dect
/
libpcap
Archived
13
0
Fork 0

Add a --with-arch-flags configuration option to specify target architectures.

They allow the user to specify flags to indicate the target
architecture(s) (yes, possibly plural - think, for example, Mac OS X)
for which we're building.  Those might need to be used not only when
compiling, but also when linking and when building a shared library.

This is not for general cross-compiling, it's for use on platforms where
versions of the native OS support more than one instruction set and
where you want to build for the OS on which you're running but not for
the default build architecture on the machine on which you're running.
This commit is contained in:
Guy Harris 2010-03-31 17:22:33 -07:00
parent d270319b2c
commit dbf3bd4597
3 changed files with 44 additions and 3 deletions

View File

@ -51,6 +51,7 @@ INCLS = -I. @V_INCLS@
DEFS = @DEFS@ @V_DEFS@
ADDLOBJS = @ADDLOBJS@
ADDLARCHIVEOBJS = @ADDLARCHIVEOBJS@
ARCHFLAGS = @ARCHFLAGS@
LIBS = @LIBS@
LDFLAGS = @LDFLAGS@
DYEXT = @DYEXT@
@ -58,7 +59,7 @@ V_RPATH_OPT = @V_RPATH_OPT@
PROG=libpcap
# Standard CFLAGS
CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
CFLAGS = $(CCOPT) $(ARCHFLAGS) $(INCLS) $(DEFS)
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@ -375,7 +376,7 @@ libpcap.dylib: $(OBJ)
MAJOR_VER=A; \
COMPAT_VER=1; \
CURRENT_VER=`sed 's/[^0-9.].*$$//' $(srcdir)/VERSION`; \
$(CC) -dynamiclib -undefined error $(LDFLAGS) \
$(CC) $(ARCHFLAGS) -dynamiclib -undefined error $(LDFLAGS) \
-o libpcap.$$VER.dylib $(OBJ) $(ADDLOBJS) $(LIBS) \
-install_name $(libdir)/libpcap.$$MAJOR_VER.dylib \
-compatibility_version $$COMPAT_VER \

20
configure vendored
View File

@ -671,6 +671,7 @@ CPPFLAGS
ac_ct_CC
EXEEXT
OBJEXT
ARCHFLAGS
CPP
GREP
EGREP
@ -1302,6 +1303,7 @@ 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
@ -2905,6 +2907,21 @@ 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
@ -11408,6 +11425,7 @@ 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
@ -11443,7 +11461,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` = 90; then
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 91; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

View File

@ -23,6 +23,28 @@ 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