annotate m4/m4_ax_have_qt.m4 @ 280:9b6e12c14a1e

chore: merge
author Paper <paper@paper.us.eu.org>
date Mon, 06 May 2024 17:23:30 -0400
parents f01b6e9c8fa2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
1 # ===========================================================================
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
2 # https://www.gnu.org/software/autoconf-archive/ax_have_qt.html
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
3 # ===========================================================================
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
4 #
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
5 # SYNOPSIS
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
6 #
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
7 # AX_HAVE_QT
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
8 #
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
9 # DESCRIPTION
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
10 #
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
11 # Searches $PATH and queries qmake for Qt include files, libraries and Qt
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
12 # binary utilities. The macro only supports Qt5 or later.
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
13 #
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
14 # The following shell variable is set to either "yes" or "no":
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
15 #
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
16 # have_qt
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
17 #
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
18 # Additionally, the following variables are exported:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
19 #
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
20 # QT_CXXFLAGS
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
21 # QT_LIBS
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
22 # QT_MOC
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
23 # QT_UIC
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
24 # QT_RCC
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
25 # QT_LRELEASE
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
26 # QT_LUPDATE
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
27 # QT_DIR
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
28 # QMAKE
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
29 #
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
30 # which respectively contain an "-I" flag pointing to the Qt include
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
31 # directory, link flags necessary to link with Qt and X, the full path to
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
32 # the meta object compiler and the user interface compiler both, and
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
33 # finally the variable QTDIR as Qt likes to see it defined.
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
34 #
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
35 # Example lines for Makefile.in:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
36 #
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
37 # CXXFLAGS = @QT_CXXFLAGS@
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
38 # MOC = @QT_MOC@
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
39 #
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
40 # After the variables have been set, a trial compile and link is performed
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
41 # to check the correct functioning of the meta object compiler. This test
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
42 # may fail when the different detected elements stem from different
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
43 # releases of the Qt framework. In that case, an error message is emitted
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
44 # and configure stops.
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
45 #
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
46 # No common variables such as $LIBS or $CFLAGS are polluted.
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
47 #
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
48 # LICENSE
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
49 #
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
50 # Copyright (c) 2008 Bastiaan Veelo <Bastiaan@Veelo.net>
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
51 # Copyright (c) 2014 Alex Henrie <alexhenrie24@gmail.com>
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
52 #
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
53 # Copying and distribution of this file, with or without modification, are
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
54 # permitted in any medium without royalty provided the copyright notice
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
55 # and this notice are preserved. This file is offered as-is, without any
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
56 # warranty.
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
57
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
58 #serial 25
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
59
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
60 AU_ALIAS([BNV_HAVE_QT], [AX_HAVE_QT])
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
61 AC_DEFUN([AX_HAVE_QT],
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
62 [
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
63 AC_REQUIRE([AC_PROG_CXX])
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
64 AC_REQUIRE([AC_PATH_X])
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
65 AC_REQUIRE([AC_PATH_XTRA])
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
66 # openSUSE leap 15.3 installs qmake-qt5, not qmake, for example.
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
67 # Store the full name (like qmake-qt5) into QMAKE
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
68 # and the specifier (like -qt5 or empty) into am_have_qt_qmexe_suff.
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
69 AC_ARG_VAR([QMAKE],"Qt make tool")
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
70 AC_CHECK_TOOLS([QMAKE],[qmake qmake-qt6 qmake-qt5],[false])
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
71
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
72 AC_MSG_CHECKING(for Qt)
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
73 am_have_qt_qmexe_suff=`echo $QMAKE | sed 's,^.*qmake,,'`
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
74 # If we have Qt5 or later in the path, we're golden
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
75 ver=`$QMAKE --version | grep -o "Qt version ."`
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
76
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
77 if test "$ver" ">" "Qt version 4"; then
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
78 have_qt=yes
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
79 # This pro file dumps qmake's variables, but it only works on Qt 5 or later
271
f01b6e9c8fa2 dep/animone: make OS X code build
Paper <paper@paper.us.eu.org>
parents: 267
diff changeset
80 am_have_qt_dir=$(mktemp -d || mktemp -d -t tmp)
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
81 am_have_qt_pro="$am_have_qt_dir/test.pro"
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
82 am_have_qt_stash="$am_have_qt_dir/.qmake.stash"
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
83 am_have_qt_makefile="$am_have_qt_dir/Makefile"
264
9a04802848c0 *: improve multiple things
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
84 am_have_qt_makefile_vars="$am_have_qt_dir/Makefile.vars"
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
85 # http://qt-project.org/doc/qt-5/qmake-variable-reference.html#qt
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
86 cat > $am_have_qt_pro << EOF
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
87 win32 {
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
88 CONFIG -= debug_and_release
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
89 CONFIG += release
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
90 }
267
09c5bd74fe93 win32: make builds work again
Paper <paper@paper.us.eu.org>
parents: 264
diff changeset
91 QMAKE_PROJECT_DEPTH = 0
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
92 qtHaveModule(core): QT += core
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
93 qtHaveModule(gui): QT += gui
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
94 qtHaveModule(widgets): QT += widgets
264
9a04802848c0 *: improve multiple things
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
95 EOF
9a04802848c0 *: improve multiple things
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
96 cat > "$am_have_qt_makefile_vars" << EOF
9a04802848c0 *: improve multiple things
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
97 include $am_have_qt_makefile
9a04802848c0 *: improve multiple things
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
98
9a04802848c0 *: improve multiple things
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
99 # todo: use printf here
9a04802848c0 *: improve multiple things
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
100 CXXFLAGS:
9a04802848c0 *: improve multiple things
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
101 @echo \$(CXXFLAGS) \$(INCPATH)
9a04802848c0 *: improve multiple things
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
102
9a04802848c0 *: improve multiple things
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
103 LIBS:
9a04802848c0 *: improve multiple things
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
104 @echo \$(LIBS)
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
105 EOF
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
106 $QMAKE $am_have_qt_pro -o $am_have_qt_makefile
264
9a04802848c0 *: improve multiple things
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
107 QT_CXXFLAGS=`cd $am_have_qt_dir; make -s -f $am_have_qt_makefile_vars CXXFLAGS`
9a04802848c0 *: improve multiple things
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
108 QT_LIBS=`cd $am_have_qt_dir; make -s -f $am_have_qt_makefile_vars LIBS`
267
09c5bd74fe93 win32: make builds work again
Paper <paper@paper.us.eu.org>
parents: 264
diff changeset
109 rm $am_have_qt_pro $am_have_qt_stash $am_have_qt_makefile $am_have_qt_makefile_vars
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
110 rmdir $am_have_qt_dir
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
111
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
112 # Look for specific tools in $PATH
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
113 QT_MOC=`which moc$am_have_qt_qmexe_suff`
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
114 QT_UIC=`which uic$am_have_qt_qmexe_suff`
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
115 QT_RCC=`which rcc$am_have_qt_qmexe_suff`
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
116 QT_LRELEASE=`which lrelease$am_have_qt_qmexe_suff`
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
117 QT_LUPDATE=`which lupdate$am_have_qt_qmexe_suff`
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
118
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
119 # Get Qt version from qmake
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
120 QT_DIR=`$QMAKE --version | grep -o -E /.+`
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
121
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
122 # All variables are defined, report the result
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
123 AC_MSG_RESULT([$have_qt:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
124 QT_CXXFLAGS=$QT_CXXFLAGS
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
125 QT_DIR=$QT_DIR
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
126 QT_LIBS=$QT_LIBS
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
127 QT_UIC=$QT_UIC
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
128 QT_MOC=$QT_MOC
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
129 QT_RCC=$QT_RCC
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
130 QT_LRELEASE=$QT_LRELEASE
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
131 QT_LUPDATE=$QT_LUPDATE])
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
132 else
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
133 # Qt was not found
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
134 have_qt=no
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
135 QT_CXXFLAGS=
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
136 QT_DIR=
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
137 QT_LIBS=
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
138 QT_UIC=
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
139 QT_MOC=
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
140 QT_RCC=
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
141 QT_LRELEASE=
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
142 QT_LUPDATE=
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
143 AC_MSG_RESULT($have_qt)
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
144 fi
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
145 AC_SUBST(QT_CXXFLAGS)
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
146 AC_SUBST(QT_DIR)
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
147 AC_SUBST(QT_LIBS)
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
148 AC_SUBST(QT_UIC)
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
149 AC_SUBST(QT_MOC)
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
150 AC_SUBST(QT_RCC)
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
151 AC_SUBST(QT_LRELEASE)
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
152 AC_SUBST(QT_LUPDATE)
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
153 AC_SUBST(QMAKE)
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
154
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
155 #### Being paranoid:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
156 if test x"$have_qt" = xyes; then
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
157 AC_MSG_CHECKING(correct functioning of Qt installation)
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
158 AC_CACHE_VAL(ax_cv_qt_test_result,
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
159 [
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
160 cat > ax_qt_test.h << EOF
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
161 #include <qobject.h>
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
162 class Test : public QObject
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
163 {
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
164 Q_OBJECT
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
165 public:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
166 Test() {}
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
167 ~Test() {}
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
168 public slots:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
169 void receive() {}
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
170 signals:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
171 void send();
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
172 };
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
173 EOF
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
174
267
09c5bd74fe93 win32: make builds work again
Paper <paper@paper.us.eu.org>
parents: 264
diff changeset
175 cat > ax_qt_main.cc << EOF
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
176 #include "ax_qt_test.h"
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
177 #include <qapplication.h>
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
178 int main( int argc, char **argv )
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
179 {
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
180 QApplication app( argc, argv );
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
181 Test t;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
182 QObject::connect( &t, SIGNAL(send()), &t, SLOT(receive()) );
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
183 }
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
184 EOF
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
185
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
186 ax_cv_qt_test_result="failure"
267
09c5bd74fe93 win32: make builds work again
Paper <paper@paper.us.eu.org>
parents: 264
diff changeset
187 ax_try_1="$QT_MOC ax_qt_test.h -o moc_ax_qt_test.cc >/dev/null 2>/dev/null"
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
188 AC_TRY_EVAL(ax_try_1)
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
189 if test x"$ac_status" != x0; then
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
190 echo "$ax_err_1" >&AS_MESSAGE_LOG_FD
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
191 echo "configure: could not run $QT_MOC on:" >&AS_MESSAGE_LOG_FD
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
192 cat ax_qt_test.h >&AS_MESSAGE_LOG_FD
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
193 else
267
09c5bd74fe93 win32: make builds work again
Paper <paper@paper.us.eu.org>
parents: 264
diff changeset
194 ax_try_2="$CXX $QT_CXXFLAGS -c $CXXFLAGS -o moc_ax_qt_test.o moc_ax_qt_test.cc >/dev/null 2>/dev/null"
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
195 AC_TRY_EVAL(ax_try_2)
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
196 if test x"$ac_status" != x0; then
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
197 echo "$ax_err_2" >&AS_MESSAGE_LOG_FD
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
198 echo "configure: could not compile:" >&AS_MESSAGE_LOG_FD
267
09c5bd74fe93 win32: make builds work again
Paper <paper@paper.us.eu.org>
parents: 264
diff changeset
199 cat moc_ax_qt_test.cc >&AS_MESSAGE_LOG_FD
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
200 else
267
09c5bd74fe93 win32: make builds work again
Paper <paper@paper.us.eu.org>
parents: 264
diff changeset
201 ax_try_3="$CXX $QT_CXXFLAGS -c $CXXFLAGS -o ax_qt_main.o ax_qt_main.cc >/dev/null 2>/dev/null"
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
202 AC_TRY_EVAL(ax_try_3)
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
203 if test x"$ac_status" != x0; then
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
204 echo "$ax_err_3" >&AS_MESSAGE_LOG_FD
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
205 echo "configure: could not compile:" >&AS_MESSAGE_LOG_FD
267
09c5bd74fe93 win32: make builds work again
Paper <paper@paper.us.eu.org>
parents: 264
diff changeset
206 cat ax_qt_main.cc >&AS_MESSAGE_LOG_FD
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
207 else
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
208 ax_try_4="$CXX -o ax_qt_main ax_qt_main.o moc_ax_qt_test.o $QT_LIBS $LIBS >/dev/null 2>/dev/null"
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
209 AC_TRY_EVAL(ax_try_4)
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
210 if test x"$ac_status" != x0; then
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
211 echo "$ax_err_4" >&AS_MESSAGE_LOG_FD
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
212 else
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
213 ax_cv_qt_test_result="success"
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
214 fi
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
215 fi
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
216 fi
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
217 fi
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
218 ])dnl AC_CACHE_VAL ax_cv_qt_test_result
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
219 AC_MSG_RESULT([$ax_cv_qt_test_result])
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
220 if test x"$ax_cv_qt_test_result" = "xfailure"; then
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
221 AC_MSG_ERROR([Failed to find matching components of a complete
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
222 Qt installation. Try using more options,
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
223 see ./configure --help.])
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
224 fi
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
225
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
226 rm -f ax_qt_test.h moc_ax_qt_test.$ac_ext moc_ax_qt_test.o \
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
227 ax_qt_main.$ac_ext ax_qt_main.o ax_qt_main
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
228 fi
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
229 ])