configure revision ef760ec072915a165bd2d7a96f6eae6cbc5d967a
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering# The purpose of this script is to check for all external tools, headers, and
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering# libraries VBox OSE depends on.
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering# Copyright (C) 2006-2007 innotek GmbH
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering# This file is part of VirtualBox Open Source Edition (OSE), as
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering# available from http://www.virtualbox.org. This file is free software;
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering# you can redistribute it and/or modify it under the terms of the GNU
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering# General Public License as published by the Free Software Foundation,
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering# distribution. VirtualBox OSE is distributed in the hope that it will
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering# be useful, but WITHOUT ANY WARRANTY of any kind.
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering# append some extra paths
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering# Solaris (order of paths important for tr, echo, grep, sed to work)
0ac38b707212e9aa40e25d65ffbae648cc9116f5Lennart PoetteringPATH="/usr/xpg4/bin:/usr/ucb:$PATH:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin"
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart PoetteringLIBX11="-L/usr/X11R6/lib -L/usr/X11R6/lib64 -L/usr/local/lib -lXext -lX11"
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart PoetteringQTDIR="/usr/qt/3 /usr/lib/qt3 /usr/lib/qt-3.3 /usr/share/qt3 /usr/lib64/qt-3.3 /usr/X11R6 /usr/lib/qt"
de190aef08bb267b645205a747762df573b36834Lennart PoetteringKBUILDDIR="`cd \`dirname $0\`; pwd`/kBuild"
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poetteringif [ -d "/lib/modules/`uname -r`/build" ]; then
de190aef08bb267b645205a747762df573b36834Lennart Poettering# the restricting tool is ar (mri mode).
de190aef08bb267b645205a747762df573b36834Lennart Poetteringif (cd `dirname $0`; pwd)|grep -q "$INVALID_CHARS"; then
de190aef08bb267b645205a747762df573b36834Lennart Poettering echo "Error: VBox base path contains invalid characters!"
de190aef08bb267b645205a747762df573b36834Lennart Poettering rm -f .tmp_src.cc .tmp_src.c .tmp_out .test_execute.log
87d2c1ff6a7375f03476767e6f59454bcc5cd04bLennart Poettering if [ -z "$nofatal" -o "x$1" != "x" ]; then
ab060556a9e1ebb2744719a29985e40919101a22Zbigniew Jędrzejewski-Szmek printf "%-30s := %s\n" "$1" "$2" >> $CNF
unset retval
fail $3
elif which_wrapper $1 > /dev/null; then
fail $3
cat .tmp_src.cc >> $LOG
$CXX -O -Wall -o .tmp_out .tmp_src.cc $1 >> $LOG 2>&1
if [ $? -ne 0 ]; then
echo >> $LOG
echo >> $LOG
./.tmp_out > .test_execute.log
rc=$?
cat .test_execute.log | tee -a $LOG
fail $1
echo >> $LOG
echo >> $LOG
export PATH
WITH_QT=0
WITH_SDL=0
WITH_X11=0
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
cat > .tmp_src.cc << EOF
if test_execute; then
echo >> $LOG
echo >> $LOG
cat > .tmp_src.cc << EOF
if test_execute; then
echo >> $LOG
echo >> $LOG
if which_wrapper pkg-config > /dev/null; then
if [ $? -ne 0 ]; then
elif which_wrapper xml2-config; then
if [ $? -ne 0 ]; 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
if which_wrapper sdl-config > /dev/null; then
cat > .tmp_src.cc << EOF
if test_execute; 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
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.c << EOF
cat .tmp_src.c >> $LOG
if [ $? -ne 0 ]; 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
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"