Makefile SH variable now tweaks the default shell used by our scripts.
This commit is contained in:
		| @@ -1,8 +1,5 @@ | |||||||
| DIR=		/etc | DIR=		/etc | ||||||
| SRCS=		rc.in rc.shutdown.in | CONF=		${CONTENTS} | ||||||
| OBJS=		${SRCS:.in=} |  | ||||||
| CONF=		${OBJS} |  | ||||||
|  |  | ||||||
|  |  | ||||||
| MK=		../mk | MK=		../mk | ||||||
| include ${MK}/scripts.mk | include ${MK}/scripts.mk | ||||||
| @@ -10,5 +7,4 @@ include Makefile.${OS} | |||||||
|  |  | ||||||
| .SUFFIXES:	.in | .SUFFIXES:	.in | ||||||
| .in: | .in: | ||||||
| 	sed -e s':@TERM@:${DEFTERM}:' $< > $@ | 	sed -e 's:@SHELL@:${SHELL}:' -e 's:@TERM@:${DEFTERM}:' $< > $@ | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| #!/bin/sh | #!@SHELL@ | ||||||
| # Copyright 2007-2008 Roy Marples <roy@marples.name> | # Copyright 2007-2008 Roy Marples <roy@marples.name> | ||||||
| # All rights reserved. Released under the 2-clause BSD license. | # All rights reserved. Released under the 2-clause BSD license. | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| #!/bin/sh | #!@SHELL@ | ||||||
| # Copyright 2007-2008 Roy Marples <roy@marples.name> | # Copyright 2007-2008 Roy Marples <roy@marples.name> | ||||||
| # All rights reserved. Released under the 2-clause BSD license. | # All rights reserved. Released under the 2-clause BSD license. | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								init.d/halt.sh → init.d/halt.sh.in
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										2
									
								
								init.d/halt.sh → init.d/halt.sh.in
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							| @@ -1,4 +1,4 @@ | |||||||
| #!/bin/sh | #!@SHELL@ | ||||||
| # Copyright 2007-2008 Roy Marples <roy@marples.name> | # Copyright 2007-2008 Roy Marples <roy@marples.name> | ||||||
| # All rights reserved. Released under the 2-clause BSD license. | # All rights reserved. Released under the 2-clause BSD license. | ||||||
| 
 | 
 | ||||||
