aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-04-04 11:51:01 -0700
committerGuy Harris <guy@alum.mit.edu>2010-04-04 11:51:01 -0700
commit8416cc897b3fc7710aa719d9e20e862076696501 (patch)
tree4fb4e48f7fc0ad4e9d1efc9062d89976b1697c6f
parent814e55d4487ce3ad50fc85a48caf0a33cf49d3da (diff)
Build universal on OS X by default; add an option to disable that.
Instead of requiring the user to specify -arch options on OS X to build a universal version of libpcap, just default to universal on OS X by default. Pick the particular targets to match the way libpcap is built for the OS for which we're building.
-rw-r--r--Makefile.in5
-rwxr-xr-xconfigure44
-rw-r--r--configure.in42
3 files changed, 47 insertions, 44 deletions
diff --git a/Makefile.in b/Makefile.in
index 387792c..abcb9d6 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -51,7 +51,6 @@ INCLS = -I. @V_INCLS@
DEFS = @DEFS@ @V_DEFS@
ADDLOBJS = @ADDLOBJS@
ADDLARCHIVEOBJS = @ADDLARCHIVEOBJS@
-ARCHFLAGS = @ARCHFLAGS@
LIBS = @LIBS@
LDFLAGS = @LDFLAGS@
DYEXT = @DYEXT@
@@ -59,7 +58,7 @@ V_RPATH_OPT = @V_RPATH_OPT@
PROG=libpcap
# Standard CFLAGS
-CFLAGS = $(CCOPT) $(ARCHFLAGS) $(INCLS) $(DEFS)
+CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -376,7 +375,7 @@ libpcap.dylib: $(OBJ)
MAJOR_VER=A; \
COMPAT_VER=1; \
CURRENT_VER=`sed 's/[^0-9.].*$$//' $(srcdir)/VERSION`; \
- $(CC) $(ARCHFLAGS) -dynamiclib -undefined error $(LDFLAGS) \
+ $(CC) -dynamiclib -undefined error $(LDFLAGS) \
-o libpcap.$$VER.dylib $(OBJ) $(ADDLOBJS) $(LIBS) \
-install_name $(libdir)/libpcap.$$MAJOR_VER.dylib \
-compatibility_version $$COMPAT_VER \
diff --git a/configure b/configure
index 86c8e17..a01a022 100755
--- a/configure
+++ b/configure
@@ -671,7 +671,6 @@ CPPFLAGS
ac_ct_CC
EXEEXT
OBJEXT
-ARCHFLAGS
CPP
GREP
EGREP
@@ -1294,6 +1293,7 @@ Optional Features:
getaddrinfo available]
--enable-optimizer-dbg build optimizer debugging code
--enable-yydebug build parser debugging code
+ --disable-universal don't build universal
--enable-bluetooth enable Bluetooth support [default=yes, if support
available]
--enable-can enable CAN support [default=yes, if support
@@ -1303,7 +1303,6 @@ Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--without-gcc don't use gcc
- --with-arch-flags=FLAGS Use FLAGS to specify the target architecture(s)
--with-sita include SITA support
--with-pcap=TYPE use packet capture TYPE
--without-libnl disable libnl support [default=yes, on Linux, if
@@ -2907,21 +2906,6 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-# Check whether --with-arch-flags was given.
-if test "${with_arch_flags+set}" = set; then
- withval=$with_arch_flags;
- if test "$withval" = "yes"
- then
- { { echo "$as_me:$LINENO: error: No flags specified for --with-arch-flags" >&5
-echo "$as_me: error: No flags specified for --with-arch-flags" >&2;}
- { (exit 1); exit 1; }; }
- fi
- ARCHFLAGS="$withval"
-
-
-fi
-
-
@@ -9557,6 +9541,29 @@ echo "${ECHO_T}yes" >&6; }
darwin*)
DYEXT="dylib"
V_CCOPT="$V_CCOPT -fno-common"
+ # Check whether --enable-universal was given.
+if test "${enable_universal+set}" = set; then
+ enableval=$enable_universal;
+fi
+
+ if test "$enable_universal" != "no"; then
+ case "$host_os" in
+
+ darwin10.3*)
+ #
+ # Snow Leopard. Build for x86-64, x86, and
+ # PPC, with x86-64 first. (That's what Apple
+ # does, even though Snow Leopard doesn't
+ # run on PPC, so PPC libpcap runs under
+ # Rosetta, and Rosetta doesn't support BPF
+ # ioctls, so PPC programs can't do live
+ # captures.
+ #
+ V_CCOPT="$V_CCOPT -arch x86_64 -arch i386 -arch ppc"
+ LDFLAGS="$LDFLAGS -arch x86_64 -arch i386 -arch ppc"
+ ;;
+ esac
+ fi
;;
hpux9*)
@@ -11425,7 +11432,6 @@ CPPFLAGS!$CPPFLAGS$ac_delim
ac_ct_CC!$ac_ct_CC$ac_delim
EXEEXT!$EXEEXT$ac_delim
OBJEXT!$OBJEXT$ac_delim
-ARCHFLAGS!$ARCHFLAGS$ac_delim
CPP!$CPP$ac_delim
GREP!$GREP$ac_delim
EGREP!$EGREP$ac_delim
@@ -11461,7 +11467,7 @@ INSTALL_DATA!$INSTALL_DATA$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 91; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 90; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff --git a/configure.in b/configure.in
index 925783c..f41f0b5 100644
--- a/configure.in
+++ b/configure.in
@@ -23,28 +23,6 @@ AC_CANONICAL_SYSTEM
AC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS)
AC_PROG_CC
-dnl
-dnl Allow the user to specify flags to indicate the target architecture(s)
-dnl (yes, possibly plural - think, for example, Mac OS X) for which we're
-dnl building. Those might need to be used not only when compiling, but
-dnl also when linking and when building a shared library.
-dnl
-dnl This is not for general cross-compiling, it's for use on platforms
-dnl where versions of the native OS support more than one instruction
-dnl set and where you want to build for the OS on which you're running
-dnl but not for the default build architecture on the machine on which
-dnl you're running.
-dnl
-AC_ARG_WITH(arch-flags,
- AC_HELP_STRING([--with-arch-flags=FLAGS],[Use FLAGS to specify the target architecture(s)]),
- [
- if test "$withval" = "yes"
- then
- AC_MSG_ERROR(No flags specified for --with-arch-flags)
- fi
- ARCHFLAGS="$withval"
- AC_SUBST(ARCHFLAGS)
- ])
AC_LBL_C_INIT(V_CCOPT, V_INCLS)
AC_LBL_SHLIBS_INIT
AC_LBL_C_INLINE
@@ -1191,6 +1169,26 @@ aix*)
darwin*)
DYEXT="dylib"
V_CCOPT="$V_CCOPT -fno-common"
+ AC_ARG_ENABLE(universal,
+ AC_HELP_STRING([--disable-universal],[don't build universal]))
+ if test "$enable_universal" != "no"; then
+ case "$host_os" in
+
+ darwin10.3*)
+ #
+ # Snow Leopard. Build for x86-64, x86, and
+ # PPC, with x86-64 first. (That's what Apple
+ # does, even though Snow Leopard doesn't
+ # run on PPC, so PPC libpcap runs under
+ # Rosetta, and Rosetta doesn't support BPF
+ # ioctls, so PPC programs can't do live
+ # captures.
+ #
+ V_CCOPT="$V_CCOPT -arch x86_64 -arch i386 -arch ppc"
+ LDFLAGS="$LDFLAGS -arch x86_64 -arch i386 -arch ppc"
+ ;;
+ esac
+ fi
;;
hpux9*)