From: Alex Smith Date: Thu, 2 Sep 2010 19:52:26 +0000 (+0100) Subject: Fix bugs in file-finding logic X-Git-Tag: 0.29~41^2~18 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=a5a384377f685c998206daf6283f539c1f44774f;p=intercal.git Fix bugs in file-finding logic This is both a logic error (an incomplete change from ICKDATADIR to ICKSYSDIR/ICKCSKELDIR), and a simple typo that was preventing the skeleton file from being found in an installed setup. --- diff --git a/etc/interfuzz.pl b/etc/interfuzz.pl old mode 100644 new mode 100755 index 7ea8b4c..30bf168 --- a/etc/interfuzz.pl +++ b/etc/interfuzz.pl @@ -1,3 +1,4 @@ +#!/usr/bin/perl # # NAME # interfuzz.pl -- C-INTERCAL optimiser fuzz-tester @@ -26,8 +27,8 @@ use File::Temp qw/tempdir/; use File::Spec; use constant fuzzamount => 1000; -use constant ickpath => '../build/ick'; -use constant idiompath => '../src/idiotism.oil'; +use constant ickpath => $ENV{ICK} || '../build/ick'; +use constant idiompath => $ENV{IDIOTISM} || '../src/idiotism.oil'; # Before getting to the main program, we need to read in idiom LHSes. print STDERR "Loading idioms...\n"; diff --git a/src/perpet.c b/src/perpet.c index 338a53b..18d2ae1 100644 --- a/src/perpet.c +++ b/src/perpet.c @@ -44,22 +44,30 @@ LICENSE TERMS /* AIS: split ICKDATADIR from ICKLIBDIR */ #ifndef ICKINCLUDEDIR -#define ICKINCLUDEDIR "/usr/local/include" +# define ICKINCLUDEDIR "/usr/local/include" #endif #ifndef ICKSYSDIR -#define ICKSYSDIR "/usr/local/share" +# ifdef ICKDATADIR +# define ICKSYSDIR ICKDATADIR +# else +# define ICKSYSDIR "/usr/local/share" +# endif #endif #ifndef ICKCSKELDIR -#define ICKCSKELDIR "/usr/local/share" +# ifdef ICKDATADIR +# define ICKCSKELDIR ICKDATADIR +# else +# define ICKCSKELDIR "/usr/local/share" +# endif #endif #ifndef ICKLIBDIR -#define ICKLIBDIR "/usr/local/lib" +# define ICKLIBDIR "/usr/local/lib" #endif #ifndef ICKBINDIR -#define ICKBINDIR "/usr/local/bin" +# define ICKBINDIR "/usr/local/bin" #endif #ifndef CC -#define CC "gcc" +# define CC "gcc" #endif #define ARGSTRING "abcdefghlmoptuvwxyCEFHOPUYX@" @@ -1786,7 +1794,7 @@ int main(int argc, char *argv[]) if (!(ick_sysdir = getenv("ICKSYSDIR"))) ick_sysdir = ICKSYSDIR; if (!(ick_cskeldir = getenv("ICKCSKELDIR"))) - ick_sysdir = ICKCSKELDIR; + ick_cskeldir = ICKCSKELDIR; /* AIS: nothing actually uses this at the moment, commenting it out for future use