From cdb27584890b3191984ce5c2e4cfcc240b6735d5 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Mon, 12 Dec 2022 05:08:15 +0400 Subject: [PATCH] Fix builds without pthreads (#139) --- .cirrus.yml | 2 +- .github/workflows/main.yml | 8 ++++---- ChangeLog | 4 ++++ README.md | 3 ++- examples/Makefile.am | 2 ++ 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index f97c14a..5aa5b9d 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -11,7 +11,7 @@ main_freebsd_task: - pkg install --yes autoconf automake libtool main_build_script: - ./autogen.sh - - ./configure --enable-debug --enable-checks CFLAGS='-O3' + - ./configure --enable-debug --enable-checks --enable-checks-pthreads CFLAGS='-O3' - make - sudo make install main_test_script: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 56d397a..1745f6c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,7 +34,7 @@ jobs: - name: autogen run: ./autogen.sh - name: configure - run: ./configure ${{matrix.debug}} --enable-checks --enable-checks-python CC='${{matrix.cc}}' CFLAGS='${{matrix.opt}}' + run: ./configure ${{matrix.debug}} --enable-checks --enable-checks-pthreads --enable-checks-python CC='${{matrix.cc}}' CFLAGS='${{matrix.opt}}' - name: make run: make - name: check @@ -76,7 +76,7 @@ jobs: - name: autogen run: ./autogen.sh - name: configure - run: ./configure --host='${{matrix.cross.arch}}-unknown-elf' --enable-checks --enable-checks-python AR='${{matrix.cross.cprefix}}ar' CC='${{matrix.cross.cprefix}}gcc' LD='${{matrix.cross.cprefix}}ld' RANLIB='${{matrix.cross.cprefix}}ranlib' + run: ./configure --host='${{matrix.cross.arch}}-unknown-elf' --enable-checks --enable-checks-pthreads --enable-checks-python AR='${{matrix.cross.cprefix}}ar' CC='${{matrix.cross.cprefix}}gcc' LD='${{matrix.cross.cprefix}}ld' RANLIB='${{matrix.cross.cprefix}}ranlib' - name: make run: make - name: check @@ -99,7 +99,7 @@ jobs: - name: autogen run: ./autogen.sh - name: configure - run: ./configure --enable-debug --enable-checks --enable-checks-python --without-${{matrix.packages.without}} ${{matrix.packages.dependencies}} + run: ./configure --enable-debug --enable-checks --enable-checks-pthreads --enable-checks-python --without-${{matrix.packages.without}} ${{matrix.packages.dependencies}} - name: make run: make - name: check @@ -138,7 +138,7 @@ jobs: - name: extract run: tar -xzf "libkernaux-$(cat VERSION).tar.gz" - name: configure - run: cd "libkernaux-$(cat VERSION)" && ./configure --enable-debug --enable-checks --enable-checks-python + run: cd "libkernaux-$(cat VERSION)" && ./configure --enable-debug --enable-checks --enable-checks-pthreads --enable-checks-python - name: make run: cd "libkernaux-$(cat VERSION)" && make - name: check diff --git a/ChangeLog b/ChangeLog index e659c8c..59cc1a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2022-12-12 Alex Kotov + + * examples/Makefile.am: Fix builds without pthreads + 2022-12-11 Alex Kotov * include/kernaux/macro.h: Macro "KERNAUX_STATIC_TEST" has been added diff --git a/README.md b/README.md index 69e5b44..4161746 100644 --- a/README.md +++ b/README.md @@ -137,8 +137,9 @@ stable options. #### Features * `--enable-checks` - enable usual tests and examples -* `--enable-checks-all` - enable all tests +* `--enable-checks-all` - enable all checks * `--enable-checks-cppcheck` - enable cppcheck +* `--enable-checks-pthreads` - enable tests that require pthreads * `--enable-checks-python` - enable tests that require Python 3 with YAML and Jinja2 diff --git a/examples/Makefile.am b/examples/Makefile.am index dc33671..29e32d4 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -41,9 +41,11 @@ generic_malloc_SOURCES = main.c generic_malloc.c # generic_mutex # ################# +if ENABLE_CHECKS_PTHREADS TESTS += generic_mutex generic_mutex_LDADD = $(top_builddir)/libkernaux.la generic_mutex_SOURCES = main.c generic_mutex.c +endif ############## # macro_bits #