configure revision d496c4d1ed30f10970ca2c170cd9b5921d8d89b1
a4544a5a0e622ef69e38641f87ab1b5685e05911Phill Cunnington#!/bin/bash
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# The purpose of this script is to check for all external tools, headers, and
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# libraries VBox OSE depends on.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Copyright (C) 2006 InnoTek Systemberatung GmbH
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# This file is part of VirtualBox Open Source Edition (OSE), as
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# available from http://www.virtualbox.org. This file is free software;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# you can redistribute it and/or modify it under the terms of the GNU
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# General Public License as published by the Free Software Foundation,
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# distribution. VirtualBox OSE is distributed in the hope that it will
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# be useful, but WITHOUT ANY WARRANTY of any kind.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# If you received this file as part of a commercial VirtualBox
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# distribution, then only the terms of your commercial VirtualBox
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# license agreement apply instead of the previous paragraph.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterLC_ALL=C
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterexport LC_ALL
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Default positions
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a4544a5a0e622ef69e38641f87ab1b5685e05911Phill CunningtonOSE=1
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterXPCOM=1
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterCC="gcc"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterCXX="g++"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterBCC="bcc"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterYASM="yasm"
449854c2a07b50ea64d9d6a8b03d18d4afeeee43Ken StubbingsIASL="iasl"
449854c2a07b50ea64d9d6a8b03d18d4afeeee43Ken StubbingsAS86="as86"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterXSLTPROC="xsltproc"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterGENISOIMAGE="genisoimage"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterMKISOFS="mkisofs"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterINCXALAN=""
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterLIBXALAN="-lxalan-c"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterINCXERCES=""
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterLIBXERCES="-lxerces-c"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterLIBUUID="-luuid"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterINCSDL="/usr/include/SDL"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterLIBSDL="-lSDL"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterLIBSDLMAIN="-lSDLmain"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterLIBCRYPTO="-lcrypto"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterLIBPTHREAD="-lpthread"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterLIBX11="-L/usr/X11R6/lib -lXext -lX11"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterLIBXCURSOR="-lXcursor"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterINCZ=""
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterLIBZ="-lz"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterINCPNG=""
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterLIBPNG="-lpng"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterQTDIR="/usr/qt/3 /usr/lib/qt3 /usr/share/qt3"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterKBUILDDIR="`cd $(dirname $0); pwd`/kBuild"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterDEVDIR="`cd $(dirname $0); pwd`/tools"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterif [ -d /lib/modules/`uname -r`/build ]; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster LINUX="/lib/modules/`uname -r`/build"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterelse
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster LINUX="/usr/src/linux"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterKCHMVIEWER="kchmviewer"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterLOG="configure.log"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterCNF="AutoConfig.kmk"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterENV="env.sh"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterBUILD_TYPE="release"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# the restricting tool is ar (mri mode).
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan FosterINVALID_CHARS="[^A-Za-z0-9/\\$:._-]"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterif (cd $(dirname $0); pwd)|grep -q "$INVALID_CHARS"; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo "Error: VBox base path contains invalid characters!"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster exit 1
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction cleanup()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster rm -f .tmp_src.cc .tmp_src.c .tmp_out .test_execute.log
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction fail()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if [ -z "$nofatal" -o "x$1" != "x" ]; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cleanup
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster rm -f $ENV
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster exit 1
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction log_success()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if [ -n "$1" ]; then echo -n "$1, "; fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo "OK."
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo -e "$1\n\n" >> $LOG
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction log_failure()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo -e "\n ** $1!"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo -e "** $1!\n" >> $LOG
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction cnf_append()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf "%-26s := %s\n" "$1" "$2" >> $CNF
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Wrapper for ancient /usr/bin/which on darwin that always returns 0
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction which_wrapper()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if [ -z "$have_ancient_which" ]; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if which /bin/___cErTaINly_a_nOn_eXisTing_fIle___ 2> /dev/null > /dev/null; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster have_ancient_which="yes"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster have_ancient_which="no"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if [ "$have_ancient_which" = "yes" ]; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster local retval=`which $* 2>/dev/null`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo "$retval"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test -n "$retval" -a -e "$retval"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster which $* 2> /dev/null
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_avail()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if [ -z "$1" ]; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_failure "$2 is empty"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fail $3
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 1
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster elif which_wrapper $1 > /dev/null; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 0
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_failure "$1 (variable $2) not found"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fail $3
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 1
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Prepare a test
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction test_header()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo "***** Checking $1 *****" >> $LOG
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo -n "Checking for $1: "
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Compile a test
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction test_compile()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo "compiling the following source file:" >> $LOG
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cat .tmp_src.cc >> $LOG
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo "using the following command line:" >> $LOG
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo "$CXX -O -Wall -o .tmp_out .tmp_src.cc \"$1\"" >> $LOG
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster $CXX -O -Wall -o .tmp_out .tmp_src.cc $1 >> $LOG 2>&1
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (($?!=0)); then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if [ -z "$4" ]; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo -e "\n $2 not found at $1 or $3 headers not found"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo " Check the file $LOG for detailed error information."
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fail
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo "not found."
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo -e "\n" >> $LOG
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 1
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 0
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Execute a compiled test binary
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction test_execute()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo "executing the binary" >> $LOG
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster ./.tmp_out > .test_execute.log
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster rc=$?
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cat .test_execute.log | tee -a $LOG
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (($rc!=0)); then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fail $1
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 1
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo -e "\n\n" >> $LOG
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 0
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for OS, MACHINE, CPU
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_environment()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header environment
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster CPU=`uname -m`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster case "$CPU" in
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster i[3456789]86|x86)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster MACHINE='x86'
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster ;;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster x86_64|amd64)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster MACHINE='amd64'
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster CPU='k8'
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo ""
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo ""
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo "Warning! Support for AMD64 host systems is work in progress."
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo " Don't expect it to work or even to build at the moment."
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo ""
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo ""
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster ;;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster *)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_failure "Cannot determine system"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster exit 1
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster ;;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster esac
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster OS=`uname -s | sed -e 's/GNU\/Linux/Linux/g' | tr 'A-Z' 'a-z'`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster case "$OS" in
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster linux)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster ;;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster darwin)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster ;;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster *)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_failure "Cannot determine OS"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster exit 1
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster ;;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster esac
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster DEVDIR_BIN="$DEVDIR/$OS.$MACHINE/bin"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster KBUILDDIR_BIN="$KBUILDDIR/bin/$OS.$MACHINE"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_success "Determined $OS.$MACHINE"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster # Automatically disable XPCOM on darwin.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if [ "$OS" = "darwin" -a $XPCOM -eq 1 ]; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster XPCOM=0
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo "Disabling checks for XPCOM related components."
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for gcc with version >= 3.2.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# We depend on a working gcc, if we fail terminate in every case.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_gcc()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header gcc
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if check_avail "$CC" CC really; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cc_ver=`$CC -dumpversion`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if check_avail "$CXX" CXX really; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cxx_ver=`$CXX -dumpversion`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cc_maj=`echo $cc_ver|cut -d. -f1`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cc_min=`echo $cc_ver|cut -d. -f2`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if [ "x$cc_ver" != "x$cxx_ver" ]; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_failure "gcc version $cc_ver does not match g++ version $cxx_ver"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fail really
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster elif (($cc_maj>3)); then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_success "found version $cc_ver, using precompiled objects for recompiler"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "VBOX_USING_GCC4" "1"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster elif (($cc_maj<3 || $cc_min<2)); then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_failure "gcc version $cc_ver found, expected at least gcc version 3.2"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fail really
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_success "found version $cc_ver"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if [ "$CC" != "gcc" ]; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "TOOL_GCC3_CC" "$CC"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "TOOL_GCC3_AS" "$CC"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if [ "$CXX" != "g++" ]; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "TOOL_GCC3_CXX" "$CXX"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "TOOL_GCC3_LD" "$CXX"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for the bcc compiler, needed for compiling the BIOS
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_bcc()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header bcc
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if check_avail "$BCC" BCC; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster bcc_ver=`$BCC -v 2>&1|grep version|sed 's+^bcc: version \(.*\)+\1+'`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (($?!=0)); then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_failure "not found"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fail
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo "compiling the following source file:" >> $LOG
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo '
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterint foo(a)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster int a;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 0;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster' > .tmp_src.c
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cat .tmp_src.c >> $LOG
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster local bcc_path=`which_wrapper $BCC`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster local bcc_dir="`dirname $bcc_path`/"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo "using the following command line:" >> $LOG
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo "$BCC -B $bcc_dir -C-c -3 -S -o .tmp_out .tmp_src.c" >> $LOG
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster $BCC -B $bcc_dir -C-c -3 -S -o .tmp_out .tmp_src.c >> $LOG 2>&1
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (($?!=0)); then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_failure "not found"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fail
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_success "found version $bcc_ver"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "VBOX_BCC" "$bcc_path -B $bcc_dir"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for the as86 assembler, needed for compiling the BIOS
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_as86()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header as86
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if check_avail "$AS86" AS86; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster as86_ver=`$AS86 -v 2>&1|grep version|sed 's+^as86 version: \(.*\)+\1+'`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (($?!=0)); then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_failure "not found"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fail
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_success "found version $as86_ver"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "VBOX_AS86" "`which_wrapper $AS86`"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for yasm, needed to compile assembler files
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_yasm()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header yasm
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if check_avail "$YASM" YASM; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster yasm_ver=`$YASM --version|grep "^yasm"|sed 's+^yasm \(.*\)+\1+'`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (($?!=0)); then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_failure "not found"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fail
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster yasm_maj=`echo $yasm_ver|cut -d. -f1`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster yasm_min=`echo $yasm_ver|cut -d. -f2`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster yasm_rev=`echo $yasm_ver|cut -d. -f3`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster yasm_ver_mul=$(($yasm_maj*10000+$yasm_min*100+$yasm_rev))
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (($yasm_ver_mul<501)); then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_failure "found version $yasm_ver, expected at least 0.5.1"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fail
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_success "found version $yasm_ver"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for the iasl ACPI compiler, needed to compile vbox.dsl
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_iasl()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header iasl
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if check_avail "$IASL" IASL; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster iasl_ver=`$IASL|grep version|sed 's+^ASL.*version \([0-9]*\).*+\1+'`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (($?!=0)); then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_failure "not found"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fail
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_success "found version $iasl_ver"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "VBOX_IASLCMD" "`which_wrapper $IASL`"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for xsltproc, needed by Main
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_xsltproc()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header xslt
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if check_avail "$XSLTPROC" XSLTPROC; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster xsltproc_ver=`$XSLTPROC --version`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (($?!=0)); then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_failure "not found"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fail
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_success "found"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "VBOX_XSLTPROC" "`which_wrapper $XSLTPROC`"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for mkisofs, needed to build the CDROM image containing the additions
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_mkisofs()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header mkisofs
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if which_wrapper $GENISOIMAGE > /dev/null; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster mkisofs_ver=`$GENISOIMAGE --version`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (($?!=0)); then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_failure "not found"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fail
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_success "found $mkisofs_ver"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "VBOX_MKISOFS" "`which_wrapper $GENISOIMAGE`"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster elif check_avail "$MKISOFS" MKISOFS; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster mkisofs_ver=`$MKISOFS --version`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (($?!=0)); then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_failure "not found"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fail
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_success "found $mkisofs_ver"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "VBOX_MKISOFS" "`which_wrapper $MKISOFS`"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for xalan, needed by VBoxXML
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_xalan()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header xalan
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo '
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <cstdio>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <xalanc/Include/XalanVersion.hpp>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterextern "C" int main(void)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf("found version %d.%d.%d",
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster XALAN_VERSION_MAJOR, XALAN_VERSION_MINOR, XALAN_VERSION_REVISION);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#if _XALAN_VERSION >= 10800
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", OK.\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 0;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", expected version 1.8.0 or higher\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 1;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#endif
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster' > .tmp_src.cc
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_compile "$LIBXALAN ${INCXALAN:+-I$INCXALAN}" xalan xalanc; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_execute; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "SDK_VBOX_XALAN_LIBS" `echo $LIBXALAN|sed 's+-l++'`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "SDK_VBOX_XALAN_INCS" "$INCXALAN"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for xerces, needed by VBoxXML
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_xerces()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header xerces
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo '
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <cstdio>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <xercesc/util/XercesVersion.hpp>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterextern "C" int main(void)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf("found version %d.%d.%d",
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster XERCES_VERSION_MAJOR, XERCES_VERSION_MINOR, XERCES_VERSION_REVISION);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#if _XERCES_VERSION >= 20500
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", OK.\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 0;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", expected version 2.5.0 or higher");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 1;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#endif
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster' > .tmp_src.cc
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_compile "$LIBXERCES ${INCXERCES:+-I$INCXERCES}" xerces xercesc; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_execute; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "SDK_VBOX_XERCES_LIBS" `echo $LIBXERCES|sed 's+-l++'`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "SDK_VBOX_XERCES_INCS" "$INCXERCES"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for libIDL, needed by xpcom
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fostercheck_libidl()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header libIDL
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if which_wrapper libIDL-config-2 > /dev/null; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster libidl_ver=`libIDL-config-2 --version`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (($?!=0)); then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_failure "not found"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fail
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_success "found version $libidl_ver"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "VBOX_LIBIDL_CONFIG" \
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster "PKG_CONFIG_PATH=`libIDL-config-2 --prefix`/lib/pkgconfig `which_wrapper libIDL-config-2`"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster elif check_avail "libIDL-config" libIDL-config; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster libidl_ver=`libIDL-config --version`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (($?!=0)); then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_failure "not found"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fail
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_success "found version $libidl_ver"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "VBOX_LIBIDL_CONFIG" `which_wrapper libIDL-config`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for uuid, needed by Runtime, VBoxSVC, VBoxSDL, and VBoxBFE
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_uuid()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header uuid
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo '
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <cstdio>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <uuid/uuid.h>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterextern "C" int main(void)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster uuid_t uu;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster uuid_clear(uu);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (uuid_is_null(uu)) {
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf("found, OK.\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 0;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster } else {
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf("uuid found but does not work\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 1;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster }
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster' > .tmp_src.cc
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_compile $LIBUUID uuid uuid; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_execute; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "LIB_UUID" `echo $LIBUUID|sed 's+-l++'`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for openssl, needed for RDP
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_ssl()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header ssl
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo '
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <cstdio>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <openssl/opensslv.h>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterextern "C" int main(void)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf("found version %s", OPENSSL_VERSION_TEXT);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#if OPENSSL_VERSION_NUMBER >= 0x0090700
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", OK.\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 0;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", expected version 0.9.7 or higher\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 1;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#endif
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster' > .tmp_src.cc
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_compile $LIBCRYPTO libcrypto openssl; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_execute nofatal; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "SDK_VBOX_OPENSSL_INCS" ""
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "SDK_VBOX_OPENSSL_LIBS" `echo $LIBCRYPTO|sed 's+-l++'`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for pthread, needed by VBoxSVC, frontends, ...
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_pthread()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header pthread
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo '
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <cstdio>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <pthread.h>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterextern "C" int main(void)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster pthread_mutex_t mutex;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (pthread_mutex_init(&mutex, NULL)) {
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf("pthread_mutex_init() failed\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 1;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster }
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (pthread_mutex_lock(&mutex)) {
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf("pthread_mutex_lock() failed\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 1;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster }
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (pthread_mutex_unlock(&mutex)) {
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf("pthread_mutex_unlock() failed\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 1;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster }
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf("found, OK.\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster' > .tmp_src.cc
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_compile $LIBPTHREAD pthread pthread; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_execute; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "LIB_PTHREAD" `echo $LIBPTHREAD|sed 's+-l++'`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for zlib, needed by VBoxSVC, Runtime, ...
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_z()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header zlib
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo '
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <cstdio>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <zlib.h>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterextern "C" int main(void)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf("found version %s", ZLIB_VERSION);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#if ZLIB_VERNUM >= 0x1210
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", OK.\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 0;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", expected version 1.2.1 or higher\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 1;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#endif
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster' > .tmp_src.cc
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_compile "$LIBZ ${INCZ:+-I$INCZ}" zlib zlib; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_execute; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "SDK_VBOX_ZLIB_LIBS" `echo $LIBZ|sed 's+-l++'`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "SDK_VBOX_ZLIB_INCS" "$INCZ"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for libpng, needed by kchmviewer
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_png()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header libpng
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo '
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <cstdio>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <png.h>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterextern "C" int main(void)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf("found version %s", PNG_LIBPNG_VER_STRING);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#if PNG_LIBPNG_VER >= 10205
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", OK.\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 0;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", expected version 1.2.5 or higher\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 1;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#endif
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster' > .tmp_src.cc
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_compile "$LIBPNG ${INCPNG:+-I$INCPNG}" libpng libpng nofatal; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_execute nofatal; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "SDK_VBOX_LIBPNG_LIBS" `echo $LIBPNG|sed 's+-l++'`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "SDK_VBOX_LIBPNG_INCS" "$INCPNG"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for pam, needed by VRDPAuth
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Version 79 was introduced in 9/2005, do we support older versions?
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Debian/sarge uses 76
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# OpenSUSE comes with 0.99.xxx where they changed the versioning scheme.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_pam()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header pam
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo '
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <cstdio>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <security/pam_appl.h>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterextern "C" int main(void)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf("found version %d", __LIBPAM_VERSION);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (__LIBPAM_VERSION >= 76)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster {
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", OK.\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 0;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster }
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster {
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", expected version 76 or higher\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 1;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster }
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster' > .tmp_src.cc
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_compile "-lpam" pam pam nofatal; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_execute nofatal; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 0;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header linux_pam
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo '
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <cstdio>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <security/pam_appl.h>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterextern "C" int main(void)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf("found version %d.%d", __LINUX_PAM__, __LINUX_PAM_MINOR__);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (__LINUX_PAM__ >= 1)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster {
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", OK.\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 0;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster }
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster {
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", expected version 1.0 or higher\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 1;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster }
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster' > .tmp_src.cc
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_compile "-lpam" pam pam; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_execute
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for the SDL library, needed by VBoxSDL and VirtualBox
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# We depend at least on version 1.2.7
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_sdl()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header SDL
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo '
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <cstdio>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <SDL/SDL.h>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <SDL/SDL_main.h>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterextern "C" int main(void)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf("found version %d.%d.%d",
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#if SDL_VERSION_ATLEAST(1,2,7)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", OK.\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 0;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", expected version 1.2.7 or higher\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 1;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#endif
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster' > .tmp_src.cc
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_compile "$LIBSDL $LIBSDLMAIN ${INCSDL:+-I$INCSDL}" SDL SDL; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_execute; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "LIB_SDK_LIBSDL_SDL" `echo $LIBSDL|sed 's+-l++'`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "LIB_SDK_LIBSDL_SDLMAIN" `echo $LIBSDLMAIN|sed 's+-l++'`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster [ -n "$INCSDL" ] && cnf_append "SDK_LIBSDL_INCS" "$INCSDL"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for the SDL_ttf library, needed by VBoxSDL (secure label)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_sdl_ttf()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header SDL_ttf
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo '
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <cstdio>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <SDL/SDL_ttf.h>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#ifndef SDL_TTF_MAJOR_VERSION
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#define SDL_TTF_MAJOR_VERSION TTF_MAJOR_VERSION
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#define SDL_TTF_MINOR_VERSION TTF_MINOR_VERSION
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#define SDL_TTF_PATCHLEVEL TTF_PATCHLEVEL
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#endif
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterextern "C" int main(void)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf("found version %d.%d.%d",
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#if 10000*SDL_TTF_MAJOR_VERSION + 100*SDL_TTF_MINOR_VERSION + SDL_TTF_PATCHLEVEL >= 20006
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", OK.\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 0;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", expected version 2.0.6 or higher\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 1;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#endif
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster' > .tmp_src.cc
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_compile "-lSDL_ttf" SDL_ttf SDL_ttf; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_execute
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for libasound, needed by the ALSA audio backend
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_alsa()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header ALSA
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo '
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <alsa/asoundlib.h>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterextern "C" int main(void)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf("found version %d.%d.%d",
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster SND_LIB_MAJOR, SND_LIB_MINOR, SND_LIB_SUBMINOR);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#if 10000*SND_LIB_MAJOR + 100*SND_LIB_MINOR + SND_LIB_SUBMINOR >= 10008
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", OK.\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 0;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#else
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster printf(", expected version 1.0.8 or higher\n");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 1;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#endif
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster' > .tmp_src.cc
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_compile "-lasound" asound asound; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_execute
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for the Xcursor library, needed by VBoxSDL and VBoxBFE
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_xcursor()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header Xcursor
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo '
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <cstdio>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <X11/Xlib.h>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <X11/Xcursor/Xcursor.h>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterextern "C" int main(void)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster XcursorImage *cursor = XcursorImageCreate (10, 10);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster XcursorImageDestroy(cursor);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster return 0;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster' > .tmp_src.cc
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if test_compile "$LIBX11 $LIBXCURSOR" Xcursor Xcursor; then
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster log_success "found"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster cnf_append "LIB_XCURSOR" `echo $LIBXCURSOR|sed 's+-l++'`
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster fi
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster# Check for the X libraries (Xext, X11)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterfunction check_x()
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster test_header "X libraries"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster echo '
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <cstdio>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#include <X11/Xlib.h>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterextern "C" int main(void)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster{
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster Display *dpy;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster int scrn_num;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster Screen *scrn;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster Window win;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster dpy = XOpenDisplay(NULL);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster scrn_num = DefaultScreen(dpy);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster scrn = ScreenOfDisplay(dpy, scrn_num);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster win = XCreateWindow(dpy, RootWindowOfScreen(scrn), 0, 0, 100, 100,
0, 16, InputOutput, CopyFromParent, 0, NULL);
XDestroyWindow(dpy, win);
}
' > .tmp_src.cc
if test_compile "$LIBX11" Xlibs Xlibs; then
log_success "found"
fi
}
#
# Check for the QT library, needed by VirtualBox
#
function check_qt()
{
test_header Qt
echo '
#include <cstdio>
#include <qglobal.h>
extern "C" int main(void)
{
printf("found version %s", QT_VERSION_STR);
#if QT_VERSION >= 0x030305
printf(", OK.\n");
return 0;
#elif QT_VERSION >= 0x030300
printf("\n ** WARNING: QT < 3.3.5 has known problems!\n");
#else
printf(", expected version 3.3.0 or higher\n");
return 1;
#endif
}
' > .tmp_src.cc
found_qt=0
for q in $QTDIR; do
echo "compiling the following source file:" >> $LOG
cat .tmp_src.cc >> $LOG
echo "using the following command line:" >> $LOG
echo "$CXX -O -Wall -o .tmp_out .tmp_src.cc -I$q/include -L$q/lib -lqt-mt" >> $LOG
$CXX -O -Wall -o .tmp_out .tmp_src.cc -I$q/include -L$q/lib -lqt-mt >> $LOG 2>&1
if (($?==0)); then
if test_execute; then
cnf_append "QTDIR" `cd $q ; pwd`
found_qt=1
break
fi
fi
done
if (($found_qt!=1)); then
echo -e "\n Qt not found at \"$QTDIR\" or Qt headers not found"
echo " Check the file $LOG for detailed error information."
fail
return 1
fi
test_header "Qt devtools"
if check_avail "$q/bin/moc" QTDIR/bin; then
moc_ver=`$q/bin/moc 2>&1 -v|sed 's+^.*(Qt \(.*\))+\1+'`
if (($?!=0)); then
log_failure "not found"
fail
else
log_success "found version $moc_ver"
fi
fi
}
#
# Check for Linux sources
#
function check_linux()
{
test_header "Linux kernel sources"
echo '
#include <linux/version.h>
int printf(const char *format, ...);
int main(void)
{
printf("found version %d.%d.%d", LINUX_VERSION_CODE / 65536,
(LINUX_VERSION_CODE % 65536) / 256,
LINUX_VERSION_CODE % 256);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,0)
printf(", OK.\n");
return 0;
#else
printf(", expected version 2.4.0 or higher\n");
return 1;
#endif
}
' > .tmp_src.c
echo "compiling the following source file:" >> $LOG
cat .tmp_src.c >> $LOG
echo "using the following command line:" >> $LOG
echo "$CC -O -Wall -o .tmp_out .tmp_src.c -nostdinc -I$LINUX/include" >> $LOG
$CC -O -Wall -o .tmp_out .tmp_src.c -nostdinc -I$LINUX/include >> $LOG 2>&1
if (($?!=0)); then
echo -e "\n Linux kernel headers not found at $LINUX"
echo " Check the file $LOG for detailed error information."
fail
else
if test_execute; then
cnf_append "VBOX_LINUX_SRC" `cd $LINUX ; pwd`
fi
fi
}
#
# Check for kchmviewer, needed to display the online help
#
function check_kchmviewer()
{
test_header kchmviewer
if check_avail "$KCHMVIEWER" KCHMVIEWER; then
kchmviewer_ver=`$KCHMVIEWER --version|grep "^KchmViewer:"|sed 's+^KchmViewer: \(.*\)+\1+'`
if (($?!=0)); then
log_failure "not found"
fail
else
log_success "found version $kchmviewer_ver"
fi
fi
}
#
# Check for the kBuild tools, we don't support GNU make
#
function check_kbuild()
{
test_header kBuild
if check_avail "$KBUILDDIR_BIN/kmk" KBUILDDIR really; then
log_success "found"
echo "export BUILD_PLATFORM=\"$OS\"" >> $ENV
echo "export BUILD_PLATFORM_ARCH=\"$MACHINE\"" >> $ENV
echo "export BUILD_TARGET=\"$OS\"" >> $ENV
echo "export BUILD_TARGET_ARCH=\"$MACHINE\"" >> $ENV
echo "export BUILD_TARGET_CPU=\"$CPU\"" >> $ENV
echo "export BUILD_TYPE=\"$BUILD_TYPE\"" >> $ENV
echo "export PATH_KBUILD=\"`cd $KBUILDDIR ; pwd`\"" >> $ENV
echo "export PATH_DEVTOOLS=\"$DEVDIR\"" >> $ENV
echo "path_kbuild_bin=\"\$PATH_KBUILD/bin/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"" >> $ENV
echo "path_dev_bin=\"\$PATH_DEVTOOLS/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"/bin" >> $ENV
echo "echo \"\$PATH\" | grep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
echo "echo \"\$PATH\" | grep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
echo "export PATH" >> $ENV
echo "unset path_kbuild_bin path_dev_bin" >> $ENV
fi
}
#
# Show help
#
function show_help()
{
cat << EOF
Usage: ./configure [OPTIONS]...
Configuration:
-h, --help display this help and exit
--nofatal don't abort on errors
--disable-xpcom disable XPCOM and related stuff
Paths:
--with-gcc=PATH position of the gcc compiler [$CC]
--with-g++=PATH position of the g++ compiler [$CXX]
--with-kbuild=DIR kbuild directory [$KBUILDDIR]
--with-iasl=PATH the position of the iasl compiler [$IASL]
--with-linux=DIR Linux kernel source directory [$LINUX]
--with-mkisofs=PATH position of mkisofs [$MKISOFS]
--with-qt-dir=DIR directory for QT headers/libraries [$QTDIR]
--with-xalan=LIB position of the xalan library [$LIBXALAN]
--with-xerces=LIB position of the xerces library [$LIBXERCES]
Build type:
-d, --build-debug build with debugging symbols and assertions
EOF
exit 0
}
#
# The body.
#
# scan command line options
for option; do
case "$option" in
--help|-help|-h)
show_help
;;
--nofatal)
nofatal=1
;;
--with-gcc=*)
CC=`echo $option | cut -d'=' -f2`
;;
--with-g++=*)
CXX=`echo $option | cut -d'=' -f2`
;;
--with-kbuild=*)
KBUILDDIR=`echo $option | cut -d'=' -f2`
if echo $KBUILDDIR|grep -q "$INVALID_CHARS"; then
echo "Error: KBUILDDIR contains invalid characters!"
exit 1
fi
;;
--with-qt-dir=*)
QTDIR=`echo $option | cut -d'=' -f2`
;;
--with-iasl=*)
IASL=`echo $option | cut -d'=' -f2`
;;
--with-linux=*)
LINUX=`echo $option | cut -d'=' -f2`
;;
--with-mkisofs=*)
MKISOFS=`echo $option | cut -d'=' -f2`
;;
--with-xalan=*)
LIBXALAN=`echo $option | cut -d'=' -f2`
;;
--with-xerces=*)
LIBXERCES=`echo $option | cut -d'=' -f2`
;;
--disable-xpcom)
XPCOM=0
;;
--disable-qt)
WITH_QT=0
;;
--build-debug|-d)
BUILD_TYPE=debug
;;
--ose)
OSE=2
;;
--odir=*)
ODIR=`echo $option | cut -d'=' -f2`
;;
*)
echo
echo "Unrecognized option \"$option\""
echo
show_help
;;
esac
done
LOG="${ODIR:+$ODIR/}$LOG"
ENV="${ODIR:+$ODIR/}$ENV"
CNF="${ODIR:+$ODIR/}$CNF"
# initialize output files
cat > $LOG << EOF
# Log file generated by
#
# '$0 $*'
#
EOF
cat > $CNF << EOF
# -*- Makefile -*-
#
# automatically generated by
#
# '$0 $*'
#
# It will be completely overwritten if configure is executed again.
#
EOF
cat > $ENV << EOF
#!/bin/bash
#
# automatically generated by
#
# '$0 $*'
#
# It will be completely overwritten if configure is executed again.
# Make sure you source this file once before you start to build VBox.
#
EOF
# test if we are OSE
if (($OSE==1)) && [ -d "`cd $(dirname $0); pwd`/src/VBox/Devices/USB" ]; then
echo "Found USB devices, assuming VBOX_OSE = FALSE" >> $LOG
echo >> $LOG
OSE=0
fi
# first determine our environment
check_environment
check_kbuild
# some things are not available in for OSE
if (($OSE)); then
cnf_append "VBOX_OSE" "1"
cnf_append "VBOX_WITH_TESTSUITE" ""
cnf_append "VBOX_WITH_WIN32_ADDITIONS" ""
if [ "$OS" = "linux" ]; then
cnf_append "VBOX_WITH_LINUX_ADDITIONS" "1"
else
cnf_append "VBOX_WITH_LINUX_ADDITIONS" ""
fi
echo >> $CNF
fi
# append the tools directory to the default search path
echo "$PATH" | grep -q "$DEVDIR_BIN" || PATH="$PATH:$DEVDIR_BIN"
# append some extra paths
PATH="$PATH:/opt/gnome/bin"
# the tools
check_gcc
[ "$OS" != "darwin" ] && check_as86
[ "$OS" != "darwin" ] && check_bcc
[ "$OS" != "darwin" ] && check_iasl
# don't check for yasm for the time beeing as 0.40 and 0.50 both have known bugs
# [ "$OS" != "darwin" ] && check_yasm
[ "$OS" != "darwin" ] && check_xsltproc
(($OSE==0)) && check_mkisofs
# the libraries
(($XPCOM==1)) && check_xalan
(($XPCOM==1)) && check_xerces
(($XPCOM==1)) && check_libidl
[ "$OS" != "darwin" ] && check_uuid
(($OSE==0)) && check_ssl
[ "$OS" != "darwin" ] && check_pthread
[ "$OS" != "darwin" ] && check_z
(($OSE==0)) && check_png
(($OSE==0)) && check_pam
[ "$OS" != "darwin" ] && check_sdl
(($OSE==0)) && check_sdl_ttf
[ "$OS" != "darwin" ] && check_alsa
[ "$OS" != "darwin" ] && check_x
[ "$OS" != "darwin" ] && check_xcursor
(($XPCOM==1)) && check_qt
# Linux-specific
[ "$OS" = "linux" ] && check_linux
# success!
echo
echo "Successfully generated '$CNF' and '$ENV'."
echo "Source '$ENV' once before you start to build VBox:"
echo
echo " source $ENV"
echo " kmk"
echo
echo "Enjoy!"
cleanup