summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9242c5d)
raw | patch | inline | side by side (parent: 9242c5d)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 22 Apr 2007 13:48:20 +0000 (15:48 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Mon, 23 Apr 2007 13:40:56 +0000 (15:40 +0200) |
There is no point in linking against liboconfig dynamically if it is only used
in one place.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
in one place.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
configure.in | patch | blob | history | |
src/Makefile.am | patch | blob | history | |
src/liboconfig/Makefile.am | patch | blob | history |
diff --git a/configure.in b/configure.in
index 2cb067b7c6ddabd679022956c9e084455eb6f231..74d15432da4f8c4ef8683b44c485b8bc1805b82f 100644 (file)
--- a/configure.in
+++ b/configure.in
[Wether or not to use mysql library])
AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
+with_own_liboconfig="no"
+liboconfig_LDFLAGS="$LDFLAGS"
+liboconfig_CPPFLAGS="$CPPFLAGS"
+AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
+[
+ if test "x$withval" != "xno" && test "x$withval" != "xyes"
+ then
+ if test -d "$withval/lib"
+ then
+ liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
+ fi
+ if test -d "$withval/include"
+ then
+ liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
+ fi
+ fi
+ if test "x$withval" = "xno"
+ then
+ AC_MSG_ERROR("liboconfig is required")
+ fi
+],
+[
+ with_liboconfig="yes"
+])
+
+save_LDFLAGS="$LDFLAGS"
+save_CPPFLAGS="$CPPFLAGS"
+LDFLAGS="$liboconfig_LDFLAGS"
+CPPFLAGS="$liboconfig_CPPFLAGS"
+AC_CHECK_LIB(oconfig, oconfig_parse_fh,
+[
+ with_liboconfig="yes"
+ with_own_liboconfig="no"
+],
+[
+ with_liboconfig="yes"
+ with_own_liboconfig="yes"
+ LDFLAGS="$save_LDFLAGS"
+ CPPFLAGS="$save_CPPFLAGS"
+])
+
+AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
+if test "x$with_own_liboconfig" = "xyes"
+then
+ with_liboconfig="yes (shipped version)"
+fi
+
#with_liboping="yes"
with_own_liboping="no"
liboping_LDFLAGS="$LDFLAGS"
libiptc . . . . . . $with_libiptc
libkstat . . . . . $with_kstat
libmysql . . . . . $with_libmysql
+ liboconfig . . . . $with_liboconfig
liboping . . . . . $with_liboping
libpcap . . . . . . $with_libpcap
libperl . . . . . . $with_libperl
diff --git a/src/Makefile.am b/src/Makefile.am
index a230283277665bda2465ad9133860aa8ca262f9a..bbbd8dc62223b5446528d7b9f470d4fdb1d8d275 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
-SUBDIRS = liboconfig
+SUBDIRS =
+if BUILD_WITH_OWN_LIBOCONFIG
+SUBDIRS += liboconfig
+endif
if BUILD_WITH_OWN_LIBOPING
SUBDIRS += liboping
endif
endif
-collectd_LDADD = $(LIBLTDL) liboconfig/liboconfig.la "-dlopen" self
-collectd_DEPENDENCIES = $(LIBLTDL) liboconfig/liboconfig.la
+collectd_LDADD =
+collectd_DEPENDENCIES =
+if BUILD_WITH_OWN_LIBOCONFIG
+collectd_LDADD += $(LIBLTDL) liboconfig/liboconfig.la
+collectd_DEPENDENCIES += $(LIBLTDL) liboconfig/liboconfig.la
+else
+collectd_LDFLAGS += -loconfig
+endif
collectd_nagios_SOURCES = collectd-nagios.c
collectd_nagios_LDFLAGS =
index d21de47db7967a214d283665c0f4ac5121cfeda4..f3e7657a82fdd47b7e2235cdaf2010e8ecd1c81d 100644 (file)
CLEANFILES = parser.[ch] scanner.c
AM_YFLAGS = -d
-include_HEADERS = oconfig.h
-lib_LTLIBRARIES = liboconfig.la
+noinst_LTLIBRARIES = liboconfig.la
-liboconfig_la_LDFLAGS = -version-info 0:0:0 $(LEXLIB)
+liboconfig_la_LDFLAGS = -avoid-version $(LEXLIB)
liboconfig_la_SOURCES = oconfig.c oconfig.h aux_types.h scanner.l parser.y