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