VirtualBox

source: vbox/trunk/configure@ 98187

Last change on this file since 98187 was 98103, checked in by vboxsync, 23 months ago

Copyright year updates by scm.

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