Skip to content

Commit e483aeb

Browse files
committed
Issue #58: FileMQ uses deprecated CZMQ API's
Problem: FileMQ is way out of date and is using a lot of deprecated CZMQ API's. The original FileMQ was also the basis for the zproto and zproject projects. Solution: Recreate FileMQ based on the zproto and zproject.
1 parent 482797b commit e483aeb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+7972
-9432
lines changed

.gitignore

+68-25
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,47 @@
1-
INSTALL
1+
# Object files
2+
*.o
3+
*.ko
4+
*.obj
5+
*.elf
6+
7+
# Precompiled Headers
8+
*.gch
9+
*.pch
10+
11+
# Libraries
12+
*.lib
13+
*.a
14+
*.la
15+
*.lo
16+
*.pc
17+
18+
# Shared objects (inc. Windows DLLs)
19+
*.dll
20+
*.so
21+
*.so.*
22+
*.dylib
23+
24+
# Executables
25+
filemq_selftest
26+
filemq_server
27+
filemq_client
28+
*.exe
29+
*.out
30+
*.app
31+
*.i*86
32+
*.x86_64
33+
*.hex
34+
35+
# Man pages
36+
doc/*.1
37+
doc/*.3
38+
doc/*.7
39+
40+
# autoconf files
41+
.deps
42+
.libs
43+
*.log
44+
*.trs
245
Makefile
346
Makefile.in
447
aclocal.m4
@@ -7,34 +50,34 @@ config.log
750
config.status
851
config/
952
configure
10-
doc/Makefile
11-
doc/Makefile.in
12-
doc/filemq.1
13-
doc/*.3
1453
libtool
15-
src/.deps/
16-
src/Makefile
17-
src/Makefile.in
18-
src/libfmq.pc
1954
src/platform.h
2055
src/platform.h.in
2156
src/platform.h.in~
2257
src/stamp-h1
23-
.libs/
24-
*.o
25-
*.lo
26-
*.la
27-
*.lst
28-
track
29-
core
30-
fmq_selftest
31-
src/fmqroot/send/*
32-
src/fmqroot/recv/*
33-
src/fmqroot/logs/*
34-
.cache
35-
mymusic
36-
testit
37-
src/fmq_selftest.log
38-
src/fmq_selftest.trs
3958
src/test-suite.log
59+
src/.dirstamp
60+
61+
# qt-android build results
62+
builds/qt-android/prefix
63+
64+
# Android - generated directories
65+
src/app/bin/
66+
src/app/gen/
67+
src/app/obj/
68+
src/app/local.properties
69+
70+
# Android -dependencies
71+
builds/android/libsodium
72+
builds/android/libzmq
73+
builds/android/czmq
74+
builds/android/e2fsprogs
75+
builds/android/zyre
76+
src/app/jni/output
4077

78+
# Additionals
79+
*.swp
80+
*.dirstamp
81+
*.xml.swp
82+
*.c.swp
83+
*.h.swp

.travis.yml

+6-33
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,9 @@
1-
# FileMQ
2-
1+
# Travis CI script
32
language: c
43

5-
# Build required ZeroMQ projects first
6-
before_script:
7-
8-
# libsodium
9-
- git clone git://github.com/jedisct1/libsodium.git
10-
- cd libsodium
11-
- ./autogen.sh
12-
- ./configure && make check
13-
- sudo make install
14-
- sudo ldconfig
15-
- cd ..
16-
17-
# libzmq
18-
- git clone git://github.com/zeromq/libzmq.git
19-
- cd libzmq
20-
- ./autogen.sh
21-
- ./configure && make check
22-
- sudo make install
23-
- sudo ldconfig
24-
- cd ..
25-
26-
# CZMQ
27-
- git clone git://github.com/zeromq/czmq.git
28-
- cd czmq
29-
- ./autogen.sh
30-
- ./configure && make check
31-
- sudo make install
32-
- sudo ldconfig
33-
- cd ..
4+
env:
5+
- BUILD_TYPE=default
6+
- BUILD_TYPE=qt-android
347

35-
# Build and check libfmq
36-
script: ./autogen.sh && ./configure && make && make check
8+
# Build and check this project according to the BUILD_TYPE
9+
script: ./ci_build.sh

CMakeLists.txt

+157
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
################################################################################
2+
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
3+
# Please refer to the README for information about making permanent changes. #
4+
################################################################################
5+
6+
########################################################################
7+
# Project setup
8+
########################################################################
9+
cmake_minimum_required(VERSION 2.8)
10+
project(filemq)
11+
enable_language(C)
12+
enable_testing()
13+
14+
set(SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
15+
set(BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
16+
17+
########################################################################
18+
# determine version
19+
########################################################################
20+
foreach(which MAJOR MINOR PATCH)
21+
file(STRINGS "${SOURCE_DIR}/include/filemq_library.h" FILEMQ_VERSION_STRING REGEX "#define FILEMQ_VERSION_${which}")
22+
string(REGEX MATCH "#define FILEMQ_VERSION_${which} ([0-9_]+)" FILEMQ_REGEX_MATCH "${FILEMQ_VERSION_STRING}")
23+
if (NOT FILEMQ_REGEX_MATCH)
24+
message(FATAL_ERROR "failed to parse FILEMQ_VERSION_${which} from filemq.h")
25+
endif()
26+
set(FILEMQ_${which}_VERSION ${CMAKE_MATCH_1})
27+
endforeach(which)
28+
29+
set(FILEMQ_VERSION ${FILEMQ_MAJOR_VERSION}.${FILEMQ_MINOR_VERSION}.${FILEMQ_PATCH_VERSION})
30+
31+
########################################################################
32+
# platform.h
33+
########################################################################
34+
include(CheckIncludeFile)
35+
CHECK_INCLUDE_FILE("linux/wireless.h" HAVE_LINUX_WIRELESS_H)
36+
CHECK_INCLUDE_FILE("net/if_media.h" HAVE_NET_IF_MEDIA_H)
37+
38+
include(CheckFunctionExists)
39+
CHECK_FUNCTION_EXISTS("getifaddrs" HAVE_GETIFADDRS)
40+
CHECK_FUNCTION_EXISTS("freeifaddrs" HAVE_FREEIFADDRS)
41+
42+
include(CheckIncludeFiles)
43+
check_include_files("sys/socket.h;net/if.h" HAVE_NET_IF_H)
44+
if (NOT HAVE_NET_IF_H)
45+
CHECK_INCLUDE_FILE("net/if.h" HAVE_NET_IF_H)
46+
endif()
47+
48+
file(WRITE ${BINARY_DIR}/platform.h.in "
49+
#cmakedefine HAVE_LINUX_WIRELESS_H
50+
#cmakedefine HAVE_NET_IF_H
51+
#cmakedefine HAVE_NET_IF_MEDIA_H
52+
#cmakedefine HAVE_GETIFADDRS
53+
#cmakedefine HAVE_FREEIFADDRS
54+
")
55+
56+
configure_file(${BINARY_DIR}/platform.h.in ${BINARY_DIR}/platform.h)
57+
58+
#The MSVC C compiler is too out of date,
59+
#so the sources have to be compiled as c++
60+
if (MSVC)
61+
enable_language(CXX)
62+
file(GLOB sources ${SOURCE_DIR}/src/*.c)
63+
set_source_files_properties(${sources} PROPERTIES LANGUAGE CXX)
64+
set(MORE_LIBRARIES ws2_32 Rpcrt4 Iphlpapi)
65+
endif()
66+
67+
# required libraries for mingw
68+
if (MINGW)
69+
set(MORE_LIBRARIES -lws2_32 -lrpcrt4 -liphlpapi)
70+
endif()
71+
72+
73+
list(APPEND CMAKE_MODULE_PATH ${SOURCE_DIR})
74+
75+
########################################################################
76+
# ZMQ dependency
77+
########################################################################
78+
find_package(ZeroMQ REQUIRED)
79+
include_directories(${ZEROMQ_INCLUDE_DIRS})
80+
list(APPEND MORE_LIBRARIES ${ZEROMQ_LIBRARIES})
81+
82+
########################################################################
83+
# CZMQ dependency
84+
########################################################################
85+
find_package(CZMQ REQUIRED)
86+
include_directories(${CZMQ_INCLUDE_DIRS})
87+
list(APPEND MORE_LIBRARIES ${CZMQ_LIBRARIES})
88+
89+
########################################################################
90+
# includes
91+
########################################################################
92+
set (filemq_headers
93+
include/filemq_library.h
94+
include/filemq.h
95+
include/fmq_msg.h
96+
include/fmq_server.h
97+
include/fmq_client.h
98+
)
99+
source_group ("Header Files" FILES ${filemq_headers})
100+
install(FILES ${filemq_headers} DESTINATION include)
101+
102+
########################################################################
103+
# library
104+
########################################################################
105+
include_directories(${BINARY_DIR})
106+
include_directories(${SOURCE_DIR}/include)
107+
set (filemq_sources
108+
src/fmq_msg.c
109+
src/fmq_server.c
110+
src/fmq_client.c
111+
)
112+
source_group ("Source Files" FILES ${filemq_sources})
113+
add_library(filemq SHARED ${filemq_sources})
114+
set_target_properties(filemq PROPERTIES DEFINE_SYMBOL "LIBFILEMQ_EXPORTS")
115+
target_link_libraries(filemq ${ZEROMQ_LIBRARIES} ${MORE_LIBRARIES})
116+
117+
install(TARGETS filemq
118+
LIBRARY DESTINATION lib${LIB_SUFFIX} # .so file
119+
ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file
120+
RUNTIME DESTINATION bin # .dll file
121+
)
122+
123+
########################################################################
124+
# pkgconfig
125+
########################################################################
126+
set(VERSION "${FILEMQ_VERSION}")
127+
set(prefix "${CMAKE_INSTALL_PREFIX}")
128+
set(exec_prefix "\${prefix}")
129+
set(libdir "\${prefix}/lib${LIB_SUFFIX}")
130+
set(includedir "\${prefix}/include")
131+
configure_file(
132+
${SOURCE_DIR}/src/libfilemq.pc.in
133+
${BINARY_DIR}/libfilemq.pc
134+
@ONLY)
135+
136+
install(
137+
FILES ${BINARY_DIR}/libfilemq.pc
138+
DESTINATION lib${LIB_SUFFIX}/pkgconfig
139+
)
140+
141+
########################################################################
142+
# tests
143+
########################################################################
144+
add_executable(filemq_selftest ${SOURCE_DIR}/src/filemq_selftest.c)
145+
target_link_libraries(filemq_selftest filemq ${ZEROMQ_LIBRARIES})
146+
add_test(filemq_selftest filemq_selftest)
147+
148+
########################################################################
149+
# summary
150+
########################################################################
151+
message(STATUS "version: ${FILEMQ_VERSION}")
152+
message(STATUS "install: ${CMAKE_INSTALL_PREFIX}")
153+
154+
################################################################################
155+
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
156+
# Please refer to the README for information about making permanent changes. #
157+
################################################################################

0 commit comments

Comments
 (0)