autoconf
[Top][All Lists]
Advanced

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

Darwin universal binaries and LDFLAGS conundrum


From: Martin-Gilles Lavoie
Subject: Darwin universal binaries and LDFLAGS conundrum
Date: Wed, 23 May 2007 10:03:59 -0400


Greetings

First, I'd like to apologize upfront for the sheer autoconf noob-ness this post might impose on vets possibly on this list. But as luck would have it, I seem to be stuck with the job of dealing with an autoconf.ac script of ours wich doesn't seem to want to play nice with the task at hand.

Full source code relating to the issue is available online at:

http://www.oracle.com/technology/software/products/berkeley-db/ index.html

To resume the problem, I need to build a Universal Binary (aka, PPC + i386) library of BerkeleyDB. Now, normally, this is a simple task but it seems Autoconfig is working against me.

At the strict minimum, I need to have the following flags set in the generated makefile:

CFLAGS= -c $(CPPFLAGS) -O3 -isysroot /Developer/SDKs/ MacOSX10.4u.sdk -arch i386 -arch ppc
        LDFLAGS=        -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk

The problem is, whatever I set for LDFLAGS or CFLAGS in the .ac file passed to autoconf, the output Makefile is invariably stripped down to an empty LDFLAGS declaration and a CFLAGS devoid of the -isysroot and -arch parameters.

Now being new to autoconf, I suspected I was doing something really stupid until I stumbled onto this:

http://www.nabble.com/Configure-Support-for-Mac-Universal-Builds- t3635358.html

So, it seems I'm not the only one having this problem. Sure enough, manually patching the resulting makefile actually produced the universal library I was expecting:

        > file .libs/libdb-4.5.a
        .libs/libdb-4.5.a: Mach-O fat file with 2 architectures
.libs/libdb-4.5.a (for architecture i386): current ar archive random library
        .libs/libdb-4.5.a (for architecture ppc):       current ar archive

So, a current workaround would be to tweak my build sequence to hack the proper settings using sed & awk but this somewhat defeats the purpose of running autoconf in the first place.

The question is, is this a known bug and/or is this on the radar of things to do for Autoconf?


Martin-Gilles Lavoie | Senior software developer | 514.905.8658
Oracle - Macintosh Native Desktop Client, Beehive
600, boul. de Maisonneuve West, Suite 1900 | Montréal (Québec)  H3A 3J2






reply via email to

[Prev in Thread] Current Thread [Next in Thread]