VirtualBox

source: vbox/trunk/configure@ 78203

Last change on this file since 78203 was 78023, checked in by vboxsync, 5 years ago

configure: Attempt to make detection and configuration of PulseAudio more consistent [build fix].

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

© 2023 Oracle
ContactPrivacy policyTerms of Use