[tlbuild] Cross-compiling TL on Mac for Tiger

Mojca Miklavec mojca.miklavec.lists at gmail.com
Sun May 29 15:43:25 CEST 2011


On Sat, May 28, 2011 at 17:27, Richard Koch wrote:
> Mojca,
>
> Thanks for the message.
>
> Note that MacTeX-2011 will support both PPC and Intel
> on Leopard, Snow Leopard, and Lion.
>
> For this distribution, I am not interested in supporting Tiger,
> because the simplification made by dropping support
> affects Ghostscript and Image Magick even more than
> TeX Live.

I'm sorry - I completely forgot about all the other tools (in
particular I never realized the existence of Ghostscript & Image
Magick in MacTeX).

> If you want to get changes in the TeX Live build script to
> support Tiger, I'll let you work directly with the TeX Live folks.

OK. I'll try to talk to Peter.

> One very big caveat is that I hope build changes are optional,
> set by flags of some sort. That is, I don't want folks compiling
> on Snow Leopard to be forced to use deprecated libraries by
> built in flags. But I think you'll agree with that sentiment.

I completely agree.

Hardcoded options make no sense. In particular since one never knows
whether the user will want to compile the sources on Panther or Lion.

----------

The following would be my feature requests for the Build script:

When cross-compiling on Mac OS X I would like to specify three optional things:
  (a) architecture (ppc, i386 or x86_64)
  (b) Mac OS X version
  (c) compilers (for example i686-apple-darwin10-gcc-4.0.1 and
i686-apple-darwin10-g++-4.0.1 or llvm-gcc-4.2 and llvm-g++-4.2 instead
of gcc and g++)

In case of (a), the building script should:
  - add "-arch NAME" to CFLAGS, CXXFLAGS, OBJCFLAGS and LDFLAGS
  - store the final binaries (inst/bin) under folder name starting
with i386/powerpc as opposed to naming the folder x86_64 (but that is
way less important)

In case of (b), the building script should:
  - export MACOSX_DEPLOYMENT_TARGET=10.x
  - add "-isysroot /Developer/SDKs/MacOSX10.x.sdk" (4 => 4u)

The case (c) is probably already covered with something like
  ./Build CC=llvm-gcc-4.2 CXX=llvm-g++-4.2
but I could provide some basic version compatibility checks to prevent
most obvious problems when compiling with a too recent compiler for an
old OS or vice versa (it often works, but even more often results in
weird compilation problem when versions mismatch).

The settings should go somewhere around the following lines in Build script:

: ${TL_BUILD_ENV=}
if test "x$1" = x--debug || test "x$1" = x-g; then
  shift
  TL_BUILD_ENV="CFLAGS='-g $TL_GCFLAGS' CXXFLAGS=-g OBJCFLAGS=-g $TL_BUILD_ENV"
fi

I can provide the exact command that I was using, but this needs
proper incorporation. I hardcoded the options to test if it worked at
all in the first place.

One bug though. xdv2pdf doesn't honor CC/CXX setting and uses gcc
instead, so the compilation fails. However after disabling building of
xdv2pdf everything works perfectly fine for both i386 and ppc.

So I guess that I have now working i386 & ppc Tiger binaries (for
everything but xdv2pdf). I used gcc 4.0 cross-compiler and 10.4 SDK.

Summary:
- I would be very grateful if some extra switches could be added to
Build script to support almost-automatic cross-compilation on mac
(this is probably up to Peter)
- I would be grateful if the bug in xdv2pdf configuration would be fixed.
- If anyone changes the mind about Tiger support, it is ready.
- I wish it was be possible to avoid updates of universal binaries
when working on x86_64 (but that is way less important than the rest).

Thanks,
    Mojca


More information about the tlbuild mailing list