From: Roy Marples Date: Sun, 19 Mar 2017 20:21:18 +0000 (+0000) Subject: Move md5 and sha256 out to compat. X-Git-Tag: v7.0.0-beta1~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39c601ba435a9f61c8b6db1b4e70ec4f4a82d1e2;p=thirdparty%2Fdhcpcd.git Move md5 and sha256 out to compat. Stop using .. to find config.h. --- diff --git a/compat/arc4random_uniform.c b/compat/arc4random_uniform.c index b5975512..0f1b7b29 100644 --- a/compat/arc4random_uniform.c +++ b/compat/arc4random_uniform.c @@ -19,7 +19,7 @@ /* We need to include config.h so we pickup either the system arc4random * or our compat one. */ -#include "../config.h" +#include "config.h" /* * Calculate a uniformly distributed random number less than upper_bound diff --git a/compat/bitops.h b/compat/bitops.h index d67fa848..31979a20 100644 --- a/compat/bitops.h +++ b/compat/bitops.h @@ -33,7 +33,7 @@ #define COMPAT_BITOPS_H #include -#include "../common.h" +#include "common.h" /* * Find First Set functions diff --git a/src/crypt/md5.c b/compat/crypt/md5.c similarity index 100% rename from src/crypt/md5.c rename to compat/crypt/md5.c diff --git a/src/crypt/md5.h b/compat/crypt/md5.h similarity index 100% rename from src/crypt/md5.h rename to compat/crypt/md5.h diff --git a/src/crypt/sha256.c b/compat/crypt/sha256.c similarity index 99% rename from src/crypt/sha256.c rename to compat/crypt/sha256.c index 222d93ab..6b2007dd 100644 --- a/src/crypt/sha256.c +++ b/compat/crypt/sha256.c @@ -37,7 +37,7 @@ # endif #endif -#include "../common.h" +#include "common.h" #include "sha256.h" #if BYTE_ORDER == BIG_ENDIAN diff --git a/src/crypt/sha256.h b/compat/crypt/sha256.h similarity index 100% rename from src/crypt/sha256.h rename to compat/crypt/sha256.h diff --git a/compat/pidfile.c b/compat/pidfile.c index 20302c29..6aea468b 100644 --- a/compat/pidfile.c +++ b/compat/pidfile.c @@ -43,8 +43,8 @@ #include #include /* for flock(2) */ -#include "../config.h" -#include "../defs.h" +#include "config.h" +#include "defs.h" static pid_t pidfile_pid; static char pidfile_path[PATH_MAX]; diff --git a/compat/posix_spawn.c b/compat/posix_spawn.c index 0cb142e5..50183692 100644 --- a/compat/posix_spawn.c +++ b/compat/posix_spawn.c @@ -37,7 +37,7 @@ #include #include -#include "../common.h" +#include "common.h" #include "posix_spawn.h" #ifndef _NSIG diff --git a/configure b/configure index 236bf281..d1f647ea 100755 --- a/configure +++ b/configure @@ -1202,7 +1202,8 @@ EOF rm -f _md5.c _md5 fi if [ "$MD5" = no ]; then - echo "MD5_SRC= crypt/md5.c" >>$CONFIG_MK + echo "#include \"compat/crypt/md5.h\"" >>$CONFIG_H + echo "MD5_SRC= compat/crypt/md5.c" >>$CONFIG_MK else echo "MD5_SRC=" >>$CONFIG_MK echo "#define HAVE_MD5_H" >>$CONFIG_H @@ -1292,7 +1293,8 @@ EOF fi fi if [ "$SHA2" = no ]; then - echo "SHA256_SRC= crypt/sha256.c" >>$CONFIG_MK + echo "#include \"compat/crypt/sha256.h\"" >>$CONFIG_H + echo "SHA256_SRC= compat/crypt/sha256.c" >>$CONFIG_MK else echo "SHA256_SRC=" >>$CONFIG_MK echo "#define SHA2_H <$SHA2_H>" >>$CONFIG_H diff --git a/src/Makefile b/src/Makefile index 625b027e..30e586f3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -19,7 +19,8 @@ SRCS+= ${DHCPCD_SRCS} DHCPCD_DEFS?= dhcpcd-definitions.conf PCOMPAT_SRCS= ${COMPAT_SRCS:compat/%=${TOP}/compat/%} -OBJS+= ${SRCS:.c=.o} ${CRYPT_SRCS:.c=.o} ${PCOMPAT_SRCS:.c=.o} +PCRYPT_SRCS= ${CRYPT_SRCS:compat/%=${TOP}/compat/%} +OBJS+= ${SRCS:.c=.o} ${PCRYPT_SRCS:.c=.o} ${PCOMPAT_SRCS:.c=.o} MAN5= dhcpcd.conf.5 MAN8= dhcpcd.8 diff --git a/src/crypt/hmac_md5.c b/src/crypt/hmac_md5.c index 476bf647..4f68cb3a 100644 --- a/src/crypt/hmac_md5.c +++ b/src/crypt/hmac_md5.c @@ -28,15 +28,13 @@ #include #include +#include "config.h" #include "crypt.h" -#include "../config.h" #ifdef HAVE_MD5_H # ifndef DEPGEN # include # endif -#else -# include "md5.h" #endif #define HMAC_PAD_LEN 64 diff --git a/src/ipv6.c b/src/ipv6.c index a25fddef..6b1a529d 100644 --- a/src/ipv6.c +++ b/src/ipv6.c @@ -72,14 +72,10 @@ # ifndef DEPGEN # include # endif -#else -# include "md5.h" #endif #ifdef SHA2_H # include SHA2_H -#else -# include "sha256.h" #endif #ifndef SHA256_DIGEST_LENGTH