configure revision e92941d5f351f21572c170746b2b66f94fdcef86
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# The purpose of this script is to check for all external tools, headers, and
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# libraries VBox OSE depends on.
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# Copyright (C) 2006-2007 Sun Microsystems, Inc.
7eaaa8a4480370b82ef3735994f986f338fb4df2vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# available from http://www.virtualbox.org. This file is free software;
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# you can redistribute it and/or modify it under the terms of the GNU
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# General Public License as published by the Free Software Foundation,
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# distribution. VirtualBox OSE is distributed in the hope that it will
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# be useful, but WITHOUT ANY WARRANTY of any kind.
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# append some extra paths
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# Solaris (order of paths important for tr, echo, grep, sed to work)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncPATH="/usr/xpg4/bin:/usr/ucb:$PATH:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin"
9040f019271f91b98e1320c0a8c38a42636e3979vboxsync# Wrapper for ancient /usr/bin/which on darwin that always returns 0
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync if which /bin/___cErTaINly_a_nOn_eXisTing_fIle___ 2> /dev/null > /dev/null; then
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncLIBX11="-L/usr/X11R6/lib -L/usr/X11R6/lib64 -L/usr/local/lib -lXext -lX11"
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncQT3DIR="/usr/qt/3 /usr/lib/qt3 /usr/lib/qt-3.3 /usr/share/qt3"
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncQT3DIR="$QT3DIR /usr/lib64/qt-3.3 /usr/X11R6 /usr/lib/qt"
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncQT4DIR="/usr/lib/qt4 /usr/share/qt4 /usr/lib64/qt4 /usr"
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# the restricting tool is ar (mri mode).
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncif (cd `dirname $0`; pwd)|grep -q "$INVALID_CHARS"; then
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync echo "Error: VBox base path contains invalid characters!"
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# darwin /bin/sh has a builtin echo that doesn't grok -n. gotta love it.
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync rm -f .tmp_src.cc .tmp_src.c .tmp_out .test_execute.log
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync echo "$1"|$KBUILD_SED 's|-l\([^ ]\+\)|\1|g; s|^-[^l][^ ]*||g; s| -[^l][^ ]*||g; s|^ ||; s| *$||g'
88e9d91abf9293ecc1c70e0bf40e42f1c3a0bdcevboxsync echo "$1"|$KBUILD_SED 's|-L\([^ ]\+\)|\1|g; s|^-[^L][^ ]*||g; s| -[^L][^ ]*||g; s|^ ||; s| *$||g'
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync echo "$1"|$KBUILD_SED 's|-I\([^ ]\+\)|\1|g; s|^-[^I][^ ]*||g; s| -[^I][^ ]*||g; s|^ ||; s| *$||g'
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync elif which_wrapper $1 > /dev/null; then
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# Prepare a test
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# Compile a test
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync echo "compiling the following source file:" >> $LOG
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync echo "$CXX -O -Wall -o .tmp_out .tmp_src.cc \"$1\"" >> $LOG
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync $CXX -O -Wall -o .tmp_out .tmp_src.cc $1 >> $LOG 2>&1
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync if [ $? -ne 0 ]; then
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync echo " Check the file $LOG for detailed error information."
./.tmp_out > .test_execute.log
rc=$?
cat .test_execute.log | tee -a $LOG
fail $1
echo >> $LOG
echo >> $LOG
LD_LIBRARY_PATH=$1 ./.tmp_out > .test_execute.log
rc=$?
cat .test_execute.log | tee -a $LOG
echo >> $LOG
echo >> $LOG
export PATH
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
cat > .tmp_src.c << EOF
cat .tmp_src.c >> $LOG
$BCC -B $bcc_dir -C-c -3 -S -o .tmp_out .tmp_src.c >> $LOG 2>&1
if [ $? -ne 0 ]; then
unset bcc_path
unset bcc_dir
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
if [ $yasm_ver_mul -lt 501 ]; then
# Check for the iasl ACPI compiler, needed to compile vbox.dsl
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
if which_wrapper $GENISOIMAGE > /dev/null; then
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
if which_wrapper pkg-config > /dev/null; then
if [ $? -ne 0 ]; then
cat > .tmp_src.cc << EOF
if test_execute; then
elif which_wrapper xml2-config; then
if [ $? -ne 0 ]; then
cat > .tmp_src.cc << EOF
if test_execute; then
if which_wrapper pkg-config > /dev/null; then
if [ $? -ne 0 ]; then
cat > .tmp_src.cc << EOF
if test_execute; then
elif which_wrapper xslt-config; then
if [ $? -ne 0 ]; then
cat > .tmp_src.cc << EOF
if test_execute; then
if which_wrapper libIDL-config-2 > /dev/null; then
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
cat > .tmp_src.cc << EOF
if test_compile $LIBCRYPTO libcrypto openssl; then
if test_execute nofatal; then
cat > .tmp_src.cc << EOF
if test_compile $LIBPTHREAD pthread pthread; then
if test_execute; then
cat > .tmp_src.cc << EOF
if test_execute; then
cat > .tmp_src.cc << EOF
if test_execute; then
# OpenSUSE comes with 0.99.xxx where they changed the versioning scheme.
cat > .tmp_src.cc << EOF
if test_execute nofatal; then
cat > .tmp_src.cc << EOF
foundsdl=1
if which_wrapper sdl-config > /dev/null; then
foundsdl=1
cat > .tmp_src.cc << EOF
if test_execute; then
cat > .tmp_src.cc << EOF
if ! test_execute nofatal; then
cat > .tmp_src.cc << EOF
cat > .tmp_src.cc << EOF
cat > .tmp_src.cc << EOF
cat > .tmp_src.cc << EOF
cat > .tmp_src.cc << EOF
found_qt=0
cat .tmp_src.cc >> $LOG
$CXX -O -Wall -o .tmp_out .tmp_src.cc -I$q/include -L$q/$l -lqt-mt $LIBPTHREAD >> $LOG 2>&1
if [ $? -eq 0 ]; then
if test_execute; then
found_qt=1
if [ $? -ne 0 ]; then
foundqt4=1
if [ $QT4DIR_PKGCONFIG -eq 1 ]; then
if which_wrapper pkg-config > /dev/null; then
pkg-config QtCore --modversion 2>> $LOG`
if [ $? -ne 0 ]; then
foundqt4=1
cat > .tmp_src.cc << EOF
foundqt4=2
foundqt4=1
cat > .tmp_src.cc << EOF
if [ $? -ne 0 ]; then
cat > .tmp_src.cc << EOF
cat > .tmp_src.c << EOF
cat .tmp_src.c >> $LOG
if [ $? -ne 0 ]; then
if test_execute; then
if [ $? -ne 0 ]; then
echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
# Check for compiler.h
# Some Linux distributions include "compiler.h" in their libc linux
cat > .tmp_src.cc << EOF
if test_compile $LIBCAP libcap libcap; then
if test_execute; then
cat > .tmp_src.c << EOF
cat .tmp_src.c >> $LOG
if [ $? -ne 0 ]; then
cat > .tmp_src.cc << EOF
for p in $PYTHONDIR; do
cat .tmp_src.cc >> $LOG
if [ $? -eq 0 ]; then
found=1
if test_execute; then
if ! which_wrapper wine > /dev/null; then
if ! which_wrapper wineprefixcreate > /dev/null; then
mkdir -p $WINEPREFIX
if ! wineprefixcreate -q > /dev/null 2>&1; then
echo "\"PATH\"=\"c:\\\\\\\\windows\\\\\\\\system32;c:\\\\\\\\windows;z:$DEVDIR/win.x86/vcc/v8/bin/Microsoft.VC80.CRT;z:$DEVDIR/win.x86/HTML_Help_Workshop/v1.3\"" >> $tmp
# is around to prevent confusion when the build fails in src/recompiler.
# Note. Keep the which order in sync with the $(which ) in src/recompiler/Makefile.kmk.
cat << EOF
--nofatal)
--with-g++=*)
--ose)
--odir=*)
echo "Unrecognized option \"$option\""
echo >> $LOG
export PATH
echo >> $CNF
if [ -n "$HEADLESS" ]; then
echo "Source '$ENV' once before you start to build VBox:"
echo " source $ENV"
echo " cd ./out/$OS.$TARGET_MACHINE/$BUILD_TYPE/bin/src/vboxdrv"