Added structure CONFIGURE to access values from ./configure.

This commit is contained in:
mainzelm 2003-12-19 14:08:58 +00:00
parent bcf88c05d0
commit dfa05a0c5c
4 changed files with 70 additions and 1 deletions

View File

@ -30,6 +30,7 @@ incdir = @includedir@
manext = 1 manext = 1
mandir = @mandir@/man$(manext) mandir = @mandir@/man$(manext)
lib_dirs_list = @lib_dirs_list@ lib_dirs_list = @lib_dirs_list@
host = @host@
### End of `configure' section### ### End of `configure' section###
htmldir = $(libdir)/scsh/doc/scsh-manual/html 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 scsh: scsh/scsh scsh/scsh.image
SCHEME =scsh/awk.scm \ SCHEME =scsh/awk.scm \
scsh/configure.scm \
scsh/defrec.scm \ scsh/defrec.scm \
scsh/endian.scm \ scsh/endian.scm \
scsh/enumconst.scm \ scsh/enumconst.scm \
@ -919,4 +921,17 @@ clean-scsh:
$(RM) scsh/*.image $(RM) scsh/*.image
$(RM) $(LIBSCSHVM) $(LIBSCSH) scsh/scsh$(EXEEXT) $(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" $< > $@

31
scsh/configure.scm.in Normal file
View File

@ -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))))

View File

@ -1188,3 +1188,19 @@
md5-digest-for-string md5-digest-for-string
md5-digest-for-port)) 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))

View File

@ -457,6 +457,7 @@
char-predicates-interface; Urk -- Some of this is R5RS! char-predicates-interface; Urk -- Some of this is R5RS!
dot-locking-interface dot-locking-interface
md5-interface md5-interface
configure-interface
) )
(open structure-refs (open structure-refs
@ -472,6 +473,7 @@
char-predicates-lib ; Urk -- Some of this is R5RS! char-predicates-lib ; Urk -- Some of this is R5RS!
dot-locking dot-locking
md5 md5
configure
scheme) scheme)
(access scsh-top-package) (access scsh-top-package)
@ -584,3 +586,8 @@
(files md5)) (files md5))
(define srfi-19 (make-srfi-19 scheme-with-scsh)) (define srfi-19 (make-srfi-19 scheme-with-scsh))
(define-structure configure configure-interface
(open scheme
(subset srfi-13 (string-join)))
(files configure))