diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 92f0b8bc..27618176 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -8,16 +8,16 @@ jobs: fail-fast: false matrix: include: - - environment: "ubuntu:24.04" + - environment: "ubuntu:24.10" cc: "gcc" upload_for_test: "false" - - environment: "ubuntu:24.04" + - environment: "ubuntu:24.10" cc: "clang" upload_for_test: "false" - - environment: "ubuntu:23.10" + - environment: "ubuntu:24.04" cc: "gcc" upload_for_test: "false" - - environment: "ubuntu:23.10" + - environment: "ubuntu:24.04" cc: "clang" upload_for_test: "false" - environment: "ubuntu:22.04" @@ -32,15 +32,6 @@ jobs: - environment: "ubuntu:20.04" cc: "clang" upload_for_test: "false" -# - environment: "ubuntu:18.04" -# cc: "gcc" -# upload_for_test: "false" -# - environment: "ubuntu:16.04" -# cc: "gcc" -# upload_for_test: "false" -# - environment: "ubuntu:14.04" -# cc: "gcc" -# upload_for_test: "false" - environment: "debian:12" cc: "gcc" upload_for_test: "false" @@ -102,12 +93,23 @@ jobs: # append the following flags: -Wno-missing-braces -Wno-missing-field-initializers -Wno-implicit-function-declaration sed -i 's/-Wall -Wextra -Werror/-Wall -Wextra -Werror -Wno-missing-braces -Wno-missing-field-initializers -Wno-implicit-function-declaration/' cmake/SecurityFlags.cmake + - name: apply environment specific changes to CMakeLists.txt + working-directory: yubihsm-shell + if: ${{ matrix.environment == 'ubuntu:24.10' }} + run: | + # ubuntu 24.10 comes with _FORTIFY_SOURCE already set + sed -i 's/add_definitions (-D_FORTIFY_SOURCE=2)/add_definitions (-D_FORTIFY_SOURCE=3)/' cmake/SecurityFlags.cmake + # Set PCSC flags + sed -i 's/#SET(CMAKE_C_FLAGS/SET(CMAKE_C_FLAGS/' ykhsmauth/CMakeLists.txt + - name: do build working-directory: yubihsm-shell env: CC: ${{ matrix.cc }} VERBOSE: 1 run: | + echo "CFLAGS = $CFLAGS" + mkdir build cd build if [ "$CC" = "gcc" ]; then @@ -172,10 +174,10 @@ jobs: - environment: "fedora:40" cc: "clang" upload_for_test: "false" - - environment: "fedora:39" + - environment: "fedora:41" cc: "gcc" upload_for_test: "false" - - environment: "fedora:39" + - environment: "fedora:41" cc: "clang" upload_for_test: "false" @@ -224,6 +226,13 @@ jobs: # append the following flags: -Wno-missing-braces -Wno-missing-field-initializers -Wno-implicit-function-declaration sed -i 's/-Wall -Wextra -Werror/-Wall -Wextra -Werror -Wno-missing-braces -Wno-missing-field-initializers/' cmake/SecurityFlags.cmake + - name: apply environment specific changes to CMakeLists.txt + working-directory: yubihsm-shell + if: ${{ matrix.environment == 'fedora:41' }} + run: | + # Set PCSC flags + sed -i 's/#SET(CMAKE_C_FLAGS/SET(CMAKE_C_FLAGS/' ykhsmauth/CMakeLists.txt + - name: do build working-directory: yubihsm-shell env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a9392e04..03a05d50 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -143,13 +143,10 @@ jobs: fail-fast: false matrix: environment: [ + "ubuntu:24.10", "ubuntu:24.04", - "ubuntu:23.10", "ubuntu:22.04", "ubuntu:20.04", -# "ubuntu:18.04", -# "ubuntu:16.04", -# "ubuntu:14.04", "debian:12", "debian:11", ] @@ -211,10 +208,18 @@ jobs: - name: apply environment specific changes to CMakeLists.txt working-directory: yubihsm-shell - if: ${{ matrix.environment == 'ubuntu:24.04' }} + env: + DOCKER_IMAGE: ${{ matrix.environment }} run: | - # ubuntu 24.04 comes with _FORTIFY_SOURCE already set - sed -i 's/add_definitions (-D_FORTIFY_SOURCE=2)/add_definitions (-D_FORTIFY_SOURCE=3)/' cmake/SecurityFlags.cmake + if [ "$DOCKER_IMAGE" = "ubuntu:24.04" ] || [ "$DOCKER_IMAGE" = "ubuntu:24.10" ]; then + # ubuntu 24.04 and above come with _FORTIFY_SOURCE already set + sed -i 's/add_definitions (-D_FORTIFY_SOURCE=2)/add_definitions (-D_FORTIFY_SOURCE=3)/' cmake/SecurityFlags.cmake + fi + + if [ "$DOCKER_IMAGE" = "ubuntu:24.10" ]; then + # Set PCSC flags + sed -i 's/#SET(CMAKE_C_FLAGS/SET(CMAKE_C_FLAGS/' ykhsmauth/CMakeLists.txt + fi - name: extract platform name env: @@ -232,6 +237,9 @@ jobs: set -x uname -a + + ls /usr/include/PCSC + echo "C_INCLUDE_PATH: $C_INCLUDE_PATH" # Create directory containing all output OUTPUT=$GITHUB_WORKSPACE/$PLATFORM/yubihsm-shell @@ -288,8 +296,8 @@ jobs: fail-fast: false matrix: environment: [ - "fedora:39", "fedora:40", + "fedora:41", ] name: build on ${{ matrix.environment }} @@ -317,6 +325,15 @@ jobs: # append the following flags: -Wno-missing-braces -Wno-missing-field-initializers -Wno-implicit-function-declaration sed -i 's/-Wall -Wextra -Werror/-Wall -Wextra -Werror -Wno-missing-braces -Wno-missing-field-initializers/' cmake/SecurityFlags.cmake + - name: apply environment specific changes to ykhsmauth/CMakeLists.txt + working-directory: yubihsm-shell + if: ${{ matrix.environment == 'fedora:41' }} + run: | + # Fedora 41 comes with _FORTIFY_SOURCE already set + sed -i 's/add_definitions (-D_FORTIFY_SOURCE=2)/add_definitions (-D_FORTIFY_SOURCE=3)/' cmake/SecurityFlags.cmake + # Set PCSC flags + sed -i 's/#SET(CMAKE_C_FLAGS/SET(CMAKE_C_FLAGS/' ykhsmauth/CMakeLists.txt + - name: extract platform name env: DOCKER_IMAGE: ${{ matrix.environment }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bcc900b..f32f99ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -202,6 +202,7 @@ if(NOT BUILD_ONLY_LIB) set(LIBPCSC_LDFLAGS "-Wl,-framework -Wl,PCSC") endif() + add_subdirectory (ykhsmauth) add_subdirectory (yubihsm-auth) @@ -249,6 +250,19 @@ message(" CFLAGS: ${CMAKE_C_FLAGS}") message(" CPPFLAGS: ${CMAKE_CXX_FLAGS}") message(" Warnings: ${WARN_FLAGS}") message(" Build type: ${CMAKE_BUILD_TYPE}") + +message(" PCSC found: ${LIBPCSC_FOUND}") +message(" PCSC libraries: ${LIBPCSC_LIBRARIES}") +message(" PCSC link libraries: ${LIBPCSC_LINK_LIBRARIES}") +message(" PCSC LDFLAGS: ${LIBPCSC_LDFLAGS}") +message(" PCSC include: ${LIBPCSC_INCLUDEDIR}") +message(" PCSC INCLUDEDIR: ${LIBPCSC_INCLUDEDIR}") +message(" PCSC CFLAGS: ${LIBPCSC_CFLAGS}") + +message(" CMAKE_INCLUDE_PATH: ${CMAKE_INCLUDE_PATH}") +message(" CMAKE_SYSTEM_INCLUDE_PATH: ${CMAKE_SYSTEM_INCLUDE_PATH}") +message(" CMAKE__STANDARD_INCLUDE_DIRECTORIES: ${CMAKE_C_STANDARD_INCLUDE_DIRECTORIES}") + message("") message(" Install prefix: ${CMAKE_INSTALL_PREFIX}") message(" Install targets") diff --git a/ykhsmauth/CMakeLists.txt b/ykhsmauth/CMakeLists.txt index 6f77b573..96ab704b 100644 --- a/ykhsmauth/CMakeLists.txt +++ b/ykhsmauth/CMakeLists.txt @@ -24,9 +24,20 @@ if(WIN32) set(SOURCE ${SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/version.rc) endif(WIN32) -include_directories ( - ${LIBPCSC_INCLUDEDIR} -) +include_directories (${LIBPCSC_INCLUDEDIR}) + +#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBPCSC_CFLAGS}") + +message(" PCSC found: ${LIBPCSC_FOUND}") +message(" PCSC libraries: ${LIBPCSC_LIBRARIES}") +message(" PCSC link libraries: ${LIBPCSC_LINK_LIBRARIES}") +message(" PCSC LDFLAGS: ${LIBPCSC_LDFLAGS}") +message(" PCSC include: ${LIBPCSC_INCLUDEDIR}") +message(" PCSC INCLUDEDIR: ${LIBPCSC_INCLUDEDIR}") +message(" PCSC CFLAGS: ${LIBPCSC_CFLAGS}") +message(" CFLAGS: ${CMAKE_C_FLAGS}") +message(" CPPFLAGS: ${CMAKE_CXX_FLAGS}") + add_library (ykhsmauth SHARED ${SOURCE})