configure

changeset 206
f5bdca63bbe7
parent 204
e870a7c8f223
child 207
27f8a41882a7
equal deleted inserted replaced
205:b8515afa450a 206:f5bdca63bbe7
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
417 break 417 break
418 done 418 done
419 419
420 # add general dependency flags to config.mk 420 # add general dependency flags to config.mk
421 echo >> $TEMP_DIR/config.mk 421 echo >> $TEMP_DIR/config.mk
422 if [[ ! -z ${CFLAGS} ]]; then 422 if [ ! -z "${CFLAGS}" ]; then
423 echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk 423 echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk
424 fi 424 fi
425 if [[ ! -z ${CXXFLAGS} ]]; then 425 if [ ! -z "${CXXFLAGS}" ]; then
426 echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk 426 echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk
427 fi 427 fi
428 if [[ ! -z ${LDFLAGS} ]]; then 428 if [ ! -z "${LDFLAGS}" ]; then
429 echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk 429 echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk
430 fi 430 fi
431 431
432 # 432 #
433 # OPTION VALUES 433 # OPTION VALUES
456 ERROR=1 456 ERROR=1
457 fi 457 fi
458 458
459 459
460 echo >> $TEMP_DIR/config.mk 460 echo >> $TEMP_DIR/config.mk
461 if [[ ! -z ${CFLAGS} ]]; then 461 if [ ! -z "${CFLAGS}" ]; then
462 echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk 462 echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk
463 fi 463 fi
464 if [[ ! -z ${CXXFLAGS} ]]; then 464 if [ ! -z "${CXXFLAGS}" ]; then
465 echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk 465 echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk
466 fi 466 fi
467 if [[ ! -z ${LDFLAGS} ]]; then 467 if [ ! -z "${LDFLAGS}" ]; then
468 echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk 468 echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk
469 fi 469 fi
470 470
471 if [ $ERROR -ne 0 ]; then 471 if [ $ERROR -ne 0 ]; then
472 echo 472 echo

mercurial