2
# The purpose of this script is to check for all external tools, headers, and
3
# libraries VBox OSE depends on.
6
# Copyright (C) 2006-2011 Oracle Corporation
8
# This file is part of VirtualBox Open Source Edition (OSE), as
9
# available from http://www.virtualbox.org. This file is free software;
10
# you can redistribute it and/or modify it under the terms of the GNU
11
# General Public License (GPL) as published by the Free Software
12
# Foundation, in version 2 as it comes in the "COPYING" file of the
13
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
20
# append some extra paths
21
PATH="$PATH:/opt/gnome/bin"
22
# Solaris (order of paths important for tr, echo, grep, sed to work)
23
PATH="/usr/xpg4/bin:/usr/ucb:$PATH:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin"
26
# Wrapper for ancient /usr/bin/which on darwin that always returns 0
29
if [ -z "$have_ancient_which" ]; then
30
if which /bin/___cErTaINly_a_nOn_eXisTing_fIle___ 2> /dev/null > /dev/null; then
31
have_ancient_which="yes"
33
have_ancient_which="no"
36
if [ "$have_ancient_which" = "yes" ]; then
37
retval=`which $* 2>/dev/null`
39
test -n "$retval" -a -x "$retval"
46
OS=`uname -s | sed -e 's/GNU\/Linux/Linux/g' | tr [:upper:] [:lower:]`
58
echo "Cannot determine OS!"
110
GENISOIMAGE="genisoimage"
113
LIBCRYPTO="-lssl -lcrypto"
114
LIBPTHREAD="-lpthread"
118
INCX11="/usr/local/include"
119
LIBX11="-L/usr/X11R6/lib -L/usr/X11R6/lib64 -L/usr/local/lib -lXext -lX11"
120
LIBXCURSOR="-lXcursor"
122
LIBXINERAMA="-lXinerama"
129
LIBVNCSERVER="-lvncserver"
131
if [ "$OS" = "freebsd" ]; then
132
INCCURL="-I/usr/local/include"
133
LIBCURL="-L/usr/local/lib -lcurl"
134
INCPULSE="-I/usr/local/include"
135
LIBPULSE="-L/usr/local/lib"
136
INCPNG="-I/usr/local/include"
137
LIBPNG="-L/usr/local/lib -lpng"
144
PKGCONFIG="`which_wrapper pkg-config`"
145
PYTHONDIR="/usr /usr/local"
146
QT4DIR="/usr/lib/qt4 /usr/share/qt4 /usr/lib64/qt4 /usr /usr/local"
148
QT4UIC3DIR="/usr/bin"
149
KBUILDDIR="`cd \`dirname $0\`; pwd`/kBuild"
150
DEVDIR="`cd \`dirname $0\`; pwd`/tools"
151
if [ -d "/lib/modules/`uname -r`/build" ]; then
152
LINUX="/lib/modules/`uname -r`/build"
154
LINUX="/usr/src/linux"
156
KCHMVIEWER="kchmviewer"
161
# the restricting tool is ar (mri mode).
162
INVALID_CHARS="[^A-Za-z0-9/\\$:._-]"
164
# darwin /bin/sh has a builtin echo that doesn't grok -n. gotta love it.
165
if [ "$OS" = "darwin" ]; then
166
ECHO_N="/bin/echo -n"
174
rm -f $ODIR.tmp_src.cc $ODIR.tmp_src.c $ODIR.tmp_out $ODIR.test_execute.log
179
if [ -z "$nofatal" -o "x$1" != "x" ]; then
182
echo "Check $LOG for details"
195
if [ -n "$1" ]; then $ECHO_N "$1, "; fi
206
echo "** $1!" >> $LOG
212
printf "%-30s := %s\n" "$1" "$2" >> $CNF
217
echo "$1"|$KBUILD_SED 's|-l\([^ ]\+\)|\1|g; s|^-[^l][^ ]*||g; s| -[^l][^ ]*||g; s|^ ||; s| *$||g'
222
echo "$1"|$KBUILD_SED 's|-L\([^ ]\+\)|\1|g; s|^-[^L][^ ]*||g; s| -[^L][^ ]*||g; s|^ ||; s| *$||g'
227
echo "$1"|$KBUILD_SED 's|-I\([^ ]\+\)|\1|g; s|^-[^I][^ ]*||g; s| -[^I][^ ]*||g; s|^ ||; s| *$||g'
232
echo "$1"|$KBUILD_SED 's|^\/|-I/|g; s| \/| -I/|g'
238
log_failure "$2 is empty"
241
elif which_wrapper $1 > /dev/null; then
244
log_failure "$1 (variable $2) not found"
254
echo "***** Checking $1 *****" >> $LOG
255
$ECHO_N "Checking for $1: "
260
# $1 compile flags/libs
263
# $4 if this argument is 'nofatal', don't abort
266
echo "compiling the following source file:" >> $LOG
267
cat $ODIR.tmp_src.cc >> $LOG
268
echo "using the following command line:" >> $LOG
269
echo "$CXX $CXX_FLAGS -g -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc \"$1\"" >> $LOG
270
$CXX $CXX_FLAGS -g -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc $1 >> $LOG 2>&1
271
if [ $? -ne 0 ]; then
274
echo " $2 not found at $1 or $3 headers not found"
275
echo " Check the file $LOG for detailed error information."
287
# Execute a compiled test binary
290
echo "executing the binary" >> $LOG
291
$ODIR.tmp_out > $ODIR.test_execute.log
293
cat $ODIR.test_execute.log | tee -a $LOG
294
if [ $rc -ne 0 ]; then
304
# Execute a compiled test binary
307
echo "executing the binary (LD_LIBRARY_PATH=$1)" >> $LOG
308
LD_LIBRARY_PATH=$1 $ODIR.tmp_out > $ODIR.test_execute.log
310
cat $ODIR.test_execute.log | tee -a $LOG
311
if [ $rc -ne 0 ]; then
322
# Check for OS, MACHINE, CPU
326
test_header environment
327
BUILD_CPU=`dpkg-architecture -qDEB_HOST_GNU_CPU`
328
[ "$OS" = "solaris" ] && BUILD_CPU=`isainfo | cut -f 1 -d ' '`
330
i[3456789]86|x86|i86pc)
335
BUILD_MACHINE='amd64'
337
if [ "$OS" != "solaris" ]; then
338
# on AMD64 systems, 64bit libs are usually located in /usr/lib64
339
# see http://www.pathname.com/fhs/pub/fhs-2.3.html#LIB64
342
# Solaris doesn't seem to subscribe to fhs, libs are usually in
343
# a '64' subdirectory of the standard 'lib' dirs while some 64-bit
344
# alternative binaries can be found in 'amd64' subdirs of the 'bin'
345
# ones. So, in order to find the right stuff (esp. sdl-config) we'll
346
# have to make sure the */bin/amd64 dirs are searched before the */bin
347
# ones. (The sed has some sideeffects, but they shouldn't harm us...)
348
echo "64-bit Solaris detected, hacking the PATH" >> $LOG
349
echo "old PATH: $PATH" >> $LOG
350
PATH=`echo ":$PATH:" | sed -e 's,\(:[^:]*/bin\):,\1/amd64:\1:,g' \
351
-e 's/^:*//' -e 's/:*$//g' -e 's/::*/:/g' `
353
echo "new PATH: $PATH" >> $LOG
358
log_failure "Cannot determine system"
362
[ -z "$TARGET_MACHINE" ] && TARGET_MACHINE=$BUILD_MACHINE
363
[ -z "$TARGET_CPU" ] && TARGET_CPU=$BUILD_CPU
364
DEVDIR_BIN="$DEVDIR/$OS.$BUILD_MACHINE/bin"
365
log_success "Determined build machine: $OS.$BUILD_MACHINE, target machine: $OS.$TARGET_MACHINE"
367
echo "BUILD_PLATFORM=\"$OS\"" >> $ENV
368
echo "export BUILD_PLATFORM" >> $ENV
369
echo "BUILD_PLATFORM_ARCH=\"$BUILD_MACHINE\"" >> $ENV
370
echo "export BUILD_PLATFORM_ARCH" >> $ENV
371
echo "BUILD_TARGET=\"$OS\"" >> $ENV
372
echo "export BUILD_TARGET" >> $ENV
373
echo "BUILD_TARGET_ARCH=\"$TARGET_MACHINE\"" >> $ENV
374
echo "export BUILD_TARGET_ARCH" >> $ENV
375
echo "BUILD_TARGET_CPU=\"$TARGET_CPU\"" >> $ENV
376
echo "export BUILD_TARGET_CPU" >> $ENV
377
echo "BUILD_TYPE=\"$BUILD_TYPE\"" >> $ENV
378
echo "export BUILD_TYPE" >> $ENV
382
# Check for gcc with version >= 3.2.
383
# We depend on a working gcc, if we fail terminate in every case.
388
if check_avail "$CC" CC really; then
389
cc_ver=`$CC -dumpversion` 2>/dev/null
390
if [ $? -ne 0 ]; then
391
log_failure "cannot execute '$CC -dumpversion'"
394
if check_avail "$CXX" CXX really; then
395
cxx_ver=`$CXX -dumpversion` 2>/dev/null
396
if [ $? -ne 0 ]; then
397
log_failure "cannot execute '$CXX -dumpversion'"
400
cc_maj=`echo $cc_ver|cut -d. -f1`
401
cc_min=`echo $cc_ver|cut -d. -f2`
402
if [ "x$cc_ver" != "x$cxx_ver" ]; then
403
log_failure "gcc version $cc_ver does not match g++ version $cxx_ver"
405
elif [ $cc_maj -eq 4 -a $cc_min -eq 0 -a "$OS" = "darwin" ]; then
406
log_success "found version $cc_ver"
407
# gcc-4.0 is allowed for Darwin only
408
elif [ $cc_maj -lt 3 \
409
-o \( $cc_maj -eq 3 -a $cc_min -lt 2 \) \
410
-o \( $cc_maj -eq 4 -a $cc_min -lt 1 -a "$OS" != "darwin" \) \
411
-o \( $cc_maj -eq 4 -a $cc_min -gt 7 \) \
412
-o $cc_maj -gt 4 ]; then
413
log_failure "gcc version $cc_ver found, expected gcc 3.x with x>1 or gcc 4.x with 0<x<8"
416
log_success "found version $cc_ver"
418
if [ "$BUILD_MACHINE" = "amd64" ]; then
419
[ -z "$CC32" ] && CC32="$CC -m32"
420
[ -z "$CXX32" ] && CXX32="$CXX -m32"
422
[ -z "$CC32" ] && CC32="$CC"
423
[ -z "$CXX32" ] && CXX32="$CXX"
425
if [ "$BUILD_MACHINE" = "x86" -a "$TARGET_MACHINE" = "amd64" ]; then
426
[ -z "$CC64" ] && CC64="$CC -m64"
427
[ -z "$CXX64" ] && CXX64="$CXX -m64"
429
if [ "$TARGET_MACHINE" = "amd64" -a $WITH_VMMRAW -eq 0 ]; then
433
if [ "$CC" != "gcc" ]; then
434
cnf_append "TOOL_GCC3_CC" "$CC"
435
cnf_append "TOOL_GCC3_AS" "$CC"
436
cnf_append "TOOL_GCC3_LD" "$CC"
437
cnf_append "TOOL_GXX3_CC" "$CC"
438
cnf_append "TOOL_GXX3_AS" "$CC"
440
if [ "$CXX" != "g++" ]; then
441
cnf_append "TOOL_GCC3_CXX" "$CXX"
442
cnf_append "TOOL_GXX3_CXX" "$CXX"
443
cnf_append "TOOL_GXX3_LD" "$CXX"
445
if [ "$CC32" != "gcc -m32" -a "$CC32" != "undefined" ]; then
446
cnf_append "TOOL_GCC32_CC" "$CC32"
447
cnf_append "TOOL_GCC32_AS" "$CC32"
448
cnf_append "TOOL_GCC32_LD" "$CC32"
449
cnf_append "TOOL_GXX32_CC" "$CC32"
450
cnf_append "TOOL_GXX32_AS" "$CC32"
452
if [ "$CXX32" != "g++ -m32" -a "$CXX32" != "undefined" ]; then
453
cnf_append "TOOL_GCC32_CXX" "$CXX32"
454
cnf_append "TOOL_GXX32_CXX" "$CXX32"
455
cnf_append "TOOL_GXX32_LD" "$CXX32"
457
# this isn't not necessary, there is not such tool.
458
if [ -n "$CC64" ]; then
459
cnf_append "TOOL_GCC64_CC" "$CC64"
460
cnf_append "TOOL_GCC64_AS" "$CC64"
461
cnf_append "TOOL_GCC64_LD" "$CC64"
462
cnf_append "TOOL_GXX64_CC" "$CC64"
463
cnf_append "TOOL_GXX64_AS" "$CC64"
465
if [ -n "$CXX64" ]; then
466
cnf_append "TOOL_GCC64_CXX" "$CXX64"
467
cnf_append "TOOL_GXX64_CXX" "$CXX64"
468
cnf_append "TOOL_GXX64_LD" "$CXX64"
470
# Solaris sports a 32-bit gcc/g++.
471
if [ "$OS" = "solaris" -a "$BUILD_MACHINE" = "amd64" ]; then
472
[ "$CC" = "gcc" ] && CC="gcc -m64"
473
[ "$CXX" = "g++" ] && CXX="g++ -m64"
481
# Check for the bcc compiler, needed for compiling the BIOS
486
if check_avail "$BCC" BCC; then
487
bcc_ver=`$BCC -v 2>&1|grep version|sed 's+^bcc: version \(.*\)+\1+'`
488
if [ $? -ne 0 ]; then
489
log_failure "BCC not found"
492
echo "compiling the following source file:" >> $LOG
493
cat > $ODIR.tmp_src.c << EOF
500
cat $ODIR.tmp_src.c >> $LOG
501
bcc_path=`which_wrapper $BCC`
502
bcc_dir="`dirname $bcc_path`/"
503
echo "using the following command line:" >> $LOG
504
echo "$BCC -B $bcc_dir -C-c -3 -S -o $ODIR.tmp_out $ODIR.tmp_src.c" >> $LOG
505
$BCC -B $bcc_dir -C-c -3 -S -o $ODIR.tmp_out $ODIR.tmp_src.c >> $LOG 2>&1
506
if [ $? -ne 0 ]; then
507
log_failure "BCC not working"
510
log_success "found version $bcc_ver"
511
cnf_append "VBOX_BCC" "$bcc_path -B $bcc_dir"
521
# Check for the as86 assembler, needed for compiling the BIOS
526
if check_avail "$AS86" AS86; then
527
as86_ver=`$AS86 -v 2>&1|grep version|sed 's+^as86 version: \(.*\)+\1+'`
528
if [ $? -ne 0 ]; then
529
log_failure "as86 not found"
532
log_success "found version $as86_ver"
533
cnf_append "VBOX_AS86" "`which_wrapper $AS86`"
540
# Check for yasm, needed to compile assembler files
545
if check_avail "$YASM" YASM; then
546
yasm_ver=`$YASM --version|grep "^yasm"|sed 's+^yasm \(.*\)+\1+'`
547
if [ $? -ne 0 ]; then
548
log_failure "yasm not found"
551
yasm_maj=`echo $yasm_ver|cut -d. -f1`
552
yasm_min=`echo $yasm_ver|cut -d. -f2`
553
yasm_rev=`echo $yasm_ver|cut -d. -f3`
554
yasm_ver_mul=`expr $yasm_maj \* 10000 + $yasm_min \* 100 + $yasm_rev`
555
if [ $yasm_ver_mul -lt 501 ]; then
556
log_failure "found version $yasm_ver, expected at least 0.5.1"
559
log_success "found version $yasm_ver"
567
# Check for the iasl ACPI compiler, needed to compile vbox.dsl
572
if check_avail "$IASL" IASL; then
573
iasl_ver=`$IASL|grep version|sed 's+^ASL.*version \([0-9]*\).*+\1+'`
574
if [ $? -ne 0 ]; then
575
log_failure "iasl not found"
578
log_success "found version $iasl_ver"
579
cnf_append "VBOX_IASLCMD" "`which_wrapper $IASL`"
586
# Check for xsltproc, needed by Main
591
if check_avail "$XSLTPROC" XSLTPROC; then
592
xsltproc_ver=`$XSLTPROC --version`
593
if [ $? -ne 0 ]; then
594
log_failure "xsltproc not found"
598
cnf_append "VBOX_XSLTPROC" "`which_wrapper $XSLTPROC`"
605
# Check for mkisofs, needed to build the CDROM image containing the additions
610
if which_wrapper $GENISOIMAGE > /dev/null; then
611
mkisofs_ver=`$GENISOIMAGE --version`
612
if [ $? -ne 0 ]; then
613
log_failure "mkisofs not found"
616
log_success "found $mkisofs_ver"
617
cnf_append "VBOX_MKISOFS" "`which_wrapper $GENISOIMAGE`"
619
elif check_avail "$MKISOFS" MKISOFS; then
620
mkisofs_ver=`$MKISOFS --version`
621
if [ $? -ne 0 ]; then
622
log_failure "mkisofs not working"
625
log_success "found $mkisofs_ver"
626
cnf_append "VBOX_MKISOFS" "`which_wrapper $MKISOFS`"
633
# Check for libxml2, needed by VBoxSettings and Runtime.
634
# 2.6.24 is known to NOT work, 2.6.26 is known to work (there is no 2.6.25 release)
638
if [ -z "$BUILD_LIBXML2" ]; then
640
if which_wrapper pkg-config > /dev/null; then
641
libxml2_ver=`pkg-config libxml-2.0 --modversion 2>> $LOG`
642
if [ $? -ne 0 ]; then
643
log_failure "libxml2 not found"
646
FLGXML2=`pkg-config libxml-2.0 --cflags`
647
INCXML2=`strip_I "$FLGXML2"`
648
LIBXML2=`pkg-config libxml-2.0 --libs`
649
cat > $ODIR.tmp_src.cc << EOF
651
#include <libxml/xmlversion.h>
652
extern "C" int main(void)
654
printf("found version %s", LIBXML_DOTTED_VERSION);
655
#if LIBXML_VERSION >= 20626
659
printf(", expected version 2.6.26 or higher\n");
664
[ -n "$INCXML2" ] && I_INCXML2=`prefix_I "$INCXML2"`
665
if test_compile "$LIBXML2 $LIBPTHREAD $I_INCXML2" xml2 xml2; then
666
if test_execute; then
667
cnf_append "SDK_VBOX_LIBXML2_INCS" "$INCXML2"
668
cnf_append "SDK_VBOX_LIBXML2_LIBS" "`strip_l "$LIBXML2"`"
672
elif which_wrapper xml2-config; then
673
libxml2_ver=`xml2-config --version`
674
if [ $? -ne 0 ]; then
675
log_failure "xml2-config not found"
678
log_success "found version $libxml2_ver"
679
FLGXML2=`xml2-config --cflags`
680
INCXML2=`strip_I "$FLGXML2"`
681
LIBXML2=`xml2-config --libs`
682
cat > $ODIR.tmp_src.cc << EOF
684
#include <libxml/xmlversion.h>
685
extern "C" int main(void)
687
printf("found version %s", LIBXML_DOTTED_VERSION);
688
#if LIBXML_VERSION >= 20626
692
printf(", expected version 2.6.26 or higher\n");
697
[ -n "$INCXML2" ] && I_INCXML2=`prefix_I "$INCXML2"`
698
if test_compile "$LIBXML2 $LIBPTHREAD $I_INCXML2" xml2 xml2; then
699
if test_execute; then
700
cnf_append "SDK_VBOX_LIBXML2_INCS" "$INCXML2"
701
cnf_append "SDK_VBOX_LIBXML2_LIBS" "`strip_l "$LIBXML2"`"
706
log_failure "neither pkg-config nor xml2-config found"
714
# Check for libIDL, needed by xpcom
720
if which_wrapper libIDL-config-2 > /dev/null; then
721
libidl_ver=`libIDL-config-2 --version`
722
if [ $? -ne 0 ]; then
723
log_failure "libIDL-config-2 not working"
726
log_success "found version $libidl_ver"
727
cnf_append "VBOX_LIBIDL_CONFIG" \
728
"PKG_CONFIG_PATH=`libIDL-config-2 --prefix`/$LIB/pkgconfig `which_wrapper libIDL-config-2`"
730
elif check_avail "libIDL-config" libIDL-config; then
731
libidl_ver=`libIDL-config --version`
732
if [ $? -ne 0 ]; then
733
log_failure "libIDL-config not working"
736
log_success "found version $libidl_ver"
737
cnf_append "VBOX_LIBIDL_CONFIG" "`which_wrapper libIDL-config`"
744
# Check for openssl, needed for RDP and S3
748
if [ -z "$BUILD_LIBSSL" ]; then
750
cat > $ODIR.tmp_src.cc << EOF
752
#include <openssl/opensslv.h>
753
#include <openssl/ssl.h>
754
extern "C" int main(void)
756
printf("found version %s", OPENSSL_VERSION_TEXT);
758
#if OPENSSL_VERSION_NUMBER >= 0x00908000
762
printf(", expected version 0.9.8 or higher\n");
767
if test_compile "$INCCRYPTO $LIBCRYPTO" libcrypto openssl; then
768
if test_execute nofatal; then
769
cnf_append "SDK_VBOX_OPENSSL_INCS" "`strip_I "$INCCRYPTO"`"
770
cnf_append "SDK_VBOX_OPENSSL_LIBS" "`strip_l "$LIBCRYPTO"`"
771
cnf_append "SDK_VBOX_BLD_OPENSSL_LIBS" "`strip_l "$LIBCRYPTO"`"
779
# Check for pthread, needed by VBoxSVC, frontends, ...
784
cat > $ODIR.tmp_src.cc << EOF
787
extern "C" int main(void)
789
pthread_mutex_t mutex;
790
if (pthread_mutex_init(&mutex, NULL)) {
791
printf("pthread_mutex_init() failed\n");
794
if (pthread_mutex_lock(&mutex)) {
795
printf("pthread_mutex_lock() failed\n");
798
if (pthread_mutex_unlock(&mutex)) {
799
printf("pthread_mutex_unlock() failed\n");
802
printf("found, OK.\n");
805
if test_compile $LIBPTHREAD pthread pthread; then
806
if test_execute; then
807
cnf_append "LIB_PTHREAD" "`strip_l "$LIBPTHREAD"`"
814
# Check for zlib, needed by VBoxSVC, Runtime, ...
819
cat > $ODIR.tmp_src.cc << EOF
822
extern "C" int main(void)
824
printf("found version %s", ZLIB_VERSION);
825
#if ZLIB_VERNUM >= 0x1210
829
printf(", expected version 1.2.1 or higher\n");
834
[ -n "$INCZ" ] && I_INCZ=`prefix_I "$INCZ"`
835
if test_compile "$LIBZ $I_INCZ" zlib zlib; then
836
if test_execute; then
837
echo "if1of (\$(KBUILD_TARGET),darwin freebsd linux solaris)" >> $CNF
838
cnf_append " SDK_VBOX_ZLIB_LIBS" "`strip_l "$LIBZ"`"
839
cnf_append " SDK_VBOX_ZLIB_INCS" "$INCZ"
847
# Check for libpng, needed by kchmviewer
852
cat > $ODIR.tmp_src.cc << EOF
855
extern "C" int main(void)
857
printf("found version %s", PNG_LIBPNG_VER_STRING);
858
#if PNG_LIBPNG_VER >= 10205
862
printf(", expected version 1.2.5 or higher\n");
867
[ -n "$INCPNG" ] && I_INCPNG=`prefix_I "$INCPNG"`
868
if test_compile "$LIBPNG $I_INCPNG" libpng libpng; then
869
if test_execute; then
870
cnf_append "SDK_VBOX_LIBPNG_LIBS" "`strip_l "$LIBPNG"`"
871
cnf_append "SDK_VBOX_LIBPNG_INCS" "$INCPNG"
877
# Check for libvncserver, needed for VNC in OSE
881
test_header libvncserver
882
cat > $ODIR.tmp_src.cc <<EOF
884
#include <rfb/rfbconfig.h>
886
extern "C" int main()
888
const char* v=LIBVNCSERVER_VERSION;
889
unsigned int major = 0, minor = 0, micro = 0;
891
for (; *v !='.' && *v != '\0'; v++) major = major*10 + *v-'0';
893
for (; *v !='.' && *v != '\0'; v++) minor = minor*10 + *v-'0';
895
for (; *v !='.' && *v != '\0'; v++) micro = micro*10 + *v-'0';
897
printf("found version %s", LIBVNCSERVER_PACKAGE_VERSION);
898
if (major*10000 + minor*100 + micro >= 907)
905
printf(", expected version 0.9.7 or higher\n");
910
if test_compile "$LIBVNCSERVER $INCVNCSERVER" libvncserver libvncserver; then
911
if test_execute; then
912
cnf_append "VBOX_WITH_VNC" "1"
918
# Check for libcurl, needed by S3
922
if [ -z "$BUILD_LIBCURL" ]; then
924
cat > $ODIR.tmp_src.cc << EOF
926
#include <curl/curl.h>
927
extern "C" int main(void)
929
printf("found version %s", LIBCURL_VERSION);
930
#if 10000*LIBCURL_VERSION_MAJOR + 100*LIBCURL_VERSION_MINOR + LIBCURL_VERSION_PATCH >= 71601
934
printf(", expected version 7.16.1 or higher\n");
939
[ -n "$INCCURL" ] && I_INCCURL=`prefix_I "$INCCURL"`
940
if test_compile "$LIBCURL $I_INCCURL" libcurl libcurl; then
941
if test_execute; then
942
cnf_append "SDK_VBOX_LIBCURL_LIBS" "`strip_l "$LIBCURL"`"
943
cnf_append "SDK_VBOX_LIBCURL_INCS" "$INCCURL"
951
# Check for pam, needed by VRDPAuth
952
# Version 79 was introduced in 9/2005, do we support older versions?
953
# Debian/sarge uses 76
954
# OpenSUSE comes with 0.99.xxx where they changed the versioning scheme.
959
cat > $ODIR.tmp_src.cc << EOF
961
#include <security/pam_appl.h>
962
extern "C" int main(void)
964
printf("found version %d", __LIBPAM_VERSION);
965
if (__LIBPAM_VERSION >= 76)
972
printf(", expected version 76 or higher\n");
977
if test_compile "-lpam" pam pam nofatal; then
978
if test_execute nofatal; then
982
echo "pam0.x not found"
983
test_header linux_pam
984
cat > $ODIR.tmp_src.cc << EOF
986
#include <security/pam_appl.h>
987
extern "C" int main(void)
989
printf("found version %d.%d", __LINUX_PAM__, __LINUX_PAM_MINOR__);
990
if (__LINUX_PAM__ >= 1)
997
printf(", expected version 1.0 or higher\n");
1002
if test_compile "-lpam" pam pam; then
1009
# Check for the SDL library, needed by VBoxSDL and VirtualBox
1010
# We depend at least on version 1.2.7
1015
if [ "$OS" = "darwin" ]; then
1016
if [ -f "/System/Library/Frameworks/SDL.framework/SDL" ]; then
1017
PATH_SDK_LIBSDL="/System/Library/Frameworks/SDL.framework"
1018
elif [ -f "/Library/Frameworks/SDL.framework/SDL" ]; then
1019
PATH_SDK_LIBSDL="/Library/Frameworks/SDL.framework"
1021
if [ -n "$PATH_SDK_LIBSDL" ]; then
1023
INCSDL="$PATH_SDK_LIBSDL/Headers"
1024
FLDSDL="-framework SDL"
1026
log_failure "SDL framework not found"
1030
if which_wrapper sdl-config > /dev/null; then
1031
FLGSDL=`sdl-config --cflags`
1032
INCSDL=`strip_I "$FLGSDL"`
1033
LIBSDL=`sdl-config --libs`
1034
LIBSDLMAIN="-lSDLmain"
1039
[ "$OS" = "linux" -o "$OS" = "darwin" -o "$OS" = "solaris" ] && LIBSDLMAIN=""
1040
if [ -n "$foundsdl" ]; then
1041
cat > $ODIR.tmp_src.cc << EOF
1044
#include <SDL_main.h>
1046
extern "C" int main(int argc, char** argv)
1048
printf("found version %d.%d.%d",
1049
SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
1050
#if SDL_VERSION_ATLEAST(1,2,7)
1054
printf(", expected version 1.2.7 or higher\n");
1059
[ -n "$INCSDL" ] && I_INCSDL=`prefix_I "$INCSDL"`
1060
if test_compile "$LIBSDL $LIBSDLMAIN $I_INCSDL $FLDSDL" SDL SDL; then
1061
if test_execute; then
1062
cnf_append "LIB_SDK_LIBSDL_SDL" "`strip_l "$LIBSDL"`"
1063
cnf_append "SDK_LIBSDL_LIBPATH" "`strip_L "$LIBSDL"`"
1064
cnf_append "LIB_SDK_LIBSDL_SDLMAIN" "`strip_l "$LIBSDLMAIN"`"
1065
[ -n "$INCSDL" ] && cnf_append "SDK_LIBSDL_INCS" "$INCSDL"
1066
[ -n "$FLDSDL" ] && cnf_append "SDK_LIBSDL_LDFLAGS" "$FLDSDL"
1070
log_failure "SDL not found"
1077
# Check for the SDL_ttf library, needed by VBoxSDL (secure label)
1082
cat > $ODIR.tmp_src.cc << EOF
1084
#include <SDL_ttf.h>
1085
#ifndef SDL_TTF_MAJOR_VERSION
1086
#define SDL_TTF_MAJOR_VERSION TTF_MAJOR_VERSION
1087
#define SDL_TTF_MINOR_VERSION TTF_MINOR_VERSION
1088
#define SDL_TTF_PATCHLEVEL TTF_PATCHLEVEL
1090
extern "C" int main(void)
1092
printf("found version %d.%d.%d",
1093
SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL);
1094
#if 10000*SDL_TTF_MAJOR_VERSION + 100*SDL_TTF_MINOR_VERSION + SDL_TTF_PATCHLEVEL >= 20006
1098
printf(", expected version 2.0.6 or higher\n");
1103
if test_compile "-lSDL_ttf $I_INCSDL" SDL_ttf SDL_ttf nofatal; then
1104
if ! test_execute nofatal; then
1105
cnf_append "VBOX_WITH_SECURELABEL" ""
1108
echo "not found -- disabling VBoxSDL secure label."
1109
cnf_append "VBOX_WITH_SECURELABEL" ""
1115
# Check for libasound, needed by the ALSA audio backend
1120
cat > $ODIR.tmp_src.cc << EOF
1122
#include <alsa/asoundlib.h>
1123
extern "C" int main(void)
1125
printf("found version %d.%d.%d",
1126
SND_LIB_MAJOR, SND_LIB_MINOR, SND_LIB_SUBMINOR);
1127
#if 10000*SND_LIB_MAJOR + 100*SND_LIB_MINOR + SND_LIB_SUBMINOR >= 10006
1131
printf(", expected version 1.0.6 or higher\n");
1136
if test_compile "-lasound" asound asound; then
1143
# Check for PulseAudio
1147
test_header "PulseAudio"
1148
cat > $ODIR.tmp_src.cc << EOF
1150
#include <pulse/version.h>
1151
extern "C" int main(void)
1153
printf("found version %s API version %d", pa_get_headers_version(), PA_API_VERSION);
1154
#if PA_API_VERSION >= 9
1158
printf(", expected version 0.9.0 (API version 9) or higher\n");
1163
if test_compile "$INCPULSE $LIBPULSE -lpulse" pulse pulse; then
1170
# Check for the X libraries (Xext, X11)
1174
test_header "X libraries"
1175
cat > $ODIR.tmp_src.cc << EOF
1177
#include <X11/Xlib.h>
1178
extern "C" int main(void)
1185
dpy = XOpenDisplay(NULL);
1186
scrn_num = DefaultScreen(dpy);
1187
scrn = ScreenOfDisplay(dpy, scrn_num);
1188
win = XCreateWindow(dpy, RootWindowOfScreen(scrn), 0, 0, 100, 100,
1189
0, 16, InputOutput, CopyFromParent, 0, NULL);
1190
XDestroyWindow(dpy, win);
1194
[ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1195
if test_compile "$LIBX11 $I_INCX11" Xlibs Xlibs; then
1202
# Check for the Xcursor library, needed by VBoxSDL and VBoxBFE
1207
cat > $ODIR.tmp_src.cc << EOF
1209
#include <X11/Xlib.h>
1210
#include <X11/Xcursor/Xcursor.h>
1211
extern "C" int main(void)
1213
XcursorImage *cursor = XcursorImageCreate (10, 10);
1214
XcursorImageDestroy(cursor);
1218
[ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1219
if test_compile "$LIBX11 $LIBXCURSOR $I_INCX11" Xcursor Xcursor; then
1221
cnf_append "VBOX_XCURSOR_LIBS" "`strip_l "$LIBXCURSOR"`"
1227
# Check for the Xinerama library, needed by the Qt GUI
1231
test_header Xinerama
1232
cat > $ODIR.tmp_src.cc << EOF
1233
#include <X11/Xlib.h>
1234
#include <X11/extensions/Xinerama.h>
1235
extern "C" int main(void)
1239
dpy = XOpenDisplay(NULL);
1242
flag = XineramaIsActive(dpy);
1247
[ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1248
if test_compile "$LIBX11 $LIBXINERAMA $I_INCX11" Xinerama Xinerama; then
1255
# Check for the Xinerama library, needed by the Qt GUI
1260
cat > $ODIR.tmp_src.cc << EOF
1261
#include <X11/Xlib.h>
1262
#include <X11/extensions/Xrandr.h>
1263
extern "C" int main(void)
1268
dpy = XOpenDisplay(NULL);
1271
flag = XRRQueryVersion(dpy, &major, &minor);
1276
[ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1277
if test_compile "$LIBX11 $LIBXRANDR $I_INCX11" Xrandr Xrandr; then
1288
# On darwin this is a on/off decision only
1289
if [ "$OS" = "darwin" ]; then
1290
test_header "OpenGL support"
1292
cnf_append "VBOX_WITH_CROGL" "1"
1301
# Check for the Xmu library, needed by OpenGL
1306
cat > $ODIR.tmp_src.cc << EOF
1308
#include <X11/Xatom.h>
1309
#include <X11/Xlib.h>
1310
#include <X11/Xutil.h>
1311
#include <X11/Xmu/StdCmap.h>
1312
extern "C" int main(void)
1318
dpy = XOpenDisplay(NULL);
1321
scrn_num = DefaultScreen(dpy);
1322
scrn = ScreenOfDisplay(dpy, scrn_num);
1323
Status status = XmuLookupStandardColormap(dpy, RootWindowOfScreen(scrn), 0,
1324
24, XA_RGB_DEFAULT_MAP, False, True);
1325
printf("Status = %x\n", status);
1331
[ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1332
if test_compile "$LIBX11 $LIBXMU $I_INCX11" Xmu Xmu; then
1334
cnf_append "VBOX_XMU_LIBS" "`strip_l "$LIBXMU"`"
1339
# Check for Mesa, needed by OpenGL
1343
test_header "Mesa / GLU"
1344
cat > $ODIR.tmp_src.cc << EOF
1346
#include <X11/Xlib.h>
1349
extern "C" int main(void)
1354
dpy = XOpenDisplay(NULL);
1357
Bool glx_version = glXQueryVersion(dpy, &major, &minor);
1361
printf("found version %u.%u, OK.\n", major, minor);
1365
printf("found (inactive), OK.\n");
1369
[ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1370
if test_compile "$LIBX11 $MESA $I_INCX11" Mesa Mesa; then
1371
[ $PASSIVE_MESA -eq 1 ] && unset DISPLAY
1378
# Check for the Qt4 library, needed by the VirtualBox frontend
1380
# Currently not fatal.
1386
if [ "$OS" = "darwin" ]; then
1387
# First check if there is the internal version of Qt. If yes nothing else
1389
QT_INTERNAL=`/bin/ls -rd1 $PWD/tools/$BUILD_TARGET.$BUILD_PLATFORM_ARCH/qt/* 2> /dev/null`
1390
for t in $QT_INTERNAL; do
1391
if [ -f "$t/Frameworks/QtCoreVBox.framework/QtCoreVBox" ]; then
1392
cnf_append "VBOX_WITH_QT4_SUN" "1"
1393
log_success "use internal version"
1397
# Now try the user provided directory and some of the standard directories.
1398
QT_TRIES="$QT4DIR /System/Library /Library"
1399
for t in $QT_TRIES; do
1400
if [ -f "$t/Frameworks/QtCore.framework/QtCore" ]; then
1405
# Add the necessary params for building the test application
1406
if [ -n "$PATH_SDK_QT4" ]; then
1408
INCQT4=-I$PATH_SDK_QT4/Frameworks/QtCore.framework/Headers
1409
LIBQT4=-F$PATH_SDK_QT4/Frameworks
1410
FLGQT4="-framework QtCore"
1412
log_failure "Qt4 framework not found (can be disabled using --disable-qt4)"
1416
if [ $QT4DIR_PKGCONFIG -eq 1 ]; then
1417
# default is to use pkg-config
1418
if which_wrapper pkg-config > /dev/null; then
1419
# this braindead path is necessary for mdv2008.1
1421
PKG_CONFIG_PATH=/usr/lib/qt4/lib/pkgconfig \
1422
pkg-config QtCore --modversion 2>> $LOG`
1423
if [ $? -ne 0 ]; then
1424
log_failure "QtCore not found"
1428
PKG_CONFIG_PATH=/usr/lib/qt4/lib/pkgconfig \
1429
pkg-config QtCore --cflags`
1430
INCQT4=`strip_I "$FLGQT4"`
1432
PKG_CONFIG_PATH=/usr/lib/qt4/lib/pkgconfig \
1433
PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \
1434
pkg-config QtCore --libs`
1438
log_failure "pkg-config not found"
1442
# do it the old way (e.g. user has specified QT4DIR)
1443
cat > $ODIR.tmp_src.cc << EOF
1446
extern "C" int main(void)
1448
printf("found version %s", QT_VERSION_STR);
1449
#if QT_VERSION >= 0x040400
1453
printf(", expected version 4.4.0 or higher\n");
1458
for q in $QT4DIR; do
1459
INCQT4="$q/include $q/include/QtCore"
1460
FLGQT4="-DQT_SHARED"
1461
I_INCQT4=`prefix_I "$INCQT4"`
1462
LIBQT4="-L$q/lib -lQtCoreVBox"
1463
if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
1467
LIBQT4="-L$q/lib -lQtCore"
1468
if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
1475
if [ -n "$foundqt4" ]; then
1476
cat > $ODIR.tmp_src.cc << EOF
1479
extern "C" int main(void)
1481
printf("found version %s", QT_VERSION_STR);
1482
#if QT_VERSION >= 0x040400
1486
printf(", expected version 4.4.0 or higher\n");
1491
[ -n "$INCQT4" ] && I_INCQT4=`prefix_I "$INCQT4"`
1492
if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
1493
if test_execute_path "`strip_L "$LIBQT4"`"; then
1494
if [ "$OS" = "darwin" ]; then
1495
# Successful build & run the test application so add the necessary
1496
# params to AutoConfig.kmk
1497
cnf_append "PATH_SDK_QT4_INC" "$PATH_SDK_QT4/Frameworks"
1498
cnf_append "PATH_SDK_QT4_LIB" "$PATH_SDK_QT4/Frameworks"
1499
cnf_append "PATH_SDK_QT4" "$PATH_SDK_QT4/Frameworks"
1500
# Check for the moc tool in the Qt directory found & some standard
1502
for q in $PATH_SDK_QT4 /usr /Developer/Tools/Qt; do
1503
if which_wrapper "$q/bin/moc" > /dev/null; then
1504
cnf_append "PATH_TOOL_QT4" "$q"
1505
cnf_append "PATH_TOOL_QT4_BIN" "$q/bin"
1509
# strip .../QtCore as we add components ourself
1510
INCQT4=`echo "$INCQT4"|$KBUILD_SED 's|\([^ ]*\)/QtCore|\1|g; s| $||g'`
1511
# store only the first path, remove all other pathes
1512
# most likely pkg-config gave us -I/usr/include/qt4 -I/usr/include/qt4/QtCore
1513
INCQT4=`echo "$INCQT4"|$KBUILD_SED 's|\([^ ]*\) .*|\1|'`
1514
cnf_append "VBOX_PATH_QT4_LIB" "`strip_L "$LIBQT4"`"
1515
cnf_append "SDK_QT4_LIBPATH" "`strip_L "$LIBQT4"`"
1516
cnf_append "PATH_SDK_QT4_INC" "$INCQT4"
1517
# this is not quite right since the qt libpath does not have to be first...
1518
cnf_append "PATH_SDK_QT4_LIB" '$'"(firstword `strip_L "$LIBQT4"`)"
1519
if [ "$foundqt4" = "2" ]; then
1520
cnf_append "VBOX_WITH_QT4_SUN" "1"
1522
test_header "Qt4 devtools"
1523
for q in $QT4DIR; do
1524
# first try it with a suffix, some platforms use that
1525
if which_wrapper "$q/bin/moc-qt4" > /dev/null; then
1526
moc_ver=`$q/bin/moc-qt4 -v 2>&1|sed 's+^.*(Qt \(.*\))+\1+'`
1527
if [ $? -ne 0 ]; then
1528
log_failure "moc-qt4 not working"
1531
log_success "found version $moc_ver"
1532
cnf_append "VBOX_PATH_QT4" "$q"
1533
cnf_append "PATH_SDK_QT4" "$q"
1534
cnf_append "PATH_TOOL_QT4" "$q"
1535
cnf_append "PATH_TOOL_QT4_BIN" "$q/bin"
1536
cnf_append "TOOL_QT4_BIN_SUFF" "-qt4"
1539
elif which_wrapper "$q/bin/moc" > /dev/null; then
1540
moc_ver=`$q/bin/moc -v 2>&1|sed 's+^.*(Qt \(.*\))+\1+'`
1541
if [ $? -ne 0 ]; then
1542
log_failure "moc not working"
1545
log_success "found version $moc_ver"
1546
cnf_append "VBOX_PATH_QT4" "$q"
1547
cnf_append "PATH_SDK_QT4" "$q"
1548
cnf_append "PATH_TOOL_QT4" "$q"
1549
cnf_append "PATH_TOOL_QT4_BIN" "$q/bin"
1557
log_failure "qt4 not working"
1561
log_failure "qt4 not found"
1568
# Check whether static libstdc++ is installed. This library is required
1569
# for the Linux guest additions.
1571
check_staticlibstdcxx()
1573
test_header "static stc++ library"
1574
libstdcxx=`$CXX -print-file-name=libstdc++.a`
1575
cat > $ODIR.tmp_src.cc << EOF
1578
extern "C" int main(void)
1580
std::string s = "test";
1584
if test_compile "$libstdcxx" libstdc++ libstdc++; then
1591
# Check for Linux sources
1595
test_header "Linux kernel sources"
1596
cat > $ODIR.tmp_src.c << EOF
1597
#include <linux/version.h>
1598
int printf(const char *format, ...);
1601
printf("found version %d.%d.%d", LINUX_VERSION_CODE / 65536,
1602
(LINUX_VERSION_CODE % 65536) / 256,
1603
LINUX_VERSION_CODE % 256);
1604
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,0)
1608
printf(", expected version 2.4.0 or higher\n");
1613
echo "compiling the following source file:" >> $LOG
1614
cat $ODIR.tmp_src.c >> $LOG
1615
echo "using the following command line:" >> $LOG
1616
echo "$CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include" >> $LOG
1617
$CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include >> $LOG 2>&1
1618
if [ $? -ne 0 ]; then
1620
echo " Linux kernel headers not found at $LINUX"
1621
echo " Check the file $LOG for detailed error information."
1624
if test_execute; then
1625
cnf_append "VBOX_LINUX_SRC" "`cd $LINUX ; pwd`"
1632
# Check for kchmviewer, needed to display the online help
1633
# (unused as we ship kchmviewer)
1637
test_header kchmviewer
1638
if check_avail "$KCHMVIEWER" KCHMVIEWER; then
1639
kchmviewer_ver=`$KCHMVIEWER --version|grep "^KchmViewer:"|sed 's+^KchmViewer: \(.*\)+\1+'`
1640
if [ $? -ne 0 ]; then
1641
log_failure "kchmviewer not working"
1644
log_success "found version $kchmviewer_ver"
1651
# Check for the kBuild tools, we don't support GNU make
1656
if which_wrapper "$KBUILDDIR/bin/$OS.$BUILD_MACHINE/kmk" > /dev/null; then
1657
KBUILDDIR_BIN="$KBUILDDIR/bin/$OS.$BUILD_MACHINE"
1658
echo "PATH_KBUILD=\"`cd $KBUILDDIR ; pwd`\"" >> $ENV
1659
echo "export PATH_KBUILD" >> $ENV
1660
echo "PATH_DEVTOOLS=\"$DEVDIR\"" >> $ENV
1661
echo "export PATH_DEVTOOLS" >> $ENV
1662
echo "path_kbuild_bin=\"\$PATH_KBUILD/bin/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"" >> $ENV
1663
echo "export PATH_KBUILD_BIN" >> $ENV
1664
echo "path_dev_bin=\"\$PATH_DEVTOOLS/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"/bin" >> $ENV
1665
if [ "$OS" = "solaris" ]; then
1666
# Because of sh being non-default shell in Solaris we need to export PATH again when
1667
# sourcing env.sh. Simply exporting from ./configure does not export PATH correctly.
1668
echo "PATH=\"$ORGPATH\"" >> $ENV
1669
echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
1670
echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
1672
echo "echo \"\$PATH\" | grep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
1673
echo "echo \"\$PATH\" | grep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
1675
echo "export PATH" >> $ENV
1676
echo "unset path_kbuild_bin path_dev_bin" >> $ENV
1677
KBUILD_SED="$KBUILDDIR_BIN/kmk_sed"
1678
elif [ "$OS.$BUILD_MACHINE" = "darwin.amd64" ]; then
1679
# Currently there are no amd64 kBuild bins. So use the x86 variant in any case.
1680
KBUILDDIR_BIN="$KBUILDDIR/bin/$OS.x86"
1681
echo "PATH_KBUILD=\"`cd $KBUILDDIR ; pwd`\"" >> $ENV
1682
echo "export PATH_KBUILD" >> $ENV
1683
echo "PATH_DEVTOOLS=\"$DEVDIR\"" >> $ENV
1684
echo "export PATH_DEVTOOLS" >> $ENV
1685
echo "path_kbuild_bin=\"\$PATH_KBUILD/bin/\$BUILD_TARGET.x86\"" >> $ENV
1686
echo "PATH_KBUILD_BIN=\"\$path_kbuild_bin\"" >> $ENV
1687
echo "export PATH_KBUILD_BIN" >> $ENV
1688
echo "path_dev_bin=\"\$PATH_DEVTOOLS/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"/bin" >> $ENV
1689
echo "echo \"\$PATH\" | grep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
1690
echo "echo \"\$PATH\" | grep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
1691
echo "export PATH" >> $ENV
1692
echo "unset path_kbuild_bin path_dev_bin" >> $ENV
1693
KBUILD_SED="$KBUILDDIR_BIN/kmk_sed"
1694
elif check_avail "kmk" KBUILDDIR really; then
1695
# check for installed kBuild
1696
KBUILD_SED="`which_wrapper kmk_sed`"
1705
# Check for compiler.h
1706
# Some Linux distributions include "compiler.h" in their libc linux
1707
# headers package, some don't. Most don't need it, building might (!)
1708
# not succeed on openSUSE without it.
1710
# See http://www.mail-archive.com/qemu-devel%40nongnu.org/msg07980.html
1714
test_header compiler.h
1715
if ! test -f "/usr/include/linux/compiler.h"; then
1716
log_success "compiler.h not found"
1718
cnf_append "VBOX_WITH_LINUX_COMPILER_H" "1"
1719
log_success "compiler.h found"
1725
# Required to pass CAP_NET_RAW to our binaries to allow to open SOCK_RAW
1726
# sockets for doing ICMP requests.
1730
test_header "libcap library"
1731
cat > $ODIR.tmp_src.cc << EOF
1733
#include <sys/types.h>
1734
#include <sys/capability.h>
1736
extern "C" int main(void)
1739
cap_t caps = cap_get_proc();
1740
snprintf(buf, sizeof(buf), "Current caps are '%s'\n", cap_to_text(caps, NULL));
1744
if test_compile $LIBCAP libcap libcap; then
1745
if test_execute; then
1752
# Check if we are able to build 32-bit applications (needed for the guest additions)
1756
test_header "32-bit support"
1757
cat > $ODIR.tmp_src.c << EOF
1764
echo "compiling the following source file:" >> $LOG
1765
cat $ODIR.tmp_src.c >> $LOG
1766
echo "using the following command line:" >> $LOG
1767
echo "$CC -m32 -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c" >> $LOG
1768
$CC -m32 -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c >> $LOG 2>&1
1769
if [ $? -ne 0 ]; then
1771
echo " Cannot compile 32-bit applications (missing headers and/or libraries)!"
1772
echo " Check the file $LOG for detailed error information."
1775
echo "executing the binary" >> $LOG
1776
$ODIR.tmp_out 2> $ODIR.test_execute.log
1778
cat $ODIR.test_execute.log >> $LOG
1779
if [ $rc -ne 0 ]; then
1781
echo " Cannot execute 32-bit applications! Either enable 32-bit support in the"
1782
echo " kernel configuration or use --disable-vmmraw to disable 32-bit guests."
1796
test_header "Python support"
1798
# On darwin this is a on/off decision only
1799
if [ "$OS" = "darwin" ]; then
1801
cnf_append "VBOX_WITH_PYTHON" "1"
1805
cat > $ODIR.tmp_src.cc << EOF
1808
extern "C" int main(void)
1811
printf("found version %s", PY_VERSION);
1812
#if PY_VERSION_HEX >= 0x02030000
1816
printf(", expected version 2.3 or higher\n");
1822
# For Solaris we use libpython2.4 for compatibility with Solaris 10 and passing IPS pkg audit
1823
if [ "$OS" != "solaris" ]; then
1824
SUPPYTHONLIBS="python2.7 python2.6 python2.5 python2.4 python2.3"
1826
SUPPYTHONLIBS="python2.4"
1828
for p in $PYTHONDIR; do
1829
for d in $SUPPYTHONLIBS; do
1830
for b in lib64 lib/64 lib; do
1831
echo "compiling the following source file:" >> $LOG
1832
cat $ODIR.tmp_src.cc >> $LOG
1833
echo "using the following command line:" >> $LOG
1834
echo "$CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so" >> $LOG
1835
$CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so >> $LOG 2>&1
1836
if [ $? -eq 0 ]; then
1841
if [ -n "$found" ]; then break; fi
1843
if [ -n "$found" ]; then break; fi
1845
if [ -n "$found" ]; then
1846
if test_execute; then
1847
cnf_append "VBOX_WITH_PYTHON" "1"
1848
cnf_append "VBOX_PATH_PYTHON_INC" "$p/include/$d"
1849
cnf_append "VBOX_LIB_PYTHON" "$p/$b/lib$d.so"
1851
log_failure "Python not working"
1855
log_failure "Python not found"
1866
test_header "Java support"
1876
test_header "Wine support"
1877
if ! which_wrapper wine > /dev/null; then
1878
echo " wine binary not found"
1881
if ! which_wrapper wine > /dev/null; then
1882
echo " wine not found"
1885
wine_version="`wine --version`"
1886
case "`expr "$wine_version" : 'wine-\([0-9.]*\)' '>' 1.1.43`" in
1888
if ! which_wrapper wineprefixcreate > /dev/null; then
1889
echo " wineprefixcreate not found"
1893
*) eval "wineprefixcreate() { true ; }" ;; # now created automatically
1895
export WINEPREFIX="${ODIR}wine.$BUILD_MACHINE"
1896
echo "WINEPREFIX=\"${ODIR}wine.$BUILD_MACHINE\"" >> $ENV
1897
echo "export WINEPREFIX" >> $ENV
1899
mkdir -p $WINEPREFIX
1900
touch $WINEPREFIX/.no_prelaunch_window_flag
1901
if ! wineprefixcreate -q > /dev/null 2>&1; then
1902
echo " wineprefixcreate failed"
1907
echo 'REGEDIT4' > $tmp
1909
echo '[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment]' >> $tmp
1910
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
1912
echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhc.exe\DllOverrides]' >> $tmp
1913
echo '"itss"="native"' >> $tmp
1915
echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhw.exe\DllOverrides]' >> $tmp
1916
echo '"itss"="native"' >> $tmp
1918
if ! wine regedit $tmp > /dev/null 2>&1; then
1920
echo " failed to load registry changes (path)."
1933
test_header "GSOAP compiler"
1934
if [ -z "$GSOAP" ]; then
1937
if which_wrapper "$GSOAP/bin/soapcpp2" > /dev/null; then
1938
if which_wrapper "$GSOAP/bin/wsdl2h" > /dev/null; then
1939
if [ -f "$GSOAP/include/stdsoap2.h" ]; then
1940
# TODO: Check for libgsoap++.a/so
1942
if [ -z "$GSOAP_IMPORT" ]; then
1943
GSOAP_IMPORT="$GSOAP/share/gsoap/import"
1944
if [ ! -d "$GSOAP_IMPORT" -a -d "$GSOAP/include/gsoap" ]; then
1945
GSOAP_IMPORT="$GSOAP/include/gsoap"
1948
if [ -f "$GSOAP_IMPORT/stlvector.h" ]; then
1949
cnf_append "VBOX_GSOAP_INSTALLED" "1"
1950
cnf_append "VBOX_PATH_GSOAP" "$GSOAP"
1951
cnf_append "VBOX_PATH_GSOAP_IMPORT" "$GSOAP_IMPORT"
1952
if [ -f "$GSOAP/share/gsoap/stdsoap2.cpp" ]; then
1953
cnf_append "VBOX_GSOAP_CXX_SOURCES" "$GSOAP/share/gsoap/stdsoap2.cpp"
1955
cnf_append "VBOX_GSOAP_CXX_SOURCES" ""
1957
cnf_append "VBOX_GSOAP_CXX_LIBS" "libgsoap++"
1960
log_failure "stlvector.h not found -- disabling webservice"
1961
cnf_append "VBOX_WITH_WEBSERVICES" ""
1964
log_failure "stdsoap2.h not found -- disabling webservice"
1965
cnf_append "VBOX_WITH_WEBSERVICES" ""
1968
log_failure "wsdl2h not found -- disabling webservice"
1969
cnf_append "VBOX_WITH_WEBSERVICES" ""
1972
log_failure "soapcpp2 not found -- disabling webservice"
1973
cnf_append "VBOX_WITH_WEBSERVICES" ""
1979
# Determines the Darwin version.
1980
# @todo This should really check the Xcode/SDK version.
1982
check_darwinversion()
1984
test_header "Darwin version"
1985
darwin_ver=`uname -r`
1986
case "$darwin_ver" in
1988
darwin_ver="10.7" # Lion
1989
sdk=/Developer/SDKs/MacOSX10.6.sdk
1990
CXX_FLAGS="-mmacosx-version-min=10.6 -isysroot $sdk -Wl,-syslibroot,$sdk"
1993
darwin_ver="10.6" # Snow Leopard
1994
if [ "$BUILD_MACHINE" = "x86" ]; then
1995
sdk=/Developer/SDKs/MacOSX10.5.sdk
1996
CXX_FLAGS="-mmacosx-version-min=10.5 -isysroot $sdk -Wl,-syslibroot,$sdk"
1997
cnf_append "VBOX_MACOS_10_5_WORKAROUND" "1"
1999
sdk=/Developer/SDKs/MacOSX10.6.sdk
2000
CXX_FLAGS="-mmacosx-version-min=10.6 -isysroot $sdk -Wl,-syslibroot,$sdk"
2002
# test "$CC" = "gcc" && CC="gcc-4.0"
2003
# test "$CXX" = "g++" && CXX="g++-4.0"
2004
cnf_append "VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_7" "1"
2007
darwin_ver="10.5" # Leopard
2008
sdk=/Developer/SDKs/MacOSX10.5.sdk
2009
CXX_FLAGS="-mmacosx-version-min=10.5 -isysroot $sdk -Wl,-syslibroot,$sdk"
2010
# test "$CC" = "gcc" && CC="gcc-4.0"
2011
# test "$CXX" = "g++" && CXX="g++-4.0"
2012
cnf_append "VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6" "1"
2013
cnf_append "VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_7" "1"
2016
darwin_ver="10.4" # Tiger
2017
sdk=/Developer/SDKs/MacOSX10.4u.sdk
2018
CXX_FLAGS="-mmacosx-version-min=10.4 -isysroot $sdk -Wl,-syslibroot,$sdk"
2019
# test "$CC" = "gcc" && CC="gcc-4.0"
2020
# test "$CXX" = "g++" && CXX="g++-4.0"
2021
cnf_append "VBOX_WITH_COCOA_QT" ""
2022
cnf_append "VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6" "1"
2023
cnf_append "VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_7" "1"
2026
echo " failed to determine Darwin version. (uname -r: $darwin_ver)"
2028
darwin_ver="unknown"
2031
log_success "found version $darwin_ver (SDK: $sdk)"
2037
test_header "makeself"
2038
if check_avail "$MAKESELF" makeself; then
2039
makeself_ver=`$MAKESELF --version|grep version|sed 's+^Makeself.*version \([0-9\.]*\).*+\1+'`
2040
if [ $? -ne 0 ]; then
2041
log_failure "makeself not working"
2044
log_success "found version $makeself_ver"
2045
cnf_append "VBOX_MAKESELF" "`which_wrapper $MAKESELF`"
2052
# Checks that i386-elf-gcc-3.4.6, i386-elf-gcc-3.4.3, i386-elf-gcc-3.4 or i386-elf-gcc
2053
# is around to prevent confusion when the build fails in src/recompiler.
2054
# Note. Keep the which order in sync with the $(which ) in src/recompiler/Makefile.kmk.
2058
test_header "i386-elf-gcc"
2059
i386_elf_gcc=`which_wrapper i386-elf-gcc-3.4.6`
2060
test -z "$i386_elf_gcc" && i386_elf_gcc=`which_wrapper i386-elf-gcc-3.4.3`
2061
test -z "$i386_elf_gcc" && i386_elf_gcc=`which_wrapper i386-elf-gcc-3.4`
2062
test -z "$i386_elf_gcc" && i386_elf_gcc=`which_wrapper i386-elf-gcc`
2063
if test -z "$i386_elf_gcc"; then
2064
echo " failed to find i386-elf-gcc"
2067
log_success "found $i386_elf_gcc"
2077
Usage: ./configure [OPTIONS]...
2080
-h, --help display this help and exit
2081
--nofatal don't abort on errors
2083
[ $WITH_XPCOM -eq 1 ] && echo " --disable-xpcom disable XPCOM and related stuff"
2084
[ $WITH_PYTHON -eq 1 ] && echo " --disable-python disable python bindings"
2085
[ $WITH_JAVA -eq 1 ] && echo " --disable-java disable java bindings"
2086
[ $WITH_VMMRAW -eq 1 ] && echo " --disable-vmmraw disable VMM raw mode (VT-x/AMD-V mandatory!)"
2087
[ $WITH_SDL_TTF -eq 1 ] && echo " --disable-sdl-ttf disable SDL_ttf detection"
2088
[ $WITH_ALSA -eq 1 ] && echo " --disable-alsa disable the ALSA sound backend"
2089
[ $WITH_PULSE -eq 1 ] && echo " --disable-pulse disable the PulseAudio backend"
2090
[ $WITH_DBUS -eq 1 ] && echo " --disable-dbus don't use DBus and hal for hardware detection"
2091
[ $WITH_KMODS -eq 1 ] && echo " --disable-kmods don't build Linux kernel modules (host and guest)"
2092
[ $WITH_OPENGL -eq 1 ] && echo " --disable-opengl disable OpenGL support (2D & 3D)"
2093
[ $WITH_GSOAP -eq 0 ] && echo " --enable-webservice enable the webservice stuff"
2094
[ $OSE -eq 1 ] && echo " --enable-vnc enable the VNC server"
2095
[ $OSE -eq 0 ] && echo " --disable-extpack don't build the extpack"
2096
[ $WITH_DOCS -eq 1 ] && echo " --disable-docs don't build the documentation"
2097
[ "$OS" = "linux" -o "$OS" = "freebsd" ] && echo " --enable-vde enable VDE networking"
2099
--disable-udptunnel disable UDP tunnel networking
2100
--disable-hardening don't be strict about /dev/vboxdrv access
2101
--build-libxml2 build libxml2 from sources
2103
[ $OSE -eq 0 ] && cat << EOF
2104
--build-libssl build openssl from sources
2105
--build-libcurl build libcurl from sources
2107
[ "$OS" != "darwin" ] && echo " --setup-wine setup a Wine directory and register the hhc hack"
2111
--with-gcc=PATH location of the gcc compiler [$CC]
2112
--with-g++=PATH location of the g++ compiler [$CXX]
2113
--with-kbuild=DIR kbuild directory [$KBUILDDIR]
2114
--with-iasl=PATH location of the iasl compiler [$IASL]
2115
--with-mkisofs=PATH location of mkisofs [$MKISOFS]
2116
--with-makeself=PATH location of makeself [$MAKESELF]
2118
[ "$OS" = "linux" ] && echo " --with-linux=DIR Linux kernel source directory [$LINUX]"
2119
[ $WITH_QT4 -eq 1 ] && echo " --with-qt-dir=DIR directory for Qt4 headers/libraries [pkgconfig]"
2120
[ $WITH_GSOAP -eq 1 ] && echo " --with-gsoap-dir=PATH directory for gSOAP compiler/headers/libraries"
2121
[ $WITH_GSOAP -eq 1 ] && echo " (soapcpp2 and wsdl2h, soapstd2.h, libgsoap++.a/so)"
2122
[ $WITH_GSOAP -eq 1 ] && echo " --with-gsoap-import=PATH directory for gSOAP import files (stlvector.h)"
2124
--with-openssl-dir=DIR directory for OpenSSL headers/libraries
2125
--out-path=PATH the folder to which configuration and build output
2129
-d, --build-debug build with debugging symbols and assertions
2130
--build-profile build with profiling support
2131
--build-headless build headless (without any GUI frontend)
2141
# test if we are OSE
2142
if [ $OSE -eq 1 -a -r "`cd \`dirname $0\`; pwd`/src/VBox/RDP/server/server.cpp" ]; then
2144
# Set this as a reminder to print a log message once we know the path of the
2149
# Change OS specific defaults; must be before all other stuff
2150
if [ "$OS" = "darwin" ]; then
2159
[ $OSE -eq 1 ] || BUILD_LIBCURL=1
2162
# scan command line options
2163
for option in $*; do
2175
CC=`echo $option | cut -d'=' -f2`
2178
CXX=`echo $option | cut -d'=' -f2`
2181
KBUILDDIR=`echo $option | cut -d'=' -f2`
2182
if echo $KBUILDDIR|grep -q "$INVALID_CHARS"; then
2183
echo "Error: KBUILDDIR contains invalid characters!"
2187
--with-qt-dir=*|--with-qt4-dir=*)
2188
QT4DIR=`echo $option | cut -d'=' -f2`
2191
--with-openssl-dir=*)
2192
OPENSSLDIR=`echo $option | cut -d'=' -f2`
2193
INCCRYPTO="-I${OPENSSLDIR}/include"
2194
LIBCRYPTO="${OPENSSLDIR}/lib/libcrypto.a ${OPENSSLDIR}/lib/libssl.a"
2197
GSOAP=`echo $option | cut -d'=' -f2`
2199
--with-gsoap-import=*)
2200
GSOAP_IMPORT=`echo $option | cut -d'=' -f2`
2203
IASL=`echo $option | cut -d'=' -f2`
2206
LINUX=`echo $option | cut -d'=' -f2`
2209
MKISOFS=`echo $option | cut -d'=' -f2`
2212
MAKESELF=`echo $option | cut -d'=' -f2`
2215
TARGET_MACHINE=`echo $option | cut -d'=' -f2`
2218
[ $WITH_XPCOM -eq 1 ] && WITH_XPCOM=0
2221
[ $WITH_PYTHON -eq 1 ] && WITH_PYTHON=0
2224
[ $WITH_JAVA -eq 1 ] && WITH_JAVA=0
2227
[ $WITH_VMMRAW -eq 1 ] && WITH_VMMRAW=0
2230
[ $WITH_SDL_TTF -eq 1 ] && WITH_SDL_TTF=0
2233
[ $WITH_QT4 -eq 1 ] && WITH_QT4=0
2236
[ $WITH_QT4 -eq 1 ] && WITH_QT4=0
2242
[ $WITH_ALSA -eq 1 ] && WITH_ALSA=0
2245
[ $WITH_PULSE -eq 1 ] && WITH_PULSE=0
2251
[ $WITH_DBUS -eq 1 ] && WITH_DBUS=0
2254
[ $WITH_KMODS -eq 1 ] && WITH_KMODS=0
2257
[ $WITH_OPENGL -eq 1 ] && WITH_OPENGL=0
2259
--enable-webservice)
2260
[ $WITH_GSOAP -eq 0 ] && WITH_GSOAP=1
2265
--disable-hardening)
2277
--disable-udptunnel)
2310
ODIR="`echo $option | cut -d'=' -f2`/"
2314
out_path="`echo $option | cut -d'=' -f2`/"
2315
if [ -d $out_path ]; then
2321
if [ $ODIR_OVERRIDE -eq 0 ]; then
2322
# This variable has not *yet* been overridden. That can still happen.
2326
echo "Error: invalid folder \"$out_path\" in option \"$option\""
2331
[ "$OS" != "darwin" ] && SETUP_WINE=1
2335
echo "Unrecognized option \"$option\""
2346
# initialize output files
2348
# Log file generated by
2357
# automatically generated by
2361
# It will be completely overwritten if configure is executed again.
2368
# automatically generated by
2372
# It will be completely overwritten if configure is executed again.
2373
# Make sure you source this file once before you start to build VBox.
2378
# Print log warning about OSE if necessary
2379
if [ -n "$NOT_OSE" ]; then
2380
echo "Found RDP server, assuming VBOX_OSE = FALSE" >> $LOG
2385
if [ "$BUILD_TYPE" = "debug" ]; then
2386
echo "Creating DEBUG build!" >> $LOG
2387
elif [ "$BUILD_TYPE" = "profile" ]; then
2388
echo "Creating PROFILE build!" >> $LOG
2391
# first determine our environment
2395
[ -n "$ENV_ONLY" ] && exit 0
2397
# append the tools directory to the default search path
2398
echo "$PATH" | grep -q "$DEVDIR_BIN" || PATH="$PATH:$DEVDIR_BIN"
2401
# if we will be writing to a different out directory then set this up now
2402
if [ $OUT_PATH_OVERRIDE -eq 1 ]; then
2403
echo "AUTOCFG=$OUT_PATH/AutoConfig.kmk" >> $ENV
2404
echo "export AUTOCFG" >> $ENV
2405
echo "LOCALCFG=$OUT_PATH/LocalConfig.kmk" >> $ENV
2406
echo "export LOCALCFG" >> $ENV
2407
echo "PATH_OUT_BASE=$OUT_PATH" >> $ENV
2408
echo "export PATH_OUT_BASE" >> $ENV
2411
# some things are not available in for OSE
2412
if [ $OSE -ge 1 ]; then
2413
cnf_append "VBOX_OSE" "1"
2414
cnf_append "VBOX_WITH_TESTSUITE" ""
2415
cnf_append "VBOX_WITH_WIN32_ADDITIONS" ""
2417
if [ "$OS" = "linux" ]; then
2418
cnf_append "VBOX_WITH_LINUX_ADDITIONS" "1"
2420
cnf_append "VBOX_WITH_LINUX_ADDITIONS" ""
2426
if [ $OSE -eq 0 ]; then
2427
if [ $WITH_EXTPACK -eq 1 ]; then
2430
cnf_append "VBOX_WITH_EXTPACK_PUEL_BUILD" ""
2435
if [ -n "$HEADLESS" ]; then
2436
cnf_append "VBOX_HEADLESS" "1"
2439
# emit disable directives corresponding to any --disable-xxx options.
2440
if [ $WITH_OPENGL -eq 0 ]; then
2441
cnf_append "VBOX_WITH_CROGL" ""
2442
cnf_append "VBOX_WITH_VIDEOHWACCEL" ""
2443
cnf_append "VBOX_GUI_USE_QGL" ""
2445
[ $WITH_XPCOM -eq 0 ] && cnf_append "VBOX_WITH_MAIN" ""
2446
[ $WITH_QT4 -eq 0 ] && cnf_append "VBOX_WITH_QTGUI" ""
2447
[ $WITH_SDL_TTF -eq 0 ] && cnf_append "VBOX_WITH_SECURELABEL" ""
2448
[ $WITH_PYTHON -eq 0 ] && cnf_append "VBOX_WITH_PYTHON" ""
2449
[ $WITH_JAVA -eq 0 ] && cnf_append "VBOX_WITH_JXPCOM" ""
2450
[ $WITH_HARDENING -eq 0 ] && cnf_append "VBOX_WITHOUT_HARDENING" "1"
2451
[ $WITH_HARDENING -eq 2 ] && cnf_append "VBOX_WITH_HARDENING" "2"
2452
[ $WITH_VMMRAW -eq 0 ] && cnf_append "VBOX_WITH_RAW_MODE" ""
2455
if [ "$OS" = "darwin" ]; then
2460
[ "$OS" != "darwin" ] && check_as86
2461
[ "$OS" != "darwin" ] && check_bcc
2462
[ "$OS" != "darwin" ] && check_iasl
2463
# don't check for yasm for the time beeing as 0.40 and 0.50 both have known bugs
2464
# [ "$OS" != "darwin" ] && check_yasm
2465
[ "$OS" != "darwin" ] && check_xsltproc
2466
[ "$OS" != "darwin" ] && check_mkisofs
2469
[ "$OS" != "darwin" ] && check_pthread
2471
[ $WITH_LIBIDL -eq 1 ] && check_libidl
2474
[ "$OS" != "darwin" ] && check_z
2475
[ "$OS" != "darwin" ] && check_png
2476
[ $OSE -eq 0 -a "$OS" = "linux" ] && check_pam
2477
[ $WITH_SDL -eq 1 ] && check_sdl
2478
[ $WITH_SDL_TTF -eq 1 -a $OSE -eq 0 ] && check_sdl_ttf
2479
[ $WITH_X11 -eq 1 ] && check_x
2480
# TODO check for xcomposite-dev (X11/extensions/Xcomposite.h, additions only)
2481
# TODO check for libxdamange-dev (X11/extensions/Xdamage.h, additions only)
2482
[ $WITH_X11 -eq 1 ] && check_xcursor
2483
[ $WITH_X11 -eq 1 ] && check_xinerama
2484
[ $WITH_X11 -eq 1 ] && check_xrandr
2485
[ $WITH_OPENGL -eq 1 ] && check_opengl
2486
[ $WITH_QT4 -eq 1 ] && check_qt4
2487
[ $WITH_PYTHON -eq 1 ] && check_python
2488
[ $WITH_JAVA -eq 1 ] && check_java
2491
if [ "$OS" = "linux" -o "$OS" = "freebsd" ]; then
2492
if [ $WITH_PULSE -eq 1 ]; then
2494
elif [ $WITH_PULSE -eq 0 ]; then
2495
cnf_append "VBOX_WITH_PULSE" ""
2500
if [ "$OS" = "linux" ]; then
2501
# don't check for the static libstdc++ in the PUEL version as we build the
2502
# additions at a dedicated box
2503
[ $OSE -ge 1 ] && check_staticlibstdcxx
2504
if [ $WITH_KMODS -eq 1 ]; then
2507
cnf_append "VBOX_LINUX_SRC" ""
2508
cnf_append "VBOX_WITH_VBOXDRV" ""
2509
cnf_append "VBOX_WITH_ADDITION_DRIVERS" ""
2511
if [ $WITH_ALSA -eq 1 ]; then
2514
cnf_append "VBOX_WITH_ALSA" ""
2516
if [ $WITH_DBUS -eq 0 ]; then
2517
cnf_append "VBOX_WITH_DBUS" ""
2521
[ "$BUILD_MACHINE" = "amd64" -a $WITH_VMMRAW -eq 1 ] && check_32bit
2522
# tools/common/makeself*
2523
[ $OSE -ge 1 ] && check_makeself
2526
[ -n "$SETUP_WINE" ] && setup_wine
2528
if [ $OSE -ge 1 ]; then
2529
if [ $WITH_GSOAP -eq 1 ]; then
2532
cnf_append "VBOX_WITH_WEBSERVICES" ""
2537
if [ $WITH_UDPTUNNEL -eq 0 ]; then
2538
cnf_append "VBOX_WITH_UDPTUNNEL" ""
2542
if [ "$OS" = "linux" -o "$OS" = "freebsd" ]; then
2543
if [ $WITH_VDE -eq 1 ]; then
2544
cnf_append "VBOX_WITH_VDE" "1"
2549
if [ $WITH_DOCS -eq 0 ]; then
2550
cnf_append "VBOX_WITH_DOCS" ""
2551
cnf_append "VBOX_WITH_DOCS_PACKING" ""
2554
# VNC server support
2555
if [ $OSE -ge 1 ]; then
2556
if [ $WITH_VNC = 1 ]; then
2559
cnf_append "VBOX_WITH_VNC" ""
2565
echo "Successfully generated '$CNF' and '$ENV'."
2566
echo "Source '$ENV' once before you start to build VBox:"
2571
if [ "$OS" = "linux" ]; then
2572
if [ $OUT_PATH_OVERRIDE -eq 1 ]; then
2573
vbox_out_path=$OUT_PATH
2577
echo "To compile the kernel modules, do:"
2579
echo " cd $vbox_out_path/$OS.$TARGET_MACHINE/$BUILD_TYPE/bin/src"
2583
if [ $WITH_HARDENING -gt 0 ]; then
2585
echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
2586
echo " Hardening is enabled which means that the VBox binaries will not run from"
2587
echo " the binary directory. The binaries have to be installed suid root and some"
2588
echo " more prerequisites have to be fulfilled which is normally done by installing"
2589
echo " the final package. For development, the hardening feature can be disabled"
2590
echo " by specifying the --disable-hardening parameter. Please never disable that"
2591
echo " feature for the final distribution!"
2592
echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
2596
echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
2597
echo " Hardening is disabled. Please do NOT build packages for distribution with"
2598
echo " disabled hardening!"
2599
echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"