VirtualBox

source: vbox/trunk/configure@ 31639

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

configure: check for makeself

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

© 2023 Oracle
ContactPrivacy policyTerms of Use