From: bangerth Date: Wed, 29 Oct 2008 17:15:48 +0000 (+0000) Subject: Remove -static from the linker flags when using static libraries. The svn log doesn... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=732494b6afcc14a0a9b99e9942369aae61662520;p=dealii-svn.git Remove -static from the linker flags when using static libraries. The svn log doesn't give much of an indication as to why it was there (Ralf commented that it was necessary but not why), but from reading through the gcc documentation I believe it has a different purpose than for example -shared: -shared needs to be given on the command line if we link object files into a shared library. On the other hand, we link into a static library using 'ar', and when we link *with* a static library we simply list it on the command line. -static, on the other hand, when given on the command line, has the effect to that a flag like -lbase should refer to libbase.a even if libbase.so is available. Since we don't really care which system libraries are being used we really have no business specifying this flag at all. The underlying reason for the change is that with the proliferation of libraries we link with there are cases where a system library is only available as a shared lib. The current case was that with MPI the compiler passes -lmpi_cxx to the linker but mpi_cxx only exists as libmpi_cxx.so and consequently the link fails. This is unnecessary since all we wanted to ensure is that the *deal.II* libraries are used in their static form. git-svn-id: https://svn.dealii.org/trunk@17397 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/configure b/deal.II/configure index cdd905b623..c2d98035a8 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -11618,14 +11618,6 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ LDFLAGS=$OLD_LDFLAGS -else - LDFLAGSSTATIC="-static" - case "$target" in - *-apple-darwin* ) - LDFLAGSSTATIC="" - ;; - esac - LDFLAGS="$LDFLAGS $LDFLAGSSTATIC" fi diff --git a/deal.II/configure.in b/deal.II/configure.in index 286b0d9fca..95511945e4 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -320,17 +320,6 @@ if test "x$enableshared" = "xyes" ; then dnl See if we can use -Wl,-soname,... for linking DEAL_II_CHECK_LINK_SONAME -else -dnl The gcc compiler needs -static for static linking. For the case -dnl other compilers do not like this flag we should introduce a -dnl LDFLAGSSTATIC variable and check -static through AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[]). - LDFLAGSSTATIC="-static" - case "$target" in - *-apple-darwin* ) - LDFLAGSSTATIC="" - ;; - esac - LDFLAGS="$LDFLAGS $LDFLAGSSTATIC" fi AC_SUBST(enableshared)