aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2011-04-19 19:59:53 +0000
committerRob Austein <sra@hactrn.net>2011-04-19 19:59:53 +0000
commitb1dd6f1b77161b3e63de3c13855a97b0e4f9b2ec (patch)
treee86af4842ffcd7ff33a75e98616045c15e3c34b9
parent1d80d436b55701c3e3066d7f28e567da8dad82bb (diff)
Search /usr/local automatically on FreeBSD by default
svn path=/configure; revision=3777
-rwxr-xr-xconfigure17
-rw-r--r--configure.ac14
2 files changed, 29 insertions, 2 deletions
diff --git a/configure b/configure
index d33284d4..c449cbd6 100755
--- a/configure
+++ b/configure
@@ -692,8 +692,7 @@ CFLAGS
LDFLAGS
LIBS
CPPFLAGS
-CPP
-CPPFLAGS'
+CPP'
# Initialize some variables set by options.
@@ -2323,6 +2322,20 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+# On some platforms we want to search /usr/local for libraries unless
+# LDFLAGS and CFLAGS are set explictly by the user. At the moment we
+# just do this for FreeBSD; add other systems here as needed.
+
+if test "x${CFLAGS+set}" = "x" && test "x${LDFLAGS+set}" = "x"
+then
+ case $host_os in
+ freebsd*)
+ CFLAGS="-I/usr/local/include"
+ LDFLAGS="-L/usr/local/lib"
+ ;;
+ esac
+fi
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
diff --git a/configure.ac b/configure.ac
index 4a88fbe5..22c0f0ab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,6 +13,20 @@ AC_CONFIG_SRCDIR([rcynic/rcynic.c])
AC_CONFIG_AUX_DIR([buildtools])
AC_CANONICAL_HOST
+# On some platforms we want to search /usr/local for libraries unless
+# LDFLAGS and CFLAGS are set explictly by the user. At the moment we
+# just do this for FreeBSD; add other systems here as needed.
+
+if test "x${CFLAGS+set}" = "x" && test "x${LDFLAGS+set}" = "x"
+then
+ case $host_os in
+ freebsd*)
+ CFLAGS="-I/usr/local/include"
+ LDFLAGS="-L/usr/local/lib"
+ ;;
+ esac
+fi
+
AC_PROG_CC
AC_PROG_INSTALL