VirtualBox

source: vbox/trunk/configure@ 60555

Last change on this file since 60555 was 60537, checked in by vboxsync, 9 years ago

configure: default is Qt5

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