VirtualBox

source: vbox/trunk/configure@ 60762

Last change on this file since 60762 was 60754, checked in by vboxsync, 8 years ago

configure: make echo -n work again on Solaris 11 without /usr/ucb

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