gravatar
alpar (Alpar Juttner)
alpar@cs.elte.hu
Valgring option for ./scripts/bootstrap.sh
0 1 0
default
1 file changed with 8 insertions and 0 deletions:
↑ Collapse diff ↑
Show white space 192 line context
... ...
@@ -9,126 +9,134 @@
9 9
# Permission to use, modify and distribute this software is granted
10 10
# provided that this copyright notice appears in all copies. For
11 11
# precise terms see the accompanying LICENSE file.
12 12
#
13 13
# This software is provided "AS IS" with no warranty of any kind,
14 14
# express or implied, and with no claim as to its suitability for any
15 15
# purpose.
16 16

	
17 17

	
18 18
if [ ! -f ~/.lemon-bootstrap ]; then
19 19
    echo 'Create ~/.lemon-bootstrap'.
20 20
    cat >~/.lemon-bootstrap <<EOF
21 21
#
22 22
# Default settings for bootstraping the LEMON source code repository
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 47
augment_config COIN_OR_PREFIX /usr/local/coin-or \
48 48
    "# COIN-OR installation root prefix (used for CLP/CBC)"
49 49

	
50 50
augment_config SOPLEX_PREFIX /usr/local/soplex \
51 51
    "# Soplex build prefix"
52 52

	
53 53

	
54 54
function ask() {
55 55
echo -n "$1 [$2]? "
56 56
read _an
57 57
if [ "x$_an" == "x" ]; then
58 58
    ret="$2"
59 59
else
60 60
    ret=$_an
61 61
fi
62 62
}
63 63

	
64 64
function yesorno() {
65 65
    ret='rossz'
66 66
    while [ "$ret" != "y" -a "$ret" != "n" -a "$ret" != "yes" -a "$ret" != "no" ]; do
67 67
        ask "$1" "$2"
68 68
    done
69 69
    if [ "$ret" != "y" -a "$ret" != "yes" ]; then
70 70
        return 1
71 71
    else
72 72
        return 0
73 73
    fi
74 74
}
75 75

	
76 76
if yesorno "External build" "n"
77 77
then
78 78
    CONFIGURE_PATH=".."
79 79
else
80 80
    CONFIGURE_PATH="."
81 81
    if yesorno "Autoreconf" "y"
82 82
    then
83 83
        AUTORE=yes
84 84
    else
85 85
        AUTORE=no
86 86
    fi
87 87
fi
88 88

	
89 89
if yesorno "Optimize" "n" 
90 90
then
91 91
    opt_flags=' -O2'
92 92
else
93 93
    opt_flags=''
94 94
fi
95 95

	
96 96
if yesorno "Stop on warning" "y" 
97 97
then
98 98
    werror_flags=' -Werror'
99 99
else
100 100
    werror_flags=''
101 101
fi
102 102

	
103 103
cxx_flags="CXXFLAGS=-ggdb$opt_flags$werror_flags"
104 104

	
105
if yesorno "Check with valgrind" "n" 
106
then
107
    valgrind_flags=' --enable-valgrind'
108
else
109
    valgrind_flags=''
110
fi
111

	
105 112
if [ -f ${COIN_OR_PREFIX}/include/coin/config_coinutils.h ]; then
106 113
    if yesorno "Use COIN-OR (CBC/CLP)" "n"
107 114
    then
108 115
        coin_flag="--with-coin=$COIN_OR_PREFIX"
109 116
    else
110 117
        coin_flag=""
111 118
    fi
112 119
else
113 120
    coin_flag=""        
114 121
fi
115 122

	
116 123
if [ -f ${SOPLEX_PREFIX}/src/soplex.h ]; then
117 124
    if yesorno "Use Soplex" "n"
118 125
    then
119 126
        soplex_flag="--with-soplex=$SOPLEX_PREFIX"
120 127
    else
121 128
        soplex_flag=""
122 129
    fi
123 130
else
124 131
    soplex_flag=""
125 132
fi
126 133

	
127 134
if [ "x$AUTORE" == "xyes" ]; then
128 135
    autoreconf -vif;
129 136
fi
130 137
${CONFIGURE_PATH}/configure --prefix=$LEMON_INSTALL_PREFIX \
138
$valgrind_flags \
131 139
"$cxx_flags" \
132 140
$coin_flag \
133 141
$soplex_flag \
134 142
$*
0 comments (0 inline)