VirtualBox

source: vbox/trunk/configure@ 5359

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

Solaris: LIB_XCURSOR -> VBOX_XCURSOR_LIBS/INCS. Qt in tools (solaris only).

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