From: Graham Leggett Date: Wed, 9 Oct 2002 06:48:08 +0000 (+0000) Subject: Change the LDAP modules to export their symbols correctly X-Git-Tag: 2.0.44~329 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8f2672db52701c89cbf9aba7094a69e9fa1b89af;p=apache Change the LDAP modules to export their symbols correctly during a Windows build. Add dsp files for Windows. PR: Obtained from: Submitted by: Andre Schild Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97156 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 5fec8e69d7..a9dae13ce7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with Apache 2.0.44 + *) Change the LDAP modules to export their symbols correctly + during a Windows build. Add dsp files for Windows. + [Andre Schild ] + *) Performance improvements for the code that generates HTTP response headers [Brian Pane] diff --git a/include/util_ldap.h b/include/util_ldap.h index 9469d44a6f..baa5634818 100644 --- a/include/util_ldap.h +++ b/include/util_ldap.h @@ -76,6 +76,28 @@ #include "http_request.h" +/* Create a set of LDAP_DECLARE(type), LDLDAP_DECLARE(type) and + * LDAP_DECLARE_DATA with appropriate export and import tags for the platform + */ +#if !defined(WIN32) +#define LDAP_DECLARE(type) type +#define LDAP_DECLARE_NONSTD(type) type +#define LDAP_DECLARE_DATA +#elif defined(LDAP_DECLARE_STATIC) +#define LDAP_DECLARE(type) type __stdcall +#define LDAP_DECLARE_NONSTD(type) type +#define LDAP_DECLARE_DATA +#elif defined(LDAP_DECLARE_EXPORT) +#define LDAP_DECLARE(type) __declspec(dllexport) type __stdcall +#define LDAP_DECLARE_NONSTD(type) __declspec(dllexport) type +#define LDAP_DECLARE_DATA __declspec(dllexport) +#else +#define LDAP_DECLARE(type) __declspec(dllimport) type __stdcall +#define LDAP_DECLARE_NONSTD(type) __declspec(dllimport) type +#define LDAP_DECLARE_DATA __declspec(dllimport) +#endif + + /* * LDAP Connections */ @@ -146,7 +168,7 @@ typedef struct util_ldap_state_t { * @return If successful LDAP_SUCCESS is returned. * @deffunc int util_ldap_connection_open(util_ldap_connection_t *ldc) */ -int util_ldap_connection_open(util_ldap_connection_t *ldc); +LDAP_DECLARE(int) util_ldap_connection_open(util_ldap_connection_t *ldc); /** * Close a connection to an LDAP server @@ -157,7 +179,7 @@ int util_ldap_connection_open(util_ldap_connection_t *ldc); * structure, using apr_ldap_open_connection(). * @deffunc util_ldap_close_connection(util_ldap_connection_t *ldc) */ -void util_ldap_connection_close(util_ldap_connection_t *ldc); +LDAP_DECLARE(void) util_ldap_connection_close(util_ldap_connection_t *ldc); /** * Destroy a connection to an LDAP server @@ -167,7 +189,7 @@ void util_ldap_connection_close(util_ldap_connection_t *ldc); * LDAP connections when the server is finished with them. * @deffunc apr_status_t util_ldap_connection_destroy(util_ldap_connection_t *ldc) */ -apr_status_t util_ldap_connection_destroy(void *param); +LDAP_DECLARE_NONSTD(apr_status_t) util_ldap_connection_destroy(void *param); /** * Find a connection in a list of connections @@ -187,7 +209,7 @@ apr_status_t util_ldap_connection_destroy(void *param); * const char *binddn, const char *bindpw, deref_options deref, * int netscapessl, int starttls) */ -util_ldap_connection_t *util_ldap_connection_find(request_rec *r, const char *host, int port, +LDAP_DECLARE(util_ldap_connection_t *) util_ldap_connection_find(request_rec *r, const char *host, int port, const char *binddn, const char *bindpw, deref_options deref, int netscapessl, int starttls); @@ -210,7 +232,7 @@ util_ldap_connection_t *util_ldap_connection_find(request_rec *r, const char *ho * const char *url, const char *dn, const char *reqdn, * int compare_dn_on_server) */ -int util_ldap_cache_comparedn(request_rec *r, util_ldap_connection_t *ldc, +LDAP_DECLARE(int) util_ldap_cache_comparedn(request_rec *r, util_ldap_connection_t *ldc, const char *url, const char *dn, const char *reqdn, int compare_dn_on_server); @@ -227,7 +249,7 @@ int util_ldap_cache_comparedn(request_rec *r, util_ldap_connection_t *ldc, * @deffunc int util_ldap_cache_compare(request_rec *r, util_ldap_connection_t *ldc, * const char *url, const char *dn, const char *attrib, const char *value) */ -int util_ldap_cache_compare(request_rec *r, util_ldap_connection_t *ldc, +LDAP_DECLARE(int) util_ldap_cache_compare(request_rec *r, util_ldap_connection_t *ldc, const char *url, const char *dn, const char *attrib, const char *value); /** @@ -249,7 +271,7 @@ int util_ldap_cache_compare(request_rec *r, util_ldap_connection_t *ldc, * char *url, const char *basedn, int scope, char **attrs, * char *filter, char *bindpw, char **binddn, char ***retvals) */ -int util_ldap_cache_checkuserid(request_rec *r, util_ldap_connection_t *ldc, +LDAP_DECLARE(int) util_ldap_cache_checkuserid(request_rec *r, util_ldap_connection_t *ldc, const char *url, const char *basedn, int scope, char **attrs, const char *filter, const char *bindpw, const char **binddn, const char ***retvals); diff --git a/modules/experimental/mod_auth_ldap.dsp b/modules/experimental/mod_auth_ldap.dsp new file mode 100644 index 0000000000..5021f83ece --- /dev/null +++ b/modules/experimental/mod_auth_ldap.dsp @@ -0,0 +1,129 @@ +# Microsoft Developer Studio Project File - Name="mod_auth_ldap" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_auth_ldap - Win32 Release +!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "mod_auth_ldap.mak". +!MESSAGE +!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "mod_auth_ldap.mak" CFG="mod_auth_ldap - Win32 Release" +!MESSAGE +!MESSAGE Für die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "mod_auth_ldap - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_auth_ldap - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_auth_ldap - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /I "../../srclib/ldap/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "AP_AUTH_DBM_USE_APR" /Fd"Release\mod_auth_ldap" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_auth_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_ldap +# ADD LINK32 kernel32.lib libhttpd.lib libapr.lib nsldap32v50.lib libaprutil.lib util_ldap.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_auth_ldap.so" /libpath:"release" /libpath:"..\..\release" /libpath:"..\..\srclib\apr\release" /libpath:"..\..\srclib\ldap\lib" /libpath:"..\..\srclib\apr-util\release" /libpath:"..\..\srclib\apr-util\Release" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_ldap +# SUBTRACT LINK32 /debug + +!ELSEIF "$(CFG)" == "mod_auth_ldap - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /I "../../srclib/ldap/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "AP_AUTH_DBM_USE_APR" /Fd"Debug\mod_auth_ldap" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_auth_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_ldap +# ADD LINK32 kernel32.lib libhttpd.lib libapr.lib nsldap32v50.lib libaprutil.lib util_ldap.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_auth_ldap.so" /libpath:"Debug" /libpath:"..\..\debug" /libpath:"..\..\srclib\apr\debug" /libpath:"..\..\srclib\ldap\lib" /libpath:"..\..\srclib\apr-util\debug" /libpath:"..\..\srclib\apr-util\Debug" /base:@..\..\os\win32\BaseAddr.ref,mod_auth_ldap + +!ENDIF + +# Begin Target + +# Name "mod_auth_ldap - Win32 Release" +# Name "mod_auth_ldap - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_auth_ldap.c +# End Source File +# Begin Source File + +SOURCE=.\mod_auth_ldap.rc +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "mod_auth_ldap - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_auth_ldap.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_auth_ldap "auth_dbm_module for Apache" ../../include/ap_release.h > .\mod_auth_ldap.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "mod_auth_ldap - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_auth_ldap.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_auth_ldap "auth_dbm_module for Apache" ../../include/ap_release.h > .\mod_auth_ldap.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/modules/experimental/util_ldap.c b/modules/experimental/util_ldap.c index 1743862105..23768ca43b 100644 --- a/modules/experimental/util_ldap.c +++ b/modules/experimental/util_ldap.c @@ -178,7 +178,7 @@ int util_ldap_handler(request_rec *r) * util_ldap_connection_find() is called this connection will be * available for reuse. */ -void util_ldap_connection_close(util_ldap_connection_t *ldc) +LDAP_DECLARE(void) util_ldap_connection_close(util_ldap_connection_t *ldc) { /* @@ -238,7 +238,7 @@ apr_status_t util_ldap_connection_destroy(void *param) * * Returns LDAP_SUCCESS on success; and an error code on failure */ -int util_ldap_connection_open(util_ldap_connection_t *ldc) +LDAP_DECLARE(int) util_ldap_connection_open(util_ldap_connection_t *ldc) { int result = 0; int failures = 0; @@ -376,7 +376,7 @@ start_over: * and returned to the caller. If found in the cache, a pointer to the existing * ldc structure will be returned. */ -util_ldap_connection_t *util_ldap_connection_find(request_rec *r, const char *host, int port, +LDAP_DECLARE(util_ldap_connection_t *)util_ldap_connection_find(request_rec *r, const char *host, int port, const char *binddn, const char *bindpw, deref_options deref, int netscapessl, int starttls) { @@ -505,7 +505,7 @@ util_ldap_connection_t *util_ldap_connection_find(request_rec *r, const char *ho * * The lock for the ldap cache should already be acquired. */ -int util_ldap_cache_comparedn(request_rec *r, util_ldap_connection_t *ldc, +LDAP_DECLARE(int) util_ldap_cache_comparedn(request_rec *r, util_ldap_connection_t *ldc, const char *url, const char *dn, const char *reqdn, int compare_dn_on_server) { @@ -623,7 +623,7 @@ start_over: * require user cache is owned by the * */ -int util_ldap_cache_compare(request_rec *r, util_ldap_connection_t *ldc, +LDAP_DECLARE(int) util_ldap_cache_compare(request_rec *r, util_ldap_connection_t *ldc, const char *url, const char *dn, const char *attrib, const char *value) { @@ -738,7 +738,7 @@ start_over: return result; } -int util_ldap_cache_checkuserid(request_rec *r, util_ldap_connection_t *ldc, +LDAP_DECLARE(int) util_ldap_cache_checkuserid(request_rec *r, util_ldap_connection_t *ldc, const char *url, const char *basedn, int scope, char **attrs, const char *filter, const char *bindpw, const char **binddn, const char ***retvals) diff --git a/modules/experimental/util_ldap.dsp b/modules/experimental/util_ldap.dsp new file mode 100644 index 0000000000..7535d1417b --- /dev/null +++ b/modules/experimental/util_ldap.dsp @@ -0,0 +1,148 @@ +# Microsoft Developer Studio Project File - Name="util_ldap" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=util_ldap - Win32 Release +!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "util_ldap.mak". +!MESSAGE +!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "util_ldap.mak" CFG="util_ldap - Win32 Release" +!MESSAGE +!MESSAGE Für die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "util_ldap - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library") +!MESSAGE "util_ldap - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "util_ldap - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /I "../../srclib/ldap/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "AP_AUTH_DBM_USE_APR" /Fd"Release\util_ldap" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/util_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,util_ldap +# ADD LINK32 kernel32.lib libhttpd.lib libapr.lib nsldap32v50.lib libaprutil.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/util_ldap.so" /libpath:"..\..\release" /libpath:"..\..\srclib\apr\release" /libpath:"..\..\srclib\ldap\lib" /libpath:"..\..\srclib\apr-util\release" /libpath:"..\..\srclib\apr-util\Release" /base:@..\..\os\win32\BaseAddr.ref,util_ldap +# SUBTRACT LINK32 /debug + +!ELSEIF "$(CFG)" == "util_ldap - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /I "../../srclib/ldap/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "AP_AUTH_DBM_USE_APR" /Fd"Debug\util_ldap" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/util_ldap.so" /base:@..\..\os\win32\BaseAddr.ref,util_ldap +# ADD LINK32 kernel32.lib libhttpd.lib libapr.lib nsldap32v50.lib libaprutil.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/util_ldap.so" /libpath:"..\..\debug" /libpath:"..\..\srclib\apr\debug" /libpath:"..\..\srclib\ldap\lib" /libpath:"..\..\srclib\apr-util\debug" /libpath:"..\..\srclib\apr-util\Debug" /base:@..\..\os\win32\BaseAddr.ref,util_ldap + +!ENDIF + +# Begin Target + +# Name "util_ldap - Win32 Release" +# Name "util_ldap - Win32 Debug" +# Begin Source File + +SOURCE=.\util_ldap.c + +!IF "$(CFG)" == "util_ldap - Win32 Release" + +# ADD CPP /D "LDAP_DECLARE_EXPORT" + +!ELSEIF "$(CFG)" == "util_ldap - Win32 Debug" + +# ADD CPP /D "LDAP_DECLARE_EXPORT" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\util_ldap.rc +# End Source File +# Begin Source File + +SOURCE=.\util_ldap_cache.c +# End Source File +# Begin Source File + +SOURCE=.\util_ldap_cache_mgr.c +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "util_ldap - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\util_ldap.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk util_ldap "auth_dbm_module for Apache" ../../include/ap_release.h > .\util_ldap.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "util_ldap - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\util_ldap.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk util_ldap "auth_dbm_module for Apache" ../../include/ap_release.h > .\util_ldap.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project