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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
--- a/makefile.in
+++ b/makefile.in
@@ -1,14 +1,17 @@
BLD = build$(QUADSUFFIX)
-LIBDIR = $(PREFIX)/lib$(LIBDIRSUFFIX)
-INCLUDEDIR = $(PREFIX)/include
-BINDIR = $(PREFIX)/bin
+LIBDIR = $(DESTDIR)/$(PREFIX)/lib$(LIBDIRSUFFIX)
+INCLUDEDIR = $(DESTDIR)/$(PREFIX)/include
+BINDIR = $(DESTDIR)/$(PREFIX)/bin
LIB = libooptools$(QUADSUFFIX).a
FE = lt$(QUADSUFFIX)$(EXE)
MFE = LoopTools$(QUADSUFFIX)$(EXE)
INCLUDE = $(BLD)/looptools.h $(BLD)/clooptools.h
+LIBRARY=libooptools.so
+REALNAME=$(LIBRARY).$(VER)
+
ARGS = $(PARALLEL) \
LIB="$(LIB)" \
FE="$(FE)" \
@@ -16,12 +19,12 @@ ARGS = $(PARALLEL) \
EXE="$(EXE)" \
DEF="$(DEF)" \
NOUNDERSCORE="$(NOUNDERSCORE)" \
- XFC="$(FC) $(FFLAGS) -I." \
+ XFC="$(FC$(QUADSUFFIX)) $(FFLAGS) -I. -fPIC" \
F90="$(F90)" \
CC="$(CC)" \
- CFLAGS="$(CFLAGS)" \
+ CFLAGS="$(CFLAGS) -fPIC" \
CXX="$(CXX)" \
- CXXFLAGS="$(CXXFLAGS)" \
+ CXXFLAGS="$(CXXFLAGS) -fPIC" \
ML="$(ML)" \
MCC="$(MCC)" \
MCFLAGS="$(MCFLAGS)" \
@@ -31,24 +34,23 @@ ARGS = $(PARALLEL) \
NM="$(NM)" \
DLLTOOL="$(DLLTOOL)" \
LDFLAGS="$(LDFLAGS)" \
- LIBPATH="$(LIBPATH)"
+ LIBPATH="$(LIBPATH)" \
+ REALNAME="$(REALNAME)"
-default all lib frontend mma: force
+default all lib solib frontend mma: force
cd $(BLD) && $(MAKE) $(ARGS) $@
-install: lib frontend
- -mkdir $(PREFIX)
+install: lib solib frontend
+ -mkdir $(DESTDIR)$(PREFIX)
-mkdir $(LIBDIR) $(BINDIR) $(INCLUDEDIR)
cp -p $(BLD)/$(LIB) $(LIBDIR)
cp -p $(INCLUDE) $(INCLUDEDIR)
- strip $(BLD)/$(FE)
cp -p $(BLD)/fcc $(BLD)/$(FE) $(BINDIR)
rm -f $(BINDIR)/f++
ln -s fcc $(BINDIR)/f++
test ! -f $(BLD)/$(MFE) || { \
test -z "$(EXE)" || ldd $(BLD)/$(MFE) | awk '/\/usr\/bin\/cyg/ { system("cp -p " $$3 " $(BINDIR)/"); }' ; \
- strip $(BLD)/$(MFE) ; \
cp -p $(BLD)/$(MFE) $(BINDIR); \
}
--- a/src/makefile
+++ b/src/makefile
@@ -1,6 +1,6 @@
-default: frontend mma$(ML)
+default: frontend mma$(ML) solib
-all: frontend mma1
+all: frontend mma1 solib
frontend: lib $(FE)
@@ -8,6 +8,8 @@ mma1: lib $(MFE)
mma0 lib: $(LIB) clooptools.h fcc
+solib: $(REALNAME) fcc
+
.SUFFIXES:
@@ -245,6 +247,9 @@ $(LIB): $(OBJS)
$(AR) $(ARFLAGS) $(LIB) $?
-$(RANLIB) $(LIB)
+$(REALNAME): $(OBJS)
+ $(XFC) $(LDFLAGS) -shared -Wl,--soname,$(REALNAME) -o $@ $?
+
$(FE): lt.F $(LTINC) $(LIB)
$(XFC) -o $(FE) lt.F $(LIB) $(LDFLAGS)
|