VirtualBox

source: vbox/trunk/configure@ 55372

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

configure: allow gcc 5

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