* support/scripts/inc2h.pl: WIN32 port
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 20 Mar 2005 17:50:34 +0000 (17:50 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 20 Mar 2005 17:50:34 +0000 (17:50 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3702 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
support/scripts/inc2h.pl

index 4cc538eb15701cd98734fc5bbcca8c0285a230eb..436ffeb36a77ca7604956370d35af9178eb9fb2c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-03-20 Borut Razem <borut.razem AT siol.net>
+
+       * support/scripts/inc2h.pl: WIN32 port
+
 2005-03-19 Maarten Brock <sourceforge.brock AT dse.nl>
 
        * device/lib/makefile.in: added abs.c and labs.c
index 63b693cb0ef0d85ae29250d4f36f33580635b623..4283688edc4f0631ca6af71cf742eaee3a4b4773 100755 (executable)
@@ -24,19 +24,32 @@ $rcsid = q~$Id$~;
 if ($#ARGV < 0 || $#ARGV > 1 ) {
     Usage();
 }
-$processor = shift;
+$processor = uc(shift);
 $path = shift;
 
-$processor = uc $processor;
-# 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";
+if ($^O eq 'MSWin32') {
+    if ($path eq '') {
+       if (defined($path = $ENV{'GPUTILS_HEADER_PATH'}) || defined($path = $ENV{'GPUTILS_LKR_PATH'})) {
+           $path .= '\\..';
+       }
+       else {
+           die "Could not find gpasm includes.\n";
+       }
+    }
+    $path_delim = '\\';
+}
+else {
+    # 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";
+       }
     }
+    $path_delim = '/';
 }
 
 #
@@ -120,7 +133,7 @@ while (<DATA>) {
 # Convert the file.
 #
 $defaultType = 'other';
-$includeFile = "$path/header/p" . lc $processor . ".inc";
+$includeFile = $path.$path_delim.'header'.$path_delim.'p'.lc($processor).'.inc';
 open(HEADER, "<$includeFile")
     || die "$programName: Error: Cannot open include file $includeFile ($!)\n";