use the scsh packaging proposal

This commit is contained in:
eknauel 2004-02-09 13:55:35 +00:00
parent 65e85e856e
commit c6005605d2
7 changed files with 70 additions and 52 deletions

View File

@ -1,2 +1 @@
SUBDIRS = c scheme
SUBDIRS = c

View File

@ -1,7 +0,0 @@
#!/bin/sh
rm -f config.cache config.guess config.status config.sub config.log \
configure ltconfig ltmain.sh Makefile Makefile.in \
aclocal.m4 depcomp install-sh ltconfig ltmain.sh missing \
mkinstalldirs
rm -rf libltdl autom4te.cache

View File

@ -1,11 +0,0 @@
#!/bin/sh
./autoclean.sh
aclocal -I .
autoconf
libtoolize --copy --automake --ltdl
#autoheader
#touch ltconfig
automake --copy --add-missing

View File

@ -6,10 +6,10 @@ SCHEME_DIR= ../scheme
FFITOOLS_DIR= ../ffi-tools
CLEANFILES= $(GENERATED_CODE)
noinst_LTLIBRARIES = libscshldap.la
libsys_LTLIBRARIES= libscshldap.la
libscshldap_la_SOURCES = ldap.c $(GENERATED_CODE)
libscshldap_la_LDFLAGS=
libscshldap_la_SOURCES= ldap.c $(GENERATED_CODE)
libscshldap_la_LDFLAGS= -avoid-version -module
libscshldap_la_DEPENDENCIES= $(GENERATED_CODE)
$(GENERATED_CODE):

View File

@ -37,6 +37,7 @@ AC_ARG_WITH(ldap-prefix,
AC_SUBST(LDFLAGS, "$LDFLAGS -L${ldap_lib}")
AC_SUBST(CFLAGS, "$CFLAGS -I${ldap_include}")
AC_SUBST(CPPFLAGS, "$CPPFLAGS -I${ldap_include}")
dnl Check for LDAP libraries and headers
@ -132,4 +133,4 @@ AC_SUBST(libdir)
AC_SUBST(libsysdir)
AC_SUBST(schemedir)
AC_SUBST(CC)
AC_OUTPUT([Makefile c/Makefile scheme/Makefile])
AC_OUTPUT([Makefile c/Makefile])

63
pkg-def.scm Normal file
View File

@ -0,0 +1,63 @@
(define-package "ldap" (0 1 0)
((options (ldap-prefix "Use LDAP library with prefix" "<dir>" #t #f #f)))
(newline)
(display "Configuring, compiling and installting C-stubs")
(newline)
(let* ((scsh-includes (include-dir))
(build-host (get-option-value 'build))
(prefix (string-append (get-directory 'lib #f) "/" build-host))
(configure (append
(list "./configure"
(string-append "--prefix=" prefix)
(string-append "--with-scsh-includes=" scsh-includes)
(string-append "--build=" build-host))
(cond ((get-option-value 'ldap-prefix)
=> (lambda (prefix)
(list
(string-append "--with-ldap-prefix=" prefix))))
(else '()))))
(make `(make install
,(string-append "DESTDIR=" (get-option-value 'dest-dir)))))
(if (get-option-value 'dry-run)
(begin
(display configure) (newline)
(display make) (newline))
(if (not (and (zero? (run ,configure))
(zero? (run ,make))))
(exit))))
(newline)
(display "creating load.scm")
(newline)
(let ((schemedir (get-directory 'scheme #f))
(libdir (get-directory 'lib #f)))
(write-to-load-script
`((user)
(load-package 'dynamic-externals)
(open 'dynamic-externals)
(open 'external-calls)
(open 'configure)
(open 'signals)
,@(map (lambda (x) `(run ',x)) tmpl-libtool-la-reader)
(run '(let* ((lib-dir (string-append ,libdir "/" (host)))
(la-file-name (string-append lib-dir "/libscshldap.la"))
(initializer-name "scsh_ldap_main"))
(let ((la-alist (read-libtool-la la-file-name)))
(cond
((assoc 'dlname la-alist)
=> (lambda (p)
(let ((module-file (string-append lib-dir "/" (cdr p))))
(dynamic-load module-file)
(call-external (get-external initializer-name)))))
(else
(error "Could not figure out libscshldap's name" la-file-name))))))
(config)
(load ,(string-append schemedir "/interfaces.scm"))
(load ,(string-append schemedir "/packages.scm"))
(user))))
(install-directory-contents "scheme" 'scheme)
)

View File

@ -1,27 +0,0 @@
SCSH= @SCSH@
scheme_SCRIPTS=load-ldap.scm
nobase_scheme_SCRIPTS= \
ldap.scm
EXTRA_DIST= load-ldap.scm.in $(nobase_scheme_SCRIPTS)
GENERATED_CODE= const-gen.scm
CLEANFILES= load-ldap.scm $(GENERATED_CODE)
$(GENERATED_CODE):
$(SCSH) -lm ffi-tools-packages.scm -lm ldap-constants.scm \
-o ldap-constants -c '(make-c-files command-line-arguments)' \
`pwd`
load-ldap.scm: $(srcdir)/load-ldap.scm.in
sed -e "s|@scshldapschemedir@|`pwd`/$(srcdir)|g" \
-e "s|@scshldaphost@||g" \
-e "s|@scshldaplibdir@|`pwd`/../c/.libs|g" \
$< > $@
install-data-hook:
sed -e "s|@scshldapschemedir@|$(schemedir)|g" \
-e "s|@scshldaphost@|(host)|g" \
-e "s|@scshldaplibdir@|$(libdir)|g" \
$(srcdir)/load-ldap.scm.in \
> $(DESTDIR)/$(schemedir)/load-ldap.scm