Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -17,11 +17,11 @@ # make install CSCOPTS='-accumulate-profile -profile-name $(PWD)/profile-ww$(shell date +%V.%u)' # rm .o ; make install CSCOPTS='-profile' ; ... ; chicken-profile | less SHELL=/bin/bash PREFIX=$(PWD)/tmpinstall -CSCOPTS= + INSTALL=install SRCFILES = common.scm items.scm launch.scm \ ods.scm runconfig.scm server.scm \ db.scm keys.scm margs.scm megatest-version.scm \ process.scm runs.scm tasks.scm tests.scm genexample.scm \ @@ -30,12 +30,13 @@ ezsteps.scm lock-queue.scm sdb.scm \ rmt.scm api.scm subrun.scm \ portlogger.scm archive.scm env.scm diff-report.scm cgisetup/models/pgdb.scm # module source files -MSRCFILES = ftail.scm +MSRCFILES = ftail.scm # mtcommon.scm mtdb.scm mtconfigf.scm + # Eggs to install (straightforward ones) EGGS=matchable readline apropos base64 regex-literals format regex-case test coops trace csv \ dot-locking posix-utils posix-extras directory-utils hostinfo tcp-server rpc csv-xml fmt \ json md5 awful http-client spiffy uri-common intarweb spiffy-request-vars \ @@ -45,10 +46,12 @@ OFILES = $(SRCFILES:%.scm=%.o) GOFILES = $(GUISRCF:%.scm=%.o) MOFILES = $(MSRCFILES:%.scm=%.o) + + %.o : %.scm ../adat.scm csc $(CSCOPTS) -J -c $< -o $*.o ADTLSCR=mt_laststep mt_runstep mt_ezstep @@ -57,11 +60,17 @@ MTESTHASH=$(shell fossil info|grep checkout:| awk '{print $$2}') MT_EGGS_BASE=$(PREFIX)/eggs MT_EGGS_DIR=$(MT_EGGS_BASE)/lib/chicken/7 MTEGGS=$(MT_EGGS_DIR)/mtconfigf.so -CHICKEN_REPOSITORY=$(MT_EGGS_BASE) +CHICKEN_REPOSITORY=$(MT_EGGS_DIR) +export CHICKEN_REPOSITORY +CSCOPTS=-Wl,-rpath,$(MT_EGGS_DIR) + + +# prefix commands with $(withenv) following as a means to collect env vars for compilation... +withenv=CHICKEN_REPOSITORY=$(MT_EGGS_DIR) ifeq ($(MTESTHASH),) $(error MTESTHASH is broken!) endif @@ -77,11 +86,11 @@ PNGFILES = $(shell cd docs/manual;ls *png) #all : $(PREFIX)/bin/.$(ARCHSTR) mtest dboard mtut ndboard all : $(PREFIX)/bin/.$(ARCHSTR) mtest dboard mtut eggs -mtest: $(OFILES) readline-fix.scm megatest.o $(MOFILES) +mtest: $(OFILES) readline-fix.scm megatest.o $(MOFILES) $(MTEGGS) csc $(CSCOPTS) $(OFILES) $(MOFILES) megatest.o -o mtest showmtesthash: @echo $(MTESTHASH) @@ -164,11 +173,11 @@ # $(MT_EGGS_DIR) : mkdir -p $(MT_EGGS_DIR) $(MT_EGGS_DIR)/types.db : $(MT_EGGS_DIR) - cp -rs $(CKREPOSITORY)/ $(MT_EGGS_BASE)/lib/chicken/ + cp -rsf $(CKREPOSITORY)/ $(MT_EGGS_BASE)/lib/chicken/ # chicken-install -init $(MT_EGGS_DIR) $(MT_EGGS_DIR)/mtconfigf.so : $(MT_EGGS_DIR)/types.db $(MTUTILS_DIR)/mtconfigf/mtconfigf.scm cd $(MTUTILS_DIR)/mtconfigf && chicken-install -prefix $(MT_EGGS_BASE) Index: cgisetup/models/pgdb.scm ================================================================== --- cgisetup/models/pgdb.scm +++ cgisetup/models/pgdb.scm @@ -17,12 +17,12 @@ ;; along with Megatest. If not, see . ;;====================================================================== (declare (unit pgdb)) -(declare (uses mtconfigf)) -(import (prefix mtconfigf configf:)) +;;(declare (uses mtconfigf)) +(use (prefix mtconfigf configf:)) ;; I don't know how to mix compilation units and modules, so no module here. ;; ;; (module pgdb ;; ( Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -26,12 +26,51 @@ (prefix sqlite3 sqlite3:) pkts (prefix dbi dbi:) ) (declare (unit common)) -(declare (uses mtconfigf)) -(import (prefix mtconfigf configf:)) + +(use posix-extras pathname-expand files) + +;; this plugs a hole in posix-extras in recent chicken versions > 4.9) +(let-values (( (chicken-release-number chicken-major-version) + (apply values + (map string->number + (take + (string-split (chicken-version) ".") + 2))))) + (let ((resolve-pathname-broken? + (or (> chicken-release-number 4) + (and (eq? 4 chicken-release-number) (> chicken-major-version 9))))) + (if resolve-pathname-broken? + (define ##sys#expand-home-path pathname-expand)))) + +(define (realpath x) (resolve-pathname (pathname-expand (or x "/dev/null")) )) + +(define (common:get-this-exe-fullpath #!key (argv (argv))) + (let* ((this-script + (cond + ((and (> (length argv) 2) + (string-match "^(.*/csi|csi)$" (car argv)) + (string-match "^-(s|ss|sx|script)$" (cadr argv))) + (caddr argv)) + (else (car argv)))) + (fullpath (realpath this-script))) + fullpath)) +(define *common:this-exe-fullpath* (common:get-this-exe-fullpath)) +(define *common:this-exe-dir* (pathname-directory *common:this-exe-fullpath*)) +(define *common:this-exe-name* (pathname-strip-directory *common:this-exe-fullpath*)) + +(let* ((libpath (conc *common:this-exe-dir* "/../../eggs/lib/chicken/7"))) + (if (and (not (get-environment-variable "CHICKEN_REPOSITORY")) + (directory-exists? libpath)) + (repository-path libpath))) + + + +;;(declare (uses mtconfigf)) +(use (prefix mtconfigf configf:)) (include "common_records.scm") ;; (require-library margs) @@ -194,42 +233,10 @@ (define *launch-setup-mutex* (make-mutex)) ;; need to be able to call launch:setup often so mutex it and re-call the real deal only if *toppath* not set (define *homehost-mutex* (make-mutex)) ;; Miscellaneous (define *triggers-mutex* (make-mutex)) ;; block overlapping processing of triggers - -(use posix-extras pathname-expand files) - -;; this plugs a hole in posix-extras in recent chicken versions > 4.9) -(let-values (( (chicken-release-number chicken-major-version) - (apply values - (map string->number - (take - (string-split (chicken-version) ".") - 2))))) - (let ((resolve-pathname-broken? - (or (> chicken-release-number 4) - (and (eq? 4 chicken-release-number) (> chicken-major-version 9))))) - (if resolve-pathname-broken? - (define ##sys#expand-home-path pathname-expand)))) - -(define (realpath x) (resolve-pathname (pathname-expand (or x "/dev/null")) )) - -(define (common:get-this-exe-fullpath #!key (argv (argv))) - (let* ((this-script - (cond - ((and (> (length argv) 2) - (string-match "^(.*/csi|csi)$" (car argv)) - (string-match "^-(s|ss|sx|script)$" (cadr argv))) - (caddr argv)) - (else (car argv)))) - (fullpath (realpath this-script))) - fullpath)) -(define *common:this-exe-fullpath* (common:get-this-exe-fullpath)) -(define *common:this-exe-dir* (pathname-directory *common:this-exe-fullpath*)) -(define *common:this-exe-name* (pathname-strip-directory *common:this-exe-fullpath*)) - Index: dashboard.scm ================================================================== --- dashboard.scm +++ dashboard.scm @@ -33,12 +33,12 @@ (declare (uses margs)) (declare (uses keys)) (declare (uses items)) (declare (uses db)) -(declare (uses mtconfigf)) -(import (prefix mtconfigf configf:)) +;;(declare (uses mtconfigf)) +(use (prefix mtconfigf configf:)) (declare (uses process)) (declare (uses launch)) (declare (uses runs)) (declare (uses dashboard-tests)) Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -32,12 +32,12 @@ (declare (uses subrun)) (declare (uses common)) ;; (declare (uses configf)) (declare (uses db)) -(declare (uses mtconfigf)) -(import (prefix mtconfigf configf:)) +;;(declare (uses mtconfigf)) +(use (prefix mtconfigf configf:)) (include "common_records.scm") (include "key_records.scm") (include "db_records.scm") Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -53,12 +53,12 @@ (declare (uses tasks)) ;; only used for debugging. (declare (uses env)) (declare (uses diff-report)) (declare (uses ftail)) (import ftail) -(declare (uses mtconfigf)) -(import (prefix mtconfigf configf:)) +;;(declare (uses mtconfigf)) +(use (prefix mtconfigf configf:)) (define *db* #f) ;; this is only for the repl, do not use in general!!!! (include "common_records.scm") (include "key_records.scm") Index: mtut.scm ================================================================== --- mtut.scm +++ mtut.scm @@ -32,12 +32,12 @@ (declare (uses megatest-version)) (declare (uses margs)) ;; (declare (uses rmt)) ;; mtconfigf is compiled in as a compilation unit -(declare (uses mtconfigf)) -(import (prefix mtconfigf configf:)) +;;(declare (uses mtconfigf)) +(use (prefix mtconfigf configf:)) (use ducttape-lib) (include "megatest-fossil-hash.scm")