aboutsummaryrefslogtreecommitdiffstats
path: root/configure1.in
diff options
context:
space:
mode:
authorBrian Fox <[email protected]>1993-09-30 23:11:45 +0000
committerBrian Fox <[email protected]>1993-09-30 23:11:45 +0000
commit6703f6cdbd528a87d600518d04ccf639b950ef0c (patch)
tree91cd735bd038dc1ad78db1d2a501978d26f2b6eb /configure1.in
parentb93f24930d6aaf7f4ad39ef15538eaadc0031c02 (diff)
Don't copy ${srcdir}/src/Makefile.in; that file doesn't exist. Just
copy src/Makefile.in instead. Touch all of the Makefiles after editing config.status.
Diffstat (limited to 'configure1.in')
-rwxr-xr-xconfigure1.in54
1 files changed, 34 insertions, 20 deletions
diff --git a/configure1.in b/configure1.in
index 8b3832d0db..bcc856c592 100755
--- a/configure1.in
+++ b/configure1.in
@@ -125,13 +125,22 @@ unsuccessful after disturbing the status quo, it removes config.status."
### Record all the arguments, so we can save them in config.status.
arguments="$@"
+### Shell Magic: Quote the quoted arguments in ARGUMENTS. At a later date,
+### in order to get the arguments back in $@, we have to do an
+### `eval set x "$quoted_arguments"; shift'.
+quoted_arguments=
+for i in "$@"; do
+ quoted_arguments="$quoted_arguments '$i'"
+done
+
### Don't use shift -- that destroys the argument list, which autoconf needs
### to produce config.status. It turns out that "set - ${arguments}" doesn't
### work portably.
-index=0
-while [ $index -lt $# ]; do
- index=`expr $index + 1`
- arg=`eval echo '$'$index`
+### However, it also turns out that many shells cannot expand ${10} at all.
+### So using an index variable doesn't work either. It is possible to use
+### some shell magic to make 'set x "$arguments"; shift' work portably.
+while [ $# != 0 ]; do
+ arg="$1"; shift
case "${arg}" in
## Anything starting with a hyphen we assume is an option.
@@ -197,14 +206,13 @@ Set it to either \`yes' or \`no'."
## If the value was omitted, get it from the next argument.
if [ "${valomitted}" = "yes" ]; then
## Get the next argument from the argument list, if there is one.
- if [ $index = $# ]; then
+ if [ $# = 0 ]; then
(echo "${progname}: You must give a value for the \`--${optname}' option, as in
\`--${optname}=FOO'."
echo "${short_usage}") >&2
exit 1
fi
- index=`expr $index + 1`
- val=`eval echo '$'$index`
+ val="$1"; shift
fi
srcdir="${val}"
;;
@@ -217,14 +225,13 @@ Set it to either \`yes' or \`no'."
## If the value was omitted, get it from the next argument.
if [ "${valomitted}" = "yes" ]; then
## Get the next argument from the argument list, if there is one.
- if [ $index = $# ]; then
+ if [ $# = 0 ]; then
(echo "${progname}: You must give a value for the \`--${optname}' option, as in
\`--${optname}=/usr/local/X11/include'."
echo "${short_usage}") >&2
exit 1
fi
- index=`expr $index + 1`
- val=`eval echo '$'$index`
+ val="$1"; shift
fi
x_includes="${val}"
;;
@@ -232,14 +239,13 @@ Set it to either \`yes' or \`no'."
## If the value was omitted, get it from the next argument.
if [ "${valomitted}" = "yes" ]; then
## Get the next argument from the argument list, if there is one.
- if [ $index = $# ]; then
+ if [ $# = 0 ]; then
(echo "${progname}: You must give a value for the \`--${optname}' option, as in
\`--${optname}=/usr/local/X11/lib'."
echo "${short_usage}") >&2
exit 1
fi
- index=`expr $index + 1`
- val=`eval echo '$'$index`
+ val="$1"; shift
fi
x_libraries="${val}"
;;
@@ -256,7 +262,7 @@ Set it to either \`yes' or \`no'."
lisppath | locallisppath )
## If the value was omitted, get it from the next argument.
if [ "${valomitted}" = "yes" ]; then
- if [ $index = $# ]; then
+ if [ $# = 0 ]; then
(echo \
"$progname: You must give a value for the \`--${optname}' option,";
echo \
@@ -264,11 +270,10 @@ Set it to either \`yes' or \`no'."
echo "$short_usage") >&2
exit 1
fi
- index=`expr $index + 1`
- val=`eval echo '$'$index`
+ val="$1"; shift
fi
- eval "${optname}=\"${val}\""
- eval "${optname}_specified=1"
+ eval "${opt}=\"${val}\""
+ eval "${opt}_specified=1"
;;
## Verbose flag, tested by autoconf macros.
@@ -300,6 +305,9 @@ Set it to either \`yes' or \`no'."
esac
done
+### Get the arguments back. See the diatribe on Shell Magic above.
+eval set x "$quoted_arguments"; shift
+
if [ "${configuration}" = "" ]; then
echo '- You did not tell me what kind of host system you want to configure.
- I will attempt to guess the kind of system this is.' 1>&2
@@ -1397,8 +1405,8 @@ topsrcdir=${srcdir}
makefile_command='echo "creating src/Makefile";
topsrcdir='"${topsrcdir}"';
( cd ./src;
- cp ${topsrcdir}/src/Makefile.in junk.c;
- eval `echo ${CPP} -I${topsrcdir}/src ${CPPFLAGS} junk.c \>junk.cpp`;
+ cp Makefile.in junk.c;
+ eval `echo ${CPP} -I. -I${topsrcdir}/src ${CPPFLAGS} junk.c \>junk.cpp`;
< junk.cpp '\
' sed -e '\''s/^#.*//'\'' '\
' -e '\''s/^[ \f\t][ \f\t]*$//'\'' '\
@@ -1418,6 +1426,12 @@ echo $makefile_command >>config.new
echo exit 0 >>config.new
mv -f config.new config.status
chmod +x config.status
+# Don't let the fact that we just rewrote config.status make Makefile think
+# that it is now newer. We have just rewritten all of the Makefiles as well.
+MFS="Makefile src/Makefile src/Makefile.in lib-src/Makefile oldXMenu/Makefile"
+for file in $MFS; do
+ chmod a+w $file; touch $file; chmod 444 $file
+done
exit 0
]