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