diff mbox

[quadmath] PR 46520 [configure.ac] Cache __float128 check and use GCC_TRY_COMPILE_OR_LINK

Message ID 4CFFE054.4080204@net-b.de
State New
Headers show

Commit Message

Tobias Burnus Dec. 8, 2010, 7:45 p.m. UTC
I have actually lost the overview about libquadmath related build 
issues. The PR 46520 talks about build issues due to linkage failing for 
bare irons. However, a couple of patches have been applied.

This patch adds _cv_ to the libquad_have_float128 check, which enables 
caching and thus to override the result. Additionally, I have changed 
AC_TRY_LINK to GCC_TRY_COMPILE_OR_LINK.

I think those changes are useful. However, before I try to make the 
symbol versioning checking part working on bare-iron targets, I would 
like to know whether libquadmath still fails on those.

Is the attached patch OK for committal?

Tobias

Comments

Ralf Wildenhues Dec. 8, 2010, 8:26 p.m. UTC | #1
* Tobias Burnus wrote on Wed, Dec 08, 2010 at 08:45:24PM CET:
> Is the attached patch OK for committal?

With nits addressed, yes.

It would if you could ping remaining build quadmath patches, if any of
them still apply.  Sorry.

Thanks,
Ralf

> 2010-12-08  Tobias Burnus  <burnus@net-b.de>
> 
> 	PR fortran/46520
> 	* configure.ac: Use GCC_TRY_COMPILE_OR_LINK instead of
> 	AC_TRY_LINK and cache libquad_have_float128.

> --- configure.ac	(revision 167583)
> +++ configure.ac	(working copy)
> @@ -150,7 +150,7 @@
>  AM_CONDITIONAL(LIBQUAD_USE_SYMVER_SUN, [test "x$quadmath_use_symver" = xsun])
>  
>  AC_MSG_CHECKING([whether __float128 is supported])

This needs to be a
  AC_CACHE_CHECK([whether ...], [libquad_cv_have_float128],
    [GCC_TRY_COMPILE_OR_LINK([...
    ])])

...
> -  AC_TRY_LINK([
> +  GCC_TRY_COMPILE_OR_LINK([
>      typedef _Complex float __attribute__((mode(TC))) __complex128;
>  
>      __float128 foo (__float128 x)
> @@ -173,21 +173,13 @@
>      foo (1.2Q);
>      bar (1.2Q);
>    ],[
> -    libquad_have_float128=yes
> +    libquad_cv_have_float128=yes
>    ],[
> -    libquad_have_float128=no
> +    libquad_cv_have_float128=no
>  ])

and then you can remove the AC_MSG_RESULT line:

> -AC_MSG_RESULT([$libquad_have_float128])
> +AC_MSG_RESULT([$libquad_cv_have_float128])
> +AM_CONDITIONAL(BUILD_LIBQUADMATH, [test "x$libquad_cv_have_float128" = xyes])
>  
> -dnl
> -dnl Enable the following for a stand-alone library:
> -dnl
> -dnl if test $libquad_have_float128 = no; then
> -dnl   AC_MSG_ERROR([__float128 support is required to build this library.])
> -dnl fi
> -
> -AM_CONDITIONAL(BUILD_LIBQUADMATH, [test "x$libquad_have_float128" = xyes])
> -
>  AC_CACHE_SAVE
>  
>  if test ${multilib} = yes; then
diff mbox

Patch

2010-12-08  Tobias Burnus  <burnus@net-b.de>

	PR fortran/46520
	* configure.ac: Use GCC_TRY_COMPILE_OR_LINK instead of
	AC_TRY_LINK and cache libquad_have_float128.
	* configure: Regenerate.

Index: configure.ac
===================================================================
--- configure.ac	(revision 167583)
+++ configure.ac	(working copy)
@@ -150,7 +150,7 @@ 
 AM_CONDITIONAL(LIBQUAD_USE_SYMVER_SUN, [test "x$quadmath_use_symver" = xsun])
 
 AC_MSG_CHECKING([whether __float128 is supported])
-  AC_TRY_LINK([
+  GCC_TRY_COMPILE_OR_LINK([
     typedef _Complex float __attribute__((mode(TC))) __complex128;
 
     __float128 foo (__float128 x)
@@ -173,21 +173,13 @@ 
     foo (1.2Q);
     bar (1.2Q);
   ],[
-    libquad_have_float128=yes
+    libquad_cv_have_float128=yes
   ],[
-    libquad_have_float128=no
+    libquad_cv_have_float128=no
 ])
-AC_MSG_RESULT([$libquad_have_float128])
+AC_MSG_RESULT([$libquad_cv_have_float128])
+AM_CONDITIONAL(BUILD_LIBQUADMATH, [test "x$libquad_cv_have_float128" = xyes])
 
-dnl
-dnl Enable the following for a stand-alone library:
-dnl
-dnl if test $libquad_have_float128 = no; then
-dnl   AC_MSG_ERROR([__float128 support is required to build this library.])
-dnl fi
-
-AM_CONDITIONAL(BUILD_LIBQUADMATH, [test "x$libquad_have_float128" = xyes])
-
 AC_CACHE_SAVE
 
 if test ${multilib} = yes; then