diff --git a/.github/workflows/build_meson.yml b/.github/workflows/build_meson.yml index c1e1c20a..82ac32e9 100644 --- a/.github/workflows/build_meson.yml +++ b/.github/workflows/build_meson.yml @@ -36,6 +36,8 @@ jobs: shell: bash run: | export CFLAGS="-Wall -Wextra -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-enum -Wundef -Wuninitialized -Wunused -Wwrite-strings -Wmissing-noreturn -flto=auto -O2 -Wp,-D_FORTIFY_SOURCE=2" + + rm -rf builddir meson setup builddir --werror cd builddir @@ -43,3 +45,17 @@ jobs: meson setup --reconfigure -Dserial=true meson compile + + - name: compile with clang + shell: bash + run: | + export CFLAGS="-Wall -Wextra -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-enum -Wundef -Wuninitialized -Wunused -Wwrite-strings -Wmissing-noreturn -flto=auto -O2 -Wp,-D_FORTIFY_SOURCE=2" + + rm -rf builddir + CC=clang CC_LD=lld meson setup builddir --werror + cd builddir + + meson dist + + meson setup --reconfigure -Dserial=true + meson compile diff --git a/configure.ac b/configure.ac index a7b6fffc..f3a8b729 100644 --- a/configure.ac +++ b/configure.ac @@ -33,7 +33,10 @@ AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_LN_S AC_PROG_LEX([noyywrap]) -AS_IF([test $LEX = ":"], [AC_MSG_ERROR([no lex or flex found])]) +AS_IF([test $LEX = ":"], [ + AM_MISSING_PROG(MISSINGLEX, [flex]) + LEX=$MISSINGLEX] +) AM_PROG_AR PKG_PROG_PKG_CONFIG @@ -331,4 +334,3 @@ AC_CONFIG_FILES(Makefile examples/Makefile) AC_OUTPUT - diff --git a/examples/GetSetNAD.py b/examples/GetSetNAD.py index 2525892c..279304e7 100755 --- a/examples/GetSetNAD.py +++ b/examples/GetSetNAD.py @@ -32,7 +32,7 @@ def get_nad(cardConnection): res = cardConnection.control(SCARD_CTL_CODE(3600), get_NAD) print(" result:", toHexString(res)) status = res[3] - if status is 0: + if status == 0: print("Success") nad = res[4] print("NAD:", nad) @@ -48,7 +48,7 @@ def set_nad(cardConnection, nad): res = cardConnection.control(SCARD_CTL_CODE(3600), set_NAD) print(" result:", toHexString(res)) status = res[3] - if status is 0: + if status == 0: print("Success") else: print("Failed!") diff --git a/meson.build b/meson.build index e73a5cf7..615bd1c5 100644 --- a/meson.build +++ b/meson.build @@ -6,6 +6,7 @@ # meson setup --reconfigure --wipe project('ccid', 'c', + meson_version : '>=0.58.0', version : '1.6.0') # for config.h @@ -42,6 +43,7 @@ pcsc_dep = dependency('libpcsclite') pcsc_cflags = pcsc_dep.partial_dependency(compile_args : true) libusb_dep = dependency('libusb-1.0') zlib_dep = dependency('zlib') +threads_dep = dependency('threads') r = run_command('uname', check: true) pcsc_arch = r.stdout().strip() @@ -136,6 +138,7 @@ parse_src = [ 'src/debug.c', 'src/ccid_usb.c', 'src/sys_unix.c', + 'src/strlcpy.c', 'src/simclist.c', ] parse_src += gen_src @@ -143,7 +146,7 @@ parse_src += gen_src executable('parse', parse_src, include_directories : ['src'], - dependencies : [libusb_dep, pcsc_cflags, zlib_dep], + dependencies : [libusb_dep, pcsc_cflags, zlib_dep, threads_dep], ) # scardcontrol diff --git a/meson.options b/meson.options index cf4cc626..52816a7b 100644 --- a/meson.options +++ b/meson.options @@ -9,17 +9,17 @@ option('class', option('composite-as-multislot', type : 'boolean', - value : 'false', + value : false, description : 'composite device are seen as multi-slots') option('embedded', type : 'boolean', - value : 'false', + value : false, description : 'for embedded systems [limit RAM and CPU resources by disabling features (log)]') option('os_log', type : 'boolean', - value : 'false', + value : false, description : 'use os_log(3) instead of printf() for debug (Sierra 10.12 and up)]') option('pcsclite', @@ -28,10 +28,10 @@ option('pcsclite', option('serial', type : 'boolean', - value : 'false', + value : false, description : 'enable the driver for the serial CCID readers') option('zlp', type : 'boolean', - value : 'false', + value : false, description : 'enable the Zero Length Packet patch for some Gemalto readers')