Initial draft of changes for optional modules.
authorChris Hanson <org/chris-hanson/cph>
Mon, 22 Oct 2018 00:20:07 +0000 (17:20 -0700)
committerChris Hanson <org/chris-hanson/cph>
Mon, 22 Oct 2018 00:20:07 +0000 (17:20 -0700)
src/Makefile.in
src/Setup.sh
src/configure.ac

index ab53ffa33655b026f3939004da452c87205dbe15..9cf12bf3d8aa7a1f4888b866e57335e10b9a76a8 100644 (file)
@@ -65,6 +65,7 @@ LIARC_BUNDLES = $(LIARC_BOOT_BUNDLES) ffi sos ssp xml
 
 SUBDIRS = $(INSTALLED_SUBDIRS) 6001 win32 xdoc
 INSTALLED_SUBDIRS = microcode runtime $(LIARC_BUNDLES)
+OPTION_SUBDIRS = @OPTION_SUBDIRS@
 
 MIT_SCHEME_EXE = @MIT_SCHEME_EXE@
 AUXDIR_NAME = @AUXDIR_NAME@
@@ -109,6 +110,9 @@ all-native: all-ssp
 all-native: all-star-parser
 all-native: all-win32
 all-native: all-xml
+@IF_X11@all-native: all-x11
+@IF_EDWIN@all-native: all-edwin
+@IF_IMAIL@all-native: all-imail
 
 # XXX This should really depend on microcode/gen-nonce and
 # microcode/extract-liarc-decls instead of microcode/scheme, but
@@ -169,16 +173,14 @@ lib/all.com: all-cref
 ################
 
 .PHONY: all-runtime
-all-runtime: stamp_compile-runtime
+all-runtime: compile-runtime
 @IF_LIARC@all-runtime: bundle-runtime
 
-stamp_compile-runtime:
+.PHONY: compile-runtime
+compile-runtime:
        (echo '(with-working-directory-pathname "runtime"' && \
-        echo '  (lambda ()' && \
-        echo '    (load "runtime.sf")' && \
-        echo '    (load "runtime.cbf")))') \
+        echo '  (lambda () (load "runtime.sf") (load "runtime.cbf")))') \
        | $(HOST_COMPILER)
-       echo "done" > $@
 
 .PHONY: bundle-runtime
 bundle-runtime: runtime/runtime-unx.c
@@ -188,18 +190,18 @@ bundle-runtime: runtime/runtime-unx.c
 ################
 
 .PHONY: all-sf
-all-sf: stamp_compile-sf
+all-sf: compile-sf
 @IF_LIARC@all-sf: bundle-sf
 
-stamp_compile-sf:
+.PHONY: compile-sf
+compile-sf:
        (echo '(with-working-directory-pathname "sf"' && \
         echo '  (lambda () (load "sf.sf") (load "sf.cbf")))') \
        | $(HOST_COMPILER)
-       echo "done" > $@
 
 .PHONY: bundle-sf
 bundle-sf: liarc-bundle-tools
-bundle-sf: stamp_compile-sf
+bundle-sf: compile-sf
 bundle-sf: sf/sf-unx.c
        (cd sf && $(MAKE) compile-liarc-bundle)
 
@@ -208,25 +210,25 @@ bundle-sf: sf/sf-unx.c
 #################
 
 .PHONY: all-compiler
-all-compiler: stamp_compile-compiler
+all-compiler: compile-compiler
 @IF_LIARC@all-compiler: bundle-compiler
 
-stamp_syntax-compiler: stamp_compile-sf
-@IF_SVM_COMPILER@stamp_syntax-compiler: compiler/machines/svm/svm1-defns.h
+.PHONY: syntax-compiler
+syntax-compiler: compile-sf
+@IF_SVM_COMPILER@syntax-compiler: compiler/machines/svm/svm1-defns.h
        (echo '(with-working-directory-pathname "compiler"' && \
         echo '  (lambda () (load "compiler.sf")))') \
        | $(HOST_RUNTIME_ONLY)
-       echo "done" > $@
 
-stamp_compile-compiler: stamp_syntax-compiler
+.PHONY: compile-compiler
+compile-compiler: syntax-compiler
        (echo '(with-working-directory-pathname "compiler"' && \
         echo '  (lambda () (load "compiler.cbf")))') \
        | $(HOST_COMPILER)
-       echo "done" > $@
 
 .PHONY: bundle-compiler
 bundle-compiler: liarc-bundle-tools
-bundle-compiler: stamp_compile-compiler
+bundle-compiler: compile-compiler
 bundle-compiler: compiler/compiler-unx.c
        (cd compiler && $(MAKE) compile-liarc-bundle)
 
