1 | # vi:filetype=tcl |
---|
2 | # |
---|
3 | # configuration for libsingthreads |
---|
4 | |
---|
5 | use cc cc-shared |
---|
6 | |
---|
7 | source autoutil.tcl |
---|
8 | |
---|
9 | options { |
---|
10 | singular:.. => "path to singular directory" |
---|
11 | threads=1 => "disable thread support" |
---|
12 | location:system => { |
---|
13 | If and where to install the Singular thread bindings. |
---|
14 | |
---|
15 | local - do not install them. |
---|
16 | system - install them in the Singular directory. |
---|
17 | <dir> - install them in directory <dir>. |
---|
18 | } |
---|
19 | } |
---|
20 | |
---|
21 | set SINGULAR [opt-val singular ..] |
---|
22 | |
---|
23 | if {![file isdirectory $SINGULAR]} { |
---|
24 | user-error "Singular path is not a directory" |
---|
25 | } |
---|
26 | |
---|
27 | set LOCATION_LIB {} |
---|
28 | set LOCATION_MOD {} |
---|
29 | |
---|
30 | switch -glob -- [opt-val location system] { |
---|
31 | local {} |
---|
32 | system { |
---|
33 | set LOCATION_LIB $SINGULAR/Singular/LIB |
---|
34 | set LOCATION_MOD $SINGULAR/Singular/MOD |
---|
35 | } |
---|
36 | /* { |
---|
37 | set LOCATION_LIB [opt-val location] |
---|
38 | set LOCATION_MOD [opt-val location] |
---|
39 | } |
---|
40 | ./* { |
---|
41 | set LOCATION_LIB [opt-val location] |
---|
42 | set LOCATION_MOD [opt-val location] |
---|
43 | } |
---|
44 | default { |
---|
45 | user-error "Invalid value for --location" |
---|
46 | } |
---|
47 | } |
---|
48 | |
---|
49 | if {[string equal $LOCATION_LIB ""]} { |
---|
50 | define INSTALLATION "" |
---|
51 | } else { |
---|
52 | set LOCATION_LIB [shell-quote $LOCATION_LIB] |
---|
53 | set LOCATION_MOD [shell-quote $LOCATION_MOD] |
---|
54 | define INSTALLATION "\ttools/install.sh -c -m 644 systhreads.lib $LOCATION_LIB |
---|
55 | \ttools/install.sh -c -m 644 systhreads.so $LOCATION_MOD |
---|
56 | \ttools/install.sh -c -m 644 threadtasks.lib $LOCATION_LIB |
---|
57 | " |
---|
58 | } |
---|
59 | set sing_includes {} |
---|
60 | foreach inc [list $SINGULAR $SINGULAR/factory/include $SINGULAR/libpolys] { |
---|
61 | lappend sing_includes $inc |
---|
62 | } |
---|
63 | |
---|
64 | set sing_libs "" |
---|
65 | |
---|
66 | define SING_INCLUDES [-I {*}$sing_includes] |
---|
67 | define SING_LIBS $sing_libs |
---|
68 | |
---|
69 | if {[opt-bool threads] && [file exists "$SINGULAR/factory/prelude.h"]} { |
---|
70 | msg-result "Enabling thread support" |
---|
71 | define ENABLE_THREADS 1 |
---|
72 | } else { |
---|
73 | msg-result "Disabling thread support" |
---|
74 | define ENABLE_THREADS 0 |
---|
75 | } |
---|
76 | |
---|
77 | make-config-header threadconf.h -auto {ENABLE_*} |
---|
78 | make-template Makefile.in |
---|