Figure out shared module extension with automake/autoconf/libtool/whatever
This commit is contained in:
parent
51c369e3d0
commit
e52a9c88bd
10
Makefile.am
10
Makefile.am
|
@ -1 +1,9 @@
|
|||
SUBDIRS= c
|
||||
SUBDIRS = c
|
||||
|
||||
BUILT_SOURCES = config-data.scm
|
||||
CLEANFILES = $(BUILT_SOURCES)
|
||||
|
||||
config-data.scm: config-data.scm.in
|
||||
module=yes; \
|
||||
eval shared_module_ext="@shrext@"; \
|
||||
sed -e s/@module_extension@/$$shared_module_ext/g < $< > $@
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
((shared-module-extension "@module_extension@"))
|
|
@ -41,6 +41,7 @@ libsysdir='${prefix}'
|
|||
AC_SUBST(libdir)
|
||||
AC_SUBST(libsysdir)
|
||||
AC_SUBST(schemedir)
|
||||
AC_SUBST(shrext)
|
||||
AC_SUBST(LIBS)
|
||||
AC_SUBST(CC)
|
||||
AC_OUTPUT([Makefile c/Makefile])
|
|
@ -4,7 +4,8 @@
|
|||
(open 'external-calls)
|
||||
(open 'configure)
|
||||
(run '(let ((initializer-name "scsh_yp_main")
|
||||
(module-file (string-append "@yplibsysdir@/" @yphost@ "/libscshyp.so")))
|
||||
(module-file (string-append "@yplibdir@/" @yphost@
|
||||
"/libscshyp" "@sharedmoduleext@")))
|
||||
(dynamic-load module-file)
|
||||
(call-external (get-external initializer-name))))
|
||||
(config)
|
||||
|
|
34
pkg-def.scm
34
pkg-def.scm
|
@ -25,21 +25,27 @@
|
|||
(begin
|
||||
(display "creating load.scm")
|
||||
(newline)
|
||||
(let ((schemedir (get-directory 'scheme #f))
|
||||
(libdir (get-directory 'lib #f))
|
||||
(target-dir (get-directory 'base #t))
|
||||
(sed-replace (lambda (from to)
|
||||
(let ((config-data
|
||||
(call-with-input-file "config-data.scm" read)))
|
||||
(let ((schemedir (get-directory 'scheme #f))
|
||||
(libdir (get-directory 'lib #f))
|
||||
(target-dir (get-directory 'base #t))
|
||||
(shared-ext (cdr (assoc 'shared-lib-extension config-data.scm)))
|
||||
(sed-replace (lambda (from to)
|
||||
(string-append "s|" from "|" to "|g"))))
|
||||
(let ((cmd `(sed -e ,(sed-replace "@ypschemedir@" schemedir)
|
||||
-e ,(sed-replace "@yphost@" "(host)")
|
||||
-e ,(sed-replace "@yplibdir@" libdir)
|
||||
"load.scm.in"))
|
||||
(tgt (string-append target-dir "/load.scm")))
|
||||
(if (get-option-value 'dry-run)
|
||||
(begin
|
||||
(display cmd) (display " > ") (display tgt)
|
||||
(newline))
|
||||
(or (zero? (run ,cmd (> ,tgt))) (exit)))))))
|
||||
(let ((cmd `(sed -e ,(sed-replace "@ypschemedir@" schemedir)
|
||||
-e ,(sed-replace "@yphost@" "(host)")
|
||||
-e ,(sed-replace "@yplibdir@" libdir)
|
||||
-e ,(sed-replace "@sharedmoduleext@"
|
||||
(cdr (assoc 'shared-module-extension
|
||||
config-data.scm)))
|
||||
"load.scm.in"))
|
||||
(tgt (string-append target-dir "/load.scm")))
|
||||
(if (get-option-value 'dry-run)
|
||||
(begin
|
||||
(display cmd) (display " > ") (display tgt)
|
||||
(newline))
|
||||
(or (zero? (run ,cmd (> ,tgt))) (exit)))))))
|
||||
|
||||
(install-directory-contents "scheme" 'scheme)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue