summaryrefslogtreecommitdiff
path: root/graphics/GMT/patches/patch-aa
blob: 35999c97ef468f6fb73a407dd620fe6bb6c62efc (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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
$NetBSD: patch-aa,v 1.9 2008/06/12 02:14:31 joerg Exp $

Libtoolize.

--- src/Makefile.orig	2006-11-01 16:41:02.000000000 +0000
+++ src/Makefile
@@ -43,7 +43,7 @@ include makegmt.macros	# GMT-specific se
 NETCDFLIB	= $(NETCDF)/lib
 NETCDFINC	= $(NETCDF)/include
 CFLAGS		= -I$(NETCDFINC) $(WIN32) $(CC_OPT) -DGMT_DEFAULT_PATH=\"$(GMT_DEFAULT_PATH)\" $(TRIANGLE_D)
-CDF		= -L$(NETCDFLIB) -lnetcdf
+CDF		= -Wl,-R$(NETCDFLIB) -L$(NETCDFLIB) -lnetcdf
 
 PS	= -lpsl
 GMT	= -lgmt
@@ -151,38 +151,34 @@ gmt_notposix.h:	
 		./configure
 
 install:	all
-		if [ ! -d $(bindir) ]; then \
-			mkdir -p $(bindir); \
-		fi
-		for i in $(ALLPROGS); do \
-			$(INSTALL) $$i$(EXE) $(bindir); \
-		done
-		$(INSTALL) GMT $(bindir)
 		if [ ! -d $(libdir) ]; then \
 			mkdir -p $(libdir); \
 		fi
 		if [ ! $(libdir) = $(srcdir) ]; then \
 			rm -f $(libdir)/libpsl.* $(libdir)/libgmt.* $(libdir)/libgmtps.*; \
-			$(INSTALL) -m 444 libpsl.a $(libdir); \
-			$(INSTALL) -m 444 libgmt.a $(libdir); \
-			$(INSTALL) -m 444 libgmtps.a $(libdir); \
-			if [ -f libpsl.$(SL) ]; then \
-				$(INSTALL) -m 444 libpsl.$(SL) $(libdir); \
-				$(INSTALL) -m 444 libgmt.$(SL) $(libdir); \
-				$(INSTALL) -m 444 libgmtps.$(SL) $(libdir); \
-			fi; \
+			$(LIBTOOL) --mode=install $(INSTALL_DATA) libpsl.la $(libdir); \
+			$(LIBTOOL) --mode=install $(INSTALL_DATA) libgmt.la $(libdir); \
+			$(LIBTOOL) --mode=install $(INSTALL_DATA) libgmtps.la $(libdir); \
 		fi
 		if [ ! -d $(includedir) ]; then \
 			mkdir -p $(includedir); \
 		fi
 		if [ ! $(includedir) = $(srcdir) ]; then \
 			for i in $(GMT_H); do \
-				$(INSTALL) -m 444 $$i $(includedir); \
+				$(INSTALL_DATA) $$i $(includedir); \
 			done; \
 			for i in $(PS_H) $(PS_I); do \
-				$(INSTALL) -m 444 $$i $(includedir); \
+				$(INSTALL_DATA) $$i $(includedir); \
 			done; \
 		fi
+		if [ ! -d $(bindir) ]; then \
+			mkdir -p $(bindir); \
+		fi
+		for i in $(ALLPROGS); do \
+			$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$i$(EXE) $(bindir); \
+		done
+		$(INSTALL) GMT $(bindir)
+
 
 uninstall:
 		for i in $(ALLPROGS); do \
@@ -207,13 +203,13 @@ uninstall:
 		fi
 
 clean:
-		rm -f *.o *.a *.$(SL)
+		rm -f *.o *.a *.lo *.$(SL)
 		for i in $(ALLPROGS); do \
 			rm -f $$i$(EXE); \
 		done
 
 spotless:	clean
-		rm -f $(GMTLIB) gmt_notposix.h makegmt.macros *.man
+		rm -fr .libs $(GMTLIB) gmt_notposix.h makegmt.macros *.man
 		touch makegmt.macros
 
 distclean:	spotless
@@ -225,40 +221,32 @@ distclean:	spotless
 libs:		$(GMTLIB)
 
 pslib.o:	pslib.c $(PS_H) $(PS_I) gmt_notunix.h gmt_notposix.h gmt_math.h
-		$(CC) $(CFLAGS) -c pslib.c
-
-./libpsl.a:	pslib.o
-		$(AR) cvur libpsl.a $?
-		$(RANLIB) libpsl.a
-
-./libgmt.a:	$(LIB_O) $(TRIANGLE_O) $(ALPHA_SINCOS_O)
-		$(AR) cvur $@ $?
-		$(RANLIB) $@
-
-./libgmtps.a:	$(LIBPS_O) 
-		$(AR) cvur $@ $?
-		$(RANLIB) $@
+		@$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c pslib.c
 
-./libpsl.$(SL):	pslib.o
-		$(LD) $(LD_OPT) $? -o $@
+libpsl.la:	pslib.o
+		@$(LIBTOOL) --mode=link $(CC) -o $@ pslib.lo $(LDFLAGS) -lm --version-info 0:0 -rpath $(PLAIN_LIBDIR)
 
-./libgmt.$(SL):	$(LIB_O) $(TRIANGLE_O) $(ALPHA_SINCOS_O)
-		$(LD) $(LD_OPT) $(LIB_O) $(TRIANGLE_O) $(ALPHA_SINCOS_O) -o $@
+libgmt.la:	$(LIB_O) $(TRIANGLE_O) $(ALPHA_SINCOS_O)
+		@$(LIBTOOL) --mode=link $(CC) -o $@ $(LIB_O:.o=.lo) \
+		 $(TRIANGLE_O:.o=.lo) $(ALPHA_SINCOS_O:.o=.lo) $(LDFLAGS) \
+		 $(CDF) $(LIBS) --version-info 0:0 -rpath $(PLAIN_LIBDIR)
 
-./libgmtps.$(SL):	$(LIBPS_O)
-		$(LD) $(LD_OPT) $(LIBPS_O) -o $@
+libgmtps.la:	$(LIBPS_O) 
+		@$(LIBTOOL) --mode=link $(CC) -o $@ $(LIBPS_O:.o=.lo) $(LDFLAGS) -lm --version-info 0:0 -rpath $(PLAIN_LIBDIR)
 
 #-------------------------------------------------------------------------------
 #	program dependencies
 #-------------------------------------------------------------------------------
 
 $(PROGS):	$(GMTLIB) $(PROGS_O)
-		$(CC) $(CFLAGS) $@.o -L. $(GMT) $(CDF) $(LIBS) $(LDFLAGS) -o $@
+		@$(LIBTOOL) --mode=link $(CC) $(CPPFLAGS) $(CFLAGS) $@.o \
+		 libgmt.la libpsl.la $(CDF) $(LIBS) $(LDFLAGS) -o $@
 		$(COMPRESS) $@$(EXE)
 
 $(PROGSPS):	$(GMTLIB) $(PROGSPS_O)
-		$(CC) $(CFLAGS) $@.o -L. $(GMT) $(GMTPS) $(PS) $(CDF) $(LIBS) $(LDFLAGS) -o $@
+		@$(LIBTOOL) --mode=link $(CC) $(CPPFLAGS) $(CFLAGS) $@.o \
+                 libgmt.la libgmtps.la libpsl.la $(CDF) $(LIBS) $(LDFLAGS) -o $@
 		$(COMPRESS) $@$(EXE)
 
 .c.o:
-		$(CC) -c $(CFLAGS) $<
+		@$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -c $(CFLAGS) $<