annotate m4/autotroll.m4 @ 250:c130f47f6f48

*: many many changes e.g. the search page is actually implemented now!
author Paper <paper@paper.us.eu.org>
date Sun, 04 Feb 2024 21:17:17 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
250
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
1 # Build Qt apps with the autotools (Autoconf/Automake).
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
2 # M4 macros.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
3 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
4 # This file is part of AutoTroll.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
5 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
6 # Copyright (C) 2006-2018 Benoit Sigoure <benoit.sigoure@lrde.epita.fr>
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
7 # Copyright (C) 2012-2023 Werner Lemberg <wl@gnu.org>
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
8 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
9 # AutoTroll is free software; you can redistribute it and/or modify it
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
10 # under the terms of the GNU General Public License as published by
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
11 # the Free Software Foundation; either version 2 of the License, or
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
12 # (at your option) any later version.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
13 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
14 # This program is distributed in the hope that it will be useful, but
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
17 # General Public License for more details.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
18 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
19 # You should have received a copy of the GNU General Public License
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
20 # along with this program; if not, write to the Free Software
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
22 # 02110-1301, USA.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
23 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
24 # In addition, as a special exception, the copyright holders of
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
25 # AutoTroll give you unlimited permission to copy, distribute and
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
26 # modify the configure scripts that are the output of Autoconf when
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
27 # processing the macros of AutoTroll. You need not follow the terms
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
28 # of the GNU General Public License when using or distributing such
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
29 # scripts, even though portions of the text of AutoTroll appear in
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
30 # them. The GNU General Public License (GPL) does govern all other
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
31 # use of the material that constitutes AutoTroll.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
32 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
33 # This special exception to the GPL applies to versions of AutoTroll
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
34 # released by the copyright holders of AutoTroll. Note that people
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
35 # who make modified versions of AutoTroll are not obligated to grant
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
36 # this special exception for their modified versions; it is their
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
37 # choice whether to do so. The GNU General Public License gives
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
38 # permission to release a modified version without this exception;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
39 # this exception also makes it possible to release a modified version
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
40 # which carries forward this exception.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
41
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
42 # ------------- #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
43 # DOCUMENTATION #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
44 # ------------- #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
45
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
46 # Disclaimer: Tested with Qt 4.2, 4.8, Qt 5.x, and Qt 6 only.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
47 # Feedback welcome. Simply invoke AT_WITH_QT in your configure.ac.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
48 # AT_WITH_QT can take arguments which are documented in depth below.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
49 # The default arguments are equivalent to the default .pro file
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
50 # generated by qmake.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
51 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
52 # Invoking AT_WITH_QT will do the following:
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
53 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
54 # - Add option `--with-qt[=ARG]' to your configure script. Possible
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
55 # values for ARG are `yes' (which is the default) and `no' to
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
56 # enable and disable Qt support, respectively, or a path to the
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
57 # directory which contains the Qt binaries in case you have a
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
58 # non-stardard location.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
59 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
60 # - Add option `--without-qt', which is equivalent to `--with-qt=no'.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
61 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
62 # - On MacOS, add `-spec macx-g++' or `-spec macx-lang' (if `$CXX
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
63 # --version' output contains `clang'). This can be overridden with
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
64 # the QMAKESPEC environment variable, for example
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
65 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
66 # QMAKESPEC='macx-clang' ./configure ...
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
67 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
68 # (The QMAKESPEC variable is honoured for non-MacOS builds also.)
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
69 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
70 # - If Qt support is enabled, define C preprocessor macro HAVE_QT.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
71 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
72 # - Find the programs `qmake', `moc', `uic', and `rcc' and save them
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
73 # in the make variables $(QMAKE), $(MOC), $(UIC), and $(RCC).
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
74 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
75 # - Save the path to Qt binaries in $(QT_PATH).
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
76 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
77 # - Find the flags necessary to compile and link Qt, that is:
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
78 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
79 # * $(QT_DEFINES): -D's defined by qmake.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
80 # * $(QT_CFLAGS): CFLAGS as defined by qmake (C?!)
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
81 # * $(QT_CXXFLAGS): CXXFLAGS as defined by qmake.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
82 # * $(QT_INCPATH): -I's defined by qmake.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
83 # * $(QT_CPPFLAGS): Same as $(QT_DEFINES) + $(QT_INCPATH).
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
84 # * $(QT_LFLAGS): LFLAGS defined by qmake.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
85 # * $(QT_LDFLAGS): Same thing as $(QT_LFLAGS).
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
86 # * $(QT_LIBS): LIBS defined by qmake.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
87 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
88 # - Provide @QT_STATIC_PLUGINS@, which holds some additional C++
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
89 # declarations necessary for linking with static Qt plugins (for
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
90 # dynamic Qt builds it contains a dummy typedef declaration
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
91 # instead). Use this substitution in a `foo.cpp.in' C++ template
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
92 # file or something similar, which must be registered in
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
93 # configure.ac's call to AC_CONFIG_FILES so that a proper `foo.cpp'
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
94 # file gets created. Then compile and link `foo.cpp' with your
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
95 # program in the usual automake way.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
96 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
97 # NOTE: It is not possible to automatically detect whether a Qt
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
98 # release earlier than version 5 is built as a static library! For
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
99 # this reason, @QT_STATIC_PLUGINS@ always contains the dummy
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
100 # typedef declaration if not using Qt5.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
101 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
102 # You *MUST* invoke $(MOC) and/or $(UIC) by yourself where necessary.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
103 # AutoTroll provides you with Makerules to ease this; here is a sample
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
104 # Makefile.am to use with AutoTroll which builds the code given in
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
105 # chapter 7 of the Qt Tutorial
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
106 # (http://doc.trolltech.com/4.2/tutorial-t7.html).
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
107 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
108 # -------------------------------------------------------------------------
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
109 # include $(top_srcdir)/build-aux/autotroll.mk
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
110 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
111 # ACLOCAL_AMFLAGS = -I build-aux
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
112 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
113 # bin_PROGRAMS = lcdrange
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
114 # lcdrange_SOURCES = $(BUILT_SOURCES) lcdrange.cpp lcdrange.h main.cpp
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
115 # lcdrange_CXXFLAGS = $(QT_CXXFLAGS) $(AM_CXXFLAGS)
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
116 # lcdrange_CPPFLAGS = $(QT_CPPFLAGS) $(AM_CPPFLAGS)
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
117 # lcdrange_LDFLAGS = $(QT_LDFLAGS) $(LDFLAGS)
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
118 # lcdrange_LDADD = $(QT_LIBS) $(LDADD)
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
119 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
120 # BUILT_SOURCES = lcdrange.moc.cpp
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
121 # -------------------------------------------------------------------------
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
122 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
123 # Note that your MOC, UIC, and RCC files *MUST* be listed explicitly
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
124 # in BUILT_SOURCES. If you name them properly (e.g. `.moc.cc',
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
125 # `.qrc.cc', `.ui.cc' -- of course you can use `.cpp' or `.cxx' or
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
126 # `.C' rather than `.cc') AutoTroll will build them automagically for
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
127 # you, using implicit rules defined in `autotroll.mk'.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
128
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
129 m4_define([_AUTOTROLL_SERIAL],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
130 [m4_translit([
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
131 # serial 17
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
132 ], [#
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
133 ], [])])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
134
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
135
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
136 m4_ifdef([AX_INSTEAD_IF],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
137 [],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
138 [AC_DEFUN([AX_INSTEAD_IF],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
139 [m4_ifval([$1],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
140 [AC_MSG_WARN([$2])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
141 [$1]],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
142 [AC_MSG_ERROR([$2])])])])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
143
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
144
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
145 # AX_PATH_TOOLS(VARIABLE, PROGS-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], [PATH])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
146 # -------------------------------------------------------------------------
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
147 AC_DEFUN([AX_PATH_TOOLS],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
148 [for ax_tool in $2; do
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
149 AC_PATH_TOOL([$1], [$ax_tool], [], [$4])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
150 test -n "$$1" && break
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
151 done
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
152 m4_ifval([$3], [test -n "$$1" || $1="$3"])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
153 ])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
154
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
155
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
156 m4_pattern_forbid([^AT_])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
157 m4_pattern_forbid([^_AT_])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
158
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
159
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
160 # AT_WITH_QT([QT_modules], [QT_config], [QT_misc], [RUN-IF-FAILED], [RUN-IF-OK])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
161 # ------------------------------------------------------------------------------
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
162 # Enable Qt support and add an option --with-qt to the configure
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
163 # script.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
164 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
165 # The QT_modules argument is optional and defines extra modules to
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
166 # enable or disable (it's equivalent to the QT variable in .pro
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
167 # files). Modules can be specified as follows:
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
168 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
169 # AT_WITH_QT => No argument -> No QT value.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
170 # Qmake sets it to "core gui" by
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
171 # default.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
172 # AT_WITH_QT([xml]) => QT += xml
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
173 # AT_WITH_QT([+xml]) => QT += xml
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
174 # AT_WITH_QT([-gui]) => QT -= gui
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
175 # AT_WITH_QT([xml -gui +sql svg]) => QT += xml sql svg
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
176 # QT -= gui
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
177 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
178 # The QT_config argument is also optional and follows the same
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
179 # convention as QT_modules. Instead of changing the QT variable, it
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
180 # changes the CONFIG variable, which is used to tweak configuration
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
181 # and compiler options.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
182 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
183 # The last argument, QT_misc (also optional) will be copied as-is the
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
184 # .pro file used to guess how to compile Qt apps. You may use it to
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
185 # further tweak the build process of Qt apps if tweaking the QT or
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
186 # CONFIG variables isn't enough for you (for example, to control which
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
187 # static plugins get used).
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
188 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
189 # RUN-IF-FAILED is arbitrary code to execute if Qt cannot be found or
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
190 # if any problem happens. If this argument is omitted, then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
191 # AC_MSG_ERROR will be called. RUN-IF-OK is arbitrary code to execute
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
192 # if Qt was successfully found.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
193
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
194 AC_DEFUN([AT_WITH_QT],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
195 [AC_REQUIRE([AC_CANONICAL_HOST])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
196 AC_REQUIRE([AC_CANONICAL_BUILD])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
197 AC_REQUIRE([AC_PROG_CXX])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
198
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
199 echo "$as_me: this is autotroll.m4[]_AUTOTROLL_SERIAL" \
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
200 >& AS_MESSAGE_LOG_FD
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
201
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
202 # This is a hack to get decent flow control with `break'.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
203 for _qt_ignored in once; do
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
204
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
205 AC_ARG_WITH([qt],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
206 AS_HELP_STRING([--with-qt@<:@=ARG@:>@],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
207 [Qt support. ARG can be `yes' (the default), `no',
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
208 or a path to Qt binaries; if `yes' or empty,
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
209 use PATH and some default directories to find Qt binaries]))
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
210
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
211 if test x"$with_qt" = x"no"; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
212 break
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
213 else
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
214 AC_DEFINE([HAVE_QT],[1],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
215 [Define if the Qt framework is available.])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
216 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
217
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
218 if test x"$with_qt" = x"yes"; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
219 QT_PATH=
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
220 else
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
221 QT_PATH=$with_qt
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
222 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
223
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
224 # Find Qt.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
225 AC_ARG_VAR([QT_PATH],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
226 [path to Qt binaries])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
227 QT_TOOL_PATH=$QT_PATH:$PATH
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
228
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
229 # Find qmake.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
230 AC_ARG_VAR([QMAKE],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
231 [Qt Makefile generator command])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
232 AX_PATH_TOOLS([QMAKE],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
233 [qmake qmake-qt5 qmake-qt4 qmake-qt3],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
234 [missing],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
235 [$QT_TOOL_PATH])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
236 if test x"$QMAKE" = xmissing; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
237 if test x"$with_qt" = "x"; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
238 with_qt="no"
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
239 else
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
240 AX_INSTEAD_IF([$4],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
241 [Cannot find qmake. Try --with-qt=PATH.])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
242 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
243 break
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
244 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
245
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
246 # Find moc (Meta Object Compiler).
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
247 AC_ARG_VAR([MOC],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
248 [Qt Meta Object Compiler command])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
249 AX_PATH_TOOLS([MOC],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
250 [moc moc-qt5 moc-qt4 moc-qt3],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
251 [missing],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
252 [$QT_TOOL_PATH])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
253 if test x"$MOC" = xmissing; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
254 AX_INSTEAD_IF([$4],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
255 [Cannot find moc (Meta Object Compiler). Try --with-qt=PATH.])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
256 break
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
257 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
258
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
259 # Find uic (User Interface Compiler).
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
260 AC_ARG_VAR([UIC],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
261 [Qt User Interface Compiler command])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
262 AX_PATH_TOOLS([UIC],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
263 [uic uic-qt5 uic-qt4 uic-qt3 uic3],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
264 [missing],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
265 [$QT_TOOL_PATH])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
266 if test x"$UIC" = xmissing; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
267 AX_INSTEAD_IF([$4],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
268 [Cannot find uic (User Interface Compiler). Try --with-qt=PATH.])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
269 break
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
270 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
271
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
272 # Find rcc (Qt Resource Compiler).
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
273 AC_ARG_VAR([RCC],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
274 [Qt Resource Compiler command])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
275 AX_PATH_TOOLS([RCC],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
276 [rcc rcc-qt5],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
277 [missing],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
278 [$QT_TOOL_PATH])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
279 if test x"$RCC" = xmissing; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
280 AC_MSG_WARN(
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
281 [Cannot find rcc (Qt Resource Compiler). Try --with-qt=PATH.])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
282 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
283
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
284 AC_ARG_VAR([LUPDATE],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
285 [Qt Linguist updater command])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
286 AX_PATH_TOOLS([LUPDATE],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
287 [lupdate lupdate-qt5 lrelease-qt6],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
288 [missing],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
289 [$QT_TOOL_PATH])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
290 if test "x$LUPDATE" = "xmissing"; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
291 AC_MSG_WARN(
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
292 [Cannot find lupdate (Qt Linguist updater). Try --with-qt=PATH.])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
293 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
294
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
295 AC_ARG_VAR([LRELEASE],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
296 [Qt Linguist compiler command])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
297 AX_PATH_TOOLS([LRELEASE],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
298 [lrelease lrelease-qt5 lrelease-qt6],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
299 [missing],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
300 [$QT_TOOL_PATH])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
301 if test "x$LRELEASE" = "xmissing"; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
302 AC_MSG_WARN(
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
303 [Cannot find lrelease (Qt Linguist compiler). Try --with-qt=PATH.])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
304 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
305
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
306 AC_MSG_CHECKING([whether host operating system is Darwin])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
307 at_darwin=no
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
308 at_qmake_args=
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
309 case $host_os in
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
310 dnl (
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
311 darwin*)
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
312 at_darwin=yes
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
313 ;;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
314 esac
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
315 AC_MSG_RESULT([$at_darwin])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
316
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
317 AC_MSG_CHECKING([whether QMAKESPEC environment variable is set])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
318 if test x"$QMAKESPEC" = x; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
319 if test x"$at_darwin" = xyes; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
320 if $CXX --version | grep -q -i clang; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
321 at_qmake_args='-spec macx-clang'
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
322 else
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
323 at_qmake_args='-spec macx-g++'
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
324 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
325 AC_MSG_RESULT([no, using $at_qmake_args])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
326 else
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
327 AC_MSG_RESULT([no])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
328 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
329 else
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
330 AC_MSG_RESULT([yes, using $QMAKESPEC])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
331 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
332
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
333 # If we don't know the path to Qt, guess it from the path to
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
334 # qmake.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
335 if test x"$QT_PATH" = x; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
336 QT_PATH=`dirname "$QMAKE"`
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
337 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
338 if test x"$QT_PATH" = x; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
339 AX_INSTEAD_IF([$4],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
340 [Cannot find your Qt installation. Try --with-qt=PATH.])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
341 break
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
342 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
343 AC_SUBST([QT_PATH])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
344
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
345 # Get ready to build a test-app with Qt.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
346 if mkdir conftest.dir \
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
347 && cd conftest.dir; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
348 :
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
349 else
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
350 AX_INSTEAD_IF([$4],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
351 [Cannot mkdir conftest.dir or cd to that directory.])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
352 break
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
353 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
354
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
355 cat >conftest.h <<_ASEOF
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
356
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
357 #include <QObject>
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
358
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
359 class Foo: public QObject
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
360 {
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
361 Q_OBJECT;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
362 public:
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
363 Foo();
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
364 ~Foo() {}
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
365 public Q_SLOTS:
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
366 void setValue(int value);
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
367 Q_SIGNALS:
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
368 void valueChanged(int newValue);
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
369 private:
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
370 int value_;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
371 };
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
372
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
373 _ASEOF
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
374
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
375 cat >conftest.cpp <<_ASEOF
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
376
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
377 #include "conftest.h"
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
378
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
379 Foo::Foo()
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
380 : value_ (42)
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
381 {
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
382 connect(this, SIGNAL(valueChanged(int)),
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
383 this, SLOT(setValue(int)));
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
384 }
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
385
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
386 void Foo::setValue(int value)
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
387 {
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
388 value_ = value;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
389 }
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
390
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
391 int main()
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
392 {
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
393 Foo f;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
394 }
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
395
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
396 _ASEOF
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
397
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
398 if $QMAKE -project; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
399 :
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
400 else
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
401 AX_INSTEAD_IF([$4],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
402 [Calling $QMAKE -project failed.])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
403 break
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
404 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
405
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
406 # Find the .pro file generated by qmake.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
407 pro_file=conftest.dir.pro
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
408 test -f $pro_file || pro_file=`echo *.pro`
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
409 if test -f "$pro_file"; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
410 :
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
411 else
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
412 AX_INSTEAD_IF([$4],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
413 [Can't find the .pro file generated by Qmake.])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
414 break
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
415 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
416
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
417 dnl This is for Qt5; for Qt4 it does nothing special.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
418 _AT_TWEAK_PRO_FILE([QT], [+widgets])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
419
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
420 dnl Undocumented qmake: always use absolute paths.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
421 dnl Defaults to 4.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
422 _AT_TWEAK_PRO_FILE([QMAKE_PROJECT_DEPTH], [0])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
423
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
424 dnl Tweak the value of QT in the .pro file if we have a first
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
425 dnl argument.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
426 m4_ifval([$1],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
427 [_AT_TWEAK_PRO_FILE([QT], [$1])])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
428
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
429 dnl Tweak the value of CONFIG in the .pro file if we have a
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
430 dnl second argument.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
431 m4_ifval([$2],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
432 [_AT_TWEAK_PRO_FILE([CONFIG], [$2])])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
433
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
434 m4_ifval([$3],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
435 [ # Add the extra-settings the user wants to set in the .pro
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
436 # file.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
437 echo "$3" >>"$pro_file"
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
438 ])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
439
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
440 echo "$as_me:$LINENO: Invoking $QMAKE on $pro_file" \
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
441 >& AS_MESSAGE_LOG_FD
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
442 sed 's/^/| /' "$pro_file" >& AS_MESSAGE_LOG_FD
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
443
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
444 if $QMAKE $at_qmake_args; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
445 :
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
446 else
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
447 AX_INSTEAD_IF([$4],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
448 [Calling $QMAKE $at_qmake_args failed.])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
449 break
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
450 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
451
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
452 # Try to compile a simple Qt app.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
453 AC_CACHE_CHECK([whether we can build a simple Qt application],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
454 [at_cv_qt_build],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
455 [at_cv_qt_build=ko
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
456 : ${MAKE=make}
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
457
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
458 if $MAKE >& AS_MESSAGE_LOG_FD 2>&1; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
459 at_cv_qt_build='ok, looks like Qt 4, Qt 5, or Qt 6'
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
460 else
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
461 echo "$as_me:$LINENO: Build failed, trying to #include <qobject.h> instead" \
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
462 >& AS_MESSAGE_LOG_FD
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
463 sed 's/<QObject>/<qobject.h>/' conftest.h > tmp.h \
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
464 && mv tmp.h conftest.h
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
465 if $MAKE >& AS_MESSAGE_LOG_FD 2>&1; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
466 at_cv_qt_build='ok, looks like Qt 3'
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
467 else
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
468 # Sometimes (such as on Debian) build will fail because Qt
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
469 # hasn't been installed in debug mode and qmake tries (by
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
470 # default) to build apps in debug mode => Try again in
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
471 # release mode.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
472 echo "$as_me:$LINENO: Build failed, trying to enforce release mode" \
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
473 >& AS_MESSAGE_LOG_FD
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
474
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
475 _AT_TWEAK_PRO_FILE([CONFIG], [+release])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
476
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
477 sed 's/<qobject.h>/<QObject>/' conftest.h > tmp.h \
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
478 && mv tmp.h conftest.h
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
479 if $MAKE >& AS_MESSAGE_LOG_FD 2>&1; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
480 at_cv_qt_build='ok, looks like Qt 4 or Qt 5, release mode forced'
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
481 else
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
482 echo "$as_me:$LINENO: Build failed, trying to #include <qobject.h> instead" \
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
483 >& AS_MESSAGE_LOG_FD
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
484 sed 's/<QObject>/<qobject.h>/' conftest.h > tmp.h \
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
485 && mv tmp.h conftest.h
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
486 if $MAKE >& AS_MESSAGE_LOG_FD 2>&1; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
487 at_cv_qt_build='ok, looks like Qt 3, release mode forced'
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
488 else
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
489 at_cv_qt_build=ko
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
490 echo "$as_me:$LINENO: failed program was:" \
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
491 >& AS_MESSAGE_LOG_FD
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
492 sed 's/^/| /' conftest.h >& AS_MESSAGE_LOG_FD
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
493 echo "$as_me:$LINENO: failed program was:" \
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
494 >& AS_MESSAGE_LOG_FD
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
495 sed 's/^/| /' conftest.cpp >& AS_MESSAGE_LOG_FD
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
496 fi # if make with Qt3-style #include and release mode forced.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
497 fi # if make with Qt4/5-style #include and release mode forced.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
498 fi # if make with Qt3-style #include.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
499 fi # if make with Qt4/5-style #include.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
500 ])dnl end: AC_CACHE_CHECK(at_cv_qt_build)
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
501
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
502 if test x"$at_cv_qt_build" = xko; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
503 AX_INSTEAD_IF([$4],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
504 [Cannot build a test Qt program])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
505 cd ..
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
506 break
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
507 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
508
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
509 QT_VERSION_MAJOR=`echo "$at_cv_qt_build" | sed 's/[[^0-9]]*//g'`
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
510 AC_SUBST([QT_VERSION_MAJOR])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
511
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
512 # This sed filter is applied after an expression of the form
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
513 # /^FOO.*=/!d; it starts by removing the beginning of the line
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
514 # (using the empty regular expression //, which repeats the last
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
515 # regular expression match), removing references to SUBLIBS,
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
516 # removing unnecessary whitespace at the beginning, then prefixing
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
517 # our exported variables with QT_. Note that `LDFLAGS' is
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
518 # intentionally omitted.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
519 qt_sed_filter='s///;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
520 s/$(SUBLIBS)//g;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
521 s/^ *//;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
522 s/\$(DEFINES)/$(QT_DEFINES)/g;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
523 s/\$(CFLAGS)/$(QT_CFLAGS)/g;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
524 s/\$(CXXFLAGS)/$(QT_CXXFLAGS)/g;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
525 s/\$(INCPATH)/$(QT_INCPATH)/g;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
526 s/\$(CPPFLAGS)/$(QT_CPPFLAGS)/g;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
527 s/\$(LFLAGS)/$(QT_LFLAGS)/g;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
528 s/\$(LIBS)/$(QT_LIBS)/g'
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
529
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
530 # Find the Makefile (qmake happens to generate a fake Makefile
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
531 # which invokes a Makefile.Debug or Makefile.Release). If we
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
532 # have both, we'll pick the Makefile.Release. The reason is that
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
533 # this release uses -Os and debug -g. We can override -Os by
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
534 # passing another -O but we usually don't override -g.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
535 if test -f Makefile.Release; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
536 at_mfile='Makefile.Release'
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
537 else
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
538 at_mfile='Makefile'
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
539 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
540 if test -f $at_mfile; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
541 :
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
542 else
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
543 AX_INSTEAD_IF([$4],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
544 [Cannot find the Makefile generated by qmake.])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
545 cd ..
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
546 break
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
547 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
548
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
549 # Find the DEFINES of Qt (should have been named CPPFLAGS).
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
550 AC_CACHE_CHECK([for the DEFINES to use with Qt],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
551 [at_cv_env_QT_DEFINES],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
552 [at_cv_env_QT_DEFINES=`sed "/^DEFINES@<:@^A-Z=@:>@*=/!d;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
553 $qt_sed_filter" $at_mfile`])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
554 AC_SUBST([QT_DEFINES],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
555 [$at_cv_env_QT_DEFINES])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
556
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
557 # Find the CFLAGS of Qt. (We can use Qt in C?!)
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
558 AC_CACHE_CHECK([for the CFLAGS to use with Qt],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
559 [at_cv_env_QT_CFLAGS],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
560 [at_cv_env_QT_CFLAGS=`sed "/^CFLAGS@<:@^A-Z=@:>@*=/!d;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
561 $qt_sed_filter" $at_mfile`])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
562 AC_SUBST([QT_CFLAGS],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
563 [$at_cv_env_QT_CFLAGS])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
564
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
565 # Find the CXXFLAGS of Qt.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
566 AC_CACHE_CHECK([for the CXXFLAGS to use with Qt],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
567 [at_cv_env_QT_CXXFLAGS],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
568 [at_cv_env_QT_CXXFLAGS=`sed "/^CXXFLAGS@<:@^A-Z=@:>@*=/!d;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
569 $qt_sed_filter" $at_mfile`])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
570 AC_SUBST([QT_CXXFLAGS],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
571 [$at_cv_env_QT_CXXFLAGS])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
572
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
573 # Find the INCPATH of Qt.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
574 AC_CACHE_CHECK([for the INCPATH to use with Qt],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
575 [at_cv_env_QT_INCPATH],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
576 [at_cv_env_QT_INCPATH=`sed "/^INCPATH@<:@^A-Z=@:>@*=/!d;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
577 $qt_sed_filter" $at_mfile`])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
578 AC_SUBST([QT_INCPATH],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
579 [$at_cv_env_QT_INCPATH])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
580
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
581 AC_SUBST([QT_CPPFLAGS],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
582 ["$at_cv_env_QT_DEFINES $at_cv_env_QT_INCPATH"])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
583
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
584 # Find the LFLAGS of Qt (should have been named LDFLAGS).
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
585 AC_CACHE_CHECK([for the LDFLAGS to use with Qt],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
586 [at_cv_env_QT_LDFLAGS],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
587 [at_cv_env_QT_LDFLAGS=`sed "/^LFLAGS@<:@^A-Z=@:>@*=/!d;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
588 $qt_sed_filter" $at_mfile`])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
589 AC_SUBST([QT_LFLAGS],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
590 [$at_cv_env_QT_LDFLAGS])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
591 AC_SUBST([QT_LDFLAGS],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
592 [$at_cv_env_QT_LDFLAGS])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
593
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
594 # Find the LIBS of Qt.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
595 AC_CACHE_CHECK([for the LIBS to use with Qt],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
596 [at_cv_env_QT_LIBS],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
597 [at_cv_env_QT_LIBS=`sed "/^LIBS@<:@^A-Z@:>@*=/!d;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
598 $qt_sed_filter" $at_mfile`
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
599 if test x$at_darwin = xyes; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
600 # Fix QT_LIBS: as of today Libtool (GNU Libtool 1.5.23a)
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
601 # doesn't handle -F properly. The "bug" has been fixed on 22
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
602 # October 2006 by Peter O'Gorman but we provide backward
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
603 # compatibility here.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
604 at_cv_env_QT_LIBS=`echo "$at_cv_env_QT_LIBS" \
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
605 | sed 's/^-F/-Wl,-F/;
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
606 s/ -F/ -Wl,-F/g'`
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
607 fi])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
608 AC_SUBST([QT_LIBS],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
609 [$at_cv_env_QT_LIBS])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
610
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
611 # We can't use AC_CACHE_CHECK for data that contains newlines.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
612 AC_MSG_CHECKING([for necessary static plugin code])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
613 # find static plugin data generated by qmake
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
614 if test -f conftest.dir_plugin_import.cpp; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
615 QT_STATIC_PLUGINS=`cat conftest.dir_plugin_import.cpp`
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
616 else
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
617 QT_STATIC_PLUGINS="\
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
618 // We have Qt earlier than version 5 or a dynamic build.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
619 // Provide dummy typedef to avoid empty source code.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
620 typedef int _qt_not_a_static_build;"
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
621 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
622 AC_SUBST([QT_STATIC_PLUGINS])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
623 AM_SUBST_NOTMAKE([QT_STATIC_PLUGINS])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
624 AC_MSG_RESULT([$QT_STATIC_PLUGINS])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
625
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
626 cd .. && rm -rf conftest.dir
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
627
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
628 # Run the user code
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
629 $5
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
630
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
631 done # end hack (useless FOR to be able to use break)
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
632 ])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
633
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
634
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
635 # AT_REQUIRE_QT_VERSION(QT_version, [RUN-IF-FAILED], [RUN-IF-OK])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
636 # ---------------------------------------------------------------
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
637 # Check (using qmake) that Qt's version "matches" QT_version. Must be
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
638 # run *AFTER* AT_WITH_QT. Requires autoconf 2.60.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
639 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
640 # This macro is ignored if Qt support has been disabled (using
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
641 # `--with-qt=no' or `--without-qt').
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
642 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
643 # RUN-IF-FAILED is arbitrary code to execute if Qt cannot be found or
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
644 # if any problem happens. If this argument is omitted, then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
645 # AC_MSG_ERROR will be called. RUN-IF-OK is arbitrary code to execute
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
646 # if Qt was successfully found.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
647 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
648 # This macro provides the Qt version in $(QT_VERSION).
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
649
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
650 AC_DEFUN([AT_REQUIRE_QT_VERSION],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
651 [AC_PREREQ([2.60])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
652
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
653 # This is a hack to get decent flow control with `break'.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
654 for _qt_ignored in once; do
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
655
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
656 if test x"$with_qt" = x"no"; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
657 break
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
658 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
659
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
660 if test x"$QMAKE" = x; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
661 AX_INSTEAD_IF([$2],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
662 [\$QMAKE is empty. Did you invoke AT@&t@_WITH_QT before AT@&t@_REQUIRE_QT_VERSION?])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
663 break
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
664 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
665
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
666 AC_CACHE_CHECK([for Qt's version],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
667 [at_cv_QT_VERSION],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
668 [echo "$as_me:$LINENO: Running $QMAKE --version:" \
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
669 >& AS_MESSAGE_LOG_FD
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
670 $QMAKE --version >& AS_MESSAGE_LOG_FD 2>&1
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
671 qmake_version_sed=['/^.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/!d;s//\1/']
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
672 at_cv_QT_VERSION=`$QMAKE --version 2>&1 \
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
673 | sed "$qmake_version_sed"`])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
674 if test x"$at_cv_QT_VERSION" = x; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
675 AX_INSTEAD_IF([$2],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
676 [Cannot detect Qt's version.])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
677 break
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
678 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
679 AC_SUBST([QT_VERSION],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
680 [$at_cv_QT_VERSION])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
681 AS_VERSION_COMPARE([$QT_VERSION], [$1],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
682 [AX_INSTEAD_IF([$2],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
683 [This package requires Qt $1 or above.])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
684 break])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
685
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
686 # Run the user code
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
687 $3
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
688
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
689 done # end hack (useless FOR to be able to use break)
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
690 ])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
691
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
692
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
693 # _AT_TWEAK_PRO_FILE(QT_VAR, VALUE)
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
694 # ---------------------------------
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
695 # @internal. Tweak the variable QT_VAR in the .pro file. VALUE is an
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
696 # IFS-separated list of values, and each value is rewritten as
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
697 # follows:
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
698 #
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
699 # +value => QT_VAR += value
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
700 # -value => QT_VAR -= value
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
701 # value => QT_VAR += value
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
702
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
703 AC_DEFUN([_AT_TWEAK_PRO_FILE],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
704 [ # Tweak the value of $1 in the .pro file for $2.
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
705 qt_conf=''
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
706 for at_mod in $2; do
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
707 at_mod=`echo "$at_mod" | sed 's/^-//; tough
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
708 s/^+//; beef
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
709 :ough
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
710 s/^/$1 -= /;n
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
711 :eef
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
712 s/^/$1 += /'`
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
713 qt_conf="\
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
714 $qt_conf
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
715 $at_mod"
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
716 done
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
717 echo "$qt_conf" | sed 1d >>"$pro_file"
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
718 ])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
719
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents:
diff changeset
720 # eof