Blame glm4/gnulib-common.m4

rpm-build 858c0f
# gnulib-common.m4 serial 38
rpm-build 858c0f
dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
rpm-build 858c0f
dnl This file is free software; the Free Software Foundation
rpm-build 858c0f
dnl gives unlimited permission to copy and/or distribute it,
rpm-build 858c0f
dnl with or without modifications, as long as this notice is preserved.
rpm-build 858c0f
rpm-build 858c0f
# gl_COMMON
rpm-build 858c0f
# is expanded unconditionally through gnulib-tool magic.
rpm-build 858c0f
AC_DEFUN([gl_COMMON], [
rpm-build 858c0f
  dnl Use AC_REQUIRE here, so that the code is expanded once only.
rpm-build 858c0f
  AC_REQUIRE([gl_00GNULIB])
rpm-build 858c0f
  AC_REQUIRE([gl_COMMON_BODY])
rpm-build 858c0f
])
rpm-build 858c0f
AC_DEFUN([gl_COMMON_BODY], [
rpm-build 858c0f
  AH_VERBATIM([_Noreturn],
rpm-build 858c0f
[/* The _Noreturn keyword of C11.  */
rpm-build 858c0f
#if ! (defined _Noreturn \
rpm-build 858c0f
       || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
rpm-build 858c0f
# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
rpm-build 858c0f
      || 0x5110 <= __SUNPRO_C)
rpm-build 858c0f
#  define _Noreturn __attribute__ ((__noreturn__))
rpm-build 858c0f
# elif defined _MSC_VER && 1200 <= _MSC_VER
rpm-build 858c0f
#  define _Noreturn __declspec (noreturn)
rpm-build 858c0f
# else
rpm-build 858c0f
#  define _Noreturn
rpm-build 858c0f
# endif
rpm-build 858c0f
#endif
rpm-build 858c0f
])
rpm-build 858c0f
  AH_VERBATIM([isoc99_inline],
rpm-build 858c0f
[/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
rpm-build 858c0f
   the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
rpm-build 858c0f
   earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
rpm-build 858c0f
   __APPLE__ && __MACH__ test for Mac OS X.
rpm-build 858c0f
   __APPLE_CC__ tests for the Apple compiler and its version.
rpm-build 858c0f
   __STDC_VERSION__ tests for the C99 mode.  */
rpm-build 858c0f
#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
rpm-build 858c0f
# define __GNUC_STDC_INLINE__ 1
rpm-build 858c0f
#endif])
rpm-build 858c0f
  AH_VERBATIM([unused_parameter],
rpm-build 858c0f
[/* Define as a marker that can be attached to declarations that might not
rpm-build 858c0f
    be used.  This helps to reduce warnings, such as from
rpm-build 858c0f
    GCC -Wunused-parameter.  */
rpm-build 858c0f
#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
rpm-build 858c0f
# define _GL_UNUSED __attribute__ ((__unused__))
rpm-build 858c0f
#else
rpm-build 858c0f
# define _GL_UNUSED
rpm-build 858c0f
#endif
rpm-build 858c0f
/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
rpm-build 858c0f
   is a misnomer outside of parameter lists.  */
rpm-build 858c0f
#define _UNUSED_PARAMETER_ _GL_UNUSED
rpm-build 858c0f
rpm-build 858c0f
/* gcc supports the "unused" attribute on possibly unused labels, and
rpm-build 858c0f
   g++ has since version 4.5.  Note to support C++ as well as C,
rpm-build 858c0f
   _GL_UNUSED_LABEL should be used with a trailing ;  */
rpm-build 858c0f
#if !defined __cplusplus || __GNUC__ > 4 \
rpm-build 858c0f
    || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
rpm-build 858c0f
# define _GL_UNUSED_LABEL _GL_UNUSED
rpm-build 858c0f
#else
rpm-build 858c0f
# define _GL_UNUSED_LABEL
rpm-build 858c0f
#endif
rpm-build 858c0f
rpm-build 858c0f
/* The __pure__ attribute was added in gcc 2.96.  */
rpm-build 858c0f
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
rpm-build 858c0f
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
rpm-build 858c0f
#else
rpm-build 858c0f
# define _GL_ATTRIBUTE_PURE /* empty */
rpm-build 858c0f
#endif
rpm-build 858c0f
rpm-build 858c0f
/* The __const__ attribute was added in gcc 2.95.  */
rpm-build 858c0f
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
rpm-build 858c0f
# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
rpm-build 858c0f
#else
rpm-build 858c0f
# define _GL_ATTRIBUTE_CONST /* empty */
rpm-build 858c0f
#endif
rpm-build 858c0f
])
rpm-build 858c0f
  dnl Preparation for running test programs:
rpm-build 858c0f
  dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
rpm-build 858c0f
  dnl to /dev/tty, so they can be redirected to log files.  Such diagnostics
rpm-build 858c0f
  dnl arise e.g., in the macros gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N.
rpm-build 858c0f
  LIBC_FATAL_STDERR_=1
rpm-build 858c0f
  export LIBC_FATAL_STDERR_
rpm-build 858c0f
])
rpm-build 858c0f
rpm-build 858c0f
# gl_MODULE_INDICATOR_CONDITION
rpm-build 858c0f
# expands to a C preprocessor expression that evaluates to 1 or 0, depending
rpm-build 858c0f
# whether a gnulib module that has been requested shall be considered present
rpm-build 858c0f
# or not.
rpm-build 858c0f
m4_define([gl_MODULE_INDICATOR_CONDITION], [1])
rpm-build 858c0f
rpm-build 858c0f
# gl_MODULE_INDICATOR_SET_VARIABLE([modulename])
rpm-build 858c0f
# sets the shell variable that indicates the presence of the given module to
rpm-build 858c0f
# a C preprocessor expression that will evaluate to 1.
rpm-build 858c0f
AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE],
rpm-build 858c0f
[
rpm-build 858c0f
  gl_MODULE_INDICATOR_SET_VARIABLE_AUX(
rpm-build 858c0f
    [GNULIB_[]m4_translit([[$1]],
rpm-build 858c0f
                          [abcdefghijklmnopqrstuvwxyz./-],
rpm-build 858c0f
                          [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])],
rpm-build 858c0f
    [gl_MODULE_INDICATOR_CONDITION])
rpm-build 858c0f
])
rpm-build 858c0f
rpm-build 858c0f
# gl_MODULE_INDICATOR_SET_VARIABLE_AUX([variable])
rpm-build 858c0f
# modifies the shell variable to include the gl_MODULE_INDICATOR_CONDITION.
rpm-build 858c0f
# The shell variable's value is a C preprocessor expression that evaluates
rpm-build 858c0f
# to 0 or 1.
rpm-build 858c0f
AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX],
rpm-build 858c0f
[
rpm-build 858c0f
  m4_if(m4_defn([gl_MODULE_INDICATOR_CONDITION]), [1],
rpm-build 858c0f
    [
rpm-build 858c0f
     dnl Simplify the expression VALUE || 1 to 1.
rpm-build 858c0f
     $1=1
rpm-build 858c0f
    ],
rpm-build 858c0f
    [gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([$1],
rpm-build 858c0f
                                             [gl_MODULE_INDICATOR_CONDITION])])
rpm-build 858c0f
])
rpm-build 858c0f
rpm-build 858c0f
# gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([variable], [condition])
rpm-build 858c0f
# modifies the shell variable to include the given condition.  The shell
rpm-build 858c0f
# variable's value is a C preprocessor expression that evaluates to 0 or 1.
rpm-build 858c0f
AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR],
rpm-build 858c0f
[
rpm-build 858c0f
  dnl Simplify the expression 1 || CONDITION to 1.
rpm-build 858c0f
  if test "$[]$1" != 1; then
rpm-build 858c0f
    dnl Simplify the expression 0 || CONDITION to CONDITION.
rpm-build 858c0f
    if test "$[]$1" = 0; then
rpm-build 858c0f
      $1=$2
rpm-build 858c0f
    else
rpm-build 858c0f
      $1="($[]$1 || $2)"
rpm-build 858c0f
    fi
rpm-build 858c0f
  fi
rpm-build 858c0f
])
rpm-build 858c0f
rpm-build 858c0f
# gl_MODULE_INDICATOR([modulename])
rpm-build 858c0f
# defines a C macro indicating the presence of the given module
rpm-build 858c0f
# in a location where it can be used.
rpm-build 858c0f
#                                             |  Value  |   Value   |
rpm-build 858c0f
#                                             | in lib/ | in tests/ |
rpm-build 858c0f
# --------------------------------------------+---------+-----------+
rpm-build 858c0f
# Module present among main modules:          |    1    |     1     |
rpm-build 858c0f
# --------------------------------------------+---------+-----------+
rpm-build 858c0f
# Module present among tests-related modules: |    0    |     1     |
rpm-build 858c0f
# --------------------------------------------+---------+-----------+
rpm-build 858c0f
# Module not present at all:                  |    0    |     0     |
rpm-build 858c0f
# --------------------------------------------+---------+-----------+
rpm-build 858c0f
AC_DEFUN([gl_MODULE_INDICATOR],
rpm-build 858c0f
[
rpm-build 858c0f
  AC_DEFINE_UNQUOTED([GNULIB_]m4_translit([[$1]],
rpm-build 858c0f
      [abcdefghijklmnopqrstuvwxyz./-],
rpm-build 858c0f
      [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]),
rpm-build 858c0f
    [gl_MODULE_INDICATOR_CONDITION],
rpm-build 858c0f
    [Define to a C preprocessor expression that evaluates to 1 or 0,
rpm-build 858c0f
     depending whether the gnulib module $1 shall be considered present.])
rpm-build 858c0f
])
rpm-build 858c0f
rpm-build 858c0f
# gl_MODULE_INDICATOR_FOR_TESTS([modulename])
rpm-build 858c0f
# defines a C macro indicating the presence of the given module
rpm-build 858c0f
# in lib or tests. This is useful to determine whether the module
rpm-build 858c0f
# should be tested.
rpm-build 858c0f
#                                             |  Value  |   Value   |
rpm-build 858c0f
#                                             | in lib/ | in tests/ |
rpm-build 858c0f
# --------------------------------------------+---------+-----------+
rpm-build 858c0f
# Module present among main modules:          |    1    |     1     |
rpm-build 858c0f
# --------------------------------------------+---------+-----------+
rpm-build 858c0f
# Module present among tests-related modules: |    1    |     1     |
rpm-build 858c0f
# --------------------------------------------+---------+-----------+
rpm-build 858c0f
# Module not present at all:                  |    0    |     0     |
rpm-build 858c0f
# --------------------------------------------+---------+-----------+
rpm-build 858c0f
AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS],
rpm-build 858c0f
[
rpm-build 858c0f
  AC_DEFINE([GNULIB_TEST_]m4_translit([[$1]],
rpm-build 858c0f
      [abcdefghijklmnopqrstuvwxyz./-],
rpm-build 858c0f
      [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1],
rpm-build 858c0f
    [Define to 1 when the gnulib module $1 should be tested.])
rpm-build 858c0f
])
rpm-build 858c0f
rpm-build 858c0f
# gl_ASSERT_NO_GNULIB_POSIXCHECK
rpm-build 858c0f
# asserts that there will never be a need to #define GNULIB_POSIXCHECK.
rpm-build 858c0f
# and thereby enables an optimization of configure and config.h.
rpm-build 858c0f
# Used by Emacs.
rpm-build 858c0f
AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK],
rpm-build 858c0f
[
rpm-build 858c0f
  dnl Override gl_WARN_ON_USE_PREPARE.
rpm-build 858c0f
  dnl But hide this definition from 'aclocal'.
rpm-build 858c0f
  AC_DEFUN([gl_W][ARN_ON_USE_PREPARE], [])
rpm-build 858c0f
])
rpm-build 858c0f
rpm-build 858c0f
# gl_ASSERT_NO_GNULIB_TESTS
rpm-build 858c0f
# asserts that there will be no gnulib tests in the scope of the configure.ac
rpm-build 858c0f
# and thereby enables an optimization of config.h.
rpm-build 858c0f
# Used by Emacs.
rpm-build 858c0f
AC_DEFUN([gl_ASSERT_NO_GNULIB_TESTS],
rpm-build 858c0f
[
rpm-build 858c0f
  dnl Override gl_MODULE_INDICATOR_FOR_TESTS.
rpm-build 858c0f
  AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], [])
