diff options
Diffstat (limited to 'config.profiles/symbian/headerexport')
-rw-r--r-- | config.profiles/symbian/headerexport | 411 |
1 files changed, 140 insertions, 271 deletions
diff --git a/config.profiles/symbian/headerexport b/config.profiles/symbian/headerexport index d9f99e5..e59979c 100644 --- a/config.profiles/symbian/headerexport +++ b/config.profiles/symbian/headerexport @@ -48,7 +48,6 @@ my %modules = ( # path to module name map "QtDesigner" => "$basedir/tools/designer/src/lib", "QtUiTools" => "$basedir/tools/designer/src/uitools", "QtDBus" => "$basedir/src/dbus", -# "QtWebKit" => "$basedir/src/3rdparty/webkit/WebCore", // :TODO:disabled since QtWebKit built separately, better logic needed here. "phonon" => "$basedir/src/phonon", "QtMultimedia" => "$basedir/src/multimedia", "QtMeeGoGraphicsSystemHelper" => "$basedir/tools/qmeegographicssystemhelper", @@ -61,22 +60,12 @@ my %moduleheaders = ( # restrict the module headers to those found in relative p #$modules{"QtCore"} .= ";$basedir/mkspecs/" . $ENV{"MKSPEC"} if defined $ENV{"MKSPEC"}; # global variables (modified by options) -my $module = 0; -my $showonly = 0; -my $quiet = 0; -my $remove_stale = 1; my $force_win = 0; -my $force_relative = 0; my $check_includes = 0; -my $copy_headers = 0; my $create_uic_class_map = 1; -my $create_private_headers = 1; -my $oneway = 0; my @modules_to_sync ; -$force_relative = 1 if ( -d "/System/Library/Frameworks" ); my $out_basedir = $basedir; $out_basedir =~ s=\\=/=g; -my $out_subdir = 'include'; # functions ---------------------------------------------------------- @@ -90,17 +79,8 @@ my $out_subdir = 'include'; sub showUsage { print "$0 usage:\n"; - print " -copy Copy headers instead of include-fwd(default: " . ($copy_headers ? "yes" : "no") . ")\n"; - print " -remove-stale Removes stale headers (default: " . ($remove_stale ? "yes" : "no") . ")\n"; - print " -relative Force relative symlinks (default: " . ($force_relative ? "yes" : "no") . ")\n"; print " -windows Force platform to Windows (default: " . ($force_win ? "yes" : "no") . ")\n"; - print " -showonly Show action but not perform (default: " . ($showonly ? "yes" : "no") . ")\n"; print " -outdir <PATH> Specify output directory for sync (default: $out_basedir)\n"; - print " -outsubdir <DIR> Target subdir under outdir (default: $out_subdir)\n"; - print " -public Create only public headers (default: " . ($create_private_headers ? "no" : "yes") . ")\n"; - print " -oneway Don't sync back from outdir (default: " . ($oneway ? "yes" : "no") . ")\n"; - print " -quiet Only report problems, not activity (default: " . ($quiet ? "yes" : "no") . ")\n"; - print " -separate-module <NAME>:<PROFILEDIR>:<HEADERDIR> Create headers for <NAME> with original headers in <HEADERDIR> relative to <PROFILEDIR> \n"; print " -help This help\n"; exit 0; } @@ -331,7 +311,7 @@ sub syncHeader { unless(-e $header) { my $header_dir = dirname($header); - mkpath $header_dir, !$quiet; + mkpath $header_dir; #write it my $iheader_out = fixPaths($iheader, $header_dir); @@ -459,7 +439,7 @@ sub copyFile close I; my $ifile_dir = dirname($ifile); - mkpath $ifile_dir, !$quiet unless(-e $ifile_dir); + mkpath $ifile_dir unless(-e $ifile_dir); open(O, "> " . $ifile) || die "Could not open $ifile for writing (no write permission?)"; local $/; binmode O; @@ -469,36 +449,6 @@ sub copyFile } ###################################################################### -# Syntax: symlinkFile(file, ifile) -# Params: file, string, filename to create "symlink" for -# ifile, string, destination name of symlink -# -# Purpose: File is symlinked to ifile (or copied if filesystem doesn't -# support symlink). -# Returns: 1 on success, else 0. -###################################################################### -sub symlinkFile -{ - my ($file,$ifile) = @_; - - if ($isunix) { - print "symlink created for $file " unless $quiet; - if ( $force_relative && ($ifile =~ /^$basedir/)) { - my $t = getcwd(); - my $c = -1; - my $p = "../"; - $t =~ s-^$basedir/--; - $p .= "../" while( ($c = index( $t, "/", $c + 1)) != -1 ); - $file =~ s-^$basedir/-$p-; - print " ($file)\n" unless $quiet; - } - print "\n" unless $quiet; - return symlink($file, $ifile); - } - return copyFile($file, $ifile); -} - -###################################################################### # Syntax: findFiles(dir, match, descend) # Params: dir, string, directory to search for name # match, string, regular expression to match in dir @@ -550,9 +500,6 @@ while ( @ARGV ) { if ($arg eq "-h" || $arg eq "-help" || $arg eq "?") { $var = "show_help"; $val = "yes"; - } elsif($arg eq "-copy") { - $var = "copy"; - $val = "yes"; } elsif($arg eq "-o" || $arg eq "-outdir") { $var = "output"; $val = shift @ARGV; @@ -567,96 +514,28 @@ while ( @ARGV ) { } elsif($arg eq "-inc") { $var = "output"; $val = shift @ARGV; - } elsif($arg eq "-module") { - $var = "module"; - $val = shift @ARGV; - } elsif($arg eq "-separate-module") { - $var = "separate-module"; - $val = shift @ARGV; - } elsif($arg eq "-show") { - $var = "showonly"; - $val = "yes"; - } elsif($arg eq "-quiet") { - $var = "quiet"; - $val = "yes"; } elsif($arg eq "-base-dir") { # skip, it's been dealt with at the top of the file shift @ARGV; next; - } elsif("$arg" eq "-outsubdir") { - $var = "outsubdir"; - $val = shift @ARGV; - } elsif("$arg" eq "-public") { - $var = "public"; - $val = "yes"; - } elsif("$arg" eq "-oneway") { - $var = "oneway"; - $val = "yes"; } #do something if(!$var || $var eq "show_help") { print "Unknown option: $arg\n\n" if(!$var); showUsage(); - } elsif ($var eq "copy") { - if($val eq "yes") { - $copy_headers++; - } elsif($showonly) { - $copy_headers--; - } - } elsif ($var eq "showonly") { - if($val eq "yes") { - $showonly++; - } elsif($showonly) { - $showonly--; - } - } elsif ($var eq "quiet") { - if($val eq "yes") { - $quiet++; - } elsif($quiet) { - $quiet--; - } } elsif ($var eq "check-includes") { if($val eq "yes") { $check_includes++; } elsif($check_includes) { $check_includes--; } - } elsif ($var eq "remove-stale") { - if($val eq "yes") { - $remove_stale++; - } elsif($remove_stale) { - $remove_stale--; - } } elsif ($var eq "windows") { if($val eq "yes") { $force_win++; } elsif($force_win) { $force_win--; } - } elsif ($var eq "relative") { - if($val eq "yes") { - $force_relative++; - } elsif($force_relative) { - $force_relative--; - } - } elsif ("$var" eq "public") { - $create_private_headers = ("$val" eq "yes" ? 0 : 1); - } elsif ("$var" eq "oneway") { - $oneway = ("$val" eq "yes" ? 1 : 0); - } elsif ("$var" eq "outsubdir") { - $out_subdir = $val; - } elsif ($var eq "module") { - print "module :$val:\n" unless $quiet; - die "No such module: $val" unless(defined $modules{$val}); - push @modules_to_sync, $val; - } elsif ($var eq "separate-module") { - my ($module, $prodir, $headerdir) = split(/:/, $val); - $modules{$module} = $prodir; - push @modules_to_sync, $module; - $moduleheaders{$module} = $headerdir; - $create_uic_class_map = 0; - $create_private_headers = 0; } elsif ($var eq "output") { my $outdir = $val; if(checkRelative($outdir)) { @@ -675,8 +554,8 @@ while ( @ARGV ) { $isunix = checkUnix; #cache checkUnix # create path -mkpath "$out_basedir/include", !$quiet; -mkpath "$out_basedir/$out_subdir/Qt", !$quiet; +mkpath "$out_basedir/include"; +mkpath "$out_basedir/mw/Qt"; my @ignore_headers = (); my $class_lib_map_contents = ""; @@ -734,41 +613,39 @@ foreach my $lib (@modules_to_sync) { } #remove the old files - if($remove_stale) { - my @subdirs = ("$out_basedir/$out_subdir/$lib"); - foreach my $subdir (@subdirs) { - if (opendir DIR, $subdir) { - while(my $t = readdir(DIR)) { - my $file = "$subdir/$t"; - if(-d $file) { - push @subdirs, $file unless($t eq "." || $t eq ".."); - } else { - my @files = ($file); - #push @files, "$out_basedir/$out_subdir/Qt/$t" if(-e "$out_basedir/$out_subdir/Qt/$t"); - foreach my $file (@files) { - my $remove_file = 0; - if(open(F, "<$file")) { - while(my $line = <F>) { - chomp $line; - if($line =~ /^\#include \"([^\"]*)\"$/) { - my $include = $1; - $include = $subdir . "/" . $include unless(substr($include, 0, 1) eq "/"); - $remove_file = 1 unless(-e $include); - } else { - $remove_file = 0; - last; - } + my @subdirs = ("$out_basedir/mw/$lib"); + foreach my $subdir (@subdirs) { + if (opendir DIR, $subdir) { + while(my $t = readdir(DIR)) { + my $file = "$subdir/$t"; + if(-d $file) { + push @subdirs, $file unless($t eq "." || $t eq ".."); + } else { + my @files = ($file); + #push @files, "$out_basedir/mw/Qt/$t" if(-e "$out_basedir/mw/Qt/$t"); + foreach my $file (@files) { + my $remove_file = 0; + if(open(F, "<$file")) { + while(my $line = <F>) { + chomp $line; + if($line =~ /^\#include \"([^\"]*)\"$/) { + my $include = $1; + $include = $subdir . "/" . $include unless(substr($include, 0, 1) eq "/"); + $remove_file = 1 unless(-e $include); + } else { + $remove_file = 0; + last; } - close(F); - unlink $file if($remove_file); } + close(F); + unlink $file if($remove_file); } } } - closedir DIR; } - + closedir DIR; } + } #create the new ones @@ -813,91 +690,85 @@ foreach my $lib (@modules_to_sync) { my $iheader = $subdir . "/" . $header; $iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow); my @classes = $public_header ? classNames($iheader) : (); - if($showonly) { - print "$header [$lib]\n"; - foreach(@classes) { - print "SYMBOL: $_\n"; - } - } else { - #find out all the places it goes.. - my @headers; - if ($public_header) { - @headers = ( "$out_basedir/$out_subdir/$lib/$header" ); - # write forwarding headers to include/Qt - if ($lib ne "phonon" && $subdir =~ /^$basedir\/src/) { - my $file_name = "$out_basedir/$out_subdir/Qt/$header"; - my $file_op = '>'; - my $header_content = ''; - if (exists $colliding_headers{$file_name}) { - $file_op = '>>'; - } else { - $colliding_headers{$file_name} = 1; - my $warning_msg = 'Inclusion of header files from include/Qt is deprecated.'; - $header_content = "#ifndef QT_NO_QT_INCLUDE_WARN\n" . - " #if defined(__GNUC__)\n" . - " #warning \"$warning_msg\"\n" . - " #elif defined(_MSC_VER)\n" . - " #pragma message(\"WARNING: $warning_msg\")\n" . - " #endif\n". - "#endif\n\n"; - } - $header_content .= '#include "' . "../$lib/$header" . "\"\n"; - open HEADERFILE, $file_op, $file_name or die "unable to open '$file_name' : $!\n"; - print HEADERFILE $header_content; - close HEADERFILE; + #find out all the places it goes.. + my @headers; + if ($public_header) { + @headers = ( "$out_basedir/mw/$lib/$header" ); + + # write forwarding headers to include/Qt + if ($lib ne "phonon" && $subdir =~ /^$basedir\/src/) { + my $file_name = "$out_basedir/mw/Qt/$header"; + my $file_op = '>'; + my $header_content = ''; + if (exists $colliding_headers{$file_name}) { + $file_op = '>>'; + } else { + $colliding_headers{$file_name} = 1; + my $warning_msg = 'Inclusion of header files from include/Qt is deprecated.'; + $header_content = "#ifndef QT_NO_QT_INCLUDE_WARN\n" . + " #if defined(__GNUC__)\n" . + " #warning \"$warning_msg\"\n" . + " #elif defined(_MSC_VER)\n" . + " #pragma message(\"WARNING: $warning_msg\")\n" . + " #endif\n". + "#endif\n\n"; } + $header_content .= '#include "' . "../$lib/$header" . "\"\n"; + open HEADERFILE, $file_op, $file_name or die "unable to open '$file_name' : $!\n"; + print HEADERFILE $header_content; + close HEADERFILE; + } - foreach my $full_class (@classes) { - my $header_base = basename($header); - # Strip namespaces: - my $class = $full_class; - $class =~ s/^.*:://; + foreach my $full_class (@classes) { + my $header_base = basename($header); + # Strip namespaces: + my $class = $full_class; + $class =~ s/^.*:://; # if ($class =~ m/::/) { # class =~ s,::,/,g; # } - $class_lib_map_contents .= "QT_CLASS_LIB($full_class, $lib, $header_base)\n"; - $header_copies++ if(syncHeader("$out_basedir/$out_subdir/$lib/$class", "$out_basedir/$out_subdir/$lib/$header", 0)); + $class_lib_map_contents .= "QT_CLASS_LIB($full_class, $lib, $header_base)\n"; + $header_copies++ if(syncHeader("$out_basedir/mw/$lib/$class", "$out_basedir/mw/$lib/$header", 0)); - # KDE-Compat headers for Phonon - if ($lib eq "phonon") { - $header_copies++ if (syncHeader("$out_basedir/$out_subdir/phonon_compat/Phonon/$class", "$out_basedir/$out_subdir/$lib/$header", 0)); - } + # KDE-Compat headers for Phonon + if ($lib eq "phonon") { + $header_copies++ if (syncHeader("$out_basedir/mw/phonon_compat/Phonon/$class", "$out_basedir/mw/$lib/$header", 0)); } - } elsif ($create_private_headers) { - @headers = ( "$out_basedir/$out_subdir/$lib/private/$header" ); - } - foreach(@headers) { #sync them - $header_copies++ if(syncHeader($_, $iheader, $copy_headers)); } + } else { + @headers = ( "$out_basedir/mw/$lib/private/$header" ); + } + foreach(@headers) { #sync them + $header_copies++ if(syncHeader($_, $iheader, 1)); + } - if($public_header) { - #put it into the master file - $master_contents .= "#include \"$public_header\"\n" if(shouldMasterInclude($iheader)); + if($public_header) { + #put it into the master file + $master_contents .= "#include \"$public_header\"\n" if(shouldMasterInclude($iheader)); - #deal with the install directives - if($public_header) { - my $pri_install_iheader = fixPaths($iheader, $current_dir); - foreach my $class (@classes) { - # Strip namespaces: - $class =~ s/^.*:://; + #deal with the install directives + if($public_header) { + my $pri_install_iheader = fixPaths($iheader, $current_dir); + foreach my $class (@classes) { + # Strip namespaces: + $class =~ s/^.*:://; # if ($class =~ m/::/) { # $class =~ s,::,/,g; # } - my $class_header = fixPaths("$out_basedir/$out_subdir/$lib/$class", - $current_dir) . " "; - $pri_install_classes .= $class_header - unless($pri_install_classes =~ $class_header); - } - $pri_install_files.= "$pri_install_iheader ";; + my $class_header = fixPaths("$out_basedir/mw/$lib/$class", + $current_dir) . " "; + $pri_install_classes .= $class_header + unless($pri_install_classes =~ $class_header); } + $pri_install_files.= "$pri_install_iheader ";; } - else { - my $pri_install_iheader = fixPaths($iheader, $current_dir); - $pri_install_pfiles.= "$pri_install_iheader ";; - } } - print "header created for $iheader ($header_copies)\n" if($header_copies > 0 && !$quiet); + else { + my $pri_install_iheader = fixPaths($iheader, $current_dir); + $pri_install_pfiles.= "$pri_install_iheader ";; + } + print "header created for $iheader ($header_copies)\n" if($header_copies > 0); } } } @@ -906,59 +777,57 @@ foreach my $lib (@modules_to_sync) { # close the master include: $master_contents .= "#endif\n"; - unless($showonly) { - my @master_includes; - push @master_includes, "$out_basedir/$out_subdir/$lib/$lib"; - push @master_includes, "$out_basedir/$out_subdir/phonon_compat/Phonon/Phonon" if ($lib eq "phonon"); - foreach my $master_include (@master_includes) { - #generate the "master" include file - my @tmp = split(/;/,$modules{$lib}); - $pri_install_files .= fixPaths($master_include, $tmp[0]) . " "; #get the master file installed too - if($master_include && -e $master_include) { - open MASTERINCLUDE, "<$master_include"; - local $/; - binmode MASTERINCLUDE; - my $oldmaster = <MASTERINCLUDE>; - close MASTERINCLUDE; - $oldmaster =~ s/\r//g; # remove \r's , so comparison is ok on all platforms - $master_include = 0 if($oldmaster eq $master_contents); - } - if($master_include && $master_contents) { - my $master_dir = dirname($master_include); - mkpath $master_dir, !$quiet; - print "header (master) created for $lib\n" unless $quiet; - open MASTERINCLUDE, ">$master_include"; - print MASTERINCLUDE $master_contents; - close MASTERINCLUDE; - } - } - - #handle the headers.pri for each module - my $headers_pri_contents = ""; - $headers_pri_contents .= "SYNCQT.HEADER_FILES = $pri_install_files\n"; - $headers_pri_contents .= "SYNCQT.HEADER_CLASSES = $pri_install_classes\n"; - $headers_pri_contents .= "SYNCQT.PRIVATE_HEADER_FILES = $pri_install_pfiles\n"; - my $headers_pri_file = "$out_basedir/$out_subdir/$lib/headers.pri"; - if(-e $headers_pri_file) { - open HEADERS_PRI_FILE, "<$headers_pri_file"; + my @master_includes; + push @master_includes, "$out_basedir/mw/$lib/$lib"; + push @master_includes, "$out_basedir/mw/phonon_compat/Phonon/Phonon" if ($lib eq "phonon"); + foreach my $master_include (@master_includes) { + #generate the "master" include file + my @tmp = split(/;/,$modules{$lib}); + $pri_install_files .= fixPaths($master_include, $tmp[0]) . " "; #get the master file installed too + if($master_include && -e $master_include) { + open MASTERINCLUDE, "<$master_include"; local $/; - binmode HEADERS_PRI_FILE; - my $old_headers_pri_contents = <HEADERS_PRI_FILE>; - close HEADERS_PRI_FILE; - $old_headers_pri_contents =~ s/\r//g; # remove \r's , so comparison is ok on all platforms - $headers_pri_file = 0 if($old_headers_pri_contents eq $headers_pri_contents); + binmode MASTERINCLUDE; + my $oldmaster = <MASTERINCLUDE>; + close MASTERINCLUDE; + $oldmaster =~ s/\r//g; # remove \r's , so comparison is ok on all platforms + $master_include = 0 if($oldmaster eq $master_contents); } - 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; - open HEADERS_PRI_FILE, ">$headers_pri_file"; - print HEADERS_PRI_FILE $headers_pri_contents; - close HEADERS_PRI_FILE; + if($master_include && $master_contents) { + my $master_dir = dirname($master_include); + mkpath $master_dir; + print "header (master) created for $lib\n"; + open MASTERINCLUDE, ">$master_include"; + print MASTERINCLUDE $master_contents; + close MASTERINCLUDE; } } + + #handle the headers.pri for each module + my $headers_pri_contents = ""; + $headers_pri_contents .= "SYNCQT.HEADER_FILES = $pri_install_files\n"; + $headers_pri_contents .= "SYNCQT.HEADER_CLASSES = $pri_install_classes\n"; + $headers_pri_contents .= "SYNCQT.PRIVATE_HEADER_FILES = $pri_install_pfiles\n"; + my $headers_pri_file = "$out_basedir/mw/$lib/headers.pri"; + if(-e $headers_pri_file) { + open HEADERS_PRI_FILE, "<$headers_pri_file"; + local $/; + binmode HEADERS_PRI_FILE; + my $old_headers_pri_contents = <HEADERS_PRI_FILE>; + close HEADERS_PRI_FILE; + $old_headers_pri_contents =~ s/\r//g; # remove \r's , so comparison is ok on all platforms + $headers_pri_file = 0 if($old_headers_pri_contents eq $headers_pri_contents); + } + if($headers_pri_file && $master_contents) { + my $headers_pri_dir = dirname($headers_pri_file); + mkpath $headers_pri_dir; + print "headers.pri file created for $lib\n"; + open HEADERS_PRI_FILE, ">$headers_pri_file"; + print HEADERS_PRI_FILE $headers_pri_contents; + close HEADERS_PRI_FILE; + } } -unless($showonly || !$create_uic_class_map) { +unless(!$create_uic_class_map) { my $class_lib_map = "$out_basedir/src/tools/uic/qclass_lib_map.h"; if(-e $class_lib_map) { open CLASS_LIB_MAP, "<$class_lib_map"; @@ -971,7 +840,7 @@ unless($showonly || !$create_uic_class_map) { } if($class_lib_map) { my $class_lib_map_dir = dirname($class_lib_map); - mkpath $class_lib_map_dir, !$quiet; + mkpath $class_lib_map_dir; open CLASS_LIB_MAP, ">$class_lib_map"; print CLASS_LIB_MAP $class_lib_map_contents; close CLASS_LIB_MAP; @@ -1054,7 +923,7 @@ if($check_includes) { } if($include) { for my $trylib (keys(%modules)) { - if(-e "$out_basedir/$out_subdir/$trylib/$include") { + if(-e "$out_basedir/mw/$trylib/$include") { print "WARNING: $iheader includes $include when it should include $trylib/$include\n"; } } |