fixes if project dir is a subdir in a repository (multiple projects in one repository)
This commit is contained in:
@@ -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
|
||||
])
|
||||
|
@@ -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
|
||||
|
@@ -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 <<EOF
|
||||
|
@@ -16,6 +16,12 @@ PACKAGE_NAME=$(sed -n 's/^ *m4_define(x_package_name, \(.*\)).*/\1/p' configure.
|
||||
|
||||
TRAP_CMD=
|
||||
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
|
||||
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) || \
|
||||
@@ -64,4 +70,5 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
echo "**** Success: All Dependencies Resolved"
|
||||
|
Reference in New Issue
Block a user