You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by ji...@apache.org on 2009/10/13 15:50:28 UTC

svn commit: r824762 - in /apr/apr/branches/1.4.x: build/apr_hints.m4 configure.in include/apr.h.in include/apr_os_override.h include/arch/darwin/ include/arch/darwin/apr_darwin_types.h

Author: jim
Date: Tue Oct 13 13:50:27 2009
New Revision: 824762

URL: http://svn.apache.org/viewvc?rev=824762&view=rev
Log:
More Darwin mojo magic. Use Apple's apr.h edits as a guide
and provide "hooks" to allow for other OS's to override at
app-compile time some values and be safe.

Added:
    apr/apr/branches/1.4.x/include/apr_os_override.h   (with props)
    apr/apr/branches/1.4.x/include/arch/darwin/
    apr/apr/branches/1.4.x/include/arch/darwin/apr_darwin_types.h   (with props)
Modified:
    apr/apr/branches/1.4.x/build/apr_hints.m4
    apr/apr/branches/1.4.x/configure.in
    apr/apr/branches/1.4.x/include/apr.h.in

Modified: apr/apr/branches/1.4.x/build/apr_hints.m4
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/build/apr_hints.m4?rev=824762&r1=824761&r2=824762&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/build/apr_hints.m4 (original)
+++ apr/apr/branches/1.4.x/build/apr_hints.m4 Tue Oct 13 13:50:27 2009
@@ -203,6 +203,9 @@
                 APR_SETIFNULL(ac_cv_func_kqueue, [no]) 
                 APR_SETIFNULL(ac_cv_func_poll, [no]) # See issue 34332
             ;;
+            *-apple-darwin10.*)
+                APR_ADDTO(CPPFLAGS, [-DDARWIN_10])
+            ;;
         esac
 	;;
     *-dec-osf*)

Modified: apr/apr/branches/1.4.x/configure.in
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/configure.in?rev=824762&r1=824761&r2=824762&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/configure.in (original)
+++ apr/apr/branches/1.4.x/configure.in Tue Oct 13 13:50:27 2009
@@ -25,6 +25,12 @@
 sinclude(build/ltversion.m4)
 sinclude(build/lt~obsolete.m4)
 
+dnl Hard-coded top of apr_private.h:
+AH_TOP([
+#ifndef APR_PRIVATE_H
+#define APR_PRIVATE_H
+])
+
 dnl Hard-coded inclusion at the tail end of apr_private.h:
 AH_BOTTOM([
 /* switch this on if we have a BeOS version below BONE */
@@ -34,10 +40,15 @@
 #define BEOS_BONE 1
 #endif
 
+#ifdef DARWIN_10
+#include "../darwin/apr_darwin_types.h"
+#endif
+
 /*
  * Include common private declarations.
  */
 #include "../apr_private_common.h"
+#endif /* APR_PRIVATE_H */
 ])
 
 dnl Save user-defined environment settings for later restoration
@@ -1738,15 +1749,6 @@
     else
         AC_ERROR([could not determine the size of off_t])
     fi
-    # Per OS tuning...
-    case $host in
-    *apple-darwin10.*)
-        # off_t is a long long, but long == long long
-        if test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_long_long"; then
-            off_t_fmt='#define APR_OFF_T_FMT "lld"'
-        fi
-        ;;
-    esac
 else
    # Fallback on int
    off_t_value=apr_int32_t

Modified: apr/apr/branches/1.4.x/include/apr.h.in
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/include/apr.h.in?rev=824762&r1=824761&r2=824762&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/include/apr.h.in (original)
+++ apr/apr/branches/1.4.x/include/apr.h.in Tue Oct 13 13:50:27 2009
@@ -277,8 +277,18 @@
 typedef  @int_value@             apr_int32_t;
 typedef  unsigned @int_value@    apr_uint32_t;
 
+#ifdef DARWIN_10
+#ifdef __LP64__
+typedef  long            apr_int64_t;
+typedef  unsigned long   apr_uint64_t;
+#else
+typedef  long long            apr_int64_t;
+typedef  unsigned long long   apr_uint64_t;
+#endif
+#else
 typedef  @long_value@            apr_int64_t;
 typedef  unsigned @long_value@   apr_uint64_t;
+#endif
 
 typedef  @size_t_value@          apr_size_t;
 typedef  @ssize_t_value@         apr_ssize_t;
@@ -505,6 +515,8 @@
 typedef  int         gid_t;
 #endif
 
+#include "apr_os_override.h"
+
 #ifdef __cplusplus
 }
 #endif

