From: Roy Marples Date: Thu, 5 Jun 2014 17:42:21 +0000 (+0000) Subject: Allow the use of libmd in static or /usr builds X-Git-Tag: v6.4.0~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f3bc4056eadb2cb646c7e2116706e9a530dfb835;p=thirdparty%2Fdhcpcd.git Allow the use of libmd in static or /usr builds --- diff --git a/configure b/configure index 24b9098e..a25e9ca5 100755 --- a/configure +++ b/configure @@ -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