Skip to content
Snippets Groups Projects
Commit 0552b1c5 authored by Howard Chu's avatar Howard Chu
Browse files

NT updates from jon@symas.com.

parent ff701c28
No related branches found
No related tags found
No related merge requests found
Showing with 374 additions and 196 deletions
...@@ -7,44 +7,47 @@ ...@@ -7,44 +7,47 @@
## Makefile Template for Shared Libraries ## Makefile Template for Shared Libraries
## ##
NT_LTFLAGS = --only-$(LINKAGE)
LTFLAGS = $(@PLAT@_LTFLAGS)
NT_DYN_LT_NO_UNDEF = -no-undefined
LT_NO_UNDEF = $(@PLAT@_@LIB_LINKAGE@_LT_NO_UNDEF)
COMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CFLAGS) $(EXTRA_DEFS) -c
LTLIBLINK = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) -rpath $(libdir) \
$(CFLAGS) $(LDFLAGS) $(LTVERSION) $(LT_NO_UNDEF)
MKDEPFLAG = -l MKDEPFLAG = -l
.SUFFIXES: .c .o .lo .SUFFIXES: .c .o .lo
.c.lo: .c.lo:
$(COMPILE) $< $(LTCOMPILE_LIB) $<
#
# DYN_EXT (@DYN_EXT@) describes the extension assoicated with a # symlinks for libraries: UNIX and Windows (a.k.a. NT) need to be handled
# dynamic library, e.g. so, dll # differently. In UNIX, the static and shared libraries, as well as shared
# library symlinks, can all be symlinked in the 'libraries' directory. In
DYN_EXT=@DYN_EXT@ # Windows, only the static library (.a file) or the shared library (.dll)
# file should be present. The current mingw linker (i.e. ld) WILL look
$(LIBRARY): version.lo # for a .dll file at link time and internally generate an import library
$(LTLIBLINK) -o $@ $(OBJS) version.lo $(EXTRA_LIBS) # for it. However, ld will not do this if a static library is present.
$(RM) ../$@ # That doesn't seem very correct, but that's the behavior, like it or not.
d=`$(PWD)`; d=`$(BASENAME) $$d`; cd ..; $(LN_S) $$d/$@ $@; \ #
t=`$(BASENAME) $@ .la`.a; $(RM) $$t; $(LN_S) $$d/.libs/$$t $$t # Note that there doesn't seem to be a true need for the .la file at
if test "$(LINK_BINS_DYNAMIC)" = "yes"; then \ # this level, so it is left out.
d=`$(PWD)`; d=`$(BASENAME) $$d`; b=`$(BASENAME) $@ .la`; \ #
cd .libs; t=`echo $$b*.$(DYN_EXT)`; (cd ../.. ; $(RM) $$t; \ # The set of symlinks are determined by examining the library's .la file.
$(LN_S) $$d/.libs/$$t $$t); \ #
if test "$(DYN_EXT)" != dll; then \ $(LIBRARY): version.lo
t=`echo $$b.$(DYN_EXT).?`; cd ../.. ; \ $(LTLINK_LIB) -o $@ $(OBJS) version.lo $(LINK_LIBS)
$(RM) $$t; \ @d=`$(PWD)`; b=`$(BASENAME) $$d`; \
$(LN_S) $$d/.libs/$$t $$t; \ echo cd ..; \
fi \ cd ..; \
fi arlib=`grep '^old_library=' $$b/$@`; \
arlib=`expr "$$arlib" : "[^']*'\(.*\)'"`; \
libs=$$arlib; \
if test "$(BUILD_LIBS_DYNAMIC)" = "shared"; then \
shlibs=`grep '^library_names' $$b/$@`; \
shlibs=`expr "$$shlibs" : "[^']*'\(.*\)'"`; \
libs="$$libs $$shlibs"; \
fi; \
for i in $$libs; do \
echo $(RM) $$i; \
$(RM) $$i; \
echo $(LN_S) $$b/.libs/$$i $$i; \
$(LN_S) $$b/.libs/$$i $$i; \
done
Makefile: $(top_srcdir)/build/lib-shared.mk Makefile: $(top_srcdir)/build/lib-shared.mk
...@@ -21,11 +21,17 @@ lint: lint-local FORCE ...@@ -21,11 +21,17 @@ lint: lint-local FORCE
lint5: lint5-local FORCE lint5: lint5-local FORCE
$(5LINT) $(DEFS) $(DEFINES) $(SRCS) $(5LINT) $(DEFS) $(DEFINES) $(SRCS)
#
# In the mingw/cygwin environment, the so and dll files must be
# deleted separately, instead of using the {.so*,*.dll} construct
# that was previously used. It just didn't work.
#
clean-common: FORCE clean-common: FORCE
$(RM) $(LIBRARY) ../$(LIBRARY) $(XLIBRARY) \ $(RM) $(LIBRARY) ../$(LIBRARY) $(XLIBRARY) \
$(PROGRAMS) $(XPROGRAMS) $(XSRCS) $(XXSRCS) \ $(PROGRAMS) $(XPROGRAMS) $(XSRCS) $(XXSRCS) \
*.o *.lo a.out *.exe core version.c .libs/* \ *.o *.lo a.out *.exe core version.c .libs/* \
../`$(BASENAME) $(LIBRARY) .la`{.a,.so*,*.dll} ../`$(BASENAME) $(LIBRARY) .la`.so* \
../`$(BASENAME) $(LIBRARY) .la`*.dll
depend-common: FORCE depend-common: FORCE
$(MKDEP) $(DEFS) $(DEFINES) $(SRCS) $(XXSRCS) $(MKDEP) $(DEFS) $(DEFINES) $(SRCS) $(XXSRCS)
...@@ -34,3 +40,4 @@ lint-local: FORCE ...@@ -34,3 +40,4 @@ lint-local: FORCE
lint5-local: FORCE lint5-local: FORCE
Makefile: $(top_srcdir)/build/lib.mk Makefile: $(top_srcdir)/build/lib.mk
...@@ -10,18 +10,12 @@ ...@@ -10,18 +10,12 @@
LIBRARY = $(LIBBASE).la LIBRARY = $(LIBBASE).la
LIBSTAT = lib$(LIBBASE).a LIBSTAT = lib$(LIBBASE).a
LTFLAGS = --only-$(LINKAGE)
COMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CFLAGS) $(MODDEFS) -c
LTLIBLINK = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) -rpath $(moduledir) \
$(CFLAGS) $(LDFLAGS) $(LTVERSION) $(LT_NO_UNDEF)
MKDEPFLAG = -l MKDEPFLAG = -l
.SUFFIXES: .c .o .lo .SUFFIXES: .c .o .lo
.c.lo: .c.lo:
$(COMPILE) $< $(LTCOMPILE_MOD) $<
all-no lint-no 5lint-no depend-no install-no: FORCE all-no lint-no 5lint-no depend-no install-no: FORCE
@echo "run configure with $(BUILD_OPT) to make $(LIBBASE)" @echo "run configure with $(BUILD_OPT) to make $(LIBBASE)"
...@@ -32,9 +26,8 @@ version.c: $(OBJS) ...@@ -32,9 +26,8 @@ version.c: $(OBJS)
$(RM) $@ $(RM) $@
$(MKVERSION) $(LIBBASE) > $@ $(MKVERSION) $(LIBBASE) > $@
$(LIBRARY): $(MODDEPS) version.lo $(LIBRARY): version.lo
$(LTLIBLINK) -module -o $@ $(OBJS) version.lo \ $(LTLINK_MOD) -module -o $@ $(OBJS) version.lo $(LINK_LIBS)
$(MODLIBS)
$(LIBSTAT): version.lo $(LIBSTAT): version.lo
$(AR) ruv $@ `echo $(OBJS) | sed 's/\.lo/.o/g'` version.o $(AR) ruv $@ `echo $(OBJS) | sed 's/\.lo/.o/g'` version.o
......
...@@ -774,6 +774,7 @@ AC_DEFUN([OL_NT_THREADS], [ ...@@ -774,6 +774,7 @@ AC_DEFUN([OL_NT_THREADS], [
if test $ac_cv_func__beginthread = yes ; then if test $ac_cv_func__beginthread = yes ; then
AC_DEFINE(HAVE_NT_THREADS,1,[if you have NT Threads]) AC_DEFINE(HAVE_NT_THREADS,1,[if you have NT Threads])
ol_cv_nt_threads=yes
fi fi
]) ])
dnl ==================================================================== dnl ====================================================================
......
...@@ -37,9 +37,12 @@ sharedstatedir = @sharedstatedir@ ...@@ -37,9 +37,12 @@ sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@$(ldap_subdir) sysconfdir = @sysconfdir@$(ldap_subdir)
schemadir = $(sysconfdir)/schema schemadir = $(sysconfdir)/schema
PLAT = @PLAT@
EXEEXT = @EXEEXT@ EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@ OBJEXT = @OBJEXT@
BUILD_LIBS_DYNAMIC = @BUILD_LIBS_DYNAMIC@
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@ INSTALL_DATA = @INSTALL_DATA@
...@@ -58,11 +61,47 @@ MKVERSION = $(top_srcdir)/build/mkversion -v "$(VERSION)" ...@@ -58,11 +61,47 @@ MKVERSION = $(top_srcdir)/build/mkversion -v "$(VERSION)"
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LIBVERSION = @OPENLDAP_LIBVERSION@ LIBVERSION = @OPENLDAP_LIBVERSION@
LTVERSION = -version-info $(LIBVERSION) LTVERSION = -version-info $(LIBVERSION)
#We don't use our own shared libraries (yet)
#LTLINK = $(LIBTOOL) --mode=link $(CC) -rpath $(libdir) \ # libtool --only flag for libraries: platform specific
# $(CFLAGS) $(LDFLAGS) NT_LTONLY_LIB = --only-$(BUILD_LIBS_DYNAMIC)
LTLINK = $(LIBTOOL) --mode=link $(CC) \ LTONLY_LIB = $(@PLAT@_LTONLY_LIB)
$(CFLAGS) $(LDFLAGS)
# libtool --only flag for modules: depends on linkage of module
# The BUILD_MOD_DYNAMIC macro is defined in each backend Makefile.in file
LTONLY_MOD = --only-$(BUILD_MOD_DYNAMIC)
# platform-specific libtool flags
NT_LTFLAGS_LIB = -no-undefined -avoid-version -rpath $(libdir)
NT_LTFLAGS_MOD = -no-undefined -avoid-version -rpath $(moduledir)
UNIX_LTFLAGS_LIB = $(LTVERSION) -rpath $(libdir)
UNIX_LTFLAGS_MOD = $(LTVERSION) -rpath $(moduledir)
# libtool flags
LTFLAGS = $(@PLAT@_LTFLAGS)
LTFLAGS_LIB = $(@PLAT@_LTFLAGS_LIB)
LTFLAGS_MOD = $(@PLAT@_LTFLAGS_MOD)
# LIB_DEFS defined in liblber and libldap Makefile.in files.
# MOD_DEFS defined in backend Makefile.in files.
# platform-specific LINK_LIBS defined in various Makefile.in files.
# LINK_LIBS referenced in library and module link commands.
LINK_LIBS = $(@PLAT@_LINK_LIBS)
LTLINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LTFLAGS)
LTCOMPILE_LIB = $(LIBTOOL) $(LTONLY_LIB) --mode=compile \
$(CC) $(CFLAGS) $(CPPFLAGS) $(LIB_DEFS) -c
LTLINK_LIB = $(LIBTOOL) $(LTONLY_LIB) --mode=link \
$(CC) $(CFLAGS) $(LDFLAGS) $(LTFLAGS_LIB)
LTCOMPILE_MOD = $(LIBTOOL) $(LTONLY_MOD) --mode=compile \
$(CC) $(CFLAGS) $(CPPFLAGS) $(MOD_DEFS) -c
LTLINK_MOD = $(LIBTOOL) $(LTONLY_MOD) --mode=link \
$(CC) $(CFLAGS) $(LDFLAGS) $(LTFLAGS_MOD)
LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL) LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
# Misc UNIX commands used in build environment # Misc UNIX commands used in build environment
...@@ -140,7 +179,6 @@ MODULES_LDFLAGS = @SLAPD_MODULES_LDFLAGS@ ...@@ -140,7 +179,6 @@ MODULES_LDFLAGS = @SLAPD_MODULES_LDFLAGS@
MODULES_LIBS = @MODULES_LIBS@ MODULES_LIBS = @MODULES_LIBS@
TERMCAP_LIBS = @TERMCAP_LIBS@ TERMCAP_LIBS = @TERMCAP_LIBS@
SLAPD_PERL_LDFLAGS = @SLAPD_PERL_LDFLAGS@ SLAPD_PERL_LDFLAGS = @SLAPD_PERL_LDFLAGS@
LINK_BINS_DYNAMIC = @LINK_BINS_DYNAMIC@
SLAPD_SQL_LDFLAGS = @SLAPD_SQL_LDFLAGS@ SLAPD_SQL_LDFLAGS = @SLAPD_SQL_LDFLAGS@
SLAPD_SQL_INCLUDES = @SLAPD_SQL_INCLUDES@ SLAPD_SQL_INCLUDES = @SLAPD_SQL_INCLUDES@
...@@ -152,7 +190,8 @@ SLURPD_LIBS = @SLURPD_LIBS@ ...@@ -152,7 +190,8 @@ SLURPD_LIBS = @SLURPD_LIBS@
# Our Defaults # Our Defaults
CC = $(AC_CC) CC = $(AC_CC)
DEFS = $(LDAP_INCPATH) $(XINCPATH) $(XDEFS) $(AC_DEFS) $(DEFINES) DEFS = $(LDAP_INCPATH) $(XINCPATH) $(XDEFS) $(AC_DEFS) $(DEFINES)
CFLAGS = $(AC_CFLAGS) $(DEFS) CFLAGS = $(AC_CFLAGS)
CPPFLAGS = $(DEFS)
LDFLAGS = $(LDAP_LIBPATH) $(AC_LDFLAGS) $(XLDFLAGS) LDFLAGS = $(LDAP_LIBPATH) $(AC_LDFLAGS) $(XLDFLAGS)
LIBS = $(XLIBS) $(XXLIBS) $(AC_LIBS) $(XXXLIBS) LIBS = $(XLIBS) $(XXLIBS) $(AC_LIBS) $(XXXLIBS)
......
...@@ -4,4 +4,6 @@ ...@@ -4,4 +4,6 @@
## ##
## Clients Makefile.in for OpenLDAP ## Clients Makefile.in for OpenLDAP
SUBDIRS= tools ud SUBDIRS = tools ud
CLEANDIRS = finger mail500 maildap
...@@ -8,9 +8,6 @@ OBJS = ldapsearch.o ldapmodify.o ldapdelete.o ldapmodrdn.o ldappasswd.o ...@@ -8,9 +8,6 @@ OBJS = ldapsearch.o ldapmodify.o ldapdelete.o ldapmodrdn.o ldappasswd.o
LDAP_INCDIR= ../../include LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries LDAP_LIBDIR= ../../libraries
NT_DYN_DEFS = -DLBER_DECL=dllimport -DLDAP_DECL=dllimport
CPPFLAGS = $(@PLAT@_@LIB_LINKAGE@_DEFS)
XLIBS = -llutil -lldif -lldap -llber XLIBS = -llutil -lldif -lldap -llber
XXLIBS = $(SECURITY_LIBS) $(LDIF_LIBS) $(LUTIL_LIBS) XXLIBS = $(SECURITY_LIBS) $(LDIF_LIBS) $(LUTIL_LIBS)
......
...@@ -6,16 +6,15 @@ XSRCS= version.c ...@@ -6,16 +6,15 @@ XSRCS= version.c
OBJS= main.o find.o mod.o print.o auth.o util.o help.o \ OBJS= main.o find.o mod.o print.o auth.o util.o help.o \
group.o globals.o edit.o group.o globals.o edit.o
HDRS= ud.h HDRS= ud.h
PROGRAMS= ud
UNIX_PRGS = ud
PROGRAMS = $(@PLAT@_PRGS)
LDAP_INCDIR= ../../include LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries LDAP_LIBDIR= ../../libraries
NT_DYN_DEFS = -DLBER_DECL=dllimport -DLDAP_DECL=dllimport
CPPFLAGS = $(@PLAT@_@LIB_LINKAGE@_DEFS)
XLIBS = -llutil -lldif -lldap -llber XLIBS = -llutil -lldif -lldap -llber
XXLIBS = $(TERMCAP_LIBS) $(SECURITY_LIBS) $(LUTIL_LIBS) XXLIBS = $(TERMCAP_LIBS) $(SECURITY_LIBS) $(LDIF_LIBS) $(LUTIL_LIBS)
ud : version.o ud : version.o
$(LTLINK) -o $@ version.o $(OBJS) $(LIBS) $(LTLINK) -o $@ version.o $(OBJS) $(LIBS)
......
...@@ -788,6 +788,7 @@ AC_CHECK_HEADERS( \ ...@@ -788,6 +788,7 @@ AC_CHECK_HEADERS( \
termios.h \ termios.h \
unistd.h \ unistd.h \
winsock.h \ winsock.h \
winsock2.h \
) )
...@@ -799,24 +800,43 @@ AC_CHECK_FUNC(dlopen, :, [AC_CHECK_LIB(dl, dlopen)]) ...@@ -799,24 +800,43 @@ AC_CHECK_FUNC(dlopen, :, [AC_CHECK_LIB(dl, dlopen)])
dnl HP-UX requires -lV3 dnl HP-UX requires -lV3
AC_CHECK_LIB(V3, sigset) AC_CHECK_LIB(V3, sigset)
dnl Gotta check for winsock manually dnl The following is INTENTIONALLY scripted out because shell does not
if test $ac_cv_header_winsock_h = yes; then dnl support variable names with the '@' character, which is what
AC_CACHE_CHECK([for winsock], [ol_cv_winsock], dnl autoconf would try to generate if one merely used AC_SEARCH_LIBS
AC_TRY_LINK([#include <winsock.h>],[ AC_MSG_CHECKING(for winsock)
socket(0,0,0); save_LIBS="$LIBS"
select(0,NULL,NULL,NULL,NULL); for curlib in ws2_32 wsock32; do
closesocket(0); LIBS="$LIBS -l$curlib"
gethostname(NULL,0); AC_TRY_LINK([
],[ol_cv_winsock=yes],[ol_cv_winsock=no])) char socket@12();
char select@20();
if test $ol_cv_winsock = yes ; then char closesocket@4();
AC_DEFINE(HAVE_WINSOCK,1,[define if you have winsock]) char gethostname@8();
],
[
socket@12();
select@20();
closesocket@4();
gethostname@8();
],
have_winsock=yes, have_winsock=no)
if test $have_winsock = yes; then
AC_DEFINE(HAVE_WINSOCK, 1, [define if you have winsock])
ac_cv_func_socket=yes ac_cv_func_socket=yes
ac_cv_func_select=yes ac_cv_func_select=yes
ac_cv_func_closesocket=yes ac_cv_func_closesocket=yes
ac_cv_func_gethostname=yes ac_cv_func_gethostname=yes
if test $curlib = ws2_32; then
have_winsock=winsock2
AC_DEFINE(HAVE_WINSOCK2, 1,
[define if you have winsock2])
fi
break
fi fi
fi LIBS="$save_LIBS"
done
AC_MSG_RESULT($have_winsock)
dnl Find socket() dnl Find socket()
dnl Likely combinations: dnl Likely combinations:
...@@ -852,7 +872,8 @@ AC_CHECK_HEADERS( regex.h ) ...@@ -852,7 +872,8 @@ AC_CHECK_HEADERS( regex.h )
if test "$ac_cv_header_regex_h" != yes ; then if test "$ac_cv_header_regex_h" != yes ; then
AC_MSG_ERROR([POSIX regex.h required.]) AC_MSG_ERROR([POSIX regex.h required.])
fi fi
AC_CHECK_FUNC(regfree, :, AC_MSG_ERROR([POSIX regex required.])) AC_SEARCH_LIBS(regfree, [regex gnuregex],
:, AC_MSG_ERROR([POSIX regex required.]))
OL_POSIX_REGEX OL_POSIX_REGEX
if test "$ol_cv_c_posix_regex" = no ; then if test "$ol_cv_c_posix_regex" = no ; then
...@@ -1898,9 +1919,10 @@ fi ...@@ -1898,9 +1919,10 @@ fi
dnl ---------------------------------------------------------------- dnl ----------------------------------------------------------------
if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
LINK_BINS_DYNAMIC="yes" BUILD_LIBS_DYNAMIC=shared
AC_DEFINE(LDAP_LIBS_DYNAMIC, 1, [define if LDAP libs are dynamic])
else else
LINK_BINS_DYNAMIC="no" BUILD_LIBS_DYNAMIC=static
fi fi
dnl ---------------------------------------------------------------- dnl ----------------------------------------------------------------
...@@ -2074,7 +2096,7 @@ fi ...@@ -2074,7 +2096,7 @@ fi
dnl ---------------------------------------------------------------- dnl ----------------------------------------------------------------
dnl Check for entropy sources dnl Check for entropy sources
if test $cross_compiling != yes ; then if test $cross_compiling != yes -a $ac_cv_mingw32 != yes ; then
dev=no dev=no
if test -r /dev/urandom ; then if test -r /dev/urandom ; then
dev="/dev/urandom"; dev="/dev/urandom";
...@@ -2559,28 +2581,22 @@ fi ...@@ -2559,28 +2581,22 @@ fi
dnl ---------------------------------------------------------------- dnl ----------------------------------------------------------------
if test "$LINK_BINS_DYNAMIC" = yes; then dnl
LIB_LINKAGE=DYN dnl For Windows build, we don't want to include -dlopen flags.
LT_LIB_LINKAGE=shared dnl They hurt more than they help.
else dnl
LIB_LINKAGE=STAT
LT_LIB_LINKAGE=static
fi
if test "$ac_cv_mingw32" = yes ; then if test "$ac_cv_mingw32" = yes ; then
PLAT=NT PLAT=NT
DYN_EXT=dll SLAPD_MODULES_LDFLAGS=
SLAPD_MODULES_LIST=
else else
PLAT=UNIX PLAT=UNIX
DYN_EXT=so
fi fi
AC_SUBST(LIBSRCS) AC_SUBST(LIBSRCS)
AC_SUBST(PLAT) AC_SUBST(PLAT)
AC_SUBST(LIB_LINKAGE) AC_SUBST(BUILD_LIBS_DYNAMIC)
AC_SUBST(LT_LIB_LINKAGE)
AC_SUBST(DYN_EXT)
AC_SUBST(BUILD_SLAPD) AC_SUBST(BUILD_SLAPD)
AC_SUBST(BUILD_BDB) AC_SUBST(BUILD_BDB)
...@@ -2618,7 +2634,6 @@ AC_SUBST(LTHREAD_LIBS) ...@@ -2618,7 +2634,6 @@ AC_SUBST(LTHREAD_LIBS)
AC_SUBST(LUTIL_LIBS) AC_SUBST(LUTIL_LIBS)
AC_SUBST(WRAP_LIBS) AC_SUBST(WRAP_LIBS)
AC_SUBST(MOD_TCL_LIB) AC_SUBST(MOD_TCL_LIB)
AC_SUBST(LINK_BINS_DYNAMIC)
AC_SUBST(SLAPD_MODULES_CPPFLAGS) AC_SUBST(SLAPD_MODULES_CPPFLAGS)
AC_SUBST(SLAPD_MODULES_LDFLAGS) AC_SUBST(SLAPD_MODULES_LDFLAGS)
......
...@@ -31,16 +31,46 @@ ldap_config.h: $(LDAP_CONFIG) Makefile ...@@ -31,16 +31,46 @@ ldap_config.h: $(LDAP_CONFIG) Makefile
@$(RM) $@ @$(RM) $@
@echo "Making $@" @echo "Making $@"
@echo "/* Generated from $(LDAP_CONFIG) on `date` */" > $@; \ @echo "/* Generated from $(LDAP_CONFIG) on `date` */" > $@; \
if test $(PLAT) = NT; then \
sysconfdir=`cygpath -w $(sysconfdir) | \
$(SED) -e 's/\\\\/\\\\\\\\\\\\\\\\/g'`; \
datadir=`cygpath -w $(datadir) | \
$(SED) -e 's/\\\\/\\\\\\\\\\\\\\\\/g'`; \
bindir=`cygpath -w $(bindir) | \
$(SED) -e 's/\\\\/\\\\\\\\\\\\\\\\/g'`; \
sbindir=`cygpath -w $(sbindir) | \
$(SED) -e 's/\\\\/\\\\\\\\\\\\\\\\/g'`; \
libexecdir=`cygpath -w $(libexecdir) | \
$(SED) -e 's/\\\\/\\\\\\\\\\\\\\\\/g'`; \
localstatedir=`cygpath -w $(localstatedir) | \
$(SED) -e 's/\\\\/\\\\\\\\\\\\\\\\/g'`; \
editor=`cygpath -w $(EDITOR) | \
$(SED) -e 's/\\\\/\\\\\\\\\\\\\\\\/g'`; \
finger=`cygpath -w $(FINGER) | \
$(SED) -e 's/\\\\/\\\\\\\\\\\\\\\\/g'`; \
sendmail=`cygpath -w $(SENDMAIL) | \
$(SED) -e 's/\\\\/\\\\\\\\\\\\\\\\/g'`; \
else \
sysconfdir=$(sysconfdir); \
datadir=$(datadir); \
bindir=$(bindir); \
sbindir=$(sbindir); \
libexecdir=$(libexecdir); \
localstatedir=$(localstatedir); \
editor=$(EDITOR); \
finger=$(FINGER); \
sendmail=$(SENDMAIL); \
fi; \
$(SED) \ $(SED) \
-e 's;%SYSCONFDIR%;$(sysconfdir);' \ -e "s;%SYSCONFDIR%;$$sysconfdir;" \
-e 's;%DATADIR%;$(datadir);' \ -e "s;%DATADIR%;$$datadir;" \
-e 's;%BINDIR%;$(bindir);' \ -e "s;%BINDIR%;$$bindir;" \
-e 's;%SBINDIR%;$(sbindir);' \ -e "s;%SBINDIR%;$$sbindir;" \
-e 's;%LIBEXECDIR%;$(libexecdir);' \ -e "s;%LIBEXECDIR%;$$libexecdir;" \
-e 's;%RUNDIR%;$(localstatedir);' \ -e "s;%RUNDIR%;$$localstatedir;" \
-e 's;%EDITOR%;$(EDITOR);' \ -e "s;%EDITOR%;$$editor;" \
-e 's;%FINGER%;$(FINGER);' \ -e "s;%FINGER%;$$finger;" \
-e 's;%SENDMAIL%;$(SENDMAIL);' \ -e "s;%SENDMAIL%;$$sendmail;" \
$(LDAP_CONFIG) >> $@; \ $(LDAP_CONFIG) >> $@; \
$(CHMOD) 444 $@ $(CHMOD) 444 $@
...@@ -49,3 +79,4 @@ install-common: all-common install-local ...@@ -49,3 +79,4 @@ install-common: all-common install-local
clean-common: clean-local clean-common: clean-local
veryclean-common: veryclean-local veryclean-common: veryclean-local
depend-common: depend-local depend-common: depend-local
...@@ -51,8 +51,9 @@ LDAP_F(char *) ldap_pvt_strtok LDAP_P(( char *str, ...@@ -51,8 +51,9 @@ LDAP_F(char *) ldap_pvt_strtok LDAP_P(( char *str,
/* strdup() is missing, declare our own version */ /* strdup() is missing, declare our own version */
# undef strdup # undef strdup
# define strdup(s) ber_strdup(s) # define strdup(s) ber_strdup(s)
#else #elif !defined(_WIN32)
/* some systems fail to declare strdup */ /* some systems fail to declare strdup */
/* Windows does not require this declaration */
LDAP_LIBC_F(char *) (strdup)(); LDAP_LIBC_F(char *) (strdup)();
#endif #endif
......
...@@ -498,12 +498,12 @@ ber_sockbuf_ctrl LDAP_P(( ...@@ -498,12 +498,12 @@ ber_sockbuf_ctrl LDAP_P((
int opt, int opt,
void *arg )); void *arg ));
LBER_F( Sockbuf_IO ) ber_sockbuf_io_tcp; LBER_V( Sockbuf_IO ) ber_sockbuf_io_tcp;
LBER_F( Sockbuf_IO ) ber_sockbuf_io_readahead; LBER_V( Sockbuf_IO ) ber_sockbuf_io_readahead;
LBER_F( Sockbuf_IO ) ber_sockbuf_io_fd; LBER_V( Sockbuf_IO ) ber_sockbuf_io_fd;
LBER_F( Sockbuf_IO ) ber_sockbuf_io_debug; LBER_V( Sockbuf_IO ) ber_sockbuf_io_debug;
#ifdef LDAP_CONNECTIONLESS #ifdef LDAP_CONNECTIONLESS
LBER_F( Sockbuf_IO ) ber_sockbuf_io_udp; LBER_V( Sockbuf_IO ) ber_sockbuf_io_udp;
#endif #endif
/* /*
......
...@@ -31,7 +31,7 @@ typedef struct sockbuf_buf { ...@@ -31,7 +31,7 @@ typedef struct sockbuf_buf {
/* /*
* bprint.c * bprint.c
*/ */
LBER_F( BER_LOG_PRINT_FN ) ber_pvt_log_print; LBER_V( BER_LOG_PRINT_FN ) ber_pvt_log_print;
LBER_F( int ) LBER_F( int )
ber_pvt_log_printf LDAP_P(( ber_pvt_log_printf LDAP_P((
......
...@@ -55,93 +55,182 @@ ...@@ -55,93 +55,182 @@
# define LDAP_GCCATTR(attrs) # define LDAP_GCCATTR(attrs)
#endif #endif
/*
/* Support for NT dynamic libraries. */ * Support for Windows DLLs.
*
* When external source code includes header files for dynamic libraries,
* the external source code is "importing" DLL symbols into its resulting
* object code. On Windows, symbols imported from DLLs must be explicitly
* indicated in header files with the __declspec(dllimport) directive.
* This is not totally necessary for functions because the compiler
* (gcc or MSVC) will generate stubs when this directive is absent.
* However, this is required for imported variables.
*
* The LDAP libraries, i.e. liblber and libldap, can be built as
* static or shared, based on configuration. Just about all other source
* code in OpenLDAP use these libraries. If the LDAP libraries
* are configured as shared, 'configure' defines the LDAP_LIBS_DYNAMIC
* macro. When other source files include LDAP library headers, the
* LDAP library symbols will automatically be marked as imported. When
* the actual LDAP libraries are being built, the symbols will not
* be marked as imported because the LBER_LIBRARY or LDAP_LIBRARY macros
* will be respectively defined.
*
* Any project outside of OpenLDAP with source code wanting to use
* LDAP dynamic libraries should explicitly define LDAP_LIBS_DYNAMIC.
* This will ensure that external source code appropriately marks symbols
* that will be imported.
*
* The slapd executable, itself, can be used as a dynamic library.
* For example, if a backend module is compiled as shared, it will
* import symbols from slapd. When this happens, the slapd symbols
* must be marked as imported in header files that the backend module
* includes. Remember that slapd links with various static libraries.
* If the LDAP libraries were configured as static, their object
* code is also part of the monolithic slapd executable. Thus, when
* a backend module imports symbols from slapd, it imports symbols from
* all of the static libraries in slapd as well. Thus, the SLAP_IMPORT
* macro, when defined, will appropriately mark symbols as imported.
* This macro should be used by shared backend modules as well as any
* other external source code that imports symbols from the slapd
* executable as if it were a DLL.
*
* Note that we don't actually have to worry about using the
* __declspec(dllexport) directive anywhere. This is because both
* MSVC and Mingw provide alternate (more effective) methods for exporting
* symbols out of binaries, i.e. the use of a DEF file.
*
* NOTE ABOUT BACKENDS: Backends can be configured as static or dynamic.
* When a backend is configured as dynamic, slapd will load the backend
* explicitly and populate function pointer structures by calling
* the backend's well-known initialization function. Because of this
* procedure, slapd never implicitly imports symbols from dynamic backends.
* This makes it unnecessary to tag various backend functions with the
* __declspec(dllimport) directive. This is because neither slapd nor
* any other external binary should ever be implicitly loading a backend
* dynamic module.
*
* Backends are supposed to be self-contained. However, it appears that
* back-meta DOES implicitly import symbols from back-ldap. This means
* that the __declspec(dllimport) directive should be marked on back-ldap
* functions (in its header files) if and only if we're compiling for
* windows AND back-ldap has been configured as dynamic AND back-meta
* is the client of back-ldap. When client is slapd, there is no effect
* since slapd does not implicitly import symbols.
*
* TODO(?): Currently, back-meta nor back-ldap is supported for Mingw32.
* Thus, there's no need to worry about this right now. This is something that
* may or may not have to be addressed in the future.
*/
/* LBER library */ /* LBER library */
#if defined(LBER_DECL) && defined(_WIN32) #if defined(_WIN32) && \
# define LBER_F(type) extern __declspec(LBER_DECL) type ((defined(LDAP_LIBS_DYNAMIC) && !defined(LBER_LIBRARY)) || \
# define LBER_V(type) extern __declspec(LBER_DECL) type (!defined(LDAP_LIBS_DYNAMIC) && defined(SLAPD_IMPORT)))
# define LBER_F(type) extern __declspec(dllimport) type
# define LBER_V(type) extern __declspec(dllimport) type
#else #else
# define LBER_F(type) extern type # define LBER_F(type) extern type
# define LBER_V(type) extern type # define LBER_V(type) extern type
#endif #endif
/* LDAP library */ /* LDAP library */
#if defined(LDAP_DECL) && defined(_WIN32) #if defined(_WIN32) && \
# define LDAP_F(type) extern __declspec(LDAP_DECL) type ((defined(LDAP_LIBS_DYNAMIC) && !defined(LDAP_LIBRARY)) || \
# define LDAP_V(type) extern __declspec(LDAP_DECL) type (!defined(LDAP_LIBS_DYNAMIC) && defined(SLAPD_IMPORT)))
# define LDAP_F(type) extern __declspec(dllimport) type
# define LDAP_V(type) extern __declspec(dllimport) type
#else #else
# define LDAP_F(type) extern type # define LDAP_F(type) extern type
# define LDAP_V(type) extern type # define LDAP_V(type) extern type
#endif #endif
/*
* C library. Mingw32 links with the C run-time library by default,
* so the explicit definition of CSTATIC will keep dllimport from
* being defined.
*/
#if (defined(__MINGW32__) && !defined(CSTATIC) || \
defined(_WIN32) && defined(_DLL))
# define LDAP_LIBC_F(type) extern __declspec(dllimport) type
# define LDAP_LIBC_V(type) extern __declspec(dllimport) type
#else
# define LDAP_LIBC_F(type) extern type
# define LDAP_LIBC_V(type) extern type
#endif
/* AVL library */ /* AVL library */
#if defined(LDAP_AVL_DECL) && defined(_WIN32) #if defined(_WIN32) && defined(SLAPD_IMPORT)
# define LDAP_AVL_F(type) extern __declspec(LDAP_AVL_DECL) type # define LDAP_AVL_F(type) extern __declspec(dllimport) type
# define LDAP_AVL_V(type) extern __declspec(LDAP_AVL_DECL) type # define LDAP_AVL_V(type) extern __declspec(dllimport) type
#else #else
# define LDAP_AVL_F(type) extern type # define LDAP_AVL_F(type) extern type
# define LDAP_AVL_V(type) extern type # define LDAP_AVL_V(type) extern type
#endif #endif
/* LDBM library */ /* LDBM library */
#if defined(LDAP_LDBM_DECL) && defined(_WIN32) #if defined(_WIN32) && defined(SLAPD_IMPORT)
# define LDAP_LDBM_F(type) extern __declspec(LDAP_LDBM_DECL) type # define LDAP_LDBM_F(type) extern __declspec(dllimport) type
# define LDAP_LDBM_V(type) extern __declspec(LDAP_LDBM_DECL) type # define LDAP_LDBM_V(type) extern __declspec(dllimport) type
#else #else
# define LDAP_LDBM_F(type) extern type # define LDAP_LDBM_F(type) extern type
# define LDAP_LDBM_V(type) extern type # define LDAP_LDBM_V(type) extern type
#endif #endif
/* LDIF library */ /* LDIF library */
#if defined(LDAP_LDIF_DECL) && defined(_WIN32) #if defined(_WIN32) && defined(SLAPD_IMPORT)
# define LDAP_LDIF_F(type) extern __declspec(LDAP_LDIF_DECL) type # define LDAP_LDIF_F(type) extern __declspec(dllimport) type
# define LDAP_LDIF_V(type) extern __declspec(LDAP_LDIF_DECL) type # define LDAP_LDIF_V(type) extern __declspec(dllimport) type
#else #else
# define LDAP_LDIF_F(type) extern type # define LDAP_LDIF_F(type) extern type
# define LDAP_LDIF_V(type) extern type # define LDAP_LDIF_V(type) extern type
#endif #endif
/* LUNICODE library */ /* LUNICODE library */
#if defined(LDAP_LUNICODE_DECL) && defined(_WIN32) #if defined(_WIN32) && defined(SLAPD_IMPORT)
# define LDAP_LUNICODE_F(type) extern __declspec(LDAP_LUNICODE_DECL) type # define LDAP_LUNICODE_F(type) extern __declspec(dllimport) type
# define LDAP_LUNICODE_V(type) extern __declspec(LDAP_LUNICODE_DECL) type # define LDAP_LUNICODE_V(type) extern __declspec(dllimport) type
#else #else
# define LDAP_LUNICODE_F(type) extern type # define LDAP_LUNICODE_F(type) extern type
# define LDAP_LUNICODE_V(type) extern type # define LDAP_LUNICODE_V(type) extern type
#endif #endif
/* LUTIL library */ /* LUTIL library */
#if defined(LDAP_LUTIL_DECL) && defined(_WIN32) #if defined(_WIN32) && defined(SLAPD_IMPORT)
# define LDAP_LUTIL_F(type) extern __declspec(LDAP_LUTIL_DECL) type # define LDAP_LUTIL_F(type) extern __declspec(dllimport) type
# define LDAP_LUTIL_V(type) extern __declspec(LDAP_LUTIL_DECL) type # define LDAP_LUTIL_V(type) extern __declspec(dllimport) type
#else #else
# define LDAP_LUTIL_F(type) extern type # define LDAP_LUTIL_F(type) extern type
# define LDAP_LUTIL_V(type) extern type # define LDAP_LUTIL_V(type) extern type
#endif #endif
/* SLAPD (as a module exporting symbols) */ /* REWRITE library */
#if defined(LDAP_SLAPD_DECL) && defined(_WIN32) #if defined(_WIN32) && defined(SLAPD_IMPORT)
# define LDAP_SLAPD_F(type) extern __declspec(LDAP_SLAPD_DECL) type # define LDAP_REWRITE_F(type) extern __declspec(dllimport) type
# define LDAP_SLAPD_V(type) extern __declspec(LDAP_SLAPD_DECL) type # define LDAP_REWRITE_V(type) extern __declspec(dllimport) type
#else
# define LDAP_REWRITE_F(type) extern type
# define LDAP_REWRITE_V(type) extern type
#endif
/* SLAPD (as a dynamic library exporting symbols) */
#if defined(_WIN32) && defined(SLAPD_IMPORT)
# define LDAP_SLAPD_F(type) extern __declspec(dllimport) type
# define LDAP_SLAPD_V(type) extern __declspec(dllimport) type
#else #else
# define LDAP_SLAPD_F(type) extern type # define LDAP_SLAPD_F(type) extern type
# define LDAP_SLAPD_V(type) extern type # define LDAP_SLAPD_V(type) extern type
#endif #endif
/*
* C library. Mingw32 links with the dynamic C run-time library by default,
* so the explicit definition of CSTATIC will keep dllimport from
* being defined, if desired.
*
* MSVC defines the _DLL macro when the compiler is invoked with /MD or /MDd,
* which means the resulting object code will be linked with the dynamic
* C run-time library.
*
* Technically, it shouldn't be necessary to redefine any functions that
* the headers for the C library should already contain. Nevertheless, this
* is here as a safe-guard.
*
* TODO: Determine if these macros ever get expanded for Windows. If not,
* the declspec expansion can probably be removed.
*/
#if (defined(__MINGW32__) && !defined(CSTATIC)) || \
(defined(_MSC_VER) && defined(_DLL))
# define LDAP_LIBC_F(type) extern __declspec(dllimport) type
# define LDAP_LIBC_V(type) extern __declspec(dllimport) type
#else
# define LDAP_LIBC_F(type) extern type
# define LDAP_LIBC_V(type) extern type
#endif
#endif /* _LDAP_CDEFS_H */ #endif /* _LDAP_CDEFS_H */
...@@ -74,7 +74,7 @@ lutil_authpasswd_hash LDAP_P(( ...@@ -74,7 +74,7 @@ lutil_authpasswd_hash LDAP_P((
#if defined( SLAPD_SPASSWD ) && defined( HAVE_CYRUS_SASL ) #if defined( SLAPD_SPASSWD ) && defined( HAVE_CYRUS_SASL )
/* cheat to avoid pulling in <sasl.h> */ /* cheat to avoid pulling in <sasl.h> */
LDAP_LUTIL_F( struct sasl_conn * ) lutil_passwd_sasl_conn; LDAP_LUTIL_V( struct sasl_conn * ) lutil_passwd_sasl_conn;
#endif #endif
LDAP_LUTIL_F( int ) LDAP_LUTIL_F( int )
...@@ -110,6 +110,27 @@ lutil_progname LDAP_P(( ...@@ -110,6 +110,27 @@ lutil_progname LDAP_P((
LDAP_LUTIL_F( int ) LDAP_LUTIL_F( int )
lutil_pair( ber_socket_t sd[2] ); lutil_pair( ber_socket_t sd[2] );
/*
* Sometimes not all declarations in a header file are needed.
* An indicator to this is whether or not the symbol's type has
* been defined. Thus, we don't need to include a symbol if
* its type has not been defined through another header file.
*/
#ifdef HAVE_NT_SERVICE_MANAGER
LDAP_LUTIL_V (int) is_NT_Service;
#ifdef _LDAP_PVT_THREAD_H
LDAP_LUTIL_V (ldap_pvt_thread_cond_t) started_event;
#endif /* _LDAP_PVT_THREAD_H */
#ifdef _WINSVC_H
LDAP_LUTIL_V (SERVICE_STATUS) SLAPDServiceStatus;
LDAP_LUTIL_V (SERVICE_STATUS_HANDLE) hSLAPDServiceStatus;
#endif /* _WINSVC_H */
#endif /* HAVE_NT_SERVICE_MANAGER */
LDAP_END_DECL LDAP_END_DECL
#endif /* _LUTIL_H */ #endif /* _LUTIL_H */
...@@ -86,7 +86,7 @@ struct berval; /* avoid include */ ...@@ -86,7 +86,7 @@ struct berval; /* avoid include */
/* /*
* Inits the info * Inits the info
*/ */
extern struct rewrite_info * LDAP_REWRITE_F (struct rewrite_info *)
rewrite_info_init( rewrite_info_init(
int mode int mode
); );
...@@ -94,7 +94,7 @@ rewrite_info_init( ...@@ -94,7 +94,7 @@ rewrite_info_init(
/* /*
* Cleans up the info structure * Cleans up the info structure
*/ */
extern int LDAP_REWRITE_F (int)
rewrite_info_delete( rewrite_info_delete(
struct rewrite_info *info struct rewrite_info *info
); );
...@@ -111,7 +111,7 @@ rewrite_info_delete( ...@@ -111,7 +111,7 @@ rewrite_info_delete(
* rewriteMap mapType mapName [mapArgs] * rewriteMap mapType mapName [mapArgs]
* rewriteParam paramName paramValue * rewriteParam paramName paramValue
*/ */
extern int LDAP_REWRITE_F (int)
rewrite_parse( rewrite_parse(
struct rewrite_info *info, struct rewrite_info *info,
const char *fname, const char *fname,
...@@ -135,7 +135,7 @@ rewrite_parse( ...@@ -135,7 +135,7 @@ rewrite_parse(
* - ok with copy of string as result, * - ok with copy of string as result,
* - use the default rewrite context. * - use the default rewrite context.
*/ */
extern int LDAP_REWRITE_F (int)
rewrite( rewrite(
struct rewrite_info *info, struct rewrite_info *info,
const char *rewriteContext, const char *rewriteContext,
...@@ -146,7 +146,7 @@ rewrite( ...@@ -146,7 +146,7 @@ rewrite(
/* /*
* Same as above; the cookie relates the rewrite to a session * Same as above; the cookie relates the rewrite to a session
*/ */
extern int LDAP_REWRITE_F (int)
rewrite_session( rewrite_session(
struct rewrite_info *info, struct rewrite_info *info,
const char *rewriteContext, const char *rewriteContext,
...@@ -158,7 +158,7 @@ rewrite_session( ...@@ -158,7 +158,7 @@ rewrite_session(
/* /*
* Inits a session * Inits a session
*/ */
extern struct rewrite_session * LDAP_REWRITE_F (struct rewrite_session *)
rewrite_session_init( rewrite_session_init(
struct rewrite_info *info, struct rewrite_info *info,
const void *cookie const void *cookie
...@@ -167,7 +167,7 @@ rewrite_session_init( ...@@ -167,7 +167,7 @@ rewrite_session_init(
/* /*
* Defines and inits a variable with session scope * Defines and inits a variable with session scope
*/ */
extern int LDAP_REWRITE_F (int)
rewrite_session_var_set( rewrite_session_var_set(
struct rewrite_info *info, struct rewrite_info *info,
const void *cookie, const void *cookie,
...@@ -178,7 +178,7 @@ rewrite_session_var_set( ...@@ -178,7 +178,7 @@ rewrite_session_var_set(
/* /*
* Deletes a session * Deletes a session
*/ */
extern int LDAP_REWRITE_F (int)
rewrite_session_delete( rewrite_session_delete(
struct rewrite_info *info, struct rewrite_info *info,
const void *cookie const void *cookie
...@@ -192,7 +192,7 @@ rewrite_session_delete( ...@@ -192,7 +192,7 @@ rewrite_session_delete(
/* /*
* Defines and inits a variable with global scope * Defines and inits a variable with global scope
*/ */
extern int LDAP_REWRITE_F (int)
rewrite_param_set( rewrite_param_set(
struct rewrite_info *info, struct rewrite_info *info,
const char *name, const char *name,
...@@ -202,7 +202,7 @@ rewrite_param_set( ...@@ -202,7 +202,7 @@ rewrite_param_set(
/* /*
* Gets a var with global scope * Gets a var with global scope
*/ */
extern int LDAP_REWRITE_F (int)
rewrite_param_get( rewrite_param_get(
struct rewrite_info *info, struct rewrite_info *info,
const char *name, const char *name,
...@@ -212,7 +212,7 @@ rewrite_param_get( ...@@ -212,7 +212,7 @@ rewrite_param_get(
/* /*
* Destroys the parameter tree * Destroys the parameter tree
*/ */
extern int LDAP_REWRITE_F (int)
rewrite_param_destroy( rewrite_param_destroy(
struct rewrite_info *info struct rewrite_info *info
); );
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#ifdef CSRIMALLOC #ifdef CSRIMALLOC
#define ber_memalloc malloc #define ber_memalloc malloc
#define ber_memrealloc realloc #define ber_memrealloc realloc
#else
#include "lber.h"
#endif #endif
#define AVL_INTERNAL #define AVL_INTERNAL
......
...@@ -11,6 +11,8 @@ XLIBRARY = ../liblber.a ...@@ -11,6 +11,8 @@ XLIBRARY = ../liblber.a
NT_SRCS = nt_err.c NT_SRCS = nt_err.c
NT_OBJS = nt_err.lo NT_OBJS = nt_err.lo
LIB_DEFS = -DLBER_LIBRARY
SRCS= assert.c decode.c encode.c io.c bprint.c \ SRCS= assert.c decode.c encode.c io.c bprint.c \
memory.c options.c sockbuf.c $(@PLAT@_SRCS) memory.c options.c sockbuf.c $(@PLAT@_SRCS)
OBJS= assert.lo decode.lo encode.lo io.lo bprint.lo \ OBJS= assert.lo decode.lo encode.lo io.lo bprint.lo \
...@@ -24,17 +26,7 @@ LDAP_LIBDIR= ../../libraries ...@@ -24,17 +26,7 @@ LDAP_LIBDIR= ../../libraries
XLIBS = -llber XLIBS = -llber
XXLIBS = XXLIBS =
NT_LINK_LIBS = $(AC_LIBS)
LINKAGE = @LT_LIB_LINKAGE@
NT_DYN_TEST_DEFS = -DLBER_DECL=dllimport
# Extras for building the library
EXTRA_DEFS = $(@PLAT@_@LIB_LINKAGE@_LIB_DEFS)
EXTRA_LIBS =
# Only the test programs will pick up these defs.
CPPFLAGS = $(@PLAT@_@LIB_LINKAGE@_TEST_DEFS)
dtest: $(LIBRARY) dtest.o dtest: $(LIBRARY) dtest.o
$(LTLINK) -o $@ dtest.o $(LIBS) $(LTLINK) -o $@ dtest.o $(LIBS)
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
LDAP_BEGIN_DECL LDAP_BEGIN_DECL
LBER_F (BER_ERRNO_FN) ber_int_errno_fn; LBER_V (BER_ERRNO_FN) ber_int_errno_fn;
struct lber_options { struct lber_options {
short lbo_valid; short lbo_valid;
...@@ -51,7 +51,7 @@ struct lber_options { ...@@ -51,7 +51,7 @@ struct lber_options {
#define LBER_VALID_BERELEMENT 0x2 #define LBER_VALID_BERELEMENT 0x2
#define LBER_VALID_SOCKBUF 0x3 #define LBER_VALID_SOCKBUF 0x3
LBER_F (struct lber_options) ber_int_options; LBER_V (struct lber_options) ber_int_options;
#define ber_int_debug ber_int_options.lbo_debug #define ber_int_debug ber_int_options.lbo_debug
struct berelement { struct berelement {
...@@ -105,7 +105,8 @@ struct seqorset { ...@@ -105,7 +105,8 @@ struct seqorset {
/* /*
* io.c * io.c
*/ */
int ber_realloc LDAP_P(( LBER_F( int )
ber_realloc LDAP_P((
BerElement *ber, BerElement *ber,
ber_len_t len )); ber_len_t len ));
...@@ -146,7 +147,7 @@ ber_log_sos_dump LDAP_P(( ...@@ -146,7 +147,7 @@ ber_log_sos_dump LDAP_P((
/* memory.c */ /* memory.c */
/* simple macros to realloc for now */ /* simple macros to realloc for now */
LBER_F (BerMemoryFunctions *) ber_int_memory_fns; LBER_V (BerMemoryFunctions *) ber_int_memory_fns;
LBER_F (char *) ber_strndup( LDAP_CONST char *, ber_len_t ); LBER_F (char *) ber_strndup( LDAP_CONST char *, ber_len_t );
LBER_F (char *) ber_strndup__( LDAP_CONST char *, size_t ); LBER_F (char *) ber_strndup__( LDAP_CONST char *, size_t );
......
...@@ -33,26 +33,11 @@ OBJS = bind.lo open.lo result.lo error.lo compare.lo search.lo \ ...@@ -33,26 +33,11 @@ OBJS = bind.lo open.lo result.lo error.lo compare.lo search.lo \
LDAP_INCDIR= ../../include LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries LDAP_LIBDIR= ../../libraries
XLIBS = -lldap -llber -llutil LIB_DEFS = -DLDAP_LIBRARY
XXLIBS = $(SECURITY_LIBS) $(TLS_LIBS)
LINKAGE = @LT_LIB_LINKAGE@
NT_DYN_LIB_LIBS = -llber -llutil $(AC_LIBS)
NT_DYN_LIB_DEFS = -DLBER_DECL=dllimport
NT_DYN_TEST_DEFS = -DLBER_DECL=dllimport -DLDAP_DECL=dllimport
NT_XXLIBS = $(SECURITY_LIBS)
UNIX_DYN_LIB_LIBS = -llber $(AC_LIBS) XLIBS = -lldap -llber -llutil
UNIX_XXLIBS = $(SECURITY_LIBS) XXLIBS = $(SECURITY_LIBS) $(LUTIL_LIBS)
NT_LINK_LIBS = -llber $(AC_LIBS) $(SECURITY_LIBS)
# Extras for building the library
EXTRA_DEFS = $(@PLAT@_@LIB_LINKAGE@_LIB_DEFS)
EXTRA_LIBS = $(@PLAT@_@LIB_LINKAGE@_LIB_LIBS) $(@PLAT@_XXLIBS)
# Only the test programs will pick up these defs.
CPPFLAGS = $(@PLAT@_@LIB_LINKAGE@_TEST_DEFS)
apitest: $(LIBRARY) apitest.o $(LDAP_LIBLBER_DEPEND) apitest: $(LIBRARY) apitest.o $(LDAP_LIBLBER_DEPEND)
$(LTLINK) -o $@ apitest.o $(LIBS) $(LTLINK) -o $@ apitest.o $(LIBS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment