From MAILER-DAEMON Fri Jul 01 10:44:54 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qcexh-000548-Su
	for mharc-autoconf@gnu.org; Fri, 01 Jul 2011 10:44:54 -0400
Received: from eggs.gnu.org ([140.186.70.92]:52382)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <cwr@netcom.co.uk>) id 1Qcexe-00053H-Tt
	for autoconf@gnu.org; Fri, 01 Jul 2011 10:44:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <cwr@netcom.co.uk>) id 1Qcexd-00043f-AK
	for autoconf@gnu.org; Fri, 01 Jul 2011 10:44:50 -0400
Received: from dns2.netcom.co.uk ([217.72.171.56]:41383
	helo=cleese.netcom.co.uk) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <cwr@netcom.co.uk>) id 1Qcexd-00042l-0y
	for autoconf@gnu.org; Fri, 01 Jul 2011 10:44:49 -0400
Received: by cleese.netcom.co.uk (Postfix, from userid 1008)
	id 0428664804B; Fri,  1 Jul 2011 15:44:40 +0100 (BST)
Received: from 81.144.199.141 ([81.144.199.141]) by webmail.netcom.co.uk
	(Horde Framework) with HTTP; Fri, 01 Jul 2011 15:44:40 +0100
Message-ID: <20110701154440.1446774k3vc5zlog@webmail.netcom.co.uk>
Date: Fri, 01 Jul 2011 15:44:40 +0100
From: cwr@netcom.co.uk
To: autoconf@gnu.org
Subject: Re: System files and "make distcheck"
References: <20110625143843.10585fqzztvhopog@webmail.netcom.co.uk>
	<20110627061242.238070@gmx.net>
	<20110627120829.62004ur16adzczac@webmail.netcom.co.uk>
	<20110627141105.GA26016@elliptictech.com>
In-Reply-To: <20110627141105.GA26016@elliptictech.com>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=ISO-8859-1;
 DelSp="Yes";
 format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
User-Agent: Internet Messaging Program (IMP) H3 (4.3.7)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 217.72.171.56
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 01 Jul 2011 14:44:52 -0000

Quoting Nick Bowler <nbowler@elliptictech.com>:

> On 2011-06-27 12:08 +0100, cwr@netcom.co.uk wrote:
>> It looks as if the standard GNU installation method would require
>> every user to run ./configure --sysconfdir=/etc
>
> If the user wants those config files to be installed to /etc, then yes.
>
>> whereas most would just try the usual ./configure && make.  Given the
>> choice between a convenient installation for the user, and a working
>> distcheck, I think I'll have to take the convenient installation.
>
> It's not very convenient for users who do not have root access to a
> machine or otherwise don't want to write to system-wide installation
> directories (such users therefore may want to install with something
> like --prefix=$HOME/sw).
>
> Users who want to install multiple versions of your package may also
> be inconvenienced.
>

Well, yes; however, if you don't have root access to the machine then
the package can't be installed correctly - that's just the nature of
the GUI.  And if you install multiple versions of the package (as you
can) that will still result in only one entry to the system file.

I'm really not happy about the non-standard install, but it seems the
least bad solution.

Will







From MAILER-DAEMON Fri Jul 01 10:47:17 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qcf00-0005kN-Pp
	for mharc-autoconf@gnu.org; Fri, 01 Jul 2011 10:47:16 -0400
Received: from eggs.gnu.org ([140.186.70.92]:49576)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <cwr@netcom.co.uk>) id 1Qcezx-0005jM-VL
	for autoconf@gnu.org; Fri, 01 Jul 2011 10:47:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <cwr@netcom.co.uk>) id 1Qcezw-0004ZG-6o
	for autoconf@gnu.org; Fri, 01 Jul 2011 10:47:13 -0400
Received: from dns2.netcom.co.uk ([217.72.171.56]:41447
	helo=cleese.netcom.co.uk) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <cwr@netcom.co.uk>) id 1Qcezv-0004ZC-R4
	for autoconf@gnu.org; Fri, 01 Jul 2011 10:47:12 -0400
Received: by cleese.netcom.co.uk (Postfix, from userid 1008)
	id 395D764804B; Fri,  1 Jul 2011 15:47:11 +0100 (BST)
Received: from 81.144.199.141 ([81.144.199.141]) by webmail.netcom.co.uk
	(Horde Framework) with HTTP; Fri, 01 Jul 2011 15:47:11 +0100
Message-ID: <20110701154711.16041hfj7p9kuo68@webmail.netcom.co.uk>
Date: Fri, 01 Jul 2011 15:47:11 +0100
From: cwr@netcom.co.uk
To: autoconf@gnu.org
Subject: Re: System files and "make distcheck"
References: <20110625143843.10585fqzztvhopog@webmail.netcom.co.uk>
	<20110627061242.238070@gmx.net>
	<20110627120829.62004ur16adzczac@webmail.netcom.co.uk>
	<20110627202727.284880@gmx.net>
In-Reply-To: <20110627202727.284880@gmx.net>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=UTF-8;
 DelSp="Yes";
 format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
User-Agent: Internet Messaging Program (IMP) H3 (4.3.7)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 217.72.171.56
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 01 Jul 2011 14:47:15 -0000

Quoting Ralf Wildenhues <Ralf.Wildenhues@gmx.de>:

> * cwr@netcom.co.uk wrote on Mon, Jun 27, 2011 at 01:08:29PM CEST:
>> It looks as if the standard GNU installation method would require
>> every user to run ./configure --sysconfdir=/etc, whereas most would
>> just try the usual ./configure && make.  Given the choice between
>> a convenient installation for the user, and a working distcheck, I
>> think I'll have to take the convenient installation.
>
> You can have both.  At the least, you shouldn't override explicit user
> wishes.
>
> configure defaults sysconfdir to '${prefix}/etc', so you could override
> it to /etc if prefix is /usr and sysconfdir has not been overridden by
> the user:
>
> AC_INIT
> if test "$prefix" = / && test "$sysconfdir" = '${prefix}/etc'; then
>   sysconfdir=/etc
>   AS_MSG_NOTICE([overriding sysconfdir to $sysconfdir])
> fi

Many thanks - I'll give it a shot.

>
>> The other approach would be to run the command grep xx || sed yyy || true,
>> so that the installation never fails, but since the setup's a bit
>> obscure if it failed that would cause even more problems for users.
>
> Ewww.
>

My thoughts exactly.

Will





From MAILER-DAEMON Sat Jul 02 05:13:10 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QcwGD-0000aV-Fa
	for mharc-autoconf@gnu.org; Sat, 02 Jul 2011 05:13:09 -0400
Received: from eggs.gnu.org ([140.186.70.92]:51755)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <cwr@netcom.co.uk>) id 1QcwGA-0000Zt-As
	for autoconf@gnu.org; Sat, 02 Jul 2011 05:13:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <cwr@netcom.co.uk>) id 1QcwG8-0006pU-JV
	for autoconf@gnu.org; Sat, 02 Jul 2011 05:13:05 -0400
Received: from dns2.netcom.co.uk ([217.72.171.56]:56084
	helo=cleese.netcom.co.uk) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <cwr@netcom.co.uk>) id 1QcwG8-0006pD-8U
	for autoconf@gnu.org; Sat, 02 Jul 2011 05:13:04 -0400
Received: by cleese.netcom.co.uk (Postfix, from userid 1008)
	id 73F7A648007; Sat,  2 Jul 2011 10:13:02 +0100 (BST)
Received: from 81.144.199.142 ([81.144.199.142]) by webmail.netcom.co.uk
	(Horde Framework) with HTTP; Sat, 02 Jul 2011 10:13:02 +0100
Message-ID: <20110702101302.208635ffhmovckcg@webmail.netcom.co.uk>
Date: Sat, 02 Jul 2011 10:13:02 +0100
From: cwr@netcom.co.uk
To: autoconf@gnu.org
Subject: Re: System files and "make distcheck"
References: <20110625143843.10585fqzztvhopog@webmail.netcom.co.uk>
	<20110627061242.238070@gmx.net>
	<20110627120829.62004ur16adzczac@webmail.netcom.co.uk>
	<20110627202727.284880@gmx.net>
In-Reply-To: <20110627202727.284880@gmx.net>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=ISO-8859-1;
 DelSp="Yes";
 format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
User-Agent: Internet Messaging Program (IMP) H3 (4.3.7)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 217.72.171.56
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 02 Jul 2011 09:13:07 -0000

Quoting Ralf Wildenhues <Ralf.Wildenhues@gmx.de>:

> * cwr@netcom.co.uk wrote on Mon, Jun 27, 2011 at 01:08:29PM CEST:
>> It looks as if the standard GNU installation method would require
>> every user to run ./configure --sysconfdir=/etc, whereas most would
>> just try the usual ./configure && make.  Given the choice between
>> a convenient installation for the user, and a working distcheck, I
>> think I'll have to take the convenient installation.
>
> You can have both.  At the least, you shouldn't override explicit user
> wishes.
>
> configure defaults sysconfdir to '${prefix}/etc', so you could override
> it to /etc if prefix is /usr and sysconfdir has not been overridden by
> the user:
>
> AC_INIT
> if test "$prefix" = / && test "$sysconfdir" = '${prefix}/etc'; then
>   sysconfdir=/etc
>   AS_MSG_NOTICE([overriding sysconfdir to $sysconfdir])
> fi

Yup, that works.  The problem was that I didn't really grasp the way you can
merge Autoconf and shell code.  Finally I've got a setup which has reasonable
defaults, and which can be overridden by the user.

Many thanks - Will





From MAILER-DAEMON Tue Jul 05 11:41:46 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qe7kv-0005q8-GD
	for mharc-autoconf@gnu.org; Tue, 05 Jul 2011 11:41:45 -0400
Received: from eggs.gnu.org ([140.186.70.92]:55496)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <edwards.jim@gmail.com>) id 1Qe7kr-0005pC-NQ
	for autoconf@gnu.org; Tue, 05 Jul 2011 11:41:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <edwards.jim@gmail.com>) id 1Qe7kp-0006iD-Ud
	for autoconf@gnu.org; Tue, 05 Jul 2011 11:41:41 -0400
Received: from mail-vw0-f41.google.com ([209.85.212.41]:43179)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <edwards.jim@gmail.com>) id 1Qe7kp-0006hR-3V
	for autoconf@gnu.org; Tue, 05 Jul 2011 11:41:39 -0400
Received: by vws4 with SMTP id 4so5543329vws.0
	for <autoconf@gnu.org>; Tue, 05 Jul 2011 08:41:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=pQfYik0dwrWhCipmJXHrbNL/BaS0dTtE/PEudxAt+QM=;
	b=F+1Ah8+tq0XLFrg6I3vzUAHCIjMAYJfiDInD/A6GnjXFSc9KYM6gIjnkiy0P/umbuD
	pKx5720tPGy73DiVmdyoOMfnTnJD4vP7PHQZuFbWsW5Us6EfexDGIYwMYcjf4+mJHfRa
	0a62Z8/lvkXni6gRscfJYHT8W1zcJ6VuDnZ0Y=
MIME-Version: 1.0
Received: by 10.52.168.3 with SMTP id zs3mr6225309vdb.76.1309880497980; Tue,
	05 Jul 2011 08:41:37 -0700 (PDT)
Received: by 10.52.111.39 with HTTP; Tue, 5 Jul 2011 08:41:37 -0700 (PDT)
Date: Tue, 5 Jul 2011 09:41:37 -0600
Message-ID: <CAGamEOuizj2PgZLFEbpD4NqAH7_sG1rFX+4K7JBeMCif8n2ShA@mail.gmail.com>
Subject: how to query filesystem type?
From: Jim Edwards <edwards.jim@gmail.com>
To: parallelio@googlegroups.com, autoconf@gnu.org
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.212.41
Content-Type: text/plain; charset=ISO-8859-1
X-Content-Filtered-By: Mailman/MimeDel 2.1.14
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Jul 2011 15:41:43 -0000

I would like to have autoconf determine if a target filesystem is gpfs or
lustre - are there existing tools to do this?

If not is anyone aware of a shell command that would provide this?

From MAILER-DAEMON Tue Jul 05 12:28:55 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qe8UY-00020X-OI
	for mharc-autoconf@gnu.org; Tue, 05 Jul 2011 12:28:54 -0400
Received: from eggs.gnu.org ([140.186.70.92]:58155)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <edwards.jim@gmail.com>) id 1Qe8UQ-0001xa-RI
	for autoconf@gnu.org; Tue, 05 Jul 2011 12:28:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <edwards.jim@gmail.com>) id 1Qe8UN-00013x-Vk
	for autoconf@gnu.org; Tue, 05 Jul 2011 12:28:46 -0400
Received: from mail-vw0-f41.google.com ([209.85.212.41]:37668)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <edwards.jim@gmail.com>) id 1Qe8UN-00013e-Br
	for autoconf@gnu.org; Tue, 05 Jul 2011 12:28:43 -0400
Received: by vws4 with SMTP id 4so5588943vws.0
	for <autoconf@gnu.org>; Tue, 05 Jul 2011 09:28:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=phpBTOVyeddYmr7FHxgG2c0M5LrErZDW2MjIuJnNvJk=;
	b=K8xSn+g9imh5tbbdh/ztYU3097iVTYTCqZQVxgUEcc1AVZLgVtXWrSyzGV4xqqx9xB
	OJIltk9r4H9xzzRo0nrlXaAXm29Dr1q/1bvBDgp2NcSby/PvQWQELBR4msZRMbXGDVRV
	XqvExwS/1j09qF4lRHX671ZG9aOZFS4Cu+EoQ=
MIME-Version: 1.0
Received: by 10.52.106.232 with SMTP id gx8mr6201343vdb.236.1309883322307;
	Tue, 05 Jul 2011 09:28:42 -0700 (PDT)
Received: by 10.52.111.39 with HTTP; Tue, 5 Jul 2011 09:28:42 -0700 (PDT)
In-Reply-To: <20110705161112.GF25388@mcs.anl.gov>
References: <CAGamEOuizj2PgZLFEbpD4NqAH7_sG1rFX+4K7JBeMCif8n2ShA@mail.gmail.com>
	<20110705161112.GF25388@mcs.anl.gov>
Date: Tue, 5 Jul 2011 10:28:42 -0600
Message-ID: <CAGamEOvvgvtQJYakRN4DyCiYxQ8H6FG8oA2UcyLGLq5nweF90g@mail.gmail.com>
Subject: Re: how to query filesystem type?
From: Jim Edwards <edwards.jim@gmail.com>
To: parallelio@googlegroups.com
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.212.41
Content-Type: text/plain; charset=ISO-8859-1
X-Content-Filtered-By: Mailman/MimeDel 2.1.14
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Jul 2011 16:28:52 -0000

On Tue, Jul 5, 2011 at 10:11 AM, Rob Latham <robl@mcs.anl.gov> wrote:

> On Tue, Jul 05, 2011 at 09:41:37AM -0600, Jim Edwards wrote:
> > I would like to have autoconf determine if a target filesystem is gpfs or
> > lustre - are there existing tools to do this?
> >
> > If not is anyone aware of a shell command that would provide this?
>
> i'd just like to point out that in general there's no guarantee that
> the file system you detect at configure time will be the one you
> access during run time.
>

This is true, but the working directory is an input to the script and I'm
using this to determine and set
mpi-io filesystem hints - as far as I know it doesn't hurt much if I get
them wrong - the hints will be ignored and
nothing will fail.



>
> the 'stat -f /path/to/file_system' command can give you the
> information you want:
>
> % stat -c %T -f /
> ext2/ext3
>
>
Running this on /tmp/work/$USER on jaguarpf gives

UNKNOWN (0xbd00bd0)

I suppose you could key on the magic number, but that doesn't seem very
robust.




> If you use the system call statfs(2) you can determine the fs type at
> runtime.  Nowadays it's even reasonably (but not entirely) portable:
>
> struct statfs has a f_fsid member.  The magic number for Lustre is "#define
> LL_SUPER_MAGIC 0x0BD00BD0" (defined in lustre_user.h).  The magic number
> for
> GPFS is ...  0x47504653 I guess?
>

I get this result from a bluegene linux front end, but not from AIX.


>

From MAILER-DAEMON Tue Jul 05 13:37:19 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qe9Yk-0005Uj-Rq
	for mharc-autoconf@gnu.org; Tue, 05 Jul 2011 13:37:18 -0400
Received: from eggs.gnu.org ([140.186.70.92]:32919)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1Qe9Yh-0005Tp-CU
	for autoconf@gnu.org; Tue, 05 Jul 2011 13:37:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1Qe9Yd-0004dB-6P
	for autoconf@gnu.org; Tue, 05 Jul 2011 13:37:15 -0400
Received: from mx1.redhat.com ([209.132.183.28]:6202)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>)
	id 1Qe9Yc-0004cp-P6; Tue, 05 Jul 2011 13:37:10 -0400
Received: from int-mx09.intmail.prod.int.phx2.redhat.com
	(int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p65Hb8OA004141
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 5 Jul 2011 13:37:08 -0400
Received: from [10.3.113.151] (ovpn-113-151.phx2.redhat.com [10.3.113.151])
	by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id p65Hb75k030273; Tue, 5 Jul 2011 13:37:07 -0400
Message-ID: <4E134BC2.3090609@redhat.com>
Date: Tue, 05 Jul 2011 11:37:06 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10
MIME-Version: 1.0
To: Jim Edwards <edwards.jim@gmail.com>
Subject: Re: how to query filesystem type?
References: <CAGamEOuizj2PgZLFEbpD4NqAH7_sG1rFX+4K7JBeMCif8n2ShA@mail.gmail.com>	<20110705161112.GF25388@mcs.anl.gov>
	<CAGamEOvvgvtQJYakRN4DyCiYxQ8H6FG8oA2UcyLGLq5nweF90g@mail.gmail.com>
In-Reply-To: <CAGamEOvvgvtQJYakRN4DyCiYxQ8H6FG8oA2UcyLGLq5nweF90g@mail.gmail.com>
X-Enigmail-Version: 1.1.2
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enig85AAC0F9742B2FC53ACB79D0"
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: autoconf@gnu.org, parallelio@googlegroups.com,
	Coreutils <coreutils@gnu.org>
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Jul 2011 17:37:17 -0000

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig85AAC0F9742B2FC53ACB79D0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

[adding coreutils]

On 07/05/2011 10:28 AM, Jim Edwards wrote:
>> the 'stat -f /path/to/file_system' command can give you the
>> information you want:
>>
>> % stat -c %T -f /
>> ext2/ext3
>>
>>
> Running this on /tmp/work/$USER on jaguarpf gives
>=20
> UNKNOWN (0xbd00bd0)

Which version of coreutils?  Is this still happening in the latest
coreutils.git (in which case, this is a sign that coreutils needs to be
taught a new magic number)?

>> If you use the system call statfs(2) you can determine the fs type at
>> runtime.  Nowadays it's even reasonably (but not entirely) portable:
>>
>> struct statfs has a f_fsid member.  The magic number for Lustre is "#d=
efine
>> LL_SUPER_MAGIC 0x0BD00BD0" (defined in lustre_user.h).  The magic numb=
er
>> for
>> GPFS is ...  0x47504653 I guess?
>>
>=20
> I get this result from a bluegene linux front end, but not from AIX.

Disk type magic numbers are non-portable.  The magic numbers used in
Linux are not necessarily the same as exposed elsewhere.  I'm not even
sure if it is possible to make AIX output what file system type a
particular directory is, and even if it is possible, whether anyone has
yet contributed code to coreutils to make stat(1) output that information=
=2E

The problem here is that POSIX does not standardize a way to query this
type of information, so there is no portable interface to get at the
information.

--=20
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enig85AAC0F9742B2FC53ACB79D0
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJOE0vCAAoJEKeha0olJ0NqOYUH/3J6itGt7FxgPfDUC+JeUpAt
L1SFxikTOL+1cBN2xAzFNh8FQmALyyJxVAatvgyI22VTW4FcyVOjSTIhYAknB2Pj
LE6DesRxL6JKOdjLFKy2zBUIkSq617oOE9C5SYFhL4wjuB5yVguiUUZ30E25MVfR
CfeV9PeuXQlVXvf3GRIr3dp7ZkNDGQPEPZKnrwPDKzOtm1yhmYn9XSIBUASQtj4V
B5d0i6YVIWaIZfE7C+LxK+5ReaGZPYVeplf4/mWebA11v18c0vhE6RrV1yIYmxKy
eJbSdn9upt1AIhpRgX7eek9LHqk/RWfZ2VnJCNMLxFZyoTTB7sOy+DP6pD3ONUw=
=c+oB
-----END PGP SIGNATURE-----

--------------enig85AAC0F9742B2FC53ACB79D0--


From MAILER-DAEMON Tue Jul 05 16:53:26 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QeCcX-0001JL-Rg
	for mharc-autoconf@gnu.org; Tue, 05 Jul 2011 16:53:25 -0400
Received: from eggs.gnu.org ([140.186.70.92]:32794)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <robl@mcs.anl.gov>) id 1Qe8DW-0005Vw-Lu
	for autoconf@gnu.org; Tue, 05 Jul 2011 12:11:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <robl@mcs.anl.gov>) id 1Qe8DU-0005LP-UJ
	for autoconf@gnu.org; Tue, 05 Jul 2011 12:11:18 -0400
Received: from mailhost.anl.gov ([130.202.113.50]:62136)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <robl@mcs.anl.gov>) id 1Qe8DU-0005LC-H0
	for autoconf@gnu.org; Tue, 05 Jul 2011 12:11:16 -0400
Received: from mailhost.anl.gov (mailhost.anl.gov [130.202.113.50])
	by localhost.anl.gov (Postfix) with ESMTP id 83EF36E;
	Tue,  5 Jul 2011 11:11:14 -0500 (CDT)
Received: from zimbra.anl.gov (zimbra.anl.gov [130.202.101.12])
	by mailhost.anl.gov (Postfix) with ESMTP id 7D8A965;
	Tue,  5 Jul 2011 11:11:14 -0500 (CDT)
Received: from localhost (localhost.localdomain [127.0.0.1])
	by zimbra.anl.gov (Postfix) with ESMTP id 625071243C;
	Tue,  5 Jul 2011 11:11:14 -0500 (CDT)
X-Virus-Scanned: amavisd-new at zimbra.anl.gov
Received: from zimbra.anl.gov ([127.0.0.1])
	by localhost (zimbra.anl.gov [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id LA4YZnbNvebV; Tue,  5 Jul 2011 11:11:14 -0500 (CDT)
Received: from doakes.mcs.anl.gov (doakes.mcs.anl.gov [140.221.11.29])
	by zimbra.anl.gov (Postfix) with ESMTPSA id 4839412437;
	Tue,  5 Jul 2011 11:11:13 -0500 (CDT)
Received: by doakes.mcs.anl.gov (sSMTP sendmail emulation);
	Tue, 05 Jul 2011 11:11:12 -0500
Date: Tue, 5 Jul 2011 11:11:12 -0500
From: Rob Latham <robl@mcs.anl.gov>
To: parallelio@googlegroups.com
Subject: Re: how to query filesystem type?
Message-ID: <20110705161112.GF25388@mcs.anl.gov>
References: <CAGamEOuizj2PgZLFEbpD4NqAH7_sG1rFX+4K7JBeMCif8n2ShA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CAGamEOuizj2PgZLFEbpD4NqAH7_sG1rFX+4K7JBeMCif8n2ShA@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
X-detected-operating-system: by eggs.gnu.org: Solaris 9
X-Received-From: 130.202.113.50
X-Mailman-Approved-At: Tue, 05 Jul 2011 16:53:24 -0400
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Jul 2011 16:11:20 -0000

On Tue, Jul 05, 2011 at 09:41:37AM -0600, Jim Edwards wrote:
> I would like to have autoconf determine if a target filesystem is gpfs or
> lustre - are there existing tools to do this?
> 
> If not is anyone aware of a shell command that would provide this?

i'd just like to point out that in general there's no guarantee that
the file system you detect at configure time will be the one you
access during run time. 

the 'stat -f /path/to/file_system' command can give you the
information you want:

% stat -c %T -f /
ext2/ext3

If you use the system call statfs(2) you can determine the fs type at runtime.  Nowadays it's even reasonably (but not entirely) portable:

struct statfs has a f_fsid member.  The magic number for Lustre is "#define
LL_SUPER_MAGIC 0x0BD00BD0" (defined in lustre_user.h).  The magic number for
GPFS is ...  0x47504653 I guess?   

On Darwin, the f_fsid is a short, so these magic numbers might get truncated.

==rob

-- 
Rob Latham
Mathematics and Computer Science Division
Argonne National Lab, IL USA


From MAILER-DAEMON Tue Jul 05 16:54:57 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QeCe0-0001ek-Fp
	for mharc-autoconf@gnu.org; Tue, 05 Jul 2011 16:54:56 -0400
Received: from eggs.gnu.org ([140.186.70.92]:43439)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QeCdv-0001dW-Uj
	for autoconf@gnu.org; Tue, 05 Jul 2011 16:54:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QeCdt-0002TA-Ba
	for autoconf@gnu.org; Tue, 05 Jul 2011 16:54:51 -0400
Received: from mx.meyering.net ([82.230.74.64]:34583)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>)
	id 1QeCds-0002Sx-Q6; Tue, 05 Jul 2011 16:54:49 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 0C9756009D; Tue,  5 Jul 2011 22:54:48 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Eric Blake <eblake@redhat.com>
Subject: Re: how to query filesystem type?
In-Reply-To: <4E134BC2.3090609@redhat.com> (Eric Blake's message of "Tue, 05
	Jul 2011 11:37:06 -0600")
References: <CAGamEOuizj2PgZLFEbpD4NqAH7_sG1rFX+4K7JBeMCif8n2ShA@mail.gmail.com>
	<20110705161112.GF25388@mcs.anl.gov>
	<CAGamEOvvgvtQJYakRN4DyCiYxQ8H6FG8oA2UcyLGLq5nweF90g@mail.gmail.com>
	<4E134BC2.3090609@redhat.com>
Date: Tue, 05 Jul 2011 22:54:47 +0200
Message-ID: <87aacsxxbc.fsf@rho.meyering.net>
Lines: 78
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 82.230.74.64
Cc: parallelio@googlegroups.com, autoconf@gnu.org,
	Jim Edwards <edwards.jim@gmail.com>, Coreutils <coreutils@gnu.org>
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Jul 2011 20:54:54 -0000

Eric Blake wrote:
> [adding coreutils]
>
> On 07/05/2011 10:28 AM, Jim Edwards wrote:
>>> the 'stat -f /path/to/file_system' command can give you the
>>> information you want:
>>>
>>> % stat -c %T -f /
>>> ext2/ext3
>>>
>>>
>> Running this on /tmp/work/$USER on jaguarpf gives
>>
>> UNKNOWN (0xbd00bd0)
>
> Which version of coreutils?  Is this still happening in the latest
> coreutils.git (in which case, this is a sign that coreutils needs to be
> taught a new magic number)?
>
>>> If you use the system call statfs(2) you can determine the fs type at
>>> runtime.  Nowadays it's even reasonably (but not entirely) portable:
>>>
>>> struct statfs has a f_fsid member.  The magic number for Lustre is "#define
>>> LL_SUPER_MAGIC 0x0BD00BD0" (defined in lustre_user.h).  The magic number

stat -f support for Lustre file systems was added in 2008 (coreutils-7.1):
http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=a36f4cb451e9627

>>> GPFS is ...  0x47504653 I guess?

I see that GPFS_SUPER_MAGIC is the symbol name
http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/topic/com.ibm.cluster.gpfs32.basicadm.doc/bl1adm_admxafg.html
and several sources confirm that value of 0x47504653

So I expect to add support for it with this:

>From 86d19b44a5357158359e06e5db99cf7608470956 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Tue, 5 Jul 2011 22:49:56 +0200
Subject: [PATCH] stat: recognize GPFS as a file system type

* src/stat.c (human_fstype) [S_MAGIC_GPFS]: Add a case,
to handle GPFS_SUPER_MAGIC/0x47504653.  Prompted by discussion
http://thread.gmane.org/gmane.comp.sysutils.autoconf.general/14007
* NEWS (Improvements): Mention it.
---
 NEWS       |    2 ++
 src/stat.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/NEWS b/NEWS
index d58df26..f7e7823 100644
--- a/NEWS
+++ b/NEWS
@@ -37,6 +37,8 @@ GNU coreutils NEWS                                    -*- outline -*-
   cp and ls now support HP-UX 11.11's ACLs, thanks to improved support
   in gnulib.

+  stat -f now also recognizes the GPFS file system type.
+
 ** Build-related

   Changes inherited from gnulib address a build failure on HP-UX 11.11
diff --git a/src/stat.c b/src/stat.c
index 273bb4b..ab235d4 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -289,6 +289,8 @@ human_fstype (STRUCT_STATVFS const *statfsbuf)
       return "futexfs";
     case S_MAGIC_GFS: /* 0x1161970 */
       return "gfs/gfs2";
+    case S_MAGIC_GPFS: /* 0x47504653 */
+      return "gpfs";
     case S_MAGIC_HFS: /* 0x4244 */
       return "hfs";
     case S_MAGIC_HPFS: /* 0xF995E849 */
--
1.7.6.370.gfeac5


From MAILER-DAEMON Wed Jul 06 14:00:23 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QeWOd-0002Yo-1v
	for mharc-autoconf@gnu.org; Wed, 06 Jul 2011 14:00:23 -0400
Received: from eggs.gnu.org ([140.186.70.92]:42418)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <edwards.jim@gmail.com>) id 1QeWOW-0002XB-JS
	for autoconf@gnu.org; Wed, 06 Jul 2011 14:00:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <edwards.jim@gmail.com>) id 1QeWOU-0000k5-Nk
	for autoconf@gnu.org; Wed, 06 Jul 2011 14:00:16 -0400
