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-2009 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!"
109
GENISOIMAGE="genisoimage"
113
LIBPTHREAD="-lpthread"
117
INCX11="/usr/local/include"
118
LIBX11="-L/usr/X11R6/lib -L/usr/X11R6/lib64 -L/usr/local/lib -lXext -lX11"
119
LIBXCURSOR="-lXcursor"
121
LIBXINERAMA="-lXinerama"
128
LIBVNCSERVER="-lvncserver"
130
if [ "$OS" = "freebsd" ]; then
131
INCCURL="-I/usr/local/include"
132
LIBCURL="-L/usr/local/lib -lcurl"
133
INCPULSE="-I/usr/local/include"
134
LIBPULSE="-L/usr/local/lib"
135
INCPNG="-I/usr/local/include"
136
LIBPNG="-L/usr/local/lib -lpng"
143
PKGCONFIG="`which_wrapper pkg-config`"
144
PYTHONDIR="/usr /usr/local"
145
QT4DIR="/usr/lib/qt4 /usr/share/qt4 /usr/lib64/qt4 /usr /usr/local"
147
QT4UIC3DIR="/usr/bin"
148
KBUILDDIR="`cd \`dirname $0\`; pwd`/kBuild"
149
DEVDIR="`cd \`dirname $0\`; pwd`/tools"
150
if [ -d "/lib/modules/`uname -r`/build" ]; then
151
LINUX="/lib/modules/`uname -r`/build"
153
LINUX="/usr/src/linux"
155
KCHMVIEWER="kchmviewer"
160
# the restricting tool is ar (mri mode).
161
INVALID_CHARS="[^A-Za-z0-9/\\$:._-]"
163
# darwin /bin/sh has a builtin echo that doesn't grok -n. gotta love it.
164
if [ "$OS" = "darwin" ]; then
165
ECHO_N="/bin/echo -n"
173
rm -f $ODIR.tmp_src.cc $ODIR.tmp_src.c $ODIR.tmp_out $ODIR.test_execute.log
178
if [ -z "$nofatal" -o "x$1" != "x" ]; then
181
echo "Check $LOG for details"
194
if [ -n "$1" ]; then $ECHO_N "$1, "; fi
205
echo "** $1!" >> $LOG
211
printf "%-30s := %s\n" "$1" "$2" >> $CNF
216
echo "$1"|$KBUILD_SED 's|-l\([^ ]\+\)|\1|g; s|^-[^l][^ ]*||g; s| -[^l][^ ]*||g; s|^ ||; s| *$||g'
221
echo "$1"|$KBUILD_SED 's|-L\([^ ]\+\)|\1|g; s|^-[^L][^ ]*||g; s| -[^L][^ ]*||g; s|^ ||; s| *$||g'
226
echo "$1"|$KBUILD_SED 's|-I\([^ ]\+\)|\1|g; s|^-[^I][^ ]*||g; s| -[^I][^ ]*||g; s|^ ||; s| *$||g'
231
echo "$1"|$KBUILD_SED 's|^\/|-I/|g; s| \/| -I/|g'
237
log_failure "$2 is empty"
240
elif which_wrapper $1 > /dev/null; then
243
log_failure "$1 (variable $2) not found"
253
echo "***** Checking $1 *****" >> $LOG
254
$ECHO_N "Checking for $1: "
259
# $1 compile flags/libs
262
# $4 if this argument is 'nofatal', don't abort
265
echo "compiling the following source file:" >> $LOG
266
cat $ODIR.tmp_src.cc >> $LOG
267
echo "using the following command line:" >> $LOG
268
echo "$CXX $CXX_FLAGS -g -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc \"$1\"" >> $LOG
269
$CXX $CXX_FLAGS -g -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc $1 >> $LOG 2>&1
270
if [ $? -ne 0 ]; then
273
echo " $2 not found at $1 or $3 headers not found"
274
echo " Check the file $LOG for detailed error information."
286
# Execute a compiled test binary
289
echo "executing the binary" >> $LOG
290
$ODIR.tmp_out > $ODIR.test_execute.log
292
cat $ODIR.test_execute.log | tee -a $LOG
293
if [ $rc -ne 0 ]; then
303
# Execute a compiled test binary
306
echo "executing the binary (LD_LIBRARY_PATH=$1)" >> $LOG
307
LD_LIBRARY_PATH=$1 $ODIR.tmp_out > $ODIR.test_execute.log
309
cat $ODIR.test_execute.log | tee -a $LOG
310
if [ $rc -ne 0 ]; then
321
# Check for OS, MACHINE, CPU
325
test_header environment
326
BUILD_CPU=`dpkg-architecture -qDEB_HOST_GNU_CPU`
327
[ "$OS" = "solaris" ] && BUILD_CPU=`isainfo | cut -f 1 -d ' '`
329
i[3456789]86|x86|i86pc)
334
BUILD_MACHINE='amd64'
336
if [ "$OS" != "solaris" ]; then
337
# on AMD64 systems, 64bit libs are usually located in /usr/lib64
338
# see http://www.pathname.com/fhs/pub/fhs-2.3.html#LIB64
341
# Solaris doesn't seem to subscribe to fhs, libs are usually in
342
# a '64' subdirectory of the standard 'lib' dirs while some 64-bit
343
# alternative binaries can be found in 'amd64' subdirs of the 'bin'
344
# ones. So, in order to find the right stuff (esp. sdl-config) we'll
345
# have to make sure the */bin/amd64 dirs are searched before the */bin
346
# ones. (The sed has some sideeffects, but they shouldn't harm us...)
347
echo "64-bit Solaris detected, hacking the PATH" >> $LOG
348
echo "old PATH: $PATH" >> $LOG
349
PATH=`echo ":$PATH:" | sed -e 's,\(:[^:]*/bin\):,\1/amd64:\1:,g' \
350
-e 's/^:*//' -e 's/:*$//g' -e 's/::*/:/g' `
352
echo "new PATH: $PATH" >> $LOG
357
log_failure "Cannot determine system"
361
[ -z "$TARGET_MACHINE" ] && TARGET_MACHINE=$BUILD_MACHINE
362
[ -z "$TARGET_CPU" ] && TARGET_CPU=$BUILD_CPU
363
DEVDIR_BIN="$DEVDIR/$OS.$BUILD_MACHINE/bin"
364
log_success "Determined build machine: $OS.$BUILD_MACHINE, target machine: $OS.$TARGET_MACHINE"
366
echo "BUILD_PLATFORM=\"$OS\"" >> $ENV
367
echo "export BUILD_PLATFORM" >> $ENV
368
echo "BUILD_PLATFORM_ARCH=\"$BUILD_MACHINE\"" >> $ENV
369
echo "export BUILD_PLATFORM_ARCH" >> $ENV
370
echo "BUILD_TARGET=\"$OS\"" >> $ENV
371
echo "export BUILD_TARGET" >> $ENV
372
echo "BUILD_TARGET_ARCH=\"$TARGET_MACHINE\"" >> $ENV
373
echo "export BUILD_TARGET_ARCH" >> $ENV
374
echo "BUILD_TARGET_CPU=\"$TARGET_CPU\"" >> $ENV
375
echo "export BUILD_TARGET_CPU" >> $ENV
376
echo "BUILD_TYPE=\"$BUILD_TYPE\"" >> $ENV
377
echo "export BUILD_TYPE" >> $ENV
381
# Check for gcc with version >= 3.2.
382
# We depend on a working gcc, if we fail terminate in every case.
387
if check_avail "$CC" CC really; then
388
cc_ver=`$CC -dumpversion` 2>/dev/null
389
if [ $? -ne 0 ]; then
390
log_failure "cannot execute '$CC -dumpversion'"
393
if check_avail "$CXX" CXX really; then
394
cxx_ver=`$CXX -dumpversion` 2>/dev/null
395
if [ $? -ne 0 ]; then
396
log_failure "cannot execute '$CXX -dumpversion'"
399
cc_maj=`echo $cc_ver|cut -d. -f1`
400
cc_min=`echo $cc_ver|cut -d. -f2`
401
if [ "x$cc_ver" != "x$cxx_ver" ]; then
402
log_failure "gcc version $cc_ver does not match g++ version $cxx_ver"
404
elif [ $cc_maj -eq 4 -a $cc_min -eq 0 -a "$OS" = "darwin" ]; then
405
log_success "found version $cc_ver"
406
# gcc-4.0 is allowed for Darwin only
407
elif [ $cc_maj -lt 3 \
408
-o \( $cc_maj -eq 3 -a $cc_min -lt 2 \) \
409
-o \( $cc_maj -eq 4 -a $cc_min -lt 1 -a "$OS" != "darwin" \) \
410
-o \( $cc_maj -eq 4 -a $cc_min -gt 6 \) \
411
-o $cc_maj -gt 4 ]; then
412
log_failure "gcc version $cc_ver found, expected gcc 3.x with x>1 or gcc 4.x with 0<x<5"
415
log_success "found version $cc_ver"
417
if [ "$BUILD_MACHINE" = "amd64" ]; then
418
[ -z "$CC32" ] && CC32="$CC -m32"
419
[ -z "$CXX32" ] && CXX32="$CXX -m32"
421
[ -z "$CC32" ] && CC32="$CC"
422
[ -z "$CXX32" ] && CXX32="$CXX"
424
if [ "$BUILD_MACHINE" = "x86" -a "$TARGET_MACHINE" = "amd64" ]; then
425
[ -z "$CC64" ] && CC64="$CC -m64"
426
[ -z "$CXX64" ] && CXX64="$CXX -m64"
428
if [ "$TARGET_MACHINE" = "amd64" -a $WITH_VMMRAW -eq 0 ]; then
432
if [ "$CC" != "gcc" ]; then
433
cnf_append "TOOL_GCC3_CC" "$CC"
434
cnf_append "TOOL_GCC3_AS" "$CC"
435
cnf_append "TOOL_GCC3_LD" "$CC"
436
cnf_append "TOOL_GXX3_CC" "$CC"
437
cnf_append "TOOL_GXX3_AS" "$CC"
439
if [ "$CXX" != "g++" ]; then
440
cnf_append "TOOL_GCC3_CXX" "$CXX"
441
cnf_append "TOOL_GXX3_CXX" "$CXX"
442
cnf_append "TOOL_GXX3_LD" "$CXX"
444
if [ "$CC32" != "gcc -m32" -a "$CC32" != "undefined" ]; then
445
cnf_append "TOOL_GCC32_CC" "$CC32"
446
cnf_append "TOOL_GCC32_AS" "$CC32"
447
cnf_append "TOOL_GCC32_LD" "$CC32"
448
cnf_append "TOOL_GXX32_CC" "$CC32"
449
cnf_append "TOOL_GXX32_AS" "$CC32"
451
if [ "$CXX32" != "g++ -m32" -a "$CXX32" != "undefined" ]; then
452
cnf_append "TOOL_GCC32_CXX" "$CXX32"
453
cnf_append "TOOL_GXX32_CXX" "$CXX32"
454
cnf_append "TOOL_GXX32_LD" "$CXX32"
456
# this isn't not necessary, there is not such tool.
457
if [ -n "$CC64" ]; then
458
cnf_append "TOOL_GCC64_CC" "$CC64"
459
cnf_append "TOOL_GCC64_AS" "$CC64"
460
cnf_append "TOOL_GCC64_LD" "$CC64"
461
cnf_append "TOOL_GXX64_CC" "$CC64"
462
cnf_append "TOOL_GXX64_AS" "$CC64"
464
if [ -n "$CXX64" ]; then
465
cnf_append "TOOL_GCC64_CXX" "$CXX64"
466
cnf_append "TOOL_GXX64_CXX" "$CXX64"
467
cnf_append "TOOL_GXX64_LD" "$CXX64"
469
# Solaris sports a 32-bit gcc/g++.
470
if [ "$OS" = "solaris" -a "$BUILD_MACHINE" = "amd64" ]; then
471
[ "$CC" = "gcc" ] && CC="gcc -m64"
472
[ "$CXX" = "g++" ] && CXX="g++ -m64"
480
# Check for the bcc compiler, needed for compiling the BIOS
485
if check_avail "$BCC" BCC; then
486
bcc_ver=`$BCC -v 2>&1|grep version|sed 's+^bcc: version \(.*\)+\1+'`
487
if [ $? -ne 0 ]; then
488
log_failure "BCC not found"
491
echo "compiling the following source file:" >> $LOG
492
cat > $ODIR.tmp_src.c << EOF
499
cat $ODIR.tmp_src.c >> $LOG
500
bcc_path=`which_wrapper $BCC`
501
bcc_dir="`dirname $bcc_path`/"
502
echo "using the following command line:" >> $LOG
503
echo "$BCC -B $bcc_dir -C-c -3 -S -o $ODIR.tmp_out $ODIR.tmp_src.c" >> $LOG
504
$BCC -B $bcc_dir -C-c -3 -S -o $ODIR.tmp_out $ODIR.tmp_src.c >> $LOG 2>&1
505
if [ $? -ne 0 ]; then
506
log_failure "BCC not working"
509
log_success "found version $bcc_ver"
510
cnf_append "VBOX_BCC" "$bcc_path -B $bcc_dir"
520
# Check for the as86 assembler, needed for compiling the BIOS
525
if check_avail "$AS86" AS86; then
526
as86_ver=`$AS86 -v 2>&1|grep version|sed 's+^as86 version: \(.*\)+\1+'`
527
if [ $? -ne 0 ]; then
528
log_failure "as86 not found"
531
log_success "found version $as86_ver"
532
cnf_append "VBOX_AS86" "`which_wrapper $AS86`"
539
# Check for yasm, needed to compile assembler files
544
if check_avail "$YASM" YASM; then
545
yasm_ver=`$YASM --version|grep "^yasm"|sed 's+^yasm \(.*\)+\1+'`
546
if [ $? -ne 0 ]; then
547
log_failure "yasm not found"
550
yasm_maj=`echo $yasm_ver|cut -d. -f1`
551
yasm_min=`echo $yasm_ver|cut -d. -f2`
552
yasm_rev=`echo $yasm_ver|cut -d. -f3`
553
yasm_ver_mul=`expr $yasm_maj \* 10000 + $yasm_min \* 100 + $yasm_rev`
554
if [ $yasm_ver_mul -lt 501 ]; then
555
log_failure "found version $yasm_ver, expected at least 0.5.1"
558
log_success "found version $yasm_ver"
566
# Check for the iasl ACPI compiler, needed to compile vbox.dsl
571
if check_avail "$IASL" IASL; then
572
iasl_ver=`$IASL|grep version|sed 's+^ASL.*version \([0-9]*\).*+\1+'`
573
if [ $? -ne 0 ]; then
574
log_failure "iasl not found"
577
log_success "found version $iasl_ver"
578
cnf_append "VBOX_IASLCMD" "`which_wrapper $IASL`"
585
# Check for xsltproc, needed by Main
590
if check_avail "$XSLTPROC" XSLTPROC; then
591
xsltproc_ver=`$XSLTPROC --version`
592
if [ $? -ne 0 ]; then
593
log_failure "xsltproc not found"
597
cnf_append "VBOX_XSLTPROC" "`which_wrapper $XSLTPROC`"
604
# Check for mkisofs, needed to build the CDROM image containing the additions
609
if which_wrapper $GENISOIMAGE > /dev/null; then
610
mkisofs_ver=`$GENISOIMAGE --version`
611
if [ $? -ne 0 ]; then
612
log_failure "mkisofs not found"
615
log_success "found $mkisofs_ver"
616
cnf_append "VBOX_MKISOFS" "`which_wrapper $GENISOIMAGE`"
618
elif check_avail "$MKISOFS" MKISOFS; then
619
mkisofs_ver=`$MKISOFS --version`
620
if [ $? -ne 0 ]; then
621
log_failure "mkisofs not working"
624
log_success "found $mkisofs_ver"
625
cnf_append "VBOX_MKISOFS" "`which_wrapper $MKISOFS`"
632
# Check for libxml2, needed by VBoxSettings and Runtime.
633
# 2.6.24 is known to NOT work, 2.6.26 is known to work (there is no 2.6.25 release)
637
if [ -z "$BUILD_LIBXML2" ]; then
639
if which_wrapper pkg-config > /dev/null; then
640
libxml2_ver=`pkg-config libxml-2.0 --modversion 2>> $LOG`
641
if [ $? -ne 0 ]; then
642
log_failure "libxml2 not found"
645
FLGXML2=`pkg-config libxml-2.0 --cflags`
646
INCXML2=`strip_I "$FLGXML2"`
647
LIBXML2=`pkg-config libxml-2.0 --libs`
648
cat > $ODIR.tmp_src.cc << EOF
650
#include <libxml/xmlversion.h>
651
extern "C" int main(void)
653
printf("found version %s", LIBXML_DOTTED_VERSION);
654
#if LIBXML_VERSION >= 20626
658
printf(", expected version 2.6.26 or higher\n");
663
[ -n "$INCXML2" ] && I_INCXML2=`prefix_I "$INCXML2"`
664
if test_compile "$LIBXML2 $LIBPTHREAD $I_INCXML2" xml2 xml2; then
665
if test_execute; then
666
cnf_append "SDK_VBOX_LIBXML2_INCS" "$INCXML2"
667
cnf_append "SDK_VBOX_LIBXML2_LIBS" "`strip_l "$LIBXML2"`"
671
elif which_wrapper xml2-config; then
672
libxml2_ver=`xml2-config --version`
673
if [ $? -ne 0 ]; then
674
log_failure "xml2-config not found"
677
log_success "found version $libxml2_ver"
678
FLGXML2=`xml2-config --cflags`
679
INCXML2=`strip_I "$FLGXML2"`
680
LIBXML2=`xml2-config --libs`
681
cat > $ODIR.tmp_src.cc << EOF
683
#include <libxml/xmlversion.h>
684
extern "C" int main(void)
686
printf("found version %s", LIBXML_DOTTED_VERSION);
687
#if LIBXML_VERSION >= 20626
691
printf(", expected version 2.6.26 or higher\n");
696
[ -n "$INCXML2" ] && I_INCXML2=`prefix_I "$INCXML2"`
697
if test_compile "$LIBXML2 $LIBPTHREAD $I_INCXML2" xml2 xml2; then
698
if test_execute; then
699
cnf_append "SDK_VBOX_LIBXML2_INCS" "$INCXML2"
700
cnf_append "SDK_VBOX_LIBXML2_LIBS" "`strip_l "$LIBXML2"`"
705
log_failure "neither pkg-config nor xml2-config found"
713
# Check for libxslt, needed by VBoxSettings. For now we depend on 1.1.15,
714
# as Solaris right now has no newer version and it definitely works.
715
# 1.1.17 is available on Ubuntu Edgy which fulfils the minimal libxml2
716
# requirement (2.6.26).
720
if [ -z "$BUILD_LIBXSLT" ]; then
722
if which_wrapper pkg-config > /dev/null; then
723
libxslt_ver=`pkg-config libxslt --modversion 2>> $LOG`
724
if [ $? -ne 0 ]; then
725
log_failure "libxslt not found"
728
FLGXSLT=`pkg-config libxslt --cflags`
729
INCXSLT=`strip_I "$FLGXSLT"`
730
LIBXSLT=`pkg-config libxslt --libs`
731
cat > $ODIR.tmp_src.cc << EOF
733
#include <libxslt/xsltconfig.h>
734
extern "C" int main(void)
736
printf("found version %s", LIBXSLT_DOTTED_VERSION);
737
#if LIBXSLT_VERSION >= 10117
741
printf(", expected version 1.1.17 or higher\n");
746
[ -n "$INCXSLT" ] && I_INCXSLT=`prefix_I "$INCXSLT"`
747
if test_compile "$LIBXSLT $LIBPTHREAD $I_INCXSLT" xslt xslt; then
748
if test_execute; then
749
cnf_append "SDK_VBOX_LIBXSLT_INCS" "$INCXSLT"
750
cnf_append "SDK_VBOX_LIBXSLT_LIBS" "`strip_l "$LIBXSLT"`"
754
elif which_wrapper xslt-config; then
755
libxslt_ver=`xslt-config --version`
756
if [ $? -ne 0 ]; then
757
log_failure "xslt-config not working"
760
log_success "found version $libxslt_ver"
761
FLGXSLT=`xslt-config --cflags`
762
INCXSLT=`strip_I "$FLGXSLT"`
763
LIBXSLT=`xslt-config --libs`
764
cat > $ODIR.tmp_src.cc << EOF
766
#include <libxslt/xsltconfig.h>
767
extern "C" int main(void)
769
printf("found version %s", LIBXSLT_DOTTED_VERSION);
770
#if LIBXSLT_VERSION >= 10117
774
printf(", expected version 1.1.17 or higher\n");
779
[ -n "$INCXSLT" ] && I_INCXSLT=`prefix_I "$INCXSLT"`
780
if test_compile "$LIBXSLT $LIBPTHREAD $I_INCXSLT" xslt xslt; then
781
if test_execute; then
782
cnf_append "SDK_VBOX_LIBXSLT_INCS" "$INCXSLT"
783
cnf_append "SDK_VBOX_LIBXSLT_LIBS" "`strip_l "$LIBXSLT"`"
788
log_failure "neither pkg-config nor xslt-config found"
796
# Check for libIDL, needed by xpcom
802
if which_wrapper libIDL-config-2 > /dev/null; then
803
libidl_ver=`libIDL-config-2 --version`
804
if [ $? -ne 0 ]; then
805
log_failure "libIDL-config-2 not working"
808
log_success "found version $libidl_ver"
809
cnf_append "VBOX_LIBIDL_CONFIG" \
810
"PKG_CONFIG_PATH=`libIDL-config-2 --prefix`/$LIB/pkgconfig `which_wrapper libIDL-config-2`"
812
elif check_avail "libIDL-config" libIDL-config; then
813
libidl_ver=`libIDL-config --version`
814
if [ $? -ne 0 ]; then
815
log_failure "libIDL-config not working"
818
log_success "found version $libidl_ver"
819
cnf_append "VBOX_LIBIDL_CONFIG" "`which_wrapper libIDL-config`"
826
# Check for openssl, needed for RDP and S3
830
if [ -z "$BUILD_LIBSSL" ]; then
832
cat > $ODIR.tmp_src.cc << EOF
834
#include <openssl/opensslv.h>
835
extern "C" int main(void)
837
printf("found version %s", OPENSSL_VERSION_TEXT);
838
#if OPENSSL_VERSION_NUMBER >= 0x00908000
842
printf(", expected version 0.9.8 or higher\n");
847
if test_compile "$INCCRYPTO $LIBCRYPTO" libcrypto openssl; then
848
if test_execute nofatal; then
849
cnf_append "SDK_VBOX_OPENSSL_INCS" "`strip_I "$INCCRYPTO"`"
850
cnf_append "SDK_VBOX_OPENSSL_LIBS" "`strip_l "$LIBCRYPTO"`"
851
cnf_append "SDK_VBOX_BLD_OPENSSL_LIBS" "`strip_l "$LIBCRYPTO"`"
859
# Check for pthread, needed by VBoxSVC, frontends, ...
864
cat > $ODIR.tmp_src.cc << EOF
867
extern "C" int main(void)
869
pthread_mutex_t mutex;
870
if (pthread_mutex_init(&mutex, NULL)) {
871
printf("pthread_mutex_init() failed\n");
874
if (pthread_mutex_lock(&mutex)) {
875
printf("pthread_mutex_lock() failed\n");
878
if (pthread_mutex_unlock(&mutex)) {
879
printf("pthread_mutex_unlock() failed\n");
882
printf("found, OK.\n");
885
if test_compile $LIBPTHREAD pthread pthread; then
886
if test_execute; then
887
cnf_append "LIB_PTHREAD" "`strip_l "$LIBPTHREAD"`"
894
# Check for zlib, needed by VBoxSVC, Runtime, ...
899
cat > $ODIR.tmp_src.cc << EOF
902
extern "C" int main(void)
904
printf("found version %s", ZLIB_VERSION);
905
#if ZLIB_VERNUM >= 0x1210
909
printf(", expected version 1.2.1 or higher\n");
914
[ -n "$INCZ" ] && I_INCZ=`prefix_I "$INCZ"`
915
if test_compile "$LIBZ $I_INCZ" zlib zlib; then
916
if test_execute; then
917
echo "if1of (\$(KBUILD_TARGET),darwin freebsd linux solaris)" >> $CNF
918
cnf_append " SDK_VBOX_ZLIB_LIBS" "`strip_l "$LIBZ"`"
919
cnf_append " SDK_VBOX_ZLIB_INCS" "$INCZ"
927
# Check for libpng, needed by kchmviewer
932
cat > $ODIR.tmp_src.cc << EOF
935
extern "C" int main(void)
937
printf("found version %s", PNG_LIBPNG_VER_STRING);
938
#if PNG_LIBPNG_VER >= 10205
942
printf(", expected version 1.2.5 or higher\n");
947
[ -n "$INCPNG" ] && I_INCPNG=`prefix_I "$INCPNG"`
948
if test_compile "$LIBPNG $I_INCPNG" libpng libpng; then
949
if test_execute; then
950
cnf_append "SDK_VBOX_LIBPNG_LIBS" "`strip_l "$LIBPNG"`"
951
cnf_append "SDK_VBOX_LIBPNG_INCS" "$INCPNG"
957
# Check for libvncserver, needed for VNC in OSE
961
test_header libvncserver
962
cat > $ODIR.tmp_src.cc <<EOF
964
#include <rfb/rfbconfig.h>
966
extern "C" int main()
968
const char* v=LIBVNCSERVER_VERSION;
969
unsigned int major = 0, minor = 0, micro = 0;
971
for (; *v !='.' && *v != '\0'; v++) major = major*10 + *v-'0';
973
for (; *v !='.' && *v != '\0'; v++) minor = minor*10 + *v-'0';
975
for (; *v !='.' && *v != '\0'; v++) micro = micro*10 + *v-'0';
977
printf("found version %s", LIBVNCSERVER_PACKAGE_VERSION);
978
if (major*10000 + minor*100 + micro >= 907)
985
printf(", expected version 0.9.7 or higher\n");
990
if test_compile "$LIBVNCSERVER $INCVNCSERVER" libvncserver libvncserver; then
991
if test_execute; then
992
cnf_append "VBOX_WITH_VNC" "1"
998
# Check for libcurl, needed by S3
1002
if [ -z "$BUILD_LIBCURL" ]; then
1004
cat > $ODIR.tmp_src.cc << EOF
1006
#include <curl/curl.h>
1007
extern "C" int main(void)
1009
printf("found version %s", LIBCURL_VERSION);
1010
#if 10000*LIBCURL_VERSION_MAJOR + 100*LIBCURL_VERSION_MINOR + LIBCURL_VERSION_PATCH >= 71601
1014
printf(", expected version 7.16.1 or higher\n");
1019
[ -n "$INCCURL" ] && I_INCCURL=`prefix_I "$INCCURL"`
1020
if test_compile "$LIBCURL $I_INCCURL" libcurl libcurl; then
1021
if test_execute; then
1022
cnf_append "SDK_VBOX_LIBCURL_LIBS" "`strip_l "$LIBCURL"`"
1023
cnf_append "SDK_VBOX_LIBCURL_INCS" "$INCCURL"
1031
# Check for pam, needed by VRDPAuth
1032
# Version 79 was introduced in 9/2005, do we support older versions?
1033
# Debian/sarge uses 76
1034
# OpenSUSE comes with 0.99.xxx where they changed the versioning scheme.
1039
cat > $ODIR.tmp_src.cc << EOF
1041
#include <security/pam_appl.h>
1042
extern "C" int main(void)
1044
printf("found version %d", __LIBPAM_VERSION);
1045
if (__LIBPAM_VERSION >= 76)
1052
printf(", expected version 76 or higher\n");
1057
if test_compile "-lpam" pam pam nofatal; then
1058
if test_execute nofatal; then
1062
echo "pam0.x not found"
1063
test_header linux_pam
1064
cat > $ODIR.tmp_src.cc << EOF
1066
#include <security/pam_appl.h>
1067
extern "C" int main(void)
1069
printf("found version %d.%d", __LINUX_PAM__, __LINUX_PAM_MINOR__);
1070
if (__LINUX_PAM__ >= 1)
1077
printf(", expected version 1.0 or higher\n");
1082
if test_compile "-lpam" pam pam; then
1089
# Check for the SDL library, needed by VBoxSDL and VirtualBox
1090
# We depend at least on version 1.2.7
1095
if [ "$OS" = "darwin" ]; then
1096
if [ -f "/System/Library/Frameworks/SDL.framework/SDL" ]; then
1097
PATH_SDK_LIBSDL="/System/Library/Frameworks/SDL.framework"
1098
elif [ -f "/Library/Frameworks/SDL.framework/SDL" ]; then
1099
PATH_SDK_LIBSDL="/Library/Frameworks/SDL.framework"
1101
if [ -n "$PATH_SDK_LIBSDL" ]; then
1103
INCSDL="$PATH_SDK_LIBSDL/Headers"
1104
FLDSDL="-framework SDL"
1106
log_failure "SDL framework not found"
1110
if which_wrapper sdl-config > /dev/null; then
1111
FLGSDL=`sdl-config --cflags`
1112
INCSDL=`strip_I "$FLGSDL"`
1113
LIBSDL=`sdl-config --libs`
1114
LIBSDLMAIN="-lSDLmain"
1119
[ "$OS" = "linux" -o "$OS" = "darwin" -o "$OS" = "solaris" ] && LIBSDLMAIN=""
1120
if [ -n "$foundsdl" ]; then
1121
cat > $ODIR.tmp_src.cc << EOF
1124
#include <SDL_main.h>
1126
extern "C" int main(int argc, char** argv)
1128
printf("found version %d.%d.%d",
1129
SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
1130
#if SDL_VERSION_ATLEAST(1,2,7)
1134
printf(", expected version 1.2.7 or higher\n");
1139
[ -n "$INCSDL" ] && I_INCSDL=`prefix_I "$INCSDL"`
1140
if test_compile "$LIBSDL $LIBSDLMAIN $I_INCSDL $FLDSDL" SDL SDL; then
1141
if test_execute; then
1142
cnf_append "LIB_SDK_LIBSDL_SDL" "`strip_l "$LIBSDL"`"
1143
cnf_append "SDK_LIBSDL_LIBPATH" "`strip_L "$LIBSDL"`"
1144
cnf_append "LIB_SDK_LIBSDL_SDLMAIN" "`strip_l "$LIBSDLMAIN"`"
1145
[ -n "$INCSDL" ] && cnf_append "SDK_LIBSDL_INCS" "$INCSDL"
1146
[ -n "$FLDSDL" ] && cnf_append "SDK_LIBSDL_LDFLAGS" "$FLDSDL"
1150
log_failure "SDL not found"
1157
# Check for the SDL_ttf library, needed by VBoxSDL (secure label)
1162
cat > $ODIR.tmp_src.cc << EOF
1164
#include <SDL_ttf.h>
1165
#ifndef SDL_TTF_MAJOR_VERSION
1166
#define SDL_TTF_MAJOR_VERSION TTF_MAJOR_VERSION
1167
#define SDL_TTF_MINOR_VERSION TTF_MINOR_VERSION
1168
#define SDL_TTF_PATCHLEVEL TTF_PATCHLEVEL
1170
extern "C" int main(void)
1172
printf("found version %d.%d.%d",
1173
SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL);
1174
#if 10000*SDL_TTF_MAJOR_VERSION + 100*SDL_TTF_MINOR_VERSION + SDL_TTF_PATCHLEVEL >= 20006
1178
printf(", expected version 2.0.6 or higher\n");
1183
if test_compile "-lSDL_ttf $I_INCSDL" SDL_ttf SDL_ttf nofatal; then
1184
if ! test_execute nofatal; then
1185
cnf_append "VBOX_WITH_SECURELABEL" ""
1188
echo "not found -- disabling VBoxSDL secure label."
1189
cnf_append "VBOX_WITH_SECURELABEL" ""
1195
# Check for libasound, needed by the ALSA audio backend
1200
cat > $ODIR.tmp_src.cc << EOF
1202
#include <alsa/asoundlib.h>
1203
extern "C" int main(void)
1205
printf("found version %d.%d.%d",
1206
SND_LIB_MAJOR, SND_LIB_MINOR, SND_LIB_SUBMINOR);
1207
#if 10000*SND_LIB_MAJOR + 100*SND_LIB_MINOR + SND_LIB_SUBMINOR >= 10006
1211
printf(", expected version 1.0.6 or higher\n");
1216
if test_compile "-lasound" asound asound; then
1223
# Check for PulseAudio
1227
test_header "PulseAudio"
1228
cat > $ODIR.tmp_src.cc << EOF
1230
#include <pulse/version.h>
1231
extern "C" int main(void)
1233
printf("found version %s API version %d", pa_get_headers_version(), PA_API_VERSION);
1234
#if PA_API_VERSION >= 9
1238
printf(", expected version 0.9.0 (API version 9) or higher\n");
1243
if test_compile "$INCPULSE $LIBPULSE -lpulse" pulse pulse; then
1250
# Check for the X libraries (Xext, X11)
1254
test_header "X libraries"
1255
cat > $ODIR.tmp_src.cc << EOF
1257
#include <X11/Xlib.h>
1258
extern "C" int main(void)
1265
dpy = XOpenDisplay(NULL);
1266
scrn_num = DefaultScreen(dpy);
1267
scrn = ScreenOfDisplay(dpy, scrn_num);
1268
win = XCreateWindow(dpy, RootWindowOfScreen(scrn), 0, 0, 100, 100,
1269
0, 16, InputOutput, CopyFromParent, 0, NULL);
1270
XDestroyWindow(dpy, win);
1274
[ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1275
if test_compile "$LIBX11 $I_INCX11" Xlibs Xlibs; then
1282
# Check for the Xcursor library, needed by VBoxSDL and VBoxBFE
1287
cat > $ODIR.tmp_src.cc << EOF
1289
#include <X11/Xlib.h>
1290
#include <X11/Xcursor/Xcursor.h>
1291
extern "C" int main(void)
1293
XcursorImage *cursor = XcursorImageCreate (10, 10);
1294
XcursorImageDestroy(cursor);
1298
[ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1299
if test_compile "$LIBX11 $LIBXCURSOR $I_INCX11" Xcursor Xcursor; then
1301
cnf_append "VBOX_XCURSOR_LIBS" "`strip_l "$LIBXCURSOR"`"
1307
# Check for the Xinerama library, needed by the Qt GUI
1311
test_header Xinerama
1312
cat > $ODIR.tmp_src.cc << EOF
1313
#include <X11/Xlib.h>
1314
#include <X11/extensions/Xinerama.h>
1315
extern "C" int main(void)
1319
dpy = XOpenDisplay(NULL);
1322
flag = XineramaIsActive(dpy);
1327
[ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1328
if test_compile "$LIBX11 $LIBXINERAMA $I_INCX11" Xinerama Xinerama; then
1335
# Check for the Xinerama library, needed by the Qt GUI
1340
cat > $ODIR.tmp_src.cc << EOF
1341
#include <X11/Xlib.h>
1342
#include <X11/extensions/Xrandr.h>
1343
extern "C" int main(void)
1348
dpy = XOpenDisplay(NULL);
1351
flag = XRRQueryVersion(dpy, &major, &minor);
1356
[ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1357
if test_compile "$LIBX11 $LIBXRANDR $I_INCX11" Xrandr Xrandr; then
1368
# On darwin this is a on/off decision only
1369
if [ "$OS" = "darwin" ]; then
1370
test_header "OpenGL support"
1372
cnf_append "VBOX_WITH_CROGL" "1"
1381
# Check for the Xmu library, needed by OpenGL
1386
cat > $ODIR.tmp_src.cc << EOF
1388
#include <X11/Xatom.h>
1389
#include <X11/Xlib.h>
1390
#include <X11/Xutil.h>
1391
#include <X11/Xmu/StdCmap.h>
1392
extern "C" int main(void)
1398
dpy = XOpenDisplay(NULL);
1401
scrn_num = DefaultScreen(dpy);
1402
scrn = ScreenOfDisplay(dpy, scrn_num);
1403
Status status = XmuLookupStandardColormap(dpy, RootWindowOfScreen(scrn), 0,
1404
24, XA_RGB_DEFAULT_MAP, False, True);
1405
printf("Status = %x\n", status);
1411
[ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1412
if test_compile "$LIBX11 $LIBXMU $I_INCX11" Xmu Xmu; then
1414
cnf_append "VBOX_XMU_LIBS" "`strip_l "$LIBXMU"`"
1419
# Check for Mesa, needed by OpenGL
1423
test_header "Mesa / GLU"
1424
cat > $ODIR.tmp_src.cc << EOF
1426
#include <X11/Xlib.h>
1429
extern "C" int main(void)
1434
dpy = XOpenDisplay(NULL);
1437
Bool glx_version = glXQueryVersion(dpy, &major, &minor);
1441
printf("found version %u.%u, OK.\n", major, minor);
1445
printf("found (inactive), OK.\n");
1449
[ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1450
if test_compile "$LIBX11 $MESA $I_INCX11" Mesa Mesa; then
1451
[ $PASSIVE_MESA -eq 1 ] && unset DISPLAY
1458
# Check for the Qt4 library, needed by the VirtualBox frontend
1460
# Currently not fatal.
1466
if [ "$OS" = "darwin" ]; then
1467
# First check if there is the internal version of Qt. If yes nothing else
1469
QT_INTERNAL=`/bin/ls -rd1 $PWD/tools/$BUILD_TARGET.$BUILD_PLATFORM_ARCH/qt/* 2> /dev/null`
1470
for t in $QT_INTERNAL; do
1471
if [ -f "$t/Frameworks/QtCoreVBox.framework/QtCoreVBox" ]; then
1472
cnf_append "VBOX_WITH_QT4_SUN" "1"
1473
log_success "use internal version"
1477
# Now try the user provided directory and some of the standard directories.
1478
QT_TRIES="$QT4DIR /System/Library /Library"
1479
for t in $QT_TRIES; do
1480
if [ -f "$t/Frameworks/QtCore.framework/QtCore" ]; then
1485
# Add the necessary params for building the test application
1486
if [ -n "$PATH_SDK_QT4" ]; then
1488
INCQT4=-I$PATH_SDK_QT4/Frameworks/QtCore.framework/Headers
1489
LIBQT4=-F$PATH_SDK_QT4/Frameworks
1490
FLGQT4="-framework QtCore"
1492
log_failure "Qt4 framework not found (can be disabled using --disable-qt4)"
1496
if [ $QT4DIR_PKGCONFIG -eq 1 ]; then
1497
# default is to use pkg-config
1498
if which_wrapper pkg-config > /dev/null; then
1499
# this braindead path is necessary for mdv2008.1
1501
PKG_CONFIG_PATH=/usr/lib/qt4/lib/pkgconfig \
1502
pkg-config QtCore --modversion 2>> $LOG`
1503
if [ $? -ne 0 ]; then
1504
log_failure "QtCore not found"
1508
PKG_CONFIG_PATH=/usr/lib/qt4/lib/pkgconfig \
1509
pkg-config QtCore --cflags`
1510
INCQT4=`strip_I "$FLGQT4"`
1512
PKG_CONFIG_PATH=/usr/lib/qt4/lib/pkgconfig \
1513
PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \
1514
pkg-config QtCore --libs`
1518
log_failure "pkg-config not found"
1522
# do it the old way (e.g. user has specified QT4DIR)
1523
cat > $ODIR.tmp_src.cc << EOF
1526
extern "C" int main(void)
1528
printf("found version %s", QT_VERSION_STR);
1529
#if QT_VERSION >= 0x040400
1533
printf(", expected version 4.4.0 or higher\n");
1538
for q in $QT4DIR; do
1539
INCQT4="$q/include $q/include/QtCore"
1540
FLGQT4="-DQT_SHARED"
1541
I_INCQT4=`prefix_I "$INCQT4"`
1542
LIBQT4="-L$q/lib -lQtCoreVBox"
1543
if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
1547
LIBQT4="-L$q/lib -lQtCore"
1548
if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
1555
if [ -n "$foundqt4" ]; then
1556
cat > $ODIR.tmp_src.cc << EOF
1559
extern "C" int main(void)
1561
printf("found version %s", QT_VERSION_STR);
1562
#if QT_VERSION >= 0x040400
1566
printf(", expected version 4.4.0 or higher\n");
1571
[ -n "$INCQT4" ] && I_INCQT4=`prefix_I "$INCQT4"`
1572
if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
1573
if test_execute_path "`strip_L "$LIBQT4"`"; then
1574
if [ "$OS" = "darwin" ]; then
1575
# Successful build & run the test application so add the necessary
1576
# params to AutoConfig.kmk
1577
cnf_append "PATH_SDK_QT4_INC" "$PATH_SDK_QT4/Frameworks"
1578
cnf_append "PATH_SDK_QT4_LIB" "$PATH_SDK_QT4/Frameworks"
1579
cnf_append "PATH_SDK_QT4" "$PATH_SDK_QT4/Frameworks"
1580
# Check for the moc tool in the Qt directory found & some standard
1582
for q in $PATH_SDK_QT4 /usr /Developer/Tools/Qt; do
1583
if which_wrapper "$q/bin/moc" > /dev/null; then
1584
cnf_append "PATH_TOOL_QT4" "$q"
1585
cnf_append "PATH_TOOL_QT4_BIN" "$q/bin"
1589
# strip .../QtCore as we add components ourself
1590
INCQT4=`echo "$INCQT4"|$KBUILD_SED 's|\([^ ]*\)/QtCore|\1|g; s| $||g'`
1591
# store only the first path, remove all other pathes
1592
# most likely pkg-config gave us -I/usr/include/qt4 -I/usr/include/qt4/QtCore
1593
INCQT4=`echo "$INCQT4"|$KBUILD_SED 's|\([^ ]*\) .*|\1|'`
1594
cnf_append "VBOX_PATH_QT4_LIB" "`strip_L "$LIBQT4"`"
1595
cnf_append "SDK_QT4_LIBPATH" "`strip_L "$LIBQT4"`"
1596
cnf_append "PATH_SDK_QT4_INC" "$INCQT4"
1597
# this is not quite right since the qt libpath does not have to be first...
1598
cnf_append "PATH_SDK_QT4_LIB" '$'"(firstword `strip_L "$LIBQT4"`)"
1599
if [ "$foundqt4" = "2" ]; then
1600
cnf_append "VBOX_WITH_QT4_SUN" "1"
1602
test_header "Qt4 devtools"
1603
for q in $QT4DIR; do
1604
# first try it with a suffix, some platforms use that
1605
if which_wrapper "$q/bin/moc-qt4" > /dev/null; then
1606
moc_ver=`$q/bin/moc-qt4 -v 2>&1|sed 's+^.*(Qt \(.*\))+\1+'`
1607
if [ $? -ne 0 ]; then
1608
log_failure "moc-qt4 not working"
1611
log_success "found version $moc_ver"
1612
cnf_append "VBOX_PATH_QT4" "$q"
1613
cnf_append "PATH_SDK_QT4" "$q"
1614
cnf_append "PATH_TOOL_QT4" "$q"
1615
cnf_append "PATH_TOOL_QT4_BIN" "$q/bin"
1616
cnf_append "TOOL_QT4_BIN_SUFF" "-qt4"
1619
elif which_wrapper "$q/bin/moc" > /dev/null; then
1620
moc_ver=`$q/bin/moc -v 2>&1|sed 's+^.*(Qt \(.*\))+\1+'`
1621
if [ $? -ne 0 ]; then
1622
log_failure "moc not working"
1625
log_success "found version $moc_ver"
1626
cnf_append "VBOX_PATH_QT4" "$q"
1627
cnf_append "PATH_SDK_QT4" "$q"
1628
cnf_append "PATH_TOOL_QT4" "$q"
1629
cnf_append "PATH_TOOL_QT4_BIN" "$q/bin"
1637
log_failure "qt4 not working"
1641
log_failure "qt4 not found"
1648
# Check whether static libstdc++ is installed. This library is required
1649
# for the Linux guest additions.
1651
check_staticlibstdcxx()
1653
test_header "static stc++ library"
1654
libstdcxx=`$CXX -print-file-name=libstdc++.a`
1655
cat > $ODIR.tmp_src.cc << EOF
1658
extern "C" int main(void)
1660
std::string s = "test";
1664
if test_compile "$libstdcxx" libstdc++ libstdc++; then
1671
# Check for Linux sources
1675
test_header "Linux kernel sources"
1676
cat > $ODIR.tmp_src.c << EOF
1677
#include <linux/version.h>
1678
int printf(const char *format, ...);
1681
printf("found version %d.%d.%d", LINUX_VERSION_CODE / 65536,
1682
(LINUX_VERSION_CODE % 65536) / 256,
1683
LINUX_VERSION_CODE % 256);
1684
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,0)
1688
printf(", expected version 2.4.0 or higher\n");
1693
echo "compiling the following source file:" >> $LOG
1694
cat $ODIR.tmp_src.c >> $LOG
1695
echo "using the following command line:" >> $LOG
1696
echo "$CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include" >> $LOG
1697
$CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include >> $LOG 2>&1
1698
if [ $? -ne 0 ]; then
1700
echo " Linux kernel headers not found at $LINUX"
1701
echo " Check the file $LOG for detailed error information."
1704
if test_execute; then
1705
cnf_append "VBOX_LINUX_SRC" "`cd $LINUX ; pwd`"
1712
# Check for kchmviewer, needed to display the online help
1713
# (unused as we ship kchmviewer)
1717
test_header kchmviewer
1718
if check_avail "$KCHMVIEWER" KCHMVIEWER; then
1719
kchmviewer_ver=`$KCHMVIEWER --version|grep "^KchmViewer:"|sed 's+^KchmViewer: \(.*\)+\1+'`
1720
if [ $? -ne 0 ]; then
1721
log_failure "kchmviewer not working"
1724
log_success "found version $kchmviewer_ver"
1731
# Check for the kBuild tools, we don't support GNU make
1736
if which_wrapper "$KBUILDDIR/bin/$OS.$BUILD_MACHINE/kmk" > /dev/null; then
1737
KBUILDDIR_BIN="$KBUILDDIR/bin/$OS.$BUILD_MACHINE"
1738
echo "PATH_KBUILD=\"`cd $KBUILDDIR ; pwd`\"" >> $ENV
1739
echo "export PATH_KBUILD" >> $ENV
1740
echo "PATH_DEVTOOLS=\"$DEVDIR\"" >> $ENV
1741
echo "export PATH_DEVTOOLS" >> $ENV
1742
echo "path_kbuild_bin=\"\$PATH_KBUILD/bin/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"" >> $ENV
1743
echo "export PATH_KBUILD_BIN" >> $ENV
1744
echo "path_dev_bin=\"\$PATH_DEVTOOLS/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"/bin" >> $ENV
1745
if [ "$OS" = "solaris" ]; then
1746
# Because of sh being non-default shell in Solaris we need to export PATH again when
1747
# sourcing env.sh. Simply exporting from ./configure does not export PATH correctly.
1748
echo "PATH=\"$ORGPATH\"" >> $ENV
1749
echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
1750
echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
1752
echo "echo \"\$PATH\" | grep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
1753
echo "echo \"\$PATH\" | grep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
1755
echo "export PATH" >> $ENV
1756
echo "unset path_kbuild_bin path_dev_bin" >> $ENV
1757
KBUILD_SED="$KBUILDDIR_BIN/kmk_sed"
1758
elif [ "$OS.$BUILD_MACHINE" = "darwin.amd64" ]; then
1759
# Currently there are no amd64 kBuild bins. So use the x86 variant in any case.
1760
KBUILDDIR_BIN="$KBUILDDIR/bin/$OS.x86"
1761
echo "PATH_KBUILD=\"`cd $KBUILDDIR ; pwd`\"" >> $ENV
1762
echo "export PATH_KBUILD" >> $ENV
1763
echo "PATH_DEVTOOLS=\"$DEVDIR\"" >> $ENV
1764
echo "export PATH_DEVTOOLS" >> $ENV
1765
echo "path_kbuild_bin=\"\$PATH_KBUILD/bin/\$BUILD_TARGET.x86\"" >> $ENV
1766
echo "PATH_KBUILD_BIN=\"\$path_kbuild_bin\"" >> $ENV
1767
echo "export PATH_KBUILD_BIN" >> $ENV
1768
echo "path_dev_bin=\"\$PATH_DEVTOOLS/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"/bin" >> $ENV
1769
echo "echo \"\$PATH\" | grep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
1770
echo "echo \"\$PATH\" | grep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
1771
echo "export PATH" >> $ENV
1772
echo "unset path_kbuild_bin path_dev_bin" >> $ENV
1773
KBUILD_SED="$KBUILDDIR_BIN/kmk_sed"
1774
elif check_avail "kmk" KBUILDDIR really; then
1775
# check for installed kBuild
1776
KBUILD_SED="`which_wrapper kmk_sed`"
1785
# Check for compiler.h
1786
# Some Linux distributions include "compiler.h" in their libc linux
1787
# headers package, some don't. Most don't need it, building might (!)
1788
# not succeed on openSUSE without it.
1790
# See http://www.mail-archive.com/qemu-devel%40nongnu.org/msg07980.html
1794
test_header compiler.h
1795
if ! test -f "/usr/include/linux/compiler.h"; then
1796
log_success "compiler.h not found"
1798
cnf_append "VBOX_WITH_LINUX_COMPILER_H" "1"
1799
log_success "compiler.h found"
1805
# Required to pass CAP_NET_RAW to our binaries to allow to open SOCK_RAW
1806
# sockets for doing ICMP requests.
1810
test_header "libcap library"
1811
cat > $ODIR.tmp_src.cc << EOF
1813
#include <sys/types.h>
1814
#include <sys/capability.h>
1816
extern "C" int main(void)
1819
cap_t caps = cap_get_proc();
1820
snprintf(buf, sizeof(buf), "Current caps are '%s'\n", cap_to_text(caps, NULL));
1824
if test_compile $LIBCAP libcap libcap; then
1825
if test_execute; then
1832
# Check if we are able to build 32-bit applications (needed for the guest additions)
1836
test_header "32-bit support"
1837
cat > $ODIR.tmp_src.c << EOF
1844
echo "compiling the following source file:" >> $LOG
1845
cat $ODIR.tmp_src.c >> $LOG
1846
echo "using the following command line:" >> $LOG
1847
echo "$CC -m32 -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c" >> $LOG
1848
$CC -m32 -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c >> $LOG 2>&1
1849
if [ $? -ne 0 ]; then
1851
echo " Cannot compile 32-bit applications (missing headers and/or libraries)!"
1852
echo " Check the file $LOG for detailed error information."
1855
echo "executing the binary" >> $LOG
1856
$ODIR.tmp_out 2> $ODIR.test_execute.log
1858
cat $ODIR.test_execute.log >> $LOG
1859
if [ $rc -ne 0 ]; then
1861
echo " Cannot execute 32-bit applications! Either enable 32-bit support in the"
1862
echo " kernel configuration or use --disable-vmmraw to disable 32-bit guests."
1876
test_header "Python support"
1878
# On darwin this is a on/off decision only
1879
if [ "$OS" = "darwin" ]; then
1881
cnf_append "VBOX_WITH_PYTHON" "1"
1885
cat > $ODIR.tmp_src.cc << EOF
1888
extern "C" int main(void)
1891
printf("found version %s", PY_VERSION);
1892
#if PY_VERSION_HEX >= 0x02030000
1896
printf(", expected version 2.3 or higher\n");
1902
# For Solaris we use libpython2.4 for compatibility with Solaris 10 and passing IPS pkg audit
1903
if [ "$OS" != "solaris" ]; then
1904
SUPPYTHONLIBS="python2.7 python2.6 python2.5 python2.4 python2.3"
1906
SUPPYTHONLIBS="python2.4"
1908
for p in $PYTHONDIR; do
1909
for d in $SUPPYTHONLIBS; do
1910
for b in lib64 lib/64 lib; do
1911
echo "compiling the following source file:" >> $LOG
1912
cat $ODIR.tmp_src.cc >> $LOG
1913
echo "using the following command line:" >> $LOG
1914
echo "$CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so" >> $LOG
1915
$CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so >> $LOG 2>&1
1916
if [ $? -eq 0 ]; then
1921
if [ -n "$found" ]; then break; fi
1923
if [ -n "$found" ]; then break; fi
1925
if [ -n "$found" ]; then
1926
if test_execute; then
1927
cnf_append "VBOX_WITH_PYTHON" "1"
1928
cnf_append "VBOX_PATH_PYTHON_INC" "$p/include/$d"
1929
cnf_append "VBOX_LIB_PYTHON" "$p/$b/lib$d.so"
1931
log_failure "Python not working"
1935
log_failure "Python not found"
1946
test_header "Java support"
1956
test_header "Wine support"
1957
if ! which_wrapper wine > /dev/null; then
1958
echo " wine binary not found"
1961
if ! which_wrapper wineprefixcreate > /dev/null; then
1962
echo " wineprefixcreate not found"
1965
export WINEPREFIX="${ODIR}wine.$BUILD_MACHINE"
1966
echo "WINEPREFIX=\"${ODIR}wine.$BUILD_MACHINE\"" >> $ENV
1967
echo "export WINEPREFIX" >> $ENV
1969
mkdir -p $WINEPREFIX
1970
touch $WINEPREFIX/.no_prelaunch_window_flag
1971
if ! wineprefixcreate -q > /dev/null 2>&1; then
1972
echo " wineprefixcreate failed"
1977
echo 'REGEDIT4' > $tmp
1979
echo '[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment]' >> $tmp
1980
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
1982
echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhc.exe\DllOverrides]' >> $tmp
1983
echo '"itss"="native"' >> $tmp
1985
echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhw.exe\DllOverrides]' >> $tmp
1986
echo '"itss"="native"' >> $tmp
1988
if ! wine regedit $tmp > /dev/null 2>&1; then
1990
echo " failed to load registry changes (path)."
2003
test_header "GSOAP compiler"
2004
if [ -z "$GSOAP" ]; then
2007
if which_wrapper "$GSOAP/bin/soapcpp2" > /dev/null; then
2008
if which_wrapper "$GSOAP/bin/wsdl2h" > /dev/null; then
2009
if [ -f "$GSOAP/include/stdsoap2.h" ]; then
2010
# TODO: Check for libgsoap++.a/so
2012
if [ -z "$GSOAP_IMPORT" ]; then
2013
GSOAP_IMPORT="$GSOAP/share/gsoap/import"
2014
if [ ! -d "$GSOAP_IMPORT" -a -d "$GSOAP/include/gsoap" ]; then
2015
GSOAP_IMPORT="$GSOAP/include/gsoap"
2018
if [ -f "$GSOAP_IMPORT/stlvector.h" ]; then
2019
cnf_append "VBOX_GSOAP_INSTALLED" "1"
2020
cnf_append "VBOX_PATH_GSOAP" "$GSOAP"
2021
cnf_append "VBOX_PATH_GSOAP_IMPORT" "$GSOAP_IMPORT"
2022
if [ -f "$GSOAP/share/gsoap/stdsoap2.cpp" ]; then
2023
cnf_append "VBOX_GSOAP_CXX_SOURCES" "$GSOAP/share/gsoap/stdsoap2.cpp"
2025
cnf_append "VBOX_GSOAP_CXX_SOURCES" ""
2027
cnf_append "VBOX_GSOAP_CXX_LIBS" "libgsoap++"
2030
log_failure "stlvector.h not found -- disabling webservice"
2031
cnf_append "VBOX_WITH_WEBSERVICES" ""
2034
log_failure "stdsoap2.h not found -- disabling webservice"
2035
cnf_append "VBOX_WITH_WEBSERVICES" ""
2038
log_failure "wsdl2h not found -- disabling webservice"
2039
cnf_append "VBOX_WITH_WEBSERVICES" ""
2042
log_failure "soapcpp2 not found -- disabling webservice"
2043
cnf_append "VBOX_WITH_WEBSERVICES" ""
2049
# Determines the Darwin version.
2050
# @todo This should really check the Xcode/SDK version.
2052
check_darwinversion()
2054
test_header "Darwin version"
2055
darwin_ver=`uname -r`
2056
case "$darwin_ver" in
2059
if [ "$BUILD_MACHINE" = "x86" ]; then
2060
sdk=/Developer/SDKs/MacOSX10.5.sdk
2061
CXX_FLAGS="-mmacosx-version-min=10.5 -isysroot $sdk -Wl,-syslibroot,$sdk"
2062
cnf_append "VBOX_MACOS_10_5_WORKAROUND" "1"
2064
sdk=/Developer/SDKs/MacOSX10.6.sdk
2065
CXX_FLAGS="-mmacosx-version-min=10.6 -isysroot $sdk -Wl,-syslibroot,$sdk"
2067
# test "$CC" = "gcc" && CC="gcc-4.0"
2068
# test "$CXX" = "g++" && CXX="g++-4.0"
2072
sdk=/Developer/SDKs/MacOSX10.5.sdk
2073
CXX_FLAGS="-mmacosx-version-min=10.5 -isysroot $sdk -Wl,-syslibroot,$sdk"
2074
# test "$CC" = "gcc" && CC="gcc-4.0"
2075
# test "$CXX" = "g++" && CXX="g++-4.0"
2076
cnf_append "VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6" "1"
2077
cnf_append "VBOX_MACOS_10_5_WORKAROUND" "1"
2081
sdk=/Developer/SDKs/MacOSX10.4u.sdk
2082
CXX_FLAGS="-mmacosx-version-min=10.4 -isysroot $sdk -Wl,-syslibroot,$sdk"
2083
# test "$CC" = "gcc" && CC="gcc-4.0"
2084
# test "$CXX" = "g++" && CXX="g++-4.0"
2085
cnf_append "VBOX_WITH_COCOA_QT" ""
2086
cnf_append "VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6" "1"
2089
echo " failed to determine Darwin version. (uname -r: $darwin_ver)"
2091
darwin_ver="unknown"
2094
log_success "found version $darwin_ver (SDK: $sdk)"
2100
test_header "makeself"
2101
if check_avail "$MAKESELF" makeself; then
2102
makeself_ver=`$MAKESELF --version|grep version|sed 's+^Makeself.*version \([0-9\.]*\).*+\1+'`
2103
if [ $? -ne 0 ]; then
2104
log_failure "makeself not working"
2107
log_success "found version $makeself_ver"
2108
cnf_append "VBOX_MAKESELF" "`which_wrapper $MAKESELF`"
2115
# Checks that i386-elf-gcc-3.4.6, i386-elf-gcc-3.4.3, i386-elf-gcc-3.4 or i386-elf-gcc
2116
# is around to prevent confusion when the build fails in src/recompiler.
2117
# Note. Keep the which order in sync with the $(which ) in src/recompiler/Makefile.kmk.
2121
test_header "i386-elf-gcc"
2122
i386_elf_gcc=`which_wrapper i386-elf-gcc-3.4.6`
2123
test -z "$i386_elf_gcc" && i386_elf_gcc=`which_wrapper i386-elf-gcc-3.4.3`
2124
test -z "$i386_elf_gcc" && i386_elf_gcc=`which_wrapper i386-elf-gcc-3.4`
2125
test -z "$i386_elf_gcc" && i386_elf_gcc=`which_wrapper i386-elf-gcc`
2126
if test -z "$i386_elf_gcc"; then
2127
echo " failed to find i386-elf-gcc"
2130
log_success "found $i386_elf_gcc"
2140
Usage: ./configure [OPTIONS]...
2143
-h, --help display this help and exit
2144
--nofatal don't abort on errors
2146
[ $WITH_XPCOM -eq 1 ] && echo " --disable-xpcom disable XPCOM and related stuff"
2147
[ $WITH_PYTHON -eq 1 ] && echo " --disable-python disable python bindings"
2148
[ $WITH_JAVA -eq 1 ] && echo " --disable-java disable java bindings"
2149
[ $WITH_VMMRAW -eq 1 ] && echo " --disable-vmmraw disable VMM raw mode (VT-x/AMD-V mandatory!)"
2150
[ $WITH_SDL_TTF -eq 1 ] && echo " --disable-sdl-ttf disable SDL_ttf detection"
2151
[ $WITH_ALSA -eq 1 ] && echo " --disable-alsa disable the ALSA sound backend"
2152
[ $WITH_PULSE -eq 1 ] && echo " --disable-pulse disable the PulseAudio backend"
2153
[ $WITH_DBUS -eq 1 ] && echo " --disable-dbus don't use DBus and hal for hardware detection"
2154
[ $WITH_KMODS -eq 1 ] && echo " --disable-kmods don't build Linux kernel modules (host and guest)"
2155
[ $WITH_OPENGL -eq 1 ] && echo " --disable-opengl disable OpenGL support (2D & 3D)"
2156
[ $WITH_GSOAP -eq 0 ] && echo " --enable-webservice enable the webservice stuff"
2157
[ $OSE -eq 1 ] && echo " --enable-vnc enable the VNC server"
2158
[ $WITH_DOCS -eq 1 ] && echo " --disable-docs don't build the documentation"
2159
[ "$OS" = "linux" -o "$OS" = "freebsd" ] && echo " --enable-vde enable VDE networking"
2161
--disable-hardening don't be strict about /dev/vboxdrv access
2162
--build-libxml2 build libxml2 from sources
2163
--build-libxslt build libxslt from sources
2165
[ $OSE -eq 0 ] && cat << EOF
2166
--build-libssl build openssl from sources
2167
--build-libcurl build libcurl from sources
2169
[ "$OS" != "darwin" ] && echo " --setup-wine setup a Wine directory and register the hhc hack"
2173
--with-gcc=PATH location of the gcc compiler [$CC]
2174
--with-g++=PATH location of the g++ compiler [$CXX]
2175
--with-kbuild=DIR kbuild directory [$KBUILDDIR]
2176
--with-iasl=PATH location of the iasl compiler [$IASL]
2177
--with-mkisofs=PATH location of mkisofs [$MKISOFS]
2179
[ "$OS" = "linux" ] && echo " --with-linux=DIR Linux kernel source directory [$LINUX]"
2180
[ $WITH_QT4 -eq 1 ] && echo " --with-qt-dir=DIR directory for Qt4 headers/libraries [pkgconfig]"
2181
[ $WITH_GSOAP -eq 1 ] && echo " --with-gsoap-dir=PATH directory for gSOAP compiler/headers/libraries"
2182
[ $WITH_GSOAP -eq 1 ] && echo " (soapcpp2 and wsdl2h, soapstd2.h, libgsoap++.a/so)"
2183
[ $WITH_GSOAP -eq 1 ] && echo " --with-gsoap-import=PATH directory for gSOAP import files (stlvector.h)"
2185
--with-openssl-dir=DIR directory for OpenSSL headers/libraries
2186
--out-path=PATH the folder to which configuration and build output
2190
-d, --build-debug build with debugging symbols and assertions
2191
--build-profile build with profiling support
2192
--build-headless build headless (without any GUI frontend)
2202
# test if we are OSE
2203
if [ $OSE -eq 1 -a -r "`cd \`dirname $0\`; pwd`/src/VBox/RDP/server/server.cpp" ]; then
2205
# Set this as a reminder to print a log message once we know the path of the
2210
# Change OS specific defaults; must be before all other stuff
2211
if [ "$OS" = "darwin" ]; then
2221
[ $OSE -eq 1 ] || BUILD_LIBCURL=1
2222
[ $OSE -eq 1 ] || BUILD_LIBSSL=1
2226
# scan command line options
2227
for option in $*; do
2239
CC=`echo $option | cut -d'=' -f2`
2242
CXX=`echo $option | cut -d'=' -f2`
2245
KBUILDDIR=`echo $option | cut -d'=' -f2`
2246
if echo $KBUILDDIR|grep -q "$INVALID_CHARS"; then
2247
echo "Error: KBUILDDIR contains invalid characters!"
2251
--with-qt-dir=*|--with-qt4-dir=*)
2252
QT4DIR=`echo $option | cut -d'=' -f2`
2255
--with-openssl-dir=*)
2256
OPENSSLDIR=`echo $option | cut -d'=' -f2`
2257
INCCRYPTO="-I${OPENSSLDIR}/include"
2258
LIBCRYPTO="${OPENSSLDIR}/lib/libcrypto.a"
2261
GSOAP=`echo $option | cut -d'=' -f2`
2263
--with-gsoap-import=*)
2264
GSOAP_IMPORT=`echo $option | cut -d'=' -f2`
2267
IASL=`echo $option | cut -d'=' -f2`
2270
LINUX=`echo $option | cut -d'=' -f2`
2273
MKISOFS=`echo $option | cut -d'=' -f2`
2276
TARGET_MACHINE=`echo $option | cut -d'=' -f2`
2279
[ $WITH_XPCOM -eq 1 ] && WITH_XPCOM=0
2282
[ $WITH_PYTHON -eq 1 ] && WITH_PYTHON=0
2285
[ $WITH_JAVA -eq 1 ] && WITH_JAVA=0
2288
[ $WITH_VMMRAW -eq 1 ] && WITH_VMMRAW=0
2291
[ $WITH_SDL_TTF -eq 1 ] && WITH_SDL_TTF=0
2294
[ $WITH_QT4 -eq 1 ] && WITH_QT4=0
2297
[ $WITH_QT4 -eq 1 ] && WITH_QT4=0
2303
[ $WITH_ALSA -eq 1 ] && WITH_ALSA=0
2306
[ $WITH_PULSE -eq 1 ] && WITH_PULSE=0
2312
[ $WITH_DBUS -eq 1 ] && WITH_DBUS=0
2315
[ $WITH_KMODS -eq 1 ] && WITH_KMODS=0
2318
[ $WITH_OPENGL -eq 1 ] && WITH_OPENGL=0
2320
--enable-webservice)
2321
[ $WITH_GSOAP -eq 0 ] && WITH_GSOAP=1
2326
--disable-hardening)
2368
ODIR="`echo $option | cut -d'=' -f2`/"
2372
out_path="`echo $option | cut -d'=' -f2`/"
2373
if [ -d $out_path ]; then
2379
if [ $ODIR_OVERRIDE -eq 0 ]; then
2380
# This variable has not *yet* been overridden. That can still happen.
2384
echo "Error: invalid folder \"$out_path\" in option \"$option\""
2389
[ "$OS" != "darwin" ] && SETUP_WINE=1
2393
echo "Unrecognized option \"$option\""
2404
# initialize output files
2406
# Log file generated by
2415
# automatically generated by
2419
# It will be completely overwritten if configure is executed again.
2426
# automatically generated by
2430
# It will be completely overwritten if configure is executed again.
2431
# Make sure you source this file once before you start to build VBox.
2436
# Print log warning about OSE if necessary
2437
if [ -n "$NOT_OSE" ]; then
2438
echo "Found RDP server, assuming VBOX_OSE = FALSE" >> $LOG
2443
if [ "$BUILD_TYPE" = "debug" ]; then
2444
echo "Creating DEBUG build!" >> $LOG
2445
elif [ "$BUILD_TYPE" = "profile" ]; then
2446
echo "Creating PROFILE build!" >> $LOG
2449
# first determine our environment
2453
[ -n "$ENV_ONLY" ] && exit 0
2455
# append the tools directory to the default search path
2456
echo "$PATH" | grep -q "$DEVDIR_BIN" || PATH="$PATH:$DEVDIR_BIN"
2459
# if we will be writing to a different out directory then set this up now
2460
if [ $OUT_PATH_OVERRIDE -eq 1 ]; then
2461
echo "AUTOCFG=$OUT_PATH/AutoConfig.kmk" >> $ENV
2462
echo "export AUTOCFG" >> $ENV
2463
echo "LOCALCFG=$OUT_PATH/LocalConfig.kmk" >> $ENV
2464
echo "export LOCALCFG" >> $ENV
2465
echo "PATH_OUT_BASE=$OUT_PATH" >> $ENV
2466
echo "export PATH_OUT_BASE" >> $ENV
2469
# some things are not available in for OSE
2470
if [ $OSE -ge 1 ]; then
2471
cnf_append "VBOX_OSE" "1"
2472
cnf_append "VBOX_WITH_TESTSUITE" ""
2473
cnf_append "VBOX_WITH_WIN32_ADDITIONS" ""
2475
if [ "$OS" = "linux" ]; then
2476
cnf_append "VBOX_WITH_LINUX_ADDITIONS" "1"
2478
cnf_append "VBOX_WITH_LINUX_ADDITIONS" ""
2484
if [ -n "$HEADLESS" ]; then
2485
cnf_append "VBOX_HEADLESS" "1"
2488
# emit disable directives corresponding to any --disable-xxx options.
2489
if [ $WITH_OPENGL -eq 0 ]; then
2490
cnf_append "VBOX_WITH_CROGL" ""
2491
cnf_append "VBOX_WITH_VIDEOHWACCEL" ""
2492
cnf_append "VBOX_GUI_USE_QGL" ""
2494
[ $WITH_XPCOM -eq 0 ] && cnf_append "VBOX_WITH_MAIN" ""
2495
[ $WITH_QT4 -eq 0 ] && cnf_append "VBOX_WITH_QTGUI" ""
2496
[ $WITH_SDL_TTF -eq 0 ] && cnf_append "VBOX_WITH_SECURELABEL" ""
2497
[ $WITH_PYTHON -eq 0 ] && cnf_append "VBOX_WITH_PYTHON" ""
2498
[ $WITH_JAVA -eq 0 ] && cnf_append "VBOX_WITH_JXPCOM" ""
2499
[ $WITH_HARDENING -eq 0 ] && cnf_append "VBOX_WITHOUT_HARDENING" "1"
2500
[ $WITH_HARDENING -eq 2 ] && cnf_append "VBOX_WITH_HARDENING" "2"
2501
[ $WITH_VMMRAW -eq 0 ] && cnf_append "VBOX_WITH_RAW_MODE" ""
2504
if [ "$OS" = "darwin" ]; then
2509
[ "$OS" != "darwin" ] && check_as86
2510
[ "$OS" != "darwin" ] && check_bcc
2511
[ "$OS" != "darwin" ] && check_iasl
2512
# don't check for yasm for the time beeing as 0.40 and 0.50 both have known bugs
2513
# [ "$OS" != "darwin" ] && check_yasm
2514
[ "$OS" != "darwin" ] && check_xsltproc
2515
[ "$OS" != "darwin" ] && check_mkisofs
2518
[ "$OS" != "darwin" ] && check_pthread
2520
[ $WITH_XPCOM -eq 1 ] && check_libxslt
2521
[ $WITH_LIBIDL -eq 1 ] && check_libidl
2524
[ "$OS" != "darwin" ] && check_z
2525
[ "$OS" != "darwin" ] && check_png
2526
[ $OSE -eq 0 -a "$OS" = "linux" ] && check_pam
2527
[ $WITH_SDL -eq 1 ] && check_sdl
2528
[ $WITH_SDL_TTF -eq 1 -a $OSE -eq 0 ] && check_sdl_ttf
2529
[ $WITH_X11 -eq 1 ] && check_x
2530
# TODO check for xcomposite-dev (X11/extensions/Xcomposite.h, additions only)
2531
# TODO check for libxdamange-dev (X11/extensions/Xdamage.h, additions only)
2532
[ $WITH_X11 -eq 1 ] && check_xcursor
2533
[ $WITH_X11 -eq 1 ] && check_xinerama
2534
[ $WITH_X11 -eq 1 ] && check_xrandr
2535
[ $WITH_OPENGL -eq 1 ] && check_opengl
2536
[ $WITH_QT4 -eq 1 ] && check_qt4
2537
[ $WITH_PYTHON -eq 1 ] && check_python
2538
[ $WITH_JAVA -eq 1 ] && check_java
2541
if [ "$OS" = "linux" -o "$OS" = "freebsd" ]; then
2542
if [ $WITH_PULSE -eq 1 ]; then
2544
elif [ $WITH_PULSE -eq 0 ]; then
2545
cnf_append "VBOX_WITH_PULSE" ""
2550
if [ "$OS" = "linux" ]; then
2551
# don't check for the static libstdc++ in the PUEL version as we build the
2552
# additions at a dedicated box
2553
[ $OSE -ge 1 ] && check_staticlibstdcxx
2554
if [ $WITH_KMODS -eq 1 ]; then
2557
cnf_append "VBOX_LINUX_SRC" ""
2558
cnf_append "VBOX_WITH_VBOXDRV" ""
2559
cnf_append "VBOX_WITH_ADDITION_DRIVERS" ""
2561
if [ $WITH_ALSA -eq 1 ]; then
2564
cnf_append "VBOX_WITH_ALSA" ""
2566
if [ $WITH_DBUS -eq 0 ]; then
2567
cnf_append "VBOX_WITH_DBUS" ""
2571
[ "$BUILD_MACHINE" = "amd64" -a $WITH_VMMRAW -eq 1 ] && check_32bit
2572
# tools/common/makeself*
2573
[ $OSE -ge 1 ] && check_makeself
2576
[ -n "$SETUP_WINE" ] && setup_wine
2578
if [ $OSE -ge 1 ]; then
2579
if [ $WITH_GSOAP -eq 1 ]; then
2582
cnf_append "VBOX_WITH_WEBSERVICES" ""
2587
if [ "$OS" = "linux" -o "$OS" = "freebsd" ]; then
2588
if [ $WITH_VDE -eq 1 ]; then
2589
cnf_append "VBOX_WITH_VDE" "1"
2594
if [ $WITH_DOCS -eq 0 ]; then
2595
cnf_append "VBOX_WITH_DOCS" ""
2596
cnf_append "VBOX_WITH_DOCS_PACKING" ""
2599
# VNC server support
2600
if [ $OSE -ge 1 ]; then
2601
if [ $WITH_VNC = 1 ]; then
2604
cnf_append "VBOX_WITH_VNC" ""
2610
echo "Successfully generated '$CNF' and '$ENV'."
2611
echo "Source '$ENV' once before you start to build VBox:"
2616
if [ "$OS" = "linux" ]; then
2617
if [ $OUT_PATH_OVERRIDE -eq 1 ]; then
2618
vbox_out_path=$OUT_PATH
2622
echo "To compile the kernel modules, do:"
2624
echo " cd $vbox_out_path/$OS.$TARGET_MACHINE/$BUILD_TYPE/bin/src"
2628
if [ $WITH_HARDENING -gt 0 ]; then
2630
echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
2631
echo " Hardening is enabled which means that the VBox binaries will not run from"
2632
echo " the binary directory. The binaries have to be installed suid root and some"
2633
echo " more prerequisites have to be fulfilled which is normally done by installing"
2634
echo " the final package. For development, the hardening feature can be disabled"
2635
echo " by specifying the --disable-hardening parameter. Please never disable that"
2636
echo " feature for the final distribution!"
2637
echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
2641
echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
2642
echo " Hardening is disabled. Please do NOT build packages for distribution with"
2643
echo " disabled hardening!"
2644
echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"