VirtualBox

source: vbox/trunk/configure@ 34959

Last change on this file since 34959 was 34466, checked in by vboxsync, 14 years ago

Made RTManifest a build program, this drags in IPRT and libcrypto into the build program run.

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
File size: 67.2 KB
Line 
1#!/bin/sh
2# The purpose of this script is to check for all external tools, headers, and
3# libraries VBox OSE depends on.
4
5#
6# Copyright (C) 2006-2009 Oracle Corporation
7#
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.
15#
16
17LC_ALL=C
18export LC_ALL
19
20# append some extra paths
21PATH="$PATH:/opt/gnome/bin"
22# Solaris (order of paths important for tr, echo, grep, sed to work)
23PATH="/usr/xpg4/bin:/usr/ucb:$PATH:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin"
24ORGPATH=$PATH
25
26# Wrapper for ancient /usr/bin/which on darwin that always returns 0
27which_wrapper()
28{
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"
32 else
33 have_ancient_which="no"
34 fi
35 fi
36 if [ "$have_ancient_which" = "yes" ]; then
37 retval=`which $* 2>/dev/null`
38 echo "$retval"
39 test -n "$retval" -a -x "$retval"
40 unset retval
41 else
42 which $* 2> /dev/null
43 fi
44}
45
46OS=`uname -s | sed -e 's/GNU\/Linux/Linux/g' | tr [:upper:] [:lower:]`
47case "$OS" in
48 linux)
49 ;;
50 darwin)
51 ;;
52 freebsd)
53 ;;
54 sunos)
55 OS='solaris'
56 ;;
57 *)
58 echo "Cannot determine OS!"
59 exit 1
60 ;;
61esac
62
63#
64# Defaults
65#
66OSE=1
67ODIR="`pwd`/"
68ODIR_OVERRIDE=0
69OUT_PATH=""
70OUT_PATH_OVERRIDE=0
71SETUP_WINE=
72TARGET_MACHINE=""
73TARGET_CPU=""
74WITH_XPCOM=1
75WITH_PYTHON=1
76WITH_JAVA=1
77WITH_VMMRAW=1
78WITH_LIBIDL=1
79WITH_GSOAP=0
80WITH_QT4=1
81WITH_SDL=1
82WITH_SDL_TTF=1
83WITH_X11=1
84WITH_ALSA=1
85WITH_PULSE=1
86WITH_DBUS=1
87WITH_KMODS=1
88WITH_OPENGL=1
89WITH_HARDENING=1
90WITH_VDE=0
91WITH_DOCS=1
92BUILD_LIBXML2=
93BUILD_LIBXSLT=
94BUILD_LIBCURL=
95BUILD_LIBSSL=
96PASSIVE_MESA=0
97CC="gcc"
98CC32=""
99CC64=""
100CXX="g++"
101CXX32=""
102CXX64=""
103BCC="bcc"
104YASM="yasm"
105IASL="iasl"
106AS86="as86"
107XSLTPROC="xsltproc"
108GENISOIMAGE="genisoimage"
109MKISOFS="mkisofs"
110INCCRYPTO=""
111LIBCRYPTO="-lcrypto"
112LIBPTHREAD="-lpthread"
113LIBCAP="-lcap"
114GSOAP=""
115GSOAP_IMPORT=""
116INCX11="/usr/local/include"
117LIBX11="-L/usr/X11R6/lib -L/usr/X11R6/lib64 -L/usr/local/lib -lXext -lX11"
118LIBXCURSOR="-lXcursor"
119LIBXMU="-lXmu"
120LIBXINERAMA="-lXinerama"
121LIBXRANDR="-lXrandr"
122MAKESELF="makeself"
123MESA="-lGL"
124INCZ=""
125LIBZ="-lz"
126CXX_FLAGS=""
127if [ "$OS" = "freebsd" ]; then
128 INCCURL="-I/usr/local/include"
129 LIBCURL="-L/usr/local/lib -lcurl"
130 INCPULSE="-I/usr/local/include"
131 LIBPULSE="-L/usr/local/lib"
132 INCPNG="-I/usr/local/include"
133 LIBPNG="-L/usr/local/lib -lpng"
134else
135 INCCURL=""
136 LIBCURL="-lcurl"
137 INCPNG=""
138 LIBPNG="-lpng"
139fi
140PKGCONFIG="`which_wrapper pkg-config`"
141PYTHONDIR="/usr /usr/local"
142QT4DIR="/usr/lib/qt4 /usr/share/qt4 /usr/lib64/qt4 /usr /usr/local"
143QT4DIR_PKGCONFIG=1
144QT4UIC3DIR="/usr/bin"
145KBUILDDIR="`cd \`dirname $0\`; pwd`/kBuild"
146DEVDIR="`cd \`dirname $0\`; pwd`/tools"
147if [ -d "/lib/modules/`uname -r`/build" ]; then
148 LINUX="/lib/modules/`uname -r`/build"
149else
150 LINUX="/usr/src/linux"
151fi
152KCHMVIEWER="kchmviewer"
153LOG="configure.log"
154CNF="AutoConfig.kmk"
155ENV="env.sh"
156BUILD_TYPE="release"
157# the restricting tool is ar (mri mode).
158INVALID_CHARS="[^A-Za-z0-9/\\$:._-]"
159
160if (cd `dirname $0`; pwd)|grep -q "$INVALID_CHARS"; then
161 echo "Error: VBox base path contains invalid characters!"
162 exit 1
163fi
164
165# darwin /bin/sh has a builtin echo that doesn't grok -n. gotta love it.
166if [ "$OS" = "darwin" ]; then
167 ECHO_N="/bin/echo -n"
168else
169 ECHO_N="echo -n"
170fi
171
172
173cleanup()
174{
175 rm -f $ODIR.tmp_src.cc $ODIR.tmp_src.c $ODIR.tmp_out $ODIR.test_execute.log
176}
177
178fail()
179{
180 if [ -z "$nofatal" -o "x$1" != "x" ]; then
181 cleanup
182 rm -f $ENV
183 echo "Check $LOG for details"
184 exit 1
185 fi
186}
187
188log()
189{
190 echo "$1"
191 echo "$1" >> $LOG
192}
193
194log_success()
195{
196 if [ -n "$1" ]; then $ECHO_N "$1, "; fi
197 echo "OK."
198 echo "$1" >> $LOG
199 echo >> $LOG
200 echo >> $LOG
201}
202
203log_failure()
204{
205 echo
206 echo " ** $1!"
207 echo "** $1!" >> $LOG
208 echo >> $LOG
209}
210
211cnf_append()
212{
213 printf "%-30s := %s\n" "$1" "$2" >> $CNF
214}
215
216strip_l()
217{
218 echo "$1"|$KBUILD_SED 's|-l\([^ ]\+\)|\1|g; s|^-[^l][^ ]*||g; s| -[^l][^ ]*||g; s|^ ||; s| *$||g'
219}
220
221strip_L()
222{
223 echo "$1"|$KBUILD_SED 's|-L\([^ ]\+\)|\1|g; s|^-[^L][^ ]*||g; s| -[^L][^ ]*||g; s|^ ||; s| *$||g'
224}
225
226strip_I()
227{
228 echo "$1"|$KBUILD_SED 's|-I\([^ ]\+\)|\1|g; s|^-[^I][^ ]*||g; s| -[^I][^ ]*||g; s|^ ||; s| *$||g'
229}
230
231prefix_I()
232{
233 echo "$1"|$KBUILD_SED 's|^\/|-I/|g; s| \/| -I/|g'
234}
235
236check_avail()
237{
238 if [ -z "$1" ]; then
239 log_failure "$2 is empty"
240 fail $3
241 return 1
242 elif which_wrapper $1 > /dev/null; then
243 return 0
244 else
245 log_failure "$1 (variable $2) not found"
246 fail $3
247 return 1
248 fi
249}
250
251
252# Prepare a test
253test_header()
254{
255 echo "***** Checking $1 *****" >> $LOG
256 $ECHO_N "Checking for $1: "
257}
258
259
260# Compile a test
261# $1 compile flags/libs
262# $2 library name
263# $3 package name
264# $4 if this argument is 'nofatal', don't abort
265test_compile()
266{
267 echo "compiling the following source file:" >> $LOG
268 cat $ODIR.tmp_src.cc >> $LOG
269 echo "using the following command line:" >> $LOG
270 echo "$CXX $CXX_FLAGS -g -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc \"$1\"" >> $LOG
271 $CXX $CXX_FLAGS -g -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc $1 >> $LOG 2>&1
272 if [ $? -ne 0 ]; then
273 if [ -z "$4" ]; then
274 echo
275 echo " $2 not found at $1 or $3 headers not found"
276 echo " Check the file $LOG for detailed error information."
277 fail
278 else
279 echo >> $LOG
280 echo >> $LOG
281 fi
282 return 1
283 fi
284 return 0
285}
286
287
288# Execute a compiled test binary
289test_execute()
290{
291 echo "executing the binary" >> $LOG
292 $ODIR.tmp_out > $ODIR.test_execute.log
293 rc=$?
294 cat $ODIR.test_execute.log | tee -a $LOG
295 if [ $rc -ne 0 ]; then
296 fail $1
297 return 1
298 fi
299 echo >> $LOG
300 echo >> $LOG
301 return 0
302}
303
304
305# Execute a compiled test binary
306test_execute_path()
307{
308 echo "executing the binary (LD_LIBRARY_PATH=$1)" >> $LOG
309 LD_LIBRARY_PATH=$1 $ODIR.tmp_out > $ODIR.test_execute.log
310 rc=$?
311 cat $ODIR.test_execute.log | tee -a $LOG
312 if [ $rc -ne 0 ]; then
313 fail
314 return 1
315 fi
316 echo >> $LOG
317 echo >> $LOG
318 return 0
319}
320
321
322#
323# Check for OS, MACHINE, CPU
324#
325check_environment()
326{
327 test_header environment
328 BUILD_CPU=`uname -m`
329 [ "$OS" = "solaris" ] && BUILD_CPU=`isainfo | cut -f 1 -d ' '`
330 case "$BUILD_CPU" in
331 i[3456789]86|x86|i86pc)
332 BUILD_MACHINE='x86'
333 LIB='lib'
334 ;;
335 x86_64|amd64)
336 BUILD_MACHINE='amd64'
337 BUILD_CPU='k8'
338 if [ "$OS" != "solaris" ]; then
339 # on AMD64 systems, 64bit libs are usually located in /usr/lib64
340 # see http://www.pathname.com/fhs/pub/fhs-2.3.html#LIB64
341 LIB='lib64'
342 else
343 # Solaris doesn't seem to subscribe to fhs, libs are usually in
344 # a '64' subdirectory of the standard 'lib' dirs while some 64-bit
345 # alternative binaries can be found in 'amd64' subdirs of the 'bin'
346 # ones. So, in order to find the right stuff (esp. sdl-config) we'll
347 # have to make sure the */bin/amd64 dirs are searched before the */bin
348 # ones. (The sed has some sideeffects, but they shouldn't harm us...)
349 echo "64-bit Solaris detected, hacking the PATH" >> $LOG
350 echo "old PATH: $PATH" >> $LOG
351 PATH=`echo ":$PATH:" | sed -e 's,\(:[^:]*/bin\):,\1/amd64:\1:,g' \
352 -e 's/^:*//' -e 's/:*$//g' -e 's/::*/:/g' `
353 export PATH
354 echo "new PATH: $PATH" >> $LOG
355 LIB='lib/64'
356 fi
357 ;;
358 *)
359 log_failure "Cannot determine system"
360 exit 1
361 ;;
362 esac
363 [ -z "$TARGET_MACHINE" ] && TARGET_MACHINE=$BUILD_MACHINE
364 [ -z "$TARGET_CPU" ] && TARGET_CPU=$BUILD_CPU
365 DEVDIR_BIN="$DEVDIR/$OS.$BUILD_MACHINE/bin"
366 log_success "Determined build machine: $OS.$BUILD_MACHINE, target machine: $OS.$TARGET_MACHINE"
367
368 echo "BUILD_PLATFORM=\"$OS\"" >> $ENV
369 echo "export BUILD_PLATFORM" >> $ENV
370 echo "BUILD_PLATFORM_ARCH=\"$BUILD_MACHINE\"" >> $ENV
371 echo "export BUILD_PLATFORM_ARCH" >> $ENV
372 echo "BUILD_TARGET=\"$OS\"" >> $ENV
373 echo "export BUILD_TARGET" >> $ENV
374 echo "BUILD_TARGET_ARCH=\"$TARGET_MACHINE\"" >> $ENV
375 echo "export BUILD_TARGET_ARCH" >> $ENV
376 echo "BUILD_TARGET_CPU=\"$TARGET_CPU\"" >> $ENV
377 echo "export BUILD_TARGET_CPU" >> $ENV
378 echo "BUILD_TYPE=\"$BUILD_TYPE\"" >> $ENV
379 echo "export BUILD_TYPE" >> $ENV
380}
381
382#
383# Check for gcc with version >= 3.2.
384# We depend on a working gcc, if we fail terminate in every case.
385#
386check_gcc()
387{
388 test_header gcc
389 if check_avail "$CC" CC really; then
390 cc_ver=`$CC -dumpversion` 2>/dev/null
391 if [ $? -ne 0 ]; then
392 log_failure "cannot execute '$CC -dumpversion'"
393 fail really
394 fi
395 if check_avail "$CXX" CXX really; then
396 cxx_ver=`$CXX -dumpversion` 2>/dev/null
397 if [ $? -ne 0 ]; then
398 log_failure "cannot execute '$CXX -dumpversion'"
399 fail really
400 fi
401 cc_maj=`echo $cc_ver|cut -d. -f1`
402 cc_min=`echo $cc_ver|cut -d. -f2`
403 if [ "x$cc_ver" != "x$cxx_ver" ]; then
404 log_failure "gcc version $cc_ver does not match g++ version $cxx_ver"
405 fail really
406 elif [ $cc_maj -eq 4 -a $cc_min -eq 0 -a "$OS" = "darwin" ]; then
407 log_success "found version $cc_ver"
408 # gcc-4.0 is allowed for Darwin only
409 elif [ $cc_maj -lt 3 \
410 -o \( $cc_maj -eq 3 -a $cc_min -lt 2 \) \
411 -o \( $cc_maj -eq 4 -a $cc_min -lt 1 -a "$OS" != "darwin" \) \
412 -o \( $cc_maj -eq 4 -a $cc_min -gt 5 \) \
413 -o $cc_maj -gt 4 ]; then
414 log_failure "gcc version $cc_ver found, expected gcc 3.x with x>1 or gcc 4.x with 0<x<5"
415 fail really
416 else
417 log_success "found version $cc_ver"
418 fi
419 if [ "$BUILD_MACHINE" = "amd64" ]; then
420 [ -z "$CC32" ] && CC32="$CC -m32"
421 [ -z "$CXX32" ] && CXX32="$CXX -m32"
422 else
423 [ -z "$CC32" ] && CC32="$CC"
424 [ -z "$CXX32" ] && CXX32="$CXX"
425 fi
426 if [ "$BUILD_MACHINE" = "x86" -a "$TARGET_MACHINE" = "amd64" ]; then
427 [ -z "$CC64" ] && CC64="$CC -m64"
428 [ -z "$CXX64" ] && CXX64="$CXX -m64"
429 fi
430 if [ "$TARGET_MACHINE" = "amd64" -a $WITH_VMMRAW -eq 0 ]; then
431 CC32="undefined"
432 CXX32="undefined"
433 fi
434 if [ "$CC" != "gcc" ]; then
435 cnf_append "TOOL_GCC3_CC" "$CC"
436 cnf_append "TOOL_GCC3_AS" "$CC"
437 cnf_append "TOOL_GCC3_LD" "$CC"
438 cnf_append "TOOL_GXX3_CC" "$CC"
439 cnf_append "TOOL_GXX3_AS" "$CC"
440 fi
441 if [ "$CXX" != "g++" ]; then
442 cnf_append "TOOL_GCC3_CXX" "$CXX"
443 cnf_append "TOOL_GXX3_CXX" "$CXX"
444 cnf_append "TOOL_GXX3_LD" "$CXX"
445 fi
446 if [ "$CC32" != "gcc -m32" -a "$CC32" != "undefined" ]; then
447 cnf_append "TOOL_GCC32_CC" "$CC32"
448 cnf_append "TOOL_GCC32_AS" "$CC32"
449 cnf_append "TOOL_GCC32_LD" "$CC32"
450 cnf_append "TOOL_GXX32_CC" "$CC32"
451 cnf_append "TOOL_GXX32_AS" "$CC32"
452 fi
453 if [ "$CXX32" != "g++ -m32" -a "$CXX32" != "undefined" ]; then
454 cnf_append "TOOL_GCC32_CXX" "$CXX32"
455 cnf_append "TOOL_GXX32_CXX" "$CXX32"
456 cnf_append "TOOL_GXX32_LD" "$CXX32"
457 fi
458 # this isn't not necessary, there is not such tool.
459 if [ -n "$CC64" ]; then
460 cnf_append "TOOL_GCC64_CC" "$CC64"
461 cnf_append "TOOL_GCC64_AS" "$CC64"
462 cnf_append "TOOL_GCC64_LD" "$CC64"
463 cnf_append "TOOL_GXX64_CC" "$CC64"
464 cnf_append "TOOL_GXX64_AS" "$CC64"
465 fi
466 if [ -n "$CXX64" ]; then
467 cnf_append "TOOL_GCC64_CXX" "$CXX64"
468 cnf_append "TOOL_GXX64_CXX" "$CXX64"
469 cnf_append "TOOL_GXX64_LD" "$CXX64"
470 fi
471 # Solaris sports a 32-bit gcc/g++.
472 if [ "$OS" = "solaris" -a "$BUILD_MACHINE" = "amd64" ]; then
473 [ "$CC" = "gcc" ] && CC="gcc -m64"
474 [ "$CXX" = "g++" ] && CXX="g++ -m64"
475 fi
476 fi
477 fi
478}
479
480
481#
482# Check for the bcc compiler, needed for compiling the BIOS
483#
484check_bcc()
485{
486 test_header bcc
487 if check_avail "$BCC" BCC; then
488 bcc_ver=`$BCC -v 2>&1|grep version|sed 's+^bcc: version \(.*\)+\1+'`
489 if [ $? -ne 0 ]; then
490 log_failure "BCC not found"
491 fail
492 else
493 echo "compiling the following source file:" >> $LOG
494 cat > $ODIR.tmp_src.c << EOF
495int foo(a)
496 int a;
497{
498 return 0;
499}
500EOF
501 cat $ODIR.tmp_src.c >> $LOG
502 bcc_path=`which_wrapper $BCC`
503 bcc_dir="`dirname $bcc_path`/"
504 echo "using the following command line:" >> $LOG
505 echo "$BCC -B $bcc_dir -C-c -3 -S -o $ODIR.tmp_out $ODIR.tmp_src.c" >> $LOG
506 $BCC -B $bcc_dir -C-c -3 -S -o $ODIR.tmp_out $ODIR.tmp_src.c >> $LOG 2>&1
507 if [ $? -ne 0 ]; then
508 log_failure "BCC not working"
509 fail
510 else
511 log_success "found version $bcc_ver"
512 cnf_append "VBOX_BCC" "$bcc_path -B $bcc_dir"
513 fi
514 unset bcc_path
515 unset bcc_dir
516 fi
517 fi
518}
519
520
521#
522# Check for the as86 assembler, needed for compiling the BIOS
523#
524check_as86()
525{
526 test_header as86
527 if check_avail "$AS86" AS86; then
528 as86_ver=`$AS86 -v 2>&1|grep version|sed 's+^as86 version: \(.*\)+\1+'`
529 if [ $? -ne 0 ]; then
530 log_failure "as86 not found"
531 fail
532 else
533 log_success "found version $as86_ver"
534 cnf_append "VBOX_AS86" "`which_wrapper $AS86`"
535 fi
536 fi
537}
538
539
540#
541# Check for yasm, needed to compile assembler files
542#
543check_yasm()
544{
545 test_header yasm
546 if check_avail "$YASM" YASM; then
547 yasm_ver=`$YASM --version|grep "^yasm"|sed 's+^yasm \(.*\)+\1+'`
548 if [ $? -ne 0 ]; then
549 log_failure "yasm not found"
550 fail
551 else
552 yasm_maj=`echo $yasm_ver|cut -d. -f1`
553 yasm_min=`echo $yasm_ver|cut -d. -f2`
554 yasm_rev=`echo $yasm_ver|cut -d. -f3`
555 yasm_ver_mul=`expr $yasm_maj \* 10000 + $yasm_min \* 100 + $yasm_rev`
556 if [ $yasm_ver_mul -lt 501 ]; then
557 log_failure "found version $yasm_ver, expected at least 0.5.1"
558 fail
559 else
560 log_success "found version $yasm_ver"
561 fi
562 fi
563 fi
564}
565
566
567#
568# Check for the iasl ACPI compiler, needed to compile vbox.dsl
569#
570check_iasl()
571{
572 test_header iasl
573 if check_avail "$IASL" IASL; then
574 iasl_ver=`$IASL|grep version|sed 's+^ASL.*version \([0-9]*\).*+\1+'`
575 if [ $? -ne 0 ]; then
576 log_failure "iasl not found"
577 fail
578 else
579 log_success "found version $iasl_ver"
580 cnf_append "VBOX_IASLCMD" "`which_wrapper $IASL`"
581 fi
582 fi
583}
584
585
586#
587# Check for xsltproc, needed by Main
588#
589check_xsltproc()
590{
591 test_header xslt
592 if check_avail "$XSLTPROC" XSLTPROC; then
593 xsltproc_ver=`$XSLTPROC --version`
594 if [ $? -ne 0 ]; then
595 log_failure "xsltproc not found"
596 fail
597 else
598 log_success "found"
599 cnf_append "VBOX_XSLTPROC" "`which_wrapper $XSLTPROC`"
600 fi
601 fi
602}
603
604
605#
606# Check for mkisofs, needed to build the CDROM image containing the additions
607#
608check_mkisofs()
609{
610 test_header mkisofs
611 if which_wrapper $GENISOIMAGE > /dev/null; then
612 mkisofs_ver=`$GENISOIMAGE --version`
613 if [ $? -ne 0 ]; then
614 log_failure "mkisofs not found"
615 fail
616 else
617 log_success "found $mkisofs_ver"
618 cnf_append "VBOX_MKISOFS" "`which_wrapper $GENISOIMAGE`"
619 fi
620 elif check_avail "$MKISOFS" MKISOFS; then
621 mkisofs_ver=`$MKISOFS --version`
622 if [ $? -ne 0 ]; then
623 log_failure "mkisofs not working"
624 fail
625 else
626 log_success "found $mkisofs_ver"
627 cnf_append "VBOX_MKISOFS" "`which_wrapper $MKISOFS`"
628 fi
629 fi
630}
631
632
633#
634# Check for libxml2, needed by VBoxSettings and Runtime.
635# 2.6.24 is known to NOT work, 2.6.26 is known to work (there is no 2.6.25 release)
636#
637check_libxml2()
638{
639 if [ -z "$BUILD_LIBXML2" ]; then
640 test_header libxml2
641 if which_wrapper pkg-config > /dev/null; then
642 libxml2_ver=`pkg-config libxml-2.0 --modversion 2>> $LOG`
643 if [ $? -ne 0 ]; then
644 log_failure "libxml2 not found"
645 fail
646 else
647 FLGXML2=`pkg-config libxml-2.0 --cflags`
648 INCXML2=`strip_I "$FLGXML2"`
649 LIBXML2=`pkg-config libxml-2.0 --libs`
650 cat > $ODIR.tmp_src.cc << EOF
651#include <cstdio>
652#include <libxml/xmlversion.h>
653extern "C" int main(void)
654{
655 printf("found version %s", LIBXML_DOTTED_VERSION);
656#if LIBXML_VERSION >= 20626
657 printf(", OK.\n");
658 return 0;
659#else
660 printf(", expected version 2.6.26 or higher\n");
661 return 1;
662#endif
663}
664EOF
665 [ -n "$INCXML2" ] && I_INCXML2=`prefix_I "$INCXML2"`
666 if test_compile "$LIBXML2 $LIBPTHREAD $I_INCXML2" xml2 xml2; then
667 if test_execute; then
668 cnf_append "SDK_VBOX_LIBXML2_INCS" "$INCXML2"
669 cnf_append "SDK_VBOX_LIBXML2_LIBS" "`strip_l "$LIBXML2"`"
670 fi
671 fi
672 fi
673 elif which_wrapper xml2-config; then
674 libxml2_ver=`xml2-config --version`
675 if [ $? -ne 0 ]; then
676 log_failure "xml2-config not found"
677 fail
678 else
679 log_success "found version $libxml2_ver"
680 FLGXML2=`xml2-config --cflags`
681 INCXML2=`strip_I "$FLGXML2"`
682 LIBXML2=`xml2-config --libs`
683 cat > $ODIR.tmp_src.cc << EOF
684#include <cstdio>
685#include <libxml/xmlversion.h>
686extern "C" int main(void)
687{
688 printf("found version %s", LIBXML_DOTTED_VERSION);
689#if LIBXML_VERSION >= 20626
690 printf(", OK.\n");
691 return 0;
692#else
693 printf(", expected version 2.6.26 or higher\n");
694 return 1;
695#endif
696}
697EOF
698 [ -n "$INCXML2" ] && I_INCXML2=`prefix_I "$INCXML2"`
699 if test_compile "$LIBXML2 $LIBPTHREAD $I_INCXML2" xml2 xml2; then
700 if test_execute; then
701 cnf_append "SDK_VBOX_LIBXML2_INCS" "$INCXML2"
702 cnf_append "SDK_VBOX_LIBXML2_LIBS" "`strip_l "$LIBXML2"`"
703 fi
704 fi
705 fi
706 else
707 log_failure "neither pkg-config nor xml2-config found"
708 fail
709 fi
710 fi
711}
712
713
714#
715# Check for libxslt, needed by VBoxSettings. For now we depend on 1.1.15,
716# as Solaris right now has no newer version and it definitely works.
717# 1.1.17 is available on Ubuntu Edgy which fulfils the minimal libxml2
718# requirement (2.6.26).
719#
720check_libxslt()
721{
722 if [ -z "$BUILD_LIBXSLT" ]; then
723 test_header libxslt
724 if which_wrapper pkg-config > /dev/null; then
725 libxslt_ver=`pkg-config libxslt --modversion 2>> $LOG`
726 if [ $? -ne 0 ]; then
727 log_failure "libxslt not found"
728 fail
729 else
730 FLGXSLT=`pkg-config libxslt --cflags`
731 INCXSLT=`strip_I "$FLGXSLT"`
732 LIBXSLT=`pkg-config libxslt --libs`
733 cat > $ODIR.tmp_src.cc << EOF
734#include <cstdio>
735#include <libxslt/xsltconfig.h>
736extern "C" int main(void)
737{
738 printf("found version %s", LIBXSLT_DOTTED_VERSION);
739#if LIBXSLT_VERSION >= 10117
740 printf(", OK.\n");
741 return 0;
742#else
743 printf(", expected version 1.1.17 or higher\n");
744 return 1;
745#endif
746}
747EOF
748 [ -n "$INCXSLT" ] && I_INCXSLT=`prefix_I "$INCXSLT"`
749 if test_compile "$LIBXSLT $LIBPTHREAD $I_INCXSLT" xslt xslt; then
750 if test_execute; then
751 cnf_append "SDK_VBOX_LIBXSLT_INCS" "$INCXSLT"
752 cnf_append "SDK_VBOX_LIBXSLT_LIBS" "`strip_l "$LIBXSLT"`"
753 fi
754 fi
755 fi
756 elif which_wrapper xslt-config; then
757 libxslt_ver=`xslt-config --version`
758 if [ $? -ne 0 ]; then
759 log_failure "xslt-config not working"
760 fail
761 else
762 log_success "found version $libxslt_ver"
763 FLGXSLT=`xslt-config --cflags`
764 INCXSLT=`strip_I "$FLGXSLT"`
765 LIBXSLT=`xslt-config --libs`
766 cat > $ODIR.tmp_src.cc << EOF
767#include <cstdio>
768#include <libxslt/xsltconfig.h>
769extern "C" int main(void)
770{
771 printf("found version %s", LIBXSLT_DOTTED_VERSION);
772#if LIBXSLT_VERSION >= 10117
773 printf(", OK.\n");
774 return 0;
775#else
776 printf(", expected version 1.1.17 or higher\n");
777 return 1;
778#endif
779}
780EOF
781 [ -n "$INCXSLT" ] && I_INCXSLT=`prefix_I "$INCXSLT"`
782 if test_compile "$LIBXSLT $LIBPTHREAD $I_INCXSLT" xslt xslt; then
783 if test_execute; then
784 cnf_append "SDK_VBOX_LIBXSLT_INCS" "$INCXSLT"
785 cnf_append "SDK_VBOX_LIBXSLT_LIBS" "`strip_l "$LIBXSLT"`"
786 fi
787 fi
788 fi
789 else
790 log_failure "neither pkg-config nor xslt-config found"
791 fail
792 fi
793 fi
794}
795
796
797#
798# Check for libIDL, needed by xpcom
799#
800check_libidl()
801{
802 test_header libIDL
803
804 if which_wrapper libIDL-config-2 > /dev/null; then
805 libidl_ver=`libIDL-config-2 --version`
806 if [ $? -ne 0 ]; then
807 log_failure "libIDL-config-2 not working"
808 fail
809 else
810 log_success "found version $libidl_ver"
811 cnf_append "VBOX_LIBIDL_CONFIG" \
812 "PKG_CONFIG_PATH=`libIDL-config-2 --prefix`/$LIB/pkgconfig `which_wrapper libIDL-config-2`"
813 fi
814 elif check_avail "libIDL-config" libIDL-config; then
815 libidl_ver=`libIDL-config --version`
816 if [ $? -ne 0 ]; then
817 log_failure "libIDL-config not working"
818 fail
819 else
820 log_success "found version $libidl_ver"
821 cnf_append "VBOX_LIBIDL_CONFIG" "`which_wrapper libIDL-config`"
822 fi
823 fi
824}
825
826
827#
828# Check for openssl, needed for RDP and S3
829#
830check_ssl()
831{
832 if [ -z "$BUILD_LIBSSL" ]; then
833 test_header ssl
834 cat > $ODIR.tmp_src.cc << EOF
835#include <cstdio>
836#include <openssl/opensslv.h>
837extern "C" int main(void)
838{
839 printf("found version %s", OPENSSL_VERSION_TEXT);
840#if OPENSSL_VERSION_NUMBER >= 0x00908000
841 printf(", OK.\n");
842 return 0;
843#else
844 printf(", expected version 0.9.8 or higher\n");
845 return 1;
846#endif
847}
848EOF
849 if test_compile "$INCCRYPTO $LIBCRYPTO" libcrypto openssl; then
850 if test_execute nofatal; then
851 cnf_append "SDK_VBOX_OPENSSL_INCS" "`strip_I "$INCCRYPTO"`"
852 cnf_append "SDK_VBOX_OPENSSL_LIBS" "`strip_l "$LIBCRYPTO"`"
853 cnf_append "SDK_VBOX_BLD_OPENSSL_LIBS" "`strip_l "$LIBCRYPTO"`"
854 fi
855 fi
856 fi
857}
858
859
860#
861# Check for pthread, needed by VBoxSVC, frontends, ...
862#
863check_pthread()
864{
865 test_header pthread
866 cat > $ODIR.tmp_src.cc << EOF
867#include <cstdio>
868#include <pthread.h>
869extern "C" int main(void)
870{
871 pthread_mutex_t mutex;
872 if (pthread_mutex_init(&mutex, NULL)) {
873 printf("pthread_mutex_init() failed\n");
874 return 1;
875 }
876 if (pthread_mutex_lock(&mutex)) {
877 printf("pthread_mutex_lock() failed\n");
878 return 1;
879 }
880 if (pthread_mutex_unlock(&mutex)) {
881 printf("pthread_mutex_unlock() failed\n");
882 return 1;
883 }
884 printf("found, OK.\n");
885}
886EOF
887 if test_compile $LIBPTHREAD pthread pthread; then
888 if test_execute; then
889 cnf_append "LIB_PTHREAD" "`strip_l "$LIBPTHREAD"`"
890 fi
891 fi
892}
893
894
895#
896# Check for zlib, needed by VBoxSVC, Runtime, ...
897#
898check_z()
899{
900 test_header zlib
901 cat > $ODIR.tmp_src.cc << EOF
902#include <cstdio>
903#include <zlib.h>
904extern "C" int main(void)
905{
906 printf("found version %s", ZLIB_VERSION);
907#if ZLIB_VERNUM >= 0x1210
908 printf(", OK.\n");
909 return 0;
910#else
911 printf(", expected version 1.2.1 or higher\n");
912 return 1;
913#endif
914}
915EOF
916 [ -n "$INCZ" ] && I_INCZ=`prefix_I "$INCZ"`
917 if test_compile "$LIBZ $I_INCZ" zlib zlib; then
918 if test_execute; then
919 echo "if1of (\$(KBUILD_TARGET),darwin freebsd linux solaris)" >> $CNF
920 cnf_append " SDK_VBOX_ZLIB_LIBS" "`strip_l "$LIBZ"`"
921 cnf_append " SDK_VBOX_ZLIB_INCS" "$INCZ"
922 echo "endif" >> $CNF
923 fi
924 fi
925}
926
927
928#
929# Check for libpng, needed by kchmviewer
930#
931check_png()
932{
933 test_header libpng
934 cat > $ODIR.tmp_src.cc << EOF
935#include <cstdio>
936#include <png.h>
937extern "C" int main(void)
938{
939 printf("found version %s", PNG_LIBPNG_VER_STRING);
940#if PNG_LIBPNG_VER >= 10205
941 printf(", OK.\n");
942 return 0;
943#else
944 printf(", expected version 1.2.5 or higher\n");
945 return 1;
946#endif
947}
948EOF
949 [ -n "$INCPNG" ] && I_INCPNG=`prefix_I "$INCPNG"`
950 if test_compile "$LIBPNG $I_INCPNG" libpng libpng; then
951 if test_execute; then
952 cnf_append "SDK_VBOX_LIBPNG_LIBS" "`strip_l "$LIBPNG"`"
953 cnf_append "SDK_VBOX_LIBPNG_INCS" "$INCPNG"
954 fi
955 fi
956}
957
958#
959# Check for libcurl, needed by S3
960#
961check_curl()
962{
963 if [ -z "$BUILD_LIBCURL" ]; then
964 test_header libcurl
965 cat > $ODIR.tmp_src.cc << EOF
966#include <cstdio>
967#include <curl/curl.h>
968extern "C" int main(void)
969{
970 printf("found version %s", LIBCURL_VERSION);
971#if 10000*LIBCURL_VERSION_MAJOR + 100*LIBCURL_VERSION_MINOR + LIBCURL_VERSION_PATCH >= 71601
972 printf(", OK.\n");
973 return 0;
974#else
975 printf(", expected version 7.16.1 or higher\n");
976 return 1;
977#endif
978}
979EOF
980 [ -n "$INCCURL" ] && I_INCCURL=`prefix_I "$INCCURL"`
981 if test_compile "$LIBCURL $I_INCCURL" libcurl libcurl; then
982 if test_execute; then
983 cnf_append "SDK_VBOX_LIBCURL_LIBS" "`strip_l "$LIBCURL"`"
984 cnf_append "SDK_VBOX_LIBCURL_INCS" "$INCCURL"
985 fi
986 fi
987 fi
988}
989
990
991#
992# Check for pam, needed by VRDPAuth
993# Version 79 was introduced in 9/2005, do we support older versions?
994# Debian/sarge uses 76
995# OpenSUSE comes with 0.99.xxx where they changed the versioning scheme.
996#
997check_pam()
998{
999 test_header pam
1000 cat > $ODIR.tmp_src.cc << EOF
1001#include <cstdio>
1002#include <security/pam_appl.h>
1003extern "C" int main(void)
1004{
1005 printf("found version %d", __LIBPAM_VERSION);
1006 if (__LIBPAM_VERSION >= 76)
1007 {
1008 printf(", OK.\n");
1009 return 0;
1010 }
1011 else
1012 {
1013 printf(", expected version 76 or higher\n");
1014 return 1;
1015 }
1016}
1017EOF
1018 if test_compile "-lpam" pam pam nofatal; then
1019 if test_execute nofatal; then
1020 return 0;
1021 fi
1022 fi
1023 echo "pam0.x not found"
1024 test_header linux_pam
1025 cat > $ODIR.tmp_src.cc << EOF
1026#include <cstdio>
1027#include <security/pam_appl.h>
1028extern "C" int main(void)
1029{
1030 printf("found version %d.%d", __LINUX_PAM__, __LINUX_PAM_MINOR__);
1031 if (__LINUX_PAM__ >= 1)
1032 {
1033 printf(", OK.\n");
1034 return 0;
1035 }
1036 else
1037 {
1038 printf(", expected version 1.0 or higher\n");
1039 return 1;
1040 }
1041}
1042EOF
1043 if test_compile "-lpam" pam pam; then
1044 test_execute
1045 fi
1046}
1047
1048
1049#
1050# Check for the SDL library, needed by VBoxSDL and VirtualBox
1051# We depend at least on version 1.2.7
1052#
1053check_sdl()
1054{
1055 test_header SDL
1056 if [ "$OS" = "darwin" ]; then
1057 if [ -f "/System/Library/Frameworks/SDL.framework/SDL" ]; then
1058 PATH_SDK_LIBSDL="/System/Library/Frameworks/SDL.framework"
1059 elif [ -f "/Library/Frameworks/SDL.framework/SDL" ]; then
1060 PATH_SDK_LIBSDL="/Library/Frameworks/SDL.framework"
1061 fi
1062 if [ -n "$PATH_SDK_LIBSDL" ]; then
1063 foundsdl=1
1064 INCSDL="$PATH_SDK_LIBSDL/Headers"
1065 FLDSDL="-framework SDL"
1066 else
1067 log_failure "SDL framework not found"
1068 fail
1069 fi
1070 else
1071 if which_wrapper sdl-config > /dev/null; then
1072 FLGSDL=`sdl-config --cflags`
1073 INCSDL=`strip_I "$FLGSDL"`
1074 LIBSDL=`sdl-config --libs`
1075 LIBSDLMAIN="-lSDLmain"
1076 FLDSDL=
1077 foundsdl=1
1078 fi
1079 fi
1080 [ "$OS" = "linux" -o "$OS" = "darwin" -o "$OS" = "solaris" ] && LIBSDLMAIN=""
1081 if [ -n "$foundsdl" ]; then
1082 cat > $ODIR.tmp_src.cc << EOF
1083#include <cstdio>
1084#include <SDL.h>
1085#include <SDL_main.h>
1086#undef main
1087extern "C" int main(int argc, char** argv)
1088{
1089 printf("found version %d.%d.%d",
1090 SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
1091#if SDL_VERSION_ATLEAST(1,2,7)
1092 printf(", OK.\n");
1093 return 0;
1094#else
1095 printf(", expected version 1.2.7 or higher\n");
1096 return 1;
1097#endif
1098}
1099EOF
1100 [ -n "$INCSDL" ] && I_INCSDL=`prefix_I "$INCSDL"`
1101 if test_compile "$LIBSDL $LIBSDLMAIN $I_INCSDL $FLDSDL" SDL SDL; then
1102 if test_execute; then
1103 cnf_append "LIB_SDK_LIBSDL_SDL" "`strip_l "$LIBSDL"`"
1104 cnf_append "SDK_LIBSDL_LIBPATH" "`strip_L "$LIBSDL"`"
1105 cnf_append "LIB_SDK_LIBSDL_SDLMAIN" "`strip_l "$LIBSDLMAIN"`"
1106 [ -n "$INCSDL" ] && cnf_append "SDK_LIBSDL_INCS" "$INCSDL"
1107 [ -n "$FLDSDL" ] && cnf_append "SDK_LIBSDL_LDFLAGS" "$FLDSDL"
1108 fi
1109 fi
1110 else
1111 log_failure "SDL not found"
1112 fail
1113 fi
1114}
1115
1116
1117#
1118# Check for the SDL_ttf library, needed by VBoxSDL (secure label)
1119#
1120check_sdl_ttf()
1121{
1122 test_header SDL_ttf
1123 cat > $ODIR.tmp_src.cc << EOF
1124#include <cstdio>
1125#include <SDL_ttf.h>
1126#ifndef SDL_TTF_MAJOR_VERSION
1127#define SDL_TTF_MAJOR_VERSION TTF_MAJOR_VERSION
1128#define SDL_TTF_MINOR_VERSION TTF_MINOR_VERSION
1129#define SDL_TTF_PATCHLEVEL TTF_PATCHLEVEL
1130#endif
1131extern "C" int main(void)
1132{
1133 printf("found version %d.%d.%d",
1134 SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL);
1135#if 10000*SDL_TTF_MAJOR_VERSION + 100*SDL_TTF_MINOR_VERSION + SDL_TTF_PATCHLEVEL >= 20006
1136 printf(", OK.\n");
1137 return 0;
1138#else
1139 printf(", expected version 2.0.6 or higher\n");
1140 return 1;
1141#endif
1142}
1143EOF
1144 if test_compile "-lSDL_ttf $I_INCSDL" SDL_ttf SDL_ttf nofatal; then
1145 if ! test_execute nofatal; then
1146 cnf_append "VBOX_WITH_SECURELABEL" ""
1147 fi
1148 else
1149 echo "not found -- disabling VBoxSDL secure label."
1150 cnf_append "VBOX_WITH_SECURELABEL" ""
1151 fi
1152}
1153
1154
1155#
1156# Check for libasound, needed by the ALSA audio backend
1157#
1158check_alsa()
1159{
1160 test_header ALSA
1161 cat > $ODIR.tmp_src.cc << EOF
1162#include <cstdio>
1163#include <alsa/asoundlib.h>
1164extern "C" int main(void)
1165{
1166 printf("found version %d.%d.%d",
1167 SND_LIB_MAJOR, SND_LIB_MINOR, SND_LIB_SUBMINOR);
1168#if 10000*SND_LIB_MAJOR + 100*SND_LIB_MINOR + SND_LIB_SUBMINOR >= 10006
1169 printf(", OK.\n");
1170 return 0;
1171#else
1172 printf(", expected version 1.0.6 or higher\n");
1173 return 1;
1174#endif
1175}
1176EOF
1177 if test_compile "-lasound" asound asound; then
1178 test_execute
1179 fi
1180}
1181
1182
1183#
1184# Check for PulseAudio
1185#
1186check_pulse()
1187{
1188 test_header "PulseAudio"
1189 cat > $ODIR.tmp_src.cc << EOF
1190#include <cstdio>
1191#include <pulse/version.h>
1192extern "C" int main(void)
1193{
1194 printf("found version %s API version %d", pa_get_headers_version(), PA_API_VERSION);
1195#if PA_API_VERSION >= 9
1196 printf(", OK.\n");
1197 return 0;
1198#else
1199 printf(", expected version 0.9.0 (API version 9) or higher\n");
1200 return 1;
1201#endif
1202}
1203EOF
1204 if test_compile "$INCPULSE $LIBPULSE -lpulse" pulse pulse; then
1205 test_execute
1206 fi
1207}
1208
1209
1210#
1211# Check for the X libraries (Xext, X11)
1212#
1213check_x()
1214{
1215 test_header "X libraries"
1216 cat > $ODIR.tmp_src.cc << EOF
1217#include <cstdio>
1218#include <X11/Xlib.h>
1219extern "C" int main(void)
1220{
1221 Display *dpy;
1222 int scrn_num;
1223 Screen *scrn;
1224 Window win;
1225
1226 dpy = XOpenDisplay(NULL);
1227 scrn_num = DefaultScreen(dpy);
1228 scrn = ScreenOfDisplay(dpy, scrn_num);
1229 win = XCreateWindow(dpy, RootWindowOfScreen(scrn), 0, 0, 100, 100,
1230 0, 16, InputOutput, CopyFromParent, 0, NULL);
1231 XDestroyWindow(dpy, win);
1232 XCloseDisplay(dpy);
1233}
1234EOF
1235 [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1236 if test_compile "$LIBX11 $I_INCX11" Xlibs Xlibs; then
1237 log_success "found"
1238 fi
1239}
1240
1241
1242#
1243# Check for the Xcursor library, needed by VBoxSDL and VBoxBFE
1244#
1245check_xcursor()
1246{
1247 test_header Xcursor
1248 cat > $ODIR.tmp_src.cc << EOF
1249#include <cstdio>
1250#include <X11/Xlib.h>
1251#include <X11/Xcursor/Xcursor.h>
1252extern "C" int main(void)
1253{
1254 XcursorImage *cursor = XcursorImageCreate (10, 10);
1255 XcursorImageDestroy(cursor);
1256 return 0;
1257}
1258EOF
1259 [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1260 if test_compile "$LIBX11 $LIBXCURSOR $I_INCX11" Xcursor Xcursor; then
1261 log_success "found"
1262 cnf_append "VBOX_XCURSOR_LIBS" "`strip_l "$LIBXCURSOR"`"
1263 fi
1264}
1265
1266
1267#
1268# Check for the Xinerama library, needed by the Qt GUI
1269#
1270check_xinerama()
1271{
1272 test_header Xinerama
1273 cat > $ODIR.tmp_src.cc << EOF
1274#include <X11/Xlib.h>
1275#include <X11/extensions/Xinerama.h>
1276extern "C" int main(void)
1277{
1278 Display *dpy;
1279 Bool flag;
1280 dpy = XOpenDisplay(NULL);
1281 if (dpy)
1282 {
1283 flag = XineramaIsActive(dpy);
1284 XCloseDisplay(dpy);
1285 }
1286}
1287EOF
1288 [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1289 if test_compile "$LIBX11 $LIBXINERAMA $I_INCX11" Xinerama Xinerama; then
1290 log_success "found"
1291 fi
1292}
1293
1294
1295#
1296# Check for the Xinerama library, needed by the Qt GUI
1297#
1298check_xrandr()
1299{
1300 test_header Xrandr
1301 cat > $ODIR.tmp_src.cc << EOF
1302#include <X11/Xlib.h>
1303#include <X11/extensions/Xrandr.h>
1304extern "C" int main(void)
1305{
1306 Display *dpy;
1307 Bool flag;
1308 int major, minor;
1309 dpy = XOpenDisplay(NULL);
1310 if (dpy)
1311 {
1312 flag = XRRQueryVersion(dpy, &major, &minor);
1313 XCloseDisplay(dpy);
1314 }
1315}
1316EOF
1317 [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1318 if test_compile "$LIBX11 $LIBXRANDR $I_INCX11" Xrandr Xrandr; then
1319 log_success "found"
1320 fi
1321}
1322
1323
1324#
1325# Check for OpenGL
1326#
1327check_opengl()
1328{
1329 # On darwin this is a on/off decision only
1330 if [ "$OS" = "darwin" ]; then
1331 test_header "OpenGL support"
1332 echo "enabled"
1333 cnf_append "VBOX_WITH_CROGL" "1"
1334 else
1335 check_xmu
1336 check_mesa
1337 fi
1338}
1339
1340
1341#
1342# Check for the Xmu library, needed by OpenGL
1343#
1344check_xmu()
1345{
1346 test_header Xmu
1347 cat > $ODIR.tmp_src.cc << EOF
1348#include <cstdio>
1349#include <X11/Xatom.h>
1350#include <X11/Xlib.h>
1351#include <X11/Xutil.h>
1352#include <X11/Xmu/StdCmap.h>
1353extern "C" int main(void)
1354{
1355 Display *dpy;
1356 int scrn_num;
1357 Screen *scrn;
1358
1359 dpy = XOpenDisplay(NULL);
1360 if (dpy)
1361 {
1362 scrn_num = DefaultScreen(dpy);
1363 scrn = ScreenOfDisplay(dpy, scrn_num);
1364 Status status = XmuLookupStandardColormap(dpy, RootWindowOfScreen(scrn), 0,
1365 24, XA_RGB_DEFAULT_MAP, False, True);
1366 printf("Status = %x\n", status);
1367 XCloseDisplay(dpy);
1368 }
1369 return 0;
1370}
1371EOF
1372 [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1373 if test_compile "$LIBX11 $LIBXMU $I_INCX11" Xmu Xmu; then
1374 log_success "found"
1375 cnf_append "VBOX_XMU_LIBS" "`strip_l "$LIBXMU"`"
1376 fi
1377}
1378
1379#
1380# Check for Mesa, needed by OpenGL
1381#
1382check_mesa()
1383{
1384 test_header "Mesa / GLU"
1385 cat > $ODIR.tmp_src.cc << EOF
1386#include <cstdio>
1387#include <X11/Xlib.h>
1388#include <GL/glx.h>
1389#include <GL/glu.h>
1390extern "C" int main(void)
1391{
1392 Display *dpy;
1393 int major, minor;
1394
1395 dpy = XOpenDisplay(NULL);
1396 if (dpy)
1397 {
1398 Bool glx_version = glXQueryVersion(dpy, &major, &minor);
1399 XCloseDisplay(dpy);
1400 if (glx_version)
1401 {
1402 printf("found version %u.%u, OK.\n", major, minor);
1403 return 0;
1404 }
1405 }
1406 printf("found (inactive), OK.\n");
1407 return 0;
1408}
1409EOF
1410 [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1411 if test_compile "$LIBX11 $MESA $I_INCX11" Mesa Mesa; then
1412 [ $PASSIVE_MESA -eq 1 ] && unset DISPLAY
1413 test_execute
1414 fi
1415}
1416
1417
1418#
1419# Check for the Qt4 library, needed by the VirtualBox frontend
1420#
1421# Currently not fatal.
1422#
1423check_qt4()
1424{
1425 foundqt4=
1426 test_header Qt4
1427 if [ "$OS" = "darwin" ]; then
1428 # First check if there is the internal version of Qt. If yes nothing else
1429 # has to be done.
1430 QT_INTERNAL=`/bin/ls -rd1 $PWD/tools/$BUILD_TARGET.$BUILD_PLATFORM_ARCH/qt/* 2> /dev/null`
1431 for t in $QT_INTERNAL; do
1432 if [ -f "$t/Frameworks/QtCoreVBox.framework/QtCoreVBox" ]; then
1433 cnf_append "VBOX_WITH_QT4_SUN" "1"
1434 log_success "use internal version"
1435 return
1436 fi
1437 done
1438 # Now try the user provided directory and some of the standard directories.
1439 QT_TRIES="$QT4DIR /System/Library /Library"
1440 for t in $QT_TRIES; do
1441 if [ -f "$t/Frameworks/QtCore.framework/QtCore" ]; then
1442 PATH_SDK_QT4="$t"
1443 break
1444 fi
1445 done
1446 # Add the necessary params for building the test application
1447 if [ -n "$PATH_SDK_QT4" ]; then
1448 foundqt4=1
1449 INCQT4=-I$PATH_SDK_QT4/Frameworks/QtCore.framework/Headers
1450 LIBQT4=-F$PATH_SDK_QT4/Frameworks
1451 FLGQT4="-framework QtCore"
1452 else
1453 log_failure "Qt4 framework not found (can be disabled using --disable-qt4)"
1454 fail
1455 fi
1456 else
1457 if [ $QT4DIR_PKGCONFIG -eq 1 ]; then
1458 # default is to use pkg-config
1459 if which_wrapper pkg-config > /dev/null; then
1460 # this braindead path is necessary for mdv2008.1
1461 qt4_ver=`\
1462 PKG_CONFIG_PATH=/usr/lib/qt4/lib/pkgconfig \
1463 pkg-config QtCore --modversion 2>> $LOG`
1464 if [ $? -ne 0 ]; then
1465 log_failure "QtCore not found"
1466 fail
1467 else
1468 FLGQT4=`\
1469 PKG_CONFIG_PATH=/usr/lib/qt4/lib/pkgconfig \
1470 pkg-config QtCore --cflags`
1471 INCQT4=`strip_I "$FLGQT4"`
1472 LIBQT4=`\
1473 PKG_CONFIG_PATH=/usr/lib/qt4/lib/pkgconfig \
1474 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \
1475 pkg-config QtCore --libs`
1476 foundqt4=1
1477 fi
1478 else
1479 log_failure "pkg-config not found"
1480 fail
1481 fi
1482 else
1483 # do it the old way (e.g. user has specified QT4DIR)
1484 cat > $ODIR.tmp_src.cc << EOF
1485#include <cstdio>
1486#include <QtGlobal>
1487extern "C" int main(void)
1488{
1489 printf("found version %s", QT_VERSION_STR);
1490#if QT_VERSION >= 0x040400
1491 printf(", OK.\n");
1492 return 0;
1493#else
1494 printf(", expected version 4.4.0 or higher\n");
1495 return 1;
1496#endif
1497}
1498EOF
1499 for q in $QT4DIR; do
1500 INCQT4="$q/include $q/include/QtCore"
1501 FLGQT4="-DQT_SHARED"
1502 I_INCQT4=`prefix_I "$INCQT4"`
1503 LIBQT4="-L$q/lib -lQtCoreVBox"
1504 if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
1505 foundqt4=2
1506 break;
1507 fi
1508 LIBQT4="-L$q/lib -lQtCore"
1509 if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
1510 foundqt4=1
1511 break;
1512 fi
1513 done
1514 fi
1515 fi
1516 if [ -n "$foundqt4" ]; then
1517 cat > $ODIR.tmp_src.cc << EOF
1518#include <cstdio>
1519#include <QtGlobal>
1520extern "C" int main(void)
1521{
1522 printf("found version %s", QT_VERSION_STR);
1523#if QT_VERSION >= 0x040400
1524 printf(", OK.\n");
1525 return 0;
1526#else
1527 printf(", expected version 4.4.0 or higher\n");
1528 return 1;
1529#endif
1530}
1531EOF
1532 [ -n "$INCQT4" ] && I_INCQT4=`prefix_I "$INCQT4"`
1533 if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
1534 if test_execute_path "`strip_L "$LIBQT4"`"; then
1535 if [ "$OS" = "darwin" ]; then
1536 # Successful build & run the test application so add the necessary
1537 # params to AutoConfig.kmk
1538 cnf_append "PATH_SDK_QT4_INC" "$PATH_SDK_QT4/Frameworks"
1539 cnf_append "PATH_SDK_QT4_LIB" "$PATH_SDK_QT4/Frameworks"
1540 cnf_append "PATH_SDK_QT4" "$PATH_SDK_QT4/Frameworks"
1541 # Check for the moc tool in the Qt directory found & some standard
1542 # directories.
1543 for q in $PATH_SDK_QT4 /usr /Developer/Tools/Qt; do
1544 if which_wrapper "$q/bin/moc" > /dev/null; then
1545 cnf_append "PATH_TOOL_QT4" "$q"
1546 cnf_append "PATH_TOOL_QT4_BIN" "$q/bin"
1547 fi
1548 done
1549 else
1550 # strip .../QtCore as we add components ourself
1551 INCQT4=`echo "$INCQT4"|$KBUILD_SED 's|\([^ ]*\)/QtCore|\1|g; s| $||g'`
1552 # store only the first path, remove all other pathes
1553 # most likely pkg-config gave us -I/usr/include/qt4 -I/usr/include/qt4/QtCore
1554 INCQT4=`echo "$INCQT4"|$KBUILD_SED 's|\([^ ]*\) .*|\1|'`
1555 cnf_append "VBOX_PATH_QT4_LIB" "`strip_L "$LIBQT4"`"
1556 cnf_append "SDK_QT4_LIBPATH" "`strip_L "$LIBQT4"`"
1557 cnf_append "PATH_SDK_QT4_INC" "$INCQT4"
1558 # this is not quite right since the qt libpath does not have to be first...
1559 cnf_append "PATH_SDK_QT4_LIB" '$'"(firstword `strip_L "$LIBQT4"`)"
1560 if [ "$foundqt4" = "2" ]; then
1561 cnf_append "VBOX_WITH_QT4_SUN" "1"
1562 fi
1563 test_header "Qt4 devtools"
1564 for q in $QT4DIR; do
1565 # first try it with a suffix, some platforms use that
1566 if which_wrapper "$q/bin/moc-qt4" > /dev/null; then
1567 moc_ver=`$q/bin/moc-qt4 -v 2>&1|sed 's+^.*(Qt \(.*\))+\1+'`
1568 if [ $? -ne 0 ]; then
1569 log_failure "moc-qt4 not working"
1570 fail
1571 else
1572 log_success "found version $moc_ver"
1573 cnf_append "VBOX_PATH_QT4" "$q"
1574 cnf_append "PATH_SDK_QT4" "$q"
1575 cnf_append "PATH_TOOL_QT4" "$q"
1576 cnf_append "PATH_TOOL_QT4_BIN" "$q/bin"
1577 cnf_append "TOOL_QT4_BIN_SUFF" "-qt4"
1578 return
1579 fi
1580 elif which_wrapper "$q/bin/moc" > /dev/null; then
1581 moc_ver=`$q/bin/moc -v 2>&1|sed 's+^.*(Qt \(.*\))+\1+'`
1582 if [ $? -ne 0 ]; then
1583 log_failure "moc not working"
1584 fail
1585 else
1586 log_success "found version $moc_ver"
1587 cnf_append "VBOX_PATH_QT4" "$q"
1588 cnf_append "PATH_SDK_QT4" "$q"
1589 cnf_append "PATH_TOOL_QT4" "$q"
1590 cnf_append "PATH_TOOL_QT4_BIN" "$q/bin"
1591 return
1592 fi
1593 fi
1594 done
1595 fi
1596 fi
1597 else
1598 log_failure "qt4 not working"
1599 fail
1600 fi
1601 else
1602 log_failure "qt4 not found"
1603 fail
1604 fi
1605}
1606
1607
1608#
1609# Check whether static libstdc++ is installed. This library is required
1610# for the Linux guest additions.
1611#
1612check_staticlibstdcxx()
1613{
1614 test_header "static stc++ library"
1615 libstdcxx=`$CXX -print-file-name=libstdc++.a`
1616 cat > $ODIR.tmp_src.cc << EOF
1617#include <string>
1618
1619extern "C" int main(void)
1620{
1621 std::string s = "test";
1622 return 0;
1623}
1624EOF
1625 if test_compile "$libstdcxx" libstdc++ libstdc++; then
1626 log_success "found"
1627 fi
1628}
1629
1630
1631#
1632# Check for Linux sources
1633#
1634check_linux()
1635{
1636 test_header "Linux kernel sources"
1637 cat > $ODIR.tmp_src.c << EOF
1638#include <linux/version.h>
1639int printf(const char *format, ...);
1640int main(void)
1641{
1642 printf("found version %d.%d.%d", LINUX_VERSION_CODE / 65536,
1643 (LINUX_VERSION_CODE % 65536) / 256,
1644 LINUX_VERSION_CODE % 256);
1645#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,0)
1646 printf(", OK.\n");
1647 return 0;
1648#else
1649 printf(", expected version 2.4.0 or higher\n");
1650 return 1;
1651#endif
1652}
1653EOF
1654 echo "compiling the following source file:" >> $LOG
1655 cat $ODIR.tmp_src.c >> $LOG
1656 echo "using the following command line:" >> $LOG
1657 echo "$CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include" >> $LOG
1658 $CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include >> $LOG 2>&1
1659 if [ $? -ne 0 ]; then
1660 echo
1661 echo " Linux kernel headers not found at $LINUX"
1662 echo " Check the file $LOG for detailed error information."
1663 fail
1664 else
1665 if test_execute; then
1666 cnf_append "VBOX_LINUX_SRC" "`cd $LINUX ; pwd`"
1667 fi
1668 fi
1669}
1670
1671
1672#
1673# Check for kchmviewer, needed to display the online help
1674# (unused as we ship kchmviewer)
1675#
1676check_kchmviewer()
1677{
1678 test_header kchmviewer
1679 if check_avail "$KCHMVIEWER" KCHMVIEWER; then
1680 kchmviewer_ver=`$KCHMVIEWER --version|grep "^KchmViewer:"|sed 's+^KchmViewer: \(.*\)+\1+'`
1681 if [ $? -ne 0 ]; then
1682 log_failure "kchmviewer not working"
1683 fail
1684 else
1685 log_success "found version $kchmviewer_ver"
1686 fi
1687 fi
1688}
1689
1690
1691#
1692# Check for the kBuild tools, we don't support GNU make
1693#
1694check_kbuild()
1695{
1696 test_header kBuild
1697 if which_wrapper "$KBUILDDIR/bin/$OS.$BUILD_MACHINE/kmk" > /dev/null; then
1698 KBUILDDIR_BIN="$KBUILDDIR/bin/$OS.$BUILD_MACHINE"
1699 echo "PATH_KBUILD=\"`cd $KBUILDDIR ; pwd`\"" >> $ENV
1700 echo "export PATH_KBUILD" >> $ENV
1701 echo "PATH_DEVTOOLS=\"$DEVDIR\"" >> $ENV
1702 echo "export PATH_DEVTOOLS" >> $ENV
1703 echo "path_kbuild_bin=\"\$PATH_KBUILD/bin/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"" >> $ENV
1704 echo "export PATH_KBUILD_BIN" >> $ENV
1705 echo "path_dev_bin=\"\$PATH_DEVTOOLS/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"/bin" >> $ENV
1706 if [ "$OS" = "solaris" ]; then
1707 # Because of sh being non-default shell in Solaris we need to export PATH again when
1708 # sourcing env.sh. Simply exporting from ./configure does not export PATH correctly.
1709 echo "PATH=\"$ORGPATH\"" >> $ENV
1710 echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
1711 echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
1712 else
1713 echo "echo \"\$PATH\" | grep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
1714 echo "echo \"\$PATH\" | grep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
1715 fi
1716 echo "export PATH" >> $ENV
1717 echo "unset path_kbuild_bin path_dev_bin" >> $ENV
1718 KBUILD_SED="$KBUILDDIR_BIN/kmk_sed"
1719 elif [ "$OS.$BUILD_MACHINE" = "darwin.amd64" ]; then
1720 # Currently there are no amd64 kBuild bins. So use the x86 variant in any case.
1721 KBUILDDIR_BIN="$KBUILDDIR/bin/$OS.x86"
1722 echo "PATH_KBUILD=\"`cd $KBUILDDIR ; pwd`\"" >> $ENV
1723 echo "export PATH_KBUILD" >> $ENV
1724 echo "PATH_DEVTOOLS=\"$DEVDIR\"" >> $ENV
1725 echo "export PATH_DEVTOOLS" >> $ENV
1726 echo "path_kbuild_bin=\"\$PATH_KBUILD/bin/\$BUILD_TARGET.x86\"" >> $ENV
1727 echo "PATH_KBUILD_BIN=\"\$path_kbuild_bin\"" >> $ENV
1728 echo "export PATH_KBUILD_BIN" >> $ENV
1729 echo "path_dev_bin=\"\$PATH_DEVTOOLS/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"/bin" >> $ENV
1730 echo "echo \"\$PATH\" | grep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
1731 echo "echo \"\$PATH\" | grep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
1732 echo "export PATH" >> $ENV
1733 echo "unset path_kbuild_bin path_dev_bin" >> $ENV
1734 KBUILD_SED="$KBUILDDIR_BIN/kmk_sed"
1735 elif check_avail "kmk" KBUILDDIR really; then
1736 # check for installed kBuild
1737 KBUILD_SED="`which_wrapper kmk_sed`"
1738 else
1739 fail
1740 fi
1741 log_success "found"
1742}
1743
1744
1745#
1746# Check for compiler.h
1747# Some Linux distributions include "compiler.h" in their libc linux
1748# headers package, some don't. Most don't need it, building might (!)
1749# not succeed on openSUSE without it.
1750#
1751# See http://www.mail-archive.com/qemu-devel%40nongnu.org/msg07980.html
1752#
1753check_compiler_h()
1754{
1755 test_header compiler.h
1756 if ! test -f "/usr/include/linux/compiler.h"; then
1757 log_success "compiler.h not found"
1758 else
1759 cnf_append "VBOX_WITH_LINUX_COMPILER_H" "1"
1760 log_success "compiler.h found"
1761 fi
1762}
1763
1764#
1765# Check for libcap.
1766# Required to pass CAP_NET_RAW to our binaries to allow to open SOCK_RAW
1767# sockets for doing ICMP requests.
1768#
1769check_libcap()
1770{
1771 test_header "libcap library"
1772 cat > $ODIR.tmp_src.cc << EOF
1773#include <cstdio>
1774#include <sys/types.h>
1775#include <sys/capability.h>
1776
1777extern "C" int main(void)
1778{
1779 char buf[1024];
1780 cap_t caps = cap_get_proc();
1781 snprintf(buf, sizeof(buf), "Current caps are '%s'\n", cap_to_text(caps, NULL));
1782 return 0;
1783}
1784EOF
1785 if test_compile $LIBCAP libcap libcap; then
1786 if test_execute; then
1787 log_success "found"
1788 fi
1789 fi
1790}
1791
1792#
1793# Check if we are able to build 32-bit applications (needed for the guest additions)
1794#
1795check_32bit()
1796{
1797 test_header "32-bit support"
1798 cat > $ODIR.tmp_src.c << EOF
1799#include <stdint.h>
1800int main(void)
1801{
1802 return 0;
1803}
1804EOF
1805 echo "compiling the following source file:" >> $LOG
1806 cat $ODIR.tmp_src.c >> $LOG
1807 echo "using the following command line:" >> $LOG
1808 echo "$CC -m32 -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c" >> $LOG
1809 $CC -m32 -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c >> $LOG 2>&1
1810 if [ $? -ne 0 ]; then
1811 echo
1812 echo " Cannot compile 32-bit applications (missing headers and/or libraries)!"
1813 echo " Check the file $LOG for detailed error information."
1814 fail
1815 else
1816 echo "executing the binary" >> $LOG
1817 $ODIR.tmp_out 2> $ODIR.test_execute.log
1818 rc=$?
1819 cat $ODIR.test_execute.log >> $LOG
1820 if [ $rc -ne 0 ]; then
1821 echo
1822 echo " Cannot execute 32-bit applications! Either enable 32-bit support in the"
1823 echo " kernel configuration or use --disable-vmmraw to disable 32-bit guests."
1824 fail
1825 return 1
1826 fi
1827 fi
1828 log_success ""
1829}
1830
1831
1832#
1833# Check for Python
1834#
1835check_python()
1836{
1837 test_header "Python support"
1838
1839 # On darwin this is a on/off decision only
1840 if [ "$OS" = "darwin" ]; then
1841 echo "enabled"
1842 cnf_append "VBOX_WITH_PYTHON" "1"
1843 return
1844 fi
1845
1846 cat > $ODIR.tmp_src.cc << EOF
1847#include <cstdio>
1848#include <Python.h>
1849extern "C" int main(void)
1850{
1851 Py_Initialize();
1852 printf("found version %s", PY_VERSION);
1853#if PY_VERSION_HEX >= 0x02030000
1854 printf(", OK.\n");
1855 return 0;
1856#else
1857 printf(", expected version 2.3 or higher\n");
1858 return 1;
1859#endif
1860}
1861EOF
1862 found=
1863# For Solaris we use libpython2.4 for compatibility with Solaris 10 and passing IPS pkg audit
1864 if [ "$OS" != "solaris" ]; then
1865 SUPPYTHONLIBS="python2.7 python2.6 python2.5 python2.4 python2.3"
1866 else
1867 SUPPYTHONLIBS="python2.4"
1868 fi
1869 for p in $PYTHONDIR; do
1870 for d in $SUPPYTHONLIBS; do
1871 for b in lib64 lib/64 lib; do
1872 echo "compiling the following source file:" >> $LOG
1873 cat $ODIR.tmp_src.cc >> $LOG
1874 echo "using the following command line:" >> $LOG
1875 echo "$CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so" >> $LOG
1876 $CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so >> $LOG 2>&1
1877 if [ $? -eq 0 ]; then
1878 found=1
1879 break
1880 fi
1881 done
1882 if [ -n "$found" ]; then break; fi
1883 done
1884 if [ -n "$found" ]; then break; fi
1885 done
1886 if [ -n "$found" ]; then
1887 if test_execute; then
1888 cnf_append "VBOX_WITH_PYTHON" "1"
1889 cnf_append "VBOX_PATH_PYTHON_INC" "$p/include/$d"
1890 cnf_append "VBOX_LIB_PYTHON" "$p/$b/lib$d.so"
1891 else
1892 log_failure "Python not working"
1893 fail
1894 fi
1895 else
1896 log_failure "Python not found"
1897 fail
1898 fi
1899}
1900
1901
1902#
1903# Check for Java
1904#
1905check_java()
1906{
1907 test_header "Java support"
1908 log_success
1909}
1910
1911
1912#
1913# Setup wine
1914#
1915setup_wine()
1916{
1917 test_header "Wine support"
1918 if ! which_wrapper wine > /dev/null; then
1919 echo " wine binary not found"
1920 fail
1921 fi
1922 if ! which_wrapper wineprefixcreate > /dev/null; then
1923 echo " wineprefixcreate not found"
1924 fail
1925 fi
1926 export WINEPREFIX="${ODIR}wine.$BUILD_MACHINE"
1927 echo "WINEPREFIX=\"${ODIR}wine.$BUILD_MACHINE\"" >> $ENV
1928 echo "export WINEPREFIX" >> $ENV
1929 rm -rf $WINEPREFIX
1930 mkdir -p $WINEPREFIX
1931 touch $WINEPREFIX/.no_prelaunch_window_flag
1932 if ! wineprefixcreate -q > /dev/null 2>&1; then
1933 echo " wineprefixcreate failed"
1934 fail
1935 fi
1936 tmp=.tmp.wine.reg
1937 rm -f $tmp
1938 echo 'REGEDIT4' > $tmp
1939 echo '' >> $tmp
1940 echo '[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment]' >> $tmp
1941 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
1942 echo '' >> $tmp
1943 echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhc.exe\DllOverrides]' >> $tmp
1944 echo '"itss"="native"' >> $tmp
1945 echo '' >> $tmp
1946 echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhw.exe\DllOverrides]' >> $tmp
1947 echo '"itss"="native"' >> $tmp
1948 echo '' >> $tmp
1949 if ! wine regedit $tmp > /dev/null 2>&1; then
1950 rm -f $tmp
1951 echo " failed to load registry changes (path)."
1952 fail
1953 fi
1954 rm -f $tmp
1955 log_success "found"
1956}
1957
1958
1959#
1960# Check for gSOAP.
1961#
1962check_gsoap()
1963{
1964 test_header "GSOAP compiler"
1965 if [ -z "$GSOAP" ]; then
1966 GSOAP="/usr"
1967 fi
1968 if which_wrapper "$GSOAP/bin/soapcpp2" > /dev/null; then
1969 if which_wrapper "$GSOAP/bin/wsdl2h" > /dev/null; then
1970 if [ -f "$GSOAP/include/stdsoap2.h" ]; then
1971 # TODO: Check for libgsoap++.a/so
1972
1973 if [ -z "$GSOAP_IMPORT" ]; then
1974 GSOAP_IMPORT="$GSOAP/share/gsoap/import"
1975 if [ ! -d "$GSOAP_IMPORT" -a -d "$GSOAP/include/gsoap" ]; then
1976 GSOAP_IMPORT="$GSOAP/include/gsoap"
1977 fi
1978 fi
1979 if [ -f "$GSOAP_IMPORT/stlvector.h" ]; then
1980 cnf_append "VBOX_GSOAP_INSTALLED" "1"
1981 cnf_append "VBOX_PATH_GSOAP" "$GSOAP"
1982 cnf_append "VBOX_PATH_GSOAP_IMPORT" "$GSOAP_IMPORT"
1983 if [ -f "$GSOAP/share/gsoap/stdsoap2.cpp" ]; then
1984 cnf_append "VBOX_GSOAP_CXX_SOURCES" "$GSOAP/share/gsoap/stdsoap2.cpp"
1985 else
1986 cnf_append "VBOX_GSOAP_CXX_SOURCES" ""
1987 fi
1988 cnf_append "VBOX_GSOAP_CXX_LIBS" "libgsoap++"
1989 log_success "found"
1990 else
1991 log_failure "stlvector.h not found -- disabling webservice"
1992 cnf_append "VBOX_WITH_WEBSERVICES" ""
1993 fi
1994 else
1995 log_failure "stdsoap2.h not found -- disabling webservice"
1996 cnf_append "VBOX_WITH_WEBSERVICES" ""
1997 fi
1998 else
1999 log_failure "wsdl2h not found -- disabling webservice"
2000 cnf_append "VBOX_WITH_WEBSERVICES" ""
2001 fi
2002 else
2003 log_failure "soapcpp2 not found -- disabling webservice"
2004 cnf_append "VBOX_WITH_WEBSERVICES" ""
2005 fi
2006}
2007
2008
2009#
2010# Determines the Darwin version.
2011# @todo This should really check the Xcode/SDK version.
2012#
2013check_darwinversion()
2014{
2015 test_header "Darwin version"
2016 darwin_ver=`uname -r`
2017 case "$darwin_ver" in
2018 10\.*)
2019 darwin_ver="10.6"
2020 if [ "$BUILD_MACHINE" = "x86" ]; then
2021 sdk=/Developer/SDKs/MacOSX10.5.sdk
2022 CXX_FLAGS="-mmacosx-version-min=10.5 -isysroot $sdk -Wl,-syslibroot,$sdk"
2023 cnf_append "VBOX_MACOS_10_5_WORKAROUND" "1"
2024 else
2025 sdk=/Developer/SDKs/MacOSX10.6.sdk
2026 CXX_FLAGS="-mmacosx-version-min=10.6 -isysroot $sdk -Wl,-syslibroot,$sdk"
2027 fi
2028# test "$CC" = "gcc" && CC="gcc-4.0"
2029# test "$CXX" = "g++" && CXX="g++-4.0"
2030 ;;
2031 9\.*)
2032 darwin_ver="10.5"
2033 sdk=/Developer/SDKs/MacOSX10.5.sdk
2034 CXX_FLAGS="-mmacosx-version-min=10.5 -isysroot $sdk -Wl,-syslibroot,$sdk"
2035# test "$CC" = "gcc" && CC="gcc-4.0"
2036# test "$CXX" = "g++" && CXX="g++-4.0"
2037 cnf_append "VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6" "1"
2038 cnf_append "VBOX_MACOS_10_5_WORKAROUND" "1"
2039 ;;
2040 8\.*)
2041 darwin_ver="10.4"
2042 sdk=/Developer/SDKs/MacOSX10.4u.sdk
2043 CXX_FLAGS="-mmacosx-version-min=10.4 -isysroot $sdk -Wl,-syslibroot,$sdk"
2044# test "$CC" = "gcc" && CC="gcc-4.0"
2045# test "$CXX" = "g++" && CXX="g++-4.0"
2046 cnf_append "VBOX_WITH_COCOA_QT" ""
2047 cnf_append "VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6" "1"
2048 ;;
2049 *)
2050 echo " failed to determine Darwin version. (uname -r: $darwin_ver)"
2051 fail
2052 darwin_ver="unknown"
2053 ;;
2054 esac
2055 log_success "found version $darwin_ver (SDK: $sdk)"
2056}
2057
2058
2059check_makeself()
2060{
2061 test_header "makeself"
2062 if check_avail "$MAKESELF" makeself; then
2063 makeself_ver=`$MAKESELF --version|grep version|sed 's+^Makeself.*version \([0-9\.]*\).*+\1+'`
2064 if [ $? -ne 0 ]; then
2065 log_failure "makeself not working"
2066 fail
2067 else
2068 log_success "found version $makeself_ver"
2069 cnf_append "VBOX_MAKESELF" "`which_wrapper $MAKESELF`"
2070 fi
2071 fi
2072}
2073
2074
2075#
2076# Checks that i386-elf-gcc-3.4.6, i386-elf-gcc-3.4.3, i386-elf-gcc-3.4 or i386-elf-gcc
2077# is around to prevent confusion when the build fails in src/recompiler.
2078# Note. Keep the which order in sync with the $(which ) in src/recompiler/Makefile.kmk.
2079#
2080check_i386elfgcc()
2081{
2082 test_header "i386-elf-gcc"
2083 i386_elf_gcc=`which_wrapper i386-elf-gcc-3.4.6`
2084 test -z "$i386_elf_gcc" && i386_elf_gcc=`which_wrapper i386-elf-gcc-3.4.3`
2085 test -z "$i386_elf_gcc" && i386_elf_gcc=`which_wrapper i386-elf-gcc-3.4`
2086 test -z "$i386_elf_gcc" && i386_elf_gcc=`which_wrapper i386-elf-gcc`
2087 if test -z "$i386_elf_gcc"; then
2088 echo " failed to find i386-elf-gcc"
2089 fail
2090 fi
2091 log_success "found $i386_elf_gcc"
2092}
2093
2094
2095#
2096# Show help
2097#
2098show_help()
2099{
2100cat << EOF
2101Usage: ./configure [OPTIONS]...
2102
2103Configuration:
2104 -h, --help display this help and exit
2105 --nofatal don't abort on errors
2106EOF
2107[ $WITH_XPCOM -eq 1 ] && echo " --disable-xpcom disable XPCOM and related stuff"
2108[ $WITH_PYTHON -eq 1 ] && echo " --disable-python disable python bindings"
2109[ $WITH_JAVA -eq 1 ] && echo " --disable-java disable java bindings"
2110[ $WITH_VMMRAW -eq 1 ] && echo " --disable-vmmraw disable VMM raw mode (VT-x/AMD-V mandatory!)"
2111[ $WITH_SDL_TTF -eq 1 ] && echo " --disable-sdl-ttf disable SDL_ttf detection"
2112[ $WITH_ALSA -eq 1 ] && echo " --disable-alsa disable the ALSA sound backend"
2113[ $WITH_PULSE -eq 1 ] && echo " --disable-pulse disable the PulseAudio backend"
2114[ $WITH_DBUS -eq 1 ] && echo " --disable-dbus don't use DBus and hal for hardware detection"
2115[ $WITH_KMODS -eq 1 ] && echo " --disable-kmods don't build Linux kernel modules (host and guest)"
2116[ $WITH_OPENGL -eq 1 ] && echo " --disable-opengl disable OpenGL support (2D & 3D)"
2117[ $WITH_GSOAP -eq 0 ] && echo " --enable-webservice enable the webservice stuff"
2118[ $WITH_DOCS -eq 1 ] && echo " --disable-docs don't build the documentation"
2119[ "$OS" = "linux" -o "$OS" = "freebsd" ] && echo " --enable-vde enable VDE networking"
2120cat << EOF
2121 --disable-hardening don't be strict about /dev/vboxdrv access
2122 --build-libxml2 build libxml2 from sources
2123 --build-libxslt build libxslt from sources
2124EOF
2125[ $OSE -eq 0 ] && cat << EOF
2126 --build-libssl build openssl from sources
2127 --build-libcurl build libcurl from sources
2128EOF
2129[ "$OS" != "darwin" ] && echo " --setup-wine setup a Wine directory and register the hhc hack"
2130cat << EOF
2131
2132Paths:
2133 --with-gcc=PATH location of the gcc compiler [$CC]
2134 --with-g++=PATH location of the g++ compiler [$CXX]
2135 --with-kbuild=DIR kbuild directory [$KBUILDDIR]
2136 --with-iasl=PATH location of the iasl compiler [$IASL]
2137 --with-mkisofs=PATH location of mkisofs [$MKISOFS]
2138EOF
2139[ "$OS" = "linux" ] && echo " --with-linux=DIR Linux kernel source directory [$LINUX]"
2140[ $WITH_QT4 -eq 1 ] && echo " --with-qt-dir=DIR directory for Qt4 headers/libraries [pkgconfig]"
2141[ $WITH_GSOAP -eq 1 ] && echo " --with-gsoap-dir=PATH directory for gSOAP compiler/headers/libraries"
2142[ $WITH_GSOAP -eq 1 ] && echo " (soapcpp2 and wsdl2h, soapstd2.h, libgsoap++.a/so)"
2143[ $WITH_GSOAP -eq 1 ] && echo " --with-gsoap-import=PATH directory for gSOAP import files (stlvector.h)"
2144cat << EOF
2145 --with-openssl-dir=DIR directory for OpenSSL headers/libraries
2146 --out-path=PATH the folder to which configuration and build output
2147 should go
2148
2149Build type:
2150 -d, --build-debug build with debugging symbols and assertions
2151 --build-profile build with profiling support
2152 --build-headless build headless (without any GUI frontend)
2153EOF
2154 exit 0
2155}
2156
2157
2158#
2159# The body.
2160#
2161
2162# test if we are OSE
2163if [ $OSE -eq 1 -a -r "`cd \`dirname $0\`; pwd`/src/VBox/RDP/server/server.cpp" ]; then
2164 OSE=0
2165 # Set this as a reminder to print a log message once we know the path of the
2166 # log file
2167 NOT_OSE=1
2168fi
2169
2170# Change OS specific defaults; must be before all other stuff
2171if [ "$OS" = "darwin" ]; then
2172 WITH_SDL=0
2173 WITH_SDL_TTF=0
2174 WITH_X11=0
2175 WITH_ALSA=0
2176 WITH_PULSE=0
2177 WITH_DBUS=0
2178 WITH_KMODS=0
2179 BUILD_LIBXSLT=1
2180 BUILD_LIBXML2=1
2181 [ $OSE -eq 1 ] || BUILD_LIBCURL=1
2182 [ $OSE -eq 1 ] || BUILD_LIBSSL=1
2183fi
2184
2185
2186# scan command line options
2187for option in $*; do
2188 case "$option" in
2189 --help|-help|-h)
2190 show_help
2191 ;;
2192 --nofatal)
2193 nofatal=1
2194 ;;
2195 --env-only)
2196 ENV_ONLY=1
2197 ;;
2198 --with-gcc=*)
2199 CC=`echo $option | cut -d'=' -f2`
2200 ;;
2201 --with-g++=*)
2202 CXX=`echo $option | cut -d'=' -f2`
2203 ;;
2204 --with-kbuild=*)
2205 KBUILDDIR=`echo $option | cut -d'=' -f2`
2206 if echo $KBUILDDIR|grep -q "$INVALID_CHARS"; then
2207 echo "Error: KBUILDDIR contains invalid characters!"
2208 exit 1
2209 fi
2210 ;;
2211 --with-qt-dir=*|--with-qt4-dir=*)
2212 QT4DIR=`echo $option | cut -d'=' -f2`
2213 QT4DIR_PKGCONFIG=0
2214 ;;
2215 --with-openssl-dir=*)
2216 OPENSSLDIR=`echo $option | cut -d'=' -f2`
2217 INCCRYPTO="-I${OPENSSLDIR}/include"
2218 LIBCRYPTO="${OPENSSLDIR}/lib/libcrypto.a"
2219 ;;
2220 --with-gsoap-dir=*)
2221 GSOAP=`echo $option | cut -d'=' -f2`
2222 ;;
2223 --with-gsoap-import=*)
2224 GSOAP_IMPORT=`echo $option | cut -d'=' -f2`
2225 ;;
2226 --with-iasl=*)
2227 IASL=`echo $option | cut -d'=' -f2`
2228 ;;
2229 --with-linux=*)
2230 LINUX=`echo $option | cut -d'=' -f2`
2231 ;;
2232 --with-mkisofs=*)
2233 MKISOFS=`echo $option | cut -d'=' -f2`
2234 ;;
2235 --target-arch=*)
2236 TARGET_MACHINE=`echo $option | cut -d'=' -f2`
2237 ;;
2238 --disable-xpcom)
2239 [ $WITH_XPCOM -eq 1 ] && WITH_XPCOM=0
2240 ;;
2241 --disable-python)
2242 [ $WITH_PYTHON -eq 1 ] && WITH_PYTHON=0
2243 ;;
2244 --disable-java)
2245 [ $WITH_JAVA -eq 1 ] && WITH_JAVA=0
2246 ;;
2247 --disable-vmmraw)
2248 [ $WITH_VMMRAW -eq 1 ] && WITH_VMMRAW=0
2249 ;;
2250 --disable-sdl-ttf)
2251 [ $WITH_SDL_TTF -eq 1 ] && WITH_SDL_TTF=0
2252 ;;
2253 --disable-qt)
2254 [ $WITH_QT4 -eq 1 ] && WITH_QT4=0
2255 ;;
2256 --disable-qt4)
2257 [ $WITH_QT4 -eq 1 ] && WITH_QT4=0
2258 ;;
2259 --passive-mesa)
2260 PASSIVE_MESA=1
2261 ;;
2262 --disable-alsa)
2263 [ $WITH_ALSA -eq 1 ] && WITH_ALSA=0
2264 ;;
2265 --disable-pulse)
2266 [ $WITH_PULSE -eq 1 ] && WITH_PULSE=0
2267 ;;
2268 --enable-pulse)
2269 WITH_PULSE=2
2270 ;;
2271 --disable-dbus)
2272 [ $WITH_DBUS -eq 1 ] && WITH_DBUS=0
2273 ;;
2274 --disable-kmods)
2275 [ $WITH_KMODS -eq 1 ] && WITH_KMODS=0
2276 ;;
2277 --disable-opengl)
2278 [ $WITH_OPENGL -eq 1 ] && WITH_OPENGL=0
2279 ;;
2280 --enable-webservice)
2281 [ $WITH_GSOAP -eq 0 ] && WITH_GSOAP=1
2282 ;;
2283 --disable-hardening)
2284 WITH_HARDENING=0
2285 ;;
2286 --disable-docs)
2287 WITH_DOCS=0
2288 ;;
2289 --enable-hardening)
2290 WITH_HARDENING=2
2291 ;;
2292 --enable-vde)
2293 WITH_VDE=1
2294 ;;
2295 --build-debug|-d)
2296 BUILD_TYPE=debug
2297 ;;
2298 --build-profile)
2299 BUILD_TYPE=profile
2300 ;;
2301 --build-libxml2)
2302 BUILD_LIBXML2=1
2303 ;;
2304 --build-libxslt)
2305 BUILD_LIBXSLT=1
2306 ;;
2307 --build-libssl)
2308 BUILD_LIBSSL=1
2309 ;;
2310 --build-libcurl)
2311 BUILD_LIBCURL=1
2312 ;;
2313 --build-headless)
2314 HEADLESS=1
2315 WITH_SDL=0
2316 WITH_SDL_TTF=0
2317 WITH_X11=0
2318 WITH_OPENGL=0
2319 WITH_QT4=0
2320 ;;
2321 --ose)
2322 OSE=2
2323 ;;
2324 --odir=*)
2325 ODIR="`echo $option | cut -d'=' -f2`/"
2326 ODIR_OVERRIDE=1
2327 ;;
2328 --out-path=*)
2329 out_path="`echo $option | cut -d'=' -f2`/"
2330 if [ -d $out_path ]; then
2331 saved_path="`pwd`"
2332 cd $out_path
2333 OUT_PATH="`pwd`"
2334 cd $saved_path
2335 OUT_PATH_OVERRIDE=1
2336 if [ $ODIR_OVERRIDE -eq 0 ]; then
2337 # This variable has not *yet* been overridden. That can still happen.
2338 ODIR=$OUT_PATH/
2339 fi
2340 else
2341 echo "Error: invalid folder \"$out_path\" in option \"$option\""
2342 exit 1
2343 fi
2344 ;;
2345 --setup-wine)
2346 [ "$OS" != "darwin" ] && SETUP_WINE=1
2347 ;;
2348 *)
2349 echo
2350 echo "Unrecognized option \"$option\""
2351 echo
2352 show_help
2353 ;;
2354 esac
2355done
2356
2357LOG="$ODIR$LOG"
2358ENV="$ODIR$ENV"
2359CNF="$ODIR$CNF"
2360
2361# initialize output files
2362cat > $LOG << EOF
2363# Log file generated by
2364#
2365# '$0 $*'
2366#
2367
2368EOF
2369cat > $CNF << EOF
2370# -*- Makefile -*-
2371#
2372# automatically generated by
2373#
2374# '$0 $*'
2375#
2376# It will be completely overwritten if configure is executed again.
2377#
2378
2379EOF
2380cat > $ENV << EOF
2381#!/bin/bash
2382#
2383# automatically generated by
2384#
2385# '$0 $*'
2386#
2387# It will be completely overwritten if configure is executed again.
2388# Make sure you source this file once before you start to build VBox.
2389#
2390
2391EOF
2392
2393# Print log warning about OSE if necessary
2394if [ -n "$NOT_OSE" ]; then
2395 echo "Found RDP server, assuming VBOX_OSE = FALSE" >> $LOG
2396 echo >> $LOG
2397fi
2398
2399
2400if [ "$BUILD_TYPE" = "debug" ]; then
2401 echo "Creating DEBUG build!" >> $LOG
2402elif [ "$BUILD_TYPE" = "profile" ]; then
2403 echo "Creating PROFILE build!" >> $LOG
2404fi
2405
2406# first determine our environment
2407check_environment
2408check_kbuild
2409
2410[ -n "$ENV_ONLY" ] && exit 0
2411
2412# append the tools directory to the default search path
2413echo "$PATH" | grep -q "$DEVDIR_BIN" || PATH="$PATH:$DEVDIR_BIN"
2414export PATH
2415
2416# if we will be writing to a different out directory then set this up now
2417if [ $OUT_PATH_OVERRIDE -eq 1 ]; then
2418 echo "AUTOCFG=$OUT_PATH/AutoConfig.kmk" >> $ENV
2419 echo "export AUTOCFG" >> $ENV
2420 echo "LOCALCFG=$OUT_PATH/LocalConfig.kmk" >> $ENV
2421 echo "export LOCALCFG" >> $ENV
2422 echo "PATH_OUT_BASE=$OUT_PATH" >> $ENV
2423 echo "export PATH_OUT_BASE" >> $ENV
2424fi
2425
2426# some things are not available in for OSE
2427if [ $OSE -ge 1 ]; then
2428 cnf_append "VBOX_OSE" "1"
2429 cnf_append "VBOX_WITH_TESTSUITE" ""
2430 cnf_append "VBOX_WITH_WIN32_ADDITIONS" ""
2431
2432 if [ "$OS" = "linux" ]; then
2433 cnf_append "VBOX_WITH_LINUX_ADDITIONS" "1"
2434 else
2435 cnf_append "VBOX_WITH_LINUX_ADDITIONS" ""
2436 fi
2437 echo >> $CNF
2438fi
2439
2440# headless
2441if [ -n "$HEADLESS" ]; then
2442 cnf_append "VBOX_HEADLESS" "1"
2443fi
2444
2445# emit disable directives corresponding to any --disable-xxx options.
2446if [ $WITH_OPENGL -eq 0 ]; then
2447 cnf_append "VBOX_WITH_CROGL" ""
2448 cnf_append "VBOX_WITH_VIDEOHWACCEL" ""
2449 cnf_append "VBOX_GUI_USE_QGL" ""
2450fi
2451[ $WITH_XPCOM -eq 0 ] && cnf_append "VBOX_WITH_MAIN" ""
2452[ $WITH_QT4 -eq 0 ] && cnf_append "VBOX_WITH_QTGUI" ""
2453[ $WITH_SDL_TTF -eq 0 ] && cnf_append "VBOX_WITH_SECURELABEL" ""
2454[ $WITH_PYTHON -eq 0 ] && cnf_append "VBOX_WITH_PYTHON" ""
2455[ $WITH_JAVA -eq 0 ] && cnf_append "VBOX_WITH_JXPCOM" ""
2456[ $WITH_HARDENING -eq 0 ] && cnf_append "VBOX_WITHOUT_HARDENING" "1"
2457[ $WITH_HARDENING -eq 2 ] && cnf_append "VBOX_WITH_HARDENING" "2"
2458[ $WITH_VMMRAW -eq 0 ] && cnf_append "VBOX_WITH_RAW_MODE" ""
2459
2460# Darwin-specific
2461if [ "$OS" = "darwin" ]; then
2462 check_darwinversion
2463fi
2464# the tools
2465check_gcc
2466[ "$OS" != "darwin" ] && check_as86
2467[ "$OS" != "darwin" ] && check_bcc
2468[ "$OS" != "darwin" ] && check_iasl
2469# don't check for yasm for the time beeing as 0.40 and 0.50 both have known bugs
2470# [ "$OS" != "darwin" ] && check_yasm
2471[ "$OS" != "darwin" ] && check_xsltproc
2472[ "$OS" != "darwin" ] && check_mkisofs
2473
2474# the libraries
2475[ "$OS" != "darwin" ] && check_pthread
2476check_libxml2
2477[ $WITH_XPCOM -eq 1 ] && check_libxslt
2478[ $WITH_LIBIDL -eq 1 ] && check_libidl
2479check_ssl
2480check_curl
2481[ "$OS" != "darwin" ] && check_z
2482[ "$OS" != "darwin" ] && check_png
2483[ $OSE -eq 0 -a "$OS" = "linux" ] && check_pam
2484[ $WITH_SDL -eq 1 ] && check_sdl
2485[ $WITH_SDL_TTF -eq 1 -a $OSE -eq 0 ] && check_sdl_ttf
2486[ $WITH_X11 -eq 1 ] && check_x
2487# TODO check for xcomposite-dev (X11/extensions/Xcomposite.h, additions only)
2488# TODO check for libxdamange-dev (X11/extensions/Xdamage.h, additions only)
2489[ $WITH_X11 -eq 1 ] && check_xcursor
2490[ $WITH_X11 -eq 1 ] && check_xinerama
2491[ $WITH_X11 -eq 1 ] && check_xrandr
2492[ $WITH_OPENGL -eq 1 ] && check_opengl
2493[ $WITH_QT4 -eq 1 ] && check_qt4
2494[ $WITH_PYTHON -eq 1 ] && check_python
2495[ $WITH_JAVA -eq 1 ] && check_java
2496
2497# PulseAudio
2498if [ "$OS" = "linux" -o "$OS" = "freebsd" ]; then
2499 if [ $WITH_PULSE -eq 1 ]; then
2500 check_pulse
2501 elif [ $WITH_PULSE -eq 0 ]; then
2502 cnf_append "VBOX_WITH_PULSE" ""
2503 fi
2504fi
2505
2506# Linux-specific
2507if [ "$OS" = "linux" ]; then
2508 # don't check for the static libstdc++ in the PUEL version as we build the
2509 # additions at a dedicated box
2510 [ $OSE -ge 1 ] && check_staticlibstdcxx
2511 if [ $WITH_KMODS -eq 1 ]; then
2512 check_linux
2513 else
2514 cnf_append "VBOX_LINUX_SRC" ""
2515 cnf_append "VBOX_WITH_VBOXDRV" ""
2516 cnf_append "VBOX_WITH_ADDITION_DRIVERS" ""
2517 fi
2518 if [ $WITH_ALSA -eq 1 ]; then
2519 check_alsa
2520 else
2521 cnf_append "VBOX_WITH_ALSA" ""
2522 fi
2523 if [ $WITH_DBUS -eq 0 ]; then
2524 cnf_append "VBOX_WITH_DBUS" ""
2525 fi
2526 check_libcap
2527 check_compiler_h
2528 [ "$BUILD_MACHINE" = "amd64" -a $WITH_VMMRAW -eq 1 ] && check_32bit
2529 # tools/common/makeself*
2530 [ $OSE -ge 1 ] && check_makeself
2531fi
2532
2533[ -n "$SETUP_WINE" ] && setup_wine
2534
2535if [ $OSE -ge 1 ]; then
2536 if [ $WITH_GSOAP -eq 1 ]; then
2537 check_gsoap
2538 else
2539 cnf_append "VBOX_WITH_WEBSERVICES" ""
2540 fi
2541fi
2542
2543# VDE
2544if [ "$OS" = "linux" -o "$OS" = "freebsd" ]; then
2545 if [ $WITH_VDE -eq 1 ]; then
2546 cnf_append "VBOX_WITH_VDE" "1"
2547 fi
2548fi
2549
2550# DOCS
2551if [ $WITH_DOCS -eq 0 ]; then
2552 cnf_append "VBOX_WITH_DOCS" ""
2553 cnf_append "VBOX_WITH_DOCS_PACKING" ""
2554fi
2555
2556# success!
2557echo
2558echo "Successfully generated '$CNF' and '$ENV'."
2559echo "Source '$ENV' once before you start to build VBox:"
2560echo ""
2561echo " source $ENV"
2562echo " kmk"
2563echo ""
2564if [ "$OS" = "linux" ]; then
2565 if [ $OUT_PATH_OVERRIDE -eq 1 ]; then
2566 vbox_out_path=$OUT_PATH
2567 else
2568 vbox_out_path=./out
2569 fi
2570 echo "To compile the kernel modules, do:"
2571 echo ""
2572 echo " cd $vbox_out_path/$OS.$TARGET_MACHINE/$BUILD_TYPE/bin/src"
2573 echo " make"
2574 echo ""
2575fi
2576if [ $WITH_HARDENING -gt 0 ]; then
2577 echo ""
2578 echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
2579 echo " Hardening is enabled which means that the VBox binaries will not run from"
2580 echo " the binary directory. The binaries have to be installed suid root and some"
2581 echo " more prerequisites have to be fulfilled which is normally done by installing"
2582 echo " the final package. For development, the hardening feature can be disabled"
2583 echo " by specifying the --disable-hardening parameter. Please never disable that"
2584 echo " feature for the final distribution!"
2585 echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
2586 echo ""
2587else
2588 echo ""
2589 echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
2590 echo " Hardening is disabled. Please do NOT build packages for distribution with"
2591 echo " disabled hardening!"
2592 echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
2593 echo ""
2594fi
2595echo "Enjoy!"
2596cleanup
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette