Add list_config generation
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
diff --git a/scripts/generate_query_config.pl b/scripts/generate_query_config.pl
index 7855c7c..b2ce8fc 100755
--- a/scripts/generate_query_config.pl
+++ b/scripts/generate_query_config.pl
@@ -68,6 +68,7 @@
# This variable will contain the string to replace in the CHECK_CONFIG of the
# format file
my $config_check = "";
+my $list_config = "";
while (my $line = <CONFIG_FILE>) {
if ($line =~ /^(\/\/)?\s*#\s*define\s+(MBEDTLS_\w+).*/) {
@@ -84,6 +85,11 @@
$config_check .= " }\n";
$config_check .= "#endif /* $name */\n";
$config_check .= "\n";
+
+ $list_config .= "#if defined($name)\n";
+ $list_config .= " OUTPUT_MACRO_NAME_VALUE($name);\n";
+ $list_config .= "#endif /* $name */\n";
+ $list_config .= "\n";
}
}
@@ -95,6 +101,7 @@
# Replace the body of the query_config() function with the code we just wrote
$query_config_format =~ s/CHECK_CONFIG/$config_check/g;
+$query_config_format =~ s/LIST_CONFIG/$list_config/g;
# Rewrite the query_config.c file
open(QUERY_CONFIG_FILE, ">$query_config_file") or die "Opening destination file '$query_config_file': $!";