apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r824767 - in /apr/apr/trunk: 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
Date Tue, 13 Oct 2009 13:58:20 GMT
Author: jim
Date: Tue Oct 13 13:58:19 2009
New Revision: 824767

URL: http://svn.apache.org/viewvc?rev=824767&view=rev
Log:
More Darwin mojo due to 64 and 32 bit multi-arches. The
deal is we need to install headers that work both when
installed and used for both 32 and 64 bit builds, ie:
at compile time. Uses Apple's own apr.h edits as a guide.

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

Modified: apr/apr/trunk/build/apr_hints.m4
URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/apr_hints.m4?rev=824767&r1=824766&r2=824767&view=diff
==============================================================================
--- apr/apr/trunk/build/apr_hints.m4 (original)
+++ apr/apr/trunk/build/apr_hints.m4 Tue Oct 13 13:58:19 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/trunk/configure.in
URL: http://svn.apache.org/viewvc/apr/apr/trunk/configure.in?rev=824767&r1=824766&r2=824767&view=diff
==============================================================================
--- apr/apr/trunk/configure.in (original)
+++ apr/apr/trunk/configure.in Tue Oct 13 13:58:19 2009
@@ -34,6 +34,12 @@
 sinclude(build/dbd.m4)
 sinclude(build/dso.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 */
@@ -43,10 +49,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

Modified: apr/apr/trunk/include/apr.h.in
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr.h.in?rev=824767&r1=824766&r2=824767&view=diff
==============================================================================
--- apr/apr/trunk/include/apr.h.in (original)
+++ apr/apr/trunk/include/apr.h.in Tue Oct 13 13:58:19 2009
@@ -278,8 +278,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;
@@ -506,6 +516,8 @@
 typedef  int         gid_t;
 #endif
 
+#include "apr_os_override.h"
+
 #ifdef __cplusplus
 }
 #endif

Added: apr/apr/trunk/include/apr_os_override.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr_os_override.h?rev=824767&view=auto
==============================================================================
--- apr/apr/trunk/include/apr_os_override.h (added)
+++ apr/apr/trunk/include/apr_os_override.h Tue Oct 13 13:58:19 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/trunk/include/apr_os_override.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: apr/apr/trunk/include/arch/darwin/apr_darwin_types.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/arch/darwin/apr_darwin_types.h?rev=824767&view=auto
==============================================================================
--- apr/apr/trunk/include/arch/darwin/apr_darwin_types.h (added)
+++ apr/apr/trunk/include/arch/darwin/apr_darwin_types.h Tue Oct 13 13:58:19 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/trunk/include/arch/darwin/apr_darwin_types.h
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message