VirtualBox

source: vbox/trunk/configure@ 80759

Last change on this file since 80759 was 80421, checked in by vboxsync, 5 years ago

configure: Eliminate the last leftovers of mkisofs/genisoimage config. Long gone, we use our own tool for everything.

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette