From 433ec0ba664c9eb53b26550e25973e2fc538646b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 7 Sep 2006 20:01:17 +0000 Subject: r18228: Don't include Samba4-specific headers when building inside a Samba3 tree. (This used to be commit d0f0d4600acad71ea4993f4e356735433d9bc5f0) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 39 +++++++++++++++--------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl/Samba4') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index bf5e8fe441..9e4388e28d 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -2359,6 +2359,29 @@ sub ParseInterface($$) pidl_hdr "#endif /* _HEADER_NDR_$interface->{NAME} */"; } +sub GenerateIncludes() +{ + if (is_intree()) { + pidl "#include \"includes.h\""; + } else { + pidl "#define _GNU_SOURCE"; + pidl "#include "; + pidl "#include "; + pidl "#include "; + pidl "#include "; + pidl "#include "; + pidl "#include "; + } + + # Samba3 has everything in include/includes.h + if (is_intree() != 3) { + pidl choose_header("libcli/util/nterr.h", "core/nterr.h"); + pidl choose_header("librpc/gen_ndr/ndr_misc.h", "gen_ndr/ndr_misc.h"); + pidl choose_header("librpc/gen_ndr/ndr_dcerpc.h", "gen_ndr/ndr_dcerpc.h"); + pidl choose_header("librpc/rpc/dcerpc.h", "dcerpc.h"); #FIXME: This shouldn't be here! + } +} + ##################################################################### # parse a parsed IDL structure back into an IDL file sub Parse($$$) @@ -2376,22 +2399,8 @@ sub Parse($$$) pidl "/* parser auto-generated by pidl */"; pidl ""; - if (is_intree()) { - pidl "#include \"includes.h\""; - } else { - pidl "#define _GNU_SOURCE"; - pidl "#include "; - pidl "#include "; - pidl "#include "; - pidl "#include "; - pidl "#include "; - pidl "#include "; - } - pidl choose_header("libcli/util/nterr.h", "core/nterr.h"); - pidl choose_header("librpc/gen_ndr/ndr_misc.h", "gen_ndr/ndr_misc.h"); - pidl choose_header("librpc/gen_ndr/ndr_dcerpc.h", "gen_ndr/ndr_dcerpc.h"); + GenerateIncludes(); pidl "#include \"$ndr_header\"" if ($ndr_header); - pidl choose_header("librpc/rpc/dcerpc.h", "dcerpc.h"); #FIXME: This shouldn't be here! pidl ""; my %needed = (); -- cgit