summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8dfaf98)
raw | patch | inline | side by side (parent: 8dfaf98)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 5 Dec 2015 16:09:00 +0000 (17:09 +0100) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 5 Dec 2015 16:09:00 +0000 (17:09 +0100) |
Split build flags in _LDFLAGS and _LIBS
Keep existing CPPFLAGS and LDFLAGS set from the command line.
This ensures we will pick up libmosquitto when running
./configure CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib",
just like we do for other plugins.
Keep existing CPPFLAGS and LDFLAGS set from the command line.
This ensures we will pick up libmosquitto when running
./configure CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib",
just like we do for other plugins.
configure.ac | patch | blob | history | |
src/Makefile.am | patch | blob | history |
diff --git a/configure.ac b/configure.ac
index 2a9b84a9a5e13ed4daa19cdcfef5c4484c1de1fe..0328b3bccbf1d78d8597897bfd455604f38c9e87 100644 (file)
--- a/configure.ac
+++ b/configure.ac
# --with-libmosquitto {{{
with_libmosquitto_cppflags=""
-with_libmosquitto_libs="-lmosquitto"
+with_libmosquitto_ldflags=""
AC_ARG_WITH(libmosquitto, [AS_HELP_STRING([--with-libmosquitto@<:@=PREFIX@:>@], [Path to libmosquitto.])],
[
if test "x$withval" != "xno" && test "x$withval" != "xyes"
then
with_libmosquitto_cppflags="-I$withval/include"
- with_libmosquitto_libs="-L$withval/lib -lmosquitto"
+ with_libmosquitto_ldflags="-L$withval/lib"
with_libmosquitto="yes"
else
with_libmosquitto="$withval"
@@ -2686,7 +2686,7 @@ AC_ARG_WITH(libmosquitto, [AS_HELP_STRING([--with-libmosquitto@<:@=PREFIX@:>@],
if test "x$with_libmosquitto" = "xyes"
then
SAVE_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$with_libmosquitto_cppflags"
+ CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
AC_CHECK_HEADERS(mosquitto.h, [with_libmosquitto="yes"], [with_libmosquitto="no (mosquitto.h not found)"])
then
SAVE_LDFLAGS="$LDFLAGS"
SAVE_CPPFLAGS="$CPPFLAGS"
- LDFLAGS="$with_libmosquitto_libs"
- CPPFLAGS="$with_libmosquitto_cppflags"
+ LDFLAGS="$LDFLAGS $with_libmosquitto_ldflags"
+ CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
AC_CHECK_LIB(mosquitto, mosquitto_connect, [with_libmosquitto="yes"], [with_libmosquitto="no (libmosquitto not found)"])
if test "x$with_libmosquitto" = "xyes"
then
BUILD_WITH_LIBMOSQUITTO_CPPFLAGS="$with_libmosquitto_cppflags"
- BUILD_WITH_LIBMOSQUITTO_LIBS="$with_libmosquitto_libs"
+ BUILD_WITH_LIBMOSQUITTO_LDFLAGS="$with_libmosquitto_ldflags"
+ BUILD_WITH_LIBMOSQUITTO_LIBS="-lmosquitto"
AC_SUBST(BUILD_WITH_LIBMOSQUITTO_CPPFLAGS)
+ AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LDFLAGS)
AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LIBS)
fi
# }}}
diff --git a/src/Makefile.am b/src/Makefile.am
index 6267a3108975765f52992fb194e9818acc1735c5..9c1e32fbac32e6134437a337a7e50b0d0e9b0480 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
if BUILD_PLUGIN_MQTT
pkglib_LTLIBRARIES += mqtt.la
mqtt_la_SOURCES = mqtt.c
-mqtt_la_LDFLAGS = $(PLUGIN_LDFLAGS)
mqtt_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBMOSQUITTO_CPPFLAGS)
+mqtt_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBMOSQUITTO_LDFLAGS)
mqtt_la_LIBADD = $(BUILD_WITH_LIBMOSQUITTO_LIBS)
endif