Received: from mail-vx0-f169.google.com ([209.85.220.169]:46639)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <edwards.jim@gmail.com>) id 1QeWOU-0000k0-8H
	for autoconf@gnu.org; Wed, 06 Jul 2011 14:00:14 -0400
Received: by vxg38 with SMTP id 38so155339vxg.0
	for <autoconf@gnu.org>; Wed, 06 Jul 2011 11:00:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=kdiifz/oYS30gaRDMJKe0R4LX5ykSNqqipBcQdFpIbQ=;
	b=kY/bFAqo+xHZ7/8azzBU9QYGMb18EdXzDYshnBeW9Cs3qE7VKmRCuFe8riaEzUKJs/
	oWp/tF9dFeSlpQUMDcNFrRI1pTdzCM0f4S5VMTP36reQghFdF73Pq4CuROdY9w79OFsP
	e/3r2jyHyPInrxXMwrnJwXjU72AA3305DHrjs=
MIME-Version: 1.0
Received: by 10.52.106.232 with SMTP id gx8mr7961918vdb.236.1309975213152;
	Wed, 06 Jul 2011 11:00:13 -0700 (PDT)
Received: by 10.52.111.39 with HTTP; Wed, 6 Jul 2011 11:00:13 -0700 (PDT)
Date: Wed, 6 Jul 2011 12:00:13 -0600
Message-ID: <CAGamEOtg2Dpna22RAQr1NstWBUd-745UoYM_b4KLc5FdsDFxqQ@mail.gmail.com>
Subject: AC_FC_MODULE_FLAG
From: Jim Edwards <edwards.jim@gmail.com>
To: autoconf@gnu.org
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.220.169
Content-Type: text/plain; charset=ISO-8859-1
X-Content-Filtered-By: Mailman/MimeDel 2.1.14
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Jul 2011 18:00:21 -0000

When using the lahey fortran compiler the flag -M is used as the path to
modules, but its also the path to where new modules should be written.
So if you are referencing modules in a read-only directory using the -M flag
will cause your program to fail.   I think that the solution is to
test for -I first (that's also the most common result, so it would make
sense to test first I think)

--- fortran.m4    (revision 327)
+++ fortran.m4    (working copy)
@@ -618,7 +618,7 @@
   [cd ..
    ac_fc_module_flag_FCFLAGS_save=$FCFLAGS
    # Flag ordering is significant for gfortran and Sun.
-   for ac_flag in -M -I '-I ' '-M ' -p '-mod ' '-module ' '-Am -I'; do
+   for ac_flag in -I '-mod ' -I '-I ' '-M ' -p '-module ' '-Am -I'; do
      # Add the flag twice to prevent matching an output flag.
      FCFLAGS="$ac_fc_module_flag_FCFLAGS_save ${ac_flag}conftest.dir
${ac_flag}conftest.dir"
      AC_COMPILE_IFELSE([[

From MAILER-DAEMON Wed Jul 06 16:15:20 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QeYVD-0006ce-N2
	for mharc-autoconf@gnu.org; Wed, 06 Jul 2011 16:15:19 -0400
Received: from eggs.gnu.org ([140.186.70.92]:46431)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Ralf.Wildenhues@gmx.de>) id 1QeYVA-0006bh-0X
	for autoconf@gnu.org; Wed, 06 Jul 2011 16:15:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <Ralf.Wildenhues@gmx.de>) id 1QeYV7-0000mJ-EC
	for autoconf@gnu.org; Wed, 06 Jul 2011 16:15:15 -0400
Received: from mailout-de.gmx.net ([213.165.64.23]:49638)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <Ralf.Wildenhues@gmx.de>) id 1QeYV6-0000lR-MY
	for autoconf@gnu.org; Wed, 06 Jul 2011 16:15:13 -0400
Received: (qmail 22037 invoked by uid 0); 6 Jul 2011 20:15:10 -0000
Received: from 77.58.247.232 by www023.gmx.net with HTTP;
	Wed, 06 Jul 2011 22:15:08 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Date: Wed, 06 Jul 2011 22:15:08 +0200
From: "Ralf Wildenhues" <Ralf.Wildenhues@gmx.de>
In-Reply-To: <CAGamEOtg2Dpna22RAQr1NstWBUd-745UoYM_b4KLc5FdsDFxqQ@mail.gmail.com>
Message-ID: <20110706201508.176130@gmx.net>
MIME-Version: 1.0
References: <CAGamEOtg2Dpna22RAQr1NstWBUd-745UoYM_b4KLc5FdsDFxqQ@mail.gmail.com>
Subject: Re: AC_FC_MODULE_FLAG
To: Jim Edwards <edwards.jim@gmail.com>
X-Authenticated: #13673931
X-Flags: 0001
X-Mailer: WWW-Mail 6100 (Global Message Exchange)
X-Mutt-Fcc: ~/Mail/outbox
X-Mutt-References: <CAGamEOtg2Dpna22RAQr1NstWBUd-745UoYM_b4KLc5FdsDFxqQ@mail.gmail.com>
X-Priority: 3
X-Provags-ID: V01U2FsdGVkX199ZS1Nm1d9+XtS+88CwDWi+3AVk+0+L9tvM+8Ep2
	SEbDbfBzujT4o9d8yHmjrPczVTed9CTCLIsg== 
Content-Transfer-Encoding: 8bit
X-GMX-UID: f/sse/E3bmwoVrnXuDdLDTZPUzc4cpHI
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 213.165.64.23
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Jul 2011 20:15:18 -0000

Hi Jim,

thanks for the bug report!

* Jim Edwards wrote on Wed, Jul 06, 2011 at 08:00:13PM CEST:
> When using the lahey fortran compiler the flag -M is used as the path to
> modules, but its also the path to where new modules should be written.
> So if you are referencing modules in a read-only directory using the -M flag
> will cause your program to fail.   I think that the solution is to
> test for -I first (that's also the most common result, so it would make
> sense to test first I think)

Well, with Solaris Fortran, -I is the flag to search for both header
includes as well as modules, but it also has -M for module search path
only.  I'm kind of wary that if some command-line gets hardcoded -M
flags from elsewhere, they could then end up overriding the ones
computed by configure, although they come later in the command-line.

Can we fix the test somehow so that -M is not chosen with Lahey?  Adding
the flag twice worked for some compiler at least.  Could also test
whether the compiler creates a module somewhere.  Care to experiment a
bit to find something that works with your compiler?  (I don't have
Lahey to test.)

> --- fortran.m4    (revision 327)
> +++ fortran.m4    (working copy)
> @@ -618,7 +618,7 @@
>    [cd ..
>     ac_fc_module_flag_FCFLAGS_save=$FCFLAGS
>     # Flag ordering is significant for gfortran and Sun.
> -   for ac_flag in -M -I '-I ' '-M ' -p '-mod ' '-module ' '-Am -I'; do
> +   for ac_flag in -I '-mod ' -I '-I ' '-M ' -p '-module ' '-Am -I'; do
>       # Add the flag twice to prevent matching an output flag.
>       FCFLAGS="$ac_fc_module_flag_FCFLAGS_save ${ac_flag}conftest.dir
> ${ac_flag}conftest.dir"
>       AC_COMPILE_IFELSE([[

Thanks,
Ralf


From MAILER-DAEMON Wed Jul 06 17:59:19 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qea7q-0000We-Sv
	for mharc-autoconf@gnu.org; Wed, 06 Jul 2011 17:59:19 -0400
Received: from eggs.gnu.org ([140.186.70.92]:54102)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <edwards.jim@gmail.com>) id 1Qea7o-0000WD-OO
	for autoconf@gnu.org; Wed, 06 Jul 2011 17:59:18 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <edwards.jim@gmail.com>) id 1Qea7m-0004RQ-Pb
	for autoconf@gnu.org; Wed, 06 Jul 2011 17:59:16 -0400
Received: from mail-vx0-f169.google.com ([209.85.220.169]:40018)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <edwards.jim@gmail.com>) id 1Qea7m-0004RG-8b
	for autoconf@gnu.org; Wed, 06 Jul 2011 17:59:14 -0400
Received: by vxg38 with SMTP id 38so343927vxg.0
	for <autoconf@gnu.org>; Wed, 06 Jul 2011 14:59:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=Sb6SPMQMj6PxEZnK2sa+uTZsK2CytrwVHEoNaK5T4zQ=;
	b=Yro0/M37axTd9NdeVgGxMXok1pMgWtfgPkl7yRDgOHh4bXsLhmFB0gfOHvxLXnkRxF
	Ik3BQRLWcqMJ5Q61J9z0WHIjLROCy6IATxi51jRBLCQJ7CdO6stPTkJO5mH73wvpTnbc
	bbNHA9A7fIEI//zjEUtqRT2BWv5KINgBFxrtw=
MIME-Version: 1.0
Received: by 10.52.68.162 with SMTP id x2mr116408vdt.116.1309989553521; Wed,
	06 Jul 2011 14:59:13 -0700 (PDT)
Received: by 10.52.111.39 with HTTP; Wed, 6 Jul 2011 14:59:13 -0700 (PDT)
In-Reply-To: <20110706201508.176130@gmx.net>
References: <CAGamEOtg2Dpna22RAQr1NstWBUd-745UoYM_b4KLc5FdsDFxqQ@mail.gmail.com>
	<20110706201508.176130@gmx.net>
Date: Wed, 6 Jul 2011 15:59:13 -0600
Message-ID: <CAGamEOsGbM159G=qrSVVh2wp-9OZfxnhjjAJG9P4y6YHfhQbzw@mail.gmail.com>
Subject: Re: AC_FC_MODULE_FLAG
From: Jim Edwards <edwards.jim@gmail.com>
To: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.220.169
Content-Type: text/plain; charset=ISO-8859-1
X-Content-Filtered-By: Mailman/MimeDel 2.1.14
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Jul 2011 21:59:18 -0000

Okay, here is another method that seems to work,  I need to make the
subdirectory read-only then
try to compile another module in the main directory.   With the -M flag it
fails because it can't write
the .mod file in the conftest.dir

Index: fortran.m4
===================================================================
--- fortran.m4  (revision 327)
+++ fortran.m4  (working copy)
@@ -593,7 +593,7 @@
 # IBM: -Idir (-qmoddir=dir for writing)
 # Intel: -Idir -I dir (-mod dir for writing)
 # Absoft: -pdir
-# Lahey: -mod dir
+# Lahey: -Idir (-Mdir or -mod dir for writing)
 # Cray: -module dir, -p dir (-J dir for writing)
 #       -e m is needed to enable writing .mod files at all
 # Compaq: -Idir
@@ -615,17 +615,23 @@
       write(*,'(a)') 'gotcha!'
       end subroutine
       end module]],
-  [cd ..
+  # For Lahey -M will also write module and object files to that directory
+  # make it read-only so that lahey fails over to -I
+  [chmod -w .
+   cd ..
    ac_fc_module_flag_FCFLAGS_save=$FCFLAGS
    # Flag ordering is significant for gfortran and Sun.
    for ac_flag in -M -I '-I ' '-M ' -p '-mod ' '-module ' '-Am -I'; do
      # Add the flag twice to prevent matching an output flag.
      FCFLAGS="$ac_fc_module_flag_FCFLAGS_save ${ac_flag}conftest.dir
${ac_flag}conftest.dir"
      AC_COMPILE_IFELSE([[
-      program main
+      module conftest_main
       use conftest_module
+      contains
+      subroutine conftest
       call conftest_routine
-      end program]],
+      end subroutine
+      end module]],
        [ac_cv_fc_module_flag="$ac_flag"])
      if test "$ac_cv_fc_module_flag" != unknown; then
        break
@@ -633,6 +639,7 @@
    done
    FCFLAGS=$ac_fc_module_flag_FCFLAGS_save
 ])
+chmod +w conftest.dir
 rm -rf conftest.dir
 AC_LANG_POP([Fortran])
 ])






On Wed, Jul 6, 2011 at 2:15 PM, Ralf Wildenhues <Ralf.Wildenhues@gmx.de>wrote:

> Hi Jim,
>
> thanks for the bug report!
>
> * Jim Edwards wrote on Wed, Jul 06, 2011 at 08:00:13PM CEST:
> > When using the lahey fortran compiler the flag -M is used as the path to
> > modules, but its also the path to where new modules should be written.
> > So if you are referencing modules in a read-only directory using the -M
> flag
> > will cause your program to fail.   I think that the solution is to
> > test for -I first (that's also the most common result, so it would make
> > sense to test first I think)
>
> Well, with Solaris Fortran, -I is the flag to search for both header
> includes as well as modules, but it also has -M for module search path
> only.  I'm kind of wary that if some command-line gets hardcoded -M
> flags from elsewhere, they could then end up overriding the ones
> computed by configure, although they come later in the command-line.
>
> Can we fix the test somehow so that -M is not chosen with Lahey?  Adding
> the flag twice worked for some compiler at least.  Could also test
> whether the compiler creates a module somewhere.  Care to experiment a
> bit to find something that works with your compiler?  (I don't have
> Lahey to test.)
>
> > --- fortran.m4    (revision 327)
> > +++ fortran.m4    (working copy)
> > @@ -618,7 +618,7 @@
> >    [cd ..
> >     ac_fc_module_flag_FCFLAGS_save=$FCFLAGS
> >     # Flag ordering is significant for gfortran and Sun.
> > -   for ac_flag in -M -I '-I ' '-M ' -p '-mod ' '-module ' '-Am -I'; do
> > +   for ac_flag in -I '-mod ' -I '-I ' '-M ' -p '-module ' '-Am -I'; do
> >       # Add the flag twice to prevent matching an output flag.
> >       FCFLAGS="$ac_fc_module_flag_FCFLAGS_save ${ac_flag}conftest.dir
> > ${ac_flag}conftest.dir"
> >       AC_COMPILE_IFELSE([[
>
> Thanks,
> Ralf
>

From MAILER-DAEMON Thu Jul 07 16:40:56 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QevNX-0004o0-Al
	for mharc-autoconf@gnu.org; Thu, 07 Jul 2011 16:40:55 -0400
Received: from eggs.gnu.org ([140.186.70.92]:38388)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <chrisstankevitz@yahoo.com>) id 1QevJJ-0003nw-Ae
	for autoconf@gnu.org; Thu, 07 Jul 2011 16:36:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <chrisstankevitz@yahoo.com>) id 1QevJH-0004Ah-Sd
	for autoconf@gnu.org; Thu, 07 Jul 2011 16:36:33 -0400
Received: from nm2-vm2.bullet.mail.ne1.yahoo.com ([98.138.91.18]:29067)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <chrisstankevitz@yahoo.com>) id 1QevJH-00043z-7R
	for autoconf@gnu.org; Thu, 07 Jul 2011 16:36:31 -0400
Received: from [98.138.90.53] by nm2.bullet.mail.ne1.yahoo.com with NNFMP;
	07 Jul 2011 20:36:29 -0000
Received: from [98.138.88.238] by tm6.bullet.mail.ne1.yahoo.com with NNFMP;
	07 Jul 2011 20:36:29 -0000
Received: from [127.0.0.1] by omp1038.mail.ne1.yahoo.com with NNFMP;
	07 Jul 2011 20:36:29 -0000
X-Yahoo-Newman-Property: ymail-3
X-Yahoo-Newman-Id: 760412.98410.bm@omp1038.mail.ne1.yahoo.com
Received: (qmail 56917 invoked by uid 60001); 7 Jul 2011 20:36:29 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024;
	t=1310070989; bh=ALJOHrYbT3bRql9unv9SFi5xiqvjF7ShmKL6RzFYZhY=;
	h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:MIME-Version:Content-Type;
	b=OldbCyav8+jiukfdXIspVlpL+EyVCUAbPisY41KadpBSRorXDwpZ9rGGTCAA8o/O2lTXyvOhPO3gdyq/hbCJ6znyf5cowniMiaOHNdTnB+5bhPOHMDDZCDNaW0T4WjW6ahKaUhAk91vSKBOfPU6fE5vPe1mrruqLuDw0AAlvylY=
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com;
	h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:MIME-Version:Content-Type;
	b=D2RXkfND0UKxwnCmbOFhk5mL3ToXQBl/YZD+vA3Zo8tT4ZjvX/DNZhu/r0yQm+yyfRTfBWSiGdQnrAG8yjL/my3fZ8yMgMprvht7i2r0gDyO85B5wCGxMs+SXWcbnbu64Hk6Te7IHT9U93p0yK8ZKLNrtjAlFFzngj4JJBM6ho0=;
X-YMail-OSG: .2_1Tz8VM1nLlsVImVRybnl0jVLsVVbS70LeuKYa6E143Xu
	oZB6hE5ZEcvE7gPZXRnNZWC9bkD6SzlDPV2EwfPTiqR_sPGemy_BntCwiPqm
	OKMv7q8cOIVgdBaR3UO1GP_JrqNg_pStT5FBvNG4q66tBCu4laPN2P3eh.51
	FE3NFdfVijA.KUZQOSsFlBC5_.vycq1ZB13pXAXOVKLmHWgk6r1YS8N.SpNb
	EkCclqkcwP8Y3Cigb.b8Z8veMb5jnGV1E0RXhpya8j.n_qZDF.t1c3WmEe3G
	333e.1GdiSdGwFzvXJtUy_QUIknaXTaQ.JaFBK2rlOjv7UsLWlakNyZycQcQ
	Is3_J2ceBeUJHKk51y9w7IxWpI..ys2BjWcdsx5PKQ4yPwSmu5I.RDPFhv8o
	xnKjl0OrgRIO15jXLZuUWB87QADnMlp3_9wyGlFe5aJa1V5pQ5QYoHJlN5hx
	G1PN.FEeRvfPQz5im_fyw0mtNemcV4rGo9bj_6TqVdaTF2VnZHZvoy0sxydm
	s4TvpPTM1o2I5flK8HTByvvm5TypTI6YHMrUd52II1mlSYKXagg--
Received: from [206.190.77.154] by web121707.mail.ne1.yahoo.com via HTTP;
	Thu, 07 Jul 2011 13:36:29 PDT
X-Mailer: YahooMailClassic/14.0.3 YahooMailWebService/0.8.112.307740
Message-ID: <1310070989.55299.YahooMailClassic@web121707.mail.ne1.yahoo.com>
Date: Thu, 7 Jul 2011 13:36:29 -0700 (PDT)
From: Chris Stankevitz <chrisstankevitz@yahoo.com>
Subject: Setting optimizations without violating autotools principles
To: autoconf@gnu.org
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 98.138.91.18
X-Mailman-Approved-At: Thu, 07 Jul 2011 16:40:54 -0400
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 07 Jul 2011 20:36:34 -0000

Q1: How do I specify that I want optimizations turned off?
a) in Makefile.am: AM_CFLAGS = -O0
b) in configure.ac: CFLAGS="$CFLAGS -O0"
c) other

Q2: Does your answer for Q1 work even when I use AC_PROG_CC which places -02 in CFLAGS?

Q3: Does your answer for Q1 violate this autotools principle:
You should never redefine a user variable such as CFLAGS (http://tinyurl.com/3wkfdp5)

Q4: Does AC_PROG_CC violate this principle?

Thank you,

Chris


From MAILER-DAEMON Thu Jul 07 17:00:16 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QevgF-0000hN-KI
	for mharc-autoconf@gnu.org; Thu, 07 Jul 2011 17:00:16 -0400
Received: from eggs.gnu.org ([140.186.70.92]:42211)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QevgA-0000dj-9J
	for autoconf@gnu.org; Thu, 07 Jul 2011 17:00:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1Qevg4-0000Tr-3s
	for autoconf@gnu.org; Thu, 07 Jul 2011 17:00:09 -0400
Received: from mx1.redhat.com ([209.132.183.28]:43965)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1Qevg3-0000Tf-LC
	for autoconf@gnu.org; Thu, 07 Jul 2011 17:00:03 -0400
Received: from int-mx02.intmail.prod.int.phx2.redhat.com
	(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p67L02o0003934
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 7 Jul 2011 17:00:02 -0400
Received: from [10.3.113.151] (ovpn-113-151.phx2.redhat.com [10.3.113.151])
	by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id p67L01VG022989; Thu, 7 Jul 2011 17:00:01 -0400
Message-ID: <4E161E51.4010508@redhat.com>
Date: Thu, 07 Jul 2011 15:00:01 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10
MIME-Version: 1.0
To: Chris Stankevitz <chrisstankevitz@yahoo.com>
Subject: Re: Setting optimizations without violating autotools principles
References: <1310070989.55299.YahooMailClassic@web121707.mail.ne1.yahoo.com>
In-Reply-To: <1310070989.55299.YahooMailClassic@web121707.mail.ne1.yahoo.com>
X-Enigmail-Version: 1.1.2
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enig74EBBF41633A8C00C7D563F8"
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 07 Jul 2011 21:00:14 -0000

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig74EBBF41633A8C00C7D563F8
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 07/07/2011 02:36 PM, Chris Stankevitz wrote:
> Q1: How do I specify that I want optimizations turned off?

As an end-user:

=2E/configure CFLAGS=3D'-O0'

As a package developer, you can't require optimizations off, but you can
suggest them as the default, by adding this to your configure.ac after
AC_INIT but prior to AC_PROG_CC:

: ${CFLAGS=3D"-O0"}

This example is documented in the autoconf manual under AC_PROG_CC.

>=20
> Q2: Does your answer for Q1 work even when I use AC_PROG_CC which place=
s -02 in CFLAGS?

The end-user's selection always trumps the configure default.  And the
configure default is '-g' for non-gcc, and '-g -O2' for gcc, unless you
as the package developer used the configure.ac trick in Q1 to change it.

> Q3: Does your answer for Q1 violate this autotools principle:
> You should never redefine a user variable such as CFLAGS (http://tinyur=
l.com/3wkfdp5)

Nope.  As the package developer, you are only setting the default.  The
end user can always override you.

>=20
> Q4: Does AC_PROG_CC violate this principle?

Nope - those are flags which the package developer uses no matter what
the user passes, _and_ which occur on the command line prior to $CFLAGS
(so the end user can _still_ override any flag that can be negated by
another option later on the command line).

--=20
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enig74EBBF41633A8C00C7D563F8
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJOFh5RAAoJEKeha0olJ0NqBPsH/3RUkfcjxyr33w3HB1Xr20Dk
vCDl9ioX5ZJBKFuNxYxM6RH7v0mP3NeicTV+MnXUqdKojzo3bKoI/vNozMMDiFws
zLyIUrUYA0vP6mlQuDLFmZ6tSxoVCtussNzwDq3OdSJIsHwdqgj94Nz3vbJovmb0
NZhdceWFB1ethYdK5cOSw+R/GouYN5T1k09upGMPk4Kow6tvw6nX7QYZCBAvIi3e
g4HqAdafI2w1cb1/RPZjtHmCmb2KJmcS0Bkuiz6KBOTxfxfym3ZlxV44p8aMQ9xL
nE6riAh3aX4xgq3Nk/b0w2+uoYy8anXE9CJS9N5/ATnTdrW91oBmDQ9v6aCa5No=
=Pxri
-----END PGP SIGNATURE-----

--------------enig74EBBF41633A8C00C7D563F8--


From MAILER-DAEMON Thu Jul 07 17:09:11 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qevos-0002tw-8B
	for mharc-autoconf@gnu.org; Thu, 07 Jul 2011 17:09:10 -0400
Received: from eggs.gnu.org ([140.186.70.92]:60124)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Ralf.Wildenhues@gmx.de>) id 1Qevoo-0002sw-Rl
	for autoconf@gnu.org; Thu, 07 Jul 2011 17:09:08 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <Ralf.Wildenhues@gmx.de>) id 1Qevoj-0001s4-Et
	for autoconf@gnu.org; Thu, 07 Jul 2011 17:09:06 -0400