@@ -245,18 +247,18 @@ compiler/machines/svm/svm1-defns.h: \
 ################
 
 .PHONY: all-cref
-all-cref: stamp_compile-cref
+all-cref: compile-cref
 @IF_LIARC@all-cref: bundle-cref
 
-stamp_compile-cref: stamp_compile-runtime
+.PHONY: compile-cref
+compile-cref: compile-runtime
        (echo '(with-working-directory-pathname "cref"' && \
         echo '  (lambda () (load "cref.sf") (load "cref.cbf")))') \
        | $(HOST_COMPILER)
-       echo "done" > $@
 
 .PHONY: bundle-cref
 bundle-cref: liarc-bundle-tools
-bundle-cref: stamp_compile-cref
+bundle-cref: compile-cref
 bundle-cref: cref/cref-unx.c
        (cd cref && $(MAKE) compile-liarc-bundle)
 
@@ -265,18 +267,18 @@ bundle-cref: cref/cref-unx.c
 ################
 
 .PHONY: all-star-parser
-all-star-parser: stamp_compile-star-parser
+all-star-parser: compile-star-parser
 @IF_LIARC@all-star-parser: bundle-star-parser
 
-stamp_compile-star-parser: stamp_compile-runtime
+.PHONY: compile-star-parser
+compile-star-parser: compile-runtime
        (echo '(with-working-directory-pathname "star-parser"' && \
         echo '  (lambda () (load "compile")))') \
        | $(HOST_COMPILER)
-       echo "done" > $@
 
 .PHONY: bundle-star-parser
 bundle-star-parser: liarc-bundle-tools
-bundle-star-parser: stamp_compile-star-parser
+bundle-star-parser: compile-star-parser
 bundle-star-parser: star-parser/parser-unx.c
        (cd star-parser && $(MAKE) compile-liarc-bundle)
 
@@ -289,18 +291,18 @@ bundle-star-parser: star-parser/parser-unx.c
 ################
 
 .PHONY: all-ffi
-all-ffi: stamp_compile-ffi
+all-ffi: compile-ffi
 @IF_LIARC@all-ffi: bundle-ffi
 
-stamp_compile-ffi: stamp_compile-runtime
+.PHONY: compile-ffi
+compile-ffi: compile-runtime
        (echo '(with-working-directory-pathname "ffi"' && \
         echo '  (lambda () (load "compile.scm")))') \
        | $(HOST_COMPILER)
-       echo "done" > $@
 
 .PHONY: bundle-ffi
 bundle-ffi: liarc-bundle-tools
-bundle-ffi: stamp_compile-ffi
+bundle-ffi: compile-ffi
 bundle-ffi: ffi/ffi-unx.c
        (cd ffi && $(MAKE) compile-liarc-bundle)
 
@@ -309,18 +311,18 @@ bundle-ffi: ffi/ffi-unx.c
 ################
 
 .PHONY: all-sos
-all-sos: stamp_compile-sos
+all-sos: compile-sos
 @IF_LIARC@all-sos: bundle-sos
 
-stamp_compile-sos: stamp_compile-runtime
+.PHONY: compile-sos
+compile-sos: compile-runtime
        (echo '(with-working-directory-pathname "sos"' && \
         echo '  (lambda () (load "compile")))') \
        | $(HOST_COMPILER)
-       echo "done" > $@
 
 .PHONY: bundle-sos
 bundle-sos: liarc-bundle-tools
-bundle-sos: stamp_compile-sos
+bundle-sos: compile-sos
 bundle-sos: sos/sos-unx.c
        (cd sos && $(MAKE) compile-liarc-bundle)
 
@@ -329,18 +331,18 @@ bundle-sos: sos/sos-unx.c
 ################
 
 .PHONY: all-ssp
-all-ssp: stamp_compile-ssp
+all-ssp: compile-ssp
 @IF_LIARC@all-ssp: bundle-ssp
 
-stamp_compile-ssp: stamp_compile-runtime stamp_compile-xml
+.PHONY: compile-ssp
+compile-ssp: compile-runtime compile-xml
        (echo '(with-working-directory-pathname "ssp"' && \
         echo '  (lambda () (load "compile")))') \
        | $(HOST_COMPILER)
-       echo "done" > $@
 
 .PHONY: bundle-ssp
 bundle-ssp: liarc-bundle-tools
-bundle-ssp: stamp_compile-ssp
+bundle-ssp: compile-ssp
 bundle-ssp: ssp/ssp-unx.c
        (cd ssp && $(MAKE) compile-liarc-bundle)
 
