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