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