summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2012-09-11 22:38:33 +0000
committerobrien <obrien@FreeBSD.org>2012-09-11 22:38:33 +0000
commit7b9a39e571e34d69700525b7529ad7961aee4341 (patch)
tree6dca9cd819c40cc5e97d69acbd873c02e2fd25fe /tools
parent0efafa1fad361ad81136f211821bbe8f975755cc (diff)
downloadFreeBSD-src-7b9a39e571e34d69700525b7529ad7961aee4341.zip
FreeBSD-src-7b9a39e571e34d69700525b7529ad7961aee4341.tar.gz
r235638 is not the clean way to add support for building on ancient FreeBSD
versions. Instead use Imp's good work on "legacy" and follow the outcome of the previous TRB discussions on this topic. Now use the libc getline() if it exists, and only where it doesn't create a bootstraping version.
Diffstat (limited to 'tools')
-rw-r--r--tools/build/Makefile16
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/build/Makefile b/tools/build/Makefile
index 8e26c29..76493f7 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -3,12 +3,24 @@
.PATH: ${.CURDIR}/../../include
LIB= egacy
-SRCS=
+SRC=
INCSGROUPS= INCS
-INCS=
+INCS=
BOOTSTRAPPING?= 0
+_WITH_GETLINE!= grep -c _WITH_GETLINE /usr/include/stdio.h || true
+.if ${_WITH_GETLINE} == 0
+.PATH: ${.CURDIR}/../../contrib/file ${.CURDIR}/../../lib/libmagic
+SRCS= getline.c config.h
+CFLAGS+= -DHAVE_CONFIG_H -I.
+CLEANFILES+= config.h
+
+${SRCS:N*.h:R:S/$/.o/}: config.h
+config.h: ${.CURDIR}/../../lib/libmagic/config.h
+ grep -v HAVE_GETLINE ${.ALLSRC} > ${.TARGET}
+.endif
+
.if empty(SRCS)
SRCS= dummy.c
.endif
OpenPOWER on IntegriCloud