Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E65F81852F for ; Thu, 16 Jul 2015 00:34:53 +0000 (UTC) Received: (qmail 26578 invoked by uid 500); 16 Jul 2015 00:34:53 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 26453 invoked by uid 500); 16 Jul 2015 00:34:53 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 26437 invoked by uid 99); 16 Jul 2015 00:34:53 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jul 2015 00:34:53 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 85492E051A; Thu, 16 Jul 2015 00:34:53 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: clebertsuconic@apache.org To: commits@activemq.apache.org Date: Thu, 16 Jul 2015 00:34:53 -0000 Message-Id: <5f5f9cb806b44bf58276c96d0964cbdc@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] activemq-artemis git commit: ARTEMIS-150 moving to cmake will fix nar/jar dependency issues and fix SBT Repository: activemq-artemis Updated Branches: refs/heads/master 3b69f5e37 -> d560aa4c4 ARTEMIS-150 moving to cmake will fix nar/jar dependency issues and fix SBT Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/e7bd2f9c Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/e7bd2f9c Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/e7bd2f9c Branch: refs/heads/master Commit: e7bd2f9c459997043857a5db0b0000a9d7645973 Parents: 3b69f5e Author: Clebert Suconic Authored: Wed Jul 15 20:29:07 2015 -0400 Committer: Clebert Suconic Committed: Wed Jul 15 20:29:36 2015 -0400 ---------------------------------------------------------------------- .gitignore | 9 +++ artemis-native/CMakeLists.txt | 18 ++++++ artemis-native/bin/libartemis-native-64.so | Bin 51820 -> 46624 bytes artemis-native/compile-native.sh | 3 +- artemis-native/pom.xml | 43 +------------ artemis-native/src/main/c/CMakeLists.txt | 79 ++++++++++++++++++++++++ 6 files changed, 109 insertions(+), 43 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e7bd2f9c/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore index 5f963dd..71af624 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,12 @@ ratReport.txt .settings .checkstyle .factorypath + +# for native build +**/CMakeCache.txt +**/CMakeFiles/ +**/Makefile +**/cmake_install.cmake + +# this file is generated +artemis-native/src/main/c/org_apache_activemq_artemis_core_libaio_Native.h http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e7bd2f9c/artemis-native/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/artemis-native/CMakeLists.txt b/artemis-native/CMakeLists.txt new file mode 100644 index 0000000..06eb3b3 --- /dev/null +++ b/artemis-native/CMakeLists.txt @@ -0,0 +1,18 @@ +# 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. + +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +SUBDIRS(src/main/c) http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e7bd2f9c/artemis-native/bin/libartemis-native-64.so ---------------------------------------------------------------------- diff --git a/artemis-native/bin/libartemis-native-64.so b/artemis-native/bin/libartemis-native-64.so index 1deebbc..1c4983c 100755 Binary files a/artemis-native/bin/libartemis-native-64.so and b/artemis-native/bin/libartemis-native-64.so differ http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e7bd2f9c/artemis-native/compile-native.sh ---------------------------------------------------------------------- diff --git a/artemis-native/compile-native.sh b/artemis-native/compile-native.sh index 7f89c95..22f4144 100755 --- a/artemis-native/compile-native.sh +++ b/artemis-native/compile-native.sh @@ -15,4 +15,5 @@ # specific language governing permissions and limitations # under the License. -mvn install -Pnative-build +cmake . +make http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e7bd2f9c/artemis-native/pom.xml ---------------------------------------------------------------------- diff --git a/artemis-native/pom.xml b/artemis-native/pom.xml index 5b383c1..abd5f0d 100644 --- a/artemis-native/pom.xml +++ b/artemis-native/pom.xml @@ -25,7 +25,7 @@ artemis-native - ${native-package-type} + jar org.apache.activemq @@ -86,49 +86,8 @@ - - - native-build - - nar - - - - - com.github.maven-nar - nar-maven-plugin - 3.0.0 - true - - - true - - - - - - - - - aio - - - - - - jni - org.apache.activemq.artemis.core.libaio - - - - - - - - - jar ${project.basedir}/.. http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e7bd2f9c/artemis-native/src/main/c/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/artemis-native/src/main/c/CMakeLists.txt b/artemis-native/src/main/c/CMakeLists.txt new file mode 100644 index 0000000..0a45fd6 --- /dev/null +++ b/artemis-native/src/main/c/CMakeLists.txt @@ -0,0 +1,79 @@ +# 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. + + +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +PROJECT(artemis-native) +SET(${PROJECT_NAME}_MAJOR_VERSION 1) +SET(${PROJECT_NAME}_MINOR_VERSION 0) +SET(${PROJECT_NAME}_PATCH_LEVEL 0) + +FIND_PACKAGE(Java) +FIND_PACKAGE(JNI) +if (JNI_FOUND) + message (STATUS "JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}") + message (STATUS "JNI_LIBRARIES=${JNI_LIBRARIES}") +endif() + +# you may want to remove this next line for debugging +# -O3 would make inline debug hard +ADD_DEFINITIONS("-O3 -Wall") +#ADD_DEFINITIONS("-fdump-tree-all -Wall -pg -g -mstack-protector-guard=guard") + +find_library(LIBAIO NAMES aio) + +INCLUDE_DIRECTORIES(. ${JNI_INCLUDE_DIRS}) + +ADD_CUSTOM_COMMAND( + OUTPUT org_apache_activemq_artemis_core_libaio_Native.h + COMMAND javah -cp ../java/ org.apache.activemq.artemis.core.libaio.Native + DEPENDS ../java/org/apache/activemq/artemis/core/libaio/Native.java +) + +ADD_LIBRARY(artemis-native SHARED + AIOController.cpp + AIOController.h + AIOException.h + AsyncFile.cpp + AsyncFile.h + CallbackAdapter.h + JAIODatatypes.h + JavaUtilities.cpp + JavaUtilities.h + JNI_AsynchronousFileImpl.cpp + JNICallbackAdapter.cpp + JNICallbackAdapter.h + LockClass.h + Version.h + org_apache_activemq_artemis_core_libaio_Native.h) + +target_link_libraries(artemis-native aio) + +set_target_properties(artemis-native PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ../../../bin) + +# It is weird but this is how you are supposed to validate between 32 and 64 bits architecture +if (CMAKE_SIZEOF_VOID_P EQUAL 8) + set_target_properties(artemis-native PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ../../../bin + LIBRARY_OUTPUT_NAME artemis-native-64) + message("-- Setting up library as artemis-native-64 based on current architecture") +else() + set_target_properties(artemis-native PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ../../../bin + LIBRARY_OUTPUT_NAME artemis-native-32) + message("-- Setting up library as artemis-native-32 based on current architecture") +endif()