rpm-build 858c0f
])
rpm-build 858c0f
rpm-build 858c0f
# Test whether <features.h> exists.
rpm-build 858c0f
# Set HAVE_FEATURES_H.
rpm-build 858c0f
AC_DEFUN([gl_FEATURES_H],
rpm-build 858c0f
[
rpm-build 858c0f
  AC_CHECK_HEADERS_ONCE([features.h])
rpm-build 858c0f
  if test $ac_cv_header_features_h = yes; then
rpm-build 858c0f
    HAVE_FEATURES_H=1
rpm-build 858c0f
  else
rpm-build 858c0f
    HAVE_FEATURES_H=0
rpm-build 858c0f
  fi
rpm-build 858c0f
  AC_SUBST([HAVE_FEATURES_H])
rpm-build 858c0f
])
rpm-build 858c0f
rpm-build 858c0f
# m4_foreach_w
rpm-build 858c0f
# is a backport of autoconf-2.59c's m4_foreach_w.
rpm-build 858c0f
# Remove this macro when we can assume autoconf >= 2.60.
rpm-build 858c0f
m4_ifndef([m4_foreach_w],
rpm-build 858c0f
  [m4_define([m4_foreach_w],
rpm-build 858c0f
    [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
rpm-build 858c0f
rpm-build 858c0f
# AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH])
rpm-build 858c0f
# ----------------------------------------------------
rpm-build 858c0f
# Backport of autoconf-2.63b's macro.
rpm-build 858c0f
# Remove this macro when we can assume autoconf >= 2.64.
rpm-build 858c0f
m4_ifndef([AS_VAR_IF],
rpm-build 858c0f
[m4_define([AS_VAR_IF],
rpm-build 858c0f
[AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])])
rpm-build 858c0f
rpm-build 858c0f
# gl_PROG_CC_C99
rpm-build 858c0f
# Modifies the value of the shell variable CC in an attempt to make $CC
rpm-build 858c0f
# understand ISO C99 source code.
rpm-build 858c0f
# This is like AC_PROG_CC_C99, except that
rpm-build 858c0f
# - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60,
rpm-build 858c0f
# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC
rpm-build 858c0f
#   <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00367.html>,
rpm-build 858c0f
#   but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99
rpm-build 858c0f
#   <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00441.html>.
rpm-build 858c0f
# Remaining problems:
rpm-build 858c0f
# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options
rpm-build 858c0f
#   to CC twice
rpm-build 858c0f
#   <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00431.html>.
rpm-build 858c0f
# - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard.
rpm-build 858c0f
AC_DEFUN([gl_PROG_CC_C99],
rpm-build 858c0f
[
rpm-build 858c0f
  dnl Change that version number to the minimum Autoconf version that supports
rpm-build 858c0f
  dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls.
rpm-build 858c0f
  m4_version_prereq([9.0],
rpm-build 858c0f
    [AC_REQUIRE([AC_PROG_CC_C99])],
rpm-build 858c0f
    [AC_REQUIRE([AC_PROG_CC_STDC])])
rpm-build 858c0f
])
rpm-build 858c0f
rpm-build 858c0f
# gl_PROG_AR_RANLIB
rpm-build 858c0f
# Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler.
rpm-build 858c0f
# The user can set the variables AR, ARFLAGS, RANLIB if he wants to override
rpm-build 858c0f
# the values.
rpm-build 858c0f
AC_DEFUN([gl_PROG_AR_RANLIB],
rpm-build 858c0f
[
rpm-build 858c0f
  dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler
rpm-build 858c0f
  dnl as "cc", and GCC as "gcc". They have different object file formats and
rpm-build 858c0f
  dnl library formats. In particular, the GNU binutils programs ar and ranlib
rpm-build 858c0f
  dnl produce libraries that work only with gcc, not with cc.
rpm-build 858c0f
  AC_REQUIRE([AC_PROG_CC])
rpm-build 858c0f
  dnl The '][' hides this use from 'aclocal'.
rpm-build 858c0f
  AC_BEFORE([$0], [A][M_PROG_AR])
rpm-build 858c0f
  AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler],
rpm-build 858c0f
    [
rpm-build 858c0f
      AC_EGREP_CPP([Amsterdam],
rpm-build 858c0f
        [
rpm-build 858c0f
#ifdef __ACK__
rpm-build 858c0f
Amsterdam
rpm-build 858c0f
#endif
rpm-build 858c0f
        ],
rpm-build 858c0f
        [gl_cv_c_amsterdam_compiler=yes],
rpm-build 858c0f
        [gl_cv_c_amsterdam_compiler=no])
rpm-build 858c0f
    ])
rpm-build 858c0f
rpm-build 858c0f
  dnl Don't compete with AM_PROG_AR's decision about AR/ARFLAGS if we are not
rpm-build 858c0f
  dnl building with __ACK__.
rpm-build 858c0f
  if test $gl_cv_c_amsterdam_compiler = yes; then
rpm-build 858c0f
    if test -z "$AR"; then
rpm-build 858c0f
      AR='cc -c.a'
rpm-build 858c0f
    fi
rpm-build 858c0f
    if test -z "$ARFLAGS"; then
rpm-build 858c0f
      ARFLAGS='-o'
rpm-build 858c0f
    fi
rpm-build 858c0f
  else
rpm-build 858c0f
    dnl AM_PROG_AR was added in automake v1.11.2.  AM_PROG_AR does not AC_SUBST
rpm-build 858c0f
    dnl ARFLAGS variable (it is filed into Makefile.in directly by automake
rpm-build 858c0f
    dnl script on-demand, if not specified by ./configure of course).
rpm-build 858c0f
    dnl Don't AC_REQUIRE the AM_PROG_AR otherwise the code for __ACK__ above
rpm-build 858c0f
    dnl will be ignored.  Also, pay attention to call AM_PROG_AR in else block
rpm-build 858c0f
    dnl because AM_PROG_AR is written so it could re-set AR variable even for
rpm-build 858c0f
    dnl __ACK__.  It may seem like its easier to avoid calling the macro here,
rpm-build 858c0f
    dnl but we need to AC_SUBST both AR/ARFLAGS (thus those must have some good
rpm-build 858c0f
    dnl default value and automake should usually know them).
rpm-build 858c0f
    dnl
rpm-build 858c0f
    dnl The '][' hides this use from 'aclocal'.
rpm-build 858c0f
    m4_ifdef([A][M_PROG_AR], [A][M_PROG_AR], [:])
rpm-build 858c0f
  fi
rpm-build 858c0f
rpm-build 858c0f
  dnl In case the code above has not helped with setting AR/ARFLAGS, use
rpm-build 858c0f
  dnl Automake-documented default values for AR and ARFLAGS, but prefer
rpm-build 858c0f
  dnl ${host}-ar over ar (useful for cross-compiling).
rpm-build 858c0f
  AC_CHECK_TOOL([AR], [ar], [ar])
rpm-build 858c0f
  if test -z "$ARFLAGS"; then
rpm-build 858c0f
    ARFLAGS='cr'
rpm-build 858c0f
  fi
rpm-build 858c0f
rpm-build 858c0f
  AC_SUBST([AR])
rpm-build 858c0f
  AC_SUBST([ARFLAGS])
rpm-build 858c0f
  if test -z "$RANLIB"; then
rpm-build 858c0f
    if test $gl_cv_c_amsterdam_compiler = yes; then
rpm-build 858c0f
      RANLIB=':'
rpm-build 858c0f
    else
rpm-build 858c0f
      dnl Use the ranlib program if it is available.
rpm-build 858c0f
      AC_PROG_RANLIB
rpm-build 858c0f
    fi
rpm-build 858c0f
  fi
rpm-build 858c0f
  AC_SUBST([RANLIB])
rpm-build 858c0f
])
rpm-build 858c0f
rpm-build 858c0f
# AC_PROG_MKDIR_P
rpm-build 858c0f
# is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix
rpm-build 858c0f
# for interoperability with automake-1.9.6 from autoconf-2.62.
rpm-build 858c0f
# Remove this macro when we can assume autoconf >= 2.62 or
rpm-build 858c0f
# autoconf >= 2.60 && automake >= 1.10.
rpm-build 858c0f
# AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness.
rpm-build 858c0f
m4_ifndef([AC_AUTOCONF_VERSION],[
rpm-build 858c0f
m4_ifdef([AC_PROG_MKDIR_P], [
rpm-build 858c0f
  dnl For automake-1.9.6 && autoconf < 2.62: Ensure MKDIR_P is AC_SUBSTed.
rpm-build 858c0f
  m4_define([AC_PROG_MKDIR_P],
rpm-build 858c0f
    m4_defn([AC_PROG_MKDIR_P])[
rpm-build 858c0f
    AC_SUBST([MKDIR_P])])], [
rpm-build 858c0f
  dnl For autoconf < 2.60: Backport of AC_PROG_MKDIR_P.
rpm-build 858c0f
  AC_DEFUN_ONCE([AC_PROG_MKDIR_P],
rpm-build 858c0f
    [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
rpm-build 858c0f
     MKDIR_P='$(mkdir_p)'
rpm-build 858c0f
     AC_SUBST([MKDIR_P])])])
rpm-build 858c0f
])
rpm-build 858c0f
rpm-build 858c0f
# AC_C_RESTRICT
rpm-build 858c0f
# This definition is copied from post-2.69 Autoconf and overrides the
rpm-build 858c0f
# AC_C_RESTRICT macro from autoconf 2.60..2.69.  It can be removed
rpm-build 858c0f
# once autoconf >= 2.70 can be assumed.  It's painful to check version
rpm-build 858c0f
# numbers, and in practice this macro is more up-to-date than Autoconf
rpm-build 858c0f
# is, so override Autoconf unconditionally.
rpm-build 858c0f
AC_DEFUN([AC_C_RESTRICT],
rpm-build 858c0f
[AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
rpm-build 858c0f
  [ac_cv_c_restrict=no
rpm-build 858c0f
   # The order here caters to the fact that C++ does not require restrict.
rpm-build 858c0f
   for ac_kw in __restrict __restrict__ _Restrict restrict; do
rpm-build 858c0f
     AC_COMPILE_IFELSE(
rpm-build 858c0f
      [AC_LANG_PROGRAM(
rpm-build 858c0f
	 [[typedef int *int_ptr;
rpm-build 858c0f
	   int foo (int_ptr $ac_kw ip) { return ip[0]; }
rpm-build 858c0f
	   int bar (int [$ac_kw]); /* Catch GCC bug 14050.  */
rpm-build 858c0f
	   int bar (int ip[$ac_kw]) { return ip[0]; }
rpm-build 858c0f
	 ]],
rpm-build 858c0f
	 [[int s[1];
rpm-build 858c0f
	   int *$ac_kw t = s;
rpm-build 858c0f
	   t[0] = 0;
rpm-build 858c0f
	   return foo (t) + bar (t);
rpm-build 858c0f
	 ]])],
rpm-build 858c0f
      [ac_cv_c_restrict=$ac_kw])
rpm-build 858c0f
     test "$ac_cv_c_restrict" != no && break
rpm-build 858c0f
   done
rpm-build 858c0f
  ])
rpm-build 858c0f
 AH_VERBATIM([restrict],
rpm-build 858c0f
[/* Define to the equivalent of the C99 'restrict' keyword, or to
rpm-build 858c0f
   nothing if this is not supported.  Do not define if restrict is
rpm-build 858c0f
   supported directly.  */
rpm-build 858c0f
#undef restrict
rpm-build 858c0f
/* Work around a bug in Sun C++: it does not support _Restrict or
rpm-build 858c0f
   __restrict__, even though the corresponding Sun C compiler ends up with
rpm-build 858c0f
   "#define restrict _Restrict" or "#define restrict __restrict__" in the
rpm-build 858c0f
   previous line.  Perhaps some future version of Sun C++ will work with
rpm-build 858c0f
   restrict; if so, hopefully it defines __RESTRICT like Sun C does.  */
rpm-build 858c0f
#if defined __SUNPRO_CC && !defined __RESTRICT
rpm-build 858c0f
# define _Restrict
rpm-build 858c0f
# define __restrict__
rpm-build 858c0f
#endif])
rpm-build 858c0f
 case $ac_cv_c_restrict in
rpm-build 858c0f
   restrict) ;;
rpm-build 858c0f
   no) AC_DEFINE([restrict], []) ;;
rpm-build 858c0f
   *)  AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
rpm-build 858c0f
 esac
rpm-build 858c0f
])# AC_C_RESTRICT
rpm-build 858c0f
rpm-build 858c0f
# gl_BIGENDIAN
rpm-build 858c0f
# is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd.
rpm-build 858c0f
# Note that AC_REQUIRE([AC_C_BIGENDIAN]) does not work reliably because some
rpm-build 858c0f
# macros invoke AC_C_BIGENDIAN with arguments.
rpm-build 858c0f
AC_DEFUN([gl_BIGENDIAN],
rpm-build 858c0f
[
rpm-build 858c0f
  AC_C_BIGENDIAN
rpm-build 858c0f
])
rpm-build 858c0f
rpm-build 858c0f
# gl_CACHE_VAL_SILENT(cache-id, command-to-set-it)
rpm-build 858c0f
# is like AC_CACHE_VAL(cache-id, command-to-set-it), except that it does not
rpm-build 858c0f
# output a spurious "(cached)" mark in the midst of other configure output.
rpm-build 858c0f
# This macro should be used instead of AC_CACHE_VAL when it is not surrounded
rpm-build 858c0f
# by an AC_MSG_CHECKING/AC_MSG_RESULT pair.
rpm-build 858c0f
AC_DEFUN([gl_CACHE_VAL_SILENT],
rpm-build 858c0f
[
rpm-build 858c0f
  saved_as_echo_n="$as_echo_n"
rpm-build 858c0f
  as_echo_n=':'
rpm-build 858c0f
  AC_CACHE_VAL([$1], [$2])
rpm-build 858c0f
  as_echo_n="$saved_as_echo_n"
rpm-build 858c0f
])
rpm-build 858c0f
rpm-build 858c0f
# AS_VAR_COPY was added in autoconf 2.63b
rpm-build 858c0f
m4_define_default([AS_VAR_COPY],
rpm-build 858c0f
[AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])
rpm-build 858c0f
rpm-build 858c0f
# AC_PROG_SED was added in autoconf 2.59b
rpm-build 858c0f
m4_ifndef([AC_PROG_SED],
rpm-build 858c0f
[AC_DEFUN([AC_PROG_SED],
rpm-build 858c0f
[AC_CACHE_CHECK([for a sed that does not truncate output], ac_cv_path_SED,
rpm-build 858c0f
    [dnl ac_script should not contain more than 99 commands (for HP-UX sed),
rpm-build 858c0f
     dnl but more than about 7000 bytes, to catch a limit in Solaris 8 /usr/ucb/sed.
rpm-build 858c0f
     ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
rpm-build 858c0f
     for ac_i in 1 2 3 4 5 6 7; do
rpm-build 858c0f
       ac_script="$ac_script$as_nl$ac_script"
rpm-build 858c0f
     done
rpm-build 858c0f
     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
rpm-build 858c0f
     AS_UNSET([ac_script])
rpm-build 858c0f
     if test -z "$SED"; then
rpm-build 858c0f
       ac_path_SED_found=false
rpm-build 858c0f
       _AS_PATH_WALK([], [
rpm-build 858c0f
         for ac_prog in sed gsed; do
rpm-build 858c0f
           for ac_exec_ext in '' $ac_executable_extensions; do
rpm-build 858c0f
             ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
rpm-build 858c0f
             AS_EXECUTABLE_P(["$ac_path_SED"]) || continue
rpm-build 858c0f
             case `"$ac_path_SED" --version 2>&1` in
rpm-build 858c0f
               *GNU*) ac_cv_path_SED=$ac_path_SED ac_path_SED_found=:;;
rpm-build 858c0f
               *)
rpm-build 858c0f
                 ac_count=0
rpm-build 858c0f
                 _AS_ECHO_N([0123456789]) >conftest.in
rpm-build 858c0f
                 while :
rpm-build 858c0f
                 do
rpm-build 858c0f
                   cat conftest.in conftest.in >conftest.tmp
rpm-build 858c0f
                   mv conftest.tmp conftest.in
rpm-build 858c0f
                   cp conftest.in conftest.nl
rpm-build 858c0f
                   echo >> conftest.nl
rpm-build 858c0f
                   "$ac_path_SED" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
rpm-build 858c0f
                   diff conftest.out conftest.nl >/dev/null 2>&1 || break
rpm-build 858c0f
                   ac_count=`expr $ac_count + 1`
rpm-build 858c0f
                   if test $ac_count -gt ${ac_path_SED_max-0}; then
rpm-build 858c0f
                     # Best so far, but keep looking for better
rpm-build 858c0f
                     ac_cv_path_SED=$ac_path_SED
rpm-build 858c0f
                     ac_path_SED_max=$ac_count
rpm-build 858c0f
                   fi
rpm-build 858c0f
                   test $ac_count -gt 10 && break
rpm-build 858c0f
                 done
rpm-build 858c0f
                 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
rpm-build 858c0f
             esac
rpm-build 858c0f
             $ac_path_SED_found && break 3
rpm-build 858c0f
           done
rpm-build 858c0f
         done])
rpm-build 858c0f
       if test -z "$ac_cv_path_SED"; then
rpm-build 858c0f
         AC_ERROR([no acceptable sed could be found in \$PATH])
rpm-build 858c0f
       fi
rpm-build 858c0f
     else
rpm-build 858c0f
       ac_cv_path_SED=$SED
rpm-build 858c0f
     fi
rpm-build 858c0f
    ])
rpm-build 858c0f
 SED="$ac_cv_path_SED"
rpm-build 858c0f
 AC_SUBST([SED])dnl
rpm-build 858c0f
 rm -f conftest.sed
rpm-build 858c0f
])
rpm-build 858c0f
])