test/make/configure.vm

changeset 9
ebdecbbb2f79
parent 7
686991ae6e2f
child 11
215b49563679
equal deleted inserted replaced
8:82cd9f1d94cb 9:ebdecbbb2f79
160 #end 160 #end
161 fi 161 fi
162 done 162 done
163 163
164 # set dir variables 164 # set dir variables
165 if [ -z $BINDIR ]; then 165 if [ -z "$BINDIR" ]; then
166 BINDIR=$EPREFIX/bin 166 BINDIR=$EPREFIX/bin
167 fi 167 fi
168 if [ -z $SBINDIR ]; then 168 if [ -z "$SBINDIR" ]; then
169 SBINDIR=$EPREFIX/sbin 169 SBINDIR=$EPREFIX/sbin
170 fi 170 fi
171 if [ -z $LIBDIR ]; then 171 if [ -z "$LIBDIR" ]; then
172 LIBDIR=$EPREFIX/lib 172 LIBDIR=$EPREFIX/lib
173 fi 173 fi
174 if [ -z $LIBEXEC ]; then 174 if [ -z "$LIBEXEC" ]; then
175 LIBEXECDIR=$EPREFIX/libexec 175 LIBEXECDIR=$EPREFIX/libexec
176 fi 176 fi
177 if [ -z $DATADIR ]; then 177 if [ -z "$DATADIR" ]; then
178 DATADIR=$PREFIX/share 178 DATADIR=$PREFIX/share
179 fi 179 fi
180 if [ -z $SYSCONFDIR]; then 180 if [ -z "$SYSCONFDIR" ]; then
181 SYSCONFDIR=$PREFIX/etc 181 SYSCONFDIR=$PREFIX/etc
182 fi 182 fi
183 if [ -z $SHAREDSTATEDIR ]; then 183 if [ -z "$SHAREDSTATEDIR" ]; then
184 SHAREDSTATEDIR=$PREFIX/com 184 SHAREDSTATEDIR=$PREFIX/com
185 fi 185 fi
186 if [ -z $LOCALSTATEDIR ]; then 186 if [ -z "$LOCALSTATEDIR" ]; then
187 LOCALSTATEDIR=$PREFIX/var 187 LOCALSTATEDIR=$PREFIX/var
188 fi 188 fi
189 if [ -z $INCLUDEDIR ]; then 189 if [ -z "$INCLUDEDIR" ]; then
190 INCLUDEDIR=$PREFIX/include 190 INCLUDEDIR=$PREFIX/include
191 fi 191 fi
192 if [ -z $INFODIR ]; then 192 if [ -z "$INFODIR" ]; then
193 INFODIR=$PREFIX/info 193 INFODIR=$PREFIX/info
194 fi 194 fi
195 if [ -z $MANDIR ]; then 195 if [ -z "$MANDIR" ]; then
196 MANDIR=$PREFIX/man 196 MANDIR=$PREFIX/man
197 fi 197 fi
198 198
199 which pkg-config > /dev/null 199 which pkg-config > /dev/null
200 if [ $? -ne 0 ]; then 200 if [ $? -eq 0 ]; then
201 PKG_CONFIG=pkg-config 201 PKG_CONFIG=pkg-config
202 else 202 else
203 PKG_CONFIG=false 203 PKG_CONFIG=false
204 fi 204 fi
205 205
309 # this will insert make vars to config.mk 309 # this will insert make vars to config.mk
310 source make/toolchain.sh 310 source make/toolchain.sh
311 311
312 # add user specified flags to config.mk 312 # add user specified flags to config.mk
313 echo >> $TEMP_DIR/config.mk 313 echo >> $TEMP_DIR/config.mk
314 if [[ ! -z ${ENV_CFLAGS} ]]; then 314 if [ ! -z "${ENV_CFLAGS}" ]; then
315 echo "CFLAGS += $ENV_CFLAGS" >> $TEMP_DIR/config.mk 315 echo "CFLAGS += $ENV_CFLAGS" >> $TEMP_DIR/config.mk
316 fi 316 fi
317 if [[ ! -z ${ENV_CXXFLAGS} ]]; then 317 if [ ! -z "${ENV_CXXFLAGS}" ]; then
318 echo "CXXFLAGS += $ENV_CXXFLAGS" >> $TEMP_DIR/config.mk 318 echo "CXXFLAGS += $ENV_CXXFLAGS" >> $TEMP_DIR/config.mk
319 fi 319 fi
320 if [[ ! -z ${ENV_LDFLAGS} ]]; then 320 if [ ! -z "${ENV_LDFLAGS}" ]; then
321 echo "LDFLAGS += $ENV_LDFLAGS" >> $TEMP_DIR/config.mk 321 echo "LDFLAGS += $ENV_LDFLAGS" >> $TEMP_DIR/config.mk
322 fi 322 fi
323 323
324 # 324 #
325 # DEPENDENCIES 325 # DEPENDENCIES
342 if isplatform "${not}"; then 342 if isplatform "${not}"; then
343 break 343 break
344 fi 344 fi
345 #end 345 #end
346 #if( $sub.pkgconfig.size() > 0 ) 346 #if( $sub.pkgconfig.size() > 0 )
347 if [ -z "PKG_CONFIG" ]; then 347 if [ -z "$PKG_CONFIG" ]; then
348 break 348 break
349 fi 349 fi
350 #end 350 #end
351 #foreach( $pkg in $sub.pkgconfig ) 351 #foreach( $pkg in $sub.pkgconfig )
352 if ! pkg-config $pkg.getPkgConfigParam() ; then 352 if ! $PKG_CONFIG $pkg.getPkgConfigParam() ; then
353 break 353 break
354 fi 354 fi
355 CFLAGS+=" `pkg-config --cflags $pkg.getPkgConfigParam()`" 355 CFLAGS+=" `$PKG_CONFIG --cflags $pkg.getPkgConfigParam()`"
356 LDFLAGS+=" `pkg-config --libs $pkg.getPkgConfigParam()`" 356 LDFLAGS+=" `$PKG_CONFIG --libs $pkg.getPkgConfigParam()`"
357 #end 357 #end
358 #foreach( $flags in $sub.flags ) 358 #foreach( $flags in $sub.flags )
359 #if( $flags.exec ) 359 #if( $flags.exec )
360 $flags.value > /dev/null 360 $flags.value > /dev/null
361 if [ $? -eq 0 ]; then 361 if [ $? -eq 0 ]; then
409 fi 409 fi
410 #end 410 #end
411 while true 411 while true
412 do 412 do
413 #if( $dependency.pkgconfig.size() > 0 ) 413 #if( $dependency.pkgconfig.size() > 0 )
414 if [ -z "PKG_CONFIG" ]; then 414 if [ -z "$PKG_CONFIG" ]; then
415 ERROR=1 415 ERROR=1
416 break 416 break
417 fi 417 fi
418 #end 418 #end
419 #foreach( $pkg in $dependency.pkgconfig ) 419 #foreach( $pkg in $dependency.pkgconfig )
420 printf "checking for pkg-config package $pkg.getPkgConfigParam()... " 420 printf "checking for pkg-config package $pkg.getPkgConfigParam()... "
421 if ! pkg-config $pkg.getPkgConfigParam() ; then 421 if ! $PKG_CONFIG $pkg.getPkgConfigParam() ; then
422 echo no 422 echo no
423 ERROR=1 423 ERROR=1
424 break 424 break
425 fi 425 fi
426 echo yes 426 echo yes
427 CFLAGS+=" `pkg-config --cflags $pkg.getPkgConfigParam()`" 427 CFLAGS+=" `$PKG_CONFIG --cflags $pkg.getPkgConfigParam()`"
428 LDFLAGS+=" `pkg-config --libs $pkg.getPkgConfigParam()`" 428 LDFLAGS+=" `$PKG_CONFIG --libs $pkg.getPkgConfigParam()`"
429 #end 429 #end
430 430
431 #foreach( $flags in $dependency.flags ) 431 #foreach( $flags in $dependency.flags )
432 #if( $flags.exec ) 432 #if( $flags.exec )
433 $flags.value > /dev/null 433 $flags.value > /dev/null
454 done 454 done
455 #end 455 #end
456 456
457 # add general dependency flags to config.mk 457 # add general dependency flags to config.mk
458 echo >> $TEMP_DIR/config.mk 458 echo >> $TEMP_DIR/config.mk
459 if [[ ! -z ${CFLAGS} ]]; then 459 if [ ! -z "${CFLAGS}" ]; then
460 echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk 460 echo "CFLAGS += $CFLAGS" >> $TEMP_DIR/config.mk
461 fi 461 fi
462 if [[ ! -z ${CXXFLAGS} ]]; then 462 if [ ! -z "${CXXFLAGS}" ]; then
463 echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk 463 echo "CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk
464 fi 464 fi
465 if [[ ! -z ${LDFLAGS} ]]; then 465 if [ ! -z "${LDFLAGS}" ]; then
466 echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk 466 echo "LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk
467 fi 467 fi
468 #end 468 #end
469 469
470 # 470 #
565 fi 565 fi
566 fi 566 fi
567 #end 567 #end
568 568
569 echo >> $TEMP_DIR/config.mk 569 echo >> $TEMP_DIR/config.mk
570 if [[ ! -z ${CFLAGS} ]]; then 570 if [ ! -z "${CFLAGS}" ]; then
571 echo "${target.getCFlags()} += $CFLAGS" >> $TEMP_DIR/config.mk 571 echo "${target.getCFlags()} += $CFLAGS" >> $TEMP_DIR/config.mk
572 fi 572 fi
573 if [[ ! -z ${CXXFLAGS} ]]; then 573 if [ ! -z "${CXXFLAGS}" ]; then
574 echo "${target.getCXXFlags()} += $CXXFLAGS" >> $TEMP_DIR/config.mk 574 echo "${target.getCXXFlags()} += $CXXFLAGS" >> $TEMP_DIR/config.mk
575 fi 575 fi
576 if [[ ! -z ${LDFLAGS} ]]; then 576 if [ ! -z "${LDFLAGS}" ]; then
577 echo "${target.getLDFlags()} += $LDFLAGS" >> $TEMP_DIR/config.mk 577 echo "${target.getLDFlags()} += $LDFLAGS" >> $TEMP_DIR/config.mk
578 fi 578 fi
579 579
580 #end 580 #end
581 if [ $ERROR -ne 0 ]; then 581 if [ $ERROR -ne 0 ]; then

mercurial