From: Ruben Kerkhof Date: Fri, 11 Dec 2015 16:59:21 +0000 (+0100) Subject: onewire plugin: fixup flag handling X-Git-Tag: collectd-5.6.0~504^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1a54c427c0b375c8294a8c00e512bf54e35dc558;p=collectd.git onewire plugin: fixup flag handling Split flags in _LDFLAGS and _LIBS Allows the plugin to be detected and to be build on FreeBSD --- diff --git a/configure.ac b/configure.ac index c4483792..655d6d8f 100644 --- a/configure.ac +++ b/configure.ac @@ -3235,13 +3235,13 @@ fi # --with-libowcapi {{{ with_libowcapi_cppflags="" -with_libowcapi_libs="-lowcapi" +with_libowcapi_ldflags="" AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])], [ if test "x$withval" != "xno" && test "x$withval" != "xyes" then with_libowcapi_cppflags="-I$withval/include" - with_libowcapi_libs="-L$withval/lib -lowcapi" + with_libowcapi_ldflags="-L$withval/lib" with_libowcapi="yes" else with_libowcapi="$withval" @@ -3253,7 +3253,7 @@ AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path if test "x$with_libowcapi" = "xyes" then SAVE_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$with_libowcapi_cppflags" + CPPFLAGS="$CPPFLAGS $with_libowcapi_cppflags" AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"]) @@ -3263,7 +3263,7 @@ if test "x$with_libowcapi" = "xyes" then SAVE_LDFLAGS="$LDFLAGS" SAVE_CPPFLAGS="$CPPFLAGS" - LDFLAGS="$with_libowcapi_libs" + LDFLAGS="$LDFLAGS $with_libowcapi_ldflags" CPPFLAGS="$with_libowcapi_cppflags" AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"]) @@ -3274,8 +3274,10 @@ fi if test "x$with_libowcapi" = "xyes" then BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags" - BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs" + BUILD_WITH_LIBOWCAPI_LDFLAGS="$with_libowcapi_ldflags" + BUILD_WITH_LIBOWCAPI_LIBS="-lowcapi" AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS) + AC_SUBST(BUILD_WITH_LIBOWCAPI_LDFLAGS) AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS) fi # }}} diff --git a/src/Makefile.am b/src/Makefile.am index 9c1e32fb..1996bed6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -784,7 +784,7 @@ onewire_la_SOURCES = onewire.c onewire_la_CFLAGS = $(AM_CFLAGS) onewire_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBOWCAPI_CPPFLAGS) onewire_la_LIBADD = $(BUILD_WITH_LIBOWCAPI_LIBS) -onewire_la_LDFLAGS = $(PLUGIN_LDFLAGS) +onewire_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBOWCAPI_LDFLAGS) endif if BUILD_PLUGIN_OPENLDAP