annotate m4/m4_ax_have_qt.m4 @ 237:a7d0d543b334

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