VirtualBox

source: vbox/trunk/configure@ 5046

Last change on this file since 5046 was 5046, checked in by vboxsync, 17 years ago

cosmetical fix

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
File size: 35.6 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 innotek GmbH
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"
24
25#
26# Defaults
27#
28OSE=1
29ODIR="`pwd`/"
30SETUP_WINE=
31TARGET_MACHINE=""
32TARGET_CPU=""
33WITH_XPCOM=1
34WITH_LIBIDL=1
35WITH_QT=1
36WITH_SDL_TTF=1
37CC="gcc"
38CC32=""
39CC64=""
40CXX="g++"
41CXX32=""
42CXX64=""
43BCC="bcc"
44YASM="yasm"
45IASL="iasl"
46AS86="as86"
47XSLTPROC="xsltproc"
48GENISOIMAGE="genisoimage"
49MKISOFS="mkisofs"
50INCXALAN="/usr/local/include"
51LIBXALAN="-lxalan-c"
52LIBXALAN_DIR="/usr/local/lib"
53INCXERCES="/usr/local/include"
54LIBXERCES="-lxerces-c"
55LIBXERCES_DIR="/usr/local/lib"
56LIBCRYPTO="-lcrypto"
57LIBPTHREAD="-lpthread"
58LIBX11="-L/usr/X11R6/lib -L/usr/X11R6/lib64 -L/usr/local/lib -lXext -lX11"
59INCX11="/usr/local/include"
60LIBXCURSOR="-lXcursor"
61INCZ=""
62LIBZ="-lz"
63INCPNG=""
64LIBPNG="-lpng"
65QTDIR="/usr/qt/3 /usr/lib/qt3 /usr/lib/qt-3.3 /usr/share/qt3 /usr/lib64/qt-3.3 /usr/X11R6"
66KBUILDDIR="`cd \`dirname $0\`; pwd`/kBuild"
67DEVDIR="`cd \`dirname $0\`; pwd`/tools"
68if [ -d "/lib/modules/`uname -r`/build" ]; then
69 LINUX="/lib/modules/`uname -r`/build"
70else
71 LINUX="/usr/src/linux"
72fi
73KCHMVIEWER="kchmviewer"
74LOG="configure.log"
75CNF="AutoConfig.kmk"
76ENV="env.sh"
77BUILD_TYPE="release"
78# the restricting tool is ar (mri mode).
79INVALID_CHARS="[^A-Za-z0-9/\\$:._-]"
80
81if (cd `dirname $0`; pwd)|grep -q "$INVALID_CHARS"; then
82 echo "Error: VBox base path contains invalid characters!"
83 exit 1
84fi
85
86cleanup()
87{
88 rm -f .tmp_src.cc .tmp_src.c .tmp_out .test_execute.log
89}
90
91fail()
92{
93 if [ -z "$nofatal" -o "x$1" != "x" ]; then
94 cleanup
95 rm -f $ENV
96 exit 1
97 fi
98}
99
100log_success()
101{
102 if [ -n "$1" ]; then echo -n "$1, "; fi
103 echo "OK."
104 echo "$1" >> $LOG
105 echo >> $LOG
106 echo >> $LOG
107}
108
109log_failure()
110{
111 echo
112 echo " ** $1!"
113 echo "** $1!" >> $LOG
114 echo >> $LOG
115}
116
117cnf_append()
118{
119 printf "%-30s := %s\n" "$1" "$2" >> $CNF
120}
121
122strip_l()
123{
124 echo "$1"|$KBUILD_SED 's|-l\([^ ]\+\)|\1|g; s|-[^l]\([^ ]\+\)||g; s|^ ||; s| *$||g'
125}
126
127strip_L()
128{
129 echo "$1"|$KBUILD_SED 's|-L\([^ ]\+\)|\1|g; s|-[^L]\([^ ]\+\)||g; s|^ ||; s| *$||g'
130}
131
132strip_I()
133{
134 echo "$1"|$KBUILD_SED 's|-I\([^ ]\+\)|\1|g; s|-[^I]\([^ ]\+\)||g; s|^ ||; s| *$||g'
135}
136
137prefix_I()
138{
139 echo "$1"|$KBUILD_SED 's|^\/|-I/|g; s| \/| -I/|g'
140}
141
142# Wrapper for ancient /usr/bin/which on darwin that always returns 0
143which_wrapper()
144{
145 if [ -z "$have_ancient_which" ]; then
146 if which /bin/___cErTaINly_a_nOn_eXisTing_fIle___ 2> /dev/null > /dev/null; then
147 have_ancient_which="yes"
148 else
149 have_ancient_which="no"
150 fi
151 fi
152 if [ "$have_ancient_which" = "yes" ]; then
153 retval=`which $* 2>/dev/null`
154 echo "$retval"
155 test -n "$retval" -a -e "$retval"
156 unset retval
157 else
158 which $* 2> /dev/null
159 fi
160}
161
162check_avail()
163{
164 if [ -z "$1" ]; then
165 log_failure "$2 is empty"
166 fail $3
167 return 1
168 elif which_wrapper $1 > /dev/null; then
169 return 0
170 else
171 log_failure "$1 (variable $2) not found"
172 fail $3
173 return 1
174 fi
175}
176
177# Prepare a test
178test_header()
179{
180 echo "***** Checking $1 *****" >> $LOG
181 echo -n "Checking for $1: "
182}
183
184# Compile a test
185test_compile()
186{
187 echo "compiling the following source file:" >> $LOG
188 cat .tmp_src.cc >> $LOG
189 echo "using the following command line:" >> $LOG
190 echo "$CXX -O -Wall -o .tmp_out .tmp_src.cc \"$1\"" >> $LOG
191 $CXX -O -Wall -o .tmp_out .tmp_src.cc $1 >> $LOG 2>&1
192 if [ $? -ne 0 ]; then
193 if [ -z "$4" ]; then
194 echo
195 echo " $2 not found at $1 or $3 headers not found"
196 echo " Check the file $LOG for detailed error information."
197 fail
198 else
199 echo "not found."
200 echo >> $LOG
201 echo >> $LOG
202 fi
203 return 1
204 fi
205 return 0
206}
207
208# Execute a compiled test binary
209test_execute()
210{
211 echo "executing the binary" >> $LOG
212 ./.tmp_out > .test_execute.log
213 rc=$?
214 cat .test_execute.log | tee -a $LOG
215 if [ $rc -ne 0 ]; then
216 fail $1
217 return 1
218 fi
219 echo >> $LOG
220 echo >> $LOG
221 return 0
222}
223
224#
225# Check for OS, MACHINE, CPU
226#
227check_environment()
228{
229 test_header environment
230 BUILD_CPU=`uname -m`
231 case "$BUILD_CPU" in
232 i[3456789]86|x86|i86pc)
233 BUILD_MACHINE='x86'
234 LIB='lib'
235 ;;
236 x86_64|amd64)
237 BUILD_MACHINE='amd64'
238 BUILD_CPU='k8'
239 # on AMD64 systems, 64bit libs are usually located in /usr/lib64
240 # see http://www.pathname.com/fhs/pub/fhs-2.3.html#LIB64
241 LIB='lib64'
242 ;;
243 *)
244 log_failure "Cannot determine system"
245 exit 1
246 ;;
247 esac
248 [ -z "$TARGET_MACHINE" ] && TARGET_MACHINE=$BUILD_MACHINE
249 [ -z "$TARGET_CPU" ] && TARGET_CPU=$BUILD_CPU
250 OS=`uname -s | sed -e 's/GNU\/Linux/Linux/g' | tr [:upper:] [:lower:]`
251 case "$OS" in
252 linux)
253 ;;
254 darwin)
255 ;;
256 freebsd)
257 ;;
258 sunos)
259 OS='solaris'
260 ;;
261 *)
262 log_failure "Cannot determine OS"
263 exit 1
264 ;;
265 esac
266 DEVDIR_BIN="$DEVDIR/$OS.$BUILD_MACHINE/bin"
267 KBUILDDIR_BIN="$KBUILDDIR/bin/$OS.$BUILD_MACHINE"
268 KBUILD_SED="$KBUILDDIR_BIN/kmk_sed"
269 log_success "Determined build machine: $OS.$BUILD_MACHINE, target machine: $OS.$TARGET_MACHINE"
270
271 # Automatically disable XPCOM on darwin.
272 if [ "$OS" = "darwin" -a $WITH_XPCOM -eq 1 ]; then
273 WITH_XPCOM=0
274 WITH_LIBIDL=0
275 WITH_QT=0
276 echo "Disabling checks for XPCOM related components."
277 fi
278}
279
280#
281# Check for gcc with version >= 3.2.
282# We depend on a working gcc, if we fail terminate in every case.
283#
284check_gcc()
285{
286 test_header gcc
287 if check_avail "$CC" CC really; then
288 cc_ver=`$CC -dumpversion`
289 if check_avail "$CXX" CXX really; then
290 cxx_ver=`$CXX -dumpversion`
291 cc_maj=`echo $cc_ver|cut -d. -f1`
292 cc_min=`echo $cc_ver|cut -d. -f2`
293 if [ "x$cc_ver" != "x$cxx_ver" ]; then
294 log_failure "gcc version $cc_ver does not match g++ version $cxx_ver"
295 fail really
296 elif [ $cc_maj -eq 4 -a $cc_min -eq 0 ]; then
297 if [ "$OS" = "darwin" ]; then
298 log_success "found version $cc_ver"
299 else
300 log_failure "gcc version $cc_ver found, expected gcc 3.x with x>1 or gcc 4.x with x>0"
301 fail really
302 fi
303 elif [ $cc_maj -gt 3 ]; then
304 log_success "found version $cc_ver"
305 elif [ $cc_maj -lt 3 -o $cc_min -lt 2 ]; then
306 log_failure "gcc version $cc_ver found, expected gcc 3.x with x>1 or gcc 4.x with x>0"
307 fail really
308 else
309 log_success "found version $cc_ver"
310 fi
311 if [ "$BUILD_MACHINE" = "amd64" ]; then
312 [ -z "$CC32" ] && CC32="$CC -m32"
313 [ -z "$CXX32" ] && CXX32="$CXX -m32"
314 else
315 [ -z "$CC32" ] && CC32="$CC"
316 [ -z "$CXX32" ] && CXX32="$CXX"
317 fi
318 if [ "$BUILD_MACHINE" = "x86" -a "$TARGET_MACHINE" = "amd64" ]; then
319 [ -z "$CC64" ] && CC64="$CC -m64"
320 [ -z "$CXX64" ] && CXX64="$CXX -m64"
321 fi
322 if [ "$CC" != "gcc" ]; then
323 cnf_append "TOOL_GCC3_CC" "$CC"
324 cnf_append "TOOL_GCC3_AS" "$CC"
325 cnf_append "TOOL_GCC3_LD" "$CC"
326 cnf_append "TOOL_GXX3_CC" "$CC"
327 cnf_append "TOOL_GXX3_AS" "$CC"
328 fi
329 if [ "$CXX" != "g++" ]; then
330 cnf_append "TOOL_GCC3_CXX" "$CXX"
331 cnf_append "TOOL_GXX3_CXX" "$CXX"
332 cnf_append "TOOL_GXX3_LD" "$CXX"
333 fi
334 if [ "$CC32" != "gcc -m32" ]; then
335 cnf_append "TOOL_GCC32_CC" "$CC32"
336 cnf_append "TOOL_GCC32_AS" "$CC32"
337 cnf_append "TOOL_GCC32_LD" "$CC32"
338 cnf_append "TOOL_GXX32_CC" "$CC32"
339 cnf_append "TOOL_GXX32_AS" "$CC32"
340 fi
341 if [ "$CXX32" != "g++ -m32" ]; then
342 cnf_append "TOOL_GCC32_CXX" "$CXX32"
343 cnf_append "TOOL_GXX32_CXX" "$CXX32"
344 cnf_append "TOOL_GXX32_LD" "$CXX32"
345 fi
346 if [ -n "$CC64" ]; then
347 cnf_append "TOOL_GCC64_CC" "$CC64"
348 cnf_append "TOOL_GCC64_AS" "$CC64"
349 cnf_append "TOOL_GCC64_LD" "$CC64"
350 cnf_append "TOOL_GXX64_CC" "$CC64"
351 cnf_append "TOOL_GXX64_AS" "$CC64"
352 fi
353 if [ -n "$CXX64" ]; then
354 cnf_append "TOOL_GCC64_CXX" "$CXX64"
355 cnf_append "TOOL_GXX64_CXX" "$CXX64"
356 cnf_append "TOOL_GXX64_LD" "$CXX64"
357 fi
358 fi
359 fi
360}
361
362#
363# Check for the bcc compiler, needed for compiling the BIOS
364#
365check_bcc()
366{
367 test_header bcc
368 if check_avail "$BCC" BCC; then
369 bcc_ver=`$BCC -v 2>&1|grep version|sed 's+^bcc: version \(.*\)+\1+'`
370 if [ $? -ne 0 ]; then
371 log_failure "not found"
372 fail
373 else
374 echo "compiling the following source file:" >> $LOG
375 cat > .tmp_src.c << EOF
376int foo(a)
377 int a;
378{
379 return 0;
380}
381EOF
382 cat .tmp_src.c >> $LOG
383 bcc_path=`which_wrapper $BCC`
384 bcc_dir="`dirname $bcc_path`/"
385 echo "using the following command line:" >> $LOG
386 echo "$BCC -B $bcc_dir -C-c -3 -S -o .tmp_out .tmp_src.c" >> $LOG
387 $BCC -B $bcc_dir -C-c -3 -S -o .tmp_out .tmp_src.c >> $LOG 2>&1
388 if [ $? -ne 0 ]; then
389 log_failure "not found"
390 fail
391 else
392 log_success "found version $bcc_ver"
393 cnf_append "VBOX_BCC" "$bcc_path -B $bcc_dir"
394 fi
395 unset bcc_path
396 unset bcc_dir
397 fi
398 fi
399}
400
401#
402# Check for the as86 assembler, needed for compiling the BIOS
403#
404check_as86()
405{
406 test_header as86
407 if check_avail "$AS86" AS86; then
408 as86_ver=`$AS86 -v 2>&1|grep version|sed 's+^as86 version: \(.*\)+\1+'`
409 if [ $? -ne 0 ]; then
410 log_failure "not found"
411 fail
412 else
413 log_success "found version $as86_ver"
414 cnf_append "VBOX_AS86" "`which_wrapper $AS86`"
415 fi
416 fi
417}
418
419#
420# Check for yasm, needed to compile assembler files
421#
422check_yasm()
423{
424 test_header yasm
425 if check_avail "$YASM" YASM; then
426 yasm_ver=`$YASM --version|grep "^yasm"|sed 's+^yasm \(.*\)+\1+'`
427 if [ $? -ne 0 ]; then
428 log_failure "not found"
429 fail
430 else
431 yasm_maj=`echo $yasm_ver|cut -d. -f1`
432 yasm_min=`echo $yasm_ver|cut -d. -f2`
433 yasm_rev=`echo $yasm_ver|cut -d. -f3`
434 yasm_ver_mul=`expr $yasm_maj \* 10000 + $yasm_min \* 100 + $yasm_rev`
435 if [ $yasm_ver_mul -lt 501 ]; then
436 log_failure "found version $yasm_ver, expected at least 0.5.1"
437 fail
438 else
439 log_success "found version $yasm_ver"
440 fi
441 fi
442 fi
443}
444
445#
446# Check for the iasl ACPI compiler, needed to compile vbox.dsl
447#
448check_iasl()
449{
450 test_header iasl
451 if check_avail "$IASL" IASL; then
452 iasl_ver=`$IASL|grep version|sed 's+^ASL.*version \([0-9]*\).*+\1+'`
453 if [ $? -ne 0 ]; then
454 log_failure "not found"
455 fail
456 else
457 log_success "found version $iasl_ver"
458 cnf_append "VBOX_IASLCMD" "`which_wrapper $IASL`"
459 fi
460 fi
461}
462
463#
464# Check for xsltproc, needed by Main
465#
466check_xsltproc()
467{
468 test_header xslt
469 if check_avail "$XSLTPROC" XSLTPROC; then
470 xsltproc_ver=`$XSLTPROC --version`
471 if [ $? -ne 0 ]; then
472 log_failure "not found"
473 fail
474 else
475 log_success "found"
476 cnf_append "VBOX_XSLTPROC" "`which_wrapper $XSLTPROC`"
477 fi
478 fi
479}
480
481#
482# Check for mkisofs, needed to build the CDROM image containing the additions
483#
484check_mkisofs()
485{
486 test_header mkisofs
487 if which_wrapper $GENISOIMAGE > /dev/null; then
488 mkisofs_ver=`$GENISOIMAGE --version`
489 if [ $? -ne 0 ]; then
490 log_failure "not found"
491 fail
492 else
493 log_success "found $mkisofs_ver"
494 cnf_append "VBOX_MKISOFS" "`which_wrapper $GENISOIMAGE`"
495 fi
496 elif check_avail "$MKISOFS" MKISOFS; then
497 mkisofs_ver=`$MKISOFS --version`
498 if [ $? -ne 0 ]; then
499 log_failure "not found"
500 fail
501 else
502 log_success "found $mkisofs_ver"
503 cnf_append "VBOX_MKISOFS" "`which_wrapper $MKISOFS`"
504 fi
505 fi
506}
507
508#
509# Check for xalan, needed by VBoxXML
510#
511check_xalan()
512{
513 if [ -n "$LIBXALAN" ]; then
514 test_header xalan
515 cat > .tmp_src.cc << EOF
516#include <cstdio>
517#include <xalanc/Include/XalanVersion.hpp>
518extern "C" int main(void)
519{
520 printf("found version %d.%d.%d",
521 XALAN_VERSION_MAJOR, XALAN_VERSION_MINOR, XALAN_VERSION_REVISION);
522#if _XALAN_VERSION >= 10800
523 printf(", OK.\n");
524 return 0;
525#else
526 printf(", expected version 1.8.0 or higher\n");
527 return 1;
528#endif
529}
530EOF
531 [ -n "$INCXALAN" ] && I_INCXALAN=`prefix_I "$INCXALAN"`
532 if test_compile "$LIBXALAN $LIBPTHREAD $I_INCXALAN" xalan xalanc; then
533 if test_execute; then
534 cnf_append "SDK_VBOX_XALAN_LIBS" "`strip_l "$LIBXALAN"`"
535 cnf_append "SDK_VBOX_XALAN_LIBPATH" "`strip_L "$LIBXALAN"`"
536 cnf_append "SDK_VBOX_XALAN_INCS" "$INCXALAN"
537 fi
538 fi
539 else
540 echo "Building xalan from shipped sources."
541 echo "Building xalan from shipped sources." >> $LOG
542 echo >> $LOG
543 echo >> $LOG
544 fi
545}
546
547#
548# Check for xerces, needed by VBoxXML
549#
550check_xerces()
551{
552 if [ -n "$LIBXERCES" ]; then
553 test_header xerces
554 cat > .tmp_src.cc << EOF
555#include <cstdio>
556#include <xercesc/util/XercesVersion.hpp>
557extern "C" int main(void)
558{
559 printf("found version %d.%d.%d",
560 XERCES_VERSION_MAJOR, XERCES_VERSION_MINOR, XERCES_VERSION_REVISION);
561#if _XERCES_VERSION >= 20500
562 printf(", OK.\n");
563 return 0;
564#else
565 printf(", expected version 2.5.0 or higher");
566 return 1;
567#endif
568}
569EOF
570 [ -n "$INCXERCES" ] && I_INCXERCES=`prefix_I "$INCXERCES"`
571 if test_compile "$LIBXERCES $LIBPTHREAD $I_INCXERCES" xerces xercesc; then
572 if test_execute; then
573 cnf_append "SDK_VBOX_XERCES_LIBS" "`strip_l "$LIBXERCES"`"
574 cnf_append "SDK_VBOX_XERCES_LIBPATH" "`strip_L "$LIBXERCES"`"
575 cnf_append "SDK_VBOX_XERCES_INCS" "$INCXERCES"
576 fi
577 fi
578 else
579 echo "Building xerces from shipped sources."
580 echo "Building xerces from shipped sources." >> $LOG
581 echo >> $LOG
582 echo >> $LOG
583 fi
584}
585
586#
587# Check for libIDL, needed by xpcom
588#
589check_libidl()
590{
591 test_header libIDL
592
593 if which_wrapper libIDL-config-2 > /dev/null; then
594 libidl_ver=`libIDL-config-2 --version`
595 if [ $? -ne 0 ]; then
596 log_failure "not found"
597 fail
598 else
599 log_success "found version $libidl_ver"
600 cnf_append "VBOX_LIBIDL_CONFIG" \
601 "PKG_CONFIG_PATH=`libIDL-config-2 --prefix`/$LIB/pkgconfig `which_wrapper libIDL-config-2`"
602 fi
603 elif check_avail "libIDL-config" libIDL-config; then
604 libidl_ver=`libIDL-config --version`
605 if [ $? -ne 0 ]; then
606 log_failure "not found"
607 fail
608 else
609 log_success "found version $libidl_ver"
610 cnf_append "VBOX_LIBIDL_CONFIG" "`which_wrapper libIDL-config`"
611 fi
612 fi
613}
614
615#
616# Check for openssl, needed for RDP
617#
618check_ssl()
619{
620 test_header ssl
621 cat > .tmp_src.cc << EOF
622#include <cstdio>
623#include <openssl/opensslv.h>
624extern "C" int main(void)
625{
626 printf("found version %s", OPENSSL_VERSION_TEXT);
627#if OPENSSL_VERSION_NUMBER >= 0x0090700
628 printf(", OK.\n");
629 return 0;
630#else
631 printf(", expected version 0.9.7 or higher\n");
632 return 1;
633#endif
634}
635EOF
636 if test_compile $LIBCRYPTO libcrypto openssl; then
637 if test_execute nofatal; then
638 cnf_append "SDK_VBOX_OPENSSL_INCS" ""
639 cnf_append "SDK_VBOX_OPENSSL_LIBS" "`strip_l "$LIBCRYPTO"`"
640 fi
641 fi
642}
643
644#
645# Check for pthread, needed by VBoxSVC, frontends, ...
646#
647check_pthread()
648{
649 test_header pthread
650 cat > .tmp_src.cc << EOF
651#include <cstdio>
652#include <pthread.h>
653extern "C" int main(void)
654{
655 pthread_mutex_t mutex;
656 if (pthread_mutex_init(&mutex, NULL)) {
657 printf("pthread_mutex_init() failed\n");
658 return 1;
659 }
660 if (pthread_mutex_lock(&mutex)) {
661 printf("pthread_mutex_lock() failed\n");
662 return 1;
663 }
664 if (pthread_mutex_unlock(&mutex)) {
665 printf("pthread_mutex_unlock() failed\n");
666 return 1;
667 }
668 printf("found, OK.\n");
669}
670EOF
671 if test_compile $LIBPTHREAD pthread pthread; then
672 if test_execute; then
673 cnf_append "LIB_PTHREAD" "`strip_l "$LIBPTHREAD"`"
674 fi
675 fi
676}
677
678#
679# Check for zlib, needed by VBoxSVC, Runtime, ...
680#
681check_z()
682{
683 test_header zlib
684 cat > .tmp_src.cc << EOF
685#include <cstdio>
686#include <zlib.h>
687extern "C" int main(void)
688{
689 printf("found version %s", ZLIB_VERSION);
690#if ZLIB_VERNUM >= 0x1210
691 printf(", OK.\n");
692 return 0;
693#else
694 printf(", expected version 1.2.1 or higher\n");
695 return 1;
696#endif
697}
698EOF
699 [ -n "$INCZ" ] && I_INCZ=`prefix_I "$INCZ"`
700 if test_compile "$LIBZ $I_INCZ" zlib zlib; then
701 if test_execute; then
702 cnf_append "SDK_VBOX_ZLIB_LIBS" "`strip_l "$LIBZ"`"
703 cnf_append "SDK_VBOX_ZLIB_INCS" "$INCZ"
704 fi
705 fi
706}
707
708#
709# Check for libpng, needed by kchmviewer
710#
711check_png()
712{
713 test_header libpng
714 cat > .tmp_src.cc << EOF
715#include <cstdio>
716#include <png.h>
717extern "C" int main(void)
718{
719 printf("found version %s", PNG_LIBPNG_VER_STRING);
720#if PNG_LIBPNG_VER >= 10205
721 printf(", OK.\n");
722 return 0;
723#else
724 printf(", expected version 1.2.5 or higher\n");
725 return 1;
726#endif
727}
728EOF
729 [ -n "$INCPNG" ] && I_INCPNG=`prefix_I "$INCPNG"`
730# if test_compile "$LIBPNG $I_INCPNG" libpng libpng nofatal; then
731 if test_compile "$LIBPNG $I_INCPNG" libpng libpng; then
732# if test_execute nofatal; then
733 if test_execute; then
734 cnf_append "SDK_VBOX_LIBPNG_LIBS" "`strip_l "$LIBPNG"`"
735 cnf_append "SDK_VBOX_LIBPNG_INCS" "$INCPNG"
736 fi
737 fi
738}
739
740#
741# Check for pam, needed by VRDPAuth
742# Version 79 was introduced in 9/2005, do we support older versions?
743# Debian/sarge uses 76
744# OpenSUSE comes with 0.99.xxx where they changed the versioning scheme.
745#
746check_pam()
747{
748 test_header pam
749 cat > .tmp_src.cc << EOF
750#include <cstdio>
751#include <security/pam_appl.h>
752extern "C" int main(void)
753{
754 printf("found version %d", __LIBPAM_VERSION);
755 if (__LIBPAM_VERSION >= 76)
756 {
757 printf(", OK.\n");
758 return 0;
759 }
760 else
761 {
762 printf(", expected version 76 or higher\n");
763 return 1;
764 }
765}
766EOF
767 if test_compile "-lpam" pam pam nofatal; then
768 if test_execute nofatal; then
769 return 0;
770 fi
771 fi
772 test_header linux_pam
773 cat > .tmp_src.cc << EOF
774#include <cstdio>
775#include <security/pam_appl.h>
776extern "C" int main(void)
777{
778 printf("found version %d.%d", __LINUX_PAM__, __LINUX_PAM_MINOR__);
779 if (__LINUX_PAM__ >= 1)
780 {
781 printf(", OK.\n");
782 return 0;
783 }
784 else
785 {
786 printf(", expected version 1.0 or higher\n");
787 return 1;
788 }
789}
790EOF
791 if test_compile "-lpam" pam pam; then
792 test_execute
793 fi
794}
795
796
797#
798# Check for the SDL library, needed by VBoxSDL and VirtualBox
799# We depend at least on version 1.2.7
800#
801check_sdl()
802{
803 test_header SDL
804 if which_wrapper sdl-config > /dev/null; then
805 FLGSDL=`sdl-config --cflags`
806 INCSDL=`strip_I "$FLGSDL"`
807 LIBSDL=`sdl-config --libs`
808 LIBSDLMAIN="-lSDLmain"
809 cat > .tmp_src.cc << EOF
810#include <cstdio>
811#include <SDL/SDL.h>
812#include <SDL/SDL_main.h>
813extern "C" int main(void)
814{
815 printf("found version %d.%d.%d",
816 SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
817#if SDL_VERSION_ATLEAST(1,2,7)
818 printf(", OK.\n");
819 return 0;
820#else
821 printf(", expected version 1.2.7 or higher\n");
822 return 1;
823#endif
824}
825EOF
826 [ -n "$INCSDL" ] && I_INCSDL=`prefix_I "$INCSDL"`
827 if test_compile "$LIBSDL $LIBSDLMAIN $I_INCSDL" SDL SDL; then
828 if test_execute; then
829 cnf_append "LIB_SDK_LIBSDL_SDL" "`strip_l "$LIBSDL"`"
830 cnf_append "SDK_LIBSDL_LIBPATH" "`strip_L "$LIBSDL"`"
831 cnf_append "LIB_SDK_LIBSDL_SDLMAIN" "`strip_l "$LIBSDLMAIN"`"
832 [ -n "$INCSDL" ] && cnf_append "SDK_LIBSDL_INCS" "$INCSDL"
833 fi
834 fi
835 else
836 log_failure "not found"
837 fi
838}
839
840#
841# Check for the SDL_ttf library, needed by VBoxSDL (secure label)
842#
843check_sdl_ttf()
844{
845 test_header SDL_ttf
846 cat > .tmp_src.cc << EOF
847#include <cstdio>
848#include <SDL/SDL_ttf.h>
849#ifndef SDL_TTF_MAJOR_VERSION
850#define SDL_TTF_MAJOR_VERSION TTF_MAJOR_VERSION
851#define SDL_TTF_MINOR_VERSION TTF_MINOR_VERSION
852#define SDL_TTF_PATCHLEVEL TTF_PATCHLEVEL
853#endif
854extern "C" int main(void)
855{
856 printf("found version %d.%d.%d",
857 SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL);
858#if 10000*SDL_TTF_MAJOR_VERSION + 100*SDL_TTF_MINOR_VERSION + SDL_TTF_PATCHLEVEL >= 20006
859 printf(", OK.\n");
860 return 0;
861#else
862 printf(", expected version 2.0.6 or higher\n");
863 return 1;
864#endif
865}
866EOF
867 if test_compile "-lSDL_ttf" SDL_ttf SDL_ttf; then
868 test_execute
869 fi
870}
871
872#
873# Check for libasound, needed by the ALSA audio backend
874#
875check_alsa()
876{
877 test_header ALSA
878 cat > .tmp_src.cc << EOF
879#include <alsa/asoundlib.h>
880extern "C" int main(void)
881{
882 printf("found version %d.%d.%d",
883 SND_LIB_MAJOR, SND_LIB_MINOR, SND_LIB_SUBMINOR);
884#if 10000*SND_LIB_MAJOR + 100*SND_LIB_MINOR + SND_LIB_SUBMINOR >= 10006
885 printf(", OK.\n");
886 return 0;
887#else
888 printf(", expected version 1.0.6 or higher\n");
889 return 1;
890#endif
891}
892EOF
893 if test_compile "-lasound" asound asound; then
894 test_execute
895 fi
896}
897
898#
899# Check for the Xcursor library, needed by VBoxSDL and VBoxBFE
900#
901check_xcursor()
902{
903 test_header Xcursor
904 cat > .tmp_src.cc << EOF
905#include <cstdio>
906#include <X11/Xlib.h>
907#include <X11/Xcursor/Xcursor.h>
908extern "C" int main(void)
909{
910 XcursorImage *cursor = XcursorImageCreate (10, 10);
911 XcursorImageDestroy(cursor);
912 return 0;
913}
914EOF
915 [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
916 if test_compile "$LIBX11 $LIBXCURSOR $I_INCX11" Xcursor Xcursor; then
917 log_success "found"
918 cnf_append "LIB_XCURSOR" "`strip_l "$LIBXCURSOR"`"
919 fi
920}
921
922#
923# Check for the X libraries (Xext, X11)
924#
925check_x()
926{
927 test_header "X libraries"
928 cat > .tmp_src.cc << EOF
929#include <cstdio>
930#include <X11/Xlib.h>
931extern "C" int main(void)
932{
933 Display *dpy;
934 int scrn_num;
935 Screen *scrn;
936 Window win;
937
938 dpy = XOpenDisplay(NULL);
939 scrn_num = DefaultScreen(dpy);
940 scrn = ScreenOfDisplay(dpy, scrn_num);
941 win = XCreateWindow(dpy, RootWindowOfScreen(scrn), 0, 0, 100, 100,
942 0, 16, InputOutput, CopyFromParent, 0, NULL);
943 XDestroyWindow(dpy, win);
944}
945EOF
946 [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
947 if test_compile "$LIBX11 $I_INCX11" Xlibs Xlibs; then
948 log_success "found"
949 fi
950}
951
952#
953# Check for the QT library, needed by VirtualBox
954#
955check_qt()
956{
957 test_header Qt
958 cat > .tmp_src.cc << EOF
959#include <cstdio>
960#include <qglobal.h>
961extern "C" int main(void)
962{
963 printf("found version %s", QT_VERSION_STR);
964#if QT_VERSION >= 0x030305
965 printf(", OK.\n");
966 return 0;
967#elif QT_VERSION >= 0x030300
968 printf("\n ** WARNING: QT < 3.3.5 has known problems!\n");
969#else
970 printf(", expected version 3.3.0 or higher\n");
971 return 1;
972#endif
973}
974EOF
975 found_qt=0
976 libs="lib"
977 [ "$LIB" = "lib64" ] && libs="$libs lib64"
978 for q in $QTDIR; do
979 for l in $libs; do
980 echo "compiling the following source file:" >> $LOG
981 cat .tmp_src.cc >> $LOG
982 echo "using the following command line:" >> $LOG
983 echo "$CXX -O -Wall -o .tmp_out .tmp_src.cc -I$q/include -L$q/$l -lqt-mt $LIBPTHREAD" >> $LOG
984 $CXX -O -Wall -o .tmp_out .tmp_src.cc -I$q/include -L$q/$l -lqt-mt $LIBPTHREAD >> $LOG 2>&1
985 if [ $? -eq 0 ]; then
986 if test_execute; then
987 cnf_append "QTDIR" "`cd $q ; pwd`"
988 found_qt=1
989 break
990 fi
991 fi
992 done
993 if [ $found_qt -eq 1 ]; then
994 break
995 fi
996 done
997 if [ $found_qt -ne 1 ]; then
998 echo
999 echo " Qt not found at \"$QTDIR\" or Qt headers not found"
1000 echo " Check the file $LOG for detailed error information."
1001 fail
1002 return 1
1003 fi
1004 test_header "Qt devtools"
1005 if check_avail "$q/bin/moc" QTDIR/bin; then
1006 moc_ver=`$q/bin/moc 2>&1 -v|sed 's+^.*(Qt \(.*\))+\1+'`
1007 if [ $? -ne 0 ]; then
1008 log_failure "not found"
1009 fail
1010 else
1011 log_success "found version $moc_ver"
1012 fi
1013 fi
1014}
1015
1016#
1017# Check for Linux sources
1018#
1019check_linux()
1020{
1021 test_header "Linux kernel sources"
1022 cat > .tmp_src.c << EOF
1023#include <linux/version.h>
1024int printf(const char *format, ...);
1025int main(void)
1026{
1027 printf("found version %d.%d.%d", LINUX_VERSION_CODE / 65536,
1028 (LINUX_VERSION_CODE % 65536) / 256,
1029 LINUX_VERSION_CODE % 256);
1030#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,0)
1031 printf(", OK.\n");
1032 return 0;
1033#else
1034 printf(", expected version 2.4.0 or higher\n");
1035 return 1;
1036#endif
1037}
1038EOF
1039 echo "compiling the following source file:" >> $LOG
1040 cat .tmp_src.c >> $LOG
1041 echo "using the following command line:" >> $LOG
1042 echo "$CC -O -Wall -o .tmp_out .tmp_src.c -nostdinc -I$LINUX/include" >> $LOG
1043 $CC -O -Wall -o .tmp_out .tmp_src.c -nostdinc -I$LINUX/include >> $LOG 2>&1
1044 if [ $? -ne 0 ]; then
1045 echo
1046 echo " Linux kernel headers not found at $LINUX"
1047 echo " Check the file $LOG for detailed error information."
1048 fail
1049 else
1050 if test_execute; then
1051 cnf_append "VBOX_LINUX_SRC" "`cd $LINUX ; pwd`"
1052 fi
1053 fi
1054}
1055
1056#
1057# Check for kchmviewer, needed to display the online help
1058#
1059check_kchmviewer()
1060{
1061 test_header kchmviewer
1062 if check_avail "$KCHMVIEWER" KCHMVIEWER; then
1063 kchmviewer_ver=`$KCHMVIEWER --version|grep "^KchmViewer:"|sed 's+^KchmViewer: \(.*\)+\1+'`
1064 if [ $? -ne 0 ]; then
1065 log_failure "not found"
1066 fail
1067 else
1068 log_success "found version $kchmviewer_ver"
1069 fi
1070 fi
1071}
1072
1073#
1074# Check for the kBuild tools, we don't support GNU make
1075#
1076check_kbuild()
1077{
1078 test_header kBuild
1079 if check_avail "$KBUILDDIR_BIN/kmk" KBUILDDIR really; then
1080 log_success "found"
1081 echo "export BUILD_PLATFORM=\"$OS\"" >> $ENV
1082 echo "export BUILD_PLATFORM_ARCH=\"$BUILD_MACHINE\"" >> $ENV
1083 echo "export BUILD_TARGET=\"$OS\"" >> $ENV
1084 echo "export BUILD_TARGET_ARCH=\"$TARGET_MACHINE\"" >> $ENV
1085 echo "export BUILD_TARGET_CPU=\"$TARGET_CPU\"" >> $ENV
1086 echo "export BUILD_TYPE=\"$BUILD_TYPE\"" >> $ENV
1087 echo "export PATH_KBUILD=\"`cd $KBUILDDIR ; pwd`\"" >> $ENV
1088 echo "export PATH_DEVTOOLS=\"$DEVDIR\"" >> $ENV
1089 echo "path_kbuild_bin=\"\$PATH_KBUILD/bin/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"" >> $ENV
1090 echo "export PATH_KBUILD_BIN=\"\$path_kbuild_bin\"" >> $ENV
1091 echo "path_dev_bin=\"\$PATH_DEVTOOLS/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"/bin" >> $ENV
1092 if [ "$OS" = "solaris" ]; then
1093 # Because of sh being non-default shell in Solaris we need to export PATH again when
1094 # sourcing env.sh. Simply exporting from ./configure does not export PATH correctly.
1095 echo "PATH=\"$PATH\"" >> $ENV
1096 echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
1097 echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
1098 else
1099 echo "echo \"\$PATH\" | grep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
1100 echo "echo \"\$PATH\" | grep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
1101 fi
1102 echo "export PATH" >> $ENV
1103 echo "unset path_kbuild_bin path_dev_bin" >> $ENV
1104 fi
1105}
1106
1107
1108#
1109# Check for compiler.h
1110# Some Linux distributions include "compiler.h" in their libc linux
1111# headers package, some don't. Most don't need it, building might (!)
1112# not succeed on openSUSE without it.
1113#
1114# See http://www.mail-archive.com/qemu-devel%40nongnu.org/msg07980.html
1115#
1116check_compiler_h()
1117{
1118 test_header compiler.h
1119 if ! test -f "/usr/include/linux/compiler.h"; then
1120 cnf_append "VBOX_WITHOUT_LINUX_COMPILER_H" "1"
1121 log_success "compiler.h not found"
1122 else
1123 log_success "compiler.h found"
1124 fi
1125}
1126
1127
1128#
1129# Check if we are able to build 32-bit applications (needed for the guest additions)
1130#
1131check_32bit()
1132{
1133 test_header "32-bit support"
1134 cat > .tmp_src.c << EOF
1135#include <stdint.h>
1136int main(void)
1137{
1138 return 0;
1139}
1140EOF
1141 echo "compiling the following source file:" >> $LOG
1142 cat .tmp_src.c >> $LOG
1143 echo "using the following command line:" >> $LOG
1144 echo "$CC -m32 -O -Wall -o .tmp_out .tmp_src.c" >> $LOG
1145 $CC -m32 -O -Wall -o .tmp_out .tmp_src.c >> $LOG 2>&1
1146 if [ $? -ne 0 ]; then
1147 echo
1148 echo " Cannot compile 32-bit applications (missing headers and/or libraries)!"
1149 echo " Check the file $LOG for detailed error information."
1150 fail
1151 fi
1152 log_success ""
1153}
1154
1155#
1156# Setup wine
1157#
1158setup_wine()
1159{
1160 test_header "wine support"
1161 if ! which_wrapper wine > /dev/null; then
1162 echo " wine not found"
1163 fail
1164 fi
1165 if ! which_wrapper wineprefixcreate > /dev/null; then
1166 echo " wineprefixcreate not found"
1167 fail
1168 fi
1169 export WINEPREFIX="${ODIR}wine.$BUILD_MACHINE"
1170 echo "export WINEPREFIX=\"${ODIR}wine.$BUILD_MACHINE\"" >> $ENV
1171 rm -rf $WINEPREFIX
1172 mkdir -p $WINEPREFIX
1173 touch $WINEPREFIX/.no_prelaunch_window_flag
1174 if ! wineprefixcreate -q > /dev/null 2>&1; then
1175 echo " wineprefixcreate failed"
1176 fail
1177 fi
1178 tmp=.tmp.wine.reg
1179 rm -f $tmp
1180 echo 'REGEDIT4' > $tmp
1181 echo '' >> $tmp
1182 echo '[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment]' >> $tmp
1183 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
1184 echo '' >> $tmp
1185 echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhc.exe\DllOverrides]' >> $tmp
1186 echo '"itss"="native"' >> $tmp
1187 echo '' >> $tmp
1188 echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhw.exe\DllOverrides]' >> $tmp
1189 echo '"itss"="native"' >> $tmp
1190 echo '' >> $tmp
1191 if ! wine regedit $tmp > /dev/null 2>&1; then
1192 rm -f $tmp
1193 echo " failed to load registry changes (path)."
1194 fail
1195 fi
1196 rm -f $tmp
1197 log_success ""
1198}
1199
1200
1201#
1202# Show help
1203#
1204show_help()
1205{
1206 cat << EOF
1207Usage: ./configure [OPTIONS]...
1208
1209Configuration:
1210 -h, --help display this help and exit
1211 --nofatal don't abort on errors
1212 --disable-xpcom disable XPCOM and related stuff
1213 --disable-sdl-ttf disable SDL_ttf detection
1214 --build-xalan build xalan & xerces from shipped sources
1215 --setup-wine setup a Wine directory and register the hhc hack
1216
1217Paths:
1218 --with-gcc=PATH location of the gcc compiler [$CC]
1219 --with-g++=PATH location of the g++ compiler [$CXX]
1220 --with-kbuild=DIR kbuild directory [$KBUILDDIR]
1221 --with-iasl=PATH location of the iasl compiler [$IASL]
1222 --with-linux=DIR Linux kernel source directory [$LINUX]
1223 --with-mkisofs=PATH location of mkisofs [$MKISOFS]
1224 --with-qt-dir=DIR directory for QT headers/libraries [$QTDIR]
1225 --with-xalan=LIB location of the xalan library [$LIBXALAN]
1226 --with-xalan-incdir=DIR location of the xalan headers [/usr/include /usr/local/include]
1227 --with-xalan-libdir=DIR location of the xalan library [/usr/lib /usr/local/lib]
1228 --with-xerces=LIB location of the xerces library [$LIBXERCES]
1229 --with-xerces-incdir=DIR location of the xerces headers [/usr/include /usr/local/include]
1230 --with-xerces-libdir=DIR location of the xerces library [/usr/lib /usr/local/lib]
1231
1232Build type:
1233 -d, --build-debug build with debugging symbols and assertions
1234 --build-headless build headless (without any X11 frontend)
1235EOF
1236 exit 0
1237}
1238
1239
1240#
1241# The body.
1242#
1243
1244# scan command line options
1245for option in $*; do
1246 case "$option" in
1247 --help|-help|-h)
1248 show_help
1249 ;;
1250 --nofatal)
1251 nofatal=1
1252 ;;
1253 --with-gcc=*)
1254 CC=`echo $option | cut -d'=' -f2`
1255 ;;
1256 --with-g++=*)
1257 CXX=`echo $option | cut -d'=' -f2`
1258 ;;
1259 --with-kbuild=*)
1260 KBUILDDIR=`echo $option | cut -d'=' -f2`
1261 if echo $KBUILDDIR|grep -q "$INVALID_CHARS"; then
1262 echo "Error: KBUILDDIR contains invalid characters!"
1263 exit 1
1264 fi
1265 ;;
1266 --with-qt-dir=*)
1267 QTDIR=`echo $option | cut -d'=' -f2`
1268 ;;
1269 --with-iasl=*)
1270 IASL=`echo $option | cut -d'=' -f2`
1271 ;;
1272 --with-linux=*)
1273 LINUX=`echo $option | cut -d'=' -f2`
1274 ;;
1275 --with-mkisofs=*)
1276 MKISOFS=`echo $option | cut -d'=' -f2`
1277 ;;
1278 --with-xalan=*)
1279 LIBXALAN=`echo $option | cut -d'=' -f2`
1280 ;;
1281 --with-xalan-libdir=*)
1282 LIBXALAN_DIR=`echo $option | cut -d'=' -f2`
1283 ;;
1284 --with-xalan-incdir=*)
1285 INCXALAN=`echo $option | cut -d'=' -f2`
1286 ;;
1287 --with-xerces=*)
1288 LIBXERCES=`echo $option | cut -d'=' -f2`
1289 ;;
1290 --with-xerces-libdir=*)
1291 LIBXERCES_DIR=`echo $option | cut -d'=' -f2`
1292 ;;
1293 --with-xerces-incdir=*)
1294 INCXERCES=`echo $option | cut -d'=' -f2`
1295 ;;
1296 --disable-xpcom)
1297 WITH_XPCOM=0
1298 ;;
1299 --disable-sdl-ttf)
1300 WITH_SDL_TTF=0
1301 ;;
1302 --disable-qt)
1303 WITH_QT=0
1304 ;;
1305 --build-debug|-d)
1306 BUILD_TYPE=debug
1307 ;;
1308 --build-xalan)
1309 LIBXERCES=
1310 LIBXERCES_DIR=
1311 LIBXALAN=
1312 LIBXALAN_DIR=
1313 ;;
1314 --build-headless)
1315 HEADLESS=1
1316 ;;
1317 --ose)
1318 OSE=2
1319 ;;
1320 --odir=*)
1321 ODIR="`echo $option | cut -d'=' -f2`/"
1322 ;;
1323 --setup-wine)
1324 SETUP_WINE=1
1325 ;;
1326 *)
1327 echo
1328 echo "Unrecognized option \"$option\""
1329 echo
1330 show_help
1331 ;;
1332 esac
1333done
1334
1335[ -n "$LIBXALAN_DIR" ] && LIBXALAN="-L$LIBXALAN_DIR $LIBXALAN"
1336[ -n "$LIBXERCES_DIR" ] && LIBXERCES="-L$LIBXERCES_DIR $LIBXERCES"
1337
1338LOG="$ODIR$LOG"
1339ENV="$ODIR$ENV"
1340CNF="$ODIR$CNF"
1341
1342# initialize output files
1343cat > $LOG << EOF
1344# Log file generated by
1345#
1346# '$0 $*'
1347#
1348
1349EOF
1350cat > $CNF << EOF
1351# -*- Makefile -*-
1352#
1353# automatically generated by
1354#
1355# '$0 $*'
1356#
1357# It will be completely overwritten if configure is executed again.
1358#
1359
1360EOF
1361cat > $ENV << EOF
1362#!/bin/bash
1363#
1364# automatically generated by
1365#
1366# '$0 $*'
1367#
1368# It will be completely overwritten if configure is executed again.
1369# Make sure you source this file once before you start to build VBox.
1370#
1371
1372EOF
1373
1374# test if we are OSE
1375if [ $OSE -eq 1 -a -d "`cd \`dirname $0\`; pwd`/src/VBox/Devices/USB" ]; then
1376 echo "Found USB devices, assuming VBOX_OSE = FALSE" >> $LOG
1377 echo >> $LOG
1378 OSE=0
1379fi
1380
1381if [ "$BUILD_TYPE" = "debug" ]; then
1382 echo "Creating DEBUG build!" >> $LOG
1383fi
1384
1385# first determine our environment
1386check_environment
1387check_kbuild
1388
1389# append the tools directory to the default search path
1390echo "$PATH" | grep -q "$DEVDIR_BIN" || PATH="$PATH:$DEVDIR_BIN"
1391export PATH
1392
1393# some things are not available in for OSE
1394if [ $OSE -ge 1 ]; then
1395 cnf_append "VBOX_OSE" "1"
1396 cnf_append "VBOX_WITH_TESTSUITE" ""
1397 cnf_append "VBOX_WITH_WIN32_ADDITIONS" ""
1398
1399 if [ "$OS" = "linux" ]; then
1400 cnf_append "VBOX_WITH_LINUX_ADDITIONS" "1"
1401 else
1402 cnf_append "VBOX_WITH_LINUX_ADDITIONS" ""
1403 fi
1404 echo >> $CNF
1405fi
1406
1407# headless
1408if [ -n "$HEADLESS" ]; then
1409 cnf_append "VBOX_HEADLESS" "1"
1410fi
1411
1412# emit disable directives corresponding to any --disable-xxx options.
1413[ $WITH_XPCOM -eq 0 ] && cnf_append "VBOX_WITH_MAIN" ""
1414[ $WITH_QT -eq 0 ] && cnf_append "VBOX_WITH_QTGUI" ""
1415[ $WITH_SDL_TTF -eq 0 ] && cnf_append "VBOX_WITH_SECURELABEL" ""
1416
1417# the tools
1418check_gcc
1419[ "$OS" != "darwin" ] && check_as86
1420[ "$OS" != "darwin" ] && check_bcc
1421[ "$OS" != "darwin" ] && check_iasl
1422# don't check for yasm for the time beeing as 0.40 and 0.50 both have known bugs
1423# [ "$OS" != "darwin" ] && check_yasm
1424[ "$OS" != "darwin" ] && check_xsltproc
1425[ $OSE -eq 0 ] && check_mkisofs
1426
1427# the libraries
1428[ "$OS" != "darwin" ] && check_pthread
1429[ $WITH_XPCOM -eq 1 ] && check_xalan
1430[ $WITH_XPCOM -eq 1 ] && check_xerces
1431[ $WITH_LIBIDL -eq 1 ] && check_libidl
1432[ $OSE -eq 0 ] && check_ssl
1433[ "$OS" != "darwin" ] && check_z
1434[ $OSE -eq 0 ] && check_png
1435[ $OSE -eq 0 -a "$OS" = "linux" ] && check_pam
1436[ "$OS" != "darwin" ] && check_sdl
1437[ $WITH_SDL_TTF -eq 1 -a $OSE -eq 0 ] && check_sdl_ttf
1438[ "$OS" != "darwin" ] && check_x
1439[ "$OS" != "darwin" ] && check_xcursor
1440[ $WITH_QT -eq 1 ] && check_qt
1441
1442# Linux-specific
1443if [ "$OS" = "linux" ]; then
1444 check_linux
1445 check_alsa
1446 check_compiler_h
1447 [ "$BUILD_MACHINE" = "amd64" ] && check_32bit
1448fi
1449
1450[ -n "$SETUP_WINE" ] && setup_wine
1451
1452# success!
1453echo
1454echo "Successfully generated '$CNF' and '$ENV'."
1455echo "Source '$ENV' once before you start to build VBox:"
1456echo ""
1457echo " source $ENV"
1458echo " kmk"
1459echo ""
1460if [ "$OS" = "linux" ]; then
1461 echo "To compile the kernel module, do:"
1462 echo ""
1463 echo " cd ./out/$OS.$TARGET_MACHINE/$BUILD_TYPE/bin/src"
1464 echo " make"
1465 echo ""
1466fi
1467echo "Enjoy!"
1468cleanup
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