Date: Sat, 19 May 2001 00:49:57 +0900 From: "Akinori MUSHA" <knu@iDaemons.org> To: Maxim Sobolev <sobomax@FreeBSD.org> Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/make Makefile Message-ID: <86ofsqejx6.wl@archon.local.idaemons.org> In-Reply-To: <200105180905.f4I95vH45495@freefall.freebsd.org> References: <200105180905.f4I95vH45495@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
At Fri, 18 May 2001 02:05:56 -0700 (PDT), sobomax wrote: > sobomax 2001/05/18 02:05:56 PDT > > Modified files: > usr.bin/make Makefile > Log: > By default build make(1) as a static binary. It costs only 100k of additional > disk space, buf provides measureable speed increase for make-intensive > operations, such as pkg_version(1), `make world' and so on. Speaking of speed increase, does anybody object against MFC'ing this? This allows you to use /bin/ksh instead of the default of /bin/sh. Index: Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/make/Makefile,v retrieving revision 1.13 diff -u -r1.13 Makefile --- Makefile 1999/11/15 17:07:45 1.13 +++ Makefile 2001/05/18 15:40:21 @@ -12,4 +12,20 @@ lstMember.c lstNext.c lstOpen.c lstRemove.c lstReplace.c lstSucc.c .PATH: ${.CURDIR}/lst.lib +# Set the shell which make(1) uses. Bourne is the default, but a decent +# Korn shell works fine, and much faster. Using the C shell for this +# will almost certainly break everything, but it's Unix tradition to +# allow you to shoot yourself in the foot if you want to :-) + +MAKE_SHELL?= sh +.if ${MAKE_SHELL} == "csh" +CFLAGS+= -DDEFSHELL=0 +.elif ${MAKE_SHELL} == "sh" +CFLAGS+= -DDEFSHELL=1 +.elif ${MAKE_SHELL} == "ksh" +CFLAGS+= -DDEFSHELL=2 +.else +.error "MAKE_SHELL must be set to one of \"csh\", \"sh\" or \"ksh\"." +.endif + .include <bsd.prog.mk> Index: Makefile.dist =================================================================== RCS file: /home/ncvs/src/usr.bin/make/Makefile.dist,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 Makefile.dist --- Makefile.dist 1994/05/27 12:32:13 1.1.1.1 +++ Makefile.dist 2001/05/18 15:34:48 @@ -1,7 +1,7 @@ # a very simple makefile... pmake: @echo 'make started.' - cc -I. -c *.c + cc -DDEFSHELL=1 -I. -c *.c cd lst.lib; cc -I.. -c *.c cc *.o lst.lib/*.o -o pmake @echo 'make completed.' Index: config.h =================================================================== RCS file: /home/ncvs/src/usr.bin/make/config.h,v retrieving revision 1.9 diff -u -r1.9 config.h --- config.h 1999/09/10 20:51:59 1.9 +++ config.h 2001/05/18 15:35:11 @@ -39,8 +39,6 @@ * $FreeBSD: src/usr.bin/make/config.h,v 1.9 1999/09/10 20:51:59 julian Exp $ */ -#define DEFSHELL 1 /* Bourne shell */ - /* * DEFMAXJOBS * DEFMAXLOCAL Index: job.c =================================================================== RCS file: /home/ncvs/src/usr.bin/make/job.c,v retrieving revision 1.17.2.2 diff -u -r1.17.2.2 job.c --- job.c 2001/02/13 03:13:57 1.17.2.2 +++ job.c 2001/05/18 15:39:14 @@ -198,6 +198,16 @@ "v", "e", }, /* + * KSH description. The Korn shell has a superset of + * the Bourne shell's functionality. + */ +{ + "ksh", + TRUE, "set -", "set -v", "set -", 5, + TRUE, "set -e", "set +e", + "v", "e", +}, + /* * UNKNOWN. */ { Index: main.c =================================================================== RCS file: /home/ncvs/src/usr.bin/make/main.c,v retrieving revision 1.35.2.4 diff -u -r1.35.2.4 main.c --- main.c 2001/03/04 09:40:32 1.35.2.4 +++ main.c 2001/05/18 15:38:38 @@ -486,6 +486,13 @@ /* avoid faults on read-only strings */ static char syspath[] = _PATH_DEFSYSPATH; +#if DEFSHELL == 2 + /* + * Turn off ENV to make ksh happier. + */ + unsetenv("ENV"); +#endif + #ifdef RLIMIT_NOFILE /* * get rid of resource limit on file descriptors @@ -1034,7 +1041,13 @@ (void) dup2(fds[1], 1); (void) close(fds[1]); +#if DEFSHELL == 1 (void) execv("/bin/sh", args); +#elif DEFSHELL == 2 + (void) execv("/bin/ksh", args); +#else +#error "DEFSHELL must be 1 or 2." +#endif _exit(1); /*NOTREACHED*/ -- / /__ __ Akinori.org / MUSHA.org / ) ) ) ) / FreeBSD.org / Ruby-lang.org Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp "Freeze this moment a little bit longer, make each impression a little bit stronger.. Experience slips away -- Time stand still" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86ofsqejx6.wl>