commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r771275 - in /commons/sandbox/runtime/trunk/src/main/native: configure shared/clazz.c
Date Mon, 04 May 2009 11:49:57 GMT
Author: mturk
Date: Mon May  4 11:49:56 2009
New Revision: 771275

URL: http://svn.apache.org/viewvc?rev=771275&view=rev
Log:
Add openssl to the configure

Modified:
    commons/sandbox/runtime/trunk/src/main/native/configure
    commons/sandbox/runtime/trunk/src/main/native/shared/clazz.c

Modified: commons/sandbox/runtime/trunk/src/main/native/configure
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/configure?rev=771275&r1=771274&r2=771275&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/configure (original)
+++ commons/sandbox/runtime/trunk/src/main/native/configure Mon May  4 11:49:56 2009
@@ -68,6 +68,10 @@
 has_test=false
 is_unix=true
 
+has_openssl=false
+openssl_inc=""
+openssl_lib=""
+
 for o
 do
     case "$o" in
@@ -121,6 +125,16 @@
             java_pinc="$a"
             shift
         ;;
+        --with-openssl=* )
+            openssl_inc="$a"
+            has_openssl=true
+            shift
+        ;;
+        --with-openssl-lib=* )
+            openssl_lib="$a"
+            has_openssl=true
+            shift
+        ;;
         CC=*)       cc="$a" ;       shift ;;
         CXX=*)      cxx="$a" ;      shift ;;
         CPP=*)      cpp="$a" ;      shift ;;
@@ -364,6 +378,26 @@
     fi
 fi
 
+if $has_openssl; then
+    if [ -n "$openssl_inc" ]; then
+        varadds includes "-I$openssl_inc"
+    fi
+    if $is_unix; then
+        if [ -n "$openssl_lib" ]; then
+            varadds shflags "-L$openssl_lib"
+        fi
+        varadds ldflags "-lssl -lcrypto"
+    else
+        if [ -n "$openssl_lib" ]; then
+            varadds shflags "/libpath:\"openssl_lib\""
+        fi
+        varadds ldflags "libeay32.lib ssleay32.lib"
+    fi
+    have_openssl=1
+else
+    have_openssl=0
+fi
+
 test=ctest$$
 
 if $has_dso_test; then
@@ -541,6 +575,7 @@
 #define HAVE_AIO_H            $have_aio
 #define HAVE_LIBAIO_H         $have_libaio
 #define HAVE_UUID_UUID_H      $have_uuid_uuid
+#define HAVE_OPENSSL          $have_openssl
 #define HAS_BIG_ENDIAN        $bige
 
 #define HAVE_UNISTD_H         `have_include unistd`

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/clazz.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/clazz.c?rev=771275&r1=771274&r2=771275&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/clazz.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/clazz.c Mon May  4 11:49:56 2009
@@ -132,7 +132,6 @@
     o = (jobject)(*_E)->FindClass(_E, name);
     if (o != NULL) {
         c = (jclass)(*_E)->NewGlobalRef(_E, o);
-        (*_E)->DeleteLocalRef(_E, o);
         if (c == NULL) {
             /* According to the JNI spec this can
              * happen if the system runs out of memory.
@@ -143,6 +142,7 @@
 #endif
             return NULL;
         }
+        (*_E)->DeleteLocalRef(_E, o);
         if (m)
             (*_E)->MonitorEnter(_E, m);
         ACR_TableAdd(_E, THROW_FMARK, clazz_cache, name, c, 0);
@@ -193,7 +193,10 @@
     }
     /* Init class */
     c = (jobject)(*_E)->FindClass(_E, clazz->n);
-    if ((*_E)->ExceptionCheck(_E) || c == NULL) {
+    if (c == NULL) {
+        /* Exception has been thrown
+         * We could clear the exception here.
+         */
         goto failed;
     }
     clazz->i = (jclass)(*_E)->NewGlobalRef(_E, c);
@@ -208,7 +211,7 @@
         /* Init class array */
         sprintf(an, "[L%s;", clazz->n);
         c = (jobject)(*_E)->FindClass(_E, an);
-        if ((*_E)->ExceptionCheck(_E) || c == NULL) {
+        if (c == NULL) {
             goto failed;
         }
         clazz->a = (jclass)(*_E)->NewGlobalRef(_E, c);



Mime
View raw message