]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Define a macro to include spawn.h or compat/spawn.h instead of forcing it in.
authorRoy Marples <roy@marples.name>
Wed, 23 Apr 2014 09:43:30 +0000 (09:43 +0000)
committerRoy Marples <roy@marples.name>
Wed, 23 Apr 2014 09:43:30 +0000 (09:43 +0000)
configure
script.c

index 7b3975dc02a2d116630fa01dcbe0238c0f66b99a..8d751877fce1a51577fd1e493fb113d3b3591e9d 100755 (executable)
--- a/configure
+++ b/configure
@@ -526,7 +526,7 @@ EOF
 fi
 if [ "$STRLCPY" = no ]; then
        echo "COMPAT_SRCS+=     compat/strlcpy.c" >>$CONFIG_MK
-       echo "#include \"compat/strlcpy.h\"" >>$CONFIG_H
+       echo "#include          \"compat/strlcpy.h\"" >>$CONFIG_H
 fi
 
 if [ -z "$TAILQ_FOREACH_SAFE" ]; then
@@ -594,9 +594,8 @@ EOF
 fi
 if [ "$POSIX_SPAWN" = no ]; then
        echo "COMPAT_SRCS+=     compat/posix_spawn.c" >>$CONFIG_MK
-       echo "#include \"compat/posix_spawn.h\"" >>$CONFIG_H
 else
-       echo "#include <spawn.h>" >>$CONFIG_H
+       echo "#define HAVE_SPAWN_H" >>$CONFIG_H
 fi
 
 if [ -z "$POLLTS" ]; then
@@ -661,15 +660,15 @@ case "$POLLTS" in
 yes)
        ;;
 ppoll)
-       echo "#define pollts ppoll" >>$CONFIG_H
+       echo "#define pollts    ppoll" >>$CONFIG_H
        ;;
 pselect)
        echo "COMPAT_SRCS+=     compat/pselect.c" >>$CONFIG_MK
-       echo "#include \"compat/pollts.h\"" >>$CONFIG_H
+       echo "#include          \"compat/pollts.h\"" >>$CONFIG_H
        ;;
 *)
        echo "COMPAT_SRCS+=     compat/pollts.c" >>$CONFIG_MK
-       echo "#include \"compat/pollts.h\"" >>$CONFIG_H
+       echo "#include          \"compat/pollts.h\"" >>$CONFIG_H
        ;;
 esac
 
index 3ee71d21c2099488637bb900f68e8391ac635c32..cbcf68c7a45da631f4d4a3577d42a7e765696d08 100644 (file)
--- a/script.c
+++ b/script.c
 #include "net.h"
 #include "script.h"
 
+#ifdef HAVE_SPAWN_H
+#include <spawn.h>
+#else
+#include "compat/posix_spawn.h"
+#endif
+
 #define DEFAULT_PATH   "PATH=/usr/bin:/usr/sbin:/bin:/sbin"
 
 static const char * const if_params[] = {