diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 763e6014..430b9c37 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -13,67 +13,8 @@ env: TESTS_TIMEOUT: 10 # in minutes jobs: - check-autotools: - name: Build with gcc and test - runs-on: ubuntu-22.04 - steps: - - name: Install Dependencies - run: | - sudo apt-get update - sudo apt-get install -y libglib2.0 attr automake appstream-compose gettext autopoint bison dbus gtk-doc-tools \ - libfuse-dev ostree libostree-dev libarchive-dev libcap-dev libattr1-dev libdw-dev libelf-dev \ - libjson-glib-dev shared-mime-info desktop-file-utils libpolkit-agent-1-dev libpolkit-gobject-1-dev \ - libseccomp-dev libsystemd-dev libxml2-utils libgpgme11-dev gobject-introspection \ - libgirepository1.0-dev libappstream-dev libdconf-dev clang socat flatpak \ - libcurl4-gnutls-dev libflatpak-dev libyaml-dev elfutils git patch unzip - - name: Check out flatpak - uses: actions/checkout@v4 - with: - submodules: true - - name: configure - # TODO: Enable gtk-doc builds - run: ./autogen.sh - env: - CFLAGS: -fsanitize=undefined -fsanitize-undefined-trap-on-error -fsanitize=address -O2 -Wp,-D_FORTIFY_SOURCE=2 - - name: Build flatpak - run: make -j $(getconf _NPROCESSORS_ONLN) - - name: Run tests - run: make check - env: - ASAN_OPTIONS: detect_leaks=0 # Right now we're not fully clean, but this gets us use-after-free etc - - name: Check distribution - run: make distcheck - env: - ASAN_OPTIONS: detect_leaks=0 - - clang: - name: Build with clang - runs-on: ubuntu-22.04 - steps: - - name: Install Dependencies - run: | - sudo apt-get update - sudo apt-get install -y libglib2.0 attr automake appstream-compose gettext autopoint bison dbus gtk-doc-tools \ - libfuse-dev ostree libostree-dev libarchive-dev libcap-dev libattr1-dev libdw-dev libelf-dev \ - libjson-glib-dev shared-mime-info desktop-file-utils libpolkit-agent-1-dev libpolkit-gobject-1-dev \ - libseccomp-dev libsystemd-dev libxml2-utils libgpgme11-dev gobject-introspection \ - libgirepository1.0-dev libappstream-dev libdconf-dev clang flatpak \ - libcurl4-gnutls-dev libflatpak-dev libyaml-dev elfutils git patch unzip - - name: Check out flatpak - uses: actions/checkout@v4 - with: - submodules: true - - name: configure - # We disable introspection because it fails with clang: https://bugzilla.redhat.com/show_bug.cgi?id=1543295 - run: ./autogen.sh --disable-introspection - env: - CC: clang - CFLAGS: -Werror=unused-variable - - name: Build flatpak - run: make -j $(getconf _NPROCESSORS_ONLN) - - check-meson: - name: Ubuntu 22.04 meson build + check: + name: Ubuntu 22.04 build runs-on: ubuntu-22.04 strategy: matrix: diff --git a/.papr.yml b/.papr.yml deleted file mode 100644 index b6898422..00000000 --- a/.papr.yml +++ /dev/null @@ -1,39 +0,0 @@ -# This PAPR file is mostly inspired by the one in projectatomic/rpm-ostree; -# if making enhancements here, consider doing them there first. -branches: - - master - - auto - - try - -required: true -context: f28-primary - -# This test case wants an "unprivileged container with bubblewrap", -# which we don't have right now; so just provision a VM and do a -# docker --privileged run. -host: - distro: fedora/28/atomic - -env: - # TODO: CFLAGS: Readd -fsanitize-undefined-trap-on-error -fsanitize=address after debugging - # https://github.com/flatpak/flatpak/pull/849#issuecomment-308483205 - CFLAGS: '-fsanitize=undefined -O2 -Wp,-D_FORTIFY_SOURCE=2' - ASAN_OPTIONS: 'detect_leaks=0' # Right now we're not fully clean, but this gets us use-after-free etc - # TODO when we're doing leak checks: G_SLICE: "always-malloc" - -# copy yum.repos.d to get any injected repos from the host, which -# will point to a closer mirror -tests: - - docker run --privileged --rm - -e "CFLAGS=${CFLAGS:-}" - -e "ASAN_OPTIONS=${ASAN_OPTIONS:-}" - -v /etc/yum.repos.d:/etc/yum.repos.d.host:ro - -v $(pwd):/srv/code -w /srv/code - registry.fedoraproject.org/fedora:28 /bin/sh -c - "cp -fv /etc/yum.repos.d{.host/*.repo,} && - ./ci/build-check.sh" - -timeout: 30m - -artifacts: - - test-suite.log diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 0b698f3d..00000000 --- a/Makefile.am +++ /dev/null @@ -1,114 +0,0 @@ -NULL = - -bin_PROGRAMS = $(NULL) -dist_installed_test_extra_scripts = $(NULL) -noinst_PROGRAMS = $(NULL) -noinst_LTLIBRARIES = $(NULL) -libexec_PROGRAMS = $(NULL) -CLEANFILES = $(NULL) -MAINTAINERCLEANFILES = $(NULL) -DISTCLEANFILES= $(NULL) -BUILT_SOURCES = $(NULL) -EXTRA_DIST = - -include $(top_srcdir)/buildutil/glib-tap.mk - -SUBDIRS = data - -if BUILD_DOCUMENTATION -SUBDIRS += . doc -endif - -FLATPAK_BINDIR=$(bindir) -ACLOCAL_AMFLAGS = -I m4 -I subprojects/libglnx ${ACLOCAL_FLAGS} -AM_CPPFLAGS = \ - -DFLATPAK_BINDIR=\"$(FLATPAK_BINDIR)\" \ - -DFLATPAK_BASEDIR=\"$(pkgdatadir)\" \ - -DG_LOG_DOMAIN=\"flatpak-builder\" \ - -I$(srcdir)/subprojects \ - -I$(srcdir)/subprojects/libglnx \ - -I$(srcdir)/subprojects/debugedit \ - -include "config.h" \ - $(NULL) - -AM_CFLAGS = $(WARN_CFLAGS) - -if WITH_SYSTEM_DEBUGEDIT -AM_CPPFLAGS += -DDEBUGEDIT=\"$(DEBUGEDIT)\" -else -AM_CPPFLAGS += -DDEBUGEDIT=\"$(libexecdir)/flatpak-builder-debugedit\" -endif - -lib_LTLIBRARIES = -noinst_LTLIBRARIES += libglnx.la -libglnx_srcpath := $(srcdir)/subprojects/libglnx -libglnx_cflags := \ - $(BASE_CFLAGS) \ - "-I$(libglnx_srcpath)" \ - -std=gnu99 \ - $(HIDDEN_VISIBILITY_CFLAGS) \ - $(NULL) -libglnx_libs := $(BASE_LIBS) -include subprojects/libglnx/Makefile-libglnx.am.inc - -include src/Makefile.am.inc -include tests/Makefile.am.inc - -if !WITH_SYSTEM_DEBUGEDIT - -libexec_PROGRAMS+=flatpak-builder-debugedit -flatpak_builder_debugedit_SOURCES = \ - subprojects/debugedit/tools/debugedit.c \ - subprojects/debugedit/tools/hashtab.c \ - subprojects/debugedit/tools/hashtab.h \ - subprojects/debugedit/tools/md5.c \ - subprojects/debugedit/tools/md5.h \ - subprojects/debugedit/tools/sha1.c \ - subprojects/debugedit/tools/sha1.h \ - subprojects/debugedit/tools/ansidecl.h \ - $(NULL) -flatpak_builder_debugedit_LDADD = \ - $(AM_LDADD) $(BASE_LIBS) \ - $(LIBELF_LIBS) $(LIBDW_LIBS) \ - $(NULL) -flatpak_builder_debugedit_CFLAGS = \ - $(AM_CFLAGS) $(BASE_CFLAGS) \ - -Isubprojects/debugedit \ - -DVERSION="\"@PACKAGE_VERSION@\"" \ - -Wno-format-nonliteral \ - $(NULL) - -endif # !WITH_SYSTEM_DEBUGEDIT - -EXTRA_DIST += \ - README.md \ - meson.build \ - meson_options.txt \ - doc/meson.build \ - src/meson.build \ - tests/meson.build \ - tests/tap.test.in \ - tests/test-keyring/meson.build \ - tests/test-keyring2/meson.build \ - subprojects/libglnx.wrap \ - subprojects/libglnx/meson.build \ - subprojects/libglnx/meson_options.txt \ - subprojects/libglnx/tests/meson.build \ - subprojects/libyaml.wrap \ - $(NULL) - -AM_DISTCHECK_CONFIGURE_FLAGS = \ - --enable-documentation \ - --disable-maintainer-mode \ - --enable-introspection - -distcheck-hook: distcheck-hook-meson -distcheck-hook-meson: - set -e; if command -v meson > /dev/null; then \ - cd $(distdir); \ - pwd; \ - meson setup -Dinstalled_tests=true _build/meson; \ - meson compile -C _build/meson -v; \ - meson test -C _build/meson -v; \ - rm -fr _build/meson; \ - fi diff --git a/acinclude.m4 b/acinclude.m4 deleted file mode 100644 index 92ec3985..00000000 --- a/acinclude.m4 +++ /dev/null @@ -1,416 +0,0 @@ -# Checks the location of the XML Catalog -# Usage: -# JH_PATH_XML_CATALOG([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# Defines XMLCATALOG and XML_CATALOG_FILE substitutions -AC_DEFUN([JH_PATH_XML_CATALOG], -[ - # check for the presence of the XML catalog - AC_ARG_WITH([xml-catalog], - AC_HELP_STRING([--with-xml-catalog=CATALOG], - [path to xml catalog to use]),, - [with_xml_catalog=/etc/xml/catalog]) - jh_found_xmlcatalog=true - XML_CATALOG_FILE="$with_xml_catalog" - AC_SUBST([XML_CATALOG_FILE]) - AC_MSG_CHECKING([for XML catalog ($XML_CATALOG_FILE)]) - if test -f "$XML_CATALOG_FILE"; then - AC_MSG_RESULT([found]) - else - jh_found_xmlcatalog=false - AC_MSG_RESULT([not found]) - fi - - # check for the xmlcatalog program - AC_PATH_PROG(XMLCATALOG, xmlcatalog, no) - if test "x$XMLCATALOG" = xno; then - jh_found_xmlcatalog=false - fi - - if $jh_found_xmlcatalog; then - ifelse([$1],,[:],[$1]) - else - ifelse([$2],,[AC_MSG_ERROR([could not find XML catalog])],[$2]) - fi -]) - -# Checks if a particular URI appears in the XML catalog -# Usage: -# JH_CHECK_XML_CATALOG(URI, [FRIENDLY-NAME], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -AC_DEFUN([JH_CHECK_XML_CATALOG], -[ - AC_REQUIRE([JH_PATH_XML_CATALOG],[JH_PATH_XML_CATALOG(,[:])])dnl - AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog]) - if $jh_found_xmlcatalog && \ - AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then - AC_MSG_RESULT([found]) - ifelse([$3],,,[$3 -])dnl - else - AC_MSG_RESULT([not found]) - ifelse([$4],, - [AC_MSG_ERROR([could not find ifelse([$2],,[$1],[$2]) in XML catalog])], - [$4]) - fi -]) - -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_valgrind_check.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_VALGRIND_CHECK() -# -# DESCRIPTION -# -# Checks whether Valgrind is present and, if so, allows running `make -# check` under a variety of Valgrind tools to check for memory and -# threading errors. -# -# Defines VALGRIND_CHECK_RULES which should be substituted in your -# Makefile; and $enable_valgrind which can be used in subsequent configure -# output. VALGRIND_ENABLED is defined and substituted, and corresponds to -# the value of the --enable-valgrind option, which defaults to being -# enabled if Valgrind is installed and disabled otherwise. -# -# If unit tests are written using a shell script and automake's -# LOG_COMPILER system, the $(VALGRIND) variable can be used within the -# shell scripts to enable Valgrind, as described here: -# -# https://www.gnu.org/software/gnulib/manual/html_node/Running-self_002dtests-under-valgrind.html -# -# Usage example: -# -# configure.ac: -# -# AX_VALGRIND_CHECK -# -# Makefile.am: -# -# @VALGRIND_CHECK_RULES@ -# VALGRIND_SUPPRESSIONS_FILES = my-project.supp -# EXTRA_DIST = my-project.supp -# -# This results in a "check-valgrind" rule being added to any Makefile.am -# which includes "@VALGRIND_CHECK_RULES@" (assuming the module has been -# configured with --enable-valgrind). Running `make check-valgrind` in -# that directory will run the module's test suite (`make check`) once for -# each of the available Valgrind tools (out of memcheck, helgrind, drd and -# sgcheck), and will output results to test-suite-$toolname.log for each. -# The target will succeed if there are zero errors and fail otherwise. -# -# The macro supports running with and without libtool. -# -# LICENSE -# -# Copyright (c) 2014, 2015 Philip Withnall -# -# 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. This file is offered as-is, without any -# warranty. - -#serial 4 - -AC_DEFUN([AX_VALGRIND_CHECK],[ - dnl Check for --enable-valgrind - AC_MSG_CHECKING([whether to enable Valgrind on the unit tests]) - AC_ARG_ENABLE([valgrind], - [AS_HELP_STRING([--enable-valgrind], [Whether to enable Valgrind on the unit tests])], - [enable_valgrind=$enableval],[enable_valgrind=]) - - # Check for Valgrind. - AC_CHECK_PROG([VALGRIND],[valgrind],[valgrind]) - - AS_IF([test "$enable_valgrind" = "yes" -a "$VALGRIND" = ""],[ - AC_MSG_ERROR([Could not find valgrind; either install it or reconfigure with --disable-valgrind]) - ]) - AS_IF([test "$enable_valgrind" != "no"],[enable_valgrind=yes]) - - AM_CONDITIONAL([VALGRIND_ENABLED],[test "$enable_valgrind" = "yes"]) - AC_SUBST([VALGRIND_ENABLED],[$enable_valgrind]) - AC_MSG_RESULT([$enable_valgrind]) - - # Check for Valgrind tools we care about. - #m4_define([valgrind_tool_list],[[memcheck], [helgrind], [drd], [exp-sgcheck]]) - # I trimmed this, because we fail on all the thread stuff - m4_define([valgrind_tool_list],[[memcheck]]) - - AS_IF([test "$VALGRIND" != ""],[ - m4_foreach([vgtool],[valgrind_tool_list],[ - m4_define([vgtooln],AS_TR_SH(vgtool)) - m4_define([ax_cv_var],[ax_cv_valgrind_tool_]vgtooln) - AC_CACHE_CHECK([for Valgrind tool ]vgtool,ax_cv_var,[ - ax_cv_var= - AS_IF([`$VALGRIND --tool=vgtool --help >/dev/null 2>&1`],[ - ax_cv_var="vgtool" - ]) - ]) - - AC_SUBST([VALGRIND_HAVE_TOOL_]vgtooln,[$ax_cv_var]) - ]) - ]) - -VALGRIND_CHECK_RULES=' -# Valgrind check -# -# Optional: -# - VALGRIND_SUPPRESSIONS_FILES: Space-separated list of Valgrind suppressions -# files to load. (Default: empty) -# - VALGRIND_FLAGS: General flags to pass to all Valgrind tools. -# (Default: --num-callers=30) -# - VALGRIND_$toolname_FLAGS: Flags to pass to Valgrind $toolname (one of: -# memcheck, helgrind, drd, sgcheck). (Default: various) - -# Optional variables -VALGRIND_SUPPRESSIONS ?= $(addprefix --suppressions=,$(VALGRIND_SUPPRESSIONS_FILES)) -VALGRIND_FLAGS ?= --num-callers=30 -VALGRIND_memcheck_FLAGS ?= --leak-check=full --show-reachable=no -VALGRIND_helgrind_FLAGS ?= --history-level=approx -VALGRIND_drd_FLAGS ?= -VALGRIND_sgcheck_FLAGS ?= - -# Internal use -valgrind_tools = memcheck helgrind drd sgcheck -valgrind_log_files = $(addprefix test-suite-,$(addsuffix .log,$(valgrind_tools))) - -valgrind_memcheck_flags = --tool=memcheck $(VALGRIND_memcheck_FLAGS) -valgrind_helgrind_flags = --tool=helgrind $(VALGRIND_helgrind_FLAGS) -valgrind_drd_flags = --tool=drd $(VALGRIND_drd_FLAGS) -valgrind_sgcheck_flags = --tool=exp-sgcheck $(VALGRIND_sgcheck_FLAGS) - -valgrind_quiet = $(valgrind_quiet_$(V)) -valgrind_quiet_ = $(valgrind_quiet_$(AM_DEFAULT_VERBOSITY)) -valgrind_quiet_0 = --quiet - -# Support running with and without libtool. -ifneq ($(LIBTOOL),) -valgrind_lt = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=execute -else -valgrind_lt = -endif - -# Use recursive makes in order to ignore errors during check -check-valgrind: -ifeq ($(VALGRIND_ENABLED),yes) - -$(foreach tool,$(valgrind_tools), \ - $(if $(VALGRIND_HAVE_TOOL_$(tool))$(VALGRIND_HAVE_TOOL_exp_$(tool)), \ - $(MAKE) $(AM_MAKEFLAGS) -k check-valgrind-tool VALGRIND_TOOL=$(tool); \ - ) \ - ) -else - @echo "Need to reconfigure with --enable-valgrind" -endif - -# Valgrind running -VALGRIND_TESTS_ENVIRONMENT = \ - $(TESTS_ENVIRONMENT) \ - env VALGRIND=$(VALGRIND) \ - G_SLICE=always-malloc,debug-blocks \ - G_DEBUG=fatal-warnings,fatal-criticals,gc-friendly - -VALGRIND_LOG_COMPILER = \ - $(valgrind_lt) \ - $(VALGRIND) $(VALGRIND_SUPPRESSIONS) --error-exitcode=1 $(VALGRIND_FLAGS) - -check-valgrind-tool: -ifeq ($(VALGRIND_ENABLED),yes) - $(MAKE) check-TESTS \ - TESTS_ENVIRONMENT="$(VALGRIND_TESTS_ENVIRONMENT)" \ - LOG_COMPILER="$(VALGRIND_LOG_COMPILER)" \ - LOG_FLAGS="$(valgrind_$(VALGRIND_TOOL)_flags)" \ - TEST_SUITE_LOG=test-suite-$(VALGRIND_TOOL).log -else - @echo "Need to reconfigure with --enable-valgrind" -endif - -DISTCHECK_CONFIGURE_FLAGS ?= -DISTCHECK_CONFIGURE_FLAGS += --disable-valgrind - -MOSTLYCLEANFILES ?= -MOSTLYCLEANFILES += $(valgrind_log_files) - -.PHONY: check-valgrind check-valgrind-tool -' - - AC_SUBST([VALGRIND_CHECK_RULES]) - m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([VALGRIND_CHECK_RULES])]) -]) - -# =========================================================================== -# http://www.gnu.org/software/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 -# -# 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. This file is offered as-is, without any -# warranty. - -#serial 11 - -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/autogen.sh b/autogen.sh deleted file mode 100755 index dfab02b7..00000000 --- a/autogen.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# Run this to generate all the initial makefiles, etc. - -test -n "$srcdir" || srcdir=`dirname "$0"` -test -n "$srcdir" || srcdir=. - -olddir=`pwd` -cd "$srcdir" - -AUTORECONF=`which autoreconf` -if test -z $AUTORECONF; then - echo "*** No autoreconf found, please install it ***" - exit 1 -fi - -# INSTALL are required by automake, but may be deleted by clean -# up rules. to get automake to work, simply touch these here, they will be -# regenerated from their corresponding *.in files by ./configure anyway. -touch INSTALL - -if ! test -f libglnx/README.md; then - git submodule update --init -fi -# Workaround automake bug with subdir-objects and computed paths -sed -e 's,$(libglnx_srcpath),subprojects/libglnx,g' \ - < subprojects/libglnx/Makefile-libglnx.am \ - > subprojects/libglnx/Makefile-libglnx.am.inc - -autoreconf --force --install --verbose || exit $? - -cd "$olddir" -test -n "$NOCONFIGURE" || "$srcdir/configure" "$@" diff --git a/buildutil/glib-tap.mk b/buildutil/glib-tap.mk deleted file mode 100644 index ea396afb..00000000 --- a/buildutil/glib-tap.mk +++ /dev/null @@ -1,129 +0,0 @@ -# GLIB - Library of useful C routines - -TESTS_ENVIRONMENT= \ - G_TEST_SRCDIR="$(abs_srcdir)/tests" \ - G_TEST_BUILDDIR="$(abs_builddir)/tests" \ - UNINSTALLEDTESTS=1 \ - G_DEBUG=gc-friendly \ - MALLOC_CHECK_=2 \ - MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) -LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/buildutil/tap-driver.sh -LOG_COMPILER = $(top_srcdir)/buildutil/tap-test - -TESTS = - -installed_test_LTLIBRARIES = -installed_test_PROGRAMS = -installed_test_SCRIPTS = -installed_test_DATA = -nobase_installed_test_DATA = - -noinst_SCRIPTS = -noinst_DATA = - -check_LTLIBRARIES = -check_PROGRAMS = -check_SCRIPTS = -check_DATA = - -EXTRA_DIST += buildutil/tap-driver.sh buildutil/tap-test - -# We support a fairly large range of possible variables. It is expected that all types of files in a test suite -# will belong in exactly one of the following variables. -# -# First, we support the usual automake suffixes, but in lowercase, with the customary meaning: -# -# test_programs, test_scripts, test_data, test_ltlibraries -# -# The above are used to list files that are involved in both uninstalled and installed testing. The -# test_programs and test_scripts are taken to be actual testcases and will be run as part of the test suite. -# Note that _data is always used with the nobase_ automake variable name to ensure that installed test data is -# installed in the same way as it appears in the package layout. -# -# In order to mark a particular file as being only for one type of testing, use 'installed' or 'uninstalled', -# like so: -# -# installed_test_programs, uninstalled_test_programs -# installed_test_scripts, uninstalled_test_scripts -# installed_test_data, uninstalled_test_data -# installed_test_ltlibraries, uninstalled_test_ltlibraries -# -# Additionally, we support 'extra' infixes for programs and scripts. This is used for support programs/scripts -# that should not themselves be run as testcases (but exist to be used from other testcases): -# -# test_extra_programs, installed_test_extra_programs, uninstalled_test_extra_programs -# test_extra_scripts, installed_test_extra_scripts, uninstalled_test_extra_scripts -# -# Additionally, for _scripts and _data, we support the customary dist_ prefix so that the named script or data -# file automatically end up in the tarball. -# -# dist_test_scripts, dist_test_data, dist_test_extra_scripts -# dist_installed_test_scripts, dist_installed_test_data, dist_installed_test_extra_scripts -# dist_uninstalled_test_scripts, dist_uninstalled_test_data, dist_uninstalled_test_extra_scripts -# -# Note that no file is automatically dist-ed unless it appears in one of the dist_ variables. This follows the -# standard automake convention of not dist-ing programs scripts or data by default. -# -# test_programs, test_scripts, uninstalled_test_programs and uninstalled_test_scripts (as well as their dist-ed -# variants) will be run as part of the in-tree 'make check'. These are all assumed to be runnable under -# gtester. That's a bit strange for scripts, but it's possible. - -TESTS += $(test_programs) $(test_scripts) $(uninstalled_test_programs) $(uninstalled_test_scripts) \ - $(dist_test_scripts) $(dist_uninstalled_test_scripts) - -# Note: build even the installed-only targets during 'make check' to ensure that they still work. -# We need to do a bit of trickery here and manage dist-ing via EXTRA_DIST instead of using dist_ prefixes to -# prevent automake from mistreating gmake functions like $(wildcard ...) and $(addprefix ...) as if they were -# filenames, including removing duplicate instances of the opening part before the space, eg. '$(addprefix'. -all_test_programs = $(test_programs) $(uninstalled_test_programs) $(installed_test_programs) \ - $(test_extra_programs) $(uninstalled_test_extra_programs) $(installed_test_extra_programs) -all_test_scripts = $(test_scripts) $(uninstalled_test_scripts) $(installed_test_scripts) \ - $(test_extra_scripts) $(uninstalled_test_extra_scripts) $(installed_test_extra_scripts) -all_dist_test_scripts = $(dist_test_scripts) $(dist_uninstalled_test_scripts) $(dist_installed_test_scripts) \ - $(dist_test_extra_scripts) $(dist_uninstalled_test_extra_scripts) $(dist_installed_test_extra_scripts) -all_test_scripts += $(all_dist_test_scripts) -EXTRA_DIST += $(all_dist_test_scripts) -all_test_data = $(test_data) $(uninstalled_test_data) $(installed_test_data) -all_dist_test_data = $(dist_test_data) $(dist_uninstalled_test_data) $(dist_installed_test_data) -all_test_data += $(all_dist_test_data) -EXTRA_DIST += $(all_dist_test_data) -all_test_ltlibs = $(test_ltlibraries) $(uninstalled_test_ltlibraries) $(installed_test_ltlibraries) - -if ENABLE_ALWAYS_BUILD_TESTS -noinst_LTLIBRARIES += $(all_test_ltlibs) -noinst_PROGRAMS += $(all_test_programs) -noinst_SCRIPTS += $(all_test_scripts) -noinst_DATA += $(all_test_data) -else -check_LTLIBRARIES += $(all_test_ltlibs) -check_PROGRAMS += $(all_test_programs) -check_SCRIPTS += $(all_test_scripts) -check_DATA += $(all_test_data) -endif - -if ENABLE_INSTALLED_TESTS -installed_test_PROGRAMS += $(test_programs) $(installed_test_programs) \ - $(test_extra_programs) $(installed_test_extra_programs) -installed_test_SCRIPTS += $(test_scripts) $(installed_test_scripts) \ - $(test_extra_scripts) $(test_installed_extra_scripts) -installed_test_SCRIPTS += $(dist_test_scripts) $(dist_test_extra_scripts) \ - $(dist_installed_test_scripts) $(dist_installed_test_extra_scripts) -installed_test_DATA += $(test_data) $(installed_test_data) -installed_test_DATA += $(dist_test_data) $(dist_installed_test_data) -installed_test_LTLIBRARIES += $(test_ltlibraries) $(installed_test_ltlibraries) -installed_testcases = $(test_programs) $(installed_test_programs) \ - $(test_scripts) $(installed_test_scripts) \ - $(dist_test_scripts) $(dist_installed_test_scripts) - -installed_test_meta_DATA = $(installed_testcases:=.test) - -%.test: %$(EXEEXT) Makefile - $(AM_V_GEN) (mkdir -p $(@D); \ - echo '[Test]' > $@.tmp; \ - echo 'Type=session' >> $@.tmp; \ - echo 'Exec=env G_TEST_SRCDIR=$(installed_testdir) G_TEST_BUILDDIR=$(installed_testdir) $(installed_testdir)/$(notdir $<) --tap' >> $@.tmp; \ - echo 'Output=TAP' >> $@.tmp; \ - mv $@.tmp $@) - -CLEANFILES += $(installed_test_meta_DATA) -endif diff --git a/buildutil/tap-driver.sh b/buildutil/tap-driver.sh deleted file mode 100755 index ea060f84..00000000 --- a/buildutil/tap-driver.sh +++ /dev/null @@ -1,652 +0,0 @@ -#! /bin/sh -# Copyright (C) 2011-2013 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -scriptversion=2011-12-27.17; # UTC - -# Make unconditional expansion of undefined variables an error. This -# helps a lot in preventing typo-related bugs. -set -u - -me=tap-driver.sh - -fatal () -{ - echo "$me: fatal: $*" >&2 - exit 1 -} - -usage_error () -{ - echo "$me: $*" >&2 - print_usage >&2 - exit 2 -} - -print_usage () -{ - cat < - # - trap : 1 3 2 13 15 - if test $merge -gt 0; then - exec 2>&1 - else - exec 2>&3 - fi - "$@" - echo $? - ) | LC_ALL=C ${AM_TAP_AWK-awk} \ - -v me="$me" \ - -v test_script_name="$test_name" \ - -v log_file="$log_file" \ - -v trs_file="$trs_file" \ - -v expect_failure="$expect_failure" \ - -v merge="$merge" \ - -v ignore_exit="$ignore_exit" \ - -v comments="$comments" \ - -v diag_string="$diag_string" \ -' -# FIXME: the usages of "cat >&3" below could be optimized when using -# FIXME: GNU awk, and/on on systems that supports /dev/fd/. - -# Implementation note: in what follows, `result_obj` will be an -# associative array that (partly) simulates a TAP result object -# from the `TAP::Parser` perl module. - -## ----------- ## -## FUNCTIONS ## -## ----------- ## - -function fatal(msg) -{ - print me ": " msg | "cat >&2" - exit 1 -} - -function abort(where) -{ - fatal("internal error " where) -} - -# Convert a boolean to a "yes"/"no" string. -function yn(bool) -{ - return bool ? "yes" : "no"; -} - -function add_test_result(result) -{ - if (!test_results_index) - test_results_index = 0 - test_results_list[test_results_index] = result - test_results_index += 1 - test_results_seen[result] = 1; -} - -# Whether the test script should be re-run by "make recheck". -function must_recheck() -{ - for (k in test_results_seen) - if (k != "XFAIL" && k != "PASS" && k != "SKIP") - return 1 - return 0 -} - -# Whether the content of the log file associated to this test should -# be copied into the "global" test-suite.log. -function copy_in_global_log() -{ - for (k in test_results_seen) - if (k != "PASS") - return 1 - return 0 -} - -# FIXME: this can certainly be improved ... -function get_global_test_result() -{ - if ("ERROR" in test_results_seen) - return "ERROR" - if ("FAIL" in test_results_seen || "XPASS" in test_results_seen) - return "FAIL" - all_skipped = 1 - for (k in test_results_seen) - if (k != "SKIP") - all_skipped = 0 - if (all_skipped) - return "SKIP" - return "PASS"; -} - -function stringify_result_obj(result_obj) -{ - if (result_obj["is_unplanned"] || result_obj["number"] != testno) - return "ERROR" - - if (plan_seen == LATE_PLAN) - return "ERROR" - - if (result_obj["directive"] == "TODO") - return result_obj["is_ok"] ? "XPASS" : "XFAIL" - - if (result_obj["directive"] == "SKIP") - return result_obj["is_ok"] ? "SKIP" : COOKED_FAIL; - - if (length(result_obj["directive"])) - abort("in function stringify_result_obj()") - - return result_obj["is_ok"] ? COOKED_PASS : COOKED_FAIL -} - -function decorate_result(result) -{ - color_name = color_for_result[result] - if (color_name) - return color_map[color_name] "" result "" color_map["std"] - # If we are not using colorized output, or if we do not know how - # to colorize the given result, we should return it unchanged. - return result -} - -function report(result, details) -{ - if (result ~ /^(X?(PASS|FAIL)|SKIP|ERROR)/) - { - msg = ": " test_script_name - add_test_result(result) - } - else if (result == "#") - { - msg = " " test_script_name ":" - } - else - { - abort("in function report()") - } - if (length(details)) - msg = msg " " details - # Output on console might be colorized. - print decorate_result(result) msg - # Log the result in the log file too, to help debugging (this is - # especially true when said result is a TAP error or "Bail out!"). - print result msg | "cat >&3"; -} - -function testsuite_error(error_message) -{ - report("ERROR", "- " error_message) -} - -function handle_tap_result() -{ - details = result_obj["number"]; - if (length(result_obj["description"])) - details = details " " result_obj["description"] - - if (plan_seen == LATE_PLAN) - { - details = details " # AFTER LATE PLAN"; - } - else if (result_obj["is_unplanned"]) - { - details = details " # UNPLANNED"; - } - else if (result_obj["number"] != testno) - { - details = sprintf("%s # OUT-OF-ORDER (expecting %d)", - details, testno); - } - else if (result_obj["directive"]) - { - details = details " # " result_obj["directive"]; - if (length(result_obj["explanation"])) - details = details " " result_obj["explanation"] - } - - report(stringify_result_obj(result_obj), details) -} - -# `skip_reason` should be empty whenever planned > 0. -function handle_tap_plan(planned, skip_reason) -{ - planned += 0 # Avoid getting confused if, say, `planned` is "00" - if (length(skip_reason) && planned > 0) - abort("in function handle_tap_plan()") - if (plan_seen) - { - # Error, only one plan per stream is acceptable. - testsuite_error("multiple test plans") - return; - } - planned_tests = planned - # The TAP plan can come before or after *all* the TAP results; we speak - # respectively of an "early" or a "late" plan. If we see the plan line - # after at least one TAP result has been seen, assume we have a late - # plan; in this case, any further test result seen after the plan will - # be flagged as an error. - plan_seen = (testno >= 1 ? LATE_PLAN : EARLY_PLAN) - # If testno > 0, we have an error ("too many tests run") that will be - # automatically dealt with later, so do not worry about it here. If - # $plan_seen is true, we have an error due to a repeated plan, and that - # has already been dealt with above. Otherwise, we have a valid "plan - # with SKIP" specification, and should report it as a particular kind - # of SKIP result. - if (planned == 0 && testno == 0) - { - if (length(skip_reason)) - skip_reason = "- " skip_reason; - report("SKIP", skip_reason); - } -} - -function extract_tap_comment(line) -{ - if (index(line, diag_string) == 1) - { - # Strip leading `diag_string` from `line`. - line = substr(line, length(diag_string) + 1) - # And strip any leading and trailing whitespace left. - sub("^[ \t]*", "", line) - sub("[ \t]*$", "", line) - # Return what is left (if any). - return line; - } - return ""; -} - -# When this function is called, we know that line is a TAP result line, -# so that it matches the (perl) RE "^(not )?ok\b". -function setup_result_obj(line) -{ - # Get the result, and remove it from the line. - result_obj["is_ok"] = (substr(line, 1, 2) == "ok" ? 1 : 0) - sub("^(not )?ok[ \t]*", "", line) - - # If the result has an explicit number, get it and strip it; otherwise, - # automatically assing the next progressive number to it. - if (line ~ /^[0-9]+$/ || line ~ /^[0-9]+[^a-zA-Z0-9_]/) - { - match(line, "^[0-9]+") - # The final `+ 0` is to normalize numbers with leading zeros. - result_obj["number"] = substr(line, 1, RLENGTH) + 0 - line = substr(line, RLENGTH + 1) - } - else - { - result_obj["number"] = testno - } - - if (plan_seen == LATE_PLAN) - # No further test results are acceptable after a "late" TAP plan - # has been seen. - result_obj["is_unplanned"] = 1 - else if (plan_seen && testno > planned_tests) - result_obj["is_unplanned"] = 1 - else - result_obj["is_unplanned"] = 0 - - # Strip trailing and leading whitespace. - sub("^[ \t]*", "", line) - sub("[ \t]*$", "", line) - - # This will have to be corrected if we have a "TODO"/"SKIP" directive. - result_obj["description"] = line - result_obj["directive"] = "" - result_obj["explanation"] = "" - - if (index(line, "#") == 0) - return # No possible directive, nothing more to do. - - # Directives are case-insensitive. - rx = "[ \t]*#[ \t]*([tT][oO][dD][oO]|[sS][kK][iI][pP])[ \t]*" - - # See whether we have the directive, and if yes, where. - pos = match(line, rx "$") - if (!pos) - pos = match(line, rx "[^a-zA-Z0-9_]") - - # If there was no TAP directive, we have nothing more to do. - if (!pos) - return - - # Let`s now see if the TAP directive has been escaped. For example: - # escaped: ok \# SKIP - # not escaped: ok \\# SKIP - # escaped: ok \\\\\# SKIP - # not escaped: ok \ # SKIP - if (substr(line, pos, 1) == "#") - { - bslash_count = 0 - for (i = pos; i > 1 && substr(line, i - 1, 1) == "\\"; i--) - bslash_count += 1 - if (bslash_count % 2) - return # Directive was escaped. - } - - # Strip the directive and its explanation (if any) from the test - # description. - result_obj["description"] = substr(line, 1, pos - 1) - # Now remove the test description from the line, that has been dealt - # with already. - line = substr(line, pos) - # Strip the directive, and save its value (normalized to upper case). - sub("^[ \t]*#[ \t]*", "", line) - result_obj["directive"] = toupper(substr(line, 1, 4)) - line = substr(line, 5) - # Now get the explanation for the directive (if any), with leading - # and trailing whitespace removed. - sub("^[ \t]*", "", line) - sub("[ \t]*$", "", line) - result_obj["explanation"] = line -} - -function get_test_exit_message(status) -{ - if (status == 0) - return "" - if (status !~ /^[1-9][0-9]*$/) - abort("getting exit status") - if (status < 127) - exit_details = "" - else if (status == 127) - exit_details = " (command not found?)" - else if (status >= 128 && status <= 255) - exit_details = sprintf(" (terminated by signal %d?)", status - 128) - else if (status > 256 && status <= 384) - # We used to report an "abnormal termination" here, but some Korn - # shells, when a child process die due to signal number n, can leave - # in $? an exit status of 256+n instead of the more standard 128+n. - # Apparently, both behaviours are allowed by POSIX (2008), so be - # prepared to handle them both. See also Austing Group report ID - # 0000051 - exit_details = sprintf(" (terminated by signal %d?)", status - 256) - else - # Never seen in practice. - exit_details = " (abnormal termination)" - return sprintf("exited with status %d%s", status, exit_details) -} - -function write_test_results() -{ - print ":global-test-result: " get_global_test_result() > trs_file - print ":recheck: " yn(must_recheck()) > trs_file - print ":copy-in-global-log: " yn(copy_in_global_log()) > trs_file - for (i = 0; i < test_results_index; i += 1) - print ":test-result: " test_results_list[i] > trs_file - close(trs_file); -} - -BEGIN { - -## ------- ## -## SETUP ## -## ------- ## - -'"$init_colors"' - -# Properly initialized once the TAP plan is seen. -planned_tests = 0 - -COOKED_PASS = expect_failure ? "XPASS": "PASS"; -COOKED_FAIL = expect_failure ? "XFAIL": "FAIL"; - -# Enumeration-like constants to remember which kind of plan (if any) -# has been seen. It is important that NO_PLAN evaluates "false" as -# a boolean. -NO_PLAN = 0 -EARLY_PLAN = 1 -LATE_PLAN = 2 - -testno = 0 # Number of test results seen so far. -bailed_out = 0 # Whether a "Bail out!" directive has been seen. - -# Whether the TAP plan has been seen or not, and if yes, which kind -# it is ("early" is seen before any test result, "late" otherwise). -plan_seen = NO_PLAN - -## --------- ## -## PARSING ## -## --------- ## - -is_first_read = 1 - -while (1) - { - # Involutions required so that we are able to read the exit status - # from the last input line. - st = getline - if (st < 0) # I/O error. - fatal("I/O error while reading from input stream") - else if (st == 0) # End-of-input - { - if (is_first_read) - abort("in input loop: only one input line") - break - } - if (is_first_read) - { - is_first_read = 0 - nextline = $0 - continue - } - else - { - curline = nextline - nextline = $0 - $0 = curline - } - # Copy any input line verbatim into the log file. - print | "cat >&3" - # Parsing of TAP input should stop after a "Bail out!" directive. - if (bailed_out) - continue - - # TAP test result. - if ($0 ~ /^(not )?ok$/ || $0 ~ /^(not )?ok[^a-zA-Z0-9_]/) - { - testno += 1 - setup_result_obj($0) - handle_tap_result() - } - # TAP plan (normal or "SKIP" without explanation). - else if ($0 ~ /^1\.\.[0-9]+[ \t]*$/) - { - # The next two lines will put the number of planned tests in $0. - sub("^1\\.\\.", "") - sub("[^0-9]*$", "") - handle_tap_plan($0, "") - continue - } - # TAP "SKIP" plan, with an explanation. - else if ($0 ~ /^1\.\.0+[ \t]*#/) - { - # The next lines will put the skip explanation in $0, stripping - # any leading and trailing whitespace. This is a little more - # tricky in truth, since we want to also strip a potential leading - # "SKIP" string from the message. - sub("^[^#]*#[ \t]*(SKIP[: \t][ \t]*)?", "") - sub("[ \t]*$", ""); - handle_tap_plan(0, $0) - } - # "Bail out!" magic. - # Older versions of prove and TAP::Harness (e.g., 3.17) did not - # recognize a "Bail out!" directive when preceded by leading - # whitespace, but more modern versions (e.g., 3.23) do. So we - # emulate the latter, "more modern" behaviour. - else if ($0 ~ /^[ \t]*Bail out!/) - { - bailed_out = 1 - # Get the bailout message (if any), with leading and trailing - # whitespace stripped. The message remains stored in `$0`. - sub("^[ \t]*Bail out![ \t]*", ""); - sub("[ \t]*$", ""); - # Format the error message for the - bailout_message = "Bail out!" - if (length($0)) - bailout_message = bailout_message " " $0 - testsuite_error(bailout_message) - } - # Maybe we have too look for diagnostic comments too. - else if (comments != 0) - { - comment = extract_tap_comment($0); - if (length(comment)) - report("#", comment); - } - } - -## -------- ## -## FINISH ## -## -------- ## - -# A "Bail out!" directive should cause us to ignore any following TAP -# error, as well as a non-zero exit status from the TAP producer. -if (!bailed_out) - { - if (!plan_seen) - { - testsuite_error("missing test plan") - } - else if (planned_tests != testno) - { - bad_amount = testno > planned_tests ? "many" : "few" - testsuite_error(sprintf("too %s tests run (expected %d, got %d)", - bad_amount, planned_tests, testno)) - } - if (!ignore_exit) - { - # Fetch exit status from the last line. - exit_message = get_test_exit_message(nextline) - if (exit_message) - testsuite_error(exit_message) - } - } - -write_test_results() - -exit 0 - -} # End of "BEGIN" block. -' - -# TODO: document that we consume the file descriptor 3 :-( -} 3>"$log_file" - -test $? -eq 0 || fatal "I/O or internal error" - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/ci/build-check.sh b/ci/build-check.sh deleted file mode 100755 index 24dd348f..00000000 --- a/ci/build-check.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/bash -# Install build dependencies, run unit tests and installed tests. - -set -xeuo pipefail - -dn=$(dirname $0) -. ${dn}/libbuild.sh -${dn}/build.sh -make check - -if test -x /usr/bin/clang; then - git clean -dfx && git submodule foreach git clean -dfx - # And now a clang build to find unused variables; perhaps - # in the future these could parallelize - export CC=clang - export CFLAGS='-Werror=unused-variable' - build -fi diff --git a/ci/build.sh b/ci/build.sh deleted file mode 100755 index 85b30b41..00000000 --- a/ci/build.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/bash -# Install build dependencies, run unit tests and installed tests. - -set -xeuo pipefail - -dn=$(dirname $0) -. ${dn}/libbuild.sh - -pkg_install sudo which attr fuse \ - libubsan libasan libtsan elfutils-libelf-devel libdwarf-devel \ - elfutils git gettext-devel libappstream-devel bison \ - libcurl-devel dconf-devel fuse-devel \ - /usr/bin/{update-mime-database,update-desktop-database,gtk-update-icon-cache} -pkg_install_testing ostree-devel ostree libyaml-devel -pkg_install_if_os fedora gjs parallel clang python2 -pkg_install_builddeps flatpak - -(git clone --depth=1 https://github.com/flatpak/flatpak/ - cd flatpak - unset CFLAGS # the sanitizers require calling apps be linked too - build --disable-introspection - make install - flatpak --version -) - -build --enable-gtk-doc ${CONFIGOPTS:-} diff --git a/ci/libbuild.sh b/ci/libbuild.sh deleted file mode 100644 index be8bea99..00000000 --- a/ci/libbuild.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/bash - -make() { - /usr/bin/make -j $(getconf _NPROCESSORS_ONLN) "$@" -} - -build() { - env NOCONFIGURE=1 ./autogen.sh - ./configure --prefix=/usr --libdir=/usr/lib64 "$@" - make V=1 -} - -pkg_install() { - yum -y install "$@" -} - -pkg_install_testing() { - yum -y --repo=updates-testing clean expire-cache - yum -y install --enablerepo=updates-testing "$@" -} - -pkg_install_if_os() { - os=$1 - shift - (. /etc/os-release; - if test "${os}" = "${ID}"; then - pkg_install "$@" - else - echo "Skipping installation on OS ${ID}: $@" - fi - ) -} - -pkg_builddep() { - # This is sadly the only case where it's a different command - if test -x /usr/bin/dnf; then - dnf builddep -y "$@" - else - yum-builddep -y "$@" - fi -} - -pkg_install_builddeps() { - pkg=$1 - if test -x /usr/bin/dnf; then - yum -y install dnf-plugins-core - yum install -y 'dnf-command(builddep)' - # Base buildroot - pkg_install @buildsys-build - else - yum -y install yum-utils - # Base buildroot, copied from the mock config sadly - yum -y install bash bzip2 coreutils cpio diffutils system-release findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux which xz - fi - # builddeps+runtime deps - pkg_builddep $pkg - pkg_install $pkg - yum -y update gcc gcc-c++ annobin # This had some weird conflict with gcc - rpm -e --nodeps $pkg -} diff --git a/configure.ac b/configure.ac deleted file mode 100644 index d20d4eaf..00000000 --- a/configure.ac +++ /dev/null @@ -1,244 +0,0 @@ -AC_PREREQ([2.63]) - -m4_define([flatpak_builder_major_version], [1]) -m4_define([flatpak_builder_minor_version], [4]) -m4_define([flatpak_builder_micro_version], [2]) -m4_define([flatpak_builder_version], - [flatpak_builder_major_version.flatpak_builder_minor_version.flatpak_builder_micro_version]) - -AC_INIT([flatpak-builder], - [flatpak_builder_version], - [https://github.com/flatpak/flatpak-builder/issues], - [flatpak-builder], - [http://flatpak.org/]) - -AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_66], [Glib min version]) -AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [GLIB_VERSION_2_70], [Glib max version]) - -GLIB_REQS=2.66 -OSTREE_REQS=2017.14 -FLATPAK_REQS=0.99.1 -APPSTREAMCLI_REQS=0.15.0 -SYSTEM_DEBUGEDIT_REQS=5.0 -LIBDW_REQS=0.172 - -AC_USE_SYSTEM_EXTENSIONS -AC_SYS_LARGEFILE -LIBGLNX_CONFIGURE - -AC_PROG_CC -AM_PROG_CC_C_O -AC_PROG_CC_STDC -AC_DISABLE_STATIC - -AC_CHECK_PROG([FLATPAK], [flatpak], [flatpak], [false]) - -if test "x$FLATPAK" = xfalse; then - AC_MSG_ERROR([You need flatpak installed]) -else - FLATPAK_VERSION=`$FLATPAK --version | sed 's,.*\ \([0-9]*\.[0-9]*\.[0-9]*\)$,\1,'` - AX_COMPARE_VERSION([$FLATPAK_REQS],[gt],[$FLATPAK_VERSION], - [AC_MSG_ERROR([You need at least version $FLATPAK_REQS of flatpak, your version is $FLATPAK_VERSION])]) -fi - -AC_CHECK_PROG([APPSTREAMCLI], [appstreamcli], [appstreamcli], [false]) -if test "x$APPSTREAMCLI" = xfalse; then - AC_MSG_ERROR([You need appstreamcli installed]) - APPSTREAMCLI_VERSION=`$APPSTREAMCLI --version | sed 's,.*\ \([0-9]*\.[0-9]*\.[0-9]*\)$,\1,'` - AX_COMPARE_VERSION([$APPSTREAMCLI_REQS],[gt],[$APPSTREAMCLI_VERSION], - [AC_MSG_ERROR([You need at least version $APPSTREAMCLI_REQS of appstreamcli, your version is $APPSTREAMCLI_VERSION])]) -fi - -AC_MSG_CHECKING([whether appstreamcli has compose support]) -AS_IF([appstreamcli compose --help >/dev/null 2>&1], - [AC_MSG_RESULT(yes)], - [ - AC_MSG_RESULT(no) - AC_MSG_ERROR([appstreamcli must have compose support enabled and installed]) - ]) - -LT_PREREQ([2.2.6]) -LT_INIT([disable-static]) - -AC_CONFIG_SRCDIR([src/builder-main.c]) -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE([1.13.4 no-define no-dist-gzip dist-xz tar-ustar foreign subdir-objects]) -AC_PROG_SED - -AM_GNU_GETTEXT([external]) -AM_GNU_GETTEXT_VERSION([0.18.2]) -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$PACKAGE", [gettext domain]) - -# Enable silent rules is available -AM_SILENT_RULES([yes]) -AM_MAINTAINER_MODE([enable]) - -dnl This list is shared with https://github.com/ostreedev/ostree -CC_CHECK_FLAGS_APPEND([WARN_CFLAGS], [CFLAGS], [\ --pipe \ --Wall \ --Werror=empty-body \ --Werror=strict-prototypes \ --Werror=missing-prototypes \ --Werror=implicit-function-declaration \ -"-Werror=format=2 -Werror=format-security -Werror=format-nonliteral" \ --Werror=pointer-arith -Werror=init-self \ --Werror=missing-declarations \ --Werror=return-type \ --Werror=overflow \ --Werror=int-conversion \ --Werror=parenthesis \ --Werror=incompatible-pointer-types \ --Werror=misleading-indentation \ --Werror=missing-include-dirs \ -]) -AC_SUBST(WARN_CFLAGS) - -AX_VALGRIND_CHECK - -PKG_PROG_PKG_CONFIG([0.24]) - -# For libglnx -AC_CHECK_HEADER([sys/xattr.h], [], [AC_MSG_ERROR([You must have sys/xattr.h from glibc])]) - -PKG_CHECK_MODULES(BASE, [glib-2.0 >= $GLIB_REQS gio-2.0 gio-unix-2.0 ostree-1 >= $OSTREE_REQS json-glib-1.0 libxml-2.0 >= 2.4 libcurl]) - -dnl ************************ -dnl *** check for libelf *** -dnl ************************ -PKG_CHECK_MODULES([LIBELF], [libelf >= 0.8.12], [have_libelf=yes], [have_libelf=maybe]) -AS_IF([ test $have_libelf = maybe ], [ - save_LIBS=$LIBS - AC_CHECK_LIB([elf], [elf_begin], [:], [have_libelf=no]) - AC_CHECK_LIB([elf], [elf_getshdrstrndx], [:], [have_libelf=no]) - AC_CHECK_LIB([elf], [elf_getshdrnum], [:], [have_libelf=no]) - AC_CHECK_HEADER([libelf.h], [:], [have_libelf=no]) - LIBS=$save_LIBS - - if test $have_libelf != no; then - LIBELF_LIBS=-lelf - have_libelf=yes - fi -]) - -if test x$have_libelf != xyes; then - AC_MSG_ERROR([libelf not found]) -fi - -AC_ARG_VAR([DEBUGEDIT], [debugedit executable]) -AC_ARG_WITH([system-debugedit], - [AS_HELP_STRING([--with-system-debugedit], [Use system debugedit [default=check $DEBUGEDIT]])], - [DEBUGEDIT="$withval"], - [DEBUGEDIT="${DEBUGEDIT:-false}"]) -AS_CASE([$DEBUGEDIT], - [yes], - [DEBUGEDIT=debugedit], - [no], - [DEBUGEDIT=false], - [auto], - [AC_CHECK_PROG([DEBUGEDIT], [debugedit], [debugedit], [false])]) -if test "x$DEBUGEDIT" != xfalse; then - DEBUGEDIT_VERSION=`$DEBUGEDIT -V | sed 's,.*\ \([0-9]*\.[0-9]*\.[0-9]*\)$,\1,'` - AX_COMPARE_VERSION([$SYSTEM_DEBUGEDIT_REQS],[gt],[$DEBUGEDIT_VERSION], - [AC_MSG_ERROR([You need at least version $SYSTEM_DEBUGEDIT_REQS of debugedit to use the system installed version])]) - AM_CONDITIONAL([WITH_SYSTEM_DEBUGEDIT], [true]) -else - PKG_CHECK_MODULES(LIBDW, [libdw >= $LIBDW_REQS], [have_libdw=yes], [have_libdw=no]) - if test "x$have_libdw" == xno; then - AC_MSG_ERROR([libdw >= $LIBDW_REQS needed by debugedit but not found]) - fi - AM_CONDITIONAL([WITH_SYSTEM_DEBUGEDIT], [false]) -fi - -AC_ARG_WITH([yaml], - [AS_HELP_STRING([--without-yaml], - [Disable YAML support [default=auto]])]) -AS_IF([test "x$with_yaml" != "xno"],[ - PKG_CHECK_MODULES(YAML, [yaml-0.1], [have_yaml=yes], [have_yaml=no]) -], [have_yaml=no]) -AS_IF([test "x$have_yaml" = "xno"],[ - AS_IF([test "x$with_yaml" = "xyes"], - [AC_MSG_ERROR([yaml-0.1 was not found, which is needed for --with-yaml])]) -], [AC_DEFINE([FLATPAK_BUILDER_ENABLE_YAML],[1],[Define if yaml supported])]) - -AC_ARG_ENABLE(documentation, - AC_HELP_STRING([--enable-documentation], [Build documentation]),, - enable_documentation=yes) -if test x$enable_documentation = xyes; then - AC_PATH_PROG([XSLTPROC], [xsltproc]) - if test x$XSLTPROC = x; then - AC_MSG_ERROR([xsltproc is required to build documentation]) - fi - - dnl check for DocBook DTD in the local catalog - JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.3//EN], - [DocBook XML DTD V4.3], [have_docbook_dtd=yes], [have_docbook_dtd=no]) - if test "$have_docbook_dtd" != yes; then - AC_MSG_ERROR([DocBook DTD is required for --enable-documentation]) - fi - - dnl check for DocBook XSL stylesheets in the local catalog - JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl], - [DocBook XSL Stylesheets], [have_docbook_style=yes],[have_docbook_style=no]) - if test "$have_docbook_style" != yes; then - AC_MSG_ERROR([DocBook XSL Stylesheets are required for --enable-documentation]) - fi -fi -AM_CONDITIONAL(BUILD_DOCUMENTATION, test x$enable_documentation = xyes) - -AC_ARG_ENABLE(docbook-docs, - [AS_HELP_STRING([--enable-docbook-docs],[build documentation (requires xmlto)])], - enable_docbook_docs=$enableval, enable_docbook_docs=auto) -AC_PATH_PROG(XMLTO, xmlto, no) -AC_MSG_CHECKING([whether to build DocBook documentation]) -if test x$XMLTO = xno ; then - have_docbook=no -else - have_docbook=yes -fi -if test x$enable_docbook_docs = xauto ; then - if test x$have_docbook = xno ; then - enable_docbook_docs=no - else - enable_docbook_docs=yes - fi -fi -if test x$enable_docbook_docs = xyes; then - if test x$have_docbook = xno; then - AC_MSG_ERROR([Building DocBook docs explicitly required, but DocBook not found]) - fi - AC_MSG_RESULT(yes) -else - AC_MSG_RESULT(no) -fi -AM_CONDITIONAL(DOCBOOK_DOCS_ENABLED, test x$enable_docbook_docs = xyes) -AC_ARG_VAR([XMLTO],[Define/override the 'xmlto' location.]) -AC_ARG_VAR([XMLTO_FLAGS],[Define/override 'xmlto' options, like '--skip-validation'.]) - -AC_ARG_WITH([fuse], - [AS_HELP_STRING([--with-fuse={2,3}], - [Only support this major version of FUSE])], - [fuse_major="$withval"], - [fuse_major=maximize-compatibility]) -AS_IF([test $fuse_major = 2], - [AC_DEFINE([ASSUME_FUSE_2], [], - [Define to speed up FUSE 2 at the cost of FUSE 3 compatibility])]) - -GLIB_TESTS - -FLATPAK_BUILDER_VERSION=flatpak_builder_version -AC_SUBST(FLATPAK_BUILDER_VERSION) - -AC_CONFIG_FILES([ -Makefile -data/Makefile -doc/Makefile -doc/flatpak-builder-docs.xml -]) -AC_OUTPUT - -echo "" -echo " flatpak-builder $FLATPAK_BUILDER_VERSION" -echo " =============================" -echo "" diff --git a/data/Makefile.am b/data/Makefile.am deleted file mode 100644 index 7cee5799..00000000 --- a/data/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -EXTRA_DIST = flatpak-manifest.schema.json \ No newline at end of file diff --git a/doc/Makefile.am b/doc/Makefile.am deleted file mode 100644 index ce248a22..00000000 --- a/doc/Makefile.am +++ /dev/null @@ -1,62 +0,0 @@ -NULL = - -XSLTPROC_FLAGS = \ - --nonet \ - --stringparam man.output.quietly 1 \ - --stringparam funcsynopsis.style ansi \ - --stringparam man.th.extra1.suppress 1 \ - --stringparam man.authors.section.enabled 0 \ - --stringparam man.copyright.section.enabled 0 \ - $(NULL) - -.xml.1: - $(AM_V_GEN) $(XSLTPROC) $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< - -.xml.5: - $(AM_V_GEN) $(XSLTPROC) $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< - -man1 = \ - flatpak-builder.1 \ - $(NULL) - -man5 = \ - flatpak-manifest.5 \ - $(NULL) - -man_MANS = \ - $(man1) \ - $(man5) \ - $(NULL) - -xml_files = \ - $(man1:.1=.xml) \ - $(man5:.5=.xml) \ - $(NULL) - -EXTRA_DIST = \ - $(xml_files) \ - docbook.css \ - flatpak-builder-docs.xml.in \ - xmlto-config.xsl \ - $(NULL) - -CLEANFILES = $(NULL) -DISTCLEANFILES = \ - $(man_MANS) \ - flatpak-builder-docs.xml \ - $(NULL) - -if DOCBOOK_DOCS_ENABLED - -doc_DATA = \ - flatpak-builder-docs.html \ - docbook.css \ - $(NULL) - -CLEANFILES += flatpak-builder-docs.html - -flatpak-builder-docs.html: flatpak-builder-docs.xml $(xml_files) xmlto-config.xsl - $(AM_V_GEN) $(XMLTO) $(XMLTO_FLAGS) --skip-validation xhtml-nochunks -m $(srcdir)/xmlto-config.xsl $< - -endif # DOCBOOK_DOCS_ENABLED - diff --git a/m4/attributes.m4 b/m4/attributes.m4 deleted file mode 100644 index 51ac88be..00000000 --- a/m4/attributes.m4 +++ /dev/null @@ -1,292 +0,0 @@ -dnl Macros to check the presence of generic (non-typed) symbols. -dnl Copyright (c) 2006-2008 Diego Pettenò -dnl Copyright (c) 2006-2008 xine project -dnl Copyright (c) 2012 Lucas De Marchi -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2, or (at your option) -dnl any later version. -dnl -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -dnl 02110-1301, USA. -dnl -dnl As a special exception, the copyright owners of the -dnl macro gives unlimited permission to copy, distribute and modify the -dnl configure scripts that are the output of Autoconf when processing the -dnl Macro. You need not follow the terms of the GNU General Public -dnl License when using or distributing such scripts, even though portions -dnl of the text of the Macro appear in them. The GNU General Public -dnl License (GPL) does govern all other use of the material that -dnl constitutes the Autoconf Macro. -dnl -dnl This special exception to the GPL applies to versions of the -dnl Autoconf Macro released by this project. When you make and -dnl distribute a modified version of the Autoconf Macro, you may extend -dnl this special exception to the GPL to apply to your modified version as -dnl well. - -dnl Check if FLAG in ENV-VAR is supported by compiler and append it -dnl to WHERE-TO-APPEND variable. Note that we invert -Wno-* checks to -dnl -W* as gcc cannot test for negated warnings. If a C snippet is passed, -dnl use it, otherwise use a simple main() definition that just returns 0. -dnl CC_CHECK_FLAG_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG], [C-SNIPPET]) - -AC_DEFUN([CC_CHECK_FLAG_APPEND], [ - AC_CACHE_CHECK([if $CC supports flag $3 in envvar $2], - AS_TR_SH([cc_cv_$2_$3]), - [eval "AS_TR_SH([cc_save_$2])='${$2}'" - eval "AS_TR_SH([$2])='${cc_save_$2} -Werror `echo "$3" | sed 's/^-Wno-/-W/'`'" - AC_LINK_IFELSE([AC_LANG_SOURCE(ifelse([$4], [], - [int main(void) { return 0; } ], - [$4]))], - [eval "AS_TR_SH([cc_cv_$2_$3])='yes'"], - [eval "AS_TR_SH([cc_cv_$2_$3])='no'"]) - eval "AS_TR_SH([$2])='$cc_save_$2'"]) - - AS_IF([eval test x$]AS_TR_SH([cc_cv_$2_$3])[ = xyes], - [eval "$1='${$1} $3'"]) -]) - -dnl CC_CHECK_FLAGS_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG1 FLAG2], [C-SNIPPET]) -AC_DEFUN([CC_CHECK_FLAGS_APPEND], [ - for flag in [$3]; do - CC_CHECK_FLAG_APPEND([$1], [$2], $flag, [$4]) - done -]) - -dnl Check if the flag is supported by linker (cacheable) -dnl CC_CHECK_LDFLAGS([FLAG], [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) - -AC_DEFUN([CC_CHECK_LDFLAGS], [ - AC_CACHE_CHECK([if $CC supports $1 flag], - AS_TR_SH([cc_cv_ldflags_$1]), - [ac_save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $1" - AC_LINK_IFELSE([int main() { return 1; }], - [eval "AS_TR_SH([cc_cv_ldflags_$1])='yes'"], - [eval "AS_TR_SH([cc_cv_ldflags_$1])="]) - LDFLAGS="$ac_save_LDFLAGS" - ]) - - AS_IF([eval test x$]AS_TR_SH([cc_cv_ldflags_$1])[ = xyes], - [$2], [$3]) -]) - -dnl define the LDFLAGS_NOUNDEFINED variable with the correct value for -dnl the current linker to avoid undefined references in a shared object. -AC_DEFUN([CC_NOUNDEFINED], [ - dnl We check $host for which systems to enable this for. - AC_REQUIRE([AC_CANONICAL_HOST]) - - case $host in - dnl FreeBSD (et al.) does not complete linking for shared objects when pthreads - dnl are requested, as different implementations are present; to avoid problems - dnl use -Wl,-z,defs only for those platform not behaving this way. - *-freebsd* | *-openbsd*) ;; - *) - dnl First of all check for the --no-undefined variant of GNU ld. This allows - dnl for a much more readable command line, so that people can understand what - dnl it does without going to look for what the heck -z defs does. - for possible_flags in "-Wl,--no-undefined" "-Wl,-z,defs"; do - CC_CHECK_LDFLAGS([$possible_flags], [LDFLAGS_NOUNDEFINED="$possible_flags"]) - break - done - ;; - esac - - AC_SUBST([LDFLAGS_NOUNDEFINED]) -]) - -dnl Check for a -Werror flag or equivalent. -Werror is the GCC -dnl and ICC flag that tells the compiler to treat all the warnings -dnl as fatal. We usually need this option to make sure that some -dnl constructs (like attributes) are not simply ignored. -dnl -dnl Other compilers don't support -Werror per se, but they support -dnl an equivalent flag: -dnl - Sun Studio compiler supports -errwarn=%all -AC_DEFUN([CC_CHECK_WERROR], [ - AC_CACHE_CHECK( - [for $CC way to treat warnings as errors], - [cc_cv_werror], - [CC_CHECK_CFLAGS_SILENT([-Werror], [cc_cv_werror=-Werror], - [CC_CHECK_CFLAGS_SILENT([-errwarn=%all], [cc_cv_werror=-errwarn=%all])]) - ]) -]) - -AC_DEFUN([CC_CHECK_ATTRIBUTE], [ - AC_REQUIRE([CC_CHECK_WERROR]) - AC_CACHE_CHECK([if $CC supports __attribute__(( ifelse([$2], , [$1], [$2]) ))], - AS_TR_SH([cc_cv_attribute_$1]), - [ac_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $cc_cv_werror" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([$3])], - [eval "AS_TR_SH([cc_cv_attribute_$1])='yes'"], - [eval "AS_TR_SH([cc_cv_attribute_$1])='no'"]) - CFLAGS="$ac_save_CFLAGS" - ]) - - AS_IF([eval test x$]AS_TR_SH([cc_cv_attribute_$1])[ = xyes], - [AC_DEFINE( - AS_TR_CPP([SUPPORT_ATTRIBUTE_$1]), 1, - [Define this if the compiler supports __attribute__(( ifelse([$2], , [$1], [$2]) ))] - ) - $4], - [$5]) -]) - -AC_DEFUN([CC_ATTRIBUTE_CONSTRUCTOR], [ - CC_CHECK_ATTRIBUTE( - [constructor],, - [void __attribute__((constructor)) ctor() { int a; }], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_FORMAT], [ - CC_CHECK_ATTRIBUTE( - [format], [format(printf, n, n)], - [void __attribute__((format(printf, 1, 2))) printflike(const char *fmt, ...) { fmt = (void *)0; }], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_FORMAT_ARG], [ - CC_CHECK_ATTRIBUTE( - [format_arg], [format_arg(printf)], - [char *__attribute__((format_arg(1))) gettextlike(const char *fmt) { fmt = (void *)0; }], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_VISIBILITY], [ - CC_CHECK_ATTRIBUTE( - [visibility_$1], [visibility("$1")], - [void __attribute__((visibility("$1"))) $1_function() { }], - [$2], [$3]) -]) - -AC_DEFUN([CC_ATTRIBUTE_NONNULL], [ - CC_CHECK_ATTRIBUTE( - [nonnull], [nonnull()], - [void __attribute__((nonnull())) some_function(void *foo, void *bar) { foo = (void*)0; bar = (void*)0; }], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_UNUSED], [ - CC_CHECK_ATTRIBUTE( - [unused], , - [void some_function(void *foo, __attribute__((unused)) void *bar);], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_SENTINEL], [ - CC_CHECK_ATTRIBUTE( - [sentinel], , - [void some_function(void *foo, ...) __attribute__((sentinel));], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_DEPRECATED], [ - CC_CHECK_ATTRIBUTE( - [deprecated], , - [void some_function(void *foo, ...) __attribute__((deprecated));], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_ALIAS], [ - CC_CHECK_ATTRIBUTE( - [alias], [weak, alias], - [void other_function(void *foo) { } - void some_function(void *foo) __attribute__((weak, alias("other_function")));], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_MALLOC], [ - CC_CHECK_ATTRIBUTE( - [malloc], , - [void * __attribute__((malloc)) my_alloc(int n);], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_PACKED], [ - CC_CHECK_ATTRIBUTE( - [packed], , - [struct astructure { char a; int b; long c; void *d; } __attribute__((packed));], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_CONST], [ - CC_CHECK_ATTRIBUTE( - [const], , - [int __attribute__((const)) twopow(int n) { return 1 << n; } ], - [$1], [$2]) -]) - -AC_DEFUN([CC_FLAG_VISIBILITY], [ - AC_REQUIRE([CC_CHECK_WERROR]) - AC_CACHE_CHECK([if $CC supports -fvisibility=hidden], - [cc_cv_flag_visibility], - [cc_flag_visibility_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $cc_cv_werror" - CC_CHECK_CFLAGS_SILENT([-fvisibility=hidden], - cc_cv_flag_visibility='yes', - cc_cv_flag_visibility='no') - CFLAGS="$cc_flag_visibility_save_CFLAGS"]) - - AS_IF([test "x$cc_cv_flag_visibility" = "xyes"], - [AC_DEFINE([SUPPORT_FLAG_VISIBILITY], 1, - [Define this if the compiler supports the -fvisibility flag]) - $1], - [$2]) -]) - -AC_DEFUN([CC_FUNC_EXPECT], [ - AC_REQUIRE([CC_CHECK_WERROR]) - AC_CACHE_CHECK([if compiler has __builtin_expect function], - [cc_cv_func_expect], - [ac_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $cc_cv_werror" - AC_COMPILE_IFELSE([AC_LANG_SOURCE( - [int some_function() { - int a = 3; - return (int)__builtin_expect(a, 3); - }])], - [cc_cv_func_expect=yes], - [cc_cv_func_expect=no]) - CFLAGS="$ac_save_CFLAGS" - ]) - - AS_IF([test "x$cc_cv_func_expect" = "xyes"], - [AC_DEFINE([SUPPORT__BUILTIN_EXPECT], 1, - [Define this if the compiler supports __builtin_expect() function]) - $1], - [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_ALIGNED], [ - AC_REQUIRE([CC_CHECK_WERROR]) - AC_CACHE_CHECK([highest __attribute__ ((aligned ())) supported], - [cc_cv_attribute_aligned], - [ac_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $cc_cv_werror" - for cc_attribute_align_try in 64 32 16 8 4 2; do - AC_COMPILE_IFELSE([AC_LANG_SOURCE([ - int main() { - static char c __attribute__ ((aligned($cc_attribute_align_try))) = 0; - return c; - }])], [cc_cv_attribute_aligned=$cc_attribute_align_try; break]) - done - CFLAGS="$ac_save_CFLAGS" - ]) - - if test "x$cc_cv_attribute_aligned" != "x"; then - AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX], [$cc_cv_attribute_aligned], - [Define the highest alignment supported]) - fi -]) diff --git a/m4/glibtests.m4 b/m4/glibtests.m4 deleted file mode 100644 index 7d5920a4..00000000 --- a/m4/glibtests.m4 +++ /dev/null @@ -1,28 +0,0 @@ -dnl GLIB_TESTS -dnl - -AC_DEFUN([GLIB_TESTS], -[ - AC_ARG_ENABLE(installed-tests, - AS_HELP_STRING([--enable-installed-tests], - [Enable installation of some test cases]), - [case ${enableval} in - yes) ENABLE_INSTALLED_TESTS="1" ;; - no) ENABLE_INSTALLED_TESTS="" ;; - *) AC_MSG_ERROR([bad value ${enableval} for --enable-installed-tests]) ;; - esac]) - AM_CONDITIONAL([ENABLE_INSTALLED_TESTS], test "$ENABLE_INSTALLED_TESTS" = "1") - AC_ARG_ENABLE(always-build-tests, - AS_HELP_STRING([--enable-always-build-tests], - [Enable always building tests during 'make all']), - [case ${enableval} in - yes) ENABLE_ALWAYS_BUILD_TESTS="1" ;; - no) ENABLE_ALWAYS_BUILD_TESTS="" ;; - *) AC_MSG_ERROR([bad value ${enableval} for --enable-always-build-tests]) ;; - esac]) - AM_CONDITIONAL([ENABLE_ALWAYS_BUILD_TESTS], test "$ENABLE_ALWAYS_BUILD_TESTS" = "1") - if test "$ENABLE_INSTALLED_TESTS" = "1"; then - AC_SUBST(installed_test_metadir, [${datadir}/installed-tests/]AC_PACKAGE_NAME) - AC_SUBST(installed_testdir, [${libexecdir}/installed-tests/]AC_PACKAGE_NAME) - fi -]) diff --git a/src/Makefile.am.inc b/src/Makefile.am.inc deleted file mode 100644 index cc426df8..00000000 --- a/src/Makefile.am.inc +++ /dev/null @@ -1,56 +0,0 @@ -bin_PROGRAMS += \ - flatpak-builder \ - $(NULL) - -flatpak_builder_SOURCES = \ - src/builder-main.c \ - src/builder-manifest.c \ - src/builder-manifest.h \ - src/builder-options.c \ - src/builder-options.h \ - src/builder-extension.c \ - src/builder-extension.h \ - src/builder-module.c \ - src/builder-module.h \ - src/builder-post-process.c \ - src/builder-post-process.h \ - src/builder-source.c \ - src/builder-source.h \ - src/builder-source-archive.c \ - src/builder-source-archive.h \ - src/builder-source-git.c \ - src/builder-source-git.h \ - src/builder-source-bzr.c \ - src/builder-source-bzr.h \ - src/builder-source-svn.c \ - src/builder-source-svn.h \ - src/builder-source-file.c \ - src/builder-source-file.h \ - src/builder-source-script.c \ - src/builder-source-script.h \ - src/builder-source-inline.c \ - src/builder-source-inline.h \ - src/builder-source-shell.c \ - src/builder-source-shell.h \ - src/builder-source-extra-data.c \ - src/builder-source-extra-data.h \ - src/builder-source-patch.c \ - src/builder-source-patch.h \ - src/builder-source-dir.c \ - src/builder-source-dir.h \ - src/builder-context.c \ - src/builder-context.h \ - src/builder-cache.c \ - src/builder-cache.h \ - src/builder-utils.c \ - src/builder-utils.h \ - src/builder-flatpak-utils.c \ - src/builder-flatpak-utils.h \ - src/builder-git.c \ - src/builder-git.h \ - src/builder-sdk-config.c \ - src/builder-sdk-config.h \ - $(NULL) - -flatpak_builder_LDADD = $(AM_LDADD) $(BASE_LIBS) $(LIBELF_LIBS) $(YAML_LIBS) libglnx.la -flatpak_builder_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS) $(YAML_CFLAGS) diff --git a/tests/Makefile.am.inc b/tests/Makefile.am.inc deleted file mode 100644 index 2b778b61..00000000 --- a/tests/Makefile.am.inc +++ /dev/null @@ -1,89 +0,0 @@ -AM_TESTS_ENVIRONMENT = FLATPAK_TESTS_DEBUG=1 \ - GI_TYPELIB_PATH=$$(cd $(top_builddir) && pwd)$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH} \ - LD_LIBRARY_PATH=$$(cd $(top_builddir)/.libs && pwd)$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH} \ - PATH=$$(cd $(top_builddir) && pwd):$${PATH} \ - $(NULL) - -if !WITH_SYSTEM_DEBUGEDIT -AM_TESTS_ENVIRONMENT += FLATPAK_BUILDER_DEBUGEDIT=$$(cd $(top_builddir) && pwd)/flatpak-builder-debugedit -endif - -dist_installed_test_extra_scripts += \ - tests/empty-configure \ - tests/test-configure \ - tests/make-test-app.sh \ - tests/make-test-runtime.sh \ - tests/make-test-bundles.sh \ - tests/testpython.py \ - $(NULL) - -dist_installed_test_data = \ - tests/libtest.sh \ - tests/org.test.Hello.png \ - tests/org.test.Hello.desktop \ - tests/Hello.desktop \ - tests/org.test.Hello.appdata.xml \ - tests/org.test.Hello.xml \ - tests/Hello.xml \ - tests/Hello.appdata.xml \ - tests/Hello-desktop.appdata.xml \ - tests/source1.json \ - tests/source2.json \ - tests/test.json \ - tests/test.yaml \ - tests/test-rename.json \ - tests/test-rename-appdata.json \ - tests/test-runtime.json \ - tests/module1.json \ - tests/module1.yaml \ - tests/data1 \ - tests/data1.patch \ - tests/module2.json \ - tests/module2.yaml \ - tests/data2 \ - tests/data2.patch \ - tests/session.conf.in \ - tests/0001-Add-test-logo.patch \ - tests/org.test.Python.json \ - tests/org.test.Python2.json \ - tests/importme.py \ - tests/importme2.py \ - tests/org.test.Deprecated.MD5.archive.json \ - tests/org.test.Deprecated.MD5.archive.yaml \ - tests/org.test.Deprecated.MD5.file.json \ - tests/org.test.Deprecated.MD5.file.yaml \ - tests/org.test.Deprecated.SHA1.archive.json \ - tests/org.test.Deprecated.SHA1.archive.yaml \ - tests/org.test.Deprecated.SHA1.file.json \ - tests/org.test.Deprecated.SHA1.file.yaml \ - tests/hello.sh \ - tests/hello.tar.xz \ - $(NULL) - -installed_test_keyringdir = $(installed_testdir)/test-keyring -installed_test_keyring2dir = $(installed_testdir)/test-keyring2 - -if ENABLE_INSTALLED_TESTS -dist_installed_test_keyring_DATA = \ - tests/test-keyring/README \ - tests/test-keyring/pubring.gpg \ - tests/test-keyring/secring.gpg \ - $(NULL) -dist_installed_test_keyring2_DATA = \ - tests/test-keyring2/README \ - tests/test-keyring2/pubring.gpg \ - tests/test-keyring2/secring.gpg \ - $(NULL) -endif - -dist_test_scripts = \ - tests/test-builder.sh \ - tests/test-builder-deprecated.sh \ - tests/test-builder-python.sh \ - $(NULL) - -@VALGRIND_CHECK_RULES@ -VALGRIND_SUPPRESSIONS_FILES=tests/flatpak.supp tests/glib.supp -EXTRA_DIST += tests/flatpak.supp tests/glib.supp -DISTCLEANFILES += \ - $(NULL)