summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-09-07 20:01:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:17:53 -0500
commit433ec0ba664c9eb53b26550e25973e2fc538646b (patch)
treede949bb457d4bcda7a0149d0dbd64297bc70a100 /source4/pidl/lib/Parse/Pidl
parent4dff1f05f00560adc1deeb09b5e27dacad787783 (diff)
downloadsamba-433ec0ba664c9eb53b26550e25973e2fc538646b.tar.gz
samba-433ec0ba664c9eb53b26550e25973e2fc538646b.tar.bz2
samba-433ec0ba664c9eb53b26550e25973e2fc538646b.zip
r18228: Don't include Samba4-specific headers when building inside a Samba3 tree.
(This used to be commit d0f0d4600acad71ea4993f4e356735433d9bc5f0)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4.pm4
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm39
2 files changed, 27 insertions, 16 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4.pm b/source4/pidl/lib/Parse/Pidl/Samba4.pm
index eac5104da2..4ef2daa591 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4.pm
@@ -18,7 +18,9 @@ $VERSION = '0.01';
sub is_intree()
{
- return (-f "kdc/kdc.c" or -f "include/smb.h");
+ return 4 if (-f "kdc/kdc.c");
+ return 3 if (-f "include/smb.h");
+ return 0;
}
# Return an #include line depending on whether this build is an in-tree
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 <stdint.h>";
+ pidl "#include <stdlib.h>";
+ pidl "#include <stdio.h>";
+ pidl "#include <stdbool.h>";
+ pidl "#include <stdarg.h>";
+ pidl "#include <string.h>";
+ }
+
+ # 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 <stdint.h>";
- pidl "#include <stdlib.h>";
- pidl "#include <stdio.h>";
- pidl "#include <stdbool.h>";
- pidl "#include <stdarg.h>";
- pidl "#include <string.h>";
- }
- 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 = ();