diff options
author | Guy Harris <guy@alum.mit.edu> | 2006-12-30 00:13:00 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2006-12-30 00:13:00 +0000 |
commit | 3c26f896308371ecb315b3b490ab80547b6c21d5 (patch) | |
tree | f1bd1eed561215823f62187f4a5ae07dc701f98d /configure.in | |
parent | 459d5f66a4a202bf06d3ca6681dbf080d9d8714b (diff) |
When building for Darwin, link with -search_paths_first, so that
--with-pcap=/usr/local will, if there's only a static libpcap in
/usr/local/lib, link with that rather than the system's dynamic version.
Move the check for Cygwin that adds -no-undefined to LDFLAGS to the
section checking for linker flags to add.
svn path=/trunk/; revision=20241
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/configure.in b/configure.in index d6bf7737e8..ba6111786c 100644 --- a/configure.in +++ b/configure.in @@ -223,14 +223,6 @@ else CFLAGS="-no-cpp-precomp $CFLAGS" AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp) ;; - cygwin*) - # - # Shared libraries in cygwin/Win32 must never contain - # undefined symbols. - # - LDFLAGS="$LDFLAGS -no-undefined" - AC_MSG_RESULT(CygWin GCC - added -no-undefined to LDFLAGS) - ;; *) AC_MSG_RESULT(none needed) ;; @@ -238,6 +230,36 @@ else fi # +# Add any platform-specific linker flags needed. +# +AC_MSG_CHECKING(for platform-specific linker flags) +case "$host_os" in +darwin*) + # + # Make sure that if we search directories A and B, in + # that order, for a given library, a non-shared version + # in directory A, rather than a shared version in + # directory B, is chosen (so we can use --with-pcap=/usr/local + # to force all programs to be linked with a static + # version installed in /usr/local/lib rather than the + # system version in /usr/lib). + LDFLAGS="-Wl,-search_paths_first $LDFLAGS" + AC_MSG_RESULT(Apple linker - added -Wl,-search_paths_first) + ;; +cygwin*) + # + # Shared libraries in cygwin/Win32 must never contain + # undefined symbols. + # + LDFLAGS="$LDFLAGS -no-undefined" + AC_MSG_RESULT(CygWin GNU ld - added -no-undefined) + ;; +*) + AC_MSG_RESULT(none needed) + ;; +esac + +# # On OS X, if we find the headers for Core Foundation and Launch Services, # add -framework options to link with Application Services (of which # Launch Services is a subframework) and Core Foundation (required by |