VirtualBox

source: vbox/trunk/configure@ 59743

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

FE/Qt: Qt5 migration (part 93): Preparing Qt5 tool: X11: Qt5 tuning for configure script.

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