From 20ed12d6fd1ca50ae629212cfa399635e52de581 Mon Sep 17 00:00:00 2001 From: Kaito Udagawa Date: Fri, 25 Nov 2016 03:11:36 +0900 Subject: [PATCH] Do not force include and library dir in configure Forcing the include and library path is not good when the user has a multiple prefix (e.g. /opt/local and /usr/local) for some reason. This situation is typical for macOS (MacPorts and Homebrew). By this change, user-specified ones are prefered over guessed prefixes. This behavior is more straightforward because the user can have the control of what header and library is to be linked. --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index e7f2b29..4f09d3a 100644 --- a/configure.ac +++ b/configure.ac @@ -34,11 +34,11 @@ ACX_PTHREAD() if test x"${cross_compiling}" = "xno" ; then # Bring additional directories where things might be found into our # search path. I don't know why autoconf doesn't do this by default - for spfx in /usr/local /opt/local /sw ${prefix} ; do + for spfx in ${prefix} /sw /opt/local /usr/local ; do AC_MSG_NOTICE([checking ${spfx}/include]) if test -d ${spfx}/include; then - CPPFLAGS="-I${spfx}/include $CPPFLAGS" - LDFLAGS="-L${spfx}/lib $LDFLAGS" + CPPFLAGS="$CPPFLAGS -I${spfx}/include" + LDFLAGS="$LDFLAGS -L${spfx}/lib" AC_MSG_NOTICE([ *** ADDING ${spfx}/include to CPPFLAGS *** ]) AC_MSG_NOTICE([ *** ADDING ${spfx}/lib to LDFLAGS *** ]) fi