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..6034b24a 100644 --- a/meson.build +++ b/meson.build @@ -42,6 +42,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 +137,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 +145,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