From: Roy Marples Date: Mon, 3 Feb 2014 13:09:13 +0000 (+0000) Subject: Fix make import with compat sources. X-Git-Tag: v6.3.0~57 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=90ada440ecae51f1041e16e54d86f1add7d6d72f;p=thirdparty%2Fdhcpcd.git Fix make import with compat sources. Use -lmd for MD5 if available. --- diff --git a/Makefile b/Makefile index c672f235..34db686e 100644 --- a/Makefile +++ b/Makefile @@ -161,7 +161,9 @@ import: ${SRCS} sort -u) /tmp/${DISTPREFIX}; \ if test -n "${CRYPT_SRCS}"; then \ ${INSTALL} -d /tmp/${DISTPREFIX}/crypt; \ - cp crypt/${CRYPT_SRCS} /tmp/${DISTPREFIX}/crypt; \ + cp $$(echo ${CRYPT_SRCS} | tr ' ' '\n' | \ + sed -e 's:^:crypt/:g') \ + /tmp/${DISTPREFIX}/crypt; \ cp $$(cd crypt && ${CC} ${CPPFLAGS} -MM ${CRYPT_SRCS} | \ sed -e 's/^.*c //g' -e 's/.*\.c$$//g' -e 's/\\//g' | \ tr ' ' '\n' | sed -e 's:^:crypt/:g' | \ @@ -169,10 +171,10 @@ import: ${SRCS} fi; if test -n "${COMPAT_SRCS}"; then \ ${INSTALL} -d /tmp/${DISTPREFIX}/compat; \ - cp compat/${COMPAT_SRCS} /tmp/${DISTPREFIX}/compat; \ - cp $$(cd compat && ${CC} ${CPPFLAGS} -MM ${COMPAT_SRCS} | \ + cp ${COMPAT_SRCS} /tmp/${DISTPREFIX}/compat; \ + cp $$(${CC} ${CPPFLAGS} -MM ${COMPAT_SRCS} | \ sed -e 's/^.*c //g' -e 's/.*\.c$$//g' -e 's/\\//g' | \ - tr ' ' '\n' | sed -e 's:^:compat/:g' | \ + tr ' ' '\n' | \ sort -u) /tmp/${DISTPREFIX}/compat; \ fi; if test -n "${IMPORT_RCSID}"; then \ diff --git a/configure b/configure index 92cca512..e5758cdf 100755 --- a/configure +++ b/configure @@ -626,8 +626,10 @@ pselect) esac if [ -z "$MD5" ]; then + MD5_LIB= printf "Testing for MD5Init ... " cat <_md5.c +#include #include #include int main(void) { @@ -638,6 +640,9 @@ int main(void) { EOF if $XCC _md5.c -o _md5 2>/dev/null; then MD5=yes + elif $XCC _md5.c -lmd -o _md5; then + MD5="yes (-lmd)" + MD5_LIB=-lmd else MD5=no fi @@ -649,6 +654,7 @@ if [ "$MD5" = no ]; then else echo "MD5_SRC=" >>$CONFIG_MK echo "CPPFLAGS+= -DHAVE_MD5_H" >>$CONFIG_MK + [ -n "$MD5_LIB" ] && echo "LDADD+= $MD5_LIB" >>$CONFIG_MK fi if [ "$DEV" != no -a "$UDEV" != no ]; then