test/configure

changeset 9
ebdecbbb2f79
parent 8
82cd9f1d94cb
child 11
215b49563679
equal deleted inserted replaced
8:82cd9f1d94cb 9:ebdecbbb2f79
102 unset FEATURE_PG 102 unset FEATURE_PG
103 fi 103 fi
104 done 104 done
105 105
106 # set dir variables 106 # set dir variables
107 if [ -z $BINDIR ]; then 107 if [ -z "$BINDIR" ]; then
108 BINDIR=$EPREFIX/bin 108 BINDIR=$EPREFIX/bin
109 fi 109 fi
110 if [ -z $SBINDIR ]; then 110 if [ -z "$SBINDIR" ]; then
111 SBINDIR=$EPREFIX/sbin 111 SBINDIR=$EPREFIX/sbin
112 fi 112 fi
113 if [ -z $LIBDIR ]; then 113 if [ -z "$LIBDIR" ]; then
114 LIBDIR=$EPREFIX/lib 114 LIBDIR=$EPREFIX/lib
115 fi 115 fi
116 if [ -z $LIBEXEC ]; then 116 if [ -z "$LIBEXEC" ]; then
117 LIBEXECDIR=$EPREFIX/libexec 117 LIBEXECDIR=$EPREFIX/libexec
118 fi 118 fi
119 if [ -z $DATADIR ]; then 119 if [ -z "$DATADIR" ]; then
120 DATADIR=$PREFIX/share 120 DATADIR=$PREFIX/share
121 fi 121 fi
122 if [ -z $SYSCONFDIR]; then 122 if [ -z "$SYSCONFDIR" ]; then
123 SYSCONFDIR=$PREFIX/etc 123 SYSCONFDIR=$PREFIX/etc
124 fi 124 fi
125 if [ -z $SHAREDSTATEDIR ]; then 125 if [ -z "$SHAREDSTATEDIR" ]; then
126 SHAREDSTATEDIR=$PREFIX/com 126 SHAREDSTATEDIR=$PREFIX/com
127 fi 127 fi
128 if [ -z $LOCALSTATEDIR ]; then 128 if [ -z "$LOCALSTATEDIR" ]; then
129 LOCALSTATEDIR=$PREFIX/var 129 LOCALSTATEDIR=$PREFIX/var
130 fi 130 fi
131 if [ -z $INCLUDEDIR ]; then 131 if [ -z "$INCLUDEDIR" ]; then
132 INCLUDEDIR=$PREFIX/include 132 INCLUDEDIR=$PREFIX/include
133 fi 133 fi
134 if [ -z $INFODIR ]; then 134 if [ -z "$INFODIR" ]; then
135 INFODIR=$PREFIX/info 135 INFODIR=$PREFIX/info
136 fi 136 fi
137 if [ -z $MANDIR ]; then 137 if [ -z "$MANDIR" ]; then
138 MANDIR=$PREFIX/man 138 MANDIR=$PREFIX/man
139 fi 139 fi
140 140
141 which pkg-config > /dev/null 141 which pkg-config > /dev/null
142 if [ $? -ne 0 ]; then 142 if [ $? -eq 0 ]; then
143 PKG_CONFIG=pkg-config 143 PKG_CONFIG=pkg-config
144 else 144 else
145 PKG_CONFIG=false 145 PKG_CONFIG=false
146 fi 146 fi
147 147
224 # this will insert make vars to config.mk 224 # this will insert make vars to config.mk
225 source make/toolchain.sh 225 source make/toolchain.sh
226 226
227 # add user specified flags to config.mk 227 # add user specified flags to config.mk
228 echo >> $TEMP_DIR/config.mk 228 echo >> $TEMP_DIR/config.mk
229 if [[ ! -z ${ENV_CFLAGS} ]]; then 229 if [ ! -z "${ENV_CFLAGS}" ]; then
230 echo "CFLAGS += $ENV_CFLAGS" >> $TEMP_DIR/config.mk 230 echo "CFLAGS += $ENV_CFLAGS" >> $TEMP_DIR/config.mk
231 fi 231 fi
232 if [[ ! -z ${ENV_CXXFLAGS} ]]; then 232 if [ ! -z "${ENV_CXXFLAGS}" ]; then
233 echo "CXXFLAGS += $ENV_CXXFLAGS" >> $TEMP_DIR/config.mk 233 echo "CXXFLAGS += $ENV_CXXFLAGS" >> $TEMP_DIR/config.mk
234 fi 234 fi
235 if [[ ! -z ${ENV_LDFLAGS} ]]; then 235 if [ ! -z "${ENV_LDFLAGS}" ]; then
236 echo "LDFLAGS += $ENV_LDFLAGS" >> $TEMP_DIR/config.mk 236 echo "LDFLAGS += $ENV_LDFLAGS" >> $TEMP_DIR/config.mk
237 fi 237 fi
238 238
239 # 239 #
240 # DEPENDENCIES 240 # DEPENDENCIES
244 { 244 {
245 printf "checking for libpq... " 245 printf "checking for libpq... "
246 # dependency libpq 246 # dependency libpq
247 while true 247 while true
248 do 248 do
249 if [ -z "PKG_CONFIG" ]; then 249 if [ -z "$PKG_CONFIG" ]; then
250 break 250 break
251 fi 251 fi
252 if ! pkg-config libpq ; then 252 if ! $PKG_CONFIG libpq ; then
253 break 253 break
254 fi 254 fi
255 CFLAGS+=" `pkg-config --cflags libpq`" 255 CFLAGS+=" `$PKG_CONFIG --cflags libpq`"
256 LDFLAGS+=" `pkg-config --libs libpq`" 256 LDFLAGS+=" `$PKG_CONFIG --libs libpq`"
257 echo yes 257 echo yes
258 return 0 258 return 0
259 done 259 done
260 260
261 echo no 261 echo no
265 { 265 {
266 printf "checking for openssl... " 266 printf "checking for openssl... "
267 # dependency openssl 267 # dependency openssl
268 while true 268 while true
269 do 269 do
270 if [ -z "PKG_CONFIG" ]; then 270 if [ -z "$PKG_CONFIG" ]; then
271 break 271 break
272 fi 272 fi
273 if ! pkg-config openssl ; then 273 if ! $PKG_CONFIG openssl ; then
274 break 274 break
275 fi 275 fi
276 CFLAGS+=" `pkg-config --cflags openssl`" 276 CFLAGS+=" `$PKG_CONFIG --cflags openssl`"
277 LDFLAGS+=" `pkg-config --libs openssl`" 277 LDFLAGS+=" `$PKG_CONFIG --libs openssl`"
278 echo yes 278 echo yes
279 return 0 279 return 0
280 done 280 done
281 281
282 echo no 282 echo no
286 { 286 {
287 printf "checking for libxml2... " 287 printf "checking for libxml2... "
288 # dependency libxml2 288 # dependency libxml2
289 while true 289 while true
290 do 290 do
291 if [ -z "PKG_CONFIG" ]; then 291 if [ -z "$PKG_CONFIG" ]; then
292 break 292 break
293 fi 293 fi
294 if ! pkg-config libxml-2.0 ; then 294 if ! $PKG_CONFIG libxml-2.0 ; then
295 break 295 break
296 fi 296 fi
297 CFLAGS+=" `pkg-config --cflags libxml-2.0`" 297 CFLAGS+=" `$PKG_CONFIG --cflags libxml-2.0`"
298 LDFLAGS+=" `pkg-config --libs libxml-2.0`" 298 LDFLAGS+=" `$PKG_CONFIG --libs libxml-2.0`"
299 echo yes 299 echo yes
300 return 0 300 return 0
301 done 301 done
302 302
303 echo no 303 echo no
321 break 321 break
322 done 322 done
323 323
324 # add general dependency flags to config.mk 324 # add general dependency flags to config.mk
325 echo >> $TEMP_DIR/config.mk 325 echo >> $TEMP_DIR/config.mk
326 if [[ ! -z ${CFLAGS} ]]; then 326 if [ ! -z "${CFLAGS}" ]; then
327 echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk 327 echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk
328 fi 328 fi
329 if [[ ! -z ${CXXFLAGS} ]]; then 329 if [ ! -z "${CXXFLAGS}" ]; then
330 echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk 330 echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk
331 fi 331 fi
332 if [[ ! -z ${LDFLAGS} ]]; then 332 if [ ! -z "${LDFLAGS}" ]; then
333 echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk 333 echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk
334 fi 334 fi
335 335
336 # 336 #
337 # OPTION VALUES 337 # OPTION VALUES
360 ERROR=1 360 ERROR=1
361 fi 361 fi
362 362
363 363
364 echo >> $TEMP_DIR/config.mk 364 echo >> $TEMP_DIR/config.mk
365 if [[ ! -z ${CFLAGS} ]]; then 365 if [ ! -z "${CFLAGS}" ]; then
366 echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk 366 echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk
367 fi 367 fi
368 if [[ ! -z ${CXXFLAGS} ]]; then 368 if [ ! -z "${CXXFLAGS}" ]; then
369 echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk 369 echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk
370 fi 370 fi
371 if [[ ! -z ${LDFLAGS} ]]; then 371 if [ ! -z "${LDFLAGS}" ]; then
372 echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk 372 echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk
373 fi 373 fi
374 374
375 if [ $ERROR -ne 0 ]; then 375 if [ $ERROR -ne 0 ]; then
376 echo 376 echo

mercurial