From 2913df520ae8ceac46bbd6bfa958cbccb0e476bf Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 8 Nov 2023 10:10:35 +0000 Subject: [PATCH] configure: guard config.h with #ifdef CONFIG_H Rename CONFIG_H guard in defs.h to DEFS_H This avoids a redeclaration issue on DragonFly. --- configure | 7 +++++++ src/defs.h | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 646ce803..5237b0e2 100755 --- a/configure +++ b/configure @@ -263,6 +263,10 @@ echo "Configuring dhcpcd for ... $OS" rm -f $CONFIG_H $CONFIG_MK echo "# $OS" >$CONFIG_MK echo "/* $OS */" >$CONFIG_H +echo >>$CONFIG_H +echo "#ifndef CONFIG_H">>$CONFIG_H +echo "#define CONFIG_H">>$CONFIG_H +echo >>$CONFIG_H : ${SYSCONFDIR:=$PREFIX/etc} : ${SBINDIR:=$PREFIX/sbin} @@ -1918,6 +1922,9 @@ if ! $HOOKSET; then fi fi +echo >>$CONFIG_H +echo "#endif /*CONFIG_H*/">>$CONFIG_H + find_hook() { for h in [0-9][0-9]"-$x" [0-9][0-9]"-$x.in" \ diff --git a/src/defs.h b/src/defs.h index df4d3511..39d0ac1c 100644 --- a/src/defs.h +++ b/src/defs.h @@ -25,8 +25,8 @@ * SUCH DAMAGE. */ -#ifndef CONFIG_H -#define CONFIG_H +#ifndef DEFS_H +#define DEFS_H #define PACKAGE "dhcpcd" #define VERSION "10.0.4"