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-2022 Oracle and/or its affiliates.
|
---|
7 | #
|
---|
8 | # This file is part of VirtualBox base platform packages, as
|
---|
9 | # available from https://www.virtualbox.org.
|
---|
10 | #
|
---|
11 | # This program is free software; you can redistribute it and/or
|
---|
12 | # modify it under the terms of the GNU General Public License
|
---|
13 | # as published by the Free Software Foundation, in version 3 of the
|
---|
14 | # License.
|
---|
15 | #
|
---|
16 | # This program is distributed in the hope that it will be useful, but
|
---|
17 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
19 | # General Public License for more details.
|
---|
20 | #
|
---|
21 | # You should have received a copy of the GNU General Public License
|
---|
22 | # along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
23 | #
|
---|
24 | # SPDX-License-Identifier: GPL-3.0-only
|
---|
25 | #
|
---|
26 |
|
---|
27 | LC_ALL=C
|
---|
28 | export LC_ALL
|
---|
29 |
|
---|
30 | # append some extra paths
|
---|
31 | PATH="$PATH:/opt/gnome/bin"
|
---|
32 | # Solaris (order of paths important for tr, grep, sed to work)
|
---|
33 | PATH="/usr/xpg4/bin:$PATH:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin"
|
---|
34 | ORGPATH=$PATH
|
---|
35 |
|
---|
36 | # Wrapper for ancient /usr/bin/which on darwin that always returns 0
|
---|
37 | which_wrapper()
|
---|
38 | {
|
---|
39 | if [ -z "$have_ancient_which" ]; then
|
---|
40 | if which /bin/___cErTaINly_a_nOn_eXisTing_fIle___ 2> /dev/null > /dev/null; then
|
---|
41 | have_ancient_which="yes"
|
---|
42 | else
|
---|
43 | have_ancient_which="no"
|
---|
44 | fi
|
---|
45 | fi
|
---|
46 | if [ "$have_ancient_which" = "yes" ]; then
|
---|
47 | retval=`which $* 2>/dev/null`
|
---|
48 | echo "$retval"
|
---|
49 | test -n "$retval" -a -x "$retval"
|
---|
50 | unset retval
|
---|
51 | else
|
---|
52 | which $* 2> /dev/null
|
---|
53 | fi
|
---|
54 | }
|
---|
55 |
|
---|
56 | OS=`uname -s | sed -e 's/GNU\/Linux/Linux/g' | tr '[:upper:]' '[:lower:]'`
|
---|
57 | case "$OS" in
|
---|
58 | linux)
|
---|
59 | ;;
|
---|
60 | darwin)
|
---|
61 | ;;
|
---|
62 | freebsd)
|
---|
63 | ;;
|
---|
64 | netbsd)
|
---|
65 | ;;
|
---|
66 | sunos)
|
---|
67 | OS='solaris'
|
---|
68 | ;;
|
---|
69 | haiku)
|
---|
70 | ;;
|
---|
71 | *)
|
---|
72 | echo "Cannot determine OS!"
|
---|
73 | exit 1
|
---|
74 | ;;
|
---|
75 | esac
|
---|
76 |
|
---|
77 | #
|
---|
78 | # Defaults
|
---|
79 | #
|
---|
80 | OSE=1
|
---|
81 | ODIR="`pwd`/"
|
---|
82 | ODIR_OVERRIDE=0
|
---|
83 | OUT_BASE_PATH=""
|
---|
84 | OUT_BASE_PATH_OVERRIDE=0
|
---|
85 | SETUP_WINE=
|
---|
86 | ONLY_ADDITIONS=0
|
---|
87 | TARGET_MACHINE=""
|
---|
88 | TARGET_CPU=""
|
---|
89 | WITH_XPCOM=1
|
---|
90 | WITH_PYTHON=1
|
---|
91 | WITH_JAVA=1
|
---|
92 | WITH_VMMRAW=1
|
---|
93 | WITH_LIBIDL=1
|
---|
94 | WITH_QT5=1
|
---|
95 | WITH_SDL=1
|
---|
96 | WITH_SDL_TTF=1
|
---|
97 | WITH_X11=1
|
---|
98 | WITH_ALSA=1
|
---|
99 | WITH_PULSE=1
|
---|
100 | WITH_DBUS=1
|
---|
101 | WITH_DEVMAPPER=1
|
---|
102 | WITH_KMODS=1
|
---|
103 | WITH_OPENGL=1
|
---|
104 | WITH_HARDENING=1
|
---|
105 | WITH_UDPTUNNEL=1
|
---|
106 | WITH_VDE=0
|
---|
107 | WITH_VNC=0
|
---|
108 | WITH_EXTPACK=1
|
---|
109 | WITH_DOCS=1
|
---|
110 | WITH_LIBVPX=1
|
---|
111 | WITH_LIBOPUS=1
|
---|
112 | WITH_LIBTPMS=1
|
---|
113 | BUILD_LIBXML2=
|
---|
114 | BUILD_LIBCURL=
|
---|
115 | BUILD_LIBSSL=
|
---|
116 | BUILD_LIBVPX=
|
---|
117 | BUILD_LIBTPMS=
|
---|
118 | PASSIVE_MESA=0
|
---|
119 | CC="gcc"
|
---|
120 | CC32=""
|
---|
121 | CC64=""
|
---|
122 | CXX="g++"
|
---|
123 | CXX32=""
|
---|
124 | CXX64=""
|
---|
125 | YASM="yasm"
|
---|
126 | IASL="iasl"
|
---|
127 | XSLTPROC="xsltproc"
|
---|
128 | INCCRYPTO=""
|
---|
129 | LIBCRYPTO="-lssl -lcrypto"
|
---|
130 | LIBPTHREAD="-lpthread"
|
---|
131 | LIBCAP="-lcap"
|
---|
132 | GSOAP=""
|
---|
133 | GSOAP_IMPORT=""
|
---|
134 | INCX11="/usr/local/include"
|
---|
135 | LIBX11="-L/usr/X11R6/lib -L/usr/X11R6/lib64 -L/usr/local/lib -lXext -lX11"
|
---|
136 | LIBXCURSOR="-lXcursor"
|
---|
137 | LIBXMU="-lXmu"
|
---|
138 | LIBXINERAMA="-lXinerama"
|
---|
139 | LIBXRANDR="-lXrandr"
|
---|
140 | MAKESELF="makeself"
|
---|
141 | MESA="-lGL"
|
---|
142 | INCZ=""
|
---|
143 | LIBZ="-lz"
|
---|
144 | INCLZF="/usr/include/liblzf"
|
---|
145 | LIBLZF="-llzf"
|
---|
146 | INCVNCSERVER=""
|
---|
147 | LIBVNCSERVER="-lvncserver"
|
---|
148 | INCDEVMAPPER=""
|
---|
149 | LIBDEVMAPPER="-ldevmapper"
|
---|
150 | CXX_FLAGS=""
|
---|
151 | if [ "$OS" = "freebsd" ]; then
|
---|
152 | INCCURL="-I/usr/local/include"
|
---|
153 | LIBCURL="-L/usr/local/lib -lcurl"
|
---|
154 | INCPULSE="-I/usr/local/include"
|
---|
155 | LIBPULSE="-L/usr/local/lib"
|
---|
156 | INCPNG="-I/usr/local/include"
|
---|
157 | LIBPNG="-L/usr/local/lib -lpng"
|
---|
158 | else
|
---|
159 | INCCURL=""
|
---|
160 | LIBCURL="-lcurl"
|
---|
161 | INCPNG=""
|
---|
162 | LIBPNG="-lpng"
|
---|
163 | fi
|
---|
164 | INCVPX=""
|
---|
165 | LIBVPX="-lvpx"
|
---|
166 | PKGCONFIG="`which_wrapper pkg-config`"
|
---|
167 | PYTHONDIR="/usr /usr/local"
|
---|
168 | QT5DIR="/usr/lib/qt5 /usr/share/qt5 /usr/lib64/qt5 /usr /usr/local"
|
---|
169 | QT5DIR_PKGCONFIG=1
|
---|
170 | QT5MAJ=5
|
---|
171 | QT5MIN=9
|
---|
172 | KBUILDDIR="`cd \`dirname $0\`; pwd`/kBuild"
|
---|
173 | DEVDIR="`cd \`dirname $0\`; pwd`/tools"
|
---|
174 | if [ -d "/lib/modules/`uname -r`/build" ]; then
|
---|
175 | LINUX="/lib/modules/`uname -r`/build"
|
---|
176 | elif [ "`echo /lib/modules/*`" != "/lib/modules/*" ]; then
|
---|
177 | # Get the most recent kernel headers if none match the current kernel.
|
---|
178 | for i in /lib/modules/*; do
|
---|
179 | if [ -r "$i/build" ]; then
|
---|
180 | LINUX="$i/build"
|
---|
181 | fi
|
---|
182 | done
|
---|
183 | fi
|
---|
184 | if [ -z "$LINUX" ]; then
|
---|
185 | LINUX="/usr/src/linux"
|
---|
186 | fi
|
---|
187 | KCHMVIEWER="kchmviewer"
|
---|
188 | LOG="configure.log"
|
---|
189 | CNF="AutoConfig.kmk"
|
---|
190 | ENV="env.sh"
|
---|
191 | BUILD_TYPE="release"
|
---|
192 | # the restricting tool is ar (mri mode).
|
---|
193 | INVALID_CHARS="[^A-Za-z0-9/\\$:._-]"
|
---|
194 |
|
---|
195 | if (cd `dirname $0`; pwd)|grep -q "$INVALID_CHARS"; then
|
---|
196 | echo "Error: VBox base path contains invalid characters!"
|
---|
197 | exit 1
|
---|
198 | fi
|
---|
199 |
|
---|
200 | # Posix /bin/sh isn't supporting echo -n. Use printf instead.
|
---|
201 | ECHO_N="printf"
|
---|
202 |
|
---|
203 |
|
---|
204 | cleanup()
|
---|
205 | {
|
---|
206 | rm -f $ODIR.tmp_src.cc $ODIR.tmp_src.c $ODIR.tmp_out $ODIR.test_execute.log
|
---|
207 | [ "$OS" = "darwin" ] && rm -rf $ODIR.tmp_out.dSYM
|
---|
208 | true
|
---|
209 | }
|
---|
210 |
|
---|
211 | fail()
|
---|
212 | {
|
---|
213 | if [ -z "$nofatal" -o "x$1" != "x" ]; then
|
---|
214 | cleanup
|
---|
215 | rm -f $ENV
|
---|
216 | echo "Check $LOG for details"
|
---|
217 | exit 1
|
---|
218 | fi
|
---|
219 | }
|
---|
220 |
|
---|
221 | log()
|
---|
222 | {
|
---|
223 | echo "$1"
|
---|
224 | echo "$1" >> $LOG
|
---|
225 | }
|
---|
226 |
|
---|
227 | log_success()
|
---|
228 | {
|
---|
229 | if [ -n "$1" ]; then $ECHO_N "$1, "; fi
|
---|
230 | echo "OK."
|
---|
231 | echo "$1" >> $LOG
|
---|
232 | echo >> $LOG
|
---|
233 | echo >> $LOG
|
---|
234 | }
|
---|
235 |
|
---|
236 | log_failure()
|
---|
237 | {
|
---|
238 | echo
|
---|
239 | echo " ** $1!"
|
---|
240 | echo "** $1!" >> $LOG
|
---|
241 | echo >> $LOG
|
---|
242 | }
|
---|
243 |
|
---|
244 | cnf_append()
|
---|
245 | {
|
---|
246 | printf "%-30s := %s\n" "$1" "$2" >> $CNF
|
---|
247 | }
|
---|
248 |
|
---|
249 | strip_l()
|
---|
250 | {
|
---|
251 | echo "$1"|$KBUILD_SED 's|-l\([^ ]\+\)|\1|g; s|^-[^l][^ ]*||g; s| -[^l][^ ]*||g; s|^ ||; s| *$||g'
|
---|
252 | }
|
---|
253 |
|
---|
254 | strip_L()
|
---|
255 | {
|
---|
256 | if [ "$OS" = "darwin" ]; then
|
---|
257 | echo "$1"|$KBUILD_SED 's|-F\([^ ]\+\)|\1|g; s|^-[^F][^ ]*||g; s| -[^F][^ ]*||g; s|^ ||; s| *$||g'
|
---|
258 | else
|
---|
259 | echo "$1"|$KBUILD_SED 's|-L\([^ ]\+\)|\1|g; s|^-[^L][^ ]*||g; s| -[^L][^ ]*||g; s|^ ||; s| *$||g'
|
---|
260 | fi
|
---|
261 | }
|
---|
262 |
|
---|
263 | L_to_PATH()
|
---|
264 | {
|
---|
265 | echo $1 >> $LOG
|
---|
266 | if [ "$OS" = "darwin" ]; then
|
---|
267 | echo "$1"|$KBUILD_SED 's|-F\([^ ]\+\)|\1|g; s|^-[^F][^ ]*||g; s| -[^F][^ ]*||g; s|^ ||; s| *$||g; s| |:|g'
|
---|
268 | else
|
---|
269 | echo "$1"|$KBUILD_SED 's|-L\([^ ]\+\)|\1|g; s|^-[^L][^ ]*||g; s| -[^L][^ ]*||g; s|^ ||; s| *$||g; s| |:|g'
|
---|
270 | fi
|
---|
271 | }
|
---|
272 |
|
---|
273 | strip_I()
|
---|
274 | {
|
---|
275 | echo "$1"|$KBUILD_SED 's|-I\([^ ]\+\)|\1|g; s|^-[^I][^ ]*||g; s| -[^I][^ ]*||g; s|^ ||; s| *$||g'
|
---|
276 | }
|
---|
277 |
|
---|
278 | prefix_I()
|
---|
279 | {
|
---|
280 | echo "$1"|$KBUILD_SED 's|^\/|-I/|g; s| \/| -I/|g'
|
---|
281 | }
|
---|
282 |
|
---|
283 | check_avail()
|
---|
284 | {
|
---|
285 | if [ -z "$1" ]; then
|
---|
286 | log_failure "$2 is empty"
|
---|
287 | fail $3
|
---|
288 | return 1
|
---|
289 | elif which_wrapper $1 > /dev/null; then
|
---|
290 | return 0
|
---|
291 | else
|
---|
292 | log_failure "$1 (variable $2) not found"
|
---|
293 | fail $3
|
---|
294 | return 1
|
---|
295 | fi
|
---|
296 | }
|
---|
297 |
|
---|
298 |
|
---|
299 | # Prepare a test
|
---|
300 | test_header()
|
---|
301 | {
|
---|
302 | echo "***** Checking $1 *****" >> $LOG
|
---|
303 | $ECHO_N "Checking for $1: "
|
---|
304 | }
|
---|
305 |
|
---|
306 |
|
---|
307 | # Compile a test
|
---|
308 | # $1 compile flags/libs
|
---|
309 | # $2 library name
|
---|
310 | # $3 package name
|
---|
311 | # $4 if this argument is 'nofatal', don't abort
|
---|
312 | test_compile()
|
---|
313 | {
|
---|
314 | echo "compiling the following source file:" >> $LOG
|
---|
315 | cat $ODIR.tmp_src.cc >> $LOG
|
---|
316 | echo "using the following command line:" >> $LOG
|
---|
317 | echo "$CXX $CXX_FLAGS -fPIC -g -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc $1" >> $LOG
|
---|
318 | $CXX $CXX_FLAGS -fPIC -g -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc $1 >> $LOG 2>&1
|
---|
319 | if [ $? -ne 0 ]; then
|
---|
320 | if [ -z "$4" ]; then
|
---|
321 | echo
|
---|
322 | echo " $2 not found at $1 or $3 headers not found"
|
---|
323 | echo " Check the file $LOG for detailed error information."
|
---|
324 | fail
|
---|
325 | else
|
---|
326 | echo >> $LOG
|
---|
327 | echo >> $LOG
|
---|
328 | fi
|
---|
329 | return 1
|
---|
330 | fi
|
---|
331 | return 0
|
---|
332 | }
|
---|
333 |
|
---|
334 |
|
---|
335 | # Execute a compiled test binary
|
---|
336 | test_execute()
|
---|
337 | {
|
---|
338 | echo "executing the binary" >> $LOG
|
---|
339 | $ODIR.tmp_out > $ODIR.test_execute.log 2>&1
|
---|
340 | rc=$?
|
---|
341 | cat $ODIR.test_execute.log | tee -a $LOG
|
---|
342 | if [ $rc -ne 0 ]; then
|
---|
343 | fail $1
|
---|
344 | return 1
|
---|
345 | fi
|
---|
346 | echo >> $LOG
|
---|
347 | echo >> $LOG
|
---|
348 | return 0
|
---|
349 | }
|
---|
350 |
|
---|
351 |
|
---|
352 | # Execute a compiled test binary
|
---|
353 | test_execute_path()
|
---|
354 | {
|
---|
355 | ## LD_LIBRARY_PATH to set.
|
---|
356 | local_path="${1}"
|
---|
357 | ## Set this to non-empty to make this test non-fatal.
|
---|
358 | local_nofail="${2}"
|
---|
359 | echo "executing the binary (LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH)" >> $LOG
|
---|
360 | LD_LIBRARY_PATH="${local_path}:$LD_LIBRARY_PATH" $ODIR.tmp_out > $ODIR.test_execute.log 2>&1
|
---|
361 | rc=$?
|
---|
362 | cat $ODIR.test_execute.log | tee -a $LOG
|
---|
363 | if [ $rc -ne 0 ]; then
|
---|
364 | test -z "${local_nofail}" && fail
|
---|
365 | echo >> $LOG
|
---|
366 | echo >> $LOG
|
---|
367 | return 1
|
---|
368 | fi
|
---|
369 | echo >> $LOG
|
---|
370 | echo >> $LOG
|
---|
371 | return 0
|
---|
372 | }
|
---|
373 |
|
---|
374 |
|
---|
375 | #
|
---|
376 | # Check for OS, MACHINE, CPU
|
---|
377 | #
|
---|
378 | check_environment()
|
---|
379 | {
|
---|
380 | test_header environment
|
---|
381 | BUILD_CPU=`uname -m`
|
---|
382 | [ "$OS" = "solaris" ] && BUILD_CPU=`isainfo | cut -f 1 -d ' '`
|
---|
383 | case "$BUILD_CPU" in
|
---|
384 | i[3456789]86|x86|i86pc|BePC)
|
---|
385 | BUILD_MACHINE='x86'
|
---|
386 | LIB='lib'
|
---|
387 | ;;
|
---|
388 | x86_64|amd64)
|
---|
389 | BUILD_MACHINE='amd64'
|
---|
390 | BUILD_CPU='blend'
|
---|
391 | if [ "$OS" != "solaris" ]; then
|
---|
392 | # on AMD64 systems, 64bit libs are usually located in /usr/lib64
|
---|
393 | # see http://www.pathname.com/fhs/pub/fhs-2.3.html#LIB64
|
---|
394 | LIB='lib64'
|
---|
395 | else
|
---|
396 | # Solaris doesn't seem to subscribe to fhs, libs are usually in
|
---|
397 | # a '64' subdirectory of the standard 'lib' dirs while some 64-bit
|
---|
398 | # alternative binaries can be found in 'amd64' subdirs of the 'bin'
|
---|
399 | # ones. So, in order to find the right stuff (esp. sdl-config) we'll
|
---|
400 | # have to make sure the */bin/amd64 dirs are searched before the */bin
|
---|
401 | # ones. (The sed has some sideeffects, but they shouldn't harm us...)
|
---|
402 | echo "64-bit Solaris detected, hacking the PATH" >> $LOG
|
---|
403 | echo "old PATH: $PATH" >> $LOG
|
---|
404 | PATH=`echo ":$PATH:" | sed -e 's,\(:[^:]*/bin\):,\1/amd64:\1:,g' \
|
---|
405 | -e 's/^:*//' -e 's/:*$//g' -e 's/::*/:/g' `
|
---|
406 | export PATH
|
---|
407 | echo "new PATH: $PATH" >> $LOG
|
---|
408 | LIB='lib/64'
|
---|
409 | fi
|
---|
410 | ;;
|
---|
411 | sparc64|sparcv9)
|
---|
412 | BUILD_MACHINE='sparc64'
|
---|
413 | BUILD_CPU='blend'
|
---|
414 | ;;
|
---|
415 | sparc32|sparc|sparcv8|sparcv7|sparcv8e)
|
---|
416 | BUILD_MACHINE='sparc32'
|
---|
417 | BUILD_CPU='blend'
|
---|
418 | ;;
|
---|
419 | *)
|
---|
420 | log_failure "Cannot determine system"
|
---|
421 | exit 1
|
---|
422 | ;;
|
---|
423 | esac
|
---|
424 | [ -z "$TARGET_MACHINE" ] && TARGET_MACHINE=$BUILD_MACHINE
|
---|
425 | [ -z "$TARGET_CPU" ] && TARGET_CPU=$BUILD_CPU
|
---|
426 | DEVDIR_BIN="$DEVDIR/$OS.$BUILD_MACHINE/bin"
|
---|
427 | log_success "Determined build machine: $OS.$BUILD_MACHINE, target machine: $OS.$TARGET_MACHINE"
|
---|
428 |
|
---|
429 | echo "KBUILD_HOST=\"$OS\"" >> $ENV
|
---|
430 | echo "KBUILD_HOST_ARCH=\"$BUILD_MACHINE\"" >> $ENV
|
---|
431 | echo "KBUILD_TARGET=\"$OS\"" >> $ENV
|
---|
432 | echo "KBUILD_TARGET_ARCH=\"$TARGET_MACHINE\"" >> $ENV
|
---|
433 | echo "KBUILD_TARGET_CPU=\"$TARGET_CPU\"" >> $ENV
|
---|
434 | echo "KBUILD_TYPE=\"$BUILD_TYPE\"" >> $ENV
|
---|
435 | echo 'export KBUILD_HOST KBUILD_HOST_ARCH KBUILD_TARGET KBUILD_TARGET_ARCH KBUILD_TARGET_CPU KBUILD_TYPE' >> $ENV
|
---|
436 |
|
---|
437 | # obsolete legacy stuff:
|
---|
438 | echo '' >> $ENV
|
---|
439 | echo "# Legacy - do not use:" >> $ENV
|
---|
440 | echo 'BUILD_PLATFORM="$KBUILD_HOST"' >> $ENV
|
---|
441 | echo 'BUILD_PLATFORM_ARCH="$KBUILD_HOST_ARCH"' >> $ENV
|
---|
442 | echo 'BUILD_TARGET="$KBUILD_TARGET"' >> $ENV
|
---|
443 | echo 'BUILD_TARGET_ARCH="$KBUILD_TARGET_ARCH"' >> $ENV
|
---|
444 | echo 'BUILD_TARGET_CPU="$KBUILD_TARGET_CPU"' >> $ENV
|
---|
445 | echo 'BUILD_TYPE="$KBUILD_TYPE"' >> $ENV
|
---|
446 | echo 'export BUILD_PLATFORM BUILD_PLATFORM_ARCH BUILD_TARGET BUILD_TARGET_ARCH BUILD_TARGET_CPU BUILD_TYPE' >> $ENV
|
---|
447 | echo '' >> $ENV
|
---|
448 | }
|
---|
449 |
|
---|
450 | #
|
---|
451 | # Check for gcc with version >= 3.2.
|
---|
452 | # We depend on a working gcc, if we fail terminate in every case.
|
---|
453 | #
|
---|
454 | check_gcc()
|
---|
455 | {
|
---|
456 | test_header gcc
|
---|
457 | if check_avail "$CC" CC really; then
|
---|
458 | cc_ver=`$CC -dumpfullversion 2>/dev/null`
|
---|
459 | if [ $? -ne 0 ]; then
|
---|
460 | cc_ver=`$CC -dumpversion 2>/dev/null`
|
---|
461 | fi
|
---|
462 | if [ $? -ne 0 ]; then
|
---|
463 | log_failure "cannot execute '$CC -dumpversion'"
|
---|
464 | fail really
|
---|
465 | fi
|
---|
466 | if check_avail "$CXX" CXX really; then
|
---|
467 | cxx_ver=`$CXX -dumpfullversion 2>/dev/null`
|
---|
468 | if [ $? -ne 0 ]; then
|
---|
469 | cxx_ver=`$CXX -dumpversion 2>/dev/null`
|
---|
470 | fi
|
---|
471 | if [ $? -ne 0 ]; then
|
---|
472 | log_failure "cannot execute '$CXX -dumpversion'"
|
---|
473 | fail really
|
---|
474 | fi
|
---|
475 | cc_maj=`echo $cc_ver|cut -d. -f1`
|
---|
476 | cc_min=`echo $cc_ver|cut -d. -f2`
|
---|
477 | if [ "x$cc_ver" != "x$cxx_ver" ]; then
|
---|
478 | log_failure "gcc version $cc_ver does not match g++ version $cxx_ver"
|
---|
479 | fail really
|
---|
480 | elif [ $cc_maj -eq 4 -a $cc_min -eq 0 -a "$OS" = "darwin" ]; then
|
---|
481 | log_success "found version $cc_ver"
|
---|
482 | # gcc-4.0 is allowed for Darwin only
|
---|
483 | elif [ $cc_maj -eq 4 -a $cc_min -eq 2 -a "$OS" = "freebsd" ]; then
|
---|
484 | log_success "found version $cc_ver"
|
---|
485 | # gcc-4.2 is allowed for FreeBSD only
|
---|
486 | elif [ $cc_maj -lt 4 \
|
---|
487 | -o \( $cc_maj -eq 4 -a $cc_min -lt 4 -a "$OS" != "darwin" \) \
|
---|
488 | -o \( $cc_maj -eq 4 -a $cc_min -lt 2 -a "$OS" = "darwin" \) ]; then
|
---|
489 | log_failure "gcc version $cc_maj.$cc_min found, expected gcc 4.x or later"
|
---|
490 | fail really
|
---|
491 | else
|
---|
492 | log_success "found version $cc_ver"
|
---|
493 | fi
|
---|
494 | if [ "$BUILD_MACHINE" = "amd64" ]; then
|
---|
495 | [ -z "$CC32" ] && CC32="$CC -m32"
|
---|
496 | [ -z "$CXX32" ] && CXX32="$CXX -m32"
|
---|
497 | else
|
---|
498 | [ -z "$CC32" ] && CC32="$CC"
|
---|
499 | [ -z "$CXX32" ] && CXX32="$CXX"
|
---|
500 | fi
|
---|
501 | if [ "$BUILD_MACHINE" = "x86" -a "$TARGET_MACHINE" = "amd64" ]; then
|
---|
502 | [ -z "$CC64" ] && CC64="$CC -m64"
|
---|
503 | [ -z "$CXX64" ] && CXX64="$CXX -m64"
|
---|
504 | fi
|
---|
505 | if [ "$TARGET_MACHINE" = "amd64" -a $WITH_VMMRAW -eq 0 ]; then
|
---|
506 | CC32="undefined"
|
---|
507 | CXX32="undefined"
|
---|
508 | fi
|
---|
509 | if [ "$CC" != "gcc" ]; then
|
---|
510 | cnf_append "TOOL_GCC3_CC" "$CC"
|
---|
511 | cnf_append "TOOL_GCC3_AS" "$CC"
|
---|
512 | cnf_append "TOOL_GCC3_LD" "$CC"
|
---|
513 | cnf_append "TOOL_GXX3_CC" "$CC"
|
---|
514 | cnf_append "TOOL_GXX3_AS" "$CC"
|
---|
515 | fi
|
---|
516 | if [ "$CXX" != "g++" ]; then
|
---|
517 | cnf_append "TOOL_GCC3_CXX" "$CXX"
|
---|
518 | cnf_append "TOOL_GXX3_CXX" "$CXX"
|
---|
519 | cnf_append "TOOL_GXX3_LD" "$CXX"
|
---|
520 | fi
|
---|
521 | if [ "$CC32" != "gcc -m32" -a "$CC32" != "undefined" ]; then
|
---|
522 | cnf_append "TOOL_GCC32_CC" "$CC32"
|
---|
523 | cnf_append "TOOL_GCC32_AS" "$CC32"
|
---|
524 | cnf_append "TOOL_GCC32_LD" "$CC32"
|
---|
525 | cnf_append "TOOL_GXX32_CC" "$CC32"
|
---|
526 | cnf_append "TOOL_GXX32_AS" "$CC32"
|
---|
527 | fi
|
---|
528 | if [ "$CXX32" != "g++ -m32" -a "$CXX32" != "undefined" ]; then
|
---|
529 | cnf_append "TOOL_GCC32_CXX" "$CXX32"
|
---|
530 | cnf_append "TOOL_GXX32_CXX" "$CXX32"
|
---|
531 | cnf_append "TOOL_GXX32_LD" "$CXX32"
|
---|
532 | fi
|
---|
533 | # this isn't not necessary, there is not such tool.
|
---|
534 | if [ -n "$CC64" ]; then
|
---|
535 | cnf_append "TOOL_GCC64_CC" "$CC64"
|
---|
536 | cnf_append "TOOL_GCC64_AS" "$CC64"
|
---|
537 | cnf_append "TOOL_GCC64_LD" "$CC64"
|
---|
538 | cnf_append "TOOL_GXX64_CC" "$CC64"
|
---|
539 | cnf_append "TOOL_GXX64_AS" "$CC64"
|
---|
540 | fi
|
---|
541 | if [ -n "$CXX64" ]; then
|
---|
542 | cnf_append "TOOL_GCC64_CXX" "$CXX64"
|
---|
543 | cnf_append "TOOL_GXX64_CXX" "$CXX64"
|
---|
544 | cnf_append "TOOL_GXX64_LD" "$CXX64"
|
---|
545 | fi
|
---|
546 | if [ "$CC" != "gcc" ]; then
|
---|
547 | if [ -n "$CC64" ]; then
|
---|
548 | cnf_append "TOOL_Bs3Gcc64Elf64_CC" "$CC64"
|
---|
549 | else
|
---|
550 | cnf_append "TOOL_Bs3Gcc64Elf64_CC" "$CC"
|
---|
551 | fi
|
---|
552 | if [ -n "$CXX64" ]; then
|
---|
553 | cnf_append "TOOL_Bs3Gcc64Elf64_CXX" "$CXX64"
|
---|
554 | else
|
---|
555 | cnf_append "TOOL_Bs3Gcc64Elf64_CXX" "$CXX"
|
---|
556 | fi
|
---|
557 | fi
|
---|
558 | # Solaris sports a 32-bit gcc/g++.
|
---|
559 | if [ "$OS" = "solaris" -a "$BUILD_MACHINE" = "amd64" ]; then
|
---|
560 | [ "$CC" = "gcc" ] && CC="gcc -m64"
|
---|
561 | [ "$CXX" = "g++" ] && CXX="g++ -m64"
|
---|
562 | fi
|
---|
563 | fi
|
---|
564 | fi
|
---|
565 | }
|
---|
566 |
|
---|
567 |
|
---|
568 | #
|
---|
569 | # Check for the OpenWatcom compiler, needed for compiling the BIOS
|
---|
570 | #
|
---|
571 | # If the system has Open Watcom installed, WATCOM will be set in the
|
---|
572 | # environment. If the user has her/his own Open Watcom install it will be
|
---|
573 | # pointed to by on the command line, which will set the WATCOM variable.
|
---|
574 | # The only exception is detecting OpenWatcom in tools/common/openwatcom.
|
---|
575 | #
|
---|
576 | check_open_watcom()
|
---|
577 | {
|
---|
578 | test_header "Open Watcom"
|
---|
579 |
|
---|
580 | if [ -z "$WATCOM" ]; then
|
---|
581 | WATCOM=`/bin/ls -rd1 $DEVDIR/common/openwatcom/* 2> /dev/null | head -1`
|
---|
582 | if [ -z "$WATCOM" ]; then
|
---|
583 | if [ $OSE -eq 0 -a $OS = "linux" ]; then
|
---|
584 | log_failure "Open Watcom was not found"
|
---|
585 | exit 1
|
---|
586 | fi
|
---|
587 | log_failure "Open Watcom was not found, using alternative BIOS sources"
|
---|
588 | cnf_append "VBOX_WITH_OPEN_WATCOM" ""
|
---|
589 | return 0;
|
---|
590 | fi
|
---|
591 | fi
|
---|
592 |
|
---|
593 | case "$OS" in
|
---|
594 | "darwin") wc_bin="binosx";; # ??
|
---|
595 | "dos") wc_bin="binw";;
|
---|
596 | "freebsd") wc_bin="binfbsd";; # ??
|
---|
597 | "linux") wc_bin="binl";;
|
---|
598 | "netbsd") wc_bin="binnbsd";; # ??
|
---|
599 | "solaris") wc_bin="binsol";; # ??
|
---|
600 | "os2") wc_bin="binp";;
|
---|
601 | "win") wc_bin="binnt";;
|
---|
602 | *) wc_bin="binl";;
|
---|
603 | esac
|
---|
604 |
|
---|
605 | # Check that the tools we use are there.
|
---|
606 | for prog in wasm wcc wlink;
|
---|
607 | do
|
---|
608 | if [ ! -f "$WATCOM/$wc_bin/$prog" ]; then
|
---|
609 | log_failure "$WATCOM/$wc_bin/$prog does not exist or is not a regular file."
|
---|
610 | fail
|
---|
611 | fi
|
---|
612 | done
|
---|
613 |
|
---|
614 | # Use WASM to get the version.
|
---|
615 | wasm_ver=`$WATCOM/$wc_bin/wasm -? 2>&1 | sed -e '1!d' -e 's/Open Watcom Assembler Version *//'`
|
---|
616 | if [ -z "$wasm_ver" ]; then
|
---|
617 | log_failure "$WATCOM/$wc_bin/wasm -? did not produce the expected response"
|
---|
618 | fail
|
---|
619 | fi
|
---|
620 | log_success "found version $wasm_ver"
|
---|
621 | cnf_append "PATH_TOOL_OPENWATCOM" "$WATCOM"
|
---|
622 | cnf_append "VBOX_WITH_OPEN_WATCOM" "1"
|
---|
623 |
|
---|
624 | unset wasm_ver
|
---|
625 | unset wc_wasm
|
---|
626 | unset wc_bin
|
---|
627 | }
|
---|
628 |
|
---|
629 |
|
---|
630 | #
|
---|
631 | # Check for yasm, needed to compile assembler files
|
---|
632 | #
|
---|
633 | check_yasm()
|
---|
634 | {
|
---|
635 | test_header yasm
|
---|
636 | if check_avail "$YASM" YASM; then
|
---|
637 | yasm_ver=`$YASM --version|grep "^yasm"|sed 's+^yasm \(.*\)+\1+'`
|
---|
638 | if [ $? -ne 0 ]; then
|
---|
639 | log_failure "yasm not found"
|
---|
640 | fail
|
---|
641 | else
|
---|
642 | yasm_maj=`echo $yasm_ver|cut -d. -f1`
|
---|
643 | yasm_min=`echo $yasm_ver|cut -d. -f2`
|
---|
644 | yasm_rev=`echo $yasm_ver|cut -d. -f3`
|
---|
645 | yasm_ver_mul=`expr $yasm_maj \* 10000 + $yasm_min \* 100 + $yasm_rev`
|
---|
646 | if [ $yasm_ver_mul -lt 10300 ]; then
|
---|
647 | log_failure "found version $yasm_ver, expected at least 1.3.0"
|
---|
648 | fail
|
---|
649 | else
|
---|
650 | [ "$YASM" != "yasm" ] && cnf_append "PATH_TOOL_YASM" "`dirname $YASM`"
|
---|
651 | log_success "found version $yasm_ver"
|
---|
652 | fi
|
---|
653 | fi
|
---|
654 | fi
|
---|
655 | }
|
---|
656 |
|
---|
657 |
|
---|
658 | #
|
---|
659 | # Check for the iasl ACPI compiler, needed to compile vbox.dsl
|
---|
660 | #
|
---|
661 | check_iasl()
|
---|
662 | {
|
---|
663 | test_header iasl
|
---|
664 | if check_avail "$IASL" IASL; then
|
---|
665 | iasl_ver=`$IASL|grep "ASL.*version"|sed 's+^ASL.*version \([0-9]*\).*+\1+'`
|
---|
666 | if [ $? -ne 0 ]; then
|
---|
667 | log_failure "iasl not found"
|
---|
668 | fail
|
---|
669 | else
|
---|
670 | log_success "found version $iasl_ver"
|
---|
671 | cnf_append "VBOX_IASLCMD" "`which_wrapper $IASL`"
|
---|
672 | fi
|
---|
673 | fi
|
---|
674 | }
|
---|
675 |
|
---|
676 |
|
---|
677 | #
|
---|
678 | # Check for xsltproc, needed by Main
|
---|
679 | #
|
---|
680 | check_xsltproc()
|
---|
681 | {
|
---|
682 | if [ -n "$BUILD_LIBXSLT" ]; then
|
---|
683 | return 0;
|
---|
684 | fi
|
---|
685 | test_header xslt
|
---|
686 | if check_avail "$XSLTPROC" XSLTPROC; then
|
---|
687 | xsltproc_ver=`$XSLTPROC --version`
|
---|
688 | if [ $? -ne 0 ]; then
|
---|
689 | log_failure "xsltproc not found"
|
---|
690 | fail
|
---|
691 | else
|
---|
692 | log_success "found"
|
---|
693 | cnf_append "VBOX_XSLTPROC" "`which_wrapper $XSLTPROC`"
|
---|
694 | fi
|
---|
695 | fi
|
---|
696 | }
|
---|
697 |
|
---|
698 |
|
---|
699 | #
|
---|
700 | # Check for libxml2, needed by the Runtime.
|
---|
701 | # 2.6.24 is known to NOT work, 2.6.26 is known to work (there is no 2.6.25 release)
|
---|
702 | #
|
---|
703 | check_libxml2()
|
---|
704 | {
|
---|
705 | if [ -z "$BUILD_LIBXML2" ]; then
|
---|
706 | test_header libxml2
|
---|
707 | if which_wrapper pkg-config > /dev/null; then
|
---|
708 | libxml2_ver=`pkg-config libxml-2.0 --modversion 2>> $LOG`
|
---|
709 | if [ $? -ne 0 ]; then
|
---|
710 | log_failure "libxml2 not found"
|
---|
711 | fail
|
---|
712 | else
|
---|
713 | FLGXML2=`pkg-config libxml-2.0 --cflags`
|
---|
714 | INCXML2=`strip_I "$FLGXML2"`
|
---|
715 | LIBXML2=`pkg-config libxml-2.0 --libs`
|
---|
716 | cat > $ODIR.tmp_src.cc << EOF
|
---|
717 | #include <cstdio>
|
---|
718 | #include <libxml/xmlversion.h>
|
---|
719 | extern "C" int main(void)
|
---|
720 | {
|
---|
721 | printf("found version %s", LIBXML_DOTTED_VERSION);
|
---|
722 | #if LIBXML_VERSION >= 20626
|
---|
723 | printf(", OK.\n");
|
---|
724 | return 0;
|
---|
725 | #else
|
---|
726 | printf(", expected version 2.6.26 or higher\n");
|
---|
727 | return 1;
|
---|
728 | #endif
|
---|
729 | }
|
---|
730 | EOF
|
---|
731 | [ -n "$INCXML2" ] && I_INCXML2=`prefix_I "$INCXML2"`
|
---|
732 | if test_compile "$LIBXML2 $LIBPTHREAD $I_INCXML2" xml2 xml2; then
|
---|
733 | if test_execute; then
|
---|
734 | cnf_append "SDK_VBOX_LIBXML2_DEFS" "_REENTRANT" ## @todo get defines from --cflags
|
---|
735 | cnf_append "SDK_VBOX_LIBXML2_INCS" "$INCXML2"
|
---|
736 | cnf_append "SDK_VBOX_LIBXML2_LIBS" "`strip_l "$LIBXML2"`"
|
---|
737 | fi
|
---|
738 | fi
|
---|
739 | fi
|
---|
740 | elif which_wrapper xml2-config; then
|
---|
741 | libxml2_ver=`xml2-config --version`
|
---|
742 | if [ $? -ne 0 ]; then
|
---|
743 | log_failure "xml2-config not found"
|
---|
744 | fail
|
---|
745 | else
|
---|
746 | log_success "found version $libxml2_ver"
|
---|
747 | FLGXML2=`xml2-config --cflags`
|
---|
748 | INCXML2=`strip_I "$FLGXML2"`
|
---|
749 | LIBXML2=`xml2-config --libs`
|
---|
750 | cat > $ODIR.tmp_src.cc << EOF
|
---|
751 | #include <cstdio>
|
---|
752 | #include <libxml/xmlversion.h>
|
---|
753 | extern "C" int main(void)
|
---|
754 | {
|
---|
755 | printf("found version %s", LIBXML_DOTTED_VERSION);
|
---|
756 | #if LIBXML_VERSION >= 20626
|
---|
757 | printf(", OK.\n");
|
---|
758 | return 0;
|
---|
759 | #else
|
---|
760 | printf(", expected version 2.6.26 or higher\n");
|
---|
761 | return 1;
|
---|
762 | #endif
|
---|
763 | }
|
---|
764 | EOF
|
---|
765 | [ -n "$INCXML2" ] && I_INCXML2=`prefix_I "$INCXML2"`
|
---|
766 | if test_compile "$LIBXML2 $LIBPTHREAD $I_INCXML2" xml2 xml2; then
|
---|
767 | if test_execute; then
|
---|
768 | cnf_append "SDK_VBOX_LIBXML2_DEFS" "_REENTRANT" ## @todo get defines from --cflags
|
---|
769 | cnf_append "SDK_VBOX_LIBXML2_INCS" "$INCXML2"
|
---|
770 | cnf_append "SDK_VBOX_LIBXML2_LIBS" "`strip_l "$LIBXML2"`"
|
---|
771 | fi
|
---|
772 | fi
|
---|
773 | fi
|
---|
774 | else
|
---|
775 | log_failure "neither pkg-config nor xml2-config found"
|
---|
776 | fail
|
---|
777 | fi
|
---|
778 | fi
|
---|
779 | }
|
---|
780 |
|
---|
781 |
|
---|
782 | #
|
---|
783 | # Check for libIDL, needed by xpcom
|
---|
784 | #
|
---|
785 | check_libidl()
|
---|
786 | {
|
---|
787 | test_header libIDL
|
---|
788 |
|
---|
789 | if which_wrapper libIDL-config-2 > /dev/null; then
|
---|
790 | libidl_ver=`libIDL-config-2 --version`
|
---|
791 | if [ $? -ne 0 ]; then
|
---|
792 | log_failure "libIDL-config-2 not working"
|
---|
793 | fail
|
---|
794 | else
|
---|
795 | log_success "found version $libidl_ver"
|
---|
796 | cnf_append "VBOX_LIBIDL_CONFIG" \
|
---|
797 | "PKG_CONFIG_PATH=`libIDL-config-2 --prefix`/$LIB/pkgconfig `which_wrapper libIDL-config-2`"
|
---|
798 | fi
|
---|
799 | elif check_avail "libIDL-config" libIDL-config; then
|
---|
800 | libidl_ver=`libIDL-config --version`
|
---|
801 | if [ $? -ne 0 ]; then
|
---|
802 | log_failure "libIDL-config not working"
|
---|
803 | fail
|
---|
804 | else
|
---|
805 | log_success "found version $libidl_ver"
|
---|
806 | cnf_append "VBOX_LIBIDL_CONFIG" "`which_wrapper libIDL-config`"
|
---|
807 | fi
|
---|
808 | fi
|
---|
809 | }
|
---|
810 |
|
---|
811 |
|
---|
812 | #
|
---|
813 | # Check for libdevmapper, needed by the VBoxVolInfo
|
---|
814 | #
|
---|
815 | check_libdevmapper()
|
---|
816 | {
|
---|
817 | test_header libdevmapper
|
---|
818 | cat > $ODIR.tmp_src.cc << EOF
|
---|
819 | #include <cstdio>
|
---|
820 | extern "C" {
|
---|
821 | #define private
|
---|
822 | #include <libdevmapper.h>
|
---|
823 | int main()
|
---|
824 | {
|
---|
825 | char version[80];
|
---|
826 |
|
---|
827 | if (!dm_get_library_version(version, sizeof(version)))
|
---|
828 | {
|
---|
829 | printf("dm_get_library_version() failed.\n");
|
---|
830 | return 1;
|
---|
831 | }
|
---|
832 |
|
---|
833 | const char* v=version;
|
---|
834 | unsigned int major = 0, minor = 0, micro = 0;
|
---|
835 |
|
---|
836 | for (; *v !='.' && *v != '\0'; v++) major = major*10 + *v-'0';
|
---|
837 | if (*v == '.') v++;
|
---|
838 | for (; *v !='.' && *v != '\0'; v++) minor = minor*10 + *v-'0';
|
---|
839 | if (*v == '.') v++;
|
---|
840 | for (; *v !='.' && *v != '\0'; v++) micro = micro*10 + *v-'0';
|
---|
841 |
|
---|
842 | printf("found version %s", version);
|
---|
843 | if (major*10000 + minor*100 + micro >= 10200)
|
---|
844 | {
|
---|
845 | printf(", OK.\n");
|
---|
846 | return 0;
|
---|
847 | }
|
---|
848 | else
|
---|
849 | {
|
---|
850 | printf(", expected version 1.02 or higher\n");
|
---|
851 | return 1;
|
---|
852 | }
|
---|
853 | }
|
---|
854 | }
|
---|
855 | EOF
|
---|
856 | if test_compile "$LIBDEVMAPPER $INCDEVMAPPER" libdevmapper libdevmapper; then
|
---|
857 | if test_execute; then
|
---|
858 | cnf_append "VBOX_WITH_DEVMAPPER" "1"
|
---|
859 | fi
|
---|
860 | fi
|
---|
861 | }
|
---|
862 |
|
---|
863 |
|
---|
864 | #
|
---|
865 | # Check for openssl, needed for RDP and S3
|
---|
866 | #
|
---|
867 | check_ssl()
|
---|
868 | {
|
---|
869 | if [ -z "$BUILD_LIBSSL" ]; then
|
---|
870 | test_header ssl
|
---|
871 | cat > $ODIR.tmp_src.cc << EOF
|
---|
872 | #include <cstdio>
|
---|
873 | #include <openssl/opensslv.h>
|
---|
874 | #include <openssl/ssl.h>
|
---|
875 | extern "C" int main(void)
|
---|
876 | {
|
---|
877 | printf("found version %s", OPENSSL_VERSION_TEXT);
|
---|
878 | SSL_library_init();
|
---|
879 | #if OPENSSL_VERSION_NUMBER >= 0x10001000
|
---|
880 | printf(", OK.\n");
|
---|
881 | return 0;
|
---|
882 | #else
|
---|
883 | printf(", expected version 1.0.1 or higher\n");
|
---|
884 | return 1;
|
---|
885 | #endif
|
---|
886 | }
|
---|
887 | EOF
|
---|
888 | if test_compile "$INCCRYPTO $LIBCRYPTO" libcrypto openssl; then
|
---|
889 | if test_execute nofatal; then
|
---|
890 | cnf_append "SDK_VBOX_OPENSSL_INCS" "`strip_I "$INCCRYPTO"`"
|
---|
891 | cnf_append "SDK_VBOX_OPENSSL_LIBS" "`strip_l "$LIBCRYPTO"`"
|
---|
892 | cnf_append "SDK_VBOX_BLD_OPENSSL_LIBS" "`strip_l "$LIBCRYPTO"`"
|
---|
893 | fi
|
---|
894 | fi
|
---|
895 | fi
|
---|
896 | }
|
---|
897 |
|
---|
898 |
|
---|
899 | #
|
---|
900 | # Check for pthread, needed by VBoxSVC, frontends, ...
|
---|
901 | #
|
---|
902 | check_pthread()
|
---|
903 | {
|
---|
904 | test_header pthread
|
---|
905 | cat > $ODIR.tmp_src.cc << EOF
|
---|
906 | #include <cstdio>
|
---|
907 | #include <pthread.h>
|
---|
908 | extern "C" int main(void)
|
---|
909 | {
|
---|
910 | pthread_mutex_t mutex;
|
---|
911 | if (pthread_mutex_init(&mutex, NULL)) {
|
---|
912 | printf("pthread_mutex_init() failed\n");
|
---|
913 | return 1;
|
---|
914 | }
|
---|
915 | if (pthread_mutex_lock(&mutex)) {
|
---|
916 | printf("pthread_mutex_lock() failed\n");
|
---|
917 | return 1;
|
---|
918 | }
|
---|
919 | if (pthread_mutex_unlock(&mutex)) {
|
---|
920 | printf("pthread_mutex_unlock() failed\n");
|
---|
921 | return 1;
|
---|
922 | }
|
---|
923 | printf("found, OK.\n");
|
---|
924 | }
|
---|
925 | EOF
|
---|
926 | if test_compile $LIBPTHREAD pthread pthread; then
|
---|
927 | if test_execute; then
|
---|
928 | cnf_append "LIB_PTHREAD" "`strip_l "$LIBPTHREAD"`"
|
---|
929 | fi
|
---|
930 | fi
|
---|
931 | }
|
---|
932 |
|
---|
933 |
|
---|
934 | #
|
---|
935 | # Check for zlib, needed by VBoxSVC, Runtime, ...
|
---|
936 | #
|
---|
937 | check_z()
|
---|
938 | {
|
---|
939 | test_header zlib
|
---|
940 | cat > $ODIR.tmp_src.cc << EOF
|
---|
941 | #include <cstdio>
|
---|
942 | #include <zlib.h>
|
---|
943 | extern "C" int main(void)
|
---|
944 | {
|
---|
945 | printf("found version %s", ZLIB_VERSION);
|
---|
946 | #if ZLIB_VERNUM >= 0x1210
|
---|
947 | printf(", OK.\n");
|
---|
948 | return 0;
|
---|
949 | #else
|
---|
950 | printf(", expected version 1.2.1 or higher\n");
|
---|
951 | return 1;
|
---|
952 | #endif
|
---|
953 | }
|
---|
954 | EOF
|
---|
955 | [ -n "$INCZ" ] && I_INCZ=`prefix_I "$INCZ"`
|
---|
956 | if test_compile "$LIBZ $I_INCZ" zlib zlib; then
|
---|
957 | if test_execute; then
|
---|
958 | echo "if1of (\$(KBUILD_TARGET),darwin freebsd haiku linux)" >> $CNF
|
---|
959 | cnf_append " SDK_VBOX_ZLIB_LIBS" "`strip_l "$LIBZ"`"
|
---|
960 | cnf_append " SDK_VBOX_ZLIB_INCS" "$INCZ"
|
---|
961 | echo "endif" >> $CNF
|
---|
962 | fi
|
---|
963 | fi
|
---|
964 | }
|
---|
965 |
|
---|
966 |
|
---|
967 | #
|
---|
968 | # Check for liblzf, needed by VBoxSVC, Runtime, ...
|
---|
969 | #
|
---|
970 | check_lzf()
|
---|
971 | {
|
---|
972 | test_header liblzf
|
---|
973 | cat > $ODIR.tmp_src.cc << EOF
|
---|
974 | #include <cstdio>
|
---|
975 | #include <lzf.h>
|
---|
976 | extern "C" int main(void)
|
---|
977 | {
|
---|
978 | printf("found LZF API version %u.%u", LZF_VERSION >> 8, LZF_VERSION & 0xff);
|
---|
979 | #if LZF_VERSION >= 0x0105
|
---|
980 | printf(", OK.\n");
|
---|
981 | return 0;
|
---|
982 | #else
|
---|
983 | printf(", expected version 1.5 or higher\n");
|
---|
984 | return 1;
|
---|
985 | #endif
|
---|
986 | }
|
---|
987 | EOF
|
---|
988 | [ -n "$INCLZF" ] && I_INCLZF=`prefix_I "$INCLZF"`
|
---|
989 | if test_compile "$LIBLZF $I_INCLZF" liblzf liblzf nofatal; then
|
---|
990 | if test_execute; then
|
---|
991 | echo "if1of (\$(KBUILD_TARGET),darwin freebsd haiku linux)" >> $CNF
|
---|
992 | cnf_append " SDK_VBOX_LZF_LIBS" "`strip_l "$LIBLZF"`"
|
---|
993 | cnf_append " SDK_VBOX_LZF_INCS" "$INCLZF"
|
---|
994 | echo "endif" >> $CNF
|
---|
995 | fi
|
---|
996 | else
|
---|
997 | echo "not found -- builing liblzf from in-tree code."
|
---|
998 | fi
|
---|
999 | }
|
---|
1000 |
|
---|
1001 |
|
---|
1002 | #
|
---|
1003 | # Check for libpng, needed by kchmviewer
|
---|
1004 | #
|
---|
1005 | check_png()
|
---|
1006 | {
|
---|
1007 | test_header libpng
|
---|
1008 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1009 | #include <cstdio>
|
---|
1010 | #include <png.h>
|
---|
1011 | extern "C" int main(void)
|
---|
1012 | {
|
---|
1013 | printf("found version %s", PNG_LIBPNG_VER_STRING);
|
---|
1014 | #if PNG_LIBPNG_VER >= 10205
|
---|
1015 | printf(", OK.\n");
|
---|
1016 | return 0;
|
---|
1017 | #else
|
---|
1018 | printf(", expected version 1.2.5 or higher\n");
|
---|
1019 | return 1;
|
---|
1020 | #endif
|
---|
1021 | }
|
---|
1022 | EOF
|
---|
1023 | [ -n "$INCPNG" ] && I_INCPNG=`prefix_I "$INCPNG"`
|
---|
1024 | if test_compile "$LIBPNG $I_INCPNG" libpng libpng; then
|
---|
1025 | if test_execute; then
|
---|
1026 | cnf_append "SDK_VBOX_LIBPNG_LIBS" "`strip_l "$LIBPNG"`"
|
---|
1027 | cnf_append "SDK_VBOX_LIBPNG_INCS" "$INCPNG"
|
---|
1028 | fi
|
---|
1029 | fi
|
---|
1030 | }
|
---|
1031 |
|
---|
1032 | #
|
---|
1033 | # Check for libvncserver, needed for VNC in OSE
|
---|
1034 | #
|
---|
1035 | check_vncserver()
|
---|
1036 | {
|
---|
1037 | test_header libvncserver
|
---|
1038 | cat > $ODIR.tmp_src.cc <<EOF
|
---|
1039 | #include <cstdio>
|
---|
1040 | #include <rfb/rfbconfig.h>
|
---|
1041 |
|
---|
1042 | extern "C" int main()
|
---|
1043 | {
|
---|
1044 | const char* v=LIBVNCSERVER_VERSION;
|
---|
1045 | unsigned int major = 0, minor = 0, micro = 0;
|
---|
1046 |
|
---|
1047 | for (; *v !='.' && *v != '\0'; v++) major = major*10 + *v-'0';
|
---|
1048 | if (*v == '.') v++;
|
---|
1049 | for (; *v !='.' && *v != '\0'; v++) minor = minor*10 + *v-'0';
|
---|
1050 | if (*v == '.') v++;
|
---|
1051 | for (; *v !='.' && *v != '\0'; v++) micro = micro*10 + *v-'0';
|
---|
1052 |
|
---|
1053 | printf("found version %s", LIBVNCSERVER_PACKAGE_VERSION);
|
---|
1054 | if (major*10000 + minor*100 + micro >= 900)
|
---|
1055 | {
|
---|
1056 | printf(", OK.\n");
|
---|
1057 | return 0;
|
---|
1058 | }
|
---|
1059 | else
|
---|
1060 | {
|
---|
1061 | printf(", expected version 0.9 or higher\n");
|
---|
1062 | return 1;
|
---|
1063 | }
|
---|
1064 | }
|
---|
1065 | EOF
|
---|
1066 | if test_compile "$LIBVNCSERVER $INCVNCSERVER" libvncserver libvncserver; then
|
---|
1067 | if test_execute; then
|
---|
1068 | cnf_append "VBOX_WITH_EXTPACK_VNC" "1"
|
---|
1069 | fi
|
---|
1070 | fi
|
---|
1071 | }
|
---|
1072 |
|
---|
1073 | #
|
---|
1074 | # Check for libcurl, needed by S3
|
---|
1075 | #
|
---|
1076 | check_curl()
|
---|
1077 | {
|
---|
1078 | if [ -z "$BUILD_LIBCURL" ]; then
|
---|
1079 | test_header libcurl
|
---|
1080 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1081 | #include <cstdio>
|
---|
1082 | #include <curl/curl.h>
|
---|
1083 | extern "C" int main(void)
|
---|
1084 | {
|
---|
1085 | printf("found version %s", LIBCURL_VERSION);
|
---|
1086 | #if 10000*LIBCURL_VERSION_MAJOR + 100*LIBCURL_VERSION_MINOR + LIBCURL_VERSION_PATCH >= 71901
|
---|
1087 | printf(", OK.\n");
|
---|
1088 | return 0;
|
---|
1089 | #else
|
---|
1090 | printf(", expected version 7.19.1 or higher\n");
|
---|
1091 | return 1;
|
---|
1092 | #endif
|
---|
1093 | }
|
---|
1094 | EOF
|
---|
1095 | [ -n "$INCCURL" ] && I_INCCURL=`prefix_I "$INCCURL"`
|
---|
1096 | if test_compile "$LIBCURL $I_INCCURL" libcurl libcurl; then
|
---|
1097 | if test_execute; then
|
---|
1098 | cnf_append "SDK_VBOX_LIBCURL_LIBS" "`strip_l "$LIBCURL"`"
|
---|
1099 | cnf_append "SDK_VBOX_LIBCURL_INCS" "$INCCURL"
|
---|
1100 | fi
|
---|
1101 | fi
|
---|
1102 | fi
|
---|
1103 | }
|
---|
1104 |
|
---|
1105 |
|
---|
1106 | #
|
---|
1107 | # Check for pam, needed by VRDPAuth
|
---|
1108 | # Version 79 was introduced in 9/2005, do we support older versions?
|
---|
1109 | # Debian/sarge uses 76
|
---|
1110 | # OpenSUSE comes with 0.99.xxx where they changed the versioning scheme.
|
---|
1111 | #
|
---|
1112 | check_pam()
|
---|
1113 | {
|
---|
1114 | test_header pam
|
---|
1115 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1116 | #include <cstdio>
|
---|
1117 | #include <security/pam_appl.h>
|
---|
1118 | extern "C" int main(void)
|
---|
1119 | {
|
---|
1120 | printf("found version %d", __LIBPAM_VERSION);
|
---|
1121 | if (__LIBPAM_VERSION >= 76)
|
---|
1122 | {
|
---|
1123 | printf(", OK.\n");
|
---|
1124 | return 0;
|
---|
1125 | }
|
---|
1126 | else
|
---|
1127 | {
|
---|
1128 | printf(", expected version 76 or higher\n");
|
---|
1129 | return 1;
|
---|
1130 | }
|
---|
1131 | }
|
---|
1132 | EOF
|
---|
1133 | if test_compile "-lpam" pam pam nofatal; then
|
---|
1134 | if test_execute nofatal; then
|
---|
1135 | return 0;
|
---|
1136 | fi
|
---|
1137 | fi
|
---|
1138 | echo "pam0.x not found"
|
---|
1139 | test_header linux_pam
|
---|
1140 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1141 | #include <cstdio>
|
---|
1142 | #include <security/pam_appl.h>
|
---|
1143 | extern "C" int main(void)
|
---|
1144 | {
|
---|
1145 | printf("found version %d.%d", __LINUX_PAM__, __LINUX_PAM_MINOR__);
|
---|
1146 | if (__LINUX_PAM__ >= 1)
|
---|
1147 | {
|
---|
1148 | printf(", OK.\n");
|
---|
1149 | return 0;
|
---|
1150 | }
|
---|
1151 | else
|
---|
1152 | {
|
---|
1153 | printf(", expected version 1.0 or higher\n");
|
---|
1154 | return 1;
|
---|
1155 | }
|
---|
1156 | }
|
---|
1157 | EOF
|
---|
1158 | if test_compile "-lpam" pam pam; then
|
---|
1159 | test_execute
|
---|
1160 | fi
|
---|
1161 | }
|
---|
1162 |
|
---|
1163 |
|
---|
1164 | #
|
---|
1165 | # Check for the SDL library, needed by VBoxSDL and VirtualBox
|
---|
1166 | # We depend at least on version 1.2.7
|
---|
1167 | #
|
---|
1168 | check_sdl()
|
---|
1169 | {
|
---|
1170 | test_header SDL
|
---|
1171 | if [ "$OS" = "darwin" ]; then
|
---|
1172 | if [ -f "/System/Library/Frameworks/SDL.framework/SDL" ]; then
|
---|
1173 | PATH_SDK_LIBSDL="/System/Library/Frameworks/SDL.framework"
|
---|
1174 | elif [ -f "/Library/Frameworks/SDL.framework/SDL" ]; then
|
---|
1175 | PATH_SDK_LIBSDL="/Library/Frameworks/SDL.framework"
|
---|
1176 | fi
|
---|
1177 | if [ -n "$PATH_SDK_LIBSDL" ]; then
|
---|
1178 | foundsdl=1
|
---|
1179 | INCSDL="$PATH_SDK_LIBSDL/Headers"
|
---|
1180 | FLDSDL="-framework SDL"
|
---|
1181 | else
|
---|
1182 | log_failure "SDL framework not found"
|
---|
1183 | fail
|
---|
1184 | fi
|
---|
1185 | else
|
---|
1186 | if which_wrapper sdl-config > /dev/null; then
|
---|
1187 | FLGSDL=`sdl-config --cflags`
|
---|
1188 | INCSDL=`strip_I "$FLGSDL"`
|
---|
1189 | LIBSDL=`sdl-config --libs`
|
---|
1190 | LIBSDLMAIN="-lSDLmain"
|
---|
1191 | FLDSDL=
|
---|
1192 | foundsdl=1
|
---|
1193 | fi
|
---|
1194 | fi
|
---|
1195 | [ "$OS" = "linux" -o "$OS" = "darwin" -o "$OS" = "solaris" ] && LIBSDLMAIN=""
|
---|
1196 | if [ -n "$foundsdl" ]; then
|
---|
1197 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1198 | #include <cstdio>
|
---|
1199 | #include <SDL.h>
|
---|
1200 | #include <SDL_main.h>
|
---|
1201 | #undef main
|
---|
1202 | extern "C" int main(int argc, char** argv)
|
---|
1203 | {
|
---|
1204 | printf("found version %d.%d.%d",
|
---|
1205 | SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
|
---|
1206 | #if SDL_VERSION_ATLEAST(1,2,7)
|
---|
1207 | printf(", OK.\n");
|
---|
1208 | return 0;
|
---|
1209 | #else
|
---|
1210 | printf(", expected version 1.2.7 or higher\n");
|
---|
1211 | return 1;
|
---|
1212 | #endif
|
---|
1213 | }
|
---|
1214 | EOF
|
---|
1215 | [ -n "$INCSDL" ] && I_INCSDL=`prefix_I "$INCSDL"`
|
---|
1216 | if test_compile "$LIBSDL $LIBSDLMAIN $I_INCSDL $FLDSDL" SDL SDL; then
|
---|
1217 | if test_execute; then
|
---|
1218 | cnf_append "LIB_SDK_LIBSDL_SDL" "`strip_l "$LIBSDL"`"
|
---|
1219 | cnf_append "SDK_LIBSDL_LIBPATH" "`strip_L "$LIBSDL"`"
|
---|
1220 | cnf_append "LIB_SDK_LIBSDL_SDLMAIN" "`strip_l "$LIBSDLMAIN"`"
|
---|
1221 | [ -n "$INCSDL" ] && cnf_append "SDK_LIBSDL_INCS" "$INCSDL"
|
---|
1222 | [ -n "$FLDSDL" ] && cnf_append "SDK_LIBSDL_LDFLAGS" "$FLDSDL"
|
---|
1223 | fi
|
---|
1224 | fi
|
---|
1225 | else
|
---|
1226 | log_failure "SDL not found (can be disabled using --disable-sdl)"
|
---|
1227 | fail
|
---|
1228 | fi
|
---|
1229 | }
|
---|
1230 |
|
---|
1231 |
|
---|
1232 | #
|
---|
1233 | # Check for the SDL_ttf library, needed by VBoxSDL (secure label)
|
---|
1234 | #
|
---|
1235 | check_sdl_ttf()
|
---|
1236 | {
|
---|
1237 | test_header SDL_ttf
|
---|
1238 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1239 | #include <cstdio>
|
---|
1240 | #include <SDL_ttf.h>
|
---|
1241 | #ifndef SDL_TTF_MAJOR_VERSION
|
---|
1242 | #define SDL_TTF_MAJOR_VERSION TTF_MAJOR_VERSION
|
---|
1243 | #define SDL_TTF_MINOR_VERSION TTF_MINOR_VERSION
|
---|
1244 | #define SDL_TTF_PATCHLEVEL TTF_PATCHLEVEL
|
---|
1245 | #endif
|
---|
1246 | extern "C" int main(void)
|
---|
1247 | {
|
---|
1248 | printf("found version %d.%d.%d",
|
---|
1249 | SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL);
|
---|
1250 | #if 10000*SDL_TTF_MAJOR_VERSION + 100*SDL_TTF_MINOR_VERSION + SDL_TTF_PATCHLEVEL >= 20006
|
---|
1251 | printf(", OK.\n");
|
---|
1252 | return 0;
|
---|
1253 | #else
|
---|
1254 | printf(", expected version 2.0.6 or higher\n");
|
---|
1255 | return 1;
|
---|
1256 | #endif
|
---|
1257 | }
|
---|
1258 | EOF
|
---|
1259 | if test_compile "-lSDL_ttf $I_INCSDL" SDL_ttf SDL_ttf nofatal; then
|
---|
1260 | test_execute nofatal || \
|
---|
1261 | cnf_append "VBOX_WITH_SECURELABEL" ""
|
---|
1262 | else
|
---|
1263 | echo "not found -- disabling VBoxSDL secure label."
|
---|
1264 | cnf_append "VBOX_WITH_SECURELABEL" ""
|
---|
1265 | fi
|
---|
1266 | }
|
---|
1267 |
|
---|
1268 |
|
---|
1269 | #
|
---|
1270 | # Check for libasound, needed by the ALSA audio backend
|
---|
1271 | #
|
---|
1272 | check_alsa()
|
---|
1273 | {
|
---|
1274 | test_header ALSA
|
---|
1275 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1276 | #include <cstdio>
|
---|
1277 | #include <alsa/asoundlib.h>
|
---|
1278 | extern "C" int main(void)
|
---|
1279 | {
|
---|
1280 | printf("found version %d.%d.%d",
|
---|
1281 | SND_LIB_MAJOR, SND_LIB_MINOR, SND_LIB_SUBMINOR);
|
---|
1282 | #if 10000*SND_LIB_MAJOR + 100*SND_LIB_MINOR + SND_LIB_SUBMINOR >= 10014
|
---|
1283 | printf(", OK.\n");
|
---|
1284 | return 0;
|
---|
1285 | #else
|
---|
1286 | printf(", expected version 1.0.14 or higher\n");
|
---|
1287 | return 1;
|
---|
1288 | #endif
|
---|
1289 | }
|
---|
1290 | EOF
|
---|
1291 | if test_compile "-lasound" asound asound; then
|
---|
1292 | test_execute
|
---|
1293 | fi
|
---|
1294 | }
|
---|
1295 |
|
---|
1296 |
|
---|
1297 | #
|
---|
1298 | # Check for PulseAudio
|
---|
1299 | #
|
---|
1300 | check_pulse()
|
---|
1301 | {
|
---|
1302 | test_header "PulseAudio"
|
---|
1303 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1304 | #include <cstdio>
|
---|
1305 | #include <pulse/version.h>
|
---|
1306 | extern "C" int main(void)
|
---|
1307 | {
|
---|
1308 | printf("found version %s API version %d", pa_get_headers_version(), PA_API_VERSION);
|
---|
1309 | #if PA_API_VERSION >= 9
|
---|
1310 | printf(", OK.\n");
|
---|
1311 | return 0;
|
---|
1312 | #else
|
---|
1313 | printf(", expected version 0.9.0 (API version 9) or higher\n");
|
---|
1314 | return 1;
|
---|
1315 | #endif
|
---|
1316 | }
|
---|
1317 | EOF
|
---|
1318 | if test_compile "$INCPULSE $LIBPULSE -lpulse" pulse pulse nofatal; then
|
---|
1319 | if test_execute nofatal; then
|
---|
1320 | cnf_append "VBOX_WITH_AUDIO_PULSE" "1"
|
---|
1321 | else
|
---|
1322 | cnf_append "VBOX_WITH_AUDIO_PULSE" ""
|
---|
1323 | fi
|
---|
1324 | else
|
---|
1325 | cnf_append "VBOX_WITH_AUDIO_PULSE" ""
|
---|
1326 | fi
|
---|
1327 | }
|
---|
1328 |
|
---|
1329 |
|
---|
1330 | #
|
---|
1331 | # Check for the X libraries (Xext, X11)
|
---|
1332 | #
|
---|
1333 | check_x()
|
---|
1334 | {
|
---|
1335 | test_header "X libraries"
|
---|
1336 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1337 | #include <cstdio>
|
---|
1338 | #include <X11/Xlib.h>
|
---|
1339 | extern "C" int main(void)
|
---|
1340 | {
|
---|
1341 | Display *dpy;
|
---|
1342 | int scrn_num;
|
---|
1343 | Screen *scrn;
|
---|
1344 | Window win;
|
---|
1345 |
|
---|
1346 | dpy = XOpenDisplay(NULL);
|
---|
1347 | scrn_num = DefaultScreen(dpy);
|
---|
1348 | scrn = ScreenOfDisplay(dpy, scrn_num);
|
---|
1349 | win = XCreateWindow(dpy, RootWindowOfScreen(scrn), 0, 0, 100, 100,
|
---|
1350 | 0, 16, InputOutput, CopyFromParent, 0, NULL);
|
---|
1351 | XDestroyWindow(dpy, win);
|
---|
1352 | XCloseDisplay(dpy);
|
---|
1353 | }
|
---|
1354 | EOF
|
---|
1355 | [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
|
---|
1356 | if test_compile "$LIBX11 $I_INCX11" Xlibs Xlibs; then
|
---|
1357 | log_success "found"
|
---|
1358 | fi
|
---|
1359 | }
|
---|
1360 |
|
---|
1361 |
|
---|
1362 | #
|
---|
1363 | # Check for the Xcursor library, needed by VBoxSDL.
|
---|
1364 | #
|
---|
1365 | check_xcursor()
|
---|
1366 | {
|
---|
1367 | test_header Xcursor
|
---|
1368 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1369 | #include <cstdio>
|
---|
1370 | #include <X11/Xlib.h>
|
---|
1371 | #include <X11/Xcursor/Xcursor.h>
|
---|
1372 | extern "C" int main(void)
|
---|
1373 | {
|
---|
1374 | XcursorImage *cursor = XcursorImageCreate (10, 10);
|
---|
1375 | XcursorImageDestroy(cursor);
|
---|
1376 | return 0;
|
---|
1377 | }
|
---|
1378 | EOF
|
---|
1379 | [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
|
---|
1380 | if test_compile "$LIBX11 $LIBXCURSOR $I_INCX11" Xcursor Xcursor; then
|
---|
1381 | log_success "found"
|
---|
1382 | cnf_append "VBOX_XCURSOR_LIBS" "`strip_l "$LIBXCURSOR"`"
|
---|
1383 | fi
|
---|
1384 | }
|
---|
1385 |
|
---|
1386 |
|
---|
1387 | #
|
---|
1388 | # Check for the Xinerama library, needed by the Qt GUI
|
---|
1389 | #
|
---|
1390 | check_xinerama()
|
---|
1391 | {
|
---|
1392 | test_header Xinerama
|
---|
1393 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1394 | #include <X11/Xlib.h>
|
---|
1395 | #include <X11/extensions/Xinerama.h>
|
---|
1396 | extern "C" int main(void)
|
---|
1397 | {
|
---|
1398 | Display *dpy;
|
---|
1399 | Bool flag;
|
---|
1400 | dpy = XOpenDisplay(NULL);
|
---|
1401 | if (dpy)
|
---|
1402 | {
|
---|
1403 | flag = XineramaIsActive(dpy);
|
---|
1404 | XCloseDisplay(dpy);
|
---|
1405 | }
|
---|
1406 | }
|
---|
1407 | EOF
|
---|
1408 | [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
|
---|
1409 | if test_compile "$LIBX11 $LIBXINERAMA $I_INCX11" Xinerama Xinerama; then
|
---|
1410 | log_success "found"
|
---|
1411 | fi
|
---|
1412 | }
|
---|
1413 |
|
---|
1414 |
|
---|
1415 | #
|
---|
1416 | # Check for the XRandR library, needed by the Qt GUI
|
---|
1417 | #
|
---|
1418 | check_xrandr()
|
---|
1419 | {
|
---|
1420 | test_header Xrandr
|
---|
1421 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1422 | #include <X11/Xlib.h>
|
---|
1423 | #include <X11/extensions/Xrandr.h>
|
---|
1424 | extern "C" int main(void)
|
---|
1425 | {
|
---|
1426 | Display *dpy;
|
---|
1427 | Bool flag;
|
---|
1428 | int major, minor;
|
---|
1429 | dpy = XOpenDisplay(NULL);
|
---|
1430 | if (dpy)
|
---|
1431 | {
|
---|
1432 | flag = XRRQueryVersion(dpy, &major, &minor);
|
---|
1433 | XCloseDisplay(dpy);
|
---|
1434 | }
|
---|
1435 | }
|
---|
1436 | EOF
|
---|
1437 | [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
|
---|
1438 | if test_compile "$LIBX11 $LIBXRANDR $I_INCX11" Xrandr Xrandr; then
|
---|
1439 | log_success "found"
|
---|
1440 | fi
|
---|
1441 | }
|
---|
1442 |
|
---|
1443 |
|
---|
1444 | #
|
---|
1445 | # Check for OpenGL
|
---|
1446 | #
|
---|
1447 | check_opengl()
|
---|
1448 | {
|
---|
1449 | # On darwin this is a on/off decision only
|
---|
1450 | if [ "$OS" = "darwin" ]; then
|
---|
1451 | test_header "OpenGL support"
|
---|
1452 | echo "enabled"
|
---|
1453 | else
|
---|
1454 | check_xmu
|
---|
1455 | check_mesa
|
---|
1456 | fi
|
---|
1457 | }
|
---|
1458 |
|
---|
1459 |
|
---|
1460 | #
|
---|
1461 | # Check for the Xmu library, needed by OpenGL
|
---|
1462 | #
|
---|
1463 | check_xmu()
|
---|
1464 | {
|
---|
1465 | test_header Xmu
|
---|
1466 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1467 | #include <cstdio>
|
---|
1468 | #include <X11/Xatom.h>
|
---|
1469 | #include <X11/Xlib.h>
|
---|
1470 | #include <X11/Xutil.h>
|
---|
1471 | #include <X11/Xmu/StdCmap.h>
|
---|
1472 | extern "C" int main(void)
|
---|
1473 | {
|
---|
1474 | Display *dpy;
|
---|
1475 | int scrn_num;
|
---|
1476 | Screen *scrn;
|
---|
1477 |
|
---|
1478 | dpy = XOpenDisplay(NULL);
|
---|
1479 | if (dpy)
|
---|
1480 | {
|
---|
1481 | scrn_num = DefaultScreen(dpy);
|
---|
1482 | scrn = ScreenOfDisplay(dpy, scrn_num);
|
---|
1483 | Status status = XmuLookupStandardColormap(dpy, RootWindowOfScreen(scrn), 0,
|
---|
1484 | 24, XA_RGB_DEFAULT_MAP, False, True);
|
---|
1485 | printf("Status = %x\n", status);
|
---|
1486 | XCloseDisplay(dpy);
|
---|
1487 | }
|
---|
1488 | return 0;
|
---|
1489 | }
|
---|
1490 | EOF
|
---|
1491 | [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
|
---|
1492 | if test_compile "$LIBX11 $LIBXMU $I_INCX11" Xmu Xmu; then
|
---|
1493 | log_success "found"
|
---|
1494 | cnf_append "VBOX_XMU_LIBS" "`strip_l "$LIBXMU"`"
|
---|
1495 | fi
|
---|
1496 | }
|
---|
1497 |
|
---|
1498 | #
|
---|
1499 | # Check for Mesa, needed by OpenGL
|
---|
1500 | #
|
---|
1501 | check_mesa()
|
---|
1502 | {
|
---|
1503 | test_header "Mesa / GLU"
|
---|
1504 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1505 | #include <cstdio>
|
---|
1506 | #include <X11/Xlib.h>
|
---|
1507 | #include <GL/glx.h>
|
---|
1508 | #include <GL/glu.h>
|
---|
1509 | extern "C" int main(void)
|
---|
1510 | {
|
---|
1511 | Display *dpy;
|
---|
1512 | int major, minor;
|
---|
1513 |
|
---|
1514 | dpy = XOpenDisplay(NULL);
|
---|
1515 | if (dpy)
|
---|
1516 | {
|
---|
1517 | Bool glx_version = glXQueryVersion(dpy, &major, &minor);
|
---|
1518 | XCloseDisplay(dpy);
|
---|
1519 | if (glx_version)
|
---|
1520 | {
|
---|
1521 | printf("found version %u.%u, OK.\n", major, minor);
|
---|
1522 | return 0;
|
---|
1523 | }
|
---|
1524 | }
|
---|
1525 | printf("found (inactive), OK.\n");
|
---|
1526 | return 0;
|
---|
1527 | }
|
---|
1528 | EOF
|
---|
1529 | [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
|
---|
1530 | if test_compile "$LIBX11 $MESA $I_INCX11" Mesa Mesa; then
|
---|
1531 | [ $PASSIVE_MESA -eq 1 ] && unset DISPLAY
|
---|
1532 | test_execute
|
---|
1533 | fi
|
---|
1534 | }
|
---|
1535 |
|
---|
1536 |
|
---|
1537 | #
|
---|
1538 | # Check for the Qt5 library, needed by the VirtualBox frontend
|
---|
1539 | #
|
---|
1540 | # Currently not fatal.
|
---|
1541 | #
|
---|
1542 | check_qt5()
|
---|
1543 | {
|
---|
1544 | foundqt5=
|
---|
1545 | test_header Qt5
|
---|
1546 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1547 | #include <QtGlobal>
|
---|
1548 | extern "C" int main(void)
|
---|
1549 | {
|
---|
1550 | EOF
|
---|
1551 | echo "#if QT_VERSION >= $(($QT5MAJ*65536+$QT5MIN*256))" >> $ODIR.tmp_src.cc
|
---|
1552 | cat >> $ODIR.tmp_src.cc << EOF
|
---|
1553 | return 0;
|
---|
1554 | #else
|
---|
1555 | return 1;
|
---|
1556 | #endif
|
---|
1557 | }
|
---|
1558 | EOF
|
---|
1559 | if [ "$OS" = "darwin" ]; then
|
---|
1560 | # First check if there is the internal version of Qt. If yes nothing else
|
---|
1561 | # has to be done.
|
---|
1562 | QT_INTERNAL=`/bin/ls -rd1 $DEVDIR/$BUILD_TARGET.$BUILD_PLATFORM_ARCH/qt/* 2> /dev/null`
|
---|
1563 | for t in $QT_INTERNAL; do
|
---|
1564 | if [ -f "$t/Frameworks/QtCoreVBox.framework/QtCoreVBox" ]; then
|
---|
1565 | cnf_append "VBOX_WITH_ORACLE_QT" "1"
|
---|
1566 | log_success "use internal version"
|
---|
1567 | return
|
---|
1568 | fi
|
---|
1569 | done
|
---|
1570 | # Now try the user provided directory and some of the standard directories.
|
---|
1571 | QT_TRIES="$QT5DIR /System/Library /Library"
|
---|
1572 | for t in $QT_TRIES; do
|
---|
1573 | if [ -f "$t/Frameworks/QtCore.framework/QtCore" -o -f "$t/clang_64/lib/QtCore.framework/QtCore" ]; then
|
---|
1574 | PATH_SDK_QT5="$t"
|
---|
1575 | foundqt5=1
|
---|
1576 | break
|
---|
1577 | fi
|
---|
1578 | done
|
---|
1579 | # Add the necessary params for building the test application
|
---|
1580 | if [ -n "$PATH_SDK_QT5" ]; then
|
---|
1581 | if [ -f "$t/clang_64/lib/QtCore.framework/QtCore" ]; then
|
---|
1582 | INCQT5=-I$PATH_SDK_QT5/clang_64/lib/QtCore.framework/Headers
|
---|
1583 | LIBQT5=-F$PATH_SDK_QT5/clang_64/lib
|
---|
1584 | SDKQT5=$PATH_SDK_QT5/clang_64
|
---|
1585 | else
|
---|
1586 | INCQT5=-I$PATH_SDK_QT5/Frameworks/QtCore.framework/Headers
|
---|
1587 | LIBQT5=-F$PATH_SDK_QT5/Frameworks
|
---|
1588 | SDKQT5=$PATH_SDK_QT5
|
---|
1589 | fi
|
---|
1590 | FLGQT5="-framework QtCore -std=c++11 -Wl,-rpath,`L_to_PATH "$LIBQT5"`"
|
---|
1591 | else
|
---|
1592 | log_failure "Qt5 framework not found (can be disabled using --disable-qt)"
|
---|
1593 | fail
|
---|
1594 | fi
|
---|
1595 | else # !darwin
|
---|
1596 | if [ $QT5DIR_PKGCONFIG -eq 1 ]; then
|
---|
1597 | # Default is to use pkg-config:
|
---|
1598 | if which_wrapper pkg-config > /dev/null; then
|
---|
1599 | qt5_ver=`pkg-config Qt5Core --modversion 2>> $LOG`
|
---|
1600 | if [ $? -eq 0 ]; then
|
---|
1601 | echo "(Qt5 from pkg-config)" >> $LOG
|
---|
1602 | FLGQT5=`pkg-config Qt5Core --cflags`
|
---|
1603 | # gcc 4.8 is able to compile with C++11 (see also VBOX_GCC_std in Config.kmk)
|
---|
1604 | [ $(($cc_maj * 100 + $cc_min)) -ge 408 ] && FLGQT5="$FLGQT5 -std=c++11"
|
---|
1605 | INCQT5=`strip_I "$FLGQT5"`
|
---|
1606 | LIBDIR5=`pkg-config Qt5Core --variable=libdir`
|
---|
1607 | LIBQT5=`pkg-config Qt5Core Qt5Gui --libs`
|
---|
1608 | LIBQT5="-L$LIBDIR5 $LIBQT5"
|
---|
1609 | TOOLQT5=`pkg-config Qt5Core --variable=prefix`
|
---|
1610 | TOOLQT5BIN=`pkg-config Qt5Core --variable=host_bins`
|
---|
1611 | if test_compile "$LIBQT5 $LIBPTHREAD $FLGQT5" qt5 qt5 nofatal; then
|
---|
1612 | test_execute_path "`L_to_PATH "$LIBQT5"`" nofatal && foundqt5=3 # pkg-config
|
---|
1613 | fi
|
---|
1614 | fi
|
---|
1615 | else
|
---|
1616 | log_failure "pkg-config not found"
|
---|
1617 | fail
|
---|
1618 | fi
|
---|
1619 | fi
|
---|
1620 | if [ -z "$foundqt5" ]; then
|
---|
1621 | # Do it the old way (e.g. user has specified QT5DIR):
|
---|
1622 | for q in $QT5DIR "$DEVDIR/linux.$TARGET_MACHINE"/qt/v5.*; do
|
---|
1623 | echo "(Qt5 from '$q')" >> $LOG
|
---|
1624 | INCQT5="$q/include $q/include/QtCore"
|
---|
1625 | FLGQT5="-DQT_SHARED -std=c++11"
|
---|
1626 | I_INCQT5=`prefix_I "$INCQT5"`
|
---|
1627 | LIBQT5="-L$q/lib -lQt5CoreVBox -lQt5GuiVBox"
|
---|
1628 | TOOLQT5="$q"
|
---|
1629 | if test_compile "$LIBQT5 $LIBPTHREAD $I_INCQT5 $FLGQT5" qt5 qt5 nofatal &&
|
---|
1630 | test_execute_path "`L_to_PATH "$LIBQT5"`" nofatal; then
|
---|
1631 | foundqt5=2 # internal
|
---|
1632 | break;
|
---|
1633 | fi
|
---|
1634 | LIBQT5="-L$q/lib -lQt5Core -lQt5Gui"
|
---|
1635 | if test_compile "$LIBQT5 $LIBPTHREAD $I_INCQT5 $FLGQT5" qt5 qt5 nofatal &&
|
---|
1636 | test_execute_path "`L_to_PATH "$LIBQT5"`" nofatal; then
|
---|
1637 | foundqt5=1 # no pkg-config, Qt directory
|
---|
1638 | break;
|
---|
1639 | fi
|
---|
1640 | done
|
---|
1641 | fi
|
---|
1642 | fi
|
---|
1643 | if [ -n "$foundqt5" ]; then
|
---|
1644 | # We decided which version of Qt to use, now enforce the version requirement:
|
---|
1645 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1646 | #include <cstdio>
|
---|
1647 | #include <QtGlobal>
|
---|
1648 | extern "C" int main(void)
|
---|
1649 | {
|
---|
1650 | printf("found version %s", QT_VERSION_STR);
|
---|
1651 | EOF
|
---|
1652 | echo "#if QT_VERSION >= $(($QT5MAJ*65536+$QT5MIN*256))" >> $ODIR.tmp_src.cc
|
---|
1653 | cat >> $ODIR.tmp_src.cc << EOF
|
---|
1654 | printf(", OK.\n");
|
---|
1655 | return 0;
|
---|
1656 | #else
|
---|
1657 | EOF
|
---|
1658 | echo " printf(\", expected version $QT5MAJ.$QT5MIN or higher\\\\n\");" >> $ODIR.tmp_src.cc
|
---|
1659 | cat >> $ODIR.tmp_src.cc << EOF
|
---|
1660 | return 1;
|
---|
1661 | #endif
|
---|
1662 | }
|
---|
1663 | EOF
|
---|
1664 | [ -n "$INCQT5" ] && I_INCQT5=`prefix_I "$INCQT5"`
|
---|
1665 | if test_compile "$LIBQT5 $LIBPTHREAD $I_INCQT5 $FLGQT5" qt5 qt5 nofatal; then
|
---|
1666 | if test_execute_path "`L_to_PATH "$LIBQT5"`"; then
|
---|
1667 | if [ "$OS" = "darwin" ]; then
|
---|
1668 | # Successful build & run the test application so add the necessary
|
---|
1669 | # params to AutoConfig.kmk:
|
---|
1670 | cnf_append "PATH_SDK_QT5_INC" "`L_to_PATH "$LIBQT5"`"
|
---|
1671 | cnf_append "PATH_SDK_QT5_LIB" "`L_to_PATH "$LIBQT5"`"
|
---|
1672 | cnf_append "PATH_SDK_QT5" "$SDKQT5"
|
---|
1673 | # Check for the moc tool in the Qt directory found & some standard
|
---|
1674 | # directories.
|
---|
1675 | for q in $PATH_SDK_QT5 $PATH_SDK_QT5/clang_64 /usr /Developer/Tools/Qt; do
|
---|
1676 | if which_wrapper "$q/bin/moc" > /dev/null; then
|
---|
1677 | cnf_append "PATH_TOOL_QT5_BIN" "$q/bin"
|
---|
1678 | fi
|
---|
1679 | done
|
---|
1680 | else
|
---|
1681 | # Strip .../QtCore as we add components ourself:
|
---|
1682 | INCQT5=`echo "$INCQT5"|$KBUILD_SED 's|\([^ ]*\)/QtCore|\1|g; s| $||g'`
|
---|
1683 | # store only the first path, remove all other paths
|
---|
1684 | # most likely pkg-config gave us -I/usr/include/qt5 -I/usr/include/qt5/QtCore
|
---|
1685 | INCQT5=`echo "$INCQT5"|$KBUILD_SED 's|\([^ ]*\) .*|\1|'`
|
---|
1686 | cnf_append "VBOX_PATH_QT_LIB" "`strip_L "$LIBQT5"`"
|
---|
1687 | cnf_append "PATH_SDK_QT5_INC" "$INCQT5"
|
---|
1688 | # This is not quite right since the qt libpath does not have to be first...
|
---|
1689 | cnf_append "PATH_SDK_QT5_LIB" '$'"(firstword `strip_L "$LIBQT5"`)"
|
---|
1690 | if [ "$foundqt5" = "2" ]; then
|
---|
1691 | cnf_append "VBOX_WITH_ORACLE_QT" "1"
|
---|
1692 | fi
|
---|
1693 | if [ "$foundqt5" != "3" ]; then
|
---|
1694 | TOOLQT5BIN="$TOOLQT5/bin"
|
---|
1695 | fi
|
---|
1696 | test_header "Qt5 devtools"
|
---|
1697 | # Try it with a suffix, some platforms use that
|
---|
1698 | if which_wrapper "$TOOLQT5BIN/moc-qt5" > /dev/null; then
|
---|
1699 | QT5BINSUFF="-qt5"
|
---|
1700 | else
|
---|
1701 | QT5BINSUFF=""
|
---|
1702 | fi
|
---|
1703 | moc_ver=`$TOOLQT5BIN/moc$QT5BINSUFF -v 2>&1|sed 's+^.*(Qt \(.*\))+\1+'`
|
---|
1704 | if [ $? -ne 0 ]; then
|
---|
1705 | log_failure "moc$QT5BINSUFF not working"
|
---|
1706 | fail
|
---|
1707 | else
|
---|
1708 | log_success "found version $moc_ver"
|
---|
1709 | cnf_append "VBOX_PATH_QT" "$TOOLQT5"
|
---|
1710 | cnf_append "PATH_SDK_QT5" "$TOOLQT5"
|
---|
1711 | cnf_append "PATH_TOOL_QT5_BIN" "$TOOLQT5BIN"
|
---|
1712 | [ -n "$QT5BINSUFF" ] && cnf_append "TOOL_QT5_BIN_SUFF" "$QT5BINSUFF"
|
---|
1713 | fi
|
---|
1714 | fi
|
---|
1715 | fi
|
---|
1716 | else
|
---|
1717 | log_failure "qt5 not working"
|
---|
1718 | fail
|
---|
1719 | fi
|
---|
1720 | else
|
---|
1721 | log_failure "qt5 not found"
|
---|
1722 | fail
|
---|
1723 | fi
|
---|
1724 | }
|
---|
1725 |
|
---|
1726 |
|
---|
1727 | #
|
---|
1728 | # Check for libopus
|
---|
1729 | #
|
---|
1730 | check_libopus()
|
---|
1731 | {
|
---|
1732 | if [ -z "$BUILD_LIBOPUS" ]; then
|
---|
1733 | test_header libopus
|
---|
1734 | if which_wrapper pkg-config > /dev/null; then
|
---|
1735 | libopus_ver=`pkg-config opus --modversion 2>> $LOG`
|
---|
1736 | if [ $? -eq 0 ]; then
|
---|
1737 | FLGOPUS=`pkg-config opus --cflags`
|
---|
1738 | INCOPUS=`strip_I "$FLGOPUS"`
|
---|
1739 | LIBOPUS=`pkg-config opus --libs`
|
---|
1740 | fi
|
---|
1741 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1742 | #include <cstdio>
|
---|
1743 | #include <opus/opus.h>
|
---|
1744 | extern "C" int main(void)
|
---|
1745 | {
|
---|
1746 | OpusEncoder *test;
|
---|
1747 | printf("found, OK.\n");
|
---|
1748 | }
|
---|
1749 | EOF
|
---|
1750 | [ -n "$INCOPUS" ] && I_INCOPUS=`prefix_I "$INCOPUS"`
|
---|
1751 | if test_compile "$LIBOPUS $I_INCOPUS" opus opus; then
|
---|
1752 | if test_execute; then
|
---|
1753 | cnf_append "SDK_VBOX_OPUS_INCS" "$INCOPUS"
|
---|
1754 | cnf_append "SDK_VBOX_OPUS_LIBS" "`strip_l "$LIBOPUS"`"
|
---|
1755 | fi
|
---|
1756 | fi
|
---|
1757 | fi
|
---|
1758 | fi
|
---|
1759 | }
|
---|
1760 |
|
---|
1761 |
|
---|
1762 | #
|
---|
1763 | # Check for libvpx
|
---|
1764 | #
|
---|
1765 | check_vpx()
|
---|
1766 | {
|
---|
1767 | if [ -z "$BUILD_LIBVPX" ]; then
|
---|
1768 | test_header libvpx
|
---|
1769 | if which_wrapper pkg-config > /dev/null; then
|
---|
1770 | libvpx_ver=`pkg-config vpx --modversion 2>> $LOG`
|
---|
1771 | if [ $? -eq 0 ]; then
|
---|
1772 | FLGVPX=`pkg-config vpx --cflags`
|
---|
1773 | INCVPX=`strip_I "$FLGVPX"`
|
---|
1774 | LIBVPX=`pkg-config vpx --libs`
|
---|
1775 | fi
|
---|
1776 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1777 | #include <cstdio>
|
---|
1778 | #include <vpx/vpx_codec.h>
|
---|
1779 | extern "C" int main(void)
|
---|
1780 | {
|
---|
1781 | int version = vpx_codec_version();
|
---|
1782 | int verMajor = VPX_VERSION_MAJOR(version);
|
---|
1783 | int verMinor = VPX_VERSION_MINOR(version);
|
---|
1784 | int verPatch = VPX_VERSION_PATCH(version);
|
---|
1785 | printf("found version %d.%d.%d", verMajor, verMinor, verPatch);
|
---|
1786 | if ( verMajor == 1 && verMinor >= 0
|
---|
1787 | || verMajor == 0 && verMinor == 9 && verPatch >= 5)
|
---|
1788 | {
|
---|
1789 | printf(", OK.\n");
|
---|
1790 | return 0;
|
---|
1791 | }
|
---|
1792 | else
|
---|
1793 | {
|
---|
1794 | printf(", expected version 0.9.5 or higher\n");
|
---|
1795 | return 1;
|
---|
1796 | }
|
---|
1797 | }
|
---|
1798 | EOF
|
---|
1799 | [ -n "$INCVPX" ] && I_INCVPX=`prefix_I "$INCVPX"`
|
---|
1800 | if test_compile "$LIBVPX $I_INCVPX" vpx vpx; then
|
---|
1801 | if test_execute; then
|
---|
1802 | cnf_append "SDK_VBOX_VPX_INCS" "$INCVPX"
|
---|
1803 | cnf_append "SDK_VBOX_VPX_LIBS" "`strip_l "$LIBVPX"`"
|
---|
1804 | fi
|
---|
1805 | fi
|
---|
1806 | fi
|
---|
1807 | fi
|
---|
1808 | }
|
---|
1809 |
|
---|
1810 |
|
---|
1811 | #
|
---|
1812 | # Check for libtpms
|
---|
1813 | #
|
---|
1814 | check_libtpms()
|
---|
1815 | {
|
---|
1816 | if [ -z "$BUILD_LIBTPMS" ]; then
|
---|
1817 | test_header libtpms
|
---|
1818 | if which_wrapper pkg-config > /dev/null; then
|
---|
1819 | libtpms_ver=`pkg-config libtpms --modversion 2>> $LOG`
|
---|
1820 | if [ $? -eq 0 ]; then
|
---|
1821 | FLGTPMS=`pkg-config libtpms --cflags`
|
---|
1822 | INCTPMS=`strip_I "$FLGTPMS"`
|
---|
1823 | LIBTPMS=`pkg-config libtpms --libs`
|
---|
1824 | fi
|
---|
1825 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1826 | #include <cstdio>
|
---|
1827 | #include <libtpms/tpm_library.h>
|
---|
1828 | extern "C" int main(void)
|
---|
1829 | {
|
---|
1830 | TPMLIB_MainInit();
|
---|
1831 | printf("found, OK.\n");
|
---|
1832 | }
|
---|
1833 | EOF
|
---|
1834 | [ -n "$INCTPMS" ] && I_INCTPMS=`prefix_I "$INCTPMS"`
|
---|
1835 | if test_compile "$LIBTPMS $I_INCTPMS" libtpms libtpms nofatal; then
|
---|
1836 | if test_execute; then
|
---|
1837 | cnf_append "SDK_VBOX_TPMS_INCS" "$INCTPMS"
|
---|
1838 | cnf_append "SDK_VBOX_TPMS_LIBS" "`strip_l "$LIBTPMS"`"
|
---|
1839 | fi
|
---|
1840 | else
|
---|
1841 | echo "not found -- building libtpms from in-tree code."
|
---|
1842 | fi
|
---|
1843 | fi
|
---|
1844 | fi
|
---|
1845 | }
|
---|
1846 |
|
---|
1847 |
|
---|
1848 | #
|
---|
1849 | # Check whether static libstdc++ is installed. This library is required
|
---|
1850 | # for the Linux guest additions.
|
---|
1851 | #
|
---|
1852 | check_staticlibstdcxx()
|
---|
1853 | {
|
---|
1854 | test_header "static stc++ library"
|
---|
1855 | libstdcxx=`$CXX -print-file-name=libstdc++.a`
|
---|
1856 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1857 | #include <string>
|
---|
1858 |
|
---|
1859 | extern "C" int main(void)
|
---|
1860 | {
|
---|
1861 | std::string s = "test";
|
---|
1862 | return 0;
|
---|
1863 | }
|
---|
1864 | EOF
|
---|
1865 | if test_compile "$libstdcxx" libstdc++ libstdc++; then
|
---|
1866 | log_success "found"
|
---|
1867 | fi
|
---|
1868 | }
|
---|
1869 |
|
---|
1870 |
|
---|
1871 | #
|
---|
1872 | # Check for Linux sources
|
---|
1873 | #
|
---|
1874 | check_linux()
|
---|
1875 | {
|
---|
1876 | test_header "Linux kernel sources"
|
---|
1877 | cat > $ODIR.tmp_src.c << EOF
|
---|
1878 | #include <linux/version.h>
|
---|
1879 | int printf(const char *format, ...);
|
---|
1880 | int main(void)
|
---|
1881 | {
|
---|
1882 | printf("found version %d.%d.%d", LINUX_VERSION_CODE / 65536,
|
---|
1883 | (LINUX_VERSION_CODE % 65536) / 256,
|
---|
1884 | LINUX_VERSION_CODE % 256);
|
---|
1885 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,0)
|
---|
1886 | printf(", OK.\n");
|
---|
1887 | return 0;
|
---|
1888 | #else
|
---|
1889 | printf(", expected version 2.4.0 or higher\n");
|
---|
1890 | return 1;
|
---|
1891 | #endif
|
---|
1892 | }
|
---|
1893 | EOF
|
---|
1894 | echo "compiling the following source file:" >> $LOG
|
---|
1895 | cat $ODIR.tmp_src.c >> $LOG
|
---|
1896 | echo "using the following command line:" >> $LOG
|
---|
1897 | echo "$CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include " \
|
---|
1898 | "-I$LINUX/include/generated/uapi" >> $LOG
|
---|
1899 | $CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include \
|
---|
1900 | -I$LINUX/include/generated/uapi >> $LOG 2>&1
|
---|
1901 | if [ $? -ne 0 ]; then
|
---|
1902 | echo
|
---|
1903 | echo " Linux kernel headers not found at $LINUX"
|
---|
1904 | echo " Check the file $LOG for detailed error information."
|
---|
1905 | fail
|
---|
1906 | else
|
---|
1907 | if test_execute; then
|
---|
1908 | cnf_append "VBOX_LINUX_SRC" "`cd $LINUX ; pwd`"
|
---|
1909 | fi
|
---|
1910 | fi
|
---|
1911 | }
|
---|
1912 |
|
---|
1913 | #
|
---|
1914 | # Check for kchmviewer, needed to display the online help
|
---|
1915 | # (unused as we ship kchmviewer)
|
---|
1916 | #
|
---|
1917 | check_kchmviewer()
|
---|
1918 | {
|
---|
1919 | test_header kchmviewer
|
---|
1920 | if check_avail "$KCHMVIEWER" KCHMVIEWER; then
|
---|
1921 | kchmviewer_ver=`$KCHMVIEWER --version|grep "^KchmViewer:"|sed 's+^KchmViewer: \(.*\)+\1+'`
|
---|
1922 | if [ $? -ne 0 ]; then
|
---|
1923 | log_failure "kchmviewer not working"
|
---|
1924 | fail
|
---|
1925 | else
|
---|
1926 | log_success "found version $kchmviewer_ver"
|
---|
1927 | fi
|
---|
1928 | fi
|
---|
1929 | }
|
---|
1930 |
|
---|
1931 |
|
---|
1932 | #
|
---|
1933 | # Check for the kBuild tools, we don't support GNU make
|
---|
1934 | #
|
---|
1935 | check_kbuild()
|
---|
1936 | {
|
---|
1937 | test_header kBuild
|
---|
1938 | if which_wrapper "$KBUILDDIR/bin/$OS.$BUILD_MACHINE/kmk" > /dev/null; then
|
---|
1939 | KBUILDDIR_BIN="$KBUILDDIR/bin/$OS.$BUILD_MACHINE"
|
---|
1940 |
|
---|
1941 | echo "KBUILD_PATH=\"`cd $KBUILDDIR ; pwd`\"" >> $ENV
|
---|
1942 | echo "KBUILD_DEVTOOLS=\"$DEVDIR\"" >> $ENV
|
---|
1943 | echo 'path_kbuild_bin="$KBUILD_PATH/bin/$BUILD_TARGET.$BUILD_PLATFORM_ARCH"' >> $ENV
|
---|
1944 | echo 'path_tools_bin="$KBUILD_DEVTOOLS/$BUILD_TARGET.$BUILD_PLATFORM_ARCH/bin"' >> $ENV
|
---|
1945 |
|
---|
1946 | if [ "$OS" = "solaris" ]; then
|
---|
1947 | # Because of sh being non-default shell in Solaris we need to export PATH again when
|
---|
1948 | # sourcing env.sh. Simply exporting from ./configure does not export PATH correctly.
|
---|
1949 | echo "PATH=\"$ORGPATH\"" >> $ENV
|
---|
1950 | echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
|
---|
1951 | echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_tools_bin\" || PATH=\"\$path_tools_bin:\$PATH\"" >> $ENV
|
---|
1952 | else
|
---|
1953 | echo "echo \"\$PATH\" | grep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
|
---|
1954 | echo "echo \"\$PATH\" | grep -q \"\$path_tools_bin\" || PATH=\"\$path_tools_bin:\$PATH\"" >> $ENV
|
---|
1955 | fi
|
---|
1956 | echo "export KBUILD_PATH KBUILD_DEVTOOLS PATH" >> $ENV
|
---|
1957 | echo "unset path_kbuild_bin path_tools_bin" >> $ENV
|
---|
1958 | KBUILD_SED="$KBUILDDIR_BIN/kmk_sed"
|
---|
1959 |
|
---|
1960 | echo '' >> $ENV
|
---|
1961 | echo "# Legacy - do not use:" >> $ENV
|
---|
1962 | echo 'PATH_KBUILD=${KBUILD_PATH}' >> $ENV
|
---|
1963 | echo 'PATH_DEVTOOLS=${KBUILD_DEVTOOLS}' >> $ENV
|
---|
1964 | echo 'export PATH_KBUILD PATH_DEVTOOLS' >> $ENV
|
---|
1965 | echo '' >> $ENV
|
---|
1966 | elif check_avail "kmk" KBUILDDIR really; then
|
---|
1967 | # check for installed kBuild
|
---|
1968 | KBUILD_SED="`which_wrapper kmk_sed`"
|
---|
1969 | else
|
---|
1970 | fail
|
---|
1971 | fi
|
---|
1972 | log_success "found"
|
---|
1973 | }
|
---|
1974 |
|
---|
1975 |
|
---|
1976 | #
|
---|
1977 | # Check for compiler.h
|
---|
1978 | # Some Linux distributions include "compiler.h" in their libc linux
|
---|
1979 | # headers package, some don't. Most don't need it, building might (!)
|
---|
1980 | # not succeed on openSUSE without it.
|
---|
1981 | #
|
---|
1982 | # See http://www.mail-archive.com/qemu-devel%40nongnu.org/msg07980.html
|
---|
1983 | #
|
---|
1984 | check_compiler_h()
|
---|
1985 | {
|
---|
1986 | test_header compiler.h
|
---|
1987 | if test ! -f "/usr/include/linux/compiler.h"; then
|
---|
1988 | log_success "compiler.h not found"
|
---|
1989 | else
|
---|
1990 | cnf_append "VBOX_WITH_LINUX_COMPILER_H" "1"
|
---|
1991 | log_success "compiler.h found"
|
---|
1992 | fi
|
---|
1993 | }
|
---|
1994 |
|
---|
1995 | #
|
---|
1996 | # Check for libcap.
|
---|
1997 | # Required to pass CAP_NET_RAW to our binaries to allow to open SOCK_RAW
|
---|
1998 | # sockets for doing ICMP requests.
|
---|
1999 | #
|
---|
2000 | check_libcap()
|
---|
2001 | {
|
---|
2002 | test_header "libcap library"
|
---|
2003 | cat > $ODIR.tmp_src.cc << EOF
|
---|
2004 | #include <cstdio>
|
---|
2005 | #include <sys/types.h>
|
---|
2006 | #include <linux/types.h>
|
---|
2007 | #include <sys/capability.h>
|
---|
2008 |
|
---|
2009 | extern "C" int main(void)
|
---|
2010 | {
|
---|
2011 | char buf[1024];
|
---|
2012 | cap_t caps = cap_get_proc();
|
---|
2013 | snprintf(buf, sizeof(buf), "Current caps are '%s'\n", cap_to_text(caps, NULL));
|
---|
2014 | return 0;
|
---|
2015 | }
|
---|
2016 | EOF
|
---|
2017 | if test_compile $LIBCAP libcap libcap; then
|
---|
2018 | if test_execute; then
|
---|
2019 | log_success "found"
|
---|
2020 | fi
|
---|
2021 | fi
|
---|
2022 | }
|
---|
2023 |
|
---|
2024 | #
|
---|
2025 | # Check if we are able to build 32-bit applications (needed for the guest additions)
|
---|
2026 | #
|
---|
2027 | check_32bit()
|
---|
2028 | {
|
---|
2029 | test_header "32-bit support"
|
---|
2030 | cat > $ODIR.tmp_src.c << EOF
|
---|
2031 | #include <stdint.h>
|
---|
2032 | int main(void)
|
---|
2033 | {
|
---|
2034 | return 0;
|
---|
2035 | }
|
---|
2036 | EOF
|
---|
2037 | echo "compiling the following source file:" >> $LOG
|
---|
2038 | cat $ODIR.tmp_src.c >> $LOG
|
---|
2039 | echo "using the following command line:" >> $LOG
|
---|
2040 | echo "$CC -m32 -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c" >> $LOG
|
---|
2041 | $CC -m32 -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c >> $LOG 2>&1
|
---|
2042 | if [ $? -ne 0 ]; then
|
---|
2043 | echo
|
---|
2044 | echo " Cannot compile 32-bit applications (missing headers and/or libraries)!"
|
---|
2045 | echo " Check the file $LOG for detailed error information."
|
---|
2046 | fail
|
---|
2047 | else
|
---|
2048 | echo "executing the binary" >> $LOG
|
---|
2049 | $ODIR.tmp_out 2> $ODIR.test_execute.log
|
---|
2050 | rc=$?
|
---|
2051 | cat $ODIR.test_execute.log >> $LOG
|
---|
2052 | if [ $rc -ne 0 ]; then
|
---|
2053 | echo
|
---|
2054 | echo " Cannot execute 32-bit applications! Either enable 32-bit support in the"
|
---|
2055 | echo " kernel configuration or use --disable-vmmraw to disable 32-bit guests."
|
---|
2056 | fail
|
---|
2057 | return 1
|
---|
2058 | fi
|
---|
2059 | fi
|
---|
2060 | log_success ""
|
---|
2061 | }
|
---|
2062 |
|
---|
2063 |
|
---|
2064 | #
|
---|
2065 | # Check for Python
|
---|
2066 | #
|
---|
2067 | check_python()
|
---|
2068 | {
|
---|
2069 | test_header "Python support"
|
---|
2070 |
|
---|
2071 | # On darwin this is a on/off decision only
|
---|
2072 | if [ "$OS" = "darwin" ]; then
|
---|
2073 | echo "enabled"
|
---|
2074 | cnf_append "VBOX_WITH_PYTHON" "1"
|
---|
2075 | return
|
---|
2076 | fi
|
---|
2077 |
|
---|
2078 | cat > $ODIR.tmp_src.cc << EOF
|
---|
2079 | #include <cstdio>
|
---|
2080 | #include <Python.h>
|
---|
2081 | extern "C" int main(void)
|
---|
2082 | {
|
---|
2083 | Py_Initialize();
|
---|
2084 | printf("found version %s", PY_VERSION);
|
---|
2085 | #if PY_VERSION_HEX >= 0x02060000
|
---|
2086 | printf(", OK.\n");
|
---|
2087 | return 0;
|
---|
2088 | #else
|
---|
2089 | printf(", expected version 2.6 or higher\n");
|
---|
2090 | return 1;
|
---|
2091 | #endif
|
---|
2092 | }
|
---|
2093 | EOF
|
---|
2094 | found=
|
---|
2095 | SUPPYTHONLIBS="python2.7 python2.6 python3.1 python3.2 python3.3 python3.4 python3.4m python3.5 python3.5m python3.6 python3.6m python3.7 python3.7m python3.8 python3.8m python3.9 python3.9m python3.10 python3.10m"
|
---|
2096 | for p in $PYTHONDIR; do
|
---|
2097 | for d in $SUPPYTHONLIBS; do
|
---|
2098 | for b in lib/x86_64-linux-gnu lib/i386-linux-gnu lib64 lib/64 lib; do
|
---|
2099 | echo "compiling the following source file:" >> $LOG
|
---|
2100 | cat $ODIR.tmp_src.cc >> $LOG
|
---|
2101 | echo "using the following command line:" >> $LOG
|
---|
2102 | echo "$CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so" >> $LOG
|
---|
2103 | $CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so >> $LOG 2>&1
|
---|
2104 | if [ $? -eq 0 ]; then
|
---|
2105 | found=1
|
---|
2106 | break
|
---|
2107 | fi
|
---|
2108 | done
|
---|
2109 | if [ -n "$found" ]; then break; fi
|
---|
2110 | done
|
---|
2111 | if [ -n "$found" ]; then break; fi
|
---|
2112 | done
|
---|
2113 | if [ -n "$found" ]; then
|
---|
2114 | if test_execute; then
|
---|
2115 | cnf_append "VBOX_WITH_PYTHON" "1"
|
---|
2116 | cnf_append "VBOX_PATH_PYTHON_INC" "$p/include/$d"
|
---|
2117 | cnf_append "VBOX_LIB_PYTHON" "$p/$b/lib$d.so"
|
---|
2118 | else
|
---|
2119 | log_failure "Python not working"
|
---|
2120 | fail
|
---|
2121 | fi
|
---|
2122 | else
|
---|
2123 | log_failure "Python not found"
|
---|
2124 | fail
|
---|
2125 | fi
|
---|
2126 | }
|
---|
2127 |
|
---|
2128 |
|
---|
2129 | #
|
---|
2130 | # Check for Java
|
---|
2131 | #
|
---|
2132 | check_java()
|
---|
2133 | {
|
---|
2134 | test_header "Java support"
|
---|
2135 | log_success
|
---|
2136 | }
|
---|
2137 |
|
---|
2138 |
|
---|
2139 | #
|
---|
2140 | # Setup wine
|
---|
2141 | #
|
---|
2142 | setup_wine()
|
---|
2143 | {
|
---|
2144 | test_header "Wine support"
|
---|
2145 | if ! which_wrapper wine > /dev/null; then
|
---|
2146 | echo " wine binary not found"
|
---|
2147 | fail
|
---|
2148 | fi
|
---|
2149 | if ! which_wrapper wine > /dev/null; then
|
---|
2150 | echo " wine not found"
|
---|
2151 | fail
|
---|
2152 | fi
|
---|
2153 | wine_version="`wine --version`"
|
---|
2154 | case "`expr "$wine_version" : 'wine-\([0-9.]*\)' '>' 1.1.43`" in
|
---|
2155 | "0")
|
---|
2156 | if ! which_wrapper wineprefixcreate > /dev/null; then
|
---|
2157 | echo " wineprefixcreate not found"
|
---|
2158 | fail
|
---|
2159 | fi
|
---|
2160 | ;;
|
---|
2161 | *) eval "wineprefixcreate() { true ; }" ;; # now created automatically
|
---|
2162 | esac
|
---|
2163 | export WINEPREFIX="${ODIR}wine.$BUILD_MACHINE"
|
---|
2164 | echo "WINEPREFIX=\"${ODIR}wine.$BUILD_MACHINE\"" >> $ENV
|
---|
2165 | echo "export WINEPREFIX" >> $ENV
|
---|
2166 | rm -rf $WINEPREFIX
|
---|
2167 | mkdir -p $WINEPREFIX
|
---|
2168 | touch $WINEPREFIX/.no_prelaunch_window_flag
|
---|
2169 | if ! wineprefixcreate -q > /dev/null 2>&1; then
|
---|
2170 | echo " wineprefixcreate failed"
|
---|
2171 | fail
|
---|
2172 | fi
|
---|
2173 | tmp=.tmp.wine.reg
|
---|
2174 | rm -f $tmp
|
---|
2175 | echo 'REGEDIT4' > $tmp
|
---|
2176 | echo '' >> $tmp
|
---|
2177 | echo '[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment]' >> $tmp
|
---|
2178 | 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
|
---|
2179 | echo '' >> $tmp
|
---|
2180 | echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhc.exe\DllOverrides]' >> $tmp
|
---|
2181 | echo '"itss"="native"' >> $tmp
|
---|
2182 | echo '' >> $tmp
|
---|
2183 | echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhw.exe\DllOverrides]' >> $tmp
|
---|
2184 | echo '"itss"="native"' >> $tmp
|
---|
2185 | echo '' >> $tmp
|
---|
2186 | if ! wine regedit $tmp > /dev/null 2>&1; then
|
---|
2187 | rm -f $tmp
|
---|
2188 | echo " failed to load registry changes (path)."
|
---|
2189 | fail
|
---|
2190 | fi
|
---|
2191 | rm -f $tmp
|
---|
2192 | log_success "found"
|
---|
2193 | }
|
---|
2194 |
|
---|
2195 |
|
---|
2196 | #
|
---|
2197 | # Check for gSOAP.
|
---|
2198 | #
|
---|
2199 | check_gsoap()
|
---|
2200 | {
|
---|
2201 | test_header "GSOAP compiler"
|
---|
2202 | if [ -z "$GSOAP" -a -z "$GSOAP_IMPORT" ]; then
|
---|
2203 | if which_wrapper pkg-config > /dev/null; then
|
---|
2204 | GSOAP_CXX_LIBS=`pkg-config gsoapssl++ --libs 2>> $LOG`
|
---|
2205 | if [ $? -eq 0 ]; then
|
---|
2206 | GSOAP=`pkg-config gsoapssl++ --variable=exec_prefix`
|
---|
2207 | GSOAP_IMPORT="$GSOAP/share/gsoap/import"
|
---|
2208 | if [ ! -d "$GSOAP_IMPORT" -a -d "$GSOAP/include/gsoap" ]; then
|
---|
2209 | GSOAP_IMPORT="$GSOAP/include/gsoap"
|
---|
2210 | fi
|
---|
2211 | cnf_append "VBOX_GSOAP_INSTALLED" "1"
|
---|
2212 | cnf_append "VBOX_PATH_GSOAP" "$GSOAP"
|
---|
2213 | cnf_append "VBOX_PATH_GSOAP_IMPORT" "$GSOAP_IMPORT"
|
---|
2214 | if [ -f "$GSOAP/share/gsoap/stdsoap2.cpp" ]; then
|
---|
2215 | cnf_append "VBOX_GSOAP_CXX_SOURCES" "$GSOAP/share/gsoap/stdsoap2.cpp"
|
---|
2216 | else
|
---|
2217 | cnf_append "VBOX_GSOAP_CXX_SOURCES" ""
|
---|
2218 | fi
|
---|
2219 | cnf_append "VBOX_GSOAP_CXX_LIBS" "`strip_l "$GSOAP_CXX_LIBS"`"
|
---|
2220 | gsoap_version=`pkg-config gsoapssl++ --modversion`
|
---|
2221 | log_success "found version $gsoap_version"
|
---|
2222 | return
|
---|
2223 | fi
|
---|
2224 | fi
|
---|
2225 | if [ -d "$DEVDIR/common/gsoap" ]; then
|
---|
2226 | GSOAP_DIR=`ls -d1 "$DEVDIR"/common/gsoap/v* 2>/dev/null | tail -1`
|
---|
2227 | if [ -n "$GSOAP_DIR" -a -d "$GSOAP_DIR" ]; then
|
---|
2228 | gsoap_version=`echo "$GSOAP_DIR" | sed -ne 's/^.*\/v\([1-9][0-9.]*\).*$/\1/p'`
|
---|
2229 | log_success "found gSOAP tool version $gsoap_version"
|
---|
2230 | # No need to configure anything, the build system knows what to do.
|
---|
2231 | return
|
---|
2232 | fi
|
---|
2233 | fi
|
---|
2234 | fi
|
---|
2235 | if [ -z "$GSOAP" ]; then
|
---|
2236 | GSOAP="/usr"
|
---|
2237 | fi
|
---|
2238 | if which_wrapper "$GSOAP/bin/soapcpp2" > /dev/null; then
|
---|
2239 | if which_wrapper "$GSOAP/bin/wsdl2h" > /dev/null; then
|
---|
2240 | if [ -f "$GSOAP/include/stdsoap2.h" ]; then
|
---|
2241 | # TODO: Check for libgsoap++.a/so
|
---|
2242 |
|
---|
2243 | if [ -z "$GSOAP_IMPORT" ]; then
|
---|
2244 | GSOAP_IMPORT="$GSOAP/share/gsoap/import"
|
---|
2245 | if [ ! -d "$GSOAP_IMPORT" -a -d "$GSOAP/include/gsoap" ]; then
|
---|
2246 | GSOAP_IMPORT="$GSOAP/include/gsoap"
|
---|
2247 | fi
|
---|
2248 | fi
|
---|
2249 | if [ -f "$GSOAP_IMPORT/stlvector.h" ]; then
|
---|
2250 | cnf_append "VBOX_GSOAP_INSTALLED" "1"
|
---|
2251 | cnf_append "VBOX_PATH_GSOAP" "$GSOAP"
|
---|
2252 | cnf_append "VBOX_PATH_GSOAP_IMPORT" "$GSOAP_IMPORT"
|
---|
2253 | if [ -f "$GSOAP/share/gsoap/stdsoap2.cpp" ]; then
|
---|
2254 | cnf_append "VBOX_GSOAP_CXX_SOURCES" "$GSOAP/share/gsoap/stdsoap2.cpp"
|
---|
2255 | else
|
---|
2256 | cnf_append "VBOX_GSOAP_CXX_SOURCES" ""
|
---|
2257 | fi
|
---|
2258 | cnf_append "VBOX_GSOAP_CXX_LIBS" "libgsoapssl++"
|
---|
2259 | log_success "found"
|
---|
2260 | else
|
---|
2261 | log_failure "stlvector.h not found -- disabling webservice"
|
---|
2262 | cnf_append "VBOX_WITH_WEBSERVICES" ""
|
---|
2263 | fi
|
---|
2264 | else
|
---|
2265 | log_failure "stdsoap2.h not found -- disabling webservice"
|
---|
2266 | cnf_append "VBOX_WITH_WEBSERVICES" ""
|
---|
2267 | fi
|
---|
2268 | else
|
---|
2269 | log_failure "wsdl2h not found -- disabling webservice"
|
---|
2270 | cnf_append "VBOX_WITH_WEBSERVICES" ""
|
---|
2271 | fi
|
---|
2272 | else
|
---|
2273 | log_failure "soapcpp2 not found -- disabling webservice"
|
---|
2274 | cnf_append "VBOX_WITH_WEBSERVICES" ""
|
---|
2275 | fi
|
---|
2276 | }
|
---|
2277 |
|
---|
2278 |
|
---|
2279 | #
|
---|
2280 | # Determines the Darwin version.
|
---|
2281 | #
|
---|
2282 | check_darwinversion()
|
---|
2283 | {
|
---|
2284 | test_header "Darwin version"
|
---|
2285 | darwin_ver=`uname -r`
|
---|
2286 | case "$darwin_ver" in
|
---|
2287 | 20\.*)
|
---|
2288 | darwin_ver="11.0" # Big Sur
|
---|
2289 | ;;
|
---|
2290 | 19\.*)
|
---|
2291 | darwin_ver="10.15" # Catalina
|
---|
2292 | ;;
|
---|
2293 | 18\.*)
|
---|
2294 | darwin_ver="10.14" # Mojave
|
---|
2295 | ;;
|
---|
2296 | 17\.*)
|
---|
2297 | darwin_ver="10.13" # High Sierra
|
---|
2298 | ;;
|
---|
2299 | 16\.*)
|
---|
2300 | darwin_ver="10.12" # Sierra
|
---|
2301 | ;;
|
---|
2302 | 15\.*)
|
---|
2303 | darwin_ver="10.11" # El Capitan
|
---|
2304 | ;;
|
---|
2305 | 14\.*)
|
---|
2306 | darwin_ver="10.10" # Yosemite
|
---|
2307 | ;;
|
---|
2308 | 13\.*)
|
---|
2309 | darwin_ver="10.9" # Mavericks
|
---|
2310 | ;;
|
---|
2311 | *)
|
---|
2312 | echo " failed to determine Darwin version. (uname -r: $darwin_ver)"
|
---|
2313 | fail
|
---|
2314 | darwin_ver="unknown"
|
---|
2315 | ;;
|
---|
2316 | esac
|
---|
2317 |
|
---|
2318 | log_success "found version $darwin_ver"
|
---|
2319 | }
|
---|
2320 |
|
---|
2321 | #
|
---|
2322 | # Check Xcode path
|
---|
2323 | #
|
---|
2324 | check_xcode_path()
|
---|
2325 | {
|
---|
2326 | # Check if WITH_XCODE_DIR is set.
|
---|
2327 | if [ -z "$WITH_XCODE_DIR" ]; then
|
---|
2328 | if [ -d "/Library/Developer/CommandLineTools" -a -f "/Library/Developer/CommandLineTools/usr/bin/clang" ]; then
|
---|
2329 | return 1
|
---|
2330 | else
|
---|
2331 | echo "Please specify --with-xcode-dir option."
|
---|
2332 | return 0
|
---|
2333 | fi
|
---|
2334 | fi
|
---|
2335 |
|
---|
2336 | # Check if specified path exists and is a directory containing Xcode.
|
---|
2337 | if [ -d "$1" -a -f "$1/Contents/Developer/usr/bin/xcodebuild" ]; then
|
---|
2338 | return 1
|
---|
2339 | else
|
---|
2340 | echo "Xcode path [$1] not found."
|
---|
2341 | return 0
|
---|
2342 | fi
|
---|
2343 | }
|
---|
2344 |
|
---|
2345 | check_xcode()
|
---|
2346 | {
|
---|
2347 | test_header "Xcode and SDK"
|
---|
2348 | check_xcode_path "$WITH_XCODE_DIR"
|
---|
2349 | [ $? -eq 1 ] || fail
|
---|
2350 |
|
---|
2351 | # Pick the oldest SDK offered by Xcode, to get maximum compatibility
|
---|
2352 | if [ -z "$WITH_XCODE_DIR" ]; then
|
---|
2353 | devel_subdir="/Library/Developer/CommandLineTools"
|
---|
2354 | sdk_subdir="$devel_subdir/SDKs"
|
---|
2355 | else
|
---|
2356 | devel_subdir="$WITH_XCODE_DIR/Contents/Developer"
|
---|
2357 | sdk_subdir="$devel_subdir/Platforms/MacOSX.platform/Developer/SDKs"
|
---|
2358 | fi
|
---|
2359 | sdk_tries="$sdk_subdir"/MacOSX10.?.sdk" $sdk_subdir"/MacOSX10.??.sdk" $sdk_subdir"/MacOSX.sdk
|
---|
2360 | for t in $sdk_tries; do
|
---|
2361 | if [ -f "$t/SDKSettings.plist" ]; then
|
---|
2362 | sdk="$t"
|
---|
2363 | sdk_ver=`defaults read "$t/SDKSettings.plist" Version`
|
---|
2364 | break
|
---|
2365 | fi
|
---|
2366 | done
|
---|
2367 | if [ -z "$sdk" ]; then
|
---|
2368 | echo " failed to determine SDK directory. ($sdk_subdir/MacOSX*.sdk/SDKSettings.plist should exist)"
|
---|
2369 | fail
|
---|
2370 | fi
|
---|
2371 | xcode_ver=`$devel_subdir/usr/bin/clang --version | sed -n 's/^.*version \([0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\).*$/\1/p'`
|
---|
2372 | if [ $? -ne 0 -o -z "$xcode_ver" ]; then
|
---|
2373 | echo " failed to determine Xcode version."
|
---|
2374 | fail
|
---|
2375 | fi
|
---|
2376 |
|
---|
2377 | if [ -z "$WITH_XCODE_DIR" ]; then
|
---|
2378 | cnf_append "VBOX_WITH_EVEN_NEWER_XCODE" "1"
|
---|
2379 | else
|
---|
2380 | cnf_append "VBOX_WITH_MACOSX_COMPILERS_FROM_DEVEL" "1"
|
---|
2381 | cnf_append "PATH_TOOL_VBoxXcode62" "$devel_subdir"
|
---|
2382 | cnf_append "VBOX_PATH_MACOSX_DEVEL_ROOT" "$devel_subdir"
|
---|
2383 | fi
|
---|
2384 | cnf_append "VBOX_PATH_MACOSX_SDK" "$sdk"
|
---|
2385 | if [ -n "$sdk_ver" ]; then
|
---|
2386 | cnf_append "VBOX_DEF_MACOSX_VERSION_MIN" "$sdk_ver"
|
---|
2387 | cnf_append "VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6" "1"
|
---|
2388 | fi
|
---|
2389 |
|
---|
2390 | log_success "found version $xcode_ver (SDK: $sdk)"
|
---|
2391 | }
|
---|
2392 |
|
---|
2393 |
|
---|
2394 | check_makeself()
|
---|
2395 | {
|
---|
2396 | test_header "makeself"
|
---|
2397 | if check_avail "$MAKESELF" makeself; then
|
---|
2398 | makeself_ver=`$MAKESELF --version|grep version|sed 's+^Makeself.*version \([0-9\.]*\).*+\1+'`
|
---|
2399 | if [ $? -ne 0 ]; then
|
---|
2400 | log_failure "makeself not working"
|
---|
2401 | fail
|
---|
2402 | else
|
---|
2403 | log_success "found version $makeself_ver"
|
---|
2404 | cnf_append "VBOX_MAKESELF" "`which_wrapper $MAKESELF`"
|
---|
2405 | fi
|
---|
2406 | fi
|
---|
2407 | }
|
---|
2408 |
|
---|
2409 |
|
---|
2410 | #
|
---|
2411 | # Show help
|
---|
2412 | #
|
---|
2413 | show_help()
|
---|
2414 | {
|
---|
2415 | cat << EOF
|
---|
2416 | Usage: ./configure [OPTIONS]...
|
---|
2417 |
|
---|
2418 | Configuration:
|
---|
2419 | -h, --help display this help and exit
|
---|
2420 | --nofatal don't abort on errors
|
---|
2421 | EOF
|
---|
2422 | [ $WITH_XPCOM -eq 1 ] && echo " --disable-xpcom disable XPCOM and related stuff"
|
---|
2423 | [ $WITH_PYTHON -eq 1 ] && echo " --disable-python disable python bindings"
|
---|
2424 | [ $WITH_JAVA -eq 1 ] && echo " --disable-java disable java bindings"
|
---|
2425 | [ $WITH_VMMRAW -eq 1 ] && echo " --disable-vmmraw disable VMM raw mode (VT-x/AMD-V mandatory!)"
|
---|
2426 | [ $WITH_SDL_TTF -eq 1 ] && echo " --disable-sdl-ttf disable SDL_ttf detection"
|
---|
2427 | [ $WITH_QT5 -eq 1 ] && echo " --disable-qt disable Qt detection"
|
---|
2428 | [ $WITH_ALSA -eq 1 ] && echo " --disable-alsa disable the ALSA sound backend"
|
---|
2429 | [ $WITH_PULSE -eq 1 ] && echo " --disable-pulse disable the PulseAudio backend"
|
---|
2430 | [ $WITH_DBUS -eq 1 ] && echo " --disable-dbus don't use DBus and hal for hardware detection"
|
---|
2431 | [ $WITH_KMODS -eq 1 ] && echo " --disable-kmods don't build Linux kernel modules (host and guest)"
|
---|
2432 | [ $WITH_OPENGL -eq 1 ] && echo " --disable-opengl disable OpenGL support (2D & 3D)"
|
---|
2433 | [ $WITH_QT5 -eq 0 ] && echo " --enable-qt5 enable Qt5 detection"
|
---|
2434 | [ $OSE -eq 1 ] && echo " --enable-vnc enable the VNC server"
|
---|
2435 | [ $OSE -eq 0 ] && echo " --disable-extpack don't build the extpack"
|
---|
2436 | [ $WITH_DOCS -eq 1 ] && echo " --disable-docs don't build the documentation"
|
---|
2437 | [ $WITH_LIBVPX -eq 1 ] && echo " --disable-libvpx don't use libvpx for video capturing"
|
---|
2438 | [ $WITH_LIBOPUS -eq 1 ] && echo " --disable-libopus don't use libopus for audio capturing"
|
---|
2439 | [ $WITH_LIBTPMS -eq 1 ] && echo " --disable-libtpms don't use libtpms for TPM emulation"
|
---|
2440 | [ "$OS" = "linux" -o "$OS" = "freebsd" ] && echo " --enable-vde enable VDE networking"
|
---|
2441 | cat << EOF
|
---|
2442 | --disable-udptunnel disable UDP tunnel networking
|
---|
2443 | --disable-devmapper disable device mapper library access
|
---|
2444 | --disable-hardening don't be strict about /dev/vboxdrv access
|
---|
2445 | --build-libxml2 build libxml2 from sources
|
---|
2446 | --build-libssl build openssl from sources
|
---|
2447 | --build-libtpms build libtpms from sources
|
---|
2448 | EOF
|
---|
2449 | [ $OSE -eq 0 ] && cat << EOF
|
---|
2450 | --build-libcurl build libcurl from sources
|
---|
2451 | --build-libvpx build libvpx from sources
|
---|
2452 | EOF
|
---|
2453 | [ "$OS" != "darwin" ] && echo " --setup-wine setup a Wine directory and register the hhc hack"
|
---|
2454 | cat << EOF
|
---|
2455 | --only-additions only build the Guest Additions
|
---|
2456 |
|
---|
2457 | Paths:
|
---|
2458 | --with-gcc=PATH location of the gcc compiler [$CC]
|
---|
2459 | --with-g++=PATH location of the g++ compiler [$CXX]
|
---|
2460 | --with-kbuild=DIR kbuild directory [$KBUILDDIR]
|
---|
2461 | --with-iasl=PATH location of the iasl compiler [$IASL]
|
---|
2462 | --with-yasm=PATH location of the iasl compiler [$YASM]
|
---|
2463 | --with-makeself=PATH location of makeself [$MAKESELF]
|
---|
2464 | EOF
|
---|
2465 | [ "$OS" = "darwin" ] && echo " --with-xcode-dir=DIR custom path to Xcode root directory; it is assumed that Xcode"
|
---|
2466 | [ "$OS" = "darwin" ] && echo " contains OS X 10.6 SDK (required for Mountain Lion and newer hosts"
|
---|
2467 | [ "$OS" = "darwin" ] && echo " only, ignored for the rest)"
|
---|
2468 | [ "$OS" = "linux" ] && echo " --with-linux=DIR Linux kernel source directory [$LINUX]"
|
---|
2469 | [ $WITH_QT5 -eq 1 ] && echo " --with-qt-dir=DIR directory for Qt headers/libraries [pkgconfig]"
|
---|
2470 | cat << EOF
|
---|
2471 | --with-gsoap-dir=PATH directory for gSOAP compiler/headers/libraries
|
---|
2472 | (soapcpp2 and wsdl2h, soapstd2.h, libgsoap++.a/so)
|
---|
2473 | --with-gsoap-import=PATH directory for gSOAP import files (stlvector.h)
|
---|
2474 | --with-openssl-dir=DIR directory for OpenSSL headers/libraries
|
---|
2475 | --with-ow-dir=DIR directory where Open Watcom can be found [$WATCOM]
|
---|
2476 | --out-base-dir=DIR directory where configuration and build output
|
---|
2477 | should go, in subdirectory out
|
---|
2478 |
|
---|
2479 | Build type:
|
---|
2480 | -d, --build-debug build with debugging symbols and assertions
|
---|
2481 | --build-profile build with profiling support
|
---|
2482 | --build-headless build headless (without any GUI frontend)
|
---|
2483 | EOF
|
---|
2484 | exit 0
|
---|
2485 | }
|
---|
2486 |
|
---|
2487 |
|
---|
2488 | #
|
---|
2489 | # The body.
|
---|
2490 | #
|
---|
2491 |
|
---|
2492 | # test if we are OSE
|
---|
2493 | if [ $OSE -eq 1 -a -r "`cd \`dirname $0\`; pwd`/src/VBox/RDP/server/server.cpp" ]; then
|
---|
2494 | OSE=0
|
---|
2495 | # Set this as a reminder to print a log message once we know the path of the
|
---|
2496 | # log file
|
---|
2497 | NOT_OSE=1
|
---|
2498 | fi
|
---|
2499 |
|
---|
2500 | # Change OS specific defaults; must be before all other stuff
|
---|
2501 | if [ "$OS" = "darwin" ]; then
|
---|
2502 | WITH_SDL=0
|
---|
2503 | WITH_SDL_TTF=0
|
---|
2504 | WITH_X11=0
|
---|
2505 | WITH_ALSA=0
|
---|
2506 | WITH_PULSE=0
|
---|
2507 | WITH_DBUS=0
|
---|
2508 | WITH_KMODS=0
|
---|
2509 | BUILD_LIBXML2=1
|
---|
2510 | BUILD_LIBSSL=1
|
---|
2511 | BUILD_LIBVPX=1
|
---|
2512 | [ $OSE -eq 1 ] || BUILD_LIBCURL=1
|
---|
2513 | [ $OSE -eq 1 ] && WITH_LIBVPX=0
|
---|
2514 | [ $OSE -eq 1 ] && WITH_LIBOPUS=0
|
---|
2515 | WITH_XCODE_DIR=""
|
---|
2516 | elif [ "$OS" = "haiku" ]; then
|
---|
2517 | #WITH_SDL=0
|
---|
2518 | WITH_SDL_TTF=0
|
---|
2519 | WITH_X11=0
|
---|
2520 | WITH_ALSA=0
|
---|
2521 | WITH_PULSE=0
|
---|
2522 | WITH_DBUS=0
|
---|
2523 | WITH_KMODS=0
|
---|
2524 | WITH_LIBIDL=0
|
---|
2525 | WITH_XPCOM=0
|
---|
2526 | BUILD_LIBXSLT=1
|
---|
2527 | BUILD_LIBXML2=1
|
---|
2528 | WITH_LIBVPX=0
|
---|
2529 | WITH_LIBOPUS=0
|
---|
2530 | # it is part of libroot, which is linked by default,
|
---|
2531 | # but the script wants something
|
---|
2532 | LIBPTHREAD="-lroot"
|
---|
2533 | #[ $OSE -eq 1 ] || BUILD_LIBCURL=1
|
---|
2534 | [ $OSE -eq 1 ] || BUILD_LIBSSL=1
|
---|
2535 | elif [ "$OS" = "solaris" ]; then
|
---|
2536 | [ $OSE -eq 1 ] && WITH_LIBVPX=0
|
---|
2537 | [ $OSE -eq 1 ] && WITH_LIBOPUS=0
|
---|
2538 | fi
|
---|
2539 |
|
---|
2540 | # scan command line options
|
---|
2541 | for option in "$@"; do
|
---|
2542 | case "$option" in
|
---|
2543 | --help|-help|-h)
|
---|
2544 | show_help
|
---|
2545 | ;;
|
---|
2546 | --nofatal)
|
---|
2547 | nofatal=1
|
---|
2548 | ;;
|
---|
2549 | --env-only)
|
---|
2550 | ENV_ONLY=1
|
---|
2551 | ;;
|
---|
2552 | --with-gcc=*)
|
---|
2553 | CC=`echo $option | cut -d'=' -f2`
|
---|
2554 | ;;
|
---|
2555 | --with-g++=*)
|
---|
2556 | CXX=`echo $option | cut -d'=' -f2`
|
---|
2557 | ;;
|
---|
2558 | --with-kbuild=*)
|
---|
2559 | KBUILDDIR=`echo $option | cut -d'=' -f2`
|
---|
2560 | if echo $KBUILDDIR|grep -q "$INVALID_CHARS"; then
|
---|
2561 | echo "Error: KBUILDDIR contains invalid characters!"
|
---|
2562 | exit 1
|
---|
2563 | fi
|
---|
2564 | ;;
|
---|
2565 | --with-qt-dir=*)
|
---|
2566 | [ $WITH_QT5 -eq 1 ] && QT5DIR=`echo $option | cut -d'=' -f2`
|
---|
2567 | [ $WITH_QT5 -eq 1 ] && QT5DIR_PKGCONFIG=0
|
---|
2568 | ;;
|
---|
2569 | --with-qt5-minor=*)
|
---|
2570 | QT5MIN=`echo $option | cut -d'=' -f2`
|
---|
2571 | ;;
|
---|
2572 | --with-qt5-major=*)
|
---|
2573 | QT5MAJ=`echo $option | cut -d'=' -f2`
|
---|
2574 | ;;
|
---|
2575 | --with-openssl-dir=*)
|
---|
2576 | OPENSSLDIR=`echo $option | cut -d'=' -f2`
|
---|
2577 | INCCRYPTO="-I${OPENSSLDIR}/include"
|
---|
2578 | LIBCRYPTO="${OPENSSLDIR}/lib/libssl.a ${OPENSSLDIR}/lib/libcrypto.a"
|
---|
2579 | # On Darwin (at least for macports) static OpenSSL also needs zlib.
|
---|
2580 | [ "$OS" = "darwin" ] && LIBCRYPTO="$LIBCRYPTO ${OPENSSLDIR}/lib/libz.a"
|
---|
2581 | # On Linux static OpenSSL typically needs a few additional libraries.
|
---|
2582 | [ "$OS" = "linux" ] && LIBCRYPTO="-ldl $LIBPTHREAD -lm"
|
---|
2583 | ;;
|
---|
2584 | --with-ow-dir=*)
|
---|
2585 | WATCOM=`echo $option | cut -d'=' -f2`
|
---|
2586 | ;;
|
---|
2587 | --with-gsoap-dir=*)
|
---|
2588 | GSOAP=`echo $option | cut -d'=' -f2`
|
---|
2589 | ;;
|
---|
2590 | --with-gsoap-import=*)
|
---|
2591 | GSOAP_IMPORT=`echo $option | cut -d'=' -f2`
|
---|
2592 | ;;
|
---|
2593 | --with-iasl=*)
|
---|
2594 | IASL=`echo $option | cut -d'=' -f2`
|
---|
2595 | ;;
|
---|
2596 | --with-yasm=*)
|
---|
2597 | YASM=`echo $option | cut -d'=' -f2`
|
---|
2598 | ;;
|
---|
2599 | --with-xcode-dir=*)
|
---|
2600 | WITH_XCODE_DIR=`echo $option | cut -d'=' -f2`
|
---|
2601 | ;;
|
---|
2602 | --with-linux=*)
|
---|
2603 | LINUX=`echo $option | cut -d'=' -f2`
|
---|
2604 | ;;
|
---|
2605 | --with-makeself=*)
|
---|
2606 | MAKESELF=`echo $option | cut -d'=' -f2`
|
---|
2607 | ;;
|
---|
2608 | --target-arch=*)
|
---|
2609 | TARGET_MACHINE=`echo $option | cut -d'=' -f2`
|
---|
2610 | ;;
|
---|
2611 | --disable-xpcom)
|
---|
2612 | [ $WITH_XPCOM -eq 1 ] && WITH_XPCOM=0
|
---|
2613 | ;;
|
---|
2614 | --disable-python)
|
---|
2615 | [ $WITH_PYTHON -eq 1 ] && WITH_PYTHON=0
|
---|
2616 | ;;
|
---|
2617 | --disable-java)
|
---|
2618 | [ $WITH_JAVA -eq 1 ] && WITH_JAVA=0
|
---|
2619 | ;;
|
---|
2620 | --disable-vmmraw)
|
---|
2621 | [ $WITH_VMMRAW -eq 1 ] && WITH_VMMRAW=0
|
---|
2622 | ;;
|
---|
2623 | --disable-sdl-ttf)
|
---|
2624 | [ $WITH_SDL_TTF -eq 1 ] && WITH_SDL_TTF=0
|
---|
2625 | ;;
|
---|
2626 | --disable-qt)
|
---|
2627 | [ $WITH_QT5 -eq 1 ] && WITH_QT5=0
|
---|
2628 | ;;
|
---|
2629 | --enable-qt5)
|
---|
2630 | [ $WITH_QT5 -eq 0 ] && WITH_QT5=1
|
---|
2631 | ;;
|
---|
2632 | --passive-mesa)
|
---|
2633 | PASSIVE_MESA=1
|
---|
2634 | ;;
|
---|
2635 | --disable-alsa)
|
---|
2636 | [ $WITH_ALSA -eq 1 ] && WITH_ALSA=0
|
---|
2637 | ;;
|
---|
2638 | --disable-pulse)
|
---|
2639 | [ $WITH_PULSE -eq 1 ] && WITH_PULSE=0
|
---|
2640 | ;;
|
---|
2641 | --enable-pulse)
|
---|
2642 | WITH_PULSE=2
|
---|
2643 | ;;
|
---|
2644 | --disable-dbus)
|
---|
2645 | [ $WITH_DBUS -eq 1 ] && WITH_DBUS=0
|
---|
2646 | ;;
|
---|
2647 | --disable-kmods)
|
---|
2648 | [ $WITH_KMODS -eq 1 ] && WITH_KMODS=0
|
---|
2649 | ;;
|
---|
2650 | --disable-opengl)
|
---|
2651 | [ $WITH_OPENGL -eq 1 ] && WITH_OPENGL=0
|
---|
2652 | ;;
|
---|
2653 | --enable-webservice)
|
---|
2654 | ;;
|
---|
2655 | --enable-vnc)
|
---|
2656 | WITH_VNC=1
|
---|
2657 | ;;
|
---|
2658 | --disable-hardening)
|
---|
2659 | WITH_HARDENING=0
|
---|
2660 | ;;
|
---|
2661 | --disable-extpack)
|
---|
2662 | WITH_EXTPACK=0
|
---|
2663 | ;;
|
---|
2664 | --disable-docs)
|
---|
2665 | WITH_DOCS=0
|
---|
2666 | ;;
|
---|
2667 | --enable-hardening)
|
---|
2668 | WITH_HARDENING=2
|
---|
2669 | ;;
|
---|
2670 | --build-libopus)
|
---|
2671 | BUILD_LIBOPUS=1
|
---|
2672 | ;;
|
---|
2673 | --disable-udptunnel)
|
---|
2674 | WITH_UDPTUNNEL=0
|
---|
2675 | ;;
|
---|
2676 | --enable-vde)
|
---|
2677 | WITH_VDE=1
|
---|
2678 | ;;
|
---|
2679 | --disable-devmapper)
|
---|
2680 | WITH_DEVMAPPER=0
|
---|
2681 | ;;
|
---|
2682 | --disable-libvpx)
|
---|
2683 | WITH_LIBVPX=0
|
---|
2684 | ;;
|
---|
2685 | --disable-libopus)
|
---|
2686 | WITH_LIBOPUS=0
|
---|
2687 | ;;
|
---|
2688 | --disable-libtpms)
|
---|
2689 | WITH_LIBTPMS=0
|
---|
2690 | ;;
|
---|
2691 | --disable-sdl)
|
---|
2692 | WITH_SDL=0
|
---|
2693 | ;;
|
---|
2694 | --build-debug|-d)
|
---|
2695 | BUILD_TYPE=debug
|
---|
2696 | ;;
|
---|
2697 | --build-profile)
|
---|
2698 | BUILD_TYPE=profile
|
---|
2699 | ;;
|
---|
2700 | --build-libxml2)
|
---|
2701 | BUILD_LIBXML2=1
|
---|
2702 | ;;
|
---|
2703 | --build-libssl)
|
---|
2704 | BUILD_LIBSSL=1
|
---|
2705 | ;;
|
---|
2706 | --build-libcurl)
|
---|
2707 | BUILD_LIBCURL=1
|
---|
2708 | ;;
|
---|
2709 | --build-libvpx)
|
---|
2710 | BUILD_LIBVPX=1
|
---|
2711 | ;;
|
---|
2712 | --build-headless)
|
---|
2713 | HEADLESS=1
|
---|
2714 | WITH_SDL=0
|
---|
2715 | WITH_SDL_TTF=0
|
---|
2716 | WITH_X11=0
|
---|
2717 | WITH_OPENGL=0
|
---|
2718 | WITH_QT5=0
|
---|
2719 | ;;
|
---|
2720 | --ose)
|
---|
2721 | OSE=2
|
---|
2722 | ;;
|
---|
2723 | --odir=*)
|
---|
2724 | ODIR="`echo $option | cut -d'=' -f2`/"
|
---|
2725 | ODIR_OVERRIDE=1
|
---|
2726 | ;;
|
---|
2727 | --out-base-dir=*)
|
---|
2728 | out_base_dir="`echo $option | cut -d'=' -f2`/"
|
---|
2729 | if [ -d $out_base_dir ]; then
|
---|
2730 | saved_pwd="$PWD"
|
---|
2731 | cd $out_base_dir
|
---|
2732 | OUT_BASE_PATH="`pwd`"
|
---|
2733 | cd $saved_pwd
|
---|
2734 | OUT_BASE_PATH_OVERRIDE=1
|
---|
2735 | if [ $ODIR_OVERRIDE -eq 0 ]; then
|
---|
2736 | # This variable has not *yet* been overridden. That can still happen.
|
---|
2737 | ODIR=$OUT_BASE_PATH/
|
---|
2738 | ODIR_OVERRIDE=1
|
---|
2739 | fi
|
---|
2740 | else
|
---|
2741 | echo "Error: invalid folder \"$out_base_dir\" in option \"$option\""
|
---|
2742 | exit 1
|
---|
2743 | fi
|
---|
2744 | ;;
|
---|
2745 | --setup-wine)
|
---|
2746 | [ "$OS" != "darwin" ] && SETUP_WINE=1
|
---|
2747 | ;;
|
---|
2748 | --only-additions)
|
---|
2749 | ONLY_ADDITIONS=1
|
---|
2750 | ;;
|
---|
2751 | *)
|
---|
2752 | echo
|
---|
2753 | echo "Unrecognized option \"$option\""
|
---|
2754 | echo
|
---|
2755 | show_help
|
---|
2756 | ;;
|
---|
2757 | esac
|
---|
2758 | done
|
---|
2759 |
|
---|
2760 | LOG="$ODIR$LOG"
|
---|
2761 | ENV="$ODIR$ENV"
|
---|
2762 | CNF="$ODIR$CNF"
|
---|
2763 |
|
---|
2764 | # initialize output files
|
---|
2765 | cat > $LOG << EOF
|
---|
2766 | # Log file generated by
|
---|
2767 | #
|
---|
2768 | # '$0 $*'
|
---|
2769 | #
|
---|
2770 |
|
---|
2771 | EOF
|
---|
2772 | cat > $CNF << EOF
|
---|
2773 | # -*- Makefile -*-
|
---|
2774 | #
|
---|
2775 | # automatically generated by
|
---|
2776 | #
|
---|
2777 | # '$0 $*'
|
---|
2778 | #
|
---|
2779 | # It will be completely overwritten if configure is executed again.
|
---|
2780 | #
|
---|
2781 |
|
---|
2782 | EOF
|
---|
2783 | cat > $ENV << EOF
|
---|
2784 | #!/bin/bash
|
---|
2785 | #
|
---|
2786 | # automatically generated by
|
---|
2787 | #
|
---|
2788 | # '$0 $*'
|
---|
2789 | #
|
---|
2790 | # It will be completely overwritten if configure is executed again.
|
---|
2791 | # Make sure you source this file once before you start to build VBox.
|
---|
2792 | #
|
---|
2793 |
|
---|
2794 | EOF
|
---|
2795 |
|
---|
2796 | # Print log warning about OSE if necessary
|
---|
2797 | if [ -n "$NOT_OSE" ]; then
|
---|
2798 | echo "Found RDP server, assuming VBOX_OSE = FALSE" >> $LOG
|
---|
2799 | echo >> $LOG
|
---|
2800 | fi
|
---|
2801 |
|
---|
2802 |
|
---|
2803 | if [ "$BUILD_TYPE" = "debug" ]; then
|
---|
2804 | echo "Creating DEBUG build!" >> $LOG
|
---|
2805 | elif [ "$BUILD_TYPE" = "profile" ]; then
|
---|
2806 | echo "Creating PROFILE build!" >> $LOG
|
---|
2807 | fi
|
---|
2808 |
|
---|
2809 | # first determine our environment
|
---|
2810 | check_environment
|
---|
2811 | check_kbuild
|
---|
2812 |
|
---|
2813 | [ -n "$ENV_ONLY" ] && exit 0
|
---|
2814 |
|
---|
2815 | # append the tools directory to the default search path
|
---|
2816 | echo "$PATH" | grep -q "$DEVDIR_BIN" || PATH="$PATH:$DEVDIR_BIN"
|
---|
2817 | export PATH
|
---|
2818 |
|
---|
2819 | # if we will be writing to a different out directory then set this up now
|
---|
2820 | if [ $ODIR_OVERRIDE -eq 1 ]; then
|
---|
2821 | echo "AUTOCFG=$CNF" >> $ENV
|
---|
2822 | echo "export AUTOCFG" >> $ENV
|
---|
2823 | fi
|
---|
2824 | if [ $OUT_BASE_PATH_OVERRIDE -eq 1 ]; then
|
---|
2825 | echo "PATH_OUT_BASE=$OUT_BASE_PATH" >> $ENV
|
---|
2826 | echo "export PATH_OUT_BASE" >> $ENV
|
---|
2827 | fi
|
---|
2828 |
|
---|
2829 | # don't bother people with -Werror
|
---|
2830 | cnf_append "VBOX_GCC_WERR" "\$(NO_SUCH_VARIABLE)"
|
---|
2831 |
|
---|
2832 | # some things are not available in for OSE
|
---|
2833 | if [ $OSE -ge 1 ]; then
|
---|
2834 | cnf_append "VBOX_OSE" "1"
|
---|
2835 | cnf_append "VBOX_WITH_VALIDATIONKIT" ""
|
---|
2836 | cnf_append "VBOX_WITH_WIN32_ADDITIONS" ""
|
---|
2837 |
|
---|
2838 | if [ "$OS" = "linux" ]; then
|
---|
2839 | cnf_append "VBOX_WITH_LINUX_ADDITIONS" "1"
|
---|
2840 | else
|
---|
2841 | cnf_append "VBOX_WITH_LINUX_ADDITIONS" ""
|
---|
2842 | fi
|
---|
2843 | echo >> $CNF
|
---|
2844 | fi
|
---|
2845 |
|
---|
2846 | # extpack
|
---|
2847 | if [ $ONLY_ADDITIONS -eq 1 ]; then
|
---|
2848 | cnf_append "VBOX_WITH_EXTPACK_PUEL_BUILD" ""
|
---|
2849 | elif [ $OSE -eq 0 ]; then
|
---|
2850 | if [ $WITH_EXTPACK -eq 1 ]; then
|
---|
2851 | BUILD_LIBSSL=1
|
---|
2852 | else
|
---|
2853 | cnf_append "VBOX_WITH_EXTPACK_PUEL_BUILD" ""
|
---|
2854 | fi
|
---|
2855 | fi
|
---|
2856 |
|
---|
2857 | # headless
|
---|
2858 | if [ -n "$HEADLESS" ]; then
|
---|
2859 | cnf_append "VBOX_HEADLESS" "1"
|
---|
2860 | fi
|
---|
2861 |
|
---|
2862 | # emit disable directives corresponding to any --disable-xxx options.
|
---|
2863 | if [ $WITH_OPENGL -eq 0 ]; then
|
---|
2864 | cnf_append "VBOX_WITH_VMSVGA3D" ""
|
---|
2865 | cnf_append "VBOX_WITH_3D_ACCELERATION" ""
|
---|
2866 | cnf_append "VBOX_WITH_VIDEOHWACCEL" ""
|
---|
2867 | cnf_append "VBOX_GUI_USE_QGL" ""
|
---|
2868 | fi
|
---|
2869 | [ $WITH_XPCOM -eq 0 ] && cnf_append "VBOX_WITH_MAIN" ""
|
---|
2870 | [ $WITH_QT5 -eq 0 ] && cnf_append "VBOX_WITH_QTGUI" ""
|
---|
2871 | [ $WITH_SDL_TTF -eq 0 ] && cnf_append "VBOX_WITH_SECURELABEL" ""
|
---|
2872 | [ $WITH_PYTHON -eq 0 ] && cnf_append "VBOX_WITH_PYTHON" ""
|
---|
2873 | [ $WITH_JAVA -eq 0 ] && cnf_append "VBOX_WITH_JXPCOM" ""
|
---|
2874 | [ $WITH_JAVA -eq 0 ] && cnf_append "VBOX_WITH_JWS" ""
|
---|
2875 | [ $WITH_HARDENING -eq 0 ] && cnf_append "VBOX_WITHOUT_HARDENING" "1"
|
---|
2876 | [ $WITH_HARDENING -eq 2 ] && cnf_append "VBOX_WITH_HARDENING" "2"
|
---|
2877 | [ $WITH_VMMRAW -eq 0 ] && cnf_append "VBOX_WITH_RAW_MODE" ""
|
---|
2878 | [ $WITH_LIBTPMS -eq 0 ] && cnf_append "VBOX_WITH_LIBTPMS" ""
|
---|
2879 | if [ $WITH_LIBVPX -eq 0 ]; then
|
---|
2880 | cnf_append "VBOX_WITH_LIBVPX" ""
|
---|
2881 | cnf_append "VBOX_WITH_RECORDING" ""
|
---|
2882 | fi
|
---|
2883 | if [ $WITH_LIBOPUS -eq 0 ]; then
|
---|
2884 | cnf_append "VBOX_WITH_LIBOPUS" ""
|
---|
2885 | cnf_append "VBOX_WITH_AUDIO_RECORDING" ""
|
---|
2886 | fi
|
---|
2887 |
|
---|
2888 | # Darwin-specific
|
---|
2889 | [ "$OS" = "darwin" ] && check_darwinversion
|
---|
2890 | # the tools
|
---|
2891 | [ "$OS" != "darwin" ] && check_gcc
|
---|
2892 | [ "$OS" = "darwin" ] && check_xcode
|
---|
2893 | if [ $ONLY_ADDITIONS -eq 0 ]; then
|
---|
2894 | check_open_watcom
|
---|
2895 | [ "$OS" != "darwin" ] && check_iasl
|
---|
2896 | [ $OSE -ge 1 ] && check_yasm
|
---|
2897 | [ "$OS" != "darwin" ] && check_xsltproc
|
---|
2898 | fi
|
---|
2899 |
|
---|
2900 | # the libraries
|
---|
2901 | if [ $ONLY_ADDITIONS -eq 0 ]; then
|
---|
2902 | [ "$OS" != "darwin" ] && check_pthread
|
---|
2903 | check_libxml2
|
---|
2904 | [ $WITH_LIBIDL -eq 1 ] && check_libidl
|
---|
2905 | check_z
|
---|
2906 | check_lzf
|
---|
2907 | check_ssl
|
---|
2908 | check_curl
|
---|
2909 | [ $WITH_LIBVPX -eq 1 ] && check_vpx
|
---|
2910 | [ $WITH_LIBOPUS -eq 1 ] && check_libopus
|
---|
2911 | [ $WITH_LIBTPMS -eq 1 ] && check_libtpms
|
---|
2912 | [ "$OS" != "darwin" ] && check_png
|
---|
2913 | [ $OSE -eq 0 -a "$OS" = "linux" ] && check_pam
|
---|
2914 | if [ $WITH_SDL -eq 1 ]; then
|
---|
2915 | check_sdl
|
---|
2916 | else
|
---|
2917 | cnf_append "VBOX_WITH_VBOXSDL" ""
|
---|
2918 | fi
|
---|
2919 | [ $WITH_SDL_TTF -eq 1 -a $OSE -eq 0 ] && check_sdl_ttf
|
---|
2920 | [ $WITH_X11 -eq 1 ] && check_x
|
---|
2921 | # TODO check for xcomposite-dev (X11/extensions/Xcomposite.h, additions only)
|
---|
2922 | # TODO check for libxdamange-dev (X11/extensions/Xdamage.h, additions only)
|
---|
2923 | [ $WITH_X11 -eq 1 ] && check_xcursor
|
---|
2924 | [ $WITH_X11 -eq 1 ] && check_xinerama
|
---|
2925 | [ $WITH_X11 -eq 1 ] && check_xrandr
|
---|
2926 | [ $WITH_OPENGL -eq 1 ] && check_opengl
|
---|
2927 | [ $WITH_QT5 -eq 1 ] && check_qt5
|
---|
2928 | [ $WITH_PYTHON -eq 1 ] && check_python
|
---|
2929 | [ $WITH_JAVA -eq 1 ] && check_java
|
---|
2930 |
|
---|
2931 | # PulseAudio
|
---|
2932 | if [ $WITH_PULSE -eq 1 ]; then
|
---|
2933 | check_pulse
|
---|
2934 | elif [ $WITH_PULSE -eq 0 ]; then # Force disabling PulseAudio.
|
---|
2935 | cnf_append "VBOX_WITH_AUDIO_PULSE" ""
|
---|
2936 | elif [ $WITH_PULSE -eq 2 ]; then # --enable-pulse was passed, force PulseAudio.
|
---|
2937 | cnf_append "VBOX_WITH_AUDIO_PULSE" "1"
|
---|
2938 | fi
|
---|
2939 | fi
|
---|
2940 |
|
---|
2941 | # Linux-specific
|
---|
2942 | if [ "$OS" = "linux" ]; then
|
---|
2943 | # don't check for the static libstdc++ in the PUEL version as we build the
|
---|
2944 | # additions at a dedicated box
|
---|
2945 | [ $OSE -ge 1 ] && check_staticlibstdcxx
|
---|
2946 | if [ $WITH_KMODS -eq 1 ]; then
|
---|
2947 | check_linux
|
---|
2948 | else
|
---|
2949 | cnf_append "VBOX_LINUX_SRC" ""
|
---|
2950 | cnf_append "VBOX_WITHOUT_LINUX_TEST_BUILDS" "1"
|
---|
2951 | fi
|
---|
2952 | if [ $ONLY_ADDITIONS -eq 0 ]; then
|
---|
2953 | if [ $WITH_ALSA -eq 1 ]; then
|
---|
2954 | check_alsa
|
---|
2955 | else
|
---|
2956 | cnf_append "VBOX_WITH_AUDIO_ALSA" ""
|
---|
2957 | fi
|
---|
2958 | if [ $WITH_DBUS -eq 0 ]; then
|
---|
2959 | cnf_append "VBOX_WITH_DBUS" ""
|
---|
2960 | fi
|
---|
2961 | if [ $WITH_DEVMAPPER -eq 1 ]; then
|
---|
2962 | check_libdevmapper
|
---|
2963 | else
|
---|
2964 | cnf_append "VBOX_WITH_DEVMAPPER" ""
|
---|
2965 | fi
|
---|
2966 | check_libcap
|
---|
2967 | fi
|
---|
2968 | check_compiler_h
|
---|
2969 | [ $ONLY_ADDITIONS -eq 0 -a "$BUILD_MACHINE" = "amd64" -a $WITH_VMMRAW -eq 1 ] && check_32bit
|
---|
2970 | # tools/common/makeself*
|
---|
2971 | [ $OSE -ge 1 ] && check_makeself
|
---|
2972 | fi
|
---|
2973 |
|
---|
2974 | [ -n "$SETUP_WINE" ] && setup_wine
|
---|
2975 |
|
---|
2976 | if [ $ONLY_ADDITIONS -eq 0 ]; then
|
---|
2977 | check_gsoap
|
---|
2978 | else
|
---|
2979 | cnf_append "VBOX_WITH_WEBSERVICES" ""
|
---|
2980 | fi
|
---|
2981 |
|
---|
2982 | # UDPTUNNEL
|
---|
2983 | if [ $ONLY_ADDITIONS -eq 0 -a $WITH_UDPTUNNEL -eq 0 ]; then
|
---|
2984 | cnf_append "VBOX_WITH_UDPTUNNEL" ""
|
---|
2985 | fi
|
---|
2986 |
|
---|
2987 | # VDE
|
---|
2988 | if [ $ONLY_ADDITIONS -eq 0 -a "$OS" = "linux" -o "$OS" = "freebsd" ]; then
|
---|
2989 | if [ $WITH_VDE -eq 1 ]; then
|
---|
2990 | cnf_append "VBOX_WITH_VDE" "1"
|
---|
2991 | fi
|
---|
2992 | fi
|
---|
2993 |
|
---|
2994 | # DOCS
|
---|
2995 | if [ $ONLY_ADDITIONS -eq 1 -o $WITH_DOCS -eq 0 ]; then
|
---|
2996 | cnf_append "VBOX_WITH_DOCS" ""
|
---|
2997 | cnf_append "VBOX_WITH_DOCS_PACKING" ""
|
---|
2998 | fi
|
---|
2999 |
|
---|
3000 | # VNC server support
|
---|
3001 | if [ $ONLY_ADDITIONS -eq 0 -a $OSE -ge 1 ]; then
|
---|
3002 | if [ $WITH_VNC = 1 ]; then
|
---|
3003 | check_vncserver
|
---|
3004 | else
|
---|
3005 | cnf_append "VBOX_WITH_EXTPACK_VNC" ""
|
---|
3006 | fi
|
---|
3007 | fi
|
---|
3008 |
|
---|
3009 | if [ $ONLY_ADDITIONS -eq 1 ]; then
|
---|
3010 | cnf_append "VBOX_ONLY_ADDITIONS" "1"
|
---|
3011 | fi
|
---|
3012 |
|
---|
3013 | # success!
|
---|
3014 | echo
|
---|
3015 | echo "Successfully generated '$CNF' and '$ENV'."
|
---|
3016 | echo "Source '$ENV' once before you start to build VBox:"
|
---|
3017 | echo ""
|
---|
3018 | echo " source $ENV"
|
---|
3019 | echo " kmk"
|
---|
3020 | echo ""
|
---|
3021 | if [ "$OS" = "linux" ]; then
|
---|
3022 | if [ $OUT_BASE_PATH_OVERRIDE -eq 1 ]; then
|
---|
3023 | out_base_dir=$OUT_BASE_PATH
|
---|
3024 | else
|
---|
3025 | out_base_dir=.
|
---|
3026 | fi
|
---|
3027 | echo "To compile the kernel modules, do:"
|
---|
3028 | echo ""
|
---|
3029 | echo " cd $out_base_dir/out/$OS.$TARGET_MACHINE/$BUILD_TYPE/bin/src"
|
---|
3030 | echo " make"
|
---|
3031 | echo ""
|
---|
3032 | fi
|
---|
3033 | if [ $ONLY_ADDITIONS -eq 1 ]; then
|
---|
3034 | echo ""
|
---|
3035 | echo " Tree configured to build only the Guest Additions"
|
---|
3036 | echo ""
|
---|
3037 | elif [ $WITH_HARDENING -gt 0 ]; then
|
---|
3038 | echo ""
|
---|
3039 | echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
|
---|
3040 | echo " Hardening is enabled which means that the VBox binaries will not run from"
|
---|
3041 | echo " the binary directory. The binaries have to be installed suid root and some"
|
---|
3042 | echo " more prerequisites have to be fulfilled which is normally done by installing"
|
---|
3043 | echo " the final package. For development, the hardening feature can be disabled"
|
---|
3044 | echo " by specifying the --disable-hardening parameter. Please never disable that"
|
---|
3045 | echo " feature for the final distribution!"
|
---|
3046 | echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
|
---|
3047 | echo ""
|
---|
3048 | else
|
---|
3049 | echo ""
|
---|
3050 | echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
|
---|
3051 | echo " Hardening is disabled. Please do NOT build packages for distribution with"
|
---|
3052 | echo " disabled hardening!"
|
---|
3053 | echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
|
---|
3054 | echo ""
|
---|
3055 | fi
|
---|
3056 | echo "Enjoy!"
|
---|
3057 | cleanup
|
---|