Use the name of the default shell instead of a numeric index to select
the default shell. Idea from: DragonFlyBSD
This commit is contained in:
parent
6c1f15aa0b
commit
b6ff4ff920
@ -98,12 +98,8 @@ hash:
|
|||||||
# allow you to shoot yourself in the foot if you want to :-)
|
# allow you to shoot yourself in the foot if you want to :-)
|
||||||
|
|
||||||
MAKE_SHELL?= sh
|
MAKE_SHELL?= sh
|
||||||
.if ${MAKE_SHELL} == "csh"
|
.if ${MAKE_SHELL} == "csh" || ${MAKE_SHELL} == "sh" || ${MAKE_SHELL} == "ksh"
|
||||||
CFLAGS+= -DDEFSHELL=0
|
CFLAGS+= -DDEFSHELLNAME=\"${MAKE_SHELL}\"
|
||||||
.elif ${MAKE_SHELL} == "sh"
|
|
||||||
CFLAGS+= -DDEFSHELL=1
|
|
||||||
.elif ${MAKE_SHELL} == "ksh"
|
|
||||||
CFLAGS+= -DDEFSHELL=2
|
|
||||||
.else
|
.else
|
||||||
.error "MAKE_SHELL must be set to one of \"csh\", \"sh\" or \"ksh\"."
|
.error "MAKE_SHELL must be set to one of \"csh\", \"sh\" or \"ksh\"."
|
||||||
.endif
|
.endif
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
# a very simple makefile...
|
# a very simple makefile...
|
||||||
pmake:
|
pmake:
|
||||||
@echo 'make started.'
|
@echo 'make started.'
|
||||||
cc -DDEFSHELL=1 -I. -c *.c
|
cc -DDEFSHELLNAME=\"sh\" -I. -c *.c
|
||||||
cc *.o -o pmake
|
cc *.o -o pmake
|
||||||
@echo 'make completed.'
|
@echo 'make completed.'
|
||||||
|
@ -2719,7 +2719,7 @@ Shell_Init(void)
|
|||||||
for (i = 0; shells_init[i] != NULL; i++) {
|
for (i = 0; shells_init[i] != NULL; i++) {
|
||||||
sh = JobParseShellSpec(shells_init[i], &fullSpec);
|
sh = JobParseShellSpec(shells_init[i], &fullSpec);
|
||||||
TAILQ_INSERT_TAIL(&shells, sh, link);
|
TAILQ_INSERT_TAIL(&shells, sh, link);
|
||||||
if (i == DEFSHELL)
|
if (strcmp(sh->name, DEFSHELLNAME) == 0)
|
||||||
commandShell = sh;
|
commandShell = sh;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user