Updated French and Turkish translation by gagar
[amule.git] / m4 / qt.m4
blob1d87ce88f73b9930782d31095bfdfa0f1a6a8605
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                 AS_IF([test -z ${QT_MOC}],
16                 [
17                         echo moc not found
18                         exit 1
19                 ])
20         ],
21         [
22                 AC_MSG_CHECKING(for moc)
23                 AS_IF([test -x ${QT_MOC}],
24                 [
25                         AC_MSG_RESULT(${QT_MOC})
26                         AC_SUBST(QT_MOC)
27                 ],
28                 [
29                         AC_MSG_RESULT("not found")
30                         QT_MOC="not found"
31                         exit 1
32                 ])
33         ])
36         AS_IF([test "${QT_MOC}" != "not found"],
37         [
38                 AC_MSG_CHECKING(for moc version >= 4)
39                 QT_MOC_VERSION=`${QT_MOC} -v 2>&1 | sed -e 's/^.* (/(/'`
40                 AS_IF([test `echo ${QT_MOC_VERSION} | sed -e 's/^.* //' -e 's/\..*$//'` = 4],
41                 [
42                         AC_MSG_RESULT(found ${QT_MOC_VERSION})
43                 ],
44                 [
45                         AC_MSG_RESULT(not found ${QT_MOC_VERSION} is too old)
46                         QT_MOC="not found"
47                         exit 1
48                 ])
49         ])
52 AC_DEFUN([CHECK_QT_HEADERS],
54         AC_REQUIRE([PKG_PROG_PKG_CONFIG])
55         AC_MSG_CHECKING(for qt)
56         AS_IF([test `${PKG_CONFIG} QtCore` --exists && `${PKG_CONFIG} QtGui --exists`],
57         [
58                 AC_MSG_RESULT(found)
59                 AC_MSG_CHECKING(for qt core cflags)
60                 QT_CORE_CXXFLAGS=`${PKG_CONFIG} --cflags QtCore`
61                 AC_MSG_RESULT($QT_CORE_CFLAGS)
62                 AC_MSG_CHECKING(for qt core libs)
63                 QT_CORE_LIBS=`${PKG_CONFIG} --libs QtCore`
64                 AC_MSG_RESULT($QT_CORE_LIBS)
65                 AC_MSG_CHECKING(for qt gui cflags)
66                 QT_GUI_CXXFLAGS=`${PKG_CONFIG} --cflags QtGui`
67                 AC_MSG_RESULT($QT_GUI_CFLAGS)
68                 AC_MSG_CHECKING(for qt gui libs)
69                 QT_GUI_LIBS=`${PKG_CONFIG} --libs QtGui`
70                 AC_MSG_RESULT($QT_GUI_LIBS)
71         ],
72                 [AC_MSG_RESULT(not found)]
73                 exit 1
74         )
76         AS_IF([test `${PKG_CONFIG} QtDBus --modversion | sed -e 's/\.//g'` -ge 470 ],
77         [
78                 QT_DBUS_LDFLAGS="-lQtDBus"
79                 AC_SUBST(QT_DBUS_LDFLAGS)
80         ])
82         AC_SUBST(QT_CORE_CXXFLAGS)
83         AC_SUBST(QT_CORE_LIBS)
84         AC_SUBST(QT_GUI_CXXFLAGS)
85         AC_SUBST(QT_GUI_LIBS)