diff --git a/ax_check_qt.m4 b/ax_check_qt.m4 index e3d7377..5422129 100644 --- a/ax_check_qt.m4 +++ b/ax_check_qt.m4 @@ -82,6 +82,7 @@ AC_DEFUN([AX_CHECK_VALID_FLAG], [ AC_DEFUN([AX_CHECK_QT], [ qt_modules="$2" + qt_modules_optional="$3" AX_CXX_QT_TOOLS HAVE_$1=0 PKG_PROG_PKG_CONFIG @@ -89,36 +90,59 @@ AC_DEFUN([AX_CHECK_QT], [ HAVE_$1=1 AC_DEFINE([HAVE_$1]) AM_CPPFLAGS+=" ${[$1]5_CFLAGS}" + MOC_FLAGS+=" -DHAVE_$1=1 ${[$1]5_CFLAGS}" AM_CXXFLAGS+=" ${[$1]5_CFLAGS}" LIBS+=" ${[$1]5_LIBS}" + 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}" + ], [ + AC_MSG_NOTICE([Not found: ${qt_modules_optional//Qt/Qt5}]) + ]) + fi ], [ PKG_CHECK_MODULES([$1], [${qt_modules}], [ HAVE_$1=1 AC_DEFINE([HAVE_$1]) AM_CPPFLAGS+=" ${$1_CFLAGS}" + MOC_FLAGS+=" -DHAVE_$1=1 ${$1_CFLAGS}" AM_CXXFLAGS+=" ${$1_CFLAGS}" LIBS+=" ${$1_LIBS}" + 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}" + ], [ + AC_MSG_NOTICE([Not found: ${qt_modules_optional}]) + ]) + fi ], [HAVE_$1=0]) ]) AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1) AX_CHECK_VALID_FLAG([-fPIC -fPIE], [position independent code flag]) AC_SUBST(AM_CPPFLAGS) + AC_SUBST(MOC_FLAGS) AC_SUBST(AM_CXXFLAGS) AX_ADDITIONAL_QT_RULES_HACK=' ui_%.hxx: %.ui - ${UIC} -o [$][@] $< + $(UIC) -o [$][@] $< moc_%.cxx: %.hxx - ${MOC} -o [$][@] $< + $(MOC) $(MOC_FLAGS) -o [$][@] $< qrc_%.cxx: %.qrc - ${RCC} -o [$][@] $<' + $(RCC) -o [$][@] $<' AC_SUBST(AX_ADDITIONAL_QT_RULES_HACK) ]) AC_DEFUN([AX_REQUIRE_QT], [ - AX_CHECK_QT([$1], [$2]) + AX_CHECK_QT([$1], [$2], [$3]) if ! test "$HAVE_$1" -eq 1; then AC_MSG_ERROR([Required Qt modules not found: $2]) fi -]) \ No newline at end of file +]) diff --git a/ax_init_standard_project.m4 b/ax_init_standard_project.m4 index c1a4b06..b718099 100644 --- a/ax_init_standard_project.m4 +++ b/ax_init_standard_project.m4 @@ -104,8 +104,8 @@ AC_DEFUN([AX_USE_CXX], [ AC_CONFIG_FILES([src/makefile]) - AM_CPPFLAGS='-I ${top_srcdir}/src -I ${top_builddir}/src' - AM_LDFLAGS='-L ${top_srcdir}/src -I ${top_builddir}/src' + AM_CPPFLAGS='-I ${top_srcdir}/src -I ${top_builddir}/src -I ${srcdir} -I ${builddir}' + AM_LDFLAGS='-L ${top_srcdir}/src -L ${top_builddir}/src' # Get rid of that stupid -O2 -g opions! CXXFLAGS="${CXXFLAGS:-}" @@ -140,6 +140,13 @@ AC_DEFUN([AX_USE_CXX], [ AC_SUBST(AM_CXXFLAGS) AC_SUBST(AM_CPPFLAGS) AC_SUBST(AM_LDFLAGS) + AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-cxx-targets], [src/makefile.in]) + test -f src/makefile.in && cat >> src/makefile.in <> examples/makefile.in <> src/makefile.in < running: $* ..." + echo -en "\e[1m-> running:\e[0m $* ..." result=$($* 2>&1) res=$? if test $res -ne 0; then if test $check -eq 1; then - echo " error" - echo "*** Failed with return code: $res" + echo -e " \e[31merror\e[0m" + echo -e "\e[1m*** Failed with return code: $res\e[0m" if test -n "$result"; then echo "$result" fi exit 1 else - echo " ignored" + echo -e " \e[33mignored\e[0m" fi else - echo " success" + echo -e " \e[32msuccess\e[0m" fi } @@ -92,18 +92,18 @@ to() { return fi checkdir "$(dirname ${1})" - echo -n "-> generating $1 ..." + echo -en "\e[1m-> generating:\e[0m $1 ..." result=$(cat > "$1" 2>&1) res=$? if test $res -ne 0; then - echo " error" - echo "*** Failed with return code: $res" + echo -e " \e[31merror\e[0m" + echo -e "\e[1m*** Failed with return code: $res\e[0m" if test -n "$result"; then echo "$result" fi exit 1 else - echo " success" + echo -e " \e[32msuccess\e[0m" fi run svn add "$1" run svn propset svn:keywords "Id" "$1" @@ -118,12 +118,12 @@ copy() { } doxyreplace() { - echo -n "-> doxyfile: configure $1 ..." + echo -en "\e[1m-> doxyfile:\e[0m configure $1 ..." if sed -i 's|\(^'"$1"' *=\) *|\1'" $2"'|g' doc/doxyfile.in; then - echo " success" + echo -e " \e[32msuccess\e[0m" else - echo " error" - echo "**** command: sed -i 's|\(^'"$1"' *=\) *|\1'" $2"'|g' doc/doxyfile.in;" + echo -e " \e[31merror\e[0m" + echo -e "\e[1m**** command: sed -i 's|\(^'"$1"' *=\) *|\1'" $2"'|g' doc/doxyfile.in;\e[0m" exit 1 fi } @@ -133,6 +133,7 @@ copy ${MY_NAME} 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 <