diff options
| author | David E. O'Brien <obrien@FreeBSD.org> | 2012-09-11 22:38:33 +0000 |
|---|---|---|
| committer | David E. O'Brien <obrien@FreeBSD.org> | 2012-09-11 22:38:33 +0000 |
| commit | c2774610af334a900a3540cfed39e68f5b2cd8ea (patch) | |
| tree | 6dca9cd819c40cc5e97d69acbd873c02e2fd25fe | |
| parent | 08bfef24afdb33f8b9dc059211e35e185a585574 (diff) | |
Notes
| -rw-r--r-- | lib/libmagic/Makefile | 6 | ||||
| -rw-r--r-- | lib/libmagic/config.h | 2 | ||||
| -rw-r--r-- | tools/build/Makefile | 16 |
3 files changed, 17 insertions, 7 deletions
diff --git a/lib/libmagic/Makefile b/lib/libmagic/Makefile index d983813d6e812..d341a3a5f5643 100644 --- a/lib/libmagic/Makefile +++ b/lib/libmagic/Makefile @@ -39,9 +39,9 @@ magic.mgc: mkmagic magic CLEANFILES+= mkmagic build-tools: mkmagic -mkmagic: apprentice.c encoding.c funcs.c getline.c magic.c print.c - ${CC} ${CFLAGS} -DCOMPILE_ONLY -DHOSTPROG ${LDFLAGS} \ - -o ${.TARGET} ${.ALLSRC} +mkmagic: apprentice.c encoding.c funcs.c magic.c print.c + ${CC} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} \ + ${LDADD} FILEVER!= awk '$$1 == "\#define" && $$2 == "VERSION" { print $$3; exit }' \ ${.CURDIR}/config.h diff --git a/lib/libmagic/config.h b/lib/libmagic/config.h index c17883f76151b..c7e38ec761a13 100644 --- a/lib/libmagic/config.h +++ b/lib/libmagic/config.h @@ -39,9 +39,7 @@ #define HAVE_FSEEKO 1 /* Define to 1 if you have the `getline' function. */ -#ifndef HOSTPROG #define HAVE_GETLINE 1 -#endif /* Define to 1 if you have the <getopt.h> header file. */ #define HAVE_GETOPT_H 1 diff --git a/tools/build/Makefile b/tools/build/Makefile index 8e26c29d77357..76493f708ab4e 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 |
