From 3e87cd395b626f5573fcc7520ad2eaf9f83b1bce Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 19 Jan 2010 16:53:12 +0000 Subject: [PATCH] Also encode the library path through -rpath when linking with static libs, since we also link with the TBB and that one is always shared. git-svn-id: https://svn.dealii.org/trunk@20388 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/configure | 61 ++++++++++++++++++++++---------------------- deal.II/configure.in | 9 ++++--- 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/deal.II/configure b/deal.II/configure index a8570ce13a..a491665ea9 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -12785,10 +12785,11 @@ _ACEOF ;; esac - OLD_LDFLAGS="$LDFLAGS" - LDFLAGS="-Wl,-rpath,$DEAL_II_PATH/lib $LDFLAGS" - { $as_echo "$as_me:$LINENO: checking whether compiler understands option -Wl,-rpath" >&5 -$as_echo_n "checking whether compiler understands option -Wl,-rpath... " >&6; } + + OLD_LDFLAGS="$LDFLAGS" + LDFLAGS="-Wl,-soname,libbase.so.6.2.1 $LDFLAGS $LDFLAGSPIC $SHLIBFLAGS" + { $as_echo "$as_me:$LINENO: checking whether compiler understands option -Wl,-soname" >&5 +$as_echo_n "checking whether compiler understands option -Wl,-soname... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -12825,29 +12826,33 @@ $as_echo "$ac_try_echo") >&5 test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + + { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } - LD_PATH_OPTION="-Wl,-rpath " + DEAL_II_LD_UNDERSTANDS_SONAME="yes" + else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 + + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } - LDFLAGS="$OLD_LDFLAGS" - LD_PATH_OPTION="no" + DEAL_II_LD_UNDERSTANDS_SONAME="no" + + fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext - + LDFLAGS="$OLD_LDFLAGS" OLD_LDFLAGS="$LDFLAGS" - LDFLAGS="-Wl,-soname,libbase.so.6.2.1 $LDFLAGS $LDFLAGSPIC $SHLIBFLAGS" - { $as_echo "$as_me:$LINENO: checking whether compiler understands option -Wl,-soname" >&5 -$as_echo_n "checking whether compiler understands option -Wl,-soname... " >&6; } + LDFLAGS="-Wl,-dynamic,-install_name -Wl,libbase.so.6.2.1 $LDFLAGS -shared" + { $as_echo "$as_me:$LINENO: checking whether compiler understands option -Wl,-dynamic,-install_name" >&5 +$as_echo_n "checking whether compiler understands option -Wl,-dynamic,-install_name... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -12887,7 +12892,7 @@ $as_echo "$ac_try_echo") >&5 { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } - DEAL_II_LD_UNDERSTANDS_SONAME="yes" + DEAL_II_LD_UNDERSTANDS_DYLIB_INSTALL_NAME="yes" else $as_echo "$as_me: failed program was:" >&5 @@ -12896,7 +12901,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } - DEAL_II_LD_UNDERSTANDS_SONAME="no" + DEAL_II_LD_UNDERSTANDS_DYLIB_INSTALL_NAME="no" fi @@ -12907,10 +12912,12 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ LDFLAGS="$OLD_LDFLAGS" - OLD_LDFLAGS="$LDFLAGS" - LDFLAGS="-Wl,-dynamic,-install_name -Wl,libbase.so.6.2.1 $LDFLAGS -shared" - { $as_echo "$as_me:$LINENO: checking whether compiler understands option -Wl,-dynamic,-install_name" >&5 -$as_echo_n "checking whether compiler understands option -Wl,-dynamic,-install_name... " >&6; } +fi + + OLD_LDFLAGS="$LDFLAGS" + LDFLAGS="-Wl,-rpath,$DEAL_II_PATH/lib $LDFLAGS" + { $as_echo "$as_me:$LINENO: checking whether compiler understands option -Wl,-rpath" >&5 +$as_echo_n "checking whether compiler understands option -Wl,-rpath... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -12947,30 +12954,24 @@ $as_echo "$ac_try_echo") >&5 test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then - - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } - DEAL_II_LD_UNDERSTANDS_DYLIB_INSTALL_NAME="yes" - + LD_PATH_OPTION="-Wl,-rpath " else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } - DEAL_II_LD_UNDERSTANDS_DYLIB_INSTALL_NAME="no" - - + LDFLAGS="$OLD_LDFLAGS" + LD_PATH_OPTION="no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$OLD_LDFLAGS" -fi diff --git a/deal.II/configure.in b/deal.II/configure.in index 909d12222e..1f1dece019 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -317,13 +317,16 @@ if test "x$enableshared" = "xyes" ; then ;; esac - dnl Check if the linker supports -rpath - DEAL_II_CHECK_RPATH - dnl See if we can use -Wl,-soname,... for linking DEAL_II_CHECK_LINK_SONAME fi +dnl Check if the linker supports -rpath. Do so independently whether we +dnl actually build deal.II as shared libs since, for example, the TBB +dnl library is always shared +DEAL_II_CHECK_RPATH + + AC_SUBST(enableshared) AC_SUBST(static_lib_suffix) AC_SUBST(shared_lib_suffix) -- 2.39.5