summaryrefslogtreecommitdiff
path: root/lang/tcl-otcl/patches/patch-aa
blob: 4c700ea80536e0e0414b90415030912e414968c2 (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
$NetBSD: patch-aa,v 1.4 2006/09/29 16:28:55 minskim Exp $

--- Makefile.in.orig	2006-09-25 05:02:37.000000000 +0000
+++ Makefile.in
@@ -5,6 +5,7 @@
 #
 
 CC=		@CC@
+CPPFLAGS=	@CPPFLAGS@
 CFLAGS=		@CFLAGS@
 RANLIB= 	@RANLIB@
 INSTALL=	@INSTALL@
@@ -28,7 +29,7 @@ SHLIB_LD_LIBS  = @SHLIB_LD_LIBS@
 INST_OTCLSH=	@prefix@/bin
 INST_OWISH=	@prefix@/bin
 INST_OLIB=	@prefix@/lib
-INST_OLIBSH=	@INST_OLIBSH@
+INST_OLIBSH=	@prefix@/lib
 INST_OINC=	@prefix@/include
 
 
@@ -40,7 +41,6 @@ INCLUDES = \
 	-I. \
 	@V_INCLUDES@ \
 	@V_INCLUDE_X11@ \
-	-I@includedir@ \
 	@V_INCLUDE@
 
 DEFINES = \
@@ -58,9 +58,9 @@ MV= mv -f
 CFILES = otcl.c otclAppInit.c otkAppInit.c
 
 .c.o:
-	$(CC) -c $(CFLAGS) $(DEFINES) $(INCLUDES) $<
+	${LIBTOOL} --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCLUDES) $<
 
-all: libotcl.a libotcl$(SHLIB_SUFFIX) otclsh owish
+all: libotcl.a otclsh owish
 
 #
 # compile an appinit with tcl and otcl and link against
@@ -69,8 +69,8 @@ all: libotcl.a libotcl$(SHLIB_SUFFIX) ot
 
 otclsh: otclAppInit.c libotcl.a
 	rm -f libotcl$(SHLIB_SUFFIX)
-	$(CC) -o otclsh $(SHLD_FLAGS) $(CFLAGS) $(INCLUDES) otclAppInit.c \
-	$(OTCLLIB) $(LIB)
+	${LIBTOOL} --mode=link $(CC) -o otclsh $(CPPFLAGS) $(CFLAGS) $(INCLUDES) $(LDFLAGS) otclAppInit.c \
+	./libotcl.la $(LIB)
 
 #
 # compile an appinit with tcl/tk and otcl and link against
@@ -79,8 +79,8 @@ otclsh: otclAppInit.c libotcl.a
 
 owish: otkAppInit.c libotcl.a
 	rm -f libotcl$(SHLIB_SUFFIX)
-	$(CC) -o owish $(SHLD_FLAGS) $(CFLAGS) $(INCLUDES) otkAppInit.c \
-	$(OTCLLIB) $(LIB)
+	${LIBTOOL} --mode=link $(CC) -o owish $(CPPFLAGS) $(CFLAGS) $(INCLUDES) $(LDFLAGS) otkAppInit.c \
+	./libotcl.la $(LIB)
 
 #
 # compile otcl.c and link it into a library archive
@@ -89,19 +89,8 @@ owish: otkAppInit.c libotcl.a
 
 libotcl.a: otcl.c
 	rm -f libotcl.a otcl.o
-	$(CC) -c $(CFLAGS) $(DEFINES) $(INCLUDES) otcl.c
-	ar cq libotcl.a otcl.o
-	$(RANLIB) libotcl.a
-
-#
-# compile otcl.c and link it into a shared object
-# INCLUDES give a path to tclInt.h (plus tk and X11)
-#
-
-libotcl$(SHLIB_SUFFIX): otcl.c
-	rm -f libotcl$(SHLIB_SUFFIX) otcl.o so_locations
-	$(CC) -c $(CFLAGS) $(DEFINES) $(SHLIB_CFLAGS) $(INCLUDES) otcl.c
-	$(SHLIB_LD) -o libotcl$(SHLIB_SUFFIX) otcl.o
+	${LIBTOOL} --mode=compile $(CC) -c $(CFLAGS) $(DEFINES) $(INCLUDES) otcl.c
+	${LIBTOOL} --mode=link ${CC} -o ${.TARGET:.a=.la} otcl.lo -rpath ${PREFIX}/lib -version-info 0:0
 
 test: otclsh owish
 	./otclsh lib/test.tcl
@@ -114,12 +103,10 @@ dirs:
 		fi;\
 	done
 
-install: owish otclsh libotcl.a libotcl$(SHLIB_SUFFIX) otcl.h dirs
-	$(INSTALL) owish $(INST_OWISH)
-	$(INSTALL) otclsh $(INST_OTCLSH)
-	$(INSTALL) libotcl.a $(INST_OLIB)
-	$(RANLIB)  $(INST_OLIB)/libotcl.a
-	$(INSTALL) libotcl$(SHLIB_SUFFIX) $(INST_OLIBSH)
+install: owish otclsh libotcl.a otcl.h dirs
+	${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} libotcl.la ${PREFIX}/lib
+	${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} owish $(INST_OWISH)
+	${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} otclsh $(INST_OTCLSH)
 	$(INSTALL) -m 644 otcl.h $(INST_OINC)
 
 clean:
@@ -154,7 +141,7 @@ srctar:
 
 depend: $(CFILES)
 	@echo Making dependencies for $(srcdir){$(CFILES)}
-	@$(CC) -MM $(CFLAGS) $(INCLUDES) $(DEFINES) $(CFILES) > makedep
+	@$(CC) -MM $(CPPFLAGS) $(CFLAGS) $(INCLUDES) $(DEFINES) $(CFILES) > makedep
 	@echo '/^# DO NOT DELETE THIS LINE/+1,$$d' > eddep
 	@echo '$$r makedep' >> eddep
 	@echo 'w' >>eddep