[texworks] Call for Help: Mac builds

Bruno Voisin bvoisin at me.com
Sat Feb 5 22:59:37 CET 2011


From the TeXworks list:

Le 5 févr. 2011 à 20:25, Stefan Löffler a écrit :

> * GCC versions seem to differ. When building hunspell, for example, the
> command called is "g++". When building Tw, the command is
> "/usr/bin/g++-4.0". If these are indeed different compilers, the error
> "file was built for unsupported file format" seems explainable. The
> custom compiler for Tw is defined in TeXworks.pro lines 66 & 67. Just
> comment those out (prefix by #) and try again (you may have to do a
> clean rebuild, i.e. repeat the compilation). IIRC, that settings had
> something to do with supporting Mac OS 10.4.
> * Linking for ppc apparently fails because the Qt libraries are not
> built for that architecture (evident from "/usr/lib/libQtUiTools.a,
> missing required architecture ppc in file" and the fact that just about
> any symbol is "undefined). Disable it for now by removing "ppc" in
> TeXworks.pro on line 84 ("CONFIG += x86 ppc").


From the MacTeX list (the dev list mentioned by Joseph Wright):

Le 5 févr. 2011 à 20:39, Adam R. Maxwell a écrit :

> For what architecture(s) did you build the libraries (poppler etc.) that this requires?  On Snow Leopard, gcc defaults to x86_64, so linking i386 and ppc will fail; it's a fair guess that this is what happened on your second build, where all of the Poppler symbols are missing.
> 
> If the Qt frameworks include x86_64, try changing TeXWorks to build only x86_64 in Xcode:
> 
> http://developer.apple.com/tools/xcode/xcodebuildsettings.html
> 
> (look for "ARCHS" on that page).  If not, you'll have to build the libraries for all architectures, then lipo them together (or take a chance and use the -arch option to gcc with multiple architectures).


First thing: looking at TeXworks.pro, I realized it contains

	QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.4u.sdk
	QMAKE_MACOS_DEPLOYMENT_TARGET = 10.4

which is wrong: on Snow Leopard (Mac OS 10.6, the current version), the 10.4 SDK is not included by default:

$ cd /Developer/SDKs
$ ls -l
total 0
drwxr-xr-x  7 root  wheel  238 30 jui  2009 MacOSX10.5.sdk
drwxr-xr-x  7 root  wheel  238  3 aoû  2009 MacOSX10.6.sdk

So you need to change to

QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.5u.sdk
QMAKE_MACOS_DEPLOYMENT_TARGET = 10.5

You also need to do as Stefan said, namely comment out the lines

	QMAKE_CC = gcc-4.0
	QMAKE_CXX = g++-4.0

and remove ppc from

	CONFIG += x86 ppc

But the build still fails. Then, out of desperation, and thinking about Adam's suggestion, I tried the following:

$ xcodebuild ARCHS=x86_64
Build settings from command line:
    ARCHS = x86_64
[...]
** BUILD SUCCEEDED **
[...]

More graphically:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capture d??cran 2011-02-05 ? 22.39.44.png
Type: image/png
Size: 75350 bytes
Desc: not available
URL: <http://tug.org/pipermail/texworks/attachments/20110205/b33e1cff/attachment-0001.png>
-------------- next part --------------


You can try it by yourself at <https://files.me.com/bvoisin/44kjm2>.

Clearly there is much remaining to be done (modify TeXworks.pro in a clean and consistent way, such that setting ARCHS from the command line is no longer necessary;, build multi-architecture then universal; remove linking to fontconfig; update and include the poppler patches; update the build instructions; ...). I hope the above will motivate contributors, and give a point to start from.

Bruno Voisin


More information about the texworks mailing list