From: hartmann Date: Fri, 26 Aug 2005 11:23:36 +0000 (+0000) Subject: Fix linking of static libpetsc libraries. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89ab6e29352bf37bfae35e03490552d0af35526d;p=dealii-svn.git Fix linking of static libpetsc libraries. git-svn-id: https://svn.dealii.org/trunk@11334 0785d39b-7218-0410-832d-ea1e28bc413d --- 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