couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randall Leeds <>
Subject Compile and Link Flags
Date Wed, 02 Feb 2011 04:36:41 GMT
Hey devs,

After mucking around in the build system the past few weeks my
compulsions got the best of me and I did things.
I think it's an improvement. I apologize for digging this up. It's not

I put a branch up on github based on current trunk[1].

I started by trying to make the build system find libmozjs and jsapi.h
from a xulrunner development installation's pkg-config files.
I also wanted to make libcurl a soft dependency. Paul committed this,
but it's got an error fixed on this branch[2].

After staring at this long, I got twitchy.
In particular, the following sorts of things really irked me:

1) "# manually linking libm is requred for FreeBSD 7.0"

I think this was needed by the icu driver, which is why icu-config
--ldflags includes -lm on my system.
But we weren't using icu-config --ldflags, we were just using the
search paths. Why? ICU wants other stuff for me.
In particular, AC_CHECK_ICU sets ICU_CFLAGS and ICU_LIBS for us but we
were ignoring them. That's craziness.

2) CFLAGS="-O2"
But only on the Windows build?
There's one place where we differentiate between windows/nix in but each case contained mostly the same stuff!
Only a -D CFLAG for SpiderMonkey needs to be different.
This CFLAG was also dropped into the generic FLAGS variable, along
with ERLANG_FLAGS, which gets duplicated in CPPFLAGS and LDFLAGS!
LTFLAGS was set to CFLAGS, but only on windows. I believe this is
default for libtool anyway.

Anyway, once I broke all this stuff down more explicitly and passed
only what was needed everywhere and let ICU tell us how it should be
linked I found that my ICU install says it should be compiled with
-ansi, so I fixed the comments in the icu driver to be C style (/*

Everything passes here and builds nicely.

Combining it all we get:
A that is easier on the eyes.
Less platform specific stuff strew about the build system.
No need for --with-js-* on systems with a system-wide xulrunner.
A (correct this time) soft dependency on libcurl.

So, is this stuff that should go in trunk? Or was this all for naught?
Again, sorry for the non-functional changes. I promise I'll submit
patches that actually improve functionality soon.


View raw message