Add udunits custom install directory to rpath

Other things I tried:

1. Pass the full path of the library directly to the linker.
Doesn't work for 32-bit builds because ICG needs the 64-bit version.

2. Use -static to have the linker statically link in the library.
Doesn't work because there is no 64-bit static library on default
installs.

Fixes #525
This commit is contained in:
Derek Bankieris 2017-12-05 09:16:53 -06:00
parent 380ab024a4
commit 1682a0d3c5
2 changed files with 4 additions and 4 deletions

View File

@ -263,11 +263,11 @@ AS_IF([test "$UDUNITS_HOME" = ""],
UDUNITS_EXCLUDE=$UDUNITS_HOME
AC_CHECK_FILE([$UDUNITS_HOME/include/udunits2.h],
[UDUNITS_INCLUDES=-I$UDUNITS_HOME/include
UDUNITS_LDFLAGS="-L$UDUNITS_HOME/lib -ludunits2"
UDUNITS_LDFLAGS="-Wl,-rpath,$UDUNITS_HOME/lib -L$UDUNITS_HOME/lib -ludunits2"
],
[AC_CHECK_FILE([$UDUNITS_HOME/lib/udunits2.h],
[UDUNITS_INCLUDES=-I$UDUNITS_HOME/lib
UDUNITS_LDFLAGS="-L$UDUNITS_HOME/lib -ludunits2"
UDUNITS_LDFLAGS="-Wl,-rpath,$UDUNITS_HOME/lib -L$UDUNITS_HOME/lib -ludunits2"
],
AC_MSG_ERROR([could not find udunits2]))
]

4
configure vendored
View File

@ -6762,7 +6762,7 @@ eval ac_res=\$$as_ac_File
$as_echo "$ac_res" >&6; }
if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
UDUNITS_INCLUDES=-I$UDUNITS_HOME/include
UDUNITS_LDFLAGS="-L$UDUNITS_HOME/lib -ludunits2"
UDUNITS_LDFLAGS="-Wl,-rpath,$UDUNITS_HOME/lib -L$UDUNITS_HOME/lib -ludunits2"
else
as_ac_File=`$as_echo "ac_cv_file_$UDUNITS_HOME/lib/udunits2.h" | $as_tr_sh`
@ -6784,7 +6784,7 @@ eval ac_res=\$$as_ac_File
$as_echo "$ac_res" >&6; }
if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
UDUNITS_INCLUDES=-I$UDUNITS_HOME/lib
UDUNITS_LDFLAGS="-L$UDUNITS_HOME/lib -ludunits2"
UDUNITS_LDFLAGS="-Wl,-rpath,$UDUNITS_HOME/lib -L$UDUNITS_HOME/lib -ludunits2"
else
as_fn_error $? "could not find udunits2" "$LINENO" 5