Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/.gitignore b/.gitignore
- index 5b4d2f2..0db34fa 100644
- --- a/.gitignore
- +++ b/.gitignore
- @@ -119,6 +119,16 @@ translations/*.qm
- translations/*_untranslated.ts
- qrc_*.cpp
- +src/corelib/qtcoreversion.h
- +src/dbus/qtdbusversion.h
- +src/gui/qtguiversion.h
- +src/network/qtnetworkversion.h
- +src/opengl/qtopenglversion.h
- +src/openvg/qtopenvgversion.h
- +src/sql/qtsqlversion.h
- +src/testlib/qttestversion.h
- +src/xml/qtxmlversion.h
- +
- # Test generated files
- QObject.log
- tst_*
- diff --git a/bin/syncqt b/bin/syncqt
- index 3d25ecc..d62d220 100755
- --- a/bin/syncqt
- +++ b/bin/syncqt
- @@ -47,6 +47,7 @@ my $copy_headers = 0;
- my $create_uic_class_map = 0;
- my $create_private_headers = 1;
- my $no_module_fwd = 0;
- +my $no_module_version_header = 0;
- my @modules_to_sync ;
- $force_relative = 1 if ( -d "/System/Library/Frameworks" );
- @@ -77,6 +78,8 @@ sub showUsage
- print " Create headers for <NAME> with original headers in <HEADERDIR> relative to <PROFILEDIR> \n";
- print " -private Force copy private headers (default: " . ($create_private_headers ? "yes" : "no") . ")\n";
- print " -no-module-fwd Don't create fwd includes for module pri files\n";
- + print " -no-module-version-header\n";
- + print " Don't create module header file\n";
- print " -help This help\n";
- exit 0;
- }
- @@ -619,6 +622,9 @@ while ( @ARGV ) {
- } elsif($arg eq "-no-module-fwd") {
- $var = "no_module_fwd";
- $val = "yes";
- + } elsif($arg eq "-no-module-version-header") {
- + $var = "no_module_version_header";
- + $val = "yes";
- } elsif($arg =~/^-/) {
- print "Unknown option: $arg\n\n" if(!$var);
- showUsage();
- @@ -696,6 +702,8 @@ while ( @ARGV ) {
- }
- } elsif ($var eq "no_module_fwd") {
- $no_module_fwd = 1;
- + } elsif ($var eq "no_module_version_header") {
- + $no_module_version_header = 1;
- } elsif ($var eq "output") {
- my $outdir = $val;
- if(checkRelative($outdir)) {
- @@ -748,6 +756,9 @@ foreach my $lib (@modules_to_sync) {
- #iteration info
- my $dir = $modules{$lib};
- my $module_version = "";
- + my $module_major_version = "";
- + my $module_minor_version = "";
- + my $module_patch_version = "";
- if (-e "$modulepris{$lib}") {
- my $content = fileContents($modulepris{$lib});
- @@ -758,6 +769,13 @@ foreach my $lib (@modules_to_sync) {
- chomp $module_version;
- $module_version =~ s/^\s*QT\..*\.VERSION\s*=\s*([^#]+).*$/$1/;
- $module_version =~ s/\s+$//;
- + my @versions = split(/\./, $module_version);
- + $module_major_version = $versions[0];
- + chomp $module_major_version;
- + $module_minor_version = $versions[1];
- + chomp $module_minor_version;
- + $module_patch_version = $versions[2];
- + chomp $module_patch_version;
- }
- }
- print "WARNING: Module $lib\'s pri missing QT.<module>.VERSION variable! Private headers not versioned!\n" if (!$module_version);
- @@ -1045,6 +1063,39 @@ foreach my $lib (@modules_to_sync) {
- print "WARNING: Module $lib\'s pri file '$modulepri' not found.\nSkipped creating forwarding pri for $lib.\n";
- }
- }
- +
- + # Liang: create the _version header files for each module
- + unless ($no_module_version_header) {
- + print "Liang: module pri $modulepris{$lib}\n";
- + print "Liang: module version $module_version\n";
- + print "Liang: module_major_version\n $module_major_version\n";
- + print "Liang: module_minor_version\n $module_minor_version\n";
- + print "Liang: module_patch_version\n $module_patch_version\n";
- + print "Liang: module lib $modules{$lib}\n";
- + print "Liang: module lib $lib\n";
- + my $modulepri = $modulepris{$lib};
- + if (-e $modulepri) {
- + my $modulepriname = basename($modulepri);
- + print "Liang: modulepri $modulepri\n";
- + print "Liang: modulepriname $modulepriname\n";
- + print "Liang: qtbasedir $qtbasedir\n";
- + my $moduleversionheader = "$modules{$lib}/" . lc($lib) . "version.h";
- + print "Liang: moduleversionheader $moduleversionheader\n";
- + my $modulehexstring = sprintf("0x%02X%02X%02X", int($module_major_version), int($module_minor_version), int($module_patch_version));
- + open MODULE_VERSION_HEADER_FILE, ">$moduleversionheader";
- + print MODULE_VERSION_HEADER_FILE "/* This file was generated by syncqt with the info from sync.profile. */\n";
- + print MODULE_VERSION_HEADER_FILE "#ifndef QT_". uc($lib) . "_VERSION_H\n";
- + print MODULE_VERSION_HEADER_FILE "#define QT_". uc($lib) . "_VERSION_H\n";
- + print MODULE_VERSION_HEADER_FILE "\n";
- + print MODULE_VERSION_HEADER_FILE "#define " .uc($lib) . "_VERSION_STR \"" . $module_version . "\"\n";
- + print MODULE_VERSION_HEADER_FILE "\n";
- + print MODULE_VERSION_HEADER_FILE "#define " .uc($lib) . "_VERSION $modulehexstring\n", ;
- + print MODULE_VERSION_HEADER_FILE "\n";
- + print MODULE_VERSION_HEADER_FILE "#endif // QT_". uc($lib) . "_VERSION_H\n";
- + } elsif ($modulepri) {
- + print "WARNING: Module $lib\'s pri file '$modulepri' not found.\nSkipped creating module version header for $lib.\n";
- + }
- + }
- }
- }
- unless($showonly || !$create_uic_class_map) {
- diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
- index a31d1e5..1e1e4da 100644
- --- a/src/corelib/corelib.pro
- +++ b/src/corelib/corelib.pro
- @@ -11,6 +11,9 @@ win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x67000000
- irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused
- include(../qbase.pri)
- +
- +HEADERS += $$QT_SOURCE_TREE/src/corelib/qtcoreversion.h
- +
- include(animation/animation.pri)
- include(arch/arch.pri)
- include(concurrent/concurrent.pri)
- diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro
- index e73fa05..731d20a 100644
- --- a/src/dbus/dbus.pro
- +++ b/src/dbus/dbus.pro
- @@ -32,6 +32,9 @@ win32 {
- else:LIBS_PRIVATE += -ldbus-1
- }
- include(../qbase.pri)
- +
- +HEADERS += $$QT_SOURCE_TREE/src/dub/qtdbusversion.h
- +
- PUB_HEADERS = qdbusargument.h \
- qdbusconnectioninterface.h \
- qdbusmacros.h \
- diff --git a/src/gui/gui.pro b/src/gui/gui.pro
- index 072553a..7e9d78d 100644
- --- a/src/gui/gui.pro
- +++ b/src/gui/gui.pro
- @@ -15,6 +15,8 @@ unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore
- include(../qbase.pri)
- +HEADERS += $$QT_SOURCE_TREE/src/gui/qtguiversion.h
- +
- contains(QT_CONFIG, x11sm):CONFIG += x11sm
- #platforms
- diff --git a/src/network/network.pro b/src/network/network.pro
- index fc5d08d..4ee71b0 100644
- --- a/src/network/network.pro
- +++ b/src/network/network.pro
- @@ -19,6 +19,9 @@ win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x64000000
- unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore
- include(../qbase.pri)
- +
- +HEADERS += $$QT_SOURCE_TREE/src/network/qtnetworkversion.h
- +
- include(access/access.pri)
- include(bearer/bearer.pri)
- include(kernel/kernel.pri)
- diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
- index 849bd9e..b30d405 100644
- --- a/src/opengl/opengl.pro
- +++ b/src/opengl/opengl.pro
- @@ -15,6 +15,8 @@ unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui
- include(../qbase.pri)
- +HEADERS += $$QT_SOURCE_TREE/src/opengl/qtopenglversion.h
- +
- !win32:!embedded:!mac:!symbian:!qpa:CONFIG += x11
- contains(QT_CONFIG, opengl):CONFIG += opengl
- contains(QT_CONFIG, opengles1):CONFIG += opengles1
- diff --git a/src/openvg/openvg.pro b/src/openvg/openvg.pro
- index dbe1620..0e22503 100644
- --- a/src/openvg/openvg.pro
- +++ b/src/openvg/openvg.pro
- @@ -52,6 +52,8 @@ symbian {
- include(../qbase.pri)
- +HEADERS += $$QT_SOURCE_TREE/src/openvg/qtopenvgversion.h
- +
- unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui
- symbian:TARGET.UID3 = 0x2001E62F
- diff --git a/src/sql/sql.pro b/src/sql/sql.pro
- index f1bdd6b..c7cbbc4 100644
- --- a/src/sql/sql.pro
- +++ b/src/sql/sql.pro
- @@ -13,6 +13,8 @@ unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore
- include(../qbase.pri)
- +HEADERS += $$QT_SOURCE_TREE/src/sql/qtsqlversion.h
- +
- DEFINES += QT_NO_CAST_FROM_ASCII
- PRECOMPILED_HEADER = ../corelib/global/qt_pch.h
- SQL_P = sql
- diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro
- index 311c793..3408c91 100644
- --- a/src/testlib/testlib.pro
- +++ b/src/testlib/testlib.pro
- @@ -85,6 +85,9 @@ qpa:mac: {
- }
- include(../qbase.pri)
- +
- +HEADERS += $$QT_SOURCE_TREE/src/testlib/qttestlibversion.h
- +
- QMAKE_TARGET_PRODUCT = QTestLib
- QMAKE_TARGET_DESCRIPTION = Qt \
- Unit \
- diff --git a/src/xml/xml.pro b/src/xml/xml.pro
- index 68bb20b..986e478 100644
- --- a/src/xml/xml.pro
- +++ b/src/xml/xml.pro
- @@ -12,6 +12,8 @@ unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore
- include(../qbase.pri)
- +HEADERS += $$QT_SOURCE_TREE/src/xml/qtxmlversion.h
- +
- PRECOMPILED_HEADER = ../corelib/global/qt_pch.h
- win32-borland {
- diff --git a/sync.profile b/sync.profile
- index 8d83804..d180458 100644
- --- a/sync.profile
- +++ b/sync.profile
- @@ -28,6 +28,15 @@
- "qtconcurrentmap.h" => "QtConcurrentMap",
- "qtconcurrentfilter.h" => "QtConcurrentFilter",
- "qtconcurrentrun.h" => "QtConcurrentRun",
- + "qtcoreversion.h" => "QtCoreVersion",
- + "qtdbusversion.h" => "QtDBusVersion",
- + "qtguiversion.h" => "QtGuiVersion",
- + "qtnetworkversion.h" => "QtNetworkVersion",
- + "qtopenglversion.h" => "QtOpenGLVersion",
- + "qtopenvgversion.h" => "QtOpenVGVersion",
- + "qtsqlversion.h" => "QtSqlVersion",
- + "qttestversion.h" => "QtTestVersion",
- + "qtxmlversion.h" => "QtXmlVersion",
- );
- %mastercontent = (
- "core" => "#include <QtCore/QtCore>\n",
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement