'-fpic',
'-shared',
);
+# References to all flags checked by the parser.
+my @flag_refs = (
+ \@def_cflags,
+ \@def_cflags_format,
+ \@def_cflags_fortify,
+ \@def_cflags_stack,
+ \@def_cflags_pie,
+ \@def_cxxflags,
+ \@def_cppflags,
+ \@def_cppflags_fortify,
+ \@def_ldflags,
+ \@def_ldflags_relro,
+ \@def_ldflags_bindnow,
+);
+# References to all used flags.
+my @flag_refs_all = (
+ @flag_refs,
+ \@def_ldflags_pie,
+ \@def_ldflags_pic,
+);
# Renaming rules for the output so the regex parts are not visible. Also
# stores string values of flag regexps above, see compile_flag_regexp().
my %flag_renames = (
# Precompile all flag regexps. any_flags_used(), all_flags_used() get a lot
# faster with this.
-@def_cflags = compile_flag_regexp(\%flag_renames, @def_cflags);
-@def_cflags_format = compile_flag_regexp(\%flag_renames, @def_cflags_format);
-@def_cflags_fortify = compile_flag_regexp(\%flag_renames, @def_cflags_fortify);
-@def_cflags_stack = compile_flag_regexp(\%flag_renames, @def_cflags_stack);
-@def_cflags_pie = compile_flag_regexp(\%flag_renames, @def_cflags_pie);
-@def_cxxflags = compile_flag_regexp(\%flag_renames, @def_cxxflags);
-@def_cppflags = compile_flag_regexp(\%flag_renames, @def_cppflags);
-@def_cppflags_fortify = compile_flag_regexp(\%flag_renames, @def_cppflags_fortify);
-@def_ldflags = compile_flag_regexp(\%flag_renames, @def_ldflags);
-@def_ldflags_relro = compile_flag_regexp(\%flag_renames, @def_ldflags_relro);
-@def_ldflags_bindnow = compile_flag_regexp(\%flag_renames, @def_ldflags_bindnow);
-@def_ldflags_pie = compile_flag_regexp(\%flag_renames, @def_ldflags_pie);
-@def_ldflags_pic = compile_flag_regexp(\%flag_renames, @def_ldflags_pic);
+foreach my $flags (@flag_refs_all) {
+ @{$flags} = compile_flag_regexp(\%flag_renames, @{$flags});
+}
# Final exit code.
my $exit = 0;