summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2023-01-17 14:09:51 -0800
committerGuy Harris <gharris@sonic.net>2023-01-17 14:09:51 -0800
commit892caaaccab56ff57bc58ff5d3996dacf290c28f (patch)
treef7473b268e72ddc91a3f750e80f74b04687515e1
parent3c7ab964eac9661098868a5202f84894f075be69 (diff)
downloadlibpcap-892caaaccab56ff57bc58ff5d3996dacf290c28f.tar.gz
configure: on Haiku, add -D_BSD_SOURCE to CFLAGS.
Treat flags required for the target platform differently from flags added for particular additional libraries.
-rwxr-xr-xconfigure17
-rw-r--r--configure.ac17
2 files changed, 24 insertions, 10 deletions
diff --git a/configure b/configure
index b0b5fc39..7ca8b034 100755
--- a/configure
+++ b/configure
@@ -3438,9 +3438,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# These are the variables that are used in Makefile, pcap-config, and
# libpcap.pc.
#
-# CFLAGS: inherited from the environment, not modified by us (except
-# temporarily during tests that involve compilation). Used only when
-# compiling C source.
+# CFLAGS: inherited from the environment, not modified by us except
+# for flags required for the platform for which we're building (and
+# except temporarily during tests that involve compilation). Used only
+# when compiling C source.
#
# CXXFLAGS: inherited from the environment, not modified by us. Used only
# when compiling C++ source.
@@ -6312,12 +6313,18 @@ then :
fi
+#
+# Check whether the platform for which we're compiling requires extra
+# defines and libraries. If so, add them to CFLAGS and LIBS, as we want
+# all subsequent tests to be done with those defines and libraries.
+3
case "$host_os" in
haiku*)
#
- # Haiku needs _BSD_SOURCE for the _IO* macros because it doesn't use them.
+ # Haiku needs _BSD_SOURCE for the _IO* macros because it doesn't
+ # use them.
#
- V_DEFS="$V_DEFS -D_BSD_SOURCE"
+ CFLAGS="$CFLAGS -D_BSD_SOURCE"
#
# Haiku has getpass in libbsd.
#
diff --git a/configure.ac b/configure.ac
index d218d025..8acc7bdf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,9 +24,10 @@ AC_SUBST(PACKAGE_NAME)
# These are the variables that are used in Makefile, pcap-config, and
# libpcap.pc.
#
-# CFLAGS: inherited from the environment, not modified by us (except
-# temporarily during tests that involve compilation). Used only when
-# compiling C source.
+# CFLAGS: inherited from the environment, not modified by us except
+# for flags required for the platform for which we're building (and
+# except temporarily during tests that involve compilation). Used only
+# when compiling C source.
#
# CXXFLAGS: inherited from the environment, not modified by us. Used only
# when compiling C++ source.
@@ -178,12 +179,18 @@ dnl
AC_CHECK_HEADERS(sys/ioccom.h sys/sockio.h)
AC_CHECK_HEADERS(netpacket/packet.h)
+#
+# Check whether the platform for which we're compiling requires extra
+# defines and libraries. If so, add them to CFLAGS and LIBS, as we want
+# all subsequent tests to be done with those defines and libraries.
+3
case "$host_os" in
haiku*)
#
- # Haiku needs _BSD_SOURCE for the _IO* macros because it doesn't use them.
+ # Haiku needs _BSD_SOURCE for the _IO* macros because it doesn't
+ # use them.
#
- V_DEFS="$V_DEFS -D_BSD_SOURCE"
+ CFLAGS="$CFLAGS -D_BSD_SOURCE"
#
# Haiku has getpass in libbsd.
#