-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure
242 lines (206 loc) · 5.48 KB
/
configure
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
#!/bin/bash
#if [ "$UID" = 0 ]; then echo "Please don't run configure as root"; exit 1; fi
LINUX=0
MACOSX=0
if [ `uname` = "Linux" ]; then
LINUX=1
OSTYPE=LINUX
CPPFLAGS="-DLINUX"
fi
if [ `uname` = "Darwin" ]; then
MACOSX=1
CPPFLAGS="-DMACOSX"
OSTYPE=MACOSX
fi
if [ ! $CXX ]; then
echo "No 'CXX' environment variable found, using g++.";
CXX="g++"
fi
if [ ! $CC ]; then
echo "No 'CC' environment variable found, using gcc.";
CC="gcc"
fi
if [ ! -x `which $CXX` ]; then
echo "Can't execute C++ compiler '$CXX'.";
exit 1;
else
echo "Using C++ compiler: $CXX"
fi
if [ ! -x `which $CC` ]; then
echo "Can't execute C++ compiler '$CC'.";
exit 1;
else
echo "Using C compiler: $CC"
fi
GCC_VERSION=`$CXX --version`
echo -n "Checking for Qt 3.x ... "
for GUESS_QTDIR in `ls /usr/lib/ | grep -E "qt3|qt-3"`; do
if [ -d /usr/lib/$GUESS_QTDIR/include -a -d /usr/lib/$GUESS_QTDIR/lib -a -f /usr/lib/$GUESS_QTDIR/bin/moc ]; then
QT_INCLUDE="-I /usr/lib/$GUESS_QTDIR/include"
QT_LIB="-L /usr/lib/$GUESS_QTDIR/lib -lqt-mt" ;
MOC="/usr/lib/$GUESS_QTDIR/bin/moc" ;
fi ;
done ;
if [ ! "$QT_INCLUDE" ]; then
echo -e "\n\n*** Qt 3.x not found. I'll make some educated guesses. If this doesn't work, please set QT_INCLUDE, QT_LIB, MOC by hand in the file global.mk.\n\a"
#exit 1
QT_INCLUDE="-I/usr/include/qt3";
QT_LIB="-lqt-mt" ;
MOC="moc-qt3" ;
else
echo "Ok" ;
fi
ARIASUPPORT="0"
echo -n "Checking for Aria libs "
for GUESS_ARIADIR in `ls /usr/local/ | grep -E "Aria"`; do
if [ -d /usr/local/$GUESS_ARIADIR/include -a -d /usr/local/$GUESS_ARIADIR/lib ]; then
ARIA_INCLUDE="-I/usr/local/$GUESS_ARIADIR/include"
ARIA_LIB="-L/usr/local/$GUESS_ARIADIR/lib -lAria"
ARIASUPPORT="1"
fi ;
done ;
if [ ! "$ARIA_INCLUDE" ]; then
echo -e "\n\n*** ARIA not found, please set ARIA_INCLUDE and ARIA_LIB by hand\n\a"
else
echo "Ok" ;
fi
#echo -n "Checking for Gsl libs "
#if [ "$OSTYPE" = "LINUX" ]; then
# GSL_LIB="-lgsl -lgslcblas"
# GSL_INCLUDE="-I/usr/include/"
#fi
#if [ "$OSTYPE" = "MACOSX" ]; then
# GSL_LIB="-L/sw/lib -lgsl -lgslcblas"
# GSL_INCLUDE="-I/sw/include"
#fi
#
#if [ ! "$GSL_INCLUDE" ]; then
# echo -e "\n\n*** GSL not found, please set GSL_INCLUDE and GSL_LIB by hand\n\a"
#else
# echo "Ok" ;
#fi
# echo -n "Checking for KDE 3.x includes ... "
# for GUESS_KDE_INCLUDE in /usr/include/kde /usr/include/kde3 /opt/kde3/include /opt/kde/include; do
# if [ -d $GUESS_KDE_INCLUDE ]; then
# KDE_INCLUDE="-I$GUESS_KDE_INCLUDE"
# fi ;
# done ;
#
# if [ ! "$KDE_INCLUDE" ]; then
# echo -e "\n\n*** KDE 3.x includes not found please set KDE_INCLUDE by hand\n\a"
# exit 1
# else
# echo "Ok" ;
# fi
#
# echo -n "Checking for KDE 3.x libs ... "
# for GUESS_KDE_LIB in /usr/lib/kde3 /opt/kde3/lib; do
# if [ -d $GUESS_KDE_LIB ]; then
# KDE_LIB="-L$GUESS_KDE_LIB -lkdeui"
# fi ;
# done ;
#
# if [ ! "$KDE_LIB" ]; then
# echo -e "\n\n*** KDE 3.x libs not found please set KDE_LIBS by hand\n\a"
# exit 1
# else
# echo "Ok" ;
# fi
# echo -n "Checking for uic ... "
# for GUESS_UIC in `ls /usr/bin/ | grep -E "uic|uic3"`; do
# if [ -f /usr/bin/$GUESS_UIC ]; then
# UIC=$GUESS_UIC;
# fi ;
# done ;
#
# if [ ! "$UIC" ]; then
# echo -e "\n\n*** uic not found please set UIC by hand\n\a"
# exit 1
# else
# echo "Ok" ;
# fi
MAPPING_ROOT=`pwd`
BINDIR=$MAPPING_ROOT/bin
echo -n "Checking bin directory $BINDIR ... "
if [ ! -d $BINDIR ]; then
mkdir $BINDIR
echo "created."
else
echo "Ok."
fi
LIBDIR=$MAPPING_ROOT/lib
echo -n "Checking lib directory $LIBDIR ... "
if [ ! -d $LIBDIR ]; then
mkdir $LIBDIR
echo "created."
else
echo "Ok."
fi
CARMENFLAG=""
CARMENSUPPORT="0"
CARMEN_LIBS="libnavigator_interface.a libipc.a librobot_interface.a liblaser_interface.a libsimulator_interface.a liblocalize_interface.a libreadlog.a libwritelog.a libglobal.a libipc.a"
if [ ! "$CARMEN_HOME" ]; then
echo -e "Carmen NOT FOUND."
echo -e "If you have a carmen version installed please set the"
echo -e "CARMEN_HOME variable to the carmen path."
else
if [ -d $CARMEN_HOME ]; then
echo -e "carmen found in $CARMEN_HOME, enabling support"
CARMENFLAG="-DCARMEN_SUPPORT"
echo -e "generating shared objects"
for CARMEN_OBJECT in $CARMEN_LIBS ; do
if [ -f $CARMEN_HOME/lib/$CARMEN_OBJECT ]; then
cp $CARMEN_HOME/lib/$CARMEN_OBJECT $LIBDIR
./build_tools/generate_shared_object $LIBDIR/$CARMEN_OBJECT
rm $LIBDIR/$CARMEN_OBJECT
else
echo -e "Compile carmen first "$CARMEN_HOME/lib/$CARMEN_OBJECT" not found"
exit -1
fi
done;
CARMENSUPPORT="1"
else
echo -e "CARMEN_HOME=$CARMEN_HOME does not exist, disabling support\n"
fi
fi
CONFIG=global.mk
rm -f $CONFIG
cat << EOF > $CONFIG
### You should not need to change anything below.
LINUX=$LINUX
MACOSX=$MACOSX
# Compilers
CC=$CC
CXX=$CXX
# Paths
MAPPING_ROOT=$MAPPING_ROOT
LIBDIR=$LIBDIR
BINDIR=$BINDIR
# Build tools
PRETTY=$MAPPING_ROOT/build_tools/pretty_compiler
MESSAGE=$MAPPING_ROOT/build_tools/message
TESTLIB=$MAPPING_ROOT/build_tools/testlib
# QT support
MOC=$MOC
QT_LIB=$QT_LIB
QT_INCLUDE=$QT_INCLUDE
# ARIA support
ARIA_LIB=$ARIA_LIB
ARIA_INCLUDE=$ARIA_INCLUDE
# # KDE support
# KDE_LIB=$KDE_LIB
# KDE_INCLUDE=$KDE_INCLUDE
# UIC=$UIC
# Generic makefiles
MAKEFILE_GENERIC=$MAPPING_ROOT/build_tools/Makefile.generic-shared-object
MAKEFILE_APP=$MAPPING_ROOT/build_tools/Makefile.app
MAKEFILE_SUBDIRS=$MAPPING_ROOT/build_tools/Makefile.subdirs
# Flags
CPPFLAGS+=$CPPFLAGS -I$MAPPING_ROOT $CARMENFLAG
CXXFLAGS+=$CXXFLAGS
LDFLAGS+=$LDFLAGS -Xlinker -rpath $MAPPING_ROOT/lib
CARMENSUPPORT=$CARMENSUPPORT
ARIASUPPORT=$ARIASUPPORT
$OTHER
include $MAPPING_ROOT/manual.mk
EOF