summaryrefslogtreecommitdiff
path: root/klibc/klcc.in
diff options
context:
space:
mode:
authorGreg KH <greg@press.(none)>2005-06-21 16:36:29 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-21 16:36:29 -0700
commit972d318a3123b00d0ed6b78bbcf70a0965841a8e (patch)
tree8322245ad8e488ad3da9575e2d90b219a99880ea /klibc/klcc.in
parentae8d5e161fe916e39f226ce53f2c5f8b31f582a0 (diff)
parentd27d3bb05288fb5e70bc3f3fc7da1dc8ee5413a8 (diff)
Merge gregkh@ehlo.org:/home/kay/public_html/pub/scm/linux/hotplug/udev-kay
Diffstat (limited to 'klibc/klcc.in')
-rw-r--r--klibc/klcc.in15
1 files changed, 13 insertions, 2 deletions
diff --git a/klibc/klcc.in b/klibc/klcc.in
index 36c4d9b3ee..5629f24f1c 100644
--- a/klibc/klcc.in
+++ b/klibc/klcc.in
@@ -1,5 +1,7 @@
# -*- perl -*-
+use IPC::Open3;
+
# Standard includes
@includes = ("-I${prefix}/${KCROSS}include/arch/${ARCH}",
"-I${prefix}/${KCROSS}include/bits${BITSIZE}",
@@ -57,7 +59,7 @@ sub files_with_lang($$) {
# Skip object files
if ( $need ne 'obj' ) {
- unless ( $xopt eq $need ) {
+ unless ( $xopt eq $need || $need eq 'stdin') {
push(@as, '-x', $need);
$xopt = $need;
}
@@ -79,7 +81,11 @@ sub syserr($) {
# Run a program; printing out the command line if $verbose is set
sub mysystem(@) {
print STDERR join(' ', @_), "\n" if ( $verbose );
- return system(@_);
+ my $cmd = shift;
+ open(INPUT, "<&STDIN"); # dup STDIN filehandle to INPUT
+ my $childpid = open3("<&INPUT", ">&STDOUT", ">&STDERR", $cmd, @_);
+ waitpid ($childpid, 0);
+ return $?;
}
#
@@ -117,6 +123,11 @@ while ( defined($a = shift(@ARGV)) ) {
# Not an option. Must be a filename then.
push(@files, $a);
$flang{$a} = $lang || filename2lang($a);
+ } elsif ( $a eq '-' ) {
+ # gcc gets its input from stdin
+ push(@files, $a);
+ # prevent setting -x
+ $flang{$a} = 'stdin'
} elsif ( $a =~ /^-print-klibc-(.*)$/ ) {
# This test must precede -print
if ( defined($conf{$1}) ) {