diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-11-01 10:30:34 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:09 -0500 |
commit | 90067934cd3195df80f8b1e614629d51fffcb38b (patch) | |
tree | 8229732147ad755c5015c9bc2c5a270d47f6c75e /source4/build | |
parent | 668ecaa325e827f2875295b121bbfc083702b77e (diff) | |
download | samba-90067934cd3195df80f8b1e614629d51fffcb38b.tar.gz samba-90067934cd3195df80f8b1e614629d51fffcb38b.tar.bz2 samba-90067934cd3195df80f8b1e614629d51fffcb38b.zip |
r3428: switched to using minimal includes for the auto-generated RPC code.
The thing that finally convinced me that minimal includes was worth
pursuing for rpc was a compiler (tcc) that failed to build Samba due
to reaching internal limits of the size of include files. Also the
fact that includes.h.gch was 16MB, which really seems excessive. This
patch brings it back to 12M, which is still too large, but
better. Note that this patch speeds up compile times for both the pch
and non-pch case.
This change also includes the addition iof a "depends()" option in our
IDL files, allowing you to specify that one IDL file depends on
another. This capability was needed for the auto-includes generation.
(This used to be commit b8f5fa8ac8e8725f3d321004f0aedf4246fc6b49)
Diffstat (limited to 'source4/build')
-rw-r--r-- | source4/build/pidl/header.pm | 7 | ||||
-rw-r--r-- | source4/build/pidl/parser.pm | 9 | ||||
-rwxr-xr-x | source4/build/pidl/tables.pl | 22 |
3 files changed, 33 insertions, 5 deletions
diff --git a/source4/build/pidl/header.pm b/source4/build/pidl/header.pm index 58707a90a5..cc14942f0c 100644 --- a/source4/build/pidl/header.pm +++ b/source4/build/pidl/header.pm @@ -320,6 +320,13 @@ sub HeaderInterface($) $res .= "#ifndef _HEADER_NDR_$interface->{NAME}\n"; $res .= "#define _HEADER_NDR_$interface->{NAME}\n\n"; + if (defined $interface->{PROPERTIES}->{depends}) { + my @d = split / /, $interface->{PROPERTIES}->{depends}; + foreach my $i (@d) { + $res .= "#include \"librpc/gen_ndr/ndr_$i\.h\"\n"; + } + } + if (defined $interface->{PROPERTIES}->{uuid}) { my $name = uc $interface->{NAME}; $res .= "#define DCERPC_$name\_UUID " . diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm index cec972911e..c52be637ec 100644 --- a/source4/build/pidl/parser.pm +++ b/source4/build/pidl/parser.pm @@ -1563,11 +1563,18 @@ sub Parse($$) { my($idl) = shift; my($filename) = shift; + my $h_filename = $filename; + + if ($h_filename =~ /(.*)\.c/) { + $h_filename = "$1.h"; + } open(OUT, ">$filename") || die "can't open $filename"; pidl "/* parser auto-generated by pidl */\n\n"; - pidl "#include \"includes.h\"\n\n"; + pidl "#include \"includes.h\"\n"; + pidl "#include \"$h_filename\"\n\n"; + foreach my $x (@{$idl}) { if ($x->{TYPE} eq "INTERFACE") { needed::BuildNeeded($x); diff --git a/source4/build/pidl/tables.pl b/source4/build/pidl/tables.pl index 5f760d4403..8d43dff146 100755 --- a/source4/build/pidl/tables.pl +++ b/source4/build/pidl/tables.pl @@ -43,17 +43,24 @@ if ($opt_help) { ################################### +# add include lines to tables.c +sub process_include($) +{ + my $name = shift; + print TABLEC "#include \"$name\"\n"; +} + +################################### # extract table entries from 1 file sub process_file($) { my $filename = shift; open(FILE, $filename) || die "unable to open $filename\n"; - print TABLEH "#include \"$filename\"\n"; - while (my $line = <FILE>) { - if ($line =~ /extern const struct dcerpc_interface_table (\w+);/) { - print TABLEC "\t&$1,\n"; + if ($line =~ /extern const struct dcerpc_interface_table dcerpc_table_(\w+);/) { + print TABLEC "\t&dcerpc_table_$1,\n"; + print TABLEH "NTSTATUS dcerpc_$1\_init(void);\n"; } } @@ -70,7 +77,14 @@ open(TABLEC, ">$opt_output.c") || die "failed to open $opt_output.c\n"; print TABLEC " #include \"includes.h\" +"; +foreach my $filename (@ARGV) { + process_include($filename); +} + + +print TABLEC " /* generated by pidl IDL table generator */ |