diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml new file mode 100644 index 000000000..669de3a8a --- /dev/null +++ b/.github/workflows/freebsd.yml @@ -0,0 +1,29 @@ +name: FreeBSD + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + workflow_dispatch: + +jobs: + FreeBSD-test: + runs-on: ubuntu-latest + name: Test xz on FreeBSD + steps: + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4 + - name: Test in FreeBSD + id: test + uses: vmactions/FreeBSD-vm@f8be330398166d1eb0601f01353839d4052367b2 #v1.0.7 + with: + usesh: true + prepare: | + pkg install -y autoconf automake gmake gettext-tools gtar libtool m4 po4a + run: | + export LC_ALL=C LANG=C + uname -a + ./autogen.sh + ./configure --enable-werror + make + make check VERBOSE=1 diff --git a/.github/workflows/netbsd.yml b/.github/workflows/netbsd.yml new file mode 100644 index 000000000..2421f53ad --- /dev/null +++ b/.github/workflows/netbsd.yml @@ -0,0 +1,29 @@ +name: NetBSD + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + workflow_dispatch: + +jobs: + NetBSD-test: + runs-on: ubuntu-latest + name: Test xz on NetBSD + steps: + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4 + - name: Test in NetBSD + id: test + uses: vmactions/NetBSD-vm@da9ed4d7cd0fb64f330e2342ac5c77ba529b6a11 #v1.0.7 + with: + usesh: true + prepare: | + /usr/sbin/pkg_add -v autoconf automake gmake gettext-tools gtar-base libtool-base m4 + run: | + export LC_ALL=C LANG=C + uname -a + ./autogen.sh + ./configure --enable-werror + make + make check VERBOSE=1 diff --git a/.github/workflows/openbsd.yml b/.github/workflows/openbsd.yml new file mode 100644 index 000000000..25ebbc566 --- /dev/null +++ b/.github/workflows/openbsd.yml @@ -0,0 +1,31 @@ +name: OpenBSD + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + workflow_dispatch: + +jobs: + OpenBSD-test: + runs-on: ubuntu-latest + name: Test xz on OpenBSD + steps: + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4 + - name: Test in OpenBSD + id: test + uses: vmactions/OpenBSD-vm@eaa3d3f695a5a52971c23958f6dd4cd3397f959d #v1.0.8 + with: + usesh: true + prepare: | + /usr/sbin/pkg_add -I -v autoconf-2.71 automake-1.16.5 gmake gettext-tools gtar libtool m4 + run: | + export LC_ALL=C LANG=C + export AUTOCONF_VERSION=2.71 + export AUTOMAKE_VERSION=1.16 + uname -a + ./autogen.sh + ./configure --enable-werror + make + make check VERBOSE=1 diff --git a/.github/workflows/solaris.yml b/.github/workflows/solaris.yml new file mode 100644 index 000000000..fbd68f0c6 --- /dev/null +++ b/.github/workflows/solaris.yml @@ -0,0 +1,29 @@ +name: Solaris + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + workflow_dispatch: + +jobs: + solaris-test: + runs-on: ubuntu-latest + name: Test xz on Solaris + steps: + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4 + - name: Test in Solaris + id: test + uses: vmactions/solaris-vm@548f790d1bc2b9342a76cbb47ddbb85875605559 #v1.0.2 + with: + usesh: true + prepare: | + pkg install bash libtool automake gnu-m4 tree wget gcc autoconf + run: | + export LC_ALL=C LANG=C + uname -a + ./autogen.sh + ./configure --enable-werror + make + make check VERBOSE=1 diff --git a/build-aux/version.sh b/build-aux/version.sh index bef1b33d9..b35292c61 100644 --- a/build-aux/version.sh +++ b/build-aux/version.sh @@ -9,14 +9,37 @@ ############################################################################# # # Author: Lasse Collin +# Kerin Millar # ############################################################################# -sed -n 's/LZMA_VERSION_STABILITY_ALPHA/alpha/ - s/LZMA_VERSION_STABILITY_BETA/beta/ - s/LZMA_VERSION_STABILITY_STABLE// - s/^#define LZMA_VERSION_[MPS][AIT][AJNT][A-Z]* //p' \ - src/liblzma/api/lzma/version.h \ - | tr '\n' '|' \ - | sed 's/|/./; s/|/./; s/|//g' \ - | tr -d '\r\n' +# Solaris provides a legacy awk implementation as /usr/bin/awk. It also provides +# /usr/bin/nawk, which is more or less POSIX-compliant. Be sure to use it. +if grep Solaris /etc/release >/dev/null 2>&1; then + awk=nawk +else + awk=awk +fi + +"$awk" -f - <<'EOF' + +BEGIN { + ARGV[1] = "src/liblzma/api/lzma/version.h" + ARGC = 2 + OFS = "." + ORS = "" +} + +/^#define LZMA_VERSION_(MAJOR|MINOR|PATCH|STABILITY) / { + sub(/.*_/, "", $2) + sub(/.*_/, "", $3) + if ($2 != "STABILITY" || $3 != "STABLE") { + ver[$2] = tolower($3) + } +} + +END { + print ver["MAJOR"], ver["MINOR"], ver["PATCH"] ver["STABILITY"] +} + +EOF diff --git a/src/common/tuklib_integer.h b/src/common/tuklib_integer.h index c0004531a..cd8776990 100644 --- a/src/common/tuklib_integer.h +++ b/src/common/tuklib_integer.h @@ -66,6 +66,9 @@ #if defined(HAVE___BUILTIN_BSWAPXX) // GCC >= 4.8 and Clang +# undef bswap16 +# undef bswap32 +# undef bswap64 # define bswap16(n) __builtin_bswap16(n) # define bswap32(n) __builtin_bswap32(n) # define bswap64(n) __builtin_bswap64(n) diff --git a/src/xz/list.c b/src/xz/list.c index ca9cf03e8..93d0cf7b8 100644 --- a/src/xz/list.c +++ b/src/xz/list.c @@ -1178,6 +1178,10 @@ print_totals_basic(void) totals.uncompressed_size), checks); +#ifdef __sun +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wformat-nonliteral" +#endif // Since we print totals only when there are at least two files, // the English message will always use "%s files". But some other // languages need different forms for different plurals so we @@ -1189,6 +1193,9 @@ print_totals_basic(void) totals.files <= ULONG_MAX ? totals.files : (totals.files % 1000000) + 1000000), uint64_to_str(totals.files, 0)); +#ifdef __sun +# pragma GCC diagnostic pop +#endif return; }