summaryrefslogtreecommitdiff
path: root/graphics/GMT/patches/patch-aa
blob: 7cbbd52da4fbac4aef78d801e48550b36abf7d96 (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
$NetBSD: patch-aa,v 1.7 2005/06/22 08:34:54 jlam Exp $

--- src/Makefile.orig	Fri Mar  9 19:20:44 2001
+++ src/Makefile
@@ -43,7 +43,7 @@
 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
@@ -136,15 +136,15 @@
 
 #-------------------------------------------------------------------------------
 
-SHARED_LIB	= libpsl.a libgmt.a libpsl.$(SL) libgmt.$(SL)
-STATIC_LIB	= libpsl.a libgmt.a
+SHARED_LIB	= libpsl.la libgmt.la
+STATIC_LIB	=
 
 #-------------------------------------------------------------------------------
 
 all:		init libs $(PROGS)
 
 init:		gmtmacros gmt_notposix.h gmt_nan.h
-		
+
 gmtmacros:	
 		if [ `cat makegmt.macros | wc -c` = 0 ]; then \
 			echo "src/makegmt.macros is empty - you must rerun configure in the main GMT directory"; \
@@ -162,32 +162,28 @@
 		./configure
 
 install:	all
-		if [ ! -d $(bindir) ]; then \
-			mkdir -p $(bindir); \
-		fi
-		for i in $(PROGS); do \
-			$(INSTALL) $$i$(EXE) $(bindir); \
-		done
-		$(INSTALL) GMT $(bindir)
 		if [ ! -d $(libdir) ]; then \
 			mkdir -p $(libdir); \
 		fi
 		if [ ! $(libdir) = $(srcdir) ]; then \
-			$(INSTALL) -m 444 libpsl.a $(libdir); \
-			$(INSTALL) -m 444 libgmt.a $(libdir); \
-			if [ -f libpsl.$(SL) ]; then \
-				$(INSTALL) -m 444 libpsl.$(SL) $(libdir); \
-				$(INSTALL) -m 444 libgmt.$(SL) $(libdir); \
-			fi; \
+			$(LIBTOOL) --mode=install $(INSTALL_DATA) libpsl.la $(libdir); \
+			$(LIBTOOL) --mode=install $(INSTALL_DATA) libgmt.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; \
 		fi
+		if [ ! -d $(bindir) ]; then \
+			mkdir -p $(bindir); \
+		fi
+		for i in $(PROGS); do \
+			$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$i$(EXE) $(bindir); \
+		done
+		$(INSTALL) GMT $(bindir)
 
 uninstall:
 		for i in $(PROGS); do \
@@ -208,13 +204,13 @@
 		fi
 
 clean:
-		rm -f *.o gmt_nan_init$(EXE)
+		rm -f *.o *.lo gmt_nan_init$(EXE)
 		for i in $(PROGS); do \
 			rm -f $$i$(EXE); \
 		done
 
 spotless:	clean
-		rm -f $(GMTLIB) gmt_nan.h gmt_notposix.h makegmt.macros
+		rm -fr .libs $(GMTLIB) gmt_nan.h gmt_notposix.h makegmt.macros
 		touch makegmt.macros
 
 distclean:	spotless
@@ -225,29 +221,24 @@
 
 libs:		$(GMTLIB)
 
-libpsl.a:	pslib.o
-		$(AR) cvur libpsl.a $?
-		$(RANLIB) libpsl.a
+libpsl.la:	pslib.o
+		@$(LIBTOOL) --mode=link $(CC) -o $@ pslib.lo $(LDFLAGS) -lm --version-info 0:0 -rpath $(libdir)
 
 pslib.o:	pslib.c $(PS_H)
-		$(CC) $(CFLAGS) -c pslib.c
-
-libgmt.a:	$(LIB_O) $(TRIANGLE_O) $(ALPHA_SINCOS_O)
-		$(AR) cvur $@ $?
-		$(RANLIB) $@
-
-libpsl.$(SL):	pslib.o
-		$(LD) $(LD_OPT) $? -o $@
+		@$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c pslib.c
 
-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 $(libdir)
 
 #-------------------------------------------------------------------------------
 #	program dependencies
 #-------------------------------------------------------------------------------
 
 $(PROGS):	$(GMTLIB) $(PROGS_O)
-		$(CC) $(CFLAGS) $@.o -L. -lgmt -lpsl $(CDF) $(LIBS) $(LDFLAGS) -o $@
+		@$(LIBTOOL) --mode=link $(CC) $(CPPFLAGS) $(CFLAGS) $@.o libgmt.la \
+		libpsl.la $(CDF) $(LIBS) $(LDFLAGS) -o $@
 		$(COMPRESS) $@$(EXE)
 .c.o:
-		$(CC) -c $(CFLAGS) $<
+		@$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -c $(CFLAGS) $<