From: Bradley Nicholes Date: Thu, 14 Apr 2005 23:42:21 +0000 (+0000) Subject: Allow httpd on NetWare to build using either the standard socket libraries or the... X-Git-Tag: 2.1.5~185 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6905d3d9d5da41176e547742c8c04d434cde2056;p=apache Allow httpd on NetWare to build using either the standard socket libraries or the Winsock libraries. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@161368 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/NWGNUmakefile b/NWGNUmakefile index ca7c3676e9..3ae56b9dd9 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -216,7 +216,6 @@ FILES_nlm_objs = \ $(OBJDIR)/mod_mime.o \ $(OBJDIR)/mod_negotiation.o \ $(OBJDIR)/mod_netware.o \ - $(OBJDIR)/mod_nw_ssl.o \ $(OBJDIR)/mod_setenvif.o \ $(OBJDIR)/mod_so.o \ $(OBJDIR)/modules.o \ @@ -241,6 +240,12 @@ FILES_nlm_objs = \ $(OBJDIR)/vhost.o \ $(EOLIST) +# Build in mod_nw_ssl if Winsock is being used +ifndef USE_STDSOCKETS +FILES_nlm_objs += $(OBJDIR)/mod_nw_ssl.o \ + $(EOLIST) +endif + # # These are the LIB files needed to create the NLM target above. # These will be added as a library command in the link.opt file. @@ -280,9 +285,14 @@ FILES_nlm_Ximports = \ @netware.imp \ @$(APR)/aprlib.imp \ @libc.imp \ - @ws2nlm.imp \ GetCurrentAddressSpace \ $(EOLIST) + +# Build in mod_nw_ssl if Winsock is being used +ifndef USE_STDSOCKETS +FILES_nlm_Ximports += @ws2nlm.imp \ + $(EOLIST) +endif # # Any symbols exported to here diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 15f3b4143a..4bc506ae6b 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -127,6 +127,9 @@ INCDIRS := $(INCDIRS);$(ZLIBSDK) endif DEFINES = -DNETWARE +ifndef USE_STDSOCKETS +DEFINES += -DUSE_WINSOCK +endif # # MetroWerks static Libraries @@ -271,6 +274,7 @@ SERVER = $(AP_WORK)/server SRC = $(AP_WORK) APR = $(APR_WORK) APRUTIL = $(APU_WORK) +APULDAP = $(APU_WORK)/ldap SUPMOD = $(AP_WORK)/support PCRE = $(AP_WORK)/srclib/pcre APRTEST = $(APR_WORK)/test @@ -284,6 +288,7 @@ PREBUILD_INST = $(AP_WORK)\nwprebuild APRLIB = $(APR)/$(OBJDIR)/aprlib.lib APRUTLIB = $(APRUTIL)/$(OBJDIR)/aprutil.lib +APULDAPLIB = $(APULDAP)/$(OBJDIR)/apuldap.lib STMODLIB = $(STDMOD)/$(OBJDIR)/stdmod.lib PCRELIB = $(PCRE)/$(OBJDIR)/pcre.lib NWOSLIB = $(NWOS)/$(OBJDIR)/netware.lib diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index a9205c2ec4..582c2c9332 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -39,7 +39,7 @@ cc.opt : NWGNUmakefile $(AP_WORK)\build\NWGNUenvironment.inc $(AP_WORK)\build\NW @echo -EP >> $@ @echo -nosyspath >> $@ @echo -w nocmdline >> $@ - @echo -DNETWARE >> $@ + @echo $(DEFINES) >> $@ @echo -DCORE_PRIVATE >> $@ @echo -I..\include >> $@ @echo -I..\modules\http >> $@ diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 861c890ef5..3a44d646f3 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -241,6 +241,7 @@ endif ifneq "$(LDAPSDK)" "" @echo -l $(LDAPSDK)/lib/nlm >> $@ endif + @echo -l $(APULDAP)/$(OBJDIR) >> $@ @echo -l $(XML)/$(OBJDIR) >> $@ @echo -nodefaults >> $@ @echo -map $(OBJDIR)\$(NLM_NAME).map>> $@ diff --git a/modules/aaa/NWGNUauthnzldap b/modules/aaa/NWGNUauthnzldap index 5b0ac89daf..b1e996df70 100644 --- a/modules/aaa/NWGNUauthnzldap +++ b/modules/aaa/NWGNUauthnzldap @@ -35,6 +35,14 @@ XCFLAGS += \ XDEFINES += \ $(EOLIST) +# +#LDAP client requires the use of Winsock +# +ifdef USE_STDSOCKETS +XDEFINES += -DUSE_WINSOCK \ + $(EOLIST) +endif + # # These flags will be added to the link.opt file # diff --git a/modules/arch/netware/libprews.c b/modules/arch/netware/libprews.c index 7255c75215..264ae054b8 100644 --- a/modules/arch/netware/libprews.c +++ b/modules/arch/netware/libprews.c @@ -26,7 +26,9 @@ ------------------------------------------------------------------*/ #include //#include "stddef.h" +#ifdef USE_WINSOCK #include "novsock2.h" +#endif int _NonAppStart ( @@ -54,14 +56,22 @@ int _NonAppStart #pragma unused(messageCount) #pragma unused(messages) +#ifdef USE_WINSOCK WSADATA wsaData; return WSAStartup((WORD) MAKEWORD(2, 0), &wsaData); +#else + return 0; +#endif } void _NonAppStop( void ) { +#ifdef USE_WINSOCK WSACleanup(); +#else + return;0; +#endif } int _NonAppCheckUnload( void ) diff --git a/modules/ldap/NWGNUmakefile b/modules/ldap/NWGNUmakefile index 09e8b5360d..7001dc980e 100644 --- a/modules/ldap/NWGNUmakefile +++ b/modules/ldap/NWGNUmakefile @@ -37,6 +37,14 @@ XCFLAGS += \ XDEFINES += \ $(EOLIST) +# +#LDAP client requires the use of Winsock +# +ifdef USE_STDSOCKETS +XDEFINES += -DUSE_WINSOCK \ + $(EOLIST) +endif + # # These flags will be added to the link.opt file # diff --git a/os/netware/modules.c b/os/netware/modules.c index 84c5c1df69..153b8c0a07 100644 --- a/os/netware/modules.c +++ b/os/netware/modules.c @@ -36,7 +36,9 @@ extern module alias_module; extern module env_module; extern module log_config_module; extern module setenvif_module; +#ifdef USE_WINSOCK extern module nwssl_module; +#endif extern module netware_module; module *ap_prelinked_modules[] = { @@ -53,7 +55,9 @@ module *ap_prelinked_modules[] = { &env_module, &log_config_module, &setenvif_module, +#ifdef USE_WINSOCK &nwssl_module, +#endif &netware_module, NULL }; @@ -72,7 +76,9 @@ ap_module_symbol_t ap_prelinked_module_symbols[] = { {"env_module", &env_module}, {"log_config_module", &log_config_module}, {"setenvif_module", &setenvif_module}, +#ifdef USE_WINSOCK {"nwssl_module", &nwssl_module}, +#endif {"netware_module", &netware_module}, {NULL, NULL} }; @@ -91,7 +97,9 @@ module *ap_preloaded_modules[] = { &env_module, &log_config_module, &setenvif_module, +#ifdef USE_WINSOCK &nwssl_module, +#endif &netware_module, NULL }; diff --git a/server/mpm/netware/mpm_netware.c b/server/mpm/netware/mpm_netware.c index 8d106198d0..65b37b99a9 100644 --- a/server/mpm/netware/mpm_netware.c +++ b/server/mpm/netware/mpm_netware.c @@ -57,6 +57,10 @@ #include #endif +#ifndef USE_WINSOCK +#include +#endif + #define CORE_PRIVATE #include "ap_config.h" @@ -385,7 +389,7 @@ void worker_main(void *arg) if (srv <= 0) { if (srv < 0) { - ap_log_error(APLOG_MARK, APLOG_NOTICE, WSAGetLastError(), ap_server_conf, + ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, "select() failed on listen socket"); apr_thread_yield(); } @@ -468,6 +472,7 @@ void worker_main(void *arg) APR_STATUS_IS_ENETUNREACH(stat)) { ; } +#ifdef USE_WINSOCK else if (APR_STATUS_IS_ENETDOWN(stat)) { /* * When the network layer has been shut down, there @@ -488,6 +493,7 @@ void worker_main(void *arg) clean_child_exit(APEXIT_CHILDFATAL, my_worker_num, ptrans, bucket_alloc); } +#endif else { ap_log_error(APLOG_MARK, APLOG_ERR, stat, ap_server_conf, "apr_socket_accept: (client socket)"); @@ -970,8 +976,10 @@ static int netware_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp free (addrname); } - /* The following call has been moved to the mod_nw_ssl pre-config handler - ap_listen_pre_config(); */ +#ifndef USE_WINSOCK + /* The following call has been moved to the mod_nw_ssl pre-config handler */ + ap_listen_pre_config(); +#endif ap_threads_to_start = DEFAULT_START_THREADS; ap_threads_min_free = DEFAULT_MIN_FREE_THREADS; diff --git a/support/logresolve.c b/support/logresolve.c index 5576fd1ea0..e497d2e0c3 100644 --- a/support/logresolve.c +++ b/support/logresolve.c @@ -305,7 +305,7 @@ int main (int argc, char *argv[]) char *bar, hoststring[MAXDNAME + 1], line[MAXLINE], *statfile; int i, check; -#if defined(WIN32) || defined(NETWARE) +#if defined(WIN32) || (defined(NETWARE) && defined(USE_WINSOCK)) /* If we apr'ify this code, apr_pool_create/apr_pool_destroy * should perform the WSAStartup/WSACleanup for us. */ @@ -367,7 +367,7 @@ int main (int argc, char *argv[]) puts(hoststring); } -#if defined(WIN32) || defined(NETWARE) +#if defined(WIN32) || (defined(NETWARE) && defined(USE_WINSOCK)) WSACleanup(); #endif