[Qgis-developer] Preview release 1 - Mac Universal binary

William Kyngesburye woklist at kyngchaos.com
Sun Jun 18 16:40:16 EDT 2006


I have a Mac OS X Universal build available for 0.8 Preview 1.  As  
before, requires my Graphics Libs and GIS Libs packages.  Works on  
Tiger, possibly Panther.

http://www.kyngchaos.com/software/unixport/qgis


For those interested, here is what I do for a universal build:

- Assuming all dependencies have been built universal.  For Qt, a  
universal framework build option is built into Qt's configure.  Most  
libraries I use from my installer packages (all universal).  I just  
needed to add GSL (very similar to Qgis uni build).

- Make sure libQtTest.la has been edited to comment out the  
dependency_libs option (the framework options cause problems with  
libtool, I think).

- I have a note to add "-framework Carbon -framework QuickTime -lz - 
framework OpenGL -framework AGL" to QT_LDADD, but I don't remember  
why.  Possibly something to do with the above patch for libqttest.

- patch in the extra flags needed - can't be added to CXXFLAGS or  
LDFLAGS since they won't get added in the right place, and possibly  
duplicated.  I use BBEdit grep find-&-replace.  For all makefile.in's  
(before configure):

replace grep: --mode=compile (?s).+?\$\(C(XX)?FLAGS\)
     with: & $(CCCFLAGS)

replace grep: --mode=link (?s).+? \$\(LDFLAGS\)
     with: & $(CCCFLAGS)

replace grep: (= |if |\t)\$\(C(C|XX)\) (?s).+?\$\(C(XX)?FLAGS\)
     with: & $(CCFLAGS)

- configure.

If you use my Graphics Libs, this is needed to get my expat since  
there is no option for it in qgis configure, tho I suppose you could  
get expat from X11:

export CPPFLAGS=-I/usr/local/baselibs/include
export CFLAGS="-O2 -I/usr/local/baselibs/include"
export CXXFLAGS="-O2 -I/usr/local/baselibs/include"
export LDFLAGS=-L/usr/local/baselibs/lib

Use options you normally would, but the key in configure for a  
universal build is:

--disable-dependency-tracking

those extra -M_ options used for this don't work with multi-arch builds.

- setup the universal build:

export SDKROOT=/Developer/SDKs/MacOSX10.4u.sdk
export CCFLAGS="-arch i386 -arch ppc -isysroot $SDKROOT"
export CCCFLAGS="-Xcompiler -arch -Xcompiler i386 -Xcompiler -arch - 
Xcompiler ppc -Xcompiler -isysroot -Xcompiler $SDKROOT"

also, some libraries in /usr/local may have linking problems with the  
Universal SDK, because the new sysroot doesn't see /usr/local.  Add a  
symlink in the SDK/usr to /usr/local.  Of course, this only works  
when those libraries are built universal.

ln -s /usr/local $SDKROOT/usr/

- Now, run make and all the universal flags will get added where  
needed.  If this could be built into the build system for Qgis  
somehow, that would be nice.


BTW, that's pretty much what I do will all my universal libraries.   
Some versions of libtool need -Xlinker instead of -Xcompiler, or both  
depending on if it's an app or library.  I have a standard set of  
these CxxxFLAGS in my bash_profile and use the appropriate ones in  
the find & replace step.  I also conditionalize any endian settings  
(ie WORDS_BIGENDIAN in config.h) on __BIG_ENDIAN__ or  
__LITTLE_ENDIAN__ (Mac OS X only macros defined by gcc).  Anything  
that uses ld directly (postgres) is trouble, and I'm stuck with a  
split build, then merge with lipo.

I hope to get some sort of detailed note about this on my site someday.


- finally, copy the Qt frameworks and libs, libpq (so you don't need  
to keep a full postgres install around) and libgsl and libgslcblas to  
the app package MacOS/lib folder.  Those are the basics if using my  
other packages, but you could copy all needed libraries into MacOS/lib.

I made this script to change all the embedded library paths to  
relative paths so the app package can be moved around.  This is just  
for everything -but- my graphics/gis libs, you'd have to add to it to  
change those.  You only need to change the paths and versions at the  
top of the script to match what you have installed.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixdirs.sh
Type: application/octet-stream
Size: 5374 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/qgis-developer/attachments/20060618/b9ba3e7b/fixdirs.obj
-------------- next part --------------

-----
William Kyngesburye <kyngchaos at kyngchaos.com>
http://www.kyngchaos.com/

"Time is an illusion - lunchtime doubly so."

- Ford Prefect



More information about the Qgis-developer mailing list