diff options
Diffstat (limited to 'gl/m4')
-rw-r--r-- | gl/m4/base64.m4 | 16 | ||||
-rw-r--r-- | gl/m4/floorf.m4 | 62 | ||||
-rw-r--r-- | gl/m4/gnulib-cache.m4 | 4 | ||||
-rw-r--r-- | gl/m4/gnulib-comp.m4 | 12 | ||||
-rw-r--r-- | gl/m4/math_h.m4 | 66 |
5 files changed, 158 insertions, 2 deletions
diff --git a/gl/m4/base64.m4 b/gl/m4/base64.m4 new file mode 100644 index 00000000..24801efa --- /dev/null +++ b/gl/m4/base64.m4 @@ -0,0 +1,16 @@ +# base64.m4 serial 3 +dnl Copyright (C) 2004, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_BASE64], +[ + gl_PREREQ_BASE64 +]) + +# Prerequisites of lib/base64.c. +AC_DEFUN([gl_PREREQ_BASE64], [ + AC_REQUIRE([AC_C_INLINE]) + AC_REQUIRE([AC_C_RESTRICT]) +]) diff --git a/gl/m4/floorf.m4 b/gl/m4/floorf.m4 new file mode 100644 index 00000000..8cdaa946 --- /dev/null +++ b/gl/m4/floorf.m4 @@ -0,0 +1,62 @@ +# floorf.m4 serial 3 +dnl Copyright (C) 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_FLOORF], +[ + AC_REQUIRE([gl_MATH_H_DEFAULTS]) + dnl Persuade glibc <math.h> to declare floorf(). + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + dnl Test whether floorf() is declared. + AC_CHECK_DECLS([floorf], , , [#include <math.h>]) + if test "$ac_cv_have_decl_floorf" = yes; then + dnl Test whether floorf() can be used without libm. + gl_FUNC_FLOORF_LIBS + if test "$FLOORF_LIBM" = "?"; then + dnl Sun C 5.0 on Solaris declares floorf() and has it in the system-wide + dnl libm.so, but not in the libm.so that the compiler uses. + REPLACE_FLOORF=1 + fi + else + REPLACE_FLOORF=1 + fi + if test $REPLACE_FLOORF = 1; then + AC_LIBOBJ([floorf]) + FLOORF_LIBM= + fi + AC_SUBST([REPLACE_FLOORF]) + AC_SUBST([FLOORF_LIBM]) +]) + +# Determines the libraries needed to get the floorf() function. +# Sets FLOORF_LIBM. +AC_DEFUN([gl_FUNC_FLOORF_LIBS], +[ + AC_CACHE_VAL([gl_cv_func_floorf_libm], [ + gl_cv_func_floorf_libm=? + AC_TRY_LINK([ + #ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include <math.h> + float x;], + [x = floorf(x);], + [gl_cv_func_floorf_libm=]) + if test "$gl_cv_func_floorf_libm" = "?"; then + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + AC_TRY_LINK([ + #ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include <math.h> + float x;], + [x = floorf(x);], + [gl_cv_func_floorf_libm="-lm"]) + LIBS="$save_LIBS" + fi + ]) + FLOORF_LIBM="$gl_cv_func_floorf_libm" +]) diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4 index 6da4d657..302dc191 100644 --- a/gl/m4/gnulib-cache.m4 +++ b/gl/m4/gnulib-cache.m4 @@ -15,11 +15,11 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --aux-dir=build-aux --no-libtool --macro-prefix=gl dirname fsusage getaddrinfo gethostname getloadavg getopt gettext mountlist regex vasprintf vsnprintf +# gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --aux-dir=build-aux --no-libtool --macro-prefix=gl base64 dirname floorf fsusage getaddrinfo gethostname getloadavg getopt gettext mountlist regex vasprintf vsnprintf # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) -gl_MODULES([dirname fsusage getaddrinfo gethostname getloadavg getopt gettext mountlist regex vasprintf vsnprintf]) +gl_MODULES([base64 dirname floorf fsusage getaddrinfo gethostname getloadavg getopt gettext mountlist regex vasprintf vsnprintf]) gl_AVOID([]) gl_SOURCE_BASE([gl]) gl_M4_BASE([gl/m4]) diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4 index a17e36ad..85ad2e9d 100644 --- a/gl/m4/gnulib-comp.m4 +++ b/gl/m4/gnulib-comp.m4 @@ -44,6 +44,7 @@ AC_DEFUN([gl_INIT], gl_FUNC_ALLOCA gl_HEADER_ARPA_INET AC_PROG_MKDIR_P + gl_FUNC_BASE64 gl_C_STRTOD gl_CLOEXEC gl_DIRNAME @@ -56,6 +57,8 @@ AC_DEFUN([gl_INIT], gl_FCNTL_SAFER gl_MODULE_INDICATOR([fcntl-safer]) gl_FLOAT_H + gl_FUNC_FLOORF + gl_MATH_MODULE_INDICATOR([floorf]) gl_FSUSAGE gl_GETADDRINFO gl_FUNC_GETHOSTNAME @@ -74,6 +77,7 @@ AC_DEFUN([gl_INIT], AC_DEFINE([GNULIB_MALLOC_GNU], 1, [Define to indicate the 'malloc' module.]) gl_FUNC_MALLOC_POSIX gl_STDLIB_MODULE_INDICATOR([malloc-posix]) + gl_MATH_H gl_MOUNTLIST gl_HEADER_NETINET_IN AC_PROG_MKDIR_P @@ -240,6 +244,8 @@ AC_DEFUN([gl_FILE_LIST], [ lib/alloca.in.h lib/asnprintf.c lib/asprintf.c + lib/base64.c + lib/base64.h lib/basename.c lib/c-strtod.c lib/c-strtod.h @@ -259,6 +265,8 @@ AC_DEFUN([gl_FILE_LIST], [ lib/fd-safer.c lib/float+.h lib/float.in.h + lib/floor.c + lib/floorf.c lib/fsusage.c lib/fsusage.h lib/full-read.c @@ -281,6 +289,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/localcharset.c lib/localcharset.h lib/malloc.c + lib/math.in.h lib/mountlist.c lib/mountlist.h lib/netinet_in.in.h @@ -333,6 +342,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/absolute-header.m4 m4/alloca.m4 m4/arpa_inet_h.m4 + m4/base64.m4 m4/c-strtod.m4 m4/cloexec.m4 m4/codeset.m4 @@ -345,6 +355,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/extensions.m4 m4/fcntl-safer.m4 m4/float_h.m4 + m4/floorf.m4 m4/fstypename.m4 m4/fsusage.m4 m4/getaddrinfo.m4 @@ -376,6 +387,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/longlong.m4 m4/ls-mntd-fs.m4 m4/malloc.m4 + m4/math_h.m4 m4/mountlist.m4 m4/netinet_in_h.m4 m4/nls.m4 diff --git a/gl/m4/math_h.m4 b/gl/m4/math_h.m4 new file mode 100644 index 00000000..dd99e7f2 --- /dev/null +++ b/gl/m4/math_h.m4 @@ -0,0 +1,66 @@ +# math_h.m4 serial 9 +dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_MATH_H], +[ + AC_REQUIRE([gl_MATH_H_DEFAULTS]) + gl_CHECK_NEXT_HEADERS([math.h]) +]) + +AC_DEFUN([gl_MATH_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_MATH_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_MATH_H_DEFAULTS], +[ + GNULIB_CEILF=0; AC_SUBST([GNULIB_CEILF]) + GNULIB_CEILL=0; AC_SUBST([GNULIB_CEILL]) + GNULIB_FLOORF=0; AC_SUBST([GNULIB_FLOORF]) + GNULIB_FLOORL=0; AC_SUBST([GNULIB_FLOORL]) + GNULIB_FREXP=0; AC_SUBST([GNULIB_FREXP]) + GNULIB_FREXPL=0; AC_SUBST([GNULIB_FREXPL]) + GNULIB_ISFINITE=0; AC_SUBST([GNULIB_ISFINITE]) + GNULIB_LDEXPL=0; AC_SUBST([GNULIB_LDEXPL]) + GNULIB_MATHL=0; AC_SUBST([GNULIB_MATHL]) + GNULIB_ROUND=0; AC_SUBST([GNULIB_ROUND]) + GNULIB_ROUNDF=0; AC_SUBST([GNULIB_ROUNDF]) + GNULIB_ROUNDL=0; AC_SUBST([GNULIB_ROUNDL]) + GNULIB_SIGNBIT=0; AC_SUBST([GNULIB_SIGNBIT]) + GNULIB_TRUNC=0; AC_SUBST([GNULIB_TRUNC]) + GNULIB_TRUNCF=0; AC_SUBST([GNULIB_TRUNCF]) + GNULIB_TRUNCL=0; AC_SUBST([GNULIB_TRUNCL]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL]) + HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL]) + HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL]) + HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL]) + HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL]) + HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL]) + HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL]) + HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL]) + HAVE_DECL_SINL=1; AC_SUBST([HAVE_DECL_SINL]) + HAVE_DECL_SQRTL=1; AC_SUBST([HAVE_DECL_SQRTL]) + HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL]) + HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC]) + HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF]) + HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL]) + REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF]) + REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL]) + REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF]) + REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL]) + REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP]) + REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL]) + REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE]) + REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL]) + REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND]) + REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF]) + REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL]) + REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT]) + REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC]) +]) |