VirtualBox

source: vbox/trunk/configure@ 15678

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

configure: purged the gcc-4.3 check for the recompiler

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