git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: autoconf: C99 format check

From
RWRalf Wildenhues <ralf.wildenhues@gmx.de>
Date
Jan 16, 2009, 09:41 UTC
Message-ID
<20090116094110.GD25275@ins.uni-bonn.de>
In-Reply-To
<loom.20090115T123123-915@post.gmane.org>
Hello Julius,
* Julius Naperkowski wrote on Thu, Jan 15, 2009 at 02:22:54PM CET:
> I am trying to cross-compile git for mips on a x86 host. But it seems that it is
> impossible to pass the C99 Format check in the configure script when
> cross_compile mode is activated because the script quits even before it starts
> the testprogramm. Is this behavior intentional?

Cross compilation assumes that test programs can be compiled and linked, but not executed on the build system, i.e., at configure time. The fourth argument of AC_RUN_IFELSE may be used to set a default test result value in the cross compilation case, typically either a pessimistic default, or one based on $host or so (using $host requires AC_CANONICAL_HOST, and the config.{guess,sub} scripts).

As a workaround, you the user can pass preset results if you know what
features the host system will have, to configure.  git's configure
script uses three runtime tests.  You can set them with something like
  ./configure ac_cv_c_c99_format=yes \
              ac_cv_fread_reads_directories=no \
              ac_cv_snprintf_returns_bogus=no --host=... ...

although I'm not quite sure if uclibc's *printf functions indeed do support C99 size specifiers (I think they do though).

I can post a patch to add sane default settings for AC_RUN_IFELSE in cross compile setups, this weekend.

Cheers, Ralf

Previous: Julius NaperkowskiNext: Ralf Wildenhues
Message 2 of 8 in “autoconf: C99 format check”
  1. Julius NaperkowskiJan 15, 2009
  2. Ralf WildenhuesJan 16, 2009
  3. Provide pessimistic defaults for cross compilation tests.Ralf Wildenhues, Jan 19, 2009
  4. Johannes SchindelinJan 19, 2009
  5. Junio C HamanoJan 20, 2009
  6. Ralf WildenhuesJan 20, 2009
  7. Junio C HamanoJan 20, 2009
  8. Ralf WildenhuesJan 20, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.