VirtualBox

source: vbox/trunk/configure@ 74942

Last change on this file since 74942 was 74653, checked in by vboxsync, 6 years ago

IPRT: Try shut up xmlFree linker warning.

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

© 2023 Oracle
ContactPrivacy policyTerms of Use