return @ret;
}
+sub make_path {
+ my ($dir, $lib, $be_verbose) = @_;
+ unless(-e $dir) {
+ mkpath $dir;
+ $dir = "<outbase>" . substr($dir, length($out_basedir)) if ($be_verbose < 3);
+ print "$lib: mkpath $dir\n" if ($be_verbose > 1);
+ }
+}
+
######################################################################
# Syntax: syncHeader(header, iheader, copy, timestamp)
# Params: header, string, filename to create "symlink" for
# Returns: 1 if successful, else 0.
######################################################################
sub syncHeader {
- my ($header, $iheader, $copy, $ts) = @_;
+ my ($lib, $header, $iheader, $copy, $ts) = @_;
$iheader =~ s=\\=/=g;
$header =~ s=\\=/=g;
- return copyFile($iheader, $header) if($copy);
+ return copyFile($lib, $iheader, $header) if($copy);
unless(-e $header) {
my $header_dir = dirname($header);
- mkpath $header_dir, !$quiet;
+ make_path($header_dir, $lib, $verbose_level);
#write it
my $iheader_out = fixPaths($iheader, $header_dir);
######################################################################
sub copyFile
{
- my ($file,$ifile, $copy,$knowdiff,$filecontents,$ifilecontents) = @_;
+ my ($lib, $file,$ifile, $copy,$knowdiff,$filecontents,$ifilecontents) = @_;
# Bi-directional synchronization
open( I, "< " . $file ) || die "Could not open $file for reading";
local $/;
if ( $knowdiff || ($filecontents ne $ifilecontents) ) {
if ( $copy > 0 ) {
my $file_dir = dirname($file);
- mkpath $file_dir, !$quiet unless(-e $file_dir);
+ make_path($file_dir, $lib, $verbose_level);
open(O, "> " . $file) || die "Could not open $file for writing (no write permission?)";
local $/;
binmode O;
return 1;
} elsif ( $copy < 0 ) {
my $ifile_dir = dirname($ifile);
- mkpath $ifile_dir, !$quiet unless(-e $ifile_dir);
+ make_path($ifile_dir, $lib, $verbose_level);
open(O, "> " . $ifile) || die "Could not open $ifile for writing (no write permission?)";
local $/;
binmode O;
######################################################################
sub symlinkFile
{
- my ($file,$ifile) = @_;
+ my ($lib, $file, $ifile) = @_;
if ($isunix) {
- print "symlink created for $file " unless $quiet;
+ print "$lib: symlink created for $file " if ($verbose_level);
if ( $force_relative && ($ifile =~ /^$quoted_basedir/)) {
my $t = getcwd();
my $c = -1;
print "\n" if($verbose_level);
return symlink($file, $ifile);
}
- return copyFile($file, $ifile);
+ return copyFile($lib, $file, $ifile);
}
######################################################################
chomp $module_patch_version;
}
}
- print "WARNING: Module $lib\'s pri missing QT.<module>.VERSION variable! Private headers not versioned!\n" if (!$module_version);
+ print "$lib: WARNING: Module\'s pri missing QT.<module>.VERSION variable! Private headers not versioned!\n" if (!$module_version);
my $pathtoheaders = "";
$pathtoheaders = $moduleheaders{$lib} if ($moduleheaders{$lib});
print MODULE_VERSION_HEADER_FILE "#endif // QT_". uc($lib) . "_VERSION_H\n";
close MODULE_VERSION_HEADER_FILE;
$moduleversionheader = "<srcbase>" . substr($moduleversionheader, length($basedir)) if ($verbose_level < 2);
- print "$moduleversionheader created for $lib\n" if($verbose_level);
+ print "$lib: created version header $moduleversionheader\n" if($verbose_level);
} elsif ($modulepri) {
- print "WARNING: Module $lib\'s pri file '$modulepri' not found.\nSkipped creating module version header for $lib.\n";
+ print "$lib: WARNING: Module\'s pri file '$modulepri' not found.\n$lib: Skipped creating module version header.\n";
}
}
# class =~ s,::,/,g;
# }
$class_lib_map_contents .= "QT_CLASS_LIB($full_class, $lib, $header_base)\n";
- $header_copies++ if(syncHeader("$out_basedir/include/$lib/$class", "$out_basedir/include/$lib/$header", 0, $ts));
+ $header_copies++ if(syncHeader($lib, "$out_basedir/include/$lib/$class", "$out_basedir/include/$lib/$header", 0, $ts));
# KDE-Compat headers for Phonon
if ($lib eq "phonon") {
- $header_copies++ if (syncHeader("$out_basedir/include/phonon_compat/Phonon/$class", "$out_basedir/include/$lib/$header", 0, $ts));
+ $header_copies++ if (syncHeader($lib, "$out_basedir/include/phonon_compat/Phonon/$class", "$out_basedir/include/$lib/$header", 0, $ts));
}
}
} elsif ($create_private_headers) {
}
}
foreach(@headers) { #sync them
- $header_copies++ if(syncHeader($_, $iheader, $copy_headers && !$shadow, $ts));
+ $header_copies++ if(syncHeader($lib, $_, $iheader, $copy_headers && !$shadow, $ts));
}
if($public_header) {
if ($verbose_level < 3) {
my $line_prefix = ",";
if ($new_header_dirname ne $header_dirname) {
- $line_prefix = "created header(s) for $new_header_dirname/ {";
+ $line_prefix = "$lib: created fwd-include header(s) for $new_header_dirname/ {";
$line_prefix = " }\n".$line_prefix if ($header_dirname);
$header_dirname = $new_header_dirname;
} else {
print "$line_prefix $header_base ($header_copies)";
} else { # $verbose_level >= 3
$iheader = "<srcbase>" . substr($iheader, length($basedir)) if ($verbose_level == 3);
- print "header created for $iheader ($header_copies)\n";
+ print "$lib: created $header_copies fwd-include headers for $iheader\n";
}
}
}
}
if($master_include && $master_contents) {
my $master_dir = dirname($master_include);
- mkpath $master_dir, !$quiet;
- print "header (master) created for $lib\n" unless $quiet;
+ make_path($master_dir, $lib, $verbose_level);
open MASTERINCLUDE, ">$master_include";
print MASTERINCLUDE $master_contents;
close MASTERINCLUDE;
+ print "$lib: created header (master) file\n" if($verbose_level);
}
}
}
if($headers_pri_file && $master_contents) {
my $headers_pri_dir = dirname($headers_pri_file);
- mkpath $headers_pri_dir, !$quiet;
- print "headers.pri file created for $lib\n" unless $quiet;
+ make_path($headers_pri_dir, $lib, $verbose_level);
open HEADERS_PRI_FILE, ">$headers_pri_file";
print HEADERS_PRI_FILE $headers_pri_contents;
close HEADERS_PRI_FILE;
+ print "$lib: created headers.pri file\n" if($verbose_level);
}
# create forwarding module pri in qtbase/mkspecs/modules
my $modulepri = $modulepris{$lib};
if (-e $modulepri) {
my $modulepriname = basename($modulepri);
- mkpath($module_fwd);
+ make_path($module_fwd, $lib, $verbose_level);
my $moduleprifwd = "$module_fwd/$modulepriname";
my $mod_base = $developer_build ? $basedir : $out_basedir;
my $mod_component_base = $developer_build ? $qtbasedir : $out_basedir;
}
}
} elsif ($modulepri) {
- print "WARNING: Module $lib\'s pri file '$modulepri' not found.\nSkipped creating forwarding pri for $lib.\n";
+ print "$lib: WARNING: Module\'s pri file '$modulepri' not found.\n$lib: Skipped creating forwarding pri.\n";
}
}
}
}
if($class_lib_map) {
my $class_lib_map_dir = dirname($class_lib_map);
- mkpath $class_lib_map_dir, !$quiet;
+ make_path($class_lib_map_dir, "<outdir>", $verbose_level);
open CLASS_LIB_MAP, ">$class_lib_map";
print CLASS_LIB_MAP $class_lib_map_contents;
close CLASS_LIB_MAP;
if($include) {
for my $trylib (keys(%modules)) {
if(-e "$out_basedir/include/$trylib/$include") {
- print "WARNING: $iheader includes $include when it should include $trylib/$include\n";
+ print "$lib: WARNING: $iheader includes $include when it should include $trylib/$include\n";
}
}
}
}
if ($header_skip_qt_begin_header_test == 0) {
if ($qt_begin_header_found == 0) {
- print "WARNING: $iheader does not include QT_BEGIN_HEADER\n";
+ print "$lib: WARNING: $iheader does not include QT_BEGIN_HEADER\n";
}
if ($qt_begin_header_found && $qt_end_header_found == 0) {
- print "WARNING: $iheader has QT_BEGIN_HEADER but no QT_END_HEADER\n";
+ print "$lib: WARNING: $iheader has QT_BEGIN_HEADER but no QT_END_HEADER\n";
}
}
if ($header_skip_qt_begin_namespace_test == 0) {
if ($qt_begin_namespace_found == 0) {
- print "WARNING: $iheader does not include QT_BEGIN_NAMESPACE\n";
+ print "$lib: WARNING: $iheader does not include QT_BEGIN_NAMESPACE\n";
}
if ($qt_begin_namespace_found && $qt_end_namespace_found == 0) {
- print "WARNING: $iheader has QT_BEGIN_NAMESPACE but no QT_END_NAMESPACE\n";
+ print "$lib: WARNING: $iheader has QT_BEGIN_NAMESPACE but no QT_END_NAMESPACE\n";
}
}
if ($header_skip_qt_module_test == 0) {
if ($qt_module_found == 0) {
- print "WARNING: $iheader does not include QT_MODULE\n";
+ print "$lib: WARNING: $iheader does not include QT_MODULE\n";
}
}
close(F);