@@ -349,34 +351,69 @@ bundle-ssp: ssp/ssp-unx.c
 ################
 
 .PHONY: all-win32
-all-win32: stamp_compile-win32
+all-win32: compile-win32
 
-stamp_compile-win32: stamp_compile-runtime
+.PHONY: compile-win32
+compile-win32: compile-runtime
        (echo '(with-working-directory-pathname "win32"' && \
         echo '  (lambda () (load "win32.sf") (load "win32.cbf")))') \
        | $(HOST_COMPILER)
-       echo "done" > $@
 
 ################
 # XML
 ################
 
 .PHONY: all-xml
-all-xml: stamp_compile-xml
+all-xml: compile-xml
 @IF_LIARC@all-xml: bundle-xml
 
-stamp_compile-xml: stamp_compile-runtime stamp_compile-sos stamp_compile-star-parser
+.PHONY: compile-xml
+compile-xml: compile-runtime compile-sos compile-star-parser
        (echo '(with-working-directory-pathname "xml"' && \
         echo '  (lambda () (load "compile")))') \
        | $(HOST_COMPILER)
-       echo "done" > $@
 
 .PHONY: bundle-xml
 bundle-xml: liarc-bundle-tools
-bundle-xml: stamp_compile-xml
+bundle-xml: compile-xml
 bundle-xml: xml/xml-unx.c
        (cd xml && $(MAKE) compile-liarc-bundle)
 
+################
+# Edwin
+################
+
+.PHONY: all-edwin
+all-edwin: compile-edwin
+
+.PHONY: compile-edwin
+compile-edwin: compile-runtime
+@IF_X11@compile-edwin: compile-x11
+       (cd edwin && $(MAKE))
+
+################
+# Imail
+################
+
+.PHONY: all-imail
+all-imail: compile-imail
+
+.PHONY: compile-imail
+compile-imail: compile-runtime compile-sos compile-edwin compile-star-parser
+       (cd imail && $(MAKE))
+
+################
+# X11
+################
+
+.PHONY: all-x11
+all-x11: compile-x11
+
+.PHONY: compile-x11
+compile-x11: compile-runtime
+       (cd x11 && $(MAKE))
+       (cd x11-screen && $(MAKE))
+
 #####################
 ### Cross compilation
 #####################
@@ -391,16 +428,16 @@ bundle-xml: xml/xml-unx.c
 # run the target code.
 
 .PHONY: cross-host
-cross-host: stamp_compile-compiler
-cross-host: stamp_compile-cref
-cross-host: stamp_compile-ffi
-cross-host: stamp_compile-runtime
-cross-host: stamp_compile-sf
-cross-host: stamp_compile-sos
-cross-host: stamp_compile-ssp
-cross-host: stamp_compile-star-parser
-cross-host: stamp_compile-win32
-cross-host: stamp_compile-xml
+cross-host: compile-compiler
+cross-host: compile-cref
+cross-host: compile-ffi
+cross-host: compile-runtime
+cross-host: compile-sf
+cross-host: compile-sos
+cross-host: compile-ssp
+cross-host: compile-star-parser
+cross-host: compile-win32
+cross-host: compile-xml
        echo "done" > stamp_$@
 
 .PHONY: cross-target
@@ -429,15 +466,12 @@ check:
          --load ../tests/check.scm --eval '(%exit)'
 
 .PHONY: macosx-app
-macosx-app: stamp_macosx-app
-
-stamp_macosx-app: all
+macosx-app:
        etc/macosx/make-app.sh
-       echo "done" > $@
 
 .PHONY: mostlyclean clean distclean maintainer-clean c-clean
 mostlyclean clean distclean maintainer-clean c-clean:
-       $(top_srcdir)/Clean.sh $@ $(SUBDIRS)
+       $(top_srcdir)/Clean.sh $@ $(SUBDIRS) $(OPTION_SUBDIRS)
 
 .PHONY: clean-boot-root
 clean-boot-root:
index 67cb70d890c13336accebb72029c1c7de1760d03..eb66801ced79b704f9165db2cdebc35229ecfd02 100755 (executable)
@@ -76,6 +76,7 @@ fi
 . etc/functions.sh
 
 INSTALLED_SUBDIRS="cref ffi sf sos ssp star-parser xml"
+MODULE_SUBDIRS="blowfish edwin gdbm imail pgsql mcrypt x11 x11-screen"
 OTHER_SUBDIRS="6001 compiler runtime win32 xdoc microcode"
 
 # lib
