From: Bertrand Jacquin <beber@meleeweb.net>
To: kerolasa@gmail.com
Cc: util-linux <util-linux@vger.kernel.org>
Subject: Re: [pull] require C99, add robustness and small fixes
Date: Sun, 10 Jun 2012 23:46:42 +0200 [thread overview]
Message-ID: <20120610214642.GB25482@lemonhead.scabb> (raw)
In-Reply-To: <CAG27Bk1p9gqdiZSjmHcsWvTTs9WKU=vx0dYvtZVLCGJ1iuAnyg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1127 bytes --]
Hi,
> --- a/configure.ac
> +++ b/configure.ac
> @@ -80,6 +80,24 @@ AC_CANONICAL_HOST
> AC_C_CONST
> AC_C_VOLATILE
> AC_C_BIGENDIAN
> +if test "$cross_compiling" = no; then
> + if test "x$ac_cv_prog_cc_c99" = "xno" || test "x$ac_cv_prog_cc_c99"
> = "x"; then
> + # We might be on RHEL5 with a git checkout and so broken
> + # autoconf. Check if CC is gcc and if it bails when given -std=gnu99.
> + # If not, use that. Yuck.
> + if test "x$ac_cv_c_compiler_gnu" = "xyes"; then
> + CC="$CC -std=gnu99"
> + AC_RUN_IFELSE(
> + [AC_LANG_PROGRAM([],[[
> + return 0;
> + ]])],
> + [],
> + [AC_MSG_ERROR([Could not find a C99 compatible compiler])])
> + else
> + AC_MSG_ERROR([Could not find a C99 compatible compiler])
> + fi
> + fi
> +fi
This break cross compiling as in this case -std=gnu99 is not added to
$CC. Why not use AC_PROG_CC_C99 (present in autoconf-2.69) that is cross
compiling friendly and set CC to the correct value depending on which
compiler is used (GCC, AIX, HP ...)
I advise you to read autoconf/c.m4.
--
Beber
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2012-06-10 21:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-10 21:11 [pull] require C99, add robustness and small fixes Sami Kerola
2012-06-10 21:46 ` Bertrand Jacquin [this message]
2012-06-11 9:48 ` Karel Zak
2012-06-11 20:19 ` Sami Kerola
2012-06-15 10:46 ` Karel Zak
2012-06-15 11:19 ` Karel Zak
2012-06-11 22:29 ` Bertrand Jacquin
2012-06-12 8:36 ` Karel Zak
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=20120610214642.GB25482@lemonhead.scabb \
--to=beber@meleeweb.net \
--cc=kerolasa@gmail.com \
--cc=util-linux@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).