summaryrefslogtreecommitdiff
path: root/devel/readline/patches/patch-ae
blob: 1053138561ac48486bc0de88bcb1dbb3a032ec7b (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
$NetBSD: patch-ae,v 1.9 2004/04/26 08:01:20 jlam Exp $

--- Makefile.in.orig	Thu Jan 24 16:15:24 2002
+++ Makefile.in
@@ -18,6 +18,9 @@
 RL_LIBRARY_VERSION = @LIBVERSION@
 RL_LIBRARY_NAME = readline
 
+SHLIB_MAJOR = @SHLIB_MAJOR@
+SHLIB_MINOR = @SHLIB_MINOR@
+
 srcdir = @srcdir@
 VPATH = .:@srcdir@
 top_srcdir = @top_srcdir@
@@ -80,11 +83,12 @@ GCC_LINT_CFLAGS = $(XCCFLAGS) $(GCC_LINT
 
 .c.o:
 	${RM} $@
-	$(CC) -c $(CCFLAGS) $<
+	$(LIBTOOL) --mode=compile $(CC) -c $(CCFLAGS) $<
 
 # The name of the main library target.
 LIBRARY_NAME = libreadline.a
 STATIC_LIBS = libreadline.a libhistory.a
+LIBTOOL_LIBS = libreadline.la libhistory.la
 
 # The C code source files for this library.
 CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \
@@ -133,6 +137,8 @@ INSTALL_TARGETS = @STATIC_INSTALL_TARGET
 
 all: $(TARGETS)
 
+all-la: $(LIBTOOL_LIBS)
+
 everything: all examples
 
 static: $(STATIC_LIBS)
@@ -142,6 +148,12 @@ libreadline.a: $(OBJECTS)
 	$(AR) $(ARFLAGS) $@ $(OBJECTS)
 	-test -n "$(RANLIB)" && $(RANLIB) $@
 
+libreadline.la: $(OBJECTS)
+	${LIBTOOL} --mode=uninstall ${RM} $@
+	${LIBTOOL} --mode=link ${CC} -o $@ ${OBJECTS:.o=.lo}		\
+		-rpath $(libdir)					\
+		-version-info ${SHLIB_MAJOR}:${SHLIB_MINOR}
+
 libhistory.a: $(HISTOBJ) xmalloc.o
 	$(RM) $@
 	$(AR) $(ARFLAGS) $@ $(HISTOBJ) xmalloc.o
@@ -151,13 +163,27 @@ libhistory.a: $(HISTOBJ) xmalloc.o
 # it with the right flags when it's built as part of readline
 tilde.o:	tilde.c
 	rm -f $@
-	$(CC) $(CCFLAGS) -DREADLINE_LIBRARY -c $(srcdir)/tilde.c
+	$(LIBTOOL) --mode=compile $(CC) $(CCFLAGS) -DREADLINE_LIBRARY -c $(srcdir)/tilde.c
 
-readline: $(OBJECTS) readline.h rldefs.h chardefs.h ./libreadline.a
-	$(CC) $(CCFLAGS) -o $@ ./examples/rl.c ./libreadline.a ${TERMCAP_LIB}
+libhistory.la: $(HISTOBJ) xmalloc.o
+	${LIBTOOL} --mode=uninstall $(RM) $@
+	${LIBTOOL} --mode=link ${CC} -o $@ ${HISTOBJ:.o=.lo} xmalloc.lo	\
+		-rpath $(libdir)					\
+		-version-info ${SHLIB_MAJOR}:${SHLIB_MINOR}
+
+readline: $(OBJECTS) readline.h rldefs.h chardefs.h ./$(LIBRARY_NAME)
+	${LIBTOOL} $(CC) $(CCFLAGS) $(LDFLAGS) -o $@ ./examples/rl.c ./$(LIBRARY_NAME) ${TERMCAP_LIB}
 
 lint:	force
 	$(MAKE) $(MFLAGS) CCFLAGS='$(GCC_LINT_CFLAGS)' static
+
+install-la: installdirs $(LIBTOOL_LIBS) install-headers
+	${LIBTOOL} --mode=install ${INSTALL_DATA} libreadline.la $(libdir)
+	${LIBTOOL} --mode=install ${INSTALL_DATA} libhistory.la $(libdir)
+	-( if test -d doc ; then \
+		cd doc && \
+		${MAKE} ${MFLAGS} infodir=$(infodir) install; \
+ 	  fi )
 
 Makefile makefile: config.status $(srcdir)/Makefile.in
 	CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status