[asterisk-bugs] [Asterisk 0011847]: configure does not find floor, pow, rint, sqrt in tgmath.h

noreply at bugs.digium.com noreply at bugs.digium.com
Sun Feb 3 15:24:32 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=11847 
====================================================================== 
Reported By:                pbwolf
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   11847
Category:                   General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 99296 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             01-25-2008 20:55 CST
Last Modified:              02-03-2008 15:24 CST
====================================================================== 
Summary:                    configure does not find floor, pow, rint, sqrt in
tgmath.h
Description: 
configure is not finding floor, pow, rint, or sqrt.

checking for floor... no
checking for pow... no
checking for rint... no
checking for sqrt... no

But they're there:

$ egrep -w "#define (floor|pow|rint|sqrt)" /usr/include/*.h
/usr/include/tgmath.h:#define pow(Val1, Val2) __TGMATH_BINARY_REAL_IMAG
(Val1, Val2, pow, cpow)
/usr/include/tgmath.h:#define sqrt(Val) __TGMATH_UNARY_REAL_IMAG (Val,
sqrt, csqrt)
/usr/include/tgmath.h:#define floor(Val) __TGMATH_UNARY_REAL_ONLY (Val,
floor)
/usr/include/tgmath.h:#define rint(Val) __TGMATH_UNARY_REAL_ONLY (Val,
rint)

====================================================================== 

---------------------------------------------------------------------- 
 pbwolf - 02-03-08 15:24  
---------------------------------------------------------------------- 
Here is a snippet from config.log.  The problem might be that configure is
not using -lm.  Recompiling the "failed program" with the same gcc command
line, plus -lm, works:

$ gcc -o conftest -g -O2 -lm conftest.c  &&  echo ok
a.c:132: warning: conflicting types for built-in function ‘sqrt’
ok



configure:14812: checking for sqrt
configure:14868: gcc -o conftest -g -O2   conftest.c  >&5
conftest.c:132: warning: conflicting types for built-in function 'sqrt'
/tmp/ccyxGR7J.o: In function `main':
/home/pbwolf/phones/asterisk14/conftest.c:143: undefined reference to
`sqrt'
collect2: ld returned 1 exit status
configure:14874: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME "asterisk"
| #define PACKAGE_TARNAME "asterisk"
| #define PACKAGE_VERSION "1.4"
| #define PACKAGE_STRING "asterisk 1.4"
| #define PACKAGE_BUGREPORT "www.asterisk.org"
| #define _GNU_SOURCE 1
| #define STDC_HEADERS 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_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define HAVE_PTHREAD 1
| #define HAVE_ALLOCA_H 1
| #define HAVE_ALLOCA 1
| #define HAVE_DIRENT_H 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_ARPA_INET_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_LIBINTL_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_MALLOC_H 1
| #define HAVE_NETDB_H 1
| #define HAVE_NETINET_IN_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_FILE_H 1
| #define HAVE_SYS_IOCTL_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_SYSLOG_H 1
| #define HAVE_TERMIOS_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_UTIME_H 1
| #define HAVE__BOOL 1
| #define HAVE_STDBOOL_H 1
| #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
| #define TIME_WITH_SYS_TIME 1
| #define HAVE_PTRDIFF_T 1
| #define HAVE_UNISTD_H 1
| #define HAVE_CHOWN 1
| #define HAVE_FORK 1
| #define HAVE_VFORK 1
| #define HAVE_WORKING_VFORK 1
| #define HAVE_WORKING_FORK 1
| #define HAVE_FSEEKO 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_UTIME_H 1
| #define HAVE_ALARM 1
| #define HAVE_STDLIB_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_GETPAGESIZE 1
| #define HAVE_MMAP 1
| #define HAVE_SYS_SELECT_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define SELECT_TYPE_ARG1 int
| #define SELECT_TYPE_ARG234 (fd_set *)
| #define SELECT_TYPE_ARG5 (struct timeval *)
| #define PROTOTYPES 1
| #define __PROTOTYPES 1
| #define RETSIGTYPE void
| #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
| #define HAVE_STRCOLL 1
| #define HAVE_STRFTIME 1
| #define HAVE_UTIME_NULL 1
| #define HAVE_VPRINTF 1
| #define HAVE_ASPRINTF 1
| #define HAVE_ATEXIT 1
| #define HAVE_BZERO 1
| #define HAVE_DUP2 1
| #define HAVE_ENDPWENT 1
| #define HAVE_FTRUNCATE 1
| #define HAVE_GETCWD 1
| #define HAVE_GETHOSTBYNAME 1
| #define HAVE_GETHOSTNAME 1
| #define HAVE_GETLOADAVG 1
| #define HAVE_GETTIMEOFDAY 1
| #define HAVE_INET_NTOA 1
| #define HAVE_ISASCII 1
| #define HAVE_LOCALTIME_R 1
| #define HAVE_MEMCHR 1
| #define HAVE_MEMMOVE 1
| #define HAVE_MEMSET 1
| #define HAVE_MKDIR 1
| #define HAVE_MUNMAP 1
| #define HAVE_PUTENV 1
| #define HAVE_RE_COMP 1
| #define HAVE_REGCOMP 1
| #define HAVE_SELECT 1
| #define HAVE_SETENV 1
| #define HAVE_SOCKET 1
| /* end confdefs.h.  */
| /* Define sqrt to an innocuous variant, in case <limits.h> declares
sqrt.
|    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
| #define sqrt innocuous_sqrt
| 
| /* System header to define __stub macros and hopefully few prototypes,
|     which can conflict with char sqrt (); below.
|     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|     <limits.h> exists even on freestanding compilers.  */
| 
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| 
| #undef sqrt
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char sqrt ();
| /* The GNU C library defines this for functions which it implements
|     to always fail with ENOSYS.  Some functions are actually named
|     something starting with __ and the normal name is an alias.  */
| #if defined __stub_sqrt || defined __stub___sqrt
| choke me
| #endif
| 
| int
| main ()
| {
| return sqrt ();
|   ;
|   return 0;
| }
configure:14892: result: no 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
02-03-08 15:24  pbwolf         Note Added: 0081634                          
======================================================================




More information about the asterisk-bugs mailing list