summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Samba4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-03-16 21:35:31 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:57:32 -0500
commit4469fa31e3e3b2d62da7686fd6426bb44be09830 (patch)
treee13b7e6ad0cd7582c98c17b53dbdc6a65f3d0b1a /source4/pidl/lib/Parse/Pidl/Samba4
parentecf0dd6bafaa95692c3ece94b6f71446cd54ebdc (diff)
downloadsamba-4469fa31e3e3b2d62da7686fd6426bb44be09830.tar.gz
samba-4469fa31e3e3b2d62da7686fd6426bb44be09830.tar.bz2
samba-4469fa31e3e3b2d62da7686fd6426bb44be09830.zip
r14491: Allow building more output outside of the Samba source tree
(This used to be commit 272ca8e636cc5043279ff247fc8d5693a9181992)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba4')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/Header.pm2
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm15
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/TDR.pm14
3 files changed, 26 insertions, 5 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
index 54e410f716..e082a74fc4 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
@@ -351,7 +351,7 @@ sub Parse($)
%headerstructs = ();
pidl "/* header auto-generated by pidl */\n\n";
if (!is_intree()) {
- pidl "#include <core.h>";
+ pidl "#include <core.h>\n\n";
}
foreach (@{$idl}) {
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm
index d52dc12ec3..f19f4df319 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm
@@ -5,6 +5,8 @@
package Parse::Pidl::Samba4::NDR::Client;
+use Parse::Pidl::Samba4 qw(choose_header is_intree);
+
use vars qw($VERSION);
$VERSION = '0.01';
@@ -97,12 +99,21 @@ sub Parse($$$$)
$res .= "/* client functions auto-generated by pidl */\n";
$res .= "\n";
- $res .= "#include \"includes.h\"\n";
+ if (is_intree()) {
+ $res .= "#include \"includes.h\"\n";
+ } else {
+ $res .= "#define _GNU_SOURCE\n";
+ $res .= "#include <stdio.h>\n";
+ $res .= "#include <stdlib.h>\n";
+ $res .= "#include <stdint.h>\n";
+ $res .= "#include <stdarg.h>\n";
+ $res .= "#include <core/nterr.h>\n";
+ }
$res .= "#include \"$ndr_header\"\n";
$res .= "#include \"$client_header\"\n";
$res .= "\n";
- $res_hdr .= "#include \"librpc/rpc/dcerpc.h\"\n";
+ $res_hdr .= choose_header("librpc/rpc/dcerpc.h", "dcerpc.h")."\n";
$res_hdr .= "#include \"$header\"\n";
foreach my $x (@{$ndr}) {
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/TDR.pm b/source4/pidl/lib/Parse/Pidl/Samba4/TDR.pm
index 3bdb701526..7e597dfb34 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/TDR.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/TDR.pm
@@ -5,6 +5,7 @@
package Parse::Pidl::Samba4::TDR;
use Parse::Pidl::Util qw(has_property ParseExpr is_constant);
+use Parse::Pidl::Samba4 qw(is_intree choose_header);
use vars qw($VERSION);
$VERSION = '0.01';
@@ -237,12 +238,21 @@ sub Parser($$$)
my ($idl,$hdrname,$baseheader) = @_;
$ret = ""; $ret_hdr = "";
pidl "/* autogenerated by pidl */";
- pidl "#include \"includes.h\"";
+ if (is_intree()) {
+ pidl "#include \"includes.h\"";
+ } else {
+ pidl "#include <stdio.h>";
+ pidl "#include <stdlib.h>";
+ pidl "#include <stdint.h>";
+ pidl "#include <stdarg.h>";
+ pidl "#include <string.h>";
+ pidl "#include <core/nterr.h>";
+ }
pidl "#include \"$hdrname\"";
pidl "";
pidl_hdr "/* autogenerated by pidl */";
pidl_hdr "#include \"$baseheader\"";
- pidl_hdr "#include \"tdr/tdr.h\"";
+ pidl_hdr choose_header("tdr/tdr.h", "tdr.h");
pidl_hdr "";
foreach (@$idl) { ParserInterface($_) if ($_->{TYPE} eq "INTERFACE"); }