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 2009/11/11 18:49:38 UTC
svn commit: r834980 -
/commons/sandbox/runtime/trunk/src/main/native/configure
Author: mturk
Date: Wed Nov 11 17:49:38 2009
New Revision: 834980
URL: http://svn.apache.org/viewvc?rev=834980&view=rev
Log:
Check for common inttypes
Modified:
commons/sandbox/runtime/trunk/src/main/native/configure
Modified: commons/sandbox/runtime/trunk/src/main/native/configure
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/configure?rev=834980&r1=834979&r2=834980&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/configure (original)
+++ commons/sandbox/runtime/trunk/src/main/native/configure Wed Nov 11 17:49:38 2009
@@ -824,24 +824,62 @@
echo $rc
}
-have_flag_defined()
+have_defined()
{
printf "Checking for %-32s" "$1" 1>&2
- cat > $test.c << EOF
+ if [ .$host = .windows ]; then
+ echo "not supported" 1>&2
+ rc=0
+ else
+ cat > $test.c << EOF
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <fcntl.h>
EOF
- if [ ".$2" != . ]; then
- cat >> $test.c << EOF
+ if [ ".$2" != . ]; then
+ cat >> $test.c << EOF
#include <$2.h>
EOF
- fi
- cat >> $test.c << EOF
+ fi
+ cat >> $test.c << EOF
int main() {return (int)($1);}
EOF
+ rc=0
+ if [ ".$host" = .windows ]; then
+ co="`$cc $ccflags $cppopts $test.c /link /out:$test$exe 2>&1`"
+ else
+ co="`$cc $ccflags $cppopts $test.c -o $test$exe 2>&1`"
+ fi
+ if [ ".$co" = . ]; then
+ rc=1
+ else
+ test -x $test$exe && rc=1
+ fi
+ rm -rf $test.* $test *.pdb >/dev/null 2>&1 || true
+ if [ $rc = 1 ]; then
+ echo ok 1>&2
+ else
+ echo "not found" 1>&2
+ fi
+ fi
+ echo $rc
+}
+
+have_typedef()
+{
+ printf "Checking for typedef %-24s" "$1" 1>&2
+ cat > $test.c << EOF
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include <wctype.h>
+
+typedef $1 _check_t;
+int main() {printf("%d", (int)sizeof(_check_t));return 0;}
+EOF
rc=0
if [ ".$host" = .windows ]; then
co="`$cc $ccflags $cppopts $test.c /link /out:$test$exe 2>&1`"
@@ -912,10 +950,6 @@
have_windows=1
have_uuid_uuid=0
have_off64t=0
- have_strerror_r=0
- have_mmap64=0
- have_fdatasync=0
- have_posix_memalign=0
else
have_ktmw32=0
have_off64t=1
@@ -939,14 +973,6 @@
fi
ok=`have_library resolv`
test ".$ok" = .1 && varadds ldflags -lresolv
- if [ ".$host" = .hpux ]; then
- have_strerror_r=0
- else
- have_strerror_r=`have_function 0 strerror_r`
- fi
- have_mmap64=`have_function 0 mmap64`
- have_fdatasync=`have_function 0 fdatasync`
- have_posix_memalign=`have_function 0 posix_memalign`
fi
if [ ".$host" = ".linux" ]; then
@@ -987,7 +1013,6 @@
have_ocsp=`have_include 1 openssl/ocsp`
varadds modules '??(SSLMODLIB)'
else
- echo "Checking for OPENSSL_HOME : $openssl_home"
if [ ".$openssl_home" != . ]; then
varadds includes "-I??(OPENSSL_HOME)"
if [ ".$host" = .windows ]; then
@@ -1095,24 +1120,37 @@
#define HAVE_RESOLV_H `have_include 0 resolv`
#define HAVE_SYS_UN_H `have_include 0 sys/un`
#define HAVE_UCONTEXT_H `have_include 0 ucontext`
-#define HAVE_STRERROR_R $have_strerror_r
-#define HAVE_MMAP64 $have_mmap64
-#define HAVE_POSIX_MEMALIGN $have_posix_memalign
-#define HAVE_FDATASYNC $have_fdatasync
+#define HAVE_STRERROR_R `have_function 0 strerror_r`
+#define HAVE_MMAP64 `have_function 0 mmap64`
+#define HAVE_POSIX_MEMALIGN `have_function 0 posix_memalign`
+#define HAVE_FDATASYNC `have_function 0 fdatasync`
#define HAVE_ACCEPT4 `have_function 0 accept4`
#define HAVE_CLOCK_GETTIME `have_function 0 clock_gettime`
#define HAVE_DUP3 `have_function 0 dup3`
#define HAVE_EPOLL_CREATE1 `have_function 0 epoll_create1`
#define HAVE_KQUEUE `have_function 0 kqueue`
#define HAVE_INOTIFY_INIT `have_function 0 inotify_init`
+#define HAVE_USLEEP `have_function 0 usleep`
#define HAVE_NANOSLEEP `have_function 0 nanosleep`
+#define HAVE_LOCALTIME_R `have_function 0 localtime_r`
+#define HAVE_GMTIME_R `have_function 0 gmtime_r`
#define HAVE_SIGSETJMP `have_function 0 sigsetjmp`
#define HAVE_SIGACTION `have_function 0 sigaction`
-#define HAVE_SOCK_CLOEXEC `have_flag_defined SOCK_CLOEXEC`
-#define HAVE_FILE_CLOEXEC `have_flag_defined O_CLOEXEC`
+#define HAVE_SOCK_CLOEXEC `have_defined SOCK_CLOEXEC`
+#define HAVE_FILE_CLOEXEC `have_defined O_CLOEXEC`
#define HAVE_OFF64_T $have_off64t
#define HAVE_LONG_LONG $have_long_long
#define HAVE_LONG_DOUBLE $have_long_double
+#define HAVE_INT8_T `have_typedef int8_t`
+#define HAVE_INT16_T `have_typedef int16_t`
+#define HAVE_INT32_T `have_typedef int32_t`
+#define HAVE_INT64_T `have_typedef int64_t`
+#define HAVE_UINT8_T `have_typedef uint8_t`
+#define HAVE_UINT16_T `have_typedef uint16_t`
+#define HAVE_UINT32_T `have_typedef uint32_t`
+#define HAVE_UINT64_T `have_typedef uint64_t`
+#define HAVE_INTPTR_T `have_typedef intptr_t`
+#define HAVE_UINTPTR_T `have_typedef uintptr_t`
#define CC_SIZEOF_INT $sizeof_int
#define CC_SIZEOF_WCHAR_T $sizeof_wchar