Skip to content

Commit

Permalink
Merge pull request #148 from hintjens/master
Browse files Browse the repository at this point in the history
Problem: need to release a version of Malamute
  • Loading branch information
asokoloski committed Feb 2, 2016
2 parents bdf43dd + 67d274d commit b9fc98c
Show file tree
Hide file tree
Showing 18 changed files with 40 additions and 42 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ install(TARGETS mlm
########################################################################
# pkgconfig
########################################################################
set (VERSION "0.0.0")
set (VERSION "1.0.0")
set (prefix "${CMAKE_INSTALL_PREFIX}")
set (exec_prefix "\${prefix}")
set (libdir "\${prefix}/lib${LIB_SUFFIX}")
Expand Down
4 changes: 2 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ EXTRA_DIST = \
src/mlm_msg.h \
src/mlm_stream_simple.h \
src/mlm_mailbox_simple.h \
src/mlm_classes.h \
LICENSE \
README.md \
CONTRIBUTING.md
CONTRIBUTING.md \
src/mlm_classes.h

include $(srcdir)/src/Makemodule.am

Expand Down
3 changes: 2 additions & 1 deletion bindings/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ find_package (JNI REQUIRED)
find_library (ZMQ_LIBRARY NAMES zmq libzmq REQUIRED)
find_library (MLM_LIBRARY NAMES mlm REQUIRED)

include_directories (${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2} src/native/include)
include_directories (${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2} ../../include src/native/include)

set (mlmjni_sources
src/main/c/org_zeromq_mlm_MlmProto.c
src/main/c/org_zeromq_mlm_MlmClient.c
)

add_library (mlmjni SHARED ${mlmjni_sources})
add_definitions (-DMLM_BUILD_DRAFT_API)

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -O2")
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build)
Expand Down
10 changes: 5 additions & 5 deletions bindings/jni/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ JNI Binding for Malamute

## Building the JNI Layer for Linux

Ensure you have cmake installed, then run:
Ensure you have gradle and cmake installed, then run:

./gradle build jar
./gradle test
gradle build jar
gradle test

This calls javah to build the headers in src/native/c, and then compiles the C and Java pieces to create a jar file a sharable library (.so).
This calls javah to build the headers in src/native/include, and then compiles the C and Java pieces to create a jar file a sharable library (.so).

## Building the JNI Layer for Android

Expand All @@ -32,7 +32,7 @@ Then in the android directory, run:
This does the following:

* It compiles the Malamute C sources for Android, into a native library libmlm.so in builds/android/
* It compiles the JNI Java classes into a jar file mlm-jni-0.0.0.jar in bindings/jni/build/libs
* It compiles the JNI Java classes into a jar file mlm-jni-1.0.0.jar in bindings/jni/build/libs
* It compiles the JNI C sources for Android, into a native library libmlmjni.so.
* It takes czmq-jni-*.jar, which must already be built in ../czmq/bindings/jni/build/libs/
* It combines all these into mlm-android.jar, which you can use in your Android projects.
Expand Down
2 changes: 1 addition & 1 deletion bindings/jni/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
apply plugin: 'java'
apply plugin: 'maven'
group = "org.zeromq"
version = "0.0.0"
version = "1.0.0"

