From 05347280c30e327bc3ce0d593a190746cfa4a944 Mon Sep 17 00:00:00 2001 From: bangerth Date: Thu, 9 Oct 2008 20:28:02 +0000 Subject: [PATCH] Replace -soname by a generic way that also works for MAC OS X. git-svn-id: https://svn.dealii.org/trunk@17154 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/aclocal.m4 | 49 +++++++++ deal.II/base/Makefile | 8 +- deal.II/common/Make.global_options.in | 15 ++- deal.II/configure | 146 +++++++++++++++++++++++--- deal.II/configure.in | 28 ++--- deal.II/contrib/hsl/Makefile | 8 +- deal.II/deal.II/Makefile | 24 ++--- deal.II/lac/Makefile | 8 +- deal.II/lib/Makefile | 10 +- 9 files changed, 231 insertions(+), 65 deletions(-) diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index 416d17415b..51018b8a91 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -1702,6 +1702,55 @@ AC_DEFUN(DEAL_II_CHECK_RPATH, ]) + +dnl ------------------------------------------------------------- +dnl +dnl Check whether we can use -soname for linking in the shared +dnl library version. On Mac OS X, -soname is called +dnl -dylib_install_name +dnl +dnl ------------------------------------------------------------- +AC_DEFUN(DEAL_II_CHECK_LINK_SONAME, +[ + dnl First try -soname + OLD_LDFLAGS=$LDFLAGS + LDFLAGS="-Wl,-soname,libbase.so.6.2.1 $LDFLAGS" + AC_MSG_CHECKING([whether compiler understands option -Wl,-soname]) + AC_LINK_IFELSE( + [ AC_LANG_PROGRAM([[]],[[]])], + [ + AC_MSG_RESULT(yes) + DEAL_II_LD_UNDERSTANDS_SONAME="yes" + ], + [ + AC_MSG_RESULT(no) + DEAL_II_LD_UNDERSTANDS_SONAME="no" + ] + ) + LDFLAGS=$OLD_LDFLAGS + AC_SUBST(DEAL_II_LD_UNDERSTANDS_SONAME) + + dnl Now try the -dylib_install_name thing + OLD_LDFLAGS=$LDFLAGS + LDFLAGS="-Wl,-dylib_install_name -Wl,libbase.so.6.2.1 $LDFLAGS" + AC_MSG_CHECKING([whether compiler understands option -Wl,-dylib_install_name]) + AC_LINK_IFELSE( + [ AC_LANG_PROGRAM([[]],[[]])], + [ + AC_MSG_RESULT(yes) + DEAL_II_LD_UNDERSTANDS_DYLIB_INSTALL_NAME="yes" + ], + [ + AC_MSG_RESULT(no) + DEAL_II_LD_UNDERSTANDS_DYLIB_INSTALL_NAME="no" + ] + ) + LDFLAGS=$OLD_LDFLAGS + AC_SUBST(DEAL_II_LD_UNDERSTANDS_DYLIB_INSTALL_NAME) +]) + + + dnl ------------------------------------------------------------- dnl Check whether user wants optimization for a certain type of dnl CPU. If so, then set some flags, dependent on what he diff --git a/deal.II/base/Makefile b/deal.II/base/Makefile index ce91c3d21c..292bb89412 100644 --- a/deal.II/base/Makefile +++ b/deal.II/base/Makefile @@ -78,13 +78,13 @@ $(LIBDIR)/libbase.g$(static-lib-suffix): $(go-files) $(LIBDIR)/libbase$(shared-lib-suffix): $(o-files) @echo "=====base=============optimized==$(MT)== Linking library: $(@F)" - @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/libbase$(shared-lib-suffix).$(DEAL_II_VERSION) -Wl,-soname,libbase$(shared-lib-suffix).$(DEAL_II_VERSION) $(o-files) $(extra-o-files) $(deplibs.o) - @ln -f -s libbase$(shared-lib-suffix).$(DEAL_II_VERSION) $@ + @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,base) $(call DEAL_II_ADD_SONAME,base) $(o-files) $(extra-o-files) $(deplibs.o) + @ln -f -s $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,base) $@ $(LIBDIR)/libbase.g$(shared-lib-suffix): $(go-files) @echo "=====base=============debug======$(MT)== Linking library: $(@F)" - @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/libbase.g$(shared-lib-suffix).$(DEAL_II_VERSION) -Wl,-soname,libbase.g$(shared-lib-suffix).$(DEAL_II_VERSION) $(go-files) $(extra-o-files) $(deplibs.g) - @ln -f -s libbase.g$(shared-lib-suffix).$(DEAL_II_VERSION) $@ + @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,base.g) $(call DEAL_II_ADD_SONAME,base.g) $(go-files) $(extra-o-files) $(deplibs.g) + @ln -f -s $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,base.g) $@ diff --git a/deal.II/common/Make.global_options.in b/deal.II/common/Make.global_options.in index 941acb199c..14a560f88c 100644 --- a/deal.II/common/Make.global_options.in +++ b/deal.II/common/Make.global_options.in @@ -68,7 +68,7 @@ USE_CONTRIB_UMFPACK = @USE_CONTRIB_UMFPACK@ TARGET = @target@ ###################################################### -# now configuration for compiler flags, pathes, etc +# now configuration for compiler flags, paths, etc # path for libraries @@ -109,6 +109,19 @@ lib-deal2-1d.g = $(LIBDIR)/libdeal_II_1d.g$(lib-suffix) lib-deal2-2d.g = $(LIBDIR)/libdeal_II_2d.g$(lib-suffix) lib-deal2-3d.g = $(LIBDIR)/libdeal_II_3d.g$(lib-suffix) +# dealing with shared libraries +DEAL_II_SHLIB_NAME = lib$(1)$(shared-lib-suffix).$(DEAL_II_VERSION) + +ifeq (@DEAL_II_LD_UNDERSTANDS_SONAME@,yes) + DEAL_II_ADD_SONAME = -Wl,-soname,$(call DEAL_II_SHLIB_NAME,$(1)) +else + ifeq (@DEAL_II_LD_UNDERSTANDS_SONAME@,yes) + DEAL_II_ADD_SONAME = -Wl,-dylib_install_name -Wl,$(call DEAL_II_SHLIB_NAME,$(1)) + else + DEAL_II_ADD_SONAME = + endif +endif + # since the PETSc libs are called the same for both debug and # optimized mode, we have to have a trick to let the executable # know which ones are the right (since apparently LD_LIBRARY_PATH diff --git a/deal.II/configure b/deal.II/configure index 31f494c088..fa328cb05b 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -703,6 +703,8 @@ F77FLAGSO F77FLAGSG F77FLAGSPIC F77LIBS +DEAL_II_LD_UNDERSTANDS_SONAME +DEAL_II_LD_UNDERSTANDS_DYLIB_INSTALL_NAME enableshared static_lib_suffix shared_lib_suffix @@ -11430,35 +11432,26 @@ else fi - - -shared_lib_suffix=".so" -static_lib_suffix=".a" - case "$target" in *-aix4* | alpha*-linux* | alpha*-osf45* | hppa64-unknown-linux-gnu ) { echo "$as_me:$LINENO: WARNING: Shared libraries not supported on $target. Using static libs instead" >&5 echo "$as_me: WARNING: Shared libraries not supported on $target. Using static libs instead" >&2;} enableshared=no ;; -esac - -case "$target" in *cygwin ) shared_lib_suffix=".dll" cygwin_shared_lib="yes" ;; -esac - - -case "$target" in *-apple-darwin* ) shared_lib_suffix=".dylib" darwin_shared_lib="yes" ;; + * ) + shared_lib_suffix=".so" + static_lib_suffix=".a" + ;; esac - if test "x$enableshared" = "xyes" ; then CFLAGS="$CFLAGS $CFLAGSPIC" CXXFLAGSG="$CXXFLAGSG $CXXFLAGSPIC" @@ -11473,6 +11466,125 @@ if test "x$enableshared" = "xyes" ; then ;; esac + + OLD_LDFLAGS=$LDFLAGS + LDFLAGS="-Wl,-soname,libbase.so.6.2.1 $LDFLAGS" + { echo "$as_me:$LINENO: checking whether compiler understands option -Wl,-soname" >&5 +echo $ECHO_N "checking whether compiler understands option -Wl,-soname... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + DEAL_II_LD_UNDERSTANDS_SONAME="yes" + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + DEAL_II_LD_UNDERSTANDS_SONAME="no" + + +fi + +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,-dylib_install_name -Wl,libbase.so.6.2.1 $LDFLAGS" + { echo "$as_me:$LINENO: checking whether compiler understands option -Wl,-dylib_install_name" >&5 +echo $ECHO_N "checking whether compiler understands option -Wl,-dylib_install_name... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + DEAL_II_LD_UNDERSTANDS_DYLIB_INSTALL_NAME="yes" + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + DEAL_II_LD_UNDERSTANDS_DYLIB_INSTALL_NAME="no" + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$OLD_LDFLAGS + + else LDFLAGSSTATIC="-static" case "$target" in @@ -15043,6 +15155,8 @@ F77FLAGSO!$F77FLAGSO$ac_delim F77FLAGSG!$F77FLAGSG$ac_delim F77FLAGSPIC!$F77FLAGSPIC$ac_delim F77LIBS!$F77LIBS$ac_delim +DEAL_II_LD_UNDERSTANDS_SONAME!$DEAL_II_LD_UNDERSTANDS_SONAME$ac_delim +DEAL_II_LD_UNDERSTANDS_DYLIB_INSTALL_NAME!$DEAL_II_LD_UNDERSTANDS_DYLIB_INSTALL_NAME$ac_delim enableshared!$enableshared$ac_delim static_lib_suffix!$static_lib_suffix$ac_delim shared_lib_suffix!$shared_lib_suffix$ac_delim @@ -15053,8 +15167,6 @@ DEAL_II_DISABLE_PARSER!$DEAL_II_DISABLE_PARSER$ac_delim DEAL_II_EXPAND_PETSC_VECTOR!$DEAL_II_EXPAND_PETSC_VECTOR$ac_delim DEAL_II_EXPAND_PETSC_BLOCKVECTOR!$DEAL_II_EXPAND_PETSC_BLOCKVECTOR$ac_delim USE_CONTRIB_PETSC!$USE_CONTRIB_PETSC$ac_delim -DEAL_II_PETSC_DIR!$DEAL_II_PETSC_DIR$ac_delim -DEAL_II_PETSC_ARCH!$DEAL_II_PETSC_ARCH$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -15096,6 +15208,8 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +DEAL_II_PETSC_DIR!$DEAL_II_PETSC_DIR$ac_delim +DEAL_II_PETSC_ARCH!$DEAL_II_PETSC_ARCH$ac_delim DEAL_II_PETSC_VERSION_MAJOR!$DEAL_II_PETSC_VERSION_MAJOR$ac_delim DEAL_II_PETSC_VERSION_MINOR!$DEAL_II_PETSC_VERSION_MINOR$ac_delim DEAL_II_PETSC_VERSION_SUBMINOR!$DEAL_II_PETSC_VERSION_SUBMINOR$ac_delim @@ -15129,7 +15243,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 31; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 33; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/deal.II/configure.in b/deal.II/configure.in index 67552dca6e..33d4ce21ca 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -275,39 +275,29 @@ AC_ARG_ENABLE(shared, dnl On AIX 4.x and alpha, shared libs don't work for us at present, so dnl disable them (we should probably use libtool there). Likewise on -dnl Mac OS X systems, where we don't know how to create shared libs -dnl at all (at least at present) - -dnl For Cygwin Windows systems, the shared library suffix becomes ".dll". - -shared_lib_suffix=".so" -static_lib_suffix=".a" - +dnl a few other systems. +dnl +dnl For Cygwin Windows systems, the shared library suffix becomes ".dll", +dnl on Mac OS X it is .dylib. case "$target" in *-aix4* | alpha*-linux* | alpha*-osf[45]* | hppa64-unknown-linux-gnu ) AC_MSG_WARN(Shared libraries not supported on $target. Using static libs instead) enableshared=no ;; -esac - -case "$target" in *cygwin ) shared_lib_suffix=".dll" cygwin_shared_lib="yes" ;; -esac - - -dnl TODO Maybe the major version number should be inserted before .dylib -dnl (.5.dylib for example). -case "$target" in *-apple-darwin* ) shared_lib_suffix=".dylib" darwin_shared_lib="yes" ;; + * ) + shared_lib_suffix=".so" + static_lib_suffix=".a" + ;; esac - if test "x$enableshared" = "xyes" ; then CFLAGS="$CFLAGS $CFLAGSPIC" CXXFLAGSG="$CXXFLAGSG $CXXFLAGSPIC" @@ -322,6 +312,8 @@ if test "x$enableshared" = "xyes" ; then ;; esac + 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 diff --git a/deal.II/contrib/hsl/Makefile b/deal.II/contrib/hsl/Makefile index e0a7f39786..a7026cf224 100644 --- a/deal.II/contrib/hsl/Makefile +++ b/deal.II/contrib/hsl/Makefile @@ -1,5 +1,5 @@ # $Id$ -# Copyright (C) 2001, 2002, 2003, 2004, 2006 by Wolfgang Bangerth +# Copyright (C) 2001, 2002, 2003, 2004, 2006, 2008 by Wolfgang Bangerth D = ../.. @@ -42,11 +42,11 @@ $(LIBDIR)/libhsl$(static-lib-suffix): $(forward-declarations) $(o-files) @$(AR) ru $@ $(o-files) @$(RANLIB) $@ -# link the object files to a shared library. since this is not C++, -# simply use the C compiler, rather than $(SHLIBLD) +# link the object files to a shared library. $(LIBDIR)/libhsl$(shared-lib-suffix): $(forward-declarations) $(o-files) @echo =====hsl==============optimized==$(MT)== Linking library: $(@F) - @$(SHLIBLD) $(LDFLAGS) -shared -o $@ $(o-files) $(F77LIBS) + @$(SHLIBLD) $(LDFLAGS) -shared -o $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,hsl) $(call DEAL_II_ADD_SONAME,hsl) $(o-files) $(F77LIBS) + @ln -f -s $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,hsl) $@ diff --git a/deal.II/deal.II/Makefile b/deal.II/deal.II/Makefile index 768bc9a000..a8bdf0d4ae 100644 --- a/deal.II/deal.II/Makefile +++ b/deal.II/deal.II/Makefile @@ -154,35 +154,35 @@ $(LIBDIR)/libdeal_II_3d$(static-lib-suffix): $(o-files-3d) $(LIBDIR)/libdeal_II_1d.g$(shared-lib-suffix): $(go-files-1d) @echo "=====deal.II====1d====debug======$(MT)== Linking library: $(@F)" - @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/libdeal_II_1d.g$(shared-lib-suffix).$(DEAL_II_VERSION) -Wl,-soname,libdeal_II_1d.g$(shared-lib-suffix).$(DEAL_II_VERSION) $(go-files-1d) $(deplibs.g) - @ln -f -s libdeal_II_1d.g$(shared-lib-suffix).$(DEAL_II_VERSION) $@ + @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II_1d.g) $(call DEAL_II_ADD_SONAME,deal_II_1d.g) $(go-files-1d) $(deplibs.g) + @ln -f -s $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II_1d.g) $@ $(LIBDIR)/libdeal_II_1d$(shared-lib-suffix): $(o-files-1d) @echo "=====deal.II====1d====optimized==$(MT)== Linking library: $(@F)" - @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/libdeal_II_1d$(shared-lib-suffix).$(DEAL_II_VERSION) -Wl,-soname,libdeal_II_1d$(shared-lib-suffix).$(DEAL_II_VERSION) $(o-files-1d) $(deplibs.o) - @ln -f -s libdeal_II_1d$(shared-lib-suffix).$(DEAL_II_VERSION) $@ + @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II_1d) $(call DEAL_II_ADD_SONAME,deal_II_1d) $(o-files-1d) $(deplibs.o) + @ln -f -s $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II_1d) $@ $(LIBDIR)/libdeal_II_2d.g$(shared-lib-suffix): $(go-files-2d) @echo "=====deal.II====2d====debug======$(MT)== Linking library: $(@F)" - @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/libdeal_II_2d.g$(shared-lib-suffix).$(DEAL_II_VERSION) -Wl,-soname,libdeal_II_2d.g$(shared-lib-suffix).$(DEAL_II_VERSION) $(go-files-2d) $(deplibs.g) - @ln -f -s libdeal_II_2d.g$(shared-lib-suffix).$(DEAL_II_VERSION) $@ + @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II_2d.g) $(call DEAL_II_ADD_SONAME,deal_II_2d.g) $(go-files-2d) $(deplibs.g) + @ln -f -s $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II_2d.g) $@ $(LIBDIR)/libdeal_II_2d$(shared-lib-suffix): $(o-files-2d) @echo "=====deal.II====2d====optimized==$(MT)== Linking library: $(@F)" - @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/libdeal_II_2d$(shared-lib-suffix).$(DEAL_II_VERSION) -Wl,-soname,libdeal_II_2d$(shared-lib-suffix).$(DEAL_II_VERSION) $(o-files-2d) $(deplibs.o) - @ln -f -s libdeal_II_2d$(shared-lib-suffix).$(DEAL_II_VERSION) $@ + @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II_2d) $(call DEAL_II_ADD_SONAME,deal_II_2d) $(o-files-2d) $(deplibs.o) + @ln -f -s $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II_2d) $@ $(LIBDIR)/libdeal_II_3d.g$(shared-lib-suffix): $(go-files-3d) @echo "=====deal.II====3d====debug======$(MT)== Linking library: $(@F)" - @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/libdeal_II_3d.g$(shared-lib-suffix).$(DEAL_II_VERSION) -Wl,-soname,libdeal_II_3d.g$(shared-lib-suffix).$(DEAL_II_VERSION) $(go-files-3d) $(deplibs.g) - @ln -f -s libdeal_II_3d.g$(shared-lib-suffix).$(DEAL_II_VERSION) $@ + @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II_3d.g) $(call DEAL_II_ADD_SONAME,deal_II_3d.g) $(go-files-3d) $(deplibs.g) + @ln -f -s $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II_3d.g) $@ $(LIBDIR)/libdeal_II_3d$(shared-lib-suffix): $(o-files-3d) @echo "=====deal.II====3d====optimized==$(MT)== Linking library: $(@F)" - @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/libdeal_II_3d$(shared-lib-suffix).$(DEAL_II_VERSION) -Wl,-soname,libdeal_II_3d$(shared-lib-suffix).$(DEAL_II_VERSION) $(o-files-3d) $(deplibs.o) - @ln -f -s libdeal_II_3d$(shared-lib-suffix).$(DEAL_II_VERSION) $@ + @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II_3d) $(call DEAL_II_ADD_SONAME,deal_II_3d) $(o-files-3d) $(deplibs.o) + @ln -f -s $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,deal_II_3d) $@ diff --git a/deal.II/lac/Makefile b/deal.II/lac/Makefile index f6b0b8021c..35c8090996 100644 --- a/deal.II/lac/Makefile +++ b/deal.II/lac/Makefile @@ -105,13 +105,13 @@ $(LIBDIR)/liblac.g$(static-lib-suffix): $(go-files) $(LIBDIR)/liblac$(shared-lib-suffix): $(o-files) @echo "=====lac==============optimized==$(MT)== Linking library: $(@F)" - @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/liblac$(shared-lib-suffix).$(DEAL_II_VERSION) $(o-files) -Wl,-soname,liblac$(shared-lib-suffix).$(DEAL_II_VERSION) $(deplibs.o) - @ln -f -s liblac$(shared-lib-suffix).$(DEAL_II_VERSION) $@ + @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,lac) $(call DEAL_II_ADD_SONAME,lac) $(o-files) $(deplibs.o) + @ln -f -s $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,lac) $@ $(LIBDIR)/liblac.g$(shared-lib-suffix): $(go-files) @echo "=====lac==============debug======$(MT)== Linking library: $(@F)" - @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/liblac.g$(shared-lib-suffix).$(DEAL_II_VERSION) -Wl,-soname,liblac.g$(shared-lib-suffix).$(DEAL_II_VERSION) $(go-files) $(deplibs.g) - @ln -f -s liblac.g$(shared-lib-suffix).$(DEAL_II_VERSION) $@ + @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,lac.g) $(call DEAL_II_ADD_SONAME,lac.g) $(go-files) $(deplibs.g) + @ln -f -s $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,lac.g) $@ clean: diff --git a/deal.II/lib/Makefile b/deal.II/lib/Makefile index 4cd85977a6..f89a05b1dc 100644 --- a/deal.II/lib/Makefile +++ b/deal.II/lib/Makefile @@ -61,15 +61,13 @@ ifeq ($(enable-shared),yes) libpetscall.g$(shared-lib-suffix): $(xlib.g) @echo "======================debug============= Linking library: libpetscall.g$(shared-lib-suffix)" - @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o libpetscall.g$(shared-lib-suffix).$(DEAL_II_VERSION) \ - -Wl,-soname,libpetscall.g$(shared-lib-suffix).$(DEAL_II_VERSION) $(xlib.g) - @ln -f -s libpetscall.g$(shared-lib-suffix).$(DEAL_II_VERSION) $@ + @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,petscall.g) $(call DEAL_II_ADD_SONAME,petscall.g) $(xlib.g) + @ln -f -s $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,petscall.g) $@ libpetscall$(shared-lib-suffix): $(xlib.o) @echo "======================optimized========= Linking library: libpetscall$(shared-lib-suffix)" - @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o libpetscall$(shared-lib-suffix).$(DEAL_II_VERSION) \ - -Wl,-soname,libpetscall$(shared-lib-suffix).$(DEAL_II_VERSION) $(xlib.o) - @ln -f -s libpetscall$(shared-lib-suffix).$(DEAL_II_VERSION) $@ + @$(SHLIBLD) $(LDFLAGS) $(SHLIBFLAGS) -o$(LIBDIR)/$(call DEAL_II_SHLIB_NAME,petscall) $(call DEAL_II_ADD_SONAME,petscall) $(xlib.o) + @ln -f -s $(LIBDIR)/$(call DEAL_II_SHLIB_NAME,petscall) $@ else -- 2.39.5