VirtualBox

source: vbox/trunk/configure@ 65316

Last change on this file since 65316 was 64526, checked in by vboxsync, 8 years ago

configure: allow python3.4m as well

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