From 208d7614b345d1fbee3347436a4ce3868b50efbd Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Thu, 28 Jul 2011 13:24:36 +0200 Subject: [PATCH] In makedef.pl, read ccflags and optimize from %Config. Previously they were read by opening and parsing config.sh. Remove all code related to reading config.sh, as it is no longer needed. --- makedef.pl | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/makedef.pl b/makedef.pl index 2009eb9..69e90ca 100644 --- a/makedef.pl +++ b/makedef.pl @@ -8,8 +8,8 @@ # # Reads from information stored in # +# %Config::Config (ie config.sh) # config.h -# config.sh # global.sym # globvar.sym # intrpvar.h @@ -66,6 +66,14 @@ my %PLATFORM; defined $PLATFORM || die "PLATFORM undefined, must be one of: @PLATFORM\n"; exists $PLATFORM{$PLATFORM} || die "PLATFORM must be one of: @PLATFORM\n"; +# Is the following guard strictly necessary? Added during refactoring +# to keep the same behaviour when merging other code into here. +if ($PLATFORM ne 'win32' && $PLATFORM ne 'wince' && $PLATFORM ne 'netware') { + foreach (@Config{qw(ccflags optimize)}) { + $define{$1} = 1 while /-D(\w+)/g; + } +} + # Add the compile-time options that miniperl was built with to %define. # On Win32 these are not the same options as perl itself will be built # with since miniperl is built with a canned config (one of the win32/ @@ -89,7 +97,6 @@ my %exportperlmalloc = my $exportperlmalloc = $PLATFORM eq 'os2'; -my $config_sh = "config.sh"; my $config_h = "config.h"; my $intrpvar_h = "intrpvar.h"; my $perlvars_h = "perlvars.h"; @@ -98,22 +105,7 @@ my $globvar_sym = "globvar.sym"; my $perlio_sym = "perlio.sym"; s/^/$TARG_DIR/ foreach($intrpvar_h, $perlvars_h, $global_sym, $globvar_sym, - $perlio_sym, $config_sh); - -{ - open(CFG,$config_sh) || die "Cannot open $config_sh: $!\n"; - while () { - if (/^(?:ccflags|optimize)='(.+)'$/ - # Are the following strictly necessary? Added during refactoring - # to keep the same behaviour when merging other code into here. - && $PLATFORM ne 'win32' && $PLATFORM ne 'wince' - && $PLATFORM ne 'netware') { - $_ = $1; - $define{$1} = 1 while /-D(\w+)/g; - } - } - close(CFG); -} + $perlio_sym); open(CFG,$config_h) || die "Cannot open $config_h: $!\n"; while () { -- 2.7.4