use gputils or gpasm (from Nathan Hurst)
[fw/sdcc] / support / scripts / inc2h.pl
index 15fac7697ba8d3b86663cb2c3d0ee9ae4b79dd6c..c66532b2a8764191a0173f96cd57660a6e8fcf0b 100755 (executable)
@@ -28,7 +28,16 @@ $processor = shift;
 $path = shift;
 
 $processor = uc $processor;
-$path = "/usr/share/gpasm" if ($path eq '');
+# Nathan Hurst <njh@mail.csse.monash.edu.au>: find gputils on Debian
+if ($path eq '') {
+    if ( -x "/usr/share/gputils") {
+       $path = "/usr/share/gputils";
+    } elsif ( -x "/usr/share/gpasm") {
+       $path = "/usr/share/gpasm";
+    } else {
+       die "Could not find gpasm includes.\n";
+    }
+}
 
 #
 # Read the symbols at the end of this file.