From bfb26d44966fe3ef23fd42f7a0691196d57df461 Mon Sep 17 00:00:00 2001 From: Matthias Krack Date: Fri, 29 Mar 2024 07:35:19 +0100 Subject: [PATCH] Check first if file exists --- tools/toolchain/scripts/stage7/install_hdf5.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/toolchain/scripts/stage7/install_hdf5.sh b/tools/toolchain/scripts/stage7/install_hdf5.sh index c46a33c129..c5a4828cee 100755 --- a/tools/toolchain/scripts/stage7/install_hdf5.sh +++ b/tools/toolchain/scripts/stage7/install_hdf5.sh @@ -79,8 +79,10 @@ if [ "${with_hdf5}" != "__DONTUSE__" ]; then else HDF5_LIBS="-lhdf5_fortran -lhdf5_f90cstub -lhdf5 -lz" fi - if [ -n "$(grep libsz ${pkg_install_dir}/lib/pkgconfig/hdf5.pc)" ]; then - HDF5_LIBS="${HDF5_LIBS} -lsz" + if [ -f "${pkg_install_dir}/lib/pkgconfig/hdf5.pc" ]; then + if [ -n "$(grep libsz ${pkg_install_dir}/lib/pkgconfig/hdf5.pc)" ]; then + HDF5_LIBS="${HDF5_LIBS} -lsz" + fi fi if [ "${with_hdf5}" != "__SYSTEM__" ]; then cat << EOF > "${BUILDDIR}/setup_hdf5"