aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac104
1 files changed, 100 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 0a0639cb..0c669d98 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,12 +32,46 @@ AC_PROG_CC_C99
if test "$ac_cv_prog_cc_c99" = "no"; then
AC_MSG_ERROR([The C compiler does not support C99])
fi
+
+#
+# Get the size of a void *, to determine whether this is a 32-bit
+# or 64-bit build.
+#
+AC_CHECK_SIZEOF([void *])
+ac_lbl_c_sizeof_void_p="$ac_cv_sizeof_void_p"
+
+#
+# We only need a C++ compiler for Haiku; all code except for its
+# pcap module is in C.
+#
case "$host_os" in
haiku*)
+ AC_PROG_CXX
+
#
- # Haiku's platform file is in C++.
+ # Make sure C and C++ have the same pointer sizes with the flags
+ # they're given; if they don't, it means that the compilers for the
+ # languages will, with those flags, not produce code that can be
+ # linked together.
#
- AC_PROG_CXX
+ # We have to use different data types, because the results of
+ # a test are cached, so if we test for the size of a given type
+ # in C, the subsequent test in C++ will use the cached variable.
+ # We trick autoconf by testing the size of a "void *" in C and a
+ # "const void *" in C++.
+ #
+ AC_LANG_PUSH([C++])
+ AC_CHECK_SIZEOF([const void *])
+ ac_lbl_cxx_sizeof_void_p="$ac_cv_sizeof_const_void_p"
+ AC_LANG_POP([C++])
+ if test "$ac_lbl_cxx_sizeof_void_p" -eq 0; then
+ AC_MSG_ERROR([No C++ compiler was found])
+ fi
+ if test "$ac_lbl_c_sizeof_void_p" -ne "$ac_lbl_cxx_sizeof_void_p"; then
+ AC_MSG_ERROR([C compiler $CC produces code with $ac_lbl_c_sizeof_void_p-byte pointers
+while C++ compiler $CXX produces code with $ac_lbl_cxx_sizeof_void_p-byte pointers. This prevents
+code in those languages from being combined.])
+ fi
;;
esac
@@ -70,6 +104,10 @@ haiku*)
# Haiku needs _BSD_SOURCE for the _IO* macros because it doesn't use them.
#
CFLAGS="$CFLAGS -D_BSD_SOURCE"
+ #
+ # Haiku has getpass in libbsd.
+ #
+ AC_CHECK_LIB(bsd, getpass)
;;
esac
@@ -720,6 +758,64 @@ PKG_PROG_PKG_CONFIG
#
AC_PATH_PROG([BREW], [brew])
+
+#
+# Solaris pkg-config is annoying. For at least one package (D-Bus, I'm
+# looking at *you*!), there are separate include files for 32-bit and
+# 64-bit builds (I guess using "unsigned long long" as a 64-bit integer
+# type on a 64-bit build is like crossing the beams or soething), and
+# there are two separate .pc files, so if we're doing a 32-bit build we
+# should make sure we look in /usr/lib/pkgconfig for .pc files and if
+# we're doing a 64-bit build we should make sure we look in
+# /usr/lib/amd64/pkgconfig for .pc files.
+#
+case "$host_os" in
+
+solaris*)
+ if test "$ac_cv_sizeof_void_p" -eq 8; then
+ #
+ # 64-bit build. If the path is empty, set it to
+ # /usr/lib/amd64/pkgconfig; otherwise, if
+ # /usr/lib/pkgconfig appears in the path, prepend
+ # /usr/lib/amd64/pkgconfig to it; otherwise, put
+ # /usr/lib/amd64/pkgconfig at the end.
+ #
+ if test -z "$PKG_CONFIG_PATH"; then
+ #
+ # Not set, or empty. Set it to
+ # /usr/lib/amd64/pkgconfig.
+ #
+ PKG_CONFIG_PATH=/usr/lib/amd64/pkgconfig
+ elif test ! -z `echo "$PKG_CONFIG_PATH" | grep "/usr/lib/pkgconfig"`; then
+ #
+ # It contains /usr/lib/pkgconfig. Prepend
+ # /usr/lib/amd64/pkgconfig to /usr/lib/pkgconfig.
+ #
+ PKG_CONFIG_PATH=`echo "$PKG_CONFIG_PATH" | sed "s;/usr/lib/pkgconfig;/usr/lib/amd64/pkgconfig:/usr/lib/pkgconfig;"`
+ else
+ #
+ # Not empty, but doesn't contain /usr/lib/pkgconfig.
+ # Append /usr/lib/amd64/pkgconfig to it.
+ #
+ PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/lib/amd64/pkgconfig"
+ fi
+ export PKG_CONFIG_PATH
+ elif test "$ac_cv_sizeof_void_p" -eq 4; then
+ #
+ # 32-bit build. If /usr/amd64/lib/pkgconfig appears
+ # in the path, prepend /usr/lib/pkgconfig to it.
+ #
+ if test ! -z `echo "$PKG_CONFIG_PATH" | grep "/usr/lib/amd64/pkgconfig"`; then
+ #
+ # It contains /usr/lib/amd64/pkgconfig. Prepend
+ # /usr/lib/pkgconfig to /usr/lib/amd64/pkgconfig.
+ #
+ PKG_CONFIG_PATH=`echo "$PKG_CONFIG_PATH" | sed "s;/usr/lib/amd64/pkgconfig;/usr/lib/pkgconfig:/usr/lib/amd64/pkgconfig;"`
+ export PKG_CONFIG_PATH
+ fi
+ fi
+esac
+
#
# Handle each capture type.
#
@@ -2221,7 +2317,7 @@ osf*)
DYEXT="so"
#
- # DEC OSF/1, a/k/a Digial UNIX, a/k/a Tru64 UNIX.
+ # DEC OSF/1, a/k/a Digital UNIX, a/k/a Tru64 UNIX.
# Use Tru64 UNIX conventions for man pages; they're the same as
# the System V conventions except that they use section 8 for
# administrative commands and daemons.
@@ -2939,7 +3035,7 @@ AC_OUTPUT_COMMANDS([if test -f .devel; then
make depend || exit 1
fi])
AC_OUTPUT(Makefile grammar.y pcap-filter.manmisc pcap-linktype.manmisc
- pcap-tstamp.manmisc pcap-savefile.manfile pcap.3pcap
+ pcap-tstamp.manmisc cbpf-savefile.manfile pcap-savefile.manfile pcap.3pcap
pcap_compile.3pcap pcap_datalink.3pcap pcap_dump_open.3pcap
pcap_get_tstamp_precision.3pcap pcap_list_datalinks.3pcap
pcap_list_tstamp_types.3pcap pcap_open_dead.3pcap