@@ -102,3 +103,8 @@ for SUBDIR in ${INSTALLED_SUBDIRS} ${OTHER_SUBDIRS}; do
     maybe_link ${SUBDIR}/Setup.sh ../etc/Setup.sh
     (cd ${SUBDIR} && ./Setup.sh ${1+"$@"})
 done
+
+for SUBDIR in ${MODULE_SUBDIRS}; do
+    echo "setting up ${SUBDIR}"
+    (cd ${SUBDIR} && ./autogen.sh)
+done
index 1f0607ee0d1c8a23a6787566d2dd0f8b0a78c8c8..c5c2277fd89bac3552c67d26f50880ba28e34da6 100644 (file)
@@ -87,13 +87,53 @@ AC_ARG_WITH([scheme-build],
        [Use this directory for the Scheme compiler]))
 : ${with_scheme_build=default}
 
+# optional modules
+
+AC_ARG_ENABLE([x11],
+    AS_HELP_STRING([--enable-x11],
+       [Add support for x11 support [[yes]]]))
+: ${enable_x11=yes}
+
+AC_ARG_ENABLE([edwin],
+    AS_HELP_STRING([--enable-edwin],
+       [Add support for the Edwin edit [[yes]]]))
+: ${enable_edwin=yes}
+
+AC_ARG_ENABLE([imail],
+    AS_HELP_STRING([--enable-imail],
+       [Add support for the Imail mail reader (implies --enable-edwin) [[yes]]]))
+: ${enable_imail=yes}
+if test x"${enable_imail}" = xyes; then
+    enable_edwin=yes
+fi
+
+AC_ARG_ENABLE([blowfish],
+    AS_HELP_STRING([--enable-blowfish],
+       [Add support for the Blowfish encryption [[no]]]))
+: ${enable_blowfish=no}
+
+AC_ARG_ENABLE([gdbm],
+    AS_HELP_STRING([--enable-gdbm],
+       [Add support for the gdbm support [[no]]]))
+: ${enable_gdbm=no}
+
+AC_ARG_ENABLE([pgsql],
+    AS_HELP_STRING([--enable-pgsql],
+       [Add support for the PostgreSQL support [[no]]]))
+: ${enable_pgsql=no}
+
+AC_ARG_ENABLE([mcrypt],
+    AS_HELP_STRING([--enable-mcrypt],
+       [Add support for the mcrypt support [[no]]]))
+: ${enable_mcrypt=no}
+
 AC_CANONICAL_HOST
 
 ALL_TARGET=all-native
 INSTALL_COM='$(INSTALL_DATA)'
 INSTALL_LIARC_BUNDLES=
-IF_LIARC='#!LIARC: '
-IF_SVM='#!SVM: '
+IF_LIARC='#!liarc: '
+IF_SVM='#!svm: '
 
 MIT_SCHEME_NATIVE_CODE([${enable_native_code}],[${host_cpu}])
 case ${mit_scheme_native_code} in
@@ -111,7 +151,7 @@ MIT_SCHEME_COMPILER_TARGET([${with_compiler_target}])
 if test x"${mit_scheme_compiler_target}" = xsvm1; then
     IF_SVM_COMPILER=
 else
-    IF_SVM_COMPILER='#!SVM compiler: '
+    IF_SVM_COMPILER='#!svm compiler: '
 fi
 
 AUXDIR_NAME=mit-scheme-${mit_scheme_native_code}
@@ -126,12 +166,19 @@ AUXDIR='$(libdir)'/${AUXDIR_NAME}
 
 if test x"${with_scheme_build}" != xdefault; then
     AC_MSG_CHECKING([for specified MIT/GNU Scheme build])
-    case ${with_scheme_build} in
+    HOST_BUILD_DIR=${with_scheme_build}
+    case ${HOST_BUILD_DIR} in
+    /*)
+        ;;
+    *)
+        HOST_BUILD_DIR=`pwd`/${HOST_BUILD_DIR}
+        ;;
+    esac
+    case ${HOST_BUILD_DIR} in
     */)
-        HOST_BUILD_DIR=${with_scheme_build}
         ;;
     *)
-        HOST_BUILD_DIR=${with_scheme_build}/
+        HOST_BUILD_DIR=${HOST_BUILD_DIR}/
         ;;
     esac
     MIT_SCHEME_EXE=${HOST_BUILD_DIR}run-build
