activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r835834 - in /activemq/sandbox/activemq-apollo/activemq-syscall/src/main: java/org/apache/activemq/syscall/ native-package/ native-package/src/
Date Fri, 13 Nov 2009 12:58:12 GMT
Author: chirino
Date: Fri Nov 13 12:58:11 2009
New Revision: 835834

URL: http://svn.apache.org/viewvc?rev=835834&view=rev
Log:
working on making it more cross platform.

Added:
    activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/configure.ac
Modified:
    activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/AIO.java
    activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/CLibrary.java
    activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/IO.java
    activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/src/activemq-syscall.h

Modified: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/AIO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/AIO.java?rev=835834&r1=835833&r2=835834&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/AIO.java
(original)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/AIO.java
Fri Nov 13 12:58:11 2009
@@ -17,9 +17,13 @@
 package org.apache.activemq.syscall;
 
 import org.fusesource.hawtjni.runtime.ClassFlag;
+import org.fusesource.hawtjni.runtime.FieldFlag;
 import org.fusesource.hawtjni.runtime.JniArg;
 import org.fusesource.hawtjni.runtime.JniClass;
 import org.fusesource.hawtjni.runtime.JniField;
+import org.fusesource.hawtjni.runtime.JniMethod;
+
+import static org.fusesource.hawtjni.runtime.MethodFlag.*;
 
 /**
  * The aio facility provides system calls for asynchronous I/O
@@ -31,9 +35,16 @@
 
     @JniClass(flags={ClassFlag.STRUCT})
     static public class aiocb {
+        static {
+            LIBRARY.load();
+            init();
+        }
+        
+        @JniMethod(flags={CONSTANT_INITIALIZER})
+        private static final native void init();
         
-        public static final native int aiocb_sizeof ();
-        public static final int SIZEOF = aiocb_sizeof();
+        @JniField(flags={FieldFlag.CONSTANT}, accessor="sizeof(struct aiocb)")
+        public static int SIZEOF;
         
         int aio_fildes;
         @JniField(cast="void *")

Modified: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/CLibrary.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/CLibrary.java?rev=835834&r1=835833&r2=835834&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/CLibrary.java
(original)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/CLibrary.java
Fri Nov 13 12:58:11 2009
@@ -30,9 +30,9 @@
 @JniClass
 public class CLibrary {
 
-    private static Library library = new Library("activemq-syscall", CLibrary.class);
+    final public static Library LIBRARY = new Library("activemq-syscall", CLibrary.class);
     static {
-        library.load();
+        LIBRARY.load();
     }
     
     ///////////////////////////////////////////////////////////////////

Modified: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/IO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/IO.java?rev=835834&r1=835833&r2=835834&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/IO.java
(original)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/IO.java
Fri Nov 13 12:58:11 2009
@@ -19,11 +19,9 @@
 import org.fusesource.hawtjni.runtime.JniClass;
 import org.fusesource.hawtjni.runtime.JniField;
 import org.fusesource.hawtjni.runtime.JniMethod;
-import org.fusesource.hawtjni.runtime.MethodFlag;
 
 import static org.fusesource.hawtjni.runtime.MethodFlag.*;
 
-import static org.fusesource.hawtjni.runtime.FieldFlag.*;
 import static org.fusesource.hawtjni.runtime.FieldFlag.CONSTANT;
 
 /**

Added: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/configure.ac
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/configure.ac?rev=835834&view=auto
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/configure.ac
(added)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/configure.ac
Fri Nov 13 12:58:11 2009
@@ -0,0 +1,73 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+## --------------------------------
+## Initialization macros.
+## --------------------------------
+AC_PREREQ([2.61])
+AC_INIT([activemq-syscall], [6.0-SNAPSHOT])
+AC_CONFIG_AUX_DIR([autotools])
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_SRCDIR([src/activemq-syscall.c])
+AC_CONFIG_HEADERS([src/config.h])
+AC_CANONICAL_HOST
+AC_CANONICAL_SYSTEM
+
+## -----------------------------------------------
+## Application Checks
+## -----------------------------------------------
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_LIBTOOL([disable-static])
+
+## -----------------------------------------------
+## API Checks
+## -----------------------------------------------
+
+WITH_OSX_UNIVERSAL
+WITH_JNI_JDK
+
+# Look for the AIO api..
+AC_CHECK_HEADER([aio.h],[
+  for lib in [aio c rt] ; do
+    AC_CHECK_LIB([$lib], [aio_read],[
+      LDFLAGS="$LDFLAGS -l$lib"
+      AC_DEFINE([HAVE_AIO_H], [1], [Define to 1 if you have the <aio.h> header file.])
+      break
+    ])  
+  done
+])
+
+CFLAGS="$CFLAGS $JNI_EXTRA_CFLAGS"
+LDFLAGS="$LDFLAGS $JNI_EXTRA_LDFLAGS -release $PACKAGE_VERSION"
+
+AC_SUBST(CFLAGS)
+AC_SUBST(LDFLAGS)
+
+## -----------------------------------------------------
+## Generate the files
+## -----------------------------------------------------
+AM_INIT_AUTOMAKE([no-dependencies -Wall -Werror foreign])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+
+echo "
+  ($PACKAGE_NAME) version $PACKAGE_VERSION
+  Prefix.........: $prefix
+  C Compiler.....: $CC $CFLAGS
+  Linker.........: $LD $LDFLAGS $LIBS
+"
\ No newline at end of file

Modified: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/src/activemq-syscall.h
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/src/activemq-syscall.h?rev=835834&r1=835833&r2=835834&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/src/activemq-syscall.h
(original)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/src/activemq-syscall.h
Fri Nov 13 12:58:11 2009
@@ -1,15 +1,33 @@
-#ifndef INCLUDED_PLATFORM_H
-#define INCLUDED_PLATFORM_H
+#ifndef INCLUDED_ACTIVEMQ_SYSCALL_H
+#define INCLUDED_ACTIVEMQ_SYSCALL_H
 
-#include <stdlib.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
+#ifdef HAVE_CONFIG_H
+  /* configure based build.. we will use what it discovered about the platform */
+  #include "config.h"
+#else
+  #ifdef WIN32
+    /* Windows based build */
+    #define HAVE_STDLIB_H 1
+    #define HAVE_STRINGS_H 1
+  #endif
+#endif
+
+#ifdef HAVE_UNISTD_H
+  #include <unistd.h>
+#endif
 
-#define PTR_sizeof() sizeof(void *)
+#ifdef HAVE_STDLIB_H
+  #include <stdlib.h>
+#endif
 
-#define NATIVE_PTR_CAST void *)(intptr_t
-#define JAVA_PTR_CAST   intptr_t)( void *
+#ifdef HAVE_STRINGS_H
+  #include <string.h>
+#endif
 
+#ifdef HAVE_AIO_H
+  #include <aio.h>
+#endif
+
+#include <fcntl.h>
 
-#endif /* INCLUDED_PLATFORM_H */
\ No newline at end of file
+#endif /* INCLUDED_ACTIVEMQ_SYSCALL_H */
\ No newline at end of file



Mime
View raw message