summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2013-05-28 11:07:13 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-03 17:59:31 +0200
commit8d69232b28165079aed1d754f9bdd8c7c4336b16 (patch)
tree9f0c14fb1f63461702ec36f14dbe83021f7782da
parent5d8b8eed90c52afbd54d7c057657dc12d1e8e61a (diff)
let configure create the forwarding qconfig.h again
this avoids that syncqt needs to forward to a yet unexisting file (which will have a yet unknown location, when syncqt is run at packaging time already). the %inject_headers syncqt config variable remains, so it can be told not to purge "foreign" files. Change-Id: I127ff6e0b7d5702fb0acaee9a5b7940b482d3608 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
-rwxr-xr-xbin/syncqt.pl10
-rwxr-xr-xconfigure17
-rw-r--r--src/corelib/global/global.pri5
-rw-r--r--sync.profile1
-rw-r--r--tools/configure/configureapp.cpp31
5 files changed, 54 insertions, 10 deletions
diff --git a/bin/syncqt.pl b/bin/syncqt.pl
index f31466ad33..1da3878695 100755
--- a/bin/syncqt.pl
+++ b/bin/syncqt.pl
@@ -893,15 +893,8 @@ foreach my $lib (@modules_to_sync) {
#calc files and "copy" them
foreach my $subdir (@subdirs) {
my @headers = findFiles($subdir, "^[-a-z0-9_]*\\.h\$" , 0);
- if (defined $inject_headers{$subdir}) {
- foreach my $if (@{$inject_headers{$subdir}}) {
- @headers = grep(!/^\Q$if\E$/, @headers); #in case we configure'd previously
- push @headers, "*".$if;
- }
- }
my $header_dirname = "";
foreach my $header (@headers) {
- my $shadow = ($header =~ s/^\*//);
$header = 0 if($header =~ /^ui_.*.h/);
foreach (@ignore_headers) {
$header = 0 if($header eq $_);
@@ -923,7 +916,6 @@ foreach my $lib (@modules_to_sync) {
}
my $iheader = $subdir . "/" . $header;
- $iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow);
my @classes = $public_header && !$minimal ? classNames($iheader) : ();
if($showonly) {
print "$header [$lib]\n";
@@ -964,7 +956,7 @@ foreach my $lib (@modules_to_sync) {
}
foreach(@headers) { #sync them
- $header_copies++ if(syncHeader($lib, $_, $iheader, $copy_headers && !$shadow, $ts));
+ $header_copies++ if (syncHeader($lib, $_, $iheader, $copy_headers, $ts));
}
if($public_header) {
diff --git a/configure b/configure
index 079f2e7415..43e7f8851e 100755
--- a/configure
+++ b/configure
@@ -6424,6 +6424,23 @@ else
fi
fi
+# create a forwarding header
+mkdir -p "$outpath/include/QtCore" || exit
+echo '#include "../../src/corelib/global/qconfig.h"' > $outpath/include/QtCore/qconfig.h.new
+if cmp -s "$outpath/include/QtCore/qconfig.h.new" "$outpath/include/QtCore/qconfig.h"; then
+ rm -f "$outpath/include/QtCore/qconfig.h.new"
+else
+ mv "$outpath/include/QtCore/qconfig.h.new" "$outpath/include/QtCore/qconfig.h" || exit
+fi
+
+# create a camelcase forwarding header
+echo '#include "qconfig.h"' > $outpath/include/QtCore/QtConfig.new
+if cmp -s "$outpath/include/QtCore/QtConfig.new" "$outpath/include/QtCore/QtConfig"; then
+ rm -f "$outpath/include/QtCore/QtConfig.new"
+else
+ mv "$outpath/include/QtCore/QtConfig.new" "$outpath/include/QtCore/QtConfig" || exit
+fi
+
#-------------------------------------------------------------------------------
# save configuration into qconfig.pri
#-------------------------------------------------------------------------------
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index 6ac32cd35d..4084d4f2ad 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -29,6 +29,11 @@ SOURCES += \
# qlibraryinfo.cpp includes qconfig.cpp
INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global
+# configure creates these, not syncqt, so we need to manually inject them
+targ_headers.files += \
+ $$OUT_PWD/global/qconfig.h \
+ $$QT_BUILD_TREE/include/QtCore/QtConfig
+
# Only used on platforms with CONFIG += precompile_header
PRECOMPILED_HEADER = global/qt_pch.h
diff --git a/sync.profile b/sync.profile
index e07b285dbb..3d89d9d71f 100644
--- a/sync.profile
+++ b/sync.profile
@@ -24,7 +24,6 @@
%classnames = (
"qglobal.h" => "QtGlobal",
"qendian.h" => "QtEndian",
- "qconfig.h" => "QtConfig",
"qplugin.h" => "QtPlugin",
"qalgorithms.h" => "QtAlgorithms",
"qcontainerfwd.h" => "QtContainerFwd",
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index a83f451b81..9620129509 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -3351,6 +3351,37 @@ void Configure::generateConfigfiles()
tmpFile.close();
}
+ QTemporaryFile tmpFile2;
+ if (tmpFile2.open()) {
+ tmpStream.setDevice(&tmpFile2);
+ tmpStream << "#include \"../../src/corelib/global/qconfig.h\"" << endl;
+
+ tmpStream.flush();
+ tmpFile2.flush();
+
+ outName = buildPath + "/include/QtCore/qconfig.h";
+ ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL);
+ QFile::remove(outName);
+
+ tmpFile2.copy(outName);
+ tmpFile2.close();
+ }
+ QTemporaryFile tmpFile2a;
+ if (tmpFile2a.open()) {
+ tmpStream.setDevice(&tmpFile2a);
+ tmpStream << "#include \"qconfig.h\"" << endl;
+
+ tmpStream.flush();
+ tmpFile2a.flush();
+
+ outName = buildPath + "/include/QtCore/QtConfig";
+ ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL);
+ QFile::remove(outName);
+
+ tmpFile2a.copy(outName);
+ tmpFile2a.close();
+ }
+
QTemporaryFile tmpFile3;
if (tmpFile3.open()) {
tmpStream.setDevice(&tmpFile3);