diff options
-rw-r--r-- | Makefile.am | 12 | ||||
-rw-r--r-- | client/Makefile.am | 8 | ||||
-rw-r--r-- | configure.ac | 97 | ||||
-rw-r--r-- | data/Makefile.am | 13 | ||||
-rw-r--r-- | data/tests/Makefile.am | 2 |
5 files changed, 82 insertions, 50 deletions
diff --git a/Makefile.am b/Makefile.am index de6d6a6..04084a8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,12 +2,19 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = \ libappstream-glib \ - libappstream-builder \ - client \ data \ docs \ po +if HAVE_BUILDER +SUBDIRS += \ + libappstream-builder +endif + +# depends on libappstream-builder +SUBDIRS += \ + client + DISTCLEANFILES = \ appstream-glib-*.tar.xz @@ -67,6 +74,7 @@ ChangeLog: DISTCHECK_CONFIGURE_FLAGS = \ --enable-dep11 \ + --enable-builder \ --with-bashcompletiondir=/${prefix}/share/bash-completion/completions .PHONY: ChangeLog diff --git a/client/Makefile.am b/client/Makefile.am index 1fc0568..417f89e 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -21,9 +21,13 @@ AS_BUILDER_LIBS = \ $(top_builddir)/libappstream-builder/libappstream-builder.la bin_PROGRAMS = \ - appstream-builder \ appstream-util +if HAVE_BUILDER +bin_PROGRAMS += \ + appstream-builder +endif + appstream_util_SOURCES = \ as-util.c appstream_util_LDADD = \ @@ -37,6 +41,7 @@ appstream_util_LDFLAGS = \ appstream_util_CFLAGS = \ $(WARNINGFLAGS_C) +if HAVE_BUILDER appstream_builder_SOURCES = \ as-builder.c appstream_builder_LDADD = \ @@ -50,6 +55,7 @@ appstream_builder_LDFLAGS = \ $(PIE_LDFLAGS) appstream_builder_CFLAGS = \ $(WARNINGFLAGS_C) +endif # ship this obsolete binary bin_PROGRAMS += \ diff --git a/configure.ac b/configure.ac index bacf261..c7d5dc6 100644 --- a/configure.ac +++ b/configure.ac @@ -126,63 +126,71 @@ PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16.1 gio-2.0 gobject-2.0 gthread-2.0 gio-u PKG_CHECK_MODULES(LIBARCHIVE, libarchive) PKG_CHECK_MODULES(SOUP, libsoup-2.4 >= 2.24) PKG_CHECK_MODULES(GDKPIXBUF, gdk-pixbuf-2.0 >= 2.14) -PKG_CHECK_MODULES(GTK, gtk+-3.0) -PKG_CHECK_MODULES(SQLITE, sqlite3) -PKG_CHECK_MODULES(FREETYPE, pango fontconfig freetype2 >= 9.10.0) -AC_PATH_PROG(GCAB, [gcab], [no]) -if test x$GCAB = "xno" ; then - AC_MSG_ERROR([gcab program not found]) -fi -# ostree (default enabled) -AC_ARG_ENABLE(ostree, AS_HELP_STRING([--disable-ostree],[Disable ostree support]), enable_ostree=$enableval) -if test x$enable_ostree != xno; then - PKG_CHECK_MODULES(OSTREE, ostree-1 >= 2015.1, HAVE_OSTREE="yes", HAVE_OSTREE="no") - if test "x$HAVE_OSTREE" = "xyes"; then - AC_DEFINE(HAVE_OSTREE, 1, [define if OSTREE is installed]) - else - if test x$enable_ostree = xyes; then - AC_MSG_ERROR([ostree enabled but not found]) - fi +# builder (default enabled) +AC_ARG_ENABLE(builder, AS_HELP_STRING([--disable-builder],[Disable AppStream builder support]), enable_builder=$enableval) +if test x$enable_builder != xno; then + PKG_CHECK_MODULES(GTK, gtk+-3.0) + PKG_CHECK_MODULES(SQLITE, sqlite3) + PKG_CHECK_MODULES(FREETYPE, pango fontconfig freetype2 >= 9.10.0) + AC_PATH_PROG(GCAB, [gcab], [no]) + if test x$GCAB = "xno" ; then + AC_MSG_ERROR([gcab program not found]) fi -else - HAVE_OSTREE=no -fi -AM_CONDITIONAL(HAVE_OSTREE, test x$HAVE_OSTREE = xyes) -# rpm (default enabled) -AC_ARG_ENABLE(rpm, AS_HELP_STRING([--disable-rpm],[Disable rpm support]), enable_rpm=$enableval) -if test x$enable_rpm != xno; then - PKG_CHECK_MODULES(RPM, rpm, HAVE_RPM="yes", HAVE_RPM="no") - if test "x$HAVE_RPM" = "xyes"; then - AC_DEFINE(HAVE_RPM, 1, [define if RPM is installed]) - else - if test x$enable_rpm = xyes; then - AC_MSG_ERROR([rpm enabled but not found]) + # ostree (default enabled) + AC_ARG_ENABLE(ostree, AS_HELP_STRING([--disable-ostree],[Disable ostree support]), enable_ostree=$enableval) + if test x$enable_ostree != xno; then + PKG_CHECK_MODULES(OSTREE, ostree-1 >= 2015.1, HAVE_OSTREE="yes", HAVE_OSTREE="no") + if test "x$HAVE_OSTREE" = "xyes"; then + AC_DEFINE(HAVE_OSTREE, 1, [define if OSTREE is installed]) + else + if test x$enable_ostree = xyes; then + AC_MSG_ERROR([ostree enabled but not found]) + fi fi + else + HAVE_OSTREE=no fi -else - HAVE_RPM=no -fi -AM_CONDITIONAL(HAVE_RPM, test x$HAVE_RPM = xyes) -# alpm (default disabled) -AC_ARG_ENABLE(alpm, AS_HELP_STRING([--enable-alpm],[Enable alpm support]), enable_alpm=yes, enable_alpm=no) -if test x$enable_alpm != xno; then - PKG_CHECK_MODULES(ALPM, libalpm, HAVE_ALPM="yes", HAVE_ALPM="no") - if test "x$HAVE_ALPM" = "xyes"; then - AC_DEFINE(HAVE_ALPM, 1, [define if ALPM is installed]) + # rpm (default enabled) + AC_ARG_ENABLE(rpm, AS_HELP_STRING([--disable-rpm],[Disable rpm support]), enable_rpm=$enableval) + if test x$enable_rpm != xno; then + PKG_CHECK_MODULES(RPM, rpm, HAVE_RPM="yes", HAVE_RPM="no") + if test "x$HAVE_RPM" = "xyes"; then + AC_DEFINE(HAVE_RPM, 1, [define if RPM is installed]) + else + if test x$enable_rpm = xyes; then + AC_MSG_ERROR([rpm enabled but not found]) + fi + fi else - if test x$enable_alpm = xyes; then - AC_MSG_ERROR([alpm enabled but not found]) + HAVE_RPM=no + fi + + # alpm (default disabled) + AC_ARG_ENABLE(alpm, AS_HELP_STRING([--enable-alpm],[Enable alpm support]), enable_alpm=yes, enable_alpm=no) + if test x$enable_alpm != xno; then + PKG_CHECK_MODULES(ALPM, libalpm, HAVE_ALPM="yes", HAVE_ALPM="no") + if test "x$HAVE_ALPM" = "xyes"; then + AC_DEFINE(HAVE_ALPM, 1, [define if ALPM is installed]) + else + if test x$enable_alpm = xyes; then + AC_MSG_ERROR([alpm enabled but not found]) + fi fi + else + HAVE_ALPM=no fi + enable_builder=yes else - HAVE_ALPM=no + enable_builder=no fi +AM_CONDITIONAL(HAVE_BUILDER, test x$enable_builder = xyes) +AM_CONDITIONAL(HAVE_RPM, test x$HAVE_RPM = xyes) +AM_CONDITIONAL(HAVE_OSTREE, test x$HAVE_OSTREE = xyes) AM_CONDITIONAL(HAVE_ALPM, test x$HAVE_ALPM = xyes) - # man files AC_ARG_ENABLE(man, [AS_HELP_STRING([--disable-man], @@ -245,5 +253,6 @@ AC_MSG_RESULT([ includedir: ${includedir} lib dir: ${libdir} DEP-11 support: ${enable_dep11} + Builder support: ${enable_builder} Bash completion dir: ${with_bashcompletiondir} ]) diff --git a/data/Makefile.am b/data/Makefile.am index 933a584..032c33c 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -13,9 +13,12 @@ dist_m4data_DATA += \ man_MANS = if ENABLE_MAN man_MANS += \ - appstream-util.1 \ + appstream-util.1 +if HAVE_BUILDER +man_MANS += \ appstream-builder.1 endif +endif XSLTPROC_FLAGS = \ --nonet \ @@ -27,11 +30,15 @@ XSLTPROC_FLAGS = \ appstream-util.1: appstream-util.xml $(AM_V_GEN) xsltproc $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< +if HAVE_BUILDER appstream-builder.1: appstream-builder.xml $(AM_V_GEN) xsltproc $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< - +endif bashcompletiondir = @bashcompletiondir@ -dist_bashcompletion_DATA = appstream-util appstream-builder +dist_bashcompletion_DATA = appstream-util +if HAVE_BUILDER +dist_bashcompletion_DATA += appstream-builder +endif EXTRA_DIST = \ appstream-util.xml \ diff --git a/data/tests/Makefile.am b/data/tests/Makefile.am index 05bbcac..dd0b263 100644 --- a/data/tests/Makefile.am +++ b/data/tests/Makefile.am @@ -52,6 +52,7 @@ test_files = \ usr/share/pixmaps/test.png \ validate.xml.gz +if HAVE_BUILDER colorhug-als-2.0.0.cab: $(srcdir)/firmware/2_0_0/firmware.* $(AM_V_GEN) touch -c -m -d"2000-01-01T00:00:00" $?; \ $(GCAB) --create --nopath $@ \ @@ -74,6 +75,7 @@ BUILT_SOURCES = \ colorhug-als-2.0.0.cab \ colorhug-als-2.0.1.cab \ colorhug-als-2.0.2.cab +endif CLEANFILES = \ $(BUILT_SOURCES) \ |