diff options
author | Gergely Risko <gergely+context@risko.hu> | 2009-06-23 18:01:26 +0300 |
---|---|---|
committer | Gergely Risko <gergely+context@risko.hu> | 2009-06-23 18:01:26 +0300 |
commit | 0d4919ec4de8dcc30135867828a202593883c161 (patch) | |
tree | b4b57068c571db2c65b191eecb0da0a58e347c97 | |
parent | 51bce7d9de06d9daec5249f630ea095e398fb7af (diff) |
Build cleanup continued.
The configure.ac is only about checking the configuration (build environment) now, not setting things up.
Every build setting is stored in Makefile.ams.
No coverage yet, but make check is supported.
33 files changed, 358 insertions, 537 deletions
@@ -150,6 +150,7 @@ tests/contextd_tests/hal_plugin.c /debian/contextkit-dbg /debian/contextkit-doc /debian/contextkit +/debian/contextd-tests /debian/fake-context-provider /debian/libcontextprovider-dev /debian/libcontextprovider-doc @@ -9,10 +9,8 @@ Build system ------------ We use the autotools in their 'foreign' strictness plus pkg-config. -We don't use qmake, even for Qt programs or libraries. Use pkg-config -when you use Qt libraries and write explicit rules for invocations of -tools like moc. See the ContextCommander for an elaborate example. -[Soon] +We don't use qmake, even for Qt programs or libraries. We have our +own solution for handling Qt things, documented in am/qt.am. Upstream and Packaging ---------------------- @@ -45,6 +43,17 @@ It's not yet totally clear how to cope with that: one approach is to have something like autotool's "missing", another might be to touch all 'interesting' files just before building. Let's see. +Anyway, you can disable generating of documentation by passing +--disable-doc to configure. + +Vala +---- + +Finding a good vala compiler is hard too, sometimes harder than +finding the documentation tools. So we distribute or vala generated C +sources too, the same timestamp issues applies, you can disable +compilation of .vala files with --disable-vala. + Environments ------------ @@ -200,6 +209,17 @@ Here is the general procedure: The "git-make-dist" script runs "make distdir" and creates a tag with the contents of the created directory. +Building a debian package +------------------------- + +After a git clone, you first have to build vala C sources and +documentation. If you have extracted a distribution tarball, then you +already have these files. Otherwise just do a ./configure, let's +double check that all of the documentation tools and the vala compiler +is found and make. After that you are ready to run +'dpkg-buildpackage -us -uc -rfakeroot -b' to get your shiny new debian +packages. + Making releases --------------- diff --git a/Makefile.am b/Makefile.am index 2c99123f..ea1c2fe4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,4 @@ -# DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc -# We exclude the caches from the uninstall check. -# fixme: add this back for make distcheck -# distuninstallcheck_listfiles = find . -type f -a ! -name '*.cdb' -print +DISTCHECK_CONFIGURE_FLAGS = --disable-doc --disable-vala AUTOMAKE_OPTIONS = subdir-objects ACLOCAL_AMFLAGS = -I m4 @@ -13,7 +10,6 @@ SUBDIRS = \ spec \ tests \ doc \ - tools \ python \ fake-provider \ vapi @@ -24,7 +20,3 @@ pkgconfig_DATA = contextprovider-1.0.pc EXTRA_DIST = contextprovider-1.0-uninstalled.pc DISTCLEANFILES = lcov.info lcov.html MAINTAINERCLEANFILES = INSTALL - -#if HAVE_COVERAGE -#include tools/lcov.am -#endif @@ -1,16 +1,7 @@ #!/bin/sh -e cd $(dirname $0) - -. tools/autogen-helpers.sh - -# fixme: can we move these four out of here? -version_check valac VALAC 'valac' 0.7.1 "http://vala-project.org" -version_check asciidoc ASCIIDOC 'asciidoc' 8.2.7 "http://www.methods.co.nz/asciidoc/" -existence_check dot -existence_check source-highlight - -autoreconf -i -f +autoreconf -i -f -v # Autoreconf overwrites INSTALL, but we have our own version of it. cp INSTALL.real INSTALL diff --git a/configure.ac b/configure.ac index 19248cfe..e1ade9d7 100644 --- a/configure.ac +++ b/configure.ac @@ -3,21 +3,20 @@ AC_INIT([ContextKit], [0.2.7~unreleased], [marius.vollmer@nokia.com], ContextKit AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([-Wall -Werror foreign dist-bzip2 tar-ustar 1.9]) -#AM_INIT_AUTOMAKE([-Wall -Wno-portability -Wno-override -Werror dist-bzip2 tar-ustar 1.9]) AC_CONFIG_MACRO_DIR([m4]) AC_PROG_CC +CFLAGS="$CXXFLAGS -Wall" AC_PROG_CXX +CXXFLAGS="$CXXFLAGS -Wall" AC_PROG_LIBTOOL AM_PATH_PYTHON -# todo?: add vala version check here -AC_PATH_PROG(VALAC, valac, valac) -AC_SUBST(VALAC) -# always build with warnings -CXXFLAGS="$CXXFLAGS -Wall" -CFLAGS="$CXXFLAGS -Wall" +# vala compiler (>= 0.7.1) +AC_FEATURE_DISABLEABLE([vala], [BUILD_VALA], [disable building of vala sources]) +AC_DISABLE_FEATURE_ON_PROG([Vala compiler], [BUILD_VALA], [VALAC], [valac], [0.7.1]) +AM_CONDITIONAL(CONTEXTKIT_BUILD_VALA, test "$missing_deps_BUILD_VALA" = "") # check for libraries PKG_CHECK_MODULES_SUBST([GLIB], [glib-2.0 >= 2.12.0]) @@ -32,65 +31,26 @@ PKG_CHECK_MODULES_SUBST([QtXml], [QtXml]) AC_PROG_QT_MOC AC_PROG_QT_UIC AC_PROG_QT_RCC -AC_CHECK_LIB([cdb], [cdb_make_start], [], [AC_MSG_ERROR([Can't find cdb library])]) - -# setup cflags and libs for different parts of the code -# fixme: why here? this belongs to the internals of that part of the code -> Makefile.am -CONTEXTPROVIDER_CFLAGS="$GLIB_CFLAGS $GOBJECT_CFLAGS $GDBUS_CFLAGS $GEE_CFLAGS" -CONTEXTPROVIDER_LIBS="$GLIB_LIBS $GOBJECT_LIBS $GDBUS_LIBS $GEE_LIBS" - -CONTEXTD_CFLAGS="$GLIB_CFLAGS $GOBJECT_CFLAGS $GDBUS_CFLAGS $GEE_CFLAGS $HAL_CFLAGS" -CONTEXTD_LIBS="$GLIB_LIBS $GOBJECT_LIBS $GDBUS_LIBS $GEE_LIBS $HAL_LIBS" - -AC_SUBST(CONTEXTD_CFLAGS) -AC_SUBST(CONTEXTD_LIBS) - -AC_SUBST(CONTEXTPROVIDER_CFLAGS) -AC_SUBST(CONTEXTPROVIDER_LIBS) - -dnl have_location=no -dnl PKG_CHECK_MODULES(LOCATION, liblocation, [have_location=yes], [have_location=no]) -dnl AC_SUBST(LOCATION_CFLAGS) -dnl AC_SUBST(LOCATION_LIBS) -dnl AM_CONDITIONAL(HAVE_LOCATION, test x$have_location = xyes) - -build_docs=yes - -dnl AC_ARG_ENABLE([doc], -dnl AS_HELP_STRING([--disable-doc], -dnl [disable building of documentation [[default=no]]]),, -dnl [enable_gtk_doc=no]) +AC_CHECK_LIB([cdb], [cdb_make_start], [CDB_LIBS=-lcdb], [AC_MSG_ERROR([Can't find cdb library])]) +AC_SUBST([CDB_LIBS]) +# tools for documentation +AC_FEATURE_DISABLEABLE([doc], [BUILD_DOCS], [disable building of documentation]) AC_MSG_CHECKING([for gtk-doc]) PKG_CHECK_EXISTS([gtk-doc >= 1.9],[AC_MSG_RESULT([yes])], - [GTKDOC=: - AC_DISABLE_DOC_IF_COLON([GTKDOC]) - ]) + [AC_MSG_RESULT([no]) + missing_deps_BUILD_DOCS="$missing_deps_BUILD_DOCS, gtk-doc >= 1.9"]) HTML_DIR="${datadir}/gtk-doc/html" AC_SUBST([HTML_DIR]) - -AC_CHECK_PROGS([XSLTPROC], [xsltproc], [:]) -AC_DISABLE_DOC_IF_COLON([XSLTPROC]) -AC_SUBST([XSLTPROC]) - -AC_CHECK_PROGS([XMLLINT], [xmllint], [:]) -AC_DISABLE_DOC_IF_COLON([XMLLINT]) -AC_SUBST([XMLLINT]) - -AC_CHECK_PROGS([DOXYGEN], [doxygen], [:]) -AC_DISABLE_DOC_IF_COLON([DOXYGEN]) -AC_SUBST([DOXYGEN]) - -# probably this is not used anymore! -# AC_PROG_PERL_MODULES([XML::LibXML::Reader], [], [build_docs=no]) - -# todo?: add asciidoc version check -# todo?: add program check for dot -# todo?: add program check for source-highlight - -AM_CONDITIONAL(CONTEXTKIT_BUILD_DOCS, test x$build_docs = xyes) -AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test x$build_docs = xyes) -AM_CONDITIONAL(ENABLE_GTK_DOC, test x$build_docs = xyes) +AC_DISABLE_FEATURE_ON_PROG([Dot drawing tool], [BUILD_DOCS], [DOT], [dot]) +AC_DISABLE_FEATURE_ON_PROG([Asciidoc], [BUILD_DOCS], [ASCIIDOC], [asciidoc], [8.2.7]) +AC_DISABLE_FEATURE_ON_PROG([source-highlight], [BUILD_DOCS], [SOURCE_HIGHLIGHT], [source-highlight]) +AC_DISABLE_FEATURE_ON_PROG([xsltproc], [BUILD_DOCS], [XSLTPROC], [xsltproc]) +AC_DISABLE_FEATURE_ON_PROG([xmllint], [BUILD_DOCS], [XMLLINT], [xmllint]) +AC_DISABLE_FEATURE_ON_PROG([doxygen], [BUILD_DOCS], [DOXYGEN], [doxygen]) +AM_CONDITIONAL(CONTEXTKIT_BUILD_DOCS, test "$missing_deps_BUILD_DOCS" = "") +AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test "$missing_deps_BUILD_DOCS" = "") +AM_CONDITIONAL(ENABLE_GTK_DOC, test "$missing_deps_BUILD_DOCS" = "") ###################### # Coverage option @@ -119,9 +79,6 @@ dnl fi dnl enable_coverage=no dnl AM_CONDITIONAL(HAVE_COVERAGE, test "x$enable_coverage" != "xno") -DEFAULT_CONTEXT_PROVIDERS="$datadir/contextkit/providers/" -AC_SUBST(DEFAULT_CONTEXT_PROVIDERS) - AC_CONFIG_FILES([ Makefile contextd/Makefile @@ -133,7 +90,7 @@ AC_CONFIG_FILES([ tests/python-test-library/testfw/Makefile tests/accept-tests/Makefile doc/Makefile doc/reference/Makefile - doc/reference/libcontextprovider/Makefile tools/Makefile + doc/reference/libcontextprovider/Makefile python/Makefile contextprovider-1.0.pc contextd/org.freedesktop.ContextKit.contextd.service @@ -167,3 +124,11 @@ AC_CONFIG_FILES([ ]) AC_OUTPUT + +AC_FEATURE_SUMMARIZE([BUILD_DOCS], + [Building of documentation is enabled], + [Documentation won't be built]) + +AC_FEATURE_SUMMARIZE([BUILD_VALA], + [Building of vala sources is enabled], + [Vala sources won't be built]) diff --git a/contextd/Makefile.am b/contextd/Makefile.am index 0a7080a2..f166a3a0 100644 --- a/contextd/Makefile.am +++ b/contextd/Makefile.am @@ -15,14 +15,16 @@ contextd_VALASOURCES = main.vala plugin.vala hal_plugin.vala \ contextd_GENERATEDSOURCES = $(contextd_VALASOURCES:.vala=.c) contextd_SOURCES = $(contextd_GENERATEDSOURCES) +if CONTEXTKIT_BUILD_VALA # FIXME: Remove the hal.vapi once the official version includes the needed functions contextd.vala.stamp: $(top_srcdir)/vapi/hal.vapi $(top_srcdir)/vapi/posix.vapi $(top_srcdir)/libcontextprovider/contextprovider.vapi $(contextd_VALASOURCES) $(VALAC) -C -g --basedir $(top_srcdir)/contextd --vapidir=$(top_srcdir)/vapi --pkg dbus-glib-1 --pkg gee-1.0 --disable-dbus-transformation $^ touch contextd.vala.stamp +endif -AM_CFLAGS = $(CONTEXTD_CFLAGS) -I$(top_srcdir)/libcontextprovider +AM_CFLAGS = $(GLIB_CFLAGS) $(GOBJECT_CFLAGS) $(GDBUS_CFLAGS) $(GEE_CFLAGS) $(HAL_CFLAGS) -I$(top_srcdir)/libcontextprovider -LDADD = $(CONTEXTD_LIBS) \ +LDADD = $(GLIB_LIBS) $(GOBJECT_LIBS) $(GDBUS_LIBS) $(GEE_LIBS) $(HAL_LIBS) \ $(top_builddir)/libcontextprovider/libcontextprovider.la -lm EXTRA_DIST = $(contextd_GENERATEDSOURCES) $(contextd_VALASOURCES) \ diff --git a/debian/rules b/debian/rules index bd9dc9e7..9f78fd51 100755 --- a/debian/rules +++ b/debian/rules @@ -4,15 +4,11 @@ #export DH_VERBOSE=1 Makefile: - ./configure --prefix /usr --sysconfdir=/etc + ./configure --prefix /usr --sysconfdir=/etc --disable-vala --disable-doc build: build-stamp build-stamp: Makefile dh_testdir - # We know that we don't want to run vala when building the - # package, but the timestamps sometimes lie. - find . -name '*.vala.stamp' -o -name '*.vapi' - touch `find . -name '*.vala.stamp' -o -name '*.vapi'` $(MAKE) all touch build-stamp diff --git a/doc/Makefile.am b/doc/Makefile.am index 5d2854c5..9b189ab2 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -11,8 +11,10 @@ html_DATA = $(html_EXTRA) \ html-local: $(html_EXTRA) $(html_ASCIIDOCS:.txt=.html) +if CONTEXTKIT_BUILD_DOCS %.html: %.txt asciidoc -a toc --unsafe -f myfilter.conf $^ +endif EXTRA_DIST = $(html_ASCIIDOCS) \ $(html_DATA) \ diff --git a/doc/reference/libcontextprovider/Makefile.am b/doc/reference/libcontextprovider/Makefile.am index 59d47cdd..0d2993d6 100644 --- a/doc/reference/libcontextprovider/Makefile.am +++ b/doc/reference/libcontextprovider/Makefile.am @@ -67,8 +67,8 @@ expand_content_files= # signals and properties. # e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) -AM_CPPFLAGS=$(CONTEXTD_CFLAGS) -GTKDOC_LIBS=$(CONEXTD_LDFLAGS) $(top_builddir)/libcontextprovider.la +AM_CPPFLAGS=$(GLIB_CFLAGS) $(GOBJECT_CFLAGS) $(GDBUS_CFLAGS) $(GEE_CFLAGS) $(HAL_CFLAGS) +GTKDOC_LIBS=$(GLIB_LIBS) $(GOBJECT_LIBS) $(GDBUS_LIBS) $(GEE_LIBS) $(HAL_LIBS) $(top_builddir)/libcontextprovider.la # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make diff --git a/gtk-doc.make b/gtk-doc.make index 0f87cc79..fa7fd6c4 100644 --- a/gtk-doc.make +++ b/gtk-doc.make @@ -172,13 +172,18 @@ uninstall-local: # # Require gtk-doc when making dist # -if ENABLE_GTK_DOC -dist-check-gtkdoc: -else -dist-check-gtkdoc: - @echo "*** gtk-doc must be installed and enabled in order to make dist" - @false -endif +#if ENABLE_GTK_DOC +#dist-check-gtkdoc: +#else +#dist-check-gtkdoc: +# @echo "*** gtk-doc must be installed and enabled in order to make dist" +# @false +#endif + +# contextkit note: instead of checking the availability of gtk-doc, +# just make the procedure, without hesitation. gtk-doc + distcheck is +# so hacky and messed up that we haven't found out a better way yet +dist-check-gtkdoc: html-build.stamp dist-hook: dist-check-gtkdoc dist-hook-local mkdir $(distdir)/tmpl diff --git a/libcontextprovider/Makefile.am b/libcontextprovider/Makefile.am index c2821395..a69ba779 100644 --- a/libcontextprovider/Makefile.am +++ b/libcontextprovider/Makefile.am @@ -22,6 +22,7 @@ libcontextproviderdir=$(includedir)/contextprovider libcontextprovider_HEADERS = $(libcontextprovider_GENERATEDSOURCES_PUB) +if CONTEXTKIT_BUILD_VALA libcontextprovider.vala.stamp contextprovider.vapi: $(libcontextprovider_VALASOURCES) $(VALAC) -C -g --basedir $(top_srcdir)/libcontextprovider \ --vapidir=$(top_srcdir)/vapi --pkg dbus-glib-1 --pkg gee-1.0 \ @@ -29,10 +30,11 @@ libcontextprovider.vala.stamp contextprovider.vapi: $(libcontextprovider_VALASOU --header context_provider.h --internal-header context_provider-internal.h \ --internal-vapi contextprovider-internal.vapi $^ touch libcontextprovider.vala.stamp +endif -AM_CFLAGS = -DG_LOG_DOMAIN=\"ContextKit\" $(CONTEXTPROVIDER_CFLAGS) +AM_CFLAGS = -DG_LOG_DOMAIN=\"ContextKit\" $(GLIB_CFLAGS) $(GOBJECT_CFLAGS) $(GDBUS_CFLAGS) $(GEE_CFLAGS) -AM_LDFLAGS = $(CONTEXTPROVIDER_LIBS) +AM_LDFLAGS = $(GLIB_LIBS) $(GOBJECT_LIBS) $(GDBUS_LIBS) $(GEE_LIBS) EXTRA_DIST = $(libcontextprovider_GENERATEDSOURCES) \ $(libcontextprovider_VALASOURCES) \ diff --git a/libcontextsubscriber/src/Makefile.am b/libcontextsubscriber/src/Makefile.am index 3d6b1e41..a7cbeca0 100644 --- a/libcontextsubscriber/src/Makefile.am +++ b/libcontextsubscriber/src/Makefile.am @@ -16,8 +16,8 @@ libcontextsubscriber_la_SOURCES = contextproperty.cpp \ includecontextsubscriberdir=$(includedir)/contextsubscriber includecontextsubscriber_HEADERS = contextproperty.h contextpropertyinfo.h contextregistryinfo.h AM_CXXFLAGS = $(QtCore_CFLAGS) $(QtXml_CFLAGS) $(QtDBus_CFLAGS) \ - '-DDEFAULT_CONTEXT_PROVIDERS="@DEFAULT_CONTEXT_PROVIDERS@"' -LIBS += -lcdb $(QtCore_LIBS) $(QtXml_LIBS) $(QtDBus_LIBS) + '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"' +LIBS += $(CDB_LIBS) $(QtCore_LIBS) $(QtXml_LIBS) $(QtDBus_LIBS) # moccing nodist_libcontextsubscriber_la_SOURCES = mocs.cpp diff --git a/libcontextsubscriber/unit-tests/cdbreader/Makefile.am b/libcontextsubscriber/unit-tests/cdbreader/Makefile.am index 60f8ae18..6eec7fd1 100644 --- a/libcontextsubscriber/unit-tests/cdbreader/Makefile.am +++ b/libcontextsubscriber/unit-tests/cdbreader/Makefile.am @@ -9,7 +9,7 @@ EXTRA_DIST = test.cdb # do the testing, coverage, etc. stuff # tests.am is using +=, so we have to set a value here for these four always AM_CXXFLAGS = '-I$(srcdir)/../util/' -AM_LDFLAGS = -lcdb +AM_LDFLAGS = $(CDB_LIBS) FROM_SOURCE = cdbreader.cpp cdbreader.h # copy these files from the real source FROM_SOURCE_DIR = $(srcdir)/../../src LDADD = diff --git a/libcontextsubscriber/unit-tests/cdbwriter/Makefile.am b/libcontextsubscriber/unit-tests/cdbwriter/Makefile.am index c107907d..b8ba233c 100644 --- a/libcontextsubscriber/unit-tests/cdbwriter/Makefile.am +++ b/libcontextsubscriber/unit-tests/cdbwriter/Makefile.am @@ -8,7 +8,7 @@ COVERAGE_FILES = cdbwriter.cpp # do the testing, coverage, etc. stuff # tests.am is using +=, so we have to set a value here for these four always AM_CXXFLAGS = '-I$(srcdir)/../util/' -AM_LDFLAGS = -lcdb +AM_LDFLAGS = $(CDB_LIBS) FROM_SOURCE = cdbwriter.cpp cdbwriter.h # copy these files from the real source FROM_SOURCE_DIR = $(srcdir)/../../src LDADD = diff --git a/libcontextsubscriber/unit-tests/contextpropertyinfo-cdb-dynamic/Makefile.am b/libcontextsubscriber/unit-tests/contextpropertyinfo-cdb-dynamic/Makefile.am index f44d40ed..5e359ebc 100644 --- a/libcontextsubscriber/unit-tests/contextpropertyinfo-cdb-dynamic/Makefile.am +++ b/libcontextsubscriber/unit-tests/contextpropertyinfo-cdb-dynamic/Makefile.am @@ -12,8 +12,8 @@ EXTRA_DIST = context-providers2v1.cdb context-providers2v2.cdb \ # do the testing, coverage, etc. stuff # tests.am is using +=, so we have to set a value here for these four always -AM_CXXFLAGS = $(QtDBus_CFLAGS) -DDEFAULT_CONTEXT_PROVIDERS="\"@DEFAULT_CONTEXT_PROVIDERS@\"" -I$(srcdir)/../util/ -AM_LDFLAGS = -lcdb $(QtXml_LIBS) +AM_CXXFLAGS = $(QtDBus_CFLAGS) '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"' -I$(srcdir)/../util/ +AM_LDFLAGS = $(CDB_LIBS) $(QtXml_LIBS) FROM_SOURCE = contextregistryinfo.cpp contextpropertyinfo.cpp \ infobackend.cpp infoxmlbackend.cpp \ infoxmlkeysfinder.cpp infocdbbackend.cpp \ diff --git a/libcontextsubscriber/unit-tests/contextpropertyinfo-cdb-static/Makefile.am b/libcontextsubscriber/unit-tests/contextpropertyinfo-cdb-static/Makefile.am index 670a0bec..b9956a17 100644 --- a/libcontextsubscriber/unit-tests/contextpropertyinfo-cdb-static/Makefile.am +++ b/libcontextsubscriber/unit-tests/contextpropertyinfo-cdb-static/Makefile.am @@ -10,8 +10,8 @@ EXTRA_DIST = cache.cdb # do the testing, coverage, etc. stuff # tests.am is using +=, so we have to set a value here for these four always -AM_CXXFLAGS = $(QtDBus_CFLAGS) -DDEFAULT_CONTEXT_PROVIDERS="\"@DEFAULT_CONTEXT_PROVIDERS@\"" -I$(srcdir)/../util/ -AM_LDFLAGS = -lcdb $(QtXml_LIBS) +AM_CXXFLAGS = $(QtDBus_CFLAGS) '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"' -I$(srcdir)/../util/ +AM_LDFLAGS = $(CDB_LIBS) $(QtXml_LIBS) FROM_SOURCE = contextregistryinfo.cpp contextpropertyinfo.cpp \ infobackend.cpp infoxmlbackend.cpp \ infoxmlkeysfinder.cpp infocdbbackend.cpp \ diff --git a/libcontextsubscriber/unit-tests/contextpropertyinfo-xml-dynamic/Makefile.am b/libcontextsubscriber/unit-tests/contextpropertyinfo-xml-dynamic/Makefile.am index 091f549d..e423018c 100644 --- a/libcontextsubscriber/unit-tests/contextpropertyinfo-xml-dynamic/Makefile.am +++ b/libcontextsubscriber/unit-tests/contextpropertyinfo-xml-dynamic/Makefile.am @@ -13,8 +13,8 @@ EXTRA_DIST = providers2v1.xml.src providers2v2.xml.src \ # do the testing, coverage, etc. stuff # tests.am is using +=, so we have to set a value here for these four always -AM_CXXFLAGS = $(QtDBus_CFLAGS) -I$(srcdir)/../util/ -DDEFAULT_CONTEXT_PROVIDERS="\"@DEFAULT_CONTEXT_PROVIDERS@\"" -AM_LDFLAGS = -lcdb $(QtXml_LIBS) +AM_CXXFLAGS = $(QtDBus_CFLAGS) -I$(srcdir)/../util/ '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"' +AM_LDFLAGS = $(CDB_LIBS) $(QtXml_LIBS) FROM_SOURCE = contextregistryinfo.cpp contextpropertyinfo.cpp \ infobackend.cpp infoxmlbackend.cpp \ infoxmlkeysfinder.cpp infocdbbackend.cpp \ diff --git a/libcontextsubscriber/unit-tests/contextpropertyinfo-xml-static/Makefile.am b/libcontextsubscriber/unit-tests/contextpropertyinfo-xml-static/Makefile.am index 781209ee..0cf74df3 100644 --- a/libcontextsubscriber/unit-tests/contextpropertyinfo-xml-static/Makefile.am +++ b/libcontextsubscriber/unit-tests/contextpropertyinfo-xml-static/Makefile.am @@ -11,8 +11,8 @@ EXTRA_DIST = providers1.context providers2.context # do the testing, coverage, etc. stuff # tests.am is using +=, so we have to set a value here for these four always -AM_CXXFLAGS = $(QtDBus_CFLAGS) -I$(srcdir)/../util/ -DDEFAULT_CONTEXT_PROVIDERS="\"@DEFAULT_CONTEXT_PROVIDERS@\"" -AM_LDFLAGS = -lcdb $(QtXml_LIBS) +AM_CXXFLAGS = $(QtDBus_CFLAGS) -I$(srcdir)/../util/ '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"' +AM_LDFLAGS = $(CDB_LIBS) $(QtXml_LIBS) FROM_SOURCE = contextregistryinfo.cpp contextpropertyinfo.cpp \ infobackend.cpp infoxmlbackend.cpp \ infoxmlkeysfinder.cpp infocdbbackend.cpp \ diff --git a/libcontextsubscriber/unit-tests/contextregistryinfo-cdb-dynamic/Makefile.am b/libcontextsubscriber/unit-tests/contextregistryinfo-cdb-dynamic/Makefile.am index fd1c36ed..eebcae75 100644 --- a/libcontextsubscriber/unit-tests/contextregistryinfo-cdb-dynamic/Makefile.am +++ b/libcontextsubscriber/unit-tests/contextregistryinfo-cdb-dynamic/Makefile.am @@ -10,8 +10,8 @@ EXTRA_DIST = context-providers1v1.cdb context-providers1v2.cdb # do the testing, coverage, etc. stuff # tests.am is using +=, so we have to set a value here for these four always -AM_CXXFLAGS = $(QtDBus_CFLAGS) -I$(srcdir)/../util/ -DDEFAULT_CONTEXT_PROVIDERS="\"@DEFAULT_CONTEXT_PROVIDERS@\"" -AM_LDFLAGS = -lcdb $(QtXml_LIBS) +AM_CXXFLAGS = $(QtDBus_CFLAGS) -I$(srcdir)/../util/ '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"' +AM_LDFLAGS = $(CDB_LIBS) $(QtXml_LIBS) FROM_SOURCE = contextregistryinfo.cpp infobackend.cpp \ infoxmlbackend.cpp infoxmlkeysfinder.cpp \ infocdbbackend.cpp cdbreader.cpp \ diff --git a/libcontextsubscriber/unit-tests/contextregistryinfo-cdb-static/Makefile.am b/libcontextsubscriber/unit-tests/contextregistryinfo-cdb-static/Makefile.am index 9766a555..6a3af716 100644 --- a/libcontextsubscriber/unit-tests/contextregistryinfo-cdb-static/Makefile.am +++ b/libcontextsubscriber/unit-tests/contextregistryinfo-cdb-static/Makefile.am @@ -10,8 +10,8 @@ EXTRA_DIST = cache.cdb # do the testing, coverage, etc. stuff # tests.am is using +=, so we have to set a value here for these four always -AM_CXXFLAGS = $(QtDBus_CFLAGS) -I$(srcdir)/../util/ -DDEFAULT_CONTEXT_PROVIDERS="\"@DEFAULT_CONTEXT_PROVIDERS@\"" -AM_LDFLAGS = -lcdb $(QtXml_LIBS) +AM_CXXFLAGS = $(QtDBus_CFLAGS) -I$(srcdir)/../util/ '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"' +AM_LDFLAGS = $(CDB_LIBS) $(QtXml_LIBS) FROM_SOURCE = contextregistryinfo.cpp infobackend.cpp \ infoxmlbackend.cpp infoxmlkeysfinder.cpp \ infocdbbackend.cpp cdbreader.cpp \ diff --git a/libcontextsubscriber/unit-tests/contextregistryinfo-xml-dynamic/Makefile.am b/libcontextsubscriber/unit-tests/contextregistryinfo-xml-dynamic/Makefile.am index f50a6467..6bfb96e7 100644 --- a/libcontextsubscriber/unit-tests/contextregistryinfo-xml-dynamic/Makefile.am +++ b/libcontextsubscriber/unit-tests/contextregistryinfo-xml-dynamic/Makefile.am @@ -12,8 +12,8 @@ EXTRA_DIST = providers1v1.xml.src providers1v2.xml.src # do the testing, coverage, etc. stuff # tests.am is using +=, so we have to set a value here for these four always -AM_CXXFLAGS = '-I$(srcdir)/../util/' '-DDEFAULT_CONTEXT_PROVIDERS="@DEFAULT_CONTEXT_PROVIDERS@"' $(QtXml_CFLAGS) -AM_LDFLAGS = -lcdb $(QtXml_LIBS) +AM_CXXFLAGS = '-I$(srcdir)/../util/' '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"' $(QtXml_CFLAGS) +AM_LDFLAGS = $(CDB_LIBS) $(QtXml_LIBS) FROM_SOURCE = contextregistryinfo.cpp infobackend.cpp infoxmlbackend.cpp infoxmlkeysfinder.cpp infocdbbackend.cpp cdbreader.cpp contextregistryinfo.h infobackend.h infoxmlbackend.h infocdbbackend.h infoxmlkeysfinder.h cdbreader.h infokeydata.h sconnect.h # copy these files from the real source FROM_SOURCE_DIR = $(srcdir)/../../src LDADD = diff --git a/libcontextsubscriber/unit-tests/contextregistryinfo-xml-static/Makefile.am b/libcontextsubscriber/unit-tests/contextregistryinfo-xml-static/Makefile.am index 5f43d137..be2b2c56 100644 --- a/libcontextsubscriber/unit-tests/contextregistryinfo-xml-static/Makefile.am +++ b/libcontextsubscriber/unit-tests/contextregistryinfo-xml-static/Makefile.am @@ -12,8 +12,8 @@ EXTRA_DIST = providers1.context providers2.context # do the testing, coverage, etc. stuff # tests.am is using +=, so we have to set a value here for these four always -AM_CXXFLAGS = '-I$(srcdir)/../util/' '-DDEFAULT_CONTEXT_PROVIDERS="@DEFAULT_CONTEXT_PROVIDERS@"' $(QtXml_CFLAGS) -AM_LDFLAGS = -lcdb $(QtXml_LIBS) +AM_CXXFLAGS = '-I$(srcdir)/../util/' '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"' $(QtXml_CFLAGS) +AM_LDFLAGS = $(CDB_LIBS) $(QtXml_LIBS) FROM_SOURCE = contextregistryinfo.cpp infobackend.cpp infoxmlbackend.cpp infoxmlkeysfinder.cpp infocdbbackend.cpp cdbreader.cpp contextregistryinfo.h infobackend.h infoxmlbackend.h infocdbbackend.h infoxmlkeysfinder.h cdbreader.h infokeydata.h sconnect.h # copy these files from the real source FROM_SOURCE_DIR = $(srcdir)/../../src LDADD = diff --git a/libcontextsubscriber/unit-tests/handlesignalrouter/Makefile.am b/libcontextsubscriber/unit-tests/handlesignalrouter/Makefile.am index 033c1b51..c0c2e5e6 100644 --- a/libcontextsubscriber/unit-tests/handlesignalrouter/Makefile.am +++ b/libcontextsubscriber/unit-tests/handlesignalrouter/Makefile.am @@ -9,7 +9,7 @@ COVERAGE_FILES = handlesignalrouter.cpp # do the testing, coverage, etc. stuff # tests.am is using +=, so we have to set a value here for these four always -AM_CXXFLAGS = $(QtDBus_CFLAGS) -DDEFAULT_CONTEXT_PROVIDERS=\"@DEFAULT_CONTEXT_PROVIDERS@\" +AM_CXXFLAGS = $(QtDBus_CFLAGS) '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"' AM_LDFLAGS = FROM_SOURCE = handlesignalrouter.cpp handlesignalrouter.h # copy these files from the real source FROM_SOURCE_DIR = $(srcdir)/../../src diff --git a/libcontextsubscriber/unit-tests/propertyhandle/Makefile.am b/libcontextsubscriber/unit-tests/propertyhandle/Makefile.am index 6fe3a73e..a7b2a850 100644 --- a/libcontextsubscriber/unit-tests/propertyhandle/Makefile.am +++ b/libcontextsubscriber/unit-tests/propertyhandle/Makefile.am @@ -10,7 +10,7 @@ COVERAGE_FILES = propertyhandle.cpp # do the testing, coverage, etc. stuff # tests.am is using +=, so we have to set a value here for these four always -AM_CXXFLAGS = $(QtDBus_CFLAGS) -DDEFAULT_CONTEXT_PROVIDERS=\"@DEFAULT_CONTEXT_PROVIDERS@\" +AM_CXXFLAGS = $(QtDBus_CFLAGS) '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"' AM_LDFLAGS = FROM_SOURCE = propertyhandle.cpp propertyhandle.h sconnect.h # copy these files from the real source FROM_SOURCE_DIR = $(srcdir)/../../src diff --git a/libcontextsubscriber/update-contextkit-providers/Makefile.am b/libcontextsubscriber/update-contextkit-providers/Makefile.am index a76c630e..0ac36456 100644 --- a/libcontextsubscriber/update-contextkit-providers/Makefile.am +++ b/libcontextsubscriber/update-contextkit-providers/Makefile.am @@ -2,7 +2,7 @@ bin_PROGRAMS = update-contextkit-providers update_contextkit_providers_SOURCES = update-contextkit-providers.cpp -AM_CXXFLAGS = -I$(srcdir)/../src $(QtXml_CFLAGS) $(QtCore_CFLAGS) $(QtDBus_CFLAGS) '-DDEFAULT_CONTEXT_PROVIDERS="@DEFAULT_CONTEXT_PROVIDERS@"' +AM_CXXFLAGS = -I$(srcdir)/../src $(QtXml_CFLAGS) $(QtCore_CFLAGS) $(QtDBus_CFLAGS) '-DDEFAULT_CONTEXT_PROVIDERS="@datadir@/contextkit/providers/"' AM_LDFLAGS = $(QtXml_LIBS) $(QtCore_LIBS) # library dependency hack for seamless make in update-contextkit-providers/ diff --git a/m4/ax_compare_version.m4 b/m4/ax_compare_version.m4 new file mode 100644 index 00000000..3f33ad1b --- /dev/null +++ b/m4/ax_compare_version.m4 @@ -0,0 +1,174 @@ +# =========================================================================== +# http://www.nongnu.org/autoconf-archive/ax_compare_version.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# +# DESCRIPTION +# +# This macro compares two version strings. Due to the various number of +# minor-version numbers that can exist, and the fact that string +# comparisons are not compatible with numeric comparisons, this is not +# necessarily trivial to do in a autoconf script. This macro makes doing +# these comparisons easy. +# +# The six basic comparisons are available, as well as checking equality +# limited to a certain number of minor-version levels. +# +# The operator OP determines what type of comparison to do, and can be one +# of: +# +# eq - equal (test A == B) +# ne - not equal (test A != B) +# le - less than or equal (test A <= B) +# ge - greater than or equal (test A >= B) +# lt - less than (test A < B) +# gt - greater than (test A > B) +# +# Additionally, the eq and ne operator can have a number after it to limit +# the test to that number of minor versions. +# +# eq0 - equal up to the length of the shorter version +# ne0 - not equal up to the length of the shorter version +# eqN - equal up to N sub-version levels +# neN - not equal up to N sub-version levels +# +# When the condition is true, shell commands ACTION-IF-TRUE are run, +# otherwise shell commands ACTION-IF-FALSE are run. The environment +# variable 'ax_compare_version' is always set to either 'true' or 'false' +# as well. +# +# Examples: +# +# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8]) +# AX_COMPARE_VERSION([3.15],[lt],[3.15.8]) +# +# would both be true. +# +# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8]) +# AX_COMPARE_VERSION([3.15],[gt],[3.15.8]) +# +# would both be false. +# +# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8]) +# +# would be true because it is only comparing two minor versions. +# +# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15]) +# +# would be true because it is only comparing the lesser number of minor +# versions of the two values. +# +# Note: The characters that separate the version numbers do not matter. An +# empty string is the same as version 0. OP is evaluated by autoconf, not +# configure, so must be a string, not a variable. +# +# The author would like to acknowledge Guido Draheim whose advice about +# the m4_case and m4_ifvaln functions make this macro only include the +# portions necessary to perform the specific comparison specified by the +# OP argument in the final configure script. +# +# LICENSE +# +# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. + +dnl ######################################################################### +AC_DEFUN([AX_COMPARE_VERSION], [ + AC_REQUIRE([AC_PROG_AWK]) + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + AS_VAR_PUSHDEF([A],[ax_compare_version_A]) + A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/[[^0-9]]//g'` + + AS_VAR_PUSHDEF([B],[ax_compare_version_B]) + B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/[[^0-9]]//g'` + + dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary + dnl # then the first line is used to determine if the condition is true. + dnl # The sed right after the echo is to remove any indented white space. + m4_case(m4_tolower($2), + [lt],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"` + ], + [gt],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"` + ], + [le],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"` + ], + [ge],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` + ],[ + dnl Split the operator from the subversion count if present. + m4_bmatch(m4_substr($2,2), + [0],[ + # A count of zero means use the length of the shorter version. + # Determine the number of characters in A and B. + ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'` + ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'` + + # Set A to no more than B's length and B to no more than A's length. + A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"` + B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"` + ], + [[0-9]+],[ + # A count greater than zero means use only that many subversions + A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` + B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` + ], + [.+],[ + AC_WARNING( + [illegal OP numeric parameter: $2]) + ],[]) + + # Pad zeros at end of numbers to make same length. + ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`" + B="$B`echo $A | sed 's/./0/g'`" + A="$ax_compare_version_tmp_A" + + # Check for equality or inequality as necessary. + m4_case(m4_tolower(m4_substr($2,0,2)), + [eq],[ + test "x$A" = "x$B" && ax_compare_version=true + ], + [ne],[ + test "x$A" != "x$B" && ax_compare_version=true + ],[ + AC_WARNING([illegal OP parameter: $2]) + ]) + ]) + + AS_VAR_POPDEF([A])dnl + AS_VAR_POPDEF([B])dnl + + dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE. + if test "$ax_compare_version" = "true" ; then + m4_ifvaln([$4],[$4],[:])dnl + m4_ifvaln([$5],[else $5])dnl + fi +]) dnl AX_COMPARE_VERSION diff --git a/m4/doxygen.m4 b/m4/doxygen.m4 index 51dded3a..1a10df97 100644 --- a/m4/doxygen.m4 +++ b/m4/doxygen.m4 @@ -1,6 +1,57 @@ dnl Usage: AC_DISABLE_DOC_IF_EMPTY([variable]) -AC_DEFUN([AC_DISABLE_DOC_IF_COLON], [ -if test x$$1 = x: ; then - AC_MSG_WARN([$1 not found, not building documentation]) - build_docs=no -fi]) +AC_DEFUN([AC_DISABLE_DOC_IF_COLON], + [if test x$$1 = x: ; then + AC_MSG_WARN([$1 not found, not building documentation]) + build_docs=no + fi]) + +AC_DEFUN([AC_CHECK_DOCPROG], [AC_CHECK_PROG([$1], [$2], [:]) + AC_DISABLE_DOC_IF_COLON([$1]) + AC_SUBST([$1])]) + +AC_DEFUN([AX_PROGRAM_VERSION], [dnl +`$$1 --version </dev/null 2>/dev/null | head -n1 | grep -o '[[0-9.]]*'`dnl +]) + +dnl Usage: AC_DISABLE_FEATURE_ON_PROG([$1=description], [$2=conditional feature], +dnl [$3=subst var], [$4=lookup list], +dnl [$5=needed version (optional)]) +AC_DEFUN([AC_DISABLE_FEATURE_ON_PROG], [ +AC_ARG_VAR([$3], [$1]) +AC_CHECK_PROGS([$3], [$4], [:]) +if test $$3 = : +then + missing_deps_$2="$missing_deps_$2, $1" +else + if test x$5 != x + then + disable_feature_on_prog_ver=AX_PROGRAM_VERSION([$3]) + AX_COMPARE_VERSION([$disable_feature_on_prog_ver], [ge], [$5], [], + [AC_MSG_WARN([$1 version mismatch; wanted $5, has: $disable_feature_on_prog_ver]) + missing_deps_$2="$missing_deps_$2, $1 >= $5"]) + fi +fi +]) + +dnl Usage: AC_FEATURE_DISABLEABLE([$1=option name], [$2=conditional feature], [$3=description]) +AC_DEFUN([AC_FEATURE_DISABLEABLE], [ +AC_ARG_ENABLE([$1], + AS_HELP_STRING([--disable-$1], + [$3 [[default=no]]]),, + [enable_$1=undef]) +if test x$enable_$1 = xno +then + missing_deps_$2=", disabled by user" +fi +]) + +dnl Usage: AC_FEATURE_SUMMARIZE([$1=conditional feature], [$2=enabled msg], [$3=disabled msg]) +AC_DEFUN([AC_FEATURE_SUMMARIZE], [ +if test "$missing_deps_$1" = "" +then + AC_MSG_NOTICE([$2]) +else + missing_deps_$1=`echo $missing_deps_$1 | cut -c3-` + AC_MSG_WARN([$3, missing dependencies: $missing_deps_$1]) +fi +]) diff --git a/tests/contextd_tests/Makefile.am b/tests/contextd_tests/Makefile.am index 7a3c7efb..2c81bcc5 100644 --- a/tests/contextd_tests/Makefile.am +++ b/tests/contextd_tests/Makefile.am @@ -27,14 +27,16 @@ test_hal_plugin_VALASOURCES = $(test_hal_plugin_real_VALASOURCES) \ test_hal_plugin_SOURCES = $(test_hal_plugin_test_VALASOURCES:.vala=.c) \ $(test_hal_plugin_copied_VALASOURCES:.vala=.c) +if CONTEXTKIT_BUILD_VALA test_hal_plugin.vala.stamp: $(top_srcdir)/vapi/posix.vapi $(test_hal_plugin_VALASOURCES) cp $(test_hal_plugin_real_VALASOURCES) . $(VALAC) $(VALA_OPTIONS) $(test_hal_plugin_test_VALASOURCES) $(test_hal_plugin_copied_VALASOURCES) touch $@ rm $(test_hal_plugin_copied_VALASOURCES) +endif -test_hal_plugin_CFLAGS = $(CONTEXTD_CFLAGS) -test_hal_plugin_LDADD = $(CONTEXTD_LIBS) -lm +test_hal_plugin_CFLAGS = $(GLIB_CFLAGS) $(GOBJECT_CFLAGS) $(GDBUS_CFLAGS) $(GEE_CFLAGS) $(HAL_CFLAGS) +test_hal_plugin_LDADD = $(GLIB_LIBS) $(GOBJECT_LIBS) $(GDBUS_LIBS) $(GEE_LIBS) $(HAL_LIBS) -lm EXTRA_DIST += $(test_hal_plugin_test_VALASOURCES) \ $(test_hal_plugin_SOURCES) test_hal_plugin.vala.stamp diff --git a/tests/unit_tests/Makefile.am b/tests/unit_tests/Makefile.am index 6e4dc33d..a2b3a456 100644 --- a/tests/unit_tests/Makefile.am +++ b/tests/unit_tests/Makefile.am @@ -18,9 +18,14 @@ test_intset_VALASOURCES = test_intset.vala test_intset_SOURCES = $(test_intset_VALASOURCES:.vala=.c) +if CONTEXTKIT_BUILD_VALA test_intset.vala.stamp: $(top_srcdir)/libcontextprovider/contextprovider-internal.vapi $(test_intset_VALASOURCES) $(VALAC) $(VALA_OPTIONS) $^ touch $@ +endif + +CONTEXTD_CFLAGS=$(GLIB_CFLAGS) $(GOBJECT_CFLAGS) $(GDBUS_CFLAGS) $(GEE_CFLAGS) $(HAL_CFLAGS) +CONTEXTD_LIBS=$(GLIB_LIBS) $(GOBJECT_LIBS) $(GDBUS_LIBS) $(GEE_LIBS) $(HAL_LIBS) test_intset_CFLAGS = -I$(top_srcdir)/libcontextprovider $(CONTEXTD_CFLAGS) test_intset_LDADD = $(CONTEXTD_LIBS) $(top_builddir)/libcontextprovider/libcontextprovider.la @@ -29,9 +34,11 @@ test_stringset_VALASOURCES = test_stringset.vala test_stringset_SOURCES = $(test_stringset_VALASOURCES:.vala=.c) +if CONTEXTKIT_BUILD_VALA test_stringset.vala.stamp: $(top_srcdir)/libcontextprovider/contextprovider-internal.vapi $(test_stringset_VALASOURCES) $(VALAC) $(VALA_OPTIONS) $^ touch $@ +endif test_stringset_CFLAGS = -I$(top_srcdir)/libcontextprovider $(CONTEXTD_CFLAGS) test_stringset_LDADD = $(CONTEXTD_LIBS) $(top_builddir)/libcontextprovider/libcontextprovider.la @@ -41,9 +48,11 @@ test_value_compare_VALASOURCES = test_value_compare.vala test_value_compare_SOURCES = $(test_value_compare_VALASOURCES:.vala=.c) +if CONTEXTKIT_BUILD_VALA test_value_compare.vala.stamp: $(top_srcdir)/libcontextprovider/contextprovider-internal.vapi $(test_value_compare_VALASOURCES) $(VALAC) $(VALA_OPTIONS) $^ touch $@ +endif test_value_compare_CFLAGS = -I$(top_srcdir)/libcontextprovider $(CONTEXTD_CFLAGS) test_value_compare_LDADD = $(CONTEXTD_LIBS) $(top_builddir)/libcontextprovider/libcontextprovider.la @@ -52,10 +61,11 @@ test_group_VALASOURCES = test_group.vala test_group_SOURCES = $(test_group_VALASOURCES:.vala=.c) +if CONTEXTKIT_BUILD_VALA test_group.vala.stamp: $(top_srcdir)/libcontextprovider/contextprovider-internal.vapi $(test_group_VALASOURCES) $(VALAC) $(VALA_OPTIONS) $^ touch $@ - +endif test_group_CFLAGS = -I$(top_srcdir)/libcontextprovider $(CONTEXTD_CFLAGS) test_group_LDADD = $(CONTEXTD_LIBS) $(top_builddir)/libcontextprovider/libcontextprovider.la @@ -64,10 +74,11 @@ test_grouplist_VALASOURCES = test_grouplist.vala test_grouplist_SOURCES = $(test_grouplist_VALASOURCES:.vala=.c) +if CONTEXTKIT_BUILD_VALA test_grouplist.vala.stamp: $(top_srcdir)/libcontextprovider/contextprovider-internal.vapi $(test_grouplist_VALASOURCES) $(VALAC) $(VALA_OPTIONS) $^ touch $@ - +endif test_grouplist_CFLAGS = -I$(top_srcdir)/libcontextprovider $(CONTEXTD_CFLAGS) test_grouplist_LDADD = $(CONTEXTD_LIBS) $(top_builddir)/libcontextprovider/libcontextprovider.la @@ -76,9 +87,11 @@ test_key_usage_counter_VALASOURCES = test_key_usage_counter.vala test_key_usage_counter_SOURCES = $(test_key_usage_counter_VALASOURCES:.vala=.c) +if CONTEXTKIT_BUILD_VALA test_key_usage_counter.vala.stamp: $(top_srcdir)/libcontextprovider/contextprovider-internal.vapi $(test_key_usage_counter_VALASOURCES) $(VALAC) $(VALA_OPTIONS) $^ touch $@ +endif test_key_usage_counter_CFLAGS = -I$(top_srcdir)/libcontextprovider $(CONTEXTD_CFLAGS) test_key_usage_counter_LDADD = $(CONTEXTD_LIBS) $(top_builddir)/libcontextprovider/libcontextprovider.la @@ -87,9 +100,11 @@ test_subscriber_VALASOURCES = test_subscriber.vala test_subscriber_SOURCES = $(test_subscriber_VALASOURCES:.vala=.c) +if CONTEXTKIT_BUILD_VALA test_subscriber.vala.stamp: $(top_srcdir)/libcontextprovider/contextprovider-internal.vapi $(test_subscriber_VALASOURCES) $(VALAC) $(VALA_OPTIONS) $^ touch $@ +endif test_subscriber_CFLAGS = -I$(top_srcdir)/libcontextprovider $(CONTEXTD_CFLAGS) test_subscriber_LDADD = $(CONTEXTD_LIBS) $(top_builddir)/libcontextprovider/libcontextprovider.la @@ -98,9 +113,11 @@ test_manager_VALASOURCES = test_manager.vala test_manager_SOURCES = $(test_manager_VALASOURCES:.vala=.c) +if CONTEXTKIT_BUILD_VALA test_manager.vala.stamp: $(top_srcdir)/libcontextprovider/contextprovider-internal.vapi $(test_manager_VALASOURCES) $(VALAC) $(VALA_OPTIONS) $^ touch $@ +endif test_manager_CFLAGS = -I$(top_srcdir)/libcontextprovider $(CONTEXTD_CFLAGS) test_manager_LDADD = $(CONTEXTD_LIBS) $(top_builddir)/libcontextprovider/libcontextprovider.la diff --git a/tests/unit_tests/Makefile.fragment b/tests/unit_tests/Makefile.fragment deleted file mode 100644 index 3ddb98c6..00000000 --- a/tests/unit_tests/Makefile.fragment +++ /dev/null @@ -1,267 +0,0 @@ -TEST_PROGS += \ - tests/unit_tests/intset \ - tests/unit_tests/stringset \ - tests/unit_tests/value_compare \ - tests/unit_tests/group \ - tests/unit_tests/grouplist \ - tests/unit_tests/key_usage_counter \ - tests/unit_tests/subscriber \ - tests/unit_tests/manager \ - $(NULL) - -noinst_PROGRAMS = $(TEST_PROGS) - -BUILT_SOURCES += \ - tests/unit_tests/intset.vala.stamp \ - tests/unit_tests/stringset.vala.stamp \ - tests/unit_tests/value_compare.vala.stamp \ - tests/unit_tests/group.vala.stamp \ - tests/unit_tests/grouplist.vala.stamp \ - tests/unit_tests/key_usage_counter.vala.stamp \ - tests/unit_tests/subscriber.vala.stamp \ - tests/unit_tests/manager.vala.stamp \ - $(NULL) - -tests_unit_tests_intset_VAPISOURCES = \ - libcontextprovider/intset.vapi \ - $(NULL) - -tests_unit_tests_intset_VALASOURCES = \ - tests/unit_tests/intset.vala \ - $(NULL) - -tests_unit_tests_intset_GENERATEDSOURCES = \ - $(tests_unit_tests_intset_VALASOURCES:.vala=.c) \ - $(tests_unit_tests_intset_VALASOURCES:.vala=.h) \ - $(NULL) - -tests_unit_tests_intset_SOURCES = \ - $(tests_unit_tests_intset_GENERATEDSOURCES) \ - libcontextprovider/intset.c \ - libcontextprovider/intset.h \ - $(NULL) - -tests/unit_tests/intset.vala.stamp: $(tests_unit_tests_intset_VALASOURCES) $(tests_unit_tests_intset_VAPISOURCES) - $(VALAC) -C --basedir $(top_srcdir) $^ - touch $@ - -tests_unit_tests_intset_CFLAGS = -I$(top_srcdir)/libcontextprovider $(CONTEXTD_CFLAGS) -DG_LOG_DOMAIN=\"ContextKit\" -tests_unit_tests_intset_LDADD = $(CONTEXTD_LIBS) - -tests_unit_tests_stringset_VAPISOURCES = \ - libcontextprovider/intset.vapi \ - $(NULL) - -tests_unit_tests_stringset_VALASOURCES = \ - libcontextprovider/string_set.vala \ - tests/unit_tests/stringset.vala \ - $(NULL) - -tests_unit_tests_stringset_GENERATEDSOURCES = \ - $(tests_unit_tests_stringset_VALASOURCES:.vala=.c) \ - $(tests_unit_tests_stringset_VALASOURCES:.vala=.h) \ - $(NULL) - -tests_unit_tests_stringset_SOURCES = \ - $(tests_unit_tests_stringset_GENERATEDSOURCES) \ - libcontextprovider/intset.c \ - libcontextprovider/intset.h \ - $(NULL) - -tests/unit_tests/stringset.vala.stamp: $(tests_unit_tests_stringset_VALASOURCES) $(tests_unit_tests_stringset_VAPISOURCES) - $(VALAC) -C --basedir $(top_srcdir) --vapidir=$(top_srcdir)/vapi --pkg gee-1.0 $^ - touch $@ - -tests_unit_tests_stringset_CFLAGS = -I$(top_srcdir)/libcontextprovider $(CONTEXTD_CFLAGS) -DG_LOG_DOMAIN=\"ContextKit\" -tests_unit_tests_stringset_LDADD = $(CONTEXTD_LIBS) - - -tests_unit_tests_value_compare_VALASOURCES = \ - libcontextprovider/value_compare.vala \ - tests/unit_tests/test_value_compare.vala \ - $(NULL) - -tests_unit_tests_value_compare_SOURCES = \ - $(tests_unit_tests_value_compare_VALASOURCES:.vala=.c) \ - $(tests_unit_tests_value_compare_VALASOURCES:.vala=.h) \ - $(NULL) - -tests/unit_tests/value_compare.vala.stamp: $(tests_unit_tests_value_compare_VALASOURCES) - $(VALAC) -C --basedir $(top_srcdir) --vapidir=$(top_srcdir)/vapi --pkg gee-1.0 $^ - touch $@ - -tests_unit_tests_value_compare_CFLAGS = -I$(top_srcdir)/libcontextprovider $(CONTEXTD_CFLAGS) -DG_LOG_DOMAIN=\"ContextKit\" -tests_unit_tests_value_compare_LDADD = $(CONTEXTD_LIBS) - -tests_unit_tests_group_VALASOURCES = \ - tests/unit_tests/test_group.vala \ - $(NULL) - -tests_unit_tests_group_SOURCES = \ - $(tests_unit_tests_group_VALASOURCES:.vala=.c) \ - $(tests_unit_tests_group_VALASOURCES:.vala=.h) \ - $(NULL) - -tests/unit_tests/group.vala.stamp: contextprovider.vapi $(tests_unit_tests_group_VALASOURCES) - $(VALAC) -C --basedir $(top_srcdir) --vapidir=$(top_srcdir)/vapi --pkg gee-1.0 --pkg dbus-glib-1 $^ - touch $@ - - -tests_unit_tests_group_CFLAGS = -I$(top_srcdir)/libcontextprovider $(CONTEXTD_CFLAGS) -DG_LOG_DOMAIN=\"ContextKit\" -tests_unit_tests_group_LDADD = $(CONTEXTD_LIBS) $(top_builddir)/libcontextprovider.la - -tests_unit_tests_grouplist_VALASOURCES = \ - tests/unit_tests/test_grouplist.vala \ - $(NULL) - -tests_unit_tests_grouplist_SOURCES = \ - $(tests_unit_tests_grouplist_VALASOURCES:.vala=.c) \ - $(tests_unit_tests_grouplist_VALASOURCES:.vala=.h) \ - $(NULL) - -tests/unit_tests/grouplist.vala.stamp: contextprovider.vapi $(tests_unit_tests_grouplist_VALASOURCES) - $(VALAC) -C --basedir $(top_srcdir) --vapidir=$(top_srcdir)/vapi --pkg gee-1.0 --pkg dbus-glib-1 $^ - touch $@ - - -tests_unit_tests_grouplist_CFLAGS = -I$(top_srcdir)/libcontextprovider $(CONTEXTD_CFLAGS) -DG_LOG_DOMAIN=\"ContextKit\" -tests_unit_tests_grouplist_LDADD = $(CONTEXTD_LIBS) $(top_builddir)/libcontextprovider.la - -tests_unit_tests_key_usage_counter_VALASOURCES = \ - tests/unit_tests/test_key_usage_counter.vala \ - $(NULL) - -tests_unit_tests_key_usage_counter_SOURCES = \ - $(tests_unit_tests_key_usage_counter_VALASOURCES:.vala=.c) \ - $(tests_unit_tests_key_usage_counter_VALASOURCES:.vala=.h) \ - $(NULL) - -tests/unit_tests/key_usage_counter.vala.stamp: contextprovider.vapi $(tests_unit_tests_key_usage_counter_VALASOURCES) - $(VALAC) -C --basedir $(top_srcdir) --vapidir=$(top_srcdir)/vapi --pkg gee-1.0 --pkg dbus-glib-1 $^ - touch $@ - -tests_unit_tests_key_usage_counter_CFLAGS = -I$(top_srcdir)/libcontextprovider $(CONTEXTD_CFLAGS) -DG_LOG_DOMAIN=\"ContextKit\" -tests_unit_tests_key_usage_counter_LDADD = $(CONTEXTD_LIBS) $(top_builddir)/libcontextprovider.la - -tests_unit_tests_subscriber_VAPISOURCES = \ - libcontextprovider/intset.vapi \ - $(NULL) - -tests_unit_tests_subscriber_VALASOURCES = \ - libcontextprovider/value_compare.vala \ - libcontextprovider/subscriber.vala \ - libcontextprovider/manager.vala \ - libcontextprovider/key_usage_counter.vala \ - libcontextprovider/string_set.vala \ - libcontextprovider/group.vala \ - libcontextprovider/grouplist.vala \ - libcontextprovider/dbus_interface.vala \ - libcontextprovider/context_provider.vala \ - tests/unit_tests/test_subscriber.vala \ - $(NULL) - -tests_unit_tests_subscriber_GENERATEDSOURCES = \ - $(tests_unit_tests_subscriber_VALASOURCES:.vala=.c) \ - $(tests_unit_tests_subscriber_VALASOURCES:.vala=.h) \ - $(NULL) - -tests_unit_tests_subscriber_SOURCES = \ - $(tests_unit_tests_subscriber_GENERATEDSOURCES) \ - libcontextprovider/intset.c \ - libcontextprovider/intset.h \ - $(NULL) - -tests/unit_tests/subscriber.vala.stamp: $(tests_unit_tests_subscriber_VALASOURCES) $(tests_unit_tests_subscriber_VAPISOURCES) - $(VALAC) -C --basedir $(top_srcdir) --vapidir=$(top_srcdir)/vapi --pkg gee-1.0 --pkg dbus-glib-1 $^ - touch $@ - -tests_unit_tests_subscriber_CFLAGS = -I$(top_srcdir)/libcontextprovider $(CONTEXTD_CFLAGS) -DG_LOG_DOMAIN=\"ContextKit\" -tests_unit_tests_subscriber_LDADD = $(CONTEXTD_LIBS) $(top_builddir)/libcontextprovider.la - -tests_unit_tests_manager_VAPISOURCES = \ - libcontextprovider/intset.vapi \ - $(NULL) - -tests_unit_tests_manager_VALASOURCES = \ - libcontextprovider/value_compare.vala \ - libcontextprovider/manager.vala \ - libcontextprovider/subscriber.vala \ - libcontextprovider/context_provider.vala \ - libcontextprovider/key_usage_counter.vala \ - libcontextprovider/string_set.vala \ - libcontextprovider/group.vala \ - libcontextprovider/grouplist.vala \ - libcontextprovider/dbus_interface.vala \ - tests/unit_tests/test_manager.vala \ - $(NULL) - -tests_unit_tests_manager_GENERATEDSOURCES = \ - $(tests_unit_tests_manager_VALASOURCES:.vala=.c) \ - $(tests_unit_tests_manager_VALASOURCES:.vala=.h) \ - $(NULL) - -tests_unit_tests_manager_SOURCES = \ - $(tests_unit_tests_manager_GENERATEDSOURCES) \ - libcontextprovider/intset.c \ - libcontextprovider/intset.h \ - $(NULL) - -tests/unit_tests/manager.vala.stamp: $(tests_unit_tests_manager_VALASOURCES) $(tests_unit_tests_manager_VAPISOURCES) - $(VALAC) -C --basedir $(top_srcdir) --vapidir=$(top_srcdir)/vapi --pkg gee-1.0 --pkg dbus-glib-1 $^ - touch $@ - -tests_unit_tests_manager_CFLAGS = -I$(top_srcdir)/libcontextprovider $(CONTEXTD_CFLAGS) -DG_LOG_DOMAIN=\"ContextKit\" -tests_unit_tests_manager_LDADD = $(CONTEXTD_LIBS) $(top_builddir)/libcontextprovider.la - -EXTRA_DIST += \ - $(tests_unit_tests_intset_VALASOURCES) \ - $(tests_unit_tests_intset_VAPISOURCES) \ - $(tests_unit_tests_intset_GENERATEDSOURCES) \ - tests/unit_tests/intset.vala.stamp \ - $(tests_unit_tests_stringset_VALASOURCES) \ - $(tests_unit_tests_stringset_VAPISOURCES) \ - $(tests_unit_tests_stringset_GENERATEDSOURCES) \ - tests/unit_tests/stringset.vala.stamp \ - $(tests_unit_tests_value_compare_VALASOURCES) \ - $(tests_unit_tests_value_compare_SOURCES) \ - tests/unit_tests/value_compare.vala.stamp \ - $(tests_unit_tests_group_VALASOURCES) \ - $(tests_unit_tests_group_SOURCES) \ - tests/unit_tests/group.vala.stamp \ - $(tests_unit_tests_grouplist_VALASOURCES) \ - $(tests_unit_tests_grouplist_SOURCES) \ - tests/unit_tests/grouplist.vala.stamp \ - $(tests_unit_tests_key_usage_counter_VALASOURCES) \ - $(tests_unit_tests_key_usage_counter_SOURCES) \ - tests/unit_tests/key_usage_counter.vala.stamp \ - $(tests_unit_tests_subscriber_VALASOURCES) \ - $(tests_unit_tests_subscriber_VAPISOURCES) \ - $(tests_unit_tests_subscriber_GENERATEDSOURCES) \ - tests/unit_tests/subscriber.vala.stamp \ - $(tests_unit_tests_manager_VALASOURCES) \ - $(tests_unit_tests_manager_VAPISOURCES) \ - $(tests_unit_tests_manager_GENERATEDSOURCES) \ - tests/unit_tests/manager.vala.stamp \ - $(NULL) - -DISTCLEANFILES += \ - $(NULL) - -MAINTAINERCLEANFILES += \ - $(tests_unit_tests_intset_GENERATEDSOURCES) \ - tests/unit_tests/intset.vala.stamp \ - $(tests_unit_tests_stringset_GENERATEDSOURCES) \ - tests/unit_tests/stringset.vala.stamp \ - $(tests_unit_tests_value_compare_SOURCES) \ - tests/unit_tests/value_compare.vala.stamp \ - $(tests_unit_tests_group_SOURCES) \ - tests/unit_tests/group.vala.stamp \ - $(tests_unit_tests_grouplist_SOURCES) \ - tests/unit_tests/grouplist.vala.stamp \ - $(tests_unit_tests_key_usage_counter_SOURCES) \ - tests/unit_tests/key_usage_counter.vala.stamp \ - $(tests_unit_tests_subscriber_GENERATEDSOURCES) \ - tests/unit_tests/subscriber.vala.stamp \ - $(tests_unit_tests_manager_GENERATEDSOURCES) \ - tests/unit_tests/manager.vala.stamp \ - $(NULL) diff --git a/tools/Makefile.am b/tools/Makefile.am deleted file mode 100644 index 730e8f1d..00000000 --- a/tools/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -EXTRA_DIST = git-make-dist autogen-helpers.sh diff --git a/tools/add-release-tag b/tools/add-release-tag deleted file mode 100755 index 12188b1f..00000000 --- a/tools/add-release-tag +++ /dev/null @@ -1,24 +0,0 @@ -#! /bin/sh - -# add-release-tag -- turn a skeleton source tree that is appropriate for -# trunk or a branch into a full source tree that is -# appropriate for a tag. -# -# We do this by building a dist tarball as a reference and add all -# files that end up in that tarball to subversion. -# - -tarname=$1 -version=$2 - -git checkout -b tmp -./autogen.sh --enable-gtk-doc -make -make dist distdir=$tarname - -git add -f `tar tzf $tarname.tar.gz | sed s,^$tarname/,,` -git commit -m "Complete for distribution." -git tag -a $version -m "Released $version" -git push --tags -git checkout master -git branch -D tmp diff --git a/tools/autogen-helpers.sh b/tools/autogen-helpers.sh deleted file mode 100644 index 5d0ae52d..00000000 --- a/tools/autogen-helpers.sh +++ /dev/null @@ -1,107 +0,0 @@ -# Not all echo versions allow -n, so we check what is possible. This test is -# based on the one in autoconf. -ECHO_C= -ECHO_N= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ;; - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -# some terminal codes ... -boldface="`tput bold 2>/dev/null`" -normal="`tput sgr0 2>/dev/null`" -printbold() { - echo $ECHO_N "$boldface" $ECHO_C - echo "$@" - echo $ECHO_N "$normal" $ECHO_C -} - -printerr() { - echo "$@" >&2 -} - -# Usage: -# compare_versions MIN_VERSION ACTUAL_VERSION -# returns true if ACTUAL_VERSION >= MIN_VERSION -compare_versions() { - ch_min_version=$1 - ch_actual_version=$2 - ch_status=0 - IFS="${IFS= }"; ch_save_IFS="$IFS"; IFS="." - set $ch_actual_version - for ch_min in $ch_min_version; do - ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes - if [ -z "$ch_min" ]; then break; fi - if [ -z "$ch_cur" ]; then ch_status=1; break; fi - if [ $ch_cur -gt $ch_min ]; then break; fi - if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi - done - IFS="$ch_save_IFS" - return $ch_status -} - -# Usage: -# version_check PACKAGE VARIABLE CHECKPROGS MIN_VERSION SOURCE -# checks to see if the package is available -version_check() { - vc_package=$1 - vc_variable=$2 - vc_checkprogs=$3 - vc_min_version=$4 - vc_source=$5 - vc_status=1 - - vc_checkprog=`eval echo "\\$$vc_variable"` - if [ -n "$vc_checkprog" ]; then - printbold "using $vc_checkprog for $vc_package" - return 0 - fi - - if test "x$vc_package" = "xautomake" -a "x$vc_min_version" = "x1.4"; then - vc_comparator="=" - else - vc_comparator=">=" - fi - printbold "checking for $vc_package $vc_comparator $vc_min_version..." - for vc_checkprog in $vc_checkprogs; do - echo $ECHO_N " testing $vc_checkprog... " $ECHO_C - if $vc_checkprog --version < /dev/null > /dev/null 2>&1; then - vc_actual_version=`$vc_checkprog --version | head -n 1 | \ - sed 's/^.*[ ]\([0-9.]*[a-z]*\).*$/\1/'` - if compare_versions $vc_min_version $vc_actual_version; then - echo "found $vc_actual_version" - # set variables - eval "$vc_variable=$vc_checkprog; \ - ${vc_variable}_VERSION=$vc_actual_version" - vc_status=0 - break - else - echo "too old (found version $vc_actual_version)" - fi - else - echo "not found." - fi - done - if [ "$vc_status" != 0 ]; then - printerr "***Error***: You must have $vc_package $vc_comparator $vc_min_version installed" - printerr " to build $PKG_NAME. Download the appropriate package for" - printerr " from your distribution or get the source tarball at" - printerr " $vc_source" - printerr - exit $vc_status - fi - return $vc_status -} - -existence_check () { - printbold checking for $1... - if ! which $1 >/dev/null; then - printerr "***Error***: You must have $1 installed to hack on $PKG_NAME." - fi -} - |