From c7b6816fa9c3d3237052d8756012c131dfbbd8b0 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Wed, 4 Feb 2015 10:24:40 +0000 Subject: [PATCH] Add MK_FILE to control whether or not to build file(1), libmagic(3), etc MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division --- lib/Makefile | 6 +++++- share/mk/src.opts.mk | 1 + tools/build/options/WITHOUT_FILE | 4 ++++ usr.bin/Makefile | 5 ++++- 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 tools/build/options/WITHOUT_FILE diff --git a/lib/Makefile b/lib/Makefile index cd0f4a13c14a..c00af75f70b4 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -63,7 +63,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ libkvm \ ${_libldns} \ liblzma \ - libmagic \ + ${_libmagic} \ libmandoc \ libmemstat \ libmd \ @@ -195,6 +195,10 @@ _cuse= libcuse _libelftc= libelftc .endif +.if ${MK_FILE} != "no" +_libmagic= libmagic +.endif + .if ${MK_GPIO} != "no" _libgpio= libgpio .endif diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index d308c4df91bb..fca992b9ab49 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -83,6 +83,7 @@ __DEFAULT_YES_OPTIONS = \ ELFTOOLCHAIN_TOOLS \ EXAMPLES \ FDT \ + FILE \ FINGER \ FLOPPY \ FMTREE \ diff --git a/tools/build/options/WITHOUT_FILE b/tools/build/options/WITHOUT_FILE new file mode 100644 index 000000000000..636d00a7fab2 --- /dev/null +++ b/tools/build/options/WITHOUT_FILE @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr file 1 +and related programs. diff --git a/usr.bin/Makefile b/usr.bin/Makefile index 70e131685aec..618170c58d43 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -48,7 +48,6 @@ SUBDIR= ${_addr2line} \ expand \ false \ fetch \ - file \ find \ fmt \ fold \ @@ -246,6 +245,10 @@ _size= size _strings= strings .endif +.if ${MK_FILE} != "no" +SUBDIR+= file +.endif + .if ${MK_FINGER} != "no" SUBDIR+= finger .endif