] )
])
-#serial 62 -*- autoconf -*-
+#serial 63 -*- autoconf -*-
m4_undefine([AC_LANG_SOURCE(C)])
dnl The following is identical to the definition in c.m4
AC_DEFUN([jm_MACROS],
[
- AC_PREREQ(2.56)
+ AC_PREREQ(2.57)
GNU_PACKAGE="GNU $PACKAGE"
AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE",
AC_CHECK_FUNC([fchown], , [AC_LIBOBJ(fchown-stub)])
AC_CHECK_FUNC([lstat], , [AC_LIBOBJ(lstat-stub)])
AC_CHECK_FUNC([readlink], , [AC_LIBOBJ(readlink-stub)])
+ AC_REQUIRE([AM_STDBOOL_H])
])
AC_REQUIRE([jm_PREREQ_GETPAGESIZE])
AC_REQUIRE([jm_PREREQ_HARD_LOCALE])
AC_REQUIRE([jm_PREREQ_HASH])
- AC_REQUIRE([jm_PREREQ_HUMAN])
+ AC_REQUIRE([gl_HUMAN])
AC_REQUIRE([jm_PREREQ_MBSWIDTH])
AC_REQUIRE([jm_PREREQ_MEMCHR])
AC_REQUIRE([jm_PREREQ_PHYSMEM])
AC_REQUIRE([jm_CHECK_DECLS])
])
-# If you use human.c, you need the following files:
-# inttypes.m4 longlong.m4
-AC_DEFUN([jm_PREREQ_HUMAN],
-[
- AC_CHECK_HEADERS(locale.h)
- AC_CHECK_DECLS([getenv])
- AC_CHECK_FUNCS(localeconv)
- AC_REQUIRE([AC_HEADER_STDBOOL])
- AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
-])
-
AC_DEFUN([jm_PREREQ_MEMCHR],
[
AC_CHECK_HEADERS(limits.h stdlib.h bp-sym.h)
AC_HEADER_STDC
])
+# human.m4 serial 3
+dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+AC_DEFUN([gl_HUMAN],
+[
+ dnl Prerequisites of lib/human.h.
+ AC_REQUIRE([AM_STDBOOL_H])
+ AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
+
+ dnl Prerequisites of lib/human.c.
+ AC_CHECK_HEADERS_ONCE(locale.h stdlib.h string.h)
+ AC_CHECK_DECLS_ONCE(getenv)
+ AC_CHECK_FUNCS_ONCE(localeconv)
+])
+
+# Check for stdbool.h that conforms to C99.
+
+# Copyright (C) 2002-2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# Prepare for substituting <stdbool.h> if it is not supported.
+
+AC_DEFUN([AM_STDBOOL_H],
+[
+ AC_REQUIRE([AC_HEADER_STDBOOL])
+
+ # Define two additional variables used in the Makefile substitution.
+
+ if test "$ac_cv_header_stdbool_h" = yes; then
+ STDBOOL_H=''
+ else
+ STDBOOL_H='stdbool.h'
+ fi
+ AC_SUBST([STDBOOL_H])
+
+ if test "$ac_cv_type__Bool" = yes; then
+ HAVE__BOOL=1
+ else
+ HAVE__BOOL=0
+ fi
+ AC_SUBST([HAVE__BOOL])
+])
+
+# This macro is only needed in autoconf <= 2.54. Newer versions of autoconf
+# have this macro built-in.
+
+AC_DEFUN([AC_HEADER_STDBOOL],
+ [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
+ [ac_cv_header_stdbool_h],
+ [AC_TRY_COMPILE(
+ [
+ #include <stdbool.h>
+ #ifndef bool
+ "error: bool is not defined"
+ #endif
+ #ifndef false
+ "error: false is not defined"
+ #endif
+ #if false
+ "error: false is not 0"
+ #endif
+ #ifndef true
+ "error: false is not defined"
+ #endif
+ #if true != 1
+ "error: true is not 1"
+ #endif
+ #ifndef __bool_true_false_are_defined
+ "error: __bool_true_false_are_defined is not defined"
+ #endif
+
+ struct s { _Bool s: 1; _Bool t; } s;
+
+ char a[true == 1 ? 1 : -1];
+ char b[false == 0 ? 1 : -1];
+ char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+ char d[(bool) -0.5 == true ? 1 : -1];
+ bool e = &s;
+ char f[(_Bool) -0.0 == false ? 1 : -1];
+ char g[true];
+ char h[sizeof (_Bool)];
+ char i[sizeof s.t];
+ ],
+ [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
+ [ac_cv_header_stdbool_h=yes],
+ [ac_cv_header_stdbool_h=no])])
+ AC_CHECK_TYPES([_Bool])
+ if test $ac_cv_header_stdbool_h = yes; then
+ AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
+ fi])
+
+#serial 6
+
+dnl From Paul Eggert.
+
+AC_PREREQ(2.52)
+
+# Define intmax_t to long or long long if <inttypes.h> doesn't define.
+
+AC_DEFUN([jm_AC_TYPE_INTMAX_T],
+[
+ AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
+ AC_CHECK_TYPE(intmax_t, ,
+ [test $ac_cv_type_long_long = yes \
+ && ac_type='long long' \
+ || ac_type='long'
+ AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
+ [Define to widest signed type if <inttypes.h> doesn't define.])])
+])
+
+# Define uintmax_t to unsigned long or unsigned long long
+# if <inttypes.h> doesn't define.
+
+AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
+[
+ AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
+ AC_CHECK_TYPE(uintmax_t, ,
+ [test $ac_cv_type_unsigned_long_long = yes \
+ && ac_type='unsigned long long' \
+ || ac_type='unsigned long'
+ AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
+ [Define to widest unsigned type if <inttypes.h> doesn't define.])])
+])
+
+#serial 2
+
+dnl From Paul Eggert.
+
+# Define HAVE_LONG_LONG if 'long long' works.
+
+AC_DEFUN([jm_AC_TYPE_LONG_LONG],
+[
+ AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
+ [AC_TRY_LINK([long long ll = 1; int i = 63;],
+ [long long llmax = (long long) -1;
+ return ll << i | ll >> i | llmax / ll | llmax % ll;],
+ ac_cv_type_long_long=yes,
+ ac_cv_type_long_long=no)])
+ if test $ac_cv_type_long_long = yes; then
+ AC_DEFINE(HAVE_LONG_LONG, 1,
+ [Define if you have the long long type.])
+ fi
+])
+
+# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
+
+AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
+[
+ AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
+ [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
+ [unsigned long long ullmax = (unsigned long long) -1;
+ return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
+ ac_cv_type_unsigned_long_long=yes,
+ ac_cv_type_unsigned_long_long=no)])
+ if test $ac_cv_type_unsigned_long_long = yes; then
+ AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
+ [Define if you have the unsigned long long type.])
+ fi
+])
+
#serial 7
dnl autoconf tests required for use of mbswidth.c
fi
])
-# Check for stdbool.h that conforms to C99.
-
-# Copyright (C) 2002 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-AC_DEFUN([AC_HEADER_STDBOOL],
- [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
- [ac_cv_header_stdbool_h],
- [AC_TRY_COMPILE(
- [
- #include <stdbool.h>
- #ifndef bool
- "error: bool is not defined"
- #endif
- #ifndef false
- "error: false is not defined"
- #endif
- #if false
- "error: false is not 0"
- #endif
- #ifndef true
- "error: false is not defined"
- #endif
- #if true != 1
- "error: true is not 1"
- #endif
- #ifndef __bool_true_false_are_defined
- "error: __bool_true_false_are_defined is not defined"
- #endif
-
- struct s { _Bool s: 1; _Bool t; } s;
-
- char a[true == 1 ? 1 : -1];
- char b[false == 0 ? 1 : -1];
- char c[__bool_true_false_are_defined == 1 ? 1 : -1];
- char d[(bool) -0.5 == true ? 1 : -1];
- bool e = &s;
- char f[(_Bool) -0.0 == false ? 1 : -1];
- char g[true];
- char h[sizeof (_Bool)];
- char i[sizeof s.t];
- ],
- [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
- [ac_cv_header_stdbool_h=yes],
- [ac_cv_header_stdbool_h=no])])
- if test $ac_cv_header_stdbool_h = yes; then
- AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
- fi])
-
# Copyright 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
-#serial 6
-
-dnl From Paul Eggert.
-
-AC_PREREQ(2.52)
-
-# Define intmax_t to long or long long if <inttypes.h> doesn't define.
-
-AC_DEFUN([jm_AC_TYPE_INTMAX_T],
-[
- AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
- AC_CHECK_TYPE(intmax_t, ,
- [test $ac_cv_type_long_long = yes \
- && ac_type='long long' \
- || ac_type='long'
- AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
- [Define to widest signed type if <inttypes.h> doesn't define.])])
-])
-
-# Define uintmax_t to unsigned long or unsigned long long
-# if <inttypes.h> doesn't define.
-
-AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
-[
- AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
- AC_CHECK_TYPE(uintmax_t, ,
- [test $ac_cv_type_unsigned_long_long = yes \
- && ac_type='unsigned long long' \
- || ac_type='unsigned long'
- AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
- [Define to widest unsigned type if <inttypes.h> doesn't define.])])
-])
-
-#serial 2
-
-dnl From Paul Eggert.
-
-# Define HAVE_LONG_LONG if 'long long' works.
-
-AC_DEFUN([jm_AC_TYPE_LONG_LONG],
-[
- AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
- [AC_TRY_LINK([long long ll = 1; int i = 63;],
- [long long llmax = (long long) -1;
- return ll << i | ll >> i | llmax / ll | llmax % ll;],
- ac_cv_type_long_long=yes,
- ac_cv_type_long_long=no)])
- if test $ac_cv_type_long_long = yes; then
- AC_DEFINE(HAVE_LONG_LONG, 1,
- [Define if you have the long long type.])
- fi
-])
-
-# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
-
-AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
-[
- AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
- [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
- [unsigned long long ullmax = (unsigned long long) -1;
- return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
- ac_cv_type_unsigned_long_long=yes,
- ac_cv_type_unsigned_long_long=no)])
- if test $ac_cv_type_unsigned_long_long = yes; then
- AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
- [Define if you have the unsigned long long type.])
- fi
-])
-
#serial 7
AC_DEFUN([jm_FUNC_MEMCMP],