Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.88 KB | None | 0 0
  1. diff --git a/.gitignore b/.gitignore
  2. index 5b4d2f2..0db34fa 100644
  3. --- a/.gitignore
  4. +++ b/.gitignore
  5. @@ -119,6 +119,16 @@ translations/*.qm
  6. translations/*_untranslated.ts
  7. qrc_*.cpp
  8.  
  9. +src/corelib/qtcoreversion.h
  10. +src/dbus/qtdbusversion.h
  11. +src/gui/qtguiversion.h
  12. +src/network/qtnetworkversion.h
  13. +src/opengl/qtopenglversion.h
  14. +src/openvg/qtopenvgversion.h
  15. +src/sql/qtsqlversion.h
  16. +src/testlib/qttestversion.h
  17. +src/xml/qtxmlversion.h
  18. +
  19. # Test generated files
  20. QObject.log
  21. tst_*
  22. diff --git a/bin/syncqt b/bin/syncqt
  23. index 3d25ecc..d62d220 100755
  24. --- a/bin/syncqt
  25. +++ b/bin/syncqt
  26. @@ -47,6 +47,7 @@ my $copy_headers = 0;
  27. my $create_uic_class_map = 0;
  28. my $create_private_headers = 1;
  29. my $no_module_fwd = 0;
  30. +my $no_module_version_header = 0;
  31. my @modules_to_sync ;
  32. $force_relative = 1 if ( -d "/System/Library/Frameworks" );
  33.  
  34. @@ -77,6 +78,8 @@ sub showUsage
  35. print " Create headers for <NAME> with original headers in <HEADERDIR> relative to <PROFILEDIR> \n";
  36. print " -private Force copy private headers (default: " . ($create_private_headers ? "yes" : "no") . ")\n";
  37. print " -no-module-fwd Don't create fwd includes for module pri files\n";
  38. + print " -no-module-version-header\n";
  39. + print " Don't create module header file\n";
  40. print " -help This help\n";
  41. exit 0;
  42. }
  43. @@ -619,6 +622,9 @@ while ( @ARGV ) {
  44. } elsif($arg eq "-no-module-fwd") {
  45. $var = "no_module_fwd";
  46. $val = "yes";
  47. + } elsif($arg eq "-no-module-version-header") {
  48. + $var = "no_module_version_header";
  49. + $val = "yes";
  50. } elsif($arg =~/^-/) {
  51. print "Unknown option: $arg\n\n" if(!$var);
  52. showUsage();
  53. @@ -696,6 +702,8 @@ while ( @ARGV ) {
  54. }
  55. } elsif ($var eq "no_module_fwd") {
  56. $no_module_fwd = 1;
  57. + } elsif ($var eq "no_module_version_header") {
  58. + $no_module_version_header = 1;
  59. } elsif ($var eq "output") {
  60. my $outdir = $val;
  61. if(checkRelative($outdir)) {
  62. @@ -748,6 +756,9 @@ foreach my $lib (@modules_to_sync) {
  63. #iteration info
  64. my $dir = $modules{$lib};
  65. my $module_version = "";
  66. + my $module_major_version = "";
  67. + my $module_minor_version = "";
  68. + my $module_patch_version = "";
  69.  
  70. if (-e "$modulepris{$lib}") {
  71. my $content = fileContents($modulepris{$lib});
  72. @@ -758,6 +769,13 @@ foreach my $lib (@modules_to_sync) {
  73. chomp $module_version;
  74. $module_version =~ s/^\s*QT\..*\.VERSION\s*=\s*([^#]+).*$/$1/;
  75. $module_version =~ s/\s+$//;
  76. + my @versions = split(/\./, $module_version);
  77. + $module_major_version = $versions[0];
  78. + chomp $module_major_version;
  79. + $module_minor_version = $versions[1];
  80. + chomp $module_minor_version;
  81. + $module_patch_version = $versions[2];
  82. + chomp $module_patch_version;
  83. }
  84. }
  85. print "WARNING: Module $lib\'s pri missing QT.<module>.VERSION variable! Private headers not versioned!\n" if (!$module_version);
  86. @@ -1045,6 +1063,39 @@ foreach my $lib (@modules_to_sync) {
  87. print "WARNING: Module $lib\'s pri file '$modulepri' not found.\nSkipped creating forwarding pri for $lib.\n";
  88. }
  89. }
  90. +
  91. + # Liang: create the _version header files for each module
  92. + unless ($no_module_version_header) {
  93. + print "Liang: module pri $modulepris{$lib}\n";
  94. + print "Liang: module version $module_version\n";
  95. + print "Liang: module_major_version\n $module_major_version\n";
  96. + print "Liang: module_minor_version\n $module_minor_version\n";
  97. + print "Liang: module_patch_version\n $module_patch_version\n";
  98. + print "Liang: module lib $modules{$lib}\n";
  99. + print "Liang: module lib $lib\n";
  100. + my $modulepri = $modulepris{$lib};
  101. + if (-e $modulepri) {
  102. + my $modulepriname = basename($modulepri);
  103. + print "Liang: modulepri $modulepri\n";
  104. + print "Liang: modulepriname $modulepriname\n";
  105. + print "Liang: qtbasedir $qtbasedir\n";
  106. + my $moduleversionheader = "$modules{$lib}/" . lc($lib) . "version.h";
  107. + print "Liang: moduleversionheader $moduleversionheader\n";
  108. + my $modulehexstring = sprintf("0x%02X%02X%02X", int($module_major_version), int($module_minor_version), int($module_patch_version));
  109. + open MODULE_VERSION_HEADER_FILE, ">$moduleversionheader";
  110. + print MODULE_VERSION_HEADER_FILE "/* This file was generated by syncqt with the info from sync.profile. */\n";
  111. + print MODULE_VERSION_HEADER_FILE "#ifndef QT_". uc($lib) . "_VERSION_H\n";
  112. + print MODULE_VERSION_HEADER_FILE "#define QT_". uc($lib) . "_VERSION_H\n";
  113. + print MODULE_VERSION_HEADER_FILE "\n";
  114. + print MODULE_VERSION_HEADER_FILE "#define " .uc($lib) . "_VERSION_STR \"" . $module_version . "\"\n";
  115. + print MODULE_VERSION_HEADER_FILE "\n";
  116. + print MODULE_VERSION_HEADER_FILE "#define " .uc($lib) . "_VERSION $modulehexstring\n", ;
  117. + print MODULE_VERSION_HEADER_FILE "\n";
  118. + print MODULE_VERSION_HEADER_FILE "#endif // QT_". uc($lib) . "_VERSION_H\n";
  119. + } elsif ($modulepri) {
  120. + print "WARNING: Module $lib\'s pri file '$modulepri' not found.\nSkipped creating module version header for $lib.\n";
  121. + }
  122. + }
  123. }
  124. }
  125. unless($showonly || !$create_uic_class_map) {
  126. diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
  127. index a31d1e5..1e1e4da 100644
  128. --- a/src/corelib/corelib.pro
  129. +++ b/src/corelib/corelib.pro
  130. @@ -11,6 +11,9 @@ win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x67000000
  131. irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused
  132.  
  133. include(../qbase.pri)
  134. +
  135. +HEADERS += $$QT_SOURCE_TREE/src/corelib/qtcoreversion.h
  136. +
  137. include(animation/animation.pri)
  138. include(arch/arch.pri)
  139. include(concurrent/concurrent.pri)
  140. diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro
  141. index e73fa05..731d20a 100644
  142. --- a/src/dbus/dbus.pro
  143. +++ b/src/dbus/dbus.pro
  144. @@ -32,6 +32,9 @@ win32 {
  145. else:LIBS_PRIVATE += -ldbus-1
  146. }
  147. include(../qbase.pri)
  148. +
  149. +HEADERS += $$QT_SOURCE_TREE/src/dub/qtdbusversion.h
  150. +
  151. PUB_HEADERS = qdbusargument.h \
  152. qdbusconnectioninterface.h \
  153. qdbusmacros.h \
  154. diff --git a/src/gui/gui.pro b/src/gui/gui.pro
  155. index 072553a..7e9d78d 100644
  156. --- a/src/gui/gui.pro
  157. +++ b/src/gui/gui.pro
  158. @@ -15,6 +15,8 @@ unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore
  159.  
  160. include(../qbase.pri)
  161.  
  162. +HEADERS += $$QT_SOURCE_TREE/src/gui/qtguiversion.h
  163. +
  164. contains(QT_CONFIG, x11sm):CONFIG += x11sm
  165.  
  166. #platforms
  167. diff --git a/src/network/network.pro b/src/network/network.pro
  168. index fc5d08d..4ee71b0 100644
  169. --- a/src/network/network.pro
  170. +++ b/src/network/network.pro
  171. @@ -19,6 +19,9 @@ win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x64000000
  172. unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore
  173.  
  174. include(../qbase.pri)
  175. +
  176. +HEADERS += $$QT_SOURCE_TREE/src/network/qtnetworkversion.h
  177. +
  178. include(access/access.pri)
  179. include(bearer/bearer.pri)
  180. include(kernel/kernel.pri)
  181. diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
  182. index 849bd9e..b30d405 100644
  183. --- a/src/opengl/opengl.pro
  184. +++ b/src/opengl/opengl.pro
  185. @@ -15,6 +15,8 @@ unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui
  186.  
  187. include(../qbase.pri)
  188.  
  189. +HEADERS += $$QT_SOURCE_TREE/src/opengl/qtopenglversion.h
  190. +
  191. !win32:!embedded:!mac:!symbian:!qpa:CONFIG += x11
  192. contains(QT_CONFIG, opengl):CONFIG += opengl
  193. contains(QT_CONFIG, opengles1):CONFIG += opengles1
  194. diff --git a/src/openvg/openvg.pro b/src/openvg/openvg.pro
  195. index dbe1620..0e22503 100644
  196. --- a/src/openvg/openvg.pro
  197. +++ b/src/openvg/openvg.pro
  198. @@ -52,6 +52,8 @@ symbian {
  199.  
  200. include(../qbase.pri)
  201.  
  202. +HEADERS += $$QT_SOURCE_TREE/src/openvg/qtopenvgversion.h
  203. +
  204. unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui
  205. symbian:TARGET.UID3 = 0x2001E62F
  206.  
  207. diff --git a/src/sql/sql.pro b/src/sql/sql.pro
  208. index f1bdd6b..c7cbbc4 100644
  209. --- a/src/sql/sql.pro
  210. +++ b/src/sql/sql.pro
  211. @@ -13,6 +13,8 @@ unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore
  212.  
  213. include(../qbase.pri)
  214.  
  215. +HEADERS += $$QT_SOURCE_TREE/src/sql/qtsqlversion.h
  216. +
  217. DEFINES += QT_NO_CAST_FROM_ASCII
  218. PRECOMPILED_HEADER = ../corelib/global/qt_pch.h
  219. SQL_P = sql
  220. diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro
  221. index 311c793..3408c91 100644
  222. --- a/src/testlib/testlib.pro
  223. +++ b/src/testlib/testlib.pro
  224. @@ -85,6 +85,9 @@ qpa:mac: {
  225. }
  226.  
  227. include(../qbase.pri)
  228. +
  229. +HEADERS += $$QT_SOURCE_TREE/src/testlib/qttestlibversion.h
  230. +
  231. QMAKE_TARGET_PRODUCT = QTestLib
  232. QMAKE_TARGET_DESCRIPTION = Qt \
  233. Unit \
  234. diff --git a/src/xml/xml.pro b/src/xml/xml.pro
  235. index 68bb20b..986e478 100644
  236. --- a/src/xml/xml.pro
  237. +++ b/src/xml/xml.pro
  238. @@ -12,6 +12,8 @@ unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore
  239.  
  240. include(../qbase.pri)
  241.  
  242. +HEADERS += $$QT_SOURCE_TREE/src/xml/qtxmlversion.h
  243. +
  244. PRECOMPILED_HEADER = ../corelib/global/qt_pch.h
  245.  
  246. win32-borland {
  247. diff --git a/sync.profile b/sync.profile
  248. index 8d83804..d180458 100644
  249. --- a/sync.profile
  250. +++ b/sync.profile
  251. @@ -28,6 +28,15 @@
  252. "qtconcurrentmap.h" => "QtConcurrentMap",
  253. "qtconcurrentfilter.h" => "QtConcurrentFilter",
  254. "qtconcurrentrun.h" => "QtConcurrentRun",
  255. + "qtcoreversion.h" => "QtCoreVersion",
  256. + "qtdbusversion.h" => "QtDBusVersion",
  257. + "qtguiversion.h" => "QtGuiVersion",
  258. + "qtnetworkversion.h" => "QtNetworkVersion",
  259. + "qtopenglversion.h" => "QtOpenGLVersion",
  260. + "qtopenvgversion.h" => "QtOpenVGVersion",
  261. + "qtsqlversion.h" => "QtSqlVersion",
  262. + "qttestversion.h" => "QtTestVersion",
  263. + "qtxmlversion.h" => "QtXmlVersion",
  264. );
  265. %mastercontent = (
  266. "core" => "#include <QtCore/QtCore>\n",
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement