From 368684343106f0dde1aef2c034a0f6d2770ed62b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Sat, 9 May 2015 09:33:27 +0000 Subject: [PATCH] fixed pkg-config requirements --- ax_check_qt.m4 | 33 +++++++++++++++ ax_init_standard_project.m4 | 17 ++++++++ bootstrap.sh | 82 ++++++++++++++++++++++++------------- src/libpcscxx.pc.in | 14 +++++-- 4 files changed, 114 insertions(+), 32 deletions(-) diff --git a/ax_check_qt.m4 b/ax_check_qt.m4 index ce7628b..61724b6 100644 --- a/ax_check_qt.m4 +++ b/ax_check_qt.m4 @@ -104,12 +104,24 @@ AC_DEFUN([AX_CHECK_QT], [ MOC_FLAGS+=" -DHAVE_$1=1 ${[$1]5_CFLAGS}" AM_CXXFLAGS+=" ${[$1]5_CFLAGS}" LIBS+=" ${[$1]5_LIBS}" + modules=${qt_modules//Qt/Qt5} + if test -z "$PKG_REQUIREMENTS"; then + PKG_REQUIREMENTS="${modules// /, }" + else + PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, ${modules// /, }" + fi if test -n "${qt_modules_optional}"; then PKG_CHECK_MODULES([$1]5_OPTIONAL, [${qt_modules_optional//Qt/Qt5}], [ AM_CPPFLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}" MOC_FLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}" AM_CXXFLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}" LIBS+=" ${[$1]5_OPTIONAL_LIBS}" + modules=${qt_modules_optional//Qt/Qt5} + if test -z "$PKG_REQUIREMENTS"; then + PKG_REQUIREMENTS="${modules// /, }" + else + PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, ${modules// /, }" + fi ], [ AC_MSG_NOTICE([Not found: ${qt_modules_optional//Qt/Qt5}]) ]) @@ -122,12 +134,24 @@ AC_DEFUN([AX_CHECK_QT], [ MOC_FLAGS+=" -DHAVE_$1=1 ${$1_CFLAGS}" AM_CXXFLAGS+=" ${$1_CFLAGS}" LIBS+=" ${$1_LIBS}" + modules=${qt_modules} + if test -z "$PKG_REQUIREMENTS"; then + PKG_REQUIREMENTS="${modules// /, }" + else + PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, ${modules// /, }" + fi if test -n "$3"; then PKG_CHECK_MODULES($1_OPTIONAL, [${qt_modules_optional}], [ AM_CPPFLAGS+=" ${$1_OPTIONAL_CFLAGS}" MOC_FLAGS+=" ${$1_OPTIONAL_CFLAGS}" AM_CXXFLAGS+=" ${$1_OPTIONAL_CFLAGS}" LIBS+=" ${$1_OPTIONAL_LIBS}" + modules=${qt_modules_optional} + if test -z "$PKG_REQUIREMENTS"; then + PKG_REQUIREMENTS="${modules// /, }" + else + PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, ${modules// /, }" + fi ], [ AC_MSG_NOTICE([Not found: ${qt_modules_optional}]) ]) @@ -139,6 +163,7 @@ AC_DEFUN([AX_CHECK_QT], [ AC_SUBST(AM_CPPFLAGS) AC_SUBST(MOC_FLAGS) AC_SUBST(AM_CXXFLAGS) + AC_SUBST(PKG_REQUIREMENTS) AX_ADDITIONAL_QT_RULES_HACK=' ui_%.hxx: %.ui $(UIC) -o [$][@] $< @@ -191,3 +216,11 @@ AC_DEFUN([AX_REQUIRE_QT], [ AC_MSG_ERROR([Required Qt modules not found: $2]) fi ]) + + +# Omit Qt Keywords +# AX_QT_NO_KEYWORDS + +AC_DEFUN([AX_QT_NO_KEYWORDS], [ + AM_CPPFLAGS+=" -DQT_NO_KEYWORDS" +]) diff --git a/ax_init_standard_project.m4 b/ax_init_standard_project.m4 index ddcf603..e4ad10a 100644 --- a/ax_init_standard_project.m4 +++ b/ax_init_standard_project.m4 @@ -399,6 +399,11 @@ AC_DEFUN([AX_PKG_REQUIRE], [ AM_CPPFLAGS+=" ${$1_CFLAGS}" AM_CXXFLAGS+=" ${$1_CFLAGS}" LIBS+=" ${$1_LIBS}" + if test -z "$PKG_REQUIREMENTS"; then + PKG_REQUIREMENTS="$2" + else + PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, $2" + fi ], [ AC_MSG_WARN([Recommended package $2 for feature $1 not installed]) if test -n "$4"; then @@ -430,6 +435,11 @@ AC_DEFUN([AX_PKG_REQUIRE], [ AM_CPPFLAGS+=" ${$1_CFLAGS}" AM_CXXFLAGS+=" ${$1_CFLAGS}" LIBS+=" ${$1_LIBS}" + if test -z "$PKG_REQUIREMENTS"; then + PKG_REQUIREMENTS="$pkg" + else + PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, $pkg" + fi ], [ AC_MSG_WARN([Recommended package $pkg for feature $1 not installed]) ]) @@ -438,6 +448,7 @@ AC_DEFUN([AX_PKG_REQUIRE], [ ]) AC_SUBST(AM_CPPFLAGS) AC_SUBST(AM_CXXFLAGS) + AC_SUBST(PKG_REQUIREMENTS) if test -n "$3"; then old_CPPFLAGS=${CPPFLAGS} CPPFLAGS=" ${$1_CFLAGS} ${CPPFLAGS}" @@ -464,6 +475,11 @@ AC_DEFUN([AX_PKG_CHECK], [ AM_CPPFLAGS+=" ${$1_CFLAGS}" AM_CXXFLAGS+=" ${$1_CFLAGS}" LIBS+=" ${$1_LIBS}" + if test -z "$PKG_REQUIREMENTS"; then + PKG_REQUIREMENTS="m4_default([$2], [$1])" + else + PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, m4_default([$2], [$1])" + fi ], [ HAVE_$1=0 ]) @@ -471,4 +487,5 @@ AC_DEFUN([AX_PKG_CHECK], [ AC_SUBST(HAVE_$1) AC_SUBST(AM_CPPFLAGS) AC_SUBST(AM_CXXFLAGS) + AC_SUBST(PKG_REQUIREMENTS) ]) diff --git a/bootstrap.sh b/bootstrap.sh index e954655..1883611 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -22,28 +22,31 @@ configure=0 build=0 overwrite=0 rebuild=0 +rebuildfiles=() while test $# -gt 0; do case "$1" in (--configure|-c) configure=1;; (--build|-b) configure=1; build=1;; (--overwrite|-o) overwrite=1;; (--rebuild|-r) rebuild=1;; + (--rebuild-file|-f) shift; rebuildfiles+=("$1");; (--version|-v) echo "$Id$"; exit;; (--help|-h) less < rebild specific file (can be added multiple times) + --help, -h show this help + --version, -v show version and date of this file DESCRIPTION @@ -122,9 +125,15 @@ GENERATED FILES REBUILDING FILES - To rebuild all these files, just run "${MY_NAME} -o". You can also - remove and rebuild a single file by removing it from subversion, - just call "svn rm " and "${MY_NAME}" to rebuild file "". + To rebuild all these files, just run "${MY_NAME} -r". + + To copy only the files provided by this package, that means those + files you must never change, that means to update the build system + to the latest release, run "${MY_NAME} -o" + + You can also rebuild a list of singleany list of specific file files + by adding option "${MY_NAME} -f " to rebuild file + "". You can add option "-f" more than once. FILES TO EDIT @@ -256,6 +265,12 @@ testtag() { egrep -q '^ *'"$1" configure.ac } +contains() { + local e + for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done + return 1 +} + checkdir() { if ! test -d "$1"; then # create path run mkdir -p "$1" @@ -285,8 +300,10 @@ to() { esac shift; done - if checkfile "$1" && test $rebuild -eq 0; then # file already exists - return + if checkfile "$1" && test $rebuild -eq 0 \ + && ! contains "$1" "${rebuildfiles[@]}"; then + # file already exists and must not be rebuilt + return 1 fi checkdir "$(dirname ${1})" echo -en "\e[1m-> generating:\e[0m $1 ..." @@ -307,10 +324,13 @@ to() { run svn add "$1" run svn propset svn:keywords "Id" "$1" fi + return 0 } copy() { - if checkfile "$1" && test $overwrite -eq 0; then + if checkfile "$1" && test $overwrite -eq 0 \ + && ! contains "$1" "${rebuildfiles[@]}"; then + # file already exists and must not be rebuilt return fi run cp "${0%/*}/$1" "$1" @@ -348,8 +368,8 @@ copy ax_init_standard_project.m4 copy ax_cxx_compile_stdcxx_11.m4 copy ax_check_qt.m4 copy AUTHORS -if ! test -f configure.ac; then - to configure.ac <