From a87e05f22141559f80bb13d4b80071a5928910dc Mon Sep 17 00:00:00 2001 From: D Herring Date: Sat, 8 Dec 2007 01:01:13 -0500 Subject: [PATCH] Progress. --- Makefile.am | 3 ++ configure.ac | 139 ++++++++++++++++++++++++++++++++++++++++++++++-- m4/lisp-features.m4 | 45 ++++++++++++++++ src/runtime/Makefile.am | 132 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 315 insertions(+), 4 deletions(-) create mode 100644 m4/lisp-features.m4 create mode 100644 src/runtime/Makefile.am diff --git a/Makefile.am b/Makefile.am index 47bb243c1..a9a2d61ed 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,6 @@ +# Tell aclocal about our custom m4 files +ACLOCAL_AMFLAGS = -I m4 + all: ./make.sh diff --git a/configure.ac b/configure.ac index 0f69fcd0b..0acb0ca31 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,5 @@ -AC_INIT(sbcl, 1.0.12.17, www.sbcl.org) +AC_INIT(sbcl, 1.0.12.17, dherring@at.tentpost.dot.com) +# change out my email to www.sbcl.org if/when this becomes official # Reduce top-level clutter AC_CONFIG_AUX_DIR([build-aux]) @@ -7,28 +8,158 @@ AM_INIT_AUTOMAKE([dist-bzip2 foreign no-define nostdinc]) # Find the compiler AC_PROG_CC +AC_PROG_NM +AC_PROG_GREP +AC_PROG_LN_S # Detect the shared-library settings AC_PROG_LIBTOOL +dnl libs to check for +# -lc -ldl -lm -lnsl -lsocket -lrt +# -lthr (preferred on BSD?) or -lpthread +# -lSystem (Darwin) # Don't actually do much for now; just wrap the existing mechanism. #Goals # --prefix= -# Cross-compilation + +# Cross-compilation -- identify the $build and $host systems +# (default runs ./build-aux/config.guess) AC_CANONICAL_HOST # Auto-detect a lisp to compile with AC_ARG_WITH([lisp], - AS_HELP_STRING([--with-lisp=path], [Name of or absolute path to the lisp which should bootstrap SBCL. @<:@default=search for sbcl, cmucl, lisp@:>@]), + AS_HELP_STRING([--with-lisp=path], [Name of or absolute path to the lisp \ +which should bootstrap SBCL. @<:@default=search for sbcl, cmucl, lisp@:>@]), [LISP=$val], [LISP=]) # make dist # ... -AC_CONFIG_FILES([Makefile]) + +dnl c.f. make-config.sh + +# Do we need to bring in undefineds.c? +port_incomplete=no + + +## OS +case $host_os in +freebsd*) + os=bsd + ;; +netbsd* | openbsd*) + os=bsd + port_incomplete=yes + ;; + +darwin*) + os=darwin + ;; + +linux*) + os=linux + ;; + +osf1*) + os=osf1 + port_incomplete=yes + ;; + +sunos* | solaris*) + os=sunos + ;; + +cygwin* | mingw* | win*) + os=windows + port_incomplete=yes + ;; + +*) + AC_MSG_ERROR([unknown OS $host_os]) + ;; +esac +AM_CONDITIONAL([COND_OS_BSD], [test $os = bsd]) +AM_CONDITIONAL([COND_OS_DARWIN], [test $os = darwin]) +AM_CONDITIONAL([COND_OS_LINUX], [test $os = linux]) +AM_CONDITIONAL([COND_OS_OSF1], [test $os = osf1]) +AM_CONDITIONAL([COND_OS_SUNOS], [test $os = sunos]) +AM_CONDITIONAL([COND_OS_WINDOWS], [test $os = windows]) + + + +## CPU +case $host_cpu in +alpha*) + cpu=alpha + ;; +hppa) + cpu=hppa + port_incomplete=yes + ;; +mips) + cpu=mips + ;; +powerpc* | ppc*) + cpu=ppc + ;; +sparc) + cpu=sparc + #port_incomplete=yes + ;; +i?86) + cpu=x86 + ;; +x86_64 | amd64) + cpu=x86_64 + ;; +*) + AC_MSG_ERROR([unknown CPU $host_cpu]) + ;; +esac +AM_CONDITIONAL([COND_CPU_ALPHA], [test $cpu = alpha]) +AM_CONDITIONAL([COND_CPU_HPPA], [test $cpu = hppa]) +AM_CONDITIONAL([COND_CPU_MIPS], [test $cpu = mips]) +AM_CONDITIONAL([COND_CPU_PPC], [test $cpu = ppc]) +AM_CONDITIONAL([COND_CPU_SPARC], [test $cpu = sparc]) +AM_CONDITIONAL([COND_CPU_X86], [test $cpu = x86]) +AM_CONDITIONAL([COND_CPU_X86_64], [test $cpu = x86_64]) + +AM_CONDITIONAL([COND_PORT_INCOMPLETE], [test $port_incomplete = yes]) + + +## Detect threading +AC_ARG_ENABLE([threading], + AS_HELP_STRING([--disable-threading], [Threading is enabled by default.]), + [ENABLE_THREADING=$enableval], + [ENABLE_THREADING=yes]) +AC_ARG_WITH([thread-lib], + AS_HELP_STRING([--with-thread-lib=@<:@lib@:>@], + [Specify a threading library to use. @<:@lib=pthread or thr; \ +default is autodetect@:>@]), + [case $withval in + yes) + WITH_THREAD_LIB= + ;; + no) + if test $ENABLE_THREADING = yes + then + AC_MSG_ERROR([threading was enabled, but --with-thread-lib=no]) + fi + ;; + *) + WITH_THREAD_LIB=$withval + ;; + esac], + [WITH_THREAD_LIB=]) + + +SET_LISP_FEATURES($os, $cpu) + +AC_CONFIG_FILES([Makefile src/runtime/Makefile]) AC_OUTPUT diff --git a/m4/lisp-features.m4 b/m4/lisp-features.m4 new file mode 100644 index 000000000..3fc46227b --- /dev/null +++ b/m4/lisp-features.m4 @@ -0,0 +1,45 @@ +dnl c.f. make-config.sh + +# Use $host_os and $host_cpu to determine which features to support +# sets LISP_FEATURES +AC_DEFUN(SET_LISP_FEATURES, +[ +LISP_FEATURES= + +# OS +case $1 in +bsd) + LISP_FEATURES=":unix :elf :bsd" + ;; +darwin) + LISP_FEATURES=":unix :mach-o :bsd :darwin" + ;; +linux) + LISP_FEATURES=":unix :elf :linux" + ;; +osf1) + LISP_FEATURES=":unix :elf :osf1" + ;; +sunos) + LISP_FEATURES=":unix :elf :sunos" + ;; +windows) + ;; +esac + +# CPU +case $2 in +esac + +# Both +case $1-$2 in +linux-x86 | linux-mips) + LISP_FEATURES="$LISP_FEATURES :largefile" + ;; +windows-x86) + LISP_FEATURES="$LISP_FEATURES :win32" + ;; +esac + +AC_SUBST(LISP_FEATURES) +]) diff --git a/src/runtime/Makefile.am b/src/runtime/Makefile.am new file mode 100644 index 000000000..dbcd54841 --- /dev/null +++ b/src/runtime/Makefile.am @@ -0,0 +1,132 @@ +bin_PROGRAMS = sbcl +sbcl_SOURCES = alloc.c backtrace.c breakpoint.c coreparse.c \ + dynbind.c funcall.c gc-common.c globals.c interr.c interrupt.c \ + largefile.c monitor.c os-common.c parse.c print.c purify.c \ + pthread-futex.c pthread-lutex.c \ + regnames.c run-program.c runtime.c save.c search.c \ + thread.c time.c util.c validate.c vars.c wrap.c + +# +# Add os/architecture-specific files +# + +## OS +if COND_OS_BSD + sbcl_SOURCES += bsd-os.c bsd-os.h +endif + +if COND_OS_DARWIN + sbcl_SOURCES += bsd-os.c bsd-os.h + sbcl_SOURCES += darwin-os.c darwin-os.h + sbcl_SOURCES += darwin-dlshim.c darwin-dlshim.h + sbcl_SOURCES += darwin-langinfo.c darwin-langinfo.h +endif + +if COND_OS_LINUX + sbcl_SOURCES += linux-os.c linux-os.h +endif + +if COND_OS_SUNOS + sbcl_SOURCES += sunos-os.c sunos-os.h + sbcl_SOURCES += os-common.c os-common.h +endif + +if COND_OS_WINDOWS + sbcl_SOURCES += os-common.c os-common.h +endif + + +## ARCH +if COND_CPU_ALPHA + sbcl_SOURCES += alpha-arch.c alpha-arch.h +endif + +if COND_CPU_HPPA + sbcl_SOURCES += hppa-arch.c hppa-arch.h +endif + +if COND_CPU_MIPS + sbcl_SOURCES += mips-arch.c mips-arch.h + + if COND_OS_LINUX + sbcl_SOURCES += mips-linux-os.c mips-linux-os.h + endif +endif + +if COND_CPU_PPC + sbcl_SOURCES += ppc-arch.c ppc-arch.h + + if COND_OS_BSD + sbcl_SOURCES += ppc-bsd-os.c ppc-bsd-os.h + endif + + if COND_OS_DARWIN + sbcl_SOURCES += ppc-bsd-os.c ppc-bsd-os.h + sbcl_SOURCES += ppc-darwin-os.c ppc-darwin-os.h + endif + + if COND_OS_LINUX + sbcl_SOURCES += ppc-linux-os.c ppc-linux-os.h + endif +endif + +if COND_CPU_SPARC + sbcl_SOURCES += sparc-arch.c sparc-arch.h + + if COND_OS_LINUX + sbcl_SOURCES += sparc-linux-os.c sparc-linux-os.h + endif + + if COND_OS_SUNOS + sbcl_SOURCES += sparc-sunos-os.c sparc-sunos-os.h + endif +endif + +if COND_CPU_X86 + sbcl_SOURCES += x86-arch.c x86-arch.h + + if COND_OS_BSD + sbcl_SOURCES += x86-bsd-os.c x86-bsd-os.h + endif + + if COND_OS_DARWIN + sbcl_SOURCES += x86-bsd-os.c x86-bsd-os.h + sbcl_SOURCES += x86-darwin-os.c x86-darwin-os.h + endif + + if COND_OS_LINUX + sbcl_SOURCES += x86-linux-os.c x86-linux-os.h + endif + + if COND_OS_SUNOS + sbcl_SOURCES += x86-sunos-os.c x86-sunos-os.h + endif + + if COND_OS_WINDOWS + sbcl_SOURCES += win32-os.c win32-os.h + sbcl_SOURCES += x86-win32-os.c x86-win32-os.h + endif +endif + +if COND_CPU_X86_64 + sbcl_SOURCES += x86-64-arch.c x86-64-arch.h + + if COND_OS_BSD + sbcl_SOURCES += x86-64-bsd-os.c x86-64-bsd-os.h + endif + + if COND_OS_DARWIN + sbcl_SOURCES += x86-64-bsd-os.c x86-64-bsd-os.h + sbcl_SOURCES += x86-64-darwin-os.c x86-64-darwin-os.h + endif + + if COND_OS_LINUX + sbcl_SOURCES += x86-64-linux-os.c x86-64-linux-os.h + endif +endif + + +if COND_PORT_INCOMPLETE + sbcl_SOURCES += undefineds.c undefineds.h +endif + -- 2.11.4.GIT