[tex-live] metapost on Mac OS X 10.5

Taco Hoekwater taco at elvenkind.com
Mon May 5 09:49:54 CEST 2008


Hi,

Karl Berry wrote:
>         checking for ANSI C header files... no
> 
> So the basic question is why that test failed.  I'm supposing MacOSX
> 10.5 really does have ANSI C headers, but maybe there is some bug in
> them, such that Autoconf concludes otherwise.
> 
> Hans, if you look in the config.log file, you'll find the file that
> configure compiled to do the test, along with the exact invocation to do
> it.  Can you post that?
> 
>     I am not sure if this affects tex-live compilation: 
> 
> If STDC_HEADERS is not declared, then c-std.h will certainly default to
> char; that's nothing new.  (You can also work around the problem with
> -DALLOC_RETURN_TYPE=void.)  Perhaps I should change it to always use
> void, since I rather doubt any systems we care about use char, these days.
> 
> So, in that alternative ... Hans, if you change line 57 of
> kpathsea/c-std.h from
> #define ALLOC_RETURN_TYPE char
> to
> #define ALLOC_RETURN_TYPE void
> does compilation proceed?

This problem popped up again last week.

Now that the metapost release includes the updated kpathsea from tl,
it no longer compiles out of the box on OS X 10.5.

Here is Hans van der Meer's diag/solution:
>> Eureka! I think I found it (took a lot of experimentation).
>> 
>> Playing with the optimizing options through CFLAGS and setting the 
>> architecture to the G4 status of my Mac Powerbook, miraculously 
>> Metafont1.002 did compile under MacOSX10.5.
>> Experimentally I then established that the architecture should be 
>> specified on the gcc call in order to have the proper ANSI headers 
>> found; without these compilation will get stuck.
>> 
>> The options that I think relevant are (both CFLAGS and CXXFLAGS should 
>> be set):
>> 
>> 1. general architecture specification:
>>    CFLAGS -arch ppc      (for powerpc)
>>    CFLAGS -arch ppc64    (for the new 64bit binaries on powerpc)
>>    CFLAGS -arch i386     (for intel)
>>    I did not check the ppc64 (not needed) and i386 (not having one) 
>> options.
>> 
>> 2. more specific architecture specification affecting instruction set 
>> and scheduling if one wants to tune the generated code to ones processor:
>>    CFLAGS -mcpu=G4 (-mcpu=G5 etc. whichever ones machine has)
>> 
>> It would be most natural, I think, if the -arch switch is added standard 
>> through the autoconf scripts. Taco could see to that for metapost and 
>> luatex, I trust. Can someone mail this experience to the maintainers of 
>> pdftex? (I could not ascertain why pdftex compiles without problems).
>> 
>> Hans van der Meer

When I reposted that on the ConTeXt mailing list, Mojca responded with:
> I might be missing the point, but I would be glad if -arch would not
> be set automatically if there is some better solution. Now it's really
> easy to cross-compile metapost, pdfTeX and LuaTeX for ppc on intel. If
> configure script would set the -arch unconditionally, then I would
> probably run into problems. But again - I might be misunderstanding
> the problem.

I would work on this if I could, but without access to 10.5 and with
unsufficient knowledge of autoconf, I have to pass. If nobody has
time and knowledge, then a warning in a README explaining Hans'
workaround is needed, I suppose.

Best wishes,
Taco



More information about the tex-live mailing list