From 5208c8aadf85fe673c432bfc632984742542dc16 Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Sun, 22 May 2011 18:00:18 +0200 Subject: [PATCH] Allow customizing ECL using extra files and a different init form. --- src/compile.lsp.in | 14 ++++++++++++-- src/configure | 41 ++++++++++++++++++++++++++++++++++++++--- src/configure.in | 23 +++++++++++++++++++++++ 3 files changed, 73 insertions(+), 5 deletions(-) diff --git a/src/compile.lsp.in b/src/compile.lsp.in index 0c437ac71..11d35e1a4 100755 --- a/src/compile.lsp.in +++ b/src/compile.lsp.in @@ -89,12 +89,21 @@ ))) #+CLOS (let* ((c::*compile-to-linking-call* nil)) - (mapc #'proclaim +ecl-optimization-settings+) + (mapc #'proclaim +ecl-optimization-settings+) (setq lsp-objects (append lsp-objects (compile-if-old "build:clos;" +clos-module-files+ - :system-p t :c-file t :data-file t :h-file t + :system-p t :c-file t :data-file t + :h-file t ;;:shared-data-file "build:ecl.sdat" )))) + (let ((extra-lisp-files '(@ECL_EXTRA_LISP_FILES@))) + (when extra-lisp-files + (setq lsp-objects (append lsp-objects + (compile-if-old "build:ext;" extra-lisp-files + :system-p t :c-file t :data-file t + :h-file t + ;;:shared-data-file "build:ecl.sdat" + ))))) (c::build-static-library "lsp" :lisp-files lsp-objects ;;:shared-data-file "build:ecl.sdat" )) @@ -342,6 +351,7 @@ #+:msvc "ecl2" #+(and (or cross stage1) (not msvc)) "bin/ecl" #-(or cross stage1 msvc) "ecl2" + :epilogue-code '@ECL_INIT_FORM@ :lisp-files *module-symbols* :ld-flags '(#-msvc "-L./" #+windows "ecl.res")) diff --git a/src/configure b/src/configure index e92a5c637..124c246fc 100755 --- a/src/configure +++ b/src/configure @@ -637,6 +637,8 @@ ac_includes_default="\ #endif" ac_subst_vars='LTLIBOBJS +ECL_INIT_FORM +ECL_EXTRA_LISP_FILES CHAR_CODE_LIMIT ECL_CHARACTER CLX_INFO @@ -814,6 +816,8 @@ enable_precisegc with_debug_cflags with_profile_cflags with_newcmp +with_extra_files +with_init_form with_x ' ac_precious_vars='build_alias @@ -826,9 +830,6 @@ LIBS CPPFLAGS CXX CXXFLAGS -LDFLAGS -LIBS -CPPFLAGS CCC CPP XMKMF' @@ -1540,6 +1541,9 @@ Optional Packages: --with-profile-cflags add profiling flags to the compiler invocation (yes,no,actual flags,default=NO) --with-newcmp new compiler (yes|no, default=NO) + --with-extra-files list of additional source files (default="") + --with-init-form lisp forms to execute at startup + (default="(si::top-level t)") --with-x use the X Window System Some influential environment variables: @@ -2428,6 +2432,24 @@ else fi + +# Check whether --with-extra-files was given. +if test "${with_extra_files+set}" = set; then + withval=$with_extra_files; with_extra_files="${withval}" +else + with_extra_files="" +fi + + + +# Check whether --with-init-form was given. +if test "${with_init_form+set}" = set; then + withval=$with_init_form; with_init_form="${withval}" +else + with_init_form="" +fi + + ecldir="${libdir}/ecl-${PACKAGE_VERSION}" test -z "${docdir}" && docdir="${datadir}/doc/ecl-${PACKAGE_VERSION}" @@ -15407,6 +15429,19 @@ fi + +ECL_EXTRA_LISP_FILES="" +for i in $with_extra_files; do + ECL_EXTRA_LISP_FILES="${ECL_EXTRA_LISP_FILES} \"$i\"" +done + +echo ${with_init_form} = init form +if test "x${with_init_form}" = "x"; then + ECL_INIT_FORM='(SI::TOP-LEVEL T)' +else + ECL_INIT_FORM="${with_init_form}" +fi + if test "${enable_hpack}" = "yes"; then cat >>confdefs.h <<\_ACEOF diff --git a/src/configure.in b/src/configure.in index a3033f175..4701c280d 100644 --- a/src/configure.in +++ b/src/configure.in @@ -278,6 +278,16 @@ AC_ARG_WITH(newcmp, [new compiler (yes|no, default=NO)]), [], [with_newcmp=no]) +AC_ARG_WITH(extra-files, + AS_HELP_STRING( [--with-extra-files], + [list of additional source files (default="")]), + [with_extra_files="${withval}"], [with_extra_files=""]) + +AC_ARG_WITH(init-form, + AS_HELP_STRING( [--with-init-form], + [lisp forms to execute at startup (default="(si::top-level t)")]), + [with_init_form="${withval}"], [with_init_form=""]) + dnl ----------------------------------------------------------------------- dnl Installation directories ecldir="${libdir}/ecl-${PACKAGE_VERSION}" @@ -840,6 +850,19 @@ fi AC_SUBST(ECL_CHARACTER) AC_SUBST(CHAR_CODE_LIMIT) +AC_SUBST(ECL_EXTRA_LISP_FILES) +ECL_EXTRA_LISP_FILES="" +for i in $with_extra_files; do + ECL_EXTRA_LISP_FILES="${ECL_EXTRA_LISP_FILES} \"$i\"" +done +AC_SUBST(ECL_INIT_FORM) +echo ${with_init_form} = init form +if test "x${with_init_form}" = "x"; then + ECL_INIT_FORM='(SI::TOP-LEVEL T)' +else + ECL_INIT_FORM="${with_init_form}" +fi + if test "${enable_hpack}" = "yes"; then AC_DEFINE(ECL_RELATIVE_PACKAGE_NAMES, [1], [Hierarchical package names]) fi