diff options
author | Guy Harris <gharris@sonic.net> | 2023-01-17 13:09:42 -0800 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2023-01-17 13:09:42 -0800 |
commit | 3c7ab964eac9661098868a5202f84894f075be69 (patch) | |
tree | a4b31f2259d6a8a6f5f5a402b5147289128ad879 | |
parent | 47a93b579e84e1b3c4a746acf2fc92c2ba78d9c1 (diff) | |
download | libpcap-3c7ab964eac9661098868a5202f84894f075be69.tar.gz |
configure: fix handling of Haiku -D_BSD_SOURCE and -lbsd flags.
Add -D_BSD_SOURCE to V_DEFS, as we leave CFLAGS alone and add additional
-D flags to V_DEFS.
Don't save the check state before checking for special Haiku flags, as
we'll be adding libraries to LIBS; instead, save it after we do the
check.
This ensures that -D_BSD_SOURCE is passed to the compiler and -lbsd is
passed to the linker in the resulting Makefile.
-rwxr-xr-x | configure | 12 | ||||
-rw-r--r-- | configure.ac | 4 |
2 files changed, 8 insertions, 8 deletions
@@ -6312,17 +6312,12 @@ then : fi - - save_CFLAGS="$CFLAGS" - save_LIBS="$LIBS" - save_LDFLAGS="$LDFLAGS" - case "$host_os" in haiku*) # # Haiku needs _BSD_SOURCE for the _IO* macros because it doesn't use them. # - CFLAGS="$CFLAGS -D_BSD_SOURCE" + V_DEFS="$V_DEFS -D_BSD_SOURCE" # # Haiku has getpass in libbsd. # @@ -6372,6 +6367,11 @@ fi ;; esac + + save_CFLAGS="$CFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + if test "$GCC" = yes ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ANSI ioctl definitions" >&5 printf %s "checking for ANSI ioctl definitions... " >&6; } diff --git a/configure.ac b/configure.ac index 052ae571..d218d025 100644 --- a/configure.ac +++ b/configure.ac @@ -178,13 +178,12 @@ dnl AC_CHECK_HEADERS(sys/ioccom.h sys/sockio.h) AC_CHECK_HEADERS(netpacket/packet.h) -AC_LBL_SAVE_CHECK_STATE case "$host_os" in haiku*) # # Haiku needs _BSD_SOURCE for the _IO* macros because it doesn't use them. # - CFLAGS="$CFLAGS -D_BSD_SOURCE" + V_DEFS="$V_DEFS -D_BSD_SOURCE" # # Haiku has getpass in libbsd. # @@ -192,6 +191,7 @@ haiku*) ;; esac +AC_LBL_SAVE_CHECK_STATE AC_LBL_FIXINCLUDES AC_LBL_RESTORE_CHECK_STATE |