VirtualBox

source: vbox/trunk/configure@ 40107

Last change on this file since 40107 was 40039, checked in by vboxsync, 13 years ago

configure: always build libssl for the extpack

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

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