Skip to content

Commit

Permalink
Merge pull request #586 from PCMDI/545_udunits2_include_dir
Browse files Browse the repository at this point in the history
Check if the path 'include/udunits2' exists for udunits2 include path
  • Loading branch information
mauzey1 authored Jan 5, 2022
2 parents 0dc79d8 + e30b9ba commit df7fc34
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
24 changes: 23 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -4170,7 +4170,29 @@ fi

if test x${with_udunits2} != xyes ; then
if test x${with_udunits2} != xno ; then
UDUNITS2FLAGS=" -I${with_udunits2}/include"
as_ac_File=`$as_echo "ac_cv_file_${with_udunits2}/include/udunits2/udunits2.h" | $as_tr_sh`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${with_udunits2}/include/udunits2/udunits2.h" >&5
$as_echo_n "checking for ${with_udunits2}/include/udunits2/udunits2.h... " >&6; }
if eval \${$as_ac_File+:} false; then :
$as_echo_n "(cached) " >&6
else
test "$cross_compiling" = yes &&
as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
if test -r "${with_udunits2}/include/udunits2/udunits2.h"; then
eval "$as_ac_File=yes"
else
eval "$as_ac_File=no"
fi
fi
eval ac_res=\$$as_ac_File
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
UDUNITS2FLAGS=" -I${with_udunits2}/include/udunits2"
else
UDUNITS2FLAGS=" -I${with_udunits2}/include"
fi

if test ${RTAG} != "none" ; then
UDUNITS2LDFLAGS=" -L${with_udunits2}/lib ${RTAG}${with_udunits2}/lib -ludunits2 -lexpat"
else
Expand Down
4 changes: 3 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ LIBS=""
AC_ARG_WITH([udunits2],[AS_HELP_STRING([--with-udunits2],[enable support for udunits2 in none standard location])],[],[with_udunits2="no"])
if [ test x${with_udunits2} != xyes ] ; then
if [ test x${with_udunits2} != xno ] ; then
UDUNITS2FLAGS=" -I${with_udunits2}/include"
AC_CHECK_FILE(${with_udunits2}/include/udunits2/udunits2.h,
[UDUNITS2FLAGS=" -I${with_udunits2}/include/udunits2"],
[UDUNITS2FLAGS=" -I${with_udunits2}/include"])
if [ test ${RTAG} != "none" ] ; then
UDUNITS2LDFLAGS=" -L${with_udunits2}/lib ${RTAG}${with_udunits2}/lib -ludunits2 -lexpat"
else
Expand Down

0 comments on commit df7fc34

Please sign in to comment.