From 6973701a00e3228aeb354768f596e5c35663bdb2 Mon Sep 17 00:00:00 2001 From: Doug Barton Date: Mon, 16 Jun 2008 05:48:15 +0000 Subject: [PATCH] 1. Make the BSD version of cpio the default [1] a. The BSD version will be built and installed unless WITHOUT_BSD_CPIO is defined. b. The GNU version will not be built or installed unless WITH_GNU_CPIO is defined. If this is defined, the symlink in /usr/bin will be to the GNU version whether the BSD version is present or not. When these changes are MFCed the defaults should be flipped. 2. Add a knob to disable the building of GNU grep. This will make it easier for those that want to test the BSD version in the ports. Approved by: kientzle [1] --- gnu/usr.bin/Makefile | 12 ++++++++++-- gnu/usr.bin/cpio/Makefile | 2 -- share/mk/bsd.own.mk | 3 +++ tools/build/options/WITHOUT_BSD_CPIO | 3 +++ tools/build/options/WITHOUT_GNU_GREP | 2 ++ tools/build/options/WITH_GNU_CPIO | 6 ++++++ usr.bin/Makefile | 6 +++++- usr.bin/cpio/Makefile | 2 +- 8 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 tools/build/options/WITHOUT_BSD_CPIO create mode 100644 tools/build/options/WITHOUT_GNU_GREP create mode 100644 tools/build/options/WITH_GNU_CPIO diff --git a/gnu/usr.bin/Makefile b/gnu/usr.bin/Makefile index b54f8409655d..10f230080e16 100644 --- a/gnu/usr.bin/Makefile +++ b/gnu/usr.bin/Makefile @@ -5,7 +5,7 @@ SUBDIR= bc \ ${_binutils} \ ${_cc} \ - cpio \ + ${_cpio} \ ${_cvs} \ dc \ dialog \ @@ -13,7 +13,7 @@ SUBDIR= bc \ diff3 \ ${_gdb} \ ${_gperf} \ - grep \ + ${_grep} \ ${_groff} \ ${_man} \ patch \ @@ -30,10 +30,18 @@ _groff= groff .endif .endif +.if ${MK_GNU_CPIO} == "yes" +_cpio= cpio +.endif + .if ${MK_CVS} != "no" _cvs= cvs .endif +.if ${MK_GNU_GREP} != "no" +_grep= grep +.endif + .if ${MK_MAN} != "no" _man= man .endif diff --git a/gnu/usr.bin/cpio/Makefile b/gnu/usr.bin/cpio/Makefile index 211b068cf60b..96ac02a86dba 100644 --- a/gnu/usr.bin/cpio/Makefile +++ b/gnu/usr.bin/cpio/Makefile @@ -62,9 +62,7 @@ CFLAGS+=-I${.OBJDIR} -I${.CURDIR} -I${CPIODIR}/lib -DHAVE_CONFIG_H \ gcpio.1: ${CPIODIR}/doc/cpio.1 cat ${CPIODIR}/doc/cpio.1 >gcpio.1 -.if !defined(WITH_BSDCPIO) SYMLINKS=gcpio ${BINDIR}/cpio MLINKS=gcpio.1 cpio.1 -.endif .include diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 04d59e5a2829..e358e31239ea 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -287,6 +287,7 @@ WITH_IDEA= ATM \ AUDIT \ AUTHPF \ + BSD_CPIO \ BIND \ BIND_DNSSEC \ BIND_ETC \ @@ -312,6 +313,7 @@ WITH_IDEA= GCOV \ GDB \ GNU \ + GNU_GREP \ GPIB \ GROFF \ HTML \ @@ -374,6 +376,7 @@ MK_${var}:= yes # .for var in \ BIND_LIBS \ + GNU_CPIO \ HESIOD \ IDEA .if defined(WITH_${var}) && defined(WITHOUT_${var}) diff --git a/tools/build/options/WITHOUT_BSD_CPIO b/tools/build/options/WITHOUT_BSD_CPIO new file mode 100644 index 000000000000..9c722ee01851 --- /dev/null +++ b/tools/build/options/WITHOUT_BSD_CPIO @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not build the BSD licensed version of cpio based on +.Xr libarchive 3 . diff --git a/tools/build/options/WITHOUT_GNU_GREP b/tools/build/options/WITHOUT_GNU_GREP new file mode 100644 index 000000000000..23f8de115d49 --- /dev/null +++ b/tools/build/options/WITHOUT_GNU_GREP @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build GNU grep as a part of the base system. diff --git a/tools/build/options/WITH_GNU_CPIO b/tools/build/options/WITH_GNU_CPIO new file mode 100644 index 000000000000..b4e756ae18b0 --- /dev/null +++ b/tools/build/options/WITH_GNU_CPIO @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Set to build GNU cpio as a part of the base system, +and symlink +.Pa /usr/bin/cpio +to this version. +(This will override the symlink to the BSD version.) diff --git a/usr.bin/Makefile b/usr.bin/Makefile index 241d3eb4cf81..02ae8b4a4a23 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -43,7 +43,7 @@ SUBDIR= alias \ comm \ compile_et \ compress \ - cpio \ + ${_cpio} \ cpuset \ csplit \ ${_csup} \ @@ -257,6 +257,10 @@ _nsupdate= nsupdate _bluetooth= bluetooth .endif +.if ${MK_BSD_CPIO} != "no" +_cpio= cpio +.endif + .if ${MK_CALENDAR} != "no" _calendar= calendar .endif diff --git a/usr.bin/cpio/Makefile b/usr.bin/cpio/Makefile index cc5c1065f251..52d23f09c116 100644 --- a/usr.bin/cpio/Makefile +++ b/usr.bin/cpio/Makefile @@ -9,7 +9,7 @@ CFLAGS+= -DBSDCPIO_VERSION_STRING=\"${BSDCPIO_VERSION_STRING}\" CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" LDADD+= -larchive -lz -lbz2 -.if defined(WITH_BSDCPIO) +.if ${MK_GNU_CPIO} != "yes" SYMLINKS=bsdcpio ${BINDIR}/cpio MLINKS= bsdcpio.1 cpio.1 .endif