You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2011/03/22 21:38:10 UTC
svn commit: r1084343 - in /commons/sandbox/runtime/trunk/src/main/native:
Makefile.unx.in configure include/acr/error.h include/acr/port.h
include/acr/stddefs.h os/darwin/ os/unix/arch_defs.h os/win32/arch_defs.h
port/bsdpath.c shared/buildmark.c
Author: mturk
Date: Tue Mar 22 20:38:09 2011
New Revision: 1084343
URL: http://svn.apache.org/viewvc?rev=1084343&view=rev
Log:
Add configure and makefile
Added:
commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in (with props)
commons/sandbox/runtime/trunk/src/main/native/configure (with props)
commons/sandbox/runtime/trunk/src/main/native/os/unix/arch_defs.h (with props)
commons/sandbox/runtime/trunk/src/main/native/os/win32/arch_defs.h (with props)
commons/sandbox/runtime/trunk/src/main/native/port/bsdpath.c (with props)
Removed:
commons/sandbox/runtime/trunk/src/main/native/os/darwin/
Modified:
commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h
commons/sandbox/runtime/trunk/src/main/native/include/acr/port.h
commons/sandbox/runtime/trunk/src/main/native/include/acr/stddefs.h
commons/sandbox/runtime/trunk/src/main/native/shared/buildmark.c
Added: commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in?rev=1084343&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in (added)
+++ commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in Tue Mar 22 20:38:09 2011
@@ -0,0 +1,145 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+include @topdir@/Makedefs
+
+.PHONY: test clean depends prepare
+
+SRCDIRS=\
+ $(TOPDIR)/os/$(HOSTSRC) \
+ $(TOPDIR)/os/unix \
+ $(TOPDIR)/port \
+ $(TOPDIR)/shared \
+ $(TOPDIR)/srclib/bzip2 \
+ $(TOPDIR)/srclib/zlib \
+ $(TOPDIR)/srclib/zlib/unix
+
+OUTLIBDIR=$(TOPDIR)/.libs
+SHAREDLL0=lib$(DLLNAME)$(SO)
+SHAREDLL1=$(SHAREDLL0).$(VERSION_MAJOR)
+SHAREDLIB=$(OUTLIBDIR)/$(SHAREDLL0).$(VERSION)
+SHAREDSSO=$(OUTLIBDIR)/$(SHAREDLL0)
+
+
+BZIP2_SOURCES=\
+ $(TOPDIR)/srclib/bzip2/blocksort.c \
+ $(TOPDIR)/srclib/bzip2/bzlib.c \
+ $(TOPDIR)/srclib/bzip2/compress.c \
+ $(TOPDIR)/srclib/bzip2/crctable.c \
+ $(TOPDIR)/srclib/bzip2/decompress.c \
+ $(TOPDIR)/srclib/bzip2/huffman.c \
+ $(TOPDIR)/srclib/bzip2/randtable.c
+
+ZLIB_SOURCES=\
+ $(TOPDIR)/srclib/zlib/adler32.c \
+ $(TOPDIR)/srclib/zlib/compress.c \
+ $(TOPDIR)/srclib/zlib/crc32.c \
+ $(TOPDIR)/srclib/zlib/deflate.c \
+ $(TOPDIR)/srclib/zlib/infback.c \
+ $(TOPDIR)/srclib/zlib/inffast.c \
+ $(TOPDIR)/srclib/zlib/inflate.c \
+ $(TOPDIR)/srclib/zlib/inftrees.c \
+ $(TOPDIR)/srclib/zlib/trees.c \
+ $(TOPDIR)/srclib/zlib/uncompr.c \
+ $(TOPDIR)/srclib/zlib/zutil.c
+
+ASMSOURCES=\
+ @zlib_asm_sources@
+
+UNIX_SOURCES=
+
+LINUX_SOURCES=
+
+SOLARIS_SOURCES=
+
+BSDX_SOURCES=
+
+HPUX_SOURCES=
+
+AIX_SOURCES=
+
+LIBSOURCES=\
+ $(BZIP2_SOURCES) \
+ $(EXPAT_SOURCES) \
+ $(REGEX_SOURCES) \
+ $(ZLIB_SOURCES) \
+ $(UNIX_SOURCES) \
+ $(@platform@_SOURCES) \
+ $(TOPDIR)/port/bsdpath.c \
+ $(TOPDIR)/port/bsdstring.c \
+ $(TOPDIR)/shared/bzip2.c \
+ $(TOPDIR)/shared/error.c \
+ $(TOPDIR)/shared/buildmark.c
+
+SHROBJECTS=$(LIBSOURCES:.c=.$(SLO)) $(ASMSOURCES:.S=.$(SLO))
+
+all: prepare @sharedlib@ @modules@
+
+%.$(SLO): %.c
+ $(CC) $(CCFLAGS) $(CCSHARE) $(CPPOPTS) $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+%.$(SLO): %.S
+ $(CPP) $(CPPOPTS) $(ASMOPTS) $< >$@.S
+ $(AS) $(ASFLAGS) $(ASSHARE) -c -o $@ $@.S
+ @rm $@.S
+
+$(SHAREDLIB): $(SHROBJECTS) @modules@
+ @$(EECHO) "Building shared library ..."
+ $(LD) $(LDARCH) $(SHFLAGS) $(LDDNAME) $(LDRPATH) $(SHROBJECTS) @modules@ $(LDFLAGS) -o $@
+ @(cd $(OUTLIBDIR) ; \
+ rm -f $(SHAREDLL0) ; \
+ rm -f $(SHAREDLL1) ; \
+ ln -s $(@F) $(SHAREDLL1) ; \
+ ln -s $(SHAREDLL1) $(SHAREDLL0) ; \
+ )
+
+$(SHAREDSSO): $(SHROBJECTS) @modules@
+ @$(EECHO) "Building shared library ..."
+ $(LD) $(LDARCH) $(SHFLAGS) $(LDDNAME) $(LDRPATH) $(SHROBJECTS) @modules@ $(LDFLAGS) -o $@
+
+Makefile: $(TOPDIR)/Makefile.unx.in
+ @./config.nice
+
+prepare:
+ @$(EECHO) "Building $(DESCBOLD) ..."
+ @mkdir -p $(OUTLIBDIR)
+
+depend:
+ @printf "\x23 AUTOMATICALLY GENERATED BY 'make depend' -- DO NOT EDIT\n\x23\n" >$(TOPDIR)/Makedeps
+ @for i in $(LIBSOURCES) @modules@ $(TSTSOURCES) ; do \
+ c=`echo $$i | sed "s/.c$$//"`; \
+ o=`basename $$c`; \
+ $(MAKEDEPS) $(CPPOPTS) $(CFLAGS) $(INCLUDES) $$i | \
+ sed -e "s;$$o.$(OBJ):;$$c.\$$(DEP):;" >>$(TOPDIR)/Makedeps; \
+ printf "\n" >>Makedeps; done
+
+clean:
+ @for i in $(SRCDIRS) ; do rm -f $$i/*.$(OBJ) $$i/*.$(SLO) ; done
+ @rm -rf $(OUTLIBDIR)
+ @echo cleaned.
+
+distclean: clean
+ @rm -f $(TOPDIR)/Makefile
+ @rm -f $(TOPDIR)/Makedefs
+ @rm -f $(TOPDIR)/Makedeps
+ @rm -f $(TOPDIR)/configure.log
+ @rm -f $(TOPDIR)/config.nice
+
+#
+# Include optional dependencies
+#
+DEP=$(SLO)
+-include $(TOPDIR)/Makedeps
Propchange: commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/runtime/trunk/src/main/native/configure
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/configure?rev=1084343&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/configure (added)
+++ commons/sandbox/runtime/trunk/src/main/native/configure Tue Mar 22 20:38:09 2011
@@ -0,0 +1,1522 @@
+#!/bin/sh
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ====================================================================
+#
+# configure Simple configure script with no dependency on
+# GNU autoconf tools.
+#
+# Important environment variables
+#
+# CC Compiler used defaults to gcc
+# AS Assempler used defaults to $CC
+# AR Archiver used defaults to ar
+# CPP Preprocessor used defaults to $CC -E
+# CFLAGS Compile task flags
+# ASFLAGS Assembler flags
+# LIBS Additional Libraries and library paths
+# Usually -L<dir> and -llibrary
+# INCLUDES Include directories
+# LDFLAGS Linker flags added to the linker
+# SHFLAGS Linker flags added when producing
+# shared libraries
+# RCFLAGS Resource compile task flags
+# Used only on windows.
+# TOPDIR Top directory defaults to .
+# JAVA_HOME Home of the Java SDK
+# Overridable by --with-java-home option
+#
+# ====================================================================
+#
+# This is a bash script, which works with any reasonable sh.
+# Solaris sh is not, so we have to start bash, and call ourselves again.
+#
+test "x$1" != "x__running_the_bash_shell@" && \
+(
+ `which sh` -c "__bash_a=(_A _B); echo \${__bash_a[*]}" >/dev/null 2>&1
+ __need_bash=$?
+ test "x$__need_bash" != "x0" && bash $0 __running_the_bash_shell@ "$@"
+ test "x$__need_bash" = "x0" && sh $0 __running_the_bash_shell@ "$@"
+)
+
+if [ "x$1" != "x__running_the_bash_shell@" ]; then
+ exit
+fi
+shift
+echo "#!/bin/sh" >config.nice
+echo "$0 $*" >>config.nice
+chmod +x config.nice
+EECHO=echo
+test ".`echo -e e 2>&1`" = .e && EECHO="echo -e"
+verbose=no
+name=acr
+pname=ACR
+desc="Apache Commons Runtime Library"
+prefix="${PREFIX:=/usr/local}"
+libdir=""
+incdir=""
+shrdir=""
+bindir="bin"
+cc="${CC}"
+ar="${AR}"
+as="${AS}"
+arflags="${ARFLAGS:=ru}"
+ranlib="${RANLIB:=ranlib}"
+makedeps="${MAKEDEPS:=echo >/dev/null}"
+topdir="${TOPDIR:=`dirname $0`}"
+cpp="${CPP}"
+ccflags="$CFLAGS"
+asflags="$ASFLAGS"
+ldflags="$LDFLAGS"
+shflags="$SHFLAGS"
+optlibs="$LIBS"
+strip="${STRIP}"
+asmopts=""
+cppopts=""
+ccshare=""
+ldrpath=""
+lddarch=""
+lddname=""
+includes="$INCLUDES"
+ssldflags=""
+bige=0
+so=.so
+lib=.a
+obj=o
+bits=""
+java_home="$JAVA_HOME"
+java_platform_inc=""
+java_home_set=no
+has_java=no
+has_64_bit=no
+has_32_bit=no
+has_test_private=no
+has_maintainer_mode=no
+has_native_threads=no
+has_sysv_mutex=yes
+has_posix_mutex=no
+has_fcntl_mutex=no
+has_shared=yes
+has_shared_version=no
+has_zlib_asm=yes
+has_openssl=no
+has_ipv6=no
+openssl_home="$OPENSSL_HOME"
+openssl_inc=""
+openssl_lib=""
+cccinc="stdio"
+mmake="make"
+makefiles=Makefile.in
+cc_ver_major=0
+cc_ver_minor=0
+cc_set=no
+cccsrc=ctest$$
+mach=unknown
+has_legacy_code=no
+modules=""
+sharedlib=""
+zlib_asm_sources=""
+linkedlib='$(LIBNAME)'
+
+for o
+do
+ case "$o" in
+ --enable-*)
+ a=`echo "$o" | sed -e 's/--enable-//' -e 's/-/_/'`
+ case "$a" in
+ *=* )
+ v=`echo "$a" | sed 's/^[_a-zA-Z0-9]*=//'`
+ a=`echo "$a" | sed 's/=.*//'`
+ ;;
+ * )
+ v='yes'
+ ;;
+ esac
+ eval has_${a}=$v
+ eval has_${a}_set=yes
+ shift
+ continue
+ ;;
+ --disable-*)
+ a=`echo "$o" | sed -e 's/--disable-//' -e 's/-/_/'`
+ case "$a" in
+ *=* )
+ a=`echo "$a" | sed 's/=.*//'`
+ ;;
+ esac
+ eval has_${a}=no
+ eval has_${a}_set=yes
+ shift
+ continue
+ ;;
+ *=*) a=`echo "$o" | sed 's/^[-_a-zA-Z0-9]*=//'`
+ ;;
+ *) a=''
+ ;;
+ esac
+ case "$o" in
+ --verbose )
+ verbose=yes
+ shift
+ ;;
+ --debug )
+ has_maintainer_mode=yes
+ shift
+ ;;
+ --name=* )
+ name="$a"
+ shift
+ ;;
+ --prefix=* )
+ prefix="$a"
+ shift
+ ;;
+ --libdir=* )
+ libdir="$a"
+ shift
+ ;;
+ --bindir=* )
+ bindir="$a"
+ shift
+ ;;
+ --incdir=* )
+ incdir="$a"
+ shift
+ ;;
+ --sharedir=* )
+ shrdir="$a"
+ shift
+ ;;
+ --with-arch=* )
+ mach="$a"
+ shift
+ ;;
+ --with-cc=* )
+ cc="$a"
+ cc_set=yes
+ shift
+ ;;
+ --with-cxx=* )
+ cxx="$a"
+ cxx_set=yes
+ shift
+ ;;
+ --with-cpp=* )
+ cpp="$a"
+ cpp_set=yes
+ shift
+ ;;
+ --with-java-home=* )
+ java_home="$a"
+ java_home_set=yes
+ shift
+ ;;
+ --with-java-platform=* )
+ java_platform_inc="$a"
+ shift
+ ;;
+ --with-openssl=* )
+ openssl_inc="$a/include"
+ openssl_lib="$a/lib"
+ has_openssl=yes
+ shift
+ ;;
+ CC=*) cc="$a" ; shift ;;
+ LD=*) ld="$a" ; shift ;;
+ AS=*) as="$a" ; shift ;;
+ AR=*) ar="$a" ; shift ;;
+ CPP=*) cpp="$a" ; shift ;;
+ RANLIB=*) ranlib="$a" ; shift ;;
+ STRIP=*) strip="$a" ; shift ;;
+ CFLAGS=*) cppopts="$a" ; shift ;;
+ LDFLAGS=*) ldflags="$a" ; shift ;;
+ ASFLAGS=*) asflags="$a" ; shift ;;
+ SHFLAGS=*) shflags="$a" ; shift ;;
+ * )
+ cat 1>&2 << EOH
+Usage: configure [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Usage: configure [options]
+
+Installation directories:
+ --name=NAME Project name
+ [acr]
+ --prefix=PREFIX Install architecture-independent files in PREFIX
+ [/usr/local]
+ --libdir=LPREFIX Install architecture-dependent files in LPREFIX
+ [PREFIX/lib]
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ CPP C preprocessor
+ LDFLAGS Linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ SHFLAGS Linker command flags
+
+Compiler options:
+ --with-cc=C Use C compiler instead default one
+ [gcc]
+ --with-cpp=CPP Use CPP preprocessor instead default one
+ [gcc -E]
+Optional features:
+ --debug Compile code with debug options.
+ [disabled]
+ --enable-maintainer-mode Same as --debug
+
+ --enable-32-bit Forces 32-bit code compilation
+ [platform dependent]
+ --enable-64-bit Forces 64-bit code compilation
+ [platform dependent]
+ --enable-native-threads Enables Solaris native threads support
+ [disabled]
+ --enable-legacy-code Enables maximum binary platform compatibility
+ [disabled]
+ --enable-test-private Enables private test code compilation
+ [disabled]
+ --with-java-home=DIR Path to the Java SDK
+ [\$JAVA_HOME environment variable]
+ --with-java-platorm=DIR Path to the Java platform include
+ [\$JAVA_HOME/include/platform]
+
+Optional packages:
+ --enable-openssl Enable compilation of OpenSSL SSL/TLS module
+ [disabled]
+ --with-openssl=DIR Path to the OpenSSL toolkit install location
+ If not specified default compiler include path
+ will be used.
+EOH
+ exit 1
+ ;;
+ esac
+done
+
+varadds()
+{
+ p=$1 ; shift
+ if [ ".$p" = ".::" ]; then
+ eval "$p=\"\""
+ elif [ ".$1" != . ]; then
+ eval e="\$$p"
+ if [ ".$e" = . ]; then
+ eval "$p=\"$@\""
+ else
+ for v in $@
+ do
+ do_adds=true
+ for i in $e
+ do
+ if [ ".$v" = ".$i" ]; then
+ do_adds=false
+ break
+ fi
+ done
+ test $do_adds && e="$e $v"
+ done
+ eval "$p=\"$e\""
+ fi
+ fi
+}
+
+findgnutool()
+{
+ r=""
+ sIFS=$IFS; IFS=": "
+ for p in `echo $PATH`
+ do
+ if [ -x "$p/$1" ]; then
+ $p/$1 --help 2>/dev/null | grep -i gnu 1>/dev/null
+ if [ $? -eq 0 ]; then
+ r="$p/$1"
+ break
+ fi
+ fi
+ done
+ IFS=$sIFS
+ echo "$r"
+}
+
+getgnutool()
+{
+# do_printf 'Checking for %-32s' "$1"
+ r="`findgnutool $1`"
+ if [ ".$r" = . ]; then
+ e="`which $1 2>/dev/null || type $1 2>&1`"
+ if [ -x "$e" ]; then
+ r="$e"
+ fi
+ fi
+ echo "$r"
+}
+
+getmstool()
+{
+ sIFS=$IFS ; IFS=:
+ for p in $PATH
+ do
+ if [ -x "$p/$1.exe" ]; then
+ if [ ".`$p/$1.exe -version 2>/dev/null | head -1 | grep Microsoft`" != . ]; then
+ if [ ".$has_cygwin" = .yes ]; then
+ cygpath -w "$p/$1.exe" | sed 's;\\;\\\\;g'
+ else
+ echo "`echo "$p/$1.exe" | sed 's;^/\([c-zC-Z]\)/;\1\:/;'`" | sed 's;/;\\\\;g'
+ fi
+ return
+ fi
+ fi
+ done
+ echo $1.exe
+}
+
+toupper()
+{
+ echo "$1" | tr '[a-z]' '[A-Z]'
+}
+
+tolower()
+{
+ echo "$1" | tr '[A-Z]' '[a-z]'
+}
+
+if [ ".$java_home" = . ]; then
+ echo 'Missing JAVA_HOME environment variable'
+ echo 'Set JAVA_HOME environment variable to point to valid'
+ echo 'Java SDK location or use --with-java-home=<path>'
+ exit 1
+fi
+if [ ! -d "$java_home" ]; then
+ echo "\`$java_home' is not valid JAVA_HOME directory"
+ exit 1
+fi
+jvm_64_bit=no
+test ".`java -version 2>&1 | grep '64-Bit'`" != . && jvm_64_bit=yes
+test ".$cc" = . && cc=`getgnutool gcc`
+test ".$ar" = . && ar=`getgnutool ar`
+test ".$ranlib" = . && ranlib=`getgnutool ranlib`
+test ".$strip" = . && strip=`getgnutool strip`
+
+varadds includes "-I??(TOPDIR)/include -I??(TOPDIR)/srclib"
+major_sed='/#define.*ACR_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p'
+minor_sed='/#define.*ACR_MINOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p'
+patch_sed='/#define.*ACR_PATCH_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p'
+vmajor="`sed -n $major_sed $topdir/include/acr/version.h`"
+vminor="`sed -n $minor_sed $topdir/include/acr/version.h`"
+vpatch="`sed -n $patch_sed $topdir/include/acr/version.h`"
+vdotted=$vmajor.$vminor.$vpatch
+test ".$libdir" = . && libdir="lib"
+test ".$incdir" = . && incdir="include/$name-$vmajor.$vminor"
+test ".$shrdir" = . && incdir="share/$name-$vmajor.$vminor"
+
+if [ ".$mach" = .unknown ]; then
+ mach=`uname -m 2>/dev/null | tr '[A-Z]' '[a-z]'` || mach="unknown"
+fi
+host=`uname -s 2>/dev/null | tr '[A-Z]' '[a-z]'` || host="unknown"
+
+test ".$has_64_bit" = .yes && bits=64
+test ".$has_32_bit" = .yes && bits=32
+
+platfromver=1
+case "$host" in
+ aix )
+ platform=AIX
+ platformver="`uname -v``uname -r`"
+ ;;
+ hp-ux )
+ platform=HPUX
+ platformver="`uname -r | sed 's/[A-Z].[0-9]*.//'`"
+ host=hpux
+ test ".$cc_set" = .no && cc=cc
+ ;;
+ sunos )
+ platform=SOLARIS
+ platformver="`uname -r | sed 's/5.//'`"
+ host=solaris
+ test ".$cc_set" = .no && cc=cc
+ ;;
+ darwin )
+ platform=BSDX
+ platformver="`uname -r | sed 's/\.//g'`"
+ ;;
+ *bsd )
+ platform=BSDX
+ platformver="`uname -r | sed 's/\.//g'`"
+ mmake=`getgnutool gmake`
+ ;;
+ linux )
+ platform=LINUX
+ platformver="`uname -r | sed 's/\.//' | sed 's/\..*//'`"
+ ;;
+ windows )
+ platform=WIN32
+ platformver="0x0501"
+ host=win32
+ test ".$cc_set" = .no && cc=cl
+ ;;
+ * )
+ platform=`toupper "$host"`
+ ;;
+esac
+uhost=`toupper "$host"`
+hincs=`tolower "$platform"`
+
+test ".$cpp" = . && cpp="$cc -E"
+test ".$as" = . && as="$cc"
+test ".$ld" = . && ld="$cc"
+cn=`echo "$cc" | sed 's/ .*/./'`
+cctype=`basename $cn`
+
+case "$mach" in
+ amd64|x86_64 )
+ mach=x86_64
+ test ".$has_32_bit" = .yes && mach=i386
+ ;;
+ ia64 )
+ test ".$has_32_bit" = .yes && mach=ia32
+ ;;
+ i[3-7]86 )
+ mach=i386
+ if [ ".$host" = .darwin ]; then
+ if [ ".$has_32_bit" = .no ]; then
+ test ".$jvm_64_bit" = .yes && has_64_bit=yes
+ fi
+ test ".$has_64_bit" = .yes && mach=x86_64
+ test ".$has_32_bit" = .yes && mach=i386
+ fi
+ ;;
+ i86pc )
+ mach=i386
+ ;;
+ sun4* )
+ mach=sparc
+ test ".$has_64_bit" = .yes && mach=sparc64
+ bige=1
+ ;;
+ 9000/[678][0-9][0-9] )
+ mach=parisc
+ test ".$has_64_bit" = .yes && mach=parisc64
+ bige=1
+ ;;
+ power* )
+ mach=ppc
+ test ".$has_64_bit" = .yes && mach=ppc64
+ bige=1
+ ;;
+esac
+
+case "$host-$mach" in
+ *-*64 )
+ test ".$bits" = . && bits=64
+ ;;
+ *-i386|darwin-ppc )
+ test ".$bits" = . && bits=32
+ ;;
+esac
+
+mcpu="_`toupper $mach`_"
+case "$host-$cctype" in
+ linux-gcc )
+ varadds cppopts -D_BSD_SOURCE -D_GNU_SOURCE
+ varadds cppopts -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED
+ varadds ccflags -O3 -Wall -Wundef
+ varadds ccshare -fPIC
+ if [ ".$mach" = .i386 ]; then
+ varadds ccflags -march=i686
+ fi
+ varadds asflags -c -D$mcpu
+ varadds ashare -fPIC
+ varadds ldflags -lrt -lpthread -ldl
+ varadds shflags -shared -fPIC
+ if [ ".$has_shared_version" = .yes ]; then
+ varadds lddname '-Wl,-soname,lib??(NAME)??(SO).??(VERSION_MAJOR)'
+ else
+ varadds lddname '-Wl,-soname,lib??(NAME)??(SO)'
+ fi
+ varadds ldrpath '-Wl,-rpath,??(PREFIX)/??(LIBDIR):????ORIGIN'
+ test ".$java_platform_inc" = . && java_platform_inc=linux
+ ;;
+ *bsd-gcc )
+ varadds cppopts -D_BSD_SOURCE
+ varadds cppopts -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED
+ varadds ccflags -O3 -Wall
+ varadds ccshare -fPIC
+ if [ ".$mach" = .i386 ]; then
+ varadds ccflags -march=i686
+ fi
+ varadds asflags -c -D$mcpu
+ varadds ashare -fPIC
+ varadds ldflags -lpthread
+ varadds shflags -shared -fPIC
+ if [ ".$has_shared_version" = .yes ]; then
+ varadds lddname '-Wl,-soname,lib??(NAME)??(SO).??(VERSION_MAJOR)'
+ else
+ varadds lddname '-Wl,-soname,lib??(NAME)??(SO)'
+ fi
+ varadds ldrpath '-Wl,-rpath,??(PREFIX)/??(LIBDIR):????ORIGIN'
+ test ".$java_platform_inc" = . && java_platform_inc=$host
+ ;;
+ linux-cc )
+ if [ ".$mach" = .i386 ]; then
+ varadds ccflags -fast -xbuiltin=%none -U__MATHERR_ERRNO_DONTCARE -xnolibmopt -xnolibmil
+ fi
+ varadds cppopts -D_BSD_SOURCE -D_GNU_SOURCE
+ varadds cppopts -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED
+ varadds ccflags -xdepend -O -Wall
+ varadds ccshare -KPIC
+ varadds asflags -c -D$mcpu
+ varadds ldflags -lpthread -ldl
+ varadds shflags -G -KPIC -dy
+ if [ ".$has_shared_version" = .yes ]; then
+ varadds lddname -h 'lib??(NAME)??(SO).??(VERSION_MAJOR)'
+ else
+ varadds lddname -h 'lib??(NAME)??(SO)'
+ fi
+ varadds ldrpath '-R:??(PREFIX)/??(LIBDIR):.'
+ test ".$java_platform_inc" = . && java_platform_inc=linux
+ ;;
+ darwin-gcc )
+ varadds cppopts -D_BSD_SOURCE
+ varadds ccflags -O3 -Wall
+ varadds ccshare -fPIC
+ varadds asflags -c -D$mcpu
+ varadds ldflags -lpthread -ldl
+ varadds ldrpath '-Wl,-rpath,??(PREFIX)/??(LIBDIR):.'
+ so=".jnilib"
+ varadds shflags -dynamiclib -flat_namespace -undefined suppress -fPIC
+ if [ ".$has_shared_version" = .yes ]; then
+ varadds lddname '-Wl,-compatibility_version,??(VERSION_MAJOR).0.0'
+ varadds lddname '-Wl,-current_version,??(VERSION_MAJOR).??(VERSION_MINOR).??(VERSION_PATCH)'
+ varadds lddname '-Wl,-install_name,lib??(NAME)??(SO).??(VERSION_MAJOR)'
+ else
+ varadds lddname '-Wl,-install_name,lib??(NAME)??(SO)'
+ fi
+ ;;
+ solaris-cc )
+ if [ ".$mach" = .sparc ]; then
+ varadds ccflags -xarch=sparc
+ varadds asflags -xarch=sparc
+ else
+ varadds ccflags -fast -xbuiltin=none -U__MATHERR_ERRNO_DONTCARE -xnolibmopt -xnolibmil
+ test ".$bits" = .64 && varadds asflags -xarch=amd64
+ fi
+ if [ ".$has_native_threads" = .yes ]; then
+ varadds ccflags -mt
+ varadds cppopts -DHAS_NATIVE_THREADS
+ else
+ varadds cppopts -D_POSIX_PTHREAD_SEMANTICS
+ fi
+ varadds ccflags -xstrconst -xdepend -O -Xa
+ varadds ccshare -KPIC
+ varadds ldflags -lrt -ldl -lthread -lsendfile -lsocket -lnsl
+ varadds shflags -G -KPIC -dy
+ if [ ".$has_shared_version" = .yes ]; then
+ varadds lddname -h 'lib??(NAME)??(SO).??(VERSION_MAJOR)'
+ else
+ varadds lddname -h 'lib??(NAME)??(SO)'
+ fi
+ varadds ldrpath '-R:??(PREFIX)/??(LIBDIR):.'
+ test ".$java_platform_inc" = . && java_platform_inc=solaris
+ ;;
+ hpux-cc )
+ varadds cppopts -D_HPUX_SOURCE -DHPUX11=$r
+ varadds ccflags -Ae +O2 -z
+ varadds ccshare +Z
+ varadds asflags -c +Z -D$mcpu
+ varadds ldflags -lrt -lpthread -ldld -lm
+ varadds asflags +Z
+ test ".$mach" = .parisc && so=.sl
+ varadds shflags +Z -b
+ if [ ".$has_shared_version" = .yes ]; then
+ varadds lddname +h 'lib??(NAME)??(SO).??(VERSION_MAJOR)'
+ else
+ varadds lddname +h 'lib??(NAME)??(SO)'
+ fi
+ test ".$java_platform_inc" = . && java_platform_inc=hp-ux
+ ;;
+ aix-gcc )
+ varadds cppopts -U__STR__ -D_THREAD_SAFE -D_USE_IRS -D$mcpu -D__CC$bits
+ varadds ccflags -O2 -Wall -pthread
+ varadds ccshare -fPIC
+ varadds ldflags -lrt -lpthreads -lnsl
+ varadds shflags -shared -fPIC
+ varadds lddname -Wl,-soname '-Wl,??@' -Wl,-brtl
+ varadds ldrpath '-Wl,-rpath,??(PREFIX)/??(LIBDIR):????ORIGIN'
+ echo "Warning : WORK IN PROGRESS"
+ ;;
+ * )
+ echo "$host$bits-$cc platform is not supported!"
+ exit 1
+ ;;
+esac
+
+test ".$optlibs" != . && varadds ldflags $optlibs
+case "$host-$cctype" in
+ *-gcc )
+ v="`$cc -dumpversion 2>/dev/null | sed 's/\./ /g'`"
+ cc_ver_major=`echo "$v" | awk '{print $1;}'`
+ if [ ".$cc_ver_major" = . ]; then
+ echo "Error: Cannot determine $cc version"
+ exit 1
+ fi
+ cc_ver_major=`echo "$v" | awk '{print $2;}'`
+ if [ ".$has_maintainer_mode" != .yes ]; then
+ varadds ccflags -fno-stack-protector
+ else
+ varadds ccflags -g
+ varadds asflags -g
+ fi
+ if [ ${cc_ver_major}${cc_ver_minor}0 -gt 400 ]; then
+ varadds cppopts -DUSE_GCC_ATOMIC_BUILTINS
+ varadds ccflags -fvisibility=hidden
+ fi
+ varadds ccflags -fstrict-aliasing
+ makedeps="$cc -MM"
+ if [ ".$has_zlib_asm" = .yes ]; then
+ if [ ".$mach" = .i386 ]; then
+ varadds cppopts -DASMV
+ zlib_asm_sources='$(TOPDIR)/srclib/zlib/unix/i686-match.S'
+ fi
+ if [ ".$mach" = .x86_64 ]; then
+ varadds cppopts -DASMV
+ zlib_asm_sources='$(TOPDIR)/srclib/zlib/unix/gvmat64.S'
+ fi
+ fi
+ ;;
+ *-cc )
+ makedeps="$cc -MM"
+ ;;
+esac
+
+case "$host$bits-$cc" in
+ hpux64-cc )
+ varadds ccflags +DD64
+ varadds asflags +DD64
+ varadds lddarch +DD64
+ if [ ".$mach" = .parisc64 ]; then
+ varadds ccflags +DA2.0W
+ varadds asflags +DA2.0W
+ varadds lddarch +DA2.0W
+ varadds asflags +DA2.0W
+ fi
+ ;;
+ hpux32-cc )
+ varadds ccflags +DD32
+ varadds asflags +DD32
+ varadds lddarch +DD32
+ ;;
+ *64-* )
+ varadds ccflags -m64
+ varadds asflags -m64
+ varadds lddarch -m64
+ ;;
+ *32-* )
+ varadds ccflags -m32
+ varadds asflags -m32
+ varadds lddarch -m32
+ ;;
+esac
+
+
+if [ "$EECHO" = "echo -e" ]; then
+ bldon="\033[1m"
+ bldof="\033[0m"
+else
+ bldon=""
+ bldof=""
+fi
+descb="$bldon$desc $vdotted$bldof"
+$EECHO "Configuring $descb. for $host$bits-$cctype"
+echo ""
+
+varadds cppopts "-D$platform -D_$platform -D__$uhost=$platformver"
+varadds cppopts "-D$mcpu -D__CC$bits"
+# Common defines
+varadds cppopts -D_REENTRANT -D_LARGEFILE64_SOURCE=1
+if [ ".$bits" = .64 ]; then
+ varadds cppopts -D_COMPILE64BIT_SOURCE=1
+else
+ test ".$host" != .hpux && varadds cppopts -D_FILE_OFFSET_BITS=64
+fi
+varadds includes "-I??(TOPDIR)/os/unix"
+test ".$has_legacy_code" = .yes && varadds cppopts -DENABLE_LEGACY_CODE
+if [ ".$has_maintainer_mode" = .yes ]; then
+ varadds cppopts -DDEBUG -D_DEBUG
+else
+ varadds cppopts -DNDEBUG
+fi
+if [ ".$has_posix_mutex" = .yes ]; then
+ if [ ".$has_sysv_mutex_set" = .yes ]; then
+ echo "[ERROR] Cannot have both Posix and System V mutexes"
+ exit 22
+ fi
+ has_sysv_mutex=no
+fi
+if [ ".$has_fcntl_mutex" = .yes ]; then
+ if [ ".$has_sysv_mutex_set" = .yes ]; then
+ echo "[ERROR] Cannot have both File and System V mutexes"
+ exit 22
+ fi
+ if [ ".$has_posix_mutex_set" = .yes ]; then
+ echo "[ERROR] Cannot have both File and Posix mutexes"
+ exit 22
+ fi
+ has_sysv_mutex=no
+ has_posix_mutex=no
+fi
+
+if [ ".$has_sysv_mutex" = .yes ]; then
+ varadds cppopts -DUSE_SYSV_MUTEX
+elif [ ".$has_posix_mutex" = .yes ]; then
+ varadds cppopts -DUSE_POSIX_MUTEX
+else
+ varadds cppopts -DUSE_FCNTL_MUTEX
+fi
+if [ ".$has_test_private" = .yes ]; then
+ varadds cppopts -DENABLE_TESTPRIVATE
+ testobjects='$(TEST_OBJECTS)'
+else
+ testobjects=""
+fi
+varadds cppopts -DOCPR_API_EXPORT
+if [ ".$has_shared_version" = .yes ]; then
+ sharedlib='$(SHAREDLIB)'
+else
+ sharedlib='$(SHAREDSSO)'
+fi
+linkedlib='$(DLLNAME)'
+if [ ".$java_home_set" = .yes ]; then
+ varadds includes "-I$java_home/include"
+ if [ ".$java_platform_inc" != . ]; then
+ if [ -d "$java_home/include/$java_platform_inc" ]; then
+ varadds includes "-I$java_home/include/$java_platform_inc"
+ else
+ echo ""
+ echo "Warning: \`$java_home/include/$java_platform_inc' in not a directory"
+ fi
+ fi
+else
+ varadds includes "-I??(JAVA_HOME)/include"
+ if [ ".$java_platform_inc" != . ]; then
+ varadds includes "-I??(JAVA_HOME)/include/$java_platform_inc"
+ fi
+fi
+
+test ".$has_ipv6" = .yes && varadds cppopts -DENABLE_IPV6
+trap 'rm -f $cccsrc ; trap 2 ; kill -2 $$' 1 2 3 13 15
+trap 'rm -f $cccsrc' 0
+
+configlog=/dev/null
+if [ ".$verbose" = .yes ]; then
+ configlog=configure.log
+ echo "Configuring $desc $vdotted for $host$bits-$cc" >$configlog
+ echo "" >>$configlog
+ echo "Configuration" >>$configlog
+ echo "Compiler : $cc" >>$configlog
+ cat > $cccsrc.c << EOF
+/* $host$bits-$cc */
+EOF
+ echo "### Compiler-specific predefined macros" >>$configlog
+ case "$host-$cctype" in
+ *-gcc )
+ $cc -dM -E $cccsrc.c >>$configlog 2>&1
+ ;;
+ *-suncc )
+ $cc -## -E $cccsrc.c >>$configlog 2>&1
+ ;;
+ hpux-* )
+ $cc -v -E $cccsrc.c >>$configlog 2>&1
+ ;;
+ aix-cc )
+ $cc -qshowmacros -E $cccsrc.c >>$configlog 2>&1
+ ;;
+ esac
+ echo "" >>$configlog
+ rm -rf $cccsrc.* $cccsrc >/dev/null 2>&1 || true
+fi
+
+test_shared()
+{
+ cat > $cccsrc.c << EOF
+extern int getchar();
+int hello() {return getchar();}
+EOF
+ do_printf 'Checking for %-32s' "shared library support"
+ cl="$cc -c $ccflags $ccshare $cppopts $cccsrc.c -o $cccsrc.$obj"
+ ll="$ld $lddarch $shflags $cccsrc.$obj $ldflags -o $cccsrc$so"
+ co="`eval $cl 2>&1`"
+ if [ ".$co" = "." ]; then
+ co="`eval $ll 2>&1`"
+ if [ ".$co" = "." ]; then
+ echo "ok"
+ fi
+ fi
+ echo "" >>$configlog
+ cat $cccsrc.c >>$configlog
+ echo "" >>$configlog
+ echo "$cl" >>$configlog
+ echo "$ll" >>$configlog
+ echo $co >>$configlog
+ if [ ".$co" != "." ]; then
+ echo "failed!"
+ rm -rf $cccsrc.* $cccsrc >/dev/null 2>&1 || true
+ exit 1
+ fi
+ nm_bin="`which nm 2>/dev/null || type nm 2>&1`"
+ if [ -x "$nm_bin" ]; then
+ if [ ".`$nm_bin $cccsrc.$obj | grep _hello`" = "." ]; then
+ varadds asmopts -DNO_UNDERLINE
+ else
+ echo "Shared library requires underlined symobls" >>$configlog
+ echo "" >>$configlog
+ fi
+ else
+ echo "Cannot find nm binary. Add -DNO_UNDERLINE manualy"
+ fi
+ rm -rf $cccsrc.* $cccsrc >/dev/null 2>&1 || true
+}
+
+#
+# $1 flag
+# $2 default value
+# $3 cc params
+test_compile()
+{
+ rc=0
+ rd="not found"
+ cl="$cc $ccflags $cppopts $ldflags $3 $cccsrc.c -o $cccsrc"
+ co="`eval $cl 2>&1`"
+ if [ ".$co" = "." ]; then
+ rc=1
+ else
+ test -x $cccsrc && rc=1
+ fi
+ echo "" >>$configlog
+ cat $cccsrc.c >>$configlog
+ echo "" >>$configlog
+ echo "$cl" >>$configlog
+ echo $co >>$configlog
+ if [ ".$1" = .x ]; then
+ rd=""
+ test ".$rc" = ".1" && rd="`./$cccsrc 2>>$configlog`"
+ test ".$rd" = "." && rd=$2
+ rc=$rd
+ else
+ test ".$rc" = .1 && rd=ok
+ fi
+ echo "Result: $rd" >>$configlog
+ echo "" >>$configlog
+ echo "" >>$configlog
+ rm -rf $cccsrc.* $cccsrc >/dev/null 2>&1 || true
+ test ".$1" != .q && echo $rd 1>&2
+ echo $rc
+}
+
+do_printf()
+{
+ printf "$1" "$2" 1>&2
+ printf "### " >>$configlog
+ printf "$1" "$2" >>$configlog
+ echo "" >>$configlog
+}
+
+have_include()
+{
+ do_printf 'Checking for %-32s' "<$1.h>"
+ cat > $cccsrc.c << EOF
+#include <stdlib.h>
+#include <$cccinc.h>
+$3
+#include <$1.h>
+int main() {return 0;}
+EOF
+ rc=`test_compile`
+ echo $rc
+}
+
+have_library()
+{
+ do_printf 'Checking for %-32s' "$1 library"
+ if [ ".$2" != . ]; then
+ cat >> $cccsrc.c << EOF
+#define $2 wrapper_$2
+#ifdef __STDC__
+#include <limits.h>
+#else
+#include <assert.h>
+#endif
+#undef $2
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+char $2();
+int main() {return $2();}
+EOF
+ else
+ cat >> $cccsrc.c << EOF
+#include <stdlib.h>
+#include <$cccinc.h>
+int main() {return 0;}
+EOF
+ fi
+ rc=`test_compile 0 0 -l$1`
+ echo $rc
+}
+
+have_function_body()
+{
+ cat > $cccsrc.c << EOF
+#define $1 wrapper_$1
+#ifdef __STDC__
+#include <limits.h>
+#else
+#include <assert.h>
+#endif
+#undef $1
+#if defined __stub_$1 || defined __stub___$1
+choke me
+#endif
+char $1 ();
+int main() { return $1 (); }
+EOF
+ rc=`test_compile q`
+ echo $rc
+}
+
+have_function()
+{
+ do_printf 'Checking for %-32s' "$2"
+ if [ .$1 = .c -a .$has_legacy_code = .yes ]; then
+ do_printf 'not supported by legacy code'
+ rc=0
+ else
+ rc=`have_function_body $2 $3`
+ test ".$rc" = .0 && rc=`have_function_body __$2 $3`
+ if [ ".$rc" = .1 ]; then
+ echo ok 1>&2
+ else
+ echo "not found" 1>&2
+ fi
+ fi
+ echo $rc
+}
+
+have_defined()
+{
+ do_printf 'Checking for %-32s' "$1"
+ cat > $cccsrc.c << EOF
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <fcntl.h>
+EOF
+ test ".$2" != . && echo "#include <$2.h>" >>$cccsrc.c
+ cat >> $cccsrc.c << EOF
+int main() {return (int)($1);}
+EOF
+ rc=`test_compile`
+ echo $rc
+}
+
+have_typedef()
+{
+ do_printf 'Checking for typedef %-24s' "$1"
+ cat > $cccsrc.c << EOF
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include <wctype.h>
+EOF
+ test ".$2" != . && echo "#include <$2.h>" >>$cccsrc.c
+ test ".$3" != . && echo "#include <$3.h>" >>$cccsrc.c
+ cat >> $cccsrc.c << EOF
+typedef $1 _check_t;
+int main() {printf("%d", (int)sizeof(_check_t));return 0;}
+EOF
+ rc=`test_compile`
+ echo $rc
+}
+
+have_strcut_member()
+{
+ do_printf 'Checking for struct member %-18s' "$3"
+ cat > $cccsrc.c << EOF
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include <$1.h>
+int main () {return (int)offsetof($2, $3);}
+EOF
+ rc=`test_compile`
+ echo $rc
+}
+
+have_thread_local()
+{
+ do_printf 'Checking for thread local support %-11s' " "
+ cat > $cccsrc.c << EOF
+#include <stdio.h>
+#include <stdlib.h>
+#if defined (_MSC_VER)
+# define CPR_THREAD __declspec (thread)
+#else
+# define CPR_THREAD __thread
+#endif
+CPR_THREAD int tls_i=1;
+static CPR_THREAD char tls_sa[8]={0};
+extern CPR_THREAD char tls_ea[8];
+CPR_THREAD char tls_ea[8]={0};
+int main () {printf("%d", tls_i+tls_sa[0]+tls_ea[0]);return 0;}
+EOF
+ rc=`test_compile x 0`
+ echo $rc
+}
+
+have_ipv6()
+{
+ do_printf 'Checking for %-32s' "ipv6 support"
+ cat > $cccsrc.c << EOF
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+int rc = 0;
+int main () {
+if(socket(AF_INET6,SOCK_STREAM,0)>= 0)rc = 1;printf("%d", rc);return 0;
+}
+EOF
+ rc=`test_compile x 0`
+ echo $rc
+}
+
+check_sizeof()
+{
+ do_printf 'Checking for sizeof %-25s' "$1"
+ cat > $cccsrc.c << EOF
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <wctype.h>
+
+int main() {printf("%d", (int)sizeof($1));return 0;}
+EOF
+ rc=`test_compile x $2`
+ echo $rc
+}
+
+test_shared
+
+sizeof_int=`check_sizeof int 4`
+if [ ".$sizeof_int" = .0 ]; then
+ echo "[ERROR] Cannot determine the size of int." 1>&2
+ exit 1
+fi
+sizeof_wchar=`check_sizeof wchar_t 2`
+if [ ".$sizeof_wchar" = .0 ]; then
+ echo "[ERROR] Cannot determine the size of wchar_t." 1>&2
+ exit 1
+fi
+sizeof_long=`check_sizeof long 4`
+sizeof_long_long=`check_sizeof 'long long' 0`
+sizeof_long_double=`check_sizeof 'long double' 0`
+sizeof_voidp=`check_sizeof 'void *' 4`
+sizeof_size_t=`check_sizeof size_t 4`
+sizeof_off_t=`check_sizeof off_t 0`
+sizeof_off64_t=`check_sizeof off64_t 0`
+have_long_double=0
+have_off64_t=0
+test ".$sizeof_long_double" != .0 && have_long_double=1
+test ".$sizeof_off64_t" != .0 && have_off64_t=1
+
+PS=/
+have_uuid_uuid=`have_include uuid/uuid`
+if [ ".$have_uuid_uuid" = .1 ]; then
+ ok=`have_library uuid uuid_generate`
+ if [ ".$ok" = .1 ]; then
+ varadds ldflags -luuid
+ else
+ have_uuid_uuid=0
+ fi
+fi
+have_capability=`have_include sys/capability`
+if [ ".$have_capability" = .1 ]; then
+ ok=`have_library cap cap_get_proc`
+ if [ ".$ok" = .1 ]; then
+ varadds ldflags -lcap
+ else
+ have_capability=0
+ fi
+fi
+
+ok=`have_library resolv res_init`
+test ".$ok" = .1 && varadds ldflags -lresolv
+
+if [ ".$host" = ".linux" ]; then
+ have_selinux=`have_include selinux/selinux`
+ if [ ".$have_selinux" = .1 ]; then
+ ok=`have_library selinux is_selinux_enabled`
+ if [ ".$ok" = .1 ]; then
+ varadds ldflags -lselinux
+ else
+ have_selinux=0
+ fi
+ fi
+else
+ have_selinux=0
+fi
+
+if [ ".$host" = ".solaris" ]; then
+ have_port_h=`have_include port`
+ if [ ".$have_port_h" = .1 ]; then
+ have_port_h=`have_function x port_create`
+ fi
+ have_kstat=`have_library kstat`
+ test ".$have_kstat" = .1 && varadds ldflags -lkstat
+else
+ have_port_h=0
+ have_kstat=0
+fi
+
+if [ ".$has_openssl" = .yes ]; then
+ test ".$openssl_inc" != . && varadds includes "-I$openssl_inc"
+ test ".$openssl_lib" != . && varadds ssllibs "-L$openssl_lib"
+ varadds ssllibs -lssl -lcrypto
+ have_openssl=1
+ have_ocsp=`have_include openssl/ocsp`
+ varadds modules '??(SSLOBJECTS)'
+else
+ if [ ".$openssl_home" != . ]; then
+ varadds includes "-I??(OPENSSL_HOME)"
+ if [ .bits = .64 ]; then
+ if [ -d "$openssl_home/lib64" ]; then
+ varadds ssllibs "-L??(OPENSSL_HOME)/lib64"
+ elif [ -d "$openssl_home/lib" ]; then
+ varadds ssllibs "-L??(OPENSSL_HOME)/lib"
+ fi
+ else
+ if [ -d "$openssl_home/lib" ]; then
+ varadds ssllibs "-L??(OPENSSL_HOME)/lib"
+ fi
+ fi
+ varadds ssllibs -lssl -lcrypto
+ has_openssl=yes
+ have_openssl=1
+ have_ocsp=`have_include w $openssl_home/openssl/ocsp`
+ varadds modules '??(SSLOBJECTS)'
+ else
+ have_ocsp=0
+ have_openssl=0
+ fi
+fi
+
+if [ ".$EXTRA_LIBS" != "." ]; then
+ varadds ldflags $EXTRA_LIBS
+fi
+# Generate configuration header file
+#
+cat > $topdir/include/acr/config_$mach.h << EOF
+/*
+ * AUTOMATICALLY GENERATED BY BOOTSTRAP SCRIPT -- DO NOT EDIT
+ */
+#ifndef _ACR_CONFIG${mcpu}H_
+#define _ACR_CONFIG${mcpu}H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define HAVE_UNISTD_H `have_include unistd`
+#define HAVE_STRING_H `have_include string`
+#define HAVE_STRINGS_H `have_include strings`
+#define HAVE_INTTYPES_H `have_include inttypes`
+#define HAVE_STDINT_H `have_include stdint`
+#define HAVE_WTYPES_H `have_include wtypes`
+#define HAVE_STDBOOL_H `have_include stdbool`
+#define HAVE_DLFCN_H `have_include dlfcn`
+#define HAVE_LINK_H `have_include link`
+#define HAVE_FCNTL_H `have_include fcntl`
+#define HAVE_SYS_FILE_H `have_include sys/file`
+#define HAVE_SYS_TYPES_H `have_include sys/types`
+#define HAVE_SYS_CDEFS_H `have_include sys/cdefs`
+#define HAVE_SYS_QUEUE_H `have_include sys/queue`
+#define HAVE_SYS_RESOURCE_H `have_include sys/resource`
+#define HAVE_SYS_SELECT_H `have_include sys/select`
+#define HAVE_SYS_SOCKET_H `have_include sys/socket`
+#define HAVE_SYS_STAT_H `have_include sys/stat`
+#define HAVE_SYS_WAIT_H `have_include sys/wait`
+#define HAVE_SYS_SYSLIMITS_H `have_include sys/syslimits`
+#define HAVE_SYS_SYSCALL_H `have_include sys/syscall`
+#define HAVE_SYS_UIO_H `have_include sys/uio`
+#define HAVE_SYS_MMAN_H `have_include sys/mman`
+#define HAVE_SYS_EPOLL_H `have_include sys/epoll`
+#define HAVE_SYS_EVENT_H `have_include sys/event`
+#define HAVE_SYS_EVENTFD_H `have_include sys/eventfd`
+#define HAVE_SYS_SIGNALFD_H `have_include sys/signalfd`
+#define HAVE_SYS_INOTIFY_H `have_include sys/inotify`
+#define HAVE_SYS_TIME_H `have_include sys/time`
+#define HAVE_LIMITS_H `have_include limits`
+#define HAVE_NETDB_H `have_include netdb`
+#define HAVE_NETINET_IN_H `have_include netinet/in`
+#define HAVE_ARPA_INET_H `have_include arpa/inet`
+#define HAVE_RESOLV_H `have_include resolv`
+#define HAVE_SYS_UN_H `have_include sys/un`
+#define HAVE_SEMAPHORE_H `have_include semaphore`
+#define HAVE_UCONTEXT_H `have_include ucontext`
+#define HAVE_LIBGEN_H `have_include libgen`
+#define HAVE_EXECINFO_H `have_include execinfo`
+#define HAVE_AIO_H `have_include aio`
+#define HAVE_LIBAIO_H `have_include libaio`
+#define HAVE_FNMATCH_H `have_include fnmatch`
+#define HAVE_LANGINFO_H `have_include langinfo`
+#define HAVE_LOCALE_H `have_include locale`
+#define HAVE_SCHED_H `have_include sched`
+#define HAVE_STRLCAT `have_function x strlcat`
+#define HAVE_STRLCPY `have_function x strlcpy`
+#define HAVE_STRSIGNAL `have_function x strsignal`
+#define HAVE_STRMODE `have_function x strmode`
+#define HAVE_WCSDUP `have_function x wcsdup`
+#define HAVE_BASENAME_R `have_function x basename_r`
+#define HAVE_DIRNAME_R `have_function x dirname_r`
+#define HAVE_WCSCASECMP `have_function x wcscasecmp`
+#define HAVE_HSTRERROR `have_function x hstrerror`
+#define HAVE_STRERROR_R `have_function x strerror_r`
+#define HAVE_GETGRENT_R `have_function x getgrent_r`
+#define HAVE_GETGRGID_R `have_function x getgrgid_r`
+#define HAVE_GETGRNAM_R `have_function x getgrnam_r`
+#define HAVE_GETPWENT_R `have_function x getpwent_r`
+#define HAVE_GETPWNAM_R `have_function x getpwnam_r`
+#define HAVE_GETPWUID_R `have_function x getpwuid_r`
+#define HAVE_READDIR_R `have_function x readdir_r`
+#define HAVE_READDIR64_R `have_function x readdir64_r`
+#define HAVE_MMAP64 `have_function x mmap64`
+#define HAVE_POSIX_MEMALIGN `have_function x posix_memalign`
+#define HAVE_POSIX_SEMAPHORE `have_function x sem_open`
+#define HAVE_FDATASYNC `have_function x fdatasync`
+#define HAVE_FLOCK `have_function x flock`
+#define HAVE_CLOCK_GETTIME `have_function x clock_gettime`
+#define HAVE_KQUEUE `have_function x kqueue`
+#define HAVE_INOTIFY_INIT `have_function x inotify_init`
+#define HAVE_USLEEP `have_function x usleep`
+#define HAVE_NANOSLEEP `have_function x nanosleep`
+#define HAVE_LOCALTIME_R `have_function x localtime_r`
+#define HAVE_GMTIME_R `have_function x gmtime_r`
+#define HAVE_SIGSETJMP `have_function x sigsetjmp`
+#define HAVE_SIGACTION `have_function x sigaction`
+#define HAVE_SIGWAIT `have_function x sigwait`
+#define HAVE_SIGSUSPEND `have_function x sigsuspend`
+#define HAVE_FDWALK `have_function x fdwalk`
+#define HAVE_SETRLIMIT `have_function x setrlimit`
+#define HAVE_BACKTRACE `have_function x backtrace`
+#define HAVE_PTHREAD_RWLOCK `have_function x pthread_rwlock_init`
+#define HAVE_PTHREAD_SPINLOCK `have_function x pthread_spin_init`
+#define HAVE_PTHREAD_TRYJOIN `have_function x pthread_tryjoin_np`
+#define HAVE_PTHREAD_TIMEDJOIN `have_function x pthread_timedjoin_np`
+#define HAVE_ISNAN `have_function x isnan`
+#define HAVE_ISINF `have_function x isinf`
+#define HAVE_GETPAGESIZE `have_function x getpagesize`
+#define HAVE_SETENV `have_function x setenv`
+#define HAVE_UNSETENV `have_function x unsetenv`
+#define HAVE_DUP3 `have_function c dup3`
+#define HAVE_EPOLL_CREATE1 `have_function c epoll_create1`
+#define HAVE_ACCEPT4 `have_function c accept4`
+#define HAVE_EVENTFD `have_function c eventfd`
+#define HAVE_EVENTFD2 `have_function c eventfd2`
+#define HAVE_SIGNALFD `have_function c signalfd`
+#define HAVE_PIPE2 `have_function c pipe2`
+#define HAVE_FCHDIR `have_function x fchdir`
+#define HAVE_WRITEV `have_function x writev`
+#define HAVE_ARC4RANDOM `have_function x arc4random`
+#define HAVE_MKDTEMP `have_function x mkdtemp`
+#define HAVE_PREAD `have_function x pread`
+#define HAVE_PWRITE `have_function x pwrite`
+#define HAVE_STRTOLL `have_function x strtoll`
+#define HAVE_STRTOULL `have_function x strtoull`
+#define HAVE_STRTONUM `have_function x strtonum`
+#define HAVE_SOCK_CLOEXEC `have_defined SOCK_CLOEXEC`
+#define HAVE_FILE_CLOEXEC `have_defined O_CLOEXEC`
+#define HAVE_TM_TM_GMTOFF `have_strcut_member time 'struct tm' tm_gmtoff`
+#define HAVE_DIRENT_D_INO `have_strcut_member dirent 'struct dirent' d_ino`
+#define HAVE_DIRENT_D_FILENO `have_strcut_member dirent 'struct dirent' d_fileno`
+#define HAVE_DIRENT_D_TYPE `have_strcut_member dirent 'struct dirent' d_type`
+#define HAVE_STAT_ST_ATIM `have_strcut_member sys/stat 'struct stat' st_atim`
+#define HAVE_STAT_ST_ATIMENSEC `have_strcut_member sys/stat 'struct stat' st_atimensec`
+#define HAVE_STAT_ST_ATIME_N `have_strcut_member sys/stat 'struct stat' st_atim_n`
+#define HAVE_STAT_ST_BLOCKS `have_strcut_member sys/stat 'struct stat' st_blocks`
+#define HAVE_OFF64_T $have_off64_t
+#define HAVE_LONG_DOUBLE $have_long_double
+#define HAVE_INTPTR_T `have_typedef intptr_t`
+#define HAVE_UINTPTR_T `have_typedef uintptr_t`
+#define HAVE_UNION_SEMUN `have_typedef 'union semun' sys/sem`
+#define HAVE_PRETTY_FUNCTION `have_defined __PRETTY_FUNCTION__`
+#define HAVE_FUNCTION `have_defined __FUNCTION__`
+#define HAVE_FUNCSIG `have_defined __FUNCSIG__`
+#define HAVE_FUNC `have_defined __func__`
+#define HAVE_THREAD_LOCAL `have_thread_local`
+#define HAVE_IPV6 `have_ipv6`
+
+#define HAVE_UUID_UUID $have_uuid_uuid
+#define HAVE_SYS_CAPABILITY $have_capability
+#define HAVE_OPENSSL $have_openssl
+#define HAVE_OCSP $have_ocsp
+#define HAVE_SELINUX $have_selinux
+#define HAVE_KSTAT $have_kstat
+#define HAVE_PORT_H $have_port_h
+
+#define PACKAGE_NAME "$name"
+#define PACKAGE_PRINT "$pname"
+#define PACKAGE_DESC "$desc"
+#define PACKAGE_PREFIX "$prefix"
+#define PACKAGE_BINDIR "$bindir"
+#define PACKAGE_LIBDIR "$libdir"
+#define PACKAGE_INCDIR "$incdir"
+#define PACKAGE_SHAREDIR "$shrdir"
+#define PACKAGE_CONFIGURED "`date -u`"
+
+#define CC_BITS $bits
+#define CC_SIZEOF_INT $sizeof_int
+#define CC_SIZEOF_WCHAR_T $sizeof_wchar
+#define CC_SIZEOF_LONG $sizeof_long
+#define CC_SIZEOF_LONG_LONG $sizeof_long_long
+#define CC_SIZEOF_LONG_DOUBLE $sizeof_long_double
+#define CC_SIZEOF_VOIDP $sizeof_voidp
+#define CC_SIZEOF_SIZE_T $sizeof_size_t
+#define CC_SIZEOF_OFF_T $sizeof_off_t
+#define CC_SIZEOF_OFF64_T $sizeof_off64_t
+#define CC_IS_BIG_ENDIAN $bige
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _ACR_CONFIG${mcpu}H_ */
+EOF
+
+test "`which $ranlib 2>/dev/null`" || ranlib=echo
+ldrpath=`echo $ldrpath | sed 's/??/\\$/g'`
+lddname=`echo $lddname | sed 's/??/\\$/g'`
+modules=`echo $modules | sed 's/??/\\$/g'`
+includes=`echo $includes | sed 's/??/\\$/g'`
+ssllibs=`echo $ssllibs | sed 's/??/\\$/g'`
+
+write_var()
+{
+
+ eval "s=\$$2"
+ fmts=`echo $s | fmt -w72`
+ sIFS=$IFS
+ IFS="
+"
+ fflag=true
+ for o in $fmts
+ do
+ if $fflag; then
+ printf "$1=$o " >>$3
+ fflag=false
+ else
+ printf "\\" >>$3
+ printf "\n\t$o " >>$3
+ fi
+ done
+ IFS=$sIFS
+ printf "\n" >>$3
+}
+
+# Generate Makefile configuration file
+#
+cat > $topdir/Makedefs << EOF
+#
+# AUTOMATICALLY GENERATED BY CONFIGURE SCRIPT -- DO NOT EDIT
+#
+NAME=$name
+DLLNAME=$name
+LIBNAME=${name}_s
+DESC=$desc
+DESCBOLD=$descb
+HOST=$hincs
+HOSTSRC=$hincs
+PLATFORM=$platform
+ARCH=$mach
+BITS=$bits
+EECHO=$EECHO
+CC=$cc
+CPP=$cpp
+LD=$ld
+SO=$so
+LIB=$lib
+OBJ=$obj
+SLO=l$obj
+AS=$as
+AR=$ar
+ARFLAGS=$arflags
+ASFLAGS=$asflags
+ASMOPTS=$asmopts
+RANLIB=$ranlib
+MAKEDEPS=$makedeps
+STRIP=$strip
+
+PREFIX=$prefix
+BINDIR=$bindir
+INCDIR=$incdir
+SHRDIR=$shrdir
+LIBDIR=$libdir
+TOPDIR=$topdir
+MODULES=$modules
+
+CCFLAGS=$ccflags
+CCSHARE=$ccshare
+EOF
+
+write_var CPPOPTS cppopts Makedefs
+write_var INCLUDES includes Makedefs
+
+cat >> $topdir/Makedefs << EOF
+LDDNAME=$lddname
+LDRPATH=$ldrpath
+LDARCH=$lddarch
+LDFLAGS=$ldflags
+SHFLAGS=$shflags
+SSLFLAGS=$ssllibs
+VERSION_MAJOR=$vmajor
+VERSION_MINOR=$vminor
+VERSION_PATCH=$vpatch
+VERSION=$vdotted
+
+EOF
+
+sed -e 's|@host@|'"$host"'|g' \
+ -e 's|@uhost@|'"$uhost"'|g' \
+ -e 's|@hincs@|'"$hincs"'|g' \
+ -e 's|@arch@|'"$mach"'|g' \
+ -e 's|@bits@|'"$bits"'|g' \
+ -e 's|@topdir@|'"$topdir"'|g' \
+ -e 's|@platform@|'"$platform"'|g' \
+ -e 's|@testobjects@|'"$testobjects"'|g' \
+ -e 's|@modules@|'"$modules"'|g' \
+ -e 's|@sharedlib@|'"$sharedlib"'|g' \
+ -e 's|@linkedlib@|'"$linkedlib"'|g' \
+ -e 's|@zlib_asm_sources@|'"$zlib_asm_sources"'|g' \
+ $topdir/Makefile.unx.in > $topdir/Makefile
+
+echo ""
+echo "Configured for $host$bits-$cctype"
+$EECHO "You can now run ${bldon}${mmake}${bldof} to build the library."
+echo ""
+
Propchange: commons/sandbox/runtime/trunk/src/main/native/configure
------------------------------------------------------------------------------
svn:executable = *
Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h?rev=1084343&r1=1084342&r2=1084343&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h Tue Mar 22 20:38:09 2011
@@ -17,7 +17,7 @@
#ifndef _ACR_ERROR_H_
#define _ACR_ERROR_H_
-#include <opencpr/stdtypes.h>
+#include "acr/stdtypes.h"
/**
* @file error.h
Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/port.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/port.h?rev=1084343&r1=1084342&r2=1084343&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/port.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/port.h Tue Mar 22 20:38:09 2011
@@ -35,6 +35,16 @@ char *_bsd_strsignal(int);
# define strsignal _bsd_strsignal
#endif
+const char *_bsd_basename_c(const char *);
+char *_bsd_basename_r(const char *, char *, size_t);
+#if !HAVE_BASENAME_R
+# define basename_r _bsd_basename_r
+#endif
+char *_bsd_dirname_r(const char *, char *, size_t);
+#if !HAVE_DIRNAME_R
+# define dirname_r _bsd_dirname_r
+#endif
+
#ifdef __cplusplus
}
#endif
Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/stddefs.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/stddefs.h?rev=1084343&r1=1084342&r2=1084343&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/stddefs.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/stddefs.h Tue Mar 22 20:38:09 2011
@@ -23,6 +23,7 @@
*/
#include "acr/stdinc.h"
+#include "arch_defs.h"
#if HAVE_THREAD_LOCAL
# if defined (_MSC_VER)
@@ -241,4 +242,6 @@
#define ALIGNED__ ALIGNED_PFX(8)
#define __ALIGNED ALIGNED_SFX(8)
+#define ACR_ERR_BUFFSIZE 1024
+
#endif /* _ACR_STDDEFS_H_ */
Added: commons/sandbox/runtime/trunk/src/main/native/os/unix/arch_defs.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/arch_defs.h?rev=1084343&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/arch_defs.h (added)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/arch_defs.h Tue Mar 22 20:38:09 2011
@@ -0,0 +1,98 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ACR_ARCH_DEFS_H_
+#define _ACR_ARCH_DEFS_H_
+
+#define ACR_I64_T_FMT "lld"
+#define ACR_U64_T_FMT "llu"
+#define ACR_Z64_T_HEX_FMT "llx"
+#if defined(__GNUC__)
+# define ACR_SIZE_T_FMT "zu"
+# define ACR_SSIZE_T_FMT "zd"
+#else
+# if CC_SIZEOF_SIZE_T == 8
+# define ACR_SIZE_T_FMT "lu"
+# define ACR_SSIZE_T_FMT "ld"
+# else
+# define ACR_SIZE_T_FMT "u"
+# define ACR_SSIZE_T_FMT "d"
+# endif
+#endif
+#if !defined(O_NONBLOCK)
+# if defined(O_NDELAY)
+# define O_NONBLOCK O_NDELAY
+# elif defined(O_FNDELAY)
+# define O_NONBLOCK O_FNDELAY
+# endif
+#endif
+
+/*
+ * Common unix utils
+ */
+#define ACR_RDWAITIO POLLIN
+#define ACR_WRWAITIO POLLOUT
+
+/* Common large file replacement macros
+ */
+#if defined(_BSDX)
+typedef struct stat struct_stat_t;
+#else
+# if defined(_LARGEFILE64_SOURCE)
+# define stat(f,b) stat64(f,b)
+# define lstat(f,b) lstat64(f,b)
+# define fstat(f,b) fstat64(f,b)
+# define lseek(f,o,w) lseek64(f,o,w)
+# define ftruncate(f,l) ftruncate64(f,l)
+typedef struct stat64 struct_stat_t;
+# else
+typedef struct stat struct_stat_t;
+# endif
+#endif
+
+#define ACR_PATH_MAX 8192
+#define ACR_CRLF "\n"
+/* Any value will do */
+#define ACR_FTOK_ID 's'
+#define ACR_MTX_MAGIC 0x23036401
+#define ACR_SHM_MAGIC 0x23036402
+
+#if defined(_SOLARIS)
+# define SHELL_PATH "/usr/xpg4/bin/sh"
+# define DEF_UPATH "/usr/xpg4/bin:/usr/bin:/opt/SUNWspro/bin:/usr/ccs/bin:/usr/sfw/bin:/opt/sfw/bin"
+# define DEF_SPATH "/usr/sbin:/usr/xpg4/bin:/usr/bin:/opt/SUNWspro/bin:/usr/ccs/bin:/usr/sfw/bin:/opt/sfw/bin"
+#endif
+
+#ifndef DEV_RANDOM
+# define DEV_RANDOM "/dev/urandom"
+#endif
+#ifndef DEFAULT_UPATH
+# define DEFAULT_UPATH "/bin:/usr/bin"
+#endif
+#ifndef DEFAULT_SPATH
+# define DEFAULT_SPATH "/sbin:/bin:/usr/sbin:/usr/bin"
+#endif
+#ifndef DEFAULT_PATH
+# define DEFAULT_PATH "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin"
+#endif
+#ifndef SHELL_PATH
+# define SHELL_PATH "/bin/sh"
+#endif
+
+#define UNUSED_SOURCE_FILE(F) \
+const char __provided_##F [] = "Using system provided " #F "()"
+
+#endif /* _ACR_ARCH_DEFS_H_ */
Propchange: commons/sandbox/runtime/trunk/src/main/native/os/unix/arch_defs.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/runtime/trunk/src/main/native/os/win32/arch_defs.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/arch_defs.h?rev=1084343&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/arch_defs.h (added)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/arch_defs.h Tue Mar 22 20:38:09 2011
@@ -0,0 +1,148 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ACR_ARCH_DEFS_H_
+#define _ACR_ARCH_DEFS_H_
+
+#include "acr/config.h"
+
+#define ACR_I64_T_FMT "I64d"
+#define ACR_U64_T_FMT "I64u"
+#define ACR_X64_T_FMT "I64x"
+#if CC_SIZEOF_SIZE_T == 8
+# define ACR_SIZE_T_FMT "I64u"
+# define ACR_SSIZE_T_FMT "I64d"
+#else
+# define ACR_SIZE_T_FMT "u"
+# define ACR_SSIZE_T_FMT "d"
+#endif
+
+#define ACR_CRLF "\r\n"
+#define ACR__THREAD(pg) _cr__thread(pg)
+#define RESOURCE_NAME_LEN 64
+#define RESOURCE_SSID_LEN 256
+#define RESOURCE_USER_LEN 256
+#define REGISTRY_USER_LEN 512
+#define ACR_PATH_MAX 8192
+#define ACR_LMNAME 512
+#define ACR_DELTA_EPOCH_IN_USEC 11644473600000000I64
+
+typedef struct OVERLAPPED_SBUFF {
+ OVERLAPPED o;
+ DWORD stat;
+ DWORD size;
+ char buff[512];
+} OVERLAPPED_SBUFF;
+
+typedef struct OVERLAPPED_HBUFF {
+ OVERLAPPED o;
+ DWORD stat;
+ DWORD size;
+ char buff[8192];
+} OVERLAPPED_HBUFF;
+
+typedef struct OVERLAPPED_VBUFF {
+ OVERLAPPED o;
+ DWORD stat;
+ DWORD size;
+ char buff[1];
+} OVERLAPPED_VBUFF;
+
+#define SAFE_CLOSE_HANDLE(H) \
+ if ((H) != 0 && (H) != INVALID_HANDLE_VALUE) { \
+ CloseHandle((H)); \
+ (H) = 0; \
+ } else (void)0
+
+#define SAFE_CLOSE_KEY(K) \
+ if ((K) != 0 && (K) != INVALID_HANDLE_VALUE) { \
+ RegCloseKey((K)); \
+ (K) = 0; \
+ } else (void)0
+
+
+#define WAIT_OBJECT_SIGNAL WAIT_OBJECT_0
+#define WAIT_OBJECT_SIGPIPE (WAIT_OBJECT_0 + 1)
+#define WAIT_OBJECT_1 (WAIT_OBJECT_0 + 1)
+#define WAIT_OBJECT_2 (WAIT_OBJECT_0 + 2)
+#define WAIT_OBJECT_3 (WAIT_OBJECT_0 + 3)
+#define WAIT_OBJECT_4 (WAIT_OBJECT_0 + 4)
+
+/*
+ * ---------------------------------------------------------------------
+ * begin of DDK declarations
+ * Copied from <ntifs.h>
+ * ---------------------------------------------------------------------
+ */
+
+#if _MSC_VER >= 1200
+#pragma warning(push)
+#endif
+#pragma warning(disable:4201) // unnamed struct
+
+#define SYMLINK_FLAG_RELATIVE 1
+
+typedef struct _REPARSE_DATA_BUFFER {
+ ULONG ReparseTag;
+ USHORT ReparseDataLength;
+ USHORT Reserved;
+ union {
+ struct {
+ USHORT SubstituteNameOffset;
+ USHORT SubstituteNameLength;
+ USHORT PrintNameOffset;
+ USHORT PrintNameLength;
+ ULONG Flags;
+ WCHAR PathBuffer[1];
+ } SymbolicLinkReparseBuffer;
+ struct {
+ USHORT SubstituteNameOffset;
+ USHORT SubstituteNameLength;
+ USHORT PrintNameOffset;
+ USHORT PrintNameLength;
+ WCHAR PathBuffer[1];
+ } MountPointReparseBuffer;
+ struct {
+ UCHAR DataBuffer[1];
+ } GenericReparseBuffer;
+ } /* DUMMYUNIONNAME */;
+} REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER;
+
+#if _MSC_VER >= 1200
+#pragma warning(pop)
+#else
+#pragma warning( default : 4201 )
+#endif
+
+#ifndef IO_REPARSE_TAG_MOUNT_POINT
+#define IO_REPARSE_TAG_MOUNT_POINT (0xA0000003L)
+#endif
+#ifndef IO_REPARSE_TAG_SYMLINK
+#define IO_REPARSE_TAG_SYMLINK (0xA000000CL)
+#endif
+
+/*
+ * ---------------------------------------------------------------------
+ * end of DDK declarations
+ * ---------------------------------------------------------------------
+ */
+
+static __inline int isblank(int c)
+{
+ return c == ' ' || c == '\t';
+}
+
+#endif /* _ACR_ARCH_DEFS_H_ */
Propchange: commons/sandbox/runtime/trunk/src/main/native/os/win32/arch_defs.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/runtime/trunk/src/main/native/port/bsdpath.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/port/bsdpath.c?rev=1084343&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/port/bsdpath.c (added)
+++ commons/sandbox/runtime/trunk/src/main/native/port/bsdpath.c Tue Mar 22 20:38:09 2011
@@ -0,0 +1,118 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "acr/port.h"
+#include "acr/error.h"
+
+#if defined(_WINDOWS)
+#define IS_PSA(c) ((c) == '/' || (c) == '\\')
+#define NO_PSA(c) ((c) != '/' && (c) != '\\')
+#else
+#define IS_PSA(c) ((c) == '/')
+#define NO_PSA(c) ((c) != '/')
+#endif
+
+const char *_bsd_basename_c(const char *path)
+{
+ const char *endp, *startp;
+
+ /* Empty or 0 string gets treated as "." */
+ if (path == 0 || *path == '\0')
+ return ".";
+ /* Strip any trailing slashes */
+ endp = path + strlen(path) - 1;
+ while (endp > path && IS_PSA(*endp))
+ endp--;
+
+ /* All slashes becomes "/" */
+ if (endp == path && IS_PSA(*endp))
+ return "/";
+ /* Find the start of the base */
+ startp = endp;
+ while (startp > path && NO_PSA(*(startp - 1)))
+ startp--;
+
+ return startp;
+}
+
+char *_bsd_basename_r(const char *path, char *bname, size_t blen)
+{
+ size_t len;
+ const char *basep;
+ static char sbuf[ACR_PATH_MAX];
+
+ if (!bname) {
+ bname = sbuf;
+ blen = sizeof(sbuf);
+ }
+ basep = _bsd_basename_c(path);
+ len = strlen(basep) + 1;
+ if (len > blen) {
+ ACR_SET_OS_ERROR(ACR_ENAMETOOLONG);
+ return 0;
+ }
+ memmove(bname, basep, len);
+ return bname;
+}
+
+char *_bsd_dirname_r(const char *path, char *dname, size_t dlen)
+{
+ size_t len;
+ static char sbuf[ACR_PATH_MAX];
+ const char *endp;
+
+ if (!dname) {
+ dname = sbuf;
+ dlen = sizeof(sbuf);
+ }
+ /* Empty or 0 string gets treated as "." */
+ if (path == 0 || *path == '\0') {
+ dname[0] = '.';
+ dname[1] = '\0';
+ return dname;
+ }
+
+ /* Strip any trailing slashes */
+ endp = path + strlen(path) - 1;
+ while (endp > path && IS_PSA(*endp))
+ endp--;
+
+ /* Find the start of the dir */
+ while (endp > path && NO_PSA(*endp))
+ endp--;
+
+ /* Either the dir is "/" or there are no slashes */
+ if (endp == path) {
+ dname[0] = IS_PSA(*endp) ? '/' : '.';
+ dname[1] = '\0';
+ return dname;
+ } else {
+ /* Move forward past the separating slashes */
+ do {
+ endp--;
+ } while (endp > path && IS_PSA(*endp));
+ }
+
+ len = endp - path + 1;
+ if (len >= dlen) {
+ ACR_SET_OS_ERROR(ACR_ENAMETOOLONG);
+ return 0;
+ }
+ memmove(dname, path, len);
+ dname[len] = '\0';
+
+ return dname;
+}
Propchange: commons/sandbox/runtime/trunk/src/main/native/port/bsdpath.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: commons/sandbox/runtime/trunk/src/main/native/shared/buildmark.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/buildmark.c?rev=1084343&r1=1084342&r2=1084343&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/buildmark.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/buildmark.c Tue Mar 22 20:38:09 2011
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#include "cpr/version.h"
-#include "cpr/stdtypes.h"
+#include "acr/stdtypes.h"
#if defined(__DATE__) && defined(__TIME__)
static const char __built[] = __DATE__ " " __TIME__;