VirtualBox

source: vbox/trunk/configure@ 28662

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

configure: cosmetics

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