patches/eglibc/2_15/110-aclocal-LIBC_TRY_CC_OPTION.patch
author Matthieu Crapet <mcrapet@gmail.com>
Wed Jun 06 12:03:12 2012 +0200 (2012-06-06)
changeset 2991 252ade1e9e17
permissions -rw-r--r--
libc/eglibc: fix missing LIBC_TRY_CC_OPTION definition (eglibc 2.15)

Upstream SVN is currently broken:
http://www.eglibc.org/svn/branches/eglibc-2_15/libc/

LIBC_TRY_CC_OPTION macro is not defined in aclocal.m4.
This patch fix the configure script.

Once upstream branch will be fixed this patch could be reverted.

Related patch (committed to eglibc trunk):
Use autoconf macro for testing compiler options with empty input
http://sourceware.org/ml/libc-alpha/2012-03/msg00816.html

Signed-off-by: Matthieu Crapet <mcrapet@gmail.com>

diff -r 1f6c8e4b2b92 -r d10afc5bcc25
patches/eglibc/2_15/110-aclocal-LIBC_TRY_CC_OPTION.patch
     1 Define missing LIBC_TRY_CC_OPTION macro
     2 
     3 diff --git a/aclocal.m4 b/aclocal.m4
     4 index 86c07f7..32e9266 100644
     5 --- a/aclocal.m4
     6 +++ b/aclocal.m4
     7 @@ -88,6 +88,12 @@ else
     8  fi
     9  rm -fr contest*])
    10 
    11 +dnl Test a compiler option or options with an empty input file.
    12 +dnl LIBC_TRY_CC_OPTION([options], [action-if-true], [action-if-false])
    13 +AC_DEFUN([LIBC_TRY_CC_OPTION],
    14 +[AS_IF([AC_TRY_COMMAND([${CC-cc} $1 -xc /dev/null -S -o /dev/null])],
    15 + [$2], [$3])])
    16 +
    17  AC_DEFUN([LIBC_PROG_BINUTILS],
    18  [# Was a --with-binutils option given?
    19  if test -n "$path_binutils"; then
    20 diff --git a/configure b/configure
    21 index fc6abe6..196a214 100755
    22 --- a/configure
    23 +++ b/configure
    24 @@ -7698,7 +7698,14 @@ if test "${libc_cv_cc_nofma+set}" = set; then
    25  else
    26    libc_cv_cc_nofma=
    27  for opt in -ffp-contract=off -mno-fused-madd; do
    28 -  LIBC_TRY_CC_OPTION($opt, libc_cv_cc_nofma=$opt; break)
    29 +  if { ac_try='${CC-cc} $opt -xc /dev/null -S -o /dev/null'
    30 +  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
    31 +  (eval $ac_try) 2>&5
    32 +  ac_status=$?
    33 +  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    34 +  test $ac_status = 0; }; }; then :
    35 +  libc_cv_cc_nofma=$opt; break
    36 +fi
    37  done
    38  fi
    39  { $as_echo "$as_me:$LINENO: result: $libc_cv_cc_nofma" >&5
    40 diff --git a/configure.in b/configure.in
    41 index 09cbeea..7ccc802 100644
    42 --- a/configure.in
    43 +++ b/configure.in
    44 @@ -2216,10 +2216,9 @@ if test -n "$submachine"; then
    45  		 libc_cv_cc_submachine, [dnl
    46    libc_cv_cc_submachine=no
    47    for opt in "-march=$submachine" "-mcpu=$submachine"; do
    48 -    if AC_TRY_COMMAND([${CC-cc} $opt -xc /dev/null -S -o /dev/null]); then
    49 +    LIBC_TRY_CC_OPTION([$opt], [
    50        libc_cv_cc_submachine="$opt"
    51 -      break
    52 -    fi
    53 +      break], [])
    54    done])
    55    if test "x$libc_cv_cc_submachine" = xno; then
    56      AC_MSG_ERROR([${CC-cc} does not support $submachine])