Received: from mailout-de.gmx.net ([213.165.64.23]:57671)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <Ralf.Wildenhues@gmx.de>) id 1Qevoi-0001mv-RV
	for autoconf@gnu.org; Thu, 07 Jul 2011 17:09:01 -0400
Received: (qmail 22132 invoked by uid 0); 7 Jul 2011 21:08:45 -0000
Received: from 74.125.121.33 by www028.gmx.net with HTTP;
	Thu, 07 Jul 2011 23:08:44 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Date: Thu, 07 Jul 2011 23:08:44 +0200
From: "Ralf Wildenhues" <Ralf.Wildenhues@gmx.de>
In-Reply-To: <CAGamEOsGbM159G=qrSVVh2wp-9OZfxnhjjAJG9P4y6YHfhQbzw@mail.gmail.com>
Message-ID: <20110707210844.78040@gmx.net>
MIME-Version: 1.0
References: <CAGamEOtg2Dpna22RAQr1NstWBUd-745UoYM_b4KLc5FdsDFxqQ@mail.gmail.com>
	<20110706201508.176130@gmx.net>
	<CAGamEOsGbM159G=qrSVVh2wp-9OZfxnhjjAJG9P4y6YHfhQbzw@mail.gmail.com>
Status: RO
Subject: Re: AC_FC_MODULE_FLAG
To: Jim Edwards <edwards.jim@gmail.com>
X-Authenticated: #13673931
X-Flags: 0001
X-Mailer: WWW-Mail 6100 (Global Message Exchange)
X-Mutt-Fcc: ~/sent
X-Mutt-References: <CAGamEOsGbM159G=qrSVVh2wp-9OZfxnhjjAJG9P4y6YHfhQbzw@mail.gmail.com>
X-Priority: 3
X-Provags-ID: V01U2FsdGVkX19YefIG65hY6eVXRjfiCe/KFNbtcr78XxVY+ETRan
	/SV1yHIsvhoGnFcsdQNhzWNIwzOFD5vwxBOQ== 
Content-Transfer-Encoding: 8bit
X-GMX-UID: Mk10Gjs+bXB+VK7X4jQ2O84iLyUmZcj2
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 213.165.64.23
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 07 Jul 2011 21:09:08 -0000

On Wed, Jul 06, 2011 at 03:59:13PM -0600, Jim Edwards wrote:
> Okay, here is another method that seems to work,  I need to make the
> subdirectory read-only then
> try to compile another module in the main directory.   With the -M flag it
> fails because it can't write
> the .mod file in the conftest.dir

