... | ... |
@@ -23,48 +23,51 @@ |
23 | 23 |
# |
24 | 24 |
EOF |
25 | 25 |
fi |
26 | 26 |
|
27 | 27 |
source ~/.lemon-bootstrap |
28 | 28 |
if [ -f ../../../.lemon-bootstrap ]; then source ../../../.lemon-bootstrap; fi |
29 | 29 |
if [ -f ../../.lemon-bootstrap ]; then source ../../.lemon-bootstrap; fi |
30 | 30 |
if [ -f ../.lemon-bootstrap ]; then source ../.lemon-bootstrap; fi |
31 | 31 |
if [ -f ./.lemon-bootstrap ]; then source ./.lemon-bootstrap; fi |
32 | 32 |
|
33 | 33 |
|
34 | 34 |
function augment_config() { |
35 | 35 |
if [ "x${!1}" == "x" ]; then |
36 | 36 |
eval $1=$2 |
37 | 37 |
echo Add "'$1'" to '~/.lemon-bootstrap'. |
38 | 38 |
echo >>~/.lemon-bootstrap |
39 | 39 |
echo $3 >>~/.lemon-bootstrap |
40 | 40 |
echo $1=$2 >>~/.lemon-bootstrap |
41 | 41 |
fi |
42 | 42 |
} |
43 | 43 |
|
44 | 44 |
augment_config LEMON_INSTALL_PREFIX /usr/local \ |
45 | 45 |
"# LEMON installation prefix" |
46 | 46 |
|
47 |
augment_config GLPK_PREFIX /usr/local/ \ |
|
48 |
"# GLPK installation root prefix" |
|
49 |
|
|
47 | 50 |
augment_config COIN_OR_PREFIX /usr/local/coin-or \ |
48 | 51 |
"# COIN-OR installation root prefix (used for CLP/CBC)" |
49 | 52 |
|
50 | 53 |
augment_config SOPLEX_PREFIX /usr/local/soplex \ |
51 | 54 |
"# Soplex build prefix" |
52 | 55 |
|
53 | 56 |
|
54 | 57 |
function ask() { |
55 | 58 |
echo -n "$1 [$2]? " |
56 | 59 |
read _an |
57 | 60 |
if [ "x$_an" == "x" ]; then |
58 | 61 |
ret="$2" |
59 | 62 |
else |
60 | 63 |
ret=$_an |
61 | 64 |
fi |
62 | 65 |
} |
63 | 66 |
|
64 | 67 |
function yesorno() { |
65 | 68 |
ret='rossz' |
66 | 69 |
while [ "$ret" != "y" -a "$ret" != "n" -a "$ret" != "yes" -a "$ret" != "no" ]; do |
67 | 70 |
ask "$1" "$2" |
68 | 71 |
done |
69 | 72 |
if [ "$ret" != "y" -a "$ret" != "yes" ]; then |
70 | 73 |
return 1 |
... | ... |
@@ -88,55 +91,67 @@ |
88 | 91 |
|
89 | 92 |
if yesorno "Optimize" "n" |
90 | 93 |
then |
91 | 94 |
opt_flags=' -O2' |
92 | 95 |
else |
93 | 96 |
opt_flags='' |
94 | 97 |
fi |
95 | 98 |
|
96 | 99 |
if yesorno "Stop on warning" "y" |
97 | 100 |
then |
98 | 101 |
werror_flags=' -Werror' |
99 | 102 |
else |
100 | 103 |
werror_flags='' |
101 | 104 |
fi |
102 | 105 |
|
103 | 106 |
cxx_flags="CXXFLAGS=-ggdb$opt_flags$werror_flags" |
104 | 107 |
|
105 | 108 |
if yesorno "Check with valgrind" "n" |
106 | 109 |
then |
107 | 110 |
valgrind_flags=' --enable-valgrind' |
108 | 111 |
else |
109 | 112 |
valgrind_flags='' |
110 | 113 |
fi |
111 | 114 |
|
115 |
if [ -f ${GLPK_PREFIX}/include/glpk.h ]; then |
|
116 |
if yesorno "Use GLPK" "y" |
|
117 |
then |
|
118 |
glpk_flag="--with-glpk=$GLPK_PREFIX" |
|
119 |
else |
|
120 |
glpk_flag="--without-glpk" |
|
121 |
fi |
|
122 |
else |
|
123 |
glpk_flag="--without-glpk" |
|
124 |
fi |
|
125 |
|
|
112 | 126 |
if [ -f ${COIN_OR_PREFIX}/include/coin/config_coinutils.h ]; then |
113 | 127 |
if yesorno "Use COIN-OR (CBC/CLP)" "n" |
114 | 128 |
then |
115 | 129 |
coin_flag="--with-coin=$COIN_OR_PREFIX" |
116 | 130 |
else |
117 |
coin_flag="" |
|
131 |
coin_flag="--without-coin" |
|
118 | 132 |
fi |
119 | 133 |
else |
120 |
coin_flag="" |
|
134 |
coin_flag="--without-coin" |
|
121 | 135 |
fi |
122 | 136 |
|
123 | 137 |
if [ -f ${SOPLEX_PREFIX}/src/soplex.h ]; then |
124 | 138 |
if yesorno "Use Soplex" "n" |
125 | 139 |
then |
126 | 140 |
soplex_flag="--with-soplex=$SOPLEX_PREFIX" |
127 | 141 |
else |
128 |
soplex_flag="" |
|
142 |
soplex_flag="--without-soplex" |
|
129 | 143 |
fi |
130 | 144 |
else |
131 |
soplex_flag="" |
|
145 |
soplex_flag="--without-soplex" |
|
132 | 146 |
fi |
133 | 147 |
|
134 | 148 |
if [ "x$AUTORE" == "xyes" ]; then |
135 | 149 |
autoreconf -vif; |
136 | 150 |
fi |
137 | 151 |
${CONFIGURE_PATH}/configure --prefix=$LEMON_INSTALL_PREFIX \ |
138 | 152 |
$valgrind_flags \ |
139 | 153 |
"$cxx_flags" \ |
154 |
$glpk_flag \ |
|
140 | 155 |
$coin_flag \ |
141 | 156 |
$soplex_flag \ |
142 | 157 |
$* |
0 comments (0 inline)