incubator-couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoit Chesneau <>
Subject Re: Compile and Link Flags
Date Wed, 02 Feb 2011 11:59:08 GMT
On Wed, Feb 2, 2011 at 5:36 AM, Randall Leeds <> wrote:
> 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
> glamorous.
> 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.
> [1]
> [2]

Looks good for me. Will try this branch in afternoon on my bsd systems.

- benoit

View raw message