summaryrefslogtreecommitdiff
path: root/devel/cqual/patches/patch-ce
blob: f88b34fb39888228daa068d6292b6e5b35a67d1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
$NetBSD: patch-ce,v 1.1 2006/07/17 22:16:55 rillig Exp $

- Use @CC@ instead of gcc for the compiler.
- Prefer the installed cqual over the one in $PATH.
- Error messages belong on stderr, not stdout.

--- bin/gcqual.in.orig	2006-07-17 08:55:02.000000000 +0200
+++ bin/gcqual.in	2006-07-17 08:57:26.000000000 +0200
@@ -22,10 +22,10 @@ use File::Basename;
 
 
 # Global config options -- should probably do something smarter with $CC
-$CC="gcc";
-$cqual="cqual";
-$pkgdatadir = "@prefix@/share/@PACKAGE@"; # Yuck. Is there a better way?
-$scriptname = $0;
+my $CC = "@CC@";
+my $cqual = (-f "@prefix@/bin/cqual" ? "@prefix@/bin/cqual" : "cqual");
+my $pkgdatadir = "@prefix@/share/@PACKAGE@"; # Yuck. Is there a better way?
+my $scriptname = $0;
 
 sub usage
 {
@@ -237,10 +237,10 @@ if ($#ifiles >= 0) {
     }
     print ("@cmd\n") if ($debug);
     system(@cmd) == 0 
-	or die "cqual failed: $?";
+	or die "cqual failed with exitcode " . ($?>>8) . ": $!";
 }
 else
 {
-    print ("Could not parse command line args.  No .c or .i files specified?\n");
+    print STDERR ("Could not parse command line args.  No .c or .i files specified?\n");
     usage();
 }