This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

little changes to fixinclude scripts


These are some small bug fixes.  It turns out some people have
/bin/csh as their login shell (I know, you're shocked :-) and so using
$SHELL really isn't a good idea in an installed script that's
expecting a bourne-like shell.

Also, I noticed that mkfixinc.sh was producing an error message when
it was run, but not stopping the build, because fixincl hadn't been
built when it was run.

Tested by running a bootstrap, 'make install', and running the
installed fixincludes with SHELL=/bin/csh.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-fixinc-robustify.patch================
2004-11-23  Geoffrey Keating  <geoffk@apple.com>

	* mkfixinc.sh: Check error code from 'cat'.  Don't try running
	built fixincl program.
	* mkheaders.in: Use @SHELL@ rather than ${SHELL} to avoid picking
	up csh from user.

Index: mkfixinc.sh
===================================================================
RCS file: /cvs/gcc/gcc/fixincludes/mkfixinc.sh,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 mkfixinc.sh
--- mkfixinc.sh	5 Nov 2004 04:48:32 -0000	1.1
+++ mkfixinc.sh	23 Nov 2004 22:41:11 -0000
@@ -35,8 +35,7 @@ case $machine in
         ;;
 
     *)
-	../${build_subdir}/fixincludes/fixincl -v < /dev/null
-	cat < ${srcdir}/fixinc.in > ${target}
+	cat < ${srcdir}/fixinc.in > ${target} || exit 1
 	;;
 esac
 chmod 755 ${target}
Index: mkheaders.in
===================================================================
RCS file: /cvs/gcc/gcc/fixincludes/mkheaders.in,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 mkheaders.in
--- mkheaders.in	5 Nov 2004 04:48:32 -0000	1.1
+++ mkheaders.in	23 Nov 2004 22:41:11 -0000
@@ -77,7 +77,7 @@ rm -rf ${incdir}/*
 if [ x${STMP_FIXINC} != x ] ; then
 	TARGET_MACHINE="${target}" target_canonical="${target}" \
 	    MACRO_LIST="${itoolsdatadir}/macro_list" \
-	    ${SHELL} ./fixinc.sh ${incdir} \
+	    @SHELL@ ./fixinc.sh ${incdir} \
 	    ${SYSTEM_HEADER_DIR} ${OTHER_FIXINCLUDES_DIRS}
 	rm -f ${incdir}/syslimits.h
 	if [ -f ${incdir}/limits.h ]; then
@@ -90,7 +90,7 @@ fi
 cp ${itoolsdatadir}/include/* ${incdir}
 
 if [ x${STMP_FIXPROTO} != x ] ; then
-  mkinstalldirs="${SHELL} ${itoolsdir}/mkinstalldirs"
+  mkinstalldirs="@SHELL@ ${itoolsdir}/mkinstalldirs"
   export FIXPROTO_DEFINES mkinstalldirs
-  ${SHELL} fixproto ${incdir} ${incdir} ${SYSTEM_HEADER_DIR} || exit 1
+  @SHELL@ fixproto ${incdir} ${incdir} ${SYSTEM_HEADER_DIR} || exit 1
 fi
============================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]