From c7c3e1ec3577226d359198072a9a5bbcef285e63 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Wed, 24 Mar 2010 18:02:58 +0200 Subject: support cflags-devmode if dev-mode enabled * Read makeopts to check if devmode was enabled by the configure script. * If so, also use cflags-devmode.xml . --- menuselect/menuselect | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/menuselect/menuselect b/menuselect/menuselect index 32ba175..20daead 100755 --- a/menuselect/menuselect +++ b/menuselect/menuselect @@ -71,6 +71,9 @@ my %ModInfo = (); # extract configuration from kernel modules: my $AutoconfDepsFile = "build_tools/menuselect-deps"; +my $AutoconfOptsFile = "makeopts"; +my %ConfigureOpts = (); # + # configuration file to read for some directives: my $ConfFile = "build_tools/conf"; @@ -290,6 +293,23 @@ sub get_autoconf_deps() { close DEPS; } +# Get the available libraries that autoconf generated. +sub get_autoconf_opts() { + open OPTS, $AutoconfOptsFile or + die "Failed to open $AutoconfOptsFile. Aborting: $!\n"; + + while () { + chomp; + next if /^(#|$)/; + my ($var, $val) = split /\s*=\s*/, $_, 2; + $ConfigureOpts{$var} = $val; + } + close OPTS; + if (not exists $ConfigureOpts{AST_DEVMODE}) { + $ConfigureOpts{AST_DEVMODE} = 'no'; + } +} + # Read our specific config file. # # Its format: @@ -520,7 +540,12 @@ sub check_dependencies() { extract_subdirs(@Subdirs); + get_autoconf_opts(); + parse_menuselect_xml_file('build_tools/cflags.xml'); + if ($ConfigureOpts{AST_DEVMODE} eq 'yes') { + parse_menuselect_xml_file('build_tools/cflags-devmode.xml'); + } parse_menuselect_xml_file('sounds/sounds.xml'); apply_random_drop(); -- cgit v1.2.3