Completely rework configure.ac
[babeltrace.git] / cli / Makefile.am
index 5ceb499e902fa8d4ab68ab61dd7aa0933270ea2a..3cd2a1168bf9c6aa760be97bb5d559672170d71a 100644 (file)
@@ -11,9 +11,7 @@ else
 IN_TREE_PLUGIN_PATH = $(PLUGINS_PATH)/ctf:$(PLUGINS_PATH)/text:$(PLUGINS_PATH)/utils$(LTTNG_UTILS_PLUGIN_PATH)
 endif
 
-AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include \
-               '-DCONFIG_IN_TREE_PLUGIN_PATH="$(IN_TREE_PLUGIN_PATH)"'
-AM_LDFLAGS = -lpopt
+AM_CPPFLAGS += '-DCONFIG_IN_TREE_PLUGIN_PATH="$(IN_TREE_PLUGIN_PATH)"'
 
 bin_PROGRAMS = babeltrace.bin babeltrace-log.bin
 noinst_PROGRAMS = babeltrace babeltrace-log
@@ -36,7 +34,7 @@ babeltrace_bin_SOURCES = \
 babeltrace_bin_LDFLAGS = $(LD_NO_AS_NEEDED)
 
 # Add all the convenience libraries used by Babeltrace plugins and the
-# library. They will be used when embedding plugins (BUILT_IN_PLUGINS),
+# library. They will be used when embedding plugins (--enable-built-in-plugins),
 # otherwise we're looking after multiple definitions of the same symbols if
 # a plugin's archive (.a) includes the convenience library because
 # we're using --whole-archive below (needed to make sure the linker does
@@ -47,9 +45,10 @@ babeltrace_bin_LDADD = \
        $(top_builddir)/compat/libcompat.la \
        $(top_builddir)/common/libbabeltrace-common.la \
        $(top_builddir)/logging/libbabeltrace-logging.la \
-       $(top_builddir)/plugins/libctfcopytrace/libctfcopytrace.la
+       $(top_builddir)/plugins/libctfcopytrace/libctfcopytrace.la \
+       $(POPT_LIBS)
 
-if BUILT_IN_PLUGINS
+if ENABLE_BUILT_IN_PLUGINS
 # Takes a plugin name and outputs the needed LDFLAGS to embed it.
 #
 # The --whole-archive option is important here. From the GNU linker's
@@ -77,7 +76,7 @@ endif
 endif
 
 if BABELTRACE_BUILD_WITH_MINGW
-babeltrace_bin_LDADD += -lws2_32 -lrpcrt4 -lintl -liconv -lole32 -lpopt -lpthread
+babeltrace_bin_LDADD += -lws2_32 -lrpcrt4 -lintl -liconv -lole32 -lpthread
 endif
 
 # Only used for in-tree execution and tests
@@ -88,13 +87,12 @@ babeltrace_CFLAGS = $(AM_CFLAGS) -DBT_SET_DEFAULT_IN_TREE_CONFIGURATION
 
 # babeltrace-log rules and config below
 babeltrace_log_bin_SOURCES = babeltrace-log.c
-babeltrace_log_bin_LDADD = $(top_builddir)/compat/libcompat.la
+babeltrace_log_bin_LDADD = \
+       $(top_builddir)/compat/libcompat.la \
+       $(POPT_LIBS)
 babeltrace_log_bin_CFLAGS = $(AM_CFLAGS) '-DBT_CLI_PATH="$(abs_top_builddir)/cli/babeltrace$(EXEEXT)"'
 
-if BABELTRACE_BUILD_WITH_MINGW
-babeltrace_log_bin_LDADD += -lpopt
-endif
-
+# Only used for in-tree execution and tests
 babeltrace_log_SOURCES = $(babeltrace_log_bin_SOURCES)
 babeltrace_log_LDADD =         $(babeltrace_log_bin_LDADD)
 babeltrace_log_CFLAGS =        $(AM_CFLAGS) '-DBT_CLI_PATH="$(bindir)/babeltrace$(EXEEXT)"'
This page took 0.025433 seconds and 4 git commands to generate.