VirtualBox

source: vbox/trunk/configure@ 16249

Last change on this file since 16249 was 16202, checked in by vboxsync, 16 years ago

configure: write temporary files to $ODIR

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
File size: 51.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-2007 Sun Microsystems, Inc.
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 as published by the Free Software Foundation,
12# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
13# distribution. VirtualBox OSE is distributed in the hope that it will
14# 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
46
47#
48# Defaults
49#
50OSE=1
51ODIR="`pwd`/"
52SETUP_WINE=
53TARGET_MACHINE=""
54TARGET_CPU=""
55WITH_XPCOM=1
56WITH_PYTHON=1
57WITH_LIBIDL=1
58WITH_GSOAP=0
59WITH_QT4=1
60WITH_SDL=1
61WITH_SDL_TTF=1
62WITH_X11=1
63WITH_ALSA=1
64WITH_PULSE=1
65WITH_DBUS=1
66WITH_KMODS=1
67WITH_HARDENING=1
68CC="gcc"
69CC32=""
70CC64=""
71CXX="g++"
72CXX32=""
73CXX64=""
74BCC="bcc"
75YASM="yasm"
76IASL="iasl"
77AS86="as86"
78XSLTPROC="xsltproc"
79GENISOIMAGE="genisoimage"
80MKISOFS="mkisofs"
81BUILD_LIBXML2=
82BUILD_LIBXSLT=
83LIBCRYPTO="-lcrypto"
84LIBPTHREAD="-lpthread"
85LIBCAP="-lcap"
86GSOAP=""
87LIBX11="-L/usr/X11R6/lib -L/usr/X11R6/lib64 -L/usr/local/lib -lXext -lX11"
88INCX11="/usr/local/include"
89LIBXCURSOR="-lXcursor"
90INCZ=""
91LIBZ="-lz"
92INCPNG=""
93LIBPNG="-lpng"
94PKGCONFIG="`which_wrapper pkg-config`"
95PYTHONDIR="/usr /usr/local"
96QT4DIR="/usr/lib/qt4 /usr/share/qt4 /usr/lib64/qt4 /usr"
97QT4DIR_PKGCONFIG=1
98QT4UIC3DIR="/usr/bin"
99KBUILDDIR="`cd \`dirname $0\`; pwd`/kBuild"
100DEVDIR="`cd \`dirname $0\`; pwd`/tools"
101if [ -d "/lib/modules/`uname -r`/build" ]; then
102 LINUX="/lib/modules/`uname -r`/build"
103else
104 LINUX="/usr/src/linux"
105fi
106KCHMVIEWER="kchmviewer"
107LOG="configure.log"
108CNF="AutoConfig.kmk"
109ENV="env.sh"
110BUILD_TYPE="release"
111# the restricting tool is ar (mri mode).
112INVALID_CHARS="[^A-Za-z0-9/\\$:._-]"
113
114if (cd `dirname $0`; pwd)|grep -q "$INVALID_CHARS"; then
115 echo "Error: VBox base path contains invalid characters!"
116 exit 1
117fi
118
119# darwin /bin/sh has a builtin echo that doesn't grok -n. gotta love it.
120if [ "`uname`" = "Darwin" ]; then
121 ECHO_N="/bin/echo -n"
122else
123 ECHO_N="echo -n"
124fi
125
126
127cleanup()
128{
129 rm -f $ODIR.tmp_src.cc $ODIR.tmp_src.c $ODIR.tmp_out $ODIR.test_execute.log
130}
131
132fail()
133{
134 if [ -z "$nofatal" -o "x$1" != "x" ]; then
135 cleanup
136 rm -f $ENV
137 exit 1
138 fi
139}
140
141log()
142{
143 echo "$1"
144 echo "$1" >> $LOG
145}
146
147log_success()
148{
149 if [ -n "$1" ]; then $ECHO_N "$1, "; fi
150 echo "OK."
151 echo "$1" >> $LOG
152 echo >> $LOG
153 echo >> $LOG
154}
155
156log_failure()
157{
158 echo
159 echo " ** $1!"
160 echo "** $1!" >> $LOG
161 echo >> $LOG
162}
163
164cnf_append()
165{
166 printf "%-30s := %s\n" "$1" "$2" >> $CNF
167}
168
169strip_l()
170{
171 echo "$1"|$KBUILD_SED 's|-l\([^ ]\+\)|\1|g; s|^-[^l][^ ]*||g; s| -[^l][^ ]*||g; s|^ ||; s| *$||g'
172}
173
174strip_L()
175{
176 echo "$1"|$KBUILD_SED 's|-L\([^ ]\+\)|\1|g; s|^-[^L][^ ]*||g; s| -[^L][^ ]*||g; s|^ ||; s| *$||g'
177}
178
179strip_I()
180{
181 echo "$1"|$KBUILD_SED 's|-I\([^ ]\+\)|\1|g; s|^-[^I][^ ]*||g; s| -[^I][^ ]*||g; s|^ ||; s| *$||g'
182}
183
184prefix_I()
185{
186 echo "$1"|$KBUILD_SED 's|^\/|-I/|g; s| \/| -I/|g'
187}
188
189check_avail()
190{
191 if [ -z "$1" ]; then
192 log_failure "$2 is empty"
193 fail $3
194 return 1
195 elif which_wrapper $1 > /dev/null; then
196 return 0
197 else
198 log_failure "$1 (variable $2) not found"
199 fail $3
200 return 1
201 fi
202}
203
204
205# Prepare a test
206test_header()
207{
208 echo "***** Checking $1 *****" >> $LOG
209 $ECHO_N "Checking for $1: "
210}
211
212
213# Compile a test
214test_compile()
215{
216 echo "compiling the following source file:" >> $LOG
217 cat $ODIR.tmp_src.cc >> $LOG
218 echo "using the following command line:" >> $LOG
219 echo "$CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc \"$1\"" >> $LOG
220 $CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc $1 >> $LOG 2>&1
221 if [ $? -ne 0 ]; then
222 if [ -z "$4" ]; then
223 echo
224 echo " $2 not found at $1 or $3 headers not found"
225 echo " Check the file $LOG for detailed error information."
226 fail
227 else
228 echo "not found."
229 echo >> $LOG
230 echo >> $LOG
231 fi
232 return 1
233 fi
234 return 0
235}
236
237
238# Execute a compiled test binary
239test_execute()
240{
241 echo "executing the binary" >> $LOG
242 $ODIR.tmp_out > $ODIR.test_execute.log
243 rc=$?
244 cat $ODIR.test_execute.log | tee -a $LOG
245 if [ $rc -ne 0 ]; then
246 fail $1
247 return 1
248 fi
249 echo >> $LOG
250 echo >> $LOG
251 return 0
252}
253
254
255# Execute a compiled test binary
256test_execute_path()
257{
258 echo "executing the binary (LD_LIBRARY_PATH=$1)" >> $LOG
259 LD_LIBRARY_PATH=$1 $ODIR.tmp_out > $ODIR.test_execute.log
260 rc=$?
261 cat $ODIR.test_execute.log | tee -a $LOG
262 if [ $rc -ne 0 ]; then
263 fail
264 return 1
265 fi
266 echo >> $LOG
267 echo >> $LOG
268 return 0
269}
270
271
272#
273# Check for OS, MACHINE, CPU
274#
275check_environment()
276{
277 test_header environment
278 OS=`uname -s | sed -e 's/GNU\/Linux/Linux/g' | tr [:upper:] [:lower:]`
279 case "$OS" in
280 linux)
281 ;;
282 darwin)
283 ;;
284 freebsd)
285 ;;
286 sunos)
287 OS='solaris'
288 ;;
289 *)
290 log_failure "Cannot determine OS"
291 exit 1
292 ;;
293 esac
294 BUILD_CPU=`uname -m`
295 [ "$OS" = "solaris" ] && BUILD_CPU=`isainfo | cut -f 1 -d ' '`
296 case "$BUILD_CPU" in
297 i[3456789]86|x86|i86pc)
298 BUILD_MACHINE='x86'
299 LIB='lib'
300 ;;
301 x86_64|amd64)
302 BUILD_MACHINE='amd64'
303 BUILD_CPU='k8'
304 if [ "$OS" != "solaris" ]; then
305 # on AMD64 systems, 64bit libs are usually located in /usr/lib64
306 # see http://www.pathname.com/fhs/pub/fhs-2.3.html#LIB64
307 LIB='lib64'
308 else
309 # Solaris doesn't seem to subscribe to fhs, libs are usually in
310 # a '64' subdirectory of the standard 'lib' dirs while some 64-bit
311 # alternative binaries can be found in 'amd64' subdirs of the 'bin'
312 # ones. So, in order to find the right stuff (esp. sdl-config) we'll
313 # have to make sure the */bin/amd64 dirs are searched before the */bin
314 # ones. (The sed has some sideeffects, but they shouldn't harm us...)
315 echo "64-bit Solaris detected, hacking the PATH" >> $LOG
316 echo "old PATH: $PATH" >> $LOG
317 PATH=`echo ":$PATH:" | sed -e 's,\(:[^:]*/bin\):,\1/amd64:\1:,g' \
318 -e 's/^:*//' -e 's/:*$//g' -e 's/::*/:/g' `
319 export PATH
320 echo "new PATH: $PATH" >> $LOG
321 LIB='lib/64'
322 fi
323 ;;
324 *)
325 log_failure "Cannot determine system"
326 exit 1
327 ;;
328 esac
329 [ -z "$TARGET_MACHINE" ] && TARGET_MACHINE=$BUILD_MACHINE
330 [ -z "$TARGET_CPU" ] && TARGET_CPU=$BUILD_CPU
331 DEVDIR_BIN="$DEVDIR/$OS.$BUILD_MACHINE/bin"
332 log_success "Determined build machine: $OS.$BUILD_MACHINE, target machine: $OS.$TARGET_MACHINE"
333
334 echo "export BUILD_PLATFORM=\"$OS\"" >> $ENV
335 echo "export BUILD_PLATFORM_ARCH=\"$BUILD_MACHINE\"" >> $ENV
336 echo "export BUILD_TARGET=\"$OS\"" >> $ENV
337 echo "export BUILD_TARGET_ARCH=\"$TARGET_MACHINE\"" >> $ENV
338 echo "export BUILD_TARGET_CPU=\"$TARGET_CPU\"" >> $ENV
339 echo "export BUILD_TYPE=\"$BUILD_TYPE\"" >> $ENV
340}
341
342#
343# Check for gcc with version >= 3.2.
344# We depend on a working gcc, if we fail terminate in every case.
345#
346check_gcc()
347{
348 test_header gcc
349 if check_avail "$CC" CC really; then
350 cc_ver=`$CC -dumpversion` 2>/dev/null
351 if [ $? -ne 0 ]; then
352 log_failure "cannot execute '$CC -dumpversion'"
353 fail really
354 fi
355 if check_avail "$CXX" CXX really; then
356 cxx_ver=`$CXX -dumpversion` 2>/dev/null
357 if [ $? -ne 0 ]; then
358 log_failure "cannot execute '$CXX -dumpversion'"
359 fail really
360 fi
361 cc_maj=`echo $cc_ver|cut -d. -f1`
362 cc_min=`echo $cc_ver|cut -d. -f2`
363 if [ "x$cc_ver" != "x$cxx_ver" ]; then
364 log_failure "gcc version $cc_ver does not match g++ version $cxx_ver"
365 fail really
366 elif [ $cc_maj -eq 4 -a $cc_min -eq 0 -a "OS" = "darwin" ]; then
367 log_success "found version $cc_ver"
368 # gcc-4.0 is allowed for Darwin only
369 elif [ $cc_maj -lt 3 \
370 -o \( $cc_maj -eq 3 -a $cc_min -lt 2 \) \
371 -o \( $cc_maj -eq 4 -a $cc_min -lt 1 -a "$OS" != "darwin" \) \
372 -o \( $cc_maj -eq 4 -a $cc_min -gt 3 \) \
373 -o $cc_maj -gt 4 ]; then
374 log_failure "gcc version $cc_ver found, expected gcc 3.x with x>1 or gcc 4.x with 0<x<4"
375 fail really
376 else
377 log_success "found version $cc_ver"
378 fi
379 if [ "$BUILD_MACHINE" = "amd64" ]; then
380 [ -z "$CC32" ] && CC32="$CC -m32"
381 [ -z "$CXX32" ] && CXX32="$CXX -m32"
382 else
383 [ -z "$CC32" ] && CC32="$CC"
384 [ -z "$CXX32" ] && CXX32="$CXX"
385 fi
386 if [ "$BUILD_MACHINE" = "x86" -a "$TARGET_MACHINE" = "amd64" ]; then
387 [ -z "$CC64" ] && CC64="$CC -m64"
388 [ -z "$CXX64" ] && CXX64="$CXX -m64"
389 fi
390 if [ "$CC" != "gcc" ]; then
391 cnf_append "TOOL_GCC3_CC" "$CC"
392 cnf_append "TOOL_GCC3_AS" "$CC"
393 cnf_append "TOOL_GCC3_LD" "$CC"
394 cnf_append "TOOL_GXX3_CC" "$CC"
395 cnf_append "TOOL_GXX3_AS" "$CC"
396 fi
397 if [ "$CXX" != "g++" ]; then
398 cnf_append "TOOL_GCC3_CXX" "$CXX"
399 cnf_append "TOOL_GXX3_CXX" "$CXX"
400 cnf_append "TOOL_GXX3_LD" "$CXX"
401 fi
402 if [ "$CC32" != "gcc -m32" ]; then
403 cnf_append "TOOL_GCC32_CC" "$CC32"
404 cnf_append "TOOL_GCC32_AS" "$CC32"
405 cnf_append "TOOL_GCC32_LD" "$CC32"
406 cnf_append "TOOL_GXX32_CC" "$CC32"
407 cnf_append "TOOL_GXX32_AS" "$CC32"
408 fi
409 if [ "$CXX32" != "g++ -m32" ]; then
410 cnf_append "TOOL_GCC32_CXX" "$CXX32"
411 cnf_append "TOOL_GXX32_CXX" "$CXX32"
412 cnf_append "TOOL_GXX32_LD" "$CXX32"
413 fi
414 # this isn't not necessary, there is not such tool.
415 if [ -n "$CC64" ]; then
416 cnf_append "TOOL_GCC64_CC" "$CC64"
417 cnf_append "TOOL_GCC64_AS" "$CC64"
418 cnf_append "TOOL_GCC64_LD" "$CC64"
419 cnf_append "TOOL_GXX64_CC" "$CC64"
420 cnf_append "TOOL_GXX64_AS" "$CC64"
421 fi
422 if [ -n "$CXX64" ]; then
423 cnf_append "TOOL_GCC64_CXX" "$CXX64"
424 cnf_append "TOOL_GXX64_CXX" "$CXX64"
425 cnf_append "TOOL_GXX64_LD" "$CXX64"
426 fi
427 # Solaris sports a 32-bit gcc/g++.
428 if [ "$OS" = "solaris" -a "$BUILD_MACHINE" = "amd64" ]; then
429 [ "$CC" = "gcc" ] && CC="gcc -m64"
430 [ "$CXX" = "g++" ] && CXX="g++ -m64"
431 fi
432 fi
433 fi
434}
435
436
437#
438# Check for the bcc compiler, needed for compiling the BIOS
439#
440check_bcc()
441{
442 test_header bcc
443 if check_avail "$BCC" BCC; then
444 bcc_ver=`$BCC -v 2>&1|grep version|sed 's+^bcc: version \(.*\)+\1+'`
445 if [ $? -ne 0 ]; then
446 log_failure "not found"
447 fail
448 else
449 echo "compiling the following source file:" >> $LOG
450 cat > $ODIR.tmp_src.c << EOF
451int foo(a)
452 int a;
453{
454 return 0;
455}
456EOF
457 cat $ODIR.tmp_src.c >> $LOG
458 bcc_path=`which_wrapper $BCC`
459 bcc_dir="`dirname $bcc_path`/"
460 echo "using the following command line:" >> $LOG
461 echo "$BCC -B $bcc_dir -C-c -3 -S -o $ODIR.tmp_out $ODIR.tmp_src.c" >> $LOG
462 $BCC -B $bcc_dir -C-c -3 -S -o $ODIR.tmp_out $ODIR.tmp_src.c >> $LOG 2>&1
463 if [ $? -ne 0 ]; then
464 log_failure "not found"
465 fail
466 else
467 log_success "found version $bcc_ver"
468 cnf_append "VBOX_BCC" "$bcc_path -B $bcc_dir"
469 fi
470 unset bcc_path
471 unset bcc_dir
472 fi
473 fi
474}
475
476
477#
478# Check for the as86 assembler, needed for compiling the BIOS
479#
480check_as86()
481{
482 test_header as86
483 if check_avail "$AS86" AS86; then
484 as86_ver=`$AS86 -v 2>&1|grep version|sed 's+^as86 version: \(.*\)+\1+'`
485 if [ $? -ne 0 ]; then
486 log_failure "not found"
487 fail
488 else
489 log_success "found version $as86_ver"
490 cnf_append "VBOX_AS86" "`which_wrapper $AS86`"
491 fi
492 fi
493}
494
495
496#
497# Check for yasm, needed to compile assembler files
498#
499check_yasm()
500{
501 test_header yasm
502 if check_avail "$YASM" YASM; then
503 yasm_ver=`$YASM --version|grep "^yasm"|sed 's+^yasm \(.*\)+\1+'`
504 if [ $? -ne 0 ]; then
505 log_failure "not found"
506 fail
507 else
508 yasm_maj=`echo $yasm_ver|cut -d. -f1`
509 yasm_min=`echo $yasm_ver|cut -d. -f2`
510 yasm_rev=`echo $yasm_ver|cut -d. -f3`
511 yasm_ver_mul=`expr $yasm_maj \* 10000 + $yasm_min \* 100 + $yasm_rev`
512 if [ $yasm_ver_mul -lt 501 ]; then
513 log_failure "found version $yasm_ver, expected at least 0.5.1"
514 fail
515 else
516 log_success "found version $yasm_ver"
517 fi
518 fi
519 fi
520}
521
522
523#
524# Check for the iasl ACPI compiler, needed to compile vbox.dsl
525#
526check_iasl()
527{
528 test_header iasl
529 if check_avail "$IASL" IASL; then
530 iasl_ver=`$IASL|grep version|sed 's+^ASL.*version \([0-9]*\).*+\1+'`
531 if [ $? -ne 0 ]; then
532 log_failure "not found"
533 fail
534 else
535 log_success "found version $iasl_ver"
536 cnf_append "VBOX_IASLCMD" "`which_wrapper $IASL`"
537 fi
538 fi
539}
540
541
542#
543# Check for xsltproc, needed by Main
544#
545check_xsltproc()
546{
547 test_header xslt
548 if check_avail "$XSLTPROC" XSLTPROC; then
549 xsltproc_ver=`$XSLTPROC --version`
550 if [ $? -ne 0 ]; then
551 log_failure "not found"
552 fail
553 else
554 log_success "found"
555 cnf_append "VBOX_XSLTPROC" "`which_wrapper $XSLTPROC`"
556 fi
557 fi
558}
559
560
561#
562# Check for mkisofs, needed to build the CDROM image containing the additions
563#
564check_mkisofs()
565{
566 test_header mkisofs
567 if which_wrapper $GENISOIMAGE > /dev/null; then
568 mkisofs_ver=`$GENISOIMAGE --version`
569 if [ $? -ne 0 ]; then
570 log_failure "not found"
571 fail
572 else
573 log_success "found $mkisofs_ver"
574 cnf_append "VBOX_MKISOFS" "`which_wrapper $GENISOIMAGE`"
575 fi
576 elif check_avail "$MKISOFS" MKISOFS; then
577 mkisofs_ver=`$MKISOFS --version`
578 if [ $? -ne 0 ]; then
579 log_failure "not found"
580 fail
581 else
582 log_success "found $mkisofs_ver"
583 cnf_append "VBOX_MKISOFS" "`which_wrapper $MKISOFS`"
584 fi
585 fi
586}
587
588
589#
590# Check for libxml2, needed by VBoxSettings
591# 2.6.24 is known to NOT work, 2.6.26 is known to work (there is no 2.6.25 release)
592#
593check_libxml2()
594{
595 if [ -z "$BUILD_LIBXML2" ]; then
596 test_header libxml2
597 if which_wrapper pkg-config > /dev/null; then
598 libxml2_ver=`pkg-config libxml-2.0 --modversion 2>> $LOG`
599 if [ $? -ne 0 ]; then
600 log_failure "not found"
601 fail
602 else
603 FLGXML2=`pkg-config libxml-2.0 --cflags`
604 INCXML2=`strip_I "$FLGXML2"`
605 LIBXML2=`pkg-config libxml-2.0 --libs`
606 cat > $ODIR.tmp_src.cc << EOF
607#include <cstdio>
608#include <libxml/xmlversion.h>
609extern "C" int main(void)
610{
611 printf("found version %s", LIBXML_DOTTED_VERSION);
612#if LIBXML_VERSION >= 20626
613 printf(", OK.\n");
614 return 0;
615#else
616 printf(", expected version 2.6.26 or higher\n");
617 return 1;
618#endif
619}
620EOF
621 [ -n "$INCXML2" ] && I_INCXML2=`prefix_I "$INCXML2"`
622 if test_compile "$LIBXML2 $LIBPTHREAD $I_INCXML2" xml2 xml2; then
623 if test_execute; then
624 cnf_append "SDK_VBOX_LIBXML2_INCS" "$INCXML2"
625 cnf_append "SDK_VBOX_LIBXML2_LIBS" "`strip_l "$LIBXML2"`"
626 fi
627 fi
628 fi
629 elif which_wrapper xml2-config; then
630 libxml2_ver=`xml2-config --version`
631 if [ $? -ne 0 ]; then
632 log_failure "not found"
633 fail
634 else
635 log_success "found version $libxml2_ver"
636 FLGXML2=`xml2-config --cflags`
637 INCXML2=`strip_I "$FLGXML2"`
638 LIBXML2=`xml2-config --libs`
639 cat > $ODIR.tmp_src.cc << EOF
640#include <cstdio>
641#include <libxml/xmlversion.h>
642extern "C" int main(void)
643{
644 printf("found version %s", LIBXML_DOTTED_VERSION);
645#if LIBXML_VERSION >= 20626
646 printf(", OK.\n");
647 return 0;
648#else
649 printf(", expected version 2.6.26 or higher\n");
650 return 1;
651#endif
652}
653EOF
654 [ -n "$INCXML2" ] && I_INCXML2=`prefix_I "$INCXML2"`
655 if test_compile "$LIBXML2 $LIBPTHREAD $I_INCXML2" xml2 xml2; then
656 if test_execute; then
657 cnf_append "SDK_VBOX_LIBXML2_INCS" "$INCXML2"
658 cnf_append "SDK_VBOX_LIBXML2_LIBS" "`strip_l "$LIBXML2"`"
659 fi
660 fi
661 fi
662 else
663 log_failure "neither pkg-config nor xml2-config found"
664 fail
665 fi
666 fi
667}
668
669
670#
671# Check for libxslt, needed by VBoxSettings. For now we depend on 1.1.17.
672# This library is available on Ubuntu Edgy which fulfils the minimal libxml2
673# requirement (2.6.26).
674#
675check_libxslt()
676{
677 if [ -z "$BUILD_LIBXSLT" ]; then
678 test_header libxslt
679 if which_wrapper pkg-config > /dev/null; then
680 libxslt_ver=`pkg-config libxslt --modversion 2>> $LOG`
681 if [ $? -ne 0 ]; then
682 log_failure "not found"
683 fail
684 else
685 FLGXSLT=`pkg-config libxslt --cflags`
686 INCXSLT=`strip_I "$FLGXSLT"`
687 LIBXSLT=`pkg-config libxslt --libs`
688 cat > $ODIR.tmp_src.cc << EOF
689#include <cstdio>
690#include <libxslt/xsltconfig.h>
691extern "C" int main(void)
692{
693 printf("found version %s", LIBXSLT_DOTTED_VERSION);
694#if LIBXSLT_VERSION >= 10117
695 printf(", OK.\n");
696 return 0;
697#else
698 printf(", expected version 1.1.17 or higher\n");
699 return 1;
700#endif
701}
702EOF
703 [ -n "$INCXSLT" ] && I_INCXSLT=`prefix_I "$INCXSLT"`
704 if test_compile "$LIBXSLT $LIBPTHREAD $I_INCXSLT" xslt xslt; then
705 if test_execute; then
706 cnf_append "SDK_VBOX_LIBXSLT_INCS" "$INCXSLT"
707 cnf_append "SDK_VBOX_LIBXSLT_LIBS" "`strip_l "$LIBXSLT"`"
708 fi
709 fi
710 fi
711 elif which_wrapper xslt-config; then
712 libxslt_ver=`xslt-config --version`
713 if [ $? -ne 0 ]; then
714 log_failure "not found"
715 fail
716 else
717 log_success "found version $libxslt_ver"
718 FLGXSLT=`xslt-config --cflags`
719 INCXSLT=`strip_I "$FLGXSLT"`
720 LIBXSLT=`xslt-config --libs`
721 cat > $ODIR.tmp_src.cc << EOF
722#include <cstdio>
723#include <libxslt/xsltconfig.h>
724extern "C" int main(void)
725{
726 printf("found version %s", LIBXSLT_DOTTED_VERSION);
727#if LIBXSLT_VERSION >= 10117
728 printf(", OK.\n");
729 return 0;
730#else
731 printf(", expected version 1.1.17 or higher\n");
732 return 1;
733#endif
734}
735EOF
736 [ -n "$INCXSLT" ] && I_INCXSLT=`prefix_I "$INCXSLT"`
737 if test_compile "$LIBXSLT $LIBPTHREAD $I_INCXSLT" xslt xslt; then
738 if test_execute; then
739 cnf_append "SDK_VBOX_LIBXSLT_INCS" "$INCXSLT"
740 cnf_append "SDK_VBOX_LIBXSLT_LIBS" "`strip_l "$LIBXSLT"`"
741 fi
742 fi
743 fi
744 else
745 log_failure "neither pkg-config nor xslt-config found"
746 fail
747 fi
748 fi
749}
750
751
752#
753# Check for libIDL, needed by xpcom
754#
755check_libidl()
756{
757 test_header libIDL
758
759 if which_wrapper libIDL-config-2 > /dev/null; then
760 libidl_ver=`libIDL-config-2 --version`
761 if [ $? -ne 0 ]; then
762 log_failure "not found"
763 fail
764 else
765 log_success "found version $libidl_ver"
766 cnf_append "VBOX_LIBIDL_CONFIG" \
767 "PKG_CONFIG_PATH=`libIDL-config-2 --prefix`/$LIB/pkgconfig `which_wrapper libIDL-config-2`"
768 fi
769 elif check_avail "libIDL-config" libIDL-config; then
770 libidl_ver=`libIDL-config --version`
771 if [ $? -ne 0 ]; then
772 log_failure "not found"
773 fail
774 else
775 log_success "found version $libidl_ver"
776 cnf_append "VBOX_LIBIDL_CONFIG" "`which_wrapper libIDL-config`"
777 fi
778 fi
779}
780
781
782#
783# Check for openssl, needed for RDP
784#
785check_ssl()
786{
787 test_header ssl
788 cat > $ODIR.tmp_src.cc << EOF
789#include <cstdio>
790#include <openssl/opensslv.h>
791extern "C" int main(void)
792{
793 printf("found version %s", OPENSSL_VERSION_TEXT);
794#if OPENSSL_VERSION_NUMBER >= 0x0090700
795 printf(", OK.\n");
796 return 0;
797#else
798 printf(", expected version 0.9.7 or higher\n");
799 return 1;
800#endif
801}
802EOF
803 if test_compile $LIBCRYPTO libcrypto openssl; then
804 if test_execute nofatal; then
805 cnf_append "SDK_VBOX_OPENSSL_INCS" ""
806 cnf_append "SDK_VBOX_OPENSSL_LIBS" "`strip_l "$LIBCRYPTO"`"
807 fi
808 fi
809}
810
811
812#
813# Check for pthread, needed by VBoxSVC, frontends, ...
814#
815check_pthread()
816{
817 test_header pthread
818 cat > $ODIR.tmp_src.cc << EOF
819#include <cstdio>
820#include <pthread.h>
821extern "C" int main(void)
822{
823 pthread_mutex_t mutex;
824 if (pthread_mutex_init(&mutex, NULL)) {
825 printf("pthread_mutex_init() failed\n");
826 return 1;
827 }
828 if (pthread_mutex_lock(&mutex)) {
829 printf("pthread_mutex_lock() failed\n");
830 return 1;
831 }
832 if (pthread_mutex_unlock(&mutex)) {
833 printf("pthread_mutex_unlock() failed\n");
834 return 1;
835 }
836 printf("found, OK.\n");
837}
838EOF
839 if test_compile $LIBPTHREAD pthread pthread; then
840 if test_execute; then
841 cnf_append "LIB_PTHREAD" "`strip_l "$LIBPTHREAD"`"
842 fi
843 fi
844}
845
846
847#
848# Check for zlib, needed by VBoxSVC, Runtime, ...
849#
850check_z()
851{
852 test_header zlib
853 cat > $ODIR.tmp_src.cc << EOF
854#include <cstdio>
855#include <zlib.h>
856extern "C" int main(void)
857{
858 printf("found version %s", ZLIB_VERSION);
859#if ZLIB_VERNUM >= 0x1210
860 printf(", OK.\n");
861 return 0;
862#else
863 printf(", expected version 1.2.1 or higher\n");
864 return 1;
865#endif
866}
867EOF
868 [ -n "$INCZ" ] && I_INCZ=`prefix_I "$INCZ"`
869 if test_compile "$LIBZ $I_INCZ" zlib zlib; then
870 if test_execute; then
871 cnf_append "SDK_VBOX_ZLIB_LIBS" "`strip_l "$LIBZ"`"
872 cnf_append "SDK_VBOX_ZLIB_INCS" "$INCZ"
873 fi
874 fi
875}
876
877
878#
879# Check for libpng, needed by kchmviewer
880#
881check_png()
882{
883 test_header libpng
884 cat > $ODIR.tmp_src.cc << EOF
885#include <cstdio>
886#include <png.h>
887extern "C" int main(void)
888{
889 printf("found version %s", PNG_LIBPNG_VER_STRING);
890#if PNG_LIBPNG_VER >= 10205
891 printf(", OK.\n");
892 return 0;
893#else
894 printf(", expected version 1.2.5 or higher\n");
895 return 1;
896#endif
897}
898EOF
899 [ -n "$INCPNG" ] && I_INCPNG=`prefix_I "$INCPNG"`
900# if test_compile "$LIBPNG $I_INCPNG" libpng libpng nofatal; then
901 if test_compile "$LIBPNG $I_INCPNG" libpng libpng; then
902# if test_execute nofatal; then
903 if test_execute; then
904 cnf_append "SDK_VBOX_LIBPNG_LIBS" "`strip_l "$LIBPNG"`"
905 cnf_append "SDK_VBOX_LIBPNG_INCS" "$INCPNG"
906 fi
907 fi
908}
909
910
911#
912# Check for pam, needed by VRDPAuth
913# Version 79 was introduced in 9/2005, do we support older versions?
914# Debian/sarge uses 76
915# OpenSUSE comes with 0.99.xxx where they changed the versioning scheme.
916#
917check_pam()
918{
919 test_header pam
920 cat > $ODIR.tmp_src.cc << EOF
921#include <cstdio>
922#include <security/pam_appl.h>
923extern "C" int main(void)
924{
925 printf("found version %d", __LIBPAM_VERSION);
926 if (__LIBPAM_VERSION >= 76)
927 {
928 printf(", OK.\n");
929 return 0;
930 }
931 else
932 {
933 printf(", expected version 76 or higher\n");
934 return 1;
935 }
936}
937EOF
938 if test_compile "-lpam" pam pam nofatal; then
939 if test_execute nofatal; then
940 return 0;
941 fi
942 fi
943 test_header linux_pam
944 cat > $ODIR.tmp_src.cc << EOF
945#include <cstdio>
946#include <security/pam_appl.h>
947extern "C" int main(void)
948{
949 printf("found version %d.%d", __LINUX_PAM__, __LINUX_PAM_MINOR__);
950 if (__LINUX_PAM__ >= 1)
951 {
952 printf(", OK.\n");
953 return 0;
954 }
955 else
956 {
957 printf(", expected version 1.0 or higher\n");
958 return 1;
959 }
960}
961EOF
962 if test_compile "-lpam" pam pam; then
963 test_execute
964 fi
965}
966
967
968#
969# Check for the SDL library, needed by VBoxSDL and VirtualBox
970# We depend at least on version 1.2.7
971#
972check_sdl()
973{
974 test_header SDL
975 if [ "$OS" = "darwin" ]; then
976 if [ -f "/System/Library/Frameworks/SDL.framework/SDL" ]; then
977 PATH_SDK_LIBSDL="/System/Library/Frameworks/SDL.framework"
978 elif [ -f "/Library/Frameworks/SDL.framework/SDL" ]; then
979 PATH_SDK_LIBSDL="/Library/Frameworks/SDL.framework"
980 fi
981 if [ -n "$PATH_SDK_LIBSDL" ]; then
982 foundsdl=1
983 INCSDL="$PATH_SDK_LIBSDL/Headers"
984 FLDSDL="-framework SDL"
985 else
986 log_failure "SDL framework not found"
987 fail
988 fi
989 else
990 if which_wrapper sdl-config > /dev/null; then
991 FLGSDL=`sdl-config --cflags`
992 INCSDL=`strip_I "$FLGSDL"`
993 LIBSDL=`sdl-config --libs`
994 LIBSDLMAIN="-lSDLmain"
995 FLDSDL=
996 foundsdl=1
997 fi
998 fi
999 [ "$OS" = "linux" -o "$OS" = "darwin" -o "$OS" = "solaris" ] && LIBSDLMAIN=""
1000 if [ -n "$foundsdl" ]; then
1001 cat > $ODIR.tmp_src.cc << EOF
1002#include <cstdio>
1003#include <SDL.h>
1004#include <SDL_main.h>
1005#undef main
1006extern "C" int main(int argc, char** argv)
1007{
1008 printf("found version %d.%d.%d",
1009 SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
1010#if SDL_VERSION_ATLEAST(1,2,7)
1011 printf(", OK.\n");
1012 return 0;
1013#else
1014 printf(", expected version 1.2.7 or higher\n");
1015 return 1;
1016#endif
1017}
1018EOF
1019 [ -n "$INCSDL" ] && I_INCSDL=`prefix_I "$INCSDL"`
1020 if test_compile "$LIBSDL $LIBSDLMAIN $I_INCSDL $FLDSDL" SDL SDL; then
1021 if test_execute; then
1022 cnf_append "LIB_SDK_LIBSDL_SDL" "`strip_l "$LIBSDL"`"
1023 cnf_append "SDK_LIBSDL_LIBPATH" "`strip_L "$LIBSDL"`"
1024 cnf_append "LIB_SDK_LIBSDL_SDLMAIN" "`strip_l "$LIBSDLMAIN"`"
1025 [ -n "$INCSDL" ] && cnf_append "SDK_LIBSDL_INCS" "$INCSDL"
1026 [ -n "$FLDSDL" ] && cnf_append "SDK_LIBSDL_LDFLAGS" "$FLDSDL"
1027 fi
1028 fi
1029 else
1030 log_failure "not found"
1031 fail
1032 fi
1033}
1034
1035
1036#
1037# Check for the SDL_ttf library, needed by VBoxSDL (secure label)
1038#
1039check_sdl_ttf()
1040{
1041 test_header SDL_ttf
1042 cat > $ODIR.tmp_src.cc << EOF
1043#include <cstdio>
1044#include <SDL_ttf.h>
1045#ifndef SDL_TTF_MAJOR_VERSION
1046#define SDL_TTF_MAJOR_VERSION TTF_MAJOR_VERSION
1047#define SDL_TTF_MINOR_VERSION TTF_MINOR_VERSION
1048#define SDL_TTF_PATCHLEVEL TTF_PATCHLEVEL
1049#endif
1050extern "C" int main(void)
1051{
1052 printf("found version %d.%d.%d",
1053 SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL);
1054#if 10000*SDL_TTF_MAJOR_VERSION + 100*SDL_TTF_MINOR_VERSION + SDL_TTF_PATCHLEVEL >= 20006
1055 printf(", OK.\n");
1056 return 0;
1057#else
1058 printf(", expected version 2.0.6 or higher\n");
1059 return 1;
1060#endif
1061}
1062EOF
1063 if test_compile "-lSDL_ttf $I_INCSDL" SDL_ttf SDL_ttf nofatal; then
1064 if ! test_execute nofatal; then
1065 cnf_append "VBOX_WITH_SECURELABEL" ""
1066 fi
1067 else
1068 cnf_append "VBOX_WITH_SECURELABEL" ""
1069 fi
1070}
1071
1072
1073#
1074# Check for libasound, needed by the ALSA audio backend
1075#
1076check_alsa()
1077{
1078 test_header ALSA
1079 cat > $ODIR.tmp_src.cc << EOF
1080#include <cstdio>
1081#include <alsa/asoundlib.h>
1082extern "C" int main(void)
1083{
1084 printf("found version %d.%d.%d",
1085 SND_LIB_MAJOR, SND_LIB_MINOR, SND_LIB_SUBMINOR);
1086#if 10000*SND_LIB_MAJOR + 100*SND_LIB_MINOR + SND_LIB_SUBMINOR >= 10006
1087 printf(", OK.\n");
1088 return 0;
1089#else
1090 printf(", expected version 1.0.6 or higher\n");
1091 return 1;
1092#endif
1093}
1094EOF
1095 if test_compile "-lasound" asound asound; then
1096 test_execute
1097 fi
1098}
1099
1100
1101#
1102# Check for PulseAudio
1103#
1104check_pulse()
1105{
1106 test_header "PulseAudio"
1107 cat > $ODIR.tmp_src.cc << EOF
1108#include <cstdio>
1109#include <pulse/version.h>
1110extern "C" int main(void)
1111{
1112 printf("found version %s API version %d", pa_get_headers_version(), PA_API_VERSION);
1113#if PA_API_VERSION >= 9
1114 printf(", OK.\n");
1115 return 0;
1116#else
1117 printf(", expected version 0.9.0 (API version 9) or higher\n");
1118 return 1;
1119#endif
1120}
1121EOF
1122 if test_compile "-lpulse" pulse pulse; then
1123 test_execute
1124 fi
1125}
1126
1127
1128#
1129# Check for the Xcursor library, needed by VBoxSDL and VBoxBFE
1130#
1131check_xcursor()
1132{
1133 test_header Xcursor
1134 cat > $ODIR.tmp_src.cc << EOF
1135#include <cstdio>
1136#include <X11/Xlib.h>
1137#include <X11/Xcursor/Xcursor.h>
1138extern "C" int main(void)
1139{
1140 XcursorImage *cursor = XcursorImageCreate (10, 10);
1141 XcursorImageDestroy(cursor);
1142 return 0;
1143}
1144EOF
1145 [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1146 if test_compile "$LIBX11 $LIBXCURSOR $I_INCX11" Xcursor Xcursor; then
1147 log_success "found"
1148 cnf_append "VBOX_XCURSOR_LIBS" "`strip_l "$LIBXCURSOR"`"
1149 fi
1150}
1151
1152
1153#
1154# Check for the X libraries (Xext, X11)
1155#
1156check_x()
1157{
1158 test_header "X libraries"
1159 cat > $ODIR.tmp_src.cc << EOF
1160#include <cstdio>
1161#include <X11/Xlib.h>
1162extern "C" int main(void)
1163{
1164 Display *dpy;
1165 int scrn_num;
1166 Screen *scrn;
1167 Window win;
1168
1169 dpy = XOpenDisplay(NULL);
1170 scrn_num = DefaultScreen(dpy);
1171 scrn = ScreenOfDisplay(dpy, scrn_num);
1172 win = XCreateWindow(dpy, RootWindowOfScreen(scrn), 0, 0, 100, 100,
1173 0, 16, InputOutput, CopyFromParent, 0, NULL);
1174 XDestroyWindow(dpy, win);
1175}
1176EOF
1177 [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1178 if test_compile "$LIBX11 $I_INCX11" Xlibs Xlibs; then
1179 log_success "found"
1180 fi
1181}
1182
1183
1184#
1185# Check for the Qt4 library, needed by the VirtualBox frontend
1186#
1187# Currently not fatal.
1188#
1189check_qt4()
1190{
1191 foundqt4=
1192 test_header Qt4
1193 if [ "$OS" = "darwin" ]; then
1194 if [ -f "/System/Library/Frameworks/QtCore.framework/QtCore" ]; then
1195 PATH_SDK_QT4="/System/Library/Framework/QtCore.framework"
1196 elif [ -f "/Library/Frameworks/QtCore.framework/QtCore" ]; then
1197 PATH_SDK_QT4="/Library/Frameworks/QtCore.framework"
1198 fi
1199 if [ -n "$PATH_SDK_QT4" ]; then
1200 foundqt4=1
1201 INCQT4="$PATH_SDK_QT4/Headers"
1202 LIBQT4=
1203 FLGQT4="-framework QtCore"
1204 else
1205 log_failure "Qt4 framework not found (can be disabled using --disable-qt4)"
1206 fail
1207 fi
1208 else
1209 if [ $QT4DIR_PKGCONFIG -eq 1 ]; then
1210 # default is to use pkg-config
1211 if which_wrapper pkg-config > /dev/null; then
1212 # this braindead path is necessary for mdv2008.1
1213 qt4_ver=`\
1214 PKG_CONFIG_PATH=/usr/lib/qt4/lib/pkgconfig \
1215 pkg-config QtCore --modversion 2>> $LOG`
1216 if [ $? -ne 0 ]; then
1217 log_failure "not found"
1218 fail
1219 else
1220 FLGQT4=`\
1221 PKG_CONFIG_PATH=/usr/lib/qt4/lib/pkgconfig \
1222 pkg-config QtCore --cflags`
1223 INCQT4=`strip_I "$FLGQT4"`
1224 LIBQT4=`\
1225 PKG_CONFIG_PATH=/usr/lib/qt4/lib/pkgconfig \
1226 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \
1227 pkg-config QtCore --libs`
1228 foundqt4=1
1229 fi
1230 else
1231 log_failure "pkg-config not found"
1232 fail
1233 fi
1234 else
1235 # do it the old way (e.g. user has specified QT4DIR)
1236 cat > $ODIR.tmp_src.cc << EOF
1237#include <cstdio>
1238#include <QtGlobal>
1239extern "C" int main(void)
1240{
1241 printf("found version %s", QT_VERSION_STR);
1242#if QT_VERSION >= 0x040300
1243 printf(", OK.\n");
1244 return 0;
1245#else
1246 printf(", expected version 4.3.0 or higher\n");
1247 return 1;
1248#endif
1249}
1250EOF
1251 for q in $QT4DIR; do
1252 INCQT4="$q/include $q/include/QtCore"
1253 FLGQT4="-DQT_SHARED"
1254 I_INCQT4=`prefix_I "$INCQT4"`
1255 LIBQT4="-L$q/lib -lVBoxQtCore"
1256 if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
1257 foundqt4=2
1258 break;
1259 fi
1260 LIBQT4="-L$q/lib -lQtCore"
1261 if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
1262 foundqt4=1
1263 break;
1264 fi
1265 done
1266 fi
1267 fi
1268 if [ -n "$foundqt4" ]; then
1269 cat > $ODIR.tmp_src.cc << EOF
1270#include <cstdio>
1271#include <QtGlobal>
1272extern "C" int main(void)
1273{
1274 printf("found version %s", QT_VERSION_STR);
1275#if QT_VERSION >= 0x040300
1276 printf(", OK.\n");
1277 return 0;
1278#else
1279 printf(", expected version 4.3.0 or higher\n");
1280 return 1;
1281#endif
1282}
1283EOF
1284 [ -n "$INCQT4" ] && I_INCQT4=`prefix_I "$INCQT4"`
1285 if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
1286 if test_execute_path "`strip_L "$LIBQT4"`"; then
1287 if [ "$OS" != "darwin" ]; then
1288 # strip .../QtCore as we add components ourself
1289 INCQT4=`echo "$INCQT4"|$KBUILD_SED 's|\([^ ]*\)/QtCore|\1|g; s| $||g'`
1290 # store only the first path, remove all other pathes
1291 # most likely pkg-config gave us -I/usr/include/qt4 -I/usr/include/qt4/QtCore
1292 INCQT4=`echo "$INCQT4"|$KBUILD_SED 's|\([^ ]*\) .*|\1|'`
1293 cnf_append "VBOX_PATH_QT4_LIB" "`strip_L "$LIBQT4"`"
1294 cnf_append "SDK_QT4_LIBPATH" "`strip_L "$LIBQT4"`"
1295 cnf_append "PATH_SDK_QT4_INC" "$INCQT4"
1296 # this is not quite right since the qt libpath does not have to be first...
1297 cnf_append "PATH_SDK_QT4_LIB" '$'"(firstword `strip_L "$LIBQT4"`)"
1298 if [ "$foundqt4" = "2" ]; then
1299 cnf_append "VBOX_WITH_QT4_SUN" "1"
1300 fi
1301 test_header "Qt4 devtools"
1302 for q in $QT4DIR; do
1303 if which_wrapper "$q/bin/moc" > /dev/null; then
1304 moc_ver=`$q/bin/moc -v 2>&1|sed 's+^.*(Qt \(.*\))+\1+'`
1305 if [ $? -ne 0 ]; then
1306 log_failure "not found"
1307 fail
1308 else
1309 log_success "found version $moc_ver"
1310 cnf_append "VBOX_PATH_QT4" "$q"
1311 cnf_append "PATH_SDK_QT4" "$q"
1312 cnf_append "PATH_TOOL_QT4" "$q"
1313 cnf_append "PATH_TOOL_QT4_BIN" "$q/bin"
1314 return
1315 fi
1316 fi
1317 done
1318 fi
1319 fi
1320 else
1321 log_failure "not found"
1322 fail
1323 fi
1324 else
1325 log_failure "not found"
1326 fail
1327 fi
1328}
1329
1330
1331#
1332# Check whether static libstdc++ is installed
1333#
1334check_staticlibstdcxx()
1335{
1336 test_header "static stc++ library"
1337 libstdcxx=`$CXX -print-file-name=libstdc++.a`
1338 cat > $ODIR.tmp_src.cc << EOF
1339#include <string>
1340
1341extern "C" int main(void)
1342{
1343 std::string s = "test";
1344 return 0;
1345}
1346EOF
1347 if test_compile "$libstdcxx" libstdc++ libstdc++; then
1348 log_success "found"
1349 fi
1350}
1351
1352
1353#
1354# Check for Linux sources
1355#
1356check_linux()
1357{
1358 test_header "Linux kernel sources"
1359 cat > $ODIR.tmp_src.c << EOF
1360#include <linux/version.h>
1361int printf(const char *format, ...);
1362int main(void)
1363{
1364 printf("found version %d.%d.%d", LINUX_VERSION_CODE / 65536,
1365 (LINUX_VERSION_CODE % 65536) / 256,
1366 LINUX_VERSION_CODE % 256);
1367#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,0)
1368 printf(", OK.\n");
1369 return 0;
1370#else
1371 printf(", expected version 2.4.0 or higher\n");
1372 return 1;
1373#endif
1374}
1375EOF
1376 echo "compiling the following source file:" >> $LOG
1377 cat $ODIR.tmp_src.c >> $LOG
1378 echo "using the following command line:" >> $LOG
1379 echo "$CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include" >> $LOG
1380 $CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include >> $LOG 2>&1
1381 if [ $? -ne 0 ]; then
1382 echo
1383 echo " Linux kernel headers not found at $LINUX"
1384 echo " Check the file $LOG for detailed error information."
1385 fail
1386 else
1387 if test_execute; then
1388 cnf_append "VBOX_LINUX_SRC" "`cd $LINUX ; pwd`"
1389 fi
1390 fi
1391}
1392
1393
1394#
1395# Check for kchmviewer, needed to display the online help
1396# (unused as we ship kchmviewer)
1397#
1398check_kchmviewer()
1399{
1400 test_header kchmviewer
1401 if check_avail "$KCHMVIEWER" KCHMVIEWER; then
1402 kchmviewer_ver=`$KCHMVIEWER --version|grep "^KchmViewer:"|sed 's+^KchmViewer: \(.*\)+\1+'`
1403 if [ $? -ne 0 ]; then
1404 log_failure "not found"
1405 fail
1406 else
1407 log_success "found version $kchmviewer_ver"
1408 fi
1409 fi
1410}
1411
1412
1413#
1414# Check for the kBuild tools, we don't support GNU make
1415#
1416check_kbuild()
1417{
1418 test_header kBuild
1419 if which_wrapper "$KBUILDDIR/bin/$OS.$BUILD_MACHINE/kmk" > /dev/null; then
1420 KBUILDDIR_BIN="$KBUILDDIR/bin/$OS.$BUILD_MACHINE"
1421 echo "export PATH_KBUILD=\"`cd $KBUILDDIR ; pwd`\"" >> $ENV
1422 echo "export PATH_DEVTOOLS=\"$DEVDIR\"" >> $ENV
1423 echo "path_kbuild_bin=\"\$PATH_KBUILD/bin/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"" >> $ENV
1424 echo "export PATH_KBUILD_BIN=\"\$path_kbuild_bin\"" >> $ENV
1425 echo "path_dev_bin=\"\$PATH_DEVTOOLS/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"/bin" >> $ENV
1426 if [ "$OS" = "solaris" ]; then
1427 # Because of sh being non-default shell in Solaris we need to export PATH again when
1428 # sourcing env.sh. Simply exporting from ./configure does not export PATH correctly.
1429 echo "PATH=\"$ORGPATH\"" >> $ENV
1430 echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
1431 echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
1432 else
1433 echo "echo \"\$PATH\" | grep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
1434 echo "echo \"\$PATH\" | grep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
1435 fi
1436 echo "export PATH" >> $ENV
1437 echo "unset path_kbuild_bin path_dev_bin" >> $ENV
1438 KBUILD_SED="$KBUILDDIR_BIN/kmk_sed"
1439 elif check_avail "kmk" KBUILDDIR really; then
1440 # check for installed kBuild
1441 KBUILD_SED="`which_wrapper kmk_sed`"
1442 else
1443 fail
1444 fi
1445 log_success "found"
1446}
1447
1448
1449#
1450# Check for compiler.h
1451# Some Linux distributions include "compiler.h" in their libc linux
1452# headers package, some don't. Most don't need it, building might (!)
1453# not succeed on openSUSE without it.
1454#
1455# See http://www.mail-archive.com/qemu-devel%40nongnu.org/msg07980.html
1456#
1457check_compiler_h()
1458{
1459 test_header compiler.h
1460 if ! test -f "/usr/include/linux/compiler.h"; then
1461 cnf_append "VBOX_WITHOUT_LINUX_COMPILER_H" "1"
1462 log_success "compiler.h not found"
1463 else
1464 log_success "compiler.h found"
1465 fi
1466}
1467
1468#
1469# Check for libcap.
1470# Required to pass CAP_NET_RAW to our binaries to allow to open SOCK_RAW
1471# sockets for doing ICMP requests.
1472#
1473check_libcap()
1474{
1475 test_header "libcap library"
1476 cat > $ODIR.tmp_src.cc << EOF
1477#include <cstdio>
1478#include <sys/capability.h>
1479
1480extern "C" int main(void)
1481{
1482 char buf[1024];
1483 cap_t caps = cap_get_proc();
1484 snprintf(buf, sizeof(buf), "Current caps are '%s'\n", cap_to_text(caps, NULL));
1485 return 0;
1486}
1487EOF
1488 if test_compile $LIBCAP libcap libcap; then
1489 if test_execute; then
1490 log_success "found"
1491 fi
1492 fi
1493}
1494
1495#
1496# Check if we are able to build 32-bit applications (needed for the guest additions)
1497#
1498check_32bit()
1499{
1500 test_header "32-bit support"
1501 cat > $ODIR.tmp_src.c << EOF
1502#include <stdint.h>
1503int main(void)
1504{
1505 return 0;
1506}
1507EOF
1508 echo "compiling the following source file:" >> $LOG
1509 cat $ODIR.tmp_src.c >> $LOG
1510 echo "using the following command line:" >> $LOG
1511 echo "$CC -m32 -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c" >> $LOG
1512 $CC -m32 -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c >> $LOG 2>&1
1513 if [ $? -ne 0 ]; then
1514 echo
1515 echo " Cannot compile 32-bit applications (missing headers and/or libraries)!"
1516 echo " Check the file $LOG for detailed error information."
1517 fail
1518 fi
1519 log_success ""
1520}
1521
1522
1523#
1524# Check for Python
1525#
1526check_python()
1527{
1528 test_header "python support"
1529 cat > $ODIR.tmp_src.cc << EOF
1530#include <cstdio>
1531#include <Python.h>
1532extern "C" int main(void)
1533{
1534 Py_Initialize();
1535 printf("found version %s", PY_VERSION);
1536#if PY_VERSION_HEX >= 0x02030000
1537 printf(", OK.\n");
1538 return 0;
1539#else
1540 printf(", expected version 2.3 or higher\n");
1541 return 1;
1542#endif
1543}
1544EOF
1545 found=
1546 for p in $PYTHONDIR; do
1547 for d in python2.6 python2.5 python2.4 python2.3; do
1548 for b in lib64 lib/64 lib; do
1549 echo "compiling the following source file:" >> $LOG
1550 cat $ODIR.tmp_src.cc >> $LOG
1551 echo "using the following command line:" >> $LOG
1552 echo "$CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so" >> $LOG
1553 $CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so >> $LOG 2>&1
1554 if [ $? -eq 0 ]; then
1555 found=1
1556 break
1557 fi
1558 done
1559 if [ -n "$found" ]; then break; fi
1560 done
1561 if [ -n "$found" ]; then break; fi
1562 done
1563 if [ -n "$found" ]; then
1564 if test_execute; then
1565 cnf_append "VBOX_WITH_PYTHON" "1"
1566 cnf_append "VBOX_PATH_PYTHON_INC" "$p/include/$d"
1567 cnf_append "VBOX_LIB_PYTHON" "$p/$b/lib$d.so"
1568 else
1569 log_failure "not found"
1570 fail
1571 fi
1572 else
1573 log_failure "not found"
1574 fail
1575 fi
1576}
1577
1578
1579#
1580# Setup wine
1581#
1582setup_wine()
1583{
1584 test_header "Wine support"
1585 if ! which_wrapper wine > /dev/null; then
1586 echo " wine binary not found"
1587 fail
1588 fi
1589 if ! which_wrapper wineprefixcreate > /dev/null; then
1590 echo " wineprefixcreate not found"
1591 fail
1592 fi
1593 export WINEPREFIX="${ODIR}wine.$BUILD_MACHINE"
1594 echo "export WINEPREFIX=\"${ODIR}wine.$BUILD_MACHINE\"" >> $ENV
1595 rm -rf $WINEPREFIX
1596 mkdir -p $WINEPREFIX
1597 touch $WINEPREFIX/.no_prelaunch_window_flag
1598 if ! wineprefixcreate -q > /dev/null 2>&1; then
1599 echo " wineprefixcreate failed"
1600 fail
1601 fi
1602 tmp=.tmp.wine.reg
1603 rm -f $tmp
1604 echo 'REGEDIT4' > $tmp
1605 echo '' >> $tmp
1606 echo '[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment]' >> $tmp
1607 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
1608 echo '' >> $tmp
1609 echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhc.exe\DllOverrides]' >> $tmp
1610 echo '"itss"="native"' >> $tmp
1611 echo '' >> $tmp
1612 echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhw.exe\DllOverrides]' >> $tmp
1613 echo '"itss"="native"' >> $tmp
1614 echo '' >> $tmp
1615 if ! wine regedit $tmp > /dev/null 2>&1; then
1616 rm -f $tmp
1617 echo " failed to load registry changes (path)."
1618 fail
1619 fi
1620 rm -f $tmp
1621 log_success "found"
1622}
1623
1624#
1625#
1626#
1627check_gsoap()
1628{
1629 test_header "GSOAP compiler"
1630 if [ -z "$GSOAP" ]; then
1631 GSOAP="/usr/bin"
1632 fi
1633 if which_wrapper "$GSOAP/soapcpp2" > /dev/null; then
1634 if which_wrapper "$GSOAP/wsdl2h" > /dev/null; then
1635 cnf_append "VBOX_GSOAP_INSTALLED" "1"
1636 cnf_append "VBOX_PATH_GSOAP" "$GSOAP"
1637 log_success "found"
1638 else
1639 log_failure "wsdl2h not found -- disabling webservice"
1640 cnf_append "VBOX_WITH_WEBSERVICES" ""
1641 fi
1642 else
1643 log_failure "soapcpp2 not found -- disabling webservice"
1644 cnf_append "VBOX_WITH_WEBSERVICES" ""
1645 fi
1646}
1647
1648
1649#
1650# Determines the Darwin version.
1651# @todo This should really check the Xcode/SDK version.
1652#
1653check_darwinversion()
1654{
1655 test_header "Darwin version"
1656 darwin_ver=`uname -r`
1657 case "$darwin_ver" in
1658 9\.*)
1659 darwin_ver="10.5"
1660 #cnf_append "VBOX_TARGET_MAC_OS_X_VERSION_10_5" "1"
1661 ;;
1662 8\.*)
1663 darwin_ver="10.4"
1664 ;;
1665 *)
1666 echo " failed to determin darwin version. (uname -r: $darwin_ver)"
1667 fail
1668 darwin_ver="unknown"
1669 ;;
1670 esac
1671 log_success "found version $darwin_ver"
1672}
1673
1674
1675#
1676# Checks that i386-elf-gcc-3.4.6, i386-elf-gcc-3.4.3, i386-elf-gcc-3.4 or i386-elf-gcc
1677# is around to prevent confusion when the build fails in src/recompiler.
1678# Note. Keep the which order in sync with the $(which ) in src/recompiler/Makefile.kmk.
1679#
1680check_i386elfgcc()
1681{
1682 test_header "i386-elf-gcc"
1683 i386_elf_gcc=`which_wrapper i386-elf-gcc-3.4.6`
1684 test -z "$i386_elf_gcc" && i386_elf_gcc=`which_wrapper i386-elf-gcc-3.4.3`
1685 test -z "$i386_elf_gcc" && i386_elf_gcc=`which_wrapper i386-elf-gcc-3.4`
1686 test -z "$i386_elf_gcc" && i386_elf_gcc=`which_wrapper i386-elf-gcc`
1687 if test -z "$i386_elf_gcc"; then
1688 echo " failed to find i386-elf-gcc"
1689 fail
1690 fi
1691 log_success "found $i386_elf_gcc"
1692}
1693
1694
1695#
1696# Show help
1697#
1698show_help()
1699{
1700 cat << EOF
1701Usage: ./configure [OPTIONS]...
1702
1703Configuration:
1704 -h, --help display this help and exit
1705 --nofatal don't abort on errors
1706 --disable-xpcom disable XPCOM and related stuff
1707 --disable-python disable python bindings
1708 --disable-sdl-ttf disable SDL_ttf detection
1709 --disable-alsa disable the ALSA sound backend
1710 --disable-pulse disable the PulseAudio backend
1711 --disable-dbus don't use DBus and hal for hardware detection
1712 --disable-kmods don't build Linux kernel modules (host and guest)
1713 --disable-hardening don't be strict about /dev/vboxdrv access
1714 --enable-webservice enable the webservice stuff
1715 --build-libxml2 build libxml2 from sources
1716 --build-libxslt build libxslt from sources
1717 --setup-wine setup a Wine directory and register the hhc hack
1718
1719Paths:
1720 --with-gcc=PATH location of the gcc compiler [$CC]
1721 --with-g++=PATH location of the g++ compiler [$CXX]
1722 --with-kbuild=DIR kbuild directory [$KBUILDDIR]
1723 --with-iasl=PATH location of the iasl compiler [$IASL]
1724 --with-linux=DIR Linux kernel source directory [$LINUX]
1725 --with-mkisofs=PATH location of mkisofs [$MKISOFS]
1726 --with-qt-dir=DIR directory for Qt4 headers/libraries [pkgconfig]
1727 --with-gsoap-dir=PATH directory for SOAP compiler (soapcpp2 and wsdl2h)
1728
1729Build type:
1730 -d, --build-debug build with debugging symbols and assertions
1731 --build-profile build with profiling support
1732 --build-headless build headless (without any X11 frontend)
1733EOF
1734 exit 0
1735}
1736
1737
1738#
1739# The body.
1740#
1741
1742# scan command line options
1743for option in $*; do
1744 case "$option" in
1745 --help|-help|-h)
1746 show_help
1747 ;;
1748 --nofatal)
1749 nofatal=1
1750 ;;
1751 --env-only)
1752 ENV_ONLY=1
1753 ;;
1754 --with-gcc=*)
1755 CC=`echo $option | cut -d'=' -f2`
1756 ;;
1757 --with-g++=*)
1758 CXX=`echo $option | cut -d'=' -f2`
1759 ;;
1760 --with-kbuild=*)
1761 KBUILDDIR=`echo $option | cut -d'=' -f2`
1762 if echo $KBUILDDIR|grep -q "$INVALID_CHARS"; then
1763 echo "Error: KBUILDDIR contains invalid characters!"
1764 exit 1
1765 fi
1766 ;;
1767 --with-qt-dir=*|--with-qt4-dir=*)
1768 QT4DIR=`echo $option | cut -d'=' -f2`
1769 QT4DIR_PKGCONFIG=0
1770 ;;
1771 --with-gsoap-dir=*)
1772 GSOAP=`echo $option | cut -d'=' -f2`
1773 ;;
1774 --with-iasl=*)
1775 IASL=`echo $option | cut -d'=' -f2`
1776 ;;
1777 --with-linux=*)
1778 LINUX=`echo $option | cut -d'=' -f2`
1779 ;;
1780 --with-mkisofs=*)
1781 MKISOFS=`echo $option | cut -d'=' -f2`
1782 ;;
1783 --disable-xpcom)
1784 WITH_XPCOM=0
1785 ;;
1786 --disable-python)
1787 WITH_PYTHON=0
1788 ;;
1789 --disable-sdl-ttf)
1790 WITH_SDL_TTF=0
1791 ;;
1792 --disable-qt)
1793 WITH_QT4=0
1794 ;;
1795 --disable-qt4)
1796 WITH_QT4=0
1797 ;;
1798 --disable-alsa)
1799 WITH_ALSA=0
1800 ;;
1801 --disable-pulse)
1802 WITH_PULSE=0
1803 ;;
1804 --disable-dbus)
1805 WITH_DBUS=0
1806 ;;
1807 --disable-kmods)
1808 WITH_KMODS=0
1809 ;;
1810 --disable-hardening)
1811 WITH_HARDENING=0
1812 ;;
1813 --enable-hardening)
1814 WITH_HARDENING=2
1815 ;;
1816 --enable-webservice)
1817 WITH_GSOAP=1
1818 ;;
1819 --build-debug|-d)
1820 BUILD_TYPE=debug
1821 ;;
1822 --build-profile)
1823 BUILD_TYPE=profile
1824 ;;
1825 --build-libxml2)
1826 BUILD_LIBXML2=1
1827 ;;
1828 --build-libxslt)
1829 BUILD_LIBXSLT=1
1830 ;;
1831 --build-headless)
1832 HEADLESS=1
1833 WITH_SDL=0
1834 WITH_SDL_TTF=0
1835 WITH_X11=0
1836 WITH_QT4=0
1837 ;;
1838 --ose)
1839 OSE=2
1840 ;;
1841 --odir=*)
1842 ODIR="`echo $option | cut -d'=' -f2`/"
1843 ;;
1844 --setup-wine)
1845 SETUP_WINE=1
1846 ;;
1847 *)
1848 echo
1849 echo "Unrecognized option \"$option\""
1850 echo
1851 show_help
1852 ;;
1853 esac
1854done
1855
1856LOG="$ODIR$LOG"
1857ENV="$ODIR$ENV"
1858CNF="$ODIR$CNF"
1859
1860# initialize output files
1861cat > $LOG << EOF
1862# Log file generated by
1863#
1864# '$0 $*'
1865#
1866
1867EOF
1868cat > $CNF << EOF
1869# -*- Makefile -*-
1870#
1871# automatically generated by
1872#
1873# '$0 $*'
1874#
1875# It will be completely overwritten if configure is executed again.
1876#
1877
1878EOF
1879cat > $ENV << EOF
1880#!/bin/bash
1881#
1882# automatically generated by
1883#
1884# '$0 $*'
1885#
1886# It will be completely overwritten if configure is executed again.
1887# Make sure you source this file once before you start to build VBox.
1888#
1889
1890EOF
1891
1892# test if we are OSE
1893if [ $OSE -eq 1 -a -d "`cd \`dirname $0\`; pwd`/src/VBox/Devices/USB" ]; then
1894 echo "Found USB devices, assuming VBOX_OSE = FALSE" >> $LOG
1895 echo >> $LOG
1896 OSE=0
1897fi
1898
1899if [ "$BUILD_TYPE" = "debug" ]; then
1900 echo "Creating DEBUG build!" >> $LOG
1901elif [ "$BUILD_TYPE" = "profile" ]; then
1902 echo "Creating PROFILE build!" >> $LOG
1903fi
1904
1905# first determine our environment
1906check_environment
1907check_kbuild
1908
1909[ -n "$ENV_ONLY" ] && exit 0
1910
1911# append the tools directory to the default search path
1912echo "$PATH" | grep -q "$DEVDIR_BIN" || PATH="$PATH:$DEVDIR_BIN"
1913export PATH
1914
1915# some things are not available in for OSE
1916if [ $OSE -ge 1 ]; then
1917 cnf_append "VBOX_OSE" "1"
1918 cnf_append "VBOX_WITH_TESTSUITE" ""
1919 cnf_append "VBOX_WITH_WIN32_ADDITIONS" ""
1920
1921 if [ "$OS" = "linux" ]; then
1922 cnf_append "VBOX_WITH_LINUX_ADDITIONS" "1"
1923 else
1924 cnf_append "VBOX_WITH_LINUX_ADDITIONS" ""
1925 fi
1926 echo >> $CNF
1927fi
1928
1929# headless
1930if [ -n "$HEADLESS" ]; then
1931 cnf_append "VBOX_HEADLESS" "1"
1932fi
1933
1934if [ "$OS" = "darwin" ]; then
1935 # On Darwin we want to build against Qt4 only. WITH_QT4 is enabled by
1936 # default so disable Qt3. --disable-qt disables both Qt3 and Qt4 GUI now,
1937 # --disable-qt4 disables only the Qt4 GUI (which is not appropriate for
1938 # Darwin as we disable the Qt3 here anyway.
1939 # (Qt3 builds for Intel Macs are usually not threaded or for X11. And they
1940 # don't contain our patches, which means the result isn't really usable.)
1941 BUILD_LIBXSLT=1
1942 BUILD_LIBXML2=1
1943fi
1944
1945# emit disable directives corresponding to any --disable-xxx options.
1946[ $WITH_XPCOM -eq 0 ] && cnf_append "VBOX_WITH_MAIN" ""
1947[ $WITH_QT4 -eq 0 ] && cnf_append "VBOX_WITH_QTGUI" ""
1948[ $WITH_SDL_TTF -eq 0 ] && cnf_append "VBOX_WITH_SECURELABEL" ""
1949[ $WITH_HARDENING -eq 0 ] && cnf_append "VBOX_WITHOUT_HARDENING" "1"
1950[ $WITH_HARDENING -eq 2 ] && cnf_append "VBOX_WITH_HARDENING" "2"
1951
1952# the tools
1953check_gcc
1954[ "$OS" != "darwin" ] && check_as86
1955[ "$OS" != "darwin" ] && check_bcc
1956[ "$OS" != "darwin" ] && check_iasl
1957# don't check for yasm for the time beeing as 0.40 and 0.50 both have known bugs
1958# [ "$OS" != "darwin" ] && check_yasm
1959[ "$OS" != "darwin" ] && check_xsltproc
1960[ $OSE -eq 0 -a "$OS" != "darwin" ] && check_mkisofs
1961
1962# the libraries
1963[ "$OS" != "darwin" ] && check_pthread
1964[ $WITH_XPCOM -eq 1 ] && check_libxml2
1965[ $WITH_XPCOM -eq 1 ] && check_libxslt
1966[ $WITH_LIBIDL -eq 1 ] && check_libidl
1967# build openssl on Darwin in every case
1968[ "$OS" != "darwin" -a $OSE -eq 0 ] && check_ssl
1969[ "$OS" != "darwin" ] && check_z
1970[ "$OS" != "darwin" -a "$OS" != "freebsd" ] && check_png
1971[ $OSE -eq 0 -a "$OS" = "linux" ] && check_pam
1972[ $WITH_SDL -eq 1 ] && check_sdl
1973[ $WITH_SDL_TTF -eq 1 -a $OSE -eq 0 ] && check_sdl_ttf
1974[ $WITH_X11 -eq 1 ] && check_x
1975# TODO check for Xmu (X11/Xmu/StdCmap.h)
1976# TODO check for mesa-common-dev (GL/glx.h)
1977# TODO check for libglu1-mesa-dev (GL/glu.h)
1978[ $WITH_X11 -eq 1 ] && check_xcursor
1979[ $WITH_QT4 -eq 1 ] && check_qt4
1980[ $WITH_PYTHON -eq 1 -a "$OS" != "darwin" ] && check_python
1981
1982# Linux-specific
1983if [ "$OS" = "linux" ]; then
1984 check_staticlibstdcxx
1985 if [ $WITH_KMODS -eq 1 ]; then
1986 check_linux
1987 else
1988 cnf_append "VBOX_LINUX_SRC" ""
1989 cnf_append "VBOX_WITH_VBOXDRV" ""
1990 cnf_append "VBOX_WITH_ADDITION_DRIVERS" ""
1991 fi
1992 if [ $WITH_ALSA -eq 1 ]; then
1993 check_alsa
1994 else
1995 cnf_append "VBOX_WITH_ALSA" ""
1996 fi
1997 if [ $WITH_PULSE -eq 1 ]; then
1998 check_pulse
1999 else
2000 cnf_append "VBOX_WITH_PULSE" ""
2001 fi
2002 if [ $WITH_DBUS -eq 0 ]; then
2003 cnf_append "VBOX_WITH_DBUS" ""
2004 fi
2005 check_libcap
2006 check_compiler_h
2007 [ "$BUILD_MACHINE" = "amd64" ] && check_32bit
2008fi
2009
2010[ -n "$SETUP_WINE" ] && setup_wine
2011
2012if [ $WITH_GSOAP -eq 1 ]; then
2013 check_gsoap
2014else
2015 cnf_append "VBOX_WITH_WEBSERVICES" ""
2016fi
2017
2018# Darwin-specific
2019if [ "$OS" = "darwin" ]; then
2020 check_darwinversion
2021 check_i386elfgcc
2022fi
2023
2024# success!
2025echo
2026echo "Successfully generated '$CNF' and '$ENV'."
2027echo "Source '$ENV' once before you start to build VBox:"
2028echo ""
2029echo " source $ENV"
2030echo " kmk"
2031echo ""
2032if [ "$OS" = "linux" ]; then
2033 echo "To compile the kernel module, do:"
2034 echo ""
2035 echo " cd ./out/$OS.$TARGET_MACHINE/$BUILD_TYPE/bin/src/vboxdrv"
2036 echo " make"
2037 echo ""
2038fi
2039if [ $WITH_HARDENING -gt 0 ]; then
2040 echo ""
2041 echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
2042 echo " Hardening is enabled which means that the VBox binaries will not run from"
2043 echo " the binary directory. The binaries have to be installed suid root and some"
2044 echo " more prerequisites have to be fulfilled which is normally done by installing"
2045 echo " the final package. For development, the hardening feature can be disabled"
2046 echo " by specifying the --disable-hardening parameter. Please never disable that"
2047 echo " feature for the final distribution!"
2048 echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
2049 echo ""
2050else
2051 echo ""
2052 echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
2053 echo " Hardening is disabled. Please do NOT build packages for distribution with"
2054 echo " disabled hardening!"
2055 echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
2056 echo ""
2057fi
2058echo "Enjoy!"
2059cleanup
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