|
|
@ -62,16 +62,35 @@ AC_DEFUN([AX_CXX_QT_TOOLS], [ |
|
|
|
AX_CXX_QT_TOOL(LRELEASE, lrelease) |
|
|
|
AX_CXX_QT_TOOL(LRELEASE, lrelease) |
|
|
|
]) |
|
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
AC_DEFUN([AX_CXX_CHECK_QT], [ |
|
|
|
AC_DEFUN([AX_CHECK_VALID_FLAG], [ |
|
|
|
|
|
|
|
AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])]) |
|
|
|
|
|
|
|
save_cxxflags="$CXXFLAGS" |
|
|
|
|
|
|
|
newflag="no" |
|
|
|
|
|
|
|
for test_flag in $1; do |
|
|
|
|
|
|
|
CXXFLAGS+=" ${test_flag}" |
|
|
|
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ |
|
|
|
|
|
|
|
newflag="$test_flag" |
|
|
|
|
|
|
|
AM_CXXFLAGS+=" ${test_flag}" |
|
|
|
|
|
|
|
CXXFLAGS="$save_cxxflags" |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
]) |
|
|
|
|
|
|
|
CXXFLAGS="$save_cxxflags" |
|
|
|
|
|
|
|
done |
|
|
|
|
|
|
|
AC_SUBST(AM_CXXFLAGS) |
|
|
|
|
|
|
|
AC_MSG_RESULT([$newflag]) |
|
|
|
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AC_DEFUN([AX_CHECK_QT], [ |
|
|
|
qt_modules="$2" |
|
|
|
qt_modules="$2" |
|
|
|
AX_CXX_QT_TOOLS |
|
|
|
AX_CXX_QT_TOOLS |
|
|
|
HAVE_$1=0 |
|
|
|
HAVE_$1=0 |
|
|
|
PKG_CHECK_MODULES([$1], [${qt_modules//Qt/Qt5}], [ |
|
|
|
PKG_PROG_PKG_CONFIG |
|
|
|
|
|
|
|
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_CFLAGS}" |
|
|
|
AM_CPPFLAGS+=" ${[$1]5_CFLAGS}" |
|
|
|
AM_CXXFLAGS+=" ${$1_CFLAGS}" |
|
|
|
AM_CXXFLAGS+=" ${[$1]5_CFLAGS}" |
|
|
|
LIBS+=" ${$1_LIBS}" |
|
|
|
LIBS+=" ${[$1]5_LIBS}" |
|
|
|
], [ |
|
|
|
], [ |
|
|
|
PKG_CHECK_MODULES([$1], [${qt_modules}], [ |
|
|
|
PKG_CHECK_MODULES([$1], [${qt_modules}], [ |
|
|
|
HAVE_$1=1 |
|
|
|
HAVE_$1=1 |
|
|
@ -82,10 +101,11 @@ AC_DEFUN([AX_CXX_CHECK_QT], [ |
|
|
|
], [HAVE_$1=0]) |
|
|
|
], [HAVE_$1=0]) |
|
|
|
]) |
|
|
|
]) |
|
|
|
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]) |
|
|
|
AC_SUBST(AM_CPPFLAGS) |
|
|
|
AC_SUBST(AM_CPPFLAGS) |
|
|
|
AC_SUBST(AM_CXXFLAGS) |
|
|
|
AC_SUBST(AM_CXXFLAGS) |
|
|
|
AX_ADDITIONAL_QT_RULES_HACK=' |
|
|
|
AX_ADDITIONAL_QT_RULES_HACK=' |
|
|
|
%_ui.hxx: %.ui |
|
|
|
ui_%.hxx: %.ui |
|
|
|
${UIC} -o [$][@] $< |
|
|
|
${UIC} -o [$][@] $< |
|
|
|
|
|
|
|
|
|
|
|
moc_%.cxx: %.hxx |
|
|
|
moc_%.cxx: %.hxx |
|
|
@ -95,3 +115,10 @@ qrc_%.cxx: %.qrc |
|
|
|
${RCC} -o [$][@] $<' |
|
|
|
${RCC} -o [$][@] $<' |
|
|
|
AC_SUBST(AX_ADDITIONAL_QT_RULES_HACK) |
|
|
|
AC_SUBST(AX_ADDITIONAL_QT_RULES_HACK) |
|
|
|
]) |
|
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AC_DEFUN([AX_REQUIRE_QT], [ |
|
|
|
|
|
|
|
AX_CHECK_QT([$1], [$2]) |
|
|
|
|
|
|
|
if ! test "$HAVE_$1" -eq 1; then |
|
|
|
|
|
|
|
AC_MSG_ERROR([Required Qt modules not found: $2]) |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
]) |