VirtualBox

source: vbox/trunk/configure@ 28800

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

Automated rebranding to Oracle copyright/license strings via filemuncher

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

© 2023 Oracle
ContactPrivacy policyTerms of Use