some qt improvements

master
Marc Wäckerlin 10 years ago
parent 024ea7cdfa
commit 19d40ea60a
  1. 38
      ax_check_qt.m4
  2. 43
      ax_init_standard_project.m4
  3. 3
      bootstrap.sh

@ -75,19 +75,19 @@ AC_DEFUN([AX_CXX_QT_TOOLS], [
AC_DEFUN([AX_CHECK_VALID_FLAG], [ AC_DEFUN([AX_CHECK_VALID_FLAG], [
AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])]) AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])])
save_cxxflags="$CXXFLAGS" save_cppflags="$CPPFLAGS"
newflag="no" newflag="no"
for test_flag in $1; do for test_flag in $1; do
CXXFLAGS+=" ${test_flag}" CPPFLAGS+=" ${test_flag}"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
newflag="$test_flag" newflag="$test_flag"
AM_CXXFLAGS+=" ${test_flag}" CPPFLAGS="$save_cppflags"
CXXFLAGS="$save_cxxflags" CPPFLAGS+=" ${test_flag}"
break; break;
]) ])
CXXFLAGS="$save_cxxflags" CPPFLAGS="$save_cppflags"
done done
AC_SUBST(AM_CXXFLAGS) AC_SUBST(CPPFLAGS)
AC_MSG_RESULT([$newflag]) AC_MSG_RESULT([$newflag])
]) ])
@ -100,16 +100,16 @@ AC_DEFUN([AX_CHECK_QT], [
PKG_CHECK_MODULES([$1]5, [${qt_modules//Qt/Qt5}], [ PKG_CHECK_MODULES([$1]5, [${qt_modules//Qt/Qt5}], [
HAVE_$1=1 HAVE_$1=1
AC_DEFINE([HAVE_$1]) AC_DEFINE([HAVE_$1])
AM_CPPFLAGS+=" ${[$1]5_CFLAGS}" CPPFLAGS+=" ${[$1]5_CFLAGS}"
MOC_FLAGS+=" -DHAVE_$1=1 ${[$1]5_CFLAGS}" MOC_FLAGS+=" -DHAVE_$1=1 ${[$1]5_CFLAGS}"
AM_CXXFLAGS+=" ${[$1]5_CFLAGS}" CXXFLAGS+=" ${[$1]5_CFLAGS}"
LIBS+=" ${[$1]5_LIBS}" LIBS+=" ${[$1]5_LIBS}"
PKG_REQUIREMENTS+=" ${qt_modules//Qt/Qt5}" PKG_REQUIREMENTS+=" ${qt_modules//Qt/Qt5}"
if test -n "${qt_modules_optional}"; then if test -n "${qt_modules_optional}"; then
PKG_CHECK_MODULES([$1]5_OPTIONAL, [${qt_modules_optional//Qt/Qt5}], [ PKG_CHECK_MODULES([$1]5_OPTIONAL, [${qt_modules_optional//Qt/Qt5}], [
AM_CPPFLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}" CPPFLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}"
MOC_FLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}" MOC_FLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}"
AM_CXXFLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}" CXXFLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}"
LIBS+=" ${[$1]5_OPTIONAL_LIBS}" LIBS+=" ${[$1]5_OPTIONAL_LIBS}"
PKG_REQUIREMENTS+=" ${qt_modules_optional//Qt/Qt5}" PKG_REQUIREMENTS+=" ${qt_modules_optional//Qt/Qt5}"
], [ ], [
@ -120,16 +120,16 @@ AC_DEFUN([AX_CHECK_QT], [
PKG_CHECK_MODULES([$1], [${qt_modules}], [ PKG_CHECK_MODULES([$1], [${qt_modules}], [
HAVE_$1=1 HAVE_$1=1
AC_DEFINE([HAVE_$1]) AC_DEFINE([HAVE_$1])
AM_CPPFLAGS+=" ${$1_CFLAGS}" CPPFLAGS+=" ${$1_CFLAGS}"
MOC_FLAGS+=" -DHAVE_$1=1 ${$1_CFLAGS}" MOC_FLAGS+=" -DHAVE_$1=1 ${$1_CFLAGS}"
AM_CXXFLAGS+=" ${$1_CFLAGS}" CXXFLAGS+=" ${$1_CFLAGS}"
LIBS+=" ${$1_LIBS}" LIBS+=" ${$1_LIBS}"
PKG_REQUIREMENTS+=" ${qt_modules}" PKG_REQUIREMENTS+=" ${qt_modules}"
if test -n "$3"; then if test -n "$3"; then
PKG_CHECK_MODULES($1_OPTIONAL, [${qt_modules_optional}], [ PKG_CHECK_MODULES($1_OPTIONAL, [${qt_modules_optional}], [
AM_CPPFLAGS+=" ${$1_OPTIONAL_CFLAGS}" CPPFLAGS+=" ${$1_OPTIONAL_CFLAGS}"
MOC_FLAGS+=" ${$1_OPTIONAL_CFLAGS}" MOC_FLAGS+=" ${$1_OPTIONAL_CFLAGS}"
AM_CXXFLAGS+=" ${$1_OPTIONAL_CFLAGS}" CXXFLAGS+=" ${$1_OPTIONAL_CFLAGS}"
LIBS+=" ${$1_OPTIONAL_LIBS}" LIBS+=" ${$1_OPTIONAL_LIBS}"
PKG_REQUIREMENTS+=" ${qt_modules_optional}" PKG_REQUIREMENTS+=" ${qt_modules_optional}"
], [ ], [
@ -140,9 +140,9 @@ AC_DEFUN([AX_CHECK_QT], [
]) ])
AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1) AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1)
AX_CHECK_VALID_FLAG([-fPIC -fPIE], [position independent code flag]) AX_CHECK_VALID_FLAG([-fPIC -fPIE], [position independent code flag])
AC_SUBST(AM_CPPFLAGS) AC_SUBST(CPPFLAGS)
AC_SUBST(MOC_FLAGS) AC_SUBST(MOC_FLAGS)
AC_SUBST(AM_CXXFLAGS) AC_SUBST(CXXFLAGS)
AC_SUBST(PKG_REQUIREMENTS) AC_SUBST(PKG_REQUIREMENTS)
AX_ADDITIONAL_QT_RULES_HACK=' AX_ADDITIONAL_QT_RULES_HACK='
@ -158,8 +158,8 @@ qrc_%.cxx: %.qrc
$(RCC) -o [$][@] -name ${<:%.qrc=%} $< $(RCC) -o [$][@] -name ${<:%.qrc=%} $<
AC_SUBST(AX_ADDITIONAL_QT_RULES_HACK) AC_SUBST(AX_ADDITIONAL_QT_RULES_HACK)
%.qrc: % #%.qrc: %
cwd=$(shell pwd) && cd $< && $(RCC) --project -o ${cwd}/[$][@] # cwd=$$(pwd) && cd $< && $(RCC) -project -o $${cwd}/[$][@]
%.qm: %.ts %.qm: %.ts
${LRELEASE} $< -qm [$][@] ${LRELEASE} $< -qm [$][@]
@ -217,5 +217,5 @@ AC_DEFUN([AX_REQUIRE_QT], [
# AX_QT_NO_KEYWORDS # AX_QT_NO_KEYWORDS
AC_DEFUN([AX_QT_NO_KEYWORDS], [ AC_DEFUN([AX_QT_NO_KEYWORDS], [
AM_CPPFLAGS+=" -DQT_NO_KEYWORDS" CPPFLAGS+=" -DQT_NO_KEYWORDS"
]) ])

@ -108,7 +108,7 @@ AC_DEFUN([AX_SUBST], [
# #
# configures the basic environment # configures the basic environment
AC_DEFUN([AX_INIT_STANDARD_PROJECT], [ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
AM_CPPFLAGS+=" '-DMAKE_STRING(X)=\#X' '-DNAMESPACE=${PACKAGE_NAME}'" AM_CPPFLAGS+=" '-DMAKE_STRING(X)=\#X' '-DNAMESPACE=${PACKAGE_NAME//-/_}'"
AX_SUBST(NUMBERS) AX_SUBST(NUMBERS)
AX_SUBST(HOME) AX_SUBST(HOME)
README=$(tail -n +3 README) README=$(tail -n +3 README)
@ -403,8 +403,8 @@ AC_DEFUN([AX_PKG_REQUIRE], [
done done
fi fi
]) ])
AC_SUBST(AM_CPPFLAGS) AC_SUBST(CPPFLAGS)
AC_SUBST(AM_CXXFLAGS) AC_SUBST(CXXFLAGS)
AC_SUBST(PKG_REQUIREMENTS) AC_SUBST(PKG_REQUIREMENTS)
if test -n "$3"; then if test -n "$3"; then
tmp_package=${$1_found} tmp_package=${$1_found}
@ -459,8 +459,8 @@ AC_DEFUN([AX_PKG_REQUIRE], [
AC_MSG_ERROR([Feature $1 not found please install module $secondpar]) AC_MSG_ERROR([Feature $1 not found please install module $secondpar])
fi fi
fi fi
AM_CPPFLAGS+=" ${$1_CFLAGS}" CPPFLAGS+=" ${$1_CFLAGS}"
AM_CXXFLAGS+=" ${$1_CFLAGS}" CXXFLAGS+=" ${$1_CFLAGS}"
LIBS+=" ${$1_LIBS}" LIBS+=" ${$1_LIBS}"
]) ])
@ -476,8 +476,8 @@ AC_DEFUN([AX_PKG_CHECK], [
PKG_PROG_PKG_CONFIG PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES([$1], [m4_default([$2], [$1])], [ PKG_CHECK_MODULES([$1], [m4_default([$2], [$1])], [
HAVE_$1=1 HAVE_$1=1
AM_CPPFLAGS+=" ${$1_CFLAGS}" CPPFLAGS+=" ${$1_CFLAGS}"
AM_CXXFLAGS+=" ${$1_CFLAGS}" CXXFLAGS+=" ${$1_CFLAGS}"
LIBS+=" ${$1_LIBS}" LIBS+=" ${$1_LIBS}"
if test -z "$PKG_REQUIREMENTS"; then if test -z "$PKG_REQUIREMENTS"; then
PKG_REQUIREMENTS="m4_default([$2], [$1])" PKG_REQUIREMENTS="m4_default([$2], [$1])"
@ -489,7 +489,32 @@ AC_DEFUN([AX_PKG_CHECK], [
]) ])
AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1) AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1)
AC_SUBST(HAVE_$1) AC_SUBST(HAVE_$1)
AC_SUBST(AM_CPPFLAGS) AC_SUBST(CPPFLAGS)
AC_SUBST(AM_CXXFLAGS) AC_SUBST(CXXFLAGS)
AC_SUBST(PKG_REQUIREMENTS) AC_SUBST(PKG_REQUIREMENTS)
]) ])
# make sure, a specific header exists
# - parameter:
# $1 = header name
AC_DEFUN([AX_REQUIRE_HEADER], [
AC_CHECK_HEADER($1, [], [
if test -n "$2"; then
found=0
for d in $2; do
if test -f "${d}/$1"; then
AC_MSG_NOTICE([found file ${d}/$1])
CPPFLAGS+=" -I${d}"
found=1
break;
else
AC_MSG_NOTICE([not found file ${d}/$1])
fi
done
fi
if test $found -eq 0; then
AC_MSG_ERROR([Header $1 not found])
fi
], [])
], [])
])

@ -601,7 +601,8 @@ Maintainer: @AUTHOR@
Build-Depends: debhelper, pkg-config, autotools-dev, lsb-release $(if testtag AX_USE_DOXYGEN; then echo -n ", doxygen, graphviz"; fi; if testtag AX_USE_CPPUNIT; then echo -n ", libcppunit-dev"; fi; if testtag AX_CXX_QT || testtag AX_CXX_CHECK_QT; then echo -n ", qtbase5-dev | libqt4-dev, qtbase5-dev-tools | qt4-dev-tools"; fi) Build-Depends: debhelper, pkg-config, autotools-dev, lsb-release $(if testtag AX_USE_DOXYGEN; then echo -n ", doxygen, graphviz"; fi; if testtag AX_USE_CPPUNIT; then echo -n ", libcppunit-dev"; fi; if testtag AX_CXX_QT || testtag AX_CXX_CHECK_QT; then echo -n ", qtbase5-dev | libqt4-dev, qtbase5-dev-tools | qt4-dev-tools"; fi)
Package: @PACKAGE_NAME@ Package: @PACKAGE_NAME@
$(if testtag AX_USE_LIBTOOL; then echo "Section: libs"; echo; fi)Architecture: any Section: $(if testtag AX_USE_LIBTOOL; then echo "libs"; fi)
Architecture: any
Depends: \${shlibs:Depends}, \${misc:Depends} Depends: \${shlibs:Depends}, \${misc:Depends}
Description: @DESCRIPTION@ Description: @DESCRIPTION@
@README_DEB@ @README_DEB@

Loading…
Cancel
Save