Provide a --disable-usr-local flag to configure so that
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 9 Jan 2002 23:21:55 +0000 (23:21 +0000)
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 9 Jan 2002 23:21:55 +0000 (23:21 +0000)
-I/usr/local/include and -L/usr/local/lib aren't automatically added
to the build flags.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4507 f5534014-38df-0310-8fa8-9805f1628bb7

configure.in
wiretap/configure.in

index 975c2e8ea03c2a69d4728617e768d0b975891e2a..f7d359e535238d6c681a9642c59afe0ebe393f9c 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.143 2001/12/23 21:11:23 gerald Exp $
+# $Id: configure.in,v 1.144 2002/01/09 23:21:54 gram Exp $
 dnl
 dnl Process this file with autoconf 2.13 or later to produce a
 dnl configure script; 2.12 doesn't generate a "configure" script that
@@ -145,19 +145,32 @@ else
        esac
 fi
 
-#
-# Arrange that we search for header files in the source directory
-# and in its "wiretap" subdirectory, as well as in "/usr/local/include",
-# as various packages we use ("libpcap", "zlib", an SNMP library)
-# may have been installed under "/usr/local/include".
-#
-CFLAGS="$CFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/wiretap -I\$(top_srcdir)/epan -I/usr/local/include"
-CPPFLAGS="$CPPFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/wiretap -I\$(top_srcdir)/epan -I/usr/local/include"
+CFLAGS="$CFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/wiretap -I\$(top_srcdir)/epan"
+CPPFLAGS="$CPPFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/wiretap -I\$(top_srcdir)/epan"
 
-#
-# Arrange that we search for libraries in "/usr/local/lib".
-#
-AC_ETHEREAL_ADD_DASH_L(LDFLAGS, /usr/local/lib)
+dnl Look in /usr/local for header files and libraries ?
+AC_ARG_ENABLE(usr-local,
+[  --enable-usr-local      look for headers and libs in /usr/local tree.  [default=yes]],enable_usr_local=$enableval,enable_usr_local=yes)
+
+AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
+if test "x$enable_usr_local" = "xyes" ; then
+       AC_MSG_RESULT(yes)
+       #
+       # Arrange that we search for header files in the source directory
+       # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
+       # as various packages we use ("libpcap", "zlib", an SNMP library)
+       # may have been installed under "/usr/local/include".
+       #
+       CFLAGS="$CFLAGS -I/usr/local/include"
+       CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+
+       #
+       # Arrange that we search for libraries in "/usr/local/lib".
+       #
+       AC_ETHEREAL_ADD_DASH_L(LDFLAGS, /usr/local/lib)
+else
+       AC_MSG_RESULT(no)
+fi
 
 # Create DATAFILE_DIR #define for config.h
 DATAFILE_DIR=$sysconfdir
index 634ddb7251d624ddadcc8421152e7dd8868393c5..f309c4ae915c17f5abea7ee471742eac71c94034 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.31 2001/12/07 22:56:58 guy Exp $
+# $Id: configure.in,v 1.32 2002/01/09 23:21:55 gram Exp $
 dnl
 dnl Process this file with autoconf 2.13 or later to produce a
 dnl configure script; 2.12 doesn't generate a "configure" script that
@@ -89,32 +89,42 @@ fi
 # Check for glib.
 AM_PATH_GLIB(1.1.0, CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS")
 
-#
-# Arrange that we search for header files in "/usr/local/include",
-# as various packages we use ("libpcap", "zlib") may have been installed
-# under "/usr/local/include".
-#
-# We do this after checking for GLib, so that "-I/usr/local/include"
-# comes after any "-I" flags added by "AM_PATH_GLIB"; if the user has
-# installed a pre-1.2.9 version of GLib, it'd probably go under
-# "/usr/local", and if they then install 1.2.9 or later without
-# uninstalling the pre-1.2.9 version, 1.2.9's header files won't be
-# in "/usr/local/include" (they're put in a separate directory so that
-# GLib 1.2[.x] and 1.3[.x]/2.x can coexist), and if we search
-# "/usr/local/include" before searching the directory "AM_PATH_GLIB"
-# specifies, we may pick up headers from the older version.
-#
-CFLAGS="$CFLAGS -I/usr/local/include"
-CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+dnl Look in /usr/local for header files and libraries ?
+AC_ARG_ENABLE(usr-local,
+[  --enable-usr-local      look for headers and libs in /usr/local tree.  [default=yes]],enable_usr_local=$enableval,enable_usr_local=yes)
 
-#
-# Arrange that we search for libraries in "/usr/local/lib", as we'll
-# be testing whether zlib has gzseek, and we need to be able to find
-# zlib even if it's in "/usr/local/lib".
-#
-# We do this after checking for GLib; see above.
-#
-LDFLAGS="$LDFLAGS -L/usr/local/lib"
+AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
+if test "x$enable_usr_local" = "xyes" ; then
+       AC_MSG_RESULT(yes)
+       #
+       # Arrange that we search for header files in "/usr/local/include",
+       # as various packages we use ("libpcap", "zlib") may have been installed
+       # under "/usr/local/include".
+       #
+       # We do this after checking for GLib, so that "-I/usr/local/include"
+       # comes after any "-I" flags added by "AM_PATH_GLIB"; if the user has
+       # installed a pre-1.2.9 version of GLib, it'd probably go under
+       # "/usr/local", and if they then install 1.2.9 or later without
+       # uninstalling the pre-1.2.9 version, 1.2.9's header files won't be
+       # in "/usr/local/include" (they're put in a separate directory so that
+       # GLib 1.2[.x] and 1.3[.x]/2.x can coexist), and if we search
+       # "/usr/local/include" before searching the directory "AM_PATH_GLIB"
+       # specifies, we may pick up headers from the older version.
+       #
+       CFLAGS="$CFLAGS -I/usr/local/include"
+       CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+
+       #
+       # Arrange that we search for libraries in "/usr/local/lib", as we'll
+       # be testing whether zlib has gzseek, and we need to be able to find
+       # zlib even if it's in "/usr/local/lib".
+       #
+       # We do this after checking for GLib; see above.
+       #
+       LDFLAGS="$LDFLAGS -L/usr/local/lib"
+else
+       AC_MSG_RESULT(no)
+fi
 
 dnl Checks for header files
 AC_HEADER_STDC