Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 15886 invoked from network); 2 Feb 2011 11:59:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Feb 2011 11:59:37 -0000 Received: (qmail 95983 invoked by uid 500); 2 Feb 2011 11:59:37 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 95556 invoked by uid 500); 2 Feb 2011 11:59:34 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 95536 invoked by uid 99); 2 Feb 2011 11:59:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Feb 2011 11:59:33 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bchesneau@gmail.com designates 209.85.214.180 as permitted sender) Received: from [209.85.214.180] (HELO mail-iw0-f180.google.com) (209.85.214.180) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Feb 2011 11:59:29 +0000 Received: by iwn37 with SMTP id 37so8547480iwn.11 for ; Wed, 02 Feb 2011 03:59:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=mHLXyxc3bw6B9CET6i/Zz8EsTRfdpXZzgzXSI8ioT+M=; b=EryTddn0Vq7nalCyq/a5FqScDe92IHaYzdrQ3loe9U01MPNte8V/pHCFk0JHK4Wazt qsvnjK1rxdQSE2nkuEyaYVqb6RpQp/Nzc7l/IQBF3xwrHMPkqD5zFtlsUbaZfbZJNlgX PmQbAWx4z7Xs6OibRNrIMbvJsEzRSUzgH4uaY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=sVTnEWqH50dXaf7dSeUVFFKTk4G2Eim2hnHNFu/vW+S+qSkRy0NYYGw5G96l8BECEu 2R6oWaTXJ2vdNhmJyHtgdCi+zgWNeEDQ9Zd7uGl+3rI6rDPa+1GuzzBSlzmO2VcZVAMt La9yk8yvmIi7azh8HcTOiyKatrlauR3u8ihXw= MIME-Version: 1.0 Received: by 10.42.226.69 with SMTP id iv5mr10969766icb.320.1296647948718; Wed, 02 Feb 2011 03:59:08 -0800 (PST) Received: by 10.231.36.67 with HTTP; Wed, 2 Feb 2011 03:59:08 -0800 (PST) In-Reply-To: References: Date: Wed, 2 Feb 2011 12:59:08 +0100 Message-ID: Subject: Re: Compile and Link Flags From: Benoit Chesneau To: dev@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 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 configure.ac 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 > configure.ac 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 configure.ac 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] https://github.com/tilgovi/couchdb/tree/flagmadness > [2] https://github.com/tilgovi/couchdb/commit/0185faa2150f072a8c71b03325424c20e24c3eab > Looks good for me. Will try this branch in afternoon on my bsd systems. - benoit