Page 1 of 1

Building VirtualBox 4.0.12 on OSX Lion

Posted: 14. Sep 2011, 08:45
by arend
Building VirtualBox 4.0.12 on OSX Lion

Just a quick write-up of how I built 4.0.12 on OSX Lion:

1. Basically follow the build instructions ... structions

Note: I installed macports following the instructions before I upgraded to Lion and had no issues with macports after the upgrade

2. You need to patch configure as Lion has kernel version 11.0.0 that is not recognized by 4.0.12 (it is recognized by 4.1.2)

Code: Select all

*** 2059,2064 ****
--- 2059,2071 ----
    test_header "Darwin version"
    darwin_ver=`uname -r`
    case "$darwin_ver" in
+     11\.*)
+       darwin_ver="10.7" # Lion
+       sdk=/Developer/SDKs/MacOSX10.6.sdk
+       CXX_FLAGS="-mmacosx-version-min=10.6 -isysroot $sdk -Wl,-syslibroot,$sdk"
+       # We disable the java stuff until Apple make the java stuff downloadable.
+       WITH_JAVA=0
+       ;;
        if [ "$BUILD_MACHINE" = "x86" ]; then
I also had to add a references to libz.a and libssl.a for LIBCRYPTO for the openssl test to work

Code: Select all

*** 2260,2266 ****
        OPENSSLDIR=`echo $option | cut -d'=' -f2`
!       LIBCRYPTO="${OPENSSLDIR}/lib/libcrypto.a"
        GSOAP=`echo $option | cut -d'=' -f2`
--- 2267,2273 ----
        OPENSSLDIR=`echo $option | cut -d'=' -f2`
!       LIBCRYPTO="${OPENSSLDIR}/lib/libcrypto.a ${OPENSSLDIR}/lib/libssl.a ${OPENSSLDIR}/lib/libz.a"
        GSOAP=`echo $option | cut -d'=' -f2`
3. Then run configure

./configure --disable-python --disable-java --disable-docs --target-arch=amd64

Note: I had problems with the --with-openssl-dir=<...> flag. I used --with-openssl-dir=/opt/local and it resulted in an unresolved symbol as a wrong header file got pulled in due to this option ( ... devel/4553)

4. . ./ [I did not need a LocalConfig.kmk]

5. kmk

6. As I built the 'hardened' version the easiest way to deal with file location and permission issues is to package everything up. Unfortunately the packaging requires an old version of PackageManager that shipped with xcode 2.4.1 (found that out from Chris from the Oracle development team). This package manager does not run on Lion as it does not find some libraries it needs.

So I copied the entire build tree into the same directory location that it had on my Lion system onto my 32-bit Snow Leopard system and ran

7. . ./

8. kmk packing j=1

which ran through and built the package