Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
configure.ac | 26 ++++++++++++++++++++++++++
doc/Makefile.am | 4 ++++
src/lib/Makefile.am | 8 ++++++--
src/plugins/Makefile.am | 36 ++++++++++++++++++++++++++----------
4 files changed, 62 insertions(+), 12 deletions(-)
diff --git a/configure.ac b/configure.ac
index 3efff1f..a9a1976 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,3 +1,20 @@
+# LIBREPORT_PARSE_WITH(PACKAGE)
+# -----------------------
+# For use in AC_ARG_WITH action-if-found, for packages default ON.
+# * Set NO_PACKAGE=YesPlease for --without-PACKAGE
+# * Unset NO_PACKAGE for --with-PACKAGE without ARG
+AC_DEFUN([LIBREPORT_PARSE_WITH],
+ [m4_pushdef([LIBREPORT_UC_PACKAGE], m4_toupper([$1]))dnl
+ if test "$withval" = "no"; then
+ NO_[]LIBREPORT_UC_PACKAGE=YesPlease
+ elif test "$withval" = "yes"; then
+ NO_[]LIBREPORT_UC_PACKAGE=
+ else
+ NO_[]LIBREPORT_UC_PACKAGE=
+ fi
+ m4_popdef([LIBREPORT_UC_PACKAGE])])
+
+
AC_INIT([libreport],
m4_esyscmd([cat ./libreport-version]),
[crash-catcher(a)fedorahosted.org])
@@ -66,6 +83,12 @@ AC_PATH_PROG([XMLTO], [xmlto], [no])
[exit 1]
[fi]
+AC_ARG_WITH(bugzilla,
+AS_HELP_STRING([--with-bugzilla],[use Bugzilla plugin (default is YES)]),
+LIBREPORT_PARSE_WITH([bugzilla]))
+
+if test -z "$NO_BUGZILLA"; then
+AM_CONDITIONAL(NO_BUGZILLA, true)
AC_PATH_PROG([XMLRPC], [xmlrpc-c-config], [no])
[if test "$XMLRPC" = "no"]
[then]
@@ -84,6 +107,9 @@ XMLRPC_CLIENT_CFLAGS=`xmlrpc-c-config client --cflags 2> /dev/null`
XMLRPC_CLIENT_LIBS=`xmlrpc-c-config client --libs 2> /dev/null`
AC_SUBST(XMLRPC_CLIENT_CFLAGS)
AC_SUBST(XMLRPC_CLIENT_LIBS)
+else
+AM_CONDITIONAL(NO_BUGZILLA, false)
+fi dnl end NO_BUGZILLA
AC_PATH_PROG([PYTHON], [python-config], [no])
[if test "$XMLTO" = "no"]
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 04e23c5..e63f18a 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -9,7 +9,11 @@ XMLTO_SILENT_0 = @echo " XMLTO " $@;
MAN1_TXT =
MAN1_TXT += report-cli.txt
+
+if NO_BUGZILLA
MAN1_TXT += reporter-bugzilla.txt
+endif
+
MAN1_TXT += reporter-kerneloops.txt
MAN1_TXT += reporter-mailx.txt
MAN1_TXT += reporter-print.txt
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 5befe7d..c2b8ec0 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -88,9 +88,13 @@ libabrt_dbus_la_LIBADD = \
$(GLIB_LIBS) \
$(DBUS_LIBS)
-libreport_web_la_SOURCES = \
+libreport_web_o =
+if NO_BUGZILLA
+libreport_web_o += abrt_xmlrpc.h abrt_xmlrpc.c
+endif
+
+libreport_web_la_SOURCES = $(libreport_web_o) \
curl.c \
- abrt_xmlrpc.h abrt_xmlrpc.c \
proxies.h proxies.c \
ureport.h json.c
libreport_web_la_CPPFLAGS = \
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index ea7d8b6..97bc365 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -1,7 +1,11 @@
pluginslibdir = $(PLUGINS_LIB_DIR)
-bin_PROGRAMS = \
- reporter-bugzilla \
+reporters_bin =
+if NO_BUGZILLA
+reporters_bin += reporter_bugzilla
+endif
+
+bin_PROGRAMS = $(reporters_bin) \
reporter-rhtsupport \
reporter-kerneloops \
reporter-upload \
@@ -14,16 +18,23 @@ pluginsconfdir = $(PLUGINS_CONF_DIR)
reportpluginsconfdir = $(REPORT_PLUGINS_CONF_DIR)
-dist_reportpluginsconf_DATA = \
- bugzilla.conf \
+reporters_plugin_conf =
+if NO_BUGZILLA
+reporters_plugin_conf += bugzilla.conf
+endif
+
+dist_reportpluginsconf_DATA = $(reporters_plugin_conf) \
rhtsupport.conf \
mailx.conf
eventsdir = $(EVENTS_DIR)
-dist_events_DATA = \
- report_Bugzilla.xml \
- report_Bugzilla.conf \
+reporters_events =
+if NO_BUGZILLA
+reporters_events += report_Bugzilla.xml report_Bugzilla.conf
+endif
+
+dist_events_DATA = $(reporters_events) \
report_Logger.conf \
report_Logger.xml \
report_Mailx.xml \
@@ -43,9 +54,12 @@ dist_eventsconf_DATA = \
rhtsupport_event.conf \
uploader_event.conf
-EXTRA_DIST = \
- report_Bugzilla.xml.in \
- report_Bugzilla.conf \
+reporters_extra_dist =
+if NO_BUGZILLA
+reporters_extra_dist += report_Bugzilla.xml.in report_Bugzilla.conf
+endif
+
+EXTRA_DIST = $(reporters_extra_dist) \
report_Logger.conf \
report_Logger.xml.in \
report_Mailx.xml.in \
@@ -57,6 +71,7 @@ EXTRA_DIST = \
$(DESTDIR)/$(DEBUG_INFO_DIR):
$(mkdir_p) '$@'
+if NO_BUGZILLA
reporter_bugzilla_SOURCES = \
reporter-bugzilla.c rhbz.c rhbz.h
reporter_bugzilla_CPPFLAGS = \
@@ -78,6 +93,7 @@ reporter_bugzilla_LDADD = \
$(XMLRPC_LIBS) $(XMLRPC_CLIENT_LIBS) \
../lib/libreport-web.la \
../lib/libreport.la
+endif
reporter_rhtsupport_SOURCES = \
abrt_rh_support.h abrt_rh_support.c \
--
1.7.12
Show replies by date