From a50239f369b0a6e20dd2c7464fce0dd833c8b4ea Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 25 Aug 2013 13:15:13 +0200 Subject: [PATCH] Drop old apr recipes and patches --- dev-libs/apr/apr-1.4.2.recipe | 90 - dev-libs/apr/patches/apr-0.9.x-haiku.diff | 185 -- dev-libs/apr/patches/apr-0.9.x.diff | 2750 -------------------- dev-libs/apr/patches/apr-1.0.1.diff | 2869 --------------------- dev-libs/apr/patches/apr-1.2.x.diff | 23 - dev-libs/apr/patches/apr-1.3.3.patch | 201 -- dev-libs/apr/patches/apr-1.3.8.patch | 219 -- dev-libs/apr/patches/apr-1.3.9.patch | 219 -- dev-libs/apr/patches/apr-1.4.2.patch | 39 - dev-libs/apr/patches/apr-1.4.4.patch | 39 - dev-libs/apr/patches/apr-1.4.5.patch | 50 - 11 files changed, 6684 deletions(-) delete mode 100644 dev-libs/apr/apr-1.4.2.recipe delete mode 100644 dev-libs/apr/patches/apr-0.9.x-haiku.diff delete mode 100644 dev-libs/apr/patches/apr-0.9.x.diff delete mode 100644 dev-libs/apr/patches/apr-1.0.1.diff delete mode 100644 dev-libs/apr/patches/apr-1.2.x.diff delete mode 100644 dev-libs/apr/patches/apr-1.3.3.patch delete mode 100644 dev-libs/apr/patches/apr-1.3.8.patch delete mode 100644 dev-libs/apr/patches/apr-1.3.9.patch delete mode 100644 dev-libs/apr/patches/apr-1.4.2.patch delete mode 100644 dev-libs/apr/patches/apr-1.4.4.patch delete mode 100644 dev-libs/apr/patches/apr-1.4.5.patch diff --git a/dev-libs/apr/apr-1.4.2.recipe b/dev-libs/apr/apr-1.4.2.recipe deleted file mode 100644 index 5d1a67757..000000000 --- a/dev-libs/apr/apr-1.4.2.recipe +++ /dev/null @@ -1,90 +0,0 @@ -SUMMARY="Apache Portable Runtime Library" -HOMEPAGE="http://apr.apache.org/" -SRC_URI="http://archive.apache.org/dist/apr/apr-1.4.2.tar.gz" -CHECKSUM_MD5="fc80cb54f158c2674f9eeb47a1f672cd" -LICENSE="Apache v2" -COPYRIGHT="2010 The Apache Software Foundation." -REVISION="5" -ARCHITECTURES="x86_gcc2 ?x86" - -PROVIDES=" - apr = $portVersion compat >= 1 - lib:libapr = $portVersion compat >= 1 - lib:libapr_1 = $portVersion compat >= 1 - " -REQUIRES=" - haiku >= $haikuVersion - " -BUILD_REQUIRES=" - " -BUILD_PREREQUIRES=" - haiku_devel >= $haikuVersion - cmd:aclocal - cmd:autoconf - cmd:gcc - cmd:ld - cmd:libtoolize - cmd:make - " - -SOURCE_DIR="$portVersionedName" - -BUILD() -{ - libtoolize --force --copy --install - touch libtool.m4 - aclocal -I build - autoconf - ./configure $configureDirArgs - - # TODO: fix this hack (by finding out why top_builddir seems to be unset)! - ln -sfn $sourceDir/libtool /libtool - - make -} - -INSTALL() -{ - make install - - # prepare develop/lib - prepareInstalledDevelLibs libapr-1 - fixPkgconfig -} - -TEST() -{ - make test -} - - -# ----- source package ------------------------------------------------------- - -PROVIDES_source="apr_source = $portVersion compat = $portVersion" - - -DESCRIPTION=" - The mission of the Apache Portable Runtime (APR) project is to create - and maintain software libraries that provide a predictable and consistent - interface to underlying platform-specific implementations. The primary - goal is to provide an API to which software developers may code and be - assured of predictable if not identical behaviour regardless of the - platform on which their software is built, relieving them of the need to - code special-case conditions to work around or take advantage of - platform-specific deficiencies or features. - - To give a brief overview, the primary core subsystems of APR 1.x include - the following: - - - atomic operations - - dynamic Shared Object loading - - file I/O - - locks (mutexes, condition variables, etc) - - memory management (high performance allocators) - - memory-mapped files - - multicast Sockets - - network I/O - - shared memory - - thread and Process management - - various data structures (tables, hashes, priority queues, etc) - " diff --git a/dev-libs/apr/patches/apr-0.9.x-haiku.diff b/dev-libs/apr/patches/apr-0.9.x-haiku.diff deleted file mode 100644 index daf24508f..000000000 --- a/dev-libs/apr/patches/apr-0.9.x-haiku.diff +++ /dev/null @@ -1,185 +0,0 @@ -diff -urN apr-0.9.17-orig/build/apr_hints.m4 apr-0.9.17/build/apr_hints.m4 ---- apr-0.9.17-orig/build/apr_hints.m4 2006-03-16 09:41:51.000000000 +0000 -+++ apr-0.9.17/build/apr_hints.m4 2008-05-13 22:10:51.000000000 +0000 -@@ -390,6 +390,12 @@ - APR_ADDTO(CPPFLAGS, [-DCYGWIN]) - APR_ADDTO(LIBS, [-lcrypt]) - ;; -+ *-haiku*) -+ APR_ADDTO(LIBS, [-lnetwork]) -+ APR_SETIFNULL(apr_lock_method, [USE_POSIXSEM_SERIALIZE]) -+ APR_SETIFNULL(apr_posixsem_is_global, [yes]) -+ APR_SETIFNULL(apr_process_lock_is_global, [yes]) -+ ;; - esac - - fi -diff -urN apr-0.9.17-orig/configure.in apr-0.9.17/configure.in ---- apr-0.9.17-orig/configure.in 2007-11-03 14:18:38.000000000 +0000 -+++ apr-0.9.17/configure.in 2008-05-13 22:10:51.000000000 +0000 -@@ -219,7 +219,7 @@ - dnl otherwise. - - case $host in -- *os390) -+ *os390|*haiku*) - if test "$ac_test_CFLAGS" != set; then - APR_REMOVEFROM(CFLAGS,-g) - fi -@@ -434,6 +434,13 @@ - OSDIR="unix" - eolstr="\\n" - ;; -+ *haiku*) -+ OSDIR="unix" -+ eolstr="\\n" -+ APR_ADDTO(CPPFLAGS,-I/boot/develop/headers/bsd) -+ AC_CHECK_LIB(bsd, getpass) -+ AC_CHECK_LIB(network, socket) -+ ;; - *) - OSDIR="unix" - eolstr="\\n" -@@ -656,6 +663,10 @@ - havemmapzero="0" - havemmapanon="0" - APR_BEGIN_DECISION([anonymous shared memory allocation method]) -+APR_IFALLYES(header:kernel/OS.h func:create_area, -+ [havebeosshm="1" -+ APR_DECIDE(USE_SHMEM_BEOS_ANON, -+ [BeOS areas])]) - APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl - func:shmget func:shmat func:shmdt func:shmctl, - [haveshmgetanon="1" -@@ -671,10 +682,6 @@ - APR_IFALLYES(header:os2.h, - [haveos2shm="1" - APR_DECIDE(USE_SHMEM_OS2_ANON, [OS/2 DosAllocSharedMem()])]) --APR_IFALLYES(header:kernel/OS.h func:create_area, -- [havebeosshm="1" -- APR_DECIDE(USE_SHMEM_BEOS_ANON, -- [BeOS areas])]) - case $host in - *linux* ) - # Linux has problems with MM_SHMT_MMANON even though it reports -@@ -722,6 +729,9 @@ - havebeosarea="0" - haveos2shm="0" - APR_BEGIN_DECISION([namebased memory allocation method]) -+APR_IFALLYES(header:kernel/OS.h func:create_area, -+ [havebeosshm="1" -+ APR_DECIDE(USE_SHMEM_BEOS, [BeOS areas])]) - APR_IFALLYES(header:sys/mman.h func:mmap func:munmap, - [havemmaptmp="1" - APR_DECIDE(USE_SHMEM_MMAP_TMP, -@@ -735,9 +745,6 @@ - func:shmget func:shmat func:shmdt func:shmctl, - [haveshmget="1" - APR_DECIDE(USE_SHMEM_SHMGET, [SysV IPC shmget()])]) --APR_IFALLYES(header:kernel/OS.h func:create_area, -- [havebeosshm="1" -- APR_DECIDE(USE_SHMEM_BEOS, [BeOS areas])]) - APR_IFALLYES(header:os2.h, - [haveos2shm="1" - APR_DECIDE(USE_SHMEM_OS2, [OS/2 DosAllocSharedMem()])]) -@@ -1270,7 +1277,7 @@ - ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' - size_t_fmt='#define APR_SIZE_T_FMT "lu"' - ;; -- *beos*) -+ *beos*|*haiku*) - ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' - size_t_fmt='#define APR_SIZE_T_FMT "ld"' - ;; -diff -urN apr-0.9.17-orig/test/testoc.c apr-0.9.17/test/testoc.c ---- apr-0.9.17-orig/test/testoc.c 2006-09-20 16:04:09.000000000 +0000 -+++ apr-0.9.17/test/testoc.c 2008-05-13 22:10:51.000000000 +0000 -@@ -78,6 +78,9 @@ - rv = apr_procattr_create(&procattr, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - -+ rv = apr_procattr_cmdtype_set(procattr, APR_PROGRAM_ENV); -+ CuAssertIntEquals(tc, APR_SUCCESS, rv); -+ - rv = apr_procattr_io_set(procattr, APR_FULL_BLOCK, APR_NO_PIPE, - APR_NO_PIPE); - CuAssertIntEquals(tc, APR_SUCCESS, rv); -diff -urN apr-0.9.17-orig/test/testpipe.c apr-0.9.17/test/testpipe.c ---- apr-0.9.17-orig/test/testpipe.c 2006-09-20 16:04:09.000000000 +0000 -+++ apr-0.9.17/test/testpipe.c 2008-05-13 22:10:51.000000000 +0000 -@@ -152,6 +152,9 @@ - rv = apr_procattr_create(&procattr, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - -+ rv = apr_procattr_cmdtype_set(procattr, APR_PROGRAM_ENV); -+ CuAssertIntEquals(tc, APR_SUCCESS, rv); -+ - rv = apr_procattr_io_set(procattr, APR_CHILD_BLOCK, APR_CHILD_BLOCK, - APR_CHILD_BLOCK); - CuAssertIntEquals(tc, APR_SUCCESS, rv); -diff -urN apr-0.9.17-orig/test/testpoll.c apr-0.9.17/test/testpoll.c ---- apr-0.9.17-orig/test/testpoll.c 2006-09-20 16:04:09.000000000 +0000 -+++ apr-0.9.17/test/testpoll.c 2008-05-13 22:10:51.000000000 +0000 -@@ -197,6 +197,8 @@ - - send_msg(s, sa, 2, tc); - -+ apr_sleep(apr_time_make(0, 10000)); -+ - rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - check_sockets(pollarray, s, 0, 0, tc); -@@ -212,6 +214,8 @@ - recv_msg(s, 1, p, tc); - send_msg(s, sa, 0, tc); - -+ apr_sleep(apr_time_make(0, 10000)); -+ - rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - check_sockets(pollarray, s, 0, 1, tc); -@@ -318,6 +322,7 @@ - int num; - - send_msg(s, sa, 0, tc); -+ apr_sleep(apr_time_make(0, 10000)); - rv = apr_pollset_poll(pollset, 0, &num, &descs); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 1, num); -@@ -348,6 +353,7 @@ - - send_msg(s, sa, 2, tc); - send_msg(s, sa, 5, tc); -+ apr_sleep(apr_time_make(0, 10000)); - rv = apr_pollset_poll(pollset, 0, &num, &descs); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 2, num); -@@ -380,6 +386,7 @@ - int num; - - send_msg(s, sa, LARGE_NUM_SOCKETS - 1, tc); -+ apr_sleep(apr_time_make(0, 10000)); - rv = apr_pollset_poll(pollset, 0, &num, &descs); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 1, num); -diff -urN apr-0.9.17-orig/test/testproc.c apr-0.9.17/test/testproc.c ---- apr-0.9.17-orig/test/testproc.c 2006-09-20 16:04:09.000000000 +0000 -+++ apr-0.9.17/test/testproc.c 2008-05-13 22:10:51.000000000 +0000 -@@ -53,7 +53,7 @@ - rv = apr_procattr_dir_set(attr, "data"); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - -- rv = apr_procattr_cmdtype_set(attr, APR_PROGRAM); -+ rv = apr_procattr_cmdtype_set(attr, APR_PROGRAM_ENV); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - - args[0] = "proc_child" EXTENSION; -@@ -129,7 +129,7 @@ - CuAssertIntEquals(tc, APR_SUCCESS, rv); - rv = apr_procattr_dir_set(attr, "data"); - CuAssertIntEquals(tc, APR_SUCCESS, rv); -- rv = apr_procattr_cmdtype_set(attr, APR_PROGRAM); -+ rv = apr_procattr_cmdtype_set(attr, APR_PROGRAM_ENV); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - - args[0] = "proc_child"; diff --git a/dev-libs/apr/patches/apr-0.9.x.diff b/dev-libs/apr/patches/apr-0.9.x.diff deleted file mode 100644 index 6bb4257ee..000000000 --- a/dev-libs/apr/patches/apr-0.9.x.diff +++ /dev/null @@ -1,2750 +0,0 @@ -Index: network_io/unix/sockopt.c -=================================================================== ---- network_io/unix/sockopt.c (revision 652904) -+++ network_io/unix/sockopt.c (working copy) -@@ -21,7 +21,7 @@ - static apr_status_t soblock(int sd) - { - /* BeOS uses setsockopt at present for non blocking... */ --#ifndef BEOS -+#if !defined(BEOS) || defined(__HAIKU__) - int fd_flags; - - fd_flags = fcntl(sd, F_GETFL, 0); -@@ -47,7 +47,7 @@ - - static apr_status_t sononblock(int sd) - { --#ifndef BEOS -+#if !defined(BEOS) || defined(__HAIKU__) - int fd_flags; - - fd_flags = fcntl(sd, F_GETFL, 0); -@@ -221,7 +221,7 @@ - * As it can't be turned off we might as well check if they're asking - * for it to be turned on! - */ --#ifdef BEOS -+#if defined(BEOS) && !defined(__HAIKU__) - if (on == 1) - return APR_SUCCESS; - else -Index: network_io/unix/sockaddr.c -=================================================================== ---- network_io/unix/sockaddr.c (revision 652904) -+++ network_io/unix/sockaddr.c (working copy) -@@ -458,7 +458,7 @@ - apr_sockaddr_t *prev_sa; - int curaddr; - #if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ -- defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) -+ defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) // CHECKME - #ifdef GETHOSTBYNAME_R_HOSTENT_DATA - struct hostent_data hd; - #else -@@ -489,7 +489,7 @@ - } - else { - #if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ -- defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) -+ defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) // CHECKME - #if defined(GETHOSTBYNAME_R_HOSTENT_DATA) - /* AIX, HP/UX, D/UX et alia */ - gethostbyname_r(hostname, &hs, &hd); -@@ -560,7 +560,7 @@ - - if ((masked = flags & (APR_IPV4_ADDR_OK | APR_IPV6_ADDR_OK))) { - if (!hostname || -- family != AF_UNSPEC || -+ family != APR_UNSPEC || - masked == (APR_IPV4_ADDR_OK | APR_IPV6_ADDR_OK)) { - return APR_EINVAL; - } -@@ -656,7 +656,7 @@ - return APR_SUCCESS; - #else - #if APR_HAS_THREADS && !defined(GETHOSTBYADDR_IS_THREAD_SAFE) && \ -- defined(HAVE_GETHOSTBYADDR_R) && !defined(BEOS) -+ defined(HAVE_GETHOSTBYADDR_R) && !defined(BEOS) // CHECKME - #ifdef GETHOSTBYNAME_R_HOSTENT_DATA - struct hostent_data hd; - #else -Index: network_io/unix/sockets.c -=================================================================== ---- network_io/unix/sockets.c (revision 652904) -+++ network_io/unix/sockets.c (working copy) -@@ -21,7 +21,7 @@ - #include "apr_portable.h" - #include "apr_arch_inherit.h" - --#if defined(BEOS) && !defined(BEOS_BONE) -+#if defined(BEOS) && !defined(BEOS_BONE) && !defined(__HAIKU__) - #define close closesocket - #endif - -@@ -47,7 +47,7 @@ - apr_sockaddr_vars_set(sock->local_addr, family, 0); - apr_sockaddr_vars_set(sock->remote_addr, family, 0); - sock->netmask = 0; --#if defined(BEOS) && !defined(BEOS_BONE) -+#if defined(BEOS) && !defined(BEOS_BONE) && !defined(__HAIKU__) - /* BeOS pre-BONE has TCP_NODELAY on by default and it can't be - * switched off! - */ -Index: network_io/beos/sendrecv.c -=================================================================== ---- network_io/beos/sendrecv.c (revision 652904) -+++ network_io/beos/sendrecv.c (working copy) -@@ -15,7 +15,7 @@ - */ - - #include "apr_private.h" --#if BEOS_BONE /* BONE uses the unix code - woohoo */ -+#if BEOS_BONE || defined(__HAIKU__) /* BONE uses the unix code - woohoo */ - #include "../unix/sendrecv.c" - #else - #include "apr_arch_networkio.h" -Index: include/arch/unix/apr_arch_file_io.h -=================================================================== ---- include/arch/unix/apr_arch_file_io.h (revision 652904) -+++ include/arch/unix/apr_arch_file_io.h (working copy) -@@ -68,7 +68,9 @@ - #include - #endif - --#if BEOS_BONE -+#if defined(__HAIKU__) -+# include -+#elif BEOS_BONE - # ifndef BONE7 - /* prior to BONE/7 fd_set & select were defined in sys/socket.h */ - # include -Index: include/apr_errno.h -=================================================================== ---- include/apr_errno.h (revision 652904) -+++ include/apr_errno.h (working copy) -@@ -1155,6 +1155,8 @@ - /** operation would block */ - #if !defined(EWOULDBLOCK) || !defined(EAGAIN) - #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) -+#elif BEOS -+#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) - #elif (EWOULDBLOCK == EAGAIN) - #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) - #else -Index: configure.in -=================================================================== ---- configure.in (revision 652904) -+++ configure.in (working copy) -@@ -219,7 +219,7 @@ - dnl otherwise. - - case $host in -- *os390) -+ *os390|*-haiku*) - if test "$ac_test_CFLAGS" != set; then - APR_REMOVEFROM(CFLAGS,-g) - fi -@@ -403,6 +403,14 @@ - ;; - esac - ;; -+ *haiku*) -+ OSDIR="beos" -+ APR_ADDTO(CPPFLAGS,-DBEOS) -+ enable_threads="system_threads" -+ eolstr="\\n" -+ proc_mutex_is_global=1 -+ file_as_socket="1" -+ ;; - *os390) - OSDIR="os390" - eolstr="\\n" -@@ -1274,7 +1282,7 @@ - ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' - size_t_fmt='#define APR_SIZE_T_FMT "lu"' - ;; -- *beos*) -+ *beos*|*haiku*) - ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' - size_t_fmt='#define APR_SIZE_T_FMT "ld"' - ;; -Index: misc/unix/errorcodes.c -=================================================================== ---- misc/unix/errorcodes.c (revision 652904) -+++ misc/unix/errorcodes.c (working copy) -@@ -343,7 +343,7 @@ - * the prototype publically (doh!), so to avoid a build warning - * we add a suitable prototype here. - */ --#if defined(BEOS) -+#if defined(BEOS) && !defined(__HAIKU__) - const char *strerror_r(apr_status_t, char *, apr_size_t); - #endif - -Index: threadproc/beos/proc.c -=================================================================== ---- threadproc/beos/proc.c (revision 652904) -+++ threadproc/beos/proc.c (working copy) -@@ -365,7 +365,12 @@ - } - - APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, -- void *limit) -+#ifdef APR_HAVE_STRUCT_RLIMIT -+ struct rlimit -+#else -+ void -+#endif -+ *limit) - { - return APR_ENOTIMPL; - } -Index: build/config.guess -=================================================================== ---- build/config.guess (revision 652904) -+++ build/config.guess (working copy) -@@ -1,9 +1,10 @@ - #! /bin/sh - # Attempt to guess a canonical system name. - # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, --# 2000, 2001, 2002, 2004 Free Software Foundation, Inc. -+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 -+# Free Software Foundation, Inc. - --timestamp='2002-03-20' -+timestamp='2008-01-08' - - # This file is free software; you can redistribute it and/or modify it - # under the terms of the GNU General Public License as published by -@@ -17,17 +18,14 @@ - # - # You should have received a copy of the GNU General Public License - # along with this program; if not, write to the Free Software --# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -+# 02110-1301, USA. - # - # As a special exception to the GNU General Public License, if you - # distribute this file as part of a program that contains a - # configuration script generated by Autoconf, you may include it under - # the same distribution terms that you use for the rest of that program. - --##################################################################### --# This file contains changes for Apache, clearly marked below. --# These changes are hereby donated to the public domain. --##################################################################### - - # Originally written by Per Bothner . - # Please send patches to . Submit a context -@@ -58,8 +56,8 @@ - GNU config.guess ($timestamp) - - Originally written by Per Bothner. --Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 --Free Software Foundation, Inc. -+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - - This is free software; see the source for copying conditions. There is NO - warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." -@@ -71,11 +69,11 @@ - while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) -- echo "$timestamp" ; exit 0 ;; -+ echo "$timestamp" ; exit ;; - --version | -v ) -- echo "$version" ; exit 0 ;; -+ echo "$version" ; exit ;; - --help | --h* | -h ) -- echo "$usage"; exit 0 ;; -+ echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. -@@ -93,30 +91,42 @@ - exit 1 - fi - -+trap 'exit 1' 1 2 15 - --dummy=dummy-$$ --trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 -+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -+# compiler to aid in system detection is discouraged as it requires -+# temporary files to be created and, as you can see below, it is a -+# headache to deal with in a portable fashion. - --# CC_FOR_BUILD -- compiler used by this script. - # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still - # use `HOST_CC' if defined, but it is deprecated. - --set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in -- ,,) echo "int dummy(){}" > $dummy.c ; -+# Portable tmp directory creation inspired by the Autoconf team. -+ -+set_cc_for_build=' -+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -+: ${TMPDIR=/tmp} ; -+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || -+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || -+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || -+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -+dummy=$tmp/dummy ; -+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -+case $CC_FOR_BUILD,$HOST_CC,$CC in -+ ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do -- ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; -- if test $? = 0 ; then -+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; -- rm -f $dummy.c $dummy.o $dummy.rel ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; --esac' -+esac ; set_cc_for_build= ;' - - # This is needed to find uname on a Pyramid OSx when run in the BSD universe. - # (ghazi@noc.rutgers.edu 1994-08-24) -@@ -147,9 +157,11 @@ - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in -+ armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; -+ sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched -@@ -172,159 +184,128 @@ - ;; - esac - # The OS release -- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` -+ # Debian GNU/NetBSD machines have a different userland, and -+ # thus, need a distinct triplet. However, they do not need -+ # kernel version information, so it can be replaced with a -+ # suitable tag, in the style of linux-gnu. -+ case "${UNAME_VERSION}" in -+ Debian*) -+ release='-gnu' -+ ;; -+ *) -+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` -+ ;; -+ esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" -- exit 0 ;; -- amiga:OpenBSD:*:*) -- echo m68k-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -- arc:OpenBSD:*:*) -- echo mipsel-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -- hp300:OpenBSD:*:*) -- echo m68k-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -- mac68k:OpenBSD:*:*) -- echo m68k-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -- macppc:OpenBSD:*:*) -- echo powerpc-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -- mvme68k:OpenBSD:*:*) -- echo m68k-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -- mvme88k:OpenBSD:*:*) -- echo m88k-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -- mvmeppc:OpenBSD:*:*) -- echo powerpc-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -- pmax:OpenBSD:*:*) -- echo mipsel-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -- sgi:OpenBSD:*:*) -- echo mipseb-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -- sun3:OpenBSD:*:*) -- echo m68k-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -- wgrisc:OpenBSD:*:*) -- echo mipsel-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - *:OpenBSD:*:*) -- echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} -- exit 0 ;; -+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` -+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} -+ exit ;; -+ *:ekkoBSD:*:*) -+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} -+ exit ;; -+ *:SolidBSD:*:*) -+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} -+ exit ;; -+ macppc:MirBSD:*:*) -+ echo powerpc-unknown-mirbsd${UNAME_RELEASE} -+ exit ;; -+ *:MirBSD:*:*) -+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} -+ exit ;; - alpha:OSF1:*:*) -- if test $UNAME_RELEASE = "V4.0"; then -+ case $UNAME_RELEASE in -+ *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` -- fi -+ ;; -+ *5.*) -+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` -+ ;; -+ esac -+ # According to Compaq, /usr/sbin/psrinfo has been available on -+ # OSF/1 and Tru64 systems produced since 1995. I hope that -+ # covers most systems running today. This code pipes the CPU -+ # types through head -n 1, so we only detect the type of CPU 0. -+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` -+ case "$ALPHA_CPU_TYPE" in -+ "EV4 (21064)") -+ UNAME_MACHINE="alpha" ;; -+ "EV4.5 (21064)") -+ UNAME_MACHINE="alpha" ;; -+ "LCA4 (21066/21068)") -+ UNAME_MACHINE="alpha" ;; -+ "EV5 (21164)") -+ UNAME_MACHINE="alphaev5" ;; -+ "EV5.6 (21164A)") -+ UNAME_MACHINE="alphaev56" ;; -+ "EV5.6 (21164PC)") -+ UNAME_MACHINE="alphapca56" ;; -+ "EV5.7 (21164PC)") -+ UNAME_MACHINE="alphapca57" ;; -+ "EV6 (21264)") -+ UNAME_MACHINE="alphaev6" ;; -+ "EV6.7 (21264A)") -+ UNAME_MACHINE="alphaev67" ;; -+ "EV6.8CB (21264C)") -+ UNAME_MACHINE="alphaev68" ;; -+ "EV6.8AL (21264B)") -+ UNAME_MACHINE="alphaev68" ;; -+ "EV6.8CX (21264D)") -+ UNAME_MACHINE="alphaev68" ;; -+ "EV6.9A (21264/EV69A)") -+ UNAME_MACHINE="alphaev69" ;; -+ "EV7 (21364)") -+ UNAME_MACHINE="alphaev7" ;; -+ "EV7.9 (21364A)") -+ UNAME_MACHINE="alphaev79" ;; -+ esac -+ # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. -- cat <$dummy.s -- .data --\$Lformat: -- .byte 37,100,45,37,120,10,0 # "%d-%x\n" -- -- .text -- .globl main -- .align 4 -- .ent main --main: -- .frame \$30,16,\$26,0 -- ldgp \$29,0(\$27) -- .prologue 1 -- .long 0x47e03d80 # implver \$0 -- lda \$2,-1 -- .long 0x47e20c21 # amask \$2,\$1 -- lda \$16,\$Lformat -- mov \$0,\$17 -- not \$1,\$18 -- jsr \$26,printf -- ldgp \$29,0(\$26) -- mov 0,\$16 -- jsr \$26,exit -- .end main --EOF -- eval $set_cc_for_build -- $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null -- if test "$?" = 0 ; then -- case `./$dummy` in -- 0-0) -- UNAME_MACHINE="alpha" -- ;; -- 1-0) -- UNAME_MACHINE="alphaev5" -- ;; -- 1-1) -- UNAME_MACHINE="alphaev56" -- ;; -- 1-101) -- UNAME_MACHINE="alphapca56" -- ;; -- 2-303) -- UNAME_MACHINE="alphaev6" -- ;; -- 2-307) -- UNAME_MACHINE="alphaev67" -- ;; -- 2-1307) -- UNAME_MACHINE="alphaev68" -- ;; -- esac -- fi -- rm -f $dummy.s $dummy -- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` -- exit 0 ;; -+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` -+ exit ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix -- exit 0 ;; -+ exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 -- exit 0 ;; -+ exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 -- exit 0;; -+ exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos -- exit 0 ;; -+ exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos -- exit 0 ;; --######################### --# Apache changes --# --# *:OS/390:*:*) --# echo i370-ibm-openedition --# exit 0 ;; -- *:OS390:*:* | *:OS/390:*:*) -- echo s390-ibm-os390 -- exit 0 ;; -- *:OS400:*:* | *:OS/400:*:*) -- echo as400-ibm-os400 -- exit 0 ;; -- *:OS/2:*:*) -- echo "i386-pc-os2_emx" -- exit 0;; --# --# end Apache changes --######################### -+ exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition -- exit 0 ;; -+ exit ;; -+ *:z/VM:*:*) -+ echo s390-ibm-zvmoe -+ exit ;; -+ *:OS400:*:*) -+ echo powerpc-ibm-os400 -+ exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} -- exit 0;; -+ exit ;; -+ arm:riscos:*:*|arm:RISCOS:*:*) -+ echo arm-unknown-riscos -+ exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp -- exit 0;; -+ exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then -@@ -332,25 +313,32 @@ - else - echo pyramid-pyramid-bsd - fi -- exit 0 ;; -+ exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 -- exit 0 ;; -+ exit ;; -+ DRS?6000:unix:4.0:6*) -+ echo sparc-icl-nx6 -+ exit ;; -+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) -+ case `/usr/bin/uname -p` in -+ sparc) echo sparc-icl-nx7; exit ;; -+ esac ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` -- exit 0 ;; -+ exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` -- exit 0 ;; -- i86pc:SunOS:5.*:*) -+ exit ;; -+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` -- exit 0 ;; -+ exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` -- exit 0 ;; -+ exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) -@@ -359,10 +347,10 @@ - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` -- exit 0 ;; -+ exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 -@@ -374,10 +362,10 @@ - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac -- exit 0 ;; -+ exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor -@@ -388,37 +376,40 @@ - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; -+ m68k:machten:*:*) -+ echo m68k-apple-machten${UNAME_RELEASE} -+ exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 -- exit 0 ;; -+ exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -@@ -442,27 +433,33 @@ - exit (-1); - } - EOF -- $CC_FOR_BUILD $dummy.c -o $dummy \ -- && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ -- && rm -f $dummy.c $dummy && exit 0 -- rm -f $dummy.c $dummy -+ $CC_FOR_BUILD -o $dummy $dummy.c && -+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && -+ SYSTEM_NAME=`$dummy $dummyarg` && -+ { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax -- exit 0 ;; -+ exit ;; -+ Motorola:*:4.3:PL8-*) -+ echo powerpc-harris-powermax -+ exit ;; -+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) -+ echo powerpc-harris-powermax -+ exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix -- exit 0 ;; -+ exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 -- exit 0 ;; -+ exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 -- exit 0 ;; -+ exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 -- exit 0 ;; -+ exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` -@@ -478,29 +475,29 @@ - else - echo i586-dg-dgux${UNAME_RELEASE} - fi -- exit 0 ;; -+ exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 -- exit 0 ;; -+ exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 -- exit 0 ;; -+ exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 -- exit 0 ;; -+ exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd -- exit 0 ;; -+ exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` -- exit 0 ;; -+ exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. -- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id -- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' -+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id -+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix -- exit 0 ;; -+ exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` -@@ -508,7 +505,7 @@ - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} -- exit 0 ;; -+ exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build -@@ -523,16 +520,19 @@ - exit(0); - } - EOF -- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 -- rm -f $dummy.c $dummy -- echo rs6000-ibm-aix3.2.5 -+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` -+ then -+ echo "$SYSTEM_NAME" -+ else -+ echo rs6000-ibm-aix3.2.5 -+ fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi -- exit 0 ;; -- *:AIX:*:[45]) -+ exit ;; -+ *:AIX:*:[456]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 -@@ -545,28 +545,28 @@ - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} -- exit 0 ;; -+ exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix -- exit 0 ;; -+ exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 -- exit 0 ;; -+ exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to -- exit 0 ;; # report: romp-ibm BSD 4.3 -+ exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx -- exit 0 ;; -+ exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 -- exit 0 ;; -+ exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd -- exit 0 ;; -+ exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 -- exit 0 ;; -+ exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in -@@ -622,17 +622,37 @@ - exit (0); - } - EOF -- (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` -- if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi -- rm -f $dummy.c $dummy -+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` -+ test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac -+ if [ ${HP_ARCH} = "hppa2.0w" ] -+ then -+ eval $set_cc_for_build -+ -+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating -+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler -+ # generating 64-bit code. GNU and HP use different nomenclature: -+ # -+ # $ CC_FOR_BUILD=cc ./config.guess -+ # => hppa2.0w-hp-hpux11.23 -+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess -+ # => hppa64-hp-hpux11.23 -+ -+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | -+ grep __LP64__ >/dev/null -+ then -+ HP_ARCH="hppa2.0w" -+ else -+ HP_ARCH="hppa64" -+ fi -+ fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} -- exit 0 ;; -+ exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} -- exit 0 ;; -+ exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -@@ -660,134 +680,192 @@ - exit (0); - } - EOF -- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 -- rm -f $dummy.c $dummy -+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && -+ { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 -- exit 0 ;; -+ exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd -- exit 0 ;; -+ exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd -- exit 0 ;; -+ exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix -- exit 0 ;; -+ exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf -- exit 0 ;; -+ exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf -- exit 0 ;; -+ exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi -- exit 0 ;; -+ exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites -- exit 0 ;; -+ exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd -- exit 0 ;; -+ exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi -- exit 0 ;; -+ exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd -- exit 0 ;; -+ exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd -- exit 0 ;; -+ exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd -- exit 0 ;; -+ exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' -- exit 0 ;; -+ exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' -- exit 0 ;; -+ exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' -- exit 0 ;; -- CRAY*T3D:*:*:*) -- echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' -- exit 0 ;; -+ exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' -- exit 0 ;; -+ exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' -- exit 0 ;; -+ exit ;; -+ *:UNICOS/mp:*:*) -+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' -+ exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" -- exit 0 ;; -+ exit ;; -+ 5000:UNIX_System_V:4.*:*) -+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` -+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` -+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" -+ exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - *:FreeBSD:*:*) -- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` -- exit 0 ;; -+ case ${UNAME_MACHINE} in -+ pc98) -+ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; -+ amd64) -+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; -+ *) -+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; -+ esac -+ exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin -- exit 0 ;; -- i*:MINGW*:*) -+ exit ;; -+ *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 -- exit 0 ;; -+ exit ;; -+ i*:windows32*:*) -+ # uname -m includes "-pc" on this system. -+ echo ${UNAME_MACHINE}-mingw32 -+ exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 -- exit 0 ;; -- x86:Interix*:3*) -- echo i386-pc-interix3 -- exit 0 ;; -+ exit ;; -+ *:Interix*:[3456]*) -+ case ${UNAME_MACHINE} in -+ x86) -+ echo i586-pc-interix${UNAME_RELEASE} -+ exit ;; -+ EM64T | authenticamd) -+ echo x86_64-unknown-interix${UNAME_RELEASE} -+ exit ;; -+ IA64) -+ echo ia64-unknown-interix${UNAME_RELEASE} -+ exit ;; -+ esac ;; -+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) -+ echo i${UNAME_MACHINE}-pc-mks -+ exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? -- echo i386-pc-interix -- exit 0 ;; -+ echo i586-pc-interix -+ exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin -- exit 0 ;; -+ exit ;; -+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) -+ echo x86_64-unknown-cygwin -+ exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin -- exit 0 ;; -+ exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` -- exit 0 ;; -+ exit ;; - *:GNU:*:*) -+ # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` -- exit 0 ;; -+ exit ;; -+ *:GNU/*:*:*) -+ # other systems with GNU libc and userland -+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu -+ exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix -- exit 0 ;; -+ exit ;; - arm*:Linux:*:*) -+ eval $set_cc_for_build -+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ -+ | grep -q __ARM_EABI__ -+ then -+ echo ${UNAME_MACHINE}-unknown-linux-gnu -+ else -+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi -+ fi -+ exit ;; -+ avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu -- exit 0 ;; -+ exit ;; -+ cris:Linux:*:*) -+ echo cris-axis-linux-gnu -+ exit ;; -+ crisv32:Linux:*:*) -+ echo crisv32-axis-linux-gnu -+ exit ;; -+ frv:Linux:*:*) -+ echo frv-unknown-linux-gnu -+ exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu -- exit 0 ;; -+ exit ;; -+ m32r*:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-gnu -+ exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu -- exit 0 ;; -+ exit ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -@@ -804,16 +882,45 @@ - #endif - #endif - EOF -- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` -- rm -f $dummy.c -- test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 -+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' -+ /^CPU/{ -+ s: ::g -+ p -+ }'`" -+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; -+ mips64:Linux:*:*) -+ eval $set_cc_for_build -+ sed 's/^ //' << EOF >$dummy.c -+ #undef CPU -+ #undef mips64 -+ #undef mips64el -+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) -+ CPU=mips64el -+ #else -+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) -+ CPU=mips64 -+ #else -+ CPU= -+ #endif -+ #endif -+EOF -+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' -+ /^CPU/{ -+ s: ::g -+ p -+ }'`" -+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } -+ ;; -+ or32:Linux:*:*) -+ echo or32-unknown-linux-gnu -+ exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu -- exit 0 ;; -+ exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu -- exit 0 ;; -+ exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; -@@ -827,7 +934,7 @@ - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} -- exit 0 ;; -+ exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in -@@ -835,22 +942,31 @@ - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac -- exit 0 ;; -+ exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu -- exit 0 ;; -+ exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux -- exit 0 ;; -+ exit ;; -+ sh64*:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-gnu -+ exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu -- exit 0 ;; -+ exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu -- exit 0 ;; -+ exit ;; -+ vax:Linux:*:*) -+ echo ${UNAME_MACHINE}-dec-linux-gnu -+ exit ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu -- exit 0 ;; -+ exit ;; -+ xtensa*:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-gnu -+ exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent -@@ -868,15 +984,15 @@ - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" -- exit 0 ;; -+ exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" -- exit 0 ;; -+ exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" -- exit 0 ;; -+ exit ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build -@@ -893,24 +1009,33 @@ - LIBC=gnulibc1 - # endif - #else -- #ifdef __INTEL_COMPILER -+ #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif -+ #ifdef __dietlibc__ -+ LIBC=dietlibc -+ #endif - EOF -- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` -- rm -f $dummy.c -- test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 -- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 -+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' -+ /^LIBC/{ -+ s: ::g -+ p -+ }'`" -+ test x"${LIBC}" != x && { -+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}" -+ exit -+ } -+ test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 -- exit 0 ;; -+ exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... -@@ -918,7 +1043,27 @@ - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} -- exit 0 ;; -+ exit ;; -+ i*86:OS/2:*:*) -+ # If we were able to find `uname', then EMX Unix compatibility -+ # is probably installed. -+ echo ${UNAME_MACHINE}-pc-os2-emx -+ exit ;; -+ i*86:XTS-300:*:STOP) -+ echo ${UNAME_MACHINE}-unknown-stop -+ exit ;; -+ i*86:atheos:*:*) -+ echo ${UNAME_MACHINE}-unknown-atheos -+ exit ;; -+ i*86:syllable:*:*) -+ echo ${UNAME_MACHINE}-pc-syllable -+ exit ;; -+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) -+ echo i386-unknown-lynxos${UNAME_RELEASE} -+ exit ;; -+ i*86:*DOS:*:*) -+ echo ${UNAME_MACHINE}-pc-msdosdjgpp -+ exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then -@@ -926,99 +1071,100 @@ - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi -- exit 0 ;; -- i*86:*:5:[78]*) -+ exit ;; -+ i*86:*:5:[678]*) -+ # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} -- exit 0 ;; -+ exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then -- UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` -- (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 -- (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ -+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` -+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 -+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 -- (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ -+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 -- (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ -+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi -- exit 0 ;; -- i*86:*DOS:*:*) -- echo ${UNAME_MACHINE}-pc-msdosdjgpp -- exit 0 ;; -+ exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp -- exit 0 ;; -+ exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 -- exit 0 ;; -+ exit ;; - paragon:*:*:*) - echo i860-intel-osf1 -- exit 0 ;; -+ exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi -- exit 0 ;; -+ exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv -- exit 0 ;; -- M68*:*:R3V[567]*:*) -- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; -- 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) -+ exit ;; -+ mc68k:UNIX:SYSTEM5:3.51m) -+ echo m68k-convergent-sysv -+ exit ;; -+ M680?0:D-NIX:5.3:*) -+ echo m68k-diab-dnix -+ exit ;; -+ M68*:*:R3V[5678]*:*) -+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; -+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ -- && echo i486-ncr-sysv4.3${OS_REL} && exit 0 -+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ -- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; -+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ -- && echo i486-ncr-sysv4 && exit 0 ;; -+ && { echo i486-ncr-sysv4; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 -- exit 0 ;; -- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) -- echo i386-unknown-lynxos${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 -- exit 0 ;; -+ exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 -- exit 0 ;; -+ exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` -@@ -1026,61 +1172,87 @@ - else - echo ns32k-sni-sysv - fi -- exit 0 ;; -+ exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 -- exit 0 ;; -+ exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 -- exit 0 ;; -+ exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 -- exit 0 ;; -+ exit ;; -+ i*86:VOS:*:*) -+ # From Paul.Green@stratus.com. -+ echo ${UNAME_MACHINE}-stratus-vos -+ exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos -- exit 0 ;; -+ exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 -- exit 0 ;; -+ exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi -- exit 0 ;; -+ exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos -- exit 0 ;; -+ exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos -- exit 0 ;; -+ exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos -- exit 0 ;; -+ exit ;; -+ BeMac:Haiku:*:*) -+ echo powerpc-apple-haiku -+ exit ;; -+ BePC:Haiku:*:*) -+ echo i586-pc-haiku -+ exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; -+ SX-6:SUPER-UX:*:*) -+ echo sx6-nec-superux${UNAME_RELEASE} -+ exit ;; -+ SX-7:SUPER-UX:*:*) -+ echo sx7-nec-superux${UNAME_RELEASE} -+ exit ;; -+ SX-8:SUPER-UX:*:*) -+ echo sx8-nec-superux${UNAME_RELEASE} -+ exit ;; -+ SX-8R:SUPER-UX:*:*) -+ echo sx8r-nec-superux${UNAME_RELEASE} -+ exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - *:Darwin:*:*) -- echo `uname -p`-apple-darwin${UNAME_RELEASE} -- exit 0 ;; -+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown -+ case $UNAME_PROCESSOR in -+ unknown) UNAME_PROCESSOR=powerpc ;; -+ esac -+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} -+ exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then -@@ -1088,22 +1260,25 @@ - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - *:QNX:*:4*) - echo i386-pc-qnx -- exit 0 ;; -- NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) -+ exit ;; -+ NSE-?:NONSTOP_KERNEL:*:*) -+ echo nse-tandem-nsk${UNAME_RELEASE} -+ exit ;; -+ NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux -- exit 0 ;; -+ exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv -- exit 0 ;; -+ exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} -- exit 0 ;; -+ exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 -@@ -1114,39 +1289,47 @@ - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 -- exit 0 ;; -- i*86:OS/2:*:*) -- # If we were able to find `uname', then EMX Unix compatibility -- # is probably installed. -- echo ${UNAME_MACHINE}-pc-os2-emx -- exit 0 ;; -+ exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 -- exit 0 ;; -+ exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex -- exit 0 ;; -+ exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 -- exit 0 ;; -+ exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 -- exit 0 ;; -+ exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 -- exit 0 ;; -+ exit ;; - *:ITS:*:*) - echo pdp10-unknown-its -- exit 0 ;; -+ exit ;; -+ SEI:*:*:SEIUX) -+ echo mips-sei-seiux${UNAME_RELEASE} -+ exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` -- exit 0 ;; -- i*86:XTS-300:*:STOP) -- echo ${UNAME_MACHINE}-unknown-stop -- exit 0 ;; -- i*86:atheos:*:*) -- echo ${UNAME_MACHINE}-unknown-atheos -- exit 0 ;; -+ exit ;; -+ *:*VMS:*:*) -+ UNAME_MACHINE=`(uname -p) 2>/dev/null` -+ case "${UNAME_MACHINE}" in -+ A*) echo alpha-dec-vms ; exit ;; -+ I*) echo ia64-dec-vms ; exit ;; -+ V*) echo vax-dec-vms ; exit ;; -+ esac ;; -+ *:XENIX:*:SysV) -+ echo i386-pc-xenix -+ exit ;; -+ i*86:skyos:*:*) -+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' -+ exit ;; -+ i*86:rdos:*:*) -+ echo ${UNAME_MACHINE}-pc-rdos -+ exit ;; - esac - - #echo '(No uname command or uname output not recognized.)' 1>&2 -@@ -1178,7 +1361,7 @@ - #endif - - #if defined (__arm) && defined (__acorn) && defined (__unix) -- printf ("arm-acorn-riscix"); exit (0); -+ printf ("arm-acorn-riscix\n"); exit (0); - #endif - - #if defined (hp300) && !defined (hpux) -@@ -1267,12 +1450,12 @@ - } - EOF - --$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 --rm -f $dummy.c $dummy -+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && -+ { echo "$SYSTEM_NAME"; exit; } - - # Apollos put the system type in the environment. - --test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } -+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - - # Convex versions that predate uname can use getsysinfo(1) - -@@ -1281,22 +1464,22 @@ - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd -- exit 0 ;; -+ exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi -- exit 0 ;; -+ exit ;; - c34*) - echo c34-convex-bsd -- exit 0 ;; -+ exit ;; - c38*) - echo c38-convex-bsd -- exit 0 ;; -+ exit ;; - c4*) - echo c4-convex-bsd -- exit 0 ;; -+ exit ;; - esac - fi - -@@ -1307,7 +1490,9 @@ - the operating system you are using. It is advised that you - download the most up to date version of the config scripts from - -- ftp://ftp.gnu.org/pub/gnu/config/ -+ http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess -+and -+ http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub - - If the version you run ($0) is already up to date, please - send the following data and any information you think might be -Index: build/config.sub -=================================================================== ---- build/config.sub (revision 652904) -+++ build/config.sub (working copy) -@@ -1,9 +1,10 @@ - #! /bin/sh - # Configuration validation subroutine script. - # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, --# 2000, 2001, 2002, 2004 Free Software Foundation, Inc. -+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 -+# Free Software Foundation, Inc. - --timestamp='2002-03-07' -+timestamp='2008-01-16' - - # This file is (in principle) common to ALL GNU software. - # The presence of a machine in this file suggests that SOME GNU software -@@ -21,18 +22,14 @@ - # - # You should have received a copy of the GNU General Public License - # along with this program; if not, write to the Free Software --# Foundation, Inc., 59 Temple Place - Suite 330, --# Boston, MA 02111-1307, USA. -- -+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -+# 02110-1301, USA. -+# - # As a special exception to the GNU General Public License, if you - # distribute this file as part of a program that contains a - # configuration script generated by Autoconf, you may include it under - # the same distribution terms that you use for the rest of that program. - --##################################################################### --# This file contains changes for Apache, clearly marked below. --# These changes are hereby donated to the public domain. --##################################################################### - - # Please send patches to . Submit a context - # diff and a properly formatted ChangeLog entry. -@@ -75,8 +72,8 @@ - version="\ - GNU config.sub ($timestamp) - --Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 --Free Software Foundation, Inc. -+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - - This is free software; see the source for copying conditions. There is NO - warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." -@@ -88,11 +85,11 @@ - while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) -- echo "$timestamp" ; exit 0 ;; -+ echo "$timestamp" ; exit ;; - --version | -v ) -- echo "$version" ; exit 0 ;; -+ echo "$version" ; exit ;; - --help | --h* | -h ) -- echo "$usage"; exit 0 ;; -+ echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. -@@ -104,7 +101,7 @@ - *local*) - # First pass through any local machine types. - echo $1 -- exit 0;; -+ exit ;; - - * ) - break ;; -@@ -123,28 +120,12 @@ - # Here we must recognize all the valid KERNEL-OS combinations. - maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` - case $maybe_os in -- nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) -+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ -+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ -+ storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; --######################## --# changes for Apache --# -- tpf | os390 | vmcms) -- os=-$maybe_os -- basic_machine=s390; -- ;; -- os400) -- os=-$maybe_os -- basic_machine=as400; -- ;; -- mvs) -- os=-mvs -- basic_machine=i370; -- ;; --# --# end Apache changes --######################## - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] -@@ -167,7 +148,7 @@ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -- -apple | -axis) -+ -apple | -axis | -knuth | -cray) - os= - basic_machine=$1 - ;; -@@ -192,6 +173,10 @@ - -hiux*) - os=-hiuxwe2 - ;; -+ -sco6) -+ os=-sco5v6 -+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` -+ ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` -@@ -208,6 +193,10 @@ - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; -+ -sco5v6*) -+ # Don't forget version if it is 3.2v4 or newer. -+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` -+ ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` -@@ -251,31 +240,52 @@ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ -- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ -+ | am33_2.0 \ -+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ -+ | bfin \ - | c4x | clipper \ -- | d10v | d30v | dsp16xx \ -- | fr30 \ -+ | d10v | d30v | dlx | dsp16xx \ -+ | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ -- | m32r | m68000 | m68k | m88k | mcore \ -- | mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ -- | mips64vr4100 | mips64vr4100el | mips64vr4300 \ -- | mips64vr4300el | mips64vr5000 | mips64vr5000el \ -- | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ -- | mipsisa32 | mipsisa64 \ -+ | ip2k | iq2000 \ -+ | m32c | m32r | m32rle | m68000 | m68k | m88k \ -+ | maxq | mb | microblaze | mcore | mep \ -+ | mips | mipsbe | mipseb | mipsel | mipsle \ -+ | mips16 \ -+ | mips64 | mips64el \ -+ | mips64vr | mips64vrel \ -+ | mips64orion | mips64orionel \ -+ | mips64vr4100 | mips64vr4100el \ -+ | mips64vr4300 | mips64vr4300el \ -+ | mips64vr5000 | mips64vr5000el \ -+ | mips64vr5900 | mips64vr5900el \ -+ | mipsisa32 | mipsisa32el \ -+ | mipsisa32r2 | mipsisa32r2el \ -+ | mipsisa64 | mipsisa64el \ -+ | mipsisa64r2 | mipsisa64r2el \ -+ | mipsisa64sb1 | mipsisa64sb1el \ -+ | mipsisa64sr71k | mipsisa64sr71kel \ -+ | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ -+ | mt \ -+ | msp430 \ -+ | nios | nios2 \ - | ns16k | ns32k \ -- | openrisc | or32 \ -+ | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ -- | sh | sh[34] | sh[34]eb | shbe | shle | sh64 \ -- | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ -- | strongarm \ -- | tahoe | thumb | tic80 | tron \ -+ | score \ -+ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ -+ | sh64 | sh64le \ -+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ -+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ -+ | spu | strongarm \ -+ | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ - | we32k \ -- | x86 | xscale | xstormy16 | xtensa \ -+ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; -@@ -286,6 +296,9 @@ - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; -+ ms1) -+ basic_machine=mt-unknown -+ ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and -@@ -304,41 +317,66 @@ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ -- | arm-* | armbe-* | armle-* | armv*-* \ -- | avr-* \ -- | bs2000-* \ -- | c[123]* | c30-* | [cjt]90-* | c54x-* \ -- | clipper-* | cydra-* \ -- | d10v-* | d30v-* \ -+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ -+ | avr-* | avr32-* \ -+ | bfin-* | bs2000-* \ -+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ -+ | clipper-* | craynv-* | cydra-* \ -+ | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ -- | f30[01]-* | f700-* | fr30-* | fx80-* \ -+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ -- | m32r-* \ -+ | ip2k-* | iq2000-* \ -+ | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ -- | m88110-* | m88k-* | mcore-* \ -- | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ -- | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ -- | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ -- | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ -+ | m88110-* | m88k-* | maxq-* | mcore-* \ -+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ -+ | mips16-* \ -+ | mips64-* | mips64el-* \ -+ | mips64vr-* | mips64vrel-* \ -+ | mips64orion-* | mips64orionel-* \ -+ | mips64vr4100-* | mips64vr4100el-* \ -+ | mips64vr4300-* | mips64vr4300el-* \ -+ | mips64vr5000-* | mips64vr5000el-* \ -+ | mips64vr5900-* | mips64vr5900el-* \ -+ | mipsisa32-* | mipsisa32el-* \ -+ | mipsisa32r2-* | mipsisa32r2el-* \ -+ | mipsisa64-* | mipsisa64el-* \ -+ | mipsisa64r2-* | mipsisa64r2el-* \ -+ | mipsisa64sb1-* | mipsisa64sb1el-* \ -+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ -+ | mipstx39-* | mipstx39el-* \ -+ | mmix-* \ -+ | mt-* \ -+ | msp430-* \ -+ | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ -- | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \ -- | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ -- | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ -- | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ -+ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ -+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ -+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ -+ | sparclite-* \ -+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ -+ | tahoe-* | thumb-* \ -+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ -+ | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ -- | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ -- | xtensa-* \ -+ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ -+ | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-*) - ;; -+ # Recognize the basic CPU types without company name, with glob match. -+ xtensa*) -+ basic_machine=$basic_machine-unknown -+ ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) -@@ -355,6 +393,9 @@ - basic_machine=a29k-amd - os=-udi - ;; -+ abacus) -+ basic_machine=abacus-unknown -+ ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout -@@ -406,6 +447,14 @@ - basic_machine=ns32k-sequent - os=-dynix - ;; -+ blackfin) -+ basic_machine=bfin-unknown -+ os=-linux -+ ;; -+ blackfin-*) -+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` -+ os=-linux -+ ;; - c90) - basic_machine=c90-cray - os=-unicos -@@ -434,12 +483,27 @@ - basic_machine=j90-cray - os=-unicos - ;; -+ craynv) -+ basic_machine=craynv-cray -+ os=-unicosmp -+ ;; -+ cr16) -+ basic_machine=cr16-unknown -+ os=-elf -+ ;; - crds | unos) - basic_machine=m68k-crds - ;; -+ crisv32 | crisv32-* | etraxfs*) -+ basic_machine=crisv32-axis -+ ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; -+ crx) -+ basic_machine=crx-unknown -+ os=-elf -+ ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; -@@ -462,6 +526,10 @@ - basic_machine=m88k-motorola - os=-sysv3 - ;; -+ djgpp) -+ basic_machine=i586-pc -+ os=-msdosdjgpp -+ ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx -@@ -612,6 +680,14 @@ - basic_machine=m68k-isi - os=-sysv - ;; -+ m68knommu) -+ basic_machine=m68k-unknown -+ os=-linux -+ ;; -+ m68knommu-*) -+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` -+ os=-linux -+ ;; - m88k-omron*) - basic_machine=m88k-omron - ;; -@@ -627,6 +703,10 @@ - basic_machine=i386-pc - os=-mingw32 - ;; -+ mingw32ce) -+ basic_machine=arm-unknown -+ os=-mingw32ce -+ ;; - miniframe) - basic_machine=m68000-convergent - ;; -@@ -640,10 +720,6 @@ - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; -- mmix*) -- basic_machine=mmix-knuth -- os=-mmixware -- ;; - monitor) - basic_machine=m68k-rom68k - os=-coff -@@ -656,6 +732,9 @@ - basic_machine=i386-pc - os=-msdos - ;; -+ ms1-*) -+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` -+ ;; - mvs) - basic_machine=i370-ibm - os=-mvs -@@ -731,10 +810,13 @@ - basic_machine=hppa1.1-oki - os=-proelf - ;; -- or32 | or32-*) -+ openrisc | openrisc-*) - basic_machine=or32-unknown -- os=-coff - ;; -+ os400) -+ basic_machine=powerpc-ibm -+ os=-os400 -+ ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose -@@ -751,55 +833,75 @@ - basic_machine=i860-intel - os=-osf - ;; -+ parisc) -+ basic_machine=hppa-unknown -+ os=-linux -+ ;; -+ parisc-*) -+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` -+ os=-linux -+ ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; -- pc532 | pc532-*) -+ pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; -+ pc98) -+ basic_machine=i386-pc -+ ;; -+ pc98-*) -+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` -+ ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; -- pentiumpro | p6 | 6x86 | athlon) -+ pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; -- pentiumii | pentium2) -+ pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; -+ pentium4) -+ basic_machine=i786-pc -+ ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; -- pentiumii-* | pentium2-*) -+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; -+ pentium4-*) -+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` -+ ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown -- ;; -+ ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown -- ;; -+ ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown -- ;; -+ ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown -- ;; -+ ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; -@@ -810,6 +912,10 @@ - basic_machine=i586-unknown - os=-pw32 - ;; -+ rdos) -+ basic_machine=i386-pc -+ os=-rdos -+ ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff -@@ -830,15 +936,20 @@ - basic_machine=a29k-amd - os=-udi - ;; --######################## --# changes for Apache --# -- as400*) -- basic_machine=as400-ibm -+ sb1) -+ basic_machine=mipsisa64sb1-unknown - ;; --# --# end Apache changes --######################## -+ sb1el) -+ basic_machine=mipsisa64sb1el-unknown -+ ;; -+ sde) -+ basic_machine=mipsisa32-sde -+ os=-elf -+ ;; -+ sei) -+ basic_machine=mips-sei -+ os=-seiux -+ ;; - sequent) - basic_machine=i386-sequent - ;; -@@ -846,6 +957,12 @@ - basic_machine=sh-hitachi - os=-hms - ;; -+ sh5el) -+ basic_machine=sh5le-unknown -+ ;; -+ sh64) -+ basic_machine=sh64-unknown -+ ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks -@@ -904,7 +1021,7 @@ - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; -- sv1) -+ sv1) - basic_machine=sv1-cray - os=-unicos - ;; -@@ -912,10 +1029,6 @@ - basic_machine=i386-sequent - os=-dynix - ;; -- t3d) -- basic_machine=alpha-cray -- os=-unicos -- ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos -@@ -928,6 +1041,18 @@ - basic_machine=tic54x-unknown - os=-coff - ;; -+ tic55x | c55x*) -+ basic_machine=tic55x-unknown -+ os=-coff -+ ;; -+ tic6x | c6x*) -+ basic_machine=tic6x-unknown -+ os=-coff -+ ;; -+ tile*) -+ basic_machine=tile-unknown -+ os=-linux-gnu -+ ;; - tx39) - basic_machine=mipstx39-unknown - ;; -@@ -941,6 +1066,10 @@ - tower | tower-32) - basic_machine=m68k-ncr - ;; -+ tpf) -+ basic_machine=s390x-ibm -+ os=-tpf -+ ;; - udi29k) - basic_machine=a29k-amd - os=-udi -@@ -962,8 +1091,8 @@ - os=-vms - ;; - vpp*|vx|vx-*) -- basic_machine=f301-fujitsu -- ;; -+ basic_machine=f301-fujitsu -+ ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks -@@ -984,11 +1113,11 @@ - basic_machine=hppa1.1-winbond - os=-proelf - ;; -- windows32) -- basic_machine=i386-pc -- os=-windows32-msvcrt -+ xbox) -+ basic_machine=i686-pc -+ os=-mingw32 - ;; -- xps | xps100) -+ xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) -@@ -1018,6 +1147,9 @@ - romp) - basic_machine=romp-ibm - ;; -+ mmix) -+ basic_machine=mmix-knuth -+ ;; - rs6000) - basic_machine=rs6000-ibm - ;; -@@ -1034,16 +1166,13 @@ - we32k) - basic_machine=we32k-att - ;; -- sh3 | sh4 | sh3eb | sh4eb) -+ sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; -- sh64) -- basic_machine=sh64-unknown -- ;; -- sparc | sparcv9 | sparcv9b) -+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; -- cydra) -+ cydra) - basic_machine=cydra-cydrome - ;; - orion) -@@ -1058,10 +1187,6 @@ - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; -- c4x*) -- basic_machine=c4x-none -- os=-coff -- ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; -@@ -1106,14 +1231,6 @@ - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; --######################## --# changes for Apache --# -- -os2_emx | -tpf* | -os390* | -vmcms* | -os400* ) -- ;; --# --# end Apache changes --######################## - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. -@@ -1125,18 +1242,23 @@ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ -- | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ -- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ -+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ -+ | -openbsd* | -solidbsd* \ -+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ -+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ -- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ -- | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ -+ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ -+ | -uxpv* | -beos* | -mpeix* | -udk* \ -+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ -- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -dragonfly*) -+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ -+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ -+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) -@@ -1148,16 +1270,21 @@ - ;; - esac - ;; -+ -nto-qnx*) -+ ;; - -nto*) -- os=-nto-qnx -+ os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ -- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ -+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; -+ -linux-dietlibc) -+ os=-linux-dietlibc -+ ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; -@@ -1170,6 +1297,9 @@ - -opened*) - os=-openedition - ;; -+ -os400*) -+ os=-os400 -+ ;; - -wince*) - os=-wince - ;; -@@ -1191,6 +1321,9 @@ - -atheos*) - os=-atheos - ;; -+ -syllable*) -+ os=-syllable -+ ;; - -386bsd) - os=-bsd - ;; -@@ -1201,7 +1334,7 @@ - os=-rtmk-nova - ;; - -ns2 ) -- os=-nextstep2 -+ os=-nextstep2 - ;; - -nsk*) - os=-nsk -@@ -1213,6 +1346,9 @@ - -sinix*) - os=-sysv4 - ;; -+ -tpf*) -+ os=-tpf -+ ;; - -triton*) - os=-sysv3 - ;; -@@ -1240,9 +1376,18 @@ - -xenix) - os=-xenix - ;; -- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) -- os=-mint -+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) -+ os=-mint - ;; -+ -aros*) -+ os=-aros -+ ;; -+ -kaos*) -+ os=-kaos -+ ;; -+ -zvmoe) -+ os=-zvmoe -+ ;; - -none) - ;; - *) -@@ -1265,6 +1410,12 @@ - # system, and we'll never get to this point. - - case $basic_machine in -+ score-*) -+ os=-elf -+ ;; -+ spu-*) -+ os=-elf -+ ;; - *-acorn) - os=-riscix1.2 - ;; -@@ -1274,11 +1425,14 @@ - arm*-semi) - os=-aout - ;; -+ c4x-* | tic4x-*) -+ os=-coff -+ ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; -- pdp11-*) -+ pdp11-*) - os=-none - ;; - *-dec | vax-*) -@@ -1299,6 +1453,9 @@ - m68*-cisco) - os=-aout - ;; -+ mep-*) -+ os=-elf -+ ;; - mips*-cisco) - os=-elf - ;; -@@ -1317,33 +1474,15 @@ - *-be) - os=-beos - ;; --######################## --# changes for Apache --# --# *-ibm) --# os=-aix --# ;; --# -+ *-haiku) -+ os=-haiku -+ ;; - *-ibm) -- case $basic_machine in -- s390*) -- os=-os390; -- ;; -- i370*) -- os=-mvs; -- ;; -- as400*) -- os=-os400; -- ;; -- *) -- os=-aix -- ;; -- esac -- ;; --# --# end Apache changes --######################## -- -+ os=-aix -+ ;; -+ *-knuth) -+ os=-mmixware -+ ;; - *-wec) - os=-proelf - ;; -@@ -1395,19 +1534,19 @@ - *-next) - os=-nextstep3 - ;; -- *-gould) -+ *-gould) - os=-sysv - ;; -- *-highlevel) -+ *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; -- *-sgi) -+ *-sgi) - os=-irix - ;; -- *-siemens) -+ *-siemens) - os=-sysv4 - ;; - *-masscomp) -@@ -1476,10 +1615,16 @@ - -mvs* | -opened*) - vendor=ibm - ;; -+ -os400*) -+ vendor=ibm -+ ;; - -ptx*) - vendor=sequent - ;; -- -vxsim* | -vxworks*) -+ -tpf*) -+ vendor=ibm -+ ;; -+ -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) -@@ -1503,7 +1648,7 @@ - esac - - echo $basic_machine$os --exit 0 -+exit - - # Local variables: - # eval: (add-hook 'write-file-hooks 'time-stamp) -Index: build/apr_hints.m4 -=================================================================== ---- build/apr_hints.m4 (revision 652904) -+++ build/apr_hints.m4 (working copy) -@@ -358,6 +358,11 @@ - esac - APR_ADDTO(CPPFLAGS, [-DSIGPROCMASK_SETS_THREAD_MASK -DAP_AUTH_DBM_USE_APR]) - ;; -+ *-haiku*) -+ APR_ADDTO(CPPFLAGS, [-DBEOS]) -+ APR_SETIFNULL(apr_process_lock_is_global, [yes]) -+ APR_ADDTO(LIBS, [-lnetwork]) -+ ;; - 4850-*.*) - APR_ADDTO(CPPFLAGS, [-DSVR4 -DMPRAS]) - APR_ADDTO(LIBS, [-lc -L/usr/ucblib -lucb]) -Index: build/apr_network.m4 -=================================================================== ---- build/apr_network.m4 (revision 652904) -+++ build/apr_network.m4 (working copy) -@@ -277,7 +277,7 @@ - } - memset(&sa, 0, sizeof sa); - sa.sin_family = AF_INET; --#ifdef BEOS -+#if defined BEOS && !defined __HAIKU__ - sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - #endif - /* leave port 0 to get ephemeral */ -@@ -307,7 +307,7 @@ - memset(&sa, 0, sizeof sa); - sa.sin_family = AF_INET; - sa.sin_port = listen_port; --#ifdef BEOS -+#if defined BEOS && !defined __HAIKU__ - sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - #endif - /* leave sin_addr all zeros to use loopback */ -@@ -386,7 +386,7 @@ - } - memset(&sa, 0, sizeof sa); - sa.sin_family = AF_INET; --#ifdef BEOS -+#if defined BEOS && !defined __HAIKU__ - sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - #endif - /* leave port 0 to get ephemeral */ -@@ -421,7 +421,7 @@ - memset(&sa, 0, sizeof sa); - sa.sin_family = AF_INET; - sa.sin_port = listen_port; --#ifdef BEOS -+#if defined BEOS && !defined __HAIKU__ - sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - #endif - /* leave sin_addr all zeros to use loopback */ -Index: file_io/unix/readwrite.c -=================================================================== ---- file_io/unix/readwrite.c (revision 652904) -+++ file_io/unix/readwrite.c (working copy) -@@ -21,7 +21,7 @@ - - /* The only case where we don't use wait_for_io_or_timeout is on - * pre-BONE BeOS, so this check should be sufficient and simpler */ --#if !BEOS_R5 -+#if !BEOS_R5 || defined(__HAIKU__) - #define USE_WAIT_FOR_IO - #endif - -Index: support/unix/waitio.c -=================================================================== ---- support/unix/waitio.c (revision 652904) -+++ support/unix/waitio.c (working copy) -@@ -22,7 +22,7 @@ - - /* The only case where we don't use wait_for_io_or_timeout is on - * pre-BONE BeOS, so this check should be sufficient and simpler */ --#if !BEOS_R5 -+#if !BEOS_R5 || defined(__HAIKU__) - #define USE_WAIT_FOR_IO - #endif - diff --git a/dev-libs/apr/patches/apr-1.0.1.diff b/dev-libs/apr/patches/apr-1.0.1.diff deleted file mode 100644 index ba6330540..000000000 --- a/dev-libs/apr/patches/apr-1.0.1.diff +++ /dev/null @@ -1,2869 +0,0 @@ -configure: -CFLAGS="-I/boot/home/develop/flock_server/src/headers -I/boot/home/config/include" CPPFLAGS="-I/boot/home/develop/flock_server/src/headers -I/boot/home/config/include" LDFLAGS="-L/boot/home/config/lib -lflock -liconv -no-undefined" ./configure --prefix=/boot/home/config --with-libtool - -diff -urN apr-1.0.1.orig/build/apr_hints.m4 apr-1.0.1/build/apr_hints.m4 ---- apr-1.0.1.orig/build/apr_hints.m4 2004-11-17 02:07:02.000000000 +0100 -+++ apr-1.0.1/build/apr_hints.m4 2004-12-17 15:19:10.000000000 +0100 -@@ -351,7 +351,6 @@ - *beos*) - APR_ADDTO(CPPFLAGS, [-DBEOS]) - PLATOSVERS=`uname -r` -- APR_SETIFNULL(apr_process_lock_is_global, [yes]) - case $PLATOSVERS in - 5.0.4) - APR_ADDTO(LDFLAGS, [-L/boot/beos/system/lib]) -@@ -362,6 +361,9 @@ - APR_ADDTO(LDFLAGS, [-L/boot/beos/system/lib]) - APR_ADDTO(LIBS, [-lbind -lsocket]) - ;; -+ *) -+ APR_ADDTO(LDFLAGS,-lnet) -+ ;; - esac - APR_ADDTO(CPPFLAGS, [-DSIGPROCMASK_SETS_THREAD_MASK -DAP_AUTH_DBM_USE_APR]) - ;; -diff -urN apr-1.0.1.orig/configure.in apr-1.0.1/configure.in ---- apr-1.0.1.orig/configure.in 2004-11-17 02:07:02.000000000 +0100 -+++ apr-1.0.1/configure.in 2004-12-17 15:19:10.000000000 +0100 -@@ -221,7 +221,7 @@ - dnl otherwise. - - case $host in -- *os390) -+ *os390 | *beos) - if test "$ac_test_CFLAGS" != set; then - APR_REMOVEFROM(CFLAGS,-g) - fi -@@ -232,6 +232,10 @@ - [APR_ADDTO(CFLAGS,-g) - if test "$GCC" = "yes"; then - APR_ADDTO(CFLAGS,-Wall) -+ if test "$host" = "i586-pc-beos"; then -+ APR_REMOVEFROM(CFLAGS, -O2) -+ APR_ADDTO(CFLAGS, -O0) -+ fi - elif test "$AIX_XLC" = "yes"; then - APR_ADDTO(CFLAGS,-qfullpath) - fi -@@ -384,10 +388,9 @@ - APR_CHECK_DEFINE(BONE_VERSION, sys/socket.h) - eolstr="\\n" - osver=`uname -r` -- proc_mutex_is_global=1 - OBJECTS_PLATFORM='$(OBJECTS_beos)' - case $osver in -- 5.0.4) -+ 5.0.4 | 5.1) - file_as_socket="1" - ;; - *) -@@ -715,6 +718,7 @@ - haveshmgetanon="0" - havemmapzero="0" - havemmapanon="0" -+havebeosarea="0" - APR_BEGIN_DECISION([anonymous shared memory allocation method]) - APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl - func:shmget func:shmat func:shmdt func:shmctl, -@@ -732,7 +736,7 @@ - [haveos2shm="1" - APR_DECIDE(USE_SHMEM_OS2_ANON, [OS/2 DosAllocSharedMem()])]) - APR_IFALLYES(header:kernel/OS.h func:create_area, -- [havebeosshm="1" -+ [havebeosarea="1" - APR_DECIDE(USE_SHMEM_BEOS_ANON, - [BeOS areas])]) - case $host in -@@ -779,7 +783,6 @@ - havemmaptmp="0" - havemmapshm="0" - haveshmget="0" --havebeosarea="0" - haveos2shm="0" - APR_BEGIN_DECISION([namebased memory allocation method]) - APR_IFALLYES(header:sys/mman.h func:mmap func:munmap, -@@ -796,7 +799,7 @@ - [haveshmget="1" - APR_DECIDE(USE_SHMEM_SHMGET, [SysV IPC shmget()])]) - APR_IFALLYES(header:kernel/OS.h func:create_area, -- [havebeosshm="1" -+ [havebeosarea="1" - APR_DECIDE(USE_SHMEM_BEOS, [BeOS areas])]) - APR_IFALLYES(header:os2.h, - [haveos2shm="1" -@@ -1315,9 +1318,10 @@ - size_t_fmt='#define APR_SIZE_T_FMT "ld"' - ;; - *beos*) -- ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' -- size_t_fmt='#define APR_SIZE_T_FMT "ld"' -- ;; -+ pid_t_fmt='#define APR_PID_T_FMT "ld"' -+ ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' -+ size_t_fmt='#define APR_SIZE_T_FMT "ld"' -+ ;; - *apple-darwin*) - ssize_t_fmt='#define APR_SSIZE_T_FMT "d"' - size_t_fmt='#define APR_SIZE_T_FMT "lu"' -@@ -1399,6 +1403,10 @@ - # Original HP-UX: - AC_CHECK_LIB(dld, shl_load, [dsotype=shl; APR_ADDTO(LIBS,-ldld)]) - fi -+ if test "$dsotype" = "any"; then -+ # BeOS: -+ AC_CHECK_LIB(root, load_image, [dsotype=other]) -+ fi - # Normal POSIX: - if test "$dsotype" = "any"; then - AC_CHECK_FUNC(dlopen, [dsotype=dlfcn]) -@@ -1414,10 +1422,6 @@ - [dsotype=any - echo "Weird: dlopen() was found but dlsym() was not found!"])]) - fi -- if test "$dsotype" = "any"; then -- # BeOS: -- AC_CHECK_LIB(root, load_image, [dsotype=other]) -- fi - # Everything else: - if test "$dsotype" = "any"; then - case $host in -@@ -1597,6 +1601,17 @@ - fi - fi - -+# BeOS has no built-in flock(), but there is a third-party flock_server package -+# that adds basic (if not compliant) support. It defines flock() in flock.h. -+case $host in -+ *beos) -+ unset ac_cv_define_LOCK_EX -+ APR_CHECK_DEFINE(LOCK_EX, flock.h) -+ APR_IFALLYES(func:flock define:LOCK_EX, [ -+ APR_ADDTO(CFLAGS, -Dclose=flock_close -Ddup2=flock_dup2)]) -+ ;; -+esac -+ - # See which lock mechanisms we can support on this system. - APR_IFALLYES(header:semaphore.h func:sem_open func:sem_close dnl - func:sem_unlink func:sem_post func:sem_wait, -@@ -1610,7 +1625,16 @@ - func:pthread_mutexattr_setpshared dnl - file:/dev/zero, - hasprocpthreadser="1", hasprocpthreadser="0") --APR_IFALLYES(header:OS.h func:create_sem, hasbeossem="1", hasbeossem="0") -+APR_IFALLYES(header:OS.h func:create_sem, hasbeossemser="1", hasbeossemser="0") -+ -+# BeOS defines F_SETLK, but that doesn't mean, that it really works. -+case $host in -+ *beos*) -+ hasfcntlser="0" -+ ;; -+ *) -+ ;; -+esac - - # See which lock mechanism we'll select by default on this system. - # The last APR_DECIDE to execute sets the default. -@@ -1642,6 +1666,7 @@ - posixser="0" - procpthreadser="0" - fcntlser="0" -+beossemser="0" - case $ac_decision in - USE_FLOCK_SERIALIZE ) - flockser="1" -@@ -1659,7 +1684,7 @@ - procpthreadser="1" - ;; - USE_BEOSSEM ) -- beossem="1" -+ beossemser="1" - ;; - esac - -@@ -1668,12 +1693,14 @@ - AC_SUBST(hasposixser) - AC_SUBST(hasfcntlser) - AC_SUBST(hasprocpthreadser) -+AC_SUBST(hasbeossemser) - AC_SUBST(flockser) - AC_SUBST(sysvser) - AC_SUBST(posixser) - AC_SUBST(fcntlser) - AC_SUBST(procpthreadser) - AC_SUBST(pthreadser) -+AC_SUBST(beossemser) - - AC_MSG_CHECKING(if all interprocess locks affect threads) - if test "x$apr_process_lock_is_global" = "xyes"; then -@@ -1983,6 +2010,9 @@ - if test -d $srcdir/test; then - MAKEFILES="$MAKEFILES test/Makefile test/internal/Makefile" - fi -+if test -d $srcdir/threadproc/beos; then -+ MAKEFILES="$MAKEFILES threadproc/beos/Makefile" -+fi - - # - # BSD/OS (BSDi) needs to use a different include syntax in the Makefiles -diff -urN apr-1.0.1.orig/dso/beos/dso.c apr-1.0.1/dso/beos/dso.c ---- apr-1.0.1.orig/dso/beos/dso.c 2004-03-09 15:40:41.000000000 +0100 -+++ apr-1.0.1/dso/beos/dso.c 2004-12-17 15:19:10.000000000 +0100 -@@ -22,7 +22,7 @@ - { - apr_dso_handle_t *dso = thedso; - -- if (dso->handle > 0 && unload_add_on(dso->handle) < B_NO_ERROR) -+ if (dso->handle >= 0 && unload_add_on(dso->handle) < B_NO_ERROR) - return APR_EINIT; - dso->handle = -1; - -@@ -32,19 +32,16 @@ - APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, - const char *path, apr_pool_t *pool) - { -- image_id newid = -1; -+ apr_dso_handle_t *handle = apr_pcalloc(pool, sizeof(apr_dso_handle_t)); -+ *res_handle = handle; - -- *res_handle = apr_pcalloc(pool, sizeof(*res_handle)); -- -- if((newid = load_add_on(path)) < B_NO_ERROR) { -- (*res_handle)->errormsg = strerror(newid); -+ handle->handle = load_add_on(path); -+ if (handle->handle < B_NO_ERROR) - return APR_EDSOOPEN; -- } -- -- (*res_handle)->pool = pool; -- (*res_handle)->handle = newid; - -- apr_pool_cleanup_register(pool, *res_handle, dso_cleanup, apr_pool_cleanup_null); -+ handle->pool = pool; -+ -+ apr_pool_cleanup_register(pool, handle, dso_cleanup, apr_pool_cleanup_null); - - return APR_SUCCESS; - } -@@ -62,10 +59,9 @@ - if (symname == NULL) - return APR_ESYMNOTFOUND; - -- err = get_image_symbol(handle->handle, symname, B_SYMBOL_TYPE_ANY, -- ressym); -+ err = get_image_symbol(handle->handle, symname, B_SYMBOL_TYPE_ANY, ressym); - -- if(err != B_OK) -+ if (err != B_OK) - return APR_ESYMNOTFOUND; - - return APR_SUCCESS; -diff -urN apr-1.0.1.orig/file_io/unix/flock.c apr-1.0.1/file_io/unix/flock.c ---- apr-1.0.1.orig/file_io/unix/flock.c 2004-02-13 10:38:38.000000000 +0100 -+++ apr-1.0.1/file_io/unix/flock.c 2004-12-17 15:19:10.000000000 +0100 -@@ -22,11 +22,15 @@ - #include - #endif - -+#if defined(BEOS) && APR_HAS_FLOCK_SERIALIZE -+#include -+#endif -+ - APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) - { - int rc; - --#if defined(HAVE_FCNTL_H) -+#if APR_HAS_FCNTL_SERIALIZE - { - struct flock l = { 0 }; - int fc; -@@ -56,7 +60,7 @@ - return errno; - } - } --#elif defined(HAVE_SYS_FILE_H) -+#elif APR_HAS_FLOCK_SERIALIZE - { - int ltype; - -@@ -85,7 +89,7 @@ - { - int rc; - --#if defined(HAVE_FCNTL_H) -+#if APR_HAS_FCNTL_SERIALIZE - { - struct flock l = { 0 }; - -@@ -102,7 +106,7 @@ - if (rc == -1) - return errno; - } --#elif defined(HAVE_SYS_FILE_H) -+#elif APR_HAS_FLOCK_SERIALIZE - { - /* keep trying if flock() gets interrupted (by a signal) */ - while ((rc = flock(thefile->filedes, LOCK_UN)) < 0 && errno == EINTR) -diff -urN apr-1.0.1.orig/file_io/unix/pipe.c apr-1.0.1/file_io/unix/pipe.c ---- apr-1.0.1.orig/file_io/unix/pipe.c 2004-02-13 10:38:38.000000000 +0100 -+++ apr-1.0.1/file_io/unix/pipe.c 2004-12-17 15:19:11.000000000 +0100 -@@ -42,7 +42,7 @@ - fd_flags &= ~O_NONBLOCK; - # elif defined(O_NDELAY) - fd_flags &= ~O_NDELAY; --# elif defined(FNDELAY) -+# elif defined(O_FNDELAY) - fd_flags &= ~O_FNDELAY; - # else - /* XXXX: this breaks things, but an alternative isn't obvious...*/ -@@ -77,7 +77,7 @@ - fd_flags |= O_NONBLOCK; - # elif defined(O_NDELAY) - fd_flags |= O_NDELAY; --# elif defined(FNDELAY) -+# elif defined(O_FNDELAY) - fd_flags |= O_FNDELAY; - # else - /* XXXX: this breaks things, but an alternative isn't obvious...*/ -diff -urN apr-1.0.1.orig/include/apr.h.in apr-1.0.1/include/apr.h.in ---- apr-1.0.1.orig/include/apr.h.in 2004-06-05 13:52:43.000000000 +0200 -+++ apr-1.0.1/include/apr.h.in 2004-12-17 15:19:10.000000000 +0100 -@@ -172,12 +172,14 @@ - #define APR_USE_FCNTL_SERIALIZE @fcntlser@ - #define APR_USE_PROC_PTHREAD_SERIALIZE @procpthreadser@ - #define APR_USE_PTHREAD_SERIALIZE @pthreadser@ -+#define APR_USE_BEOS_SEM_SERIALIZE @beossemser@ - - #define APR_HAS_FLOCK_SERIALIZE @hasflockser@ - #define APR_HAS_SYSVSEM_SERIALIZE @hassysvser@ - #define APR_HAS_POSIXSEM_SERIALIZE @hasposixser@ - #define APR_HAS_FCNTL_SERIALIZE @hasfcntlser@ - #define APR_HAS_PROC_PTHREAD_SERIALIZE @hasprocpthreadser@ -+#define APR_HAS_BEOS_SEM_SERIALIZE @hasbeossemser@ - - #define APR_PROCESS_LOCK_IS_GLOBAL @proclockglobal@ - -diff -urN apr-1.0.1.orig/include/apr_portable.h apr-1.0.1/include/apr_portable.h ---- apr-1.0.1.orig/include/apr_portable.h 2004-02-13 10:38:38.000000000 +0100 -+++ apr-1.0.1/include/apr_portable.h 2004-12-17 15:19:10.000000000 +0100 -@@ -87,9 +87,24 @@ - #include - #include - -+/** Basic OS process mutex structure. */ - struct apr_os_proc_mutex_t { -- sem_id sem; -- int32 ben; -+#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE -+ /** Value used for SYS V Semaphore, FCNTL and FLOCK serialization */ -+ int crossproc; -+#endif -+#if APR_HAS_PROC_PTHREAD_SERIALIZE -+ /** Value used for PTHREAD serialization */ -+ pthread_mutex_t *pthread_interproc; -+#endif -+#if APR_HAS_THREADS -+ /* If no threads, no need for thread locks */ -+#if APR_USE_PTHREAD_SERIALIZE -+ /** This value is currently unused within APR and Apache */ -+ pthread_mutex_t *intraproc; -+#endif -+ sem_id beos_sem; -+#endif - }; - - typedef int apr_os_file_t; -@@ -98,7 +113,7 @@ - typedef struct apr_os_proc_mutex_t apr_os_proc_mutex_t; - typedef thread_id apr_os_thread_t; - typedef thread_id apr_os_proc_t; --typedef int apr_os_threadkey_t; -+typedef int32 apr_os_threadkey_t; - typedef struct timeval apr_os_imp_time_t; - typedef struct tm apr_os_exp_time_t; - typedef image_id apr_os_dso_handle_t; ---- apr-1.0.1.orig/include/arch/beos/apr_arch_proc_mutex.h 2004-02-13 10:38:38.000000000 +0100 -+++ apr-1.0.1/include/arch/beos/apr_arch_proc_mutex.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,35 +0,0 @@ --/* Copyright 2000-2004 The Apache Software Foundation -- * -- * Licensed 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 PROC_MUTEX_H --#define PROC_MUTEX_H -- --#include "apr_pools.h" --#include "apr_proc_mutex.h" --#include "apr_file_io.h" --#include "apr_general.h" --#include "apr_lib.h" --#include "apr_portable.h" -- --struct apr_proc_mutex_t { -- apr_pool_t *pool; -- -- /* Our lock :) */ -- sem_id Lock; -- int32 LockCount; --}; -- --#endif /* PROC_MUTEX_H */ -- -diff -urN apr-1.0.1.orig/include/arch/beos/apr_arch_shm.h apr-1.0.1/include/arch/beos/apr_arch_shm.h ---- apr-1.0.1.orig/include/arch/beos/apr_arch_shm.h 1970-01-01 01:00:00.000000000 +0100 -+++ apr-1.0.1/include/arch/beos/apr_arch_shm.h 2004-12-17 15:19:11.000000000 +0100 -@@ -0,0 +1,35 @@ -+/* Copyright 2000-2004 The Apache Software Foundation -+ * -+ * Licensed 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 SHM_H -+#define SHM_H -+ -+#include -+#include "apr_pools.h" -+#include "apr_general.h" -+#include "apr_lib.h" -+#include "apr_portable.h" -+ -+typedef struct beos_area_handle beos_area_handle; -+ -+struct apr_shm_t { -+ apr_pool_t *pool; -+ beos_area_handle *handle; -+}; -+ -+apr_status_t apr_beos_setup_shmem(); -+apr_status_t apr_beos_shmem_child_init(); -+ -+#endif /* SHM_H */ -diff -urN apr-1.0.1.orig/include/arch/beos/apr_arch_thread_mutex.h apr-1.0.1/include/arch/beos/apr_arch_thread_mutex.h ---- apr-1.0.1.orig/include/arch/beos/apr_arch_thread_mutex.h 2004-02-13 10:38:38.000000000 +0100 -+++ apr-1.0.1/include/arch/beos/apr_arch_thread_mutex.h 2004-12-17 15:19:11.000000000 +0100 -@@ -37,5 +37,8 @@ - int owner_ref; - }; - -+apr_status_t apr_beos_thread_mutex_init(apr_thread_mutex_t *mutex, -+ unsigned int flags, apr_pool_t *pool); -+ - #endif /* THREAD_MUTEX_H */ - -diff -urN apr-1.0.1.orig/include/arch/beos/apr_arch_threadproc.h apr-1.0.1/include/arch/beos/apr_arch_threadproc.h ---- apr-1.0.1.orig/include/arch/beos/apr_arch_threadproc.h 2004-02-13 10:38:38.000000000 +0100 -+++ apr-1.0.1/include/arch/beos/apr_arch_threadproc.h 2004-12-17 15:19:11.000000000 +0100 -@@ -44,6 +44,7 @@ - void *data; - apr_thread_start_t func; - apr_status_t exitval; -+ vint32 join_count; - }; - - struct apr_threadattr_t { -@@ -55,21 +56,8 @@ - - struct apr_threadkey_t { - apr_pool_t *pool; -- int32 key; --}; -- --struct beos_private_data { -- const void ** data; -- int count; -- volatile thread_id td; --}; -- --struct beos_key { -- int assigned; -- int count; -- sem_id lock; -- int32 ben_lock; -- void (* destructor) (void *); -+ int32 key; -+ void (*destructor)(void *); - }; - - struct apr_procattr_t { -@@ -87,7 +75,6 @@ - - struct apr_thread_once_t { - sem_id sem; -- int hit; - }; - - #endif /* ! THREAD_PROC_H */ -diff -urN apr-1.0.1.orig/include/arch/unix/apr_arch_proc_mutex.h apr-1.0.1/include/arch/unix/apr_arch_proc_mutex.h ---- apr-1.0.1.orig/include/arch/unix/apr_arch_proc_mutex.h 2004-06-14 10:53:31.000000000 +0200 -+++ apr-1.0.1/include/arch/unix/apr_arch_proc_mutex.h 2004-12-17 15:19:10.000000000 +0100 -@@ -104,6 +104,9 @@ - #if APR_HAS_PROC_PTHREAD_SERIALIZE - pthread_mutex_t *pthread_interproc; - #endif -+#if APR_HAS_BEOS_SEM_SERIALIZE -+ sem_id beos_sem; -+#endif - }; - - void apr_proc_mutex_unix_setup_lock(void); -diff -urN apr-1.0.1.orig/locks/beos/locks_common.c apr-1.0.1/locks/beos/locks_common.c ---- apr-1.0.1.orig/locks/beos/locks_common.c 1970-01-01 01:00:00.000000000 +0100 -+++ apr-1.0.1/locks/beos/locks_common.c 2004-12-17 15:19:11.000000000 +0100 -@@ -0,0 +1,5 @@ -+/* Include "apr_arch_thread_mutex.h" first, so that "apr_arch_global_mutex.h" -+ * won't include the wrong one (the UNIX version). -+ */ -+#include "apr_arch_thread_mutex.h" -+#include "../unix/global_mutex.c" -diff -urN apr-1.0.1.orig/locks/beos/proc_mutex.c apr-1.0.1/locks/beos/proc_mutex.c ---- apr-1.0.1.orig/locks/beos/proc_mutex.c 2004-03-09 15:39:45.000000000 +0100 -+++ apr-1.0.1/locks/beos/proc_mutex.c 2004-12-17 15:19:11.000000000 +0100 -@@ -13,157 +13,68 @@ - * limitations under the License. - */ - --/*Read/Write locking implementation based on the MultiLock code from -- * Stephen Beaulieu -- */ -- - #include "apr_arch_proc_mutex.h" - #include "apr_strings.h" - #include "apr_portable.h" -+#if APR_HAS_FLOCK_SERIALIZE -+#include -+#endif - --static apr_status_t _proc_mutex_cleanup(void * data) --{ -- apr_proc_mutex_t *lock = (apr_proc_mutex_t*)data; -- if (lock->LockCount != 0) { -- /* we're still locked... */ -- while (atomic_add(&lock->LockCount , -1) > 1){ -- /* OK we had more than one person waiting on the lock so -- * the sem is also locked. Release it until we have no more -- * locks left. -- */ -- release_sem (lock->Lock); -- } -- } -- delete_sem(lock->Lock); -- return APR_SUCCESS; --} -- --APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, -- const char *fname, -- apr_lockmech_e mech, -- apr_pool_t *pool) --{ -- apr_proc_mutex_t *new; -- apr_status_t stat = APR_SUCCESS; -- -- if (mech != APR_LOCK_DEFAULT) { -- return APR_ENOTIMPL; -- } -- -- new = (apr_proc_mutex_t *)apr_pcalloc(pool, sizeof(apr_proc_mutex_t)); -- if (new == NULL){ -- return APR_ENOMEM; -- } -- -- if ((stat = create_sem(0, "APR_Lock")) < B_NO_ERROR) { -- _proc_mutex_cleanup(new); -- return stat; -- } -- new->LockCount = 0; -- new->Lock = stat; -- new->pool = pool; -- -- apr_pool_cleanup_register(new->pool, (void *)new, _proc_mutex_cleanup, -- apr_pool_cleanup_null); -- -- (*mutex) = new; -- return APR_SUCCESS; --} -+#include - --APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, -- const char *fname, -- apr_pool_t *pool) -+static apr_status_t proc_mutex_beos_sem_cleanup(void *mutex_) - { -- return APR_SUCCESS; --} -+ apr_proc_mutex_t *mutex = mutex_; - --APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) --{ -- int32 stat; -- -- if (atomic_add(&mutex->LockCount, 1) > 0) { -- if ((stat = acquire_sem(mutex->Lock)) < B_NO_ERROR) { -- atomic_add(&mutex->LockCount, -1); -- return stat; -- } -- } -- return APR_SUCCESS; --} -- --APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) --{ -- return APR_ENOTIMPL; --} -+ return delete_sem(mutex->beos_sem); -+} - --APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) -+static apr_status_t proc_mutex_beos_sem_create(apr_proc_mutex_t *new_mutex, -+ const char *fname) - { -- int32 stat; -- -- if (atomic_add(&mutex->LockCount, -1) > 1) { -- if ((stat = release_sem(mutex->Lock)) < B_NO_ERROR) { -- atomic_add(&mutex->LockCount, 1); -- return stat; -- } -- } -- return APR_SUCCESS; --} -+ new_mutex->beos_sem = create_sem(1, "APR_ProcMutex"); -+ if (new_mutex->beos_sem < B_NO_ERROR) -+ return new_mutex->beos_sem; - --APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) --{ -- apr_status_t stat; -- if ((stat = _proc_mutex_cleanup(mutex)) == APR_SUCCESS) { -- apr_pool_cleanup_kill(mutex->pool, mutex, _proc_mutex_cleanup); -- return APR_SUCCESS; -- } -- return stat; --} -+ apr_pool_cleanup_register(new_mutex->pool, (void *)new_mutex, -+ apr_proc_mutex_cleanup, -+ apr_pool_cleanup_null); - --APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex) --{ -- return _proc_mutex_cleanup(mutex); -+ return APR_SUCCESS; - } - -- --APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) -+static apr_status_t proc_mutex_beos_sem_acquire(apr_proc_mutex_t *mutex) - { -- return NULL; -+ return acquire_sem(mutex->beos_sem); - } - --APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) -+static apr_status_t proc_mutex_beos_sem_tryacquire(apr_proc_mutex_t *mutex) - { -- return "beossem"; -+ return acquire_sem_etc(mutex->beos_sem, 0, B_RELATIVE_TIMEOUT, 0); - } - --APR_DECLARE(const char *) apr_proc_mutex_defname(void) -+static apr_status_t proc_mutex_beos_sem_release(apr_proc_mutex_t *mutex) - { -- return "beossem"; -+ return release_sem(mutex->beos_sem); - } - --APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) -- --/* Implement OS-specific accessors defined in apr_portable.h */ -- --APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, -- apr_proc_mutex_t *pmutex) -+static apr_status_t proc_mutex_beos_sem_child_init(apr_proc_mutex_t **mutex, -+ apr_pool_t *cont, -+ const char *fname) - { -- ospmutex->sem = pmutex->Lock; -- ospmutex->ben = pmutex->LockCount; - return APR_SUCCESS; - } - --APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, -- apr_os_proc_mutex_t *ospmutex, -- apr_pool_t *pool) --{ -- if (pool == NULL) { -- return APR_ENOPOOL; -- } -- if ((*pmutex) == NULL) { -- (*pmutex) = (apr_proc_mutex_t *)apr_pcalloc(pool, sizeof(apr_proc_mutex_t)); -- (*pmutex)->pool = pool; -- } -- (*pmutex)->Lock = ospmutex->sem; -- (*pmutex)->LockCount = ospmutex->ben; -- return APR_SUCCESS; --} -+static const apr_proc_mutex_unix_lock_methods_t mutex_beos_sem_methods = -+{ -+ APR_PROCESS_LOCK_MECH_IS_GLOBAL, -+ proc_mutex_beos_sem_create, -+ proc_mutex_beos_sem_acquire, -+ proc_mutex_beos_sem_tryacquire, -+ proc_mutex_beos_sem_release, -+ proc_mutex_beos_sem_cleanup, -+ proc_mutex_beos_sem_child_init, -+ "beossem" -+}; - -+#include "../unix/proc_mutex.c" -diff -urN apr-1.0.1.orig/locks/beos/thread_cond.c apr-1.0.1/locks/beos/thread_cond.c ---- apr-1.0.1.orig/locks/beos/thread_cond.c 2004-02-26 18:03:26.000000000 +0100 -+++ apr-1.0.1/locks/beos/thread_cond.c 2004-12-17 15:19:11.000000000 +0100 -@@ -20,7 +20,6 @@ - - static apr_status_t thread_cond_cleanup(void *data) - { -- struct waiter *w; - apr_thread_cond_t *cond = (apr_thread_cond_t *)data; - - acquire_sem(cond->lock); -diff -urN apr-1.0.1.orig/locks/beos/thread_mutex.c apr-1.0.1/locks/beos/thread_mutex.c ---- apr-1.0.1.orig/locks/beos/thread_mutex.c 2004-02-26 18:03:26.000000000 +0100 -+++ apr-1.0.1/locks/beos/thread_mutex.c 2004-12-17 15:19:11.000000000 +0100 -@@ -26,18 +26,37 @@ - apr_thread_mutex_t *lock = (apr_thread_mutex_t*)data; - if (lock->LockCount != 0) { - /* we're still locked... */ -- while (atomic_add(&lock->LockCount , -1) > 1){ -- /* OK we had more than one person waiting on the lock so -- * the sem is also locked. Release it until we have no more -- * locks left. -- */ -+ while (atomic_add(&lock->LockCount , -1) > 1){ -+ /* OK we had more than one person waiting on the lock so -+ * the sem is also locked. Release it until we have no more -+ * locks left. -+ */ - release_sem (lock->Lock); -- } -+ } - } - delete_sem(lock->Lock); - return APR_SUCCESS; - } - -+/* pool may be NULL. */ -+apr_status_t apr_beos_thread_mutex_init(apr_thread_mutex_t *mutex, -+ unsigned int flags, apr_pool_t *pool) -+{ -+ mutex->Lock = create_sem(0, "APR_Lock"); -+ if (mutex->Lock < 0) -+ return mutex->Lock; -+ -+ mutex->LockCount = 0; -+ mutex->pool = pool; -+ -+ /* Optimal default is APR_THREAD_MUTEX_UNNESTED, -+ * no additional checks required for either flag. -+ */ -+ mutex->nested = flags & APR_THREAD_MUTEX_NESTED; -+ -+ return APR_SUCCESS; -+} -+ - APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, - unsigned int flags, - apr_pool_t *pool) -@@ -49,19 +68,10 @@ - if (new_m == NULL){ - return APR_ENOMEM; - } -- -- if ((stat = create_sem(0, "APR_Lock")) < B_NO_ERROR) { -- _thread_mutex_cleanup(new_m); -- return stat; -- } -- new_m->LockCount = 0; -- new_m->Lock = stat; -- new_m->pool = pool; - -- /* Optimal default is APR_THREAD_MUTEX_UNNESTED, -- * no additional checks required for either flag. -- */ -- new_m->nested = flags & APR_THREAD_MUTEX_NESTED; -+ stat = apr_beos_thread_mutex_init(new_m, flags, pool); -+ if (stat != APR_SUCCESS) -+ return stat; - - apr_pool_cleanup_register(new_m->pool, (void *)new_m, _thread_mutex_cleanup, - apr_pool_cleanup_null); -@@ -90,13 +100,13 @@ - return APR_SUCCESS; - } - -- if (atomic_add(&mutex->LockCount, 1) > 0) { -- if ((stat = acquire_sem(mutex->Lock)) < B_NO_ERROR) { -+ if (atomic_add(&mutex->LockCount, 1) > 0) { -+ if ((stat = acquire_sem(mutex->Lock)) < B_NO_ERROR) { - /* Oh dear, acquire_sem failed!! */ -- atomic_add(&mutex->LockCount, -1); -- return stat; -- } -- } -+ atomic_add(&mutex->LockCount, -1); -+ return stat; -+ } -+ } - - mutex->owner = me; - mutex->owner_ref = 1; -@@ -119,7 +129,7 @@ - return APR_SUCCESS; - } - -- if (atomic_add(&mutex->LockCount, -1) > 1) { -+ if (atomic_add(&mutex->LockCount, -1) > 1) { - if ((stat = release_sem(mutex->Lock)) < B_NO_ERROR) { - atomic_add(&mutex->LockCount, 1); - return stat; -diff -urN apr-1.0.1.orig/locks/unix/proc_mutex.c apr-1.0.1/locks/unix/proc_mutex.c ---- apr-1.0.1.orig/locks/unix/proc_mutex.c 2004-06-15 10:21:22.000000000 +0200 -+++ apr-1.0.1/locks/unix/proc_mutex.c 2004-12-17 15:19:11.000000000 +0100 -@@ -717,6 +717,8 @@ - new_mutex->inter_meth = &mutex_proc_pthread_methods; - #elif APR_USE_POSIXSEM_SERIALIZE - new_mutex->inter_meth = &mutex_posixsem_methods; -+#elif APR_USE_BEOS_SEM_SERIALIZE -+ new_mutex->inter_meth = &mutex_beos_sem_methods; - #else - return APR_ENOTIMPL; - #endif -@@ -837,6 +839,9 @@ - #if APR_HAS_PROC_PTHREAD_SERIALIZE - ospmutex->pthread_interproc = pmutex->pthread_interproc; - #endif -+#if APR_HAS_BEOS_SEM_SERIALIZE -+ ospmutex->beos_sem = pmutex->beos_sem; -+#endif - return APR_SUCCESS; - } - -@@ -858,6 +863,9 @@ - #if APR_HAS_PROC_PTHREAD_SERIALIZE - (*pmutex)->pthread_interproc = ospmutex->pthread_interproc; - #endif -+#if APR_HAS_BEOS_SEM_SERIALIZE -+ (*pmutex)->beos_sem = ospmutex->beos_sem; -+#endif - return APR_SUCCESS; - } - -diff -urN apr-1.0.1.orig/misc/unix/start.c apr-1.0.1/misc/unix/start.c ---- apr-1.0.1.orig/misc/unix/start.c 2004-02-13 10:38:38.000000000 +0100 -+++ apr-1.0.1/misc/unix/start.c 2004-12-17 15:19:11.000000000 +0100 -@@ -22,6 +22,10 @@ - #include "apr_arch_proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */ - #include "apr_arch_internal_time.h" - -+#ifdef BEOS -+#include "apr_arch_shm.h" /* for apr_beos_setup_shmem() */ -+#endif -+ - - APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, - const char * const * *argv, -@@ -51,6 +55,10 @@ - apr_unix_setup_time(); - #endif - -+#ifdef BEOS -+ apr_beos_setup_shmem(); -+#endif -+ - if ((status = apr_pool_initialize()) != APR_SUCCESS) - return status; - ---- apr-1.0.1.orig/network_io/beos/sendrecv.c 2004-02-13 10:38:38.000000000 +0100 -+++ apr-1.0.1/network_io/beos/sendrecv.c 2004-12-17 15:25:26.000000000 +0100 -@@ -17,9 +17,14 @@ - #if BEOS_BONE /* BONE uses the unix code - woohoo */ - #include "../unix/sendrecv.c" - #else -+#include -+ - #include "apr_arch_networkio.h" - #include "apr_time.h" - -+#define SEND_WAIT APR_USEC_PER_SEC / 100 -+#define RECEIVE_WAIT APR_USEC_PER_SEC / 100 -+ - static apr_status_t wait_for_io_or_timeout(apr_socket_t *sock, int for_read) - { - struct timeval tv, *tvptr; -@@ -37,6 +42,8 @@ - tv.tv_usec = sock->timeout % APR_USEC_PER_SEC; - tvptr = &tv; - } -+ /* This probably only works for read_for. At least according to the -+ * documentation only the read set argument is actually supported. */ - srv = select(sock->socketdes + 1, - for_read ? &fdset : NULL, - for_read ? NULL : &fdset, -@@ -54,38 +61,46 @@ - return APR_SUCCESS; - } - --#define SEND_WAIT APR_USEC_PER_SEC / 10 -+apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, -+ int for_read) -+{ -+ /* BeOS net_server select() supports sockets only */ -+ if (!f) -+ return APR_ENOTIMPL; -+ -+ return wait_for_io_or_timeout(s, for_read); -+} - - APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, - apr_size_t *len) - { - apr_ssize_t rv; -- -+ - do { - rv = send(sock->socketdes, buf, (*len), 0); - } while (rv == -1 && errno == EINTR); - - if (rv == -1 && errno == EWOULDBLOCK && sock->timeout > 0) { -- apr_int32_t snooze_val = SEND_WAIT; -- apr_int32_t zzz = 0; -- -- do { -- rv = send(sock->socketdes, buf, (*len), 0); -- if (rv == -1 && errno == EWOULDBLOCK){ -- apr_sleep (snooze_val); -- zzz += snooze_val; -- snooze_val += SEND_WAIT; -- /* have we passed our timeout value */ -- if (zzz > (sock->timeout * APR_USEC_PER_SEC)) -- break; -- } -- } while (rv == -1 && (errno == EINTR || errno == EWOULDBLOCK)); -+ bigtime_t now = system_time(); -+ bigtime_t endTime = now + sock->timeout; -+ while (now < endTime) { -+ snooze(RECEIVE_WAIT); -+ -+ do { -+ rv = send(sock->socketdes, buf, (*len), 0); -+ } while (rv == -1 && errno == EINTR); -+ -+ if (rv >= 0 || (rv < 0 && errno != EWOULDBLOCK)) -+ break; -+ -+ now = system_time(); -+ }; - } - if (rv == -1) { - *len = 0; -- return errno; -+ return (errno == EWOULDBLOCK ? APR_TIMEUP : errno); - } -- (*len) = rv; -+ *len = rv; - - return APR_SUCCESS; - } -@@ -100,22 +115,30 @@ - } while (rv == -1 && errno == EINTR); - - if (rv == -1 && errno == EWOULDBLOCK && sock->timeout > 0) { -- apr_status_t arv = wait_for_io_or_timeout(sock, 1); -- if (arv != APR_SUCCESS) { -- *len = 0; -- return arv; -- } -- else { -+ /* bonefish: I don't know why, but in some cases select() seems to -+ * return success, even if there's nothing to read yet. Maybe if the -+ * connection is not yet established? The tests exposed this problem. -+ * Long story short, we have to poll here, too. */ -+ bigtime_t now = system_time(); -+ bigtime_t endTime = now + sock->timeout; -+ while (now < endTime) { -+ snooze(RECEIVE_WAIT); -+ - do { - rv = recv(sock->socketdes, buf, (*len), 0); - } while (rv == -1 && errno == EINTR); -- } -+ -+ if (rv >= 0 || (rv < 0 && errno != EWOULDBLOCK)) -+ break; -+ -+ now = system_time(); -+ }; - } - if (rv == -1) { - (*len) = 0; -- return errno; -+ return (errno == EWOULDBLOCK ? APR_TIMEUP : errno); - } -- (*len) = rv; -+ *len = rv; - if (rv == 0) - return APR_EOF; - return APR_SUCCESS; -@@ -144,23 +167,28 @@ - where->salen); - } while (rv == -1 && errno == EINTR); - -- if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) -- && sock->timeout != 0) { -- apr_status_t arv = wait_for_io_or_timeout(sock, 0); -- if (arv != APR_SUCCESS) { -- *len = 0; -- return arv; -- } else { -+ -+ if (rv == -1 && errno == EWOULDBLOCK && sock->timeout > 0) { -+ bigtime_t now = system_time(); -+ bigtime_t endTime = now + sock->timeout; -+ while (now < endTime) { -+ snooze(RECEIVE_WAIT); -+ - do { - rv = sendto(sock->socketdes, buf, (*len), flags, - (const struct sockaddr*)&where->sa, - where->salen); - } while (rv == -1 && errno == EINTR); -- } -+ -+ if (rv >= 0 || (rv < 0 && errno != EWOULDBLOCK)) -+ break; -+ -+ now = system_time(); -+ }; - } - if (rv == -1) { - *len = 0; -- return errno; -+ return (errno == EWOULDBLOCK ? APR_TIMEUP : errno); - } - *len = rv; - return APR_SUCCESS; -@@ -173,38 +201,38 @@ - { - apr_ssize_t rv; - -- if (from == NULL){ -- return APR_ENOMEM; -- /* Not sure if this is correct. Maybe we should just allocate -- the memory?? -- */ -- } -- - do { - rv = recvfrom(sock->socketdes, buf, (*len), flags, - (struct sockaddr*)&from->sa, &from->salen); - } while (rv == -1 && errno == EINTR); - -- if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && -- sock->timeout != 0) { -- apr_status_t arv = wait_for_io_or_timeout(sock, 1); -- if (arv != APR_SUCCESS) { -- *len = 0; -- return arv; -- } else { -+ if (rv == -1 && errno == EWOULDBLOCK && sock->timeout > 0) { -+ /* bonefish: I don't know why, but in some cases select() seems to -+ * return success, even if there's nothing to read yet. Maybe if the -+ * connection is not yet established? The tests exposed this problem. -+ * Long story short, we have to poll here, too. */ -+ bigtime_t now = system_time(); -+ bigtime_t endTime = now + sock->timeout; -+ while (now < endTime) { -+ snooze(RECEIVE_WAIT); -+ - do { - rv = recvfrom(sock->socketdes, buf, (*len), flags, - (struct sockaddr*)&from->sa, &from->salen); -- } while (rv == -1 && errno == EINTR); -- } -+ } while (rv == -1 && errno == EINTR); -+ -+ if (rv >= 0 || (rv < 0 && errno != EWOULDBLOCK)) -+ break; -+ -+ now = system_time(); -+ }; - } - if (rv == -1) { - (*len) = 0; -- return errno; -+ return (errno == EWOULDBLOCK ? APR_TIMEUP : errno); - } -- -- (*len) = rv; -- if (rv == 0) -+ *len = rv; -+ if (rv == 0 && sock->type == SOCK_STREAM) - return APR_EOF; - - return APR_SUCCESS; -diff -urN apr-1.0.1.orig/network_io/unix/sockaddr.c apr-1.0.1/network_io/unix/sockaddr.c ---- apr-1.0.1.orig/network_io/unix/sockaddr.c 2004-07-13 11:15:50.000000000 +0200 -+++ apr-1.0.1/network_io/unix/sockaddr.c 2004-12-17 15:19:11.000000000 +0100 -@@ -543,7 +543,7 @@ - - if ((masked = flags & (APR_IPV4_ADDR_OK | APR_IPV6_ADDR_OK))) { - if (!hostname || -- family != AF_UNSPEC || -+ family != APR_UNSPEC || - masked == (APR_IPV4_ADDR_OK | APR_IPV6_ADDR_OK)) { - return APR_EINVAL; - } -diff -urN apr-1.0.1.orig/network_io/unix/sockets.c apr-1.0.1/network_io/unix/sockets.c ---- apr-1.0.1.orig/network_io/unix/sockets.c 2004-03-10 21:58:34.000000000 +0100 -+++ apr-1.0.1/network_io/unix/sockets.c 2004-12-17 15:19:11.000000000 +0100 -@@ -20,9 +20,10 @@ - #include "apr_portable.h" - #include "apr_arch_inherit.h" - --#if defined(BEOS) && !defined(BEOS_BONE) -+#ifdef BEOS_R5 -+#undef close - #define close closesocket --#endif -+#endif /* BEOS_R5 */ - - static char generic_inaddr_any[16] = {0}; /* big enough for IPv4 or IPv6 */ - -@@ -92,7 +93,28 @@ - - alloc_socket(new, cont); - -+#ifndef BEOS_R5 - (*new)->socketdes = socket(family, type, protocol); -+#else -+ /* For any reason BeOS R5 has an unconventional protocol numbering, -+ * so we need to translate here. */ -+ switch (protocol) { -+ case 0: -+ (*new)->socketdes = socket(family, type, 0); -+ break; -+ case APR_PROTO_TCP: -+ (*new)->socketdes = socket(family, type, IPPROTO_TCP); -+ break; -+ case APR_PROTO_UDP: -+ (*new)->socketdes = socket(family, type, IPPROTO_UDP); -+ break; -+ case APR_PROTO_SCTP: -+ default: -+ errno = EPROTONOSUPPORT; -+ (*new)->socketdes = -1; -+ break; -+ } -+#endif /* BEOS_R5 */ - - #if APR_HAVE_IPV6 - if ((*new)->socketdes < 0 && ofamily == APR_UNSPEC) { -diff -urN apr-1.0.1.orig/network_io/unix/sockopt.c apr-1.0.1/network_io/unix/sockopt.c ---- apr-1.0.1.orig/network_io/unix/sockopt.c 2004-04-03 19:15:52.000000000 +0200 -+++ apr-1.0.1/network_io/unix/sockopt.c 2004-12-17 15:19:11.000000000 +0100 -@@ -323,6 +323,7 @@ - - apr_status_t apr_socket_atmark(apr_socket_t *sock, int *atmark) - { -+#ifndef BEOS_R5 - int oobmark; - - if (ioctl(sock->socketdes, SIOCATMARK, (void*) &oobmark) < 0) -@@ -331,6 +332,9 @@ - *atmark = (oobmark != 0); - - return APR_SUCCESS; -+#else -+ return APR_ENOTIMPL; -+#endif - } - - -diff -urN apr-1.0.1.orig/shmem/beos/shm.c apr-1.0.1/shmem/beos/shm.c ---- apr-1.0.1.orig/shmem/beos/shm.c 2004-06-29 18:38:16.000000000 +0200 -+++ apr-1.0.1/shmem/beos/shm.c 2004-12-17 15:19:11.000000000 +0100 -@@ -13,25 +13,147 @@ - * limitations under the License. - */ - --#include "apr_general.h" --#include "apr_shm.h" -+#include "apr_arch_shm.h" -+#include "apr_arch_thread_mutex.h" - #include "apr_errno.h" - #include "apr_lib.h" -+#include "apr_general.h" -+#include "apr_portable.h" -+#include "apr_ring.h" -+#include "apr_shm.h" - #include "apr_strings.h" -+ -+#include - #include - #include --#include --#include "apr_portable.h" -+#include -+ -+#include -+ -+static struct apr_thread_mutex_t area_handles_lock; - --struct apr_shm_t { -- apr_pool_t *pool; -- void *memblock; -- void *ptr; -- apr_size_t reqsize; -- apr_size_t avail; -- area_id aid; -+APR_RING_HEAD(area_handle_list, beos_area_handle); -+static struct area_handle_list area_handles; -+ -+struct beos_area_handle { -+ APR_RING_ENTRY(beos_area_handle) link; -+ area_id id; /* area id */ -+ char *name; /* area name */ -+ void *address; /* base address */ -+ apr_size_t size; /* requested size */ -+ char *filename; /* name of the file, associated with the area */ -+ int fd; /* FD of the file, associated with the area */ -+ int use_count; /* how often attached in this process */ - }; - -+typedef struct shmem_file_info { -+ apr_size_t size; /* requested size of the shmem */ -+ char name[B_OS_NAME_LENGTH]; /* area name */ -+} shmem_file_info; -+ -+#define LOCK_AREA_HANDLES() apr_thread_mutex_lock(&area_handles_lock) -+#define UNLOCK_AREA_HANDLES() apr_thread_mutex_unlock(\ -+ &area_handles_lock) -+#define INIT_AREA_HANDLE_LINK(handle) APR_RING_ELEM_INIT(handle, link) -+#define FIRST_AREA_HANDLE() APR_RING_FIRST(&area_handles) -+#define NEXT_AREA_HANDLE(handle) APR_RING_NEXT(handle, link) -+#define AREA_HANDLES_END() APR_RING_SENTINEL(&area_handles, \ -+ beos_area_handle, link) -+#define ADD_AREA_HANDLE(handle) APR_RING_INSERT_TAIL(&area_handles, \ -+ handle, \ -+ beos_area_handle, \ -+ link) -+#define REMOVE_AREA_HANDLE(handle) APR_RING_REMOVE(handle, link) -+ -+/* Initializes the area handle list and the semaphore that protects it. Invoked -+ by apr_initialize(). */ -+apr_status_t apr_beos_setup_shmem() -+{ -+ APR_RING_INIT(&area_handles, beos_area_handle, link); -+ return apr_beos_thread_mutex_init(&area_handles_lock, 0, NULL); -+} -+ -+/* Called directly after fork() in the child process. Sets up the semaphore -+ that protects the area handle list in a child process and repairs the shared -+ memory areas. The problem is that BeOS fork() clones all areas copy on write, -+ which requires us to re-clone the parent's areas. */ -+apr_status_t apr_beos_shmem_child_init() -+{ -+ apr_status_t error; -+ beos_area_handle *handle; -+ -+ /* re-init the lock */ -+ error = apr_beos_thread_mutex_init(&area_handles_lock, 0, NULL); -+ if (error != B_OK) -+ return error; -+ -+ /* now iterate through the area handle list and clone all areas */ -+ for (handle = FIRST_AREA_HANDLE(); -+ handle != AREA_HANDLES_END(); -+ handle = NEXT_AREA_HANDLE(handle)) { -+ /* delete the clone area and clone the original one */ -+ delete_area(area_for(handle->address)); -+ handle->id = clone_area(handle->name, &(handle->address), -+ B_EXACT_ADDRESS, B_READ_AREA | B_WRITE_AREA, -+ handle->id); -+ if (handle->id < 0) -+ return handle->id; -+ } -+ -+ return APR_SUCCESS; -+} -+ -+/* Creates a new area handle from a given valid area_info. */ -+static beos_area_handle *create_area_handle(area_id id, const char *name, -+ void *address, apr_size_t size, -+ const char *filename, int fd, -+ int useCount) -+{ -+ beos_area_handle *handle -+ = (beos_area_handle*)malloc(sizeof(beos_area_handle)); -+ if (!handle) -+ return NULL; -+ -+ INIT_AREA_HANDLE_LINK(handle); -+ handle->id = id; -+ handle->name = strdup(name); -+ handle->address = address; -+ handle->size = size; -+ handle->filename = (filename ? strdup(filename) : NULL); -+ handle->fd = fd; -+ handle->use_count = useCount; -+ -+ if (!handle->name || (filename && !handle->filename)) { -+ free(handle->name); -+ free(handle->filename); -+ free(handle); -+ return NULL; -+ } -+ -+ return handle; -+} -+ -+static apr_status_t shm_cleanup(void *_m) -+{ -+ apr_shm_t *m = (apr_shm_t*)_m; -+ -+ LOCK_AREA_HANDLES(); -+ -+ if (m->handle && --m->handle->use_count == 0) { -+ REMOVE_AREA_HANDLE(m->handle); -+ delete_area(m->handle->id); -+ if (m->handle->fd >= 0) -+ close(m->handle->fd); -+ free(m->handle->name); -+ free(m->handle); -+ } -+ m->handle = NULL; -+ -+ UNLOCK_AREA_HANDLES(); -+ -+ return APR_SUCCESS; -+} -+ - APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, - apr_size_t reqsize, - const char *filename, -@@ -40,53 +162,102 @@ - apr_size_t pagesize; - area_id newid; - char *addr; -- char shname[B_OS_NAME_LENGTH]; -+ shmem_file_info fileInfo; -+ char *shname = fileInfo.name; -+ int fd = -1; -+ int num = 0; -+ status_t error = B_OK; -+ beos_area_handle *handle = NULL; - - (*m) = (apr_shm_t *)apr_pcalloc(p, sizeof(apr_shm_t)); - /* we MUST allocate in pages, so calculate how big an area we need... */ - pagesize = ((reqsize + B_PAGE_SIZE - 1) / B_PAGE_SIZE) * B_PAGE_SIZE; -- -- if (!filename) { -- int num = 0; -- snprintf(shname, B_OS_NAME_LENGTH, "apr_shmem_%ld", find_thread(NULL)); -- while (find_area(shname) >= 0) -- snprintf(shname, B_OS_NAME_LENGTH, "apr_shmem_%ld_%d", -- find_thread(NULL), num++); -- } -- newid = create_area(filename ? filename : shname, -- (void*)&addr, B_ANY_ADDRESS, -- pagesize, B_LAZY_LOCK, B_READ_AREA|B_WRITE_AREA); - -- if (newid < 0) -- return errno; -+ -+ /* create a unique name for the area */ -+ snprintf(shname, B_OS_NAME_LENGTH, "apr_shmem_%ld", find_thread(NULL)); -+ while (find_area(shname) >= 0) -+ snprintf(shname, B_OS_NAME_LENGTH, "apr_shmem_%ld_%d", -+ find_thread(NULL), num++); -+ -+ LOCK_AREA_HANDLES(); -+ -+ /* if a file name was given, create the file */ -+ if (filename) { -+ fd = open(filename, O_RDWR |O_CREAT | O_TRUNC | O_EXCL, -+ S_IRUSR | S_IWUSR, S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); -+ if (fd < 0) -+ return errno; -+ } -+ -+ /* write the shmem info to the file */ -+ if (fd >= 0) { -+ int len = (shname + strlen(shname)) - (char*)&fileInfo; -+ fileInfo.size = reqsize; -+ if (write(fd, &fileInfo, len) < 0) -+ error = errno; -+ } -+ -+ /* allocate the area */ -+ if (error == B_OK) { -+ newid = create_area(shname, (void*)&addr, B_ANY_ADDRESS, -+ pagesize, B_LAZY_LOCK, B_READ_AREA | B_WRITE_AREA); -+ if (newid < 0) -+ error = newid; -+ } -+ -+ /* allocate an area handle */ -+ if (error == B_OK) { -+ handle = create_area_handle(newid, shname, addr, reqsize, filename, fd, -+ 1); -+ /* add it to the list */ -+ if (handle) -+ ADD_AREA_HANDLE(handle); -+ else -+ error = APR_ENOMEM; -+ } -+ -+ UNLOCK_AREA_HANDLES(); -+ -+ /* cleanup on error */ -+ if (error != B_OK) { -+ if (newid >= 0) -+ delete_area(newid); -+ if (filename) -+ unlink(filename); -+ close(fd); -+ return error; -+ } - - (*m)->pool = p; -- (*m)->aid = newid; -- (*m)->memblock = addr; -- (*m)->ptr = (void*)addr; -- (*m)->avail = pagesize; /* record how big an area we actually created... */ -- (*m)->reqsize = reqsize; -+ (*m)->handle = handle; -+ -+ apr_pool_cleanup_register(p, *m, shm_cleanup, apr_pool_cleanup_null); - - return APR_SUCCESS; - } - - APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) - { -- delete_area(m->aid); -- m->avail = 0; -- m->memblock = NULL; -- return APR_SUCCESS; -+ LOCK_AREA_HANDLES(); -+ -+ if (m->handle && m->handle->filename) { -+ unlink(m->handle->filename); -+ free(m->handle->filename); -+ m->handle->filename = NULL; -+ } -+ -+ UNLOCK_AREA_HANDLES(); -+ -+ return apr_pool_cleanup_run(m->pool, m, shm_cleanup); - } - - APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, - apr_pool_t *pool) - { -- area_id deleteme = find_area(filename); -- -- if (deleteme == B_NAME_NOT_FOUND) -- return APR_EINVAL; -+ if (unlink(filename) < 0) -+ return errno; - -- delete_area(deleteme); - return APR_SUCCESS; - } - -@@ -94,58 +265,132 @@ - const char *filename, - apr_pool_t *pool) - { -- area_info ai; -- thread_info ti; -- apr_shm_t *new_m; -- area_id deleteme = find_area(filename); -- -- if (deleteme == B_NAME_NOT_FOUND) -+ int fd = -1; -+ shmem_file_info fileInfo; -+ char *areaName = fileInfo.name; -+ int fileInfoLen; -+ int nameLen = 0; -+ beos_area_handle *handle = NULL; -+ area_id id = -1; -+ status_t error = B_OK; -+ -+ /* open the file */ -+ fd = open(filename, O_RDONLY); -+ if (fd < 0) - return APR_EINVAL; - -- new_m = (apr_shm_t*)apr_palloc(pool, sizeof(apr_shm_t*)); -- if (new_m == NULL) -- return APR_ENOMEM; -- new_m->pool = pool; -- -- get_area_info(deleteme, &ai); -- get_thread_info(find_thread(NULL), &ti); -- -- if (ti.team != ai.team) { -- area_id narea; -- -- narea = clone_area(ai.name, &(ai.address), B_CLONE_ADDRESS, -- B_READ_AREA|B_WRITE_AREA, ai.area); -- -- if (narea < B_OK) -- return narea; -- -- get_area_info(narea, &ai); -- new_m->aid = narea; -- new_m->memblock = ai.address; -- new_m->ptr = (void*)ai.address; -- new_m->avail = ai.size; -- new_m->reqsize = ai.size; -+ /* read the file info */ -+ fileInfoLen = read(fd, &fileInfo, sizeof(shmem_file_info) - 1); -+ if (fileInfoLen > 0) { -+ nameLen = (char*)&fileInfo + fileInfoLen - areaName; -+ if (nameLen > 0) { -+ areaName[nameLen] = '\0'; -+ nameLen = strlen(areaName); -+ } -+ } -+ if (nameLen <= 0) -+ error = APR_EINVAL; -+ -+ LOCK_AREA_HANDLES(); -+ -+ /* check, if we already know the area */ -+ if (error == B_OK) { -+ beos_area_handle *itHandle; -+ for (itHandle = FIRST_AREA_HANDLE(); -+ itHandle != AREA_HANDLES_END(); -+ itHandle = NEXT_AREA_HANDLE(itHandle)) { -+ if (strcmp(itHandle->name, areaName) == 0) { -+ /* OK, found */ -+ handle = itHandle; -+ close(fd); -+ fd = -1; -+ break; -+ } -+ } -+ } -+ -+ /* if we don't know the area yet, get it */ -+ if (error == B_OK && !handle) { -+ id = find_area(areaName); -+ if (id < 0) -+ error = APR_EINVAL; -+ } -+ -+ /* if we have no error till now, then there definitely exists an area */ -+ if (error == B_OK) { -+ /* allocate memory for the new shared memory handle */ -+ *m = (apr_shm_t*)apr_palloc(pool, sizeof(apr_shm_t*)); -+ if (!*m) -+ error = APR_ENOMEM; - } - -- (*m) = new_m; -+ /* if we don't know the area yet, we clone it */ -+ if (error == B_OK && !handle) { -+ area_info areaInfo; -+ error = get_area_info(id, &areaInfo); -+ if (error == B_OK && areaInfo.size < fileInfo.size) { -+ /* something's fishy: the actual area size is less than the -+ * shmem region it is supposed to contain */ -+ error = APR_EINVAL; -+ } -+ if (error == B_OK) { -+ void *address; -+ id = clone_area(areaInfo.name, &address, B_ANY_ADDRESS, -+ B_READ_AREA | B_WRITE_AREA, areaInfo.area); -+ if (id >= 0) { -+ /* create the area */ -+ handle = create_area_handle(id, areaName, address, -+ fileInfo.size, filename, fd, 0); -+ /* The size we supply here is actually not the real size -+ * of the shared memory region, but is rounded up to a -+ * page size multiple. We could store the real size in -+ * the file. */ - -- return APR_SUCCESS; -+ /* add it to the list */ -+ if (handle) { -+ ADD_AREA_HANDLE(handle); -+ } -+ else { -+ delete_area(id); -+ error = APR_ENOMEM; -+ } -+ } -+ else -+ error = id; -+ } -+ } -+ -+ /* now we should have a handle -- nothing can go wrong anymore */ -+ if (error == B_OK) { -+ (*m)->pool = pool; -+ (*m)->handle = handle; -+ (*m)->handle->use_count++; -+ apr_pool_cleanup_register(pool, *m, shm_cleanup, apr_pool_cleanup_null); -+ } -+ -+ UNLOCK_AREA_HANDLES(); -+ -+ /* cleanup on error */ -+ if (error != B_OK) { -+ close(fd); -+ } -+ -+ return error; - } - - APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m) - { -- delete_area(m->aid); -- return APR_SUCCESS; -+ return apr_pool_cleanup_run(m->pool, m, shm_cleanup); - } - - APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m) - { -- return m->memblock; -+ return (m->handle ? m->handle->address : NULL); - } - - APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) - { -- return m->reqsize; -+ return (m->handle ? m->handle->size : 0); - } - - APR_POOL_IMPLEMENT_ACCESSOR(shm) -diff -urN apr-1.0.1.orig/test/Makefile.in apr-1.0.1/test/Makefile.in ---- apr-1.0.1.orig/test/Makefile.in 2004-11-17 02:07:02.000000000 +0100 -+++ apr-1.0.1/test/Makefile.in 2004-12-17 15:19:11.000000000 +0100 -@@ -72,7 +72,7 @@ - $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -prefer-pic -c $(srcdir)/mod_test.c && touch $@ - - mod_test.la: mod_test.slo $(LOCAL_LIBS) -- $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ -+ $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ $(LOCAL_LIBS) $(ALL_LIBS) - - libmod_test.la: mod_test.slo $(LOCAL_LIBS) - $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -avoid-version mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ $(LOCAL_LIBS) $(ALL_LIBS) -diff -urN apr-1.0.1.orig/test/testdso.c apr-1.0.1/test/testdso.c ---- apr-1.0.1.orig/test/testdso.c 2004-05-14 16:43:22.000000000 +0200 -+++ apr-1.0.1/test/testdso.c 2004-12-17 15:19:11.000000000 +0100 -@@ -77,9 +77,11 @@ - ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - ABTS_PTR_NOTNULL(tc, func1); - -- function = (void (*)(char *))func1; -- (*function)(teststr); -- ABTS_STR_EQUAL(tc, "Hello - I'm a DSO!\n", teststr); -+ if (status == APR_SUCCESS) { -+ function = (void (*)(char *))func1; -+ (*function)(teststr); -+ ABTS_STR_EQUAL(tc, "Hello - I'm a DSO!\n", teststr); -+ } - - apr_dso_unload(h); - } -@@ -100,9 +102,11 @@ - ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - ABTS_PTR_NOTNULL(tc, func1); - -- function = (int (*)(int))func1; -- status = (*function)(5); -- ABTS_INT_EQUAL(tc, 5, status); -+ if (status == APR_SUCCESS) { -+ function = (int (*)(int))func1; -+ status = (*function)(5); -+ ABTS_INT_EQUAL(tc, 5, status); -+ } - - apr_dso_unload(h); - } -diff -urN apr-1.0.1.orig/test/testpipe.c apr-1.0.1/test/testpipe.c ---- apr-1.0.1.orig/test/testpipe.c 2004-05-14 16:43:22.000000000 +0200 -+++ apr-1.0.1/test/testpipe.c 2004-12-17 15:19:11.000000000 +0100 -@@ -23,6 +23,11 @@ - #include "apr_thread_proc.h" - #include "apr_strings.h" - -+/* BeOS doesn't offer non-blocking pipes */ -+#if defined(BEOS) -+# define BLOCKING_PIPE_ONLY -+#endif -+ - static apr_file_t *readp = NULL; - static apr_file_t *writep = NULL; - -@@ -60,6 +65,10 @@ - ABTS_PTR_NOTNULL(tc, readp); - ABTS_PTR_NOTNULL(tc, writep); - -+#ifdef BLOCKING_PIPE_ONLY -+ (void)timeout; -+ ABTS_NOT_IMPL(tc, "no non-blocking pipe support"); -+#else - rv = apr_file_pipe_timeout_get(readp, &timeout); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, -1, timeout); -@@ -70,6 +79,7 @@ - rv = apr_file_pipe_timeout_get(readp, &timeout); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, apr_time_from_sec(1), timeout); -+#endif - } - - static void read_write(abts_case *tc, void *data) -@@ -86,12 +96,16 @@ - ABTS_PTR_NOTNULL(tc, readp); - ABTS_PTR_NOTNULL(tc, writep); - -+#ifdef BLOCKING_PIPE_ONLY -+ ABTS_NOT_IMPL(tc, "no non-blocking pipe support"); -+#else - rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1)); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - - rv = apr_file_read(readp, buf, &nbytes); - ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); - ABTS_INT_EQUAL(tc, 0, nbytes); -+#endif - } - - static void read_write_notimeout(abts_case *tc, void *data) -@@ -122,6 +136,9 @@ - - static void test_pipe_writefull(abts_case *tc, void *data) - { -+#ifdef BLOCKING_PIPE_ONLY -+ ABTS_NOT_IMPL(tc, "no non-blocking pipe support"); -+#else - int iterations = 1000; - int i; - int bytes_per_iteration = 8000; -@@ -177,6 +194,7 @@ - apr_proc_wait(&proc, NULL, &why, APR_WAIT) == APR_CHILD_DONE); - - ABTS_ASSERT(tc, "child terminated normally", why == APR_PROC_EXIT); -+#endif - } - - abts_suite *testpipe(abts_suite *suite) -diff -urN apr-1.0.1.orig/test/testpoll.c apr-1.0.1/test/testpoll.c ---- apr-1.0.1.orig/test/testpoll.c 2004-07-06 05:38:06.000000000 +0200 -+++ apr-1.0.1/test/testpoll.c 2004-12-17 15:19:11.000000000 +0100 -@@ -21,6 +21,11 @@ - #include "apr_network_io.h" - #include "apr_poll.h" - -+/* non-BONE BeOS select() only supports the read set */ -+#if defined(BEOS) && !defined(HAVE_BONE_VERSION) -+# define NO_POLLOUT_SUPPORT 1 -+#endif -+ - #define SMALL_NUM_SOCKETS 3 - /* We can't use 64 here, because some platforms *ahem* Solaris *ahem* have - * a default limit of 64 open file descriptors per process. If we use -@@ -425,6 +430,9 @@ - - static void pollset_remove(abts_case *tc, void *data) - { -+#ifdef NO_POLLOUT_SUPPORT -+ ABTS_NOT_IMPL(tc, "no APR_POLLOUT support"); -+#else - apr_status_t rv; - apr_pollset_t *pollset; - const apr_pollfd_t *hot_files; -@@ -497,6 +505,7 @@ - (hot_files[1].client_data == (void *)4)) || - ((hot_files[0].client_data == (void *)4) && - (hot_files[1].client_data == (void *)1))); -+#endif - } - - abts_suite *testpoll(abts_suite *suite) -@@ -527,9 +536,7 @@ - abts_run_test(suite, clear_middle_pollset, NULL); - abts_run_test(suite, send_last_pollset, NULL); - abts_run_test(suite, clear_last_pollset, NULL); -- - abts_run_test(suite, pollset_remove, NULL); -- - abts_run_test(suite, close_all_sockets, NULL); - - return suite; -diff -urN apr-1.0.1.orig/test/testsockopt.c apr-1.0.1/test/testsockopt.c ---- apr-1.0.1.orig/test/testsockopt.c 2004-08-01 00:36:03.000000000 +0200 -+++ apr-1.0.1/test/testsockopt.c 2004-12-17 15:19:11.000000000 +0100 -@@ -19,6 +19,11 @@ - #include "apr_lib.h" - #include "testutil.h" - -+/* non-BONE BeOS versions don't know SO_KEEPALIVE */ -+#if defined(BEOS) && !defined(HAVE_BONE_VERSION) -+# define NO_SO_KEEPALIVE 1 -+#endif -+ - static apr_socket_t *sock = NULL; - - static void create_socket(abts_case *tc, void *data) -@@ -32,6 +37,9 @@ - - static void set_keepalive(abts_case *tc, void *data) - { -+#ifdef NO_SO_KEEPALIVE -+ ABTS_NOT_IMPL(tc, "no SO_KEEPALIVE socket option"); -+#else - apr_status_t rv; - apr_int32_t ck; - -@@ -41,6 +49,7 @@ - rv = apr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 1, ck); -+#endif - } - - static void set_debug(abts_case *tc, void *data) -@@ -62,6 +71,9 @@ - - static void remove_keepalive(abts_case *tc, void *data) - { -+#ifdef NO_SO_KEEPALIVE -+ ABTS_NOT_IMPL(tc, "no SO_KEEPALIVE socket option"); -+#else - apr_status_t rv; - apr_int32_t ck; - -@@ -75,6 +87,7 @@ - rv = apr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 0, ck); -+#endif - } - - static void corkable(abts_case *tc, void *data) -diff -urN apr-1.0.1.orig/threadproc/beos/Makefile.in apr-1.0.1/threadproc/beos/Makefile.in ---- apr-1.0.1.orig/threadproc/beos/Makefile.in 1970-01-01 01:00:00.000000000 +0100 -+++ apr-1.0.1/threadproc/beos/Makefile.in 2004-12-17 15:18:45.000000000 +0100 -@@ -0,0 +1,21 @@ -+srcdir = @srcdir@ -+VPATH = @srcdir@ -+ -+TARGETS = \ -+ apr_proc_stub -+ -+# bring in rules.mk for standard functionality -+@INCLUDE_RULES@ -+ -+INCDIR=../../include -+OSDIR=$(INCDIR)/arch/@OSDIR@ -+DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ -+INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch -I$(OSDIR) -I$(DEFOSDIR) -+ -+CLEAN_TARGETS = apr_proc_stub /boot/home/config/bin/apr_proc_stub -+ -+apr_proc_stub: -+ $(CC) apr_proc_stub.c \ -+ && cp apr_proc_stub /boot/home/config/bin -+ -+# DO NOT REMOVE -diff -urN apr-1.0.1.orig/threadproc/beos/apr_proc_stub.c apr-1.0.1/threadproc/beos/apr_proc_stub.c ---- apr-1.0.1.orig/threadproc/beos/apr_proc_stub.c 2004-02-13 10:38:38.000000000 +0100 -+++ apr-1.0.1/threadproc/beos/apr_proc_stub.c 2004-12-17 15:19:11.000000000 +0100 -@@ -13,15 +13,17 @@ - * limitations under the License. - */ - -+#include - #include - #include - #include - #include - - struct pipefd { -- int in; -- int out; -- int err; -+ int in; -+ int out; -+ int err; -+ port_id port; - }; - - int main(int argc, char *argv[]) { -@@ -32,44 +34,65 @@ - * argv[2] = progname to execute - * rest of arguments to be passed to program - */ -- char *progname = argv[2]; -- char *directory = argv[1]; -- struct pipefd *pfd; -- thread_id sender; -- void *buffer; -- char ** newargs; -- int i = 0; -- -- newargs = (char**)malloc(sizeof(char*) * (argc - 1)); -- -- buffer = (void*)malloc(sizeof(struct pipefd)); -- /* this will block until we get the data */ -- receive_data(&sender, buffer, sizeof(struct pipefd)); -- pfd = (struct pipefd*)buffer; -- -- if (pfd->in > STDERR_FILENO) { -- if (dup2(pfd->in, STDIN_FILENO) != STDIN_FILENO) return (-1); -- close (pfd->in); -- } -- if (pfd->out > STDERR_FILENO) { -- if (dup2(pfd->out, STDOUT_FILENO) != STDOUT_FILENO) return (-1); -- close (pfd->out); -- } -- if (pfd->err > STDERR_FILENO) { -- if (dup2(pfd->err, STDERR_FILENO) != STDERR_FILENO) return (-1); -- close (pfd->err); -- } -- -- for (i=3;i<=argc;i++){ -- newargs[i-3] = argv[i]; -- } -- -- /* tell the caller we're OK to start */ -- send_data(sender,1,NULL,0); -- -- if (directory != NULL) -- chdir(directory); -- execve (progname, newargs, environ); -+ char *progname = argv[2]; -+ char *directory = argv[1]; -+ struct pipefd pfd; -+ thread_id sender; -+ char **newargs = argv + 3; -+ int i = 0; -+ status_t error = B_OK; -+ -+ /* this will block until we get the data */ -+ receive_data(&sender, &pfd, sizeof(struct pipefd)); -+ -+ if (argc < 3) -+ error = B_BAD_VALUE; -+ -+ newargs = (char**)malloc(sizeof(char*) * (argc - 1)); -+ for (i=3;i<=argc;i++) { -+ newargs[i-3] = argv[i]; -+ } -+ -+ if (error == B_OK && pfd.in > STDERR_FILENO) { -+ if (dup2(pfd.in, STDIN_FILENO) != STDIN_FILENO) -+ error = errno; -+ close(pfd.in); -+ } -+ if (error == B_OK && pfd.out > STDERR_FILENO) { -+ if (dup2(pfd.out, STDOUT_FILENO) != STDOUT_FILENO) -+ error = errno; -+ close(pfd.out); -+ } -+ if (error == B_OK && pfd.err > STDERR_FILENO) { -+ if (dup2(pfd.err, STDERR_FILENO) != STDERR_FILENO) -+ error = errno; -+ close(pfd.err); -+ } -+ -+ if (error == B_OK && chdir(directory) < 0) -+ error = errno; -+ -+ if (error == B_OK) { -+ /* get our parent's team ID (the port owner) and our team ID */ -+ port_info portInfo; -+ thread_info threadInfo; -+ get_port_info(pfd.port, &portInfo); -+ get_thread_info(find_thread(NULL), &threadInfo); -+ -+ /* transfer the port ownership to us, so the the port will -+ * automatically be deleted, if execv() succeeds */ -+ set_port_owner(pfd.port, threadInfo.team); -+ -+ if (execv(progname, newargs) < 0) -+ error = errno; -+ -+ /* execv() failed; transfer the port ownership back to our parent, -+ * so that we can send the error code to it */ -+ set_port_owner(pfd.port, portInfo.team); -+ } - -- return (-1); -+ /* something went wrong; send our parent the error code */ -+ write_port(pfd.port, 0, &error, sizeof(error)); -+ -+ return (-1); - } -diff -urN apr-1.0.1.orig/threadproc/beos/proc.c apr-1.0.1/threadproc/beos/proc.c ---- apr-1.0.1.orig/threadproc/beos/proc.c 2004-06-29 18:35:57.000000000 +0200 -+++ apr-1.0.1/threadproc/beos/proc.c 2004-12-17 15:19:11.000000000 +0100 -@@ -13,13 +13,22 @@ - * limitations under the License. - */ - -+#include "apr_arch_shm.h" - #include "apr_arch_threadproc.h" -+#include "apr_random.h" -+#include "apr_signal.h" - #include "apr_strings.h" - -+#include -+#include -+ -+#include -+ - struct send_pipe { -- int in; -- int out; -- int err; -+ int in; -+ int out; -+ int err; -+ port_id port; - }; - - APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *pool) -@@ -113,18 +122,11 @@ - APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, - const char *dir) - { -- char * cwd; -- if (dir[0] != '/') { -- cwd = (char*)malloc(sizeof(char) * PATH_MAX); -- getcwd(cwd, PATH_MAX); -- attr->currdir = (char *)apr_pstrcat(attr->pool, cwd, "/", dir, NULL); -- free(cwd); -- } else { -- attr->currdir = (char *)apr_pstrdup(attr->pool, dir); -- } -+ attr->currdir = apr_pstrdup(attr->pool, dir); - if (attr->currdir) { - return APR_SUCCESS; - } -+ - return APR_ENOMEM; - } - -@@ -144,53 +146,53 @@ - APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) - { - int pid; -+ port_id port; -+ status_t error = B_OK; -+ status_t childInitError = B_OK; -+ int32 code; -+ -+ /* we create a port through which the child will send us whether its -+ * initialization was successful */ -+ port = create_port(1, "apr_fork"); -+ if (port < 0) -+ return port; - - if ((pid = fork()) < 0) { -+ delete_port(port); - return errno; - } - else if (pid == 0) { -- /* This is really ugly... -- * The semantics of BeOS's fork() are that areas (used for shared -- * memory) get COW'd :-( The only way we can make shared memory -- * work across fork() is therefore to find any areas that have -- * been created and then clone them into our address space. -- * Thankfully only COW'd areas have the lock variable set at -- * anything but 0, so we can use that to find the areas we need to -- * copy. Of course what makes it even worse is that the loop through -- * the area's will go into an infinite loop, eating memory and then -- * eventually segfault unless we know when we reach then end of the -- * "original" areas and stop. Why? Well, we delete the area and then -- * add another to the end of the list... -- */ -- area_info ai; -- int32 cookie = 0; -- area_id highest = 0; -- -- while (get_next_area_info(0, &cookie, &ai) == B_OK) -- if (ai.area > highest) -- highest = ai.area; -- cookie = 0; -- while (get_next_area_info(0, &cookie, &ai) == B_OK) { -- if (ai.area > highest) -- break; -- if (ai.lock > 0) { -- area_id original = find_area(ai.name); -- delete_area(ai.area); -- clone_area(ai.name, &ai.address, B_CLONE_ADDRESS, -- ai.protection, original); -- } -- } -- - proc->pid = pid; -- proc->in = NULL; -+ proc->in = NULL; - proc->out = NULL; - proc->err = NULL; -+ -+ error = apr_beos_shmem_child_init(); -+ write_port(port, 0, &error, sizeof(error)); -+ if (error != B_OK) -+ exit(1); -+ -+ apr_random_after_fork(proc); -+ - return APR_INCHILD; - } - proc->pid = pid; - proc->in = NULL; - proc->out = NULL; - proc->err = NULL; -+ -+ /* get the child initialization status */ -+ do { -+ error = read_port(port, &code, &childInitError, sizeof(childInitError)); -+ } while (error == EINTR); -+ -+ delete_port(port); -+ -+ if (error >= B_OK) -+ error = childInitError; -+ if (error != B_OK) -+ return error; -+ - return APR_INPARENT; - } - -@@ -215,62 +217,234 @@ - return APR_SUCCESS; - } - -+static status_t find_program(const char **resolvedProgramName, -+ const char *programName, apr_procattr_t *attr, -+ const char *const *env, apr_pool_t *pool) -+{ -+ const char *pathVarName = "PATH="; -+ int pathVarNameLen = strlen(pathVarName); -+ const char *paths = NULL; -+ int programNameLen = strlen(programName); -+ int i; -+ -+ /* If the program name is absolute, then there's nothing to do. -+ * If the program name consists of more than one path element, then we -+ * consider it a relative path and don't search in PATH either. */ -+ if (*programName == '/' || strchr(programName, '/')) { -+ *resolvedProgramName = programName; -+ return B_OK; -+ } -+ -+ /* get the PATH environment variable */ -+ for (i = 0; env[i]; i++) { -+ const char *var = env[i]; -+ if (strncmp(var, pathVarName, pathVarNameLen) == 0) { -+ paths = var + pathVarNameLen; -+ break; -+ } -+ } -+ if (!paths) -+ return APR_ENOENT; -+ -+ /* iterate through the paths */ -+ do { -+ const char *pathEnd = strchr(paths, ':'); -+ int pathLen = (pathEnd ? pathEnd - paths : strlen(paths)); -+ -+ /* We skip empty paths and those that would become too long. -+ * The latter is not really correct, but practically irrelevant. */ -+ if (pathLen > 0 -+ && pathLen + 1 + programNameLen < B_PATH_NAME_LENGTH) { -+ /* get the path */ -+ char path[B_PATH_NAME_LENGTH]; -+ struct stat st; -+ memcpy(path, paths, pathLen); -+ path[pathLen] = '\0'; -+ -+ /* get the program path */ -+ strcat(path, "/"); -+ strcat(path, programName); -+ -+ /* stat() the path to be sure, there is a file */ -+ if (stat(path, &st) == 0 && S_ISREG(st.st_mode)) { -+ /* If the path is relative, we make it absolute by -+ * prepending the current working directory, so there -+ * won't be problems when changing the cwd later */ -+ if (*path == '/') { -+ *resolvedProgramName = apr_pstrdup(pool, path); -+ } -+ else { -+ char cwd[B_PATH_NAME_LENGTH]; -+ getcwd(cwd, sizeof(cwd)); -+ *resolvedProgramName = apr_pstrcat(pool, cwd, "/", -+ path, NULL); -+ } -+ return B_OK; -+ } -+ } -+ -+ paths = (pathEnd ? pathEnd + 1 : NULL); -+ } while (paths); -+ -+ /* not found in PATH */ -+ return APR_ENOENT; -+} -+ -+typedef struct char_buffer { -+ char *buffer; -+ int size; -+} char_buffer; -+ -+static void append_char(char_buffer *buffer, char c) -+{ -+ if (buffer->buffer) { -+ *(buffer->buffer) = c; -+ buffer->buffer++; -+ } -+ buffer->size++; -+} -+ -+static void prepare_shell_args(const char *progname, const char * const *args, -+ int argc, char_buffer *buffer) -+{ -+ int i; -+ -+ for (i = 0; i < argc; i++) { -+ const char *arg = args[i]; -+ -+ /* replace the first argument with the program name and separate the -+ * other arguments with a space */ -+ if (i == 0) -+ arg = progname; -+ else -+ append_char(buffer, ' '); -+ -+ if (*arg == '\0') { -+ /* empty arg */ -+ append_char(buffer, '"'); -+ append_char(buffer, '"'); -+ } -+ else { -+ while (*arg) { -+ /* escape special characters */ -+ if (strchr(" ()?*&\"'[]^\\~|;!<>*$", *arg)) -+ append_char(buffer, '\\'); -+ append_char(buffer, *arg); -+ arg++; -+ } -+ } -+ } -+} -+ - APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, - const char * const *args, - const char * const *env, - apr_procattr_t *attr, - apr_pool_t *pool) - { -- int i=0,nargs=0; -- char **newargs = NULL; -- thread_id newproc, sender; -- struct send_pipe *sp; -- char * dir = NULL; -- -- sp = (struct send_pipe *)apr_palloc(pool, sizeof(struct send_pipe)); -+ int i = 0, nargs = 0; -+ const char **newargs = NULL; -+ thread_id newproc; -+ struct send_pipe sp; -+ const char *shellArgs[4] = { SHELL_PATH, "-c", NULL, NULL }; -+ status_t error; -+ status_t childError; - - new->in = attr->parent_in; - new->err = attr->parent_err; - new->out = attr->parent_out; -- sp->in = attr->child_in ? attr->child_in->filedes : -1; -- sp->out = attr->child_out ? attr->child_out->filedes : -1; -- sp->err = attr->child_err ? attr->child_err->filedes : -1; -+ sp.in = attr->child_in ? attr->child_in->filedes : -1; -+ sp.out = attr->child_out ? attr->child_out->filedes : -1; -+ sp.err = attr->child_err ? attr->child_err->filedes : -1; -+ -+ /* Get the correct environment to use. */ -+ switch (attr->cmdtype) { -+ case APR_SHELLCMD: -+ case APR_PROGRAM: -+ break; -+ case APR_PROGRAM_ENV: -+ case APR_PROGRAM_PATH: -+ case APR_SHELLCMD_ENV: -+ env = (const char *const*)environ; -+ break; -+ } -+ if (!env) -+ env = (const char *const*)environ; -+ -+ /* In case of APR_PROGRAM_PATH we need to find the program ourselves. In -+ * the other cases, the program name shall either be considered a path or -+ * the shell searches for the program. */ -+ if (attr->cmdtype == APR_PROGRAM_PATH) { -+ error = find_program(&progname, progname, attr, env, pool); -+ if (error != B_OK) -+ return error; -+ } -+ -+ /* if the program shall be started via shell, we need to prepare the -+ * arguments */ -+ if (attr->cmdtype == APR_SHELLCMD || attr->cmdtype == APR_SHELLCMD_ENV) { -+ char_buffer charBuffer = { NULL, 0 }; -+ int argc = 0; -+ -+ /* count the arguments */ -+ while (args && args[argc]) { -+ argc++; -+ } -+ if (argc == 0) -+ return APR_EINVAL; -+ -+ /* first we get the length */ -+ prepare_shell_args(progname, args, argc, &charBuffer); - -+ /* allocate the memory and get the args for real */ -+ charBuffer.buffer = (char*)apr_palloc(pool, charBuffer.size + 1); -+ charBuffer.size = 0; -+ shellArgs[2] = charBuffer.buffer; -+ prepare_shell_args(progname, args, argc, &charBuffer); -+ *(charBuffer.buffer) = '\0'; -+ -+ /* replace the program name and the arguments */ -+ progname = shellArgs[0]; -+ args = shellArgs; -+ } -+ -+ /* count the arguments */ - i = 0; - while (args && args[i]) { - i++; - } - -- newargs = (char**)malloc(sizeof(char *) * (i + 4)); -- newargs[0] = strdup("/boot/home/config/bin/apr_proc_stub"); -+ newargs = (const char**)malloc(sizeof(const char *) * (i + 4)); -+ newargs[0] = "/boot/home/config/bin/apr_proc_stub"; - if (attr->currdir == NULL) { -- /* we require the directory , so use a temp. variable */ -- dir = malloc(sizeof(char) * PATH_MAX); -- getcwd(dir, PATH_MAX); -- newargs[1] = strdup(dir); -- free(dir); -- } else { -- newargs[1] = strdup(attr->currdir); -+ newargs[1] = "."; - } -- newargs[2] = strdup(progname); -+ else { -+ newargs[1] = attr->currdir; -+ } -+ newargs[2] = progname; - i=0;nargs = 3; - - while (args && args[i]) { -- newargs[nargs] = strdup(args[i]); -+ newargs[nargs] = args[i]; - i++;nargs++; - } - newargs[nargs] = NULL; - -- /* ### we should be looking at attr->cmdtype in here... */ -- -- newproc = load_image(nargs, (const char**)newargs, (const char**)env); -+ /* create a temporary port, the stub will use to report an error back to -+ * us */ -+ sp.port = create_port(1, "apr_proc_create"); -+ if (sp.port < 0) -+ return sp.port; -+ -+ /* load the stub */ -+ newproc = load_image(nargs, newargs, (const char**)env); - - /* load_image copies the data so now we can free it... */ -- while (--nargs >= 0) -- free (newargs[nargs]); - free(newargs); - - if (newproc < B_NO_ERROR) { -+ delete_port(sp.port); - return errno; - } - -@@ -286,15 +460,25 @@ - apr_file_close(attr->child_err); - } - -- send_data(newproc, 0, (void*)sp, sizeof(struct send_pipe)); -+ send_data(newproc, 0, &sp, sizeof(struct send_pipe)); - new->pid = newproc; - - /* before we go charging on we need the new process to get to a -- * certain point. When it gets there it'll let us know and we -- * can carry on. */ -- receive_data(&sender, (void*)NULL,0); -- -- return APR_SUCCESS; -+ * certain point. The stub will either send us an error code back through -+ * the port or simply delete the port, when everything went fine. */ -+ do { -+ int32 code; -+ error = read_port(sp.port, &code, &childError, sizeof(childError)); -+ } while (error == EINTR); -+ -+ if (error == B_BAD_PORT_ID) -+ return APR_SUCCESS; -+ -+ delete_port(sp.port); -+ -+ if (error >= B_OK) -+ return childError; -+ return error; - } - - APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, -@@ -360,10 +544,10 @@ - apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool); - - if (child_in != NULL) -- apr_file_dup(&attr->child_in, child_in, attr->pool); -+ apr_file_dup2(attr->child_in, child_in, attr->pool); - - if (parent_in != NULL) -- apr_file_dup(&attr->parent_in, parent_in, attr->pool); -+ apr_file_dup2(attr->parent_in, parent_in, attr->pool); - - return APR_SUCCESS; - } -@@ -375,10 +559,10 @@ - apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool); - - if (child_out != NULL) -- apr_file_dup(&attr->child_out, child_out, attr->pool); -+ apr_file_dup2(attr->child_out, child_out, attr->pool); - - if (parent_out != NULL) -- apr_file_dup(&attr->parent_out, parent_out, attr->pool); -+ apr_file_dup2(attr->parent_out, parent_out, attr->pool); - - return APR_SUCCESS; - } -@@ -390,10 +574,10 @@ - apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool); - - if (child_err != NULL) -- apr_file_dup(&attr->child_err, child_err, attr->pool); -+ apr_file_dup2(attr->child_err, child_err, attr->pool); - - if (parent_err != NULL) -- apr_file_dup(&attr->parent_err, parent_err, attr->pool); -+ apr_file_dup2(attr->parent_err, parent_err, attr->pool); - - return APR_SUCCESS; - } -diff -urN apr-1.0.1.orig/threadproc/beos/thread.c apr-1.0.1/threadproc/beos/thread.c ---- apr-1.0.1.orig/threadproc/beos/thread.c 2004-06-10 12:57:25.000000000 +0200 -+++ apr-1.0.1/threadproc/beos/thread.c 2004-12-17 15:19:11.000000000 +0100 -@@ -26,27 +26,27 @@ - } - - (*new)->pool = pool; -- (*new)->attr = (int32)B_NORMAL_PRIORITY; -+ (*new)->attr = (int32)B_NORMAL_PRIORITY; - - return APR_SUCCESS; - } - - APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) - { -- if (on == 1){ -- attr->detached = 1; -- } else { -- attr->detached = 0; -- } -+ if (on == 1){ -+ attr->detached = 1; -+ } else { -+ attr->detached = 0; -+ } - return APR_SUCCESS; - } - - APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) - { -- if (attr->detached == 1){ -- return APR_DETACH; -- } -- return APR_NOTDETACH; -+ if (attr->detached == 1){ -+ return APR_DETACH; -+ } -+ return APR_NOTDETACH; - } - - APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, -@@ -61,10 +61,11 @@ - return APR_ENOTIMPL; - } - --static void *dummy_worker(void *opaque) -+static int32 dummy_worker(void *opaque) - { - apr_thread_t *thd = (apr_thread_t*)opaque; -- return thd->func(thd, thd->data); -+ thd->func(thd, thd->data); -+ return 0; - } - - APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, -@@ -82,23 +83,21 @@ - (*new)->pool = pool; - (*new)->data = data; - (*new)->func = func; -- (*new)->exitval = -1; -+ (*new)->exitval = 0; -+ (*new)->join_count = 0; - - /* First we create the new thread...*/ -- if (attr) -- temp = attr->attr; -- else -- temp = B_NORMAL_PRIORITY; -+ if (attr) -+ temp = attr->attr; -+ else -+ temp = B_NORMAL_PRIORITY; - - stat = apr_pool_create(&(*new)->pool, pool); - if (stat != APR_SUCCESS) { - return stat; - } - -- (*new)->td = spawn_thread((thread_func)dummy_worker, -- "apr thread", -- temp, -- (*new)); -+ (*new)->td = spawn_thread(dummy_worker, "apr thread", temp, (*new)); - - /* Now we try to run it...*/ - if (resume_thread((*new)->td) == B_NO_ERROR) { -@@ -128,7 +127,8 @@ - return APR_SUCCESS; - } - --APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *thd) -+APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, -+ apr_thread_t *thd) - { - status_t rv = 0, ret; - ret = wait_for_thread(thd->td, &rv); -@@ -137,10 +137,10 @@ - return APR_SUCCESS; - } - else { -- /* if we've missed the thread's death, did we set an exit value prior -- * to it's demise? If we did return that. -+ /* We've missed the thread's death, if noone joined it before us, we -+ * will succeed. - */ -- if (thd->exitval != -1) { -+ if (atomic_add(&thd->join_count, 1) == 0) { - *retval = thd->exitval; - return APR_SUCCESS; - } else -@@ -150,12 +150,27 @@ - - APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) - { -- if (suspend_thread(thd->td) == B_NO_ERROR){ -+ /* -+ if (suspend_thread(thd->td) == B_NO_ERROR){ - return APR_SUCCESS; - } - else { - return errno; - } -+ -+ * bonefish: -+ * The code above is definitely not correct. The OpenGroup specification -+ * of pthread_detach() says: -+ * -+ * "The pthread_detach() function shall indicate to the implementation that -+ * storage for the thread thread can be reclaimed when that thread -+ * terminates. If thread has not terminated, pthread_detach() shall not -+ * cause it to terminate. The effect of multiple pthread_detach() calls -+ * on the same target thread is unspecified." -+ * -+ * I don't really see, what we should do here. -+ */ -+ return APR_SUCCESS; - } - - void apr_thread_yield() -@@ -198,10 +213,8 @@ - { - apr_thread_once_t *control = (apr_thread_once_t *)vcontrol; - -- if (control->sem) { -- release_sem(control->sem); -+ if (control->sem >= 0) - delete_sem(control->sem); -- } - - return APR_SUCCESS; - } -@@ -211,7 +224,6 @@ - { - int rc; - *control = (apr_thread_once_t *)apr_pcalloc(p, sizeof(apr_thread_once_t)); -- (*control)->hit = 0; /* we haven't done it yet... */ - rc = ((*control)->sem = create_sem(1, "thread_once")); - if (rc < 0) - return rc; -@@ -225,10 +237,11 @@ - APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, - void (*func)(void)) - { -- if (!control->hit) { -+ if (control->sem >= 0) { - if (acquire_sem(control->sem) == B_OK) { -- control->hit = 1; - func(); -+ delete_sem(control->sem); -+ control->sem = -1; - } - } - return APR_SUCCESS; -diff -urN apr-1.0.1.orig/threadproc/beos/threadpriv.c apr-1.0.1/threadproc/beos/threadpriv.c ---- apr-1.0.1.orig/threadproc/beos/threadpriv.c 2004-02-13 10:38:38.000000000 +0100 -+++ apr-1.0.1/threadproc/beos/threadpriv.c 2004-12-17 15:19:11.000000000 +0100 -@@ -14,135 +14,51 @@ - */ - - #include "apr_arch_threadproc.h" -+#include - --static struct beos_key key_table[BEOS_MAX_DATAKEYS]; --static struct beos_private_data *beos_data[BEOS_MAX_DATAKEYS]; --static sem_id lock; -+static void threadkey_cleanup(void *_key) -+{ -+ apr_threadkey_t *key = (apr_threadkey_t *)_key; -+ void* data = tls_get(key->key); -+ -+ if (data && key->destructor) { -+ (*key->destructor)(data); -+ } -+} - - APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, - void (*dest)(void *), apr_pool_t *pool) - { -- (*key) = (apr_threadkey_t *)apr_palloc(pool, sizeof(apr_threadkey_t)); -+ (*key) = (apr_threadkey_t *)apr_pcalloc(pool, sizeof(apr_threadkey_t)); -+ - if ((*key) == NULL) { - return APR_ENOMEM; - } - -+ (*key)->key = tls_allocate(); - (*key)->pool = pool; -- -- acquire_sem(lock); -- for ((*key)->key=0; (*key)->key < BEOS_MAX_DATAKEYS; (*key)->key++){ -- if (key_table[(*key)->key].assigned == 0){ -- key_table[(*key)->key].assigned = 1; -- key_table[(*key)->key].destructor = dest; -- release_sem(lock); -- return APR_SUCCESS; -- } -- -- } -- release_sem(lock); -- return APR_ENOMEM; -+ (*key)->destructor = dest; -+ -+ on_exit_thread(&threadkey_cleanup, *key); -+ -+ return APR_SUCCESS; - } - - APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, apr_threadkey_t *key) - { -- thread_id tid; -- int i, index=0; -- tid = find_thread(NULL); -- for (i=0;idata){ -- /* it's been used */ -- if (beos_data[i]->td == tid){ -- index = i; -- } -- } -- } -- if (index == 0){ -- /* no storage for thread so we can't get anything... */ -- return APR_ENOMEM; -- } -- -- if ((key->key < BEOS_MAX_DATAKEYS) && (key_table)){ -- acquire_sem(key_table[key->key].lock); -- if (key_table[key->key].count){ -- (*new) = (void*)beos_data[index]->data[key->key]; -- } else { -- (*new) = NULL; -- } -- release_sem(key_table[key->key].lock); -- } else { -- (*new) = NULL; -- } -- return APR_SUCCESS; -+ (*new) = tls_get(key->key); -+ return APR_SUCCESS; - } - - APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t *key) - { -- thread_id tid; -- int i,index = 0, ret = 0; -- -- tid = find_thread(NULL); -- for (i=0; i < BEOS_MAX_DATAKEYS; i++){ -- if (beos_data[i]->data){ -- if (beos_data[i]->td == tid){index = i;} -- } -- } -- if (index==0){ -- /* not yet been allocated */ -- for (i=0; i< BEOS_MAX_DATAKEYS; i++){ -- if (! beos_data[i]->data){ -- /* we'll take this one... */ -- index = i; -- beos_data[i]->data = (const void **)malloc(sizeof(void *) * BEOS_MAX_DATAKEYS); -- memset((void *)beos_data[i]->data, 0, sizeof(void *) * BEOS_MAX_DATAKEYS); -- beos_data[i]->count = (int)malloc(sizeof(int)); -- beos_data[i]->td = (thread_id)malloc(sizeof(thread_id)); -- beos_data[i]->td = tid; -- } -- } -- } -- if (index == 0){ -- /* we're out of luck.. */ -- return APR_ENOMEM; -- } -- if ((key->key < BEOS_MAX_DATAKEYS) && (key_table)){ -- acquire_sem(key_table[key->key].lock); -- if (key_table[key->key].count){ -- if (beos_data[index]->data[key->key] == NULL){ -- if (priv != NULL){ -- beos_data[index]->count++; -- key_table[key->key].count++; -- } -- } else { -- if (priv == NULL){ -- beos_data[index]->count--; -- key_table[key->key].count--; -- } -- } -- beos_data[index]->data[key->key] = priv; -- ret = 1; -- } else { -- ret = 0; -- } -- release_sem(key_table[key->key].lock); -- } -- if (ret) -- return APR_SUCCESS; -- return APR_ENOMEM; -+ tls_set(key->key, priv); -+ return APR_SUCCESS; - } - - APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) - { -- if (key->key < BEOS_MAX_DATAKEYS){ -- acquire_sem(key_table[key->key].lock); -- if (key_table[key->key].count == 1){ -- key_table[key->key].destructor = NULL; -- key_table[key->key].count = 0; -- } -- release_sem(key_table[key->key].lock); -- } else { -- return APR_ENOMEM; -- } -- return APR_SUCCESS; -+ return APR_ENOTIMPL; - } - - APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, -diff -urN apr-1.0.1.orig/user/unix/userinfo.c apr-1.0.1/user/unix/userinfo.c ---- apr-1.0.1.orig/user/unix/userinfo.c 2004-02-13 10:38:38.000000000 +0100 -+++ apr-1.0.1/user/unix/userinfo.c 2004-12-17 15:19:11.000000000 +0100 -@@ -31,6 +31,28 @@ - - #define PWBUF_SIZE 512 - -+/* on BeOS R5 (also for BONE systems?) getpwnam() is broken */ -+#ifdef BEOS -+static struct passwd *beos_getpwnam(const char *name) -+{ -+ struct passwd *p; -+ while ((p = getpwent()) != NULL) { -+ if (strcmp(p->pw_name, name) == 0) -+ break; -+ } -+ endpwent(); -+ -+ if (!p) { -+ errno = ENOENT; -+ /* probably not the correct error code, but that doesn't really -+ * matter anyway */ -+ } -+ return p; -+} -+#define getpwnam beos_getpwnam -+#endif -+ -+ - static apr_status_t getpwnam_safe(const char *username, - struct passwd *pw, - char pwbuf[PWBUF_SIZE]) diff --git a/dev-libs/apr/patches/apr-1.2.x.diff b/dev-libs/apr/patches/apr-1.2.x.diff deleted file mode 100644 index faa0ab6ea..000000000 --- a/dev-libs/apr/patches/apr-1.2.x.diff +++ /dev/null @@ -1,23 +0,0 @@ -Index: Makefile.in -=================================================================== ---- Makefile.in (revision 619048) -+++ Makefile.in (working copy) -@@ -18,7 +18,7 @@ - INCDIR=./include - OSDIR=$(top_srcdir)/include/arch/@OSDIR@ - DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ --INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -I$(top_srcdir)/include -+INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -I$(top_srcdir)/include/arch/@DEFAULT_OSDIR@ -I$(top_srcdir)/include - - # - # Macros for target determination -Index: build/gen-build.py -=================================================================== ---- build/gen-build.py (revision 619048) -+++ build/gen-build.py (working copy) -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/bin/env python - # - # USAGE: gen-build.py TYPE - # diff --git a/dev-libs/apr/patches/apr-1.3.3.patch b/dev-libs/apr/patches/apr-1.3.3.patch deleted file mode 100644 index 9eb5f2c0e..000000000 --- a/dev-libs/apr/patches/apr-1.3.3.patch +++ /dev/null @@ -1,201 +0,0 @@ -diff -urN apr-1.3.3/build/apr_hints.m4 apr-1.3.3-haiku/build/apr_hints.m4 ---- apr-1.3.3/build/apr_hints.m4 2009-04-27 05:57:37.000000000 +0000 -+++ apr-1.3.3-haiku/build/apr_hints.m4 2009-04-28 02:01:57.000000000 +0000 -@@ -35,7 +35,7 @@ - dnl Generally, we force the setting of CC, and add flags - dnl to CFLAGS, CPPFLAGS, LIBS and LDFLAGS. - dnl --AC_DEFUN(APR_PRELOAD, [ -+AC_DEFUN([APR_PRELOAD], [ - if test "x$apr_preload_done" != "xyes" ; then - - apr_preload_done="yes" -@@ -453,6 +453,12 @@ - APR_SETIFNULL(have_proc_invoked, [1]) - APR_SETIFNULL(apr_cv_use_lfs64, [yes]) - ;; -+ *-haiku*) -+ APR_ADDTO(LIBS, [-lnetwork]) -+ APR_SETIFNULL(apr_lock_method, [USE_POSIXSEM_SERIALIZE]) -+ APR_SETIFNULL(apr_posixsem_is_global, [yes]) -+ APR_SETIFNULL(apr_process_lock_is_global, [yes]) -+ ;; - esac - - fi -@@ -463,7 +469,7 @@ - dnl - dnl Allows us to provide a default choice of compiler which - dnl the user can override. --AC_DEFUN(APR_CC_HINTS, [ -+AC_DEFUN([APR_CC_HINTS], [ - case "$host" in - *-apple-aux3*) - APR_SETIFNULL(CC, [gcc]) -diff -urN apr-1.3.3/build/apr_network.m4 apr-1.3.3-haiku/build/apr_network.m4 ---- apr-1.3.3/build/apr_network.m4 2009-04-27 05:57:37.000000000 +0000 -+++ apr-1.3.3-haiku/build/apr_network.m4 2009-04-27 06:00:26.000000000 +0000 -@@ -21,7 +21,7 @@ - dnl - dnl check for type in_addr - dnl --AC_DEFUN(APR_TYPE_IN_ADDR,[ -+AC_DEFUN([APR_TYPE_IN_ADDR],[ - AC_CACHE_CHECK(for type in_addr, ac_cv_type_in_addr,[ - AC_TRY_COMPILE([ - #ifdef HAVE_SYS_TYPES_H -diff -urN apr-1.3.3/build/apr_threads.m4 apr-1.3.3-haiku/build/apr_threads.m4 ---- apr-1.3.3/build/apr_threads.m4 2009-04-27 05:57:37.000000000 +0000 -+++ apr-1.3.3-haiku/build/apr_threads.m4 2009-04-27 05:51:44.000000000 +0000 -@@ -26,7 +26,7 @@ - dnl pthreads is not available. - dnl Turn off warnings if we're using gcc. - dnl --AC_DEFUN(APR_CHECK_PTHREADS_H, [ -+AC_DEFUN([APR_CHECK_PTHREADS_H], [ - if test "$GCC" = "yes"; then - SAVE_FL="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -w" -@@ -41,7 +41,7 @@ - dnl - dnl APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS - dnl --AC_DEFUN(APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS, [ -+AC_DEFUN([APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS], [ - AC_CACHE_CHECK(whether pthread_getspecific takes two arguments, ac_cv_pthread_getspecific_two_args,[ - AC_TRY_COMPILE([ - #include -@@ -65,7 +65,7 @@ - dnl - dnl APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG - dnl --AC_DEFUN(APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG, [ -+AC_DEFUN([APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG], [ - AC_CACHE_CHECK(whether pthread_attr_getdetachstate takes one argument, ac_cv_pthread_attr_getdetachstate_one_arg,[ - AC_TRY_COMPILE([ - #include -@@ -91,7 +91,7 @@ - dnl Try running a program which uses pthreads, executing the - dnl actions-if-success commands on success. - dnl --AC_DEFUN(APR_PTHREADS_TRY_RUN, [ -+AC_DEFUN([APR_PTHREADS_TRY_RUN], [ - AC_TRY_RUN( [ - #include - #include -@@ -182,12 +182,12 @@ - dnl the checks for threading support so that they can restored if the - dnl result is not what the caller wanted. - dnl --AC_DEFUN(APR_PTHREADS_CHECK_SAVE, [ -+AC_DEFUN([APR_PTHREADS_CHECK_SAVE], [ - apr_pthsv_CFLAGS="$CFLAGS" - apr_pthsv_LIBS="$LIBS" - ])dnl - --AC_DEFUN(APR_PTHREADS_CHECK_RESTORE, [ -+AC_DEFUN([APR_PTHREADS_CHECK_RESTORE], [ - CFLAGS="$apr_pthsv_CFLAGS" - LIBS="$apr_pthsv_LIBS" - ])dnl -diff -urN apr-1.3.3/configure.in apr-1.3.3-haiku/configure.in ---- apr-1.3.3/configure.in 2009-04-27 05:57:37.000000000 +0000 -+++ apr-1.3.3-haiku/configure.in 2009-04-28 02:02:02.000000000 +0000 -@@ -244,7 +244,7 @@ - dnl otherwise. - - case $host in -- *os390) -+ *os390|*haiku*) - if test "$ac_test_CFLAGS" != set; then - APR_REMOVEFROM(CFLAGS,-g) - fi -@@ -479,6 +479,12 @@ - OSDIR="unix" - eolstr="\\n" - ;; -+ *haiku*) -+ OSDIR="unix" -+ eolstr="\\n" -+ AC_CHECK_LIB(bsd, getpass) -+ AC_CHECK_LIB(network, socket) -+ ;; - *) - OSDIR="unix" - eolstr="\\n" -@@ -833,6 +840,10 @@ - havemmapzero="0" - havemmapanon="0" - APR_BEGIN_DECISION([anonymous shared memory allocation method]) -+APR_IFALLYES(header:kernel/OS.h func:create_area, -+ [havebeosshm="1" -+ APR_DECIDE(USE_SHMEM_BEOS_ANON, -+ [BeOS areas])]) - APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl - func:shmget func:shmat func:shmdt func:shmctl, - [haveshmgetanon="1" -@@ -904,6 +915,9 @@ - haveos2shm="0" - havewin32shm="0" - APR_BEGIN_DECISION([namebased memory allocation method]) -+APR_IFALLYES(header:kernel/OS.h func:create_area, -+ [havebeosshm="1" -+ APR_DECIDE(USE_SHMEM_BEOS, [BeOS areas])]) - APR_IFALLYES(header:sys/mman.h func:mmap func:munmap, - [havemmaptmp="1" - APR_DECIDE(USE_SHMEM_MMAP_TMP, -@@ -917,9 +931,6 @@ - func:shmget func:shmat func:shmdt func:shmctl, - [haveshmget="1" - APR_DECIDE(USE_SHMEM_SHMGET, [SysV IPC shmget()])]) --APR_IFALLYES(header:kernel/OS.h func:create_area, -- [havebeosshm="1" -- APR_DECIDE(USE_SHMEM_BEOS, [BeOS areas])]) - APR_IFALLYES(header:os2.h, - [haveos2shm="1" - APR_DECIDE(USE_SHMEM_OS2, [OS/2 DosAllocSharedMem()])]) -diff -urN apr-1.3.3/test/testpoll.c apr-1.3.3-haiku/test/testpoll.c ---- apr-1.3.3/test/testpoll.c 2009-04-27 05:57:37.000000000 +0000 -+++ apr-1.3.3-haiku/test/testpoll.c 2009-04-28 02:02:28.000000000 +0000 -@@ -193,6 +193,8 @@ - recv_msg(s, 2, p, tc); - send_msg(s, sa, 1, tc); - -+ apr_sleep(apr_time_make(0, 10000)); -+ - rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - check_sockets(pollarray, s, 0, 0, tc); -@@ -207,6 +209,8 @@ - - send_msg(s, sa, 2, tc); - -+ apr_sleep(apr_time_make(0, 10000)); -+ - rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - check_sockets(pollarray, s, 0, 0, tc); -@@ -381,6 +385,7 @@ - int num; - - send_msg(s, sa, 0, tc); -+ apr_sleep(apr_time_make(0, 10000)); - rv = apr_pollset_poll(pollset, 0, &num, &descs); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 1, num); -@@ -411,6 +416,7 @@ - - send_msg(s, sa, 2, tc); - send_msg(s, sa, 5, tc); -+ apr_sleep(apr_time_make(0, 10000)); - rv = apr_pollset_poll(pollset, 0, &num, &descs); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 2, num); -@@ -443,6 +449,7 @@ - int num; - - send_msg(s, sa, LARGE_NUM_SOCKETS - 1, tc); -+ apr_sleep(apr_time_make(0, 10000)); - rv = apr_pollset_poll(pollset, 0, &num, &descs); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 1, num); diff --git a/dev-libs/apr/patches/apr-1.3.8.patch b/dev-libs/apr/patches/apr-1.3.8.patch deleted file mode 100644 index 0b1f41ac2..000000000 --- a/dev-libs/apr/patches/apr-1.3.8.patch +++ /dev/null @@ -1,219 +0,0 @@ -diff -urN apr-1.3.8/build/apr_hints.m4 apr-1.3.8-haiku/build/apr_hints.m4 ---- apr-1.3.8/build/apr_hints.m4 2009-06-02 09:15:46.000000000 -0700 -+++ apr-1.3.8-haiku/build/apr_hints.m4 2009-08-29 21:04:14.000000000 -0700 -@@ -35,7 +35,7 @@ - dnl Generally, we force the setting of CC, and add flags - dnl to CFLAGS, CPPFLAGS, LIBS and LDFLAGS. - dnl --AC_DEFUN(APR_PRELOAD, [ -+AC_DEFUN([APR_PRELOAD], [ - if test "x$apr_preload_done" != "xyes" ; then - - apr_preload_done="yes" -@@ -454,6 +454,12 @@ - APR_SETIFNULL(have_proc_invoked, [1]) - APR_SETIFNULL(apr_cv_use_lfs64, [yes]) - ;; -+ *-haiku*) -+ APR_ADDTO(LIBS, [-lnetwork]) -+ APR_SETIFNULL(apr_lock_method, [USE_POSIXSEM_SERIALIZE]) -+ APR_SETIFNULL(apr_posixsem_is_global, [yes]) -+ APR_SETIFNULL(apr_process_lock_is_global, [yes]) -+ ;; - esac - - fi -@@ -464,7 +470,7 @@ - dnl - dnl Allows us to provide a default choice of compiler which - dnl the user can override. --AC_DEFUN(APR_CC_HINTS, [ -+AC_DEFUN([APR_CC_HINTS], [ - case "$host" in - *-apple-aux3*) - APR_SETIFNULL(CC, [gcc]) -diff -urN apr-1.3.8/build/apr_network.m4 apr-1.3.8-haiku/build/apr_network.m4 ---- apr-1.3.8/build/apr_network.m4 2008-06-16 14:16:13.000000000 -0700 -+++ apr-1.3.8-haiku/build/apr_network.m4 2009-08-29 21:04:14.000000000 -0700 -@@ -21,7 +21,7 @@ - dnl - dnl check for type in_addr - dnl --AC_DEFUN(APR_TYPE_IN_ADDR,[ -+AC_DEFUN([APR_TYPE_IN_ADDR],[ - AC_CACHE_CHECK(for type in_addr, ac_cv_type_in_addr,[ - AC_TRY_COMPILE([ - #ifdef HAVE_SYS_TYPES_H -diff -urN apr-1.3.8/build/apr_threads.m4 apr-1.3.8-haiku/build/apr_threads.m4 ---- apr-1.3.8/build/apr_threads.m4 2006-08-03 03:46:47.000000000 -0700 -+++ apr-1.3.8-haiku/build/apr_threads.m4 2009-08-29 21:04:14.000000000 -0700 -@@ -26,7 +26,7 @@ - dnl pthreads is not available. - dnl Turn off warnings if we're using gcc. - dnl --AC_DEFUN(APR_CHECK_PTHREADS_H, [ -+AC_DEFUN([APR_CHECK_PTHREADS_H], [ - if test "$GCC" = "yes"; then - SAVE_FL="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -w" -@@ -41,7 +41,7 @@ - dnl - dnl APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS - dnl --AC_DEFUN(APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS, [ -+AC_DEFUN([APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS], [ - AC_CACHE_CHECK(whether pthread_getspecific takes two arguments, ac_cv_pthread_getspecific_two_args,[ - AC_TRY_COMPILE([ - #include -@@ -65,7 +65,7 @@ - dnl - dnl APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG - dnl --AC_DEFUN(APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG, [ -+AC_DEFUN([APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG], [ - AC_CACHE_CHECK(whether pthread_attr_getdetachstate takes one argument, ac_cv_pthread_attr_getdetachstate_one_arg,[ - AC_TRY_COMPILE([ - #include -@@ -91,7 +91,7 @@ - dnl Try running a program which uses pthreads, executing the - dnl actions-if-success commands on success. - dnl --AC_DEFUN(APR_PTHREADS_TRY_RUN, [ -+AC_DEFUN([APR_PTHREADS_TRY_RUN], [ - AC_TRY_RUN( [ - #include - #include -@@ -182,12 +182,12 @@ - dnl the checks for threading support so that they can restored if the - dnl result is not what the caller wanted. - dnl --AC_DEFUN(APR_PTHREADS_CHECK_SAVE, [ -+AC_DEFUN([APR_PTHREADS_CHECK_SAVE], [ - apr_pthsv_CFLAGS="$CFLAGS" - apr_pthsv_LIBS="$LIBS" - ])dnl - --AC_DEFUN(APR_PTHREADS_CHECK_RESTORE, [ -+AC_DEFUN([APR_PTHREADS_CHECK_RESTORE], [ - CFLAGS="$apr_pthsv_CFLAGS" - LIBS="$apr_pthsv_LIBS" - ])dnl -diff -urN apr-1.3.8/build/gen-build.py apr-1.3.8-haiku/build/gen-build.py ---- apr-1.3.8/build/gen-build.py 2007-02-28 04:44:52.000000000 -0800 -+++ apr-1.3.8-haiku/build/gen-build.py 2009-08-29 20:36:31.000000000 -0700 -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/bin/env python - # - # USAGE: gen-build.py TYPE - # -diff -urN apr-1.3.8/configure.in apr-1.3.8-haiku/configure.in ---- apr-1.3.8/configure.in 2009-07-17 16:14:25.000000000 -0700 -+++ apr-1.3.8-haiku/configure.in 2009-08-29 20:48:05.000000000 -0700 -@@ -135,7 +135,7 @@ - AC_PROG_CPP - AC_PROG_AWK - AC_PROG_LN_S --AC_PROG_RANLIB -+AC_PROG_LIBTOOL - AC_PROG_INSTALL - AC_CHECK_PROG(RM, rm, rm) - AC_CHECK_PROG(AS, as, as) -@@ -248,7 +248,7 @@ - dnl otherwise. - - case $host in -- *os390) -+ *os390|*haiku*) - if test "$ac_test_CFLAGS" != set; then - APR_REMOVEFROM(CFLAGS,-g) - fi -@@ -486,6 +486,12 @@ - OSDIR="unix" - eolstr="\\n" - ;; -+ *haiku*) -+ OSDIR="unix" -+ eolstr="\\n" -+ AC_CHECK_LIB(bsd, getpass) -+ AC_CHECK_LIB(network, socket) -+ ;; - *) - OSDIR="unix" - eolstr="\\n" -@@ -962,6 +968,10 @@ - havemmapzero="0" - havemmapanon="0" - APR_BEGIN_DECISION([anonymous shared memory allocation method]) -+APR_IFALLYES(header:kernel/OS.h func:create_area, -+ [havebeosshm="1" -+ APR_DECIDE(USE_SHMEM_BEOS_ANON, -+ [BeOS areas])]) - APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl - func:shmget func:shmat func:shmdt func:shmctl, - [haveshmgetanon="1" -@@ -1033,6 +1043,9 @@ - haveos2shm="0" - havewin32shm="0" - APR_BEGIN_DECISION([namebased memory allocation method]) -+APR_IFALLYES(header:kernel/OS.h func:create_area, -+ [havebeosshm="1" -+ APR_DECIDE(USE_SHMEM_BEOS, [BeOS areas])]) - APR_IFALLYES(header:sys/mman.h func:mmap func:munmap, - [havemmaptmp="1" - APR_DECIDE(USE_SHMEM_MMAP_TMP, -@@ -1046,9 +1059,6 @@ - func:shmget func:shmat func:shmdt func:shmctl, - [haveshmget="1" - APR_DECIDE(USE_SHMEM_SHMGET, [SysV IPC shmget()])]) --APR_IFALLYES(header:kernel/OS.h func:create_area, -- [havebeosshm="1" -- APR_DECIDE(USE_SHMEM_BEOS, [BeOS areas])]) - APR_IFALLYES(header:os2.h, - [haveos2shm="1" - APR_DECIDE(USE_SHMEM_OS2, [OS/2 DosAllocSharedMem()])]) -diff -urN apr-1.3.8/test/testpoll.c apr-1.3.8-haiku/test/testpoll.c ---- apr-1.3.8/test/testpoll.c 2008-04-13 04:37:52.000000000 -0700 -+++ apr-1.3.8-haiku/test/testpoll.c 2009-08-29 21:04:14.000000000 -0700 -@@ -193,6 +193,8 @@ - recv_msg(s, 2, p, tc); - send_msg(s, sa, 1, tc); - -+ apr_sleep(apr_time_make(0, 10000)); -+ - rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - check_sockets(pollarray, s, 0, 0, tc); -@@ -207,6 +209,8 @@ - - send_msg(s, sa, 2, tc); - -+ apr_sleep(apr_time_make(0, 10000)); -+ - rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - check_sockets(pollarray, s, 0, 0, tc); -@@ -381,6 +385,7 @@ - int num; - - send_msg(s, sa, 0, tc); -+ apr_sleep(apr_time_make(0, 10000)); - rv = apr_pollset_poll(pollset, 0, &num, &descs); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 1, num); -@@ -411,6 +416,7 @@ - - send_msg(s, sa, 2, tc); - send_msg(s, sa, 5, tc); -+ apr_sleep(apr_time_make(0, 10000)); - rv = apr_pollset_poll(pollset, 0, &num, &descs); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 2, num); -@@ -443,6 +449,7 @@ - int num; - - send_msg(s, sa, LARGE_NUM_SOCKETS - 1, tc); -+ apr_sleep(apr_time_make(0, 10000)); - rv = apr_pollset_poll(pollset, 0, &num, &descs); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 1, num); diff --git a/dev-libs/apr/patches/apr-1.3.9.patch b/dev-libs/apr/patches/apr-1.3.9.patch deleted file mode 100644 index 41d545de0..000000000 --- a/dev-libs/apr/patches/apr-1.3.9.patch +++ /dev/null @@ -1,219 +0,0 @@ -diff -urN apr-1.3.9/build/apr_hints.m4 apr-1.3.9-haiku/build/apr_hints.m4 ---- apr-1.3.9/build/apr_hints.m4 2009-06-02 09:15:46.000000000 -0700 -+++ apr-1.3.9-haiku/build/apr_hints.m4 2009-08-29 21:04:14.000000000 -0700 -@@ -35,7 +35,7 @@ - dnl Generally, we force the setting of CC, and add flags - dnl to CFLAGS, CPPFLAGS, LIBS and LDFLAGS. - dnl --AC_DEFUN(APR_PRELOAD, [ -+AC_DEFUN([APR_PRELOAD], [ - if test "x$apr_preload_done" != "xyes" ; then - - apr_preload_done="yes" -@@ -454,6 +454,12 @@ - APR_SETIFNULL(have_proc_invoked, [1]) - APR_SETIFNULL(apr_cv_use_lfs64, [yes]) - ;; -+ *-haiku*) -+ APR_ADDTO(LIBS, [-lnetwork]) -+ APR_SETIFNULL(apr_lock_method, [USE_POSIXSEM_SERIALIZE]) -+ APR_SETIFNULL(apr_posixsem_is_global, [yes]) -+ APR_SETIFNULL(apr_process_lock_is_global, [yes]) -+ ;; - esac - - fi -@@ -464,7 +470,7 @@ - dnl - dnl Allows us to provide a default choice of compiler which - dnl the user can override. --AC_DEFUN(APR_CC_HINTS, [ -+AC_DEFUN([APR_CC_HINTS], [ - case "$host" in - *-apple-aux3*) - APR_SETIFNULL(CC, [gcc]) -diff -urN apr-1.3.9/build/apr_network.m4 apr-1.3.9-haiku/build/apr_network.m4 ---- apr-1.3.9/build/apr_network.m4 2008-06-16 14:16:13.000000000 -0700 -+++ apr-1.3.9-haiku/build/apr_network.m4 2009-08-29 21:04:14.000000000 -0700 -@@ -21,7 +21,7 @@ - dnl - dnl check for type in_addr - dnl --AC_DEFUN(APR_TYPE_IN_ADDR,[ -+AC_DEFUN([APR_TYPE_IN_ADDR],[ - AC_CACHE_CHECK(for type in_addr, ac_cv_type_in_addr,[ - AC_TRY_COMPILE([ - #ifdef HAVE_SYS_TYPES_H -diff -urN apr-1.3.9/build/apr_threads.m4 apr-1.3.9-haiku/build/apr_threads.m4 ---- apr-1.3.9/build/apr_threads.m4 2006-08-03 03:46:47.000000000 -0700 -+++ apr-1.3.9-haiku/build/apr_threads.m4 2009-08-29 21:04:14.000000000 -0700 -@@ -26,7 +26,7 @@ - dnl pthreads is not available. - dnl Turn off warnings if we're using gcc. - dnl --AC_DEFUN(APR_CHECK_PTHREADS_H, [ -+AC_DEFUN([APR_CHECK_PTHREADS_H], [ - if test "$GCC" = "yes"; then - SAVE_FL="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -w" -@@ -41,7 +41,7 @@ - dnl - dnl APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS - dnl --AC_DEFUN(APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS, [ -+AC_DEFUN([APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS], [ - AC_CACHE_CHECK(whether pthread_getspecific takes two arguments, ac_cv_pthread_getspecific_two_args,[ - AC_TRY_COMPILE([ - #include -@@ -65,7 +65,7 @@ - dnl - dnl APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG - dnl --AC_DEFUN(APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG, [ -+AC_DEFUN([APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG], [ - AC_CACHE_CHECK(whether pthread_attr_getdetachstate takes one argument, ac_cv_pthread_attr_getdetachstate_one_arg,[ - AC_TRY_COMPILE([ - #include -@@ -91,7 +91,7 @@ - dnl Try running a program which uses pthreads, executing the - dnl actions-if-success commands on success. - dnl --AC_DEFUN(APR_PTHREADS_TRY_RUN, [ -+AC_DEFUN([APR_PTHREADS_TRY_RUN], [ - AC_TRY_RUN( [ - #include - #include -@@ -182,12 +182,12 @@ - dnl the checks for threading support so that they can restored if the - dnl result is not what the caller wanted. - dnl --AC_DEFUN(APR_PTHREADS_CHECK_SAVE, [ -+AC_DEFUN([APR_PTHREADS_CHECK_SAVE], [ - apr_pthsv_CFLAGS="$CFLAGS" - apr_pthsv_LIBS="$LIBS" - ])dnl - --AC_DEFUN(APR_PTHREADS_CHECK_RESTORE, [ -+AC_DEFUN([APR_PTHREADS_CHECK_RESTORE], [ - CFLAGS="$apr_pthsv_CFLAGS" - LIBS="$apr_pthsv_LIBS" - ])dnl -diff -urN apr-1.3.9/build/gen-build.py apr-1.3.9-haiku/build/gen-build.py ---- apr-1.3.9/build/gen-build.py 2007-02-28 04:44:52.000000000 -0800 -+++ apr-1.3.9-haiku/build/gen-build.py 2009-08-29 20:36:31.000000000 -0700 -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/bin/env python - # - # USAGE: gen-build.py TYPE - # -diff -urN apr-1.3.9/configure.in apr-1.3.9-haiku/configure.in ---- apr-1.3.9/configure.in 2009-07-17 16:14:25.000000000 -0700 -+++ apr-1.3.9-haiku/configure.in 2009-08-29 20:48:05.000000000 -0700 -@@ -135,7 +135,7 @@ - AC_PROG_CPP - AC_PROG_AWK - AC_PROG_LN_S --AC_PROG_RANLIB -+AC_PROG_LIBTOOL - AC_PROG_INSTALL - AC_CHECK_PROG(RM, rm, rm) - AC_CHECK_PROG(AS, as, as) -@@ -248,7 +248,7 @@ - dnl otherwise. - - case $host in -- *os390) -+ *os390|*haiku*) - if test "$ac_test_CFLAGS" != set; then - APR_REMOVEFROM(CFLAGS,-g) - fi -@@ -486,6 +486,12 @@ - OSDIR="unix" - eolstr="\\n" - ;; -+ *haiku*) -+ OSDIR="unix" -+ eolstr="\\n" -+ AC_CHECK_LIB(bsd, getpass) -+ AC_CHECK_LIB(network, socket) -+ ;; - *) - OSDIR="unix" - eolstr="\\n" -@@ -962,6 +968,10 @@ - havemmapzero="0" - havemmapanon="0" - APR_BEGIN_DECISION([anonymous shared memory allocation method]) -+APR_IFALLYES(header:kernel/OS.h func:create_area, -+ [havebeosshm="1" -+ APR_DECIDE(USE_SHMEM_BEOS_ANON, -+ [BeOS areas])]) - APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl - func:shmget func:shmat func:shmdt func:shmctl, - [haveshmgetanon="1" -@@ -1033,6 +1043,9 @@ - haveos2shm="0" - havewin32shm="0" - APR_BEGIN_DECISION([namebased memory allocation method]) -+APR_IFALLYES(header:kernel/OS.h func:create_area, -+ [havebeosshm="1" -+ APR_DECIDE(USE_SHMEM_BEOS, [BeOS areas])]) - APR_IFALLYES(header:sys/mman.h func:mmap func:munmap, - [havemmaptmp="1" - APR_DECIDE(USE_SHMEM_MMAP_TMP, -@@ -1046,9 +1059,6 @@ - func:shmget func:shmat func:shmdt func:shmctl, - [haveshmget="1" - APR_DECIDE(USE_SHMEM_SHMGET, [SysV IPC shmget()])]) --APR_IFALLYES(header:kernel/OS.h func:create_area, -- [havebeosshm="1" -- APR_DECIDE(USE_SHMEM_BEOS, [BeOS areas])]) - APR_IFALLYES(header:os2.h, - [haveos2shm="1" - APR_DECIDE(USE_SHMEM_OS2, [OS/2 DosAllocSharedMem()])]) -diff -urN apr-1.3.9/test/testpoll.c apr-1.3.9-haiku/test/testpoll.c ---- apr-1.3.9/test/testpoll.c 2008-04-13 04:37:52.000000000 -0700 -+++ apr-1.3.9-haiku/test/testpoll.c 2009-08-29 21:04:14.000000000 -0700 -@@ -193,6 +193,8 @@ - recv_msg(s, 2, p, tc); - send_msg(s, sa, 1, tc); - -+ apr_sleep(apr_time_make(0, 10000)); -+ - rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - check_sockets(pollarray, s, 0, 0, tc); -@@ -207,6 +209,8 @@ - - send_msg(s, sa, 2, tc); - -+ apr_sleep(apr_time_make(0, 10000)); -+ - rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - check_sockets(pollarray, s, 0, 0, tc); -@@ -381,6 +385,7 @@ - int num; - - send_msg(s, sa, 0, tc); -+ apr_sleep(apr_time_make(0, 10000)); - rv = apr_pollset_poll(pollset, 0, &num, &descs); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 1, num); -@@ -411,6 +416,7 @@ - - send_msg(s, sa, 2, tc); - send_msg(s, sa, 5, tc); -+ apr_sleep(apr_time_make(0, 10000)); - rv = apr_pollset_poll(pollset, 0, &num, &descs); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 2, num); -@@ -443,6 +449,7 @@ - int num; - - send_msg(s, sa, LARGE_NUM_SOCKETS - 1, tc); -+ apr_sleep(apr_time_make(0, 10000)); - rv = apr_pollset_poll(pollset, 0, &num, &descs); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 1, num); diff --git a/dev-libs/apr/patches/apr-1.4.2.patch b/dev-libs/apr/patches/apr-1.4.2.patch deleted file mode 100644 index 3a6fcb6ce..000000000 --- a/dev-libs/apr/patches/apr-1.4.2.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff -urN apr-1.4.2/config.layout apr-1.4.2-haiku/config.layout ---- apr-1.4.2/config.layout 2004-11-24 22:51:51.065798144 +0000 -+++ apr-1.4.2-haiku/config.layout 2011-03-24 11:36:30.742653952 +0000 -@@ -60,6 +60,23 @@ - runtimedir: ${localstatedir}/run - - -+# Haiku Layout making use of finddir -+ -+ prefix: /boot/common -+ exec_prefix: /boot/common -+ bindir: /boot/common/bin -+ sbindir: /boot/common/servers -+ libdir: /boot/common/lib -+ libexecdir: /boot/common/servers -+ mandir: /boot/common/documentation/man -+ sysconfdir: /boot/common/settings -+ datadir: /boot/common/data -+ installbuilddir: /boot/develop/build -+ includedir: /boot/common/include -+ localstatedir: /boot/common/var -+ runtimedir: ${localstatedir}/log -+ -+ - # Mac OS X Server (Rhapsody) - - prefix: /Local/Library/WebServer -diff -urN apr-1.4.2/configure.in apr-1.4.2-haiku/configure.in ---- apr-1.4.2/configure.in 2009-11-16 07:45:28.064225280 +0000 -+++ apr-1.4.2-haiku/configure.in 2011-03-24 14:27:40.000000000 +0000 -@@ -143,7 +143,7 @@ - AC_PROG_CPP - AC_PROG_AWK - AC_PROG_LN_S --AC_PROG_RANLIB -+AC_PROG_LIBTOOL - AC_PROG_INSTALL - AC_CHECK_PROG(RM, rm, rm) - AC_CHECK_PROG(AS, as, as) diff --git a/dev-libs/apr/patches/apr-1.4.4.patch b/dev-libs/apr/patches/apr-1.4.4.patch deleted file mode 100644 index 86f9e8c76..000000000 --- a/dev-libs/apr/patches/apr-1.4.4.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff -urN apr-1.4.4/config.layout apr-1.4.4-haiku/config.layout ---- apr-1.4.4/config.layout 2004-11-24 22:51:51.065798144 +0000 -+++ apr-1.4.4-haiku/config.layout 2011-03-24 11:36:30.742653952 +0000 -@@ -60,6 +60,23 @@ - runtimedir: ${localstatedir}/run - - -+# Haiku Layout making use of finddir -+ -+ prefix: /boot/common -+ exec_prefix: /boot/common -+ bindir: /boot/common/bin -+ sbindir: /boot/common/servers -+ libdir: /boot/common/lib -+ libexecdir: /boot/common/servers -+ mandir: /boot/common/documentation/man -+ sysconfdir: /boot/common/settings -+ datadir: /boot/common/data -+ installbuilddir: /boot/develop/build -+ includedir: /boot/common/include -+ localstatedir: /boot/common/var -+ runtimedir: ${localstatedir}/log -+ -+ - # Mac OS X Server (Rhapsody) - - prefix: /Local/Library/WebServer -diff -urN apr-1.4.4/configure.in apr-1.4.4-haiku/configure.in ---- apr-1.4.4/configure.in 2009-11-16 07:45:28.064225280 +0000 -+++ apr-1.4.4-haiku/configure.in 2011-03-24 14:27:40.000000000 +0000 -@@ -143,7 +143,7 @@ - AC_PROG_CPP - AC_PROG_AWK - AC_PROG_LN_S --AC_PROG_RANLIB -+AC_PROG_LIBTOOL - AC_PROG_INSTALL - AC_CHECK_PROG(RM, rm, rm) - AC_CHECK_PROG(AS, as, as) diff --git a/dev-libs/apr/patches/apr-1.4.5.patch b/dev-libs/apr/patches/apr-1.4.5.patch deleted file mode 100644 index 1b713b281..000000000 --- a/dev-libs/apr/patches/apr-1.4.5.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff -urN apr-1.4.5/config.layout apr-1.4.5-haiku/config.layout ---- apr-1.4.5/config.layout 2004-11-24 22:51:51.056360960 +0000 -+++ apr-1.4.5-haiku/config.layout 2011-07-12 10:34:27.155189248 +0000 -@@ -60,6 +60,23 @@ - runtimedir: ${localstatedir}/run - - -+# Haiku Layout making use of finddir -+ -+ prefix: /boot/common -+ exec_prefix: /boot/common -+ bindir: /boot/common/bin -+ sbindir: /boot/common/servers -+ libdir: /boot/common/lib -+ libexecdir: /boot/common/servers -+ mandir: /boot/common/documentation/man -+ sysconfdir: /boot/common/settings -+ datadir: /boot/common/data -+ installbuilddir: /boot/develop/build -+ includedir: /boot/common/include -+ localstatedir: /boot/common/var -+ runtimedir: ${localstatedir}/log -+ -+ - # Mac OS X Server (Rhapsody) - - prefix: /Local/Library/WebServer -diff -urN apr-1.4.5/configure.in apr-1.4.5-haiku/configure.in ---- apr-1.4.5/configure.in 2011-04-11 12:58:38.043253760 -0700 -+++ apr-1.4.5-haiku/configure.in 2011-08-02 12:49:33.801112064 -0700 -@@ -204,7 +204,7 @@ - AC_PROG_CPP - AC_PROG_AWK - AC_PROG_LN_S --AC_PROG_RANLIB -+AC_PROG_LIBTOOL - AC_PROG_INSTALL - AC_CHECK_PROG(RM, rm, rm) - AC_CHECK_PROG(AS, as, as) -@@ -673,9 +673,9 @@ - ac_cv_func_CreateFileMapping=yes - ;; - *) -+ AC_SEARCH_LIBS(socket, socket network) - AC_SEARCH_LIBS(gethostbyname, nsl) - AC_SEARCH_LIBS(gethostname, nsl) -- AC_SEARCH_LIBS(socket, socket) - AC_SEARCH_LIBS(crypt, crypt ufc) - AC_CHECK_LIB(truerand, main) - AC_SEARCH_LIBS(modf, m)