From ec8f7cfa9365f0d4e59081c0d7bb035f0536ccb6 Mon Sep 17 00:00:00 2001 From: mckay Date: Fri, 7 Sep 2012 00:20:46 +0000 Subject: [PATCH] MFS r240157 (MFC r235638,r239348): - Work around failure to compile on FreeBSD 7.x machines. - Correct a regression introduced during the import of file(1) 5.11. PR: 170415 Reviewed by: obrien Approved by: re (kib) git-svn-id: svn://svn.freebsd.org/base/releng/9.1@240179 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- contrib/file/apprentice.c | 2 -- lib/libmagic/Makefile | 5 +++-- lib/libmagic/config.h | 2 ++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/contrib/file/apprentice.c b/contrib/file/apprentice.c index a9d4d17f..8e0f2cf5 100644 --- a/contrib/file/apprentice.c +++ b/contrib/file/apprentice.c @@ -648,7 +648,6 @@ set_test_type(struct magic *mstart, struct magic *m) break; case FILE_REGEX: case FILE_SEARCH: -#ifndef COMPILE_ONLY /* Check for override */ if (mstart->str_flags & STRING_BINTEST) mstart->flag |= BINTEST; @@ -664,7 +663,6 @@ set_test_type(struct magic *mstart, struct magic *m) mstart->flag |= BINTEST; else mstart->flag |= TEXTTEST; -#endif break; case FILE_DEFAULT: /* can't deduce anything; we shouldn't see this at the diff --git a/lib/libmagic/Makefile b/lib/libmagic/Makefile index 7750cd9e..740f52d4 100644 --- a/lib/libmagic/Makefile +++ b/lib/libmagic/Makefile @@ -40,8 +40,9 @@ magic.mgc: mkmagic magic CLEANFILES+= mkmagic build-tools: mkmagic -mkmagic: apprentice.c funcs.c magic.c print.c - ${CC} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} +mkmagic: apprentice.c encoding.c funcs.c getline.c magic.c print.c + ${CC} ${CFLAGS} -DCOMPILE_ONLY -DHOSTPROG ${LDFLAGS} \ + -o ${.TARGET} ${.ALLSRC} 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 c7e38ec7..c17883f7 100644 --- a/lib/libmagic/config.h +++ b/lib/libmagic/config.h @@ -39,7 +39,9 @@ #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 header file. */ #define HAVE_GETOPT_H 1 -- 2.42.0