That's better; but what about w32?  IIUC Lahey also has a version for
that.  Can you just try to look if some module-like file exists in the
directory after the fact?  Something like
  case conftest.dir/*_* in
    *\*_\**) good... ;;
    *) Lahey... ;;
  esac

Thanks,
Ralf

> --- fortran.m4  (revision 327)
> +++ fortran.m4  (working copy)
> @@ -593,7 +593,7 @@
>  # IBM: -Idir (-qmoddir=dir for writing)
>  # Intel: -Idir -I dir (-mod dir for writing)
>  # Absoft: -pdir
> -# Lahey: -mod dir
> +# Lahey: -Idir (-Mdir or -mod dir for writing)
>  # Cray: -module dir, -p dir (-J dir for writing)
>  #       -e m is needed to enable writing .mod files at all
>  # Compaq: -Idir
> @@ -615,17 +615,23 @@
>        write(*,'(a)') 'gotcha!'
>        end subroutine
>        end module]],
> -  [cd ..
> +  # For Lahey -M will also write module and object files to that directory
> +  # make it read-only so that lahey fails over to -I
> +  [chmod -w .
> +   cd ..
>     ac_fc_module_flag_FCFLAGS_save=$FCFLAGS
>     # Flag ordering is significant for gfortran and Sun.
>     for ac_flag in -M -I '-I ' '-M ' -p '-mod ' '-module ' '-Am -I'; do
>       # Add the flag twice to prevent matching an output flag.
>       FCFLAGS="$ac_fc_module_flag_FCFLAGS_save ${ac_flag}conftest.dir
> ${ac_flag}conftest.dir"
>       AC_COMPILE_IFELSE([[
> -      program main
> +      module conftest_main
>        use conftest_module
> +      contains
> +      subroutine conftest
>        call conftest_routine
> -      end program]],
> +      end subroutine
> +      end module]],
>         [ac_cv_fc_module_flag="$ac_flag"])
>       if test "$ac_cv_fc_module_flag" != unknown; then
>         break
> @@ -633,6 +639,7 @@
>     done
>     FCFLAGS=$ac_fc_module_flag_FCFLAGS_save
>  ])
> +chmod +w conftest.dir
>  rm -rf conftest.dir
>  AC_LANG_POP([Fortran])
>  ])


From MAILER-DAEMON Thu Jul 07 17:16:14 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qevvh-000585-Om
	for mharc-autoconf@gnu.org; Thu, 07 Jul 2011 17:16:13 -0400
Received: from eggs.gnu.org ([140.186.70.92]:49481)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Ralf.Wildenhues@gmx.de>) id 1Qevvd-00056Z-V9
	for autoconf@gnu.org; Thu, 07 Jul 2011 17:16:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <Ralf.Wildenhues@gmx.de>) id 1Qevvc-0003Jo-7t
	for autoconf@gnu.org; Thu, 07 Jul 2011 17:16:09 -0400
Received: from mailout-de.gmx.net ([213.165.64.22]:59801)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <Ralf.Wildenhues@gmx.de>) id 1Qevvb-0003Je-Iu
	for autoconf@gnu.org; Thu, 07 Jul 2011 17:16:07 -0400
Received: (qmail 12143 invoked by uid 0); 7 Jul 2011 21:16:06 -0000
Received: from 74.125.121.33 by www041.gmx.net with HTTP;
	Thu, 07 Jul 2011 23:16:05 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Date: Thu, 07 Jul 2011 23:16:05 +0200
From: "Ralf Wildenhues" <Ralf.Wildenhues@gmx.de>
In-Reply-To: <1310070989.55299.YahooMailClassic@web121707.mail.ne1.yahoo.com>
Message-ID: <20110707211605.280230@gmx.net>
MIME-Version: 1.0
References: <1310070989.55299.YahooMailClassic@web121707.mail.ne1.yahoo.com>
Status: RO
Subject: Re: Setting optimizations without violating autotools principles
To: Chris Stankevitz <chrisstankevitz@yahoo.com>
X-Authenticated: #13673931
X-Flags: 0001
X-Mailer: WWW-Mail 6100 (Global Message Exchange)
X-Mutt-Fcc: ~/sent
X-Mutt-References: <1310070989.55299.YahooMailClassic@web121707.mail.ne1.yahoo.com>
X-Priority: 3
X-Provags-ID: V01U2FsdGVkX1/y6dpwuKzyQYRkanNfvt/Ev28eEa9sCYQwo7wB1W
	1mTHUeIaqnriEzCXKilI7RNNQP3S6gcg8yDg== 
Content-Transfer-Encoding: 8bit
X-GMX-UID: cUtzDxkZfW47VPH/p2VoOJJudmllcsXV
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 213.165.64.22
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 07 Jul 2011 21:16:11 -0000

Hi Chris,

On Thu, Jul 07, 2011 at 01:36:29PM -0700, Chris Stankevitz wrote:
> Q1: How do I specify that I want optimizations turned off?
> a) in Makefile.am: AM_CFLAGS = -O0

That won't work as user CFLAGS come after AM_CFLAGS in the command line.

> b) in configure.ac: CFLAGS="$CFLAGS -O0"
> c) other
> 
> Q2: Does your answer for Q1 work even when I use AC_PROG_CC which places -02 in CFLAGS?
> 
> Q3: Does your answer for Q1 violate this autotools principle:
> You should never redefine a user variable such as CFLAGS (http://tinyurl.com/3wkfdp5)
> 
> Q4: Does AC_PROG_CC violate this principle?

AC_PROG_CC is documented to enable optimization, and enable
debugging if feasible[1], iff the user hasn't set her own
preferences.

You can do so too:

# Override CFLAGS if not set by the user.
test ${CFLAGS+set} = set || CFLAGS=-O0
AC_PROG_CC

which answers Q1b and Q2.  Answer to Q3: no.  :-)

Hope that helps.

If you want to munge with CFLAGS but also want to take into account
what AC_PROG_CC would have set, you can do things like

if test ${CFLAGS+set} = set; then
  CFLAGS_set_by_user=true
else
  CFLAGS_set_by_user=false
fi
AC_PROG_CC
# Now, do your overriding based on $CFLAGS and $CFLAGS_set_by_user
# and whatever other data.

Cheers,
Ralf

[1] Yes, its definition of "feasible" was maaaybee somewhat valid ten
years, ago, but it definitely isn't today, and I don't know whether
it actually was back then.  Me no Autoconfer back then.


From MAILER-DAEMON Thu Jul 07 22:22:50 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qf0iP-000067-Mz
	for mharc-autoconf@gnu.org; Thu, 07 Jul 2011 22:22:49 -0400
Received: from eggs.gnu.org ([140.186.70.92]:57179)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <chrisstankevitz@yahoo.com>) id 1Qf0iL-00004x-MV
	for autoconf@gnu.org; Thu, 07 Jul 2011 22:22:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <chrisstankevitz@yahoo.com>) id 1Qf0iJ-00025A-9F
	for autoconf@gnu.org; Thu, 07 Jul 2011 22:22:45 -0400
Received: from nm18-vm1.bullet.mail.ne1.yahoo.com ([98.138.91.64]:47965)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <chrisstankevitz@yahoo.com>) id 1Qf0iI-00024z-UR
	for autoconf@gnu.org; Thu, 07 Jul 2011 22:22:43 -0400
Received: from [98.138.90.52] by nm18.bullet.mail.ne1.yahoo.com with NNFMP;
	08 Jul 2011 02:22:41 -0000
Received: from [98.138.89.245] by tm5.bullet.mail.ne1.yahoo.com with NNFMP;
	08 Jul 2011 02:22:41 -0000
Received: from [127.0.0.1] by omp1059.mail.ne1.yahoo.com with NNFMP;
	08 Jul 2011 02:22:41 -0000
X-Yahoo-Newman-Property: ymail-3
X-Yahoo-Newman-Id: 727430.85830.bm@omp1059.mail.ne1.yahoo.com
Received: (qmail 37567 invoked by uid 60001); 8 Jul 2011 02:22:41 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024;
	t=1310091761; bh=Os8+YNlFHEOAc6VPk3CjneN+kptUQmwogq0IE8RhjH0=;
	h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type;
	b=iiQAHk7qjg4zpOITU68dLKppO6treorf1oRDkJez64DLTHbI2fPb2upPLjC7DTwKpwpSrcsvvOOc962eIIUYk2fSygV3P/s+MvUYr6kZkxyRtgQ+pm/VmOx9PlFsa5Z9a89JPo685g2e4qBL1YL55e3KyY55X5PIGtf0a+ctPe4=
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com;
	h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type;
	b=Oqsrjiw4KjiJUHgIl/nXxZ9a6U9z7PMdNtrDYzt009DChQYcmC9fB1RvzgomCVYmQabfgoGWcBm7+AdaKp4cp1bpxhm+zycg87E8XgygBZ1/vg1OK8T0ayzaVOpIssrFQl9tfgkcl9rqyJqhnNFm/pVIfN+uVGxPrcq8JFyT2B0=;
X-YMail-OSG: hdIB0F0VM1mHi7yTNxqmgVrefetb8VS6V72yvZoev3ePuk_
 c2No-
Received: from [206.190.77.154] by web121716.mail.ne1.yahoo.com via HTTP;
	Thu, 07 Jul 2011 19:22:41 PDT
X-Mailer: YahooMailClassic/14.0.3 YahooMailWebService/0.8.112.307740
Message-ID: <1310091761.35221.YahooMailClassic@web121716.mail.ne1.yahoo.com>
Date: Thu, 7 Jul 2011 19:22:41 -0700 (PDT)
From: Chris Stankevitz <chrisstankevitz@yahoo.com>
Subject: Re: Setting optimizations without violating autotools principles
To: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
In-Reply-To: <20110707211605.280230@gmx.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 98.138.91.64
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 08 Jul 2011 02:22:48 -0000

--- On Thu, 7/7/11, Ralf Wildenhues <Ralf.Wildenhues@gmx.de> wrote:
> From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
> # Override CFLAGS if not set by the user.
> test ${CFLAGS+set} = set || CFLAGS=-O0

Ralf,

Thank you.  I believe your method does not work when the user has set CFLAGS to something that has nothing to do with optimizations (e.g. CFLAGS=-I/foo/bar).

Would you please comment on the solution I came up with:

In configure.ac:
  CFLAGS_ORIG=${CFLAGS}
  AC_PROG_CC
  CFLAGS=${CFLAGS_ORIG}

In Makefile.am:
  if DEBUG
  AM_CFLAGS = -g3 -O0
  endif

I believe my approach
1. Allows the user full control via the sacred CFLAGS
2. Does not touch, mutate, or alter the user's sacred CFLAGS
3. Works despite AC_PROG_CC mucking around with CFLAGS
4. Works even when the user specifies CFLAGS that do not change the optimization level

Thank you all for your help,

Chris


From MAILER-DAEMON Fri Jul 08 09:05:06 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QfAjx-0003Ai-Q3
	for mharc-autoconf@gnu.org; Fri, 08 Jul 2011 09:05:05 -0400
Received: from eggs.gnu.org ([140.186.70.92]:45022)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QfAju-00038O-4H
	for autoconf@gnu.org; Fri, 08 Jul 2011 09:05:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QfAjs-0000Fg-4U
	for autoconf@gnu.org; Fri, 08 Jul 2011 09:05:01 -0400
Received: from mx1.redhat.com ([209.132.183.28]:16702)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QfAjr-0000FZ-Kf
	for autoconf@gnu.org; Fri, 08 Jul 2011 09:04:59 -0400
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p68D4kXt006741
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 8 Jul 2011 09:04:47 -0400
Received: from [10.3.113.151] (ovpn-113-151.phx2.redhat.com [10.3.113.151])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id p68D4kv9023765; Fri, 8 Jul 2011 09:04:46 -0400
Message-ID: <4E17006D.5020003@redhat.com>
Date: Fri, 08 Jul 2011 07:04:45 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10
MIME-Version: 1.0
To: Chris Stankevitz <chrisstankevitz@yahoo.com>
Subject: Re: Setting optimizations without violating autotools principles
References: <1310091761.35221.YahooMailClassic@web121716.mail.ne1.yahoo.com>
In-Reply-To: <1310091761.35221.YahooMailClassic@web121716.mail.ne1.yahoo.com>
X-Enigmail-Version: 1.1.2
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enig9D8CB5564428B76793F8BC6A"
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 08 Jul 2011 13:05:03 -0000

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig9D8CB5564428B76793F8BC6A
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 07/07/2011 08:22 PM, Chris Stankevitz wrote:
> --- On Thu, 7/7/11, Ralf Wildenhues <Ralf.Wildenhues@gmx.de> wrote:
>> From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
>> # Override CFLAGS if not set by the user.
>> test ${CFLAGS+set} =3D set || CFLAGS=3D-O0
>=20
> Ralf,
>=20
> Thank you.  I believe your method does not work when the user has set C=
FLAGS to something that has nothing to do with optimizations (e.g. CFLAGS=
=3D-I/foo/bar).
>=20
> Would you please comment on the solution I came up with:
>=20
> In configure.ac:
>   CFLAGS_ORIG=3D${CFLAGS}
>   AC_PROG_CC
>   CFLAGS=3D${CFLAGS_ORIG}

If the user set CFLAGS, then this is equivalent to:

CFLAGS_ORIG=3D$CFLAGS
AC_PROG_CC -> CFLAGS is set, so no change to CFLAGS
CFLAGS=3D$CFLAGS_ORIG -> no change to CFLAGS

However, if the user did not set CFLAGS, then this is equivalent to:

CFLAGS_ORIG=3D
AC_PROG_CC -> CFLAGS wasn't set, so now CFLAGS is either '-g' or '-g
-O2' depending on $CC
CFLAGS=3D''

which explicitly sets CFLAGS to the empty string, instead of leaving it
unset.

This might have ramifications for users that do ./configure -C, since
CFLAGS is a precious variable, and configure warns about a change
between a set-but-empty and an unset variable.

>=20
> In Makefile.am:
>   if DEBUG
>   AM_CFLAGS =3D -g3 -O0
>   endif

The combination '-g3 -O0' is gcc-specific.  It will fail miserably on
other compilers, unless you took pains in configure.ac to ensure that
the automake conditional DEBUG can only be set if $CC is gcc.  But if
you did indeed take care to define the automake conditional
appropriately, then yes, this is a way to turn on debugging (for
comparison, look at coreutils.git, and see how coreutils turns on
optional warning flags when you configure --enable-gcc-warnings, where
coreutils took pains to ensure that the AM_CFLAGS adjustments are only
made to options already proven at configure time to work alongside the
user's $CC).

>=20
> I believe my approach
> 1. Allows the user full control via the sacred CFLAGS
> 2. Does not touch, mutate, or alter the user's sacred CFLAGS

But points 1 and 2 are also met by following the autoconf manual's
approach of:

: ${CFLAGS=3D"-g3 -O0"}
AC_PROG_CC

without having to modify AM_CFLAGS in the first place.  But you are
still stuck with the burden of verifying whether '-g3 -O0' works with
non-gcc $CC.

> 3. Works despite AC_PROG_CC mucking around with CFLAGS

AC_PROG_CC does _not_ muck around with CFLAGS.  If the user specified
CFLAGS, then AC_PROG_CC honors that.  If the user did not specify
CFLAGS, then AC_PROG_CC uses a default, and you as package author have
control over that default if you don't like autoconf's choice of '-g' or
'-g -O2'.  However, autoconf's default is safe for all compilers,
whereas you have to be careful when using a default like '-g3 -O0' that
is gcc-specific.

> 4. Works even when the user specifies CFLAGS that do not change the opt=
imization level
>=20
> Thank you all for your help,
>=20

--=20
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enig9D8CB5564428B76793F8BC6A
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJOFwBtAAoJEKeha0olJ0Nqlz8H/RqhxLd8nM+o5NSr6O8XIHxj
ei1MnLo4n34QE3hrHg0WTHYxtB5/gWoh4TRegh8PF6laRFw+eafG1VGb6uU5dMiA
BM6rSI21sZAGQo6u4/5ag+D8R6vj1YBDTYCzy8HxRaSYvcyRzuxVLrNCSem0JV3v
yEqutNc0+ee/ExA79gcZyYU8mavp9izertIdcuAbxhVrHeDFmXDWk7vXsFo4Ksvo
BsGkwtgcj6AUdEwAgggB17fxrXt8itobjx46Y2l7K1nZqhS/W4sHryyRHoBBffLe
pzRrCtEohKF3WZLetIytqAnE8SPFCLqZJkR1Gqsk6H8effy+VM66JZOTQKSe9tA=
=yjmH
-----END PGP SIGNATURE-----

--------------enig9D8CB5564428B76793F8BC6A--


From MAILER-DAEMON Sat Jul 09 03:14:31 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QfRkF-00022z-5x
	for mharc-autoconf@gnu.org; Sat, 09 Jul 2011 03:14:31 -0400
Received: from eggs.gnu.org ([140.186.70.92]:55352)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <chrisstankevitz@yahoo.com>) id 1QfRkC-00022s-Q6
	for autoconf@gnu.org; Sat, 09 Jul 2011 03:14:29 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <chrisstankevitz@yahoo.com>) id 1QfRkB-0002Zs-Vn
	for autoconf@gnu.org; Sat, 09 Jul 2011 03:14:28 -0400
Received: from nm18-vm4.bullet.mail.ne1.yahoo.com ([98.138.91.178]:46046)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <chrisstankevitz@yahoo.com>) id 1QfRkB-0002Zj-PP
	for autoconf@gnu.org; Sat, 09 Jul 2011 03:14:27 -0400
Received: from [98.138.90.51] by nm18.bullet.mail.ne1.yahoo.com with NNFMP;
	09 Jul 2011 07:14:26 -0000
Received: from [98.138.89.246] by tm4.bullet.mail.ne1.yahoo.com with NNFMP;
	09 Jul 2011 07:14:26 -0000
Received: from [127.0.0.1] by omp1060.mail.ne1.yahoo.com with NNFMP;
	09 Jul 2011 07:14:26 -0000
X-Yahoo-Newman-Property: ymail-3
X-Yahoo-Newman-Id: 255116.96846.bm@omp1060.mail.ne1.yahoo.com
Received: (qmail 69357 invoked by uid 60001); 9 Jul 2011 07:14:25 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024;
	t=1310195665; bh=HZ5LnLLtMRO61q/apks7WMjrb+q7mC4oKogsc0D1TTk=;
	h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type;
	b=W/vcG8h0e1rMKJjSN9DNOEe+eoi1k+oVC0WWryK2nzRG3geqzKlb21rCMX8Ww5+S4RmJQJ4JeSIEYQj2C+QW2kqSrNsqc3QDW48AVWddFKyNyqfZL92eAYU5DKBj+HYe+wRETbfkRzuUphMDNlQNYkWS3E72Xwo3PJHgpxZuffE=
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com;
	h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type;
	b=hv33qQB3H5b3ai1E/s8gy2XwqYVAMgRBSpcRcuvin/pBygm+6WS8x3uzLdpSDO77JeIoiX/eNGtQqQrkZ2InXAhjRXeMnnRy86mBnRl4nuRVH1douQuuC15JdMrbuR0Pw1O3eWNEUKeLnHfnR0mSeILHwKvR3O+BG/hp9RmcrtE=;
X-YMail-OSG: o.NKPPoVM1n2MAWHajuPy62PAn1QpfKcTR5VHxPVaPt7AZK
	VMYVVInmYgJeWHghsldU8LeYOohN.qNaWJtZtKS7o7QuoAK5nBuv8IhtPtgI
	6pHEyyPcPASe3YSGTTIAsicUi4ZmU61CfvhzxiLOgLWuyUrNaalcCA9_TgTa
	2RmpsqGs3Ws5gh6y30luOuu3c5dW5lAHIzEAWmLQqHXfvAhxb9JGBX4rFvKw
	5Jpr68myrbON2fouX4.11xX9BeWddfnAEbKfpHJIEInGzW1oJKpwxhHu1Uwl
	gzpMPG6awCPYH4.alL012_M7jhA9rycj5TPcMMTtxqGf5_nducVJS7CjVGiU
	QX5Tx7dw9Tvy9dii.z.wpwOtdLmvFXRUC_Eb29scDnbhM14HQruzMQi45AE4
	1m2iVtUfMxv7HzkA-
Received: from [68.6.44.39] by web121715.mail.ne1.yahoo.com via HTTP;
	Sat, 09 Jul 2011 00:14:25 PDT
X-Mailer: YahooMailClassic/14.0.3 YahooMailWebService/0.8.112.307740
Message-ID: <1310195665.69109.YahooMailClassic@web121715.mail.ne1.yahoo.com>
Date: Sat, 9 Jul 2011 00:14:25 -0700 (PDT)
From: Chris Stankevitz <chrisstankevitz@yahoo.com>
Subject: Re: Setting optimizations without violating autotools principles
To: Eric Blake <eblake@redhat.com>
In-Reply-To: <4E17006D.5020003@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 98.138.91.178
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 09 Jul 2011 07:14:29 -0000

--- On Fri, 7/8/11, Eric Blake <eblake@redhat.com> wrote:
> If the user set CFLAGS, then this is equivalent to:

Eric,

Thank you for your detailed (and free!) analysis,

Chris 


From MAILER-DAEMON Sat Jul 09 12:05:31 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qfa26-0005XN-Pn
	for mharc-autoconf@gnu.org; Sat, 09 Jul 2011 12:05:30 -0400
Received: from eggs.gnu.org ([140.186.70.92]:56774)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <trojkan@gmail.com>) id 1Qfa1w-0005U1-M6
	for autoconf@gnu.org; Sat, 09 Jul 2011 12:05:28 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <trojkan@gmail.com>) id 1Qfa1n-0008BG-Af
	for autoconf@gnu.org; Sat, 09 Jul 2011 12:05:14 -0400
Received: from mail-vx0-f169.google.com ([209.85.220.169]:61403)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <trojkan@gmail.com>) id 1Qfa1j-00086L-U4
	for autoconf@gnu.org; Sat, 09 Jul 2011 12:05:08 -0400
Received: by vxg38 with SMTP id 38so2497856vxg.0
	for <autoconf@gnu.org>; Sat, 09 Jul 2011 09:05:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=message-id:date:from:user-agent:mime-version:to:subject:references
	:in-reply-to:content-type:content-transfer-encoding;
	bh=yItKahpB/J97OsX0aEKeLt5kgmaGYU/LFeXvzOy/pEY=;
	b=uXqDDOEgJEXU64r7UQikw6LuQC1FPNXPE0aOgU5i0WZsiibXzkeKThDQD0weBP3TiQ
	POGV8wCiX7mhButoZw6GVF9r8RlBt3BST2DV9cYHbiLZAb3hNCS2ke+63tZaPMbnwLxy
	2wyMu64kO3YqaRBjvZW99bxQcKjrJSh+Hf6A4=
Received: by 10.52.178.195 with SMTP id da3mr3902298vdc.179.1310227505546;
	Sat, 09 Jul 2011 09:05:05 -0700 (PDT)
Received: from [192.168.1.102] (c-69-255-224-25.hsd1.md.comcast.net
	[69.255.224.25])
	by mx.google.com with ESMTPS id bl2sm4295769vbb.21.2011.07.09.09.05.03
	(version=SSLv3 cipher=OTHER); Sat, 09 Jul 2011 09:05:04 -0700 (PDT)
Message-ID: <4E187C25.80305@gmail.com>
Date: Sat, 09 Jul 2011 12:04:53 -0400
From: Peter Johansson <trojkan@gmail.com>
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US;
	rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11
MIME-Version: 1.0
To: autoconf@gnu.org
Subject: Re: Feature request: AC_PROG_CXX_STDCXX
References: <20110628230135.GY6333@codelibre.net>
In-Reply-To: <20110628230135.GY6333@codelibre.net>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.220.169
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 09 Jul 2011 16:05:28 -0000

Hi Roger,

On 6/28/11 7:01 PM, Roger Leigh wrote:
> AC_PROG_CXX_CXX98
> AC_PROG_CXX_CXX03 and/or AC_PROC_CXX_CXXTR1
> AC_PROC_CXX_CXX11 and/or AC_PROC_CXX_CXX0X [not yet finalised]
>
> AC_PROC_CXX_STDCXX could select the most recent version of the
> standard supported.
>
>
There is the AX_CXX_COMPILE_STDCXX_0X macro in Autoconf Macro Archive, 
which may be a start:

http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_0x.html#ax_cxx_compile_stdcxx_0x


Cheers,
Peter


From MAILER-DAEMON Sat Jul 09 19:15:22 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qfgk6-0008K6-41
	for mharc-autoconf@gnu.org; Sat, 09 Jul 2011 19:15:22 -0400
Received: from eggs.gnu.org ([140.186.70.92]:60349)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <rleigh@codelibre.net>) id 1Qfgk3-0008Jj-ES
	for autoconf@gnu.org; Sat, 09 Jul 2011 19:15:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <rleigh@codelibre.net>) id 1Qfgk2-0002U0-FI
	for autoconf@gnu.org; Sat, 09 Jul 2011 19:15:19 -0400
Received: from nagini.codelibre.net ([80.68.93.164]:32922)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <rleigh@codelibre.net>) id 1Qfgk2-0002Tw-9D
	for autoconf@gnu.org; Sat, 09 Jul 2011 19:15:18 -0400
Received: by nagini.codelibre.net (Postfix, from userid 1000)
	id 5238B18247; Sun, 10 Jul 2011 00:15:15 +0100 (BST)
Date: Sun, 10 Jul 2011 00:15:15 +0100
From: Roger Leigh <rleigh@codelibre.net>
To: autoconf@gnu.org
Subject: Re: Feature request: AC_PROG_CXX_STDCXX
Message-ID: <20110709231515.GS2138@codelibre.net>
References: <20110628230135.GY6333@codelibre.net>
 <4E187C25.80305@gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="K5roPakIqCb4O6y8"
Content-Disposition: inline
In-Reply-To: <4E187C25.80305@gmail.com>
X-GPG-Key: 0x25BFB848
X-Debian: testing/unstable
X-OS-Uptime: 19:20:30 up 146 days, 22:14,  2 users,  load average: 0.09,
	0.04, 0.01
User-Agent: Mutt/1.5.20 (2009-06-14)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1)
X-Received-From: 80.68.93.164
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 09 Jul 2011 23:15:20 -0000


--K5roPakIqCb4O6y8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Jul 09, 2011 at 12:04:53PM -0400, Peter Johansson wrote:
> Hi Roger,
>=20
> On 6/28/11 7:01 PM, Roger Leigh wrote:
> >AC_PROG_CXX_CXX98
> >AC_PROG_CXX_CXX03 and/or AC_PROC_CXX_CXXTR1
> >AC_PROC_CXX_CXX11 and/or AC_PROC_CXX_CXX0X [not yet finalised]
> >
> >AC_PROC_CXX_STDCXX could select the most recent version of the
> >standard supported.
> >
> >
> There is the AX_CXX_COMPILE_STDCXX_0X macro in Autoconf Macro
> Archive, which may be a start:
>=20
> http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_0x.htm=
l#ax_cxx_compile_stdcxx_0x

Definitely good as a start.  It's currently GCC-specific; ideally it
should have the same level of compiler support as the C checks, and
can probably reuse some of the same logic as those checks.


Regards,
Roger

--=20
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.

--K5roPakIqCb4O6y8
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk4Y4QMACgkQVcFcaSW/uEg5hACfaefFjk6kn8XWRk+4C00A0E6I
4kYAoIT+yTmFg1g3fZisCORIWbrM8P/L
=S5Ct
-----END PGP SIGNATURE-----

--K5roPakIqCb4O6y8--


From MAILER-DAEMON Sun Jul 10 13:25:04 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qfxkd-0000D5-G8
	for mharc-autoconf@gnu.org; Sun, 10 Jul 2011 13:25:03 -0400
Received: from eggs.gnu.org ([140.186.70.92]:55620)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vitormr@gmail.com>) id 1Qfj5F-0007T0-MU
	for autoconf@gnu.org; Sat, 09 Jul 2011 21:45:23 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <vitormr@gmail.com>) id 1Qfj5E-0003VP-2G
	for autoconf@gnu.org; Sat, 09 Jul 2011 21:45:21 -0400
Received: from mail-yx0-f169.google.com ([209.85.213.169]:41032)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vitormr@gmail.com>) id 1Qfj5D-0003VJ-NW
	for autoconf@gnu.org; Sat, 09 Jul 2011 21:45:19 -0400
Received: by yxn22 with SMTP id 22so1386424yxn.0
	for <autoconf@gnu.org>; Sat, 09 Jul 2011 18:45:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=k1MLElVcI5RB7CMCaauqvJtN1GMgrADIpszwqt0La+8=;
	b=wx9SPIYBBE5PKIPdo0jxtBlSd4a+JghHzQ7XKcj59NFyl3NpLPCL8BEigpTugHiuFC
	zxXop+8x4pdU34BMGGvh4w5IF1P0PyXfI+CJbcgTWWebjcGLzjHwpBzLBv5cDq6tKK+U
	nKiMghsXzJWZjfsC62Q1N3mVu0T3zgUjC7Bzs=
MIME-Version: 1.0
Received: by 10.90.255.18 with SMTP id c18mr3130475agi.31.1310262317843; Sat,
	09 Jul 2011 18:45:17 -0700 (PDT)
Received: by 10.90.103.6 with HTTP; Sat, 9 Jul 2011 18:45:17 -0700 (PDT)
Date: Sat, 9 Jul 2011 22:45:17 -0300
Message-ID: <CADqoJL2Qv_LZhGeFCQCUY=pKHNae3jUWvE5OD3U7PfGHVTeeuw@mail.gmail.com>
Subject: Nested Packages: dependencies between autoconfiscated packages
From: =?ISO-8859-1?Q?V=EDtor_da_Rosa?= <vitormr@gmail.com>
To: autoconf@gnu.org
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.213.169
X-Mailman-Approved-At: Sun, 10 Jul 2011 13:25:01 -0400
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 10 Jul 2011 01:45:23 -0000

Hello,

I am facing a problem with subpackages (autoconfiscated) which have
library and header dependencies between them. I will try to explain my
problem based on a nested package example similiar to the arm and hand
example, described in 7.4 Nesting Packages from GNU Automake Manual.

Suppose that instead of having arm and hand packages, my project
application has body as main package and trunk, arm and leg as
subpackages (autoconfiscated packages), such as the following
directory hierarchy:

body
|--> trunk
|--> arm
|--> leg


The packages arm and leg call functions from trunk subpackage, so they
have library and header dependencies on trunk. Here comes my question.
What should be set in configure.ac or Makefile.am from body package to
to pass library and header paths to configure and compile my
subpackages arm and leg? If it is possible, please, show me what I
have to change in the files configure.ac and Makefile.am bellow:

body's configure.ac:

AC_PREREQ([2.67])
AC_INIT([body], [1.0])
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE

AC_PROG_CC
LT_INIT

AC_CONFIG_FILES([Makefile])

# Call ./configure script recursively from trunk, arm and leg.
AC_CONFIG_SUBDIRS([
        trunk
        arm
        leg
])
AC_OUTPUT


body's Makefile.am:

ACLOCAL_AMFLAGS = -I m4 -I.
# Build the library in the arm, leg and trunk subdirectory first.
SUBDIRS = arm leg trunk

# Include headers from arm, leg and trunk when compiling this directory.
AM_CPPFLAGS = -I$(srcdir)/arm -I$(srcdir)/leg -I$(srcdir)/trunk

lib_LTLIBRARIES = libbody.la
libbody_la_SOURCES = src/body.c
# link with the arm, leg and trunk library.
libbody_la_LIBLDADD = arm/libarm.la leg/libleg.la trunk/libtrunk.la


Now here is trunk's trunk/configure.ac:

AC_INIT([trunk], [1.2])
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE

AC_PROG_CC
LT_INIT

AC_CONFIG_FILES([Makefile])
AC_OUTPUT


and its trunk/Makefile.am:

ACLOCAL_AMFLAGS = -I m4 -I.
noinst_LTLIBRARIES = libtrunk.la


Now here is arm's arm/configure.ac:

AC_INIT([arm], [1.2])
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE

AC_PROG_CC
LT_INIT

AC_CONFIG_FILES([Makefile])
AC_OUTPUT


and its arm/Makefile.am:

ACLOCAL_AMFLAGS = -I m4 -I.
noinst_LTLIBRARIES = libarm.la
libarm_la_SOURCES = src/arm.c


Now here is leg's leg/configure.ac:

AC_INIT([leg], [1.2])
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE

AC_PROG_CC
LT_INIT

AC_CONFIG_FILES([Makefile])
AC_OUTPUT


and its leg/Makefile.am:

ACLOCAL_AMFLAGS = -I m4 -I.
noinst_LTLIBRARIES = libleg.la
libleg_la_SOURCES = src/leg.c


Thanks,
Vitor Moscon


From MAILER-DAEMON Mon Jul 11 09:40:45 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QgGj6-00065d-UL
	for mharc-autoconf@gnu.org; Mon, 11 Jul 2011 09:40:45 -0400
Received: from eggs.gnu.org ([140.186.70.92]:51987)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ma.kalbfuss@web.de>) id 1QgEdb-0004R8-Mc
	for autoconf@gnu.org; Mon, 11 Jul 2011 07:26:56 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ma.kalbfuss@web.de>) id 1QgEda-0000gs-7d
	for autoconf@gnu.org; Mon, 11 Jul 2011 07:26:55 -0400
Received: from fmmailgate02.web.de ([217.72.192.227]:48795)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ma.kalbfuss@web.de>) id 1QgEdZ-0000gj-Oc
	for autoconf@gnu.org; Mon, 11 Jul 2011 07:26:54 -0400
Received: from smtp03.web.de  ( [172.20.0.65])
	by fmmailgate02.web.de (Postfix) with ESMTP id 970981A6224B7
	for <autoconf@gnu.org>; Mon, 11 Jul 2011 13:26:51 +0200 (CEST)
Received: from [79.220.136.162] (helo=[192.168.178.23])
	by smtp03.web.de with esmtp (WEB.DE 4.110 #2) id 1QgEdX-0005GO-00
	for autoconf@gnu.org; Mon, 11 Jul 2011 13:26:51 +0200
Subject: gcc compiler version
From: Martin =?ISO-8859-1?Q?Kalbfu=DF?= <ma.kalbfuss@web.de>
To: autoconf mailing list <autoconf@gnu.org>
Content-Type: text/plain; charset="UTF-8"
Date: Mon, 11 Jul 2011 13:26:50 +0200
Message-ID: <1310383610.4102.29.camel@martin-K7VT4APro>
Mime-Version: 1.0
X-Mailer: Evolution 2.32.2 
Content-Transfer-Encoding: 7bit
Sender: ma.kalbfuss@web.de
X-Sender: ma.kalbfuss@web.de
X-Provags-ID: V01U2FsdGVkX1/weLaEA6r79ACJcdDDGVaQb9SHy73UdXCLCdT7
	VnWBiFT5HnGwOzygKg83xZmKii7Tg5n4f6XPdvZVqyxEy75oiO KRXfdF9Gc=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6
X-Received-From: 217.72.192.227
X-Mailman-Approved-At: Mon, 11 Jul 2011 09:40:43 -0400
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 11 Jul 2011 11:26:57 -0000

Hi,

I develop a library for the gm2 compiler. gm2 is the GNU Modula-2
compiler. They started a while ago. So the compatible gcc version is no
longer present in the repos of the distros. They decided to ship the
needed gcc compiler with gm2. If I install the gm2 package.

martin@martin-K7VT4APro:~/schwarzerkaffee/m4$ ls /opt/gm2/bin/
c++  gcc     gm2    i486-linux-gnu-c++  i486-linux-gnu-gcc-4.1.2
cpp  gccbug  gm2m   i486-linux-gnu-g++
g++  gcov    h2def  i486-linux-gnu-gcc

The directory can be a different one, when compiling from source. For
example ~/opt/bin or /usr/local/bin

There's even a version without gcc included.

The library itself is written in C/C++. So I use AC_PROC_CXX
But the examples are written in Modula-2. They need to link the created
library. And here's the problem. AC_PROC_CXX gives me the default
compiler. But gm2 isn't compatible. I need to use the correct gcc
version to compile the library. which is version 4.1 How could I search
for a gcc compiler with this version?

Thanks,
Martin



From MAILER-DAEMON Mon Jul 11 19:23:58 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QgPpV-0005xF-RJ
	for mharc-autoconf@gnu.org; Mon, 11 Jul 2011 19:23:58 -0400
Received: from eggs.gnu.org ([140.186.70.92]:51932)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <zack.weinberg@gmail.com>) id 1QgPpS-0005x5-Or
	for autoconf@gnu.org; Mon, 11 Jul 2011 19:23:55 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <zack.weinberg@gmail.com>) id 1QgPpO-0005ZF-LX
	for autoconf@gnu.org; Mon, 11 Jul 2011 19:23:54 -0400
Received: from mail-pv0-f169.google.com ([74.125.83.169]:61391)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <zack.weinberg@gmail.com>) id 1QgPpN-0005Yz-Vp
	for autoconf@gnu.org; Mon, 11 Jul 2011 19:23:50 -0400
Received: by pvc12 with SMTP id 12so3856006pvc.0
	for <autoconf@gnu.org>; Mon, 11 Jul 2011 16:23:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:sender:date:x-google-sender-auth:message-id:subject
	:from:to:content-type;
	bh=EGhBj98F7oiRLA2a5dVR7V5VDzefbMVwgI5hc+pZjmk=;
	b=ubROZATm6aSOo+Ud8y2VJria1a9KajwhyK90CTIDl8eekF9qnoosar5CIrHke5BiT6
	UnsQ6UP3EF07fZJ6EZk+CcGHcxGTxtdXPKkU3nG9q/rZA4BBLPnBClbxBG2wT+bPkxEL
	pFJjNe0Yzr2NKJ67Rot9wAuIh4mTNhoo2ubdM=
MIME-Version: 1.0
Received: by 10.68.23.6 with SMTP id i6mr8563106pbf.314.1310426626603; Mon, 11
	Jul 2011 16:23:46 -0700 (PDT)
Sender: zack.weinberg@gmail.com
Received: by 10.68.55.137 with HTTP; Mon, 11 Jul 2011 16:23:46 -0700 (PDT)
Date: Mon, 11 Jul 2011 16:23:46 -0700
X-Google-Sender-Auth: dfc4e8HNAKe8WwPCHqQ4t7Gn4SE
Message-ID: <CAKCAbMh8T1H=smxZ621nnbBjXaUVs082Tsge-h8TKs_awf24bQ@mail.gmail.com>
Subject: AC_SEARCH_LIBS with appropriate system headers
From: Zack Weinberg <zackw@panix.com>
To: autoconf@gnu.org
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 74.125.83.169
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 11 Jul 2011 23:23:56 -0000

The obvious way to detect that you're on MinGW and you need to stick
-lws2_32 on your link line for 'ntohl' is

    AC_SEARCH_LIBS([ntohl], [ws2_32])

but this does not work, because the system declares ntohl as

    WINSOCK_API_LINKAGE u_long PASCAL ntohl(u_long);

whereas AC_LANG_CALL will declare it as

    char ntohl();

On Windows the former gets the symbol name '_ntohl@4' and the latter
just '_ntohl', which means both link attempts will fail.  There's no
way autoconf can be expected to know this, it has to include the
appropriate system header.  Worse, the "appropriate system header" is
different on Windows than on Unixy platforms.  Thus, to get it right
everywhere, the program compiled needs to be something like this:

    AC_LANG_CONFTEST([AC_LANG_PROGRAM(
    [#ifdef _WIN32
    #include <winsock2.h>
    #else
    #include <arpa/inet.h>
    #endif],
    [return (int)ntohl(42);])])

Is there a neater way to do this test than by copying the entire
definition of AC_SEARCH_LIBS into my configure.ac (or my aclocal.m4)
and hacking it up?

Thanks,
zw


From MAILER-DAEMON Tue Jul 12 09:10:15 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qgcj7-0003y7-Sn
	for mharc-autoconf@gnu.org; Tue, 12 Jul 2011 09:10:14 -0400
Received: from eggs.gnu.org ([140.186.70.92]:43802)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <narkewoody@gmail.com>) id 1QgUXJ-0000Nn-0Y
	for autoconf@gnu.org; Tue, 12 Jul 2011 00:25:30 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <narkewoody@gmail.com>) id 1QgUXG-0005T2-Cn
	for autoconf@gnu.org; Tue, 12 Jul 2011 00:25:28 -0400
Received: from mail-pz0-f41.google.com ([209.85.210.41]:51817)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <narkewoody@gmail.com>) id 1QgUXF-0005Sv-Na
	for autoconf@gnu.org; Tue, 12 Jul 2011 00:25:26 -0400
Received: by pzk4 with SMTP id 4so4158263pzk.0
	for <autoconf@gnu.org>; Mon, 11 Jul 2011 21:25:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type
	:content-transfer-encoding;
	bh=ITqsdBXdqJaKIf+yyTtwMIQ3Q91Wg/3IUB/OBr2Wl70=;
	b=lCSRfRb66xORdZHqlisqkEAL52tAO0ZacH6VzTRNd2ANsP9wKDfNxVsr6iiwOHg3td
	0Tas33brYvK9vMeRLpHMiQWuea8msSxdAgxImlKQ86Un8DTtuy/Gd+vY/1AgVs4W54Kf
	yhIJnKaV9TBAVbnrtGOyqsrFYXg7A+yr4rQYU=
MIME-Version: 1.0
Received: by 10.68.65.79 with SMTP id v15mr6174858pbs.167.1310444704036; Mon,
	11 Jul 2011 21:25:04 -0700 (PDT)
Received: by 10.68.42.8 with HTTP; Mon, 11 Jul 2011 21:25:04 -0700 (PDT)
Date: Tue, 12 Jul 2011 12:25:04 +0800
Message-ID: <CAAsE_ueNfVBfG4xwqeHD1c5Yus=Y20XXaEG881J05hSC7xfYsg@mail.gmail.com>
Subject: No AC_PROG_TAR?
From: narke <narkewoody@gmail.com>
To: autoconf@gnu.org
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.210.41
X-Mailman-Approved-At: Tue, 12 Jul 2011 09:10:11 -0400
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 12 Jul 2011 04:25:31 -0000

Hi,

I am writing a script.in file that is supposed to finally produce a
script.sh file by automake.  In this script.in, I like to refer the
full path name of two utilities:  sed and tar, hence I use @SED@ and
@TAR@ int my script.in as a place holder.  By add 'AC_PROG_SED=91 in my
configure.ac, I get the @SED@ works for me.  But since there is no
AC_PROG_TAR, I don't know how to make my @TAR@ works.

Can someone please give me a hint?  And, more generally, how to detect
the full path of an external program?

Thanks in advance.

--=20
Life is the only flaw in an otherwise perfect nonexistence
=A0 =A0 -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 (narkewoody@gmail.com)


From MAILER-DAEMON Tue Jul 12 09:26:57 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QgczJ-0007UF-Bs
	for mharc-autoconf@gnu.org; Tue, 12 Jul 2011 09:26:57 -0400
Received: from eggs.gnu.org ([140.186.70.92]:43635)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QgczF-0007TR-EJ
	for autoconf@gnu.org; Tue, 12 Jul 2011 09:26:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QgczD-0002Mo-CV
	for autoconf@gnu.org; Tue, 12 Jul 2011 09:26:53 -0400
Received: from mx1.redhat.com ([209.132.183.28]:45181)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QgczC-0002Mf-W0
	for autoconf@gnu.org; Tue, 12 Jul 2011 09:26:51 -0400
Received: from int-mx12.intmail.prod.int.phx2.redhat.com
	(int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6CDQmWE017112
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 12 Jul 2011 09:26:48 -0400
Received: from [10.3.113.149] (ovpn-113-149.phx2.redhat.com [10.3.113.149])
	by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id p6CDQlaU016052; Tue, 12 Jul 2011 09:26:47 -0400
Message-ID: <4E1C4B97.8040207@redhat.com>
Date: Tue, 12 Jul 2011 07:26:47 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11
MIME-Version: 1.0
To: narke <narkewoody@gmail.com>
Subject: Re: No AC_PROG_TAR?
References: <CAAsE_ueNfVBfG4xwqeHD1c5Yus=Y20XXaEG881J05hSC7xfYsg@mail.gmail.com>
In-Reply-To: <CAAsE_ueNfVBfG4xwqeHD1c5Yus=Y20XXaEG881J05hSC7xfYsg@mail.gmail.com>
X-Enigmail-Version: 1.1.2
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enigCFD1FB35CA8D1CBA707304B3"
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 12 Jul 2011 13:26:55 -0000

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigCFD1FB35CA8D1CBA707304B3
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

On 07/11/2011 10:25 PM, narke wrote:
> Hi,
>=20
> I am writing a script.in file that is supposed to finally produce a
> script.sh file by automake.  In this script.in, I like to refer the
> full path name of two utilities:  sed and tar, hence I use @SED@ and
> @TAR@ int my script.in as a place holder.  By add 'AC_PROG_SED=91 in my=

> configure.ac, I get the @SED@ works for me.  But since there is no
> AC_PROG_TAR, I don't know how to make my @TAR@ works.
>=20
> Can someone please give me a hint?  And, more generally, how to detect
> the full path of an external program?

AC_CHECK_PROG or AC_PATH_PROG

http://www.gnu.org/software/autoconf/manual/autoconf.html#Generic-Program=
s

--=20
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enigCFD1FB35CA8D1CBA707304B3
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJOHEuXAAoJEKeha0olJ0Nqu5wH/js19CjhZHJLEBbv4HxTDc0d
SH0E9wskOkcQEibE1ovOc+G9r+q7tsNBI539+yuBoUyhO/nM+Zc/R2iuHklUhC7M
xQXm8Jl7UkA/g0L1utREVKnhAq8syFbyJWboEcsThig2rGj+BvdUcUlwwurB7Lb6
chwiRl3lMUfTM/sE8HcGpZe3lGQM44n2MUGNpLlFVeWF7QWej4DZF/0MQM6bZGAb
ATEJ/KfYJcX+eO9jWz3HJUVSKXUuPO1VLI9Yxky0+cuvw8hHZf1xBsKYCSysPVe6
usfKz5Qpu6JuKWpEi9fRMOPReIMUBhUrdGbWjDc00qs5arZDc7oGUw45cJKj3mI=
=zIug
-----END PGP SIGNATURE-----

--------------enigCFD1FB35CA8D1CBA707304B3--


From MAILER-DAEMON Tue Jul 12 23:16:54 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QgpwT-0008Bh-DS
	for mharc-autoconf@gnu.org; Tue, 12 Jul 2011 23:16:53 -0400
Received: from eggs.gnu.org ([140.186.70.92]:58771)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <narkewoody@gmail.com>) id 1QgpwN-0008BX-Ke
	for autoconf@gnu.org; Tue, 12 Jul 2011 23:16:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <narkewoody@gmail.com>) id 1QgpwJ-0002G0-1e
	for autoconf@gnu.org; Tue, 12 Jul 2011 23:16:47 -0400
Received: from mail-pz0-f41.google.com ([209.85.210.41]:64239)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <narkewoody@gmail.com>) id 1QgpwI-0002Fv-RS
	for autoconf@gnu.org; Tue, 12 Jul 2011 23:16:43 -0400
Received: by pzk4 with SMTP id 4so5242631pzk.0
	for <autoconf@gnu.org>; Tue, 12 Jul 2011 20:16:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:content-transfer-encoding;
	bh=zyTv253rz5I5/VWMcQFUkGpk8u69QVnHVLr1Hq77zXo=;
	b=tU9KC419wnxOblSSbIoNOFsx0LrWnsXBMt0O815XQ9ke4DIj4+vTfG8fX2814r3VSp
	26SVPNJpj2I9D5IUp/BcB2aJHCs9WKSe96gDHc/aGQx8wSFPYSQRHn+8BBSwaY0si9wL
	PMH2tHNlcg4n4d2QEhgBvFCeBmpidHHiTa/R8=
MIME-Version: 1.0
Received: by 10.68.8.231 with SMTP id u7mr26024pba.390.1310527000909; Tue, 12
	Jul 2011 20:16:40 -0700 (PDT)
Received: by 10.68.42.34 with HTTP; Tue, 12 Jul 2011 20:16:40 -0700 (PDT)
In-Reply-To: <4E1C4B97.8040207@redhat.com>
References: <CAAsE_ueNfVBfG4xwqeHD1c5Yus=Y20XXaEG881J05hSC7xfYsg@mail.gmail.com>
	<4E1C4B97.8040207@redhat.com>
Date: Wed, 13 Jul 2011 11:16:40 +0800
Message-ID: <CAAsE_uc_q6J9QvpxnGD90fENmtX2=L+38VfpFrVLvFBYfPpsXA@mail.gmail.com>
Subject: Re: No AC_PROG_TAR?
From: narke <narkewoody@gmail.com>
To: Eric Blake <eblake@redhat.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.210.41
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Jul 2011 03:16:52 -0000

On 12 July 2011 21:26, Eric Blake <eblake@redhat.com> wrote:
> On 07/11/2011 10:25 PM, narke wrote:
>> Hi,
>>
>> I am writing a script.in file that is supposed to finally produce a
>> script.sh file by automake. =A0In this script.in, I like to refer the
>> full path name of two utilities: =A0sed and tar, hence I use @SED@ and
>> @TAR@ int my script.in as a place holder. =A0By add 'AC_PROG_SED=91 in m=
y
>> configure.ac, I get the @SED@ works for me. =A0But since there is no
>> AC_PROG_TAR, I don't know how to make my @TAR@ works.
>>
>> Can someone please give me a hint? =A0And, more generally, how to detect
>> the full path of an external program?
>
> AC_CHECK_PROG or AC_PATH_PROG
>
> http://www.gnu.org/software/autoconf/manual/autoconf.html#Generic-Program=
s
>
> --
> Eric Blake =A0 eblake@redhat.com =A0 =A0+1-801-349-2682
> Libvirt virtualization library http://libvirt.org
>
>

Thanks!  AC_PATH_PROG works for me.

--=20
Life is the only flaw in an otherwise perfect nonexistence
=A0 =A0 -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 (narkewoody@gmail.com)


From MAILER-DAEMON Mon Jul 18 02:26:09 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QihHM-0007Hh-UI
	for mharc-autoconf@gnu.org; Mon, 18 Jul 2011 02:26:09 -0400
Received: from eggs.gnu.org ([140.186.70.92]:60218)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Ralf.Wildenhues@gmx.de>) id 1QihHI-0007H8-Pg
	for autoconf@gnu.org; Mon, 18 Jul 2011 02:26:06 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <Ralf.Wildenhues@gmx.de>) id 1QihHG-0003iX-R8
	for autoconf@gnu.org; Mon, 18 Jul 2011 02:26:04 -0400
Received: from mailout-de.gmx.net ([213.165.64.22]:56875)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <Ralf.Wildenhues@gmx.de>) id 1QihHG-0003iF-6H
	for autoconf@gnu.org; Mon, 18 Jul 2011 02:26:02 -0400
Received: (qmail 12366 invoked by uid 0); 18 Jul 2011 06:26:00 -0000
Received: from 77.58.247.232 by www011.gmx.net with HTTP;
	Mon, 18 Jul 2011 08:25:59 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Date: Mon, 18 Jul 2011 08:25:59 +0200
From: "Ralf Wildenhues" <Ralf.Wildenhues@gmx.de>
In-Reply-To: <CAKCAbMh8T1H=smxZ621nnbBjXaUVs082Tsge-h8TKs_awf24bQ@mail.gmail.com>
Message-ID: <20110718062559.325950@gmx.net>
MIME-Version: 1.0
References: <CAKCAbMh8T1H=smxZ621nnbBjXaUVs082Tsge-h8TKs_awf24bQ@mail.gmail.com>
Subject: Re: AC_SEARCH_LIBS with appropriate system headers
To: Zack Weinberg <zackw@panix.com>
X-Authenticated: #13673931
X-Flags: 0001
X-Mailer: WWW-Mail 6100 (Global Message Exchange)
X-Mutt-Fcc: ~/Mail/outbox
X-Mutt-References: <CAKCAbMh8T1H=smxZ621nnbBjXaUVs082Tsge-h8TKs_awf24bQ@mail.gmail.com>
X-Priority: 3
X-Provags-ID: V01U2FsdGVkX18jpjQ0gv8jOqhnUHEnCAhPZq/gz/x12LD98TPE9E
	oZ1PeXakOLWcS5rpumw1adOzhnU4Mc+70SUw== 
Content-Transfer-Encoding: 8bit
X-GMX-UID: weQRdmRMPjl+Ev6R5jU2y1E7MTE2NYlm
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 213.165.64.22
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jul 2011 06:26:06 -0000

Hello Zack,

* Zack Weinberg wrote on Tue, Jul 12, 2011 at 01:23:46AM CEST:
> The obvious way to detect that you're on MinGW and you need to stick
> -lws2_32 on your link line for 'ntohl' is
[...]

>     AC_LANG_CONFTEST([AC_LANG_PROGRAM(
>     [#ifdef _WIN32
>     #include <winsock2.h>
>     #else
>     #include <arpa/inet.h>
>     #endif],
>     [return (int)ntohl(42);])])
> 
> Is there a neater way to do this test than by copying the entire
> definition of AC_SEARCH_LIBS into my configure.ac (or my aclocal.m4)
> and hacking it up?

Maybe wrap your AC_SEARCH_LIBS call into
  m4_pushdef([AC_LANG_CALL], [modified version that does TRT])dnl
  ...
  m4_popdef([AC_LANG_CALL])dnl

Hope that helps.

Cheers,
Ralf


From MAILER-DAEMON Mon Jul 18 02:36:02 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QihQw-0000NE-8k
	for mharc-autoconf@gnu.org; Mon, 18 Jul 2011 02:36:02 -0400
Received: from eggs.gnu.org ([140.186.70.92]:49340)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Ralf.Wildenhues@gmx.de>) id 1QihQo-0000L6-Cx
	for autoconf@gnu.org; Mon, 18 Jul 2011 02:36:00 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <Ralf.Wildenhues@gmx.de>) id 1QihQi-0005Uv-Ja
	for autoconf@gnu.org; Mon, 18 Jul 2011 02:35:54 -0400
Received: from mailout-de.gmx.net ([213.165.64.22]:35714)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <Ralf.Wildenhues@gmx.de>) id 1QihQh-0005Ul-OM
	for autoconf@gnu.org; Mon, 18 Jul 2011 02:35:48 -0400
Received: (qmail 20569 invoked by uid 0); 18 Jul 2011 06:35:46 -0000
Received: from 77.58.247.232 by www011.gmx.net with HTTP;
	Mon, 18 Jul 2011 08:35:44 +0200 (CEST)
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="utf-8"
Date: Mon, 18 Jul 2011 08:35:44 +0200
From: "Ralf Wildenhues" <Ralf.Wildenhues@gmx.de>
In-Reply-To: <CADqoJL2Qv_LZhGeFCQCUY=pKHNae3jUWvE5OD3U7PfGHVTeeuw@mail.gmail.com>
Message-ID: <20110718063544.325950@gmx.net>
MIME-Version: 1.0
References: <CADqoJL2Qv_LZhGeFCQCUY=pKHNae3jUWvE5OD3U7PfGHVTeeuw@mail.gmail.com>
Subject: Re: Nested Packages: dependencies between autoconfiscated packages
To: =?iso-8859-1?Q?=22V=EDtor_da_Rosa=22?= <vitormr@gmail.com>
X-Authenticated: #13673931
X-Flags: 0001
X-Mailer: WWW-Mail 6100 (Global Message Exchange)
X-Mutt-Fcc: ~/Mail/outbox
X-Mutt-References: <CADqoJL2Qv_LZhGeFCQCUY=pKHNae3jUWvE5OD3U7PfGHVTeeuw@mail.gmail.com>
X-Priority: 3
X-Provags-ID: V01U2FsdGVkX1948doWHzl42V77Z30N6cK5UREHCHB6R0tMrOM3To
	7wWKKJGt03M+ztlPTweJPrhDFlGzRLRAiOoQ== 
X-GMX-UID: JaVKISFHMydhZZzwumpllApjaGRhZlr+
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 213.165.64.22
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jul 2011 06:36:00 -0000

Hello Vítor,

* Vítor da Rosa wrote on Sun, Jul 10, 2011 at 03:45:17AM CEST:
> Suppose that instead of having arm and hand packages, my project
> application has body as main package and trunk, arm and leg as
> subpackages (autoconfiscated packages), such as the following
> directory hierarchy:
> 
> body
> |--> trunk
> |--> arm
> |--> leg
> 
> 
> The packages arm and leg call functions from trunk subpackage, so they
> have library and header dependencies on trunk. Here comes my question.

...
> # Include headers from arm, leg and trunk when compiling this directory.
> AM_CPPFLAGS = -I$(srcdir)/arm -I$(srcdir)/leg -I$(srcdir)/trunk
...
> # link with the arm, leg and trunk library.
> libbody_la_LIBLDADD = arm/libarm.la leg/libleg.la trunk/libtrunk.la

So you're saying you have dependencies going in both ways?  Why are you
making them separate packages then?  (Honest question, doing so can be
useful for reasons other than being able to split packages.)


In your arm and leg package, you cannot test for trunk libraries at
configure time (obviously, as they don't exist yet at that time).
So you typically hard-code them as $(top_srcdir)/../libbody.la or so,
likewise -I$(top_srcdir)/..  Of course this is invalid, as libbody
already depends on libarm and libleg, and a circular dependency would
not work.

Header dependencies are not a problem, but often, the structure can be
reformulated not to require such interdependencies.

Hope that helps.

Cheers,
Ralf


From MAILER-DAEMON Wed Jul 20 09:02:24 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QjWPv-0000Vv-B2
	for mharc-autoconf@gnu.org; Wed, 20 Jul 2011 09:02:23 -0400
Received: from eggs.gnu.org ([140.186.70.92]:37314)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kaushikbv.glus@gmail.com>) id 1QjSK6-00074l-L8
	for autoconf@gnu.org; Wed, 20 Jul 2011 04:40:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kaushikbv.glus@gmail.com>) id 1QjSJr-0003qr-Ru
	for autoconf@gnu.org; Wed, 20 Jul 2011 04:40:04 -0400
Received: from mail-qy0-f176.google.com ([209.85.216.176]:40951)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kaushikbv.glus@gmail.com>) id 1QjSJr-0003qV-Eb
	for autoconf@gnu.org; Wed, 20 Jul 2011 04:39:51 -0400
Received: by qyk4 with SMTP id 4so4251qyk.0
	for <autoconf@gnu.org>; Wed, 20 Jul 2011 01:39:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:from:date:message-id:subject:to:content-type;
	bh=6S5WMHw9u/jtnp9JD3cOqQYjzN5DVWHz+TLgbdPz1Zk=;
	b=FJbKFzXdBpu1O25cuOt0i5o5XbY4kIJR9cmy0N5b2AcdPQ/wZgta9/GjVkjqCf4zLe
	oMB6sVdhvIKC7sDBQcoVccDyu+jUQ5urbo3yrVJ8HTkNsjN+dt0xX0Blr2Fn+P0wFjMv
	dRYYWwT8nlMOELQhxidVkurGJXrRs+Pk8AibQ=
Received: by 10.224.18.212 with SMTP id x20mr4397989qaa.165.1311151188137;
	Wed, 20 Jul 2011 01:39:48 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.229.19.83 with HTTP; Wed, 20 Jul 2011 01:39:27 -0700 (PDT)
From: Kaushik BV <kaushikbv.glus@gmail.com>
Date: Wed, 20 Jul 2011 14:09:27 +0530
Message-ID: <CAJ6sxPKnqBkKa4oBsy+HaJb3ExUBQfe653pWOhPYgAiGmDQKrQ@mail.gmail.com>
Subject: PKG_CHECK_MODULES not working in Solaris
To: autoconf@gnu.org
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.216.176
X-Mailman-Approved-At: Wed, 20 Jul 2011 09:02:22 -0400
Content-Type: text/plain; charset=ISO-8859-1
X-Content-Filtered-By: Mailman/MimeDel 2.1.14
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Jul 2011 08:40:12 -0000

Hi all,

I am a newbie w.r.t to auto-tools. Searched for an answer in the list was
not able to find one, please direct me to the right list if the following
question is not appropriate.

 My project requires dependency of `libxml2` am using autotools to check the
dependencies & install the same. I declare the dependency of using the
following macro in configure.ac

    echo -n "checking if libxml2 is present... "

    PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6.19],
                  [echo "yes (features requiring libxml2 enabled)"
 AC_DEFINE(HAVE_LIB_XML, 1,     [define if libxml2 is present])],
                  [echo "no"] )

The macro works as desired in `GNU/Linux`.

But somehow it fails in `Solaris` with the following error

    checking if libxml2 is present... ./configure: line 11586: syntax error
near unexpected token `LIBXML2,'
    ./configure: line 11586: `PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >=
2.6.19,'

Googled for a solution, most of them complain of `pkg-config` not being
installed. But in my test machine its actually installed, checked it by
executing the following command.

    bash-3.00# pkg-config libxml-2.0 --modversion
    2.6.23

Some suggestions would be welcomed.

From MAILER-DAEMON Wed Jul 20 10:12:18 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QjXVa-0001qJ-9M
	for mharc-autoconf@gnu.org; Wed, 20 Jul 2011 10:12:18 -0400
Received: from eggs.gnu.org ([140.186.70.92]:54430)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QjXVU-0001ok-2M
	for autoconf@gnu.org; Wed, 20 Jul 2011 10:12:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QjXVO-00086M-RS
	for autoconf@gnu.org; Wed, 20 Jul 2011 10:12:12 -0400
Received: from mx1.redhat.com ([209.132.183.28]:5451)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QjXVO-000862-3u
	for autoconf@gnu.org; Wed, 20 Jul 2011 10:12:06 -0400
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6KEC3H5028479
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 20 Jul 2011 10:12:03 -0400
Received: from [10.3.113.79] (ovpn-113-79.phx2.redhat.com [10.3.113.79])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id p6KEC3WH026020; Wed, 20 Jul 2011 10:12:03 -0400
Message-ID: <4E26E232.8000609@redhat.com>
Date: Wed, 20 Jul 2011 08:12:02 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11
MIME-Version: 1.0
To: Kaushik BV <kaushikbv.glus@gmail.com>
Subject: Re: PKG_CHECK_MODULES not working in Solaris
References: <CAJ6sxPKnqBkKa4oBsy+HaJb3ExUBQfe653pWOhPYgAiGmDQKrQ@mail.gmail.com>
In-Reply-To: <CAJ6sxPKnqBkKa4oBsy+HaJb3ExUBQfe653pWOhPYgAiGmDQKrQ@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Jul 2011 14:12:16 -0000

On 07/20/2011 02:39 AM, Kaushik BV wrote:
> But somehow it fails in `Solaris` with the following error
>
>      checking if libxml2 is present... ./configure: line 11586: syntax error
> near unexpected token `LIBXML2,'
>      ./configure: line 11586: `PKG_CHECK_MODULES(LIBXML2, libxml-2.0>=
> 2.6.19,'

That means that your aclocal.m4 (either hand-written, or as generated by 
'aclocal' from automake) file did not include enough instructions to 
have a definition of the macro PKG_CHECK_MODULES.  Is your project using 
automake?  If so, it means that you were probably relying on automake's 
search path of installed public .m4 files on one machine where the 
pkg-config package had been installed, but on your Solaris machine, 
automake is not set up to find that external macro by default.

Relying on external .m4 macros when rerunning aclocal (or autoreconf) is 
always dangerous - it means you are dependent on what else is already 
installed on your machine.  Better is to copy the pkg-config .m4 file 
that defined PKG_CHECK_MODULES into your project, so that the macro is 
available for all people who autoreconf your package, even in cases like 
your Solaris setup where pkg-config has not already been installed in 
such a way that its public .m4 files are visible to automake.

> Googled for a solution, most of them complain of `pkg-config` not being
> installed. But in my test machine its actually installed, checked it by
> executing the following command.
>
>      bash-3.00# pkg-config libxml-2.0 --modversion
>      2.6.23

That says that the pkg-config binary is installed, but doesn't say 
whether the public .m4 files provided by the pkg-config package are 
located somewhere that automake will find them by default.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


From MAILER-DAEMON Thu Jul 21 23:53:29 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qk6np-0003sh-Cq
	for mharc-autoconf@gnu.org; Thu, 21 Jul 2011 23:53:29 -0400
Received: from eggs.gnu.org ([140.186.70.92]:58687)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <rra@stanford.edu>) id 1Qk6nm-0003kE-84
	for autoconf@gnu.org; Thu, 21 Jul 2011 23:53:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <rra@stanford.edu>) id 1Qk6nl-0007W9-4j
	for autoconf@gnu.org; Thu, 21 Jul 2011 23:53:26 -0400
Received: from smtp3.stanford.edu ([171.67.219.83]:54643
	helo=smtp.stanford.edu) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <rra@stanford.edu>) id 1Qk6nk-0007V3-W0
	for autoconf@gnu.org; Thu, 21 Jul 2011 23:53:25 -0400
Received: from smtp.stanford.edu (localhost.localdomain [127.0.0.1])
	by localhost (Postfix) with SMTP id 65B57D805A
	for <autoconf@gnu.org>; Thu, 21 Jul 2011 20:53:21 -0700 (PDT)
Received: from windlord.stanford.edu (windlord.Stanford.EDU [171.67.225.134])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.stanford.edu (Postfix) with ESMTPS id 22099D8063
	for <autoconf@gnu.org>; Thu, 21 Jul 2011 20:53:21 -0700 (PDT)
Received: by windlord.stanford.edu (Postfix, from userid 1000)
	id 0AC7D2F4F4; Thu, 21 Jul 2011 20:53:21 -0700 (PDT)
From: Russ Allbery <rra@stanford.edu>
To: autoconf@gnu.org
Subject: Minor autoreconf manual typo
Organization: The Eyrie
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)
Date: Thu, 21 Jul 2011 20:53:21 -0700
Message-ID: <87mxg7otse.fsf@windlord.stanford.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 171.67.219.83
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Jul 2011 03:53:27 -0000

Someone mentioned in another forum that I read that the autoreconf
Invocation node of the Autoconf manual has a typo: -V (upper-case) is
shown as the short option for both --version and --verbose.  From the
--help output, it looks like this should be -v for --verbose.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>


From MAILER-DAEMON Fri Jul 22 09:04:58 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QkFPW-00079X-DV
	for mharc-autoconf@gnu.org; Fri, 22 Jul 2011 09:04:58 -0400
Received: from eggs.gnu.org ([140.186.70.92]:42086)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QkFPT-00079R-LB
	for autoconf@gnu.org; Fri, 22 Jul 2011 09:04:56 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QkFPS-0005Dz-Hb
	for autoconf@gnu.org; Fri, 22 Jul 2011 09:04:55 -0400
Received: from mx1.redhat.com ([209.132.183.28]:22720)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QkFPS-0005Dl-AH
	for autoconf@gnu.org; Fri, 22 Jul 2011 09:04:54 -0400
Received: from int-mx10.intmail.prod.int.phx2.redhat.com
	(int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6MD4qa6031942
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 22 Jul 2011 09:04:52 -0400
Received: from [10.3.113.79] (ovpn-113-79.phx2.redhat.com [10.3.113.79])
	by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id p6MD4qdu012020; Fri, 22 Jul 2011 09:04:52 -0400
Message-ID: <4E297573.3030308@redhat.com>
Date: Fri, 22 Jul 2011 07:04:51 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11
MIME-Version: 1.0
To: Russ Allbery <rra@stanford.edu>
Subject: Re: Minor autoreconf manual typo
References: <87mxg7otse.fsf@windlord.stanford.edu>
In-Reply-To: <87mxg7otse.fsf@windlord.stanford.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Jul 2011 13:04:56 -0000

On 07/21/2011 09:53 PM, Russ Allbery wrote:
> Someone mentioned in another forum that I read that the autoreconf
> Invocation node of the Autoconf manual has a typo: -V (upper-case) is
> shown as the short option for both --version and --verbose.  From the
> --help output, it looks like this should be -v for --verbose.

Thanks, fixed.

>

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


From MAILER-DAEMON Fri Jul 22 14:26:21 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QkKQX-0004yh-VN
	for mharc-autoconf@gnu.org; Fri, 22 Jul 2011 14:26:21 -0400
Received: from eggs.gnu.org ([140.186.70.92]:43498)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <avenger-inpe@avenger.ws>) id 1QkKKX-0004MZ-5G
	for autoconf@gnu.org; Fri, 22 Jul 2011 14:20:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <avenger-inpe@avenger.ws>) id 1QkKKW-0007TZ-16
	for autoconf@gnu.org; Fri, 22 Jul 2011 14:20:09 -0400
Received: from ethereal.avenger.ws ([66.111.53.78]:38017 helo=mail.avenger.ws)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <avenger-inpe@avenger.ws>) id 1QkKKV-0007RO-Sx
	for autoconf@gnu.org; Fri, 22 Jul 2011 14:20:07 -0400
Received: (qmail 19374 invoked from network); 22 Jul 2011 18:20:05 -0000
Received: from piqui.cptec.inpe.br (HELO avengerwork) (150.163.163.197)
	by mail.avenger.ws with SMTP; 22 Jul 2011 18:20:05 -0000
Message-ID: <72AAA9F729DB4DD18181AE9C5744C583@avengerwork>
From: "Heavenly Avenger" <avenger-inpe@avenger.ws>
To: <autoconf@gnu.org>
Subject: Fortran 90: Specify 'use' statements to AC_CHECK_LIB / AC_HAVE_LIBRARY
Date: Fri, 22 Jul 2011 15:20:03 -0300
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Mailer: Microsoft Windows Live Mail 15.4.3508.1109
X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3508.1109
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 66.111.53.78
X-Mailman-Approved-At: Fri, 22 Jul 2011 14:26:20 -0400
Content-Type: text/plain;
	charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-Content-Filtered-By: Mailman/MimeDel 2.1.14
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Jul 2011 18:20:10 -0000

Hello,

    While using AC_CHECK_LIB, a tiny program is generated. If I say on =
configure.ac:
AC_CHECK_LIB([netcdf],[nf90_inq_libvers])
    It creates a
      program main
      nf90_inq_libvers
      end
    What is enough for a simple program. The problem is, for that =
library, the specific fortran 90 commands are exported via a module =
only, so instead of having generated that three-line-long file, I would =
need a single additional line to search for the .mod file, resulting in:
      program main
      use netcdf
      nf90_inq_libvers
      end
    Is there a way I can specify and additional line to be created to =
conftest file in autoconf? As a =E2=80=98workaround=E2=80=99 I could =
either build a custom script to make configtest as I need it, or check =
for the .MOD file existence and just try with the functions that work =
right away with =E2=80=93lnetcdf like =E2=80=98nf_inq_libvers=E2=80=99, =
but it would be nicer if there was an option to specify the =
=E2=80=98use=E2=80=99 line in the conftest to a =
AC_CHECK_LIB/AC_HAVE_LIBRARY or similar command.
    Remember, I am using FORTRAN 90.

Thanks in advance,
Fabricio Murta

From MAILER-DAEMON Wed Jul 27 01:56:18 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qlx6P-0003JL-RH
	for mharc-autoconf@gnu.org; Wed, 27 Jul 2011 01:56:17 -0400
Received: from eggs.gnu.org ([140.186.70.92]:36185)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <narkewoody@gmail.com>) id 1Qlx6N-0003JF-MH
	for autoconf@gnu.org; Wed, 27 Jul 2011 01:56:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <narkewoody@gmail.com>) id 1Qlx6M-0002sp-1a
	for autoconf@gnu.org; Wed, 27 Jul 2011 01:56:15 -0400
Received: from mail-pz0-f49.google.com ([209.85.210.49]:34612)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <narkewoody@gmail.com>) id 1Qlx6L-0002sj-QI
	for autoconf@gnu.org; Wed, 27 Jul 2011 01:56:14 -0400
Received: by pzk33 with SMTP id 33so1784273pzk.8
	for <autoconf@gnu.org>; Tue, 26 Jul 2011 22:56:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type
	:content-transfer-encoding;
	bh=hyDSjsaD6KjwMevnAEYvyYGFVtalYqjVdKABMEJpkk0=;
	b=s0dG9i6wXg/NRBl8b4hDoVqhHHVzNezbzuZEQrAD3/FYqS10XqHcNNP7hu8qjjyW26
	Iqm+IhtuQUGmqlRWYeLaAxCvxdA0g5Y9LidH5SONxoq2XWmv7rF4C1fkwhTToJJUT40Z
	SOWloVoFkmx9RFZyVlmmsgQJlRc1NrD/eZFR8=
MIME-Version: 1.0
Received: by 10.68.34.34 with SMTP id w2mr11809863pbi.291.1311746171704; Tue,
	26 Jul 2011 22:56:11 -0700 (PDT)
Received: by 10.68.63.136 with HTTP; Tue, 26 Jul 2011 22:56:11 -0700 (PDT)
Date: Wed, 27 Jul 2011 13:56:11 +0800
Message-ID: <CAAsE_udijCfASMj8sr7YOfC5qLTXzJWYmG_KuW7dH8gUERcc4g@mail.gmail.com>
Subject: How to enable/disable my debug code?
From: narke <narkewoody@gmail.com>
To: autoconf@gnu.org
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.210.49
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jul 2011 05:56:16 -0000

Hi,

With a same set of autoconf/automake files, how to I distribute my
program that allows user to build it with or without debug code
enabled?  In my code, there are something like below:

#if (__MY_DEBUG__)
 ...
#endif

Thanks in advance.


--=20
Life is the only flaw in an otherwise perfect nonexistence
=A0 =A0 -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 (narkewoody@gmail.com)


From MAILER-DAEMON Wed Jul 27 07:43:38 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qm2WY-0004Xt-EC
	for mharc-autoconf@gnu.org; Wed, 27 Jul 2011 07:43:38 -0400
Received: from eggs.gnu.org ([140.186.70.92]:52786)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gary@vaughan.pe>) id 1Qlxjo-0001g1-8r
	for autoconf@gnu.org; Wed, 27 Jul 2011 02:37:04 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gary@vaughan.pe>) id 1Qlxjm-0001nA-Us
	for autoconf@gnu.org; Wed, 27 Jul 2011 02:37:00 -0400
Received: from hapkido.dreamhost.com ([66.33.216.122]:57201)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gary@vaughan.pe>) id 1Qlxjm-0001n2-KA
	for autoconf@gnu.org; Wed, 27 Jul 2011 02:36:58 -0400
Received: from homiemail-a76.g.dreamhost.com (caiajhbdcagg.dreamhost.com
	[208.97.132.66])
	by hapkido.dreamhost.com (Postfix) with ESMTP id 8161A17CB79
	for <autoconf@gnu.org>; Tue, 26 Jul 2011 23:36:56 -0700 (PDT)
Received: from homiemail-a76.g.dreamhost.com (localhost [127.0.0.1])
	by homiemail-a76.g.dreamhost.com (Postfix) with ESMTP id 354A345807C;
	Tue, 26 Jul 2011 23:36:55 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; c=nofws; d=vaughan.pe; h=subject
	:mime-version:content-type:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to; q=dns; s=
	vaughan.pe; b=YzkwDMM6bDIL8sx+jnbLl1VYTGFgftNQ7se54vamUCPZ0S5HGT
	016KxGDfqhHjUhx0jcq7jiZwioX/clMRs/7o+ahDPzK0RpH2Nh03Iy/7W1TB7F5K
	jmgEjwYy+yCS+Zoa+ogzaghjIGJqJCL0GPiVv96AWGMnpjOfoB1TaupV4=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=vaughan.pe; h=subject
	:mime-version:content-type:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to; s=
	vaughan.pe; bh=7YqhjnmsF71jMIIvIstiTZaVaLs=; b=Wlb/uwDjSxmrcqSmg
	T3PwyO8/yqgT68GJ3O/Yhd+qgHsyPNKR6zCTebuuxCEe6wDg8erhIrJWKv14ptGx
	qPwNnNeoTcHysOxBlq0CQW2AZ0IC2O7xTDIG2ATr329CHu8CosFHXaEXYW5M1K/C
	sGcyO8L2ElWuzdMFzqVESzb52g=
Received: from [192.168.1.3] (unknown [180.183.124.95])
	(using TLSv1 with cipher AES128-SHA (128/128 bits))
	(No client certificate requested)
	(Authenticated sender: gary@vaughan.pe)
	by homiemail-a76.g.dreamhost.com (Postfix) with ESMTPSA id 5286E45807B; 
	Tue, 26 Jul 2011 23:36:53 -0700 (PDT)
Subject: Re: How to enable/disable my debug code?
Mime-Version: 1.0 (Apple Message framework v1244.3)
Content-Type: text/plain; charset=iso-8859-1
From: "Gary V. Vaughan" <gary@vaughan.pe>
In-Reply-To: <CAAsE_udijCfASMj8sr7YOfC5qLTXzJWYmG_KuW7dH8gUERcc4g@mail.gmail.com>
Date: Wed, 27 Jul 2011 13:36:49 +0700
Content-Transfer-Encoding: 7bit
Message-Id: <7ED9887F-BCEE-433E-ADB0-70C748FBC363@vaughan.pe>
References: <CAAsE_udijCfASMj8sr7YOfC5qLTXzJWYmG_KuW7dH8gUERcc4g@mail.gmail.com>
To: narke <narkewoody@gmail.com>
X-Mailer: Apple Mail (2.1244.3)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6
X-Received-From: 66.33.216.122
X-Mailman-Approved-At: Wed, 27 Jul 2011 07:43:36 -0400
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jul 2011 06:37:04 -0000

On 27 Jul 2011, at 12:56, narke wrote:
> With a same set of autoconf/automake files, how to I distribute my
> program that allows user to build it with or without debug code
> enabled?  In my code, there are something like below:
> 
> #if (__MY_DEBUG__)
> ...
> #endif
> 
> Thanks in advance.


For debug builds:

  ./configure CFLAGS='-g' CPPFLAGS=-D__MY_DEBUG__

For regular builds:

  ./configure

If you use assert.h, you can also speed things up a bit more by turning
off the assertions with:

  ./configure CPPFLAGS=-DNDEBUG

Of course you can write (or find and copy) some Autoconf M4 code to
do some or all of the above automatically depending on the presence
of configure options like:

  ./configure --enable-debug

Googling for 'AC_ARG_ENABLE debug' turns up many examples such as:

  AC_ARG_ENABLE([debug],
    [  --enable-debug           build with additional debugging code],
    [CFLAGS='-g';AC_DEFINE([__MY_DEBUG__])])

HTH,
-- 
Gary V. Vaughan (gary AT gnu DOT org)


From MAILER-DAEMON Wed Jul 27 08:23:06 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qm38k-0008DM-SR
	for mharc-autoconf@gnu.org; Wed, 27 Jul 2011 08:23:06 -0400
Received: from eggs.gnu.org ([140.186.70.92]:49828)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <narkewoody@gmail.com>) id 1Qm38i-0008BV-5I
	for autoconf@gnu.org; Wed, 27 Jul 2011 08:23:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <narkewoody@gmail.com>) id 1Qm38g-0007H8-MY
	for autoconf@gnu.org; Wed, 27 Jul 2011 08:23:04 -0400
Received: from mail-pz0-f49.google.com ([209.85.210.49]:35413)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <narkewoody@gmail.com>) id 1Qm38g-0007H1-BX
	for autoconf@gnu.org; Wed, 27 Jul 2011 08:23:02 -0400
Received: by pzk33 with SMTP id 33so2204847pzk.8
	for <autoconf@gnu.org>; Wed, 27 Jul 2011 05:23:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:content-transfer-encoding;
	bh=7laFdTazzJ3jh8EkxPDdaW6TEMqNFklNyjbmXz3Z6fA=;
	b=xbjsVXH2qBoz84lebPDe2KDDIHYE/Y+NSKAUz3hJd1oyAxbodyVxP+WWRtKelKfpKk
	MXrc76IhaPo1yEZ661vMI/EkHpFyC9ySMGCf3ZM1ut/S/VALg2TbjBuJpAHwuOhuv7LX
	jJQW4w94o+iFcrsjdOghbJd9htN6LhS52nQ1c=
MIME-Version: 1.0
Received: by 10.68.11.195 with SMTP id s3mr6858454pbb.157.1311769379187; Wed,
	27 Jul 2011 05:22:59 -0700 (PDT)
Received: by 10.68.63.136 with HTTP; Wed, 27 Jul 2011 05:22:59 -0700 (PDT)
In-Reply-To: <7ED9887F-BCEE-433E-ADB0-70C748FBC363@vaughan.pe>
References: <CAAsE_udijCfASMj8sr7YOfC5qLTXzJWYmG_KuW7dH8gUERcc4g@mail.gmail.com>
	<7ED9887F-BCEE-433E-ADB0-70C748FBC363@vaughan.pe>
Date: Wed, 27 Jul 2011 20:22:59 +0800
Message-ID: <CAAsE_ufQBQFjL7qGY-3Wq1QUcAAEkraKLoRYvf7WQeEhP3fN8Q@mail.gmail.com>
Subject: Re: How to enable/disable my debug code?
From: narke <narkewoody@gmail.com>
To: "Gary V. Vaughan" <gary@vaughan.pe>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.210.49
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jul 2011 12:23:05 -0000

Hi, Gary

On 27 July 2011 14:36, Gary V. Vaughan <gary@vaughan.pe> wrote:
> On 27 Jul 2011, at 12:56, narke wrote:
>> With a same set of autoconf/automake files, how to I distribute my
>> program that allows user to build it with or without debug code
>> enabled? =A0In my code, there are something like below:
>>
>> #if (__MY_DEBUG__)
>> ...
>> #endif
>>
>> Thanks in advance.
>
>
> For debug builds:
>
> =A0./configure CFLAGS=3D'-g' CPPFLAGS=3D-D__MY_DEBUG__
>

For this approach, will it overwrite my already defined flags or just
append values to them?  It usual that my CPPFLAGS had already set as
something like "-I/my/include" in a Makefile.am

> For regular builds:
>
> =A0./configure
>
> If you use assert.h, you can also speed things up a bit more by turning
> off the assertions with:
>
> =A0./configure CPPFLAGS=3D-DNDEBUG
>
> Of course you can write (or find and copy) some Autoconf M4 code to
> do some or all of the above automatically depending on the presence
> of configure options like:
>
> =A0./configure --enable-debug
>
> Googling for 'AC_ARG_ENABLE debug' turns up many examples such as:
>
> =A0AC_ARG_ENABLE([debug],
> =A0 =A0[ =A0--enable-debug =A0 =A0 =A0 =A0 =A0 build with additional debu=
gging code],
> =A0 =A0[CFLAGS=3D'-g';AC_DEFINE([__MY_DEBUG__])])
>

I prefer this approach, thank for showing the example!

> HTH,
> --
> Gary V. Vaughan (gary AT gnu DOT org)
>



--=20
Life is the only flaw in an otherwise perfect nonexistence
=A0 =A0 -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 (narkewoody@gmail.com)


From MAILER-DAEMON Wed Jul 27 09:13:38 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qm3ve-0004fk-0j
	for mharc-autoconf@gnu.org; Wed, 27 Jul 2011 09:13:38 -0400
Received: from eggs.gnu.org ([140.186.70.92]:54642)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gary@gnu.org>) id 1Qm3vZ-0004fc-9O
	for autoconf@gnu.org; Wed, 27 Jul 2011 09:13:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gary@gnu.org>) id 1Qm3vY-0000uj-1D
	for autoconf@gnu.org; Wed, 27 Jul 2011 09:13:33 -0400
Received: from hapkido.dreamhost.com ([66.33.216.122]:54560)
	by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <gary@gnu.org>)
	id 1Qm3vX-0000ue-S1
	for autoconf@gnu.org; Wed, 27 Jul 2011 09:13:31 -0400
Received: from homiemail-a76.g.dreamhost.com (caiajhbdccah.dreamhost.com
	[208.97.132.207])
	by hapkido.dreamhost.com (Postfix) with ESMTP id D678217B005
	for <autoconf@gnu.org>; Wed, 27 Jul 2011 06:13:30 -0700 (PDT)
Received: from homiemail-a76.g.dreamhost.com (localhost [127.0.0.1])
	by homiemail-a76.g.dreamhost.com (Postfix) with ESMTP id B8FFC458080;
	Wed, 27 Jul 2011 06:13:29 -0700 (PDT)
Received: from [192.168.1.3] (unknown [180.183.124.95])
	(using TLSv1 with cipher AES128-SHA (128/128 bits))
	(No client certificate requested)
	(Authenticated sender: gary@vaughan.pe)
	by homiemail-a76.g.dreamhost.com (Postfix) with ESMTPSA id E5BB5458079; 
	Wed, 27 Jul 2011 06:13:28 -0700 (PDT)
Subject: Re: How to enable/disable my debug code?
Mime-Version: 1.0 (Apple Message framework v1244.3)
Content-Type: text/plain; charset=iso-8859-1
From: "Gary V. Vaughan" <gary@gnu.org>
In-Reply-To: <CAAsE_ufQBQFjL7qGY-3Wq1QUcAAEkraKLoRYvf7WQeEhP3fN8Q@mail.gmail.com>
Date: Wed, 27 Jul 2011 20:13:24 +0700
Content-Transfer-Encoding: 7bit
Message-Id: <ADCDD800-8A8B-41B1-8DC0-8418D2BED25D@gnu.org>
References: <CAAsE_udijCfASMj8sr7YOfC5qLTXzJWYmG_KuW7dH8gUERcc4g@mail.gmail.com>
	<7ED9887F-BCEE-433E-ADB0-70C748FBC363@vaughan.pe>
	<CAAsE_ufQBQFjL7qGY-3Wq1QUcAAEkraKLoRYvf7WQeEhP3fN8Q@mail.gmail.com>
To: narke <narkewoody@gmail.com>
X-Mailer: Apple Mail (2.1244.3)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6
X-Received-From: 66.33.216.122
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jul 2011 13:13:37 -0000

On 27 Jul 2011, at 19:22, narke wrote:
> Hi, Gary

Howdy!

> On 27 July 2011 14:36, Gary V. Vaughan <gary@vaughan.pe> wrote:
>> On 27 Jul 2011, at 12:56, narke wrote:
>>> With a same set of autoconf/automake files, how to I distribute my
>>> program that allows user to build it with or without debug code
>>> enabled?  In my code, there are something like below:
>>> 
>>> #if (__MY_DEBUG__)
>>> ...
>>> #endif
>>> 
>>> Thanks in advance.
>> 
>> 
>> For debug builds:
>> 
>>  ./configure CFLAGS='-g' CPPFLAGS=-D__MY_DEBUG__
>> 
> 
> For this approach, will it overwrite my already defined flags or just
> append values to them?  It usual that my CPPFLAGS had already set as
> something like "-I/my/include" in a Makefile.am

If the Makefile.am's have been written correctly (as described in the
info manual and elsewhere), then CPPFLAGS/CFLAGS/LDFLAGS/etc should not
be *set* in Makefile.am (although of course they are referenced often)
because those are in the users' namespace.  Instead, Makefile.am should
be setting required (but not compiler specific!!) options inside
AM_CPPFLAGS/AM_CFLAGS/AM_LDFLAGS/etc.  The info manuals will help you
here. Anyway, even if Makefile.am sets these flags incorrectly, since
you set the options at configure time as shown above, you might still
get away with it, since the configure values are then spliced into the
generated Makefile's.

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



From MAILER-DAEMON Wed Jul 27 10:54:22 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qm5V8-0001DY-2I
	for mharc-autoconf@gnu.org; Wed, 27 Jul 2011 10:54:22 -0400
Received: from eggs.gnu.org ([140.186.70.92]:38873)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <rhys.ulerich@gmail.com>) id 1Qm5V4-0001BT-SB
	for autoconf@gnu.org; Wed, 27 Jul 2011 10:54:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <rhys.ulerich@gmail.com>) id 1Qm5V3-0002oC-QB
	for autoconf@gnu.org; Wed, 27 Jul 2011 10:54:18 -0400
Received: from mail-ww0-f49.google.com ([74.125.82.49]:57159)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <rhys.ulerich@gmail.com>) id 1Qm5V3-0002o7-DP
	for autoconf@gnu.org; Wed, 27 Jul 2011 10:54:17 -0400
Received: by wwf22 with SMTP id 22so1166839wwf.30
	for <autoconf@gnu.org>; Wed, 27 Jul 2011 07:54:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type;
	bh=UB1KDbo0cBVNP+yEN52nZnnXhrfiSIFAUvso9uhZj1w=;
	b=dGpAHVf/vk8bpny7PDBbt/deCuHUe07kHQvlT6U9TPBhwPabDJ6DmMF5x4Ofrmm/1l
	lwKrTRql17S+c/WHXHI8ebd/mOpdmIqvvDAqWHaNKY8SJfEd72ZHvfNFFXecpumoeS35
	snwsMKAV3PiBr4jZ+5X79Z1RjoZybhvXbDyHg=
Received: by 10.216.79.5 with SMTP id h5mr94726wee.110.1311778456178; Wed, 27
	Jul 2011 07:54:16 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.216.28.195 with HTTP; Wed, 27 Jul 2011 07:53:56 -0700 (PDT)
In-Reply-To: <7ED9887F-BCEE-433E-ADB0-70C748FBC363@vaughan.pe>
References: <CAAsE_udijCfASMj8sr7YOfC5qLTXzJWYmG_KuW7dH8gUERcc4g@mail.gmail.com>
	<7ED9887F-BCEE-433E-ADB0-70C748FBC363@vaughan.pe>
From: Rhys Ulerich <rhys.ulerich@gmail.com>
Date: Wed, 27 Jul 2011 09:53:56 -0500
Message-ID: <CAKDqugTNUcx2eF3UU8FYd4NnKTgxJin_-HZJ5HxFqckFZBWHGw@mail.gmail.com>
Subject: Re: How to enable/disable my debug code?
To: narke <narkewoody@gmail.com>
Content-Type: multipart/mixed; boundary=000e0ce0d80ce7901604a90e388e
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 74.125.82.49
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jul 2011 14:54:20 -0000

--000e0ce0d80ce7901604a90e388e
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

>> With a same set of autoconf/automake files, how to I distribute my
>> program that allows user to build it with or without debug code
>> enabled?

> Of course you can write (or find and copy) some Autoconf M4 code to
> do some or all of the above automatically depending on the presence
> of configure options like:
>
> =A0./configure --enable-debug

Attached is a macro that provides logic similar to what was described.
Hope it helps.  The header information is wrong in that it does not
exist in that particular m4 archive-- I need to submit these changes
but haven't gotten the chance.

- Rhys

--000e0ce0d80ce7901604a90e388e
Content-Type: application/octet-stream; name="ax_check_enable_debug.m4"
Content-Disposition: attachment; filename="ax_check_enable_debug.m4"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_gqmeywgn0

IyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT0KIyAgICAgICAgIGh0dHA6Ly9hdXRvY29uZi1hcmNoaXZlLmNy
eXAudG8vYXhfY2hlY2tfZW5hYmxlX2RlYnVnLmh0bWwKIyA9PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KIwoj
IFNZTk9QU0lTCiMKIyAgIENoZWNrIGZvciB0aGUgcHJlc2VuY2Ugb2YgYW4gLS1lbmFibGUtZGVi
dWcgb3B0aW9uIHRvIGNvbmZpZ3VyZSBhbmQKIyAgIGFsbG93L2F2b2lkIGNvbXBpbGVkIGRlYnVn
Z2luZyBmbGFncyBhcHByb3ByaWF0ZWx5LgojCiMgICBBWF9DSEVDS19FTkFCTEVfREVCVUcoW2Vu
YWJsZSBieSBkZWZhdWx0PXllcy9pbmZvL3Byb2ZpbGUvbm9dKQojCiMgREVTQ1JJUFRJT04KIwoj
ICAgQ2hlY2sgZm9yIHRoZSBwcmVzZW5jZSBvZiBhbiAtLWVuYWJsZS1kZWJ1ZyBvcHRpb24gdG8g
Y29uZmlndXJlLCB3aXRoIHRoZQojICAgc3BlY2lmaWVkIGRlZmF1bHQgdmFsdWUgdXNlZCB3aGVu
IHRoZSBvcHRpb24gaXMgbm90IHByZXNlbnQuICBSZXR1cm4gdGhlCiMgICB2YWx1ZSBpbiB0aGUg
dmFyaWFibGUgJGF4X2VuYWJsZV9kZWJ1Zy4KIwojICAgU3BlY2lmeWluZyAneWVzJyBhZGRzICct
ZyAtTzAnIHRvIHRoZSBjb21waWxhdGlvbiBmbGFncyBmb3IgYWxsIGxhbmd1YWdlcy4KIyAgIFNw
ZWNpZnlpbmcgJ2luZm8nIGFkZHMgJy1nJyB0byB0aGUgY29tcGlsYXRpb24gZmxhZ3MuICBTcGVj
aWZ5aW5nICdwcm9maWxlJwojICAgYWRkcyAnLWcgLXBnJyB0byB0aGUgY29tcGlsYXRpb24gZmxh
Z3MgYW5kICctcGcnIHRvIHRoZSBsaW5raW5nIGZsYWdzLgojICAgT3RoZXJ3aXNlLCBub3RoaW5n
IGlzIGFkZGVkLiAgRGVmaW5lIE5ERUJVRyBpZiBkZWJ1ZyBkaXNhYmxlZC4gIElmIGRlYnVnCiMg
ICBub3QgZW5hYmxlZCwgZW5zdXJlIEFDX1BST0dfKiB3aWxsIG5vdCBhZGQgZGVidWdnaW5nIGZs
YWdzLiAgU2hvdWxkIGJlCiMgICBpbnZva2VkIHByaW9yIHRvIGFueSBBQ19QUk9HXyogY29tcGls
ZXIgY2hlY2tzLgojCiMgTEFTVCBNT0RJRklDQVRJT04KIwojICAgMjAxMS0wMy0wOQojCiMgQ09Q
WUxFRlQKIwojICAgQ29weXJpZ2h0IChjKSAyMDExIFJoeXMgVWxlcmljaCA8cmh5cy51bGVyaWNo
QGdtYWlsLmNvbT4KIwojICAgQ29weWluZyBhbmQgZGlzdHJpYnV0aW9uIG9mIHRoaXMgZmlsZSwg
d2l0aCBvciB3aXRob3V0IG1vZGlmaWNhdGlvbiwgYXJlCiMgICBwZXJtaXR0ZWQgaW4gYW55IG1l
ZGl1bSB3aXRob3V0IHJveWFsdHkgcHJvdmlkZWQgdGhlIGNvcHlyaWdodCBub3RpY2UKIyAgIGFu
ZCB0aGlzIG5vdGljZSBhcmUgcHJlc2VydmVkLgoKQUNfREVGVU4oW0FYX0NIRUNLX0VOQUJMRV9E
RUJVR10sWwogICAgQUNfQkVGT1JFKFskMF0sW0FDX1BST0dfQ0NdKWRubAogICAgQUNfQkVGT1JF
KFskMF0sW0FDX1BST0dfQ1hYXSlkbmwKICAgIEFDX0JFRk9SRShbJDBdLFtBQ19QUk9HX0Y3N10p
ZG5sCiAgICBBQ19CRUZPUkUoWyQwXSxbQUNfUFJPR19GQ10pZG5sCgogICAgQUNfTVNHX0NIRUNL
SU5HKHdoZXRoZXIgdG8gZW5hYmxlIGRlYnVnZ2luZykKICAgIG00X2RlZmluZShheF9lbmFibGVf
ZGVidWdfZGVmYXVsdCxbbTRfdG9sb3dlcihtNF9ub3JtYWxpemUoaWZlbHNlKFskMV0sLFtub10s
WyQxXSkpKV0pCiAgICBBQ19BUkdfRU5BQkxFKGRlYnVnLAogICAgICAgIFtBU19IRUxQX1NUUklO
RyhbLS1lbmFibGUtZGVidWddQDw6QD1heF9lbmFibGVfZGVidWdfZGVmYXVsdEA6PkAsW2NvbXBp
bGUgd2l0aCBkZWJ1Z2dpbmc7IG9uZSBvZiB5ZXMvaW5mby9wcm9maWxlL25vXSldLAogICAgICAg
IFtdLGVuYWJsZV9kZWJ1Zz1heF9lbmFibGVfZGVidWdfZGVmYXVsdCkKICAgIGlmIHRlc3QgIngk
ZW5hYmxlX2RlYnVnIiA9ICJ4eWVzIiB8fCB0ZXN0ICJ4JGVuYWJsZV9kZWJ1ZyIgPSAieCI7IHRo
ZW4KICAgICAgICBBQ19NU0dfUkVTVUxUKHllcykKICAgICAgICBDRkxBR1M9IiR7Q0ZMQUdTfSAt
ZyAtTzAiCiAgICAgICAgQ1hYRkxBR1M9IiR7Q1hYRkxBR1N9IC1nIC1PMCIKICAgICAgICBGRkxB
R1M9IiR7RkZMQUdTfSAtZyAtTzAiCiAgICAgICAgRkNGTEFHUz0iJHtGQ0ZMQUdTfSAtZyAtTzAi
CiAgICAgICAgT0JKQ0ZMQUdTPSIke09CSkNGTEFHU30gLWcgLU8wIgogICAgZWxzZQogICAgICAg
IGlmIHRlc3QgIngkZW5hYmxlX2RlYnVnIiA9ICJ4aW5mbyI7IHRoZW4KICAgICAgICAgICAgQUNf
TVNHX1JFU1VMVChpbmZvKQogICAgICAgICAgICBDRkxBR1M9IiR7Q0ZMQUdTfSAtZyIKICAgICAg
ICAgICAgQ1hYRkxBR1M9IiR7Q1hYRkxBR1N9IC1nIgogICAgICAgICAgICBGRkxBR1M9IiR7RkZM
QUdTfSAtZyIKICAgICAgICAgICAgRkNGTEFHUz0iJHtGQ0ZMQUdTfSAtZyIKICAgICAgICAgICAg
T0JKQ0ZMQUdTPSIke09CSkNGTEFHU30gLWciCiAgICAgICAgZWxpZiB0ZXN0ICJ4JGVuYWJsZV9k
ZWJ1ZyIgPSAieHByb2ZpbGUiOyB0aGVuCiAgICAgICAgICAgIEFDX01TR19SRVNVTFQocHJvZmls
ZSkKICAgICAgICAgICAgQ0ZMQUdTPSIke0NGTEFHU30gLWcgLXBnIgogICAgICAgICAgICBDWFhG
TEFHUz0iJHtDWFhGTEFHU30gLWcgLXBnIgogICAgICAgICAgICBGRkxBR1M9IiR7RkZMQUdTfSAt
ZyAtcGciCiAgICAgICAgICAgIEZDRkxBR1M9IiR7RkNGTEFHU30gLWcgLXBnIgogICAgICAgICAg
ICBPQkpDRkxBR1M9IiR7T0JKQ0ZMQUdTfSAtZyAtcGciCiAgICAgICAgICAgIExERkxBR1M9IiR7
TERGTEFHU30gLXBnIgogICAgICAgIGVsc2UKICAgICAgICAgICAgQUNfTVNHX1JFU1VMVChubykK
ICAgICAgICAgICAgZG5sIEVuc3VyZSBBQ19QUk9HX0NDL0NYWC9GNzcvRkMvT0JKQyB3aWxsIG5v
dCBlbmFibGUgZGVidWcgZmxhZ3MKICAgICAgICAgICAgZG5sIGJ5IHNldHRpbmcgYW55IHVuc2V0
IGVudmlyb25tZW50IGZsYWcgdmFyaWFibGVzCiAgICAgICAgICAgIGlmIHRlc3QgIngke0NGTEFH
UytzZXR9IiAhPSAieHNldCI7IHRoZW4KICAgICAgICAgICAgICAgIENGTEFHUz0iIgogICAgICAg
ICAgICBmaQogICAgICAgICAgICBpZiB0ZXN0ICJ4JHtDWFhGTEFHUytzZXR9IiAhPSAieHNldCI7
IHRoZW4KICAgICAgICAgICAgICAgIENYWEZMQUdTPSIiCiAgICAgICAgICAgIGZpCiAgICAgICAg
ICAgIGlmIHRlc3QgIngke0ZGTEFHUytzZXR9IiAhPSAieHNldCI7IHRoZW4KICAgICAgICAgICAg
ICAgIEZGTEFHUz0iIgogICAgICAgICAgICBmaQogICAgICAgICAgICBpZiB0ZXN0ICJ4JHtGQ0ZM
QUdTK3NldH0iICE9ICJ4c2V0IjsgdGhlbgogICAgICAgICAgICAgICAgRkNGTEFHUz0iIgogICAg
ICAgICAgICBmaQogICAgICAgICAgICBpZiB0ZXN0ICJ4JHtPQkpDRkxBR1Mrc2V0fSIgIT0gInhz
ZXQiOyB0aGVuCiAgICAgICAgICAgICAgICBPQkpDRkxBR1M9IiIKICAgICAgICAgICAgZmkKICAg
ICAgICBmaQogICAgICAgIGRubCBhc3NlcnQuaCBpcyBhIE5PUCBpZiBOREVCVUcgaXMgZGVmaW5l
ZCwgc28gZGVmaW5lIGl0LgogICAgICAgIEFDX0RFRklORShOREVCVUcsLFtEZWZpbmUgaWYgZGVi
dWdnaW5nIGlzIGRpc2FibGVkXSkKICAgIGZpCiAgICBheF9lbmFibGVfZGVidWc9JGVuYWJsZV9k
ZWJ1ZwpdKQo=
--000e0ce0d80ce7901604a90e388e--


From MAILER-DAEMON Wed Jul 27 18:45:01 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QmCqb-0004b8-7p
	for mharc-autoconf@gnu.org; Wed, 27 Jul 2011 18:45:01 -0400
Received: from eggs.gnu.org ([140.186.70.92]:46053)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Xochitl_Lunde@tripplite.com>) id 1QmCqY-0004aH-AB
	for autoconf@gnu.org; Wed, 27 Jul 2011 18:44:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <Xochitl_Lunde@tripplite.com>) id 1QmCqX-0007yc-DR
	for autoconf@gnu.org; Wed, 27 Jul 2011 18:44:58 -0400
Received: from va3ehsobe001.messaging.microsoft.com ([216.32.180.11]:46183
	helo=VA3EHSOBE008.bigfish.com) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Xochitl_Lunde@tripplite.com>) id 1QmCqX-0007yO-AX
	for autoconf@gnu.org; Wed, 27 Jul 2011 18:44:57 -0400
Received: from mail160-va3-R.bigfish.com (10.7.14.246) by
	VA3EHSOBE008.bigfish.com (10.7.40.28) with Microsoft SMTP Server id
	14.1.225.22; Wed, 27 Jul 2011 22:14:50 +0000
Received: from mail160-va3 (localhost.localdomain [127.0.0.1])	by
	mail160-va3-R.bigfish.com (Postfix) with ESMTP id 3436310C02D1	for
	<autoconf@gnu.org>; Wed, 27 Jul 2011 22:14:50 +0000 (UTC)
X-SpamScore: 1
X-BigFish: S1(zzzz1202hzzz32i2a8h668h839h944h61h)
X-Forefront-Antispam-Report: CIP:12.233.90.252; KIP:(null); UIP:(null);
	IPVD:NLI; H:mail.tripplite.com; RD:none; EFVD:NLI
Received: from mail160-va3 (localhost.localdomain [127.0.0.1]) by mail160-va3
	(MessageSwitch) id 1311804852595562_22554;
	Wed, 27 Jul 2011 22:14:12 +0000 (UTC)
Received: from VA3EHSMHS029.bigfish.com (unknown [10.7.14.241])	by
	mail160-va3.bigfish.com (Postfix) with ESMTP id AA2E51F0314	for
	<autoconf@gnu.org>; Wed, 27 Jul 2011 22:13:58 +0000 (UTC)
Received: from mail.tripplite.com (12.233.90.252) by VA3EHSMHS029.bigfish.com
	(10.7.99.39) with Microsoft SMTP Server (TLS) id 14.1.225.22;
	Wed, 27 Jul 2011 22:13:53 +0000
Received: from CHI-VS-EXMBX01.tripplite.com ([169.254.2.4]) by
	CHI-VS-EXCAS01.tripplite.com ([172.18.0.61]) with mapi id
	14.01.0270.001; Wed, 27 Jul 2011 17:13:02 -0500
From: Xochitl Lunde <Xochitl_Lunde@tripplite.com>
To: "autoconf@gnu.org" <autoconf@gnu.org>
Subject: Conditionally set CXXFLAGS based on directory via 1 configure.ac?
Thread-Topic: Conditionally set CXXFLAGS based on directory via 1 configure.ac?
Thread-Index: AcxMqnaFuHDg/Y61Stq66/GDlP3L2A==
Date: Wed, 27 Jul 2011 22:13:01 +0000
Message-ID: <93DB215748FC574392DCDFD0D850C12D30DC2A7A@CHI-VS-EXMBX01.tripplite.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [12.233.90.199]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: tripplite.com
X-detected-operating-system: by eggs.gnu.org: Windows 2000 SP2+,
	XP SP1+ (seldom 98)
X-Received-From: 216.32.180.11
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jul 2011 22:44:59 -0000

I have a project like this:

Top Dir (configure.ac, etc.)
  - Source Dir
    -- Lib 1
    -- Lib 2
    -- Main Application
  - Test Dir
    -- Lib 1 Tests
    -- Lib 2 Tests

I need to set -fno-exceptions in everything under "Source Dir".  But I need=
 to have -fexceptions in everything under "Test Dir".

I have tried putting -fexceptions in every Makefile.am under Test Dir.  Thi=
s did not work because apparently -fexceptions is the default.  Everything =
in "Source Dir" still had exceptions.

I thought of having a nested configure for Test Dir, but I don't think that=
's the "right" way to do it.  It would not be very manageable for us to do =
that.

Is there a nice way to conditionally add -fno-exceptions to CXXFLAGS for th=
e "Source Dir" from configure.ac or elsewhere?  I am sure I can go to each =
library under "Source Dir" and put -fno-exceptions in AM_CXXFLAGS, but is t=
here a correct way to do it in configure.ac?

Thanks





From MAILER-DAEMON Wed Jul 27 19:01:14 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QmD6I-0006ub-ST
	for mharc-autoconf@gnu.org; Wed, 27 Jul 2011 19:01:14 -0400
Received: from eggs.gnu.org ([140.186.70.92]:58143)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QmD6G-0006u8-Jr
	for autoconf@gnu.org; Wed, 27 Jul 2011 19:01:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QmD6E-0004p9-8P
	for autoconf@gnu.org; Wed, 27 Jul 2011 19:01:12 -0400
Received: from mx1.redhat.com ([209.132.183.28]:19194)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QmD6E-0004oQ-12
	for autoconf@gnu.org; Wed, 27 Jul 2011 19:01:10 -0400
Received: from int-mx09.intmail.prod.int.phx2.redhat.com
	(int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6RN18Pb001784
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 27 Jul 2011 19:01:08 -0400
Received: from [10.3.113.61] (ovpn-113-61.phx2.redhat.com [10.3.113.61])
	by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id p6RN17K6020380; Wed, 27 Jul 2011 19:01:08 -0400
Message-ID: <4E3098B3.5000301@redhat.com>
Date: Wed, 27 Jul 2011 17:01:07 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11
MIME-Version: 1.0
To: Xochitl Lunde <Xochitl_Lunde@tripplite.com>
Subject: Re: Conditionally set CXXFLAGS based on directory via 1 configure.ac?
References: <93DB215748FC574392DCDFD0D850C12D30DC2A7A@CHI-VS-EXMBX01.tripplite.com>
In-Reply-To: <93DB215748FC574392DCDFD0D850C12D30DC2A7A@CHI-VS-EXMBX01.tripplite.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: "autoconf@gnu.org" <autoconf@gnu.org>
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jul 2011 23:01:13 -0000

On 07/27/2011 04:13 PM, Xochitl Lunde wrote:
> Is there a nice way to conditionally add -fno-exceptions to CXXFLAGS for the "Source Dir" from configure.ac or elsewhere?  I am sure I can go to each library under "Source Dir" and put -fno-exceptions in AM_CXXFLAGS, but is there a correct way to do it in configure.ac?

The nicest way to to this is to not change CXXFLAGS, but to instead 
AC_SUBST two different variables for the difference in which compiler 
options you want (you _did_ test that $CXX supports -fno-exceptions 
before blindly adding it to CXXFLAGS, right?  Not all the world is g++). 
  Then, in the appropriate Makefile.am files, modify AM_CXXFLAGS to 
include the appropriate substituted variables.

See how coreutils does things: in the top level configure.ac, it does an 
AC_SUBST of WERROR_CFLAGS, WARN_CFLAGS, and GNULIB_WARN_CFLAGS - three 
distinct subsets of flags that were all tested on whether they were 
supported by the current compiler, and where WERROR_CFLAGS is 
conditional on whether you requested configure --enable-gcc-warnings. 
Then, src/Makefile.am sets AM_CFLAGS to $(WARN_CFLAGS) $(WERROR_CFLAGS), 
while lib/Makefile.am uses the less-strict AM_CFLAGS += 
$(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS).

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


From MAILER-DAEMON Wed Jul 27 22:22:17 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QmGEr-0004a8-OX
	for mharc-autoconf@gnu.org; Wed, 27 Jul 2011 22:22:17 -0400
Received: from eggs.gnu.org ([140.186.70.92]:51674)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <narkewoody@gmail.com>) id 1QmGEo-0004ZN-QJ
	for autoconf@gnu.org; Wed, 27 Jul 2011 22:22:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <narkewoody@gmail.com>) id 1QmGEn-00008D-0U
	for autoconf@gnu.org; Wed, 27 Jul 2011 22:22:14 -0400
Received: from mail-pz0-f49.google.com ([209.85.210.49]:45816)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <narkewoody@gmail.com>)
	id 1QmGEm-000082-Qg; Wed, 27 Jul 2011 22:22:12 -0400
Received: by pzk33 with SMTP id 33so3134530pzk.8
	for <multiple recipients>; Wed, 27 Jul 2011 19:22:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:content-transfer-encoding;
	bh=N5GEKfjK3zk7L66fPrFMzsgXCq0cO/3hO5N5HlcyvNQ=;
	b=XTeCug1AraWXGafocMKkzJQPaQ7B8v9AzCWznOBnxwdB/uItgGOxvsnuhWaQodjCy7
	MD7a0aoyVunswbMvSVvjpaHXFEFXOAJehqTdQ823BAFE8Ji7FGSI8J3pAKI8N4u3BPMg
	Wm1ji4vzepsW3mOQY3mDlB7EKDx6Fh0D5kIK4=
MIME-Version: 1.0
Received: by 10.68.32.104 with SMTP id h8mr791087pbi.314.1311819730066; Wed,
	27 Jul 2011 19:22:10 -0700 (PDT)
Received: by 10.68.54.169 with HTTP; Wed, 27 Jul 2011 19:22:10 -0700 (PDT)
In-Reply-To: <ADCDD800-8A8B-41B1-8DC0-8418D2BED25D@gnu.org>
References: <CAAsE_udijCfASMj8sr7YOfC5qLTXzJWYmG_KuW7dH8gUERcc4g@mail.gmail.com>
	<7ED9887F-BCEE-433E-ADB0-70C748FBC363@vaughan.pe>
	<CAAsE_ufQBQFjL7qGY-3Wq1QUcAAEkraKLoRYvf7WQeEhP3fN8Q@mail.gmail.com>
	<ADCDD800-8A8B-41B1-8DC0-8418D2BED25D@gnu.org>
Date: Thu, 28 Jul 2011 10:22:10 +0800
Message-ID: <CAAsE_udL6hT3+Bkafe-v+xz1F6qbM7x7rjnuxibt0zTtvP=bTA@mail.gmail.com>
Subject: Re: How to enable/disable my debug code?
From: narke <narkewoody@gmail.com>
To: "Gary V. Vaughan" <gary@gnu.org>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.210.49
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Jul 2011 02:22:16 -0000

On 27 July 2011 21:13, Gary V. Vaughan <gary@gnu.org> wrote:
> On 27 Jul 2011, at 19:22, narke wrote:
>> Hi, Gary
>
> Howdy!
>
>> On 27 July 2011 14:36, Gary V. Vaughan <gary@vaughan.pe> wrote:
>>> On 27 Jul 2011, at 12:56, narke wrote:
>>>> With a same set of autoconf/automake files, how to I distribute my
>>>> program that allows user to build it with or without debug code
>>>> enabled? =A0In my code, there are something like below:
>>>>
>>>> #if (__MY_DEBUG__)
>>>> ...
>>>> #endif
>>>>
>>>> Thanks in advance.
>>>
>>>
>>> For debug builds:
>>>
>>> =A0./configure CFLAGS=3D'-g' CPPFLAGS=3D-D__MY_DEBUG__
>>>
>>
>> For this approach, will it overwrite my already defined flags or just
>> append values to them? =A0It usual that my CPPFLAGS had already set as
>> something like "-I/my/include" in a Makefile.am
>
> If the Makefile.am's have been written correctly (as described in the
> info manual and elsewhere), then CPPFLAGS/CFLAGS/LDFLAGS/etc should not
> be *set* in Makefile.am (although of course they are referenced often)
> because those are in the users' namespace. =A0Instead, Makefile.am should
> be setting required (but not compiler specific!!) options inside
> AM_CPPFLAGS/AM_CFLAGS/AM_LDFLAGS/etc. =A0The info manuals will help you
> here. Anyway, even if Makefile.am sets these flags incorrectly, since
> you set the options at configure time as shown above, you might still
> get away with it, since the configure values are then spliced into the
> generated Makefile's.
>
> Cheers,
> --
> Gary V. Vaughan (gary AT gnu DOT org)
>
>

Gary,

Thanks! Understood.

--=20
Life is the only flaw in an otherwise perfect nonexistence
=A0 =A0 -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 (narkewoody@gmail.com)


From MAILER-DAEMON Thu Jul 28 12:49:14 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QmTlq-0006Io-3U
	for mharc-autoconf@gnu.org; Thu, 28 Jul 2011 12:49:14 -0400
Received: from eggs.gnu.org ([140.186.70.92]:57877)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-autoconf@m.gmane.org>) id 1QmTln-0006Eu-CE
	for autoconf@gnu.org; Thu, 28 Jul 2011 12:49:12 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu-autoconf@m.gmane.org>) id 1QmTle-0001gB-Py
	for autoconf@gnu.org; Thu, 28 Jul 2011 12:49:11 -0400
Received: from lo.gmane.org ([80.91.229.12]:47711)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-autoconf@m.gmane.org>) id 1QmTle-0001fd-JY
	for autoconf@gnu.org; Thu, 28 Jul 2011 12:49:02 -0400
Received: from list by lo.gmane.org with local (Exim 4.69)
	(envelope-from <gnu-autoconf@m.gmane.org>) id 1QmTlc-000829-EA
	for autoconf@gnu.org; Thu, 28 Jul 2011 18:49:00 +0200
Received: from rrcs-24-103-48-205.nyc.biz.rr.com ([24.103.48.205])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <autoconf@gnu.org>; Thu, 28 Jul 2011 18:49:00 +0200
Received: from sds by rrcs-24-103-48-205.nyc.biz.rr.com with local (Gmexim 0.1
	(Debian)) id 1AlnuQ-0007hv-00
	for <autoconf@gnu.org>; Thu, 28 Jul 2011 18:49:00 +0200
X-Injected-Via-Gmane: http://gmane.org/
Mail-Followup-To: autoconf@gnu.org
To: autoconf@gnu.org
From: Sam Steingold <sds@gnu.org>
Subject: --help should not require --srcdir
Date: Thu, 28 Jul 2011 12:48:48 -0400
Organization: disorganization
Lines: 13
Message-ID: <sv39hq4ahb.fsf@smsv2-L.wtc.algo>
Mime-Version: 1.0
Content-Type: text/plain
X-Complaints-To: usenet@dough.gmane.org
X-Gmane-NNTP-Posting-Host: rrcs-24-103-48-205.nyc.biz.rr.com
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
Mail-Copies-To: never
X-Attribution: Sam
X-Disclaimer: You should not expect anyone to agree with me.
Cancel-Lock: sha1:e5wLPg5hLhL/WCo3f31lwUxxS78=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 80.91.229.12
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: sds@gnu.org
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Jul 2011 16:49:12 -0000

Hi,
this should not happen:

$ ./configure --help
configure: error: cannot find sources (lispbibl.d) in . or ..



-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 11.0.60900031
http://openvotingconsortium.org http://mideasttruth.com http://dhimmi.com
http://palestinefacts.org http://iris.org.il http://camera.org
You can have it good, soon or cheap.  Pick two...



From MAILER-DAEMON Thu Jul 28 12:57:29 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QmTtp-0008Ie-5V
	for mharc-autoconf@gnu.org; Thu, 28 Jul 2011 12:57:29 -0400
Received: from eggs.gnu.org ([140.186.70.92]:47192)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QmTtn-0008IY-HY
	for autoconf@gnu.org; Thu, 28 Jul 2011 12:57:28 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QmTtm-0003h0-5J
	for autoconf@gnu.org; Thu, 28 Jul 2011 12:57:27 -0400
Received: from mx1.redhat.com ([209.132.183.28]:59138)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QmTtl-0003gt-Q3
	for autoconf@gnu.org; Thu, 28 Jul 2011 12:57:26 -0400
Received: from int-mx02.intmail.prod.int.phx2.redhat.com
	(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6SGvPrJ021488
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <autoconf@gnu.org>; Thu, 28 Jul 2011 12:57:25 -0400
Received: from [10.3.113.61] (ovpn-113-61.phx2.redhat.com [10.3.113.61])
	by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id p6SGvOkg021195
	for <autoconf@gnu.org>; Thu, 28 Jul 2011 12:57:24 -0400
Message-ID: <4E3194F4.2040904@redhat.com>
Date: Thu, 28 Jul 2011 10:57:24 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11
MIME-Version: 1.0
To: autoconf@gnu.org
Subject: Re: --help should not require --srcdir
References: <sv39hq4ahb.fsf@smsv2-L.wtc.algo>
In-Reply-To: <sv39hq4ahb.fsf@smsv2-L.wtc.algo>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Jul 2011 16:57:28 -0000

On 07/28/2011 10:48 AM, Sam Steingold wrote:
> Hi,
> this should not happen:
>
> $ ./configure --help
> configure: error: cannot find sources (lispbibl.d) in . or ..

While I agree with your sentiment, I can't reproduce it with this amount 
of information.  Can you provide a minimal configure.ac file that 
reproduces this problem, or even a pointer to the project whose 
configure.ac is causing this failure to see if the bug is in that 
configure.ac instead of in autoconf?

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


From MAILER-DAEMON Thu Jul 28 13:05:46 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QmU1q-0001tT-DD
	for mharc-autoconf@gnu.org; Thu, 28 Jul 2011 13:05:46 -0400
Received: from eggs.gnu.org ([140.186.70.92]:58405)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-autoconf@m.gmane.org>) id 1QmU1o-0001tN-B3
	for autoconf@gnu.org; Thu, 28 Jul 2011 13:05:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu-autoconf@m.gmane.org>) id 1QmU1l-0006Gj-D7
	for autoconf@gnu.org; Thu, 28 Jul 2011 13:05:44 -0400
Received: from lo.gmane.org ([80.91.229.12]:60752)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-autoconf@m.gmane.org>) id 1QmU1l-0006Gd-84
	for autoconf@gnu.org; Thu, 28 Jul 2011 13:05:41 -0400
Received: from list by lo.gmane.org with local (Exim 4.69)
	(envelope-from <gnu-autoconf@m.gmane.org>) id 1QmU1k-00018X-AU
	for autoconf@gnu.org; Thu, 28 Jul 2011 19:05:40 +0200
Received: from rrcs-24-103-48-205.nyc.biz.rr.com ([24.103.48.205])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <autoconf@gnu.org>; Thu, 28 Jul 2011 19:05:39 +0200
Received: from sds by rrcs-24-103-48-205.nyc.biz.rr.com with local (Gmexim 0.1
	(Debian)) id 1AlnuQ-0007hv-00
	for <autoconf@gnu.org>; Thu, 28 Jul 2011 19:05:39 +0200
X-Injected-Via-Gmane: http://gmane.org/
Mail-Followup-To: autoconf@gnu.org
To: autoconf@gnu.org
From: Sam Steingold <sds@gnu.org>
Subject: Re: --help should not require --srcdir
Date: Thu, 28 Jul 2011 13:05:24 -0400
Organization: disorganization
Lines: 41
Message-ID: <svy5zi2v57.fsf@smsv2-L.wtc.algo>
References: <sv39hq4ahb.fsf@smsv2-L.wtc.algo> <4E3194F4.2040904@redhat.com>
Mime-Version: 1.0
Content-Type: text/plain
X-Complaints-To: usenet@dough.gmane.org
X-Gmane-NNTP-Posting-Host: rrcs-24-103-48-205.nyc.biz.rr.com
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
Mail-Copies-To: never
X-Attribution: Sam
X-Disclaimer: You should not expect anyone to agree with me.
Cancel-Lock: sha1:pDjIx5IBWG9BDLbzGDjjXT345Qs=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 80.91.229.12
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: sds@gnu.org
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Jul 2011 17:05:45 -0000

> * Eric Blake <roynxr@erqung.pbz> [2011-07-28 10:57:24 -0600]:
>
> On 07/28/2011 10:48 AM, Sam Steingold wrote:
>> this should not happen:
>>
>> $ ./configure --help
>> configure: error: cannot find sources (lispbibl.d) in . or ..
>
> While I agree with your sentiment, I can't reproduce it with this
> amount of information.

how about
/full/path/to/some/configure
or
cp configure /tmp
cd /tmp
./configure

It does not matter that configure is in the current directory.
It could have been copied of linked over from the source tree and
intended to be run by a top-level configure with --srcdir argument.

However, there is no reason for any program to report an error when
given the --help switch, no matter where the program is located.

> Can you provide a minimal configure.ac file that reproduces this
> problem, or even a pointer to the project whose configure.ac is
> causing this failure to see if the bug is in that configure.ac instead
> of in autoconf?

hg clone http://clisp.hg.sourceforge.net:8000/hgroot/clisp/clisp
cd clisp
./configure build-dir
cd build-dir
./configure --help

-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 11.0.60900031
http://www.memritv.org http://mideasttruth.com http://ffii.org
http://honestreporting.com http://www.PetitionOnline.com/tap12009/
Life is like a diaper -- short and loaded.



From MAILER-DAEMON Thu Jul 28 13:35:40 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QmUUm-0005UM-EU
	for mharc-autoconf@gnu.org; Thu, 28 Jul 2011 13:35:40 -0400
Received: from eggs.gnu.org ([140.186.70.92]:55724)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QmUUj-0005UE-RA
	for autoconf@gnu.org; Thu, 28 Jul 2011 13:35:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QmUUe-0004Xd-CU
	for autoconf@gnu.org; Thu, 28 Jul 2011 13:35:37 -0400
Received: from mx1.redhat.com ([209.132.183.28]:45076)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QmUUe-0004XR-1F
	for autoconf@gnu.org; Thu, 28 Jul 2011 13:35:32 -0400
Received: from int-mx09.intmail.prod.int.phx2.redhat.com
	(int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6SHZVEs007494
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <autoconf@gnu.org>; Thu, 28 Jul 2011 13:35:31 -0400
Received: from [10.3.113.61] (ovpn-113-61.phx2.redhat.com [10.3.113.61])
	by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id p6SHZUmc013903
	for <autoconf@gnu.org>; Thu, 28 Jul 2011 13:35:31 -0400
Message-ID: <4E319DE2.2070706@redhat.com>
Date: Thu, 28 Jul 2011 11:35:30 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11
MIME-Version: 1.0
To: autoconf@gnu.org
Subject: Re: --help should not require --srcdir
References: <sv39hq4ahb.fsf@smsv2-L.wtc.algo> <4E3194F4.2040904@redhat.com>
	<svy5zi2v57.fsf@smsv2-L.wtc.algo>
In-Reply-To: <svy5zi2v57.fsf@smsv2-L.wtc.algo>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Jul 2011 17:35:39 -0000

On 07/28/2011 11:05 AM, Sam Steingold wrote:
>> * Eric Blake<roynxr@erqung.pbz>  [2011-07-28 10:57:24 -0600]:
>>
>> On 07/28/2011 10:48 AM, Sam Steingold wrote:
>>> this should not happen:
>>>
>>> $ ./configure --help
>>> configure: error: cannot find sources (lispbibl.d) in . or ..
>>
>> While I agree with your sentiment, I can't reproduce it with this
>> amount of information.
>
> how about
> /full/path/to/some/configure

That should always work.

> or
> cp configure /tmp

That's where things fall apart.  A configure file should not be moved in 
isolation from the rest of its project.  Granted, the --help output in 
that case could still be a bit nicer, maybe along the lines of:

configure: error: cannot find sources (lispbibl.d) in . or ..
This configure script is designed to configure the lisp package,
but only works when this script is located in the same directory as
the source code for that package.

Patches for improving the error condition output are welcome.  But as 
most users won't get into that error condition, I don't see it as a 
pressing bug.

> It does not matter that configure is in the current directory.

Correct - it is always possible to run a configure located in some other 
directory (such as VPATH builds, where you do mkdir build, cd build, 
../configure).

> It could have been copied of linked over from the source tree and
> intended to be run by a top-level configure with --srcdir argument.

Huh?  Configure should not be copied or linked over from the source tree 
into the build tree.  It should always be run from the source tree.

>
> However, there is no reason for any program to report an error when
> given the --help switch, no matter where the program is located.

Yes there is, if the program can do nothing useful in its current 
location.  Just like './configure --help' must also report an error if 
if it encounters a write error trying to output help information to stdout.

>
>> Can you provide a minimal configure.ac file that reproduces this
>> problem, or even a pointer to the project whose configure.ac is
>> causing this failure to see if the bug is in that configure.ac instead
>> of in autoconf?
>
> hg clone http://clisp.hg.sourceforge.net:8000/hgroot/clisp/clisp
> cd clisp
> ./configure build-dir
> cd build-dir
> ./configure --help

Why is build-dir/configure being created?  It seems like you should 
instead be be doing:

cd build-dir
../configure --help

since configure should not be copied into build-dir, but left in srcdir.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


From MAILER-DAEMON Thu Jul 28 14:14:11 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QmV63-0000Kd-5J
	for mharc-autoconf@gnu.org; Thu, 28 Jul 2011 14:14:11 -0400
Received: from eggs.gnu.org ([140.186.70.92]:50483)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-autoconf@m.gmane.org>) id 1QmV60-0000Jw-L7
	for autoconf@gnu.org; Thu, 28 Jul 2011 14:14:09 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu-autoconf@m.gmane.org>) id 1QmV5z-0004p2-6R
	for autoconf@gnu.org; Thu, 28 Jul 2011 14:14:08 -0400
Received: from lo.gmane.org ([80.91.229.12]:56782)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-autoconf@m.gmane.org>) id 1QmV5y-0004ow-N1
	for autoconf@gnu.org; Thu, 28 Jul 2011 14:14:07 -0400
Received: from list by lo.gmane.org with local (Exim 4.69)
	(envelope-from <gnu-autoconf@m.gmane.org>) id 1QmV5x-0007Fn-DG
	for autoconf@gnu.org; Thu, 28 Jul 2011 20:14:05 +0200
Received: from rrcs-24-103-48-205.nyc.biz.rr.com ([24.103.48.205])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <autoconf@gnu.org>; Thu, 28 Jul 2011 20:14:05 +0200
Received: from sds by rrcs-24-103-48-205.nyc.biz.rr.com with local (Gmexim 0.1
	(Debian)) id 1AlnuQ-0007hv-00
	for <autoconf@gnu.org>; Thu, 28 Jul 2011 20:14:05 +0200
X-Injected-Via-Gmane: http://gmane.org/
Mail-Followup-To: autoconf@gnu.org
To: autoconf@gnu.org
From: Sam Steingold <sds@gnu.org>
Subject: Re: --help should not require --srcdir
Date: Thu, 28 Jul 2011 14:13:47 -0400
Organization: disorganization
Lines: 17
Message-ID: <svlivi2rz8.fsf@smsv2-L.wtc.algo>
References: <sv39hq4ahb.fsf@smsv2-L.wtc.algo> <4E3194F4.2040904@redhat.com>
	<svy5zi2v57.fsf@smsv2-L.wtc.algo> <4E319DE2.2070706@redhat.com>
Mime-Version: 1.0
Content-Type: text/plain
X-Complaints-To: usenet@dough.gmane.org
X-Gmane-NNTP-Posting-Host: rrcs-24-103-48-205.nyc.biz.rr.com
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
Mail-Copies-To: never
X-Attribution: Sam
X-Disclaimer: You should not expect anyone to agree with me.
Cancel-Lock: sha1:Dsak1fwohslnDyuKRTvTbMDfqe8=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 80.91.229.12
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: sds@gnu.org
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Jul 2011 18:14:09 -0000

> * Eric Blake <roynxr@erqung.pbz> [2011-07-28 11:35:30 -0600]:
>
>> However, there is no reason for any program to report an error when
>> given the --help switch, no matter where the program is located.
>
> Yes there is, if the program can do nothing useful in its current
> location.

try "ls --help" in an unreadable directory.
it will print help, not report an error saying that the current
directory is not readable.

-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 11.0.60900031
http://www.memritv.org http://honestreporting.com http://iris.org.il
http://www.PetitionOnline.com/tap12009/ http://dhimmi.com
If a cat tells you that you lost your mind, then it is so.



From MAILER-DAEMON Thu Jul 28 14:21:57 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QmVDZ-00015d-7M
	for mharc-autoconf@gnu.org; Thu, 28 Jul 2011 14:21:57 -0400
Received: from eggs.gnu.org ([140.186.70.92]:35728)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QmVDW-00015W-Jx
	for autoconf@gnu.org; Thu, 28 Jul 2011 14:21:55 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QmVDV-0006pC-9X
	for autoconf@gnu.org; Thu, 28 Jul 2011 14:21:54 -0400
Received: from mx1.redhat.com ([209.132.183.28]:60298)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QmVDU-0006oO-Vu
	for autoconf@gnu.org; Thu, 28 Jul 2011 14:21:53 -0400
Received: from int-mx02.intmail.prod.int.phx2.redhat.com
	(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6SILpnC015500
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <autoconf@gnu.org>; Thu, 28 Jul 2011 14:21:52 -0400
Received: from [10.3.113.61] (ovpn-113-61.phx2.redhat.com [10.3.113.61])
	by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id p6SILpZH016728
	for <autoconf@gnu.org>; Thu, 28 Jul 2011 14:21:51 -0400
Message-ID: <4E31A8BF.1070808@redhat.com>
Date: Thu, 28 Jul 2011 12:21:51 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11
MIME-Version: 1.0
To: autoconf@gnu.org
Subject: Re: --help should not require --srcdir
References: <sv39hq4ahb.fsf@smsv2-L.wtc.algo>
	<4E3194F4.2040904@redhat.com>	<svy5zi2v57.fsf@smsv2-L.wtc.algo>
	<4E319DE2.2070706@redhat.com> <svlivi2rz8.fsf@smsv2-L.wtc.algo>
In-Reply-To: <svlivi2rz8.fsf@smsv2-L.wtc.algo>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Jul 2011 18:21:55 -0000

On 07/28/2011 12:13 PM, Sam Steingold wrote:
>> * Eric Blake<roynxr@erqung.pbz>  [2011-07-28 11:35:30 -0600]:
>>
>>> However, there is no reason for any program to report an error when
>>> given the --help switch, no matter where the program is located.
>>
>> Yes there is, if the program can do nothing useful in its current
>> location.
>
> try "ls --help" in an unreadable directory.
> it will print help, not report an error saying that the current
> directory is not readable.

ls is location-independent.  It is designed to run no matter where 
either ls is located or where the current working directory is.

configure is location-dependent.  It is only designed to do something 
useful when located in alongside the sources that it was generated from. 
  However, while it matters in which directory configure lives, it does 
_not_ matter where the current working directory is - you can run 
/path/to/configure, ../configure, or any other construct where a 
correctly-located configure living in an appropriate srcdir, distinct 
from your choice of current working directory.

I don't buy your argument as justification for always making ./configure 
--help succeed, when ./configure was moved out of place.  And I already 
told you that I welcome patches that make configure give nicer error 
messages stating that the script is useless when not located correctly.

Additionally, there's a difference between code that can be run from 
anywhere (configure and ls both fit this) and relocatable code (ls is 
typically relocatable, configure is not).  GNU Coding Standards do not 
require relocatable code, and when you look at packages like gettext 
that provide relocatable binaries, you can see why that is such a 
difficult bonus feature to add.  And even then, while gettext is 
relocatable, it is only relocatable if you move ALL of the helper files 
that the primary binary uses to reside in a parallel directory structure 
similar to where the binary was originally installed.  If you relocate 
the main binary but not the helper scripts and shared libraries, then 
the binary in the new location will not function correctly.  You can 
think of configure scripts in the same manner - they can be invoked from 
anywhere, but if relocated, you must also relocate everything else that 
the script needs for full functionality.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


From MAILER-DAEMON Sat Jul 30 15:04:48 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QnEq8-0004Cd-IV
	for mharc-autoconf@gnu.org; Sat, 30 Jul 2011 15:04:48 -0400
Received: from eggs.gnu.org ([140.186.70.92]:39492)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <nightstrike@gmail.com>) id 1QnEq5-00049R-Bd
	for autoconf@gnu.org; Sat, 30 Jul 2011 15:04:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <nightstrike@gmail.com>) id 1QnEq4-0005yl-FS
	for autoconf@gnu.org; Sat, 30 Jul 2011 15:04:45 -0400
Received: from mail-vw0-f41.google.com ([209.85.212.41]:39598)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <nightstrike@gmail.com>)
	id 1QnEq4-0005yd-CQ; Sat, 30 Jul 2011 15:04:44 -0400
Received: by vwm42 with SMTP id 42so1654991vwm.0
	for <multiple recipients>; Sat, 30 Jul 2011 12:04:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:content-transfer-encoding;
	bh=Rrml0s7BTzFzdrw/efHdPhbDu6WA1krUAcXYbGjZefI=;
	b=XyGbx+qqK0tMcHSQu8ot6M4QboZfppjSKKc2vrzSvjUC6BgTYDQFXI2SaGRu1bzY4E
	TCrqCrxwJox779UbbDAOC5Fay1a2+e9iANaFpxC+JROZSWQWB380Zas6pdtsJaqp37kn
	dms4/wT6mHq0ZKANnyG6Vwo2wMm3QiMsTX0vY=
MIME-Version: 1.0
Received: by 10.52.97.36 with SMTP id dx4mr2689572vdb.481.1312052683006; Sat,
	30 Jul 2011 12:04:43 -0700 (PDT)
Received: by 10.52.167.1 with HTTP; Sat, 30 Jul 2011 12:04:42 -0700 (PDT)
In-Reply-To: <CAAsE_udL6hT3+Bkafe-v+xz1F6qbM7x7rjnuxibt0zTtvP=bTA@mail.gmail.com>
References: <CAAsE_udijCfASMj8sr7YOfC5qLTXzJWYmG_KuW7dH8gUERcc4g@mail.gmail.com>
	<7ED9887F-BCEE-433E-ADB0-70C748FBC363@vaughan.pe>
	<CAAsE_ufQBQFjL7qGY-3Wq1QUcAAEkraKLoRYvf7WQeEhP3fN8Q@mail.gmail.com>
	<ADCDD800-8A8B-41B1-8DC0-8418D2BED25D@gnu.org>
	<CAAsE_udL6hT3+Bkafe-v+xz1F6qbM7x7rjnuxibt0zTtvP=bTA@mail.gmail.com>
Date: Sat, 30 Jul 2011 15:04:42 -0400
Message-ID: <CAF1jjLsExOnCfYaMEajDi28-=dc_FzfPKz12h+jNFP2+2J2Rew@mail.gmail.com>
Subject: Re: How to enable/disable my debug code?
From: NightStrike <nightstrike@gmail.com>
To: narke <narkewoody@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.212.41
Cc: autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jul 2011 19:04:46 -0000

On Wed, Jul 27, 2011 at 10:22 PM, narke <narkewoody@gmail.com> wrote:
>>> On 27 July 2011 14:36, Gary V. Vaughan <gary@vaughan.pe> wrote:
>> because those are in the users' namespace. =A0Instead, Makefile.am shoul=
d
>> be setting required (but not compiler specific!!) options inside
>> AM_CPPFLAGS/AM_CFLAGS/AM_LDFLAGS/etc. =A0The info manuals will help you

How can you have compiler-generic options?  It's not like POSIX says
that -O2 is for optimization, -g is for debug, and -D is for a
commandline define.

Unless I'm completely wrong, and there is in fact some sort of
standard for compiler options other than "do whatever gcc does".

Consider, though, using cl.exe in an msys environment.  That uses /
instead of - for switches, for instance.


From MAILER-DAEMON Sat Jul 30 15:26:28 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QnFB6-00081q-S5
	for mharc-autoconf@gnu.org; Sat, 30 Jul 2011 15:26:28 -0400
Received: from eggs.gnu.org ([140.186.70.92]:45591)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gary@gnu.org>) id 1QnFB4-00081a-Kp
	for autoconf@gnu.org; Sat, 30 Jul 2011 15:26:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gary@gnu.org>) id 1QnFB3-0001gu-Ft
	for autoconf@gnu.org; Sat, 30 Jul 2011 15:26:26 -0400
Received: from caiajhbdcaid.dreamhost.com ([208.97.132.83]:59630
	helo=homiemail-a15.g.dreamhost.com)
	by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <gary@gnu.org>)
	id 1QnFB3-0001gh-Bk
	for autoconf@gnu.org; Sat, 30 Jul 2011 15:26:25 -0400
Received: from homiemail-a15.g.dreamhost.com (localhost [127.0.0.1])
	by homiemail-a15.g.dreamhost.com (Postfix) with ESMTP id 5761176C072;
	Sat, 30 Jul 2011 12:26:24 -0700 (PDT)
Received: from [192.168.1.3] (unknown [180.183.124.95])
	(using TLSv1 with cipher AES128-SHA (128/128 bits))
	(No client certificate requested)
	(Authenticated sender: gary@vaughan.pe)
	by homiemail-a15.g.dreamhost.com (Postfix) with ESMTPSA id 2C64876C06F; 
	Sat, 30 Jul 2011 12:26:22 -0700 (PDT)
Subject: Re: How to enable/disable my debug code?
Mime-Version: 1.0 (Apple Message framework v1244.3)
Content-Type: text/plain; charset=iso-8859-1
From: "Gary V. Vaughan" <gary@gnu.org>
In-Reply-To: <CAF1jjLsExOnCfYaMEajDi28-=dc_FzfPKz12h+jNFP2+2J2Rew@mail.gmail.com>
Date: Sun, 31 Jul 2011 02:26:18 +0700
Content-Transfer-Encoding: 7bit
Message-Id: <19CE5CC8-22C1-4C43-84B6-167574A2A0D1@gnu.org>
References: <CAAsE_udijCfASMj8sr7YOfC5qLTXzJWYmG_KuW7dH8gUERcc4g@mail.gmail.com>
	<7ED9887F-BCEE-433E-ADB0-70C748FBC363@vaughan.pe>
	<CAAsE_ufQBQFjL7qGY-3Wq1QUcAAEkraKLoRYvf7WQeEhP3fN8Q@mail.gmail.com>
	<ADCDD800-8A8B-41B1-8DC0-8418D2BED25D@gnu.org>
	<CAAsE_udL6hT3+Bkafe-v+xz1F6qbM7x7rjnuxibt0zTtvP=bTA@mail.gmail.com>
	<CAF1jjLsExOnCfYaMEajDi28-=dc_FzfPKz12h+jNFP2+2J2Rew@mail.gmail.com>
To: NightStrike <nightstrike@gmail.com>
X-Mailer: Apple Mail (2.1244.3)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.97.132.83
Cc: narke <narkewoody@gmail.com>, autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jul 2011 19:26:27 -0000

On 31 Jul 2011, at 02:04, NightStrike wrote:
> On Wed, Jul 27, 2011 at 10:22 PM, narke <narkewoody@gmail.com> wrote:
>>>> On 27 July 2011 14:36, Gary V. Vaughan <gary@vaughan.pe> wrote:
>>> because those are in the users' namespace.  Instead, Makefile.am should
>>> be setting required (but not compiler specific!!) options inside
>>> AM_CPPFLAGS/AM_CFLAGS/AM_LDFLAGS/etc.  The info manuals will help you
> 
> How can you have compiler-generic options?  It's not like POSIX says
> that -O2 is for optimization, -g is for debug, and -D is for a
> commandline define.
> 
> Unless I'm completely wrong, and there is in fact some sort of
> standard for compiler options other than "do whatever gcc does".

For example:

  AM_CPPFLAGS = -I../gnulib -I../libltdl
  AM_LDFLAGS = -L../libltdl @LIBTHREAD@

As in things that need to be there for your project to build, even if
the user passes flags of their own at make time.

> Consider, though, using cl.exe in an msys environment.  That uses /
> instead of - for switches, for instance.


I would be quite surprised if more that a very few Autotools using
projects compiled in that environment out of the box.

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)


From MAILER-DAEMON Sat Jul 30 19:57:07 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QnJP1-000398-Sy
	for mharc-autoconf@gnu.org; Sat, 30 Jul 2011 19:57:07 -0400
Received: from eggs.gnu.org ([140.186.70.92]:56373)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <nightstrike@gmail.com>) id 1QnJOy-00037v-WA
	for autoconf@gnu.org; Sat, 30 Jul 2011 19:57:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <nightstrike@gmail.com>) id 1QnJOx-00033s-O2
	for autoconf@gnu.org; Sat, 30 Jul 2011 19:57:04 -0400
Received: from mail-vw0-f41.google.com ([209.85.212.41]:64869)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <nightstrike@gmail.com>)
	id 1QnJOx-00033j-Kd; Sat, 30 Jul 2011 19:57:03 -0400
Received: by vwm42 with SMTP id 42so1744956vwm.0
	for <multiple recipients>; Sat, 30 Jul 2011 16:57:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:content-transfer-encoding;
	bh=+Fg7l8f9Po+qhf4vkSwTz5VotLYVQ71ESBdOcSem+zg=;
	b=l2RUu4QDlLnjJtr1nN82aLWSrMvjh644Fvw+DZ34CrJh5WauG54S3zk2+xprv6mZ9O
	9TLQYuNKttEp+L/SiENIaXNifN46d3WfNcbewwLb1D6xHZtkym3bOZPQUbakHBm5EQYF
	j8eGx/Nrl/YABbkZamzBbMNTfoUp666r2lsBU=
MIME-Version: 1.0
Received: by 10.52.25.115 with SMTP id b19mr3080440vdg.414.1312070222609; Sat,
	30 Jul 2011 16:57:02 -0700 (PDT)
Received: by 10.52.167.1 with HTTP; Sat, 30 Jul 2011 16:57:02 -0700 (PDT)
In-Reply-To: <19CE5CC8-22C1-4C43-84B6-167574A2A0D1@gnu.org>
References: <CAAsE_udijCfASMj8sr7YOfC5qLTXzJWYmG_KuW7dH8gUERcc4g@mail.gmail.com>
	<7ED9887F-BCEE-433E-ADB0-70C748FBC363@vaughan.pe>
	<CAAsE_ufQBQFjL7qGY-3Wq1QUcAAEkraKLoRYvf7WQeEhP3fN8Q@mail.gmail.com>
	<ADCDD800-8A8B-41B1-8DC0-8418D2BED25D@gnu.org>
	<CAAsE_udL6hT3+Bkafe-v+xz1F6qbM7x7rjnuxibt0zTtvP=bTA@mail.gmail.com>
	<CAF1jjLsExOnCfYaMEajDi28-=dc_FzfPKz12h+jNFP2+2J2Rew@mail.gmail.com>
	<19CE5CC8-22C1-4C43-84B6-167574A2A0D1@gnu.org>
Date: Sat, 30 Jul 2011 19:57:02 -0400
Message-ID: <CAF1jjLumE6MUh++n3ohqu=f15E2Oh-PnkaD8Uo2heRo=Q-RF1w@mail.gmail.com>
Subject: Re: How to enable/disable my debug code?
From: NightStrike <nightstrike@gmail.com>
To: "Gary V. Vaughan" <gary@gnu.org>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.212.41
Cc: narke <narkewoody@gmail.com>, autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jul 2011 23:57:05 -0000

On Sat, Jul 30, 2011 at 3:26 PM, Gary V. Vaughan <gary@gnu.org> wrote:
> On 31 Jul 2011, at 02:04, NightStrike wrote:
>> On Wed, Jul 27, 2011 at 10:22 PM, narke <narkewoody@gmail.com> wrote:
>>>>> On 27 July 2011 14:36, Gary V. Vaughan <gary@vaughan.pe> wrote:
>>>> because those are in the users' namespace. =A0Instead, Makefile.am sho=
uld
>>>> be setting required (but not compiler specific!!) options inside
>>>> AM_CPPFLAGS/AM_CFLAGS/AM_LDFLAGS/etc. =A0The info manuals will help yo=
u
>>
>> How can you have compiler-generic options? =A0It's not like POSIX says
>> that -O2 is for optimization, -g is for debug, and -D is for a
>> commandline define.
>>
>> Unless I'm completely wrong, and there is in fact some sort of
>> standard for compiler options other than "do whatever gcc does".
>
> For example:
>
> =A0AM_CPPFLAGS =3D -I../gnulib -I../libltdl
> =A0AM_LDFLAGS =3D -L../libltdl @LIBTHREAD@
>
> As in things that need to be there for your project to build, even if
> the user passes flags of their own at make time.

My point was just that there's nothing that forces every compiler to
make "-I<dir>" the way to set the include path.  It happens to be that
way for a few popular ones like icc because people generally just do
what GCC does.  But nothing stops someone from making a compiler where
it uses lowercase i, for instance.  These options HAVE to be compiler
specific.

>
>> Consider, though, using cl.exe in an msys environment. =A0That uses /
>> instead of - for switches, for instance.
>
>
> I would be quite surprised if more that a very few Autotools using
> projects compiled in that environment out of the box.

I'm trying to make that work, actually.  It's very hard.


From MAILER-DAEMON Sun Jul 31 00:19:55 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QnNVL-0005qM-Jw
	for mharc-autoconf@gnu.org; Sun, 31 Jul 2011 00:19:55 -0400
Received: from eggs.gnu.org ([140.186.70.92]:49012)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gary@gnu.org>) id 1QnNVJ-0005qC-75
	for autoconf@gnu.org; Sun, 31 Jul 2011 00:19:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gary@gnu.org>) id 1QnNVH-0008Ld-Ka
	for autoconf@gnu.org; Sun, 31 Jul 2011 00:19:53 -0400
Received: from mailbigip.dreamhost.com ([208.97.132.5]:52043
	helo=homiemail-a15.g.dreamhost.com)
	by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <gary@gnu.org>)
	id 1QnNVH-0008L4-8S
	for autoconf@gnu.org; Sun, 31 Jul 2011 00:19:51 -0400
Received: from homiemail-a15.g.dreamhost.com (localhost [127.0.0.1])
	by homiemail-a15.g.dreamhost.com (Postfix) with ESMTP id 4493F76C069;
	Sat, 30 Jul 2011 21:19:50 -0700 (PDT)
Received: from [192.168.1.3] (unknown [180.183.124.95])
	(using TLSv1 with cipher AES128-SHA (128/128 bits))
	(No client certificate requested)
	(Authenticated sender: gary@vaughan.pe)
	by homiemail-a15.g.dreamhost.com (Postfix) with ESMTPSA id 4275776C065; 
	Sat, 30 Jul 2011 21:19:49 -0700 (PDT)
Subject: Re: How to enable/disable my debug code?
Mime-Version: 1.0 (Apple Message framework v1244.3)
Content-Type: text/plain; charset=iso-8859-1
From: "Gary V. Vaughan" <gary@gnu.org>
In-Reply-To: <CAF1jjLumE6MUh++n3ohqu=f15E2Oh-PnkaD8Uo2heRo=Q-RF1w@mail.gmail.com>
Date: Sun, 31 Jul 2011 11:19:43 +0700
Content-Transfer-Encoding: 7bit
Message-Id: <F520B326-7582-4E70-B2BA-CA6253C4F214@gnu.org>
References: <CAAsE_udijCfASMj8sr7YOfC5qLTXzJWYmG_KuW7dH8gUERcc4g@mail.gmail.com>
	<7ED9887F-BCEE-433E-ADB0-70C748FBC363@vaughan.pe>
	<CAAsE_ufQBQFjL7qGY-3Wq1QUcAAEkraKLoRYvf7WQeEhP3fN8Q@mail.gmail.com>
	<ADCDD800-8A8B-41B1-8DC0-8418D2BED25D@gnu.org>
	<CAAsE_udL6hT3+Bkafe-v+xz1F6qbM7x7rjnuxibt0zTtvP=bTA@mail.gmail.com>
	<CAF1jjLsExOnCfYaMEajDi28-=dc_FzfPKz12h+jNFP2+2J2Rew@mail.gmail.com>
	<19CE5CC8-22C1-4C43-84B6-167574A2A0D1@gnu.org>
	<CAF1jjLumE6MUh++n3ohqu=f15E2Oh-PnkaD8Uo2heRo=Q-RF1w@mail.gmail.com>
To: NightStrike <nightstrike@gmail.com>
X-Mailer: Apple Mail (2.1244.3)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.97.132.5
Cc: narke <narkewoody@gmail.com>, autoconf@gnu.org
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 31 Jul 2011 04:19:54 -0000

On 31 Jul 2011, at 06:57, NightStrike wrote:
> On Sat, Jul 30, 2011 at 3:26 PM, Gary V. Vaughan <gary@gnu.org> wrote:
>> On 31 Jul 2011, at 02:04, NightStrike wrote:
>>> Unless I'm completely wrong, and there is in fact some sort of
>>> standard for compiler options other than "do whatever gcc does".
>> 
>> For example:
>> 
>>  AM_CPPFLAGS = -I../gnulib -I../libltdl
>>  AM_LDFLAGS = -L../libltdl @LIBTHREAD@
>> 
>> As in things that need to be there for your project to build, even if
>> the user passes flags of their own at make time.
> 
> My point was just that there's nothing that forces every compiler to
> make "-I<dir>" the way to set the include path.  It happens to be that
> way for a few popular ones like icc because people generally just do
> what GCC does.  But nothing stops someone from making a compiler where
> it uses lowercase i, for instance.  These options HAVE to be compiler
> specific.

You're not wrong.  But I was answering the original question be stating
that current best practice for Autotools using projects is to separate
the various build and link flags into two groups:

  i) my project won't build without this;
 ii) users might like to set this.

Group (i) goes into the AM_* prefixed automake macros and are set by the
developer in advance of the release; Group (ii) are entirely at the
discretion of the user and can be set arbitrarily at compile and/or
configure time.  That's just the way automake was designed.

>>> Consider, though, using cl.exe in an msys environment.  That uses /
>>> instead of - for switches, for instance.
>> 
>> I would be quite surprised if more that a very few Autotools using
>> projects compiled in that environment out of the box.
> 
> I'm trying to make that work, actually.  It's very hard.

Current best practice in this case is to make a compiler wrapper script
that translates the flags from what Autotools expect to be universally
available (-I, -L etc) into whatever unusual syntax cl.exe might prefer,
and then to pass the wrapper script as CC at configure time.

There is still some hair to untangle if you want Autotools to ship that
wrapper script and/or automatically set CC to use it.  But in principle
it shouldn't be too difficult to solve in the same way that Automake's
`compile` script works around the unportability of '-c -o' - infact it's
not a bad idea to patch `compile`  to take care of any other useful
command line rewriting problems...

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org) 


From MAILER-DAEMON Sun Jul 31 20:18:04 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QngCq-0007lo-By
	for mharc-autoconf@gnu.org; Sun, 31 Jul 2011 20:18:04 -0400
Received: from eggs.gnu.org ([140.186.70.92]:48423)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <julien@trigofacile.com>) id 1QnUtW-0002Ac-Bm
	for autoconf@gnu.org; Sun, 31 Jul 2011 08:13:23 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <julien@trigofacile.com>) id 1QnUtV-0004YI-9r
	for autoconf@gnu.org; Sun, 31 Jul 2011 08:13:22 -0400
Received: from denver.dinauz.org ([91.121.7.193]:49223)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <julien@trigofacile.com>) id 1QnUtV-0004YC-21
	for autoconf@gnu.org; Sun, 31 Jul 2011 08:13:21 -0400
Received: from localhost (localhost.localdomain [127.0.0.1])
	by denver.dinauz.org (Postfix) with ESMTP id 0D7E78160
	for <autoconf@gnu.org>; Sun, 31 Jul 2011 14:13:20 +0200 (CEST)
Received: from denver.dinauz.org ([127.0.0.1])
	by localhost (denver.dinauz.org [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id DHc3wMar2QbG for <autoconf@gnu.org>;
	Sun, 31 Jul 2011 14:13:19 +0200 (CEST)
Received: from MacBook-Pro-de-Julien-Elie.local
	(AAubervilliers-552-1-71-100.w83-200.abo.wanadoo.fr [83.200.70.100])
	by denver.dinauz.org (Postfix) with ESMTPSA id CCBB0805F
	for <autoconf@gnu.org>; Sun, 31 Jul 2011 14:13:19 +0200 (CEST)
Message-ID: <4E3546DF.8050207@trigofacile.com>
Date: Sun, 31 Jul 2011 14:13:19 +0200
From: =?ISO-8859-1?Q?Julien_=C9LIE?= <julien@trigofacile.com>
Organization: TrigoFACILE -- http://www.trigofacile.com/
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.7; fr;
	rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11
MIME-Version: 1.0
To: autoconf@gnu.org
Subject: Use of double parentheses
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 91.121.7.193
X-Mailman-Approved-At: Sun, 31 Jul 2011 20:18:02 -0400
X-BeenThere: autoconf@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussion list for the autoconf build system <autoconf.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf>
List-Post: <mailto:autoconf@gnu.org>
List-Help: <mailto:autoconf-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf>,
	<mailto:autoconf-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 31 Jul 2011 12:13:23 -0000

Hi all,

Reading a generated "configure" file, I see:

# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there.  '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} =3D xset \
  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done


Wouldn't it mean that all '((' present in the "configure" script, and
related to shell commands, should be rewritten to '( ('?

--=20
Julien =C9LIE

=AB Un ami fid=E8le qui parle tr=E8s bien votre langue et toutes les
  langues vivantes : le latin, le grec, le celte, etc. =BB (Ast=E9rix)


