at v192 3.9 kB view raw
1diff -ur qc--20060131.orig/configure qc--20060131/configure 2--- qc--20060131.orig/configure 2005-11-05 22:15:24.000000000 +0100 3+++ qc--20060131/configure 2006-02-02 14:29:07.000000000 +0100 4@@ -93,7 +93,22 @@ 5 # for file in dirs and return, full path, if found, and "" otherwise. 6 # 7 8-sub search { search_with( sub($) { return (-f shift) }, @_) } 9+sub combine { 10+ my $base = shift; 11+ my $file = shift; 12+ return ("$base/$file") 13+}; 14+ 15+sub search { search_with( sub($) { return (-f shift) }, \&combine, @_) } 16+ 17+sub search_suffix { 18+ my $f = sub($) { 19+ my $suffix = shift; 20+ my $base = shift; 21+ return ($base . $suffix); 22+ }; 23+ search_with(sub($) { return (-f shift) }, $f, @_) 24+} 25 26 sub searchx { 27 my $f = sub($) { 28@@ -105,16 +120,17 @@ 29 } 30 return (1==2); # how do you write false in perl? 31 }; 32- search_with($f, @_) 33+ search_with($f, \&combine, @_) 34 } 35 36 sub search_with { 37 my $p = shift; 38+ my $com = shift; 39 my $file = shift; 40 41- printf(LOG "searching for %-20s", $file); 42+ printf(LOG "searching for %-20s ", $file); 43 while ($f = shift (@_)) { 44- my $x = "$f/$file"; 45+ my $x = &$com($f, $file); 46 if (&$p($x)) { 47 print LOG "found $x\n"; 48 return $x 49@@ -124,6 +140,20 @@ 50 return ""; 51 } 52 53+#configure lua based on some known installation prefix 54+sub config_lua { 55+ my $base = shift; 56+ @libsuffix = ( ".so", "40.so", ".a", "40.a" ); 57+ 58+ $x{lua_h} = "$base/include/lua.h"; 59+ $x{lualib_h} = "$base/include/lualib.h"; 60+ $x{liblua} = search_suffix("$base/lib/liblua", @libsuffix); 61+ $x{liblualib} = search_suffix("$base/lib/liblualib", @libsuffix); 62+ $x{lua_inc} = "-I$base/include"; 63+ $x{lua_lib} = "-L$base/lib/"; 64+ $x{lua_libs} = "-llua -llualib"; 65+} 66+ 67 68 # 69 # compile and run a small C program to find out about architecture 70@@ -183,6 +213,8 @@ 71 72 ./configure [options] 73 74+ --with-lua=/lua/path lua is installed in /lua/path the default 75+ is to search for standard locations 76 --prefix=/usr/local install into the /usr/local hierarchy which 77 is also the default 78 -h, --help this summary 79@@ -224,15 +256,15 @@ 80 # We start from here with reading the command line 81 # ------------------------------------------------------------------ 82 83+open (LOG, ">$configure_log") || die "cannot write configure.log: $!"; 84+ 85 foreach (@ARGV) { 86 if (/^--?prefix=(.*)$/) { $x{prefix}=$1 } 87 elsif (/^--?h(elp?)$/) { usage(); exit 0 } 88+ elsif (/^--?with-lua=(.*)$/) { config_lua($1) } 89 else { usage(); exit 1 } 90 } 91 92- 93-open (LOG, ">$configure_log") || die "cannot write configure.log: $!"; 94- 95 # check for various executables and versions. Only update variable if 96 # it is not already set. 97 # 98diff -ur qc--20060131.orig/doc/mkfile qc--20060131/doc/mkfile 99--- qc--20060131.orig/doc/mkfile 2005-11-07 01:41:21.000000000 +0100 100+++ qc--20060131/doc/mkfile 2006-02-02 00:38:00.000000000 +0100 101@@ -92,7 +92,7 @@ 102 # and accessible from Lua as This.manual. 103 104 qc--.man:D: qc--.1 105- GROFF_NO_SGR=1 nroff -man -Tascii qc--.1 | ul -t dump > $target 106+ GROFF_NO_SGR=1 nroff -man -Tascii qc--.1 > $target 107 108 release.tex:D: release.nw 109 noweave -delay $prereq > $target 110diff -ur qc--20060131.orig/mkfile qc--20060131/mkfile 111--- qc--20060131.orig/mkfile 2005-07-01 22:29:52.000000000 +0200 112+++ qc--20060131/mkfile 2006-02-02 19:15:53.000000000 +0100 113@@ -97,7 +97,7 @@ 114 cd test2 && NPROC=1 mk $MKFLAGS all 115 116 test.opt:V: all.opt 117- cd test2 && NPROC=1 mk QC=../bin/qc--.opt $MKFLAGS all 118+ cd test2 && NPROC=1 mk $MKFLAGS QC=../bin/qc--.opt all 119 120 coverage: test2/ocamlprof.dump 121 rm -f $target