Fix problem with compiler/configure: it needed to be updated to match
authorChris Hanson <org/chris-hanson/cph>
Thu, 5 Nov 2009 11:23:12 +0000 (03:23 -0800)
committerChris Hanson <org/chris-hanson/cph>
Thu, 5 Nov 2009 11:23:12 +0000 (03:23 -0800)
the other changes around it.  Also, rewrite the script to meet
autoconf portable shell recommendations.

src/compiler/configure
src/configure.ac

index c4e9ac5d6e1eac4c3a56d96e43eed72aff8c422a..e78ff6366264f7ce4d1e8be311ece0ba8bba9b67 100755 (executable)
 
 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
index ae923dea1e92bc6785fba98239ff0e6221affe5a..72db5e554c9f1c52c67129a08dff740d7501ead0 100644 (file)
@@ -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