From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ptx.hi.pengutronix.de ([2001:6f8:1178:2:5054:ff:fec0:8e10] ident=Debian-exim) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1W5KfW-0002He-7Z for ptxdist@pengutronix.de; Mon, 20 Jan 2014 20:37:58 +0100 Received: from rsc by ptx.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1W5KfW-0001RJ-5v for ptxdist@pengutronix.de; Mon, 20 Jan 2014 20:37:58 +0100 Date: Mon, 20 Jan 2014 20:37:58 +0100 From: Robert Schwebel Message-ID: <20140120193758.GA12605@pengutronix.de> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Subject: Re: [ptxdist] determining compiler/libc/target capabilities for monit Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Hi Alexander, On Mon, Jan 20, 2014 at 05:17:20PM +0100, Alexander Dahl wrote: > I'm working on a package for monit [1]. While building fine in a usual > environment things are a little different with cross-compiling it with > ptxdist. I'm using ptxdist 2014.01.0 and OSELAS Toolchain 2012.12.1 > building for armv5te. In the prepare stage aka when ./configure is > called for this autotool using project I get: > > checking sys/filio.h presence... configure: error: cross-compiling: > please set 'libmonit_cv_setjmp_available=yes|no' > no > checking for sys/filio.h... no > checking setjmp is available... configure: error: ./configure failed for > libmonit This is caused by a patch submitted by the buildroot people. They do the right thing here: if you can't determine something at runtime and there is no way to know it beforehand, make it overwritable by a cached variable on configure time. This way a build system, which might know about the result of the check for a certain architecture, can just set the right things. > By setting those variable (and another) I could successfully make the > prepare stage run. This was introduced by monit in release 5.4 to > support cross compilation [2] and it circumvents the test program > compiled in ./configure call using AC_LANG_PROGRAM. Correct. > I'm not happy with this. The change seems like a workaround because > obviously you can not execute those small programms on the target in > this stage. You can't, because in a cross build system, you can't run anything on the target. However, the intention is not to run something, but to find out if the setjmp mechanism is available. According to my understanding, it is always available on glibc based systems. > Would it be possible to automatically get this information > instead of the developer having to set it? It took me quite a while to > verify which settings are correct for my toolchain/libc/target > combination and I do not want to release a package where a developer > would have to set those options. It is in the rules, see my patch I've just sent. > So anyone having experience with autotools and cross-compiling, who can > suggest a technical solution? If yes I would try to get this change > upstream then. I don't think that an upstream patch is necessary. Setting ac_cv_ variables is common practise, grep rules/* for other examples. The only question is if setting the variables unconditionally is the right thing to do. If you like, you can do more research about that. Or just wait if someone complains and sends a patch :-) rsc -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- ptxdist mailing list ptxdist@pengutronix.de