| @@ -1,14 +1,23 @@ | |||||||
| # Install rules for our scripts | # Install rules for our scripts | ||||||
| # Copyright 2007-2008 Roy Marples <roy@marples.name> | # Copyright 2007-2008 Roy Marples <roy@marples.name> | ||||||
|  |  | ||||||
|  | _IN_SH=	ls -1 | sed -n -e 's:\.in$$::p' | xargs | ||||||
|  | _IN!=		${_IN_SH} | ||||||
|  | OBJS+=		${_IN}$(shell ${_IN_SH}) | ||||||
|  |  | ||||||
| # We store the contents of the directory for ease of use in Makefiles | # We store the contents of the directory for ease of use in Makefiles | ||||||
| _CONTENTS_SH=	ls -1 | grep -v Makefile | xargs | _CONTENTS_SH=	ls -1 | grep -v "\(Makefile\|.in$$\)" | sed -e 's:\.in$$::g' | xargs | ||||||
| _CONTENTS!=	${_CONTENTS_SH} | _CONTENTS!=	${_CONTENTS_SH} | ||||||
| CONTENTS=	${_CONTENTS}$(shell ${_CONTENTS_SH}) | CONTENTS=	${_CONTENTS}$(shell ${_CONTENTS_SH}) | ||||||
|  |  | ||||||
| include ${MK}/sys.mk | include ${MK}/sys.mk | ||||||
| include ${MK}/os.mk | include ${MK}/os.mk | ||||||
|  |  | ||||||
|  | # Tweak our shell scripts | ||||||
|  | .SUFFIXES:	.sh.in | ||||||
|  | .sh.in.sh: | ||||||
|  | 	sed -e 's:@SHELL@:${SH}:g' -e 's:@LIB@:${LIBNAME}:g' $< > $@ | ||||||
|  |  | ||||||
| all: ${OBJS} | all: ${OBJS} | ||||||
|  |  | ||||||
| realinstall: ${BIN} ${CONF} ${CONF_APPEND} | realinstall: ${BIN} ${CONF} ${CONF_APPEND} | ||||||
|   | |||||||
| @@ -5,6 +5,7 @@ AR?=			ar | |||||||
| ECHO?=			echo | ECHO?=			echo | ||||||
| INSTALL?=		install | INSTALL?=		install | ||||||
| RANLIB?=		ranlib | RANLIB?=		ranlib | ||||||
|  | SH=			/bin/sh | ||||||
|  |  | ||||||
| PICFLAG?=		-fPIC | PICFLAG?=		-fPIC | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								sh.BSD/init.sh → sh.BSD/init.sh.in
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										2
									
								
								sh.BSD/init.sh → sh.BSD/init.sh.in
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							| @@ -1,4 +1,4 @@ | |||||||
| #!/bin/sh | #!@SHELL@ | ||||||
| # Copyright 2007-2008 Roy Marples <roy@marples.name> | # Copyright 2007-2008 Roy Marples <roy@marples.name> | ||||||
| # All rights reserved. Released under the 2-clause BSD license. | # All rights reserved. Released under the 2-clause BSD license. | ||||||
| 
 | 
 | ||||||
							
								
								
									
										2
									
								
								sh.Linux/init-early.sh → sh.Linux/init-early.sh.in
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										2
									
								
								sh.Linux/init-early.sh → sh.Linux/init-early.sh.in
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							| @@ -1,4 +1,4 @@ | |||||||
| #!/bin/sh | #!@SHELL@ | ||||||
| # Copyright 2007-2008 Roy Marples <roy@marples.name> | # Copyright 2007-2008 Roy Marples <roy@marples.name> | ||||||
| # All rights reserved. Released under the 2-clause BSD license. | # All rights reserved. Released under the 2-clause BSD license. | ||||||
| 
 | 
 | ||||||
							
								
								
									
										2
									
								
								sh.Linux/init.sh → sh.Linux/init.sh.in
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										2
									
								
								sh.Linux/init.sh → sh.Linux/init.sh.in
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							| @@ -1,4 +1,4 @@ | |||||||
| #!/bin/sh | #!@SHELL@ | ||||||
| # Copyright 1999-2007 Gentoo Foundation | # Copyright 1999-2007 Gentoo Foundation | ||||||
| # Copyright 2007-2008 Roy Marples <roy@marples.name> | # Copyright 2007-2008 Roy Marples <roy@marples.name> | ||||||
| # All rights reserved. Released under the 2-clause BSD license. | # All rights reserved. Released under the 2-clause BSD license. | ||||||
| @@ -1,7 +1,5 @@ | |||||||
| DIR=	${RC_LIB}/sh | DIR=	${RC_LIB}/sh | ||||||
| SRCS=	functions.in rc-functions.in | INC=	init-common-post.sh rc-mount.sh functions.sh rc-functions.sh | ||||||
| OBJS=	${SRCS:.in=.sh} |  | ||||||
| INC=	init-common-post.sh rc-mount.sh ${OBJS} |  | ||||||
| BIN=	gendepends.sh net.sh runscript.sh | BIN=	gendepends.sh net.sh runscript.sh | ||||||
|  |  | ||||||
| INSTALLAFTER=	_installafter | INSTALLAFTER=	_installafter | ||||||
| @@ -12,11 +10,6 @@ include ${MK}/os.mk | |||||||
| include Makefile.${SUBOS} | include Makefile.${SUBOS} | ||||||
| include ${MK}/scripts.mk | include ${MK}/scripts.mk | ||||||
|  |  | ||||||
| # Ensure that the lib name is correct |  | ||||||
| .SUFFIXES: .in .sh |  | ||||||
| .in.sh: |  | ||||||
| 	sed -e 's:/lib/:/${LIBNAME}/:g' $< > $@ |  | ||||||
|  |  | ||||||
| _installafter: | _installafter: | ||||||
| 	${INSTALL} -d ${DESTDIR}/etc/init.d | 	${INSTALL} -d ${DESTDIR}/etc/init.d | ||||||
| 	@# Provide an init script for the loopback interface | 	@# Provide an init script for the loopback interface | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								sh/gendepends.sh → sh/gendepends.sh.in
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										2
									
								
								sh/gendepends.sh → sh/gendepends.sh.in
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							| @@ -1,4 +1,4 @@ | |||||||
| #!/bin/sh | #!@SHELL@ | ||||||
| # Shell wrapper to list our dependencies | # Shell wrapper to list our dependencies | ||||||
| 
 | 
 | ||||||
| # Copyright 2007-2008 Roy Marples <roy@marples.name> | # Copyright 2007-2008 Roy Marples <roy@marples.name> | ||||||
							
								
								
									
										2
									
								
								sh/runscript.sh → sh/runscript.sh.in
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										2
									
								
								sh/runscript.sh → sh/runscript.sh.in
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							| @@ -1,4 +1,4 @@ | |||||||
| #!/bin/sh | #!@SHELL@ | ||||||
| # Shell wrapper for runscript | # Shell wrapper for runscript | ||||||
| 
 | 
 | ||||||
| # Copyright 2007-2008 Roy Marples <roy@marples.name> | # Copyright 2007-2008 Roy Marples <roy@marples.name> | ||||||
		Reference in New Issue
	
	Block a user