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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
|
--- 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();
--- editline-1.12.orig/libeditline.la
+++ editline-1.12/libeditline.la
@@ -0,0 +1,35 @@
+# libeditline.la - a libtool library file
+# Generated by ltmain.sh - GNU libtool 1.5.2 (1.1220.2.60 2004/01/25 12:25:08) Debian: 192 $
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='libeditline.so.0'
+
+# Names of this library.
+library_names='libeditline.so.0.0.0 libeditline.so.0 libeditline.so'
+
+# The name of the static archive.
+old_library='libeditline.a'
+
+# Libraries that this one depends upon.
+dependency_libs=''
+
+# Version information for libeditline.
+current=0
+age=0
+revision=0
+
+# Is this an already installed library?
+installed=no
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/usr/lib'
--- 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 --mode=compile $(CC) $(CFLAGS) -c $<
-testit: testit.c libedit.a
- $(CC) $(CFLAGS) -o testit testit.c libedit.a $(LDFLAGS)
+complete.o complete.lo : complete.c
+ libtool --mode=compile $(CC) $(CFLAGS) -c $<
+
+sysunix.o sysunix.lo : sysunix.c
+ libtool --mode=compile $(CC) $(CFLAGS) -c $<
shar: FORCE
shar `sed -e 1,2d -e 's/[ ].*//' <MANIFEST` >shar
+install:
+ install -m644 libeditline.a $(DESTDIR)/usr/lib/
+ libtool --mode=install 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 --mode=link $(CC) -rpath /usr/lib $(LDFLAGS) -version-info 0:0:0 -o $@ $^
$(OBJECTS): editline.h
|