Author: mturk
Date: Fri Jun 12 07:17:40 2009
New Revision: 784010
URL: http://svn.apache.org/viewvc?rev=784010&view=rev
Log:
Test for advanced OS features during configure
Modified:
commons/sandbox/runtime/trunk/src/main/native/configure
commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h
commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h
Modified: commons/sandbox/runtime/trunk/src/main/native/configure
URL:
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/configure?rev=784010&r1=784009&r2=784010&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/configure (original)
+++ commons/sandbox/runtime/trunk/src/main/native/configure Fri Jun 12 07:17:40
2009
@@ -321,8 +321,8 @@
varadds cppopts "-DWIN32 -D_WIN32 -D_WINDOWS -D_WINNT -DNDEBUG"
varadds cppopts "-D_WIN32_WINNT=0x0501 -D_WIN32_IE=0x0600"
varadds cxxopts "-TP"
- varadds ldflags "kernel32.lib advapi32.lib ws2_32.lib mswsock.lib"
- varadds ldflags "ole32.lib shell32.lib rpcrt4.lib user32.lib gdi32.lib"
+ varadds ldflags "kernel32.lib advapi32.lib ws2_32.lib mswsock.lib
ole32.lib"
+ varadds ldflags "shell32.lib rpcrt4.lib user32.lib gdi32.lib
userenv.lib"
varadds ldflags "psapi.lib shlwapi.lib wldap32.lib netapi32.lib
iphlpapi.lib"
varadds shflags "/NOLOGO /OPT:REF"
is_unix=false
@@ -509,6 +509,60 @@
echo $rc
}
+have_sock_cloexec()
+{
+ printf "Checking for %-32s" "SOCK_CLOEXEC flag" 1>&2
+ cat > $test.c << EOF
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+int main() {return socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, 0) == -1;}
+EOF
+ rc=0
+ co="`$cc $ccflags $cppopts $test.c -o $test$exe 2>&1`"
+ if [ ".$co" = "." ]; then
+ rc=1
+ else
+ if [ -x $test$exe ]; then
+ rc=1
+ fi
+ 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
+ echo $rc
+}
+
+have_epoll_create1()
+{
+ printf "Checking for %-32s" "epoll_create1" 1>&2
+ cat > $test.c << EOF
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/epoll.h>
+int main() {return epoll_create1(EPOLL_CLOEXEC) == -1;}
+EOF
+ rc=0
+ co="`$cc $ccflags $cppopts $test.c -o $test$exe 2>&1`"
+ if [ ".$co" = "." ]; then
+ rc=1
+ else
+ if [ -x $test$exe ]; then
+ rc=1
+ fi
+ 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
+ echo $rc
+}
+
test_csizeof()
{
printf "Checking for sizeof %-25s" "$1" 1>&2
@@ -545,12 +599,14 @@
if [ ".$host" = ".windows" ]; then
have_fileextd=`have_include fileextd '#include <windows.h>'`
+ have_ktmw32=`have_include ktmw32 '#include <windows.h>'`
have_aio=0
have_libaio=0
have_windows=1
have_uuid_uuid=0
else
have_fileextd=0
+ have_ktmw32=0
have_aio=`have_include aio`
have_libaio=`have_include libaio`
have_windows=0
@@ -582,6 +638,7 @@
#define HAVE_WINDOWS_H $have_windows
#define HAVE_FILEEXTD_H $have_fileextd
+#define HAVE_KTMW32_H $have_ktmw32
#define HAVE_AIO_H $have_aio
#define HAVE_LIBAIO_H $have_libaio
#define HAVE_UUID_UUID_H $have_uuid_uuid
@@ -612,6 +669,8 @@
#define HAVE_ARPA_INET_H `have_include arpa/inet`
#define HAVE_SYS_UN_H `have_include sys/un`
#define HAVE_STRERROR_R `have_strerror_r`
+#define HAVE_SOCK_CLOEXEC `have_sock_cloexec`
+#define HAVE_EPOLL_CREATE1 `have_epoll_create1`
#define CC_SIZEOF_INT $sizeof_int
#define CC_SIZEOF_WCHAR_T $sizeof_wchar
Modified:
commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h
URL:
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h?rev=784010&r1=784009&r2=784010&view=diff
==============================================================================
---
commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h
(original)
+++
commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h
Fri Jun 12 07:17:40 2009
@@ -312,8 +312,9 @@
SYSDLL_SHELL32 = 6, /* shell32 From ShellAPI.h */
SYSDLL_ADVAPI32 = 7, /* advapi32 From WinBase.h */
SYSDLL_JVM = 8, /* jvm From our own jvm.dll */
+ SYSDLL_KTMW32 = 9, /* ktmw32 From Ktmw32.h */
- SYSDLL_defined = 9 /* must define as last idx_ + 1 */
+ SYSDLL_defined = 10 /* must define as last idx_ + 1 */
} acr_dlltoken_e;
extern LPSYSTEM_INFO acr_osinf;
Modified:
commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h
URL:
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h?rev=784010&r1=784009&r2=784010&view=diff
==============================================================================
---
commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h
(original)
+++
commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h
Fri Jun 12 07:17:40 2009
@@ -40,6 +40,10 @@
#define HAVE_FILEEXTD_LIB 0
#endif
+#if HAVE_KTMW32_H
+#include <ktmw32.h>
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif