mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Robert Schwebel <r.schwebel@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] determining compiler/libc/target capabilities for monit
Date: Mon, 20 Jan 2014 20:37:58 +0100	[thread overview]
Message-ID: <20140120193758.GA12605@pengutronix.de> (raw)
In-Reply-To: <e2344e7cfc22d1fb132ed15005d4398c@idefix.lespocky.dyndns.org>

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

      parent reply	other threads:[~2014-01-20 19:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-20 16:17 Alexander Dahl
2014-01-20 19:30 ` [ptxdist] [PATCH] monit: add new package Robert Schwebel
2014-01-21  8:51   ` Alexander Dahl
2014-01-21  9:31     ` Michael Olbrich
2014-01-20 19:37 ` Robert Schwebel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140120193758.GA12605@pengutronix.de \
    --to=r.schwebel@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox