Mercurial > minori
annotate m4/m4_ax_have_qt.m4 @ 242:82470f83f0c2
autotools: make windows build work
also, I've added back the method I made for getting the vars as
variables rather than separate files, so less clutter in tmp folders :)
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Mon, 22 Jan 2024 19:06:23 -0800 |
parents | 06d6c351925c |
children |
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> |
242
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
52 # Copyright (c) 2024 Paper <mrpapersonic@gmail.com> |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
53 # |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
54 # 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
|
55 # 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
|
56 # 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
|
57 # warranty. |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
58 |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
59 #serial 25 |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
60 |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
61 AU_ALIAS([BNV_HAVE_QT], [AX_HAVE_QT]) |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
62 AC_DEFUN([AX_HAVE_QT], |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
63 [ |
242
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
64 AC_REQUIRE([AC_PROG_CXX]) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
65 AC_REQUIRE([AC_PATH_X]) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
66 AC_REQUIRE([AC_PATH_XTRA]) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
67 # openSUSE leap 15.3 installs qmake-qt5, not qmake, for example. |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
68 # Store the full name (like qmake-qt5) into QMAKE |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
69 # and the specifier (like -qt5 or empty) into am_have_qt_qmexe_suff. |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
70 AC_ARG_VAR([QMAKE],"Qt make tool") |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
71 AC_CHECK_TOOLS([QMAKE],[qmake qmake-qt6 qmake-qt5],[false]) |
240
6ffe42286978
m4: use different method for CXXFLAGS
Paper <paper@paper.us.eu.org>
parents:
237
diff
changeset
|
72 |
242
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
73 AC_MSG_CHECKING(for Qt) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
74 am_have_qt_qmexe_suff=`echo $QMAKE | sed 's,^.*qmake,,'` |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
75 # If we have Qt5 or later in the path, we're golden |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
76 ver=`$QMAKE --version | grep -o "Qt version ."` |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
77 |
242
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
78 if test "$ver" ">" "Qt version 4"; then |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
79 have_qt=yes |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
80 # This pro file dumps qmake's variables, but it only works on Qt 5 or later |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
81 am_have_qt_dir=`mktemp -d` |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
82 am_have_qt_pro="$am_have_qt_dir/test.pro" |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
83 am_have_qt_stash="$am_have_qt_dir/.qmake.stash" |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
84 am_have_qt_makefile="$am_have_qt_dir/Makefile" |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
85 # http://qt-project.org/doc/qt-5/qmake-variable-reference.html#qt |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
86 cat > $am_have_qt_pro << EOF |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
87 win32 { |
242
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
88 CONFIG -= debug_and_release |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
89 CONFIG += release |
240
6ffe42286978
m4: use different method for CXXFLAGS
Paper <paper@paper.us.eu.org>
parents:
237
diff
changeset
|
90 } |
242
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
91 |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
92 CONFIG += sdk_no_version_check |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
93 |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
94 # use absolute paths, useful on windows |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
95 # where qmake really loves giving relative paths |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
96 QMAKE_PROJECT_DEPTH = 0 |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
97 |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
98 # commented out all the modules we don't use |
237 | 99 #qtHaveModule(axcontainer): QT += axcontainer |
100 #qtHaveModule(axserver): QT += axserver | |
101 #qtHaveModule(concurrent): QT += concurrent | |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
102 qtHaveModule(core): QT += core |
237 | 103 #qtHaveModule(dbus): QT += dbus |
104 #qtHaveModule(declarative): QT += declarative | |
105 #qtHaveModule(designer): QT += designer | |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
106 qtHaveModule(gui): QT += gui |
237 | 107 #qtHaveModule(help): QT += help |
108 #qtHaveModule(multimedia): QT += multimedia | |
109 #qtHaveModule(multimediawidgets): QT += multimediawidgets | |
110 #qtHaveModule(network): QT += network | |
111 #qtHaveModule(opengl): QT += opengl | |
112 #qtHaveModule(printsupport): QT += printsupport | |
113 #qtHaveModule(qml): QT += qml | |
114 #qtHaveModule(qmltest): QT += qmltest | |
115 #qtHaveModule(x11extras): QT += x11extras | |
116 #qtHaveModule(script): QT += script | |
117 #qtHaveModule(scripttools): QT += scripttools | |
118 #qtHaveModule(sensors): QT += sensors | |
119 #qtHaveModule(serialport): QT += serialport | |
120 #qtHaveModule(sql): QT += sql | |
121 #qtHaveModule(svg): QT += svg | |
122 #qtHaveModule(testlib): QT += testlib | |
123 #qtHaveModule(uitools): QT += uitools | |
124 #qtHaveModule(webkit): QT += webkit | |
125 #qtHaveModule(webkitwidgets): QT += webkitwidgets | |
126 #qtHaveModule(xml): QT += xml | |
127 #qtHaveModule(xmlpatterns): QT += xmlpatterns | |
240
6ffe42286978
m4: use different method for CXXFLAGS
Paper <paper@paper.us.eu.org>
parents:
237
diff
changeset
|
128 qtHaveModule(widgets): QT += widgets |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
129 percent.target = % |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
130 percent.commands = @echo -n "\$(\$(@))\ " |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
131 QMAKE_EXTRA_TARGETS += percent |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
132 EOF |
242
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
133 am_have_qt_makefile_cxxflags=`cat << EOF |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
134 include $am_have_qt_makefile |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
135 |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
136 VAR: |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
137 @echo \\$(CXXFLAGS) \\$(INCPATH) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
138 EOF` |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
139 am_have_qt_makefile_libs=`cat << EOF |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
140 include $am_have_qt_makefile |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
141 |
242
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
142 VAR: |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
143 @echo \\$(LIBS) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
144 EOF` |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
145 $QMAKE "$am_have_qt_pro" -o "$am_have_qt_makefile" |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
146 QT_CXXFLAGS=`cd $am_have_qt_dir; echo "\$am_have_qt_makefile_cxxflags" | make -s -f - VAR` |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
147 QT_LIBS=`cd $am_have_qt_dir; echo "\$am_have_qt_makefile_libs" | make -s -f - VAR` |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
148 rm $am_have_qt_pro $am_have_qt_stash $am_have_qt_makefile |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
149 rmdir $am_have_qt_dir |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
150 |
242
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
151 # Look for specific tools in $PATH |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
152 QT_MOC=`which moc$am_have_qt_qmexe_suff` |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
153 QT_UIC=`which uic$am_have_qt_qmexe_suff` |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
154 QT_RCC=`which rcc$am_have_qt_qmexe_suff` |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
155 QT_LRELEASE=`which lrelease$am_have_qt_qmexe_suff` |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
156 QT_LUPDATE=`which lupdate$am_have_qt_qmexe_suff` |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
157 |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
158 # Get Qt version from qmake |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
159 QT_DIR=`$QMAKE --version | grep -o -E /.+` |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
160 |
242
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
161 # All variables are defined, report the result |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
162 AC_MSG_RESULT([$have_qt: |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
163 QT_CXXFLAGS=$QT_CXXFLAGS |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
164 QT_DIR=$QT_DIR |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
165 QT_LIBS=$QT_LIBS |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
166 QT_UIC=$QT_UIC |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
167 QT_MOC=$QT_MOC |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
168 QT_RCC=$QT_RCC |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
169 QT_LRELEASE=$QT_LRELEASE |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
170 QT_LUPDATE=$QT_LUPDATE]) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
171 else |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
172 # Qt was not found |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
173 have_qt=no |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
174 QT_CXXFLAGS= |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
175 QT_DIR= |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
176 QT_LIBS= |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
177 QT_UIC= |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
178 QT_MOC= |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
179 QT_RCC= |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
180 QT_LRELEASE= |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
181 QT_LUPDATE= |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
182 AC_MSG_RESULT($have_qt) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
183 fi |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
184 AC_SUBST(QT_CXXFLAGS) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
185 AC_SUBST(QT_DIR) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
186 AC_SUBST(QT_LIBS) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
187 AC_SUBST(QT_UIC) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
188 AC_SUBST(QT_MOC) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
189 AC_SUBST(QT_RCC) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
190 AC_SUBST(QT_LRELEASE) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
191 AC_SUBST(QT_LUPDATE) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
192 AC_SUBST(QMAKE) |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
193 |
242
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
194 #### Being paranoid: |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
195 if test x"$have_qt" = xyes; then |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
196 AC_MSG_CHECKING(correct functioning of Qt installation) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
197 AC_CACHE_VAL(ax_cv_qt_test_result, |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
198 [ |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
199 cat > ax_qt_test.h << EOF |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
200 #include <qobject.h> |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
201 class Test : public QObject |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
202 { |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
203 Q_OBJECT |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
204 public: |
242
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
205 Test() {} |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
206 ~Test() {} |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
207 public slots: |
242
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
208 void receive() {} |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
209 signals: |
242
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
210 void send(); |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
211 }; |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
212 EOF |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
213 |
242
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
214 cat > ax_qt_main.$ac_ext << EOF |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
215 #include "ax_qt_test.h" |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
216 #include <qapplication.h> |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
217 int main( int argc, char **argv ) |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
218 { |
242
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
219 QApplication app( argc, argv ); |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
220 Test t; |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
221 QObject::connect( &t, SIGNAL(send()), &t, SLOT(receive()) ); |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
222 } |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
223 EOF |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
224 |
242
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
225 ax_cv_qt_test_result="failure" |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
226 ax_try_1="$QT_MOC ax_qt_test.h -o moc_ax_qt_test.$ac_ext >/dev/null 2>/dev/null" |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
227 AC_TRY_EVAL(ax_try_1) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
228 if test x"$ac_status" != x0; then |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
229 echo "$ax_err_1" >&AS_MESSAGE_LOG_FD |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
230 echo "configure: could not run $QT_MOC on:" >&AS_MESSAGE_LOG_FD |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
231 cat ax_qt_test.h >&AS_MESSAGE_LOG_FD |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
232 else |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
233 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" |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
234 AC_TRY_EVAL(ax_try_2) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
235 if test x"$ac_status" != x0; then |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
236 echo "$ax_err_2" >&AS_MESSAGE_LOG_FD |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
237 echo "configure: could not compile:" >&AS_MESSAGE_LOG_FD |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
238 cat moc_ax_qt_test.$ac_ext >&AS_MESSAGE_LOG_FD |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
239 else |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
240 ax_try_3="$CXX $QT_CXXFLAGS -c $CXXFLAGS -o ax_qt_main.o ax_qt_main.$ac_ext >/dev/null 2>/dev/null" |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
241 AC_TRY_EVAL(ax_try_3) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
242 if test x"$ac_status" != x0; then |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
243 echo "$ax_err_3" >&AS_MESSAGE_LOG_FD |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
244 echo "configure: could not compile:" >&AS_MESSAGE_LOG_FD |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
245 cat ax_qt_main.$ac_ext >&AS_MESSAGE_LOG_FD |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
246 else |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
247 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" |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
248 AC_TRY_EVAL(ax_try_4) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
249 if test x"$ac_status" != x0; then |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
250 echo "$ax_err_4" >&AS_MESSAGE_LOG_FD |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
251 else |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
252 ax_cv_qt_test_result="success" |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
253 fi |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
254 fi |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
255 fi |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
256 fi |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
257 ])dnl AC_CACHE_VAL ax_cv_qt_test_result |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
258 AC_MSG_RESULT([$ax_cv_qt_test_result]) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
259 if test x"$ax_cv_qt_test_result" = "xfailure"; then |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
260 AC_MSG_ERROR([Failed to find matching components of a complete |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
261 Qt installation. Try using more options, |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
262 see ./configure --help.]) |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
263 fi |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
264 |
242
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
265 rm -f ax_qt_test.h moc_ax_qt_test.$ac_ext moc_ax_qt_test.o \ |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
266 ax_qt_main.$ac_ext ax_qt_main.o ax_qt_main |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
267 fi |
82470f83f0c2
autotools: make windows build work
Paper <paper@paper.us.eu.org>
parents:
241
diff
changeset
|
268 ]) |