From dfa05a0c5cbbb6c02fd3c8d9b57f4bfce3743c19 Mon Sep 17 00:00:00 2001 From: mainzelm Date: Fri, 19 Dec 2003 14:08:58 +0000 Subject: [PATCH] Added structure CONFIGURE to access values from ./configure. --- Makefile.in | 17 ++++++++++++++++- scsh/configure.scm.in | 31 +++++++++++++++++++++++++++++++ scsh/scsh-interfaces.scm | 16 ++++++++++++++++ scsh/scsh-package.scm | 7 +++++++ 4 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 scsh/configure.scm.in diff --git a/Makefile.in b/Makefile.in index 6f7da70..e679bb5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -30,6 +30,7 @@ incdir = @includedir@ manext = 1 mandir = @mandir@/man$(manext) lib_dirs_list = @lib_dirs_list@ +host = @host@ ### End of `configure' section### htmldir = $(libdir)/scsh/doc/scsh-manual/html @@ -772,6 +773,7 @@ $(CIG).image: $(IMAGE) $(VM) $(srcdir)/cig/cig.scm $(srcdir)/cig/libcig.scm scsh: scsh/scsh scsh/scsh.image SCHEME =scsh/awk.scm \ + scsh/configure.scm \ scsh/defrec.scm \ scsh/endian.scm \ scsh/enumconst.scm \ @@ -919,4 +921,17 @@ clean-scsh: $(RM) scsh/*.image $(RM) $(LIBSCSHVM) $(LIBSCSH) scsh/scsh$(EXEEXT) - +scsh/configure.scm: scsh/configure.scm.in + sed -e "s|@scsh_host@|$(host)|g" \ + -e "s|@scsh_prefix@|$(prefix)|g" \ + -e "s|@scsh_exec_prefix@|$(exec_prefix)|g" \ + -e "s|@scsh_bindir@|$(bindir)|g" \ + -e "s|@scsh_libdir@|$(libdir)|g" \ + -e "s|@scsh_includedir@|$(incdir)|g" \ + -e "s|@scsh_mandir@|$(mandir)|g" \ + -e "s|@scsh_lib_dirs_list@|$(lib_dirs_list)|g" \ + -e "s|@scsh_LIBS@|$(LIBS)|g" \ + -e "s|@scsh_DEFS@|$(DEFS)|g" \ + -e "s|@scsh_CFLAGS@|$(CFLAGS)|g" \ + -e "s|@scsh_CPPFLAGS@|$(CPPFLAGS)|g" \ + -e "s|@scsh_LDFLAGS@|$(LDFLAGS)|g" $< > $@ diff --git a/scsh/configure.scm.in b/scsh/configure.scm.in new file mode 100644 index 0000000..4cb95e9 --- /dev/null +++ b/scsh/configure.scm.in @@ -0,0 +1,31 @@ +(define (host) "@scsh_host@") + +(define (prefix) "@scsh_prefix@") + +(define (exec-prefix) "@scsh_exec_prefix@") + +(define (bin-dir) "@scsh_bindir@") + +(define (lib-dir) "@scsh_libdir@") + +(define (include-dir) "@scsh_includedir@") + +(define (man-dir) "@scsh_mandir@") + +(define (lib-dir-list) (quote @scsh_lib_dirs_list@)) + +(define (libs) "@scsh_LIBS@") + +(define (defs) "@scsh_DEFS@") + +(define (cflags) "@scsh_CFLAGS@") + +(define (cppflags) "@scsh_CPPFLAGS@") + +(define (ldflags) "@scsh_LDFLAGS@") + +(define (linker-flags) + (string-join (list "-L" (lib-dir) (libs) "-lscsh") " ")) + +(define (compiler-flags) + (string-join (list "-I" (include-dir) (defs)))) diff --git a/scsh/scsh-interfaces.scm b/scsh/scsh-interfaces.scm index a208b96..5b5acb2 100644 --- a/scsh/scsh-interfaces.scm +++ b/scsh/scsh-interfaces.scm @@ -1188,3 +1188,19 @@ md5-digest-for-string md5-digest-for-port)) +(define-interface configure-interface + (export host + prefix + exec-prefix + bin-dir + lib-dir + include-dir + man-dir + lib-dir-list + libs + defs + cflags + cppflags + ldflags + linker-flags + compiler-flags)) \ No newline at end of file diff --git a/scsh/scsh-package.scm b/scsh/scsh-package.scm index e0c9e45..5553565 100644 --- a/scsh/scsh-package.scm +++ b/scsh/scsh-package.scm @@ -457,6 +457,7 @@ char-predicates-interface; Urk -- Some of this is R5RS! dot-locking-interface md5-interface + configure-interface ) (open structure-refs @@ -472,6 +473,7 @@ char-predicates-lib ; Urk -- Some of this is R5RS! dot-locking md5 + configure scheme) (access scsh-top-package) @@ -584,3 +586,8 @@ (files md5)) (define srfi-19 (make-srfi-19 scheme-with-scsh)) + +(define-structure configure configure-interface + (open scheme + (subset srfi-13 (string-join))) + (files configure)) \ No newline at end of file