diff options
author | Matthieu Patou <mat@matws.net> | 2010-12-10 02:03:40 +0300 |
---|---|---|
committer | Matthieu Patou <mat@samba.org> | 2010-12-10 01:26:44 +0100 |
commit | 21b0d5e3b10711e6ce3bfad0c1ee2da09a60e232 (patch) | |
tree | 7f348d7c4d895e1f4237aee7b46d910fee1c5703 /pidl/lib | |
parent | 301d59caf2ee6f49e108b748b0e38221dec9bb96 (diff) | |
download | samba-21b0d5e3b10711e6ce3bfad0c1ee2da09a60e232.tar.gz samba-21b0d5e3b10711e6ce3bfad0c1ee2da09a60e232.tar.bz2 samba-21b0d5e3b10711e6ce3bfad0c1ee2da09a60e232.zip |
pidl: use $CC -E if $CPP is not defined, if both undefined use cpp
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Fri Dec 10 01:26:44 CET 2010 on sn-devel-104
Diffstat (limited to 'pidl/lib')
-rw-r--r-- | pidl/lib/Parse/Pidl/IDL.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pidl/lib/Parse/Pidl/IDL.pm b/pidl/lib/Parse/Pidl/IDL.pm index de605c7024..bafa2cec61 100644 --- a/pidl/lib/Parse/Pidl/IDL.pm +++ b/pidl/lib/Parse/Pidl/IDL.pm @@ -2619,11 +2619,17 @@ sub parse_file($$) my $saved_delim = $/; undef $/; my $cpp = $ENV{CPP}; + my $options = ""; if (! defined $cpp) { - $cpp = "cpp"; + if (defined $ENV{CC}) { + $cpp = "$ENV{CC}"; + $options = "-E"; + } else { + $cpp = "cpp"; + } } my $includes = join('',map { " -I$_" } @$incdirs); - my $data = `$cpp -D__PIDL__$includes -xc "$filename"`; + my $data = `$cpp $options -D__PIDL__$includes -xc "$filename"`; $/ = $saved_delim; return parse_string($data, $filename); |