From 85d7de106cd1eb8f6c4d97fc4542bf6df17ff6c3 Mon Sep 17 00:00:00 2001 From: Gabor Kovesdan Date: Fri, 11 May 2012 12:47:21 +0000 Subject: [PATCH] - Hook up BSD sort to the build. By default, it will be installed as "bsdsort" and GNU sort will be the default "sort". When WITH_BSD_SORT is set, BSD sort will be the default "sort" and GNU sort will be installed as "gnusort". --- gnu/usr.bin/sort/Makefile | 11 +++++++++++ share/mk/bsd.own.mk | 1 + tools/build/options/WITH_BSD_SORT | 2 ++ usr.bin/Makefile | 1 + 4 files changed, 15 insertions(+) create mode 100644 tools/build/options/WITH_BSD_SORT diff --git a/gnu/usr.bin/sort/Makefile b/gnu/usr.bin/sort/Makefile index e3a005dfbbc..a116a637dec 100644 --- a/gnu/usr.bin/sort/Makefile +++ b/gnu/usr.bin/sort/Makefile @@ -3,7 +3,18 @@ SORTDIR= ${.CURDIR}/../../../contrib/gnu-sort .PATH: ${SORTDIR}/lib ${SORTDIR}/src ${SORTDIR}/man +.include + +.if ${MK_BSD_SORT} != "yes" PROG= sort +.else +PROG= gnusort + +CLEANFILES+= gnusort.1 +gnusort.1: sort.1 + cp ${.ALLSRC} ${.TARGET} +.endif + SRCS= sort.c \ __fpending.c \ argmatch.c \ diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 6b5180a4b31..9802e79eebf 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -413,6 +413,7 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ BSD_GREP \ + BSD_SORT \ BIND_IDN \ BIND_LARGE_FILE \ BIND_LIBS \ diff --git a/tools/build/options/WITH_BSD_SORT b/tools/build/options/WITH_BSD_SORT new file mode 100644 index 00000000000..a9e654d2209 --- /dev/null +++ b/tools/build/options/WITH_BSD_SORT @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Install BSD-licensed sort as 'sort' instead of GNU sort. diff --git a/usr.bin/Makefile b/usr.bin/Makefile index ce8e48c1992..bcdfbcda485 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -141,6 +141,7 @@ SUBDIR= alias \ shar \ showmount \ sockstat \ + sort \ split \ stat \ stdbuf \