This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[fixinc patch] Re: egcs-19990405 fixincludes SHELL requirement (hpux10.20)
- To: Tim C Prince <Prince_Tim_C at solarturbines dot com>
- Subject: [fixinc patch] Re: egcs-19990405 fixincludes SHELL requirement (hpux10.20)
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 07 Apr 1999 09:24:07 -0300
- Cc: egcs-bugs at egcs dot cygnus dot com, egcs-patches at egcs dot cygnus dot com
- References: <"3708E872.6E8C.F372.000*/c=US/admd= /prmd=Cat/o=GWise/s=Prince/g=Tim/i=C/"@MHS>
On Apr 5, 1999, Tim C Prince <Prince_Tim_C@solarturbines.com> wrote:
> The new fixincludes apparently depend on the SHELL
> environment being set to a suitable value.
Here's a patch that should fix this. We can't expect SHELL to be set
to a Bourne Shell-compatible shell :-(
Jeff, is this ok to install?
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Brasil
{oliva,Alexandre.Oliva}@dcc.unicamp.br aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
*** E-mail about software projects will be forwarded to mailing lists
? gcc/testsuite/g++.old-deja/g++.oliva
Index: gcc/ChangeLog
from Alexandre Oliva <oliva@dcc.unicamp.br>
* Makefile.in (stmp-fixinc): Pass $(SHELL) to fixinc.sh as
CONFIG_SHELL.
* Makefile.in (fixinc.sh): Ditto, to mkfixinc.sh.
* fixinc/mkfixinc.sh: Refer to CONFIG_SHELL, so as not to be
trapped if the user's SHELL is /bin/csh; default to /bin/sh.
* fixinc/procopen.c (chain_open): Likewise; default remains sh.
Index: gcc/Makefile.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/Makefile.in,v
retrieving revision 1.255
diff -u -r1.255 Makefile.in
--- gcc/Makefile.in 1999/04/05 11:03:57 1.255
+++ gcc/Makefile.in 1999/04/07 12:26:26
@@ -2117,7 +2117,8 @@
fixinc.sh: $(srcdir)/fixinc/mkfixinc.sh
MAKE="$(MAKE)"; srcdir=`cd $(srcdir)/fixinc; pwd` ; \
- export MAKE srcdir ; \
+ CONFIG_SHELL="$(SHELL)" ; \
+ export MAKE srcdir CONFIG_SHELL ; \
cd ./fixinc; $(SHELL) $${srcdir}/mkfixinc.sh $(target)
##stmp-fixinc: $(FIXINCLUDES) gsyslimits.h
@@ -2144,8 +2145,8 @@
stmp-fixinc: fixinc.sh gsyslimits.h
rm -rf include; mkdir include
TARGET_MACHINE=$(target); srcdir=`cd $(srcdir); pwd`; \
- INSTALL_ASSERT_H=$(INSTALL_ASSERT_H); \
- export TARGET_MACHINE srcdir INSTALL_ASSERT_H; \
+ INSTALL_ASSERT_H=$(INSTALL_ASSERT_H); CONFIG_SHELL="$(SHELL)"; \
+ export TARGET_MACHINE srcdir INSTALL_ASSERT_H CONFIG_SHELL; \
$(SHELL) ./fixinc.sh `pwd`/include $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS)
rm -f include/syslimits.h
if [ -f include/limits.h ]; then \
Index: gcc/fixinc/mkfixinc.sh
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/fixinc/mkfixinc.sh,v
retrieving revision 1.10
diff -u -r1.10 mkfixinc.sh
--- gcc/fixinc/mkfixinc.sh 1999/04/02 10:50:41 1.10
+++ gcc/fixinc/mkfixinc.sh 1999/04/07 12:26:29
@@ -123,11 +123,11 @@
# OK. We gotta make the thing.
#
-echo $MAKE SHELL=\"$SHELL\" install
+echo $MAKE SHELL=\"${CONFIG_SHELL-/bin/sh}\" install
# make and install either the binary or the default script
#
-$MAKE SHELL="$SHELL" install && exit 0
+$MAKE SHELL="${CONFIG_SHELL-/bin/sh}" install && exit 0
# Where is our inclhack script? That is the backup
# in case we are unable to make a working binary.
Index: gcc/fixinc/procopen.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/fixinc/procopen.c,v
retrieving revision 1.3
diff -u -r1.3 procopen.c
--- gcc/fixinc/procopen.c 1999/03/17 22:03:32 1.3
+++ gcc/fixinc/procopen.c 1999/04/07 12:26:29
@@ -127,14 +127,14 @@
/*
* If the arg list does not have a program,
- * assume the "SHELL" from the environment, or, failing
+ * assume the "CONFIG_SHELL" from the environment, or, failing
* that, then sh. Set argv[0] to whatever we decided on.
*/
if (pz_cmd = *pp_args,
(pz_cmd == (char *) NULL) || (*pz_cmd == '\0'))
{
- pz_cmd = getenv ("SHELL");
+ pz_cmd = getenv ("CONFIG_SHELL");
if (pz_cmd == (char *) NULL)
pz_cmd = "sh";
}