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