Skip to content

Commit

Permalink
Problem: malamute is no longer a dependency
Browse files Browse the repository at this point in the history
Solution: drop it from project.xml
  • Loading branch information
Michal Vyskocil committed Feb 7, 2017
1 parent 99b830e commit e7ab058
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 150 deletions.
16 changes: 0 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,6 @@ ELSE (CZMQ_FOUND)
message( FATAL_ERROR "czmq not found." )
ENDIF (CZMQ_FOUND)

########################################################################
# MALAMUTE dependency
########################################################################
find_package(malamute REQUIRED)
IF (MALAMUTE_FOUND)
include_directories(${MALAMUTE_INCLUDE_DIRS})
list(APPEND MORE_LIBRARIES ${MALAMUTE_LIBRARIES})
set(pkg_config_libs_private "${pkg_config_libs_private} -lmlm")
ELSE (MALAMUTE_FOUND)
message( FATAL_ERROR "malamute not found." )
ENDIF (MALAMUTE_FOUND)

########################################################################
# MOSQUITTO dependency
########################################################################
Expand All @@ -137,7 +125,6 @@ set (zmsq_headers

IF (ENABLE_DRAFTS)
list(APPEND zmsq_headers
include/zmosq_server.h
include/zmosq_client.h
include/zmosq_server.h
)
Expand All @@ -155,7 +142,6 @@ set (zmsq_sources

IF (ENABLE_DRAFTS)
list (APPEND zmsq_sources
src/zmosq_server.c
src/zmosq_client.c
src/zmosq_server.c
)
Expand Down Expand Up @@ -223,7 +209,6 @@ target_link_libraries(
zmsq
${LIBZMQ_LIBRARIES}
${CZMQ_LIBRARIES}
${MALAMUTE_LIBRARIES}
${MOSQUITTO_LIBRARIES}
${OPTIONAL_LIBRARIES}
)
Expand All @@ -246,7 +231,6 @@ set(TEST_CLASSES

IF (ENABLE_DRAFTS)
list (APPEND TEST_CLASSES
zmosq_server
zmosq_client
zmosq_server
)
Expand Down
4 changes: 1 addition & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ AM_CFLAGS = \
AM_CPPFLAGS = \
${libzmq_CFLAGS} \
${czmq_CFLAGS} \
${malamute_CFLAGS} \
${mosquitto_CFLAGS} \
-I$(srcdir)/include

project_libs = ${libzmq_LIBS} ${czmq_LIBS} ${malamute_LIBS} ${mosquitto_LIBS}
project_libs = ${libzmq_LIBS} ${czmq_LIBS} ${mosquitto_LIBS}

SUBDIRS = doc
DIST_SUBDIRS = doc
Expand All @@ -36,7 +35,6 @@ if ENABLE_DIST_CMAKEFILES
EXTRA_DIST += \
Findlibzmq.cmake \
Findczmq.cmake \
Findmalamute.cmake \
Findmosquitto.cmake \
CMakeLists.txt
endif
Expand Down
27 changes: 0 additions & 27 deletions builds/cmake/ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,33 +103,6 @@ if ! ((command -v dpkg-query >/dev/null 2>&1 && dpkg-query --list libczmq-dev >/
$CI_TIME make install
cd "${BASE_PWD}"
fi
if ! ((command -v dpkg-query >/dev/null 2>&1 && dpkg-query --list libmlm-dev >/dev/null 2>&1) || \
(command -v brew >/dev/null 2>&1 && brew ls --versions malamute >/dev/null 2>&1)); then
$CI_TIME git clone --quiet --depth 1 https://github.com/zeromq/malamute.git malamute
BASE_PWD=${PWD}
cd malamute
CCACHE_BASEDIR=${PWD}
export CCACHE_BASEDIR
git --no-pager log --oneline -n1
if [ -e autogen.sh ]; then
$CI_TIME ./autogen.sh 2> /dev/null
fi
if [ -e buildconf ]; then
$CI_TIME ./buildconf 2> /dev/null
fi
if [ ! -e autogen.sh ] && [ ! -e buildconf ] && [ ! -e ./configure ] && [ -s ./configure.ac ]; then
$CI_TIME libtoolize --copy --force && \
$CI_TIME aclocal -I . && \
$CI_TIME autoheader && \
$CI_TIME automake --add-missing --copy && \
$CI_TIME autoconf || \
$CI_TIME autoreconf -fiv
fi
$CI_TIME ./configure "${CONFIG_OPTS[@]}"
$CI_TIME make -j4
$CI_TIME make install
cd "${BASE_PWD}"
fi

# Build and check this project
cd ../..
Expand Down
87 changes: 0 additions & 87 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -265,93 +265,6 @@ dnl END of PKG_CHECK_MODULES and/or direct tests for libczmq
dnl END of enabled attempts to search for libczmq


was_malamute_check_lib_detected=no

search_libmlm="yes"

AC_ARG_WITH([libmlm],
[
AS_HELP_STRING([--with-libmlm],
[yes or no. Optionally specify libmlm prefix (directory where its include/ and lib/ are located), but that is only used if pkgconfig metadata is not found first])
],
[
search_libmlm="yes"
],
[])
AS_CASE([x"${with_libmlm}"],
[xyes], [search_libmlm="yes"],
[xno], [search_libmlm="no"])

dnl We do not abort right now, because the maintainer/developer may have
dnl something particular in mind, e.g. to build just parts of a project.
AS_IF([test x"${search_libmlm}" = xno],
[AC_MSG_WARN([Required dependency on malamute was explicitly disabled during configuration by '--with-libmlm=no'; subsequent full build of zmosq may fail])])

AS_IF([test x"${search_libmlm}" = xyes], [
# Archive previously detected and supplied flags
PRE_SEARCH_CFLAGS="${CFLAGS}"
PRE_SEARCH_LIBS="${LIBS}"
found_pkgconfig=""
found_linkname=""
PKG_CHECK_MODULES([malamute], [libmlm >= 0.0.0],
[
PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE $malamute_LIBS"
was_malamute_check_lib_detected=pkgcfg
found_pkgconfig="libmlm"
],
[
AC_MSG_NOTICE([Package libmlm not found; falling back to defined compilability tests])
malamute_synthetic_cflags=""
malamute_synthetic_libs="-lmlm"
if test -n "${with_libmlm}" && test x"${with_libmlm}" != xyes && test x"${with_libmlm}" != xno; then
if test -r "${with_libmlm}/include/malamute.h"; then
malamute_synthetic_cflags="-I${with_libmlm}/include"
malamute_synthetic_libs="-L${with_libmlm}/lib -lmlm"
else
AC_MSG_ERROR([Header file ${with_libmlm}/include/malamute.h was not found. Please check libmlm prefix])
fi
else
AC_CHECK_HEADER([malamute.h], [],
AC_MSG_ERROR([Header file malamute.h was not found in default search paths])
)
fi
AC_CHECK_LIB([mlm], [mlm_server_test],
[
was_malamute_check_lib_detected=yes
PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE -lmlm"
found_linkname="mlm"
],
[AC_MSG_ERROR([cannot link with -lmlm, install libmlm])])
])
dnl END of PKG_CHECK_MODULES and/or direct tests for libmlm
AS_CASE(["x${was_malamute_check_lib_detected}"],
[xpkgcfg], [
AC_SUBST([pkgconfig_name_libmlm],[${found_pkgconfig}])
CFLAGS="${malamute_CFLAGS} ${CFLAGS}"
LIBS="${malamute_LIBS} ${LIBS}"
],
[xyes], [
AC_SUBST([pkgconfig_name_libmlm],[${found_linkname}])
CFLAGS="${malamute_synthetic_cflags} ${CFLAGS}"
LDFLAGS="${malamute_synthetic_libs} ${LDFLAGS}"
LIBS="${malamute_synthetic_libs} ${LIBS}"
AC_SUBST([malamute_CFLAGS],[${malamute_synthetic_cflags}])
AC_SUBST([malamute_LIBS],[${malamute_synthetic_libs}])
],
[xno], [
AC_SUBST([pkgconfig_name_libmlm],[libmlm])
AC_MSG_ERROR([Cannot find pkg-config metadata for libmlm 0.0.0 or higher])
])
])
dnl END of enabled attempts to search for libmlm


was_mosquitto_check_lib_detected=no

search_mosquitto="yes"
Expand Down
2 changes: 0 additions & 2 deletions doc/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
*.xml7

# Ignore the source doc texts generated from program sources
zmosq_server.txt
zmosq_server.doc
zmosq_client.txt
zmosq_client.doc
zmosq_server.txt
Expand Down
6 changes: 1 addition & 5 deletions doc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ all-local: doc
# Public programs ("main" tags in project.xml), auto-regenerated:
MAN1 =
# Public classes ("class" tags in project.xml), auto-regenerated:
MAN3 = zmosq_server.3 zmosq_client.3 zmosq_server.3
MAN3 = zmosq_client.3 zmosq_server.3
# Project overview, written by a human after initial skeleton:
# NOTE: stub doc/zmosq.adoc is generated by GSL from project.xml
# and then comitted to SCM and maintained manually to describe the
Expand Down Expand Up @@ -64,10 +64,6 @@ GENERATED_DOCS =
.txt.doc:
@true

GENERATED_DOCS += zmosq_server.txt zmosq_server.doc
zmosq_server.txt: $(top_srcdir)/src/zmosq_server.c
"$(srcdir)/mkman" "zmosq_server" "$(builddir)/zmosq_server.txt" "$(srcdir)/.."

GENERATED_DOCS += zmosq_client.txt zmosq_client.doc
zmosq_client.txt: $(top_srcdir)/src/zmosq_client.c
"$(srcdir)/mkman" "zmosq_client" "$(builddir)/zmosq_client.txt" "$(srcdir)/.."
Expand Down
6 changes: 2 additions & 4 deletions include/zmsq_library.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

// External dependencies
#include <czmq.h>
#include <malamute.h>
#include <mosquitto.h>

// ZMSQ version macros for compile-time API detection
Expand Down Expand Up @@ -67,16 +66,15 @@
// These classes are stable or legacy and built in all releases
// Draft classes are by default not built in stable releases
#ifdef ZMSQ_BUILD_DRAFT_API
typedef struct _zmosq_server_t zmosq_server_t;
#define ZMOSQ_SERVER_T_DEFINED
typedef struct _zmosq_client_t zmosq_client_t;
#define ZMOSQ_CLIENT_T_DEFINED
typedef struct _zmosq_server_t zmosq_server_t;
#define ZMOSQ_SERVER_T_DEFINED
#endif // ZMSQ_BUILD_DRAFT_API


// Public classes, each with its own header file
#ifdef ZMSQ_BUILD_DRAFT_API
#include "zmosq_server.h"
#include "zmosq_client.h"
#include "zmosq_server.h"
#endif // ZMSQ_BUILD_DRAFT_API
Expand Down
2 changes: 0 additions & 2 deletions project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
<include filename = "license.xml" />
<version major = "0" minor = "1" />
<use project = "czmq" />
<use project = "malamute" />
<use project = "mosquitto" test="mosquitto_lib_cleanup"/>

<class name = "zmosq_server">Zmosq actor</class>
<actor name = "zmosq_server">Zmosq actor</actor>
<class name = "zmosq_client">Zmosq client</class>

Expand Down
2 changes: 1 addition & 1 deletion src/libzmsq.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Name: libzmsq
Description: ZeroMQ/Malamute/Mosquitto (MQQT) proxy
Version: @VERSION@

Requires:@pkgconfig_name_libzmq@ @pkgconfig_name_libczmq@ @pkgconfig_name_libmlm@ @pkgconfig_name_mosquitto@
Requires:@pkgconfig_name_libzmq@ @pkgconfig_name_libczmq@ @pkgconfig_name_mosquitto@

Libs: -L${libdir} -lzmsq
Cflags: -I${includedir} @pkg_config_defines@
Expand Down
5 changes: 2 additions & 3 deletions src/zmsq_selftest.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ static test_item_t
all_tests [] = {
#ifdef ZMSQ_BUILD_DRAFT_API
// Tests for draft public classes:
{ "zmosq_server", zmosq_server_test },
{ "zmosq_client", zmosq_client_test },
{ "zmosq_server", zmosq_server_test },
#endif // ZMSQ_BUILD_DRAFT_API
#ifdef ZMSQ_BUILD_DRAFT_API
{ "private_classes", zmsq_private_selftest },
Expand Down Expand Up @@ -92,14 +92,13 @@ main (int argc, char **argv)
else
if (streq (argv [argn], "--number")
|| streq (argv [argn], "-n")) {
puts ("3");
puts ("2");
return 0;
}
else
if (streq (argv [argn], "--list")
|| streq (argv [argn], "-l")) {
puts ("Available tests:");
puts (" zmosq_server\t\t- draft");
puts (" zmosq_client\t\t- draft");
puts (" zmosq_server\t\t- draft");
puts (" private_classes\t- draft");
Expand Down

0 comments on commit e7ab058

Please sign in to comment.