Change the ELF linker version script creator to take no parameters

It only needs stdin now, instead of stdin plus a separate file containing
a list of file names.

Change-Id: I9f3db030001e47e4a4e5ffff1425b76884cc7ca0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This commit is contained in:
Thiago Macieira 2016-01-02 18:55:14 -02:00
parent 15b65e7a5f
commit 29f41e5e38
2 changed files with 21 additions and 33 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/env perl
#############################################################################
##
## Copyright (C) 2015 Intel Corporation
## Copyright (C) 2016 Intel Corporation
## Contact: http://www.qt.io/licensing/
##
## This file is part of the build configuration tools of the Qt Toolkit.
@ -33,40 +33,26 @@
#############################################################################
use strict;
my $syntax = "findclasslist.pl <file (containing private header list)>\n" .
"Replaces \@CLASSLIST\@ with the classes found in the header files\n";
die("Expected exactly one argument") if (@ARGV != 1);
my @headers = ();
# Expand contents of the command-line arguments file
open ARGFILE, "<$ARGV[0]" or die("Could not open arguments file $ARGV[0]: $!");
while (my $line = <ARGFILE>) {
chomp($line);
push @headers, $line;
}
close ARGFILE;
my $syntax = "findclasslist.pl\n" .
"Replaces each \@FILE:filename\@ in stdin with the classes found in that file\n";
$\ = $/;
while (<STDIN>) {
chomp;
unless (/\@CLASSLIST\@/) {
unless (/\@FILE:(.*)\@/) {
print;
next;
}
# Replace @CLASSLIST@ with the class list
for my $header (@headers) {
open HDR, "<$header" or die("Could not open header $header: $!");
my $comment = " /* $header */";
while (my $line = <HDR>) {
# Match a struct or class declaration, but not a forward declaration
$line =~ /^(?:struct|class) (?:Q_.*_EXPORT)? (\w+)(?!;)/ or next;
print $comment if $comment;
printf " *%d%s*;\n", length $1, $1;
$comment = 0;
}
close HDR;
# Replace this line with the class list
open HDR, "<$1" or die("Could not open header $1: $!");
my $comment = " /* $1 */";
while (my $line = <HDR>) {
# Match a struct or class declaration, but not a forward declaration
$line =~ /^(?:struct|class) (?:Q_.*_EXPORT)? (\w+)(?!;)/ or next;
print $comment if $comment;
printf " *%d%s*;\n", length $1, $1;
$comment = 0;
}
close HDR;
}

View File

@ -199,7 +199,10 @@ android: CONFIG += qt_android_deps no_linker_version_script
verscript_content = "Qt_$${QT_MAJOR_VERSION}_PRIVATE_API { *; };"
} else {
verscript_content = "Qt_$${QT_MAJOR_VERSION}_PRIVATE_API {" \
" qt_private_api_tag*;" "@CLASSLIST@" "};"
" qt_private_api_tag*;"
for(header, SYNCQT.PRIVATE_HEADER_FILES): \
verscript_content += " @FILE:$${_PRO_FILE_PWD_}/$$header@"
verscript_content += "};"
current = Qt_$$QT_MAJOR_VERSION
verscript_content += "$$current { *; };"
@ -213,13 +216,12 @@ android: CONFIG += qt_android_deps no_linker_version_script
else: verscript_content += "$$current {} $$previous;"
}
# Add a post-processing step to replace the @CLASSLIST@
verscriptprocess.commands = perl $${PWD}/data/unix/findclasslist.pl < $${verscript}.in $${verscript}.in.args > $@
# Add a post-processing step to replace the @FILE:filename@
verscriptprocess.commands = perl $${PWD}/data/unix/findclasslist.pl < $${verscript}.in > $@
verscriptprocess.target = $$verscript
for(header, SYNCQT.PRIVATE_HEADER_FILES): \
verscriptprocess.depends += $${_PRO_FILE_PWD_}/$$header
write_file($${verscript}.in.args, verscriptprocess.depends)|error("Aborting.")
verscriptprocess.depends += $${verscript}.in $${verscript}.in.args
verscriptprocess.depends += $${verscript}.in
QMAKE_EXTRA_TARGETS += verscriptprocess
PRE_TARGETDEPS += $$verscript
verscript = $${verscript}.in