VirtualBox

source: vbox/trunk/configure@ 65466

Last change on this file since 65466 was 65360, checked in by vboxsync, 8 years ago

configure: another fix

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
File size: 83.0 KB
Line 
1#!/bin/sh
2# The purpose of this script is to check for all external tools, headers, and
3# libraries VBox OSE depends on.
4
5#
6# Copyright (C) 2006-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 netbsd)
55 ;;
56 sunos)
57 OS='solaris'
58 ;;
59 haiku)
60 ;;
61 *)
62 echo "Cannot determine OS!"
63 exit 1
64 ;;
65esac
66
67#
68# Defaults
69#
70OSE=1
71ODIR="`pwd`/"
72ODIR_OVERRIDE=0
73OUT_PATH=""
74OUT_PATH_OVERRIDE=0
75SETUP_WINE=
76ONLY_ADDITIONS=0
77TARGET_MACHINE=""
78TARGET_CPU=""
79WITH_XPCOM=1
80WITH_PYTHON=1
81WITH_JAVA=1
82WITH_VMMRAW=1
83WITH_LIBIDL=1
84WITH_GSOAP=0
85WITH_QT4=0
86WITH_QT5=1
87WITH_SDL=1
88WITH_SDL_TTF=1
89WITH_X11=1
90WITH_ALSA=1
91WITH_PULSE=1
92WITH_DBUS=1
93WITH_DEVMAPPER=1
94WITH_KMODS=1
95WITH_OPENGL=1
96WITH_HARDENING=1
97WITH_UDPTUNNEL=1
98WITH_VDE=0
99WITH_VNC=0
100WITH_EXTPACK=1
101WITH_DOCS=1
102WITH_LIBVPX=1
103BUILD_LIBXML2=
104BUILD_LIBCURL=
105BUILD_LIBSSL=
106BUILD_LIBVPX=
107PASSIVE_MESA=0
108CC="gcc"
109CC32=""
110CC64=""
111CXX="g++"
112CXX32=""
113CXX64=""
114YASM="yasm"
115IASL="iasl"
116XSLTPROC="xsltproc"
117GENISOIMAGE="genisoimage"
118MKISOFS="mkisofs"
119INCCRYPTO=""
120LIBCRYPTO="-lssl -lcrypto"
121LIBPTHREAD="-lpthread"
122LIBCAP="-lcap"
123GSOAP=""
124GSOAP_IMPORT=""
125INCX11="/usr/local/include"
126LIBX11="-L/usr/X11R6/lib -L/usr/X11R6/lib64 -L/usr/local/lib -lXext -lX11"
127LIBXCURSOR="-lXcursor"
128LIBXMU="-lXmu"
129LIBXINERAMA="-lXinerama"
130LIBXRANDR="-lXrandr"
131MAKESELF="makeself"
132MESA="-lGL"
133INCZ=""
134LIBZ="-lz"
135INCVNCSERVER=""
136LIBVNCSERVER="-lvncserver"
137INCDEVMAPPER=""
138LIBDEVMAPPER="-ldevmapper"
139CXX_FLAGS=""
140if [ "$OS" = "freebsd" ]; then
141 INCCURL="-I/usr/local/include"
142 LIBCURL="-L/usr/local/lib -lcurl"
143 INCPULSE="-I/usr/local/include"
144 LIBPULSE="-L/usr/local/lib"
145 INCPNG="-I/usr/local/include"
146 LIBPNG="-L/usr/local/lib -lpng"
147else
148 INCCURL=""
149 LIBCURL="-lcurl"
150 INCPNG=""
151 LIBPNG="-lpng"
152fi
153INCVPX=""
154LIBVPX="-lvpx"
155PKGCONFIG="`which_wrapper pkg-config`"
156PYTHONDIR="/usr /usr/local"
157QT4DIR="/usr/lib/qt4 /usr/share/qt4 /usr/lib64/qt4 /usr /usr/local"
158QT4DIR_PKGCONFIG=1
159QT5DIR="/usr/lib/qt5 /usr/share/qt5 /usr/lib64/qt5 /usr /usr/local"
160QT5DIR_PKGCONFIG=1
161KBUILDDIR="`cd \`dirname $0\`; pwd`/kBuild"
162DEVDIR="`cd \`dirname $0\`; pwd`/tools"
163if [ -d "/lib/modules/`uname -r`/build" ]; then
164 LINUX="/lib/modules/`uname -r`/build"
165elif [ "`echo /lib/modules/*`" != "/lib/modules/*" ]; then
166 # Get the most recent kernel headers if none match the current kernel.
167 for i in /lib/modules/*; do
168 if [ -r "$i/build" ]; then
169 LINUX="$i/build"
170 fi
171 done
172fi
173if [ -z "$LINUX" ]; then
174 LINUX="/usr/src/linux"
175fi
176KCHMVIEWER="kchmviewer"
177LOG="configure.log"
178CNF="AutoConfig.kmk"
179ENV="env.sh"
180BUILD_TYPE="release"
181# the restricting tool is ar (mri mode).
182INVALID_CHARS="[^A-Za-z0-9/\\$:._-]"
183
184if (cd `dirname $0`; pwd)|grep -q "$INVALID_CHARS"; then
185 echo "Error: VBox base path contains invalid characters!"
186 exit 1
187fi
188
189# darwin /bin/sh has a builtin echo that doesn't grok -n. gotta love it.
190if [ "$OS" = "darwin" ]; then
191 ECHO_N="/bin/echo -n"
192elif [ "$OS" = "solaris" ]; then
193 # Solaris 11 /bin/sh has a builtin echo that could grok -n if there is
194 # /usr/ucb/echo the first echo executable in the path, but the /usr/ucb
195 # tools are no longer installed by default.
196 ECHO_N="/usr/gnu/bin/echo -n"
197else
198 ECHO_N="echo -n"
199fi
200
201
202cleanup()
203{
204 rm -f $ODIR.tmp_src.cc $ODIR.tmp_src.c $ODIR.tmp_out $ODIR.test_execute.log
205}
206
207fail()
208{
209 if [ -z "$nofatal" -o "x$1" != "x" ]; then
210 cleanup
211 rm -f $ENV
212 echo "Check $LOG for details"
213 exit 1
214 fi
215}
216
217log()
218{
219 echo "$1"
220 echo "$1" >> $LOG
221}
222
223log_success()
224{
225 if [ -n "$1" ]; then $ECHO_N "$1, "; fi
226 echo "OK."
227 echo "$1" >> $LOG
228 echo >> $LOG
229 echo >> $LOG
230}
231
232log_failure()
233{
234 echo
235 echo " ** $1!"
236 echo "** $1!" >> $LOG
237 echo >> $LOG
238}
239
240cnf_append()
241{
242 printf "%-30s := %s\n" "$1" "$2" >> $CNF
243}
244
245strip_l()
246{
247 echo "$1"|$KBUILD_SED 's|-l\([^ ]\+\)|\1|g; s|^-[^l][^ ]*||g; s| -[^l][^ ]*||g; s|^ ||; s| *$||g'
248}
249
250strip_L()
251{
252 echo "$1"|$KBUILD_SED 's|-L\([^ ]\+\)|\1|g; s|^-[^L][^ ]*||g; s| -[^L][^ ]*||g; s|^ ||; s| *$||g'
253}
254
255strip_I()
256{
257 echo "$1"|$KBUILD_SED 's|-I\([^ ]\+\)|\1|g; s|^-[^I][^ ]*||g; s| -[^I][^ ]*||g; s|^ ||; s| *$||g'
258}
259
260prefix_I()
261{
262 echo "$1"|$KBUILD_SED 's|^\/|-I/|g; s| \/| -I/|g'
263}
264
265check_avail()
266{
267 if [ -z "$1" ]; then
268 log_failure "$2 is empty"
269 fail $3
270 return 1
271 elif which_wrapper $1 > /dev/null; then
272 return 0
273 else
274 log_failure "$1 (variable $2) not found"
275 fail $3
276 return 1
277 fi
278}
279
280
281# Prepare a test
282test_header()
283{
284 echo "***** Checking $1 *****" >> $LOG
285 $ECHO_N "Checking for $1: "
286}
287
288
289# Compile a test
290# $1 compile flags/libs
291# $2 library name
292# $3 package name
293# $4 if this argument is 'nofatal', don't abort
294test_compile()
295{
296 echo "compiling the following source file:" >> $LOG
297 cat $ODIR.tmp_src.cc >> $LOG
298 echo "using the following command line:" >> $LOG
299 echo "$CXX $CXX_FLAGS -fPIC -g -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc \"$1\"" >> $LOG
300 $CXX $CXX_FLAGS -fPIC -g -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc $1 >> $LOG 2>&1
301 if [ $? -ne 0 ]; then
302 if [ -z "$4" ]; then
303 echo
304 echo " $2 not found at $1 or $3 headers not found"
305 echo " Check the file $LOG for detailed error information."
306 fail
307 else
308 echo >> $LOG
309 echo >> $LOG
310 fi
311 return 1
312 fi
313 return 0
314}
315
316
317# Execute a compiled test binary
318test_execute()
319{
320 echo "executing the binary" >> $LOG
321 $ODIR.tmp_out > $ODIR.test_execute.log
322 rc=$?
323 cat $ODIR.test_execute.log | tee -a $LOG
324 if [ $rc -ne 0 ]; then
325 fail $1
326 return 1
327 fi
328 echo >> $LOG
329 echo >> $LOG
330 return 0
331}
332
333
334# Execute a compiled test binary
335test_execute_path()
336{
337 ## LD_LIBRARY_PATH to set.
338 local_path="${1}"
339 ## Set this to non-empty to make this test non-fatal.
340 local_nofail="${2}"
341 echo "executing the binary (LD_LIBRARY_PATH=$1)" >> $LOG
342 LD_LIBRARY_PATH="${local_path}" $ODIR.tmp_out > $ODIR.test_execute.log
343 rc=$?
344 cat $ODIR.test_execute.log | tee -a $LOG
345 if [ $rc -ne 0 ]; then
346 test -z "${local_nofail}" && fail
347 echo >> $LOG
348 echo >> $LOG
349 return 1
350 fi
351 echo >> $LOG
352 echo >> $LOG
353 return 0
354}
355
356
357#
358# Check for OS, MACHINE, CPU
359#
360check_environment()
361{
362 test_header environment
363 BUILD_CPU=`uname -m`
364 [ "$OS" = "solaris" ] && BUILD_CPU=`isainfo | cut -f 1 -d ' '`
365 case "$BUILD_CPU" in
366 i[3456789]86|x86|i86pc|BePC)
367 BUILD_MACHINE='x86'
368 LIB='lib'
369 ;;
370 x86_64|amd64)
371 BUILD_MACHINE='amd64'
372 BUILD_CPU='k8'
373 if [ "$OS" != "solaris" ]; then
374 # on AMD64 systems, 64bit libs are usually located in /usr/lib64
375 # see http://www.pathname.com/fhs/pub/fhs-2.3.html#LIB64
376 LIB='lib64'
377 else
378 # Solaris doesn't seem to subscribe to fhs, libs are usually in
379 # a '64' subdirectory of the standard 'lib' dirs while some 64-bit
380 # alternative binaries can be found in 'amd64' subdirs of the 'bin'
381 # ones. So, in order to find the right stuff (esp. sdl-config) we'll
382 # have to make sure the */bin/amd64 dirs are searched before the */bin
383 # ones. (The sed has some sideeffects, but they shouldn't harm us...)
384 echo "64-bit Solaris detected, hacking the PATH" >> $LOG
385 echo "old PATH: $PATH" >> $LOG
386 PATH=`echo ":$PATH:" | sed -e 's,\(:[^:]*/bin\):,\1/amd64:\1:,g' \
387 -e 's/^:*//' -e 's/:*$//g' -e 's/::*/:/g' `
388 export PATH
389 echo "new PATH: $PATH" >> $LOG
390 LIB='lib/64'
391 fi
392 ;;
393 *)
394 log_failure "Cannot determine system"
395 exit 1
396 ;;
397 esac
398 [ -z "$TARGET_MACHINE" ] && TARGET_MACHINE=$BUILD_MACHINE
399 [ -z "$TARGET_CPU" ] && TARGET_CPU=$BUILD_CPU
400 DEVDIR_BIN="$DEVDIR/$OS.$BUILD_MACHINE/bin"
401 log_success "Determined build machine: $OS.$BUILD_MACHINE, target machine: $OS.$TARGET_MACHINE"
402
403 echo "BUILD_PLATFORM=\"$OS\"" >> $ENV
404 echo "export BUILD_PLATFORM" >> $ENV
405 echo "BUILD_PLATFORM_ARCH=\"$BUILD_MACHINE\"" >> $ENV
406 echo "export BUILD_PLATFORM_ARCH" >> $ENV
407 echo "BUILD_TARGET=\"$OS\"" >> $ENV
408 echo "export BUILD_TARGET" >> $ENV
409 echo "BUILD_TARGET_ARCH=\"$TARGET_MACHINE\"" >> $ENV
410 echo "export BUILD_TARGET_ARCH" >> $ENV
411 echo "BUILD_TARGET_CPU=\"$TARGET_CPU\"" >> $ENV
412 echo "export BUILD_TARGET_CPU" >> $ENV
413 echo "BUILD_TYPE=\"$BUILD_TYPE\"" >> $ENV
414 echo "export BUILD_TYPE" >> $ENV
415}
416
417#
418# Check for gcc with version >= 3.2.
419# We depend on a working gcc, if we fail terminate in every case.
420#
421check_gcc()
422{
423 test_header gcc
424 if check_avail "$CC" CC really; then
425 cc_ver=`$CC -dumpversion` 2>/dev/null
426 if [ $? -ne 0 ]; then
427 log_failure "cannot execute '$CC -dumpversion'"
428 fail really
429 fi
430 if check_avail "$CXX" CXX really; then
431 cxx_ver=`$CXX -dumpversion` 2>/dev/null
432 if [ $? -ne 0 ]; then
433 log_failure "cannot execute '$CXX -dumpversion'"
434 fail really
435 fi
436 cc_maj=`echo $cc_ver|cut -d. -f1`
437 cc_min=`echo $cc_ver|cut -d. -f2`
438 if [ "x$cc_ver" != "x$cxx_ver" ]; then
439 log_failure "gcc version $cc_ver does not match g++ version $cxx_ver"
440 fail really
441 elif [ $cc_maj -eq 4 -a $cc_min -eq 0 -a "$OS" = "darwin" ]; then
442 log_success "found version $cc_ver"
443 # gcc-4.0 is allowed for Darwin only
444 elif [ $cc_maj -lt 4 \
445 -o \( $cc_maj -eq 4 -a $cc_min -lt 4 -a "$OS" != "darwin" \) \
446 -o \( $cc_maj -eq 4 -a $cc_min -lt 2 -a "$OS" = "darwin" \) \
447 -o \( $cc_maj -eq 4 -a $cc_min -gt 9 \) \
448 -o \( $cc_maj -eq 5 -a $cc_min -gt 9 \) \
449 -o \( $cc_maj -eq 6 -a $cc_min -gt 9 \) \
450 -o $cc_maj -gt 6 ]; then
451 log_failure "gcc version $cc_maj.$cc_min found, expected gcc 4.x, gcc 5.x or gcc 6.x"
452 fail really
453 else
454 log_success "found version $cc_ver"
455 fi
456 if [ "$BUILD_MACHINE" = "amd64" ]; then
457 [ -z "$CC32" ] && CC32="$CC -m32"
458 [ -z "$CXX32" ] && CXX32="$CXX -m32"
459 else
460 [ -z "$CC32" ] && CC32="$CC"
461 [ -z "$CXX32" ] && CXX32="$CXX"
462 fi
463 if [ "$BUILD_MACHINE" = "x86" -a "$TARGET_MACHINE" = "amd64" ]; then
464 [ -z "$CC64" ] && CC64="$CC -m64"
465 [ -z "$CXX64" ] && CXX64="$CXX -m64"
466 fi
467 if [ "$TARGET_MACHINE" = "amd64" -a $WITH_VMMRAW -eq 0 ]; then
468 CC32="undefined"
469 CXX32="undefined"
470 fi
471 if [ "$CC" != "gcc" ]; then
472 cnf_append "TOOL_GCC3_CC" "$CC"
473 cnf_append "TOOL_GCC3_AS" "$CC"
474 cnf_append "TOOL_GCC3_LD" "$CC"
475 cnf_append "TOOL_GXX3_CC" "$CC"
476 cnf_append "TOOL_GXX3_AS" "$CC"
477 fi
478 if [ "$CXX" != "g++" ]; then
479 cnf_append "TOOL_GCC3_CXX" "$CXX"
480 cnf_append "TOOL_GXX3_CXX" "$CXX"
481 cnf_append "TOOL_GXX3_LD" "$CXX"
482 fi
483 if [ "$CC32" != "gcc -m32" -a "$CC32" != "undefined" ]; then
484 cnf_append "TOOL_GCC32_CC" "$CC32"
485 cnf_append "TOOL_GCC32_AS" "$CC32"
486 cnf_append "TOOL_GCC32_LD" "$CC32"
487 cnf_append "TOOL_GXX32_CC" "$CC32"
488 cnf_append "TOOL_GXX32_AS" "$CC32"
489 fi
490 if [ "$CXX32" != "g++ -m32" -a "$CXX32" != "undefined" ]; then
491 cnf_append "TOOL_GCC32_CXX" "$CXX32"
492 cnf_append "TOOL_GXX32_CXX" "$CXX32"
493 cnf_append "TOOL_GXX32_LD" "$CXX32"
494 fi
495 # this isn't not necessary, there is not such tool.
496 if [ -n "$CC64" ]; then
497 cnf_append "TOOL_GCC64_CC" "$CC64"
498 cnf_append "TOOL_GCC64_AS" "$CC64"
499 cnf_append "TOOL_GCC64_LD" "$CC64"
500 cnf_append "TOOL_GXX64_CC" "$CC64"
501 cnf_append "TOOL_GXX64_AS" "$CC64"
502 fi
503 if [ -n "$CXX64" ]; then
504 cnf_append "TOOL_GCC64_CXX" "$CXX64"
505 cnf_append "TOOL_GXX64_CXX" "$CXX64"
506 cnf_append "TOOL_GXX64_LD" "$CXX64"
507 fi
508 # Solaris sports a 32-bit gcc/g++.
509 if [ "$OS" = "solaris" -a "$BUILD_MACHINE" = "amd64" ]; then
510 [ "$CC" = "gcc" ] && CC="gcc -m64"
511 [ "$CXX" = "g++" ] && CXX="g++ -m64"
512 fi
513 fi
514 fi
515}
516
517
518#
519# Check for the OpenWatcom compiler, needed for compiling the BIOS
520#
521# If the system has Open Watcom installed, WATCOM will be set in the
522# environment. If the user has her/his own Open Watcom install it will be
523# pointed to by on the command line, which will set the WATCOM variable.
524# The only exception is detecting OpenWatcom in tools/common/openwatcom.
525#
526check_open_watcom()
527{
528 test_header "Open Watcom"
529
530 if [ -z "$WATCOM" ]; then
531 WATCOM=`/bin/ls -rd1 $PWD/tools/common/openwatcom/* 2> /dev/null | head -1`
532 if [ -z "$WATCOM" ]; then
533 log_failure "Open Watcom was not found"
534 cnf_append "VBOX_WITH_OPEN_WATCOM" ""
535 return 0;
536 fi
537 fi
538
539 case "$OS" in
540 "darwin") wc_bin="binosx";; # ??
541 "dos") wc_bin="binw";;
542 "freebsd") wc_bin="binfbsd";; # ??
543 "linux") wc_bin="binl";;
544 "netbsd") wc_bin="binnbsd";; # ??
545 "solaris") wc_bin="binsol";; # ??
546 "os2") wc_bin="binp";;
547 "win") wc_bin="binnt";;
548 *) wc_bin="binl";;
549 esac
550
551 # Check that the tools we use are there.
552 for prog in wasm wcc wlink;
553 do
554 if [ ! -f "$WATCOM/$wc_bin/$prog" ]; then
555 log_failure "$WATCOM/$wc_bin/$prog does not exist or is not a regular file."
556 fail
557 fi
558 done
559
560 # Use WASM to get the version.
561 wasm_ver=`$WATCOM/$wc_bin/wasm -? 2>&1 | sed -e '1!d' -e 's/Open Watcom Assembler Version *//'`
562 if [ -z "$wasm_ver" ]; then
563 log_failure "$WATCOM/$wc_bin/wasm -? did not produce the expected response"
564 fail
565 fi
566 log_success "found version $wasm_ver"
567 cnf_append "PATH_TOOL_OPENWATCOM" "$WATCOM"
568 cnf_append "VBOX_WITH_OPEN_WATCOM" "1"
569
570 unset wasm_ver
571 unset wc_wasm
572 unset wc_bin
573}
574
575
576#
577# Check for yasm, needed to compile assembler files
578#
579check_yasm()
580{
581 test_header yasm
582 if check_avail "$YASM" YASM; then
583 yasm_ver=`$YASM --version|grep "^yasm"|sed 's+^yasm \(.*\)+\1+'`
584 if [ $? -ne 0 ]; then
585 log_failure "yasm not found"
586 fail
587 else
588 yasm_maj=`echo $yasm_ver|cut -d. -f1`
589 yasm_min=`echo $yasm_ver|cut -d. -f2`
590 yasm_rev=`echo $yasm_ver|cut -d. -f3`
591 yasm_ver_mul=`expr $yasm_maj \* 10000 + $yasm_min \* 100 + $yasm_rev`
592 if [ $yasm_ver_mul -lt 501 ]; then
593 log_failure "found version $yasm_ver, expected at least 0.5.1"
594 fail
595 else
596 log_success "found version $yasm_ver"
597 fi
598 fi
599 fi
600}
601
602
603#
604# Check for the iasl ACPI compiler, needed to compile vbox.dsl
605#
606check_iasl()
607{
608 test_header iasl
609 if check_avail "$IASL" IASL; then
610 iasl_ver=`$IASL|grep "ASL.*version"|sed 's+^ASL.*version \([0-9]*\).*+\1+'`
611 if [ $? -ne 0 ]; then
612 log_failure "iasl not found"
613 fail
614 else
615 log_success "found version $iasl_ver"
616 cnf_append "VBOX_IASLCMD" "`which_wrapper $IASL`"
617 fi
618 fi
619}
620
621
622#
623# Check for xsltproc, needed by Main
624#
625check_xsltproc()
626{
627 if [ -n "$BUILD_LIBXSLT" ]; then
628 return 0;
629 fi
630 test_header xslt
631 if check_avail "$XSLTPROC" XSLTPROC; then
632 xsltproc_ver=`$XSLTPROC --version`
633 if [ $? -ne 0 ]; then
634 log_failure "xsltproc not found"
635 fail
636 else
637 log_success "found"
638 cnf_append "VBOX_XSLTPROC" "`which_wrapper $XSLTPROC`"
639 fi
640 fi
641}
642
643
644#
645# Check for mkisofs, needed to build the CDROM image containing the additions
646#
647check_mkisofs()
648{
649 test_header mkisofs
650 if which_wrapper $GENISOIMAGE > /dev/null; then
651 mkisofs_ver=`$GENISOIMAGE --version`
652 if [ $? -ne 0 ]; then
653 log_failure "mkisofs not found"
654 fail
655 else
656 log_success "found $mkisofs_ver"
657 cnf_append "VBOX_MKISOFS" "`which_wrapper $GENISOIMAGE`"
658 fi
659 elif check_avail "$MKISOFS" MKISOFS; then
660 mkisofs_ver=`$MKISOFS --version`
661 if [ $? -ne 0 ]; then
662 log_failure "mkisofs not working"
663 fail
664 else
665 log_success "found $mkisofs_ver"
666 cnf_append "VBOX_MKISOFS" "`which_wrapper $MKISOFS`"
667 fi
668 fi
669}
670
671
672#
673# Check for libxml2, needed by VBoxSettings and Runtime.
674# 2.6.24 is known to NOT work, 2.6.26 is known to work (there is no 2.6.25 release)
675#
676check_libxml2()
677{
678 if [ -z "$BUILD_LIBXML2" ]; then
679 test_header libxml2
680 if which_wrapper pkg-config > /dev/null; then
681 libxml2_ver=`pkg-config libxml-2.0 --modversion 2>> $LOG`
682 if [ $? -ne 0 ]; then
683 log_failure "libxml2 not found"
684 fail
685 else
686 FLGXML2=`pkg-config libxml-2.0 --cflags`
687 INCXML2=`strip_I "$FLGXML2"`
688 LIBXML2=`pkg-config libxml-2.0 --libs`
689 cat > $ODIR.tmp_src.cc << EOF
690#include <cstdio>
691#include <libxml/xmlversion.h>
692extern "C" int main(void)
693{
694 printf("found version %s", LIBXML_DOTTED_VERSION);
695#if LIBXML_VERSION >= 20626
696 printf(", OK.\n");
697 return 0;
698#else
699 printf(", expected version 2.6.26 or higher\n");
700 return 1;
701#endif
702}
703EOF
704 [ -n "$INCXML2" ] && I_INCXML2=`prefix_I "$INCXML2"`
705 if test_compile "$LIBXML2 $LIBPTHREAD $I_INCXML2" xml2 xml2; then
706 if test_execute; then
707 cnf_append "SDK_VBOX_LIBXML2_INCS" "$INCXML2"
708 cnf_append "SDK_VBOX_LIBXML2_LIBS" "`strip_l "$LIBXML2"`"
709 fi
710 fi
711 fi
712 elif which_wrapper xml2-config; then
713 libxml2_ver=`xml2-config --version`
714 if [ $? -ne 0 ]; then
715 log_failure "xml2-config not found"
716 fail
717 else
718 log_success "found version $libxml2_ver"
719 FLGXML2=`xml2-config --cflags`
720 INCXML2=`strip_I "$FLGXML2"`
721 LIBXML2=`xml2-config --libs`
722 cat > $ODIR.tmp_src.cc << EOF
723#include <cstdio>
724#include <libxml/xmlversion.h>
725extern "C" int main(void)
726{
727 printf("found version %s", LIBXML_DOTTED_VERSION);
728#if LIBXML_VERSION >= 20626
729 printf(", OK.\n");
730 return 0;
731#else
732 printf(", expected version 2.6.26 or higher\n");
733 return 1;
734#endif
735}
736EOF
737 [ -n "$INCXML2" ] && I_INCXML2=`prefix_I "$INCXML2"`
738 if test_compile "$LIBXML2 $LIBPTHREAD $I_INCXML2" xml2 xml2; then
739 if test_execute; then
740 cnf_append "SDK_VBOX_LIBXML2_INCS" "$INCXML2"
741 cnf_append "SDK_VBOX_LIBXML2_LIBS" "`strip_l "$LIBXML2"`"
742 fi
743 fi
744 fi
745 else
746 log_failure "neither pkg-config nor xml2-config found"
747 fail
748 fi
749 fi
750}
751
752
753#
754# Check for libIDL, needed by xpcom
755#
756check_libidl()
757{
758 test_header libIDL
759
760 if which_wrapper libIDL-config-2 > /dev/null; then
761 libidl_ver=`libIDL-config-2 --version`
762 if [ $? -ne 0 ]; then
763 log_failure "libIDL-config-2 not working"
764 fail
765 else
766 log_success "found version $libidl_ver"
767 cnf_append "VBOX_LIBIDL_CONFIG" \
768 "PKG_CONFIG_PATH=`libIDL-config-2 --prefix`/$LIB/pkgconfig `which_wrapper libIDL-config-2`"
769 fi
770 elif check_avail "libIDL-config" libIDL-config; then
771 libidl_ver=`libIDL-config --version`
772 if [ $? -ne 0 ]; then
773 log_failure "libIDL-config not working"
774 fail
775 else
776 log_success "found version $libidl_ver"
777 cnf_append "VBOX_LIBIDL_CONFIG" "`which_wrapper libIDL-config`"
778 fi
779 fi
780}
781
782
783#
784# Check for libdevmapper, needed by the VBoxVolInfo
785#
786check_libdevmapper()
787{
788 test_header libdevmapper
789 cat > $ODIR.tmp_src.cc << EOF
790#include <cstdio>
791extern "C" {
792#define private
793#include <libdevmapper.h>
794int main()
795{
796 char version[80];
797
798 if (!dm_get_library_version(version, sizeof(version)))
799 {
800 printf("dm_get_library_version() failed.\n");
801 return 1;
802 }
803
804 const char* v=version;
805 unsigned int major = 0, minor = 0, micro = 0;
806
807 for (; *v !='.' && *v != '\0'; v++) major = major*10 + *v-'0';
808 if (*v == '.') v++;
809 for (; *v !='.' && *v != '\0'; v++) minor = minor*10 + *v-'0';
810 if (*v == '.') v++;
811 for (; *v !='.' && *v != '\0'; v++) micro = micro*10 + *v-'0';
812
813 printf("found version %s", version);
814 if (major*10000 + minor*100 + micro >= 10200)
815 {
816 printf(", OK.\n");
817 return 0;
818 }
819 else
820 {
821 printf(", expected version 1.02 or higher\n");
822 return 1;
823 }
824}
825}
826EOF
827 if test_compile "$LIBDEVMAPPER $INCDEVMAPPER" libdevmapper libdevmapper; then
828 if test_execute; then
829 cnf_append "VBOX_WITH_DEVMAPPER" "1"
830 fi
831 fi
832}
833
834
835#
836# Check for openssl, needed for RDP and S3
837#
838check_ssl()
839{
840 if [ -z "$BUILD_LIBSSL" ]; then
841 test_header ssl
842 cat > $ODIR.tmp_src.cc << EOF
843#include <cstdio>
844#include <openssl/opensslv.h>
845#include <openssl/ssl.h>
846extern "C" int main(void)
847{
848 printf("found version %s", OPENSSL_VERSION_TEXT);
849 SSL_library_init();
850#if OPENSSL_VERSION_NUMBER >= 0x00908000
851 printf(", OK.\n");
852 return 0;
853#else
854 printf(", expected version 0.9.8 or higher\n");
855 return 1;
856#endif
857}
858EOF
859 if test_compile "$INCCRYPTO $LIBCRYPTO" libcrypto openssl; then
860 if test_execute nofatal; then
861 cnf_append "SDK_VBOX_OPENSSL_INCS" "`strip_I "$INCCRYPTO"`"
862 cnf_append "SDK_VBOX_OPENSSL_LIBS" "`strip_l "$LIBCRYPTO"`"
863 cnf_append "SDK_VBOX_BLD_OPENSSL_LIBS" "`strip_l "$LIBCRYPTO"`"
864 fi
865 fi
866 fi
867}
868
869
870#
871# Check for pthread, needed by VBoxSVC, frontends, ...
872#
873check_pthread()
874{
875 test_header pthread
876 cat > $ODIR.tmp_src.cc << EOF
877#include <cstdio>
878#include <pthread.h>
879extern "C" int main(void)
880{
881 pthread_mutex_t mutex;
882 if (pthread_mutex_init(&mutex, NULL)) {
883 printf("pthread_mutex_init() failed\n");
884 return 1;
885 }
886 if (pthread_mutex_lock(&mutex)) {
887 printf("pthread_mutex_lock() failed\n");
888 return 1;
889 }
890 if (pthread_mutex_unlock(&mutex)) {
891 printf("pthread_mutex_unlock() failed\n");
892 return 1;
893 }
894 printf("found, OK.\n");
895}
896EOF
897 if test_compile $LIBPTHREAD pthread pthread; then
898 if test_execute; then
899 cnf_append "LIB_PTHREAD" "`strip_l "$LIBPTHREAD"`"
900 fi
901 fi
902}
903
904
905#
906# Check for zlib, needed by VBoxSVC, Runtime, ...
907#
908check_z()
909{
910 test_header zlib
911 cat > $ODIR.tmp_src.cc << EOF
912#include <cstdio>
913#include <zlib.h>
914extern "C" int main(void)
915{
916 printf("found version %s", ZLIB_VERSION);
917#if ZLIB_VERNUM >= 0x1210
918 printf(", OK.\n");
919 return 0;
920#else
921 printf(", expected version 1.2.1 or higher\n");
922 return 1;
923#endif
924}
925EOF
926 [ -n "$INCZ" ] && I_INCZ=`prefix_I "$INCZ"`
927 if test_compile "$LIBZ $I_INCZ" zlib zlib; then
928 if test_execute; then
929 echo "if1of (\$(KBUILD_TARGET),darwin freebsd haiku linux)" >> $CNF
930 cnf_append " SDK_VBOX_ZLIB_LIBS" "`strip_l "$LIBZ"`"
931 cnf_append " SDK_VBOX_ZLIB_INCS" "$INCZ"
932 echo "endif" >> $CNF
933 fi
934 fi
935}
936
937
938#
939# Check for libpng, needed by kchmviewer
940#
941check_png()
942{
943 test_header libpng
944 cat > $ODIR.tmp_src.cc << EOF
945#include <cstdio>
946#include <png.h>
947extern "C" int main(void)
948{
949 printf("found version %s", PNG_LIBPNG_VER_STRING);
950#if PNG_LIBPNG_VER >= 10205
951 printf(", OK.\n");
952 return 0;
953#else
954 printf(", expected version 1.2.5 or higher\n");
955 return 1;
956#endif
957}
958EOF
959 [ -n "$INCPNG" ] && I_INCPNG=`prefix_I "$INCPNG"`
960 if test_compile "$LIBPNG $I_INCPNG" libpng libpng; then
961 if test_execute; then
962 cnf_append "SDK_VBOX_LIBPNG_LIBS" "`strip_l "$LIBPNG"`"
963 cnf_append "SDK_VBOX_LIBPNG_INCS" "$INCPNG"
964 fi
965 fi
966}
967
968#
969# Check for libvncserver, needed for VNC in OSE
970#
971check_vncserver()
972{
973 test_header libvncserver
974 cat > $ODIR.tmp_src.cc <<EOF
975#include <cstdio>
976#include <rfb/rfbconfig.h>
977
978extern "C" int main()
979{
980 const char* v=LIBVNCSERVER_VERSION;
981 unsigned int major = 0, minor = 0, micro = 0;
982
983 for (; *v !='.' && *v != '\0'; v++) major = major*10 + *v-'0';
984 if (*v == '.') v++;
985 for (; *v !='.' && *v != '\0'; v++) minor = minor*10 + *v-'0';
986 if (*v == '.') v++;
987 for (; *v !='.' && *v != '\0'; v++) micro = micro*10 + *v-'0';
988
989 printf("found version %s", LIBVNCSERVER_PACKAGE_VERSION);
990 if (major*10000 + minor*100 + micro >= 900)
991 {
992 printf(", OK.\n");
993 return 0;
994 }
995 else
996 {
997 printf(", expected version 0.9 or higher\n");
998 return 1;
999 }
1000}
1001EOF
1002 if test_compile "$LIBVNCSERVER $INCVNCSERVER" libvncserver libvncserver; then
1003 if test_execute; then
1004 cnf_append "VBOX_WITH_EXTPACK_VNC" "1"
1005 fi
1006 fi
1007}
1008
1009#
1010# Check for libcurl, needed by S3
1011#
1012check_curl()
1013{
1014 if [ -z "$BUILD_LIBCURL" ]; then
1015 test_header libcurl
1016 cat > $ODIR.tmp_src.cc << EOF
1017#include <cstdio>
1018#include <curl/curl.h>
1019extern "C" int main(void)
1020{
1021 printf("found version %s", LIBCURL_VERSION);
1022#if 10000*LIBCURL_VERSION_MAJOR + 100*LIBCURL_VERSION_MINOR + LIBCURL_VERSION_PATCH >= 71901
1023 printf(", OK.\n");
1024 return 0;
1025#else
1026 printf(", expected version 7.19.1 or higher\n");
1027 return 1;
1028#endif
1029}
1030EOF
1031 [ -n "$INCCURL" ] && I_INCCURL=`prefix_I "$INCCURL"`
1032 if test_compile "$LIBCURL $I_INCCURL" libcurl libcurl; then
1033 if test_execute; then
1034 cnf_append "SDK_VBOX_LIBCURL_LIBS" "`strip_l "$LIBCURL"`"
1035 cnf_append "SDK_VBOX_LIBCURL_INCS" "$INCCURL"
1036 fi
1037 fi
1038 fi
1039}
1040
1041
1042#
1043# Check for pam, needed by VRDPAuth
1044# Version 79 was introduced in 9/2005, do we support older versions?
1045# Debian/sarge uses 76
1046# OpenSUSE comes with 0.99.xxx where they changed the versioning scheme.
1047#
1048check_pam()
1049{
1050 test_header pam
1051 cat > $ODIR.tmp_src.cc << EOF
1052#include <cstdio>
1053#include <security/pam_appl.h>
1054extern "C" int main(void)
1055{
1056 printf("found version %d", __LIBPAM_VERSION);
1057 if (__LIBPAM_VERSION >= 76)
1058 {
1059 printf(", OK.\n");
1060 return 0;
1061 }
1062 else
1063 {
1064 printf(", expected version 76 or higher\n");
1065 return 1;
1066 }
1067}
1068EOF
1069 if test_compile "-lpam" pam pam nofatal; then
1070 if test_execute nofatal; then
1071 return 0;
1072 fi
1073 fi
1074 echo "pam0.x not found"
1075 test_header linux_pam
1076 cat > $ODIR.tmp_src.cc << EOF
1077#include <cstdio>
1078#include <security/pam_appl.h>
1079extern "C" int main(void)
1080{
1081 printf("found version %d.%d", __LINUX_PAM__, __LINUX_PAM_MINOR__);
1082 if (__LINUX_PAM__ >= 1)
1083 {
1084 printf(", OK.\n");
1085 return 0;
1086 }
1087 else
1088 {
1089 printf(", expected version 1.0 or higher\n");
1090 return 1;
1091 }
1092}
1093EOF
1094 if test_compile "-lpam" pam pam; then
1095 test_execute
1096 fi
1097}
1098
1099
1100#
1101# Check for the SDL library, needed by VBoxSDL and VirtualBox
1102# We depend at least on version 1.2.7
1103#
1104check_sdl()
1105{
1106 test_header SDL
1107 if [ "$OS" = "darwin" ]; then
1108 if [ -f "/System/Library/Frameworks/SDL.framework/SDL" ]; then
1109 PATH_SDK_LIBSDL="/System/Library/Frameworks/SDL.framework"
1110 elif [ -f "/Library/Frameworks/SDL.framework/SDL" ]; then
1111 PATH_SDK_LIBSDL="/Library/Frameworks/SDL.framework"
1112 fi
1113 if [ -n "$PATH_SDK_LIBSDL" ]; then
1114 foundsdl=1
1115 INCSDL="$PATH_SDK_LIBSDL/Headers"
1116 FLDSDL="-framework SDL"
1117 else
1118 log_failure "SDL framework not found"
1119 fail
1120 fi
1121 else
1122 if which_wrapper sdl-config > /dev/null; then
1123 FLGSDL=`sdl-config --cflags`
1124 INCSDL=`strip_I "$FLGSDL"`
1125 LIBSDL=`sdl-config --libs`
1126 LIBSDLMAIN="-lSDLmain"
1127 FLDSDL=
1128 foundsdl=1
1129 fi
1130 fi
1131 [ "$OS" = "linux" -o "$OS" = "darwin" -o "$OS" = "solaris" ] && LIBSDLMAIN=""
1132 if [ -n "$foundsdl" ]; then
1133 cat > $ODIR.tmp_src.cc << EOF
1134#include <cstdio>
1135#include <SDL.h>
1136#include <SDL_main.h>
1137#undef main
1138extern "C" int main(int argc, char** argv)
1139{
1140 printf("found version %d.%d.%d",
1141 SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
1142#if SDL_VERSION_ATLEAST(1,2,7)
1143 printf(", OK.\n");
1144 return 0;
1145#else
1146 printf(", expected version 1.2.7 or higher\n");
1147 return 1;
1148#endif
1149}
1150EOF
1151 [ -n "$INCSDL" ] && I_INCSDL=`prefix_I "$INCSDL"`
1152 if test_compile "$LIBSDL $LIBSDLMAIN $I_INCSDL $FLDSDL" SDL SDL; then
1153 if test_execute; then
1154 cnf_append "LIB_SDK_LIBSDL_SDL" "`strip_l "$LIBSDL"`"
1155 cnf_append "SDK_LIBSDL_LIBPATH" "`strip_L "$LIBSDL"`"
1156 cnf_append "LIB_SDK_LIBSDL_SDLMAIN" "`strip_l "$LIBSDLMAIN"`"
1157 [ -n "$INCSDL" ] && cnf_append "SDK_LIBSDL_INCS" "$INCSDL"
1158 [ -n "$FLDSDL" ] && cnf_append "SDK_LIBSDL_LDFLAGS" "$FLDSDL"
1159 fi
1160 fi
1161 else
1162 log_failure "SDL not found (can be disabled using --disable-sdl)"
1163 fail
1164 fi
1165}
1166
1167
1168#
1169# Check for the SDL_ttf library, needed by VBoxSDL (secure label)
1170#
1171check_sdl_ttf()
1172{
1173 test_header SDL_ttf
1174 cat > $ODIR.tmp_src.cc << EOF
1175#include <cstdio>
1176#include <SDL_ttf.h>
1177#ifndef SDL_TTF_MAJOR_VERSION
1178#define SDL_TTF_MAJOR_VERSION TTF_MAJOR_VERSION
1179#define SDL_TTF_MINOR_VERSION TTF_MINOR_VERSION
1180#define SDL_TTF_PATCHLEVEL TTF_PATCHLEVEL
1181#endif
1182extern "C" int main(void)
1183{
1184 printf("found version %d.%d.%d",
1185 SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL);
1186#if 10000*SDL_TTF_MAJOR_VERSION + 100*SDL_TTF_MINOR_VERSION + SDL_TTF_PATCHLEVEL >= 20006
1187 printf(", OK.\n");
1188 return 0;
1189#else
1190 printf(", expected version 2.0.6 or higher\n");
1191 return 1;
1192#endif
1193}
1194EOF
1195 if test_compile "-lSDL_ttf $I_INCSDL" SDL_ttf SDL_ttf nofatal; then
1196 test_execute nofatal || \
1197 cnf_append "VBOX_WITH_SECURELABEL" ""
1198 else
1199 echo "not found -- disabling VBoxSDL secure label."
1200 cnf_append "VBOX_WITH_SECURELABEL" ""
1201 fi
1202}
1203
1204
1205#
1206# Check for libasound, needed by the ALSA audio backend
1207#
1208check_alsa()
1209{
1210 test_header ALSA
1211 cat > $ODIR.tmp_src.cc << EOF
1212#include <cstdio>
1213#include <alsa/asoundlib.h>
1214extern "C" int main(void)
1215{
1216 printf("found version %d.%d.%d",
1217 SND_LIB_MAJOR, SND_LIB_MINOR, SND_LIB_SUBMINOR);
1218#if 10000*SND_LIB_MAJOR + 100*SND_LIB_MINOR + SND_LIB_SUBMINOR >= 10014
1219 printf(", OK.\n");
1220 return 0;
1221#else
1222 printf(", expected version 1.0.14 or higher\n");
1223 return 1;
1224#endif
1225}
1226EOF
1227 if test_compile "-lasound" asound asound; then
1228 test_execute
1229 fi
1230}
1231
1232
1233#
1234# Check for PulseAudio
1235#
1236check_pulse()
1237{
1238 test_header "PulseAudio"
1239 cat > $ODIR.tmp_src.cc << EOF
1240#include <cstdio>
1241#include <pulse/version.h>
1242extern "C" int main(void)
1243{
1244 printf("found version %s API version %d", pa_get_headers_version(), PA_API_VERSION);
1245#if PA_API_VERSION >= 9
1246 printf(", OK.\n");
1247 return 0;
1248#else
1249 printf(", expected version 0.9.0 (API version 9) or higher\n");
1250 return 1;
1251#endif
1252}
1253EOF
1254 if test_compile "$INCPULSE $LIBPULSE -lpulse" pulse pulse; then
1255 test_execute
1256 fi
1257}
1258
1259
1260#
1261# Check for the X libraries (Xext, X11)
1262#
1263check_x()
1264{
1265 test_header "X libraries"
1266 cat > $ODIR.tmp_src.cc << EOF
1267#include <cstdio>
1268#include <X11/Xlib.h>
1269extern "C" int main(void)
1270{
1271 Display *dpy;
1272 int scrn_num;
1273 Screen *scrn;
1274 Window win;
1275
1276 dpy = XOpenDisplay(NULL);
1277 scrn_num = DefaultScreen(dpy);
1278 scrn = ScreenOfDisplay(dpy, scrn_num);
1279 win = XCreateWindow(dpy, RootWindowOfScreen(scrn), 0, 0, 100, 100,
1280 0, 16, InputOutput, CopyFromParent, 0, NULL);
1281 XDestroyWindow(dpy, win);
1282 XCloseDisplay(dpy);
1283}
1284EOF
1285 [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1286 if test_compile "$LIBX11 $I_INCX11" Xlibs Xlibs; then
1287 log_success "found"
1288 fi
1289}
1290
1291
1292#
1293# Check for the Xcursor library, needed by VBoxSDL.
1294#
1295check_xcursor()
1296{
1297 test_header Xcursor
1298 cat > $ODIR.tmp_src.cc << EOF
1299#include <cstdio>
1300#include <X11/Xlib.h>
1301#include <X11/Xcursor/Xcursor.h>
1302extern "C" int main(void)
1303{
1304 XcursorImage *cursor = XcursorImageCreate (10, 10);
1305 XcursorImageDestroy(cursor);
1306 return 0;
1307}
1308EOF
1309 [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1310 if test_compile "$LIBX11 $LIBXCURSOR $I_INCX11" Xcursor Xcursor; then
1311 log_success "found"
1312 cnf_append "VBOX_XCURSOR_LIBS" "`strip_l "$LIBXCURSOR"`"
1313 fi
1314}
1315
1316
1317#
1318# Check for the Xinerama library, needed by the Qt GUI
1319#
1320check_xinerama()
1321{
1322 test_header Xinerama
1323 cat > $ODIR.tmp_src.cc << EOF
1324#include <X11/Xlib.h>
1325#include <X11/extensions/Xinerama.h>
1326extern "C" int main(void)
1327{
1328 Display *dpy;
1329 Bool flag;
1330 dpy = XOpenDisplay(NULL);
1331 if (dpy)
1332 {
1333 flag = XineramaIsActive(dpy);
1334 XCloseDisplay(dpy);
1335 }
1336}
1337EOF
1338 [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1339 if test_compile "$LIBX11 $LIBXINERAMA $I_INCX11" Xinerama Xinerama; then
1340 log_success "found"
1341 fi
1342}
1343
1344
1345#
1346# Check for the Xinerama library, needed by the Qt GUI
1347#
1348check_xrandr()
1349{
1350 test_header Xrandr
1351 cat > $ODIR.tmp_src.cc << EOF
1352#include <X11/Xlib.h>
1353#include <X11/extensions/Xrandr.h>
1354extern "C" int main(void)
1355{
1356 Display *dpy;
1357 Bool flag;
1358 int major, minor;
1359 dpy = XOpenDisplay(NULL);
1360 if (dpy)
1361 {
1362 flag = XRRQueryVersion(dpy, &major, &minor);
1363 XCloseDisplay(dpy);
1364 }
1365}
1366EOF
1367 [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1368 if test_compile "$LIBX11 $LIBXRANDR $I_INCX11" Xrandr Xrandr; then
1369 log_success "found"
1370 fi
1371}
1372
1373
1374#
1375# Check for OpenGL
1376#
1377check_opengl()
1378{
1379 # On darwin this is a on/off decision only
1380 if [ "$OS" = "darwin" ]; then
1381 test_header "OpenGL support"
1382 echo "enabled"
1383 cnf_append "VBOX_WITH_CROGL" "1"
1384 else
1385 check_xmu
1386 check_mesa
1387 fi
1388}
1389
1390
1391#
1392# Check for the Xmu library, needed by OpenGL
1393#
1394check_xmu()
1395{
1396 test_header Xmu
1397 cat > $ODIR.tmp_src.cc << EOF
1398#include <cstdio>
1399#include <X11/Xatom.h>
1400#include <X11/Xlib.h>
1401#include <X11/Xutil.h>
1402#include <X11/Xmu/StdCmap.h>
1403extern "C" int main(void)
1404{
1405 Display *dpy;
1406 int scrn_num;
1407 Screen *scrn;
1408
1409 dpy = XOpenDisplay(NULL);
1410 if (dpy)
1411 {
1412 scrn_num = DefaultScreen(dpy);
1413 scrn = ScreenOfDisplay(dpy, scrn_num);
1414 Status status = XmuLookupStandardColormap(dpy, RootWindowOfScreen(scrn), 0,
1415 24, XA_RGB_DEFAULT_MAP, False, True);
1416 printf("Status = %x\n", status);
1417 XCloseDisplay(dpy);
1418 }
1419 return 0;
1420}
1421EOF
1422 [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1423 if test_compile "$LIBX11 $LIBXMU $I_INCX11" Xmu Xmu; then
1424 log_success "found"
1425 cnf_append "VBOX_XMU_LIBS" "`strip_l "$LIBXMU"`"
1426 fi
1427}
1428
1429#
1430# Check for Mesa, needed by OpenGL
1431#
1432check_mesa()
1433{
1434 test_header "Mesa / GLU"
1435 cat > $ODIR.tmp_src.cc << EOF
1436#include <cstdio>
1437#include <X11/Xlib.h>
1438#include <GL/glx.h>
1439#include <GL/glu.h>
1440extern "C" int main(void)
1441{
1442 Display *dpy;
1443 int major, minor;
1444
1445 dpy = XOpenDisplay(NULL);
1446 if (dpy)
1447 {
1448 Bool glx_version = glXQueryVersion(dpy, &major, &minor);
1449 XCloseDisplay(dpy);
1450 if (glx_version)
1451 {
1452 printf("found version %u.%u, OK.\n", major, minor);
1453 return 0;
1454 }
1455 }
1456 printf("found (inactive), OK.\n");
1457 return 0;
1458}
1459EOF
1460 [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1461 if test_compile "$LIBX11 $MESA $I_INCX11" Mesa Mesa; then
1462 [ $PASSIVE_MESA -eq 1 ] && unset DISPLAY
1463 test_execute
1464 fi
1465}
1466
1467
1468#
1469# Check for the Qt4 library, needed by the VirtualBox frontend
1470#
1471# Currently not fatal.
1472#
1473check_qt4()
1474{
1475 foundqt4=
1476 test_header Qt4
1477 cat > $ODIR.tmp_src.cc << EOF
1478#include <QtGlobal>
1479extern "C" int main(void)
1480{
1481#if QT_VERSION >= 0x040800
1482 return 0;
1483#else
1484 return 1;
1485#endif
1486}
1487EOF
1488 if [ "$OS" = "darwin" ]; then
1489 # First check if there is the internal version of Qt. If yes nothing else
1490 # has to be done.
1491 QT_INTERNAL=`/bin/ls -rd1 $PWD/tools/$BUILD_TARGET.$BUILD_PLATFORM_ARCH/qt/* 2> /dev/null`
1492 for t in $QT_INTERNAL; do
1493 if [ -f "$t/Frameworks/QtCoreVBox.framework/QtCoreVBox" ]; then
1494 cnf_append "VBOX_WITH_ORACLE_QT" "1"
1495 log_success "use internal version"
1496 return
1497 fi
1498 done
1499 # Now try the user provided directory and some of the standard directories.
1500 QT_TRIES="$QT4DIR /System/Library /Library"
1501 for t in $QT_TRIES; do
1502 if [ -f "$t/Frameworks/QtCore.framework/QtCore" ]; then
1503 PATH_SDK_QT4="$t"
1504 break
1505 fi
1506 done
1507 # Add the necessary params for building the test application
1508 if [ -n "$PATH_SDK_QT4" ]; then
1509 foundqt4=1
1510 INCQT4=-I$PATH_SDK_QT4/Frameworks/QtCore.framework/Headers
1511 LIBQT4=-F$PATH_SDK_QT4/Frameworks
1512 FLGQT4="-framework QtCore"
1513 else
1514 log_failure "Qt4 framework not found (can be disabled using --disable-qt)"
1515 fail
1516 fi
1517 else # !darwin
1518 if [ $QT4DIR_PKGCONFIG -eq 1 ]; then
1519 # default is to use pkg-config
1520 if which_wrapper pkg-config > /dev/null; then
1521 qt4_ver=`pkg-config QtCore --modversion 2>> $LOG`
1522 if [ $? -eq 0 ]; then
1523 FLGQT4=`pkg-config QtCore --cflags`
1524 INCQT4=`strip_I "$FLGQT4"`
1525 LIBQT4=`PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 pkg-config QtCore --libs`
1526 TOOLQT4=`pkg-config QtCore --variable=prefix`
1527 TOOLQT4MOC="`pkg-config QtCore --variable=moc_location`"
1528 TOOLQT4BIN="`dirname $TOOLQT4MOC`"
1529 if test_compile "$LIBQT4 $LIBPTHREAD $FLGQT4" qt4 qt4 nofatal; then
1530 test_execute_path "`strip_L "$LIBQT4"`" nofatal && foundqt4=3 # pkg-config
1531 fi
1532 fi
1533 else
1534 log_failure "pkg-config not found"
1535 fail
1536 fi
1537 fi
1538 if [ -z "$foundqt4" ]; then
1539 # do it the old way (e.g. user has specified QT4DIR)
1540 for q in $QT4DIR "$PWD/tools/linux.$TARGET_MACHINE"/qt/v4.8.*; do
1541 INCQT4="$q/include $q/include/QtCore"
1542 FLGQT4="-DQT_SHARED"
1543 I_INCQT4=`prefix_I "$INCQT4"`
1544 LIBQT4="-L$q/lib -lQtCoreVBox"
1545 TOOLQT4="$q"
1546 if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal &&
1547 test_execute_path "`strip_L "$LIBQT4"`" nofatal; then
1548 foundqt4=2 # internal
1549 break;
1550 fi
1551 LIBQT4="-L$q/lib -lQtCore"
1552 if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal &&
1553 test_execute_path "`strip_L "$LIBQT4"`" nofatal; then
1554 foundqt4=1 # no pkg-config, Qt directory
1555 break;
1556 fi
1557 done
1558 fi
1559 fi
1560 if [ -n "$foundqt4" ]; then
1561 # we decided which version of Qt to use. Now enforce the version requirement
1562 cat > $ODIR.tmp_src.cc << EOF
1563#include <cstdio>
1564#include <QtGlobal>
1565extern "C" int main(void)
1566{
1567 printf("found version %s", QT_VERSION_STR);
1568#if QT_VERSION >= 0x040800
1569 printf(", OK.\n");
1570 return 0;
1571#else
1572 printf(", expected version 4.8.0 or higher\n");
1573 return 1;
1574#endif
1575}
1576EOF
1577 [ -n "$INCQT4" ] && I_INCQT4=`prefix_I "$INCQT4"`
1578 if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
1579 if test_execute_path "`strip_L "$LIBQT4"`"; then
1580 if [ "$OS" = "darwin" ]; then
1581 # Successful build & run the test application so add the necessary
1582 # params to AutoConfig.kmk
1583 cnf_append "PATH_SDK_QT4_INC" "$PATH_SDK_QT4/Frameworks"
1584 cnf_append "PATH_SDK_QT4_LIB" "$PATH_SDK_QT4/Frameworks"
1585 cnf_append "PATH_SDK_QT4" "$PATH_SDK_QT4/Frameworks"
1586 # Check for the moc tool in the Qt directory found & some standard
1587 # directories.
1588 for q in $PATH_SDK_QT4 /usr /Developer/Tools/Qt; do
1589 if which_wrapper "$q/bin/moc" > /dev/null; then
1590 cnf_append "PATH_TOOL_QT4_BIN" "$q/bin"
1591 fi
1592 done
1593 else
1594 # strip .../QtCore as we add components ourself
1595 INCQT4=`echo "$INCQT4"|$KBUILD_SED 's|\([^ ]*\)/QtCore|\1|g; s| $||g'`
1596 # store only the first path, remove all other pathes
1597 # most likely pkg-config gave us -I/usr/include/qt4 -I/usr/include/qt4/QtCore
1598 INCQT4=`echo "$INCQT4"|$KBUILD_SED 's|\([^ ]*\) .*|\1|'`
1599 cnf_append "VBOX_PATH_QT_LIB" "`strip_L "$LIBQT4"`"
1600 cnf_append "PATH_SDK_QT4_INC" "$INCQT4"
1601 # this is not quite right since the qt libpath does not have to be first...
1602 cnf_append "PATH_SDK_QT4_LIB" '$'"(firstword `strip_L "$LIBQT4"`)"
1603 if [ "$foundqt4" = "2" ]; then
1604 cnf_append "VBOX_WITH_ORACLE_QT" "1"
1605 fi
1606 if [ "$foundqt4" != "3" ]; then
1607 TOOLQT4BIN="$TOOLQT4/bin"
1608 fi
1609 test_header "Qt4 devtools"
1610 # try it with a suffix, some platforms use that
1611 if which_wrapper "$TOOLQT4BIN/moc-qt4" > /dev/null; then
1612 QT4BINSUFF="-qt4"
1613 else
1614 QT4BINSUFF=""
1615 fi
1616 moc_ver=`$TOOLQT4BIN/moc$QT4BINSUFF -v 2>&1|sed 's+^.*(Qt \(.*\))+\1+'`
1617 if [ $? -ne 0 ]; then
1618 log_failure "moc$QT4BINSUFF not working"
1619 fail
1620 else
1621 log_success "found version $moc_ver"
1622 cnf_append "VBOX_PATH_QT" "$TOOLQT4"
1623 cnf_append "PATH_SDK_QT4" "$TOOLQT4"
1624 cnf_append "PATH_TOOL_QT4_BIN" "$TOOLQT4BIN"
1625 [ -n "$QT4BINSUFF" ] && cnf_append "TOOL_QT4_BIN_SUFF" "$QT4BINSUFF"
1626 fi
1627 fi
1628 fi
1629 else
1630 log_failure "qt4 not working"
1631 fail
1632 fi
1633 else
1634 log_failure "qt4 not found"
1635 fail
1636 fi
1637}
1638
1639
1640#
1641# Check for the Qt5 library, needed by the VirtualBox frontend
1642#
1643# Currently not fatal.
1644#
1645check_qt5()
1646{
1647 foundqt5=
1648 test_header Qt5
1649 cat > $ODIR.tmp_src.cc << EOF
1650#include <QtGlobal>
1651extern "C" int main(void)
1652{
1653#if QT_VERSION >= 0x050302
1654 return 0;
1655#else
1656 return 1;
1657#endif
1658}
1659EOF
1660 if [ "$OS" = "darwin" ]; then
1661 # First check if there is the internal version of Qt. If yes nothing else
1662 # has to be done.
1663 QT_INTERNAL=`/bin/ls -rd1 $PWD/tools/$BUILD_TARGET.$BUILD_PLATFORM_ARCH/qt/* 2> /dev/null`
1664 for t in $QT_INTERNAL; do
1665 if [ -f "$t/Frameworks/QtCoreVBox.framework/QtCoreVBox" ]; then
1666 cnf_append "VBOX_WITH_ORACLE_QT" "1"
1667 log_success "use internal version"
1668 return
1669 fi
1670 done
1671 # Now try the user provided directory and some of the standard directories.
1672 QT_TRIES="$QT5DIR /System/Library /Library"
1673 for t in $QT_TRIES; do
1674 if [ -f "$t/Frameworks/QtCore.framework/QtCore" ]; then
1675 PATH_SDK_QT5="$t"
1676 break
1677 fi
1678 done
1679 # Add the necessary params for building the test application
1680 if [ -n "$PATH_SDK_QT5" ]; then
1681 foundqt5=1
1682 INCQT5=-I$PATH_SDK_QT5/Frameworks/QtCore.framework/Headers
1683 LIBQT5=-F$PATH_SDK_QT5/Frameworks
1684 FLGQT5="-framework QtCore"
1685 else
1686 log_failure "Qt5 framework not found (can be disabled using --disable-qt)"
1687 fail
1688 fi
1689 else # !darwin
1690 if [ $QT5DIR_PKGCONFIG -eq 1 ]; then
1691 # Default is to use pkg-config:
1692 if which_wrapper pkg-config > /dev/null; then
1693 qt5_ver=`pkg-config Qt5Core --modversion 2>> $LOG`
1694 if [ $? -eq 0 ]; then
1695 echo "(Qt5 from pkg-config)" >> $LOG
1696 FLGQT5=`pkg-config Qt5Core --cflags`
1697 # gcc 4.8 is able to compile with C++11 (see also VBOX_GCC_std in Config.kmk)
1698 [ $cc_maj -eq 4 -a $cc_min -eq 8 ] && FLGQT5="$FLGQT5 -std=c++11"
1699 INCQT5=`strip_I "$FLGQT5"`
1700 LIBDIR5=`pkg-config Qt5Core --variable=libdir`
1701 LIBQT5=`pkg-config Qt5Core --libs`
1702 LIBQT5="-L$LIBDIR5 $LIBQT5"
1703 TOOLQT5=`pkg-config Qt5Core --variable=prefix`
1704 TOOLQT5BIN=`pkg-config Qt5Core --variable=host_bins`
1705 if test_compile "$LIBQT5 $LIBPTHREAD $FLGQT5" qt5 qt5 nofatal; then
1706 test_execute_path "`strip_L "$LIBQT5"`" nofatal && foundqt5=3 # pkg-config
1707 fi
1708 fi
1709 else
1710 log_failure "pkg-config not found"
1711 fail
1712 fi
1713 fi
1714 if [ -z "$foundqt5" ]; then
1715 # Do it the old way (e.g. user has specified QT5DIR):
1716 for q in $QT5DIR "$PWD/tools/linux.$TARGET_MACHINE"/qt/v5.*; do
1717 echo "(Qt5 from '$q')" >> $LOG
1718 INCQT5="$q/include $q/include/QtCore"
1719 FLGQT5="-DQT_SHARED"
1720 I_INCQT5=`prefix_I "$INCQT5"`
1721 LIBQT5="-L$q/lib -lQt5CoreVBox"
1722 TOOLQT5="$q"
1723 if test_compile "$LIBQT5 $LIBPTHREAD $I_INCQT5 $FLGQT5" qt5 qt5 nofatal &&
1724 test_execute_path "`strip_L "$LIBQT5"`" nofatal; then
1725 foundqt5=2 # internal
1726 break;
1727 fi
1728 LIBQT5="-L$q/lib -lQt5Core"
1729 if test_compile "$LIBQT5 $LIBPTHREAD $I_INCQT5 $FLGQT5" qt5 qt5 nofatal &&
1730 test_execute_path "`strip_L "$LIBQT5"`" nofatal; then
1731 foundqt5=1 # no pkg-config, Qt directory
1732 break;
1733 fi
1734 done
1735 fi
1736 fi
1737 if [ -n "$foundqt5" ]; then
1738 # We decided which version of Qt to use, now enforce the version requirement:
1739 cat > $ODIR.tmp_src.cc << EOF
1740#include <cstdio>
1741#include <QtGlobal>
1742extern "C" int main(void)
1743{
1744 printf("found version %s", QT_VERSION_STR);
1745#if QT_VERSION >= 0x050302
1746 printf(", OK.\n");
1747 return 0;
1748#else
1749 printf(", expected version 5.3.2 or higher\n");
1750 return 1;
1751#endif
1752}
1753EOF
1754 [ -n "$INCQT5" ] && I_INCQT5=`prefix_I "$INCQT5"`
1755 if test_compile "$LIBQT5 $LIBPTHREAD $I_INCQT5 $FLGQT5" qt5 qt5 nofatal; then
1756 if test_execute_path "`strip_L "$LIBQT5"`"; then
1757 if [ "$OS" = "darwin" ]; then
1758 # Successful build & run the test application so add the necessary
1759 # params to AutoConfig.kmk:
1760 cnf_append "PATH_SDK_QT5_INC" "$PATH_SDK_QT5/Frameworks"
1761 cnf_append "PATH_SDK_QT5_LIB" "$PATH_SDK_QT5/Frameworks"
1762 cnf_append "PATH_SDK_QT5" "$PATH_SDK_QT5/Frameworks"
1763 # Check for the moc tool in the Qt directory found & some standard
1764 # directories.
1765 for q in $PATH_SDK_QT5 /usr /Developer/Tools/Qt; do
1766 if which_wrapper "$q/bin/moc" > /dev/null; then
1767 cnf_append "PATH_TOOL_QT5_BIN" "$q/bin"
1768 fi
1769 done
1770 else
1771 # Strip .../QtCore as we add components ourself:
1772 INCQT5=`echo "$INCQT5"|$KBUILD_SED 's|\([^ ]*\)/QtCore|\1|g; s| $||g'`
1773 # store only the first path, remove all other paths
1774 # most likely pkg-config gave us -I/usr/include/qt5 -I/usr/include/qt5/QtCore
1775 INCQT5=`echo "$INCQT5"|$KBUILD_SED 's|\([^ ]*\) .*|\1|'`
1776 cnf_append "VBOX_PATH_QT_LIB" "`strip_L "$LIBQT5"`"
1777 cnf_append "PATH_SDK_QT5_INC" "$INCQT5"
1778 # This is not quite right since the qt libpath does not have to be first...
1779 cnf_append "PATH_SDK_QT5_LIB" '$'"(firstword `strip_L "$LIBQT5"`)"
1780 if [ "$foundqt5" = "2" ]; then
1781 cnf_append "VBOX_WITH_ORACLE_QT" "1"
1782 fi
1783 if [ "$foundqt5" != "3" ]; then
1784 TOOLQT5BIN="$TOOLQT5/bin"
1785 fi
1786 test_header "Qt5 devtools"
1787 # Try it with a suffix, some platforms use that
1788 if which_wrapper "$TOOLQT5BIN/moc-qt5" > /dev/null; then
1789 QT5BINSUFF="-qt5"
1790 else
1791 QT5BINSUFF=""
1792 fi
1793 moc_ver=`$TOOLQT5BIN/moc$QT5BINSUFF -v 2>&1|sed 's+^.*(Qt \(.*\))+\1+'`
1794 if [ $? -ne 0 ]; then
1795 log_failure "moc$QT5BINSUFF not working"
1796 fail
1797 else
1798 log_success "found version $moc_ver"
1799 cnf_append "VBOX_PATH_QT" "$TOOLQT5"
1800 cnf_append "PATH_SDK_QT5" "$TOOLQT5"
1801 cnf_append "PATH_TOOL_QT5_BIN" "$TOOLQT5BIN"
1802 [ -n "$QT5BINSUFF" ] && cnf_append "TOOL_QT5_BIN_SUFF" "$QT5BINSUFF"
1803 fi
1804 fi
1805 fi
1806 else
1807 log_failure "qt5 not working"
1808 fail
1809 fi
1810 else
1811 log_failure "qt5 not found"
1812 fail
1813 fi
1814}
1815
1816
1817#
1818# Check for libvpx
1819#
1820check_vpx()
1821{
1822 if [ -z "$BUILD_LIBVPX" ]; then
1823 test_header libvpx
1824 if which_wrapper pkg-config > /dev/null; then
1825 libvpx_ver=`pkg-config vpx --modversion 2>> $LOG`
1826 if [ $? -eq 0 ]; then
1827 FLGVPX=`pkg-config vpx --cflags`
1828 INCVPX=`strip_I "$FLGVPX"`
1829 LIBVPX=`pkg-config vpx --libs`
1830 fi
1831 cat > $ODIR.tmp_src.cc << EOF
1832#include <cstdio>
1833#include <vpx/vpx_codec.h>
1834extern "C" int main(void)
1835{
1836 int version = vpx_codec_version();
1837 int verMajor = VPX_VERSION_MAJOR(version);
1838 int verMinor = VPX_VERSION_MINOR(version);
1839 int verPatch = VPX_VERSION_PATCH(version);
1840 printf("found version %d.%d.%d", verMajor, verMinor, verPatch);
1841 if ( verMajor == 1 && verMinor >= 0
1842 || verMajor == 0 && verMinor == 9 && verPatch >= 5)
1843 {
1844 printf(", OK.\n");
1845 return 0;
1846 }
1847 else
1848 {
1849 printf(", expected version 0.9.5 or higher\n");
1850 return 1;
1851 }
1852}
1853EOF
1854 [ -n "$INCVPX" ] && I_INCVPX=`prefix_I "$INCVPX"`
1855 if test_compile "$LIBVPX $I_INCVPX" vpx vpx; then
1856 if test_execute; then
1857 cnf_append "SDK_VBOX_VPX_INCS" "$INCVPX"
1858 cnf_append "SDK_VBOX_VPX_LIBS" "`strip_l "$LIBVPX"`"
1859 fi
1860 fi
1861 fi
1862 fi
1863}
1864
1865
1866#
1867# Check whether static libstdc++ is installed. This library is required
1868# for the Linux guest additions.
1869#
1870check_staticlibstdcxx()
1871{
1872 test_header "static stc++ library"
1873 libstdcxx=`$CXX -print-file-name=libstdc++.a`
1874 cat > $ODIR.tmp_src.cc << EOF
1875#include <string>
1876
1877extern "C" int main(void)
1878{
1879 std::string s = "test";
1880 return 0;
1881}
1882EOF
1883 if test_compile "$libstdcxx" libstdc++ libstdc++; then
1884 log_success "found"
1885 fi
1886}
1887
1888
1889#
1890# Check for Linux sources
1891#
1892check_linux()
1893{
1894 test_header "Linux kernel sources"
1895 cat > $ODIR.tmp_src.c << EOF
1896#include <linux/version.h>
1897int printf(const char *format, ...);
1898int main(void)
1899{
1900 printf("found version %d.%d.%d", LINUX_VERSION_CODE / 65536,
1901 (LINUX_VERSION_CODE % 65536) / 256,
1902 LINUX_VERSION_CODE % 256);
1903#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,0)
1904 printf(", OK.\n");
1905 return 0;
1906#else
1907 printf(", expected version 2.4.0 or higher\n");
1908 return 1;
1909#endif
1910}
1911EOF
1912 echo "compiling the following source file:" >> $LOG
1913 cat $ODIR.tmp_src.c >> $LOG
1914 echo "using the following command line:" >> $LOG
1915 echo "$CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include " \
1916 "-I$LINUX/include/generated/uapi" >> $LOG
1917 $CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include \
1918 -I$LINUX/include/generated/uapi >> $LOG 2>&1
1919 if [ $? -ne 0 ]; then
1920 echo
1921 echo " Linux kernel headers not found at $LINUX"
1922 echo " Check the file $LOG for detailed error information."
1923 fail
1924 else
1925 if test_execute; then
1926 cnf_append "VBOX_LINUX_SRC" "`cd $LINUX ; pwd`"
1927 fi
1928 fi
1929}
1930
1931
1932#
1933# Check for kchmviewer, needed to display the online help
1934# (unused as we ship kchmviewer)
1935#
1936check_kchmviewer()
1937{
1938 test_header kchmviewer
1939 if check_avail "$KCHMVIEWER" KCHMVIEWER; then
1940 kchmviewer_ver=`$KCHMVIEWER --version|grep "^KchmViewer:"|sed 's+^KchmViewer: \(.*\)+\1+'`
1941 if [ $? -ne 0 ]; then
1942 log_failure "kchmviewer not working"
1943 fail
1944 else
1945 log_success "found version $kchmviewer_ver"
1946 fi
1947 fi
1948}
1949
1950
1951#
1952# Check for the kBuild tools, we don't support GNU make
1953#
1954check_kbuild()
1955{
1956 test_header kBuild
1957 if which_wrapper "$KBUILDDIR/bin/$OS.$BUILD_MACHINE/kmk" > /dev/null; then
1958 KBUILDDIR_BIN="$KBUILDDIR/bin/$OS.$BUILD_MACHINE"
1959 echo "PATH_KBUILD=\"`cd $KBUILDDIR ; pwd`\"" >> $ENV
1960 echo "export PATH_KBUILD" >> $ENV
1961 echo "PATH_DEVTOOLS=\"$DEVDIR\"" >> $ENV
1962 echo "export PATH_DEVTOOLS" >> $ENV
1963 echo "path_kbuild_bin=\"\$PATH_KBUILD/bin/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"" >> $ENV
1964 echo "export PATH_KBUILD_BIN" >> $ENV
1965 echo "path_dev_bin=\"\$PATH_DEVTOOLS/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"/bin" >> $ENV
1966 if [ "$OS" = "solaris" ]; then
1967 # Because of sh being non-default shell in Solaris we need to export PATH again when
1968 # sourcing env.sh. Simply exporting from ./configure does not export PATH correctly.
1969 echo "PATH=\"$ORGPATH\"" >> $ENV
1970 echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
1971 echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
1972 else
1973 echo "echo \"\$PATH\" | grep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
1974 echo "echo \"\$PATH\" | grep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
1975 fi
1976 echo "export PATH" >> $ENV
1977 echo "unset path_kbuild_bin path_dev_bin" >> $ENV
1978 KBUILD_SED="$KBUILDDIR_BIN/kmk_sed"
1979 elif [ "$OS.$BUILD_MACHINE" = "darwin.amd64" ]; then
1980 # Currently there are no amd64 kBuild bins. So use the x86 variant in any case.
1981 KBUILDDIR_BIN="$KBUILDDIR/bin/$OS.x86"
1982 echo "PATH_KBUILD=\"`cd $KBUILDDIR ; pwd`\"" >> $ENV
1983 echo "export PATH_KBUILD" >> $ENV
1984 echo "PATH_DEVTOOLS=\"$DEVDIR\"" >> $ENV
1985 echo "export PATH_DEVTOOLS" >> $ENV
1986 echo "path_kbuild_bin=\"\$PATH_KBUILD/bin/\$BUILD_TARGET.x86\"" >> $ENV
1987 echo "PATH_KBUILD_BIN=\"\$path_kbuild_bin\"" >> $ENV
1988 echo "export PATH_KBUILD_BIN" >> $ENV
1989 echo "path_dev_bin=\"\$PATH_DEVTOOLS/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"/bin" >> $ENV
1990 echo "echo \"\$PATH\" | grep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
1991 echo "echo \"\$PATH\" | grep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
1992 echo "export PATH" >> $ENV
1993 echo "unset path_kbuild_bin path_dev_bin" >> $ENV
1994 KBUILD_SED="$KBUILDDIR_BIN/kmk_sed"
1995 elif check_avail "kmk" KBUILDDIR really; then
1996 # check for installed kBuild
1997 KBUILD_SED="`which_wrapper kmk_sed`"
1998 else
1999 fail
2000 fi
2001 log_success "found"
2002}
2003
2004
2005#
2006# Check for compiler.h
2007# Some Linux distributions include "compiler.h" in their libc linux
2008# headers package, some don't. Most don't need it, building might (!)
2009# not succeed on openSUSE without it.
2010#
2011# See http://www.mail-archive.com/qemu-devel%40nongnu.org/msg07980.html
2012#
2013check_compiler_h()
2014{
2015 test_header compiler.h
2016 if test ! -f "/usr/include/linux/compiler.h"; then
2017 log_success "compiler.h not found"
2018 else
2019 cnf_append "VBOX_WITH_LINUX_COMPILER_H" "1"
2020 log_success "compiler.h found"
2021 fi
2022}
2023
2024#
2025# Check for libcap.
2026# Required to pass CAP_NET_RAW to our binaries to allow to open SOCK_RAW
2027# sockets for doing ICMP requests.
2028#
2029check_libcap()
2030{
2031 test_header "libcap library"
2032 cat > $ODIR.tmp_src.cc << EOF
2033#include <cstdio>
2034#include <sys/types.h>
2035#include <linux/types.h>
2036#include <sys/capability.h>
2037
2038extern "C" int main(void)
2039{
2040 char buf[1024];
2041 cap_t caps = cap_get_proc();
2042 snprintf(buf, sizeof(buf), "Current caps are '%s'\n", cap_to_text(caps, NULL));
2043 return 0;
2044}
2045EOF
2046 if test_compile $LIBCAP libcap libcap; then
2047 if test_execute; then
2048 log_success "found"
2049 fi
2050 fi
2051}
2052
2053#
2054# Check if we are able to build 32-bit applications (needed for the guest additions)
2055#
2056check_32bit()
2057{
2058 test_header "32-bit support"
2059 cat > $ODIR.tmp_src.c << EOF
2060#include <stdint.h>
2061int main(void)
2062{
2063 return 0;
2064}
2065EOF
2066 echo "compiling the following source file:" >> $LOG
2067 cat $ODIR.tmp_src.c >> $LOG
2068 echo "using the following command line:" >> $LOG
2069 echo "$CC -m32 -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c" >> $LOG
2070 $CC -m32 -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c >> $LOG 2>&1
2071 if [ $? -ne 0 ]; then
2072 echo
2073 echo " Cannot compile 32-bit applications (missing headers and/or libraries)!"
2074 echo " Check the file $LOG for detailed error information."
2075 fail
2076 else
2077 echo "executing the binary" >> $LOG
2078 $ODIR.tmp_out 2> $ODIR.test_execute.log
2079 rc=$?
2080 cat $ODIR.test_execute.log >> $LOG
2081 if [ $rc -ne 0 ]; then
2082 echo
2083 echo " Cannot execute 32-bit applications! Either enable 32-bit support in the"
2084 echo " kernel configuration or use --disable-vmmraw to disable 32-bit guests."
2085 fail
2086 return 1
2087 fi
2088 fi
2089 log_success ""
2090}
2091
2092
2093#
2094# Check for Python
2095#
2096check_python()
2097{
2098 test_header "Python support"
2099
2100 # On darwin this is a on/off decision only
2101 if [ "$OS" = "darwin" ]; then
2102 echo "enabled"
2103 cnf_append "VBOX_WITH_PYTHON" "1"
2104 return
2105 fi
2106
2107 cat > $ODIR.tmp_src.cc << EOF
2108#include <cstdio>
2109#include <Python.h>
2110extern "C" int main(void)
2111{
2112 Py_Initialize();
2113 printf("found version %s", PY_VERSION);
2114#if PY_VERSION_HEX >= 0x02060000
2115 printf(", OK.\n");
2116 return 0;
2117#else
2118 printf(", expected version 2.6 or higher\n");
2119 return 1;
2120#endif
2121}
2122EOF
2123 found=
2124 SUPPYTHONLIBS="python2.7 python2.6 python3.1 python3.2 python3.3 python3.4 python3.4m python3.5 python3.5m"
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-sdl)
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# don't bother people with -Werror
2855cnf_append "VBOX_GCC_WERR" "\$(NO_SUCH_VARIABLE)"
2856
2857# some things are not available in for OSE
2858if [ $OSE -ge 1 ]; then
2859 cnf_append "VBOX_OSE" "1"
2860 cnf_append "VBOX_WITH_VALIDATIONKIT" ""
2861 cnf_append "VBOX_WITH_WIN32_ADDITIONS" ""
2862
2863 if [ "$OS" = "linux" ]; then
2864 cnf_append "VBOX_WITH_LINUX_ADDITIONS" "1"
2865 else
2866 cnf_append "VBOX_WITH_LINUX_ADDITIONS" ""
2867 fi
2868 echo >> $CNF
2869fi
2870
2871# extpack
2872if [ $ONLY_ADDITIONS -eq 1 ]; then
2873 cnf_append "VBOX_WITH_EXTPACK_PUEL_BUILD" ""
2874elif [ $OSE -eq 0 ]; then
2875 if [ $WITH_EXTPACK -eq 1 ]; then
2876 BUILD_LIBSSL=1
2877 else
2878 cnf_append "VBOX_WITH_EXTPACK_PUEL_BUILD" ""
2879 fi
2880fi
2881
2882# headless
2883if [ -n "$HEADLESS" ]; then
2884 cnf_append "VBOX_HEADLESS" "1"
2885fi
2886
2887# emit disable directives corresponding to any --disable-xxx options.
2888if [ $WITH_OPENGL -eq 0 ]; then
2889 cnf_append "VBOX_WITH_CROGL" ""
2890 cnf_append "VBOX_WITH_VIDEOHWACCEL" ""
2891 cnf_append "VBOX_GUI_USE_QGL" ""
2892fi
2893[ $WITH_XPCOM -eq 0 ] && cnf_append "VBOX_WITH_MAIN" ""
2894[ $WITH_QT4 -eq 0 -a $WITH_QT5 -eq 0 ] && cnf_append "VBOX_WITH_QTGUI" ""
2895[ $WITH_QT5 -eq 1 ] && cnf_append "VBOX_WITH_QTGUI_V5" "1"
2896[ $WITH_SDL_TTF -eq 0 ] && cnf_append "VBOX_WITH_SECURELABEL" ""
2897[ $WITH_PYTHON -eq 0 ] && cnf_append "VBOX_WITH_PYTHON" ""
2898[ $WITH_JAVA -eq 0 ] && cnf_append "VBOX_WITH_JXPCOM" ""
2899[ $WITH_JAVA -eq 0 ] && cnf_append "VBOX_WITH_JWS" ""
2900[ $WITH_HARDENING -eq 0 ] && cnf_append "VBOX_WITHOUT_HARDENING" "1"
2901[ $WITH_HARDENING -eq 2 ] && cnf_append "VBOX_WITH_HARDENING" "2"
2902[ $WITH_VMMRAW -eq 0 ] && cnf_append "VBOX_WITH_RAW_MODE" ""
2903if [ $WITH_LIBVPX -eq 0 ]; then
2904 cnf_append "VBOX_WITH_LIBVPX" ""
2905 cnf_append "VBOX_WITH_VIDEOREC" ""
2906fi
2907
2908# Darwin-specific
2909if [ "$OS" = "darwin" ]; then
2910 check_darwinversion
2911fi
2912# the tools
2913check_gcc
2914if [ $ONLY_ADDITIONS -eq 0 ]; then
2915 check_open_watcom
2916 [ "$OS" != "darwin" ] && check_iasl
2917 # don't check for yasm for the time beeing as 0.40 and 0.50 both have known bugs
2918 # [ "$OS" != "darwin" ] && check_yasm
2919 [ "$OS" != "darwin" ] && check_xsltproc
2920 [ "$OS" != "darwin" ] && check_mkisofs
2921fi
2922
2923# the libraries
2924if [ $ONLY_ADDITIONS -eq 0 ]; then
2925 [ "$OS" != "darwin" ] && check_pthread
2926 check_libxml2
2927 [ $WITH_LIBIDL -eq 1 ] && check_libidl
2928 check_ssl
2929 check_curl
2930 [ $WITH_LIBVPX -eq 1 ] && check_vpx
2931 [ "$OS" != "darwin" ] && check_z
2932 [ "$OS" != "darwin" ] && check_png
2933 [ $OSE -eq 0 -a "$OS" = "linux" ] && check_pam
2934 if [ $WITH_SDL -eq 1 ]; then
2935 check_sdl
2936 else
2937 cnf_append "VBOX_WITH_VBOXSDL" ""
2938 fi
2939 [ $WITH_SDL_TTF -eq 1 -a $OSE -eq 0 ] && check_sdl_ttf
2940 [ $WITH_X11 -eq 1 ] && check_x
2941 # TODO check for xcomposite-dev (X11/extensions/Xcomposite.h, additions only)
2942 # TODO check for libxdamange-dev (X11/extensions/Xdamage.h, additions only)
2943 [ $WITH_X11 -eq 1 ] && check_xcursor
2944 [ $WITH_X11 -eq 1 ] && check_xinerama
2945 [ $WITH_X11 -eq 1 ] && check_xrandr
2946 [ $WITH_OPENGL -eq 1 ] && check_opengl
2947 [ $WITH_QT4 -eq 1 ] && check_qt4
2948 [ $WITH_QT5 -eq 1 ] && check_qt5
2949 [ $WITH_PYTHON -eq 1 ] && check_python
2950 [ $WITH_JAVA -eq 1 ] && check_java
2951
2952 # PulseAudio
2953 if [ "$OS" = "linux" -o "$OS" = "freebsd" -o "$OS" = "netbsd" ]; then
2954 if [ $WITH_PULSE -eq 1 ]; then
2955 check_pulse
2956 elif [ $WITH_PULSE -eq 0 ]; then
2957 cnf_append "VBOX_WITH_AUDIO_PULSE" ""
2958 fi
2959 fi
2960fi
2961
2962# Linux-specific
2963if [ "$OS" = "linux" ]; then
2964 # don't check for the static libstdc++ in the PUEL version as we build the
2965 # additions at a dedicated box
2966 [ $OSE -ge 1 ] && check_staticlibstdcxx
2967 if [ $WITH_KMODS -eq 1 ]; then
2968 check_linux
2969 else
2970 cnf_append "VBOX_LINUX_SRC" ""
2971 cnf_append "VBOX_WITH_VBOXDRV" ""
2972 cnf_append "VBOX_WITH_ADDITION_DRIVERS" ""
2973 fi
2974 if [ $ONLY_ADDITIONS -eq 0 ]; then
2975 if [ $WITH_ALSA -eq 1 ]; then
2976 check_alsa
2977 else
2978 cnf_append "VBOX_WITH_AUDIO_ALSA" ""
2979 fi
2980 if [ $WITH_DBUS -eq 0 ]; then
2981 cnf_append "VBOX_WITH_DBUS" ""
2982 fi
2983 if [ $WITH_DEVMAPPER -eq 1 ]; then
2984 check_libdevmapper
2985 else
2986 cnf_append "VBOX_WITH_DEVMAPPER" ""
2987 fi
2988 check_libcap
2989 fi
2990 check_compiler_h
2991 [ $ONLY_ADDITIONS -eq 0 -a "$BUILD_MACHINE" = "amd64" -a $WITH_VMMRAW -eq 1 ] && check_32bit
2992 # tools/common/makeself*
2993 [ $OSE -ge 1 ] && check_makeself
2994fi
2995
2996[ -n "$SETUP_WINE" ] && setup_wine
2997
2998if [ $ONLY_ADDITIONS -eq 0 -a $WITH_GSOAP -eq 1 ]; then
2999 check_gsoap
3000else
3001 if [ $OSE -ge 1 ]; then
3002 cnf_append "VBOX_WITH_WEBSERVICES" ""
3003 fi
3004fi
3005
3006# UDPTUNNEL
3007if [ $ONLY_ADDITIONS -eq 0 -a $WITH_UDPTUNNEL -eq 0 ]; then
3008 cnf_append "VBOX_WITH_UDPTUNNEL" ""
3009fi
3010
3011# VDE
3012if [ $ONLY_ADDITIONS -eq 0 -a "$OS" = "linux" -o "$OS" = "freebsd" ]; then
3013 if [ $WITH_VDE -eq 1 ]; then
3014 cnf_append "VBOX_WITH_VDE" "1"
3015 fi
3016fi
3017
3018# DOCS
3019if [ $ONLY_ADDITIONS -eq 1 -o $WITH_DOCS -eq 0 ]; then
3020 cnf_append "VBOX_WITH_DOCS" ""
3021 cnf_append "VBOX_WITH_DOCS_PACKING" ""
3022fi
3023
3024# VNC server support
3025if [ $ONLY_ADDITIONS -eq 0 -a $OSE -ge 1 ]; then
3026 if [ $WITH_VNC = 1 ]; then
3027 check_vncserver
3028 else
3029 cnf_append "VBOX_WITH_EXTPACK_VNC" ""
3030 fi
3031fi
3032
3033if [ $ONLY_ADDITIONS -eq 1 ]; then
3034 cnf_append "VBOX_ONLY_ADDITIONS" "1"
3035fi
3036
3037# success!
3038echo
3039echo "Successfully generated '$CNF' and '$ENV'."
3040echo "Source '$ENV' once before you start to build VBox:"
3041echo ""
3042echo " source $ENV"
3043echo " kmk"
3044echo ""
3045if [ "$OS" = "linux" ]; then
3046 if [ $OUT_PATH_OVERRIDE -eq 1 ]; then
3047 vbox_out_path=$OUT_PATH
3048 else
3049 vbox_out_path=./out
3050 fi
3051 echo "To compile the kernel modules, do:"
3052 echo ""
3053 echo " cd $vbox_out_path/$OS.$TARGET_MACHINE/$BUILD_TYPE/bin/src"
3054 echo " make"
3055 echo ""
3056fi
3057if [ $ONLY_ADDITIONS -eq 1 ]; then
3058 echo ""
3059 echo " Tree configured to build only the Guest Additions"
3060 echo ""
3061elif [ $WITH_HARDENING -gt 0 ]; then
3062 echo ""
3063 echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
3064 echo " Hardening is enabled which means that the VBox binaries will not run from"
3065 echo " the binary directory. The binaries have to be installed suid root and some"
3066 echo " more prerequisites have to be fulfilled which is normally done by installing"
3067 echo " the final package. For development, the hardening feature can be disabled"
3068 echo " by specifying the --disable-hardening parameter. Please never disable that"
3069 echo " feature for the final distribution!"
3070 echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
3071 echo ""
3072else
3073 echo ""
3074 echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
3075 echo " Hardening is disabled. Please do NOT build packages for distribution with"
3076 echo " disabled hardening!"
3077 echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
3078 echo ""
3079fi
3080echo "Enjoy!"
3081cleanup
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