From: Chris Hanson Date: Mon, 22 Oct 2018 07:04:11 +0000 (-0700) Subject: Get plugins working using the top-level makefile. X-Git-Tag: mit-scheme-pucked-10.1.2~16^2~193 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=76e6fa27db81ecbc5ce103bc1360167b1f4695ff;p=mit-scheme.git Get plugins working using the top-level makefile. Probably still some bugs; note workarounds for interaction between edwin and blowfish/gdbm. I'd like to fix those by making new plugins for the parts of edwin that use those; that way they're installed only if both edwin and the matching plugin is installed. --- diff --git a/src/Makefile.in b/src/Makefile.in index 9cf12bf3d..9285043cb 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -63,7 +63,7 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/microcode/mkinstalldirs LIARC_BOOT_BUNDLES = compiler cref sf star-parser LIARC_BUNDLES = $(LIARC_BOOT_BUNDLES) ffi sos ssp xml -SUBDIRS = $(INSTALLED_SUBDIRS) 6001 win32 xdoc +SUBDIRS = $(INSTALLED_SUBDIRS) win32 xdoc INSTALLED_SUBDIRS = microcode runtime $(LIARC_BUNDLES) OPTION_SUBDIRS = @OPTION_SUBDIRS@ @@ -110,9 +110,14 @@ all-native: all-ssp all-native: all-star-parser all-native: all-win32 all-native: all-xml -@IF_X11@all-native: all-x11 +@IF_BLOWFISH@all-native: all-blowfish @IF_EDWIN@all-native: all-edwin +@IF_GDBM@all-native: all-gdbm @IF_IMAIL@all-native: all-imail +@IF_MCRYPT@all-native: all-mcrypt +@IF_PGSQL@all-native: all-pgsql +@IF_X11@all-native: all-x11 +@IF_X11_SCREEN@all-native: all-x11-screen # XXX This should really depend on microcode/gen-nonce and # microcode/extract-liarc-decls instead of microcode/scheme, but @@ -380,19 +385,43 @@ bundle-xml: xml/xml-unx.c (cd xml && $(MAKE) compile-liarc-bundle) ################ -# Edwin +# blowfish +################ + +.PHONY: all-blowfish +all-blowfish: compile-blowfish + +.PHONY: compile-blowfish +compile-blowfish: compile-runtime + (cd blowfish && MIT_SCHEME_EXE=$(MIT_SCHEME_EXE) $(MAKE)) + +################ +# edwin ################ .PHONY: all-edwin all-edwin: compile-edwin .PHONY: compile-edwin -compile-edwin: compile-runtime +compile-edwin: compile-runtime compile-xml +@IF_BLOWFISH@compile-edwin: compile-blowfish +@IF_GDBM@compile-edwin: compile-gdbm @IF_X11@compile-edwin: compile-x11 - (cd edwin && $(MAKE)) + (cd edwin && MIT_SCHEME_EXE=$(MIT_SCHEME_EXE) $(MAKE)) ################ -# Imail +# gdbm +################ + +.PHONY: all-gdbm +all-gdbm: compile-gdbm + +.PHONY: compile-gdbm +compile-gdbm: compile-runtime + (cd gdbm && MIT_SCHEME_EXE=$(MIT_SCHEME_EXE) $(MAKE)) + +################ +# imail ################ .PHONY: all-imail @@ -400,7 +429,29 @@ all-imail: compile-imail .PHONY: compile-imail compile-imail: compile-runtime compile-sos compile-edwin compile-star-parser - (cd imail && $(MAKE)) + (cd imail && MIT_SCHEME_EXE=$(MIT_SCHEME_EXE) $(MAKE)) + +################ +# mcrypt +################ + +.PHONY: all-mcrypt +all-mcrypt: compile-mcrypt + +.PHONY: compile-mcrypt +compile-mcrypt: compile-runtime + (cd mcrypt && MIT_SCHEME_EXE=$(MIT_SCHEME_EXE) $(MAKE)) + +################ +# pgsql +################ + +.PHONY: all-pgsql +all-pgsql: compile-pgsql + +.PHONY: compile-pgsql +compile-pgsql: compile-runtime + (cd pgsql && MIT_SCHEME_EXE=$(MIT_SCHEME_EXE) $(MAKE)) ################ # X11 @@ -411,8 +462,18 @@ all-x11: compile-x11 .PHONY: compile-x11 compile-x11: compile-runtime - (cd x11 && $(MAKE)) - (cd x11-screen && $(MAKE)) + (cd x11 && MIT_SCHEME_EXE=$(MIT_SCHEME_EXE) $(MAKE)) + +################ +# X11-screen +################ + +.PHONY: all-x11-screen +all-x11-screen: compile-x11-screen + +.PHONY: compile-x11-screen +compile-x11-screen: compile-runtime compile-x11 compile-edwin + (cd x11-screen && MIT_SCHEME_EXE=$(MIT_SCHEME_EXE) $(MAKE)) ##################### ### Cross compilation diff --git a/src/blowfish/blowfish.pkg b/src/blowfish/blowfish.pkg index 23879068a..5ad69c167 100644 --- a/src/blowfish/blowfish.pkg +++ b/src/blowfish/blowfish.pkg @@ -24,7 +24,7 @@ USA. |# -(global-definitions runtime/) +(global-definitions "../runtime/") (define-package (blowfish) (files "blowfish") diff --git a/src/blowfish/compile.scm b/src/blowfish/compile.scm index c6cba0ee8..e3d666dcf 100644 --- a/src/blowfish/compile.scm +++ b/src/blowfish/compile.scm @@ -2,7 +2,7 @@ ;;;; Compile the BLOWFISH option. -(load-option 'CREF) -(load-option 'FFI) -(compile-file "blowfish" '() (->environment '(RUNTIME))) +(load-option 'cref) +(load-option 'ffi) +(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 c5c2277fd..34adfde50 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -96,7 +96,7 @@ AC_ARG_ENABLE([x11], AC_ARG_ENABLE([edwin], AS_HELP_STRING([--enable-edwin], - [Add support for the Edwin edit [[yes]]])) + [Add support for the Edwin editor [[yes]]])) : ${enable_edwin=yes} AC_ARG_ENABLE([imail], @@ -255,12 +255,18 @@ if test x"${mit_scheme_native_code}" = xsvm1 \ HOST_COMPILER_HEAP="--heap 10000" fi +if test x"${enable_x11}" = xyes && test x"${enable_edwin}" = xyes; then + enable_x11_screen=yes +else + enable_x11_screen=no +fi + OPTION_SUBDIRS= -if test x"${enable_x11}" = xyes; then - OPTION_SUBDIRS="${OPTION_SUBDIRS} x11 x11-screen" - IF_X11= +if test x"${enable_blowfish}" = xyes; then + OPTION_SUBDIRS="${OPTION_SUBDIRS} blowfish" + IF_BLOWFISH= else - IF_X11="#!x11: " + IF_BLOWFISH="#!blowfish: " fi if test x"${enable_edwin}" = xyes; then OPTION_SUBDIRS="${OPTION_SUBDIRS} edwin" @@ -268,24 +274,18 @@ if test x"${enable_edwin}" = xyes; then 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_imail}" = xyes; then + OPTION_SUBDIRS="${OPTION_SUBDIRS} imail" + IF_IMAIL= +else + IF_IMAIL="#!imail: " +fi if test x"${enable_mcrypt}" = xyes; then OPTION_SUBDIRS="${OPTION_SUBDIRS} mcrypt" IF_MCRYPT= @@ -298,6 +298,18 @@ if test x"${enable_pgsql}" = xyes; then else IF_PGSQL="#!pgsql: " fi +if test x"${enable_x11}" = xyes; then + OPTION_SUBDIRS="${OPTION_SUBDIRS} x11" + IF_X11= +else + IF_X11="#!x11: " +fi +if test x"${enable_x11_screen}" = xyes; then + OPTION_SUBDIRS="${OPTION_SUBDIRS} x11-screen" + IF_X11_SCREEN= +else + IF_X11_SCREEN="#!x11-screen: " +fi AC_SUBST([ALL_TARGET]) AC_SUBST([AUXDIR]) @@ -315,6 +327,7 @@ AC_SUBST([IF_PGSQL]) AC_SUBST([IF_SVM]) AC_SUBST([IF_SVM_COMPILER]) AC_SUBST([IF_X11]) +AC_SUBST([IF_X11_SCREEN]) AC_SUBST([INSTALL_COM]) AC_SUBST([INSTALL_LIARC_BUNDLES]) AC_SUBST([MIT_SCHEME_EXE]) @@ -348,7 +361,10 @@ 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]) + AC_CONFIG_SUBDIRS([x11]) +fi +if test x"${enable_x11_screen}" = xyes; then + AC_CONFIG_SUBDIRS([x11-screen]) fi AC_CONFIG_FILES([ diff --git a/src/edwin/edwin.pkg b/src/edwin/edwin.pkg index ac04bb3aa..a1a03839e 100644 --- a/src/edwin/edwin.pkg +++ b/src/edwin/edwin.pkg @@ -26,10 +26,8 @@ USA. ;;;; Edwin Packaging -(global-definitions runtime/) -(global-definitions xml/) -(global-definitions blowfish/) -(global-definitions gdbm/) +(global-definitions "../runtime/") +(global-definitions "../xml/") (define-package (edwin) (files "utils" @@ -122,6 +120,7 @@ USA. (port/output-channel output-port-channel) (port/state textual-port-state) generic-port-operation:write-substring) + #| (import (blowfish) blowfish-encrypt-port blowfish-file? @@ -140,6 +139,7 @@ USA. gdbm_fast gdbm_replace gdbm_wrcreat) + |# (export () create-editor create-editor-args diff --git a/src/edwin/edwin.sf b/src/edwin/edwin.sf index 87522d795..f2aad22d7 100644 --- a/src/edwin/edwin.sf +++ b/src/edwin/edwin.sf @@ -25,9 +25,6 @@ USA. |# (load-option 'cref) -(load-option 'xml) -(load-option 'blowfish) -(load-option 'gdbm) (if (not (name->package '(edwin))) (let ((package-set (package-set-pathname "edwin"))) diff --git a/src/edwin/make.scm b/src/edwin/make.scm index d1cdee9ff..2a5c59ab8 100644 --- a/src/edwin/make.scm +++ b/src/edwin/make.scm @@ -29,8 +29,6 @@ USA. (declare (usual-integrations)) (load-option 'xml) -(load-option 'blowfish) -(load-option 'gdbm) (with-loader-base-uri (system-library-uri "edwin/") (lambda () (load-package-set "edwin" diff --git a/src/gdbm/compile.scm b/src/gdbm/compile.scm index fe20d1d59..b4c7c9841 100644 --- a/src/gdbm/compile.scm +++ b/src/gdbm/compile.scm @@ -2,7 +2,7 @@ ;;;; Compile the GDBM option. -(load-option 'CREF) -(load-option 'FFI) -(compile-file "gdbm" '() (->environment '(RUNTIME))) +(load-option 'cref) +(load-option 'ffi) +(compile-file "gdbm" '() (->environment '(runtime))) (cref/generate-constructors "gdbm") \ No newline at end of file diff --git a/src/gdbm/gdbm.pkg b/src/gdbm/gdbm.pkg index 2d29d9be9..56fd964ef 100644 --- a/src/gdbm/gdbm.pkg +++ b/src/gdbm/gdbm.pkg @@ -24,7 +24,7 @@ USA. |# -(global-definitions runtime/) +(global-definitions "../runtime/") (define-package (gdbm) (files "gdbm") diff --git a/src/imail/compile.scm b/src/imail/compile.scm index 3fb0d6146..e12daa323 100644 --- a/src/imail/compile.scm +++ b/src/imail/compile.scm @@ -31,6 +31,10 @@ USA. (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")))) (for-each (lambda (filename) (compile-file filename '() (->environment '(edwin)))) '("imail-browser" diff --git a/src/imail/compile.sh b/src/imail/compile.sh index c396df36b..83fc7cf7f 100755 --- a/src/imail/compile.sh +++ b/src/imail/compile.sh @@ -3,8 +3,8 @@ # # 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 -# Massachusetts Institute of Technology +# 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. # @@ -12,12 +12,12 @@ # 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, @@ -28,13 +28,7 @@ set -e : ${MIT_SCHEME_EXE=mit-scheme} ${MIT_SCHEME_EXE} --batch-mode <<\EOF -(begin - - (parameterize ((param:suppress-loading-message? #t)) - (load-option 'EDWIN)) - - (load "compile.scm") - ) +(load "compile.scm") EOF suffix=`echo "(display (microcode-id/operating-system-suffix))" \ | ${MIT_SCHEME_EXE} --batch-mode` diff --git a/src/imail/imail.pkg b/src/imail/imail.pkg index 4178e8383..e4d5792d7 100644 --- a/src/imail/imail.pkg +++ b/src/imail/imail.pkg @@ -26,10 +26,10 @@ USA. ;;;; IMAIL mail reader: packaging -(global-definitions runtime/) -(global-definitions sos/) -(global-definitions edwin/) -(global-definitions star-parser/parser) +(global-definitions "../runtime/") +(global-definitions "../sos/") +(global-definitions "../edwin/") +(global-definitions "../star-parser/parser") (define-package (edwin imail) (files "imail-util" diff --git a/src/mcrypt/compile.scm b/src/mcrypt/compile.scm index b1ade84a6..f98c295d1 100644 --- a/src/mcrypt/compile.scm +++ b/src/mcrypt/compile.scm @@ -2,7 +2,7 @@ ;;;; Compile the MCRYPT option. -(load-option 'CREF) -(load-option 'FFI) -(compile-file "mcrypt" '() (->environment '(RUNTIME))) +(load-option 'cref) +(load-option 'ffi) +(compile-file "mcrypt" '() (->environment '(runtime))) (cref/generate-constructors "mcrypt") \ No newline at end of file diff --git a/src/mcrypt/mcrypt.pkg b/src/mcrypt/mcrypt.pkg index 98e63b95e..b023f1e85 100644 --- a/src/mcrypt/mcrypt.pkg +++ b/src/mcrypt/mcrypt.pkg @@ -24,7 +24,7 @@ USA. |# -(global-definitions runtime/) +(global-definitions "../runtime/") (define-package (mcrypt) (files "mcrypt") diff --git a/src/pgsql/compile.scm b/src/pgsql/compile.scm index f4be94acd..f957028b2 100644 --- a/src/pgsql/compile.scm +++ b/src/pgsql/compile.scm @@ -2,7 +2,7 @@ ;;;; Compile the PGSQL option. -(load-option 'CREF) -(load-option 'FFI) +(load-option 'cref) +(load-option 'ffi) (compile-file "pgsql" '() (->environment '())) (cref/generate-constructors "pgsql") \ No newline at end of file diff --git a/src/pgsql/pgsql.pkg b/src/pgsql/pgsql.pkg index fe9548a75..e662721f9 100644 --- a/src/pgsql/pgsql.pkg +++ b/src/pgsql/pgsql.pkg @@ -24,7 +24,7 @@ USA. |# -(global-definitions runtime/) +(global-definitions "../runtime/") (define-package (postgresql) (files "pgsql") diff --git a/src/x11-screen/compile.scm b/src/x11-screen/compile.scm new file mode 100644 index 000000000..9f1e180b5 --- /dev/null +++ b/src/x11-screen/compile.scm @@ -0,0 +1,39 @@ +#| -*-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 () + (unless (load-option 'edwin #t) + (with-working-directory-pathname (merge-pathnames "../edwin") + (lambda () + (load "make")))) + (for-each (lambda (filename) + (compile-file filename '() (->environment '(edwin)))) + '("x11-screen" + "x11-key" + "x11-command")) + (cref/generate-constructors "x11-screen"))) \ No newline at end of file diff --git a/src/x11-screen/compile.sh b/src/x11-screen/compile.sh index 88556b52c..781e5dc91 100755 --- a/src/x11-screen/compile.sh +++ b/src/x11-screen/compile.sh @@ -28,26 +28,7 @@ set -e : ${MIT_SCHEME_EXE=mit-scheme} ${MIT_SCHEME_EXE} --batch-mode <<\EOF -(begin - - (parameterize ((param:suppress-loading-message? #t)) - (load-option 'CREF) - (load-option 'X11) - (load-option 'EDWIN)) - - (if (name->package '(EDWIN SCREEN X11-SCREEN)) - (error "The (EDWIN SCREEN X11-SCREEN) package already exists.")) - (let ((package-set (package-set-pathname "x11-screen"))) - (if (not (file-modification-timeenvironment '(edwin screen x11-screen))) - (compile-file "x11-key" '() (->environment '(edwin x11-keys))) - (compile-file "x11-command" '() (->environment '(edwin x11-commands))) - - (cref/generate-constructors "x11-screen") - ) +(load "compile.scm") EOF suffix=`echo "(display (microcode-id/operating-system-suffix))" \ | ${MIT_SCHEME_EXE} --batch-mode` diff --git a/src/x11-screen/x11-screen.pkg b/src/x11-screen/x11-screen.pkg index b25d6dfb2..96faaa737 100644 --- a/src/x11-screen/x11-screen.pkg +++ b/src/x11-screen/x11-screen.pkg @@ -25,9 +25,9 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. ;;;; Edwin Packaging -(global-definitions runtime/) -(global-definitions edwin/) -(global-definitions x11/) +(global-definitions "../runtime/") +(global-definitions "../edwin/") +(global-definitions "../x11/") (define-package (edwin screen x11-screen) (files "x11-screen") diff --git a/src/x11/compile.sh b/src/x11/compile.sh index b1b88e76d..17324858d 100755 --- a/src/x11/compile.sh +++ b/src/x11/compile.sh @@ -30,8 +30,8 @@ set -e ${MIT_SCHEME_EXE} --prepend-library . --batch-mode <<\EOF (begin - (load-option 'CREF) - (load-option 'FFI) + (load-option 'cref) + (load-option 'ffi) (let ((runtime (->environment '(runtime)))) (compile-file "x11" '() runtime) diff --git a/src/x11/x11.pkg b/src/x11/x11.pkg index 1c6055951..c82998671 100644 --- a/src/x11/x11.pkg +++ b/src/x11/x11.pkg @@ -25,7 +25,7 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. ;;;; X11 Graphics Packaging -(global-definitions runtime/) +(global-definitions "../runtime/") (define-package (x11) (files "x11")