blob: b7430205752ed735adb6428ba4c54155cbed3a8d (
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
|
$NetBSD: patch-aa,v 1.7 2013/01/11 23:35:12 joerg Exp $
libtcl85 is hard-coded in the patch, just like it's predecessor.
--- Makefile.orig 1998-08-25 07:25:20.000000000 +0000
+++ Makefile
@@ -18,12 +18,12 @@ TCLEXPAT_VERSION = 1.1
TCL_SHLIB_SUFFIX = .so
TCL_OBJS = tclexpat.o
-TCL_PREFIX = /usr/local/tcl/8.0
-TCL_EXEC_PREFIX = /usr/local/tcl/8.0
-TCL_SHLIB_CFLAGS = -fPIC
-TCL_SHLIB_LD = gcc -shared
-TCL_CC = gcc
-TCL_PACKAGE_PATH = /usr/local/tcl/8.0/lib
+TCL_PREFIX = ${LOCALBASE}
+TCL_EXEC_PREFIX = ${LOCALBASE}
+TCL_SHLIB_CFLAGS =
+TCL_SHLIB_LD = ${SHLIBTOOL} --mode=link ${CC}
+TCL_CC = ${SHLIBTOOL} --mode=compile ${CC}
+TCL_PACKAGE_PATH = ${PREFIX}/lib/tcl
@@ -64,39 +64,27 @@ FILEMAP_OBJ=expat/xmlwf/unixfilemap.o
# You shouldnt have to edit anything below here
#----------------------------------------------------------------------------
-CC= $(TCL_CC)
LIB= tclexpat$(TCL_SHLIB_SUFFIX)
-OBJS=expat/xmltok/xmltok.o \
- expat/xmltok/xmlrole.o \
- expat/xmlwf/xmlwf.o \
- expat/xmlwf/codepage.o \
- expat/xmlparse/xmlparse.o \
- expat/xmlparse/hashtable.o \
- $(FILEMAP_OBJ)
-
+OBJS=
all: $(LIB)
-
-$(LIB): tclexpat.o ${OBJS}
- $(TCL_SHLIB_LD) -o $(LIB) $(OBJS) tclexpat.o
-
-${OBJS}:
- cd expat ; make CC=${CC} SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS}
+$(LIB): tclexpat.o
+ $(TCL_SHLIB_LD) -o ${LIB:.so=.la} ${OBJS:.o=.lo} tclexpat.lo -L${LOCALBASE}/lib -rpath "$$(echo $(TCL_PACKAGE_PATH) | cut -f 1 -d :)" -Wl,-rpath,${PREFIX}/lib -lexpat -ltcl85 -module -avoid-version
tclexpat.o: tclexpat.c
- $(TCL_CC) $(CFLAGS) -c $(TCL_DEFS) $(TCL_SHLIB_CFLAGS) -I$(TCL_PREFIX)/include -Iexpat/xmlparse tclexpat.c
+ $(TCL_CC) $(CFLAGS) -c $(TCL_DEFS) $(TCL_SHLIB_CFLAGS) -I$(TCL_PREFIX)/include tclexpat.c
install: $(LIB)
instdir=`echo $(TCL_PACKAGE_PATH) | cut -f 1 -d :` ; \
- mkdir $$instdir/TclExpat-$(TCLEXPAT_VERSION) ; \
- cp $(LIB) pkgIndex.tcl $$instdir
-
+ ${BSD_INSTALL_DATA_DIR} ${DESTDIR}$$instdir/TclExpat-$(TCLEXPAT_VERSION) ; \
+ ${SHLIBTOOL} --mode=install ${BSD_INSTALL_LIB} ${LIB:.so=.la} ${DESTDIR}$$instdir/TclExpat-${TCLEXPAT_VERSION}; \
+ ${SHLIBTOOL} --mode=finish ${DESTDIR}$$instdir/TclExpat-${TCLEXPAT_VERSION}; \
+ ${BSD_INSTALL_DATA} pkgIndex.tcl ${DESTDIR}$$instdir/TclExpat-${TCLEXPAT_VERSION}
clean:
- @cd expat; make clean
rm -f *~ *.o
@if [ ! -z $(TCL_SHLIB_SUFFIX) ] ; then \
echo "rm -f *$(TCL_SHLIB_SUFFIX)" ;\
|