Upstream tarball 10152
[amule.git] / m4 / qt.m4
blobd8d0ca3f40d07bedc1c0b07f0eaa06d1f9787e01
1 AC_DEFUN([QT_CONFIG_OPTIONS],
3         AC_ARG_WITH(
4                 [moc],
5                 [AS_HELP_STRING([--with-moc=PATH],
6                         [Search in PATH for Qt's meta object compiler])],
7                 [QT_MOC=$withval], [QT_MOC=""])
8 ])
10 AC_DEFUN([CHECK_MOC_VERSION],
12         AS_IF([test -z ${QT_MOC}],
13         [
14                 AC_PATH_PROGS(QT_MOC, moc-qt4 moc)
15         ],
16         [
17                 AC_MSG_CHECKING(for moc)
18                 AS_IF([test -x ${QT_MOC}],
19                 [
20                         AC_MSG_RESULT(${QT_MOC})
21                         AC_SUBST(QT_MOC)
22                 ],
23                 [
24                         AC_MSG_RESULT("not found")
25                         QT_MOC="not found"
26                 ])
27         ])
30         AS_IF([test "${QT_MOC}" != "not found"],
31         [
32                 AC_MSG_CHECKING(for moc version >= 4)
33                 QT_MOC_VERSION=`${QT_MOC} -v 2>&1 | sed -e 's/^.* (/(/'`
34                 AS_IF([test `echo ${QT_MOC_VERSION} | sed -e 's/^.* //' -e 's/\..*$//'` = 4],
35                 [
36                         AC_MSG_RESULT(found ${QT_MOC_VERSION})
37                 ],
38                 [
39                         AC_MSG_RESULT(not found ${QT_MOC_VERSION} is too old)
40                         QT_MOC="not found"
41                 ])
42         ])
45 AC_DEFUN([CHECK_QT_HEADERS],
47         AC_REQUIRE([PKG_PROG_PKG_CONFIG])
48         AC_MSG_CHECKING(for qt)
49         AS_IF([test `${PKG_CONFIG} QtCore` --exists && `${PKG_CONFIG} QtGui --exists`],
50         [
51                 AC_MSG_RESULT(found)
52                 AC_MSG_CHECKING(for qt core cflags)
53                 QT_CORE_CXXFLAGS=`${PKG_CONFIG} --cflags QtCore`
54                 AC_MSG_RESULT($QT_CORE_CFLAGS)
55                 AC_MSG_CHECKING(for qt core libs)
56                 QT_CORE_LIBS=`${PKG_CONFIG} --libs QtCore`
57                 AC_MSG_RESULT($QT_CORE_LIBS)
58                 AC_MSG_CHECKING(for qt gui cflags)
59                 QT_GUI_CXXFLAGS=`${PKG_CONFIG} --cflags QtGui`
60                 AC_MSG_RESULT($QT_GUI_CFLAGS)
61                 AC_MSG_CHECKING(for qt gui libs)
62                 QT_GUI_LIBS=`${PKG_CONFIG} --libs QtGui`
63                 AC_MSG_RESULT($QT_GUI_LIBS)
64         ],
65                 [AC_MSG_RESULT(not found)]
66         )
67         AC_SUBST(QT_CORE_CXXFLAGS)
68         AC_SUBST(QT_CORE_LIBS)
69         AC_SUBST(QT_GUI_CXXFLAGS)
70         AC_SUBST(QT_GUI_LIBS)