[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fenv.h -- solaris 9, sunpro CC version 5, autoconf (GNU Autoconf) 2
From: |
Akim Demaille |
Subject: |
Re: fenv.h -- solaris 9, sunpro CC version 5, autoconf (GNU Autoconf) 2.57 |
Date: |
Fri, 28 Mar 2003 17:52:03 +0100 |
User-agent: |
Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.2 (gnu/linux) |
Hi!
Thanks for the report, unfortunately, it is about a problem in the
package you were trying to configure, not from Autoconf itself.
Please, forward this bug report to the authors of the package,
together with the following piece of information. Thanks!
Header Present But Cannot Be Compiled
=====================================
The most important guideline to bear in mind when checking for
features is to mimic as much as possible the intended use.
Unfortunately, old versions of `AC_CHECK_HEADER' and `AC_CHECK_HEADERS'
failed to follow this idea, and called the preprocessor, instead of the
compiler, to check for headers. As a result, incompatibilities between
headers went unnoticed during configuration, and maintainers finally
had to deal with this issue elsewhere.
As of Autoconf 2.56 both checks are performed, and `configure'
complains loudly if the compiler and the preprocessor do not agree.
For the time being the result used is that of the preprocessor, to give
maintainers time to adjust their `configure.ac', but in the near
future, only the compiler will be considered.
Consider the following example:
$ cat number.h
typedef int number;
$ cat pi.h
const number pi = 3;
$ cat configure.ac
AC_INIT
AC_CHECK_HEADERS(pi.h)
$ autoconf -Wall
$ ./configure
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking pi.h usability... no
checking pi.h presence... yes
configure: WARNING: pi.h: present but cannot be compiled
configure: WARNING: pi.h: check for missing prerequisite headers?
configure: WARNING: pi.h: proceeding with the preprocessor's result
configure: WARNING: ## ------------------------------------ ##
configure: WARNING: ## Report this to address@hidden ##
configure: WARNING: ## ------------------------------------ ##
checking for pi.h... yes
The proper way the handle this case is using the fourth argument (*note
Generic Headers::):
$ cat configure.ac
AC_INIT
AC_CHECK_HEADERS(number.h pi.h,,,
[[#if HAVE_NUMBER_H
# include <number.h>
#endif
]])
$ autoconf -Wall
$ ./configure
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for number.h... yes
checking for pi.h... yes
----------------------------------------------------------------------
bash-2.05$ autoconf --version
autoconf (GNU Autoconf) 2.57
bash-2.05$ automake --version
automake (GNU automake) 1.7.2
bash-2.05$ ./configure CC=c89 CXX=CC --prefix=/home/greg
...
checking for ieeefp.h... yes
checking fenv.h usability... no
checking fenv.h presence... yes
configure: WARNING: fenv.h: present but cannot be compiled
configure: WARNING: fenv.h: check for missing prerequisite headers?
configure: WARNING: fenv.h: proceeding with the preprocessor's result
configure: WARNING: ## ------------------------------------ ##
configure: WARNING: ## Report this to address@hidden ##
configure: WARNING: ## ------------------------------------ ##
configure.log:
==============
configure:4772: checking fenv.h usability
configure:4785: c89 -c -g conftest.c >&5
"/opt/SUNWspro/SC5.0/include/cc/fenv.h", line 192: syntax error before or at:
fex_handler_t
"/opt/SUNWspro/SC5.0/include/cc/fenv.h", line 192: cannot recover from previous
errors
c89: acomp failed for conftest.c
configure:4788: $? = 2
configure: failed program was:
| #line 4774 "configure"
| /* confdefs.h. */
|
| #define PACKAGE_NAME "lqns"
| #define PACKAGE_TARNAME "lqns"
| #define PACKAGE_VERSION "2.5"
| #define PACKAGE_STRING "lqns 2.5"
| #define PACKAGE_BUGREPORT "address@hidden"
| #define PACKAGE "lqns"
| #define VERSION "2.5"
| #ifdef __cplusplus
| #include <stdlib.h>
| #endif
| #define YYTEXT_POINTER 1
| #define HAVE_LIBM 1
| #define HAVE_LIBM9X 1
| #define HAVE_LIBSUNMATH 1
| #define HAVE_BOOL
| #define STDC_HEADERS 1
| #define HAVE_NAMESPACES
| #define HAVE_STD
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_ERRNO_H 1
| #define HAVE_IEEEFP_H 1
| /* end confdefs.h. */
| #include <stdio.h>
| #if HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #if HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #if STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # if HAVE_STDLIB_H
| # include <stdlib.h>
| # endif
| #endif
| #if HAVE_STRING_H
| # if !STDC_HEADERS && HAVE_MEMORY_H
| # include <memory.h>
| # endif
| # include <string.h>
| #endif
| #if HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #if HAVE_INTTYPES_H
| # include <inttypes.h>
| #else
| # if HAVE_STDINT_H
| # include <stdint.h>
| # endif
| #endif
| #if HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| #include <fenv.h>
configure:4804: result: no
configure:4808: checking fenv.h presence
configure:4819: c89 -E conftest.c
configure:4825: $? = 0
configure:4844: result: yes
configure:4864: WARNING: fenv.h: present but cannot be compiled
configure:4866: WARNING: fenv.h: check for missing prerequisite headers?
configure:4868: WARNING: fenv.h: proceeding with the preprocessor's result
configure:4880: checking for fenv.h
configure:4887: result: yes
configure:4772: checking fcntl.h usability
--------------------------------------------------------------------------------
>From fenv.h...
#if (__STDC__ - 0 != 1 || defined(__EXTENSIONS__))
/*
* Exception handling extensions
*/
#define FEX_NOHANDLER -1
#define FEX_NONSTOP 0
#define FEX_ABORT 1
#define FEX_SIGNAL 2
#define FEX_CUSTOM 3
...
typedef struct fex_handler_data {
int __mode;
void (*__handler)();
} fex_handler_t[FEX_NUM_EXC];
...
#endif /* (__STDC__ - 0 != 1 || defined(__EXTENSIONS__)) */
/*
* Environment as a whole
*/
typedef struct {
fex_handler_t __handlers;
unsigned long __fsr;
} fenv_t;
--------------------------------------------------------------------------------
Mathematical Library Functions feclearexcept(3M)
NAME
feclearexcept, feraiseexcept, fetestexcept, fegetexceptflag,
fesetexceptflag - access floating point exception flags
SYNOPSIS
cc [ flag ... ] file ... -R/opt/SUNWspro/lib
-L/opt/SUNWspro/lib -lm9x [ library ... ]
#include <fenv.h>
void feclearexcept(int excepts);