fixes if project dir is a subdir in a repository (multiple projects in one repository)

master
Marc Wäckerlin 8 years ago
parent dc869529cd
commit b60877e292
  1. 35
      scripts/ax_check_qt.m4
  2. 24
      scripts/ax_init_standard_project.m4
  3. 28
      scripts/bootstrap.sh
  4. 7
      scripts/resolve-rpmbuilddeps.sh

@ -51,18 +51,33 @@
AC_DEFUN([AX_CXX_QT_TOOL], [ AC_DEFUN([AX_CXX_QT_TOOL], [
PKG_PROG_PKG_CONFIG PKG_PROG_PKG_CONFIG
if test -z "$HAVE_$1"; then if test -z "${HAVE_$1}"; then
HAVE_$1=1 HAVE_$1=1
AC_MSG_CHECKING([for $2]) AC_MSG_CHECKING([for $2])
AC_ARG_VAR([$1], [path to Qt tool $2]) AC_ARG_VAR([$1], [path to Qt tool $2])
$1=${$1:-$(${PKG_CONFIG} --variable=$2_location Qt5Core)} for package in Qt5Core QtCore; do
$1=${$1:-$(${PKG_CONFIG} --variable=host_bins Qt5Core)/$2-qt5} if test -x "${$1}"; then
$1=${$1:-$(${PKG_CONFIG} --variable=host_bins Qt5Core)/$2} break
$1=${$1:-$(${PKG_CONFIG} --variable=$2_location QtCore)} fi
$1=${$1:-$(${PKG_CONFIG} --variable=host_bins QtCore)/$2} tool=$(${PKG_CONFIG} --variable=$2_location $package 2> /dev/null)
$1=${$1:-$(${PKG_CONFIG} --variable=host_bins QtCore)/$2-qt4} if test -x "${tool}"; then
if ! which "${$1%% *}" > /dev/null; then $1="${tool}"
if which "$2-qt5" > /dev/null; then 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 $1=$2-qt5
elif which "$2" > /dev/null; then elif which "$2" > /dev/null; then
$1=$2 $1=$2
@ -70,7 +85,7 @@ AC_DEFUN([AX_CXX_QT_TOOL], [
$1=$2-qt4 $1=$2-qt4
else else
HAVE_$1=0 HAVE_$1=0
$1="" unset $1
fi fi
fi fi
AC_SUBST($1) AC_SUBST($1)

@ -13,12 +13,12 @@ m4_define(x_least, m4_ifdef([x_least_fix], [x_least_fix],
mrw_esyscmd_s([ mrw_esyscmd_s([
VCS_REVISION="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-checkout" VCS_REVISION="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-checkout"
for path in . .. ../.. ../../..; do for path in . .. ../.. ../../..; do
if test -d .svn; then if test -d ${path}/.svn; then
svn upgrade 1>&2 > /dev/null || true (cd $path; svn upgrade 1>&2 > /dev/null || true)
VCS_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p') VCS_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p')
if test -n "${VCS_REVISION}"; then break; fi if test -n "${VCS_REVISION}"; then break; fi
elif test -d .git; then elif test -d ${path}/.git; then
VCS_REVISION=$(git rev-list --all --count) VCS_REVISION=$(cd ${path} > /dev/null 2/dev/null; git rev-list --all --count)
if test -n "${VCS_REVISION}"; then break; fi if test -n "${VCS_REVISION}"; then break; fi
fi fi
done done
@ -26,12 +26,12 @@ m4_define(x_least, m4_ifdef([x_least_fix], [x_least_fix],
]), mrw_esyscmd_s([ ]), mrw_esyscmd_s([
VCS_REVISION="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-checkout" VCS_REVISION="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-checkout"
for path in . .. ../.. ../../..; do for path in . .. ../.. ../../..; do
if test -d .svn; then if test -d ${path}/.svn; then
svn upgrade 1>&2 > /dev/null || true (cd $path; svn upgrade 1>&2 > /dev/null || true)
VCS_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p') VCS_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p')
if test -n "${VCS_REVISION}"; then break; fi if test -n "${VCS_REVISION}"; then break; fi
elif test -d .git; then elif test -d ${path}/.git; then
VCS_REVISION=$(git rev-list --all --count) VCS_REVISION=$(cd ${path} > /dev/null 2/dev/null; git rev-list --all --count)
if test -n "${VCS_REVISION}"; then break; fi if test -n "${VCS_REVISION}"; then break; fi
fi fi
done 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([ 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" VCS_REVISION="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-checkout"
for path in . .. ../.. ../../..; do for path in . .. ../.. ../../..; do
if test -d .svn; then if test -d ${path}/.svn; then
svn upgrade 1>&2 > /dev/null || true (cd $path; svn upgrade 1>&2 > /dev/null || true)
VCS_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p') VCS_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p')
if test -n "${VCS_REVISION}"; then break; fi if test -n "${VCS_REVISION}"; then break; fi
elif test -d .git; then elif test -d ${path}/.git; then
VCS_REVISION=$(git rev-list --all --count) VCS_REVISION=$(cd ${path} > /dev/null 2/dev/null; git rev-list --all --count)
if test -n "${VCS_REVISION}"; then break; fi if test -n "${VCS_REVISION}"; then break; fi
fi; fi;
done done

@ -303,17 +303,22 @@ done
echo -en "\e[1m-> checking:\e[0m for version control system ..." echo -en "\e[1m-> checking:\e[0m for version control system ..."
VCS="" VCS=""
VCSDEPENDS="" VCSDEPENDS=""
if test -d .svn; then for path in . .. ../.. ../../..; do
if test -d ${path}/.svn; then
VCS="svn" VCS="svn"
VCSDEPENDS_DEB="svn2cl, subversion, subversion-tools," VCSDEPENDS_DEB="svn2cl, subversion, subversion-tools,"
VCSDEPENDS_RPM="subversion," VCSDEPENDS_RPM="subversion,"
echo -e " \e[32msuccess\e[0m detected ${VCS}" echo -e " \e[32msuccess\e[0m detected ${VCS}"
elif test -d .git; then break
elif test -d ${path}/.git; then
VCS="git" VCS="git"
VCSDEPENDS_DEB="git2cl, git," VCSDEPENDS_DEB="git2cl, git,"
VCSDEPENDS_RPM="git," VCSDEPENDS_RPM="git,"
echo -e " \e[32msuccess\e[0m detected ${VCS}" echo -e " \e[32msuccess\e[0m detected ${VCS}"
else break
fi
done
if test -z "$VCS"; then
echo -e " \e[33mignored\e[0m" echo -e " \e[33mignored\e[0m"
fi fi
@ -634,7 +639,7 @@ LANGUAGE_FILE_BASE = ${PACKAGE_NAME}
QT_PLUGINS = iconengines imageformats platforms QT_PLUGINS = iconengines imageformats platforms
#### enable if you deliver a KDE/Gnome desktop file #### enable if you deliver a KDE/Gnome desktop file
#applicationsdir = ${datarootdir}/applications #applicationsdir = \${datarootdir}/applications
#dist_applications_DATA = ${PACKAGE_NAME}.desktop #dist_applications_DATA = ${PACKAGE_NAME}.desktop
#### enable (ev. instead of bin_PROGRAMS) if you build a library #### 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} ${PACKAGE_NAME//-/_}_SOURCES = \${${PACKAGE_NAME//-/_}_TR_FILES} \${BUILT_SOURCES}
## automatic assembly, no need to change ## automatic assembly, no need to change
BUILT_SOURCES = \${${PACKAGE_NAME//-/_}_MOCFILES} \ BUILT_SOURCES = \${${PACKAGE_NAME//-/_}_MOCFILES} \\
\${${PACKAGE_NAME//-/_}_UIFILES} \ \${${PACKAGE_NAME//-/_}_UIFILES} \\
\${${PACKAGE_NAME//-/_}_TRANSLATIONS} \ \${${PACKAGE_NAME//-/_}_TRANSLATIONS} \\
\${${PACKAGE_NAME//-/_}_RESOURCES} \${${PACKAGE_NAME//-/_}_RESOURCES}
## automatic assembly, no need to change ## 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} \${${PACKAGE_NAME//-/_}_UIFILES:ui_%.hxx=%.ui}
## automatic assembly, no need to change ## automatic assembly, no need to change
## except: adapt the pre-delivered qt_%.qm list (language files you copy from qt ## except: adapt the pre-delivered qt_%.qm list (language files you copy from qt
EXTRA_DIST = \${EXTRA_DIST_TR} \ EXTRA_DIST = \${EXTRA_DIST_TR} \\
\${${PACKAGE_NAME//-/_}_RESOURCES:qrc_%.cxx:%.qrc} \ \${${PACKAGE_NAME//-/_}_RESOURCES:qrc_%.cxx=%.qrc} \\
\${${PACKAGE_NAME//-/_}_TRANSLATIONS:%.qm=%.ts} \ \${${PACKAGE_NAME//-/_}_TRANSLATIONS:%.qm=%.ts} \\
qt_de.qm qt_fr.qm qt_de.qm qt_fr.qm
## automatic assembly, no need to change ## automatic assembly, no need to change
LANGUAGE_FILES = \${EXTRA_DIST_TR} \${${PACKAGE_NAME//-/_}_TR_FILES} LANGUAGE_FILES = \${EXTRA_DIST_TR} \${${PACKAGE_NAME//-/_}_TR_FILES}
CLEANFILES = \${${PACKAGE_NAME//-/_}_RESOURCES}
MAINTAINERCLEANFILES = makefile.in MAINTAINERCLEANFILES = makefile.in
EOF EOF
to --condition AX_USE_CXX src/main.cxx <<EOF to --condition AX_USE_CXX src/main.cxx <<EOF

@ -16,6 +16,12 @@ PACKAGE_NAME=$(sed -n 's/^ *m4_define(x_package_name, \(.*\)).*/\1/p' configure.
TRAP_CMD= TRAP_CMD=
DEPS= DEPS=
for f in BUILD BUILDROOT RPMS SPECS SRPMS; do
if ! test -d $f; then
TRAP_CMD+="rm -rf $f;"
mkdir $f
fi
done
if test -e ${PACKAGE_NAME}.spec.in -a ! -e ${PACKAGE_NAME}.spec; then if test -e ${PACKAGE_NAME}.spec.in -a ! -e ${PACKAGE_NAME}.spec; then
for f in $(sed -n 's, *AX_\(RPM\|ALL\)_DEPEND_IFEXISTS(\([^)]*\)).*,\2,p' configure.ac); do for f in $(sed -n 's, *AX_\(RPM\|ALL\)_DEPEND_IFEXISTS(\([^)]*\)).*,\2,p' configure.ac); do
if (test -x /usr/bin/zypper && zypper search -x "$f" 1>&2 > /dev/null) || \ if (test -x /usr/bin/zypper && zypper search -x "$f" 1>&2 > /dev/null) || \
@ -64,4 +70,5 @@ else
fi fi
fi fi
echo "**** Success: All Dependencies Resolved" echo "**** Success: All Dependencies Resolved"

Loading…
Cancel
Save