diff --git a/ax_check_qt.m4 b/ax_check_qt.m4 index a2019a5..673330f 100644 --- a/ax_check_qt.m4 +++ b/ax_check_qt.m4 @@ -48,6 +48,7 @@ AC_DEFUN([AX_CXX_QT_TOOL], [ ]) AC_DEFUN([AX_CXX_QT_TOOLS], [ + AX_CXX_QT_TOOL(QMAKE, qmake) AX_CXX_QT_TOOL(MOC, moc) AX_CXX_QT_TOOL(UIC, uic) AX_CXX_QT_TOOL(RCC, rcc) @@ -62,17 +63,25 @@ AC_DEFUN([AX_CXX_CHECK_QT], [ PKG_CHECK_MODULES([$1], [${qt_modules//Qt/Qt5}], [ HAVE_$1=1 AC_DEFINE([HAVE_$1]) - CPPFLAGS+=" ${$1_CFLAGS}" - CXXFLAGS+=" ${$1_CFLAGS}" + AM_CPPFLAGS+=" ${$1_CFLAGS}" + AM_CXXFLAGS+=" ${$1_CFLAGS}" LIBS+=" ${$1_LIBS}" ], [ PKG_CHECK_MODULES([$1], [${qt_modules}], [ HAVE_$1=1 AC_DEFINE([HAVE_$1]) - CPPFLAGS+=" ${$1_CFLAGS}" - CXXFLAGS+=" ${$1_CFLAGS}" + AM_CPPFLAGS+=" ${$1_CFLAGS}" + AM_CXXFLAGS+=" ${$1_CFLAGS}" LIBS+=" ${$1_LIBS}" ]) ]) AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1) + AC_SUBST(AM_CPPFLAGS) + AC_SUBST(AM_CXXFLAGS) + AX_CHECK_COMPILE_FLAG(-fPIC, [AM_CXXFLAGS+=" -fPIC"]) + AX_CHECK_COMPILE_FLAG(-DPIC, [AM_CXXFLAGS+=" -DPIC"]) + AX_CHECK_COMPILE_FLAG(-fPIE, [AM_CXXFLAGS+=" -fPIE"]) + AX_CHECK_LINK_FLAG(-fPIC, [LDFLAGS+=" -fPIC"]) + AX_CHECK_LINK_FLAG(-DPIC, [LDFLAGS+=" -DPIC"]) + AX_CHECK_LINK_FLAG(-fPIE, [LDFLAGS+=" -fPIE"]) ])