diff --git a/.gitignore b/.gitignore index 6dee9875..3a84e7ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,50 +1,22 @@ # Generic ignores for libtool project -Makefile.in -Makefile -/INSTALL -/autom4te.cache -/aclocal.m4 -/compile -/configure -/configure~ -/depcomp -/install-sh -/missing -/stamp-h1 -/m4/** -/config.guess -/config.sub -/config.log -/config.status -/ltmain.sh -/libtool **/.deps/** *.la *.lo *.o -**/.libs/** -*/config.h -*/config.h.in -*/config.h.in~ -*/stamp-h1 -/test-driver /coverage.info /coveragereport/* *.gcno -/.vscode/* *~ *.tmp .dirstamp .*.swp # Generic ignores for cmake project -/out/* +/out/** +/build/** /doxygen-doc/** /libjwt/libjwt.pc -/include/jwt_export.h -/dist/libjwt.spec -/dist/rpmbuild/** # Cmake /build diff --git a/.travis.yml b/.travis.yml index 80fb52c2..4aacc78f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,8 +21,6 @@ before_install: before_script: - set -ev -- autoreconf --version -- autoreconf -fi - mkdir build - cd build @@ -32,30 +30,25 @@ after_script: jobs: include: - - name: "Autotools Build (focal)" + - name: "Focal" dist: focal script: - - ../configure - - make - - rm -rf * - - cmake -DWITH_TESTS=NO .. - - make - - - name: "CMake Build" - dist: jammy - script: - cmake -DWITH_GNUTLS=YES -DWITH_OPENSSL=YES .. - make check - - name: "Autotools Build" + - name: "Jammy" dist: jammy script: - - ../configure --with-openssl --with-gnutls + - cmake -DWITH_GNUTLS=YES -DWITH_OPENSSL=YES .. - make check - name: "Coverage Build" dist: jammy script: - - ../configure --without-gnutls --enable-code-coverage --enable-valgrind - - make check-valgrind check-code-coverage doxygen-doc + - cmake -DWITH_GNUTLS=NO -DWITH_OPENSSL=YES -DENABLE_COVERAGE .. + - make + - ctest -T memcheck + - make doxygen-doc + - make package_source + - make check-code-coverage - codecov diff --git a/CMakeLists.txt b/CMakeLists.txt index 395efecd..8fd6b236 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ cmake_minimum_required (VERSION 3.7...3.15) list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") # Extract info from configure.ac -include(AutoToolsVersion) +include(LibJWTVersions) include(GenerateExportHeader) project(${LIBJWT_PROJECT} @@ -168,6 +168,8 @@ add_definitions(-DKEYDIR=\"${CMAKE_SOURCE_DIR}/tests/keys\") install(FILES include/jwt.h ${CMAKE_BINARY_DIR}/jwt_export.h DESTINATION include) +install(FILES LICENSE README.md + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/${LIBJWT_PROJECT_LOWER}) # Install library install(TARGETS jwt @@ -183,25 +185,22 @@ install(TARGETS jwt_static ARCHIVE DESTINATION lib ) +# For cmake users install(EXPORT ${LIBJWT_PROJECT}Targets FILE ${LIBJWT_PROJECT}Config.cmake NAMESPACE ${LIBJWT_PROJECT}:: DESTINATION lib/cmake/${LIBJWT_PROJECT} ) -# We do this to make it compatible with autotools -set(PACKAGE_NAME ${PROJECT_NAME}) -set(PACKAGE_VERSION ${PROJECT_VERSION}) -set(prefix ${CMAKE_INSTALL_PREFIX}) -string(JOIN " " JANSSON_LIBS ${JANSSON_LDFLAGS}) -if (OPENSSL_FOUND) - string(JOIN " " OPENSSL_LIBS ${OPENSSL_LDFLAGS}) -endif() -if (GNUTLS_FOUND) - string(JOIN " " GNUTLS_LIBS ${GNUTLS_LDFLAGS}) -endif() +# For pkg-config users +unset(LIBJWT_LDFLAGS) +foreach (FLAG ${JANSSON_LDFLAGS} ${OPENSSL_LDFLAGS} ${GNUTLS_LDFLAGS}) + string(APPEND LIBJWT_LDFLAGS " " ${FLAG}) +endforeach() + configure_file(libjwt/libjwt.pc.in libjwt.pc @ONLY) -install(FILES ${CMAKE_BINARY_DIR}/libjwt.pc DESTINATION lib/pkgconfig) +install(FILES ${CMAKE_BINARY_DIR}/libjwt.pc + DESTINATION lib/pkgconfig) find_package(Doxygen) @@ -219,7 +218,7 @@ if (DOXYGEN_FOUND) COMMAND ${CMAKE_COMMAND} -E env ${DOXYGEN_ENV_VARS} ${DOXYGEN_EXECUTABLE} - ${CMAKE_SOURCE_DIR}/Doxyfile + ${CMAKE_SOURCE_DIR}/doxygen/Doxyfile COMMENT "Generating documentation with Doxygen" VERBATIM ) @@ -229,8 +228,14 @@ option(ENABLE_COVERAGE "Enable code coverage rules" OFF) # Tests and coverage depend on this, but optional if (WITH_TESTS) - option(ENABLE_COVERAGE "Enable code coverage rules" OFF) - pkg_check_modules(CHECK check>=0.9.10 IMPORTED_TARGET) + if (ENABLE_COVERAGE) + set(CHECK_REQUIRED "REQUIRED") + endif() + pkg_check_modules(CHECK check>=0.9.10 IMPORTED_TARGET ${CHECK_REQUIRED}) +else() + if (ENABLE_COVERAGE) + message(SEND_ERROR "You must set WITH_TESTS=ON to enable code coverage") + endif() endif() function(jwt_add_test) @@ -280,6 +285,10 @@ if (CHECK_FOUND) EXECUTABLE ctest -j ${PROCESSOR_COUNT} DEPENDENCIES ${UNIT_TESTS}) endif() +else() + if (ENABLE_COVERAGE) + message(SEND_ERROR "Coverage enabled, but did not find check library") + endif() endif() set(CPACK_PROPERTIES_FILE "${CMAKE_SOURCE_DIR}/cmake/CPackConfig.cmake") diff --git a/Doxygen.mk b/Doxygen.mk deleted file mode 100644 index 1d99b579..00000000 --- a/Doxygen.mk +++ /dev/null @@ -1,188 +0,0 @@ -# Copyright (C) 2004 Oren Ben-Kiki -# This file is distributed under the same terms as the Automake macro files. - -# Generate automatic documentation using Doxygen. Goals and variables values -# are controlled by the various DX_COND_??? conditionals set by autoconf. -# -# The provided goals are: -# doxygen-doc: Generate all doxygen documentation. -# doxygen-run: Run doxygen, which will generate some of the documentation -# (HTML, CHM, CHI, MAN, RTF, XML) but will not do the post -# processing required for the rest of it (PS, PDF, and some MAN). -# doxygen-man: Rename some doxygen generated man pages. -# doxygen-ps: Generate doxygen PostScript documentation. -# doxygen-pdf: Generate doxygen PDF documentation. -# -# Note that by default these are not integrated into the automake goals. If -# doxygen is used to generate man pages, you can achieve this integration by -# setting man3_MANS to the list of man pages generated and then adding the -# dependency: -# -# $(man3_MANS): doxygen-doc -# -# This will cause make to run doxygen and generate all the documentation. -# -# The following variable is intended for use in Makefile.am: -# -# DX_CLEANFILES = everything to clean. -# -# This is usually added to MOSTLYCLEANFILES. - -EXTRA_DIST += Doxyfile - -## --------------------------------- ## -## Format-independent Doxygen rules. ## -## --------------------------------- ## - -if DX_COND_doc - -## ------------------------------- ## -## Rules specific for HTML output. ## -## ------------------------------- ## - -if DX_COND_html - -DX_CLEAN_HTML = @DX_DOCDIR@/html - -endif DX_COND_html - -## ------------------------------ ## -## Rules specific for CHM output. ## -## ------------------------------ ## - -if DX_COND_chm - -DX_CLEAN_CHM = @DX_DOCDIR@/chm - -if DX_COND_chi - -DX_CLEAN_CHI = @DX_DOCDIR@/@PACKAGE@.chi - -endif DX_COND_chi - -endif DX_COND_chm - -## ------------------------------ ## -## Rules specific for MAN output. ## -## ------------------------------ ## - -if DX_COND_man - -DX_CLEAN_MAN = @DX_DOCDIR@/man - -endif DX_COND_man - -## ------------------------------ ## -## Rules specific for RTF output. ## -## ------------------------------ ## - -if DX_COND_rtf - -DX_CLEAN_RTF = @DX_DOCDIR@/rtf - -endif DX_COND_rtf - -## ------------------------------ ## -## Rules specific for XML output. ## -## ------------------------------ ## - -if DX_COND_xml - -DX_CLEAN_XML = @DX_DOCDIR@/xml - -endif DX_COND_xml - -## ----------------------------- ## -## Rules specific for PS output. ## -## ----------------------------- ## - -if DX_COND_ps - -DX_CLEAN_PS = @DX_DOCDIR@/@PACKAGE@.ps - -DX_PS_GOAL = doxygen-ps - -doxygen-ps: @DX_DOCDIR@/@PACKAGE@.ps - -@DX_DOCDIR@/@PACKAGE@.ps: @DX_DOCDIR@/@PACKAGE@.tag - cd @DX_DOCDIR@/latex; \ - rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \ - $(DX_LATEX) refman.tex; \ - $(MAKEINDEX_PATH) refman.idx; \ - $(DX_LATEX) refman.tex; \ - countdown=5; \ - while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \ - refman.log > /dev/null 2>&1 \ - && test $$countdown -gt 0; do \ - $(DX_LATEX) refman.tex; \ - countdown=`expr $$countdown - 1`; \ - done; \ - $(DX_DVIPS) -o ../@PACKAGE@.ps refman.dvi - -endif DX_COND_ps - -## ------------------------------ ## -## Rules specific for PDF output. ## -## ------------------------------ ## - -if DX_COND_pdf - -DX_CLEAN_PDF = @DX_DOCDIR@/@PACKAGE@.pdf - -DX_PDF_GOAL = doxygen-pdf - -doxygen-pdf: @DX_DOCDIR@/@PACKAGE@.pdf - -@DX_DOCDIR@/@PACKAGE@.pdf: @DX_DOCDIR@/@PACKAGE@.tag - cd @DX_DOCDIR@/latex; \ - rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \ - $(DX_PDFLATEX) refman.tex; \ - $(DX_MAKEINDEX) refman.idx; \ - $(DX_PDFLATEX) refman.tex; \ - countdown=5; \ - while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \ - refman.log > /dev/null 2>&1 \ - && test $$countdown -gt 0; do \ - $(DX_PDFLATEX) refman.tex; \ - countdown=`expr $$countdown - 1`; \ - done; \ - mv refman.pdf ../@PACKAGE@.pdf - -endif DX_COND_pdf - -## ------------------------------------------------- ## -## Rules specific for LaTeX (shared for PS and PDF). ## -## ------------------------------------------------- ## - -if DX_COND_latex - -DX_CLEAN_LATEX = @DX_DOCDIR@/latex - -endif DX_COND_latex - -.PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL) - -.INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) - -doxygen-run: @DX_DOCDIR@/@PACKAGE@.tag - -doxygen-doc: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) - -@DX_DOCDIR@/@PACKAGE@.tag: $(DX_CONFIG) $(pkginclude_HEADERS) - rm -rf @DX_DOCDIR@ - $(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG) - -DX_CLEANFILES = \ - @DX_DOCDIR@/@PACKAGE@.tag \ - -r \ - $(DX_CLEAN_HTML) \ - $(DX_CLEAN_CHM) \ - $(DX_CLEAN_CHI) \ - $(DX_CLEAN_MAN) \ - $(DX_CLEAN_RTF) \ - $(DX_CLEAN_XML) \ - $(DX_CLEAN_PS) \ - $(DX_CLEAN_PDF) \ - $(DX_CLEAN_LATEX) - -endif DX_COND_doc diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 59026966..00000000 --- a/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (C) 2015-2024 maClara, LLC -# This file is part of the JWT C Library -# -# SPDX-License-Identifier: MPL-2.0 -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -ACLOCAL_AMFLAGS = -I m4 -I m4-local - -# The basics -EXTRA_DIST = LICENSE README.md - -# CMake stuff -EXTRA_DIST += CMakeLists.txt \ - cmake/AutoToolsVersion.cmake \ - cmake/CodeCoverage.cmake - -# Logos and banners -EXTRA_DIST += \ - images/LibJWT-800x152.png \ - images/LibJWT.svg \ - images/favicon.ico - -# Doxygen components -EXTRA_DIST += \ - doxygen-extra/doxygen-awesome-fragment-copy-button.js \ - doxygen-extra/doxygen-awesome.css \ - doxygen-extra/doxygen-awesome-interactive-toc.js \ - doxygen-extra/footer.html \ - doxygen-extra/doxygen-awesome-paragraph-link.js \ - doxygen-extra/header.html \ - doxygen-extra/doxygen-awesome-tabs.js \ - doxygen-extra/libjwt.css - -SUBDIRS = include libjwt tests dist -if BUILD_EXAMPLES -SUBDIRS += examples -endif - -include $(top_srcdir)/Doxygen.mk - -check-valgrind check-code-coverage: all - $(MAKE) $(AM_MAKEFLAGS) -C tests $@ diff --git a/README.md b/README.md index 2eb6d9d1..6faa8c03 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ ### Required - [JANSSON](https://github.com/akheron/jansson) (>= 2.0) +- CMake (>= 3.7) ### Atleast one of these, you can use both - OpenSSL (>= 1.1.0) @@ -33,17 +34,6 @@ macOS, and Windows. ## Build Instructions -**With GNU AutoTools:** - - $ autoreconf -if - ... - $ mkdir build - $ cd build - $ ../configure - ... - $ make - ... - **With CMake:** $ mkdir build @@ -54,9 +44,8 @@ macOS, and Windows. ... ### Common -If you have *libcheck* installed, both targets will compile the test suite -which you can run using the ``check`` target. +If you have *libcheck* installed you can compile the test suite which you can +run using the ``check`` target. -Both build systems will auto detect *OpenSSL* and *GnuTLS* and use one or both. -Each build system has a way to force-enable (error if not found) or force-disable -either library. +CMake will auto detect *OpenSSL* and *GnuTLS* and use one or both. There are +CMake options to force either one on or off. diff --git a/cmake/AutoToolsVersion.cmake b/cmake/AutoToolsVersion.cmake deleted file mode 100644 index fae5fb8b..00000000 --- a/cmake/AutoToolsVersion.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# Get information from configure.ac -FILE(STRINGS "${CMAKE_SOURCE_DIR}/configure.ac" configure REGEX "^m4_define") -foreach (line ${configure}) - foreach (var major_version minor_version micro_version - so_current so_revision so_age libjwt_project - libjwt_bugs libjwt_url libjwt_brief) - if (NOT ${var} AND line MATCHES "m4_define\\(\\[${var}\\],.*\\[(.*)\\]\\)") - set(${var} "${CMAKE_MATCH_1}") - break() - endif() - endforeach() -endforeach() - -set(LIBJWT_VERSION "${major_version}.${minor_version}.${micro_version}") -set(LIBJWT_PROJECT "${libjwt_project}") -set(LIBJWT_DESCRIPTION "${libjwt_brief}") -set(LIBJWT_HOMEPAGE_URL "${libjwt_url}") - -# WWLTD (What would libtool do) -math(EXPR SO_MAJOR "${so_current} - ${so_age}") -set(SO_MINOR "${so_age}") -set(SO_REVISION "${so_revision}") -set(LIBJWT_VERSION_INFO "${SO_MAJOR}.${SO_MINOR}.${SO_REVISION}") -set(LIBJWT_COMPATVERSION "${SO_MAJOR}") diff --git a/cmake/CPackConfig.cmake b/cmake/CPackConfig.cmake index fa55f15e..568e0b45 100644 --- a/cmake/CPackConfig.cmake +++ b/cmake/CPackConfig.cmake @@ -10,11 +10,12 @@ # usually begin with CPACK__xxxx. set(CPACK_BINARY_TBZ2 "OFF") +set(CPACK_BINARY_DEB "ON") set(CPACK_GENERATOR "TBZ2") -set(CPACK_PACKAGE_NAME "libjwt") set(CPACK_PACKAGE_VENDOR "maClara, LLC") set(CPACK_SOURCE_GENERATOR "TBZ2") set(CPACK_SOURCE_TBZ2 "ON") +set(CPACK_PACKAGE_CONTACT "Ben Collins ") set(CPACK_IGNORE_FILES "/\\.git/" "\\.gitignore" "\\.swp\$" "\\.DS_Store" "\\.travis.yml") list(APPEND CPACK_IGNORE_FILES "/build/" "Makefile.*" "configure.ac" "/m4/" "Doxygen\\.mk") list(APPEND CPACK_IGNORE_FILES "/dist/" "jwt_export\\.h\\.in" "/m4-local/") diff --git a/cmake/LibJWTVersions.cmake b/cmake/LibJWTVersions.cmake new file mode 100644 index 00000000..d9d65697 --- /dev/null +++ b/cmake/LibJWTVersions.cmake @@ -0,0 +1,26 @@ +# Source of truth + +set(LIBJWT_PROJECT "LibJWT") +set(LIBJWT_DESCRIPTION "The C JSON Web Token Library +JWK +JWKS") +set(LIBJWT_HOMEPAGE_URL "https://libjwt.io") + +set(LIBJWT_VERSION_SET 2 1 1) + +set(LIBJWT_SO_CRA 13 1 11) +# SONAME History +# v1.12.1 0 => 1 +# v1.15.0 1 => 2 +# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html + +string(TOLOWER ${LIBJWT_PROJECT} LIBJWT_PROJECT_LOWER) +string(JOIN "." LIBJWT_VERSION ${LIBJWT_VERSION_SET}) + +list(GET LIBJWT_SO_CRA 0 LIBJWT_SO_CURRENT) +list(GET LIBJWT_SO_CRA 1 LIBJWT_SO_REVISION) +list(GET LIBJWT_SO_CRA 2 LIBJWT_SO_AGE) + +# Libtool does -version-info cur:rev:age, but cmake does things +# a bit different. However, the result is the same. +math(EXPR JWT_SO_MAJOR "${LIBJWT_SO_CURRENT} - ${LIBJWT_SO_AGE}") +set(LIBJWT_VERSION_INFO "${JWT_SO_MAJOR}.${LIBJWT_SO_AGE}.${LIBJWT_SO_REVISION}") +set(LIBJWT_COMPATVERSION "${JWT_SO_MAJOR}") diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 7168ff3d..00000000 --- a/configure.ac +++ /dev/null @@ -1,153 +0,0 @@ -dnl The use of m4_define here is to make it easy to parse by CMakeLists.txt. -dnl That way there's one source for this info - -AC_PREREQ([2.61]) - -dnl The library version -m4_define([major_version], [2]) -m4_define([minor_version], [1]) -m4_define([micro_version], [0]) -m4_define([libjwt_version], [major_version.minor_version.micro_version]) - -m4_if(m4_esyscmd_s([ls -d .git || echo none]),[.git], - m4_define([libjwt_version], - m4_esyscmd_s([git describe --abbrev=7 --dirty --always --tags | sed -e 's/^v//']))) - -dnl SONAME History -dnl v1.12.1 0 => 1 -dnl v1.15.0 1 => 2 -dnl http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html -m4_define([so_current], [13]) -m4_define([so_revision], [1]) -m4_define([so_age], [11]) -m4_define([libjwt_version_info], [so_current:so_revision:so_age]) - -m4_define([libjwt_project], [LibJWT]) -m4_define([libjwt_bugs], [https://github.com/benmcollins/libjwt/issues]) -m4_define([libjwt_url], [https://libjwt.io]) -m4_define([libjwt_brief], [The C JSON Web Token Library +JWK +JWKS]) - -AC_INIT([libjwt_project], - [libjwt_version], - [libjwt_bugs], - [], - [libjwt_url]) - -AC_SUBST([LIBJWT_VERSION_INFO], [libjwt_version_info]) -AC_DEFINE([PACKAGE_DESCRIPTION], ["libjwt_brief"], [Description of this project]) -AC_SUBST([PACKAGE_DESCRIPTION], ["libjwt_brief"]) - -AC_LANG([C]) -AM_INIT_AUTOMAKE([foreign subdir-objects dist-bzip2]) -LT_PREREQ([2.2]) -LT_INIT([]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([libjwt/config.h]) - -AC_SUBST([AM_CFLAGS], [-Wall]) - -[RPMB_GNUTLS="--without gnutls"] -[RPMB_OPENSSL="--without openssl"] - -AC_ARG_WITH([gnutls], - [AS_HELP_STRING([--with-gnutls], - [Support GnuTLS for crypto operations @<:@default=check@:>@])], - [], [with_gnutls=check]) - -AC_ARG_WITH([openssl], - [AS_HELP_STRING([--with-openssl], - [Support OpenSSL for crypto operations @<:@default=check@:>@])], - [], [with_openssl=check]) - -AC_ARG_WITH([mbedtls], - [AS_HELP_STRING([--with-mbedtls], - [Support MBedTLS for crypto operations @<:@default=no@:>@])], - [], [with_mbedtls=no]) - -AS_IF([test "x$with_openssl" != xno], - [PKG_CHECK_MODULES([OPENSSL], [openssl >= 1.1.0], - [have_openssl=yes], - [AS_IF([test "x$with_openssl" != xcheck], - AC_MSG_FAILURE([--with-openssl was given but OpenSSL not found]) - )])]) - -AS_IF([test "x$with_gnutls" != xno], - [PKG_CHECK_MODULES([GNUTLS], [gnutls >= 3.6.0], - [have_gnutls=yes], - [AS_IF([test "x$with_gnutls" != xcheck], - AC_MSG_FAILURE([--with-gnutls was given but GnuTLS not found]) - )])]) - -AS_IF([test "x$have_gnutls" = xyes], - dnl We got it - [AC_DEFINE([HAVE_GNUTLS], [1], [GnuTLS Support])] - [AM_CONDITIONAL([HAVE_GNUTLS], [true])] - [have_crypto=yes] - [RPMB_GNUTLS="--with gnutls"], - - dnl We don't - [AM_CONDITIONAL([HAVE_GNUTLS], [false])] -) - -AS_IF([test "x$have_openssl" = xyes], - dnl We got it - [AC_DEFINE([HAVE_OPENSSL], [1], [OpenSSL Support])] - [AM_CONDITIONAL([HAVE_OPENSSL], [true])] - [have_crypto=yes] - [RPMB_OPENSSL="--with openssl"], - - dnl We don't - [AM_CONDITIONAL([HAVE_OPENSSL], [false])] -) - -CHECK_MBEDTLS - -AS_IF([test "x$have_crypto" = x], - [AC_MSG_ERROR([No crypto library detected])]) - -AC_ARG_WITH([examples], - AS_HELP_STRING([--with-examples], [Build example programs @<:@default=no@:>@]), - [AM_CONDITIONAL([BUILD_EXAMPLES],[true])], - [AM_CONDITIONAL([BUILD_EXAMPLES],[false])]) - -PKG_CHECK_MODULES([JANSSON], [jansson >= 2.0]) -PKG_CHECK_MODULES([CHECK], [check >= 0.9.10], - [RPMB_CHECK="--with check"],[RPMB_CHECK="--without check"]) - -AC_SUBST([RPMBUILD_OPTS],["$RPMB_OPENSSL $RPMB_GNUTLS $RPMB_CHECK"]) - -dnl Check for compiler support flags -dnl AX_GCC_FUNC_ATTRIBUTE([deprecated]) -dnl AX_GCC_FUNC_ATTRIBUTE([visibility]) -AC_SUBST([GCC_FUNC_DEPRECATED],["__attribute__((__deprecated__))"]) -AC_SUBST([GCC_EXPORT],["__attribute__((visibility(\"default\")))"]) -AC_SUBST([GCC_NO_EXPORT],["__attribute__((visibility(\"hidden\")))"]) -AC_SUBST([GCC_CONSTRUCTOR],["__attribute__((constructor))"]) - -dnl Valgrind defaults -AX_VALGRIND_DFLT([memcheck], [on]) -AX_VALGRIND_DFLT([helgrind], [off]) -AX_VALGRIND_DFLT([drd], [off]) -AX_VALGRIND_DFLT([sgcheck], [off]) -AX_VALGRIND_CHECK - -AX_CODE_COVERAGE - -DX_ENV_APPEND(PROJECT_BRIEF, $PACKAGE_DESCRIPTION) -DX_INIT_DOXYGEN($PACKAGE_NAME, Doxyfile) - -AC_CONFIG_FILES([ - Makefile - include/Makefile - libjwt/Makefile - examples/Makefile - libjwt/libjwt.pc - dist/Makefile - dist/libjwt.spec - tests/Makefile - tests/keys/Makefile - tests/keys/jwks/Makefile - include/jwt_export.h -]) - -AC_OUTPUT diff --git a/dist/Makefile.am b/dist/Makefile.am deleted file mode 100644 index 50c02398..00000000 --- a/dist/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (C) 2015-2024 maClara, LLC -# This file is part of the JWT C Library -# -# SPDX-License-Identifier: MPL-2.0 -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -clean-local: - rm -rf $(builddir)/rpmbuild - -$(top_builddir)/$(PACKAGE)-$(VERSION).tar.bz2: - $(MAKE) -C $(top_builddir) dist-bzip2 - -$(builddir)/rpmbuild/SOURCES/$(PACKAGE)-$(VERSION).tar.bz2: $(top_builddir)/$(PACKAGE)-$(VERSION).tar.bz2 - $(MKDIR_P) $(builddir)/rpmbuild/{SOURCES,SPECS,RPMS,SRPMS,BUILD} - $(INSTALL) $< $@ - -rpm: libjwt.spec $(builddir)/rpmbuild/SOURCES/$(PACKAGE)-$(VERSION).tar.bz2 - rpmbuild @RPMBUILD_OPTS@ -ba --define "_topdir $(builddir)/rpmbuild" libjwt.spec diff --git a/dist/libjwt.spec.in b/dist/libjwt.spec.in deleted file mode 100644 index f1661f04..00000000 --- a/dist/libjwt.spec.in +++ /dev/null @@ -1,102 +0,0 @@ -%bcond_with gnutls -%bcond_without openssl -%bcond_with check -%bcond_with coverage -%bcond_with docs - -Summary: LibJWT: A C implementation of JSON Web Token and JSON Web Key (Set) -Name: libjwt -Version: @VERSION@ -Release: 0%{?dist} -License: MPLv2.0 -Group: Development/Tools -Source: https://github.com/benmcollins/libjwt/releases/download/v%{version}/libjwt-%{version}.tar.bz2 -URL: https://github.com/benmcollins/libjwt - -BuildRequires: pkgconfig(jansson) >= 2.0 -BuildRequires: make autoconf libtool automake - -%if %{with openssl} -BuildRequires: pkgconfig(openssl) >= 1.1.0 -%endif -%if %{with gnutls} -BuildRequires: pkgconfig(gnutls) >= 3.6.0 -%endif -%if %{with docs} -BuildRequires: doxygen -%endif -%if %{with check} -BuildRequires: pkgconfig(check) >= 0.9.4 -%endif - -%description -JSON Web Tokens are an open industry standard RFC 7519 method for representing -claims securely between two parties. This package is a C library implementing -JWT functionality. It supports HS256/384/512, RS256/384/512, ES256/384/512, -PS256/384/512, EdDSA, and ES256K algorithms. - -In addition, it supports impporting and using JWK and JWKS for keys. - - -%package devel -Summary: JSON Web Token (C implementation) development kit -Group: Development/Libraries -Requires: %{name}%{?_isa} = %{version}-%{release} - -%description devel -Development files for the JWT C library. - - -%prep -%setup -q - -%build -test -e configure || autoreconf -fi -# We could set the --with/out configure args for the options set above, -# but we'll just let things get detected -%configure -make %{?_smp_mflags} - - -%install -rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT - -%if %{with check} -%check -make %{?make_test_opts} check -%endif - -%clean -rm -rf $RPM_BUILD_ROOT - -%post -/sbin/ldconfig - -%postun -/sbin/ldconfig - -%files -%doc README.md -%if "%{_host_os}" == "darwin" -%{_libdir}/lib*.*.dylib -%else -%{_libdir}/lib*.so.* -%endif - -%files devel -%doc -%if "%{_host_os}" == "darwin" -%{_libdir}/lib*.dylib -%else -%{_libdir}/lib*.so -%endif -%{_libdir}/lib*.a -%{_libdir}/pkgconfig/*.pc -%{_includedir}/* - -%changelog -* Tue Dec 17 2024 maClara, LLC - 2.1.0-0 -- Updated -* Tue Nov 12 2019 Julien Courtat - 1.11.0-0 -- Initial packaging diff --git a/Doxyfile b/doxygen/Doxyfile similarity index 99% rename from Doxyfile rename to doxygen/Doxyfile index eb663d92..1d3cbacf 100644 --- a/Doxyfile +++ b/doxygen/Doxyfile @@ -1044,7 +1044,7 @@ EXCLUDE_SYMBOLS = # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = $(SRCDIR)/doxygen-extra +EXAMPLE_PATH = $(SRCDIR)/doxygen # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -1285,7 +1285,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = $(SRCDIR)/doxygen-extra/header.html +HTML_HEADER = $(SRCDIR)/doxygen/header.html # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank Doxygen will generate a standard @@ -1295,7 +1295,7 @@ HTML_HEADER = $(SRCDIR)/doxygen-extra/header.html # that Doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = $(SRCDIR)/doxygen-extra/footer.html +HTML_FOOTER = $(SRCDIR)/doxygen/footer.html # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1325,8 +1325,8 @@ HTML_STYLESHEET = # documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = $(SRCDIR)/doxygen-extra/doxygen-awesome.css \ - $(SRCDIR)/doxygen-extra/libjwt.css +HTML_EXTRA_STYLESHEET = $(SRCDIR)/doxygen/doxygen-awesome.css \ + $(SRCDIR)/doxygen/libjwt.css # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1336,9 +1336,9 @@ HTML_EXTRA_STYLESHEET = $(SRCDIR)/doxygen-extra/doxygen-awesome.css \ # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = $(SRCDIR)/doxygen-extra/doxygen-awesome-paragraph-link.js \ - $(SRCDIR)/doxygen-extra/doxygen-awesome-fragment-copy-button.js \ - $(SRCDIR)/doxygen-extra/doxygen-awesome-interactive-toc.js +HTML_EXTRA_FILES = $(SRCDIR)/doxygen/doxygen-awesome-paragraph-link.js \ + $(SRCDIR)/doxygen/doxygen-awesome-fragment-copy-button.js \ + $(SRCDIR)/doxygen/doxygen-awesome-interactive-toc.js # The HTML_COLORSTYLE tag can be used to specify if the generated HTML output # should be rendered with a dark or light theme. diff --git a/doxygen-extra/doxygen-awesome-fragment-copy-button.js b/doxygen/doxygen-awesome-fragment-copy-button.js similarity index 100% rename from doxygen-extra/doxygen-awesome-fragment-copy-button.js rename to doxygen/doxygen-awesome-fragment-copy-button.js diff --git a/doxygen-extra/doxygen-awesome-interactive-toc.js b/doxygen/doxygen-awesome-interactive-toc.js similarity index 100% rename from doxygen-extra/doxygen-awesome-interactive-toc.js rename to doxygen/doxygen-awesome-interactive-toc.js diff --git a/doxygen-extra/doxygen-awesome-paragraph-link.js b/doxygen/doxygen-awesome-paragraph-link.js similarity index 100% rename from doxygen-extra/doxygen-awesome-paragraph-link.js rename to doxygen/doxygen-awesome-paragraph-link.js diff --git a/doxygen-extra/doxygen-awesome-tabs.js b/doxygen/doxygen-awesome-tabs.js similarity index 100% rename from doxygen-extra/doxygen-awesome-tabs.js rename to doxygen/doxygen-awesome-tabs.js diff --git a/doxygen-extra/doxygen-awesome.css b/doxygen/doxygen-awesome.css similarity index 100% rename from doxygen-extra/doxygen-awesome.css rename to doxygen/doxygen-awesome.css diff --git a/doxygen-extra/footer.html b/doxygen/footer.html similarity index 100% rename from doxygen-extra/footer.html rename to doxygen/footer.html diff --git a/doxygen-extra/header.html b/doxygen/header.html similarity index 100% rename from doxygen-extra/header.html rename to doxygen/header.html diff --git a/doxygen-extra/libjwt.css b/doxygen/libjwt.css similarity index 100% rename from doxygen-extra/libjwt.css rename to doxygen/libjwt.css diff --git a/doxygen-extra/mainpage.dox b/doxygen/mainpage.dox similarity index 80% rename from doxygen-extra/mainpage.dox rename to doxygen/mainpage.dox index 2944d604..4c59cf55 100644 --- a/doxygen-extra/mainpage.dox +++ b/doxygen/mainpage.dox @@ -20,6 +20,7 @@ Standard | RFC | Description @subsection req Required - JANSSON (>= 2.0) +- CMake (>= 3.7) @subsection req_crypto One or more of these @@ -48,16 +49,6 @@ LibJWT is available in most Linux distributions as well as through @section instructions @fa{hammer} Build Instructions -@subsection autotools With GNU AutoTools: - -@code{.sh} -$ autoreconf -if -$ mkdir build -$ cd build -$ ../configure -$ make -@endcode - @subsection cmake With CMake: @code{.sh} @@ -69,9 +60,8 @@ $ make @subsection common Common -If you have libcheck installed, both targets will compile the test suite -which you can run using the ``check`` target. +If you have *libcheck* installed you can compile the test suite which you can +run using the ``check`` target. -Both build systems will auto detect OpenSSL and GnuTLS and use one or -both. Each build system has a way to force-enable (error if not found) -or force-disable either library. See the @ref jwt_crypto_grp section +CMake will auto detect *OpenSSL* and *GnuTLS* and use one or both. There are +CMake options to force either one on or off. diff --git a/examples/Makefile.am b/examples/Makefile.am deleted file mode 100644 index 06dce795..00000000 --- a/examples/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (C) 2015-2024 maClara, LLC -# This file is part of the JWT C Library -# -# SPDX-License-Identifier: MPL-2.0 -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -EXAMPLES = \ - jwtgen \ - jwtauth - -noinst_PROGRAMS = $(EXAMPLES) - -jwtgen_SOURCES = main-gen.c -jwtauth_SOURCES = main-auth.c - -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -AM_CFLAGS = -Wall -DKEYDIR="\"$(srcdir)/keys\"" -D_GNU_SOURCE -AM_LDFLAGS = -L$(top_builddir)/libjwt -LDADD = -ljwt - diff --git a/include/Makefile.am b/include/Makefile.am deleted file mode 100644 index 8259b7be..00000000 --- a/include/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (C) 2015-2024 maClara, LLC -# This file is part of the JWT C Library -# -# SPDX-License-Identifier: MPL-2.0 -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -include_HEADERS = jwt.h -nodist_include_HEADERS = jwt_export.h diff --git a/include/jwt_export.h.in b/include/jwt_export.h.in deleted file mode 100644 index 512bf2ce..00000000 --- a/include/jwt_export.h.in +++ /dev/null @@ -1,26 +0,0 @@ - -#ifndef JWT_EXPORT_H -#define JWT_EXPORT_H - -#ifdef _MSC_VER -# define JWT_DEPRECATED __declspec(deprecated) -# ifdef JWT_DLL_CONFIG -# ifdef JWT_BUILD_SHARED_LIBRARY -# define JWT_EXPORT __declspec(dllexport) -# else -# define JWT_EXPORT __declspec(dllimport) -# endif -# endif -# define JWT_CONSTRUCTOR -#else -# define JWT_DEPRECATED @GCC_FUNC_DEPRECATED@ -# define JWT_EXPORT @GCC_EXPORT@ -# define JWT_NO_EXPORT @GCC_NO_EXPORT@ -# define JWT_CONSTRUCTOR @GCC_CONSTRUCTOR@ -#endif - -#ifndef JWT_DEPRECATED_EXPORT -# define JWT_DEPRECATED_EXPORT JWT_EXPORT JWT_DEPRECATED -#endif - -#endif /* JWT_EXPORT_H */ diff --git a/libjwt/Makefile.am b/libjwt/Makefile.am deleted file mode 100644 index 774861bb..00000000 --- a/libjwt/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (C) 2015-2024 maClara, LLC -# This file is part of the JWT C Library -# -# SPDX-License-Identifier: MPL-2.0 -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include - -lib_LTLIBRARIES = libjwt.la - -libjwt_la_SOURCES = jwt.c jwt-verify.c jwt-encode.c jwks.c \ - jwt-crypto-ops.c jwt-memory.c jwt-setget.c ../libjwt/jwt-validate.c \ - base64.c jwt-private.h base64.h ll.h - -libjwt_la_LDFLAGS = -version-info $(LIBJWT_VERSION_INFO) $(OPENSSL_LDFLAGS) \ - $(GNUTLS_LDFLAGS) $(MBEDTLS_LIBS) $(JANSSON_LDFLAGS) -no-undefined - -libjwt_la_CPPFLAGS = $(OPENSSL_INCLUDES) $(MBEDTLS_INCS) $(GNUTLS_INCLUDES) \ - $(CODE_COVERAGE_CPPFLAGS) $(AM_CPPFLAGS) - -libjwt_la_CFLAGS = $(JANSSON_CFLAGS) $(OPENSSL_CFLAGS) $(GNUTLS_CFLAGS) \ - $(CODE_COVERAGE_CFLAGS) -D_GNU_SOURCE - -libjwt_la_LIBADD = $(JANSSON_LIBS) $(OPENSSL_LIBS) $(GNUTLS_LIBS) \ - $(CODE_COVERAGE_LDFLAGS) - -if HAVE_OPENSSL -libjwt_la_SOURCES += openssl/jwk-parse.c openssl/sign-verify.c -endif - -if HAVE_GNUTLS -libjwt_la_SOURCES += gnutls/jwk-parse.c gnutls/sign-verify.c -endif - -if HAVE_MBEDTLS -libjwt_la_SOURCES += mbedtls/jwk-parse.c mbedtls/sign-verify.c -endif - -pkgconfiglibdir = $(libdir)/pkgconfig -pkgconfiglib_DATA = libjwt.pc diff --git a/libjwt/libjwt.pc.in b/libjwt/libjwt.pc.in index fef604ef..86f20436 100644 --- a/libjwt/libjwt.pc.in +++ b/libjwt/libjwt.pc.in @@ -1,13 +1,13 @@ -prefix=@prefix@ -exec_prefix=${prefix} +prefix=@CMAKE_INSTALL_PREFIX@ libdir=${prefix}/lib includedir=${prefix}/include -Name: @PACKAGE_NAME@ -URL: https://github.com/benmcollins/libjwt -Description: JWT C Library -Version: @PACKAGE_VERSION@ +Name: @CMAKE_PROJECT_NAME@ +Description: @CMAKE_PROJECT_DESCRIPTION@ +Version: @CMAKE_PROJECT_VERSION@ +URL: @CMAKE_PROJECT_HOMEPAGE_URL@ +Requires: @JANSSON_MODULE_NAME@ @OPENSSL_MODULE_NAME@ @GNUTLS_MODULE_NAME@ Cflags: -I${includedir} Libs: -L${libdir} -ljwt -Libs.private: @JANSSON_LIBS@ @OPENSSL_LIBS@ @GNUTLS_LIBS@ +Libs.private: @LIBJWT_LDFLAGS@ diff --git a/m4-local/ax_code_coverage.m4 b/m4-local/ax_code_coverage.m4 deleted file mode 100644 index 178d9381..00000000 --- a/m4-local/ax_code_coverage.m4 +++ /dev/null @@ -1,249 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_code_coverage.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CODE_COVERAGE() -# -# DESCRIPTION -# -# Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS, -# CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LDFLAGS which should be -# included in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LDFLAGS variables of -# every build target (program or library) which should be built with code -# coverage support. Also defines CODE_COVERAGE_RULES which should be -# substituted in your Makefile; and $enable_code_coverage which can be -# used in subsequent configure output. CODE_COVERAGE_ENABLED is defined -# and substituted, and corresponds to the value of the -# --enable-code-coverage option, which defaults to being disabled. -# -# Test also for gcov program and create GCOV variable that could be -# substituted. -# -# Note that all optimisation flags in CFLAGS must be disabled when code -# coverage is enabled. -# -# Usage example: -# -# configure.ac: -# -# AX_CODE_COVERAGE -# -# Makefile.am: -# -# @CODE_COVERAGE_RULES@ -# my_program_LIBS = ... $(CODE_COVERAGE_LDFLAGS) ... -# my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ... -# my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ... -# my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ... -# -# This results in a "check-code-coverage" rule being added to any -# Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module -# has been configured with --enable-code-coverage). Running `make -# check-code-coverage` in that directory will run the module's test suite -# (`make check`) and build a code coverage report detailing the code which -# was touched, then print the URI for the report. -# -# This code was derived from Makefile.decl in GLib, originally licenced -# under LGPLv2.1+. -# -# LICENSE -# -# Copyright (c) 2012, 2016 Philip Withnall -# Copyright (c) 2012 Xan Lopez -# Copyright (c) 2012 Christian Persch -# Copyright (c) 2012 Paolo Borelli -# Copyright (c) 2012 Dan Winship -# Copyright (c) 2015 Bastien ROUCARIES -# -# This library is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or (at -# your option) any later version. -# -# This library 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 Lesser -# General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program. If not, see . - -#serial 16 - -AC_DEFUN([AX_CODE_COVERAGE],[ - dnl Check for --enable-code-coverage - AC_REQUIRE([AC_PROG_SED]) - - # allow to override gcov location - AC_ARG_WITH([gcov], - [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])], - [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov], - [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov]) - - AC_MSG_CHECKING([whether to build with code coverage support]) - AC_ARG_ENABLE([code-coverage], - AS_HELP_STRING([--enable-code-coverage], - [Whether to enable code coverage support]),, - enable_code_coverage=no) - - AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes]) - AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage]) - AC_MSG_RESULT($enable_code_coverage) - - AS_IF([ test "$enable_code_coverage" = "yes" ], [ - # check for gcov - AC_CHECK_TOOL([GCOV], - [$_AX_CODE_COVERAGE_GCOV_PROG_WITH], - [:]) - AS_IF([test "X$GCOV" = "X:"], - [AC_MSG_ERROR([gcov is needed to do coverage])]) - AC_SUBST([GCOV]) - - dnl Check if gcc is being used - AS_IF([ test "$GCC" = "no" ], [ - AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage]) - ]) - - AC_CHECK_PROG([LCOV], [lcov], [lcov]) - AC_CHECK_PROG([GENHTML], [genhtml], [genhtml]) - - AS_IF([ test -z "$GENHTML" ], [ - AC_MSG_ERROR([Could not find genhtml from the lcov package]) - ]) - - dnl Build the code coverage flags - CODE_COVERAGE_CPPFLAGS="-DNDEBUG" - CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" - CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" - dnl Using -lgcov explicitly seems to be unneeded -- BenC : Aug 13, 2017 - CODE_COVERAGE_LDFLAGS="" - - AC_SUBST([CODE_COVERAGE_CPPFLAGS]) - AC_SUBST([CODE_COVERAGE_CFLAGS]) - AC_SUBST([CODE_COVERAGE_CXXFLAGS]) - AC_SUBST([CODE_COVERAGE_LDFLAGS]) - ]) - -[CODE_COVERAGE_RULES=' -# Code coverage -# -# Optional: -# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting. -# Multiple directories may be specified, separated by whitespace. -# (Default: $(top_builddir)) -# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated -# by lcov for code coverage. (Default: -# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info) -# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage -# reports to be created. (Default: -# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage) -# - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage, -# set to 0 to disable it and leave empty to stay with the default. -# (Default: empty) -# - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov -# instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) -# - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov -# instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) -# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov -# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the -# collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) -# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov -# instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) -# - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering -# lcov instance. (Default: empty) -# - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov -# instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) -# - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the -# genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) -# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml -# instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) -# - CODE_COVERAGE_EXTRACT_PATTERN: Glob pattern of files to keep -# -# The generated report will be titled using the $(PACKAGE_NAME) and -# $(PACKAGE_VERSION). In order to add the current git hash to the title, -# use the git-version-gen script, available online. - -# Optional variables -CODE_COVERAGE_DIRECTORY ?= $(top_builddir) -CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info -CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage -CODE_COVERAGE_BRANCH_COVERAGE ?= -CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ ---rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) -CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) -CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)" -CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) -CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) -CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?= -CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) -CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\ -$(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ ---rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) -CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULTS) -CODE_COVERAGE_EXTRACT_PATTERN ?= $(top_srcdir) - -code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V)) -code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY)) -code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\ - $(CODE_COVERAGE_OUTPUT_FILE); -code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V)) -code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY)) -code_coverage_v_lcov_ign_0 = @echo " LCOV --extract "\ - $(CODE_COVERAGE_EXTRACT_PATTERN); -code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V)) -code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY)) -code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY); -code_coverage_quiet = $(code_coverage_quiet_$(V)) -code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY)) -code_coverage_quiet_0 = --quiet - -# sanitizes the test-name: replaces with underscores: dashes and dots -code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) - -# Use recursive makes in order to ignore errors during check -check-code-coverage: -ifeq ($(CODE_COVERAGE_ENABLED),yes) - -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check - $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture -else - @echo "Need to reconfigure with --enable-code-coverage" -endif - -# Capture code coverage data -code-coverage-capture: code-coverage-capture-hook -ifeq ($(CODE_COVERAGE_ENABLED),yes) - $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) - $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --extract "$(CODE_COVERAGE_OUTPUT_FILE).tmp" $(CODE_COVERAGE_EXTRACT_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) - -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp - $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) - @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" -else - @echo "Need to reconfigure with --enable-code-coverage" -endif - -# Hook rule executed before code-coverage-capture, overridable by the user -code-coverage-capture-hook: - -ifeq ($(CODE_COVERAGE_ENABLED),yes) -clean: code-coverage-clean -distclean: code-coverage-clean -code-coverage-clean: - -$(LCOV) --directory $(top_builddir) -z - -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) - -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete -endif - -GITIGNOREFILES ?= -GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) - -A''M_DISTCHECK_CONFIGURE_FLAGS ?= -A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage - -.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean -'] - - AC_SUBST([CODE_COVERAGE_RULES]) - m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])]) -]) diff --git a/m4-local/ax_gcc_func_attribute.m4 b/m4-local/ax_gcc_func_attribute.m4 deleted file mode 100644 index e2aa05b9..00000000 --- a/m4-local/ax_gcc_func_attribute.m4 +++ /dev/null @@ -1,243 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_GCC_FUNC_ATTRIBUTE(ATTRIBUTE) -# -# DESCRIPTION -# -# This macro checks if the compiler supports one of GCC's function -# attributes; many other compilers also provide function attributes with -# the same syntax. Compiler warnings are used to detect supported -# attributes as unsupported ones are ignored by default so quieting -# warnings when using this macro will yield false positives. -# -# The ATTRIBUTE parameter holds the name of the attribute to be checked. -# -# If ATTRIBUTE is supported define HAVE_FUNC_ATTRIBUTE_. -# -# The macro caches its result in the ax_cv_have_func_attribute_ -# variable. -# -# The macro currently supports the following function attributes: -# -# alias -# aligned -# alloc_size -# always_inline -# artificial -# cold -# const -# constructor -# constructor_priority for constructor attribute with priority -# deprecated -# destructor -# dllexport -# dllimport -# error -# externally_visible -# fallthrough -# flatten -# format -# format_arg -# gnu_format -# gnu_inline -# hot -# ifunc -# leaf -# malloc -# noclone -# noinline -# nonnull -# noreturn -# nothrow -# optimize -# pure -# sentinel -# sentinel_position -# unused -# used -# visibility -# warning -# warn_unused_result -# weak -# weakref -# -# Unsupported function attributes will be tested with a prototype -# returning an int and not accepting any arguments and the result of the -# check might be wrong or meaningless so use with care. -# -# LICENSE -# -# Copyright (c) 2013 Gabriele Svelto -# -# 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 13 - -AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ - AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1]) - - AC_CACHE_CHECK([for __attribute__(($1))], [ac_var], [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([ - m4_case([$1], - [alias], [ - int foo( void ) { return 0; } - int bar( void ) __attribute__(($1("foo"))); - ], - [aligned], [ - int foo( void ) __attribute__(($1(32))); - ], - [alloc_size], [ - void *foo(int a) __attribute__(($1(1))); - ], - [always_inline], [ - inline __attribute__(($1)) int foo( void ) { return 0; } - ], - [artificial], [ - inline __attribute__(($1)) int foo( void ) { return 0; } - ], - [cold], [ - int foo( void ) __attribute__(($1)); - ], - [const], [ - int foo( void ) __attribute__(($1)); - ], - [constructor_priority], [ - int foo( void ) __attribute__((__constructor__(65535/2))); - ], - [constructor], [ - int foo( void ) __attribute__(($1)); - ], - [deprecated], [ - int foo( void ) __attribute__(($1(""))); - ], - [destructor], [ - int foo( void ) __attribute__(($1)); - ], - [dllexport], [ - __attribute__(($1)) int foo( void ) { return 0; } - ], - [dllimport], [ - int foo( void ) __attribute__(($1)); - ], - [error], [ - int foo( void ) __attribute__(($1(""))); - ], - [externally_visible], [ - int foo( void ) __attribute__(($1)); - ], - [fallthrough], [ - void foo( int x ) {switch (x) { case 1: __attribute__(($1)); case 2: break ; }}; - ], - [flatten], [ - int foo( void ) __attribute__(($1)); - ], - [format], [ - int foo(const char *p, ...) __attribute__(($1(printf, 1, 2))); - ], - [gnu_format], [ - int foo(const char *p, ...) __attribute__((format(gnu_printf, 1, 2))); - ], - [format_arg], [ - char *foo(const char *p) __attribute__(($1(1))); - ], - [gnu_inline], [ - inline __attribute__(($1)) int foo( void ) { return 0; } - ], - [hot], [ - int foo( void ) __attribute__(($1)); - ], - [ifunc], [ - int my_foo( void ) { return 0; } - static int (*resolve_foo(void))(void) { return my_foo; } - int foo( void ) __attribute__(($1("resolve_foo"))); - ], - [leaf], [ - __attribute__(($1)) int foo( void ) { return 0; } - ], - [malloc], [ - void *foo( void ) __attribute__(($1)); - ], - [noclone], [ - int foo( void ) __attribute__(($1)); - ], - [noinline], [ - __attribute__(($1)) int foo( void ) { return 0; } - ], - [nonnull], [ - int foo(char *p) __attribute__(($1(1))); - ], - [noreturn], [ - void foo( void ) __attribute__(($1)); - ], - [nothrow], [ - int foo( void ) __attribute__(($1)); - ], - [optimize], [ - __attribute__(($1(3))) int foo( void ) { return 0; } - ], - [pure], [ - int foo( void ) __attribute__(($1)); - ], - [sentinel], [ - int foo(void *p, ...) __attribute__(($1)); - ], - [sentinel_position], [ - int foo(void *p, ...) __attribute__(($1(1))); - ], - [returns_nonnull], [ - void *foo( void ) __attribute__(($1)); - ], - [unused], [ - int foo( void ) __attribute__(($1)); - ], - [used], [ - int foo( void ) __attribute__(($1)); - ], - [visibility], [ - int foo_def( void ) __attribute__(($1("default"))); - int foo_hid( void ) __attribute__(($1("hidden"))); - int foo_int( void ) __attribute__(($1("internal"))); - int foo_pro( void ) __attribute__(($1("protected"))); - ], - [warning], [ - int foo( void ) __attribute__(($1(""))); - ], - [warn_unused_result], [ - int foo( void ) __attribute__(($1)); - ], - [weak], [ - int foo( void ) __attribute__(($1)); - ], - [weakref], [ - static int foo( void ) { return 0; } - static int bar( void ) __attribute__(($1("foo"))); - ], - [ - m4_warn([syntax], [Unsupported attribute $1, the test may fail]) - int foo( void ) __attribute__(($1)); - ] - )], []) - ], - dnl GCC doesn't exit with an error if an unknown attribute is - dnl provided but only outputs a warning, so accept the attribute - dnl only if no warning were issued. - [AS_IF([grep -- -Wattributes conftest.err], - [AS_VAR_SET([ac_var], [no])], - [AS_VAR_SET([ac_var], [yes])])], - [AS_VAR_SET([ac_var], [no])]) - ]) - - AS_IF([test yes = AS_VAR_GET([ac_var])], - [AS_IF([test $1 = visibility], - [AC_SUBST([GCC_EXPORT], ["__attribute__((visibility(\"default\")))"])], - [AC_SUBST(AS_TR_CPP(GCC_FUNC_$1),["__attribute__((deprecated))"])], [])], []) - - AS_VAR_POPDEF([ac_var]) -]) diff --git a/m4-local/ax_valgrind_check.m4 b/m4-local/ax_valgrind_check.m4 deleted file mode 100644 index b18babe6..00000000 --- a/m4-local/ax_valgrind_check.m4 +++ /dev/null @@ -1,236 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_valgrind_check.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_VALGRIND_DFLT(memcheck|helgrind|drd|sgcheck, on|off) -# AX_VALGRIND_CHECK() -# -# DESCRIPTION -# -# AX_VALGRIND_CHECK 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. Individual -# Valgrind tools can be disabled via --disable-valgrind-, the -# default is configurable via the AX_VALGRIND_DFLT command or is to use -# all commands not disabled via AX_VALGRIND_DFLT. All AX_VALGRIND_DFLT -# calls must be made before the call to AX_VALGRIND_CHECK. -# -# 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_DFLT([sgcheck], [off]) -# 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 and drd) -# while the sgcheck will be skipped unless enabled again on the -# commandline with --enable-valgrind-sgcheck. The results for each check -# will be output to test-suite-$toolname.log. The target will succeed if -# there are zero errors and fail otherwise. -# -# Alternatively, a "check-valgrind-$TOOL" rule will be added, for $TOOL in -# memcheck, helgrind, drd and sgcheck. These are useful because often only -# some of those tools can be ran cleanly on a codebase. -# -# The macro supports running with and without libtool. -# -# LICENSE -# -# Copyright (c) 2014, 2015, 2016 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 13 - -dnl Configured tools -m4_define([valgrind_tool_list], [[memcheck], [helgrind], [drd], [sgcheck]]) -m4_set_add_all([valgrind_exp_tool_set], [sgcheck]) -m4_foreach([vgtool], [valgrind_tool_list], - [m4_define([en_dflt_valgrind_]vgtool, [on])]) - -AC_DEFUN([AX_VALGRIND_DFLT],[ - m4_define([en_dflt_valgrind_$1], [$2]) -])dnl - -AC_DEFUN([AX_VALGRIND_CHECK],[ - dnl Check for --enable-valgrind - AC_ARG_ENABLE([valgrind], - [AS_HELP_STRING([--enable-valgrind], [Whether to enable Valgrind on the unit tests])], - [enable_valgrind=$enableval],[enable_valgrind=]) - - AS_IF([test "$enable_valgrind" != "no"],[ - # Check for Valgrind. - AC_CHECK_PROG([VALGRIND],[valgrind],[valgrind]) - AS_IF([test "$VALGRIND" = ""],[ - AS_IF([test "$enable_valgrind" = "yes"],[ - AC_MSG_ERROR([Could not find valgrind; either install it or reconfigure with --disable-valgrind]) - ],[ - enable_valgrind=no - ]) - ],[ - enable_valgrind=yes - ]) - ]) - - AM_CONDITIONAL([VALGRIND_ENABLED],[test "$enable_valgrind" = "yes"]) - AC_SUBST([VALGRIND_ENABLED],[$enable_valgrind]) - - # Check for Valgrind tools we care about. - [valgrind_enabled_tools=] - m4_foreach([vgtool],[valgrind_tool_list],[ - AC_ARG_ENABLE([valgrind-]vgtool, - m4_if(m4_defn([en_dflt_valgrind_]vgtool),[off],dnl -[AS_HELP_STRING([--enable-valgrind-]vgtool, [Whether to use ]vgtool[ during the Valgrind tests])],dnl -[AS_HELP_STRING([--disable-valgrind-]vgtool, [Whether to skip ]vgtool[ during the Valgrind tests])]), - [enable_valgrind_]vgtool[=$enableval], - [enable_valgrind_]vgtool[=]) - AS_IF([test "$enable_valgrind" = "no"],[ - enable_valgrind_]vgtool[=no], - [test "$enable_valgrind_]vgtool[" ]dnl -m4_if(m4_defn([en_dflt_valgrind_]vgtool), [off], [= "yes"], [!= "no"]),[ - AC_CACHE_CHECK([for Valgrind tool ]vgtool, - [ax_cv_valgrind_tool_]vgtool,[ - ax_cv_valgrind_tool_]vgtool[=no - m4_set_contains([valgrind_exp_tool_set],vgtool, - [m4_define([vgtoolx],[exp-]vgtool)], - [m4_define([vgtoolx],vgtool)]) - AS_IF([`$VALGRIND --tool=]vgtoolx[ --help >/dev/null 2>&1`],[ - ax_cv_valgrind_tool_]vgtool[=yes - ]) - ]) - AS_IF([test "$ax_cv_valgrind_tool_]vgtool[" = "no"],[ - AS_IF([test "$enable_valgrind_]vgtool[" = "yes"],[ - AC_MSG_ERROR([Valgrind does not support ]vgtool[; reconfigure with --disable-valgrind-]vgtool) - ],[ - enable_valgrind_]vgtool[=no - ]) - ],[ - enable_valgrind_]vgtool[=yes - ]) - ]) - AS_IF([test "$enable_valgrind_]vgtool[" = "yes"],[ - valgrind_enabled_tools="$valgrind_enabled_tools ]m4_bpatsubst(vgtool,[^exp-])[" - ]) - AC_SUBST([ENABLE_VALGRIND_]vgtool,[$enable_valgrind_]vgtool) - ]) - AC_SUBST([valgrind_tools],["]m4_join([ ], valgrind_tool_list)["]) - AC_SUBST([valgrind_enabled_tools],[$valgrind_enabled_tools]) - -[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_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 -valgrind_v_use = $(valgrind_v_use_$(V)) -valgrind_v_use_ = $(valgrind_v_use_$(AM_DEFAULT_VERBOSITY)) -valgrind_v_use_0 = @echo " USE " $(patsubst check-valgrind-%,%,$''@):; - -# 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) - -$(A''M_V_at)$(foreach tool,$(valgrind_enabled_tools), \ - $(MAKE) $(AM_MAKEFLAGS) -k check-valgrind-$(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) - -define valgrind_tool_rule = -check-valgrind-$(1): -ifeq ($$(VALGRIND_ENABLED)-$$(ENABLE_VALGRIND_$(1)),yes-yes) - $$(valgrind_v_use)$$(MAKE) check-TESTS \ - TESTS_ENVIRONMENT="$$(VALGRIND_TESTS_ENVIRONMENT)" \ - LOG_COMPILER="$$(VALGRIND_LOG_COMPILER)" \ - LOG_FLAGS="$$(valgrind_$(1)_flags)" \ - TEST_SUITE_LOG=test-suite-$(1).log -else ifeq ($$(VALGRIND_ENABLED),yes) - @echo "Need to reconfigure with --enable-valgrind-$(1)" -else - @echo "Need to reconfigure with --enable-valgrind" -endif -endef - -$(foreach tool,$(valgrind_tools),$(eval $(call valgrind_tool_rule,$(tool)))) - -A''M_DISTCHECK_CONFIGURE_FLAGS ?= -A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-valgrind - -MOSTLYCLEANFILES ?= -MOSTLYCLEANFILES += $(valgrind_log_files) - -.PHONY: check-valgrind $(add-prefix check-valgrind-,$(valgrind_tools)) -'] - - AC_SUBST([VALGRIND_CHECK_RULES]) - m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([VALGRIND_CHECK_RULES])]) -]) diff --git a/m4-local/doxygen.m4 b/m4-local/doxygen.m4 deleted file mode 100644 index 5c5a52a2..00000000 --- a/m4-local/doxygen.m4 +++ /dev/null @@ -1,321 +0,0 @@ -# This file is part of Autoconf. -*- Autoconf -*- - -# Copyright (C) 2004 Oren Ben-Kiki -# This file is distributed under the same terms as the Autoconf macro files. - -########## CHANGELOG ################## -# 2009-01-14 Martin Mann -# * DX_ARG_ABLE : new variable 'DX_FLAG_DX_CURRENT_FEATURE' -# * DX_CLEAR_DEPEND : use of explicit variable 'DX_FLAG_DX_CURRENT_FEATURE' -# in AC_SUBST instead of 'DX_FLAG[]DX_CURRENT_FEATURE' which is rejected by -# newer autotools - -# Generate automatic documentation using Doxygen. Works in concert with the -# aminclude.m4 file and a compatible doxygen configuration file. Defines the -# following public macros: -# -# DX_???_FEATURE(ON|OFF) - control the default setting fo a Doxygen feature. -# Supported features are 'DOXYGEN' itself, 'DOT' for generating graphics, -# 'HTML' for plain HTML, 'CHM' for compressed HTML help (for MS users), 'CHI' -# for generating a seperate .chi file by the .chm file, and 'MAN', 'RTF', -# 'XML', 'PDF' and 'PS' for the appropriate output formats. The environment -# variable DOXYGEN_PAPER_SIZE may be specified to override the default 'a4wide' -# paper size. -# -# By default, HTML, PDF and PS documentation is generated as this seems to be -# the most popular and portable combination. MAN pages created by Doxygen are -# usually problematic, though by picking an appropriate subset and doing some -# massaging they might be better than nothing. CHM and RTF are specific for MS -# (note that you can't generate both HTML and CHM at the same time). The XML is -# rather useless unless you apply specialized post-processing to it. -# -# The macro mainly controls the default state of the feature. The use can -# override the default by specifying --enable or --disable. The macros ensure -# that contradictory flags are not given (e.g., --enable-doxygen-html and -# --enable-doxygen-chm, --enable-doxygen-anything with --disable-doxygen, etc.) -# Finally, each feature will be automatically disabled (with a warning) if the -# required programs are missing. -# -# Once all the feature defaults have been specified, call DX_INIT_DOXYGEN with -# the following parameters: a one-word name for the project for use as a -# filename base etc., an optional configuration file name (the default is -# 'Doxyfile', the same as Doxygen's default), and an optional output directory -# name (the default is 'doxygen-doc'). - -## ----------## -## Defaults. ## -## ----------## - -DX_ENV="" -AC_DEFUN([DX_FEATURE_doc], ON) -AC_DEFUN([DX_FEATURE_dot], ON) -AC_DEFUN([DX_FEATURE_man], ON) -AC_DEFUN([DX_FEATURE_html], OFF) -AC_DEFUN([DX_FEATURE_chm], OFF) -AC_DEFUN([DX_FEATURE_chi], OFF) -AC_DEFUN([DX_FEATURE_rtf], OFF) -AC_DEFUN([DX_FEATURE_xml], OFF) -AC_DEFUN([DX_FEATURE_pdf], OFF) -AC_DEFUN([DX_FEATURE_ps], OFF) - -## --------------- ## -## Private macros. ## -## --------------- ## - -# DX_ENV_APPEND(VARIABLE, VALUE) -# ------------------------------ -# Append VARIABLE="VALUE" to DX_ENV for invoking doxygen. -AC_DEFUN([DX_ENV_APPEND], [AC_SUBST([DX_ENV], ["$DX_ENV $1='$2'"])]) - -# DX_DIRNAME_EXPR -# --------------- -# Expand into a shell expression prints the directory part of a path. -AC_DEFUN([DX_DIRNAME_EXPR], - [[expr ".$1" : '\(\.\)[^/]*$' \| "x$1" : 'x\(.*\)/[^/]*$']]) - -# DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF) -# ------------------------------------- -# Expands according to the M4 (static) status of the feature. -AC_DEFUN([DX_IF_FEATURE], [ifelse(DX_FEATURE_$1, ON, [$2], [$3])]) - -# DX_REQUIRE_PROG(VARIABLE, PROGRAM) -# ---------------------------------- -# Require the specified program to be found for the DX_CURRENT_FEATURE to work. -AC_DEFUN([DX_REQUIRE_PROG], [ -AC_PATH_TOOL([$1], [$2]) -if test "$DX_FLAG_DX_CURRENT_FEATURE$$1" = 1; then - AC_MSG_WARN([$2 not found - will not DX_CURRENT_DESCRIPTION]) - AC_SUBST([DX_FLAG_DX_CURRENT_FEATURE], 0) -fi -]) - -# DX_TEST_FEATURE(FEATURE) -# ------------------------ -# Expand to a shell expression testing whether the feature is active. -AC_DEFUN([DX_TEST_FEATURE], [test "$DX_FLAG_$1" = 1]) - -# DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE) -# ------------------------------------------------- -# Verify that a required features has the right state before trying to turn on -# the DX_CURRENT_FEATURE. -AC_DEFUN([DX_CHECK_DEPEND], [ -test "$DX_FLAG_$1" = "$2" \ -|| AC_MSG_ERROR([doxygen-DX_CURRENT_FEATURE ifelse([$2], 1, - requires, contradicts) doxygen-DX_CURRENT_FEATURE]) -]) - -# DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE) -# ---------------------------------------------------------- -# Turn off the DX_CURRENT_FEATURE if the required feature is off. -AC_DEFUN([DX_CLEAR_DEPEND], [ -test "$DX_FLAG_$1" = "$2" || AC_SUBST([DX_FLAG_DX_CURRENT_FEATURE], 0) -]) - - -# DX_FEATURE_ARG(FEATURE, DESCRIPTION, -# CHECK_DEPEND, CLEAR_DEPEND, -# REQUIRE, DO-IF-ON, DO-IF-OFF) -# -------------------------------------------- -# Parse the command-line option controlling a feature. CHECK_DEPEND is called -# if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND), -# otherwise CLEAR_DEPEND is called to turn off the default state if a required -# feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional -# requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and -# DO-IF-ON or DO-IF-OFF are called according to the final state of the feature. -AC_DEFUN([DX_ARG_ABLE], [ - AC_DEFUN([DX_CURRENT_FEATURE], [$1]) - AC_DEFUN([DX_FLAG_DX_CURRENT_FEATURE], [DX_FLAG_$1]) - AC_DEFUN([DX_CURRENT_DESCRIPTION], [$2]) - AC_ARG_ENABLE(doxygen-$1, - [AS_HELP_STRING(DX_IF_FEATURE([$1], [--disable-doxygen-$1], - [--enable-doxygen-$1]), - DX_IF_FEATURE([$1], [don't $2], [$2]))], - [ -case "$enableval" in -#( -y|Y|yes|Yes|YES) - AC_SUBST([DX_FLAG_$1], 1) - $3 -;; #( -n|N|no|No|NO) - AC_SUBST([DX_FLAG_$1], 0) -;; #( -*) - AC_MSG_ERROR([invalid value '$enableval' given to doxygen-$1]) -;; -esac -], [ -AC_SUBST([DX_FLAG_$1], [DX_IF_FEATURE([$1], 1, 0)]) -$4 -]) -if DX_TEST_FEATURE([$1]); then - $5 - : -fi -if DX_TEST_FEATURE([$1]); then - AM_CONDITIONAL(DX_COND_$1, :) - $6 - : -else - AM_CONDITIONAL(DX_COND_$1, false) - $7 - : -fi -]) - -## -------------- ## -## Public macros. ## -## -------------- ## - -# DX_XXX_FEATURE(DEFAULT_STATE) -# ----------------------------- -AC_DEFUN([DX_DOXYGEN_FEATURE], [AC_DEFUN([DX_FEATURE_doc], [$1])]) -AC_DEFUN([DX_MAN_FEATURE], [AC_DEFUN([DX_FEATURE_man], [$1])]) -AC_DEFUN([DX_HTML_FEATURE], [AC_DEFUN([DX_FEATURE_html], [$1])]) -AC_DEFUN([DX_CHM_FEATURE], [AC_DEFUN([DX_FEATURE_chm], [$1])]) -AC_DEFUN([DX_CHI_FEATURE], [AC_DEFUN([DX_FEATURE_chi], [$1])]) -AC_DEFUN([DX_RTF_FEATURE], [AC_DEFUN([DX_FEATURE_rtf], [$1])]) -AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])]) -AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])]) -AC_DEFUN([DX_PDF_FEATURE], [AC_DEFUN([DX_FEATURE_pdf], [$1])]) -AC_DEFUN([DX_PS_FEATURE], [AC_DEFUN([DX_FEATURE_ps], [$1])]) - -# DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR]) -# --------------------------------------------------------- -# PROJECT also serves as the base name for the documentation files. -# The default CONFIG-FILE is "Doxyfile" and OUTPUT-DOC-DIR is "doxygen-doc". -AC_DEFUN([DX_INIT_DOXYGEN], [ - -# Files: -AC_SUBST([DX_PROJECT], [$1]) -AC_SUBST([DX_CONFIG], [ifelse([$2], [], Doxyfile, [$2])]) -AC_SUBST([DX_DOCDIR], [ifelse([$3], [], doxygen-doc, [$3])]) - -# Environment variables used inside doxygen.cfg: -DX_ENV_APPEND(SRCDIR, $srcdir) -DX_ENV_APPEND(PROJECT, $DX_PROJECT) -DX_ENV_APPEND(DOCDIR, $DX_DOCDIR) -DX_ENV_APPEND(VERSION, $PACKAGE_VERSION) - -# Doxygen itself: -DX_ARG_ABLE(doc, [generate any doxygen documentation], - [], - [], - [DX_REQUIRE_PROG([DX_DOXYGEN], doxygen) - DX_REQUIRE_PROG([DX_PERL], perl)], - [DX_ENV_APPEND(PERL_PATH, $DX_PERL)]) - -# Dot for graphics: -DX_ARG_ABLE(dot, [generate graphics for doxygen documentation], - [DX_CHECK_DEPEND(doc, 1)], - [DX_CLEAR_DEPEND(doc, 1)], - [DX_REQUIRE_PROG([DX_DOT], dot)], - [DX_ENV_APPEND(HAVE_DOT, YES) - DX_ENV_APPEND(DOT_PATH, [`DX_DIRNAME_EXPR($DX_DOT)`])], - [DX_ENV_APPEND(HAVE_DOT, NO)]) - -# Man pages generation: -DX_ARG_ABLE(man, [generate doxygen manual pages], - [DX_CHECK_DEPEND(doc, 1)], - [DX_CLEAR_DEPEND(doc, 1)], - [], - [DX_ENV_APPEND(GENERATE_MAN, YES)], - [DX_ENV_APPEND(GENERATE_MAN, NO)]) - -# RTF file generation: -DX_ARG_ABLE(rtf, [generate doxygen RTF documentation], - [DX_CHECK_DEPEND(doc, 1)], - [DX_CLEAR_DEPEND(doc, 1)], - [], - [DX_ENV_APPEND(GENERATE_RTF, YES)], - [DX_ENV_APPEND(GENERATE_RTF, NO)]) - -# XML file generation: -DX_ARG_ABLE(xml, [generate doxygen XML documentation], - [DX_CHECK_DEPEND(doc, 1)], - [DX_CLEAR_DEPEND(doc, 1)], - [], - [DX_ENV_APPEND(GENERATE_XML, YES)], - [DX_ENV_APPEND(GENERATE_XML, NO)]) - -# (Compressed) HTML help generation: -DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation], - [DX_CHECK_DEPEND(doc, 1)], - [DX_CLEAR_DEPEND(doc, 1)], - [DX_REQUIRE_PROG([DX_HHC], hhc)], - [DX_ENV_APPEND(HHC_PATH, $DX_HHC) - DX_ENV_APPEND(GENERATE_HTML, YES) - DX_ENV_APPEND(GENERATE_HTMLHELP, YES)], - [DX_ENV_APPEND(GENERATE_HTMLHELP, NO)]) - -# Seperate CHI file generation. -DX_ARG_ABLE(chi, [generate doxygen seperate compressed HTML help index file], - [DX_CHECK_DEPEND(chm, 1)], - [DX_CLEAR_DEPEND(chm, 1)], - [], - [DX_ENV_APPEND(GENERATE_CHI, YES)], - [DX_ENV_APPEND(GENERATE_CHI, NO)]) - -# Plain HTML pages generation: -DX_ARG_ABLE(html, [generate doxygen plain HTML documentation], - [DX_CHECK_DEPEND(doc, 1) DX_CHECK_DEPEND(chm, 0)], - [DX_CLEAR_DEPEND(doc, 1) DX_CLEAR_DEPEND(chm, 0)], - [], - [DX_ENV_APPEND(GENERATE_HTML, YES)], - [DX_TEST_FEATURE(chm) || DX_ENV_APPEND(GENERATE_HTML, NO)]) - -# PostScript file generation: -DX_ARG_ABLE(ps, [generate doxygen PostScript documentation], - [DX_CHECK_DEPEND(doc, 1)], - [DX_CLEAR_DEPEND(doc, 1)], - [DX_REQUIRE_PROG([DX_LATEX], latex) - DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex) - DX_REQUIRE_PROG([DX_DVIPS], dvips) - DX_REQUIRE_PROG([DX_EGREP], egrep)]) - -# PDF file generation: -DX_ARG_ABLE(pdf, [generate doxygen PDF documentation], - [DX_CHECK_DEPEND(doc, 1)], - [DX_CLEAR_DEPEND(doc, 1)], - [DX_REQUIRE_PROG([DX_PDFLATEX], pdflatex) - DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex) - DX_REQUIRE_PROG([DX_EGREP], egrep)]) - -# LaTeX generation for PS and/or PDF: -if DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf); then - AM_CONDITIONAL(DX_COND_latex, :) - DX_ENV_APPEND(GENERATE_LATEX, YES) -else - AM_CONDITIONAL(DX_COND_latex, false) - DX_ENV_APPEND(GENERATE_LATEX, NO) -fi - -# Paper size for PS and/or PDF: -AC_ARG_VAR(DOXYGEN_PAPER_SIZE, - [letter (default), a4wide, a4, letter, legal or executive]) -case "$DOXYGEN_PAPER_SIZE" in -#( -"") - AC_SUBST(DOXYGEN_PAPER_SIZE, "letter") -;; #( -a4wide|a4|letter|legal|executive) - DX_ENV_APPEND(PAPER_SIZE, $DOXYGEN_PAPER_SIZE) -;; #( -*) - AC_MSG_ERROR([unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE']) -;; -esac - -#For debugging: -#echo DX_FLAG_doc=$DX_FLAG_doc -#echo DX_FLAG_dot=$DX_FLAG_dot -#echo DX_FLAG_man=$DX_FLAG_man -#echo DX_FLAG_html=$DX_FLAG_html -#echo DX_FLAG_chm=$DX_FLAG_chm -#echo DX_FLAG_chi=$DX_FLAG_chi -#echo DX_FLAG_rtf=$DX_FLAG_rtf -#echo DX_FLAG_xml=$DX_FLAG_xml -#echo DX_FLAG_pdf=$DX_FLAG_pdf -#echo DX_FLAG_ps=$DX_FLAG_ps -#echo DX_ENV=$DX_ENV -]) diff --git a/m4-local/mbedtls.m4 b/m4-local/mbedtls.m4 deleted file mode 100644 index 3f54808d..00000000 --- a/m4-local/mbedtls.m4 +++ /dev/null @@ -1,42 +0,0 @@ -dnl ###################################################################### -dnl mbedtls support -AC_DEFUN([CHECK_MBEDTLS], [ - -case "$with_mbedtls" in -check|yes) - case "$have_mbedtls" in - yes) ;; - *) - save_LIBS="$LIBS" - LIBS="" - MBEDTLS_LIBS="" - # clear cache - unset ac_cv_search_mbedtls_ssl_init - AC_SEARCH_LIBS([mbedtls_ssl_init], [mbedtls], - [have_mbedtls=yes - MBEDTLS_LIBS="$LIBS -lmbedtls -lmbedcrypto -lmbedx509"], - [have_mbedtls=no], - [-lmbedtls -lmbedcrypto -lmbedx509]) - LIBS="$save_LIBS" - ;; - esac - - CPPFLAGS_SAVE=$CPPFLAGS - CPPFLAGS="$CPPFLAGS $MBEDTLS_INCS" - AC_CHECK_HEADERS([mbedtls/ssl.h], [], [have_mbedtls=no]) - CPPFLAGS=$CPPFLAGS_SAVE - AC_SUBST(MBEDTLS_INCS) - AC_SUBST(MBEDTLS_LIBS) - if test "$have_mbedtls" = "yes" ; then - AC_DEFINE(HAVE_MBEDTLS, 1, [Define if the system has mbedtls]) - AM_CONDITIONAL([HAVE_MBEDTLS], [true]) - have_crypto=yes - elif test "$with_mbedtls" = "yes" ; then - AC_MSG_ERROR([--with-mbedtls was given but MBedTLS not found]) - fi - ;; -esac - -# check if we have and should use mbedtls -AM_CONDITIONAL(HAVE_MBEDTLS, [test "$have_mbedtls" = "yes"]) -]) diff --git a/tests/Makefile.am b/tests/Makefile.am deleted file mode 100644 index bf64b77d..00000000 --- a/tests/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (C) 2015-2024 maClara, LLC -# This file is part of the JWT C Library -# -# SPDX-License-Identifier: MPL-2.0 -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -EXTRA_DIST = jwt_tests.h test-env.sh misc/ruby-eddsa.rb - -SUBDIRS = keys - -TESTS = \ - jwt_new \ - jwt_grant \ - jwt_header \ - jwt_dump \ - jwt_encode \ - jwt_rsa \ - jwt_ec \ - jwt_validate \ - jwt_rsa_pss \ - jwt_eddsa \ - jwt_crypto \ - jwt_es256k - -# JWKS tests are OpenSSL 3 only -if HAVE_OPENSSL -TESTS += jwt_jwks jwt_jwks_errors jwt_jwks_ec jwt_jwks_rsa -endif - -check_PROGRAMS = $(TESTS) - -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -AM_CFLAGS = -Wall $(CHECK_CFLAGS) -DKEYDIR="\"$(srcdir)/keys\"" -D_GNU_SOURCE -AM_LDFLAGS = -L$(top_builddir)/libjwt -LDADD = -ljwt $(CHECK_LIBS) - -CODE_COVERAGE_EXTRACT_PATTERN = "*/libjwt/*.c" -@CODE_COVERAGE_RULES@ -@VALGRIND_CHECK_RULES@ - -AM_TESTS_ENVIRONMENT = \ - export TEST="$$f"; \ - . $(srcdir)/test-env.sh; diff --git a/tests/keys/Makefile.am b/tests/keys/Makefile.am deleted file mode 100644 index 2c557b7a..00000000 --- a/tests/keys/Makefile.am +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (C) 2015-2024 maClara, LLC -# This file is part of the JWT C Library -# -# SPDX-License-Identifier: MPL-2.0 -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -EXTRA_DIST = \ - ec_key_invalid.pem \ - ec_key_invalid_pub.pem \ - ec_key_prime256v1.json \ - ec_key_prime256v1.pem \ - ec_key_prime256v1_pub.json \ - ec_key_prime256v1_pub.pem \ - ec_key_secp256k1.json \ - ec_key_secp256k1.pem \ - ec_key_secp256k1_pub.json \ - ec_key_secp256k1_pub.pem \ - ec_key_secp384r1.json \ - ec_key_secp384r1.pem \ - ec_key_secp384r1_pub.json \ - ec_key_secp384r1_pub.pem \ - ec_key_secp521r1.json \ - ec_key_secp521r1.pem \ - ec_key_secp521r1_pub.json \ - ec_key_secp521r1_pub.pem \ - eddsa_key_ed25519.json \ - eddsa_key_ed25519.pem \ - eddsa_key_ed25519_pub.json \ - eddsa_key_ed25519_pub.pem \ - jwks_keyring.json \ - jwks_test-1.json \ - jwks_test-2.json \ - rsa_key_2048.json \ - rsa_key_2048.pem \ - rsa_key_2048_pub.json \ - rsa_key_2048_pub.pem \ - rsa_key_4096.json \ - rsa_key_4096.pem \ - rsa_key_4096_pub.json \ - rsa_key_4096_pub.pem \ - rsa_key_8192.json \ - rsa_key_8192.pem \ - rsa_key_8192_pub.json \ - rsa_key_8192_pub.pem \ - rsa_key_i37_pub.json \ - rsa_key_i37_pub.pem \ - rsa_key_invalid.pem \ - rsa_key_invalid_pub.pem \ - rsa_pss_key_2048.json \ - rsa_pss_key_2048.pem \ - rsa_pss_key_2048_pub.json \ - rsa_pss_key_2048_pub.pem - -SUBDIRS = jwks diff --git a/tests/keys/jwks/Makefile.am b/tests/keys/jwks/Makefile.am deleted file mode 100644 index b77c2fc2..00000000 --- a/tests/keys/jwks/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (C) 2015-2024 maClara, LLC -# This file is part of the JWT C Library -# -# SPDX-License-Identifier: MPL-2.0 -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -if HAVE_OPENSSL -EXTRA_PROGRAMS = pem_to_jwk jwk_to_pem -endif - -AM_CFLAGS = $(OPENSSL_CFLAGS) $(JANSSON_CFLAGS) \ - -I$(top_srcdir)/include -I$(top_builddir)/include \ - -I$(top_srcdir)/libjwt - -AM_LDFLAGS = -L$(top_builddir)/libjwt \ - $(OPENSSL_LDFLAGS) $(JANSSON_LDFLAGS) - -AM_CPPFLAGS = $(OPENSSL_INCLUDES) - -pem_to_jwk_LDFLAGS = -static $(AM_LDFLAGS) - -LDADD = -ljwt $(JANSSON_LIBS) $(OPENSSL_LIBS)