From 3aaa9f4e27030276dc0eafba31da1a36246b85a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Sat, 14 Mar 2015 14:05:37 +0000 Subject: [PATCH] wrong pkg-config prefix --- ChangeLog | 5 +++++ ax_check_qt.m4 | 39 +++++++++++++++++++++++++++++++------ ax_init_standard_project.m4 | 13 +++++++++++++ bootstrap.sh | 4 ++-- configure.ac | 6 +++--- src/libpcscxx.pc.in | 4 ++-- 6 files changed, 58 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8f3db47..71d36cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-03-14 09:31 marc + + * ChangeLog, ax_init_standard_project.m4, bootstrap.sh, + src/libpcscxx.pc.in: add compile dependencies + 2015-03-13 16:30 marc * ax_check_qt.m4, ax_init_standard_project.m4, bootstrap.sh, diff --git a/ax_check_qt.m4 b/ax_check_qt.m4 index 4567828..e3d7377 100644 --- a/ax_check_qt.m4 +++ b/ax_check_qt.m4 @@ -62,16 +62,35 @@ AC_DEFUN([AX_CXX_QT_TOOLS], [ AX_CXX_QT_TOOL(LRELEASE, lrelease) ]) -AC_DEFUN([AX_CXX_CHECK_QT], [ +AC_DEFUN([AX_CHECK_VALID_FLAG], [ + AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])]) + save_cxxflags="$CXXFLAGS" + newflag="no" + for test_flag in $1; do + CXXFLAGS+=" ${test_flag}" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ + newflag="$test_flag" + AM_CXXFLAGS+=" ${test_flag}" + CXXFLAGS="$save_cxxflags" + break; + ]) + CXXFLAGS="$save_cxxflags" + done + AC_SUBST(AM_CXXFLAGS) + AC_MSG_RESULT([$newflag]) +]) + +AC_DEFUN([AX_CHECK_QT], [ qt_modules="$2" AX_CXX_QT_TOOLS HAVE_$1=0 - PKG_CHECK_MODULES([$1], [${qt_modules//Qt/Qt5}], [ + PKG_PROG_PKG_CONFIG + PKG_CHECK_MODULES([$1]5, [${qt_modules//Qt/Qt5}], [ HAVE_$1=1 AC_DEFINE([HAVE_$1]) - AM_CPPFLAGS+=" ${$1_CFLAGS}" - AM_CXXFLAGS+=" ${$1_CFLAGS}" - LIBS+=" ${$1_LIBS}" + AM_CPPFLAGS+=" ${[$1]5_CFLAGS}" + AM_CXXFLAGS+=" ${[$1]5_CFLAGS}" + LIBS+=" ${[$1]5_LIBS}" ], [ PKG_CHECK_MODULES([$1], [${qt_modules}], [ HAVE_$1=1 @@ -82,10 +101,11 @@ AC_DEFUN([AX_CXX_CHECK_QT], [ ], [HAVE_$1=0]) ]) AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1) + AX_CHECK_VALID_FLAG([-fPIC -fPIE], [position independent code flag]) AC_SUBST(AM_CPPFLAGS) AC_SUBST(AM_CXXFLAGS) AX_ADDITIONAL_QT_RULES_HACK=' -%_ui.hxx: %.ui +ui_%.hxx: %.ui ${UIC} -o [$][@] $< moc_%.cxx: %.hxx @@ -95,3 +115,10 @@ qrc_%.cxx: %.qrc ${RCC} -o [$][@] $<' AC_SUBST(AX_ADDITIONAL_QT_RULES_HACK) ]) + +AC_DEFUN([AX_REQUIRE_QT], [ + AX_CHECK_QT([$1], [$2]) + if ! test "$HAVE_$1" -eq 1; then + AC_MSG_ERROR([Required Qt modules not found: $2]) + fi +]) \ No newline at end of file diff --git a/ax_init_standard_project.m4 b/ax_init_standard_project.m4 index c4e5b26..c1a4b06 100644 --- a/ax_init_standard_project.m4 +++ b/ax_init_standard_project.m4 @@ -251,3 +251,16 @@ uninstall-documentation: #### End: $0 EOF ]) + +AC_DEFUN([AX_PKG_REQUIRE], [ + PKG_PROG_PKG_CONFIG + PKG_CHECK_MODULES([$1], [$1], [ + AM_CPPFLAGS+=" ${$1_CFLAGS}" + AM_CXXFLAGS+=" ${$1_CFLAGS}" + LIBS+=" ${$1_LIBS}" + ], [ + AC_MSG_ERROR([Required package $1 not found]) + ]) + AC_SUBST(AM_CPPFLAGS) + AC_SUBST(AM_CXXFLAGS) +]) diff --git a/bootstrap.sh b/bootstrap.sh index 82addc5..f961972 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -282,8 +282,8 @@ if ! test -f makefile.am; then echo "${HEADER}SUBDIRS =${SUBDIRS}" | to makefile.am fi to --condition AX_USE_LIBTOOL src/${PACKAGE_NAME}.pc.in <