Diff of /configure.ac.in [a40df2] .. [203fd3] Maximize Restore

  Switch to side-by-side view

--- a/configure.ac.in
+++ b/configure.ac.in
@@ -47,6 +47,31 @@
 AC_PROG_LIBTOOL
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
+
+# See whether to include shared library dependencies (taken from gtk+)
+AC_ARG_ENABLE(explicit-deps,
+  [AC_HELP_STRING([--enable-explicit-deps=@<:@yes/no/auto@:>@],
+                  [use explicit dependencies in .pc files [default=auto]])],,
+  [enable_explicit_deps=auto])
+
+AC_MSG_CHECKING([whether use explicit library dependencies])
+case $enable_explicit_deps in
+  auto)
+    export SED
+    deplibs_check_method=`(./libtool --config; echo 'eval echo $deplibs_check_method') | sh`
+    if test "x$deplibs_check_method" != xpass_all || \
+       test "x$enable_shared" = xno ; then
+      enable_explicit_deps=yes
+    else
+      enable_explicit_deps=no
+    fi
+  ;;
+  yes|no)
+  ;;
+  *) AC_MSG_ERROR([Value given to --enable-explicit-deps must be one of yes, no or auto])
+  ;;
+esac
+AC_MSG_RESULT($enable_explicit_deps)
 
 # Set default language to C++
 AC_LANG([C++])
@@ -259,7 +284,17 @@
 LDFLAGS="`echo \"$LDFLAGS\" | sed -e 's/  */ /g' -e 's/^ //' -e 's/ $//'`"
 LIBS="`echo \"$LIBS\" | sed -e 's/  */ /g' -e 's/^ //' -e 's/ $//'`"
 LDLIBS="`echo \"$LDFLAGS $LIBS\" | sed -e 's/^ //' -e 's/ $//'`"
-AC_SUBST(LDLIBS)
+
+if test $enable_explicit_deps = yes; then
+  EXPLICIT_LIBS=" $LDLIBS" # the leading space is important here...
+  PRIVATE_LIBS=""
+else
+  EXPLICIT_LIBS=""
+  PRIVATE_LIBS=" $LDLIBS" # ... and also here!
+fi
+AC_SUBST(EXPLICIT_LIBS)
+AC_SUBST(PRIVATE_LIBS)
+
 
 # Set conditional BUILD_ZDOTUSUB flag for ZDOTU Fortran wrapper
 AM_CONDITIONAL([BUILD_ZDOTUSUB],
@@ -268,6 +303,7 @@
 # Set conditionals for runing test programs
 AM_CONDITIONAL([RUN_LAPACK_TESTS], [test "x$acx_lapack_ok" = xyes])
 AM_CONDITIONAL([RUN_FFT_TESTS], [test "x$acx_fft_ok" = xyes])
+
 
 # config.h top and bottom
 AH_TOP([