From 29d77e6003d0e156e5979dc8eb72e7ed8eb51456 Mon Sep 17 00:00:00 2001
From: Rohan McGovern <rohan.mcgovern@nokia.com>
Date: Thu, 5 Aug 2010 16:04:56 +1000
Subject: Fixed incorrect include/Qt/qconfig.h in binary packages.

When building from a source package, src/corelib/global/qconfig.h exists.
syncqt contained logic to force the creation of include/Qt/qconfig.h for
the case where it _doesn't_ exist.

This meant that running syncqt from a Qt source package resulted in
include/Qt/qconfig.h including qconfig.h twice.

Task: QTBUG-12637
Reviewed-by: Toby Tomkins
---
 bin/syncqt | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/bin/syncqt b/bin/syncqt
index 1e553dc..f63f06a 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -691,7 +691,10 @@ my @ignore_for_qt_begin_header_check = ( "qiconset.h", "qconfig.h", "qconfig-dis
 my @ignore_for_qt_begin_namespace_check = ( "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qatomic_arch.h", "qatomic_windowsce.h", "qt_windows.h", "qatomic_macosx.h" );
 my @ignore_for_qt_module_check = ( "$modules{QtCore}/arch", "$modules{QtCore}/global", "$modules{QtSql}/drivers", "$modules{QtTest}", "$modules{QtDesigner}", "$modules{QtUiTools}", "$modules{QtDBus}", "$modules{phonon}" );
 my %colliding_headers = ();
-my %inject_headers = ( "$basedir/src/corelib/global" => ( "*qconfig.h" ) );
+my %inject_headers;
+# Force generation of forwarding header for qconfig.h if (and only if) we can't
+# find the header by normal means.
+%inject_headers = ( "$basedir/src/corelib/global" => ( "*qconfig.h" ) ) unless (-e "$basedir/src/corelib/global/qconfig.h");
 
 foreach (@modules_to_sync) {
     #iteration info
-- 
cgit v0.12