Log in

No account? Create an account

Building gnutls 1.4.1 on OS X

« previous entry | next entry »
Aug. 22nd, 2006 | 12:08 am

Or if I toss another -flat_namespace over here, I'm sure it'd make things better.

After running OS X for a while I realized that I miss mutt, and I more importantly I miss mairix, so I wanted to set up an imap server on my mac and have multiple mail clients connect to it. Preferably an imap server that saves messages in a standard mailbox format.

But before I could get any of those other worthy goals accomplished I needed to get an SSL library working, some time ago I managed to build gnutls, but any time I ran certtool I got a bunch of unresolved namespace errors.

After some diagnosing I learned more about OS X's two-level namespaces, and that basically software written for other unix systems that use the dynamic library load apis will break, without sprinkling "-flat_namespace" in at least your LDFLAGS environment variable.

Currently libgpg-error-1.0 and libgcrypt-1.2.2 compiled fairly easily and appear to have accepted the -flat_namespace. (libgpg-error-1.3 doesn't compile for some reason, and since there's so many other packages I want to use I don't really care.)

gnutls-1.4.1 unfortunately was more challenging as it ships with its own libtool, so in some of its final build steps it dropped the all-important -flat_namespace when linking a library.

I started with
$ export CFLAGS=-flat_namespace
$ export LDFLAGS=-flat_namespace
$ configure --disable-openssl-compatibility

After running configure I needed to change archive_cmds="\$CC -dynamiclib ..." to archive_cmds="\$CC -flat_namespace -dynamiclib..." my compilation finished, and more importantly certtool ran without the unresolved namespace issue.

At this point I hope the autotools suite dies, it was a good prototype, but its time for something that works better (like cmake)

(Aslo the change to archive_cmds needs to be made everything configure is run, there's probably a better way to do it, but there's other packages I need to get working first)
Tags: ,

Link | Leave a comment |

Comments {0}