improve QT check; refs #41

master
Marc Wäckerlin 10 years ago
parent 50baa546a2
commit d7f4952012
  1. 17
      ax_check_qt.m4

@ -48,6 +48,7 @@ AC_DEFUN([AX_CXX_QT_TOOL], [
]) ])
AC_DEFUN([AX_CXX_QT_TOOLS], [ AC_DEFUN([AX_CXX_QT_TOOLS], [
AX_CXX_QT_TOOL(QMAKE, qmake)
AX_CXX_QT_TOOL(MOC, moc) AX_CXX_QT_TOOL(MOC, moc)
AX_CXX_QT_TOOL(UIC, uic) AX_CXX_QT_TOOL(UIC, uic)
AX_CXX_QT_TOOL(RCC, rcc) AX_CXX_QT_TOOL(RCC, rcc)
@ -62,17 +63,25 @@ AC_DEFUN([AX_CXX_CHECK_QT], [
PKG_CHECK_MODULES([$1], [${qt_modules//Qt/Qt5}], [ PKG_CHECK_MODULES([$1], [${qt_modules//Qt/Qt5}], [
HAVE_$1=1 HAVE_$1=1
AC_DEFINE([HAVE_$1]) AC_DEFINE([HAVE_$1])
CPPFLAGS+=" ${$1_CFLAGS}" AM_CPPFLAGS+=" ${$1_CFLAGS}"
CXXFLAGS+=" ${$1_CFLAGS}" AM_CXXFLAGS+=" ${$1_CFLAGS}"
LIBS+=" ${$1_LIBS}" LIBS+=" ${$1_LIBS}"
], [ ], [
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])
CPPFLAGS+=" ${$1_CFLAGS}" AM_CPPFLAGS+=" ${$1_CFLAGS}"
CXXFLAGS+=" ${$1_CFLAGS}" AM_CXXFLAGS+=" ${$1_CFLAGS}"
LIBS+=" ${$1_LIBS}" LIBS+=" ${$1_LIBS}"
]) ])
]) ])
AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1) 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"])
]) ])

Loading…
Cancel
Save