From 0a511bc9e7c0a7fb3b83092b797181dae48f932a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Tue, 11 Apr 2017 10:25:14 +0000 Subject: [PATCH] build fixed for windows --- COPYING | 2 +- ChangeLog | 16 ++++++++++++++++ INSTALL | 2 +- ax_check_qt.m4 | 39 +++++++++++++++++++++++++++------------ configure.ac | 42 +++++++++++++++++++++++++----------------- src/suisseid.hxx | 8 +------- 6 files changed, 71 insertions(+), 38 deletions(-) diff --git a/COPYING b/COPYING index caeca07..88798ab 120000 --- a/COPYING +++ b/COPYING @@ -1 +1 @@ -/usr/share/automake-1.14/COPYING \ No newline at end of file +/usr/share/automake-1.15/COPYING \ No newline at end of file diff --git a/ChangeLog b/ChangeLog index 27f0413..aae6815 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2017-04-07 14:15 + + * [r396] COPYING, ChangeLog, INSTALL, configure.ac, + src/suisseid.hxx: + fixed recently introduced bug + +2017-04-06 12:52 + + * [r395] configure.ac: + typo + +2017-04-06 12:44 + + * [r394] configure.ac, src/suisseid.hxx: + improved build scripts + 2017-02-08 18:48 * [r393] configure.ac: diff --git a/INSTALL b/INSTALL index f812f5a..ddcdb76 120000 --- a/INSTALL +++ b/INSTALL @@ -1 +1 @@ -/usr/share/automake-1.14/INSTALL \ No newline at end of file +/usr/share/automake-1.15/INSTALL \ No newline at end of file diff --git a/ax_check_qt.m4 b/ax_check_qt.m4 index af3a238..7ba286f 100644 --- a/ax_check_qt.m4 +++ b/ax_check_qt.m4 @@ -51,18 +51,33 @@ AC_DEFUN([AX_CXX_QT_TOOL], [ PKG_PROG_PKG_CONFIG - if test -z "$HAVE_$1"; then + if test -z "${HAVE_$1}"; then HAVE_$1=1 AC_MSG_CHECKING([for $2]) AC_ARG_VAR([$1], [path to Qt tool $2]) - $1=${$1:-$(${PKG_CONFIG} --variable=$2_location Qt5Core)} - $1=${$1:-$(${PKG_CONFIG} --variable=host_bins Qt5Core)/$2-qt5} - $1=${$1:-$(${PKG_CONFIG} --variable=host_bins Qt5Core)/$2} - $1=${$1:-$(${PKG_CONFIG} --variable=$2_location QtCore)} - $1=${$1:-$(${PKG_CONFIG} --variable=host_bins QtCore)/$2} - $1=${$1:-$(${PKG_CONFIG} --variable=host_bins QtCore)/$2-qt4} - if ! which "${$1%% *}" > /dev/null; then - if which "$2-qt5" > /dev/null; then + for package in Qt5Core QtCore; do + if test -x "${$1}"; then + break + fi + tool=$(${PKG_CONFIG} --variable=$2_location $package 2> /dev/null) + if test -x "${tool}"; then + $1="${tool}" + break + fi + tool=$(${PKG_CONFIG} --variable=host_bins $package 2> /dev/null) + if test -n "$tool"; then + for name in $2 $2-qt5 $2-qt4; do + if test -x "${tool}/${name}"; then + $1="${tool}/${name}" + break + fi + done + fi + done + if ! test -x "${$1}"; then + if which "$2" > /dev/null; then + $1=$2 + elif which "$2-qt5" > /dev/null; then $1=$2-qt5 elif which "$2" > /dev/null; then $1=$2 @@ -70,15 +85,15 @@ AC_DEFUN([AX_CXX_QT_TOOL], [ $1=$2-qt4 else HAVE_$1=0 - $1="" + unset $1 fi fi AC_SUBST($1) AM_CONDITIONAL(HAVE_$1, test $HAVE_[$1] -eq 1) if test $HAVE_$1 -eq 1; then - AC_MSG_RESULT([$$1]) + AC_MSG_RESULT([$$1]) else - AC_MSG_RESULT([not found]) + AC_MSG_RESULT([not found]) fi fi ]) diff --git a/configure.ac b/configure.ac index 95fa22c..e8148b9 100644 --- a/configure.ac +++ b/configure.ac @@ -21,24 +21,25 @@ AX_BUILD_EXAMPLES AC_ARG_ENABLE(pkcs11-download, [AS_HELP_STRING([--enable-pkcs11-download], [download pkcs11 header])], - [have_pedantic="$enableval" - AC_MSG_NOTICE([downloading pkcs11 library headers]) - if test "$enableval" = "yes"; then - test -d usr/include || mkdir -p usr/include - cd usr/include - for f in $(wget -qO- ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/ 2>&1 | html2 | sed -n 's,.*/a/@href=\(.*\.h\)$,\1,gp'); do - wget --unlink $f - if ! test -f "${f##*/}"; then - AC_MSG_ERROR([download failed of pkcs11 header file: $f]) - fi - done - if ! test -f cryptoki.h; then + [download_pkcs11="$enableval"], + [if test -z "$MINGW"; then download_pkcs11="no"; else download_pkcs11="yes"; fi]) + +if test "$download_pkcs11" != "no"; then + AC_MSG_NOTICE([downloading pkcs11 library headers]) + test -d usr/include || mkdir -p usr/include + cd usr/include + for f in $(wget -qO- ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/ 2>&1 | html2 | sed -n 's,.*/a/@href=\(.*\.h\)$,\1,gp'); do + wget --unlink $f + if ! test -f "${f##*/}"; then + AC_MSG_ERROR([download failed of pkcs11 header file: $f]) + fi + done + if ! test -f cryptoki.h; then AC_MSG_ERROR([download failed of pkcs11 headers - have you installed xml2?]) - fi - AM_CPPFLAGS+=" -I$(pwd)" - cd - - fi - ]) + fi + AM_CPPFLAGS+=" -I$(pwd)" + cd - +fi # qt features AX_CHECK_QT([QTGUI], [QtCore QtGui], [QtWidgets]) @@ -64,3 +65,10 @@ AX_PKG_REQUIRE([mrwcxx], [mrw-c++], [mrw/checkcxx11.hxx]) # create output AC_OUTPUT + +if test "${HAVE_QTGUI}" -ne 1; then + AC_MSG_WARN([QtGui not found, ${HAVE_QTGUI} Qt GUI features disabled]) +fi +if test "${HAVE_QTNETWORK}" -ne 1; then + AC_MSG_WARN([QtNetwork5 not found, ${HAVE_QTNETWORK} Qt Network features disabled]) +fi diff --git a/src/suisseid.hxx b/src/suisseid.hxx index 9fba246..ba35ba7 100644 --- a/src/suisseid.hxx +++ b/src/suisseid.hxx @@ -13,7 +13,6 @@ #include #include #include -#include #include /*! @defgroup gsuisseid C++ library to access SuisseID smart cards @@ -394,12 +393,7 @@ namespace suisseid { virtual CertStatus certStatus() { try { Certificate auth(authenticationCertificate()); - //auth.subjectInfo(serialNumber); - // if (mrw::RegExp("^$[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}") - // (auth.subjectInfo(serialNumber))) { - // _type = SUISSE_ID; - Certificate sig(digitalSignatureCertificate()); - // } + Certificate sig(digitalSignatureCertificate()); return VALID; } catch (const no_auth& x) { return MISSING;