File: 01-Makefile.dpatch

package info (click to toggle)
libedit 2.6.cvs.20020109-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 676 kB
  • ctags: 1,672
  • sloc: ansic: 12,214; sh: 328; makefile: 189
file content (51 lines) | stat: -rw-r--r-- 1,366 bytes parent folder | download
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
#! /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,10 +1,23 @@
 #	$NetBSD: Makefile,v 1.21 2001/12/28 01:32:38 lukem Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/4/93
 
+OS!=	uname -s
+
+.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
+
 LIB=	edit
 USE_SHLIBDIR=	yes
 
 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