diff options
author | Jacob Bachmeyer <jcb@gnu.org> | 2021-04-08 21:31:21 -0500 |
---|---|---|
committer | Jacob Bachmeyer <jcb@gnu.org> | 2021-04-08 21:31:21 -0500 |
commit | c6d9e1e2b1a5abaa88a6ec46bc76ea7e752a1b36 (patch) | |
tree | c7de1e86329ee0baa189440994a24bb4f8eae394 /configure.ac | |
parent | 3c804107f4a5ad6928585aaba94f8c27e6b1af56 (diff) | |
download | dejagnu-c6d9e1e2b1a5abaa88a6ec46bc76ea7e752a1b36.zip dejagnu-c6d9e1e2b1a5abaa88a6ec46bc76ea7e752a1b36.tar.gz dejagnu-c6d9e1e2b1a5abaa88a6ec46bc76ea7e752a1b36.tar.bz2 |
Add support for patching config.guess interpreter line with CONFIG_SHELL
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index b44f006..a6e980c 100644 --- a/configure.ac +++ b/configure.ac @@ -42,5 +42,25 @@ fi AC_SUBST(DEJAGNU) # Makefile.am arranges for DEJAGNU to be exported in the environment. +# Patch interpreter lines in config.* scripts to reference CONFIG_SHELL. +# Normally configure ensures that these scripts are run using CONFIG_SHELL +# and their interpreter lines are ignored, but DejaGnu also installs +# config.guess and the framework invokes it at runtime. +if test x"$SHELL" != x/bin/sh +then + AC_CONFIG_COMMANDS([scriptpatch],[ + for file in config.guess config.sub + do + f=${ac_srcdir}/${file} + sed -e '1s,^@%:@!.*$,@%:@! '"${SHELL}", $f > ${f}.new + if test `awk 'END {print NR}' $f` != `awk 'END {print NR}' ${f}.new` + then + AC_MSG_ERROR([patching script for local shell changed line count!]) + fi + mv -f ${f}.new $f + done +], [SHELL=$SHELL]) +fi + AC_CONFIG_FILES([Makefile]) AC_OUTPUT |