Added: apr/apr/branches/1.4.x/include/apr_os_override.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/include/apr_os_override.h?rev=824762&view=auto
==============================================================================
--- apr/apr/branches/1.4.x/include/apr_os_override.h (added)
+++ apr/apr/branches/1.4.x/include/apr_os_override.h Tue Oct 13 13:50:27 2009
@@ -0,0 +1,70 @@
+/* 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.
+ */
+
+
+#ifndef APR_OS_OVERRIDE_H
+#define APR_OS_OVERRIDE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#ifdef DARWIN_10
+
+#undef APR_HAS_LARGE_FILES
+#undef APR_SIZEOF_VOIDP
+#undef APR_INT64_T_FMT
+#undef APR_UINT64_T_FMT
+#undef APR_UINT64_T_HEX_FMT
+
+#ifdef __LP64__
+ #define APR_HAS_LARGE_FILES  0
+ #define APR_SIZEOF_VOIDP     8
+ #define APR_INT64_T_FMT      "ld"
+ #define APR_UINT64_T_FMT     "lu"
+ #define APR_UINT64_T_HEX_FMT "lx"
+#else
+ #define APR_HAS_LARGE_FILES  1
+ #define APR_SIZEOF_VOIDP     4
+ #define APR_INT64_T_FMT      "lld"
+ #define APR_UINT64_T_FMT     "llu"
+ #define APR_UINT64_T_HEX_FMT "llx"
+#endif
+
+#undef APR_IS_BIGENDIAN
+#ifdef __BIG_ENDIAN__
+ #define APR_IS_BIGENDIAN	1
+#else
+ #define APR_IS_BIGENDIAN	0
+#endif
+
+/*
+ * ./i386/_types.h:typedef long long __int64_t;
+ * ./sys/_types.h:typedef __int64_t	__darwin_off_t;
+ * ./sys/types.h:typedef __darwin_off_t		off_t;
+ * So off_t is always long long
+ */
+#undef APR_OFF_T_FMT
+#define APR_OFF_T_FMT "lld"
+
+#endif /* DARWIN_10 */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* APR_OS_OVERRIDE_H */

Propchange: apr/apr/branches/1.4.x/include/apr_os_override.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: apr/apr/branches/1.4.x/include/arch/darwin/apr_darwin_types.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/include/arch/darwin/apr_darwin_types.h?rev=824762&view=auto
==============================================================================
--- apr/apr/branches/1.4.x/include/arch/darwin/apr_darwin_types.h (added)
+++ apr/apr/branches/1.4.x/include/arch/darwin/apr_darwin_types.h Tue Oct 13 13:50:27 2009
@@ -0,0 +1,77 @@
+/* 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.
+ */
+
+
+#ifndef APR_DARWIN_TYPES_H
+#define APR_DARWIN_TYPES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Darwin 10's default compiler (gcc42) builds for both 64 and
+ * 32 bit architectures unless specifically told not to.
+ * In those cases, we need to override types depending on how
+ * we're being built at compile time
+ */
+#ifdef DARWIN_10
+
+#undef APR_OFF_T_STRFN
+#undef APR_INT64_STRFN
+#undef SIZEOF_LONG
+#undef SIZEOF_SIZE_T
+#undef SIZEOF_SSIZE_T
+#undef SIZEOF_VOIDP
+
+#ifdef __LP64__
+ #define APR_INT64_STRFN strtol
+ #define SIZEOF_LONG    8
+ #define SIZEOF_SIZE_T  8
+ #define SIZEOF_SSIZE_T 8
+ #define SIZEOF_VOIDP   8
+#else
+ #define APR_INT64_STRFN strtoll
+ #define SIZEOF_LONG    4
+ #define SIZEOF_SIZE_T  4
+ #define SIZEOF_SSIZE_T 4
+ #define SIZEOF_VOIDP   4
+#endif
+
+/*
+ * ./i386/_types.h:typedef long long __int64_t;
+ * ./sys/_types.h:typedef __int64_t	__darwin_off_t;
+ * ./sys/types.h:typedef __darwin_off_t		off_t;
+ * So off_t is always long long
+ */
+#undef APR_OFF_T_STRFN
+#define APR_OFF_T_STRFN APR_INT64_STRFN
+ 
+
+#undef SETPGRP_VOID
+#ifdef __DARWIN_UNIX03
+ #define SETPGRP_VOID 1
+#else
+/* #undef SETPGRP_VOID */
+#endif
+ 
+#endif /* DARWIN_10 */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* APR_DARWIN_TYPES_H */

Propchange: apr/apr/branches/1.4.x/include/arch/darwin/apr_darwin_types.h
------------------------------------------------------------------------------
    svn:eol-style = native