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
|
#! /bin/sh -e
## 01-Makefile.dpatch by Neal H Walfield <neal@cs.uml.edu> and
## Gergely Nagy <algernon@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Add the necessary includes and other things to the libedit
## DP: Makefile, so it will compile on GNU systems, with our supplied
## DP: glue code
if [ $# -ne 1 ]; then
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
fi
case "$1" in
-patch) patch -f --no-backup-if-mismatch -p0 < $0;;
-unpatch) patch -f --no-backup-if-mismatch -R -p0 < $0;;
*)
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1;;
esac
exit 0
--- Makefile
+++ Makefile
@@ -1,13 +1,26 @@
# $NetBSD: Makefile,v 1.29 2003/12/05 13:37:48 lukem Exp $
# @(#)Makefile 8.1 (Berkeley) 6/4/93
+OS!= sh -c "case `uname -s` in GNU|GNU/*) echo GNU ;; *) uname -s ;; esac"
+
+.if ${OS} == GNU || ${OS} == Linux
+CPPFLAGS+=-I../glibc-compat -I../glibc-bsd-glue
+CFLAGS += -include ../glibc-bsd-glue/bsdcompat.h
+.PATH: ${.CURDIR}/../glibc-bsd-glue ${.CURDIR}/../glibc-compat
+MKLINT=no
+.endif
+
USE_SHLIBDIR= yes
WARNS= 3
LIB= edit
OSRCS= chared.c common.c el.c emacs.c fcns.c help.c hist.c key.c map.c \
parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c
+
+.if ${OS} == GNU || ${OS} == Linux
+OSRCS+= fgetln.c vis.c unvis.c strlcat.c strlcpy.c
+.endif
MAN= editline.3 editrc.5
|