From f8549ea233cf2d2ee68d673734c76d98111e05d4 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 25 Sep 2006 04:40:10 +0000 Subject: [PATCH] Add support for "--enable-c-back-end", to override native-code support if desired. --- v7/src/compiler/configure | 78 ++++++++++++++++++++++------------- v7/src/configure.ac | 7 +++- v7/src/microcode/configure.ac | 71 +++++++++++++++++-------------- 3 files changed, 94 insertions(+), 62 deletions(-) diff --git a/v7/src/compiler/configure b/v7/src/compiler/configure index 66bd6f23b..eba22562b 100755 --- a/v7/src/compiler/configure +++ b/v7/src/compiler/configure @@ -1,8 +1,8 @@ #!/bin/sh -# $Id: configure,v 1.7 2006/09/16 11:19:09 gjr Exp $ +# $Id: configure,v 1.8 2006/09/25 04:40:04 cph Exp $ # -# Copyright (c) 2000, 2006 Massachusetts Institute of Technology +# Copyright 2000,2006 Massachusetts Institute of Technology # # This file is part of MIT/GNU Scheme. # @@ -21,35 +21,57 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. -if test ! -e machine; then - case `./config.guess` in - alpha-* | alphaev[56]-* | alphaev56-* | alphapca56-* ) - MACHINE=alpha - ;; - m68k-* ) - MACHINE=bobcat - ;; - i[3456]86-* ) - MACHINE=i386 - ;; - mips-* | mipsel-* ) - MACHINE=mips - ;; - sparc-* ) - MACHINE=sparc - ;; - hppa-* | hppa1.[01]-* | hppa2.?-* ) - MACHINE=spectrum +enable_c_back_end="no" + +while test $# -gt 0; do + case "${1}" in + (--enable-c-back-end) + enable_c_back_end="yes" + shift ;; - vax-* ) - MACHINE=vax + (--disable-c-back-end) + enable_c_back_end="no" + shift ;; - * ) - MACHINE=C + (*) + shift ;; esac - ln -s machines/${MACHINE} machine +done + +if test ! -e machine; then + if test "${enable_c_back_end}" = "yes"; then + MACHINE="C" + else + case `./config.guess` in + (alpha-* | alphaev[56]-* | alphaev56-* | alphapca56-*) + MACHINE="alpha" + ;; + (m68k-*) + MACHINE="bobcat" + ;; + (i[3456]86-*) + MACHINE="i386" + ;; + (mips-* | mipsel-*) + MACHINE="mips" + ;; + (sparc-*) + MACHINE="sparc" + ;; + (hppa-* | hppa1.[01]-* | hppa2.?-*) + MACHINE="spectrum" + ;; + (vax-*) + MACHINE="vax" + ;; + (*) + MACHINE="C" + ;; + esac + fi + ln -s "machines/${MACHINE}" machine fi -for FN in compiler.cbf compiler.pkg compiler.sf make.com; do \ - test -e ${FN} || ln -s machine/${FN} .; \ +for FN in compiler.cbf compiler.pkg compiler.sf make.com; do + test -h "${FN}" || ln -s "machine/${FN}" .; done diff --git a/v7/src/configure.ac b/v7/src/configure.ac index 60a6d891a..116c6b1f4 100644 --- a/v7/src/configure.ac +++ b/v7/src/configure.ac @@ -1,12 +1,12 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT([MIT/GNU Scheme], [7.7.91], [bug-mit-scheme@gnu.org], [mit-scheme]) -AC_REVISION([$Id: configure.ac,v 1.2 2004/11/01 19:21:21 cph Exp $]) +AC_REVISION([$Id: configure.ac,v 1.3 2006/09/25 04:39:59 cph Exp $]) AC_CONFIG_SRCDIR([microcode/boot.c]) AC_PROG_MAKE_SET AC_COPYRIGHT( -[Copyright 2000,2001,2004 Massachusetts Institute of Technology +[Copyright 2000,2001,2004,2006 Massachusetts Institute of Technology This file is part of MIT/GNU Scheme. @@ -26,6 +26,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ]) +AC_ARG_ENABLE([c-back-end], +[[ --enable-c-back-end Build portable system with C output [no]]]) + AC_PROG_INSTALL AC_PROG_LN_S if test "$(${INSTALL} --help 2> /dev/null | fgrep -e --preserve-timestamps)" diff --git a/v7/src/microcode/configure.ac b/v7/src/microcode/configure.ac index 746af3d7e..73aa04459 100644 --- a/v7/src/microcode/configure.ac +++ b/v7/src/microcode/configure.ac @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([MIT/GNU Scheme], [14.18], [bug-mit-scheme@gnu.org], [mit-scheme]) -AC_REVISION([$Id: configure.ac,v 1.13 2006/09/24 23:54:12 cph Exp $]) +AC_INIT([MIT/GNU Scheme microcode], [14.18], [bug-mit-scheme@gnu.org], [mit-scheme]) +AC_REVISION([$Id: configure.ac,v 1.14 2006/09/25 04:40:10 cph Exp $]) AC_CONFIG_SRCDIR([boot.c]) AC_CONFIG_HEADERS([config.h]) AC_PROG_MAKE_SET @@ -110,6 +110,8 @@ AH_BOTTOM( #endif /* SCM_CONFIG_H */]) dnl Feature options. +AC_ARG_ENABLE([c-back-end], +[[ --enable-c-back-end Build portable system with C output [no]]]) AC_ARG_ENABLE([static-libs], [[ --enable-static-libs Link some libraries statically [no]]]) AC_ARG_ENABLE([dynamic-modules], @@ -129,6 +131,8 @@ AC_ARG_WITH([db4], AC_ARG_WITH([libpq], [[ --with-libpq Use PostgreSQL libpq library if available [yes]]]) +enable_c_back_end="${enable_c_back_end:-no}" + dnl Substitution variables to be filled in below. AS_FLAGS= GC_HEAD_FILES= @@ -818,38 +822,42 @@ fi dnl Add architecture-dependent customizations. dnl This is mostly support for native-code compilation. +AC_MSG_CHECKING([for native-code support]) scheme_arch= OPTIONAL_BASES="${OPTIONAL_BASES} cmpint" GC_HEAD_FILES="gccode.h cmpgc.h" -case "$host_cpu" in -alpha*) - scheme_arch=alpha - ;; -hppa*) - scheme_arch=hppa - GC_HEAD_FILES="${GC_HEAD_FILES} hppacach.h" - ;; -i?86) - scheme_arch=i386 - ;; -# x86_64) -# scheme_arch=i386 -# CFLAGS="${CFLAGS} -m32" -# LDFLAGS="${LDFLAGS} -m32" -# ;; -m68k|m680?0) - scheme_arch=mc68k - ;; -mips*) - scheme_arch=mips - ;; -vax) - scheme_arch=vax - ;; -esac +if test "${enable_c_back_end}" = "no"; then + case "$host_cpu" in + alpha*) + scheme_arch=alpha + ;; + hppa*) + scheme_arch=hppa + GC_HEAD_FILES="${GC_HEAD_FILES} hppacach.h" + ;; + i?86) + scheme_arch=i386 + ;; + # x86_64) + # scheme_arch=i386 + # CFLAGS="${CFLAGS} -m32" + # LDFLAGS="${LDFLAGS} -m32" + # ;; + m68k|m680?0) + scheme_arch=mc68k + ;; + mips*) + scheme_arch=mips + ;; + vax) + scheme_arch=vax + ;; + esac +fi +AC_DEFINE([HAS_COMPILER_SUPPORT], [1], + [Define if architecture has native-code compiler support.]) if test "${scheme_arch}" != ""; then - AC_DEFINE([HAS_COMPILER_SUPPORT], [1], - [Define if architecture has native-code compiler support.]) + AC_MSG_RESULT([yes, for ${scheme_arch}]) test -f cmpauxmd.m4 || ${LN_S} cmpauxmd/${scheme_arch}.m4 cmpauxmd.m4 test -f cmpintmd.h || ${LN_S} cmpintmd/${scheme_arch}.h cmpintmd.h OPTIONAL_SOURCES="${OPTIONAL_SOURCES} cmpauxmd.m4" @@ -857,8 +865,7 @@ if test "${scheme_arch}" != ""; then GC_HEAD_FILES="${GC_HEAD_FILES} cmpintmd.h" CMPAUXMDO="Ignore-me.o" else - AC_DEFINE([HAS_COMPILER_SUPPORT], [1], - [Define if architecture has native-code compiler support.]) + AC_MSG_RESULT([yes, using portable C code]) AC_DEFINE([NATIVE_CODE_IS_C], [1], [Define that the compiler outputs C code instead of binaries.]) test -f cmpauxmd.c || ${LN_S} cmpauxmd/c.c cmpauxmd.c -- 2.25.1