diff --git a/lib/libmagic/Makefile b/lib/libmagic/Makefile index 59573060afb1..fbf71efac83b 100644 --- a/lib/libmagic/Makefile +++ b/lib/libmagic/Makefile @@ -39,8 +39,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 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 c7e38ec761a1..c17883f76151 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