+ more infrastructure
This commit is contained in:
parent
a25a3daae0
commit
dda50cdfbe
|
@ -0,0 +1,59 @@
|
||||||
|
CC = @CC@
|
||||||
|
LIBS = @LIBS@ -lscsh -lsasl2
|
||||||
|
SCSH_LIB = @scsh_libraries@
|
||||||
|
LIB_DIRS = -L$(SCSH_LIB)
|
||||||
|
INCLUDES = -I. -I./c
|
||||||
|
|
||||||
|
SCSH_INCLUDES = @scsh_includes@
|
||||||
|
ifneq ($(SCSH_INCLUDES),)
|
||||||
|
INCLUDES += -I$(SCSH_INCLUDES)
|
||||||
|
endif
|
||||||
|
|
||||||
|
SCSH_MODULES = @scsh_modules@
|
||||||
|
LDAP_VM = scshldapvm
|
||||||
|
LDAP_IMAGE = scsh-ldap.image
|
||||||
|
LDAP = scsh-ldap
|
||||||
|
|
||||||
|
prefix = @prefix@
|
||||||
|
exec_prefix = @exec_prefix@
|
||||||
|
|
||||||
|
enough: $(LDAP)
|
||||||
|
|
||||||
|
DIST_SOURCES = c/ldap.c
|
||||||
|
|
||||||
|
OBJECTS = $(DIST_SOURCES:.c=.o)
|
||||||
|
|
||||||
|
SCM_FILES = scheme/ldap.scm
|
||||||
|
|
||||||
|
SCM_CONFIG_FILES = scheme/ldap-interfaces.scm scheme/ldap-packages.scm
|
||||||
|
|
||||||
|
$(LDAP_VM): tmpmain.o $(OBJECTS)
|
||||||
|
$(CC) $(LDFLAGS) $(CFLAGS) -o $(LDAP_VM) $(LIB_DIRS) tmpmain.o $(OBJECTS) $(LIBS)
|
||||||
|
|
||||||
|
$(OBJECTS): c/scsh-ldap.h
|
||||||
|
.c.o:
|
||||||
|
$(CC) $(CFLAGS) -c $(INCLUDES) -o $@ $<
|
||||||
|
|
||||||
|
tmpmain.o: c/main.c
|
||||||
|
$(CC) -c -DSCSHIMAGE=\"$(SCSH_LIB)/scsh.image\" $(INCLUDES) $(CFLAGS) -o $@ $<
|
||||||
|
|
||||||
|
main.o: c/main.c
|
||||||
|
$(CC) -c -DSCSHIMAGE=\"`pwd`/scsh-ldap.image\" $(INCLUDES) $(CFLAGS) -o $@ $<
|
||||||
|
|
||||||
|
$(LDAP_IMAGE): $(LDAP_VM) $(SCM_FILES) $(SCM_CONFIG_FILES)
|
||||||
|
( \
|
||||||
|
echo ",batch on"; \
|
||||||
|
echo ",config ,load $(SCM_CONFIG_FILES)"; \
|
||||||
|
echo ",load-package ldap-low"; \
|
||||||
|
echo "(dump-scsh \"$(LDAP_IMAGE)\")"; \
|
||||||
|
) | ./$(LDAP_VM) $(SCSH_ARGS)
|
||||||
|
|
||||||
|
$(LDAP): $(LDAP_IMAGE) main.o $(OBJECTS)
|
||||||
|
$(CC) $(LDFLAGS) -o $@ $(LIB_DIRS) main.o $(OBJECTS) $(LIBS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(LDAP_VM) $(LDAP) $(LDAP_IMAGE) *.o c/*.o
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
rm -f configure Makefile config.log config.status
|
||||||
|
rm -rf autom4te.cache/
|
|
@ -0,0 +1,13 @@
|
||||||
|
#include "scheme48.h"
|
||||||
|
#include "c/config.h"
|
||||||
|
|
||||||
|
extern void scsh_ldap_main();
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
s48_add_external_init(scsh_ldap_main);
|
||||||
|
|
||||||
|
return s48_main(10000000, 64000,
|
||||||
|
SCSHIMAGE,
|
||||||
|
--argc, ++argv);
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
AC_INIT
|
||||||
|
AC_CONFIG_HEADER(c/config.h)
|
||||||
|
AC_PROG_CC
|
||||||
|
|
||||||
|
AC_ARG_WITH(scsh-includes,
|
||||||
|
AC_HELP_STRING([--with-scsh-includes=DIR],
|
||||||
|
[scsh include files are in DIR [/usr/local/include]]),
|
||||||
|
scsh_includes=$withval,
|
||||||
|
scsh_includes=/usr/local/include)
|
||||||
|
AC_SUBST(scsh_includes)
|
||||||
|
|
||||||
|
AC_ARG_WITH(scsh-libraries,
|
||||||
|
AC_HELP_STRING([--with-scsh-libraries=DIR],
|
||||||
|
[scsh libraries are in DIR [/usr/local/lib/scsh]]),
|
||||||
|
scsh_libraries=$withval,
|
||||||
|
scsh_libraries=/usr/local/lib/scsh)
|
||||||
|
AC_SUBST(scsh_libraries)
|
||||||
|
|
||||||
|
AC_ARG_WITH(scsh-modules,
|
||||||
|
AC_HELP_STRING([--with-scsh-modules=DIR],
|
||||||
|
[scsh modules are in DIR [/usr/local/lib/scsh/modules]]),
|
||||||
|
scsh_modules=$withval,
|
||||||
|
scsh_modules=/usr/local/lib/scsh/modules)
|
||||||
|
AC_SUBST(scsh_modules)
|
||||||
|
AC_CHECK_LIB(crypt, crypt)
|
||||||
|
dnl AC_CHECK_LIB(dl, dlopen)
|
||||||
|
AC_CHECK_LIB(m, exp)
|
||||||
|
AC_CHECK_LIB(ldap, ldap_open)
|
||||||
|
|
||||||
|
AC_SUBST(LIBS)
|
||||||
|
AC_SUBST(CC)
|
||||||
|
AC_OUTPUT(Makefile)
|
|
@ -0,0 +1,11 @@
|
||||||
|
(define-interface ldap-low-interface
|
||||||
|
(export
|
||||||
|
ldap?
|
||||||
|
ldap-message?
|
||||||
|
|
||||||
|
ldap-open
|
||||||
|
ldap-init
|
||||||
|
ldap-bind-sync
|
||||||
|
ldap-unbind-sync
|
||||||
|
ldap-error-string
|
||||||
|
ldap-result-error))
|
|
@ -0,0 +1,6 @@
|
||||||
|
(define-structure ldap-low ldap-low-interface
|
||||||
|
(open scheme
|
||||||
|
primitives
|
||||||
|
define-record-types
|
||||||
|
external-calls)
|
||||||
|
(files ldap))
|
Loading…
Reference in New Issue