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/04/21 10:10:49 UTC

svn commit: r767062 - in /commons/sandbox/runtime/trunk/src/main/native: configure include/acr.h

Author: mturk
Date: Tue Apr 21 08:10:48 2009
New Revision: 767062

URL: http://svn.apache.org/viewvc?rev=767062&view=rev
Log:
Add -laio only if <libaio.h> is present

Modified:
    commons/sandbox/runtime/trunk/src/main/native/configure
    commons/sandbox/runtime/trunk/src/main/native/include/acr.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=767062&r1=767061&r2=767062&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/configure (original)
+++ commons/sandbox/runtime/trunk/src/main/native/configure Tue Apr 21 08:10:48 2009
@@ -260,7 +260,7 @@
     linux-gcc )
         varadds cppopts "-DLINUX=2 -D_GNU_SOURCE"
         varadds ccflags "-fPIC -O3 -Wall -g"
-        varadds ldflags "-lrt -lpthread -ldl -laio"
+        varadds ldflags "-lrt -lpthread -ldl"
         varadds shflags "-shared -fPIC -Wl,-soname -Wl,lib$name$so"
         if [ ".$java_pinc" = . ]; then java_pinc=linux; fi
         ;;
@@ -281,7 +281,7 @@
         fi
         varadds ccflags "-xstrconst -xdepend -O -Xa -KPIC"
         varadds cppopts "-D_POSIX_PTHREAD_SEMANTICS -DSOLARIS2=$r"
-        varadds ldflags "-lrt -lthread -lsocket -lnsl -ldl -laio"
+        varadds ldflags "-lrt -lthread -lsocket -lnsl -ldl"
         varadds shflags "-G -KPIC -dy"
         if [ ".$java_pinc" = . ]; then java_pinc=solaris; fi
         ;;
@@ -473,7 +473,20 @@
     exit 1
 fi
 
-have_fileextd="`have_include fileextd '#include <windows.h>'`"
+if [ ".$host" = ".windows" ]; then
+    have_fileextd="`have_include fileextd '#include <windows.h>'`"
+    have_aio="0"
+    have_libaio="0"
+    have_windows="1"
+else
+    have_aio="`have_include aio`"
+    have_libaio="`have_include libaio`"
+    have_windows="0"
+fi
+
+if [ ".$have_libaio" = ".1" ]; then
+    varadds ldflags "-laio"
+fi
 
 # Generate configuration header file
 #
@@ -488,11 +501,15 @@
 extern "C" {
 #endif
 
+#define HAVE_WINDOWS_H        $have_windows
+#define HAVE_FILEEXTD_H       $have_fileextd
+#define HAVE_AIO_H            $have_aio
+#define HAVE_LIBAIO_H         $have_libaio
+#define HAS_BIG_ENDIAN        $bige
+
 #define HAVE_UNISTD_H         `have_include unistd`
 #define HAVE_STRING_H         `have_include string`
 #define HAVE_STRINGS_H        `have_include strings`
-#define HAVE_WINDOWS_H        `have_include windows`
-#define HAVE_FILEEXTD_H       $have_fileextd
 #define HAVE_INTTYPES_H       `have_include inttypes`
 #define HAVE_DLFCN_H          `have_include dlfcn`
 #define HAVE_LINK_H           `have_include link`
@@ -509,22 +526,20 @@
 #define HAVE_CTYPE_H          `have_include ctype`
 #define HAVE_WCHAR_H          `have_include wchar`
 #define HAVE_WCTYPE_H         `have_include wctype`
-#define HAVE_AIO_H            `have_include aio`
 #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_SYS_UN_H         `have_include sys/un`
 #define HAVE_STRERROR_R       `have_strerror_r`
 
-#define HAS_BIG_ENDIAN        $bige
-
 #define CC_SIZEOF_INT         $sizeof_int
+#define CC_SIZEOF_WCHAR_T     $sizeof_wchar
+
 #define CC_SIZEOF_LONG        `test_csizeof long`
 #define CC_SIZEOF_LONG_LONG   `test_csizeof 'long long'`
 #define CC_SIZEOF_VOIDP       `test_csizeof 'void *'`
 #define CC_SIZEOF_SIZE_T      `test_csizeof size_t`
 #define CC_SIZEOF_OFF64_T     `test_csizeof off64_t`
-#define CC_SIZEOF_WCHAR_T     $sizeof_wchar
 
 EOF
 
@@ -565,7 +580,7 @@
     else
         echo "not found"
     fi
-    if [ $have_fileextd = 1 ]; then
+    if [ ".$have_fileextd" = ".1" ]; then
         varadds ldflags "fileextd.lib"
     fi
 fi

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr.h?rev=767062&r1=767061&r2=767062&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr.h Tue Apr 21 08:10:48 2009
@@ -144,6 +144,9 @@
 #if HAVE_AIO_H
 #include <aio.h>
 #endif
+#if HAVE_LIBAIO_H
+#include <libaio.h>
+#endif
 #if HAVE_NETDB_H
 #include <netdb.h>
 #endif