diff options
| author | Roy Marples <roy@marples.name> | 2014-06-05 17:42:21 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2014-06-05 17:42:21 +0000 |
| commit | f3bc4056eadb2cb646c7e2116706e9a530dfb835 (patch) | |
| tree | b4d479e32def128b96acd38b4f1374b88c97ef0b /configure | |
| parent | f355e130d67507e1caf58f9324f39e6e05ce72c9 (diff) | |
| download | dhcpcd-f3bc4056eadb2cb646c7e2116706e9a530dfb835.tar.xz | |
Allow the use of libmd in static or /usr builds
Diffstat (limited to 'configure')
| -rwxr-xr-x | configure | 24 |
1 files changed, 21 insertions, 3 deletions
@@ -302,6 +302,11 @@ if [ -e "$LDELF" ]; then echo "LDFLAGS+= -Wl,-rpath=${LIBDIR}" >>$CONFIG_MK fi +if [ -z "$PREFIX" -o "$PREFIX" = / ]; then + ALLOW_USR_LIBS=false +else + ALLOW_USR_LIBS=true +fi case "$OS" in linux*|sunos*) ;; *) @@ -310,6 +315,7 @@ linux*|sunos*) ;; then echo "Forcing a static build for $OS and \$PREFIX of /" STATIC=yes + ALLOW_USR_LIBS=true fi ;; esac @@ -786,7 +792,11 @@ int main(void) { } EOF # We only want to link to libmd if it exists in /lib - set -- $(ls /lib/libmd.so.* 2>/dev/null) + if $ALLOW_USR_LIBS; then + set -- / + else + set -- $(ls /lib/libmd.so.* 2>/dev/null) + fi if $XCC _md5.c -o _md5 2>/dev/null; then MD5=yes elif [ -e "$1" ] && $XCC _md5.c -lmd -o _md5 2>/dev/null; then @@ -837,7 +847,11 @@ int main(void) { } EOF # We only want to link to libmd if it exists in /lib - set -- $(ls /lib/libmd.so.* 2>/dev/null) + if $ALLOW_USR_LIBS; then + set -- / + else + set -- $(ls /lib/libmd.so.* 2>/dev/null) + fi if $XCC _sha256.c -o _sha256 2>/dev/null; then SHA2=yes elif [ -e "$1" ] && $XCC _sha256.c -lmd -o _sha256 2>/dev/null; then @@ -864,7 +878,11 @@ int main(void) { } EOF # We only want to link to libmd if it exists in /lib - set -- $(ls /lib/libmd.so.* 2>/dev/null) + if $ALLOW_USR_LIBS; then + set -- / + else + set -- $(ls /lib/libmd.so.* 2>/dev/null) + fi if $XCC _sha256.c -o _sha256 2>/dev/null; then SHA2=yes SHA2_RENAMED=yes |
