From 89ab6e29352bf37bfae35e03490552d0af35526d Mon Sep 17 00:00:00 2001 From: hartmann Date: Fri, 26 Aug 2005 11:23:36 +0000 Subject: [PATCH] Fix linking of static libpetsc libraries. git-svn-id: https://svn.dealii.org/trunk@11334 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lib/Makefile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/deal.II/lib/Makefile b/deal.II/lib/Makefile index 016e17210e..dfcef753db 100644 --- a/deal.II/lib/Makefile +++ b/deal.II/lib/Makefile @@ -66,25 +66,31 @@ endif -Wl,-rpath,$(lib-contrib-petsc-path.o) $(xlib.o) else - # As I don't know how to merge archives, here a workaround: First extract all - # the archives into a newly created directory. Then put all the files into a - # single new archive. Do the same for debug and optimized mode. + # As I don't know how to merge archives, here's a workaround: Extract each of + # the archives and append the object files to the libpetsc archive. Do the + # same for debug and optimized mode. external-links-petsc: @echo Setting up libraries for PETSc @echo "======================debug============= Linking library: libpetsc.g$(static-lib-suffix)" + @rm -f libpetsc.g$(static-lib-suffix) @mkdir ar_tmp; cd ar_tmp; \ for arfile in $(xlib.g) ; do \ $(AR) x $$arfile; \ + $(AR) q ../libpetsc.g$(static-lib-suffix) *; \ + rm *; \ done - @$(AR) ru libpetsc.g$(static-lib-suffix) ar_tmp/* + @cd .. @rm -r ar_tmp @$(RANLIB) libpetsc.g$(static-lib-suffix) @echo "======================optimized========= Linking library: libpetsc$(static-lib-suffix)" + @rm -f libpetsc$(static-lib-suffix) @mkdir ar_tmp; cd ar_tmp; \ for arfile in $(xlib.o) ; do \ $(AR) x $$arfile; \ + $(AR) q ../libpetsc$(static-lib-suffix) *; \ + rm *; \ done - @$(AR) ru libpetsc$(static-lib-suffix) ar_tmp/* + @cd .. @rm -r ar_tmp @$(RANLIB) libpetsc$(static-lib-suffix) endif -- 2.39.5