summarylogtreecommitdiffstats
path: root/MUMPS-shared-pord.patch
blob: efada6e5e3514fba761ea2cde084ab9b813389a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
--- PORD/lib/Makefile
+++ PORD/lib/Makefile
@@ -24,10 +24,14 @@ OBJS = graph.o gbipart.o gbisect.o ddcre
 .c.o:
 	$(CC) $(COPTIONS) -c $*.c $(OUTC)$*.o
 
-libpord$(LIBEXT):$(OBJS)
+libpord$(PLAT).a:$(OBJS)
 	$(AR)$@ $(OBJS)
 	$(RANLIB) $@
 
+libpord$(PLAT).so: $(OBJS)
+	$(CC) -shared $(OBJS) -Wl,-soname,libpord$(PLAT).so.$(SONAME_VERSION) -o libpord$(PLAT).so.$(SONAME_VERSION) $(OPTL) -Wl,-z,defs
+	ln -fs libpord$(PLAT).so.$(SONAME_VERSION) $@
+
 clean:
 	rm -f *.o

Index: mumps/Makefile
===================================================================
--- Makefile
+++ Makefile
@@ -54,7 +54,7 @@
 multi_example:	s d c z
 	(cd examples ; $(MAKE) multi)
 
-requiredobj: Makefile.inc $(LIBSEQNEEDED) $(libdir)/libpord$(PLAT)$(LIBEXT)
+requiredobj: Makefile.inc $(LIBSEQNEEDED) $(libdir)/libpord$(PLAT).a $(libdir)/libpord$(PLAT).so
 
 # dummy MPI library (sequential version)
 
@@ -62,19 +62,26 @@
 	(cd libseq; $(MAKE))
 
 # Build the libpord.a library and copy it into $(topdir)/lib
-$(libdir)/libpord$(PLAT)$(LIBEXT):
+$(libdir)/libpord$(PLAT).a:
 	if [ "$(LPORDDIR)" != "" ] ; then \
 	  cd $(LPORDDIR); \
 	  $(MAKE) CC="$(CC)" CFLAGS="$(OPTC)" AR="$(AR)" RANLIB="$(RANLIB)" OUTC="$(OUTC)" LIBEXT=$(LIBEXT); \
 	fi;
 	if [ "$(LPORDDIR)" != "" ] ; then \
-	  cp $(LPORDDIR)/libpord$(LIBEXT) $@; \
+	  cp $(LPORDDIR)/libpord$(PLAT).a $@; \
 	fi;
 
+$(libdir)/libpord$(PLAT).so:
+	if [ "$(LPORDDIR)" != "" ] ; then \
+	cd $(LPORDDIR); make CC="$(CC)" CFLAGS="$(OPTC)" AR="$(AR)" ARFUNCT= RANLIB="$(RANLIB)" libpord$(PLAT).so; fi;
+	if [ "$(LPORDDIR)" != "" ] ; then \
+	cp -a $(LPORDDIR)/libpord*.so* lib/; fi;
+
+
 clean:
 	(cd src; $(MAKE) clean)
 	(cd examples; $(MAKE) clean)
-	(cd $(libdir); $(RM) *$(PLAT)$(LIBEXT))
+	(cd $(libdir); $(RM) *$(PLAT).a *$(PLAT).so*)
 	(cd libseq; $(MAKE) clean)
 	if [ "$(LPORDDIR)" != "" ] ; then \
 	  cd $(LPORDDIR); $(MAKE) realclean; \