From 73d41228a94f8baedf1d0f3475b103c0e9f82590 Mon Sep 17 00:00:00 2001 From: Amos Bird Date: Wed, 9 Sep 2020 17:13:32 +0800 Subject: [PATCH] Don't force system library path When building with non-root toolchains (gentoo-prefix for instance), it confuses the toolchain to use non-existing libraries. --- configure.ac | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/configure.ac b/configure.ac index a6f1ce09..1f56a132 100644 --- a/configure.ac +++ b/configure.ac @@ -15,25 +15,27 @@ CC="$PTHREAD_CC" AX_CXX_COMPILE_STDCXX_14([noext], [mandatory]) -for defdir in /opt/local /usr/local; do - if test -d "$defdir/include"; then - CPPFLAGS="$CPPFLAGS -I$defdir/include" - fi -done - -for defdir in /opt/local /usr/local /usr /; do - - if test -d "$defdir/lib64"; then - LDFLAGS="$LDFLAGS -L$defdir/lib64" - fi - if test -d "$defdir/lib"; then - LDFLAGS="$LDFLAGS -L$defdir/lib" - fi - - if test -d "$defdir/lib/x86_64-linux-gnu"; then - LDFLAGS="$LDFLAGS -L$defdir/lib/x86_64-linux-gnu" - fi -done +if test x"${without-system-paths}" != x"yes"; then + for defdir in /opt/local /usr/local; do + if test -d "$defdir/include"; then + CPPFLAGS="$CPPFLAGS -I$defdir/include" + fi + done + + for defdir in /opt/local /usr/local /usr /; do + + if test -d "$defdir/lib64"; then + LDFLAGS="$LDFLAGS -L$defdir/lib64" + fi + if test -d "$defdir/lib"; then + LDFLAGS="$LDFLAGS -L$defdir/lib" + fi + + if test -d "$defdir/lib/x86_64-linux-gnu"; then + LDFLAGS="$LDFLAGS -L$defdir/lib/x86_64-linux-gnu" + fi + done +fi dnl abssrcdir is the absolute path to the source base (regardless of where dnl you are building it)