summaryrefslogtreecommitdiff
path: root/source4/pidl/tests/Util.pm
diff options
context:
space:
mode:
Diffstat (limited to 'source4/pidl/tests/Util.pm')
-rw-r--r--source4/pidl/tests/Util.pm21
1 files changed, 19 insertions, 2 deletions
diff --git a/source4/pidl/tests/Util.pm b/source4/pidl/tests/Util.pm
index cfa1422674..a406b868e1 100644
--- a/source4/pidl/tests/Util.pm
+++ b/source4/pidl/tests/Util.pm
@@ -72,9 +72,27 @@ SKIP: {
$outfile = "./test-$name";
}
+ my $cflags = $ENV{CFLAGS};
+ unless (defined($cflags)) {
+ $cflags = "";
+ }
+
+ my $ldflags = $ENV{LDFLAGS};
+ unless (defined($ldflags)) {
+ $ldflags = "";
+ }
+
+ my $cc = $ENV{CC};
+ unless (defined($cc)) {
+ $cc = "cc";
+ }
+
my $flags = `pkg-config --libs --cflags ndr samba-config`;
- open CC, "|cc -x c - -o $outfile $flags";
+ my $cmd = "$cc $cflags -x c - -o $outfile $flags $ldflags";
+ $cmd =~ s/\n//g;
+ print "$cmd\n";
+ open CC, "|$cmd";
print CC "#define uint_t unsigned int\n";
print CC "#define _GNU_SOURCE\n";
print CC "#include <stdint.h>\n";
@@ -121,7 +139,6 @@ sub test_warnings($$)
is($warnings, $exp);
}
-
sub test_errors($$)
{
my ($exp, $code) = @_;