From b60877e29292e5b21188587cd838e3bb12f69532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Wed, 3 May 2017 14:55:22 +0000 Subject: [PATCH] fixes if project dir is a subdir in a repository (multiple projects in one repository) --- scripts/ax_check_qt.m4 | 39 +++++++++++++++++-------- scripts/ax_init_standard_project.m4 | 24 ++++++++-------- scripts/bootstrap.sh | 44 ++++++++++++++++------------- scripts/resolve-rpmbuilddeps.sh | 7 +++++ 4 files changed, 71 insertions(+), 43 deletions(-) diff --git a/scripts/ax_check_qt.m4 b/scripts/ax_check_qt.m4 index af3a238..7ba286f 100644 --- a/scripts/ax_check_qt.m4 +++ b/scripts/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/scripts/ax_init_standard_project.m4 b/scripts/ax_init_standard_project.m4 index a260e0c..6a9537f 100644 --- a/scripts/ax_init_standard_project.m4 +++ b/scripts/ax_init_standard_project.m4 @@ -13,12 +13,12 @@ m4_define(x_least, m4_ifdef([x_least_fix], [x_least_fix], mrw_esyscmd_s([ VCS_REVISION="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-checkout" for path in . .. ../.. ../../..; do - if test -d .svn; then - svn upgrade 1>&2 > /dev/null || true + if test -d ${path}/.svn; then + (cd $path; svn upgrade 1>&2 > /dev/null || true) VCS_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p') if test -n "${VCS_REVISION}"; then break; fi - elif test -d .git; then - VCS_REVISION=$(git rev-list --all --count) + elif test -d ${path}/.git; then + VCS_REVISION=$(cd ${path} > /dev/null 2/dev/null; git rev-list --all --count) if test -n "${VCS_REVISION}"; then break; fi fi done @@ -26,12 +26,12 @@ m4_define(x_least, m4_ifdef([x_least_fix], [x_least_fix], ]), mrw_esyscmd_s([ VCS_REVISION="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-checkout" for path in . .. ../.. ../../..; do - if test -d .svn; then - svn upgrade 1>&2 > /dev/null || true + if test -d ${path}/.svn; then + (cd $path; svn upgrade 1>&2 > /dev/null || true) VCS_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p') if test -n "${VCS_REVISION}"; then break; fi - elif test -d .git; then - VCS_REVISION=$(git rev-list --all --count) + elif test -d ${path}/.git; then + VCS_REVISION=$(cd ${path} > /dev/null 2/dev/null; git rev-list --all --count) if test -n "${VCS_REVISION}"; then break; fi fi done @@ -44,12 +44,12 @@ m4_define(x_least, m4_ifdef([x_least_fix], [x_least_fix], m4_define(x_minor_diff, m4_ifdef([x_least_fix], 0, mrw_esyscmd_s([ VCS_REVISION="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-checkout" for path in . .. ../.. ../../..; do - if test -d .svn; then - svn upgrade 1>&2 > /dev/null || true + if test -d ${path}/.svn; then + (cd $path; svn upgrade 1>&2 > /dev/null || true) VCS_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p') if test -n "${VCS_REVISION}"; then break; fi - elif test -d .git; then - VCS_REVISION=$(git rev-list --all --count) + elif test -d ${path}/.git; then + VCS_REVISION=$(cd ${path} > /dev/null 2/dev/null; git rev-list --all --count) if test -n "${VCS_REVISION}"; then break; fi fi; done diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index e30ad57..a483413 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -303,17 +303,22 @@ done echo -en "\e[1m-> checking:\e[0m for version control system ..." VCS="" VCSDEPENDS="" -if test -d .svn; then - VCS="svn" - VCSDEPENDS_DEB="svn2cl, subversion, subversion-tools," - VCSDEPENDS_RPM="subversion," - echo -e " \e[32msuccess\e[0m detected ${VCS}" -elif test -d .git; then - VCS="git" - VCSDEPENDS_DEB="git2cl, git," - VCSDEPENDS_RPM="git," - echo -e " \e[32msuccess\e[0m detected ${VCS}" -else +for path in . .. ../.. ../../..; do + if test -d ${path}/.svn; then + VCS="svn" + VCSDEPENDS_DEB="svn2cl, subversion, subversion-tools," + VCSDEPENDS_RPM="subversion," + echo -e " \e[32msuccess\e[0m detected ${VCS}" + break + elif test -d ${path}/.git; then + VCS="git" + VCSDEPENDS_DEB="git2cl, git," + VCSDEPENDS_RPM="git," + echo -e " \e[32msuccess\e[0m detected ${VCS}" + break + fi +done +if test -z "$VCS"; then echo -e " \e[33mignored\e[0m" fi @@ -634,7 +639,7 @@ LANGUAGE_FILE_BASE = ${PACKAGE_NAME} QT_PLUGINS = iconengines imageformats platforms #### enable if you deliver a KDE/Gnome desktop file -#applicationsdir = ${datarootdir}/applications +#applicationsdir = \${datarootdir}/applications #dist_applications_DATA = ${PACKAGE_NAME}.desktop #### enable (ev. instead of bin_PROGRAMS) if you build a library @@ -671,25 +676,26 @@ ${PACKAGE_NAME//-/_}_TR_FILES = main.cxx version.cxx ${PACKAGE_NAME//-/_}_SOURCES = \${${PACKAGE_NAME//-/_}_TR_FILES} \${BUILT_SOURCES} ## automatic assembly, no need to change -BUILT_SOURCES = \${${PACKAGE_NAME//-/_}_MOCFILES} \ - \${${PACKAGE_NAME//-/_}_UIFILES} \ - \${${PACKAGE_NAME//-/_}_TRANSLATIONS} \ +BUILT_SOURCES = \${${PACKAGE_NAME//-/_}_MOCFILES} \\ + \${${PACKAGE_NAME//-/_}_UIFILES} \\ + \${${PACKAGE_NAME//-/_}_TRANSLATIONS} \\ \${${PACKAGE_NAME//-/_}_RESOURCES} ## automatic assembly, no need to change -EXTRA_DIST_TR = \${${PACKAGE_NAME//-/_}_MOCFILES:moc_%.cxx=%.hxx} \ +EXTRA_DIST_TR = \${${PACKAGE_NAME//-/_}_MOCFILES:moc_%.cxx=%.hxx} \\ \${${PACKAGE_NAME//-/_}_UIFILES:ui_%.hxx=%.ui} ## automatic assembly, no need to change ## except: adapt the pre-delivered qt_%.qm list (language files you copy from qt -EXTRA_DIST = \${EXTRA_DIST_TR} \ - \${${PACKAGE_NAME//-/_}_RESOURCES:qrc_%.cxx:%.qrc} \ - \${${PACKAGE_NAME//-/_}_TRANSLATIONS:%.qm=%.ts} \ +EXTRA_DIST = \${EXTRA_DIST_TR} \\ + \${${PACKAGE_NAME//-/_}_RESOURCES:qrc_%.cxx=%.qrc} \\ + \${${PACKAGE_NAME//-/_}_TRANSLATIONS:%.qm=%.ts} \\ qt_de.qm qt_fr.qm ## automatic assembly, no need to change LANGUAGE_FILES = \${EXTRA_DIST_TR} \${${PACKAGE_NAME//-/_}_TR_FILES} +CLEANFILES = \${${PACKAGE_NAME//-/_}_RESOURCES} MAINTAINERCLEANFILES = makefile.in EOF to --condition AX_USE_CXX src/main.cxx <&2 > /dev/null) || \ @@ -64,4 +70,5 @@ else fi fi + echo "**** Success: All Dependencies Resolved"