diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b21d6c53..8bed8dd9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -38,21 +38,17 @@ jobs: install: | apt-get update -q -y - apt-get install -q -y python3 automake libtool autotools-dev git make cmake pkg-config gcc wget libyajl-dev + apt-get install -q -y python3 automake libtool autotools-dev git make cmake pkg-config gcc wget xz-utils run: | find $(pwd) -name '.git' -exec bash -c 'git config --global --add safe.directory ${0%/.git}' {} \; - ./autogen.sh - ./configure CFLAGS='-Wall -Wextra -Werror' - make -j $(nproc) distcheck - # check that the working dir is clean - git describe --broken --dirty --all | grep -qv dirty - - make clean + ./autogen.sh --enable-embedded-yajl ./configure --enable-embedded-yajl CFLAGS='-Wall -Wextra -Werror' - make -j $(nproc) distcheck + make -j $(nproc) distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-embedded-yajl" # check that the working dir is clean git describe --broken --dirty --all | grep -qv dirty + make clean + test_and_build_rust_bindings: name: test and build rust bindings runs-on: ubuntu-latest diff --git a/Makefile.am b/Makefile.am index 9646507e..cb73891b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -256,7 +256,8 @@ EXTRA_DIST = autogen.sh \ runtime-spec \ image-spec \ src/ocispec/json_common.h \ - src/ocispec/json_common.c + src/ocispec/json_common.c \ + src/yajl sync: (cd image-spec; git pull https://github.com/opencontainers/image-spec) diff --git a/configure.ac b/configure.ac index 390c0ba9..6125dcbe 100644 --- a/configure.ac +++ b/configure.ac @@ -25,7 +25,10 @@ case "${enableval}" in esac],[embedded_yajl=false]) AM_CONDITIONAL([HAVE_EMBEDDED_YAJL], [test x"$embedded_yajl" = xtrue]) -AM_COND_IF([HAVE_EMBEDDED_YAJL], [], [PKG_CHECK_MODULES([YAJL], [yajl >= 2.1.0])]) +AM_COND_IF([HAVE_EMBEDDED_YAJL], [], [ +AC_SEARCH_LIBS(yajl_tree_get, [yajl], [AC_DEFINE([HAVE_YAJL], 1, [Define if libyajl is available])], [AC_MSG_ERROR([*** libyajl headers not found])]) +PKG_CHECK_MODULES([YAJL], [yajl >= 2.0.0]) +]) # Optionally install the library. AC_ARG_ENABLE(libocispec-install,