Skip to content

Commit

Permalink
Problem: not checking minimum CZMQ version level
Browse files Browse the repository at this point in the history
Allows building with old CZMQs, causing weird failures in zproto code.

Solution: require at least v 3.0.1

(Also, set Malamute version to 0.1.0)
  • Loading branch information
hintjens committed Feb 27, 2015
1 parent 5eb7111 commit 9b754e0
Show file tree
Hide file tree
Showing 24 changed files with 173 additions and 96 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ if (MINGW)
set(MORE_LIBRARIES -lws2_32 -lrpcrt4 -liphlpapi)
endif()

# required libraries for cygwin
if (CYGWIN)
set(MORE_LIBRARIES -luuid)
endif()

list(APPEND CMAKE_MODULE_PATH ${SOURCE_DIR})

Expand All @@ -92,13 +96,13 @@ list(APPEND MORE_LIBRARIES ${CZMQ_LIBRARIES})
set (malamute_headers
include/mlm_library.h
include/malamute.h
src/zbits.h
include/mlm_proto.h
include/mlm_server.h
include/mlm_client.h
src/mlm_msg.h
src/mlm_stream_simple.h
src/mlm_mailbox_simple.h
src/zbits.h
src/mlm_server_engine.inc
src/mlm_client_engine.inc
src/mlm_client_custom.xml
Expand All @@ -112,13 +116,13 @@ install(FILES ${malamute_headers} DESTINATION include)
include_directories(${BINARY_DIR})
include_directories(${SOURCE_DIR}/include)
set (malamute_sources
src/zbits.c
src/mlm_proto.c
src/mlm_server.c
src/mlm_client.c
src/mlm_msg.c
src/mlm_stream_simple.c
src/mlm_mailbox_simple.c
src/zbits.c
)
source_group ("Source Files" FILES ${malamute_sources})
add_library(malamute SHARED ${malamute_sources})
Expand Down
3 changes: 3 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ SUBDIRS += doc
DIST_SUBDIRS =
lib_LTLIBRARIES =
bin_PROGRAMS =
noinst_PROGRAMS =
check_PROGRAMS =
noinst_LTLIBRARIES =
TESTS =

EXTRA_DIST = \
mlm_server_engine.inc \
Expand Down
5 changes: 3 additions & 2 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ if [ $? -ne 0 ]; then
fi

autoreconf --install --force --verbose -I config
if [ $? -ne 0 ]; then
echo "autogen.sh: error: autoreconf exited with status $?" 1>&2
status=$?
if [ $status -ne 0 ]; then
echo "autogen.sh: error: autoreconf exited with status $status" 1>&2
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion builds/android/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := malamute
LOCAL_C_INCLUDES := ../../include $(LIBZMQ)/include
LOCAL_SRC_FILES := zbits.c mlm_proto.c mlm_server.c mlm_client.c mlm_msg.c mlm_stream_simple.c mlm_mailbox_simple.c
LOCAL_SRC_FILES := mlm_proto.c mlm_server.c mlm_client.c mlm_msg.c mlm_stream_simple.c mlm_mailbox_simple.c zbits.c
LOCAL_SHARED_LIBRARIES := zmq
include $(BUILD_SHARED_LIBRARY)

Expand Down
31 changes: 31 additions & 0 deletions builds/cygwin/Makefile.cygwin
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Please refer to the README for information about making permanent changes. #
################################################################################

CC=gcc
# replace the following with wherever you have installed libzmq
PREFIX=/usr/local
INCDIR=-I$(PREFIX)/include -I.
LIBDIR=-L$(PREFIX)/lib
CFLAGS=-Wall -Os -g -DLIBMLM_EXPORTS $(INCDIR)

OBJS = mlm_proto.o mlm_server.o mlm_client.o mlm_msg.o mlm_stream_simple.o mlm_mailbox_simple.o zbits.o
%.o: ../../src/%.c
$(CC) -c -o $@ $< $(CFLAGS)

all: libmlm.dll mlm_selftest.exe

libmlm.dll: $(OBJS)
$(CC) -shared -o $@ $(OBJS) -Wl,--out-implib,$@.a $(LIBDIR) -lzmq -luuid

# the test functions are not exported into the DLL
mlm_selftest.exe: mlm_selftest.o $(OBJS)
$(CC) -o $@ $^ $(LIBDIR) -lzmq -luuid
clean:
del *.o *.a *.dll *.exe

################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Please refer to the README for information about making permanent changes. #
################################################################################
2 changes: 1 addition & 1 deletion builds/mingw32/Makefile.mingw32
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ INCDIR=-I$(PREFIX)/include -I.
LIBDIR=-L$(PREFIX)/lib
CFLAGS=-Wall -Os -g -DLIBMLM_EXPORTS $(INCDIR)

OBJS = zbits.o mlm_proto.o mlm_server.o mlm_client.o mlm_msg.o mlm_stream_simple.o mlm_mailbox_simple.o
OBJS = mlm_proto.o mlm_server.o mlm_client.o mlm_msg.o mlm_stream_simple.o mlm_mailbox_simple.o zbits.o
%.o: ../../src/%.c
$(CC) -c -o $@ $< $(CFLAGS)

Expand Down
4 changes: 2 additions & 2 deletions builds/msvc/vs2008/malamute/malamute.sln
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "malamute", "malamute$(project.name).vcproj", "{0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "malamute", "malamute\malamute.vcproj", "{0C4A2E28-8C9E-4B27-85D9-BB679AD84AC7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "malamute_selftest", "malamute_selftest$(project.name)_selftest.vcproj", "{A5497C4B-1CD1-4779-9458-2CF7908E7E26}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "malamute_selftest", "malamute_selftest\malamute_selftest.vcproj", "{A5497C4B-1CD1-4779-9458-2CF7908E7E26}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
16 changes: 8 additions & 8 deletions builds/msvc/vs2008/malamute/malamute.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
<References />
<Files>
<Filter Name="Source Files" Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File RelativePath="..\..\..\..\src\zbits.c">
<File RelativePath="..\..\..\..\src\mlm_proto.c">
<FileConfiguration Name="Release|Win32">
<Tool Name="VCCLCompilerTool" CompileAs="2" />
</FileConfiguration>
Expand Down Expand Up @@ -230,7 +230,7 @@
<Tool Name="VCCLCompilerTool" CompileAs="2" />
</FileConfiguration>
</File>
<File RelativePath="..\..\..\..\src\mlm_proto.c">
<File RelativePath="..\..\..\..\src\mlm_server.c">
<FileConfiguration Name="Release|Win32">
<Tool Name="VCCLCompilerTool" CompileAs="2" />
</FileConfiguration>
Expand Down Expand Up @@ -262,7 +262,7 @@
<Tool Name="VCCLCompilerTool" CompileAs="2" />
</FileConfiguration>
</File>
<File RelativePath="..\..\..\..\src\mlm_server.c">
<File RelativePath="..\..\..\..\src\mlm_client.c">
<FileConfiguration Name="Release|Win32">
<Tool Name="VCCLCompilerTool" CompileAs="2" />
</FileConfiguration>
Expand Down Expand Up @@ -294,7 +294,7 @@
<Tool Name="VCCLCompilerTool" CompileAs="2" />
</FileConfiguration>
</File>
<File RelativePath="..\..\..\..\src\mlm_client.c">
<File RelativePath="..\..\..\..\src\mlm_msg.c">
<FileConfiguration Name="Release|Win32">
<Tool Name="VCCLCompilerTool" CompileAs="2" />
</FileConfiguration>
Expand Down Expand Up @@ -326,7 +326,7 @@
<Tool Name="VCCLCompilerTool" CompileAs="2" />
</FileConfiguration>
</File>
<File RelativePath="..\..\..\..\src\mlm_msg.c">
<File RelativePath="..\..\..\..\src\mlm_stream_simple.c">
<FileConfiguration Name="Release|Win32">
<Tool Name="VCCLCompilerTool" CompileAs="2" />
</FileConfiguration>
Expand Down Expand Up @@ -358,7 +358,7 @@
<Tool Name="VCCLCompilerTool" CompileAs="2" />
</FileConfiguration>
</File>
<File RelativePath="..\..\..\..\src\mlm_stream_simple.c">
<File RelativePath="..\..\..\..\src\mlm_mailbox_simple.c">
<FileConfiguration Name="Release|Win32">
<Tool Name="VCCLCompilerTool" CompileAs="2" />
</FileConfiguration>
Expand Down Expand Up @@ -390,7 +390,7 @@
<Tool Name="VCCLCompilerTool" CompileAs="2" />
</FileConfiguration>
</File>
<File RelativePath="..\..\..\..\src\mlm_mailbox_simple.c">
<File RelativePath="..\..\..\..\src\zbits.c">
<FileConfiguration Name="Release|Win32">
<Tool Name="VCCLCompilerTool" CompileAs="2" />
</FileConfiguration>
Expand Down Expand Up @@ -425,13 +425,13 @@
</Filter>
<Filter Name="Header Files">
<File RelativePath="..\..\..\..\builds\msvc\platform.h" />
<File RelativePath="..\..\..\..\src\zbits.h" />
<File RelativePath="..\..\..\..\include\mlm_proto.h" />
<File RelativePath="..\..\..\..\include\mlm_server.h" />
<File RelativePath="..\..\..\..\include\mlm_client.h" />
<File RelativePath="..\..\..\..\src\mlm_msg.h" />
<File RelativePath="..\..\..\..\src\mlm_stream_simple.h" />
<File RelativePath="..\..\..\..\src\mlm_mailbox_simple.h" />
<File RelativePath="..\..\..\..\src\zbits.h" />
<File RelativePath="..\..\..\..\include\mlm_library.h" />
<File RelativePath="..\..\..\..\include\malamute.h" />
<File RelativePath="..\..\..\..\src\mlm_server_engine.inc" />
Expand Down
6 changes: 3 additions & 3 deletions builds/msvc/vs2010/malamute/malamute.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@
<ClInclude Include="..\..\..\..\src\mlm_client_custom.xml" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\src\zbits.c">
<CompileAs>CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\..\src\mlm_proto.c">
<CompileAs>CompileAsCpp</CompileAs>
</ClCompile>
Expand All @@ -105,6 +102,9 @@
<ClCompile Include="..\..\..\..\src\mlm_mailbox_simple.c">
<CompileAs>CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\..\src\zbits.c">
<CompileAs>CompileAsCpp</CompileAs>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\malamute.rc" />
Expand Down
6 changes: 3 additions & 3 deletions builds/msvc/vs2010/malamute/malamute.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\..\..\src\zbits.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\mlm_proto.c">
<Filter>src</Filter>
</ClCompile>
Expand All @@ -28,6 +25,9 @@
<ClCompile Include="..\..\..\..\src\mlm_mailbox_simple.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\zbits.c">
<Filter>src</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\include\mlm_library.h">
Expand Down
6 changes: 3 additions & 3 deletions builds/msvc/vs2012/malamute/malamute.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@
<ClInclude Include="..\..\..\..\src\mlm_client_custom.xml" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\src\zbits.c">
<CompileAs>CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\..\src\mlm_proto.c">
<CompileAs>CompileAsCpp</CompileAs>
</ClCompile>
Expand All @@ -105,6 +102,9 @@
<ClCompile Include="..\..\..\..\src\mlm_mailbox_simple.c">
<CompileAs>CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\..\src\zbits.c">
<CompileAs>CompileAsCpp</CompileAs>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\malamute.rc" />
Expand Down
6 changes: 3 additions & 3 deletions builds/msvc/vs2012/malamute/malamute.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\..\..\src\zbits.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\mlm_proto.c">
<Filter>src</Filter>
</ClCompile>
Expand All @@ -28,6 +25,9 @@
<ClCompile Include="..\..\..\..\src\mlm_mailbox_simple.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\zbits.c">
<Filter>src</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\include\mlm_library.h">
Expand Down
6 changes: 3 additions & 3 deletions builds/msvc/vs2013/malamute/malamute.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@
<ClInclude Include="..\..\..\..\src\mlm_client_custom.xml" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\src\zbits.c">
<CompileAs>CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\..\src\mlm_proto.c">
<CompileAs>CompileAsCpp</CompileAs>
</ClCompile>
Expand All @@ -105,6 +102,9 @@
<ClCompile Include="..\..\..\..\src\mlm_mailbox_simple.c">
<CompileAs>CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\..\src\zbits.c">
<CompileAs>CompileAsCpp</CompileAs>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\malamute.rc" />
Expand Down
6 changes: 3 additions & 3 deletions builds/msvc/vs2013/malamute/malamute.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\..\..\src\zbits.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\mlm_proto.c">
<Filter>src</Filter>
</ClCompile>
Expand All @@ -28,6 +25,9 @@
<ClCompile Include="..\..\..\..\src\mlm_mailbox_simple.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\zbits.c">
<Filter>src</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\include\mlm_library.h">
Expand Down
11 changes: 9 additions & 2 deletions builds/qt-android/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@ android_build_opts

# Use a temporary build directory
cache="/tmp/android_build/${TOOLCHAIN_NAME}"
rm -rf "${cache}"
mkdir -p "${cache}"

# Check for environment variable to clear the prefix and do a clean build
if [[ $ANDROID_BUILD_CLEAN ]]; then
echo "Doing a clean build (removing previous build and depedencies)..."
rm -rf "${ANDROID_BUILD_PREFIX}"/*
fi

##
# Make sure zmq is built and copy the prefix

Expand All @@ -35,7 +42,7 @@ mkdir -p "${cache}"
exit 1
fi

(${ZMQ_ROOT}/builds/qt-android/build.sh) || exit 1
(bash ${ZMQ_ROOT}/builds/qt-android/build.sh) || exit 1
UPSTREAM_PREFIX=${ZMQ_ROOT}/builds/qt-android/prefix/${TOOLCHAIN_NAME}
cp -r ${UPSTREAM_PREFIX}/* ${ANDROID_BUILD_PREFIX}
}
Expand All @@ -53,7 +60,7 @@ mkdir -p "${cache}"
exit 1
fi

(${CZMQ_ROOT}/builds/qt-android/build.sh) || exit 1
(bash ${CZMQ_ROOT}/builds/qt-android/build.sh) || exit 1
UPSTREAM_PREFIX=${CZMQ_ROOT}/builds/qt-android/prefix/${TOOLCHAIN_NAME}
cp -r ${UPSTREAM_PREFIX}/* ${ANDROID_BUILD_PREFIX}
}
Expand Down
Loading

0 comments on commit 9b754e0

Please sign in to comment.