summaryrefslogtreecommitdiff
path: root/net/tsocks/patches/patch-aa
blob: fc650d21ea22b928445f6e47889918c2c40e04a6 (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
$NetBSD: patch-aa,v 1.4 2006/09/17 11:50:15 jmmv Exp $

--- Makefile.in.orig	2002-03-16 11:12:40.000000000 +0100
+++ Makefile.in
@@ -13,7 +13,7 @@ includedir = @includedir@
 
 SHELL = /bin/sh
 MKINSTALLDIRS = ${SHELL} mkinstalldirs 
-SHCC = ${CC} -fPIC 
+SHCC = ${LIBTOOL} --mode=compile ${CC}
 INSPECT = inspectsocks
 SAVE = saveme
 LIB_NAME = libtsocks
@@ -23,7 +23,7 @@ VALIDATECONF = validateconf
 SCRIPT = tsocks
 SHLIB_MAJOR = 1
 SHLIB_MINOR = 8
-SHLIB = ${LIB_NAME}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
+SHLIB = ${LIB_NAME}.la
 
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -34,26 +34,25 @@ SPECIALLIBS = @SPECIALLIBS@
 
 SHOBJS = ${OBJS:.o=.so}
 
-OBJS= tsocks.o
+OBJS= tsocks.lo
 
-TARGETS= ${SHLIB} ${UTIL_LIB} ${SAVE} ${INSPECT} ${VALIDATECONF}
+TARGETS= ${SHLIB} ${UTIL_LIB} ${INSPECT} ${VALIDATECONF}
 
 all: ${TARGETS}
 
 ${VALIDATECONF}: ${VALIDATECONF}.c ${COMMON}.o ${PARSER}.o
-	${SHCC} ${CFLAGS} ${INCLUDES} -o ${VALIDATECONF} ${VALIDATECONF}.c ${COMMON}.o ${PARSER}.o ${LIBS}
+	${CC} ${CFLAGS} ${INCLUDES} -o ${VALIDATECONF} ${VALIDATECONF}.c ${COMMON}.o ${PARSER}.o ${LIBS}
 
 ${INSPECT}: ${INSPECT}.c ${COMMON}.o
-	${SHCC} ${CFLAGS} ${INCLUDES} -o ${INSPECT} ${INSPECT}.c ${COMMON}.o ${LIBS} 
+	${CC} ${CFLAGS} ${INCLUDES} -o ${INSPECT} ${INSPECT}.c ${COMMON}.o ${LIBS} 
 
 ${SAVE}: ${SAVE}.c
-	${SHCC} ${CFLAGS} ${INCLUDES} -static -o ${SAVE} ${SAVE}.c
+	${CC} ${CFLAGS} ${INCLUDES} -static -o ${SAVE} ${SAVE}.c
 
-${SHLIB}: ${OBJS} ${COMMON}.o ${PARSER}.o
-	${SHCC} ${CFLAGS} ${INCLUDES} -nostdlib -shared -o ${SHLIB} ${OBJS} ${COMMON}.o ${PARSER}.o ${DYNLIB_FLAGS} ${SPECIALLIBS} ${LIBS}
-	ln -sf ${SHLIB} ${LIB_NAME}.so
+${SHLIB}: ${OBJS} ${COMMON}.lo ${PARSER}.lo
+	${LIBTOOL} --mode=link ${CC} -rpath ${PREFIX}/lib -version-info ${SHLIB_MAJOR}:${SHLIB_MINOR} ${LDFLAGS} -o ${SHLIB} ${OBJS} ${COMMON}.lo ${PARSER}.lo ${DYNLIB_FLAGS} ${SPECIALLIBS} ${LIBS}
 
-%.so: %.c
+%.lo: %.c
 	${SHCC} ${CFLAGS} ${INCLUDES} -c ${CC_SWITCHES} $< -o $@
 
 %.o: %.c
@@ -67,9 +66,7 @@ installscript:
 
 installlib:
 	${MKINSTALLDIRS} "${DESTDIR}${libdir}"
-	${INSTALL} ${SHLIB} ${DESTDIR}${libdir}
-	ln -sf ${SHLIB} ${DESTDIR}${libdir}/${LIB_NAME}.so.${SHLIB_MAJOR}
-	ln -sf ${LIB_NAME}.so.${SHLIB_MAJOR} ${DESTDIR}${libdir}/${LIB_NAME}.so
+	${LIBTOOL} --mode=install ${INSTALL} ${SHLIB} ${DESTDIR}${libdir}
 
 installman:
 	${MKINSTALLDIRS} "${DESTDIR}${mandir}/man1"
@@ -78,7 +75,7 @@ installman:
 	${INSTALL_DATA} tsocks.8 ${DESTDIR}${mandir}/man8/
 	${MKINSTALLDIRS} "${DESTDIR}${mandir}/man5"
 	${INSTALL_DATA} tsocks.conf.5 ${DESTDIR}${mandir}/man5/
-	
+
 clean:
 	-rm -f *.so *.so.* *.o *~ ${TARGETS}