configure revision 1157cb85c075851b8e510855221e0b8a1e6c9ab6
80833bb9a1bf25dcf19e814438a4b311d2e1f4cffuankg# The purpose of this script is to check for all external tools, headers, and
16f23f109da3b82fdca8695789bec9f06e2e3383humbedooh# libraries VBox OSE depends on.
e42e58d225104194ba5e894eb616be1ce2258e13jailletc# Copyright (C) 2006-2007 Sun Microsystems, Inc.
10b01707470385065764d144de9bb5297fe8ecf2ylavic# This file is part of VirtualBox Open Source Edition (OSE), as
10b01707470385065764d144de9bb5297fe8ecf2ylavic# available from http://www.virtualbox.org. This file is free software;
10b01707470385065764d144de9bb5297fe8ecf2ylavic# you can redistribute it and/or modify it under the terms of the GNU
b8efdc95bec9cf089aa1be0bfd07d46aa1137a7acovener# General Public License as published by the Free Software Foundation,
b8efdc95bec9cf089aa1be0bfd07d46aa1137a7acovener# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
b8efdc95bec9cf089aa1be0bfd07d46aa1137a7acovener# distribution. VirtualBox OSE is distributed in the hope that it will
c12b284247f00b5696adabb0b855ce0669465764ylavic# be useful, but WITHOUT ANY WARRANTY of any kind.
6029353b43240f5fa7feede018ce0e3ab1600c96covener# append some extra paths
8861e3760584fe7f451b3519163502a63c406eb3humbedooh# Solaris (order of paths important for tr, echo, grep, sed to work)
8861e3760584fe7f451b3519163502a63c406eb3humbedoohPATH="/usr/xpg4/bin:/usr/ucb:$PATH:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin"
e1f43cac62f6960a6945e1fb6e3288ef7082ac53rpluem# Wrapper for ancient /usr/bin/which on darwin that always returns 0
f06e7c4b1bce6b6491e5de0b7998d3f5696b293dchrisd if which /bin/___cErTaINly_a_nOn_eXisTing_fIle___ 2> /dev/null > /dev/null; then
9b0076ddd1103e5fa9c1f9bafde4b06ce244fbaecovenerLIBX11="-L/usr/X11R6/lib -L/usr/X11R6/lib64 -L/usr/local/lib -lXext -lX11"
56589be3d7a3e9343370df240010c6928cc78b39jkaluzaQT4DIR="/usr/lib/qt4 /usr/share/qt4 /usr/lib64/qt4 /usr"
f87299dab99bc04b51a6b8cad51b6795db862c0atrawick# the restricting tool is ar (mri mode).
4d12805e6c18253040223ea637acd6b3b3c18f60jortonif (cd `dirname $0`; pwd)|grep -q "$INVALID_CHARS"; then
4d12805e6c18253040223ea637acd6b3b3c18f60jorton echo "Error: VBox base path contains invalid characters!"
a4df2cd1e1391575a327c2a90ba4315f805a0a78covener# darwin /bin/sh has a builtin echo that doesn't grok -n. gotta love it.
75a230a728338d84dcfe81edd375352f34de22d0covener rm -f $ODIR.tmp_src.cc $ODIR.tmp_src.c $ODIR.tmp_out $ODIR.test_execute.log
05a5a9c3e16f21566e1b61f4bd68025ce1b741ccjoes echo "$1"|$KBUILD_SED 's|-l\([^ ]\+\)|\1|g; s|^-[^l][^ ]*||g; s| -[^l][^ ]*||g; s|^ ||; s| *$||g'
ef82e8fa164e0a1f8b813f7deb6b7ead96018c94niq echo "$1"|$KBUILD_SED 's|-L\([^ ]\+\)|\1|g; s|^-[^L][^ ]*||g; s| -[^L][^ ]*||g; s|^ ||; s| *$||g'
c12917da693bae4028a1d5a5e8224bceed8c739dsf echo "$1"|$KBUILD_SED 's|-I\([^ ]\+\)|\1|g; s|^-[^I][^ ]*||g; s| -[^I][^ ]*||g; s|^ ||; s| *$||g'
9811aed12bbc71783d2e544ccb5fecd193843eadsf elif which_wrapper $1 > /dev/null; then
2a7beea91d46beb41f043a84eaad060047ee04aafabien# Prepare a test
f21e9e3d0bfb7a507ecc5bc963f2159d693503d1sf# Compile a test
132ee6ac1c26d6e8953836316ba50734eefab47bsf echo "$CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc \"$1\"" >> $LOG
85eacfc96a04547ef25aabbc06440039715084c2jorton $CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc $1 >> $LOG 2>&1
85eacfc96a04547ef25aabbc06440039715084c2jorton if [ $? -ne 0 ]; then
536d2e7cd1fdec1255b8c3bdf41fdc714c506a54trawick echo " Check the file $LOG for detailed error information."
7b395e4e878c28a4784919cfd2e704ddd14a3390jorton# Execute a compiled test binary
3e4e54d4e3fc0123c63d57aa84ac7ad7a8c73ff8jorton if [ $rc -ne 0 ]; then
ca61ccd0c306c2c72df153688ba1b49f3eceed80sf# Execute a compiled test binary
e6dd71992459d05a676b98b7963423dc5dc1e24aminfrin echo "executing the binary (LD_LIBRARY_PATH=$1)" >> $LOG
e6dd71992459d05a676b98b7963423dc5dc1e24aminfrin LD_LIBRARY_PATH=$1 $ODIR.tmp_out > $ODIR.test_execute.log
23f1535d6a60817d2846bac0aea230ea475d7dccminfrin if [ $rc -ne 0 ]; then
6249dfa569d3b4f1f539665b979a80c6e335d93etrawick# Check for OS, MACHINE, CPU
6249dfa569d3b4f1f539665b979a80c6e335d93etrawick OS=`uname -s | sed -e 's/GNU\/Linux/Linux/g' | tr [:upper:] [:lower:]`
export PATH
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
cat > $ODIR.tmp_src.c << EOF
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 > $ODIR.tmp_src.cc << EOF
if test_execute; then
elif which_wrapper xml2-config; then
if [ $? -ne 0 ]; then
cat > $ODIR.tmp_src.cc << EOF
if test_execute; then
if which_wrapper pkg-config > /dev/null; then
if [ $? -ne 0 ]; then
cat > $ODIR.tmp_src.cc << EOF
if test_execute; then
elif which_wrapper xslt-config; then
if [ $? -ne 0 ]; then
cat > $ODIR.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 > $ODIR.tmp_src.cc << EOF
if test_compile $LIBCRYPTO libcrypto openssl; then
if test_execute nofatal; then
cat > $ODIR.tmp_src.cc << EOF
if test_compile $LIBPTHREAD pthread pthread; then
if test_execute; then
cat > $ODIR.tmp_src.cc << EOF
if test_execute; then
cat > $ODIR.tmp_src.cc << EOF
if test_execute; then
# OpenSUSE comes with 0.99.xxx where they changed the versioning scheme.
cat > $ODIR.tmp_src.cc << EOF
if test_execute nofatal; then
cat > $ODIR.tmp_src.cc << EOF
foundsdl=1
if which_wrapper sdl-config > /dev/null; then
foundsdl=1
cat > $ODIR.tmp_src.cc << EOF
if test_execute; then
cat > $ODIR.tmp_src.cc << EOF
if ! test_execute nofatal; then
cat > $ODIR.tmp_src.cc << EOF
cat > $ODIR.tmp_src.cc << EOF
cat > $ODIR.tmp_src.cc << EOF
cat > $ODIR.tmp_src.cc << EOF
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 > $ODIR.tmp_src.cc << EOF
foundqt4=2
foundqt4=1
cat > $ODIR.tmp_src.cc << EOF
if [ $? -ne 0 ]; then
cat > $ODIR.tmp_src.cc << EOF
cat > $ODIR.tmp_src.c << EOF
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 > $ODIR.tmp_src.cc << EOF
if test_compile $LIBCAP libcap libcap; then
if test_execute; then
cat > $ODIR.tmp_src.c << EOF
if [ $? -ne 0 ]; then
cat > $ODIR.tmp_src.cc << EOF
for p in $PYTHONDIR; do
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=*)
if [ -d $out_path ]; then
cd $out_path
cd $saved_path
echo "Unrecognized option \"$option\""
echo >> $LOG
export PATH
echo >> $CNF
if [ -n "$HEADLESS" ]; then
# TODO check for xcomposite-dev (X11/extensions/Xcomposite.h)
echo "Source '$ENV' once before you start to build VBox:"
echo " source $ENV"
echo " cd $vbox_out_path/$OS.$TARGET_MACHINE/$BUILD_TYPE/bin/src/vboxdrv"