Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > c9ac48381e4357eb0828483302c0acdc > files > 2

editline-1.12-9mdv2008.0.src.rpm

--- editline-1.12.orig/Makefile
+++ editline-1.12/Makefile
@@ -17,8 +17,10 @@
 ##	-DUSE_TERMCAP		Use the termcap library for terminal size
 ##				see LDFLAGS, below, if you set this.
 ##	-DNEED_PERROR		Don't have perror() (used in testit)
+
 ##	-DDO_SIGTSTP		Send SIGTSTP on "suspend" key
 DEFS	= -DANSI_ARROWS -DHAVE_STDLIB -DHAVE_TCGETATTR -DHIDE -DUSE_DIRENT -DSYS_UNIX -DNEED_STRDUP
+DEFS	= -DANSI_ARROWS -DHAVE_STDLIB -DHAVE_TCGETATTR -DHIDE -DUSE_DIRENT -DSYS_UNIX
 
 ##  Set your C compiler:
 WARN	= -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings \
@@ -26,7 +28,7 @@
 CC	= gcc -ansi $(WARN)
 #CFLAGS	= $(DEFS) -O -g
 #CC	= gcc
-CFLAGS	= $(DEFS) -g
+CFLAGS	= $(DEFS) -D_POSIX_SOURCE -D_BSD_SOURCE
 
 ##  If you have -DUSE_TERMCAP, set this as appropriate:
 #LDFLAGS = -ltermlib
@@ -41,18 +43,31 @@
 SOURCES	= editline.c complete.c sysunix.c
 OBJECTS	= editline.o complete.o sysunix.o
 
-all:		libedit.a
+all:		libeditline.a libeditline.la
+
+testit:		testit.c libeditline.a
+	$(CC) $(CFLAGS) -o testit testit.c libeditline.a $(LDFLAGS)
+
+editline.o editline.lo : editline.c
+	libtool $(CC) $(CFLAGS) -c $<
 
-testit:		testit.c libedit.a
-	$(CC) $(CFLAGS) -o testit testit.c libedit.a $(LDFLAGS)
+complete.o complete.lo : complete.c
+	libtool $(CC) $(CFLAGS) -c $<
+
+sysunix.o sysunix.lo : sysunix.c
+	libtool $(CC) $(CFLAGS) -c $<
 
 shar:		FORCE
 	shar `sed -e 1,2d -e 's/[ 	].*//' <MANIFEST` >shar
 
+install:
+	install -m644 libeditline.a $(DESTDIR)/usr/lib/
+	libtool install -c libeditline.la $(DESTDIR)/usr/lib/libeditline.la
+
 FORCE:
 
 clean:
-	rm -f *.[oa] testit foo core tags lint lint.all a.out Part01
+	rm -rf *.[oa] *.lo testit foo core tags lint lint.all a.out Part01 .libs
 
 lint:		testit
 	lint -a -b -u -x $(DEFS) $(SOURCES) testit.c >lint.all
@@ -61,9 +76,10 @@
 		-e '/mix of old and new style function declaration/'d \
 		<lint.all >lint
 
-libedit.a:	$(OBJECTS)
-	@rm -f $@
-	ar r $@ $(OBJECTS)
-	$(RANLIB) $@
+#libedit.a:	$(OBJECTS)
+#	libtool $(CC) $(LDFLAGS) -o $@ $^
+
+libeditline.a libeditline.la :	$(OBJECTS:.o=.lo)
+	libtool $(CC) -rpath /usr/lib $(LDFLAGS) -version-info 0:0:0 -o $@ $^
 
 $(OBJECTS):	editline.h
--- editline-1.12.orig/editline.c
+++ editline-1.12/editline.c
@@ -5,6 +5,7 @@
 #include "editline.h"
 #include <signal.h>
 #include <ctype.h>
+#include <unistd.h>
 
 /*
 **  Manifest constants.
@@ -104,8 +105,10 @@
 **  Declarations.
 */
 STATIC CHAR	*editinput();
+#if 0
 extern int	read();
 extern int	write();
+#endif
 #if	defined(USE_TERMCAP)
 extern char	*getenv();
 extern char	*tgetstr();
--- editline-1.12.orig/include_editline.h
+++ editline-1.12/include_editline.h
@@ -0,0 +1,2 @@
+extern char	*readline();
+extern void	add_history();