From: Roy Marples Date: Wed, 28 Aug 2019 21:41:11 +0000 (+0100) Subject: build: Fix import-src when there is no compat to import. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=933e0df9ee7ae54807608555e1d41286d4253e25;p=thirdparty%2Fdhcpcd.git build: Fix import-src when there is no compat to import. --- diff --git a/configure b/configure index 69bf4a72..fae17464 100755 --- a/configure +++ b/configure @@ -504,10 +504,18 @@ if [ -z "$AUTH" -o "$AUTH" = yes ]; then echo "Enabling Authentication" echo "CPPFLAGS+= -DAUTH" >>$CONFIG_MK echo "SRCS+= auth.c" >>$CONFIG_MK - echo "CRYPT_SRCS+= \${HMAC_SRC}" >>$CONFIG_MK + if [ -n "$HMAC_SRC" ]; then + echo "CRYPT_SRCS+= \${HMAC_SRC}" >>$CONFIG_MK + fi fi -if [ -z "$INET6" -o "$INET6" = yes -o -z "$AUTH" -o "$AUTH" = yes ]; then - echo "CRYPT_SRCS+= \${MD5_SRC} \${SHA256_SRC}" >>$CONFIG_MK +if [ -z "$INET6" ] || [ "$INET6" = yes ] || \ + [ -z "$AUTH" ] || [ "$AUTH" = yes ]; then + if [ -n "$MD5_SRC" ]; then + echo "CRYPT_SRCS+= \${MD5_SRC}" >>$CONFIG_MK + fi + if [ -n "$SHA256_SRC" ]; then + echo "CRYPT_SRCS+= \${SHA256_SRC}" >>$CONFIG_MK + fi fi echo "Using compiler .. $CC" diff --git a/src/Makefile b/src/Makefile index 7f7317d5..eccca522 100644 --- a/src/Makefile +++ b/src/Makefile @@ -141,11 +141,14 @@ _import-src: ${SRCS} cp defs.h ${SRCS} ${SRCS:.c=.h} dev.h ${MAN5}.in ${MAN8}.in ${DESTDIR}/src rm if-bsd.h if-linux.h if-sun.h rm -f ${DESTDIR}/src/if-bsd.h ${DESTDIR}/src/if-linux.h ${DESTDIR}/src/if-sun.h - ${INSTALL} -d ${DESTDIR}/compat - touch ../compat/rb.h ../compat/strtou.h - cd ..; cp ${COMPAT_SRCS} ${COMPAT_SRCS:.c=.h} ${DESTDIR}/compat - rm ../compat/rb.h ../compat/strtou.h - rm -f ${DESTDIR}/compat/rb.h ${DESTDIR}/compat/strtou.h + if [ -n "${COMPAT_SRCS}" ]; then \ + ${INSTALL} -d ${DESTDIR}/compat; \ + touch ../compat/rb.h ../compat/strtou.h; \ + cd ..; \ + cp ${COMPAT_SRCS} ${COMPAT_SRCS:.c=.h} ${DESTDIR}/compat; \ + rm ../compat/rb.h ../compat/strtou.h; \ + rm -f ${DESTDIR}/compat/rb.h ${DESTDIR}/compat/strtou.h; \ + fi if ! grep HAVE_SYS_BITOPS_H ../config.h; then \ cp ../compat/bitops.h ${DESTDIR}/compat; \ fi @@ -158,8 +161,11 @@ _import-src: ${SRCS} if [ -e ${DESTDIR}/compat/strtoi.c ]; then \ cp ../compat/_strtoi.h ${DESTDIR}/compat; \ fi - ${INSTALL} -d ${DESTDIR}/compat/crypt - cd ..; cp ${CRYPT_SRCS} ${CRYPT_SRCS:.c=.h} ${DESTDIR}/compat/crypt + if [ -n "${CRYPT_SRCS}" ]; then \ + ${INSTALL} -d ${DESTDIR}/compat/crypt; \ + cd ..; \ + cp ${CRYPT_SRCS} ${CRYPT_SRCS:.c=.h} ${DESTDIR}/compat/crypt; \ + fi # DragonFlyBSD builds base version with private crypto if [ `uname` = DragonFly ]; then rm ${DESTDIR}/compat/crypt/md5* ${DESTDIR}/compat/crypt/sha256*; fi