@@ -182,7 +182,7 @@ find_or_install()
182182 export CC=$package_install_path /bin/gcc
183183 export CXX=$package_install_path /bin/g++
184184 gfortran_lib_paths=" $package_install_path /lib64/:$package_install_path /lib"
185- if [[ -z " $LD_LIBRARY_PATH " ]]; then
185+ if [[ -z " ${ LD_LIBRARY_PATH:- } " ]]; then
186186 echo " $this_script : export LD_LIBRARY_PATH=\" $gfortran_lib_paths \" "
187187 export LD_LIBRARY_PATH=" $gfortran_lib_paths "
188188 else
@@ -421,7 +421,7 @@ find_or_install()
421421 fi
422422
423423 else
424- if [[ -z " $package " ]]; then
424+ if [[ -z " ${ package:- } " ]]; then
425425 echo -e " $this_script : empty package name passed to find_or_install function. [exit 50]\n"
426426 exit 50
427427 else
@@ -489,7 +489,7 @@ find_or_install()
489489 exit 75
490490 fi
491491 # Otherwise, if no CC has been defined yet, use the gcc in the user's PATH
492- elif [[ -z " $CC " ]]; then
492+ elif [[ -z " ${CC :- } " ]]; then
493493 CC=gcc
494494 fi
495495
@@ -503,12 +503,12 @@ find_or_install()
503503 exit 76
504504 fi
505505 # Otherwise, if no CXX has been defined yet, use the g++ in the user's PATH
506- elif [[ -z " $CXX " ]]; then
506+ elif [[ -z " ${ CXX:- } " ]]; then
507507 CXX=g++
508508 fi
509509
510510 # If no FC has been defined yet, use the gfortran in the user's PATH
511- if [[ -z " $FC " ]]; then
511+ if [[ -z " ${FC :- } " ]]; then
512512 FC=gfortran
513513 fi
514514
@@ -544,7 +544,7 @@ find_or_install()
544544 echo " $this_script : export CXX=$package_install_path /bin/g++"
545545 export CXX=" $package_install_path /bin/g++"
546546 gfortran_lib_paths=" $package_install_path /lib64/:$package_install_path /lib"
547- if [[ -z " $LD_LIBRARY_PATH " ]]; then
547+ if [[ -z " ${ LD_LIBRARY_PATH:- } " ]]; then
548548 export LD_LIBRARY_PATH=" $gfortran_lib_paths "
549549 else
550550 export LD_LIBRARY_PATH=" $gfortran_lib_paths :$LD_LIBRARY_PATH "
@@ -562,7 +562,7 @@ find_or_install()
562562 echo -e " $this_script : could prevent a complete build of OpenCoarrays. Please report this\n"
563563 echo -e " $this_script : issue at https://github.com/sourceryinstitute/opencoarrays/issues\n"
564564 fi
565- if [[ -z " $PATH " ]]; then
565+ if [[ -z " ${ PATH:- } " ]]; then
566566 export PATH=" $package_install_path /bin"
567567 else
568568 export PATH=" $package_install_path /bin:$PATH "
0 commit comments