1 # Build Qt apps with the autotools (Autoconf/Automake).
3 # This file is part of AutoTroll.
4 # Copyright (C) 2006-2013 Benoit Sigoure <benoit.sigoure@lrde.epita.fr>
6 # AutoTroll is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
21 # In addition, as a special exception, the copyright holders of AutoTroll
22 # give you unlimited permission to copy, distribute and modify the configure
23 # scripts that are the output of Autoconf when processing the macros of
24 # AutoTroll. You need not follow the terms of the GNU General Public License
25 # when using or distributing such scripts, even though portions of the text of
26 # AutoTroll appear in them. The GNU General Public License (GPL) does govern
27 # all other use of the material that constitutes AutoTroll.
29 # This special exception to the GPL applies to versions of AutoTroll
30 # released by the copyright holders of AutoTroll. Note that people who make
31 # modified versions of AutoTroll are not obligated to grant this special
32 # exception for their modified versions; it is their choice whether to do so.
33 # The GNU General Public License gives permission to release a modified version
34 # without this exception; this exception also makes it possible to release a
35 # modified version which carries forward this exception.
41 # Disclaimer: Tested with Qt 4.2 and 4.8 only. Feedback welcome.
42 # Simply invoke AT_WITH_QT in your configure.ac. AT_WITH_QT can take
43 # arguments which are documented in depth below. The default arguments are
44 # equivalent to the default .pro file generated by qmake.
46 # Invoking AT_WITH_QT will do the following:
47 # - Add option `--with-qt[=ARG]' to your configure script. Possible
48 # values for ARG are `yes' (which is the default) and `no' to
49 # enable and disable Qt support, respectively, or a path to the
50 # directory which contains the Qt binaries in case you have a
51 # non-stardard location.
52 # - Add option `--without-qt', which is equivalent to `--with-qt=no'.
53 # - If Qt support is enabled, define C preprocessor macro HAVE_QT.
54 # - Find the programs `qmake', `moc', `uic', and `rcc' and save them
55 # in the make variables $(QMAKE), $(MOC), $(UIC), and $(RCC).
56 # - Save the path to Qt binaries in $(QT_PATH).
57 # - Find the flags necessary to compile and link Qt, that is:
58 # * $(QT_DEFINES): -D's defined by qmake.
59 # * $(QT_CFLAGS): CFLAGS as defined by qmake (C?!)
60 # * $(QT_CXXFLAGS): CXXFLAGS as defined by qmake.
61 # * $(QT_INCPATH): -I's defined by qmake.
62 # * $(QT_CPPFLAGS): Same as $(QT_DEFINES) + $(QT_INCPATH)
63 # * $(QT_LFLAGS): LFLAGS defined by qmake.
64 # * $(QT_LDFLAGS): Same thing as $(QT_LFLAGS).
65 # * $(QT_LIBS): LIBS defined by qmake.
67 # You *MUST* invoke $(MOC) and/or $(UIC) where necessary. AutoTroll provides
68 # you with Makerules to ease this, here is a sample Makefile.am to use with
69 # AutoTroll which builds the code given in the chapter 7 of the Qt Tutorial:
70 # http://doc.trolltech.com/4.2/tutorial-t7.html
72 # -------------------------------------------------------------------------
73 # include $(top_srcdir)/build-aux/autotroll.mk
75 # ACLOCAL_AMFLAGS = -I build-aux
77 # bin_PROGRAMS = lcdrange
78 # lcdrange_SOURCES = $(BUILT_SOURCES) lcdrange.cpp lcdrange.h main.cpp
79 # lcdrange_CXXFLAGS = $(QT_CXXFLAGS) $(AM_CXXFLAGS)
80 # lcdrange_CPPFLAGS = $(QT_CPPFLAGS) $(AM_CPPFLAGS)
81 # lcdrange_LDFLAGS = $(QT_LDFLAGS) $(LDFLAGS)
82 # lcdrange_LDADD = $(QT_LIBS) $(LDADD)
84 # BUILT_SOURCES = lcdrange.moc.cpp
85 # -------------------------------------------------------------------------
87 # Note that your MOC, UIC and QRC files *MUST* be listed manually in
88 # BUILT_SOURCES. If you name them properly (eg: .moc.cc, .qrc.cc, .ui.cc -- of
89 # course you can use .cpp or .cxx or .C rather than .cc) AutoTroll will build
90 # them automagically for you (using implicit rules defined in autotroll.mk).
92 m4_define([_AUTOTROLL_SERIAL], [m4_translit([
98 m4_ifdef([AX_INSTEAD_IF], [],
99 [AC_DEFUN([AX_INSTEAD_IF],
101 [AC_MSG_WARN([$2]); [$1]],
102 [AC_MSG_ERROR([$2])])])])
105 # AX_PATH_TOOLS(VARIABLE, PROGS-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], [PATH])
106 # -------------------------------------------------------------------------
107 AC_DEFUN([AX_PATH_TOOLS],
108 [for ax_tool in $2; do
109 AC_PATH_TOOL([$1], [$ax_tool], , [$4])
110 test -n "$$1" && break
112 m4_ifval([$3], [test -n "$$1" || $1="$3"])
115 m4_pattern_forbid([^AT_])dnl
116 m4_pattern_forbid([^_AT_])dnl
118 # AT_WITH_QT([QT_modules], [QT_config], [QT_misc], [RUN-IF-FAILED], [RUN-IF-OK])
119 # ------------------------------------------------------------------------------
120 # Enable Qt support and add an option --with-qt to the configure script.
122 # The QT_modules argument is optional and defines extra modules to enable or
123 # disable (it's equivalent to the QT variable in .pro files). Modules can be
124 # specified as follows:
126 # AT_WITH_QT => No argument -> No QT value.
127 # Qmake sets it to "core gui" by default.
128 # AT_WITH_QT([xml]) => QT += xml
129 # AT_WITH_QT([+xml]) => QT += xml
130 # AT_WITH_QT([-gui]) => QT -= gui
131 # AT_WITH_QT([xml -gui +sql svg]) => QT += xml sql svg
134 # The QT_config argument is also optional and follows the same convention as
135 # QT_modules. Instead of changing the QT variable, it changes the CONFIG
136 # variable, which is used to tweak configuration and compiler options.
138 # The last argument, QT_misc (also optional) will be copied as-is the .pro
139 # file used to guess how to compile Qt apps. You may use it to further tweak
140 # the build process of Qt apps if tweaking the QT or CONFIG variables isn't
143 # RUN-IF-FAILED is arbitrary code to execute if Qt cannot be found or if any
144 # problem happens. If this argument is omitted, then AC_MSG_ERROR will be
145 # called. RUN-IF-OK is arbitrary code to execute if Qt was successfully found.
146 AC_DEFUN([AT_WITH_QT],
147 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
148 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
149 AC_REQUIRE([AC_PROG_CXX])dnl
150 echo "$as_me: this is autotroll.m4[]_AUTOTROLL_SERIAL" >&AS_MESSAGE_LOG_FD
152 test x"$TROLL" != x && echo 'ViM rox emacs.'
154 dnl Memo: AC_ARG_WITH(package, help-string, [if-given], [if-not-given])
156 AS_HELP_STRING([--with-qt@<:@=ARG@:>@],
157 [Qt support. ARG can be `yes' (the default), `no',
158 or a path to Qt binaries; if `yes' or empty,
159 use PATH and some default directories to find Qt binaries]))
161 if test x"$with_qt" = x"no"; then
164 AC_DEFINE([HAVE_QT],[1],
165 [Define if the Qt framework is available.])
168 if test x"$with_qt" = x"yes"; then
174 # this is a hack to get decent flow control with 'break'
175 for _qt_ignored in once; do
178 AC_ARG_VAR([QT_PATH], [Path to the Qt binaries])
179 if test -d /usr/local/Trolltech; then
180 # Try to find the latest version.
181 tmp_qt_paths=`echo /usr/local/Trolltech/*/bin | tr ' ' '\n' | sort -nr \
182 | xargs | sed 's/ */:/g'`
184 # Path to which recent MacPorts (~v1.7) install Qt4.
185 test -d /opt/local/libexec/qt4-mac/bin \
186 && tmp_qt_paths="$tmp_qt_paths:/opt/local/libexec/qt4-mac/bin"
189 AC_ARG_VAR([QMAKE], [Qt Makefile generator command])
190 AX_PATH_TOOLS([QMAKE], [qmake qmake-qt5 qmake-qt4 qmake-qt3], [missing],
191 [$QT_DIR:$QT_PATH:$PATH:$tmp_qt_paths])
192 if test x"$QMAKE" = xmissing; then
193 AX_INSTEAD_IF([$4], [Cannot find qmake. Try --with-qt=PATH.])
197 # Find moc (Meta Object Compiler).
198 AC_ARG_VAR([MOC], [Qt Meta Object Compiler command])
199 AX_PATH_TOOLS([MOC], [moc moc-qt5 moc-qt4 moc-qt3], [missing],
200 [$QT_PATH:$PATH:$tmp_qt_paths])
201 if test x"$MOC" = xmissing; then
203 [Cannot find moc (Meta Object Compiler). Try --with-qt=PATH.])
207 # Find uic (User Interface Compiler).
208 AC_ARG_VAR([UIC], [Qt User Interface Compiler command])
209 AX_PATH_TOOLS([UIC], [uic uic-qt5 uic-qt4 uic-qt3 uic3], [missing],
210 [$QT_PATH:$PATH:$tmp_qt_paths])
211 if test x"$UIC" = xmissing; then
213 [Cannot find uic (User Interface Compiler). Try --with-qt=PATH.])
217 # Find rcc (Qt Resource Compiler).
218 AC_ARG_VAR([RCC], [Qt Resource Compiler command])
219 AX_PATH_TOOLS([RCC], [rcc rcc-qt5], [false], [$QT_PATH:$PATH:$tmp_qt_paths])
220 if test x"$UIC" = xfalse; then
221 AC_MSG_WARN([Cannot find rcc (Qt Resource Compiler). Try --with-qt=PATH.])
224 AC_MSG_CHECKING([whether host operating system is Darwin])
230 at_qmake_args='-spec macx-g++'
233 AC_MSG_RESULT([$at_darwin])
235 # If we don't know the path to Qt, guess it from the path to qmake.
236 if test x"$QT_PATH" = x; then
237 QT_PATH=`dirname "$QMAKE"`
239 if test x"$QT_PATH" = x; then
241 [Cannot find your Qt installation. Try --with-qt=PATH.])
246 # Get ready to build a test-app with Qt.
247 if mkdir conftest.dir && cd conftest.dir; then :; else
248 AX_INSTEAD_IF([$4], [Cannot mkdir conftest.dir or cd to that directory.])
252 cat >conftest.h <<_ASEOF
255 class Foo: public QObject
262 void setValue(int value);
264 void valueChanged(int newValue);
270 cat >conftest.cpp <<_ASEOF
271 #include "conftest.h"
275 connect(this, SIGNAL(valueChanged(int)), this, SLOT(setValue(int)));
278 void Foo::setValue(int value)
288 if $QMAKE -project; then :; else
289 AX_INSTEAD_IF([$4], [Calling $QMAKE -project failed.])
293 # Find the .pro file generated by qmake.
294 pro_file='conftest.dir.pro'
295 test -f $pro_file || pro_file=`echo *.pro`
296 if test -f "$pro_file"; then :; else
297 AX_INSTEAD_IF([$4], [Can't find the .pro file generated by Qmake.])
301 dnl This is for Qt5; for Qt4 it does nothing special.
302 _AT_TWEAK_PRO_FILE([QT], [+widgets])
304 dnl Tweak the value of QT in the .pro if have been the 1st arg.
305 m4_ifval([$1], [_AT_TWEAK_PRO_FILE([QT], [$1])])
307 dnl Tweak the value of CONFIG in the .pro if have been given a 2nd arg.
308 m4_ifval([$2], [_AT_TWEAK_PRO_FILE([CONFIG], [$2])])
311 [ # Add the extra-settings the user wants to set in the .pro
312 echo "$3" >>"$pro_file"
315 echo "$as_me:$LINENO: Invoking $QMAKE on $pro_file" >&AS_MESSAGE_LOG_FD
316 sed 's/^/| /' "$pro_file" >&AS_MESSAGE_LOG_FD
318 if $QMAKE $at_qmake_args; then :; else
319 AX_INSTEAD_IF([$4], [Calling $QMAKE $at_qmake_args failed.])
323 # QMake has a very annoying misfeature: sometimes it generates Makefiles
324 # where all the references to the files from the Qt installation are
325 # relative. We can't use them as-is because if we take, say, a
326 # -I../../usr/include/Qt from that Makefile, the flag is invalid as soon
327 # as we use it in another (sub) directory. So what this perl pass does is
328 # that it rewrite all relative paths to absolute paths. Another problem
329 # when building on Cygwin is that QMake mixes paths with blackslashes and
330 # forward slashes and paths must be handled with extra care because of the
331 # stupid Windows drive letters.
332 echo "$as_me:$LINENO: fixing the Makefiles:" Makefile* >&AS_MESSAGE_LOG_FD
335 use Cwd qw(cwd abs_path);
336 # This variable is useful on Cygwin for the following reason: Say that you are
337 # in `/' (that is, in fact you are in C:/cygwin, or something like that) if you
338 # `cd ..' then obviously you remain in `/' (that is in C:/cygwin). QMake
339 # generates paths that are relative to C:/ (or another driver letter, whatever)
340 # so the trick to get the `..' resolved properly is to prepend the absolute
341 # path of the current working directory in a Windows-style. C:/cygwin/../ will
342 # properly become C:/.
348 if ($^O eq "cygwin") {
351 $d = `cygpath --mixed '$d'`;
362 $p = `cygpath --mixed '$p'`;
366 # Do not use abs_path on Cygwin: it incorrectly resolves the paths that are
367 # relative to C:/ rather than `/'.
375 # Only useful on Cygwin.
381 $p = `cygpath --mixed '$p'`;
388 foreach my $mk (@ARGV)
391 open(MK, $mk) or die("open $mk: $!");
393 my $file = join("", <MK>);
394 close(MK) or die("close $mk: $!");
395 rename $mk, $mk . "~" or die("rename $mk: $!");
396 $file =~ s{(?:\.\.[\\/])+(?:[^"'\s:]+)}{rel2abs($&)}gse;
397 $file =~ s{(?:[a-zA-Z]:[\\/])?(?:[^"\s]+\\[^"\s:]+)+}
398 {back2forward($&)}gse if $cygwin;
399 open(MK, ">", $mk) or die("open >$mk: $!");
401 close(MK) or die("close >$mk: $!");
402 print "$mk: updated $r2a relative paths and $b2f backslash-style paths\n";
408 perl >&AS_MESSAGE_LOG_FD -w fixmk.pl Makefile* ||
409 AC_MSG_WARN([failed to fix the Makefiles generated by $QMAKE])
412 # Try to compile a simple Qt app.
413 AC_CACHE_CHECK([whether we can build a simple Qt app], [at_cv_qt_build],
417 if $MAKE >&AS_MESSAGE_LOG_FD 2>&1; then
418 at_cv_qt_build='ok, looks like Qt 4 or Qt 5'
420 echo "$as_me:$LINENO: Build failed, trying to #include <qobject.h> \
421 instead" >&AS_MESSAGE_LOG_FD
422 sed 's/<QObject>/<qobject.h>/' conftest.h > tmp.h && mv tmp.h conftest.h
423 if $MAKE >&AS_MESSAGE_LOG_FD 2>&1; then
424 at_cv_qt_build='ok, looks like Qt 3'
426 # Sometimes (such as on Debian) build will fail because Qt hasn't been
427 # installed in debug mode and qmake tries (by default) to build apps in
428 # debug mode => Try again in release mode.
429 echo "$as_me:$LINENO: Build failed, trying to enforce release mode" \
432 _AT_TWEAK_PRO_FILE([CONFIG], [+release])
434 sed 's/<qobject.h>/<QObject>/' conftest.h > tmp.h && mv tmp.h conftest.h
435 if $MAKE >&AS_MESSAGE_LOG_FD 2>&1; then
436 at_cv_qt_build='ok, looks like Qt 4 or Qt 5, release mode forced'
438 echo "$as_me:$LINENO: Build failed, trying to #include <qobject.h> \
439 instead" >&AS_MESSAGE_LOG_FD
440 sed 's/<QObject>/<qobject.h>/' conftest.h >tmp.h && mv tmp.h conftest.h
441 if $MAKE >&AS_MESSAGE_LOG_FD 2>&1; then
442 at_cv_qt_build='ok, looks like Qt 3, release mode forced'
445 echo "$as_me:$LINENO: failed program was:" >&AS_MESSAGE_LOG_FD
446 sed 's/^/| /' conftest.h >&AS_MESSAGE_LOG_FD
447 echo "$as_me:$LINENO: failed program was:" >&AS_MESSAGE_LOG_FD
448 sed 's/^/| /' conftest.cpp >&AS_MESSAGE_LOG_FD
449 fi # if make with Qt3-style #include and release mode forced.
450 fi # if make with Qt4/5-style #include and release mode forced.
451 fi # if make with Qt3-style #include.
452 fi # if make with Qt4/5-style #include.
453 ])dnl end: AC_CACHE_CHECK(at_cv_qt_build)
455 if test x"$at_cv_qt_build" = xko; then
456 AX_INSTEAD_IF([$4], [Cannot build a test Qt program])
460 QT_VERSION_MAJOR=`echo "$at_cv_qt_build" | sed 's/[[^0-9]]*//g'`
461 AC_SUBST([QT_VERSION_MAJOR])
463 # This sed filter is applied after an expression of the form: /^FOO.*=/!d;
464 # It starts by removing the beginning of the line, removing references to
465 # SUBLIBS, removing unnecessary whitespaces at the beginning, and prefixes
466 # all variable uses by QT_.
470 s/\$(\(@<:@A-Z_@:>@@<:@A-Z_@:>@*\))/$(QT_\1)/g'
472 # Find the Makefile (qmake happens to generate a fake Makefile which invokes
473 # a Makefile.Debug or Makefile.Release). We we have both, we'll pick the
474 # Makefile.Release. The reason is that the main difference is that release
475 # uses -Os and debug -g. We can override -Os by passing another -O but we
476 # usually don't override -g.
477 if test -f Makefile.Release; then
478 at_mfile='Makefile.Release'
482 if test -f $at_mfile; then :; else
483 AX_INSTEAD_IF([$4], [Cannot find the Makefile generated by qmake.])
488 # Find the DEFINES of Qt (should have been named CPPFLAGS).
489 AC_CACHE_CHECK([for the DEFINES to use with Qt], [at_cv_env_QT_DEFINES],
490 [at_cv_env_QT_DEFINES=`sed "/^DEFINES@<:@^A-Z=@:>@*=/!d;$qt_sed_filter" $at_mfile`])
491 AC_SUBST([QT_DEFINES], [$at_cv_env_QT_DEFINES])
493 # Find the CFLAGS of Qt (We can use Qt in C?!)
494 AC_CACHE_CHECK([for the CFLAGS to use with Qt], [at_cv_env_QT_CFLAGS],
495 [at_cv_env_QT_CFLAGS=`sed "/^CFLAGS@<:@^A-Z=@:>@*=/!d;$qt_sed_filter" $at_mfile`])
496 AC_SUBST([QT_CFLAGS], [$at_cv_env_QT_CFLAGS])
498 # Find the CXXFLAGS of Qt.
499 AC_CACHE_CHECK([for the CXXFLAGS to use with Qt], [at_cv_env_QT_CXXFLAGS],
500 [at_cv_env_QT_CXXFLAGS=`sed "/^CXXFLAGS@<:@^A-Z=@:>@*=/!d;$qt_sed_filter" $at_mfile`])
501 AC_SUBST([QT_CXXFLAGS], [$at_cv_env_QT_CXXFLAGS])
503 # Find the INCPATH of Qt.
504 AC_CACHE_CHECK([for the INCPATH to use with Qt], [at_cv_env_QT_INCPATH],
505 [at_cv_env_QT_INCPATH=`sed "/^INCPATH@<:@^A-Z=@:>@*=/!d;$qt_sed_filter" $at_mfile`])
506 AC_SUBST([QT_INCPATH], [$at_cv_env_QT_INCPATH])
508 AC_SUBST([QT_CPPFLAGS], ["$at_cv_env_QT_DEFINES $at_cv_env_QT_INCPATH"])
510 # Find the LFLAGS of Qt (Should have been named LDFLAGS)
511 AC_CACHE_CHECK([for the LDFLAGS to use with Qt], [at_cv_env_QT_LDFLAGS],
512 [at_cv_env_QT_LDFLAGS=`sed "/^LFLAGS@<:@^A-Z=@:>@*=/!d;$qt_sed_filter" $at_mfile`])
513 AC_SUBST([QT_LFLAGS], [$at_cv_env_QT_LDFLAGS])
514 AC_SUBST([QT_LDFLAGS], [$at_cv_env_QT_LDFLAGS])
516 # Find the LIBS of Qt.
517 AC_CACHE_CHECK([for the LIBS to use with Qt], [at_cv_env_QT_LIBS],
518 [at_cv_env_QT_LIBS=`sed "/^LIBS@<:@^A-Z@:>@*=/!d;$qt_sed_filter" $at_mfile`
519 if test x$at_darwin = xyes; then
520 # Fix QT_LIBS: as of today Libtool (GNU Libtool 1.5.23a) doesn't handle
521 # -F properly. The "bug" has been fixed on 22 October 2006
522 # by Peter O'Gorman but we provide backward compatibility here.
523 at_cv_env_QT_LIBS=`echo "$at_cv_env_QT_LIBS" \
524 | sed 's/^-F/-Wl,-F/;s/ -F/ -Wl,-F/g'`
527 AC_SUBST([QT_LIBS], [$at_cv_env_QT_LIBS])
529 cd .. && rm -rf conftest.dir
534 done # end hack (useless for to be able to use break)
537 # AT_REQUIRE_QT_VERSION(QT_version, [RUN-IF-FAILED], [RUN-IF-OK])
538 # ---------------------------------------------------------------
539 # Check (using qmake) that Qt's version "matches" QT_version.
540 # Must be run AFTER AT_WITH_QT. Requires autoconf 2.60.
542 # This macro is ignored if Qt support has been disabled (using
543 # `--with-qt=no' or `--without-qt').
545 # RUN-IF-FAILED is arbitrary code to execute if Qt cannot be found or if any
546 # problem happens. If this argument is omitted, then AC_MSG_ERROR will be
547 # called. RUN-IF-OK is arbitrary code to execute if Qt was successfully found.
548 AC_DEFUN([AT_REQUIRE_QT_VERSION],
550 # this is a hack to get decent flow control with 'break'
551 for _qt_ignored in once; do
553 if test x"$with_qt" = x"no"; then
557 if test x"$QMAKE" = x; then
560 Did you invoke AT@&t@_WITH_QT before AT@&t@_REQUIRE_QT_VERSION?])
563 AC_CACHE_CHECK([for Qt's version], [at_cv_QT_VERSION],
564 [echo "$as_me:$LINENO: Running $QMAKE --version:" >&AS_MESSAGE_LOG_FD
565 $QMAKE --version >&AS_MESSAGE_LOG_FD 2>&1
566 qmake_version_sed=['/^.*\([0-9]\.[0-9]\.[0-9]\).*$/!d;s//\1/']
567 at_cv_QT_VERSION=`$QMAKE --version 2>&1 | sed "$qmake_version_sed"`])
568 if test x"$at_cv_QT_VERSION" = x; then
569 AX_INSTEAD_IF([$2], [Cannot detect Qt's version.])
572 AC_SUBST([QT_VERSION], [$at_cv_QT_VERSION])
573 AS_VERSION_COMPARE([$QT_VERSION], [$1],
574 [AX_INSTEAD_IF([$2], [This package requires Qt $1 or above.])
581 done # end hack (useless for to be able to use break)
584 # _AT_TWEAK_PRO_FILE(QT_VAR, VALUE)
585 # ---------------------------
586 # @internal. Tweak the variable QT_VAR in the .pro.
587 # VALUE is an IFS-separated list of value and each value is rewritten
589 # +value => QT_VAR += value
590 # -value => QT_VAR -= value
591 # value => QT_VAR += value
592 AC_DEFUN([_AT_TWEAK_PRO_FILE],
593 [ # Tweak the value of $1 in the .pro file for $2.
597 at_mod=`echo "$at_mod" | sed 's/^-//; tough
606 echo "$qt_conf" | sed 1d >>"$pro_file"