diff options
author | kay.sievers@vrfy.org <kay.sievers@vrfy.org> | 2005-03-04 04:26:44 +0100 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 23:39:48 -0700 |
commit | e5f053b5312a0f8d62a2bcff8ddb095052d228bc (patch) | |
tree | 54fa17afcdb1c8919710da70f55e267d2a758e8e /klibc/makeklcc.pl | |
parent | 6d7a6d08c2386611e4ccb62ce660ceb53b1bf79f (diff) |
[PATCH] klibc: update v0.205
Diffstat (limited to 'klibc/makeklcc.pl')
-rw-r--r-- | klibc/makeklcc.pl | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/klibc/makeklcc.pl b/klibc/makeklcc.pl new file mode 100644 index 0000000000..ea3f8a8256 --- /dev/null +++ b/klibc/makeklcc.pl @@ -0,0 +1,36 @@ +#!/usr/bin/perl +# +# Combine klibc.config, klcc.in to produce a klcc script +# +# Usage: makeklcc klcc.in klibc.config perlpath +# + +($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"; + } +} +close(KLIBCCONF); + +open(KLCCIN, '<', $klccin) or die "$0: cannot open $klccin: $!\n"; +while ( defined($l = <KLCCIN>) ) { + print $l; +} +close(KLCCIN); + |