autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: could not setup config headers machinery


From: Dr. David Kirkby
Subject: Re: could not setup config headers machinery
Date: Sat, 23 Oct 2010 17:25:11 +0100
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.1.7) Gecko/20100214 Thunderbird/3.0.1

On 10/14/10 09:02 PM, Ralf Wildenhues wrote:
Hello David,

* Dr. David Kirkby wrote on Tue, Oct 12, 2010 at 09:53:46PM CEST:
I'm trying to sort out why the latest version of the GNU Scientific Library 
(GSL)

does not build properly on some AIX systems (the developers are aware of it).

I need to check if 'fprnd_t' is defined in float.h or not.

Is there any particular trick needed to check for things in float.h?

The *only* change I've made is this single line in configure.ac

AC_CHECK_DECLS([fprnd_t],[],[],[[#include<float.h>]])

But after running will always cause the generated configure script
to fail to execute properly - see below. Notice it does not find
'fprnd_t', (on the second line) but then later generates an error.
[...]

Can you send 'diff -u' of the two configure files (without above line
and with)?  Of even of the one with float.h and the one with math.h?


Sure. First here's the diff between the configure.ac files

address@hidden:~/gsl-1.14$ diff -u configure.ac.orig configure.ac.float
--- configure.ac.orig   Wed Mar 10 10:57:12 2010
+++ configure.ac.float  Sat Oct 23 16:54:20 2010
@@ -197,6 +197,7 @@
 AC_CHECK_DECLS(atanh,,,[#include <math.h>])
 AC_CHECK_DECLS(ldexp,,,[#include <math.h>])
 AC_CHECK_DECLS(frexp,,,[#include <math.h>])
+AC_CHECK_DECLS([fprnd_t],[],[],[[#include <float.h>]])
 AC_CHECK_DECLS(isinf,,,[#include <math.h>])
 AC_CHECK_DECLS(isfinite,,,[#include <math.h>])
 AC_CHECK_DECLS(finite,,,[#include <math.h>

And here's the resulting diff in the generated configure scripts.



address@hidden:~/gsl-1.14$ diff -u configure.orig configure.float
--- configure.orig      Sat Oct 23 16:50:30 2010
+++ configure.float     Sat Oct 23 16:55:16 2010
@@ -11933,6 +11933,18 @@
 #define HAVE_DECL_FREXP $ac_have_decl
 _ACEOF

+ac_fn_c_check_decl "$LINENO" "fprnd_t" "ac_cv_have_decl_fprnd_t" "#include <float.h>
+"
+if test "x$ac_cv_have_decl_fprnd_t" = x""yes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FPRND_T $ac_have_decl
+_ACEOF
+
 ac_fn_c_check_decl "$LINENO" "isinf" "ac_cv_have_decl_isinf" "#include <math.h>
 "
 if test "x$ac_cv_have_decl_isinf" = x""yes; then :


Conversely, if I change it to

AC_CHECK_DECLS([fprnd_t],[],[],[[#include<math.h>]])

then the configure script works. But checking in math.h is not a lot
of use when I want to check in float.h

If that line really is the cause of the issues you're seeing (rather
than some other circumstance), then the diff should provide a strong
hint.

What is also interesting is the difference between that which looks in the math.h file and that which looks in the float.h file:

i.e.

address@hidden:~/gsl-1.14$ diff -u configure.ac.math configure.ac.float
--- configure.ac.math   Sat Oct 23 16:55:44 2010
+++ configure.ac.float  Sat Oct 23 16:54:20 2010
@@ -197,7 +197,7 @@
 AC_CHECK_DECLS(atanh,,,[#include <math.h>])
 AC_CHECK_DECLS(ldexp,,,[#include <math.h>])
 AC_CHECK_DECLS(frexp,,,[#include <math.h>])
-AC_CHECK_DECLS([fprnd_t],[],[],[[#include <math.h>]])
+AC_CHECK_DECLS([fprnd_t],[],[],[[#include <float.h>]])
 AC_CHECK_DECLS(isinf,,,[#include <math.h>])
 AC_CHECK_DECLS(isfinite,,,[#include <math.h>])
 AC_CHECK_DECLS(finite,,,[#include <math.h>
address@hidden:~/gsl-1.14$


gives the expected change in the output file.

address@hidden:~/gsl-1.14$ diff -u configure.math configure.float
--- configure.math      Sat Oct 23 16:55:58 2010
+++ configure.float     Sat Oct 23 16:55:16 2010
@@ -11933,7 +11933,7 @@
 #define HAVE_DECL_FREXP $ac_have_decl
 _ACEOF

-ac_fn_c_check_decl "$LINENO" "fprnd_t" "ac_cv_have_decl_fprnd_t" "#include 
<math.h>
+ac_fn_c_check_decl "$LINENO" "fprnd_t" "ac_cv_have_decl_fprnd_t" "#include <float.h>
 "
 if test "x$ac_cv_have_decl_fprnd_t" = x""yes; then :
   ac_have_decl=1


Could this be a gcc bug, which is actually causing the configure script to fail?

The reason I'm thinking this is because it seems to be a gcc bug that the fprnd_t is not being defined on the AIX system. If fprnd_t was defineded properly, I would not need to be testing for this at all. It seems a bug thats it not defined, since it is clearly defined in /usr/include/float.h


-bash-4.1$ grep fprnd_t  /usr/include/float.h
typedef unsigned short fprnd_t;
fprnd_t fp_read_rnd();
fprnd_t fp_swap_rnd();
fprnd_t fp_read_rnd(void);
fprnd_t fp_swap_rnd(fprnd_t rnd);


but it does not appear in the header file gcc is using.

-bash-4.1$ find /opt/pware -name float.h
/opt/pware/include/c++/4.2.4/tr1/float.h
/opt/pware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.4/include/float.h
/opt/pware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.4/install-tools/include/float.h
-bash-4.1$ grep fprnd_t  /opt/pware/include/c++/4.2.4/tr1/float.h
-bash-4.1$ grep fprnd_t /opt/pware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.4/include/float.h -bash-4.1$ grep fprnd_t /opt/pware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.4/install-tools/include/float.h
-bash-4.1$

It looks to me like this is a gcc bug, but I'm puzzled why it can result in a problem with the autoconf generated script.

Thanks,
Ralf

Dave



reply via email to

[Prev in Thread] Current Thread [Next in Thread]