summaryrefslogtreecommitdiff
path: root/source4/build/pidl/test.pm
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-05-17 13:50:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:16:51 -0500
commit9d56a6d8f86a2285231d1707635ce8a5bb996b1a (patch)
treea0cc41e088ff1cc9f03f5ca1b620f9080a7b7972 /source4/build/pidl/test.pm
parentfe597fd1e28b92766e174249b10739fb2fe4a35f (diff)
downloadsamba-9d56a6d8f86a2285231d1707635ce8a5bb996b1a.tar.gz
samba-9d56a6d8f86a2285231d1707635ce8a5bb996b1a.tar.bz2
samba-9d56a6d8f86a2285231d1707635ce8a5bb996b1a.zip
r6859: Add ndr_align tests, use environment variables ($CC, $CFLAGS, $LDFLAGS)
where possible. (This used to be commit 077f4105aceba99a7ac4de21a20bb758fcc01203)
Diffstat (limited to 'source4/build/pidl/test.pm')
-rw-r--r--source4/build/pidl/test.pm19
1 files changed, 11 insertions, 8 deletions
diff --git a/source4/build/pidl/test.pm b/source4/build/pidl/test.pm
index d01a98bd2c..a7e3a839be 100644
--- a/source4/build/pidl/test.pm
+++ b/source4/build/pidl/test.pm
@@ -8,6 +8,11 @@ use strict;
use util;
my $idl_path = "./build/pidl/pidl.pl";
+my $cc = $ENV{CC};
+my @cflags = split / /, $ENV{CFLAGS};
+my @ldflags = split / /, $ENV{LDFLAGS};
+
+$cc = "cc" if ($cc eq "");
sub generate_cfile($$$)
{
@@ -30,7 +35,6 @@ sub generate_cfile($$$)
int main(int argc, char **argv)
{
TALLOC_CTX *mem_ctx = talloc_init(NULL);
- int ndr_flags = 0;
';
print OUT $fragment;
print OUT "\treturn 0;\n}\n";
@@ -76,16 +80,14 @@ sub compile_cfile($)
{
my ($filename) = @_;
- print "Compiling C file $filename\n";
-
- return system("cc", '-I.', '-Iinclude', '-c', $filename);
+ return system($cc, @cflags, '-I.', '-Iinclude', '-c', $filename);
}
sub link_files($$)
{
my ($exe_name,$objs) = @_;
- return system("cc", '-I.', '-Iinclude', '-Lbin', '-lrpc', '-o', $exe_name, @$objs);
+ return system($cc, @ldflags, '-I.', '-Iinclude', '-Lbin', '-lrpc', '-o', $exe_name, @$objs);
}
sub test_idl($$$$)
@@ -109,9 +111,10 @@ sub test_idl($$$$)
my @srcs = ($c_filename);
push (@srcs, @{$settings->{'ExtraFiles'}});
-# foreach (@srcs) {
-# return -1 if (compile_cfile($_) == -1);
-# }
+ foreach (@srcs) {
+ next unless /\.c$/;
+ return -1 if (compile_cfile($_) == -1);
+ }
return -1 if (link_files($exe_filename, \@srcs) == -1);