@@ -199,6 +246,7 @@ directory, which is usually \`/usr/local/lib/mit-scheme-${mit_scheme_native_code
 ])
     fi
 fi
+export MIT_SCHEME_EXE
 
 # A 32bit host running LIAR/svm needs a large heap.
 small_words='(= 4 (vector-ref (gc-space-status) 0))'
@@ -207,18 +255,70 @@ if test x"${mit_scheme_native_code}" = xsvm1 \
     HOST_COMPILER_HEAP="--heap 10000"
 fi
 
-AC_SUBST([DEFAULT_TARGET])
+OPTION_SUBDIRS=
+if test x"${enable_x11}" = xyes; then
+    OPTION_SUBDIRS="${OPTION_SUBDIRS} x11 x11-screen"
+    IF_X11=
+else
+    IF_X11="#!x11: "
+fi
+if test x"${enable_edwin}" = xyes; then
+    OPTION_SUBDIRS="${OPTION_SUBDIRS} edwin"
+    IF_EDWIN=
+else
+    IF_EDWIN="#!edwin: "
+fi
+if test x"${enable_imail}" = xyes; then
+    OPTION_SUBDIRS="${OPTION_SUBDIRS} imail"
+    IF_IMAIL=
+else
+    IF_IMAIL="#!imail: "
+fi
+if test x"${enable_blowfish}" = xyes; then
+    OPTION_SUBDIRS="${OPTION_SUBDIRS} blowfish"
+    IF_BLOWFISH=
+else
+    IF_BLOWFISH="#!blowfish: "
+fi
+if test x"${enable_gdbm}" = xyes; then
+    OPTION_SUBDIRS="${OPTION_SUBDIRS} gdbm"
+    IF_GDBM=
+else
+    IF_GDBM="#!gdbm: "
+fi
+if test x"${enable_mcrypt}" = xyes; then
+    OPTION_SUBDIRS="${OPTION_SUBDIRS} mcrypt"
+    IF_MCRYPT=
+else
+    IF_MCRYPT="#!mcrypt: "
+fi
+if test x"${enable_pgsql}" = xyes; then
+    OPTION_SUBDIRS="${OPTION_SUBDIRS} pgsql"
+    IF_PGSQL=
+else
+    IF_PGSQL="#!pgsql: "
+fi
+
 AC_SUBST([ALL_TARGET])
-AC_SUBST([INSTALL_COM])
-AC_SUBST([INSTALL_LIARC_BUNDLES])
-AC_SUBST([MIT_SCHEME_EXE])
-AC_SUBST([AUXDIR_NAME])
 AC_SUBST([AUXDIR])
+AC_SUBST([AUXDIR_NAME])
+AC_SUBST([DEFAULT_TARGET])
+AC_SUBST([HOST_COMPILER_HEAP])
+AC_SUBST([IF_BLOWFISH])
 AC_SUBST([IF_CROSS])
+AC_SUBST([IF_EDWIN])
+AC_SUBST([IF_GDBM])
+AC_SUBST([IF_IMAIL])
 AC_SUBST([IF_LIARC])
+AC_SUBST([IF_MCRYPT])
+AC_SUBST([IF_PGSQL])
 AC_SUBST([IF_SVM])
 AC_SUBST([IF_SVM_COMPILER])
-AC_SUBST([HOST_COMPILER_HEAP])
+AC_SUBST([IF_X11])
+AC_SUBST([INSTALL_COM])
+AC_SUBST([INSTALL_LIARC_BUNDLES])
+AC_SUBST([MIT_SCHEME_EXE])
+AC_SUBST([OPTION_SUBDIRS])
 
 AC_PROG_INSTALL
 AC_PROG_LN_S
@@ -229,6 +329,27 @@ etc/create-makefiles.sh "${MIT_SCHEME_EXE}" "${mit_scheme_compiler_target}" \
 compiler/configure "${mit_scheme_compiler_target}" || exit $?
 
 AC_CONFIG_SUBDIRS([microcode])
+if test x"${enable_blowfish}" = xyes; then
+    AC_CONFIG_SUBDIRS([blowfish])
+fi
+if test x"${enable_edwin}" = xyes; then
+    AC_CONFIG_SUBDIRS([edwin])
+fi
+if test x"${enable_gdbm}" = xyes; then
+    AC_CONFIG_SUBDIRS([gdbm])
+fi
+if test x"${enable_imail}" = xyes; then
+    AC_CONFIG_SUBDIRS([imail])
+fi
+if test x"${enable_mcrypt}" = xyes; then
+    AC_CONFIG_SUBDIRS([mcrypt])
+fi
+if test x"${enable_pgsql}" = xyes; then
+    AC_CONFIG_SUBDIRS([pgsql])
+fi
+if test x"${enable_x11}" = xyes; then
+    AC_CONFIG_SUBDIRS([x11 x11-screen])
+fi
 
 AC_CONFIG_FILES([
 Makefile