From 281aafbbb3fc98ca842c06c5e56aa1ecfbd12bb2 Mon Sep 17 00:00:00 2001 From: borutr Date: Sun, 20 Mar 2005 17:50:34 +0000 Subject: [PATCH] * support/scripts/inc2h.pl: WIN32 port git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3702 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 4 ++++ support/scripts/inc2h.pl | 35 ++++++++++++++++++++++++----------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4cc538eb..436ffeb3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-03-20 Borut Razem + + * support/scripts/inc2h.pl: WIN32 port + 2005-03-19 Maarten Brock * device/lib/makefile.in: added abs.c and labs.c diff --git a/support/scripts/inc2h.pl b/support/scripts/inc2h.pl index 63b693cb..4283688e 100755 --- a/support/scripts/inc2h.pl +++ b/support/scripts/inc2h.pl @@ -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 : 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 : 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 () { # 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"; -- 2.47.2