]> granicus.if.org Git - apache/commitdiff
Allow httpd on NetWare to build using either the standard socket libraries or the...
authorBradley Nicholes <bnicholes@apache.org>
Thu, 14 Apr 2005 23:42:21 +0000 (23:42 +0000)
committerBradley Nicholes <bnicholes@apache.org>
Thu, 14 Apr 2005 23:42:21 +0000 (23:42 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@161368 13f79535-47bb-0310-9956-ffa450edef68

NWGNUmakefile
build/NWGNUenvironment.inc
build/NWGNUmakefile
build/NWGNUtail.inc
modules/aaa/NWGNUauthnzldap
modules/arch/netware/libprews.c
modules/ldap/NWGNUmakefile
os/netware/modules.c
server/mpm/netware/mpm_netware.c
support/logresolve.c

index ca7c3676e9be6f055f90db0f8531daaf5ef97428..3ae56b9dd98e84a9b8d07f55bb800bc9b0222788 100644 (file)
@@ -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
index 15f3b4143a3250057c415337cca1461ffe40fd37..4bc506ae6b2cf12d4d5581cbc92218e1006bdebf 100644 (file)
@@ -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
index a9205c2ec4b9435436da5676b67c7039515027fa..582c2c93324ef8389a02f9c31fce7bcacf8c6ac1 100644 (file)
@@ -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 >> $@
index 861c890ef54a2322f0a482672fd37128ed1bad38..3a44d646f32c6f78183b37bd20798c031e5f26ea 100644 (file)
@@ -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>> $@
index 5b0ac89daf9f7d06434317643d0504a7a9fd3b99..b1e996df704fac3f57ff71286110257e8e9d8785 100644 (file)
@@ -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
 #
index 7255c7521581b6f4766deb7f71abb07c0b8d5a73..264ae054b84f7ad61ff69b44dd93210169a8c1b5 100644 (file)
@@ -26,7 +26,9 @@
 ------------------------------------------------------------------*/
 #include <netware.h>
 //#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 )
index 09e8b5360dfec4b4f508d83103beda10f710a1dc..7001dc980eccc0e71305b1c587b06f4ad6160bbf 100644 (file)
@@ -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
 #
index 84c5c1df695fb97b01a770fc8cc9a6ee6e450d7a..153b8c0a07cf4e4342298ac75fc3afe4484ddc9f 100644 (file)
@@ -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
 };
index 8d106198d0563fa6de4949b650a606358b571e1d..65b37b99a9aa6d1cd53a612126d9150487a8eac9 100644 (file)
 #include <sys/types.h>
 #endif
 
+#ifndef USE_WINSOCK
+#include <sys/select.h>
+#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;
index 5576fd1ea054531429132d0da85b1c47202e10a7..e497d2e0c305a5440c4c5b99a1d9a821c849309f 100644 (file)
@@ -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