From: Chris Hanson Date: Tue, 23 Oct 2018 21:07:26 +0000 (-0700) Subject: Refactor plugins to simplify compilation. X-Git-Tag: mit-scheme-pucked-10.1.2~16^2~189 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=500698e4cda9fb4c6cce3e2dd40022739f825bbc;p=mit-scheme.git Refactor plugins to simplify compilation. --- diff --git a/src/Makefile.in b/src/Makefile.in index a3ad07fe7..75be0baef 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -392,7 +392,7 @@ bundle-xml: xml/xml-unx.c all-blowfish: compile-blowfish .PHONY: compile-blowfish -compile-blowfish: compile-runtime +compile-blowfish: compile-runtime compile-ffi (cd blowfish && MIT_SCHEME_EXE=$(MIT_SCHEME_EXE) $(MAKE)) ################ @@ -417,7 +417,7 @@ compile-edwin: compile-runtime compile-xml all-gdbm: compile-gdbm .PHONY: compile-gdbm -compile-gdbm: compile-runtime +compile-gdbm: compile-runtime compile-ffi (cd gdbm && MIT_SCHEME_EXE=$(MIT_SCHEME_EXE) $(MAKE)) ################ @@ -439,7 +439,7 @@ compile-imail: compile-runtime compile-sos compile-edwin compile-star-parser all-mcrypt: compile-mcrypt .PHONY: compile-mcrypt -compile-mcrypt: compile-runtime +compile-mcrypt: compile-runtime compile-ffi (cd mcrypt && MIT_SCHEME_EXE=$(MIT_SCHEME_EXE) $(MAKE)) ################ @@ -450,7 +450,7 @@ compile-mcrypt: compile-runtime all-pgsql: compile-pgsql .PHONY: compile-pgsql -compile-pgsql: compile-runtime +compile-pgsql: compile-runtime compile-ffi (cd pgsql && MIT_SCHEME_EXE=$(MIT_SCHEME_EXE) $(MAKE)) ################ @@ -461,7 +461,7 @@ compile-pgsql: compile-runtime all-x11: compile-x11 .PHONY: compile-x11 -compile-x11: compile-runtime +compile-x11: compile-runtime compile-ffi (cd x11 && MIT_SCHEME_EXE=$(MIT_SCHEME_EXE) $(MAKE)) ################ diff --git a/src/Setup.sh b/src/Setup.sh index eb66801ce..5a243f24d 100755 --- a/src/Setup.sh +++ b/src/Setup.sh @@ -87,12 +87,16 @@ maybe_link lib/optiondb.scm ../etc/optiondb.scm maybe_link lib/compiler ../compiler maybe_link lib/cref ../cref +maybe_link lib/edwin ../edwin maybe_link lib/ffi ../ffi +maybe_link lib/imail ../imail maybe_link lib/runtime ../runtime maybe_link lib/sf ../sf maybe_link lib/sos ../sos maybe_link lib/ssp ../ssp maybe_link lib/star-parser ../star-parser +maybe_link lib/x11 ../x11 +maybe_link lib/x11-screen ../x11-screen maybe_link lib/xml ../xml maybe_link config.sub microcode/config.sub diff --git a/src/blowfish/compile.scm b/src/blowfish/compile.scm index e3d666dcf..fc0c28cc1 100644 --- a/src/blowfish/compile.scm +++ b/src/blowfish/compile.scm @@ -3,6 +3,10 @@ ;;;; Compile the BLOWFISH option. (load-option 'cref) -(load-option 'ffi) -(compile-file "blowfish" '() (->environment '(runtime))) -(cref/generate-constructors "blowfish") \ No newline at end of file +(with-working-directory-pathname (directory-pathname (current-load-pathname)) + (lambda () + (with-working-directory-pathname (merge-pathnames "../ffi") + (lambda () + (load "make"))) + (compile-file "blowfish" '() (->environment '(runtime))) + (cref/generate-constructors "blowfish"))) \ No newline at end of file diff --git a/src/configure.ac b/src/configure.ac index 007adb6cf..11a1a7c0a 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -89,22 +89,27 @@ AC_ARG_WITH([scheme-build], # optional modules +AC_ARG_ENABLE([default-plugins], + AS_HELP_STRING([--default-plugins], + [Enable default plugins [[yes]]])) +: ${enable_default_plugins=yes} + AC_ARG_ENABLE([x11], AS_HELP_STRING([--enable-x11], - [Add support for x11 support [[yes]]])) -: ${enable_x11=yes} + [Add support for x11 [[yes]]])) +: ${enable_x11=${enable_default_plugins}} AC_ARG_ENABLE([edwin], AS_HELP_STRING([--enable-edwin], [Add support for the Edwin editor [[yes]]])) -: ${enable_edwin=yes} +: ${enable_edwin=${enable_default_plugins}} 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 +: ${enable_imail=${enable_default_plugins}} +if test x"${enable_imail}" = xyes && test x"${enable_edwin}" = xno; then + enable_edwin=${enable_default_plugins} fi AC_ARG_ENABLE([blowfish], diff --git a/src/edwin/Makefile.am b/src/edwin/Makefile.am index b98989791..66cb4c5f1 100644 --- a/src/edwin/Makefile.am +++ b/src/edwin/Makefile.am @@ -61,28 +61,11 @@ EXTRA_DIST += sources.sh compile.sh decls.scm edwin.ldr EXTRA_DIST += edwin.sf edwin.cbf edwin.pkg install-data-hook: - ( echo '(add-plugin "edwin" "@MIT_SCHEME_PROJECT@"'; \ - echo ' ""'; \ - echo ' "$(DESTDIR)$(scmlibdir)"'; \ - echo ' "$(DESTDIR)$(scmdocdir)")' ) \ - | $(MIT_SCHEME_EXE) --batch-mode install-html: install-html-am - ( echo '(add-plugin "edwin" "@MIT_SCHEME_PROJECT@"'; \ - echo ' ""'; \ - echo ' "$(DESTDIR)$(scmlibdir)"'; \ - echo ' "$(DESTDIR)$(scmdocdir)")' ) \ - | $(MIT_SCHEME_EXE) --batch-mode install-info-am: uninstall-info-am: uninstall-hook: - ( echo '(remove-plugin "edwin" "@MIT_SCHEME_PROJECT@"'; \ - echo ' ""'; \ - echo ' "$(DESTDIR)$(scmlibdir)"'; \ - echo ' "$(DESTDIR)$(scmdocdir)")' ) \ - | $(MIT_SCHEME_EXE) --batch-mode - [ -d "$(DESTDIR)$(scmlib_subdir)" ] \ - && rmdir "$(DESTDIR)$(scmlib_subdir)" diff --git a/src/etc/optiondb.scm b/src/etc/optiondb.scm index 0327b7c76..c0a513767 100644 --- a/src/etc/optiondb.scm +++ b/src/etc/optiondb.scm @@ -93,9 +93,15 @@ USA. (define-load-option 'cref (guarded-system-loader '(cross-reference) "cref")) +(define-load-option 'edwin + (guarded-system-loader '(edwin) "edwin")) + (define-load-option 'ffi (guarded-system-loader '(ffi) "ffi")) +(define-load-option 'imail + (guarded-system-loader '(edwin imail) "imail")) + (define-load-option '*parser (guarded-system-loader '(runtime *parser) "star-parser")) @@ -114,6 +120,12 @@ USA. (define-load-option 'win32 (guarded-system-loader '(win32) "win32")) +(define-load-option 'x11 + (guarded-system-loader '(x11) "x11")) + +(define-load-option 'x11-screen + (guarded-system-loader '(edwin screen x11-screen) "x11-screen")) + (define-load-option 'xdoc (guarded-system-loader '(runtime ssp xdoc) "xdoc")) diff --git a/src/gdbm/compile.scm b/src/gdbm/compile.scm index b4c7c9841..39e88aadf 100644 --- a/src/gdbm/compile.scm +++ b/src/gdbm/compile.scm @@ -3,6 +3,10 @@ ;;;; Compile the GDBM option. (load-option 'cref) -(load-option 'ffi) -(compile-file "gdbm" '() (->environment '(runtime))) -(cref/generate-constructors "gdbm") \ No newline at end of file +(with-working-directory-pathname (directory-pathname (current-load-pathname)) + (lambda () + (with-working-directory-pathname (merge-pathnames "../ffi") + (lambda () + (load "make"))) + (compile-file "gdbm" '() (->environment '(runtime))) + (cref/generate-constructors "gdbm"))) \ No newline at end of file diff --git a/src/imail/compile.scm b/src/imail/compile.scm index e12daa323..cc00ef572 100644 --- a/src/imail/compile.scm +++ b/src/imail/compile.scm @@ -27,14 +27,17 @@ USA. ;;;; IMAIL mail reader: compilation (load-option 'cref) -(load-option 'sos) -(load-option '*parser) (with-working-directory-pathname (directory-pathname (current-load-pathname)) (lambda () - (unless (load-option 'edwin #t) - (with-working-directory-pathname (merge-pathnames "../edwin") - (lambda () - (load "make")))) + (with-working-directory-pathname (merge-pathnames "../sos") + (lambda () + (load "load"))) + (with-working-directory-pathname (merge-pathnames "../star-parser") + (lambda () + (load "load"))) + (with-working-directory-pathname (merge-pathnames "../edwin") + (lambda () + (load "make"))) (for-each (lambda (filename) (compile-file filename '() (->environment '(edwin)))) '("imail-browser" diff --git a/src/mcrypt/compile.scm b/src/mcrypt/compile.scm index f98c295d1..5be57ba73 100644 --- a/src/mcrypt/compile.scm +++ b/src/mcrypt/compile.scm @@ -3,6 +3,10 @@ ;;;; Compile the MCRYPT option. (load-option 'cref) -(load-option 'ffi) -(compile-file "mcrypt" '() (->environment '(runtime))) -(cref/generate-constructors "mcrypt") \ No newline at end of file +(with-working-directory-pathname (directory-pathname (current-load-pathname)) + (lambda () + (with-working-directory-pathname (merge-pathnames "../ffi") + (lambda () + (load "make"))) + (compile-file "mcrypt" '() (->environment '(runtime))) + (cref/generate-constructors "mcrypt"))) \ No newline at end of file diff --git a/src/pgsql/compile.scm b/src/pgsql/compile.scm index f957028b2..91c447aea 100644 --- a/src/pgsql/compile.scm +++ b/src/pgsql/compile.scm @@ -3,6 +3,10 @@ ;;;; Compile the PGSQL option. (load-option 'cref) -(load-option 'ffi) -(compile-file "pgsql" '() (->environment '())) -(cref/generate-constructors "pgsql") \ No newline at end of file +(with-working-directory-pathname (directory-pathname (current-load-pathname)) + (lambda () + (with-working-directory-pathname (merge-pathnames "../ffi") + (lambda () + (load "make"))) + (compile-file "pgsql" '() (->environment '())) + (cref/generate-constructors "pgsql"))) \ No newline at end of file diff --git a/src/x11-screen/compile.scm b/src/x11-screen/compile.scm index 9f1e180b5..8bb53f120 100644 --- a/src/x11-screen/compile.scm +++ b/src/x11-screen/compile.scm @@ -27,10 +27,9 @@ USA. (load-option 'cref) (with-working-directory-pathname (directory-pathname (current-load-pathname)) (lambda () - (unless (load-option 'edwin #t) - (with-working-directory-pathname (merge-pathnames "../edwin") - (lambda () - (load "make")))) + (with-working-directory-pathname (merge-pathnames "../edwin") + (lambda () + (load "make"))) (for-each (lambda (filename) (compile-file filename '() (->environment '(edwin)))) '("x11-screen" diff --git a/src/x11/compile.scm b/src/x11/compile.scm new file mode 100644 index 000000000..197e2a759 --- /dev/null +++ b/src/x11/compile.scm @@ -0,0 +1,43 @@ +#| -*-Scheme-*- + +Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, + 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, + 2017, 2018 Massachusetts Institute of Technology + +This file is part of MIT/GNU Scheme. + +MIT/GNU Scheme is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at +your option) any later version. + +MIT/GNU Scheme is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with MIT/GNU Scheme; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, +USA. + +|# + + +(load-option 'cref) +(with-working-directory-pathname (directory-pathname (current-load-pathname)) + (lambda () + (with-working-directory-pathname (merge-pathnames "../ffi") + (lambda () + (load "make"))) + (for-each (let ((env (->environment '(runtime)))) + (lambda (filename) + (compile-file filename '() env))) + '("x11" + "x11-base" + "x11-color" + "x11-graphics" + "x11-device" + "x11-terminal")) + (cref/generate-constructors "x11"))) \ No newline at end of file diff --git a/src/x11/compile.sh b/src/x11/compile.sh index 17324858d..b158101ff 100755 --- a/src/x11/compile.sh +++ b/src/x11/compile.sh @@ -28,21 +28,7 @@ set -e : ${MIT_SCHEME_EXE=mit-scheme} ${MIT_SCHEME_EXE} --prepend-library . --batch-mode <<\EOF - -(begin - (load-option 'cref) - (load-option 'ffi) - - (let ((runtime (->environment '(runtime)))) - (compile-file "x11" '() runtime) - (compile-file "x11-base" '() runtime) - (compile-file "x11-color" '() runtime) - (compile-file "x11-graphics" '() runtime) - (compile-file "x11-device" '() runtime) - (compile-file "x11-terminal" '() runtime)) - - (cref/generate-constructors "x11") - ) +(load "compile.scm") EOF suffix=`echo "(display (microcode-id/operating-system-suffix))" \ | ${MIT_SCHEME_EXE} --batch-mode`