configure revision 424a6548fed99f4fc6b9ce1caa8e43e80641cbe1
# The purpose of this script is to check for all external tools, headers, and # libraries VBox OSE depends on. # Copyright (C) 2006-2007 innotek GmbH # This file is part of VirtualBox Open Source Edition (OSE), as # you can redistribute it and/or modify it under the terms of the GNU # General Public License as published by the Free Software Foundation, # in version 2 as it comes in the "COPYING" file of the VirtualBox OSE # distribution. VirtualBox OSE is distributed in the hope that it will # be useful, but WITHOUT ANY WARRANTY of any kind. # append some extra paths # Solaris (order of paths important for tr, echo, grep, sed to work) # the restricting tool is ar (mri mode). echo "Error: VBox base path contains invalid characters!" if [ -z "$nofatal" -o "x$1" != "x" ]; then if [ -n "$1" ]; then echo -n "$1, "; fi echo "$1"|$KBUILD_SED 's|-l\([^ ]\+\)|\1|g; s|-[^l]\([^ ]\+\)||g; s|^ ||; s| *$||g' echo "$1"|$KBUILD_SED 's|-L\([^ ]\+\)|\1|g; s|-[^L]\([^ ]\+\)||g; s|^ ||; s| *$||g' echo "$1"|$KBUILD_SED 's|-I\([^ ]\+\)|\1|g; s|-[^I]\([^ ]\+\)||g; s|^ ||; s| *$||g' # Wrapper for ancient /usr/bin/which on darwin that always returns 0 echo "***** Checking $1 *****" >> $LOG echo -n "Checking for $1: " echo "compiling the following source file:" >> $LOG echo "using the following command line:" >> $LOG echo " $2 not found at $1 or $3 headers not found" echo " Check the file $LOG for detailed error information." # Execute a compiled test binary echo "executing the binary" >> $LOG # Check for OS, MACHINE, CPU # on AMD64 systems, 64bit libs are usually located in /usr/lib64 # Automatically disable XPCOM on darwin. echo "Disabling checks for XPCOM related components." # Check for gcc with version >= 3.2. # We depend on a working gcc, if we fail terminate in every case. if [ "$OS" = "darwin" ]; then if [ "$CC" != "gcc" ]; then if [ "$CXX" != "g++" ]; then if [ "$CC32" != "gcc -m32" ]; then if [ "$CXX32" != "g++ -m32" ]; then # Check for the bcc compiler, needed for compiling the BIOS echo "compiling the following source file:" >> $LOG echo "using the following command line:" >> $LOG # Check for the as86 assembler, needed for compiling the BIOS # Check for yasm, needed to compile assembler files # Check for the iasl ACPI compiler, needed to compile vbox.dsl # Check for xsltproc, needed by Main # Check for mkisofs, needed to build the CDROM image containing the additions # Check for xalan, needed by VBoxXML #include <xalanc/Include/XalanVersion.hpp> extern "C" int main(void) printf("found version %d.%d.%d", XALAN_VERSION_MAJOR, XALAN_VERSION_MINOR, XALAN_VERSION_REVISION); #if _XALAN_VERSION >= 10800 printf(", expected version 1.8.0 or higher\n"); echo "Building xalan from shipped sources." echo "Building xalan from shipped sources." >> $LOG # Check for xerces, needed by VBoxXML #include <xercesc/util/XercesVersion.hpp> extern "C" int main(void) printf("found version %d.%d.%d", XERCES_VERSION_MAJOR, XERCES_VERSION_MINOR, XERCES_VERSION_REVISION); #if _XERCES_VERSION >= 20500 printf(", expected version 2.5.0 or higher"); echo "Building xerces from shipped sources." echo "Building xerces from shipped sources." >> $LOG # Check for libIDL, needed by xpcom # Check for openssl, needed for RDP #include <openssl/opensslv.h> extern "C" int main(void) printf("found version %s", OPENSSL_VERSION_TEXT); #if OPENSSL_VERSION_NUMBER >= 0x0090700 printf(", expected version 0.9.7 or higher\n"); # Check for pthread, needed by VBoxSVC, frontends, ... extern "C" int main(void) if (pthread_mutex_init(&mutex, NULL)) { printf("pthread_mutex_init() failed\n"); if (pthread_mutex_lock(&mutex)) { printf("pthread_mutex_lock() failed\n"); if (pthread_mutex_unlock(&mutex)) { printf("pthread_mutex_unlock() failed\n"); # Check for zlib, needed by VBoxSVC, Runtime, ... extern "C" int main(void) printf("found version %s", ZLIB_VERSION); #if ZLIB_VERNUM >= 0x1210 printf(", expected version 1.2.1 or higher\n"); # Check for libpng, needed by kchmviewer extern "C" int main(void) printf("found version %s", PNG_LIBPNG_VER_STRING); #if PNG_LIBPNG_VER >= 10205 printf(", expected version 1.2.5 or higher\n"); # if test_compile "$LIBPNG $I_INCPNG" libpng libpng nofatal; then # if test_execute nofatal; then # Check for pam, needed by VRDPAuth # Version 79 was introduced in 9/2005, do we support older versions? # OpenSUSE comes with 0.99.xxx where they changed the versioning scheme. #include <security/pam_appl.h> extern "C" int main(void) printf("found version %d", __LIBPAM_VERSION); if (__LIBPAM_VERSION >= 76) printf(", expected version 76 or higher\n"); #include <security/pam_appl.h> extern "C" int main(void) printf("found version %d.%d", __LINUX_PAM__, __LINUX_PAM_MINOR__); printf(", expected version 1.0 or higher\n"); # Check for the SDL library, needed by VBoxSDL and VirtualBox # We depend at least on version 1.2.7 #include <SDL/SDL_main.h> extern "C" int main(void) printf("found version %d.%d.%d", SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL); #if SDL_VERSION_ATLEAST(1,2,7) printf(", expected version 1.2.7 or higher\n"); # Check for the SDL_ttf library, needed by VBoxSDL (secure label) #ifndef SDL_TTF_MAJOR_VERSION #define SDL_TTF_MAJOR_VERSION TTF_MAJOR_VERSION #define SDL_TTF_MINOR_VERSION TTF_MINOR_VERSION #define SDL_TTF_PATCHLEVEL TTF_PATCHLEVEL extern "C" int main(void) printf("found version %d.%d.%d", SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL); #if 10000*SDL_TTF_MAJOR_VERSION + 100*SDL_TTF_MINOR_VERSION + SDL_TTF_PATCHLEVEL >= 20006 printf(", expected version 2.0.6 or higher\n"); # Check for libasound, needed by the ALSA audio backend #include <alsa/asoundlib.h> extern "C" int main(void) printf("found version %d.%d.%d", SND_LIB_MAJOR, SND_LIB_MINOR, SND_LIB_SUBMINOR); #if 10000*SND_LIB_MAJOR + 100*SND_LIB_MINOR + SND_LIB_SUBMINOR >= 10006 printf(", expected version 1.0.6 or higher\n"); # Check for the Xcursor library, needed by VBoxSDL and VBoxBFE #include <X11/Xcursor/Xcursor.h> extern "C" int main(void) XcursorImage *cursor = XcursorImageCreate (10, 10); XcursorImageDestroy(cursor); # Check for the X libraries (Xext, X11) extern "C" int main(void) dpy = XOpenDisplay(NULL); scrn_num = DefaultScreen(dpy); scrn = ScreenOfDisplay(dpy, scrn_num); win = XCreateWindow(dpy, RootWindowOfScreen(scrn), 0, 0, 100, 100, 0, 16, InputOutput, CopyFromParent, 0, NULL); XDestroyWindow(dpy, win); # Check for the QT library, needed by VirtualBox extern "C" int main(void) printf("found version %s", QT_VERSION_STR); #if QT_VERSION >= 0x030305 #elif QT_VERSION >= 0x030300 printf("\n ** WARNING: QT < 3.3.5 has known problems!\n"); printf(", expected version 3.3.0 or higher\n"); echo "compiling the following source file:" >> $LOG echo "using the following command line:" >> $LOG echo " Qt not found at \"$QTDIR\" or Qt headers not found" echo " Check the file $LOG for detailed error information." # Check for Linux sources #include <linux/version.h> int printf(const char *format, ...); 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(", expected version 2.4.0 or higher\n"); echo "compiling the following source file:" >> $LOG echo "using the following command line:" >> $LOG echo " Linux kernel headers not found at $LINUX" echo " Check the file $LOG for detailed error information." # Check for kchmviewer, needed to display the online help # Check for the kBuild tools, we don't support GNU make echo "export BUILD_PLATFORM=\"$OS\"" >> $ENV echo "export BUILD_TARGET=\"$OS\"" >> $ENV echo "export PATH_KBUILD_BIN=\"\$path_kbuild_bin\"" >> $ENV echo "path_dev_bin=\"\$PATH_DEVTOOLS/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"/bin" >> $ENV if [ "$OS" = "solaris" ]; then # Because of sh being non-default shell in Solaris we need to export PATH again when # sourcing env.sh. Simply exporting from ./configure does not export PATH correctly. echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV 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 # Some Linux distributions include "compiler.h" in their libc linux # headers package, some don't. Most don't need it, building might (!) # not succeed on openSUSE without it. # Check if we are able to build 32-bit applications (needed for the guest additions) echo "compiling the following source file:" >> $LOG echo "using the following command line:" >> $LOG echo " Cannot compile 32-bit applications (missing headers and/or libraries)!" echo " Check the file $LOG for detailed error information." Usage: ./configure [OPTIONS]... -h, --help display this help and exit --nofatal don't abort on errors --disable-xpcom disable XPCOM and related stuff --disable-sdl-ttf disable SDL_ttf detection --build-xalan build xalan & xerces from shipped sources --with-gcc=PATH location of the gcc compiler [$CC] --with-g++=PATH location of the g++ compiler [$CXX] --with-kbuild=DIR kbuild directory [$KBUILDDIR] --with-iasl=PATH location of the iasl compiler [$IASL] --with-linux=DIR Linux kernel source directory [$LINUX] --with-mkisofs=PATH location of mkisofs [$MKISOFS] --with-qt-dir=DIR directory for QT headers/libraries [$QTDIR] --with-xalan=LIB location of the xalan library [$LIBXALAN] --with-xalan-incdir=DIR location of the xalan headers [/usr/include] --with-xalan-libdir=DIR location of the xalan library [/usr/lib] --with-xerces=LIB location of the xerces library [$LIBXERCES] --with-xerces-incdir=DIR location of the xerces headers [/usr/include] --with-xerces-libdir=DIR location of the xerces library [/usr/lib] -d, --build-debug build with debugging symbols and assertions --build-headless build headless (without any X11 frontend) # scan command line options echo "Error: KBUILDDIR contains invalid characters!" echo "Unrecognized option \"$option\"" # initialize output files # automatically generated by # It will be completely overwritten if configure is executed again. # automatically generated by # It will be completely overwritten if configure is executed again. # Make sure you source this file once before you start to build VBox. echo "Found USB devices, assuming VBOX_OSE = FALSE" >>
$LOG echo "Creating DEBUG build!" >>
$LOG # first determine our environment # append the tools directory to the default search path # some things are not available in for OSE if [
"$OS" =
"linux" ];
then # emit disable directives corresponding to any --disable-xxx options. # don't check for yasm for the time beeing as 0.40 and 0.50 both have known bugs # [ "$OS" != "darwin" ] && check_yasm if [
"$OS" =
"linux" ];
then echo "Successfully generated '$CNF' and '$ENV'." echo "Source '$ENV' once before you start to build VBox:" if [
"$OS" =
"linux" ];
then echo "To compile the kernel module, do:"