On Sun, Mar 27, 2011 at 3:26 PM, NormW <[email protected]> wrote:
> On 28/03/2011 1:30 AM, Jeff Trawick wrote:
>>
>> For autoconf-based builds, DEFAULT_REL_RUNTIMEDIR is defined by the
>> layout machinery, which creates ap_config_layout.h.
>>
>> For non-autoconf-based builds, there is no equivalent to
>> ap_config_layout.h.  Windows and NetWare MPMs define
>> DEFAULT_REL_RUNTIMEDIR in mpm_layout.h, but that is local to the MPM.
>> So no definition is visible to modules and other source files.  As a
>> work-around, several common source files have created their own
>> defaults when DEFAULT_REL_RUNTIMEDIR is not defined.
>>
>> The attached patch creates a new os_layout.h for non-autoconf-based
>> builds (just Windows and NetWare) which defines
>> DEFAULT_REL_RUNTIMEDIR.  The workarounds from the several common
>> source files are removed.  Third-party modules can also depend on
>> DEFAULT_REL_RUNTIMEDIR again.
>>
>> Concerns (such as better name for the new file)?
>>
>> No, I didn't test it :)  My Visual C++ Express setup for httpd is not
>> workable at present.
>>
>> I will try to test the docgen stuff before I commit.
>
> Seems like the paperclip failed.

(blush)

now attached
Index: os/win32/os_layout.h
===================================================================
--- os/win32/os_layout.h        (revision 0)
+++ os/win32/os_layout.h        (revision 0)
@@ -0,0 +1,35 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file win32/os_layout.h
+ * @brief This provides layout definitions for non-autoconf-based Windows
+ * builds.
+ *
+ * @defgroup APACHE_OS_LAYOUT_WIN32 win32
+ * @ingroup  APACHE_OS_LAYOUT
+ * @{
+ */
+
+#ifndef AP_OS_LAYOUT_H
+#define AP_OS_LAYOUT_H
+
+/* Check for definition of DEFAULT_REL_RUNTIMEDIR */
+#ifndef DEFAULT_REL_RUNTIMEDIR
+#define DEFAULT_REL_RUNTIMEDIR "logs"
+#endif
+
+#endif /* AP_OS_LAYOUT_H */
Index: os/netware/os_layout.h
===================================================================
--- os/netware/os_layout.h      (revision 0)
+++ os/netware/os_layout.h      (revision 0)
@@ -0,0 +1,35 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file netware/os_layout.h
+ * @brief This provides layout definitions for non-autoconf-based NetWare
+ * builds.
+ *
+ * @defgroup APACHE_OS_LAYOUT_NETWARE netware
+ * @ingroup  APACHE_OS_LAYOUT
+ * @{
+ */
+
+#ifndef AP_OS_LAYOUT_H
+#define AP_OS_LAYOUT_H
+
+/* Check for definition of DEFAULT_REL_RUNTIMEDIR */
+#ifndef DEFAULT_REL_RUNTIMEDIR
+#define DEFAULT_REL_RUNTIMEDIR "logs"
+#endif
+
+#endif /* AP_OS_LAYOUT_H */
Index: server/util_mutex.c
===================================================================
--- server/util_mutex.c (revision 1085954)
+++ server/util_mutex.c (working copy)
@@ -154,11 +154,7 @@
     /* initialize default mutex configuration */
     def = apr_pcalloc(p, sizeof *def);
     def->mech = APR_LOCK_DEFAULT;
-#ifdef DEFAULT_REL_RUNTIMEDIR
     def->dir = DEFAULT_REL_RUNTIMEDIR;
-#else
-    def->dir = "logs";
-#endif
     apr_hash_set(mxcfg_by_type, "default", APR_HASH_KEY_STRING, def);
 }
 
Index: server/mpm/winnt/mpm_default.h
===================================================================
--- server/mpm/winnt/mpm_default.h      (revision 1085954)
+++ server/mpm/winnt/mpm_default.h      (working copy)
@@ -55,11 +55,6 @@
  */
 #define HARD_SERVER_LIMIT 1
 
-/* Check for definition of DEFAULT_REL_RUNTIMEDIR */
-#ifndef DEFAULT_REL_RUNTIMEDIR
-#define DEFAULT_REL_RUNTIMEDIR "logs"
-#endif
-
 /* Where the main/parent process's pid is logged */
 #ifndef DEFAULT_PIDLOG
 #define DEFAULT_PIDLOG DEFAULT_REL_RUNTIMEDIR "/httpd.pid"
Index: server/mpm/netware/mpm_default.h
===================================================================
--- server/mpm/netware/mpm_default.h    (revision 1085954)
+++ server/mpm/netware/mpm_default.h    (working copy)
@@ -60,11 +60,6 @@
 #define DEFAULT_MIN_FREE_THREADS 10
 #endif
 
-/* Check for definition of DEFAULT_REL_RUNTIMEDIR */
-#ifndef DEFAULT_REL_RUNTIMEDIR
-#define DEFAULT_REL_RUNTIMEDIR "logs"
-#endif
-
 /* Where the main/parent process's pid is logged */
 /*#ifndef DEFAULT_PIDLOG
   #define DEFAULT_PIDLOG DEFAULT_REL_RUNTIMEDIR "/httpd.pid"
Index: modules/cache/mod_socache_shmcb.c
===================================================================
--- modules/cache/mod_socache_shmcb.c   (revision 1085954)
+++ modules/cache/mod_socache_shmcb.c   (working copy)
@@ -32,12 +32,7 @@
 
 #define SHMCB_MAX_SIZE (64 * 1024 * 1024)
 
-/* Check for definition of DEFAULT_REL_RUNTIMEDIR */
-#ifndef DEFAULT_REL_RUNTIMEDIR
-#define DEFAULT_SHMCB_PREFIX "logs/socache-shmcb-"
-#else
 #define DEFAULT_SHMCB_PREFIX DEFAULT_REL_RUNTIMEDIR "/socache-shmcb-"
-#endif
 
 #define DEFAULT_SHMCB_SUFFIX ".cache"
 
Index: modules/cache/mod_socache_dbm.c
===================================================================
--- modules/cache/mod_socache_dbm.c     (revision 1085954)
+++ modules/cache/mod_socache_dbm.c     (working copy)
@@ -53,12 +53,7 @@
  */
 #define DBM_FILE_MODE ( APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD )
 
-/* Check for definition of DEFAULT_REL_RUNTIMEDIR */
-#ifndef DEFAULT_REL_RUNTIMEDIR
-#define DEFAULT_DBM_PREFIX "logs/socache-dbm-"
-#else
 #define DEFAULT_DBM_PREFIX DEFAULT_REL_RUNTIMEDIR "/socache-dbm-"
-#endif
 
 /* ### this should use apr_dbm_usednames. */
 #if !defined(DBM_FILE_SUFFIX_DIR) && !defined(DBM_FILE_SUFFIX_PAG)
Index: include/ap_config.h
===================================================================
--- include/ap_config.h (revision 1085954)
+++ include/ap_config.h (working copy)
@@ -233,6 +233,8 @@
 #if (!defined(WIN32) && !defined(NETWARE)) || defined(__MINGW32__)
 #include "ap_config_auto.h"
 #include "ap_config_layout.h"
+#else
+#include "os_layout.h" /* hard-coded layout definitions */
 #endif
 #if defined(NETWARE)
 #define AP_NONBLOCK_WHEN_MULTI_LISTEN 1

Reply via email to