Re: [gtk-osx-users] Crossbuild on linux




On May 25, 2012, at 4:19 AM, Gabriele Greco wrote:

It's possible to crossbuild the native OSX GTK on linux?

I have a crosscompiler set up on my ubuntu linux box and I've built and test successfully SDL, ffmpeg and other projects.

I have SDKs 10.5 and 10.6 installed and I'm not interested in an universal binary....

The alternative I have is obviously to copy the the gtk/inst/(lib|include|bin|share) from my OSX machine to my linux box in the cross compiler sysroot path, and maybe modify pkg-config files to map on the destination paths....
I'd like the cleaner approach of being able to build on linux if possible...

I'm looking at .jhbuildrc as starting point... lot of changes to do since it assumes xcode presence and OSX standard paths :)

Anyway my GCC is this one:

gabry@nevada:~/projects/$ i686-apple-darwin10-gcc -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: ../gcc-5646.1-i686-apple-darwin10/configure --target=i686-apple-darwin10 --prefix=/usr --with-sysroot=/usr/lib/apple/SDKs/MacOSX10.5.sdk --with-slibdir=/usr/i686-apple-darwin10/lib --mandir=/usr/i686-apple-darwin10/share/man --infodir=/usr/i686-apple-darwin10/share/info --libexecdir=/usr/lib --disable-nls --with-gxx-include-dir=/usr/include/c++/4.2.1 --enable-languages=c,c++,objc,obj-c++ --enable-version-specific-runtime-libs --with-as=/usr/bin/i686-apple-darwin10-as --with-ld=/usr/bin/i686-apple-darwin10-ld : (reconfigured) ../gcc-5646.1-i686-apple-darwin10/configure --target=i686-apple-darwin10 --prefix=/usr --with-sysroot=/usr/lib/apple/SDKs/MacOSX10.5.sdk --with-slibdir=/usr/i686-apple-darwin10/lib --mandir=/usr/i686-apple-darwin10/share/man --infodir=/usr/i686-apple-darwin10/share/info --libexecdir=/usr/lib --disable-nls --with-gxx-include-dir=/usr/include/c++/4.2.1 --enable-languages=c,c++,objc,obj-c++ --enable-version-specific-runtime-libs --with-as=/usr/bin/i686-apple-darwin10-as --with-ld=/usr/bin/i686-apple-darwin10-ld
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5646) (dot 1)

Do you think it makes sense to do this (and spend quite a lot of time to fight with every package ./configure problems) or I'd better stick with my OSX native build and just port headers/libs to the linux box?

Yes, you're right that jhbuildrc is the place to start, but once you've got that worked out you shouldn't have to mess with configure settings. You'll need to fiddle the bit of setup_sdk() that sets the compiler and SDK paths, and you'll probably need to modify CFLAGS, CXXFLAGS, and LDFLAGS. It should be pretty straightforward. Once it's done, there shouldn't be any need to modify configure arguments for the cross-compiled environment.

Regards,
John Ralls




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]