diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-11 00:10:15 +1000 |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-11 00:10:15 +1000 |
commit | ff112f47c86ec49a04afcd932475ab6d6a1eda77 (patch) | |
tree | a5ef07652a17d1c21966fe2d1d3eff8d932512d7 /bin | |
parent | e35297e65d1de578202a3d1b784a70c4db65d356 (diff) | |
parent | 45cdd701fa9e9e491bebde2b6fa11d7dd9250e1d (diff) |
Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-earth-staging
* 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-earth-staging:
Add QT_xxx_VERSION macros for each library in qtbase
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/syncqt | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/bin/syncqt b/bin/syncqt index 6050d31e9e..436d93e935 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 version 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,28 @@ foreach my $lib (@modules_to_sync) { print "WARNING: Module $lib\'s pri file '$modulepri' not found.\nSkipped creating forwarding pri for $lib.\n"; } } + + # create the version header files for each module + unless ($no_module_version_header) { + my $modulepri = $modulepris{$lib}; + if (-e $modulepri) { + my $modulepriname = basename($modulepri); + my $moduleversionheader = "$modules{$lib}/" . lc($lib) . "version.h"; + 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) { |