configure revision d9a4dcd59fc2806c8a7076cf07c9cb08385403fa
1N/A# The purpose of this script is to check for all external tools, headers, and 1N/A# libraries VBox OSE depends on. 1N/A# Copyright (C) 2006-2007 Sun Microsystems, Inc. 1N/A# This file is part of VirtualBox Open Source Edition (OSE), as 1N/A# you can redistribute it and/or modify it under the terms of the GNU 1N/A# General Public License as published by the Free Software Foundation, 1N/A# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE 1N/A# distribution. VirtualBox OSE is distributed in the hope that it will 1N/A# be useful, but WITHOUT ANY WARRANTY of any kind. 1N/A# append some extra paths 1N/A# Solaris (order of paths important for tr, echo, grep, sed to work) 1N/A# the restricting tool is ar (mri mode). 1N/A echo "Error: VBox base path contains invalid characters!" 1N/A# darwin /bin/sh has a builtin echo that doesn't grok -n. gotta love it. 1N/A echo "$1"|$KBUILD_SED 's|-l\([^ ]\+\)|\1|g; s|^-[^l][^ ]*||g; s| -[^l][^ ]*||g; s|^ ||; s| *$||g' 1N/A echo "$1"|$KBUILD_SED 's|-L\([^ ]\+\)|\1|g; s|^-[^L][^ ]*||g; s| -[^L][^ ]*||g; s|^ ||; s| *$||g' 1N/A echo "$1"|$KBUILD_SED 's|-I\([^ ]\+\)|\1|g; s|^-[^I][^ ]*||g; s| -[^I][^ ]*||g; s|^ ||; s| *$||g' 1N/A if [ -z "$1" ]; then 1N/A echo "***** Checking $1 *****" >> $LOG 1N/A echo "compiling the following source file:" >> $LOG 1N/A echo "using the following command line:" >> $LOG 1N/A if [ -z "$4" ]; then 1N/A echo " $2 not found at $1 or $3 headers not found" 1N/A echo " Check the file $LOG for detailed error information." 1N/A# Execute a compiled test binary 1N/A echo "executing the binary" >> $LOG 1N/A# Execute a compiled test binary 1N/A echo "executing the binary (LD_LIBRARY_PATH=$1)" >> $LOG 1N/A# Check for OS, MACHINE, CPU 1N/A if [ "$OS" != "solaris" ]; then 1N/A # on AMD64 systems, 64bit libs are usually located in /usr/lib64 1N/A # Solaris doesn't seem to subscribe to fhs, libs are usually in 1N/A # a '64' subdirectory of the standard 'lib' dirs while some 64-bit 1N/A # alternative binaries can be found in 'amd64' subdirs of the 'bin' 1N/A # ones. So, in order to find the right stuff (esp. sdl-config) we'll 1N/A # have to make sure the */bin/amd64 dirs are searched before the */bin 1N/A # ones. (The sed has some sideeffects, but they shouldn't harm us...) 1N/A echo "64-bit Solaris detected, hacking the PATH" >> $LOG 1N/A -e 's/^:*//' -e 's/:*$//g' -e 's/::*/:/g' ` 1N/A# Check for gcc with version >= 3.2. 1N/A# We depend on a working gcc, if we fail terminate in every case. 1N/A log " ** There are known problems with gcc version 4.3 when compiling the recompiler" 1N/A log " ** stuff. You need to specify a compatibility compiler with version < 4.3. Look" 1N/A log " ** for a package compat-gcc-34 on Fedora systems or something similar on other" 1N/A log " ** distributions and call configure with parameter --with-gcc-compat=gcc34." 1N/A # gcc-4.0 is allowed for Darwin only 1N/A # this isn't not necessary, there is not such tool. 1N/A # Solaris sports a 32-bit gcc/g++. 1N/A# Check for the bcc compiler, needed for compiling the BIOS 1N/A echo "compiling the following source file:" >> $LOG 1N/A echo "using the following command line:" >> $LOG 1N/A# Check for the as86 assembler, needed for compiling the BIOS 1N/A# Check for yasm, needed to compile assembler files 1N/A# Check for the iasl ACPI compiler, needed to compile vbox.dsl 1N/A# Check for xsltproc, needed by Main 1N/A# Check for mkisofs, needed to build the CDROM image containing the additions 1N/A# Check for libxml2, needed by VBoxSettings 1N/A# 2.6.24 is known to NOT work, 2.6.26 is known to work (there is no 2.6.25 release) 1N/A#include <libxml/xmlversion.h> 1N/Aextern "C" int main(void) 1N/A printf("found version %s", LIBXML_DOTTED_VERSION); 1N/A#if LIBXML_VERSION >= 20626 1N/A printf(", expected version 2.6.26 or higher\n"); 1N/A#include <libxml/xmlversion.h> 1N/Aextern "C" int main(void) 1N/A printf("found version %s", LIBXML_DOTTED_VERSION); 1N/A#if LIBXML_VERSION >= 20626 1N/A printf(", expected version 2.6.26 or higher\n"); 1N/A# Check for libxslt, needed by VBoxSettings. For now we depend on 1.1.17. 1N/A# This library is available on Ubuntu Edgy which fulfils the minimal libxml2 1N/A# requirement (2.6.26). 1N/A#include <libxslt/xsltconfig.h> 1N/Aextern "C" int main(void) 1N/A printf("found version %s", LIBXSLT_DOTTED_VERSION); 1N/A#if LIBXSLT_VERSION >= 10117 1N/A printf(", expected version 1.1.17 or higher\n"); 1N/A#include <libxslt/xsltconfig.h> 1N/Aextern "C" int main(void) 1N/A printf("found version %s", LIBXSLT_DOTTED_VERSION); 1N/A#if LIBXSLT_VERSION >= 10117 1N/A printf(", expected version 1.1.17 or higher\n"); 1N/A# Check for libIDL, needed by xpcom 1N/A# Check for openssl, needed for RDP 1N/A#include <openssl/opensslv.h> 1N/Aextern "C" int main(void) 1N/A printf("found version %s", OPENSSL_VERSION_TEXT); 1N/A#if OPENSSL_VERSION_NUMBER >= 0x0090700 1N/A printf(", expected version 0.9.7 or higher\n"); 1N/A# Check for pthread, needed by VBoxSVC, frontends, ... 1N/Aextern "C" int main(void) 1N/A pthread_mutex_t mutex; 1N/A if (pthread_mutex_init(&mutex, NULL)) { 1N/A printf("pthread_mutex_init() failed\n"); 1N/A if (pthread_mutex_lock(&mutex)) { 1N/A printf("pthread_mutex_lock() failed\n"); 1N/A if (pthread_mutex_unlock(&mutex)) { 1N/A printf("pthread_mutex_unlock() failed\n"); 1N/A printf("found, OK.\n"); 1N/A# Check for zlib, needed by VBoxSVC, Runtime, ... 1N/Aextern "C" int main(void) 1N/A printf("found version %s", ZLIB_VERSION); 1N/A#if ZLIB_VERNUM >= 0x1210 1N/A printf(", expected version 1.2.1 or higher\n"); 1N/A# Check for libpng, needed by kchmviewer 1N/Aextern "C" int main(void) 1N/A printf("found version %s", PNG_LIBPNG_VER_STRING); 1N/A#if PNG_LIBPNG_VER >= 10205 1N/A printf(", expected version 1.2.5 or higher\n"); 1N/A# if test_compile "$LIBPNG $I_INCPNG" libpng libpng nofatal; then 1N/A# if test_execute nofatal; then 1N/A# Check for pam, needed by VRDPAuth 1N/A# Version 79 was introduced in 9/2005, do we support older versions? 1N/A# OpenSUSE comes with 0.99.xxx where they changed the versioning scheme. 1N/A#include <security/pam_appl.h> 1N/Aextern "C" int main(void) 1N/A printf("found version %d", __LIBPAM_VERSION); 1N/A if (__LIBPAM_VERSION >= 76) 1N/A printf(", expected version 76 or higher\n"); 1N/A#include <security/pam_appl.h> 1N/Aextern "C" int main(void) 1N/A printf("found version %d.%d", __LINUX_PAM__, __LINUX_PAM_MINOR__); 1N/A if (__LINUX_PAM__ >= 1) 1N/A printf(", expected version 1.0 or higher\n"); 1N/A# Check for the SDL library, needed by VBoxSDL and VirtualBox 1N/A# We depend at least on version 1.2.7 1N/A#include <SDL_main.h> 1N/Aextern "C" int main(int argc, char** argv) 1N/A printf("found version %d.%d.%d", 1N/A SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL); 1N/A#if SDL_VERSION_ATLEAST(1,2,7) 1N/A printf(", expected version 1.2.7 or higher\n"); 1N/A# Check for the SDL_ttf library, needed by VBoxSDL (secure label) 1N/A#ifndef SDL_TTF_MAJOR_VERSION 1N/A#define SDL_TTF_MAJOR_VERSION TTF_MAJOR_VERSION 1N/A#define SDL_TTF_MINOR_VERSION TTF_MINOR_VERSION 1N/A#define SDL_TTF_PATCHLEVEL TTF_PATCHLEVEL 1N/Aextern "C" int main(void) 1N/A printf("found version %d.%d.%d", 1N/A SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL); 1N/A#if 10000*SDL_TTF_MAJOR_VERSION + 100*SDL_TTF_MINOR_VERSION + SDL_TTF_PATCHLEVEL >= 20006 1N/A printf(", expected version 2.0.6 or higher\n"); 1N/A# Check for libasound, needed by the ALSA audio backend 1N/A#include <alsa/asoundlib.h> 1N/Aextern "C" int main(void) 1N/A printf("found version %d.%d.%d", 1N/A SND_LIB_MAJOR, SND_LIB_MINOR, SND_LIB_SUBMINOR); 1N/A#if 10000*SND_LIB_MAJOR + 100*SND_LIB_MINOR + SND_LIB_SUBMINOR >= 10006 1N/A printf(", expected version 1.0.6 or higher\n"); 1N/A# Check for PulseAudio 1N/A#include <pulse/version.h> 1N/Aextern "C" int main(void) 1N/A printf("found version %s API version %d", pa_get_headers_version(), PA_API_VERSION); 1N/A#if PA_API_VERSION >= 9 1N/A printf(", expected version 0.9.0 (API version 9) or higher\n"); 1N/A# Check for the Xcursor library, needed by VBoxSDL and VBoxBFE 1N/A#include <X11/Xlib.h> 1N/A#include <X11/Xcursor/Xcursor.h> 1N/Aextern "C" int main(void) 1N/A XcursorImage *cursor = XcursorImageCreate (10, 10); 1N/A XcursorImageDestroy(cursor); 1N/A# Check for the X libraries (Xext, X11) 1N/A#include <X11/Xlib.h> 1N/Aextern "C" int main(void) 1N/A dpy = XOpenDisplay(NULL); 1N/A scrn_num = DefaultScreen(dpy); 1N/A scrn = ScreenOfDisplay(dpy, scrn_num); 1N/A win = XCreateWindow(dpy, RootWindowOfScreen(scrn), 0, 0, 100, 100, 1N/A 0, 16, InputOutput, CopyFromParent, 0, NULL); 1N/A XDestroyWindow(dpy, win); 1N/A# Check for the Qt3 library, needed by VirtualBox 1N/Aextern "C" int main(void) 1N/A printf("found version %s", QT_VERSION_STR); 1N/A#if QT_VERSION >= 0x030305 1N/A#elif QT_VERSION >= 0x030300 1N/A printf("\n ** WARNING: QT < 3.3.5 has known problems!\n"); 1N/A printf(", expected version 3.3.0 or higher\n"); 1N/A echo "compiling the following source file:" >> $LOG 1N/A echo "using the following command line:" >> $LOG 1N/A echo " Qt3 not found at \"$QT3DIR\" or Qt3 headers not found" 1N/A echo " Check the file $LOG for detailed error information." 1N/A# Check for the Qt4 library, needed by VirtualBox4 1N/A# Currently not fatal. 1N/A log_failure "Qt4 framework not found (can be disable using --disable-qt4)" 1N/A # default is to use pkg-config 1N/A # this braindead path is necessary for mdv2008.1 1N/A # do it the old way (e.g. user has specified QT4DIR) 1N/Aextern "C" int main(void) 1N/A printf("found version %s", QT_VERSION_STR); 1N/A#if QT_VERSION >= 0x040300 1N/A printf(", expected version 4.3.0 or higher\n"); 1N/Aextern "C" int main(void) 1N/A printf("found version %s", QT_VERSION_STR); 1N/A#if QT_VERSION >= 0x040300 1N/A printf(", expected version 4.3.0 or higher\n"); 1N/A if [ "$OS" != "darwin" ]; then 1N/A # strip .../QtCore as we add components ourself 1N/A # store only the first path, remove all other pathes 1N/A # this is not quite right since the qt libpath does not have to be first... 1N/A# Check whether static libstdc++ is installed 1N/Aextern "C" int main(void) 1N/A std::string s = "test"; 1N/A# Check for Linux sources 1N/A#include <linux/version.h> 1N/Aint printf(const char *format, ...); 1N/A printf("found version %d.%d.%d", LINUX_VERSION_CODE / 65536, 1N/A (LINUX_VERSION_CODE % 65536) / 256, 1N/A LINUX_VERSION_CODE % 256); 1N/A#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,0) 1N/A printf(", expected version 2.4.0 or higher\n"); 1N/A echo "compiling the following source file:" >> $LOG 1N/A echo "using the following command line:" >> $LOG 1N/A echo " Linux kernel headers not found at $LINUX" 1N/A echo " Check the file $LOG for detailed error information." 1N/A# Check for kchmviewer, needed to display the online help 1N/A# (unused as we ship kchmviewer) 1N/A# Check for the kBuild tools, we don't support GNU make 1N/A echo "export PATH_KBUILD_BIN=\"\$path_kbuild_bin\"" >> $ENV 1N/A echo "path_dev_bin=\"\$PATH_DEVTOOLS/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"/bin" >> $ENV 1N/A if [ "$OS" = "solaris" ]; then 1N/A # Because of sh being non-default shell in Solaris we need to export PATH again when 1N/A # sourcing env.sh. Simply exporting from ./configure does not export PATH correctly. 1N/A echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV 1N/A echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV 1N/A echo "echo \"\$PATH\" | grep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV 1N/A echo "echo \"\$PATH\" | grep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV 1N/A echo "unset path_kbuild_bin path_dev_bin" >> $ENV 1N/A # check for installed kBuild 1N/A# Some Linux distributions include "compiler.h" in their libc linux 1N/A# headers package, some don't. Most don't need it, building might (!) 1N/A# not succeed on openSUSE without it. 1N/A# Required to pass CAP_NET_RAW to our binaries to allow to open SOCK_RAW 1N/A# sockets for doing ICMP requests. 1N/A#include <sys/capability.h> 1N/Aextern "C" int main(void) 1N/A cap_t caps = cap_get_proc(); 1N/A snprintf(buf, sizeof(buf), "Current caps are '%s'\n", cap_to_text(caps, NULL)); 1N/A# Check if we are able to build 32-bit applications (needed for the guest additions) 1N/A echo "compiling the following source file:" >> $LOG 1N/A echo "using the following command line:" >> $LOG 1N/A echo " Cannot compile 32-bit applications (missing headers and/or libraries)!" 1N/A echo " Check the file $LOG for detailed error information." 1N/Aextern "C" int main(void) 1N/A printf("found version %s", PY_VERSION); 1N/A#if PY_VERSION_HEX >= 0x02030000 1N/A printf(", expected version 2.3 or higher\n"); 1N/A echo "compiling the following source file:" >> $LOG 1N/A echo "using the following command line:" >> $LOG 1N/A echo " wine binary not found" 1N/A echo " wineprefixcreate not found" 1N/A echo " wineprefixcreate failed" 1N/A echo '[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment]' >> $tmp 1N/A echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhc.exe\DllOverrides]' >> $tmp 1N/A echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhw.exe\DllOverrides]' >> $tmp 1N/A echo " failed to load registry changes (path)." 1N/A# Determines the Darwin version. 1N/A #cnf_append "VBOX_TARGET_MAC_OS_X_VERSION_10_5" "1" 1N/A# Checks that i386-elf-gcc-3.4.6, i386-elf-gcc-3.4.3, i386-elf-gcc-3.4 or i386-elf-gcc 1N/A echo " failed to find i386-elf-gcc" 1N/AUsage: ./configure [OPTIONS]... 1N/A -h, --help display this help and exit 1N/A --nofatal don't abort on errors 1N/A --disable-xpcom disable XPCOM and related stuff 1N/A --disable-python disable python bindings 1N/A --disable-sdl-ttf disable SDL_ttf detection 1N/A --disable-alsa disable the ALSA sound backend 1N/A --disable-pulse disable the PulseAudio backend 1N/A --disable-dbus don't use DBus and hal for hardware detection 1N/A --disable-kmods don't build Linux kernel modules (host and guest) 1N/A --disable-hardening don't be strict about /dev/vboxdrv access 1N/A --build-libxml2 build libxml2 from sources 1N/A --build-libxslt build libxslt from sources 1N/A --setup-wine setup a Wine directory and register the hhc hack 1N/A --with-gcc=PATH location of the gcc compiler [$CC] 1N/A --with-g++=PATH location of the g++ compiler [$CXX] 1N/A --with-gcc-compat=PATH location of the gcc compiler for recompiler [$CC] 1N/A --with-kbuild=DIR kbuild directory [$KBUILDDIR] 1N/A --with-iasl=PATH location of the iasl compiler [$IASL] 1N/A --with-linux=DIR Linux kernel source directory [$LINUX] 1N/A --with-mkisofs=PATH location of mkisofs [$MKISOFS] 1N/A --with-qt-dir=DIR directory for Qt3 headers/libraries [$QT3DIR] 1N/A --with-qt4-dir=DIR directory for Qt4 headers/libraries [pkgconfig] 1N/A -d, --build-debug build with debugging symbols and assertions 1N/A --build-profile build with profiling support 1N/A --build-headless build headless (without any X11 frontend) 1N/A# scan command line options 1N/A echo "Error: KBUILDDIR contains invalid characters!" 1N/A# initialize output files 1N/A# Log file generated by 1N/A# automatically generated by 1N/A# It will be completely overwritten if configure is executed again. 1N/A# automatically generated by 1N/A# It will be completely overwritten if configure is executed again. 1N/A# Make sure you source this file once before you start to build VBox. 1N/A echo "Found USB devices, assuming VBOX_OSE = FALSE" >>
$LOG 1N/A echo "Creating DEBUG build!" >>
$LOG 1N/A echo "Creating PROFILE build!" >>
$LOG 1N/A# first determine our environment 1N/A# append the tools directory to the default search path 1N/A# some things are not available in for OSE 1N/A # On Darwin we want to build against Qt4 only. WITH_QT4 is enabled by 1N/A # default so disable Qt3. --disable-qt disables both Qt3 and Qt4 GUI now, 1N/A # --disable-qt4 disables only the Qt4 GUI (which is not appropriate for 1N/A # Darwin as we disable the Qt3 here anyway. 1N/A # (Qt3 builds for Intel Macs are usually not threaded or for X11. And they 1N/A # don't contain our patches, which means the result isn't really usable.) 1N/A# emit disable directives corresponding to any --disable-xxx options. 1N/A# don't check for yasm for the time beeing as 0.40 and 0.50 both have known bugs 1N/A# [ "$OS" != "darwin" ] && check_yasm 1N/A# build openssl on Darwin in every case 1N/Aecho "Source '$ENV' once before you start to build VBox:" 1N/A echo "To compile the kernel module, do:" 1N/A echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++" 1N/A echo " Hardening is enabled which means that the VBox binaries will not run from" 1N/A echo " the binary directory. The binaries have to be installed suid root and some" 1N/A echo " more prerequisites have to be fulfilled which is normally done by installing" 1N/A echo " the final package. For development, the hardening feature can be disabled" 1N/A echo " by specifying the --disable-hardening parameter. Please never disable that" 1N/A echo " feature for the final distribution!" 1N/A echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++" 1N/A echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++" 1N/A echo " Hardening is disabled. Please do NOT build packages for distribution with" 1N/A echo " disabled hardening!" 1N/A echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"