VirtualBox

source: vbox/trunk/configure@ 55347

Last change on this file since 55347 was 55347, checked in by vboxsync, 9 years ago

configure: introduced --only-additions

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

© 2024 Oracle
ContactPrivacy/Do Not Sell My InfoTerms of Use