]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Build universal on OS X by default; add an option to disable that.
authorGuy Harris <[email protected]>
Sun, 4 Apr 2010 19:08:11 +0000 (12:08 -0700)
committerGuy Harris <[email protected]>
Sun, 4 Apr 2010 19:08:11 +0000 (12:08 -0700)
Instead of requiring the user to specify -arch options on OS X to build
a universal version of tcpdump, just default to universal on OS X by
default.  Pick the particular targets to match the way tcpdump is built
for the OS for which we're building.

Makefile.in
configure
configure.in

index c4cb1aa5960a96b8a19bdac2dd2958197089ac74..8e7b73b4cf6aac72481cd86c807d0216aadc0971 100644 (file)
@@ -44,10 +44,9 @@ PROG = tcpdump
 CCOPT = @V_CCOPT@
 INCLS = -I. @V_INCLS@
 DEFS = @DEFS@ @CPPFLAGS@ @V_DEFS@
-ARCHFLAGS = @ARCHFLAGS@
 
 # Standard CFLAGS
-CFLAGS = $(CCOPT) $(ARCHFLAGS) $(DEFS) $(INCLS)
+CFLAGS = $(CCOPT) $(DEFS) $(INCLS)
 
 # Standard LDFLAGS
 LDFLAGS = @LDFLAGS@
index cf6854134642bbc415d57c2fc7a8661d4f33d01f..28060a86d220f7d3f1c6ec88bbbd05ea112cb575 100755 (executable)
--- a/configure
+++ b/configure
@@ -667,7 +667,6 @@ CPPFLAGS
 ac_ct_CC
 EXEEXT
 OBJEXT
-ARCHFLAGS
 CPP
 GREP
 EGREP
@@ -1268,6 +1267,7 @@ if test -n "$ac_init_help"; then
 Optional Features:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-universal     don't build universal on OS X
   --enable-smb            enable possibly-buggy SMB printer default=yes
   --disable-smb           disable possibly-buggy SMB printer
   --enable-ipv6           enable ipv6 (with ipv4) support
@@ -1277,7 +1277,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-smi              link with libsmi (allows to load MIBs on the fly to decode SNMP packets. default=yes
   --without-smi           don't link with libsmi
   --with-user=USERNAME    drop privileges by default to USERNAME
@@ -2826,21 +2825,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
-
-
 
 
 
@@ -4404,6 +4388,27 @@ fi
 
 case "$host_os" in
 
+darwin*)
+       # 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 and x86, with
+                       # x86-64 first.  (That's what Apple does.)
+                       #
+                       V_CCOPT="$V_CCOPT -arch x86_64 -arch i386"
+                       LDFLAGS="$LDFLAGS -arch x86_64 -arch i386"
+                       ;;
+               esac
+       fi
+       ;;
+
 linux*)
        { echo "$as_me:$LINENO: checking Linux kernel version" >&5
 echo $ECHO_N "checking Linux kernel version... $ECHO_C" >&6; }
@@ -14899,7 +14904,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
@@ -14920,7 +14924,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` = 72; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 71; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
index 1a8c4a17c39986d12710855ed1f6a56062009845..0a475086102e04918f5ad61eadeccbee7bf5e908 100644 (file)
@@ -23,28 +23,6 @@ AC_CANONICAL_HOST
 
 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_C_INLINE
 AC_C___ATTRIBUTE__
@@ -82,6 +60,24 @@ AC_HEADER_TIME
 
 case "$host_os" in
 
+darwin*)
+       AC_ARG_ENABLE(universal,
+       AC_HELP_STRING([--disable-universal],[don't build universal on OS X]))
+       if test "$enable_universal" != "no"; then
+               case "$host_os" in
+
+               darwin10.3*)
+                       #
+                       # Snow Leopard.  Build for x86-64 and x86, with
+                       # x86-64 first.  (That's what Apple does.)
+                       #
+                       V_CCOPT="$V_CCOPT -arch x86_64 -arch i386"
+                       LDFLAGS="$LDFLAGS -arch x86_64 -arch i386"
+                       ;;
+               esac
+       fi
+       ;;
+
 linux*)
        AC_MSG_CHECKING(Linux kernel version)
        if test "$cross_compiling" = yes; then