From: Chris Hanson <org/chris-hanson/cph>
Date: Thu, 5 Nov 2009 11:23:12 +0000 (-0800)
Subject: Fix problem with compiler/configure: it needed to be updated to match
X-Git-Tag: 20100708-Gtk~261
X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=c2fba9ebcf142359146ccddae0b9538ee1d39587;p=mit-scheme.git

Fix problem with compiler/configure: it needed to be updated to match
the other changes around it.  Also, rewrite the script to meet
autoconf portable shell recommendations.
---

diff --git a/src/compiler/configure b/src/compiler/configure
index c4e9ac5d6..e78ff6366 100755
--- a/src/compiler/configure
+++ b/src/compiler/configure
@@ -24,47 +24,37 @@
 
 set -e
 
-MACHINE=
-while test $# -gt 0; do
-    case "${1}" in
-    --enable-native-code=*)
-	MACHINE=`echo "${1}" | sed -e 's/--enable-native-code=//'`
-	shift
-	;;
-    --disable-native-code)
-	MACHINE=no
-	shift
-	;;
-    *)
-	shift
-	;;
-    esac
-done
-MACHINE=`./choose-machine.sh "${MACHINE}"`
+if test ${#} != 1; then
+    echo "usage: ${0} TARGET_ARCH" >&2
+    exit 1
+fi
 
-make_link ()
-{
-    local target link
-    target="${1}"
-    link="${2}"
-    if [ -e "${link}" -a ! -L "${link}" ]; then
-	cat <<EOF >&2
-${link} is not a symbolic link; refusing to clobber it.
-EOF
-	exit 1
-    else
-	CMDS="rm -f ${link} && ln -s ${target} ${link}"
-	echo "${CMDS}"; eval "${CMDS}"
-    fi
-}
+cd `dirname "${0}"`
+TARGET_ARCH=${1}
+
+MACHINE=`./choose-machine.sh "${TARGET_ARCH}"`
 
-make_link "machines/${MACHINE}" machine
+if test -z "${MACHINE}"; then
+    echo "Unknown target arch: ${TARGET_ARCH}" >&2
+    exit 1
+fi
 
 LINKS="compiler.cbf compiler.pkg compiler.sf make.com"
-if test "${MACHINE}" = C; then
+if test x${MACHINE} = xC; then
     LINKS="${LINKS} make.so"
 fi
 
+for FN in machine ${LINKS}; do
+    if test -e ${FN} && test ! -L ${FN}; then
+	echo "${FN} is not a symbolic link; refusing to clobber it." >&2
+	exit 1
+    fi
+done
+
+CMDS="rm -f machine && ln -s machines/${MACHINE} machine"
+echo "${CMDS}"; eval "${CMDS}"
+
 for FN in ${LINKS}; do
-    make_link "machine/${FN}" "${FN}"
+    CMDS="rm -f ${FN} && ln -s machine/${FN} ${FN}"
+    echo "${CMDS}"; eval "${CMDS}"
 done
diff --git a/src/configure.ac b/src/configure.ac
index ae923dea1..72db5e554 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -109,8 +109,9 @@ then
 fi
 
 etc/create-makefiles.sh "${MIT_SCHEME_EXE}" "${SCM_ARCH}"
+compiler/configure "${SCM_ARCH}"
 
-AC_CONFIG_SUBDIRS([microcode compiler])
+AC_CONFIG_SUBDIRS([microcode])
 AC_CONFIG_FILES([
 Makefile
 6001/Makefile