]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix make import with compat sources.
authorRoy Marples <roy@marples.name>
Mon, 3 Feb 2014 13:09:13 +0000 (13:09 +0000)
committerRoy Marples <roy@marples.name>
Mon, 3 Feb 2014 13:09:13 +0000 (13:09 +0000)
Use -lmd for MD5 if available.

Makefile
configure

index c672f235b124613f9e3889d302f34db97db2a42b..34db686e47c117c785ff7bd923b276192c831921 100644 (file)
--- 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 \
index 92cca512d18a159bd0b373f3ac375750022c5c13..e5758cdfdaea628a67c521ee6f8cb4fa9f5edaf8 100755 (executable)
--- a/configure
+++ b/configure
@@ -626,8 +626,10 @@ pselect)
 esac
 
 if [ -z "$MD5" ]; then
+       MD5_LIB=
        printf "Testing for MD5Init ... "
        cat <<EOF >_md5.c
+#include <sys/types.h>
 #include <md5.h>
 #include <stdlib.h>
 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