repositories {
mavenLocal()
Expand Down
2 changes: 1 addition & 1 deletion bindings/jni/src/main/c/org_zeromq_mlm_MlmClient.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <stdlib.h>
#include <jni.h>
#include "malamute.h"
#include "../../native/include/org_zeromq_mlm_MlmClient.h"
#include "org_zeromq_mlm_MlmClient.h"

JNIEXPORT jlong JNICALL
Java_org_zeromq_mlm_MlmClient__1_1new (JNIEnv *env, jclass c)
Expand Down
2 changes: 1 addition & 1 deletion bindings/jni/src/main/c/org_zeromq_mlm_MlmProto.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <stdlib.h>
#include <jni.h>
#include "malamute.h"
#include "../../native/include/org_zeromq_mlm_MlmProto.h"
#include "org_zeromq_mlm_MlmProto.h"

JNIEXPORT jlong JNICALL
Java_org_zeromq_mlm_MlmProto__1_1new (JNIEnv *env, jclass c)
Expand Down
4 changes: 2 additions & 2 deletions bindings/jni/src/main/java/org/zeromq/mlm/MlmClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
# Please refer to the README for information about making permanent changes. #
################################################################################
*/
package org.zeromq.malamute;
package org.zeromq.mlm;
import org.zeromq.czmq.*;

public class MlmClient implements AutoCloseable{
static {
try {
System.loadLibrary ("malamutejni");
System.loadLibrary ("mlmjni");
}
catch (Exception e) {
System.exit (-1);
Expand Down
4 changes: 2 additions & 2 deletions bindings/jni/src/main/java/org/zeromq/mlm/MlmProto.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
# Please refer to the README for information about making permanent changes. #
################################################################################
*/
package org.zeromq.malamute;
package org.zeromq.mlm;
import org.zeromq.czmq.*;

public class MlmProto implements AutoCloseable{
static {
try {
System.loadLibrary ("malamutejni");
System.loadLibrary ("mlmjni");
}
catch (Exception e) {
System.exit (-1);
Expand Down
4 changes: 2 additions & 2 deletions bindings/jni/src/test/java/org/zeromq/mlm/MlmClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
# Please refer to the README for information about making permanent changes. #
################################################################################
*/
package org.zeromq.malamute;
package org.zeromq.mlm;

import org.junit.Assert;
import org.junit.Test;

public class MlmClientTest {
static {
try {
System.loadLibrary ("malamutejni");
System.loadLibrary ("mlmjni");
}
catch (Exception e) {
System.exit (-1);
Expand Down
4 changes: 2 additions & 2 deletions bindings/jni/src/test/java/org/zeromq/mlm/MlmProtoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
# Please refer to the README for information about making permanent changes. #
################################################################################
*/
package org.zeromq.malamute;
package org.zeromq.mlm;

import org.junit.Assert;
import org.junit.Test;

public class MlmProtoTest {
static {
try {
System.loadLibrary ("malamutejni");
System.loadLibrary ("mlmjni");
}
catch (Exception e) {
System.exit (-1);
Expand Down
14 changes: 3 additions & 11 deletions bindings/python/malamute/_malamute_ctypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
# load the library. If we use find_library below, we get the wrong result.
if os.name == 'posix':
if sys.platform == 'darwin':
lib = cdll.LoadLibrary('libmlm.0.dylib')
lib = cdll.LoadLibrary('libmlm.1.dylib')
else:
lib = cdll.LoadLibrary("libmlm.so.0")
lib = cdll.LoadLibrary("libmlm.so.1")
elif os.name == 'nt':
lib = cdll.LoadLibrary('libmlm.dll')
except OSError:
Expand Down Expand Up @@ -111,15 +111,7 @@ class MlmProto(object):
"""

SUCCESS = 200 #
STORED = 201 #
DELIVERED = 202 #
NOT_DELIVERED = 300 #
CONTENT_TOO_LARGE = 301 #
TIMEOUT_EXPIRED = 302 #
CONNECTION_REFUSED = 303 #
RESOURCE_LOCKED = 400 #
ACCESS_REFUSED = 401 #
NOT_FOUND = 404 #
FAILED = 300 #
COMMAND_INVALID = 500 #
NOT_IMPLEMENTED = 501 #
INTERNAL_ERROR = 502 #
Expand Down
2 changes: 1 addition & 1 deletion bindings/ruby/lib/malamute/ffi/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

module Malamute
module FFI
VERSION = '0.0.0'
VERSION = '1.0.0'
end
end

Expand Down
8 changes: 6 additions & 2 deletions builds/msvc/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
/* =========================================================================
platform.h
Copyright (c) the Contributors as noted in the AUTHORS file.
This file is part of the Malamute Project.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
file, You can obtain one at http://mozilla.org/MPL/2.0/.
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Please refer to the README for information about making permanent changes. #
Expand All @@ -15,6 +18,7 @@
#ifndef __PLATFORM_H_INCLUDED__
#define __PLATFORM_H_INCLUDED__

#define MLM_HAVE_WINDOWS
#define MLM_HAVE_WINDOWS 1
#define MLM_BUILD_DRAFT_API 1

#endif
8 changes: 4 additions & 4 deletions builds/msvc/resource.rc
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,0,0,0
PRODUCTVERSION 0,0,0,0
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -67,12 +67,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "The AUTHORS"
VALUE "FileDescription", "ZeroMQ Message Broker"
VALUE "FileVersion", "0.0.0.0"
VALUE "FileVersion", "1.0.0.0"
VALUE "InternalName", "Malamute"
VALUE "LegalCopyright", "Copyright (c) the Authors"
VALUE "OriginalFilename", "libmlm.dll"
VALUE "ProductName", "Malamute"
VALUE "ProductVersion", "0.0.0.0"
VALUE "ProductVersion", "1.0.0.0"
END
END
BLOCK "VarFileInfo"
Expand Down
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
#
AC_INIT([malamute],[0.0.0],[email@hostname.com])
AC_INIT([malamute],[1.0.0],[email@hostname.com])

AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)
Expand Down Expand Up @@ -36,7 +36,7 @@ AC_SUBST(PACKAGE_VERSION)
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
#
# libmlm -version-info
LTVER="0:0:0"
LTVER="1:0:0"
AC_SUBST(LTVER)

# Capture c flags
Expand Down Expand Up @@ -455,7 +455,7 @@ if test "x$cross_compiling" = "xyes"; then
else
# enable draft API by default if we're in a git repository
# else disable it by default; then allow --enable-drafts=yes/no override
AC_CHECK_FILE(.git, [gitmaster=yes], [gitmaster=no])
AC_CHECK_FILE($srcdir/.git, [gitmaster=yes], [gitmaster=no])
fi

AC_ARG_ENABLE([drafts],
Expand Down
2 changes: 1 addition & 1 deletion include/mlm_library.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

// MLM version macros for compile-time API detection

#define MLM_VERSION_MAJOR 0
#define MLM_VERSION_MAJOR 1
#define MLM_VERSION_MINOR 0
#define MLM_VERSION_PATCH 0

Expand Down
1 change: 1 addition & 0 deletions project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
repository = "git://github.com/zeromq/malamute.git">

<include filename = "src/license.xml" />
<version major = "1" minor = "0" />
<use project = "czmq" />

<target name = "java" />
Expand Down

0 comments on commit b9fc98c

Please sign in to comment.