VirtualBox

source: vbox/trunk/configure@ 28787

Last change on this file since 28787 was 28746, checked in by vboxsync, 15 years ago

configure: --disable-fam

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

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