configure revision a8e9bad42a6c51f6f50ce0e976d11e626a31e3e4
13ee9baf0119bca0739d3f17591f0bf2c64cdcccrbb# The purpose of this script is to check for all external tools, headers, and
13ee9baf0119bca0739d3f17591f0bf2c64cdcccrbb# libraries VBox OSE depends on.
13ee9baf0119bca0739d3f17591f0bf2c64cdcccrbb# Copyright (C) 2006-2013 Oracle Corporation
5a58a10705b7b154b53294e0c0283d64eabdcb7fstoddard# This file is part of VirtualBox Open Source Edition (OSE), as
5a58a10705b7b154b53294e0c0283d64eabdcb7fstoddard# available from http://www.virtualbox.org. This file is free software;
10a2de5cee9ae5abe675ea200fbe635a54556c8ffanf# you can redistribute it and/or modify it under the terms of the GNU
3568de757bac0b47256647504c186d17ca272f85rbb# General Public License (GPL) as published by the Free Software
3568de757bac0b47256647504c186d17ca272f85rbb# Foundation, in version 2 as it comes in the "COPYING" file of the
3568de757bac0b47256647504c186d17ca272f85rbb# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
98f3c8c547839251cb43e9f917114cc8b16ced9efanf# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
10a2de5cee9ae5abe675ea200fbe635a54556c8ffanf# append some extra paths
10a2de5cee9ae5abe675ea200fbe635a54556c8ffanf# Solaris (order of paths important for tr, echo, grep, sed to work)
60777c94cb33363389d4848524c0809c235ba5e5rbbPATH="/usr/xpg4/bin:/usr/ucb:$PATH:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin"
b5140df3124b186e4a977812fd9828d1e295c080wrowe# Wrapper for ancient /usr/bin/which on darwin that always returns 0
c9dafaafc2650994e47f88f5239f643c97ec4cb3wrowe if which /bin/___cErTaINly_a_nOn_eXisTing_fIle___ 2> /dev/null > /dev/null; then
d28c69d8e5f2e88e653d61436bb6fa6302a212b4rbbOS=`uname -s | sed -e 's/GNU\/Linux/Linux/g' | tr '[:upper:]' '[:lower:]'`
a1bbc66131c63e718e3f73fc11a348f7552d7947rbb echo "Cannot determine OS!"
34ea1d36f4e1c8d66338e691793017d105cc9c32rbbLIBX11="-L/usr/X11R6/lib -L/usr/X11R6/lib64 -L/usr/local/lib -lXext -lX11"
bf9902ea6090f94c9ee0aaddd80b419a184ffe55jimQT4DIR="/usr/lib/qt4 /usr/share/qt4 /usr/lib64/qt4 /usr /usr/local"
365c33fd9c0fc3ac27c0bd1d360a5a94980c576atrawick# the restricting tool is ar (mri mode).
0ea568e49752d337d2b513cce07f2a6f4699d6eatrawickif (cd `dirname $0`; pwd)|grep -q "$INVALID_CHARS"; then
0ea568e49752d337d2b513cce07f2a6f4699d6eatrawick echo "Error: VBox base path contains invalid characters!"
328d02603f471fad56cc5588fc9e93f589593ad0rbb# darwin /bin/sh has a builtin echo that doesn't grok -n. gotta love it.
48a2f5e2c189669b025d462f44fda5d4b45e8d78trawick rm -f $ODIR.tmp_src.cc $ODIR.tmp_src.c $ODIR.tmp_out $ODIR.test_execute.log
a8c0c0b8d7dada680bd3f3d70f78ce0656ba5aa6trawick echo "$1"|$KBUILD_SED 's|-l\([^ ]\+\)|\1|g; s|^-[^l][^ ]*||g; s| -[^l][^ ]*||g; s|^ ||; s| *$||g'
a8c0c0b8d7dada680bd3f3d70f78ce0656ba5aa6trawick echo "$1"|$KBUILD_SED 's|-L\([^ ]\+\)|\1|g; s|^-[^L][^ ]*||g; s| -[^L][^ ]*||g; s|^ ||; s| *$||g'
77c656dabf05adcdee0d30b15b4628be738a1913rbb echo "$1"|$KBUILD_SED 's|-I\([^ ]\+\)|\1|g; s|^-[^I][^ ]*||g; s| -[^I][^ ]*||g; s|^ ||; s| *$||g'
e1ade9256c87684358786fcf7eef251bd4c1db10rbb elif which_wrapper $1 > /dev/null; then
eae32ab3fb398ca408bc2d45b22adf1b67a75471rbb# Prepare a test
42ec91fadb5532438ab4c02993b15c18a517967frbb# Compile a test
96fc773162e93e5b85686ab152f11baf4498d868rbb# $1 compile flags/libs
2975523a2901fc601ae9510082a7d4fb11bb9aecake# $2 library name
2975523a2901fc601ae9510082a7d4fb11bb9aecake# $3 package name
2975523a2901fc601ae9510082a7d4fb11bb9aecake# $4 if this argument is 'nofatal', don't abort
5827adc4c40ff4b10db9b09cea43f4307c8fc319trawick echo "$CXX $CXX_FLAGS -g -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc \"$1\"" >> $LOG
cfa64348224b66dd1c9979b809406c4d15b1c137fielding $CXX $CXX_FLAGS -g -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc $1 >> $LOG 2>&1
e7270e4daeb3e62414b361ca2bf0e707d0ae3310wrowe if [ $? -ne 0 ]; then
e7270e4daeb3e62414b361ca2bf0e707d0ae3310wrowe echo " Check the file $LOG for detailed error information."
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Execute a compiled test binary
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $rc -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Execute a compiled test binary
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "executing the binary (LD_LIBRARY_PATH=$1)" >> $LOG
cfa64348224b66dd1c9979b809406c4d15b1c137fielding LD_LIBRARY_PATH=$1 $ODIR.tmp_out > $ODIR.test_execute.log
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $rc -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for OS, MACHINE, CPU
cfa64348224b66dd1c9979b809406c4d15b1c137fielding [ "$OS" = "solaris" ] && BUILD_CPU=`isainfo | cut -f 1 -d ' '`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding i[3456789]86|x86|i86pc|BePC)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # on AMD64 systems, 64bit libs are usually located in /usr/lib64
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # see http://www.pathname.com/fhs/pub/fhs-2.3.html#LIB64
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # Solaris doesn't seem to subscribe to fhs, libs are usually in
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # a '64' subdirectory of the standard 'lib' dirs while some 64-bit
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # alternative binaries can be found in 'amd64' subdirs of the 'bin'
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # ones. So, in order to find the right stuff (esp. sdl-config) we'll
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # have to make sure the */bin/amd64 dirs are searched before the */bin
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # ones. (The sed has some sideeffects, but they shouldn't harm us...)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "64-bit Solaris detected, hacking the PATH" >> $LOG
cfa64348224b66dd1c9979b809406c4d15b1c137fielding PATH=`echo ":$PATH:" | sed -e 's,\(:[^:]*/bin\):,\1/amd64:\1:,g' \
cfa64348224b66dd1c9979b809406c4d15b1c137fielding [ -z "$TARGET_MACHINE" ] && TARGET_MACHINE=$BUILD_MACHINE
cfa64348224b66dd1c9979b809406c4d15b1c137fielding log_success "Determined build machine: $OS.$BUILD_MACHINE, target machine: $OS.$TARGET_MACHINE"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "BUILD_PLATFORM_ARCH=\"$BUILD_MACHINE\"" >> $ENV
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "BUILD_TARGET_ARCH=\"$TARGET_MACHINE\"" >> $ENV
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for gcc with version >= 3.2.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# We depend on a working gcc, if we fail terminate in every case.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding log_failure "gcc version $cc_ver does not match g++ version $cxx_ver"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding elif [ $cc_maj -eq 4 -a $cc_min -eq 0 -a "$OS" = "darwin" ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding -o \( $cc_maj -eq 4 -a $cc_min -lt 1 -a "$OS" != "darwin" \) \
cfa64348224b66dd1c9979b809406c4d15b1c137fielding -o $cc_maj -gt 4 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding log_failure "gcc version $cc_ver found, expected gcc 3.x with x>1 or gcc 4.x with 0<x<10"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ "$BUILD_MACHINE" = "x86" -a "$TARGET_MACHINE" = "amd64" ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ "$TARGET_MACHINE" = "amd64" -a $WITH_VMMRAW -eq 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ "$CC32" != "gcc -m32" -a "$CC32" != "undefined" ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ "$CXX32" != "g++ -m32" -a "$CXX32" != "undefined" ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # this isn't not necessary, there is not such tool.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ "$OS" = "solaris" -a "$BUILD_MACHINE" = "amd64" ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for the OpenWatcom compiler, needed for compiling the BIOS
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# If the system has Open Watcom installed, WATCOM will be set in the
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# environment. If the user has her/his own Open Watcom install it will be
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# pointed to by on the command line, which will set the WATCOM variable.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# The only exception is detecting OpenWatcom in tools/common/openwatcom.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding WATCOM=`/bin/ls -rd1 $PWD/tools/common/openwatcom/* 2> /dev/null | head -1`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding log_failure "$WATCOM/$wc_bin/$prog does not exist or is not a regular file."
cfa64348224b66dd1c9979b809406c4d15b1c137fielding wasm_ver=`$WATCOM/$wc_bin/wasm -? 2>&1 | sed -e '1!d' -e 's/Open Watcom Assembler Version *//'`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding log_failure "$WATCOM/$wc_bin/wasm -? did not produce the expected response"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for yasm, needed to compile assembler files
cfa64348224b66dd1c9979b809406c4d15b1c137fielding yasm_ver=`$YASM --version|grep "^yasm"|sed 's+^yasm \(.*\)+\1+'`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding yasm_ver_mul=`expr $yasm_maj \* 10000 + $yasm_min \* 100 + $yasm_rev`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $yasm_ver_mul -lt 501 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding log_failure "found version $yasm_ver, expected at least 0.5.1"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for the iasl ACPI compiler, needed to compile vbox.dsl
cfa64348224b66dd1c9979b809406c4d15b1c137fielding iasl_ver=`$IASL|grep "ASL.*version"|sed 's+^ASL.*version \([0-9]*\).*+\1+'`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for xsltproc, needed by Main
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_XSLTPROC" "`which_wrapper $XSLTPROC`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for mkisofs, needed to build the CDROM image containing the additions
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_MKISOFS" "`which_wrapper $GENISOIMAGE`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_MKISOFS" "`which_wrapper $MKISOFS`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for libxml2, needed by VBoxSettings and Runtime.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# 2.6.24 is known to NOT work, 2.6.26 is known to work (there is no 2.6.25 release)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding libxml2_ver=`pkg-config libxml-2.0 --modversion 2>> $LOG`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <libxml/xmlversion.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %s", LIBXML_DOTTED_VERSION);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#if LIBXML_VERSION >= 20626
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", expected version 2.6.26 or higher\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding [ -n "$INCXML2" ] && I_INCXML2=`prefix_I "$INCXML2"`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "$LIBXML2 $LIBPTHREAD $I_INCXML2" xml2 xml2; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "SDK_VBOX_LIBXML2_LIBS" "`strip_l "$LIBXML2"`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <libxml/xmlversion.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %s", LIBXML_DOTTED_VERSION);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#if LIBXML_VERSION >= 20626
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", expected version 2.6.26 or higher\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding [ -n "$INCXML2" ] && I_INCXML2=`prefix_I "$INCXML2"`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "$LIBXML2 $LIBPTHREAD $I_INCXML2" xml2 xml2; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "SDK_VBOX_LIBXML2_LIBS" "`strip_l "$LIBXML2"`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding log_failure "neither pkg-config nor xml2-config found"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for libIDL, needed by xpcom
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding "PKG_CONFIG_PATH=`libIDL-config-2 --prefix`/$LIB/pkgconfig `which_wrapper libIDL-config-2`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding elif check_avail "libIDL-config" libIDL-config; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_LIBIDL_CONFIG" "`which_wrapper libIDL-config`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for libdevmapper, needed by the VBoxVolInfo
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" {
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#define private
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <libdevmapper.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding char version[80];
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if (!dm_get_library_version(version, sizeof(version)))
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("dm_get_library_version() failed.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding const char* v=version;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding unsigned int major = 0, minor = 0, micro = 0;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding for (; *v !='.' && *v != '\0'; v++) major = major*10 + *v-'0';
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if (*v == '.') v++;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding for (; *v !='.' && *v != '\0'; v++) minor = minor*10 + *v-'0';
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if (*v == '.') v++;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding for (; *v !='.' && *v != '\0'; v++) micro = micro*10 + *v-'0';
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %s", version);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if (major*10000 + minor*100 + micro >= 10200)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", expected version 1.02 or higher\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "$LIBDEVMAPPER $INCDEVMAPPER" libdevmapper libdevmapper; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for openssl, needed for RDP and S3
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <openssl/opensslv.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <openssl/ssl.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %s", OPENSSL_VERSION_TEXT);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding SSL_library_init();
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#if OPENSSL_VERSION_NUMBER >= 0x00908000
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", expected version 0.9.8 or higher\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "$INCCRYPTO $LIBCRYPTO" libcrypto openssl; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "SDK_VBOX_OPENSSL_INCS" "`strip_I "$INCCRYPTO"`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "SDK_VBOX_OPENSSL_LIBS" "`strip_l "$LIBCRYPTO"`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "SDK_VBOX_BLD_OPENSSL_LIBS" "`strip_l "$LIBCRYPTO"`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for pthread, needed by VBoxSVC, frontends, ...
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <pthread.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding pthread_mutex_t mutex;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if (pthread_mutex_init(&mutex, NULL)) {
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("pthread_mutex_init() failed\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if (pthread_mutex_lock(&mutex)) {
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("pthread_mutex_lock() failed\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if (pthread_mutex_unlock(&mutex)) {
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("pthread_mutex_unlock() failed\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found, OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for zlib, needed by VBoxSVC, Runtime, ...
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <zlib.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %s", ZLIB_VERSION);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#if ZLIB_VERNUM >= 0x1210
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", expected version 1.2.1 or higher\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "if1of (\$(KBUILD_TARGET),darwin freebsd haiku linux)" >> $CNF
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append " SDK_VBOX_ZLIB_LIBS" "`strip_l "$LIBZ"`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for libpng, needed by kchmviewer
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <png.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %s", PNG_LIBPNG_VER_STRING);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#if PNG_LIBPNG_VER >= 10205
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", expected version 1.2.5 or higher\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "$LIBPNG $I_INCPNG" libpng libpng; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "SDK_VBOX_LIBPNG_LIBS" "`strip_l "$LIBPNG"`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for libvncserver, needed for VNC in OSE
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <rfb/rfbconfig.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main()
cfa64348224b66dd1c9979b809406c4d15b1c137fielding const char* v=LIBVNCSERVER_VERSION;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding unsigned int major = 0, minor = 0, micro = 0;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding for (; *v !='.' && *v != '\0'; v++) major = major*10 + *v-'0';
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if (*v == '.') v++;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding for (; *v !='.' && *v != '\0'; v++) minor = minor*10 + *v-'0';
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if (*v == '.') v++;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding for (; *v !='.' && *v != '\0'; v++) micro = micro*10 + *v-'0';
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %s", LIBVNCSERVER_PACKAGE_VERSION);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if (major*10000 + minor*100 + micro >= 900)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", expected version 0.9 or higher\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "$LIBVNCSERVER $INCVNCSERVER" libvncserver libvncserver; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for libcurl, needed by S3
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <curl/curl.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %s", LIBCURL_VERSION);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#if 10000*LIBCURL_VERSION_MAJOR + 100*LIBCURL_VERSION_MINOR + LIBCURL_VERSION_PATCH >= 71901
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", expected version 7.19.1 or higher\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding [ -n "$INCCURL" ] && I_INCCURL=`prefix_I "$INCCURL"`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "$LIBCURL $I_INCCURL" libcurl libcurl; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "SDK_VBOX_LIBCURL_LIBS" "`strip_l "$LIBCURL"`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for pam, needed by VRDPAuth
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Version 79 was introduced in 9/2005, do we support older versions?
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# OpenSUSE comes with 0.99.xxx where they changed the versioning scheme.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <security/pam_appl.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %d", __LIBPAM_VERSION);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if (__LIBPAM_VERSION >= 76)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", expected version 76 or higher\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <security/pam_appl.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %d.%d", __LINUX_PAM__, __LINUX_PAM_MINOR__);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if (__LINUX_PAM__ >= 1)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", expected version 1.0 or higher\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for the SDL library, needed by VBoxSDL and VirtualBox
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# We depend at least on version 1.2.7
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ -f "/System/Library/Frameworks/SDL.framework/SDL" ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding PATH_SDK_LIBSDL="/System/Library/Frameworks/SDL.framework"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding elif [ -f "/Library/Frameworks/SDL.framework/SDL" ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding PATH_SDK_LIBSDL="/Library/Frameworks/SDL.framework"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding [ "$OS" = "linux" -o "$OS" = "darwin" -o "$OS" = "solaris" ] && LIBSDLMAIN=""
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <SDL.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <SDL_main.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(int argc, char** argv)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %d.%d.%d",
cfa64348224b66dd1c9979b809406c4d15b1c137fielding SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#if SDL_VERSION_ATLEAST(1,2,7)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", expected version 1.2.7 or higher\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "$LIBSDL $LIBSDLMAIN $I_INCSDL $FLDSDL" SDL SDL; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "LIB_SDK_LIBSDL_SDL" "`strip_l "$LIBSDL"`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "SDK_LIBSDL_LIBPATH" "`strip_L "$LIBSDL"`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "LIB_SDK_LIBSDL_SDLMAIN" "`strip_l "$LIBSDLMAIN"`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding [ -n "$INCSDL" ] && cnf_append "SDK_LIBSDL_INCS" "$INCSDL"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding [ -n "$FLDSDL" ] && cnf_append "SDK_LIBSDL_LDFLAGS" "$FLDSDL"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for the SDL_ttf library, needed by VBoxSDL (secure label)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <SDL_ttf.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#ifndef SDL_TTF_MAJOR_VERSION
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#define SDL_TTF_MAJOR_VERSION TTF_MAJOR_VERSION
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#define SDL_TTF_MINOR_VERSION TTF_MINOR_VERSION
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#define SDL_TTF_PATCHLEVEL TTF_PATCHLEVEL
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %d.%d.%d",
cfa64348224b66dd1c9979b809406c4d15b1c137fielding SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#if 10000*SDL_TTF_MAJOR_VERSION + 100*SDL_TTF_MINOR_VERSION + SDL_TTF_PATCHLEVEL >= 20006
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", expected version 2.0.6 or higher\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "-lSDL_ttf $I_INCSDL" SDL_ttf SDL_ttf nofatal; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "not found -- disabling VBoxSDL secure label."
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for libasound, needed by the ALSA audio backend
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <alsa/asoundlib.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %d.%d.%d",
cfa64348224b66dd1c9979b809406c4d15b1c137fielding SND_LIB_MAJOR, SND_LIB_MINOR, SND_LIB_SUBMINOR);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#if 10000*SND_LIB_MAJOR + 100*SND_LIB_MINOR + SND_LIB_SUBMINOR >= 10006
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", expected version 1.0.6 or higher\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for PulseAudio
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <pulse/version.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %s API version %d", pa_get_headers_version(), PA_API_VERSION);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#if PA_API_VERSION >= 9
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", expected version 0.9.0 (API version 9) or higher\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "$INCPULSE $LIBPULSE -lpulse" pulse pulse; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for the X libraries (Xext, X11)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <X11/Xlib.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding Display *dpy;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding int scrn_num;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding Screen *scrn;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding Window win;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding dpy = XOpenDisplay(NULL);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding scrn_num = DefaultScreen(dpy);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding scrn = ScreenOfDisplay(dpy, scrn_num);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding win = XCreateWindow(dpy, RootWindowOfScreen(scrn), 0, 0, 100, 100,
cfa64348224b66dd1c9979b809406c4d15b1c137fielding 0, 16, InputOutput, CopyFromParent, 0, NULL);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding XDestroyWindow(dpy, win);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding XCloseDisplay(dpy);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "$LIBX11 $I_INCX11" Xlibs Xlibs; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for the Xcursor library, needed by VBoxSDL.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <X11/Xlib.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <X11/Xcursor/Xcursor.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding XcursorImage *cursor = XcursorImageCreate (10, 10);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding XcursorImageDestroy(cursor);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "$LIBX11 $LIBXCURSOR $I_INCX11" Xcursor Xcursor; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_XCURSOR_LIBS" "`strip_l "$LIBXCURSOR"`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for the Xinerama library, needed by the Qt GUI
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <X11/Xlib.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <X11/extensions/Xinerama.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding Display *dpy;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding dpy = XOpenDisplay(NULL);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding flag = XineramaIsActive(dpy);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding XCloseDisplay(dpy);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "$LIBX11 $LIBXINERAMA $I_INCX11" Xinerama Xinerama; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for the Xinerama library, needed by the Qt GUI
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <X11/Xlib.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <X11/extensions/Xrandr.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding Display *dpy;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding int major, minor;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding dpy = XOpenDisplay(NULL);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding flag = XRRQueryVersion(dpy, &major, &minor);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding XCloseDisplay(dpy);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "$LIBX11 $LIBXRANDR $I_INCX11" Xrandr Xrandr; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for OpenGL
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for the Xmu library, needed by OpenGL
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <X11/Xatom.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <X11/Xlib.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <X11/Xutil.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <X11/Xmu/StdCmap.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding Display *dpy;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding int scrn_num;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding Screen *scrn;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding dpy = XOpenDisplay(NULL);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding scrn_num = DefaultScreen(dpy);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding scrn = ScreenOfDisplay(dpy, scrn_num);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding Status status = XmuLookupStandardColormap(dpy, RootWindowOfScreen(scrn), 0,
cfa64348224b66dd1c9979b809406c4d15b1c137fielding 24, XA_RGB_DEFAULT_MAP, False, True);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("Status = %x\n", status);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding XCloseDisplay(dpy);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "$LIBX11 $LIBXMU $I_INCX11" Xmu Xmu; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for Mesa, needed by OpenGL
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <X11/Xlib.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <GL/glx.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <GL/glu.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding Display *dpy;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding int major, minor;
cfa64348224b66dd1c9979b809406c4d15b1c137fielding dpy = XOpenDisplay(NULL);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding Bool glx_version = glXQueryVersion(dpy, &major, &minor);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding XCloseDisplay(dpy);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if (glx_version)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %u.%u, OK.\n", major, minor);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found (inactive), OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "$LIBX11 $MESA $I_INCX11" Mesa Mesa; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding [ $PASSIVE_MESA -eq 1 ] && unset DISPLAY
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for the Qt4 library, needed by the VirtualBox frontend
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Currently not fatal.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # First check if there is the internal version of Qt. If yes nothing else
cfa64348224b66dd1c9979b809406c4d15b1c137fielding QT_INTERNAL=`/bin/ls -rd1 $PWD/tools/$BUILD_TARGET.$BUILD_PLATFORM_ARCH/qt/* 2> /dev/null`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ -f "$t/Frameworks/QtCoreVBox.framework/QtCoreVBox" ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # Now try the user provided directory and some of the standard directories.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ -f "$t/Frameworks/QtCore.framework/QtCore" ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # Add the necessary params for building the test application
cfa64348224b66dd1c9979b809406c4d15b1c137fielding INCQT4=-I$PATH_SDK_QT4/Frameworks/QtCore.framework/Headers
cfa64348224b66dd1c9979b809406c4d15b1c137fielding log_failure "Qt4 framework not found (can be disabled using --disable-qt4)"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $QT4DIR_PKGCONFIG -eq 1 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/qt4/lib/pkgconfig \
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/qt4/lib/pkgconfig \
cfa64348224b66dd1c9979b809406c4d15b1c137fielding PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/qt4/lib/pkgconfig \
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # do it the old way (e.g. user has specified QT4DIR)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <QtGlobal>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %s", QT_VERSION_STR);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#if QT_VERSION >= 0x040602
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", expected version 4.6.2 or higher\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <QtGlobal>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %s", QT_VERSION_STR);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#if QT_VERSION >= 0x040602
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", expected version 4.6.2 or higher\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # Successful build & run the test application so add the necessary
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "PATH_SDK_QT4_INC" "$PATH_SDK_QT4/Frameworks"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "PATH_SDK_QT4_LIB" "$PATH_SDK_QT4/Frameworks"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "PATH_SDK_QT4" "$PATH_SDK_QT4/Frameworks"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # Check for the moc tool in the Qt directory found & some standard
cfa64348224b66dd1c9979b809406c4d15b1c137fielding for q in $PATH_SDK_QT4 /usr /Developer/Tools/Qt; do
cfa64348224b66dd1c9979b809406c4d15b1c137fielding INCQT4=`echo "$INCQT4"|$KBUILD_SED 's|\([^ ]*\)/QtCore|\1|g; s| $||g'`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # store only the first path, remove all other pathes
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # most likely pkg-config gave us -I/usr/include/qt4 -I/usr/include/qt4/QtCore
cfa64348224b66dd1c9979b809406c4d15b1c137fielding INCQT4=`echo "$INCQT4"|$KBUILD_SED 's|\([^ ]*\) .*|\1|'`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_PATH_QT4_LIB" "`strip_L "$LIBQT4"`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # this is not quite right since the qt libpath does not have to be first...
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "PATH_SDK_QT4_LIB" '$'"(firstword `strip_L "$LIBQT4"`)"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # first try it with a suffix, some platforms use that
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if which_wrapper "$q/bin/moc-qt4" > /dev/null; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding moc_ver=`$q/bin/moc-qt4 -v 2>&1|sed 's+^.*(Qt \(.*\))+\1+'`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding moc_ver=`$q/bin/moc -v 2>&1|sed 's+^.*(Qt \(.*\))+\1+'`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for libvpx
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -eq 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <vpx/vpx_codec.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding int version = vpx_codec_version();
cfa64348224b66dd1c9979b809406c4d15b1c137fielding int verMajor = VPX_VERSION_MAJOR(version);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding int verMinor = VPX_VERSION_MINOR(version);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding int verPatch = VPX_VERSION_PATCH(version);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %d.%d.%d", verMajor, verMinor, verPatch);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if ( verMajor == 1 && verMinor >= 0
cfa64348224b66dd1c9979b809406c4d15b1c137fielding || verMajor == 0 && verMinor == 9 && verPatch >= 5)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", expected version 0.9.5 or higher\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "SDK_VBOX_VPX_LIBS" "`strip_l "$LIBVPX"`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check whether static libstdc++ is installed. This library is required
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# for the Linux guest additions.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <string>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding std::string s = "test";
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if test_compile "$libstdcxx" libstdc++ libstdc++; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for Linux sources
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <linux/version.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingint printf(const char *format, ...);
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingint main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %d.%d.%d", LINUX_VERSION_CODE / 65536,
cfa64348224b66dd1c9979b809406c4d15b1c137fielding (LINUX_VERSION_CODE % 65536) / 256,
cfa64348224b66dd1c9979b809406c4d15b1c137fielding LINUX_VERSION_CODE % 256);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,0)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", expected version 2.4.0 or higher\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "compiling the following source file:" >> $LOG
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "$CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include " \
cfa64348224b66dd1c9979b809406c4d15b1c137fielding $CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include \
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " Check the file $LOG for detailed error information."
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for kchmviewer, needed to display the online help
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# (unused as we ship kchmviewer)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding kchmviewer_ver=`$KCHMVIEWER --version|grep "^KchmViewer:"|sed 's+^KchmViewer: \(.*\)+\1+'`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for the kBuild tools, we don't support GNU make
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if which_wrapper "$KBUILDDIR/bin/$OS.$BUILD_MACHINE/kmk" > /dev/null; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "PATH_KBUILD=\"`cd $KBUILDDIR ; pwd`\"" >> $ENV
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "path_kbuild_bin=\"\$PATH_KBUILD/bin/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"" >> $ENV
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "path_dev_bin=\"\$PATH_DEVTOOLS/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"/bin" >> $ENV
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # Because of sh being non-default shell in Solaris we need to export PATH again when
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # sourcing env.sh. Simply exporting from ./configure does not export PATH correctly.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "echo \"\$PATH\" | grep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "echo \"\$PATH\" | grep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
cfa64348224b66dd1c9979b809406c4d15b1c137fielding elif [ "$OS.$BUILD_MACHINE" = "darwin.amd64" ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # Currently there are no amd64 kBuild bins. So use the x86 variant in any case.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "PATH_KBUILD=\"`cd $KBUILDDIR ; pwd`\"" >> $ENV
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "path_kbuild_bin=\"\$PATH_KBUILD/bin/\$BUILD_TARGET.x86\"" >> $ENV
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "PATH_KBUILD_BIN=\"\$path_kbuild_bin\"" >> $ENV
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "path_dev_bin=\"\$PATH_DEVTOOLS/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"/bin" >> $ENV
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "echo \"\$PATH\" | grep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "echo \"\$PATH\" | grep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Some Linux distributions include "compiler.h" in their libc linux
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# headers package, some don't. Most don't need it, building might (!)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# not succeed on openSUSE without it.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# See http://www.mail-archive.com/qemu-devel%40nongnu.org/msg07980.html
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for libcap.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Required to pass CAP_NET_RAW to our binaries to allow to open SOCK_RAW
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# sockets for doing ICMP requests.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <sys/types.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <linux/types.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <sys/capability.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding char buf[1024];
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cap_t caps = cap_get_proc();
cfa64348224b66dd1c9979b809406c4d15b1c137fielding snprintf(buf, sizeof(buf), "Current caps are '%s'\n", cap_to_text(caps, NULL));
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check if we are able to build 32-bit applications (needed for the guest additions)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <stdint.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingint main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "compiling the following source file:" >> $LOG
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "$CC -m32 -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c" >> $LOG
cfa64348224b66dd1c9979b809406c4d15b1c137fielding $CC -m32 -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c >> $LOG 2>&1
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " Cannot compile 32-bit applications (missing headers and/or libraries)!"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " Check the file $LOG for detailed error information."
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $rc -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " Cannot execute 32-bit applications! Either enable 32-bit support in the"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " kernel configuration or use --disable-vmmraw to disable 32-bit guests."
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for Python
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <cstdio>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#include <Python.h>
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingextern "C" int main(void)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding Py_Initialize();
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf("found version %s", PY_VERSION);
cfa64348224b66dd1c9979b809406c4d15b1c137fielding#if PY_VERSION_HEX >= 0x02030000
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", OK.\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding printf(", expected version 2.3 or higher\n");
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# For Solaris we use libpython2.4 for compatibility with Solaris 10 and passing IPS pkg audit
cfa64348224b66dd1c9979b809406c4d15b1c137fielding SUPPYTHONLIBS="python2.7 python2.6 python2.5 python2.4 python2.3"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding for b in lib/x86_64-linux-gnu lib/i386-linux-gnu lib64 lib/64 lib; do
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "compiling the following source file:" >> $LOG
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "$CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so" >> $LOG
cfa64348224b66dd1c9979b809406c4d15b1c137fielding $CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so >> $LOG 2>&1
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -eq 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for Java
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Setup wine
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if ! which_wrapper wine > /dev/null; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if ! which_wrapper wine > /dev/null; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding case "`expr "$wine_version" : 'wine-\([0-9.]*\)' '>' 1.1.43`" in
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if ! which_wrapper wineprefixcreate > /dev/null; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding *) eval "wineprefixcreate() { true ; }" ;; # now created automatically
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "WINEPREFIX=\"${ODIR}wine.$BUILD_MACHINE\"" >> $ENV
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if ! wineprefixcreate -q > /dev/null 2>&1; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo '[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment]' >> $tmp
cfa64348224b66dd1c9979b809406c4d15b1c137fielding 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
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhc.exe\DllOverrides]' >> $tmp
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhw.exe\DllOverrides]' >> $tmp
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check for gSOAP.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding GSOAP_CXX_LIBS=`pkg-config gsoapssl++ --libs 2>> $LOG`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -eq 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding GSOAP=`pkg-config gsoapssl++ --variable=exec_prefix`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ ! -d "$GSOAP_IMPORT" -a -d "$GSOAP/include/gsoap" ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_PATH_GSOAP_IMPORT" "$GSOAP_IMPORT"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_GSOAP_CXX_SOURCES" "$GSOAP/share/gsoap/stdsoap2.cpp"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_GSOAP_CXX_LIBS" "`strip_l "$GSOAP_CXX_LIBS"`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if which_wrapper "$GSOAP/bin/soapcpp2" > /dev/null; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if which_wrapper "$GSOAP/bin/wsdl2h" > /dev/null; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ ! -d "$GSOAP_IMPORT" -a -d "$GSOAP/include/gsoap" ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_PATH_GSOAP_IMPORT" "$GSOAP_IMPORT"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_GSOAP_CXX_SOURCES" "$GSOAP/share/gsoap/stdsoap2.cpp"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding log_failure "stlvector.h not found -- disabling webservice"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding log_failure "stdsoap2.h not found -- disabling webservice"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding log_failure "wsdl2h not found -- disabling webservice"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding log_failure "soapcpp2 not found -- disabling webservice"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Check Xcode path
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # Check if specified path exists and is a directory.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Determines the Darwin version.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# @todo This should really check the Xcode/SDK version.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding [ $? -eq 1 ] || fail
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_WITH_MACOSX_COMPILERS_FROM_DEVEL" "1"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_PATH_MACOSX_DEVEL_ROOT" "$WITH_XCODE_DIR/Developer"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding [ $? -eq 1 ] || fail
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_WITH_MACOSX_COMPILERS_FROM_DEVEL" "1"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_PATH_MACOSX_DEVEL_ROOT" "$WITH_XCODE_DIR/Developer"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_WITH_MACOSX_COMPILERS_FROM_DEVEL" "1"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_PATH_MACOSX_DEVEL_ROOT" "$WITH_XCODE_DIR/Developer"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding CXX_FLAGS="-mmacosx-version-min=10.6 -isysroot $sdk -Wl,-syslibroot,$sdk"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding CXX_FLAGS="-mmacosx-version-min=10.6 -isysroot $sdk -Wl,-syslibroot,$sdk"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding CXX_FLAGS="-mmacosx-version-min=10.5 -isysroot $sdk -Wl,-syslibroot,$sdk"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding CXX_FLAGS="-mmacosx-version-min=10.6 -isysroot $sdk -Wl,-syslibroot,$sdk"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# test "$CC" = "gcc" && CC="gcc-4.0"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# test "$CXX" = "g++" && CXX="g++-4.0"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_7" "1"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding CXX_FLAGS="-mmacosx-version-min=10.5 -isysroot $sdk -Wl,-syslibroot,$sdk"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# test "$CC" = "gcc" && CC="gcc-4.0"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# test "$CXX" = "g++" && CXX="g++-4.0"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6" "1"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_7" "1"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding CXX_FLAGS="-mmacosx-version-min=10.4 -isysroot $sdk -Wl,-syslibroot,$sdk"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# test "$CC" = "gcc" && CC="gcc-4.0"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# test "$CXX" = "g++" && CXX="g++-4.0"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6" "1"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_7" "1"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " failed to determine Darwin version. (uname -r: $darwin_ver)"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding log_success "found version $darwin_ver (SDK: $sdk)"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding makeself_ver=`$MAKESELF --version|grep version|sed 's+^Makeself.*version \([0-9\.]*\).*+\1+'`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ $? -ne 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding cnf_append "VBOX_MAKESELF" "`which_wrapper $MAKESELF`"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Checks that i386-elf-gcc-3.4.6, i386-elf-gcc-3.4.3, i386-elf-gcc-3.4 or i386-elf-gcc
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# is around to prevent confusion when the build fails in src/recompiler.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Note. Keep the which order in sync with the $(which ) in src/recompiler/Makefile.kmk.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding test -z "$i386_elf_gcc" && i386_elf_gcc=`which_wrapper i386-elf-gcc-3.4.3`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding test -z "$i386_elf_gcc" && i386_elf_gcc=`which_wrapper i386-elf-gcc-3.4`
cfa64348224b66dd1c9979b809406c4d15b1c137fielding test -z "$i386_elf_gcc" && i386_elf_gcc=`which_wrapper i386-elf-gcc`
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingUsage: ./configure [OPTIONS]...
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingConfiguration:
cfa64348224b66dd1c9979b809406c4d15b1c137fielding -h, --help display this help and exit
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --nofatal don't abort on errors
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_XPCOM -eq 1 ] && echo " --disable-xpcom disable XPCOM and related stuff"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_PYTHON -eq 1 ] && echo " --disable-python disable python bindings"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_JAVA -eq 1 ] && echo " --disable-java disable java bindings"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_VMMRAW -eq 1 ] && echo " --disable-vmmraw disable VMM raw mode (VT-x/AMD-V mandatory!)"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_SDL_TTF -eq 1 ] && echo " --disable-sdl-ttf disable SDL_ttf detection"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_ALSA -eq 1 ] && echo " --disable-alsa disable the ALSA sound backend"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_PULSE -eq 1 ] && echo " --disable-pulse disable the PulseAudio backend"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_DBUS -eq 1 ] && echo " --disable-dbus don't use DBus and hal for hardware detection"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_KMODS -eq 1 ] && echo " --disable-kmods don't build Linux kernel modules (host and guest)"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_OPENGL -eq 1 ] && echo " --disable-opengl disable OpenGL support (2D & 3D)"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_GSOAP -eq 0 ] && echo " --enable-webservice enable the webservice stuff"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $OSE -eq 1 ] && echo " --enable-vnc enable the VNC server"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $OSE -eq 0 ] && echo " --disable-extpack don't build the extpack"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_DOCS -eq 1 ] && echo " --disable-docs don't build the documentation"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_LIBVPX -eq 1 ] && echo " --disable-libvpx don't use libvpx for video capturing"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ "$OS" = "linux" -o "$OS" = "freebsd" ] && echo " --enable-vde enable VDE networking"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --disable-udptunnel disable UDP tunnel networking
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --disable-devmapper disable device mapper library access
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --disable-hardening don't be strict about /dev/vboxdrv access
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --build-libxml2 build libxml2 from sources
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $OSE -eq 0 ] && cat << EOF
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --build-libssl build openssl from sources
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --build-libcurl build libcurl from sources
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --build-libvpx build libvpx from sources
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ "$OS" != "darwin" ] && echo " --setup-wine setup a Wine directory and register the hhc hack"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --only-additions only build the Guest Additions
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --with-gcc=PATH location of the gcc compiler [$CC]
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --with-g++=PATH location of the g++ compiler [$CXX]
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --with-kbuild=DIR kbuild directory [$KBUILDDIR]
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --with-iasl=PATH location of the iasl compiler [$IASL]
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --with-mkisofs=PATH location of mkisofs [$MKISOFS]
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --with-makeself=PATH location of makeself [$MAKESELF]
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ "$OS" = "darwin" ] && echo " --with-xcode-dir=DIR custom path to Xcode root directory; it is assumed that Xcode"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ "$OS" = "darwin" ] && echo " contains OS X 10.6 SDK (required for Mountain Lion and newer hosts"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ "$OS" = "darwin" ] && echo " only, ignored for the rest)"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ "$OS" = "linux" ] && echo " --with-linux=DIR Linux kernel source directory [$LINUX]"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_QT4 -eq 1 ] && echo " --with-qt-dir=DIR directory for Qt4 headers/libraries [pkgconfig]"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_GSOAP -eq 1 ] && echo " --with-gsoap-dir=PATH directory for gSOAP compiler/headers/libraries"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_GSOAP -eq 1 ] && echo " (soapcpp2 and wsdl2h, soapstd2.h, libgsoap++.a/so)"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_GSOAP -eq 1 ] && echo " --with-gsoap-import=PATH directory for gSOAP import files (stlvector.h)"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --with-openssl-dir=DIR directory for OpenSSL headers/libraries
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --with-ow-dir=DIR directory where Open Watcom can be found [$WATCOM]
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --out-path=PATH the folder to which configuration and build output
cfa64348224b66dd1c9979b809406c4d15b1c137fielding -d, --build-debug build with debugging symbols and assertions
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --build-profile build with profiling support
cfa64348224b66dd1c9979b809406c4d15b1c137fielding --build-headless build headless (without any GUI frontend)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# test if we are OSE
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingif [ $OSE -eq 1 -a -r "`cd \`dirname $0\`; pwd`/src/VBox/RDP/server/server.cpp" ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # Set this as a reminder to print a log message once we know the path of the
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Change OS specific defaults; must be before all other stuff
cfa64348224b66dd1c9979b809406c4d15b1c137fielding #WITH_SDL=0
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # it is part of libroot, which is linked by default,
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # but the script wants something
cfa64348224b66dd1c9979b809406c4d15b1c137fielding #[ $OSE -eq 1 ] || BUILD_LIBCURL=1
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# scan command line options
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "Error: KBUILDDIR contains invalid characters!"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding LIBCRYPTO="${OPENSSLDIR}/lib/libcrypto.a ${OPENSSLDIR}/lib/libssl.a"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding if [ -d $out_path ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # This variable has not *yet* been overridden. That can still happen.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "Error: invalid folder \"$out_path\" in option \"$option\""
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "Unrecognized option \"$option\""
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# initialize output files
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Log file generated by
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# -*- Makefile -*-
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# automatically generated by
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# It will be completely overwritten if configure is executed again.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# automatically generated by
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# It will be completely overwritten if configure is executed again.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Make sure you source this file once before you start to build VBox.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Print log warning about OSE if necessary
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingif [ -n "$NOT_OSE" ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "Found RDP server, assuming VBOX_OSE = FALSE" >> $LOG
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# first determine our environment
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# append the tools directory to the default search path
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingecho "$PATH" | grep -q "$DEVDIR_BIN" || PATH="$PATH:$DEVDIR_BIN"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# if we will be writing to a different out directory then set this up now
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# some things are not available in for OSE
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingif [ -n "$HEADLESS" ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# emit disable directives corresponding to any --disable-xxx options.
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_XPCOM -eq 0 ] && cnf_append "VBOX_WITH_MAIN" ""
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_QT4 -eq 0 ] && cnf_append "VBOX_WITH_QTGUI" ""
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_SDL_TTF -eq 0 ] && cnf_append "VBOX_WITH_SECURELABEL" ""
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_PYTHON -eq 0 ] && cnf_append "VBOX_WITH_PYTHON" ""
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_JAVA -eq 0 ] && cnf_append "VBOX_WITH_JXPCOM" ""
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_JAVA -eq 0 ] && cnf_append "VBOX_WITH_JWS" ""
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_HARDENING -eq 0 ] && cnf_append "VBOX_WITHOUT_HARDENING" "1"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_HARDENING -eq 2 ] && cnf_append "VBOX_WITH_HARDENING" "2"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_VMMRAW -eq 0 ] && cnf_append "VBOX_WITH_RAW_MODE" ""
cfa64348224b66dd1c9979b809406c4d15b1c137fielding[ $WITH_LIBVPX -eq 0 ] && cnf_append "VBOX_WITH_VPX" ""
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Darwin-specific
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # don't check for yasm for the time beeing as 0.40 and 0.50 both have known bugs
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # [ "$OS" != "darwin" ] && check_yasm
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# the libraries
cfa64348224b66dd1c9979b809406c4d15b1c137fielding [ $WITH_SDL_TTF -eq 1 -a $OSE -eq 0 ] && check_sdl_ttf
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # TODO check for xcomposite-dev (X11/extensions/Xcomposite.h, additions only)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # TODO check for libxdamange-dev (X11/extensions/Xdamage.h, additions only)
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # PulseAudio
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# Linux-specific
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # don't check for the static libstdc++ in the PUEL version as we build the
cfa64348224b66dd1c9979b809406c4d15b1c137fielding # additions at a dedicated box
cfa64348224b66dd1c9979b809406c4d15b1c137fielding [ $ONLY_ADDITIONS -eq 0 -a "$BUILD_MACHINE" = "amd64" -a $WITH_VMMRAW -eq 1 ] && check_32bit
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingif [ $ONLY_ADDITIONS -eq 0 -a $WITH_GSOAP -eq 1 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingif [ $ONLY_ADDITIONS -eq 0 -a $WITH_UDPTUNNEL -eq 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingif [ $ONLY_ADDITIONS -eq 0 -a "$OS" = "linux" -o "$OS" = "freebsd" ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingif [ $ONLY_ADDITIONS -eq 1 -o $WITH_DOCS -eq 0 ]; then
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# VNC server support
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingecho "Successfully generated '$CNF' and '$ENV'."
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingecho "Source '$ENV' once before you start to build VBox:"
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingecho " source $ENV"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo "To compile the kernel modules, do:"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " cd $vbox_out_path/$OS.$TARGET_MACHINE/$BUILD_TYPE/bin/src"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " make"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " Tree configured to build only the Guest Additions"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " Hardening is enabled which means that the VBox binaries will not run from"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " the binary directory. The binaries have to be installed suid root and some"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " more prerequisites have to be fulfilled which is normally done by installing"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " the final package. For development, the hardening feature can be disabled"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " by specifying the --disable-hardening parameter. Please never disable that"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " feature for the final distribution!"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " Hardening is disabled. Please do NOT build packages for distribution with"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " disabled hardening!"
cfa64348224b66dd1c9979b809406c4d15b1c137fielding echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingecho "Enjoy!"