diff options
Diffstat (limited to 'klibc/makeklcc.pl')
-rw-r--r-- | klibc/makeklcc.pl | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/klibc/makeklcc.pl b/klibc/makeklcc.pl index ea3f8a8256..f8a6294db3 100644 --- a/klibc/makeklcc.pl +++ b/klibc/makeklcc.pl @@ -7,23 +7,16 @@ ($klccin, $klibcconf, $perlpath) = @ARGV; -# This should probably handle quotes and escapes... -sub string2list($) -{ - my($s) = @_; - - $s =~ s/\s+/\',\'/g; - return "(\'".$s."\')"; -} - print "#!${perlpath}\n"; open(KLIBCCONF, '<', $klibcconf) or die "$0: cannot open $klibcconf: $!\n"; while ( defined($l = <KLIBCCONF>) ) { chomp $l; - if ( $l =~ /=/ ) { - print "\$$` = \"\Q$'\E\";\n"; - print "\@$` = ", string2list("$'"), ";\n"; + if ( $l =~ /^([^=]+)\=(.*)$/ ) { + $n = $1; $s = $2; + print "\$$n = \"\Q$s\E\";\n"; + print "\@$n = qw($s);\n"; + print "\$conf{\'\L$n\E\'} = \\\$$n;\n"; } } close(KLIBCCONF); |