Blame autoconf/local.m4

Packit Service 5195f2
dnl Serial 3 mfx/m4/acc.m4
Packit Service 5195f2
Packit Service 5195f2
AC_DEFUN([mfx_ACC_CHECK_ENDIAN], [
Packit Service 5195f2
AC_C_BIGENDIAN([AC_DEFINE(ACC_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(ACC_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
Packit Service 5195f2
])
Packit Service 5195f2
Packit Service 5195f2
AC_DEFUN([mfx_ACC_CHECK_HEADERS], [
Packit Service 5195f2
AC_HEADER_TIME
Packit Service 5195f2
AC_CHECK_HEADERS([assert.h ctype.h dirent.h errno.h fcntl.h float.h limits.h malloc.h memory.h setjmp.h signal.h stdarg.h stddef.h stdint.h stdio.h stdlib.h string.h strings.h time.h unistd.h utime.h sys/mman.h sys/resource.h sys/stat.h sys/time.h sys/types.h sys/wait.h])
Packit Service 5195f2
])
Packit Service 5195f2
Packit Service 5195f2
AC_DEFUN([mfx_ACC_CHECK_FUNCS], [
Packit Service 5195f2
AC_CHECK_FUNCS(access alloca atexit atoi atol chmod chown clock_getcpuclockid clock_getres clock_gettime ctime difftime fstat getenv getpagesize getrusage gettimeofday gmtime isatty localtime longjmp lstat memcmp memcpy memmove memset mkdir mktime mmap mprotect munmap qsort raise rmdir setjmp signal snprintf strcasecmp strchr strdup strerror strftime stricmp strncasecmp strnicmp strrchr strstr time umask utime vsnprintf)
Packit Service 5195f2
])
Packit Service 5195f2
Packit Service 5195f2
AC_DEFUN([mfx_ACC_CHECK_SIZEOF], [
Packit Service 5195f2
AC_CHECK_SIZEOF(short)
Packit Service 5195f2
AC_CHECK_SIZEOF(int)
Packit Service 5195f2
AC_CHECK_SIZEOF(long)
Packit Service 5195f2
Packit Service 5195f2
AC_CHECK_SIZEOF(long long)
Packit Service 5195f2
AC_CHECK_SIZEOF(__int16)
Packit Service 5195f2
AC_CHECK_SIZEOF(__int32)
Packit Service 5195f2
AC_CHECK_SIZEOF(__int64)
Packit Service 5195f2
Packit Service 5195f2
AC_CHECK_SIZEOF(void *)
Packit Service 5195f2
AC_CHECK_SIZEOF(size_t)
Packit Service 5195f2
AC_CHECK_SIZEOF(ptrdiff_t)
Packit Service 5195f2
])
Packit Service 5195f2
Packit Service 5195f2
AC_DEFUN([mfx_ACC_ACCCHK], [
Packit Service 5195f2
mfx_tmp=$1
Packit Service 5195f2
mfx_save_CPPFLAGS=$CPPFLAGS
Packit Service 5195f2
dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
Packit Service 5195f2
test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
Packit Service 5195f2
Packit Service 5195f2
AC_MSG_CHECKING([whether your compiler passes the ACC conformance test])
Packit Service 5195f2
Packit Service 5195f2
AC_LANG_CONFTEST([AC_LANG_PROGRAM(
Packit Service 5195f2
[[#define ACC_CFG_NO_CONFIG_HEADER 1
Packit Service 5195f2
#include "acc/acc.h"
Packit Service 5195f2
#include "acc/acc_incd.h"
Packit Service 5195f2
Packit Service 5195f2
#undef  ACCCHK_ASSERT
Packit Service 5195f2
#define ACCCHK_ASSERT(expr)     ACC_COMPILE_TIME_ASSERT_HEADER(expr)
Packit Service 5195f2
#include "acc/acc_chk.ch"
Packit Service 5195f2
Packit Service 5195f2
#undef  ACCCHK_ASSERT
Packit Service 5195f2
#define ACCCHK_ASSERT(expr)     ACC_COMPILE_TIME_ASSERT(expr)
Packit Service 5195f2
static void test_acc_compile_time_assert(void) {
Packit Service 5195f2
#include "acc/acc_chk.ch"
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
#undef NDEBUG
Packit Service 5195f2
#include <assert.h>
Packit Service 5195f2
#undef  ACCCHK_ASSERT
Packit Service 5195f2
#define ACCCHK_ASSERT(expr)     assert(expr);
Packit Service 5195f2
static int test_acc_run_time_assert(int r) {
Packit Service 5195f2
#include "acc/acc_chk.ch"
Packit Service 5195f2
return r;
Packit Service 5195f2
}
Packit Service 5195f2
]], [[
Packit Service 5195f2
test_acc_compile_time_assert();
Packit Service 5195f2
if (test_acc_run_time_assert(1) != 1) return 1;
Packit Service 5195f2
]]
Packit Service 5195f2
)])
Packit Service 5195f2
Packit Service 5195f2
mfx_tmp=FAILED
Packit Service 5195f2
_AC_COMPILE_IFELSE([], [mfx_tmp=yes])
Packit Service 5195f2
rm -f conftest.$ac_ext conftest.$ac_objext
Packit Service 5195f2
Packit Service 5195f2
CPPFLAGS=$mfx_save_CPPFLAGS
Packit Service 5195f2
Packit Service 5195f2
AC_MSG_RESULT([$mfx_tmp])
Packit Service 5195f2
case x$mfx_tmp in
Packit Service 5195f2
  xpassed | xyes) ;;
Packit Service 5195f2
  *)
Packit Service 5195f2
    AC_MSG_NOTICE([])
Packit Service 5195f2
    AC_MSG_NOTICE([Your compiler failed the ACC conformance test - for details see ])
Packit Service 5195f2
    AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
Packit Service 5195f2
    AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
Packit Service 5195f2
    AC_MSG_NOTICE([Thanks for your support.])
Packit Service 5195f2
    AC_MSG_NOTICE([])
Packit Service 5195f2
    AC_MSG_ERROR([ACC conformance test failed. Stop.])
Packit Service 5195f2
dnl    AS_EXIT
Packit Service 5195f2
    ;;
Packit Service 5195f2
esac
Packit Service 5195f2
])
Packit Service 5195f2
Packit Service 5195f2
dnl Serial 3 mfx/m4/acc_miniacc.m4
Packit Service 5195f2
Packit Service 5195f2
AC_DEFUN([mfx_MINIACC_ACCCHK], [
Packit Service 5195f2
mfx_tmp=$1
Packit Service 5195f2
mfx_save_CPPFLAGS=$CPPFLAGS
Packit Service 5195f2
dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
Packit Service 5195f2
test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
Packit Service 5195f2
Packit Service 5195f2
AC_MSG_CHECKING([whether your compiler passes the ACC conformance test])
Packit Service 5195f2
Packit Service 5195f2
AC_LANG_CONFTEST([AC_LANG_PROGRAM(
Packit Service 5195f2
[[#define ACC_CFG_NO_CONFIG_HEADER 1
Packit Service 5195f2
#define ACC_WANT_ACC_INCD_H 1
Packit Service 5195f2
#include $2
Packit Service 5195f2
Packit Service 5195f2
#undef  ACCCHK_ASSERT
Packit Service 5195f2
#define ACCCHK_ASSERT(expr)     ACC_COMPILE_TIME_ASSERT_HEADER(expr)
Packit Service 5195f2
#define ACC_WANT_ACC_CHK_CH 1
Packit Service 5195f2
#include $2
Packit Service 5195f2
Packit Service 5195f2
#undef  ACCCHK_ASSERT
Packit Service 5195f2
#define ACCCHK_ASSERT(expr)     ACC_COMPILE_TIME_ASSERT(expr)
Packit Service 5195f2
static void test_acc_compile_time_assert(void) {
Packit Service 5195f2
#define ACC_WANT_ACC_CHK_CH 1
Packit Service 5195f2
#include $2
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
#undef NDEBUG
Packit Service 5195f2
#include <assert.h>
Packit Service 5195f2
#undef  ACCCHK_ASSERT
Packit Service 5195f2
#define ACCCHK_ASSERT(expr)     assert(expr);
Packit Service 5195f2
static int test_acc_run_time_assert(int r) {
Packit Service 5195f2
#define ACC_WANT_ACC_CHK_CH 1
Packit Service 5195f2
#include $2
Packit Service 5195f2
return r;
Packit Service 5195f2
}
Packit Service 5195f2
]], [[
Packit Service 5195f2
test_acc_compile_time_assert();
Packit Service 5195f2
if (test_acc_run_time_assert(1) != 1) return 1;
Packit Service 5195f2
]]
Packit Service 5195f2
)])
Packit Service 5195f2
Packit Service 5195f2
mfx_tmp=FAILED
Packit Service 5195f2
_AC_COMPILE_IFELSE([], [mfx_tmp=yes])
Packit Service 5195f2
rm -f conftest.$ac_ext conftest.$ac_objext
Packit Service 5195f2
Packit Service 5195f2
CPPFLAGS=$mfx_save_CPPFLAGS
Packit Service 5195f2
Packit Service 5195f2
AC_MSG_RESULT([$mfx_tmp])
Packit Service 5195f2
case x$mfx_tmp in
Packit Service 5195f2
  xpassed | xyes) ;;
Packit Service 5195f2
  *)
Packit Service 5195f2
    AC_MSG_NOTICE([])
Packit Service 5195f2
    AC_MSG_NOTICE([Your compiler failed the ACC conformance test - for details see ])
Packit Service 5195f2
    AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
Packit Service 5195f2
    AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
Packit Service 5195f2
    AC_MSG_NOTICE([Thanks for your support.])
Packit Service 5195f2
    AC_MSG_NOTICE([])
Packit Service 5195f2
    AC_MSG_ERROR([ACC conformance test failed. Stop.])
Packit Service 5195f2
dnl    AS_EXIT
Packit Service 5195f2
    ;;
Packit Service 5195f2
esac
Packit Service 5195f2
])
Packit Service 5195f2
Packit Service 5195f2
dnl Serial 2 mfx/m4/cppflags.m4
Packit Service 5195f2
Packit Service 5195f2
AC_DEFUN([mfx_PROG_CPPFLAGS], [
Packit Service 5195f2
AC_MSG_CHECKING([whether the C preprocessor needs special flags])
Packit Service 5195f2
Packit Service 5195f2
AC_LANG_CONFTEST([AC_LANG_PROGRAM(
Packit Service 5195f2
[[#include <limits.h>
Packit Service 5195f2
#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul)
Packit Service 5195f2
#  include "your C preprocessor is broken 1"
Packit Service 5195f2
#elif (0xffffu == 0xfffffffful)
Packit Service 5195f2
#  include "your C preprocessor is broken 2"
Packit Service 5195f2
#elif (32767 >= ULONG_MAX) || (65535u >= ULONG_MAX)
Packit Service 5195f2
#  include "your C preprocessor is broken 3"
Packit Service 5195f2
#endif
Packit Service 5195f2
]], [[ ]]
Packit Service 5195f2
)])
Packit Service 5195f2
Packit Service 5195f2
mfx_save_CPPFLAGS=$CPPFLAGS
Packit Service 5195f2
mfx_tmp=ERROR
Packit Service 5195f2
for mfx_arg in "" -no-cpp-precomp
Packit Service 5195f2
do
Packit Service 5195f2
  CPPFLAGS="$mfx_arg $mfx_save_CPPFLAGS"
Packit Service 5195f2
  _AC_COMPILE_IFELSE([],
Packit Service 5195f2
[mfx_tmp=$mfx_arg
Packit Service 5195f2
break])
Packit Service 5195f2
done
Packit Service 5195f2
CPPFLAGS=$mfx_save_CPPFLAGS
Packit Service 5195f2
rm -f conftest.$ac_ext conftest.$ac_objext
Packit Service 5195f2
case x$mfx_tmp in
Packit Service 5195f2
  x)
Packit Service 5195f2
    AC_MSG_RESULT([none needed]) ;;
Packit Service 5195f2
  xERROR)
Packit Service 5195f2
    AC_MSG_RESULT([ERROR])
Packit Service 5195f2
    AC_MSG_ERROR([your C preprocessor is broken - for details see config.log])
Packit Service 5195f2
    ;;
Packit Service 5195f2
  *)
Packit Service 5195f2
    AC_MSG_RESULT([$mfx_tmp])
Packit Service 5195f2
    CPPFLAGS="$mfx_tmp $CPPFLAGS"
Packit Service 5195f2
    ;;
Packit Service 5195f2
esac
Packit Service 5195f2
])
Packit Service 5195f2
Packit Service 5195f2
dnl Serial 13  -*- Autoconf -*-
Packit Service 5195f2
# Enable extensions on systems that normally disable them.
Packit Service 5195f2
Packit Service 5195f2
# Copyright (C) 2003, 2006-2014 Free Software Foundation, Inc.
Packit Service 5195f2
# This file is free software; the Free Software Foundation
Packit Service 5195f2
# gives unlimited permission to copy and/or distribute it,
Packit Service 5195f2
# with or without modifications, as long as this notice is preserved.
Packit Service 5195f2
Packit Service 5195f2
# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git
Packit Service 5195f2
# Autoconf.  Perhaps we can remove this once we can assume Autoconf
Packit Service 5195f2
# 2.70 or later everywhere, but since Autoconf mutates rapidly
Packit Service 5195f2
# enough in this area it's likely we'll need to redefine
Packit Service 5195f2
# AC_USE_SYSTEM_EXTENSIONS for quite some time.
Packit Service 5195f2
Packit Service 5195f2
# If autoconf reports a warning
Packit Service 5195f2
#     warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
Packit Service 5195f2
# or  warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
Packit Service 5195f2
# the fix is
Packit Service 5195f2
#   1) to ensure that AC_USE_SYSTEM_EXTENSIONS is never directly invoked
Packit Service 5195f2
#      but always AC_REQUIREd,
Packit Service 5195f2
#   2) to ensure that for each occurrence of
Packit Service 5195f2
#        AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
Packit Service 5195f2
#      or
Packit Service 5195f2
#        AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
Packit Service 5195f2
#      the corresponding gnulib module description has 'extensions' among
Packit Service 5195f2
#      its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS
Packit Service 5195f2
#      invocation occurs in gl_EARLY, not in gl_INIT.
Packit Service 5195f2
Packit Service 5195f2
# AC_USE_SYSTEM_EXTENSIONS
Packit Service 5195f2
# ------------------------
Packit Service 5195f2
# Enable extensions on systems that normally disable them,
Packit Service 5195f2
# typically due to standards-conformance issues.
Packit Service 5195f2
#
Packit Service 5195f2
# Remember that #undef in AH_VERBATIM gets replaced with #define by
Packit Service 5195f2
# AC_DEFINE.  The goal here is to define all known feature-enabling
Packit Service 5195f2
# macros, then, if reports of conflicts are made, disable macros that
Packit Service 5195f2
# cause problems on some platforms (such as __EXTENSIONS__).
Packit Service 5195f2
AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
Packit Service 5195f2
[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
Packit Service 5195f2
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
Packit Service 5195f2
Packit Service 5195f2
  AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
Packit Service 5195f2
  if test "$MINIX" = yes; then
Packit Service 5195f2
    AC_DEFINE([_POSIX_SOURCE], [1],
Packit Service 5195f2
      [Define to 1 if you need to in order for 'stat' and other
Packit Service 5195f2
       things to work.])
Packit Service 5195f2
    AC_DEFINE([_POSIX_1_SOURCE], [2],
Packit Service 5195f2
      [Define to 2 if the system does not provide POSIX.1 features
Packit Service 5195f2
       except with this defined.])
Packit Service 5195f2
    AC_DEFINE([_MINIX], [1],
Packit Service 5195f2
      [Define to 1 if on MINIX.])
Packit Service 5195f2
    AC_DEFINE([_NETBSD_SOURCE], [1],
Packit Service 5195f2
      [Define to 1 to make NetBSD features available.  MINIX 3 needs this.])
Packit Service 5195f2
  fi
Packit Service 5195f2
Packit Service 5195f2
dnl Use a different key than __EXTENSIONS__, as that name broke existing
Packit Service 5195f2
dnl configure.ac when using autoheader 2.62.
Packit Service 5195f2
  AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
Packit Service 5195f2
[/* Enable extensions on AIX 3, Interix.  */
Packit Service 5195f2
#ifndef _ALL_SOURCE
Packit Service 5195f2
# undef _ALL_SOURCE
Packit Service 5195f2
#endif
Packit Service 5195f2
/* Enable general extensions on OS X.  */
Packit Service 5195f2
#ifndef _DARWIN_C_SOURCE
Packit Service 5195f2
# undef _DARWIN_C_SOURCE
Packit Service 5195f2
#endif
Packit Service 5195f2
/* Enable GNU extensions on systems that have them.  */
Packit Service 5195f2
#ifndef _GNU_SOURCE
Packit Service 5195f2
# undef _GNU_SOURCE
Packit Service 5195f2
#endif
Packit Service 5195f2
/* Enable threading extensions on Solaris.  */
Packit Service 5195f2
#ifndef _POSIX_PTHREAD_SEMANTICS
Packit Service 5195f2
# undef _POSIX_PTHREAD_SEMANTICS
Packit Service 5195f2
#endif
Packit Service 5195f2
/* Enable extensions on HP NonStop.  */
Packit Service 5195f2
#ifndef _TANDEM_SOURCE
Packit Service 5195f2
# undef _TANDEM_SOURCE
Packit Service 5195f2
#endif
Packit Service 5195f2
/* Enable X/Open extensions if necessary.  HP-UX 11.11 defines
Packit Service 5195f2
   mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
Packit Service 5195f2
   whether compiling with -Ae or -D_HPUX_SOURCE=1.  */
Packit Service 5195f2
#ifndef _XOPEN_SOURCE
Packit Service 5195f2
# undef _XOPEN_SOURCE
Packit Service 5195f2
#endif
Packit Service 5195f2
/* Enable general extensions on Solaris.  */
Packit Service 5195f2
#ifndef __EXTENSIONS__
Packit Service 5195f2
# undef __EXTENSIONS__
Packit Service 5195f2
#endif
Packit Service 5195f2
])
Packit Service 5195f2
  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
Packit Service 5195f2
    [ac_cv_safe_to_define___extensions__],
Packit Service 5195f2
    [AC_COMPILE_IFELSE(
Packit Service 5195f2
       [AC_LANG_PROGRAM([[
Packit Service 5195f2
#         define __EXTENSIONS__ 1
Packit Service 5195f2
          ]AC_INCLUDES_DEFAULT])],
Packit Service 5195f2
       [ac_cv_safe_to_define___extensions__=yes],
Packit Service 5195f2
       [ac_cv_safe_to_define___extensions__=no])])
Packit Service 5195f2
  test $ac_cv_safe_to_define___extensions__ = yes &&
Packit Service 5195f2
    AC_DEFINE([__EXTENSIONS__])
Packit Service 5195f2
  AC_DEFINE([_ALL_SOURCE])
Packit Service 5195f2
  AC_DEFINE([_DARWIN_C_SOURCE])
Packit Service 5195f2
  AC_DEFINE([_GNU_SOURCE])
Packit Service 5195f2
  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
Packit Service 5195f2
  AC_DEFINE([_TANDEM_SOURCE])
Packit Service 5195f2
  AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
Packit Service 5195f2
    [ac_cv_should_define__xopen_source],
Packit Service 5195f2
    [ac_cv_should_define__xopen_source=no
Packit Service 5195f2
     AC_COMPILE_IFELSE(
Packit Service 5195f2
       [AC_LANG_PROGRAM([[
Packit Service 5195f2
          #include <wchar.h>
Packit Service 5195f2
          mbstate_t x;]])],
Packit Service 5195f2
       [],
Packit Service 5195f2
       [AC_COMPILE_IFELSE(
Packit Service 5195f2
          [AC_LANG_PROGRAM([[
Packit Service 5195f2
             #define _XOPEN_SOURCE 500
Packit Service 5195f2
             #include <wchar.h>
Packit Service 5195f2
             mbstate_t x;]])],
Packit Service 5195f2
          [ac_cv_should_define__xopen_source=yes])])])
Packit Service 5195f2
  test $ac_cv_should_define__xopen_source = yes &&
Packit Service 5195f2
    AC_DEFINE([_XOPEN_SOURCE], [500])
Packit Service 5195f2
])# AC_USE_SYSTEM_EXTENSIONS
Packit Service 5195f2
Packit Service 5195f2
# gl_USE_SYSTEM_EXTENSIONS
Packit Service 5195f2
# ------------------------
Packit Service 5195f2
# Enable extensions on systems that normally disable them,
Packit Service 5195f2
# typically due to standards-conformance issues.
Packit Service 5195f2
AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
Packit Service 5195f2
[
Packit Service 5195f2
  dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS.
Packit Service 5195f2
  dnl gnulib does not need it. But if it gets required by third-party macros
Packit Service 5195f2
  dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a
Packit Service 5195f2
  dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
Packit Service 5195f2
  dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE,
Packit Service 5195f2
  dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck.
Packit Service 5195f2
  AC_REQUIRE([AC_GNU_SOURCE])
Packit Service 5195f2
Packit Service 5195f2
  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
Packit Service 5195f2
])
Packit Service 5195f2
Packit Service 5195f2
dnl Serial 4 mfx/m4/limits.m4
Packit Service 5195f2
Packit Service 5195f2
AC_DEFUN([mfx_CHECK_HEADER_SANE_LIMITS_H], [
Packit Service 5195f2
AC_CACHE_CHECK([whether limits.h is sane],
Packit Service 5195f2
mfx_cv_header_sane_limits_h,
Packit Service 5195f2
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <limits.h>
Packit Service 5195f2
#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul)
Packit Service 5195f2
#  if defined(__APPLE__) && defined(__GNUC__)
Packit Service 5195f2
#    error "your preprocessor is broken - use compiler option -no-cpp-precomp"
Packit Service 5195f2
#  else
Packit Service 5195f2
#    include "your preprocessor is broken"
Packit Service 5195f2
#  endif
Packit Service 5195f2
#endif
Packit Service 5195f2
#define MFX_0xffff          0xffff
Packit Service 5195f2
#define MFX_0xffffffffL     4294967295ul
Packit Service 5195f2
#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
Packit Service 5195f2
#  include "error CHAR_BIT"
Packit Service 5195f2
#endif
Packit Service 5195f2
#if !defined(UCHAR_MAX)
Packit Service 5195f2
#  include "error UCHAR_MAX 1"
Packit Service 5195f2
#endif
Packit Service 5195f2
#if !defined(USHRT_MAX)
Packit Service 5195f2
#  include "error USHRT_MAX 1"
Packit Service 5195f2
#endif
Packit Service 5195f2
#if !defined(UINT_MAX)
Packit Service 5195f2
#  include "error UINT_MAX 1"
Packit Service 5195f2
#endif
Packit Service 5195f2
#if !defined(ULONG_MAX)
Packit Service 5195f2
#  include "error ULONG_MAX 1"
Packit Service 5195f2
#endif
Packit Service 5195f2
#if !defined(SHRT_MAX)
Packit Service 5195f2
#  include "error SHRT_MAX 1"
Packit Service 5195f2
#endif
Packit Service 5195f2
#if !defined(INT_MAX)
Packit Service 5195f2
#  include "error INT_MAX 1"
Packit Service 5195f2
#endif
Packit Service 5195f2
#if !defined(LONG_MAX)
Packit Service 5195f2
#  include "error LONG_MAX 1"
Packit Service 5195f2
#endif
Packit Service 5195f2
#if (UCHAR_MAX < 1)
Packit Service 5195f2
#  include "error UCHAR_MAX 2"
Packit Service 5195f2
#endif
Packit Service 5195f2
#if (USHRT_MAX < 1)
Packit Service 5195f2
#  include "error USHRT_MAX 2"
Packit Service 5195f2
#endif
Packit Service 5195f2
#if (UINT_MAX < 1)
Packit Service 5195f2
#  include "error UINT_MAX 2"
Packit Service 5195f2
#endif
Packit Service 5195f2
#if (ULONG_MAX < 1)
Packit Service 5195f2
#  include "error ULONG_MAX 2"
Packit Service 5195f2
#endif
Packit Service 5195f2
#if (UCHAR_MAX < 0xff)
Packit Service 5195f2
#  include "error UCHAR_MAX 3"
Packit Service 5195f2
#endif
Packit Service 5195f2
#if (USHRT_MAX < MFX_0xffff)
Packit Service 5195f2
#  include "error USHRT_MAX 3"
Packit Service 5195f2
#endif
Packit Service 5195f2
#if (UINT_MAX < MFX_0xffff)
Packit Service 5195f2
#  include "error UINT_MAX 3"
Packit Service 5195f2
#endif
Packit Service 5195f2
#if (ULONG_MAX < MFX_0xffffffffL)
Packit Service 5195f2
#  include "error ULONG_MAX 3"
Packit Service 5195f2
#endif
Packit Service 5195f2
#if (USHRT_MAX > UINT_MAX)
Packit Service 5195f2
#  include "error USHRT_MAX vs UINT_MAX"
Packit Service 5195f2
#endif
Packit Service 5195f2
#if (UINT_MAX > ULONG_MAX)
Packit Service 5195f2
#  include "error UINT_MAX vs ULONG_MAX"
Packit Service 5195f2
#endif
Packit Service 5195f2
]], [[
Packit Service 5195f2
#if (USHRT_MAX == MFX_0xffff)
Packit Service 5195f2
{ typedef char a_short2a[1 - 2 * !(sizeof(short) == 2)]; }
Packit Service 5195f2
#elif (USHRT_MAX >= MFX_0xffff)
Packit Service 5195f2
{ typedef char a_short2b[1 - 2 * !(sizeof(short) > 2)]; }
Packit Service 5195f2
#endif
Packit Service 5195f2
#if (UINT_MAX == MFX_0xffff)
Packit Service 5195f2
{ typedef char a_int2a[1 - 2 * !(sizeof(int) == 2)]; }
Packit Service 5195f2
#elif (UINT_MAX >= MFX_0xffff)
Packit Service 5195f2
{ typedef char a_int2b[1 - 2 * !(sizeof(int) > 2)]; }
Packit Service 5195f2
#endif
Packit Service 5195f2
#if (ULONG_MAX == MFX_0xffff)
Packit Service 5195f2
{ typedef char a_long2a[1 - 2 * !(sizeof(long) == 2)]; }
Packit Service 5195f2
#elif (ULONG_MAX >= MFX_0xffff)
Packit Service 5195f2
{ typedef char a_long2b[1 - 2 * !(sizeof(long) > 2)]; }
Packit Service 5195f2
#endif
Packit Service 5195f2
#if !defined(_CRAY1) /* CRAY PVP systems */
Packit Service 5195f2
#if (USHRT_MAX == MFX_0xffffffffL)
Packit Service 5195f2
{ typedef char a_short4a[1 - 2 * !(sizeof(short) == 4)]; }
Packit Service 5195f2
#elif (USHRT_MAX >= MFX_0xffffffffL)
Packit Service 5195f2
{ typedef char a_short4b[1 - 2 * !(sizeof(short) > 4)]; }
Packit Service 5195f2
#endif
Packit Service 5195f2
#endif /* _CRAY1 */
Packit Service 5195f2
#if (UINT_MAX == MFX_0xffffffffL)
Packit Service 5195f2
{ typedef char a_int4a[1 - 2 * !(sizeof(int) == 4)]; }
Packit Service 5195f2
#elif (UINT_MAX >= MFX_0xffffffffL)
Packit Service 5195f2
{ typedef char a_int4b[1 - 2 * !(sizeof(int) > 4)]; }
Packit Service 5195f2
#endif
Packit Service 5195f2
#if (ULONG_MAX == MFX_0xffffffffL)
Packit Service 5195f2
{ typedef char a_long4a[1 - 2 * !(sizeof(long) == 4)]; }
Packit Service 5195f2
#elif (ULONG_MAX >= MFX_0xffffffffL)
Packit Service 5195f2
{ typedef char a_long4b[1 - 2 * !(sizeof(long) > 4)]; }
Packit Service 5195f2
#endif
Packit Service 5195f2
]])],
Packit Service 5195f2
[mfx_cv_header_sane_limits_h=yes],
Packit Service 5195f2
[mfx_cv_header_sane_limits_h=no])])
Packit Service 5195f2
])
Packit Service 5195f2
Packit Service 5195f2
dnl Serial 2 mfx/m4/lzo.m4
Packit Service 5195f2
Packit Service 5195f2
AC_DEFUN([mfx_LZO_CHECK_ENDIAN], [
Packit Service 5195f2
AC_C_BIGENDIAN([AC_DEFINE(LZO_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(LZO_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
Packit Service 5195f2
])
Packit Service 5195f2
Packit Service 5195f2
dnl Serial 3 mfx/m4/lzo_lzochk.m4
Packit Service 5195f2
Packit Service 5195f2
AC_DEFUN([mfx_LZO_LZOCHK], [
Packit Service 5195f2
mfx_tmp=$1
Packit Service 5195f2
mfx_save_CPPFLAGS=$CPPFLAGS
Packit Service 5195f2
dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
Packit Service 5195f2
test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
Packit Service 5195f2
Packit Service 5195f2
AC_MSG_CHECKING([whether your compiler passes the LZO conformance test])
Packit Service 5195f2
Packit Service 5195f2
AC_LANG_CONFTEST([AC_LANG_PROGRAM(
Packit Service 5195f2
[[#include <limits.h>
Packit Service 5195f2
#include <stddef.h>
Packit Service 5195f2
#define LZO_CFG_NO_CONFIG_HEADER 1
Packit Service 5195f2
#define LZO_WANT_ACC_INCD_H 1
Packit Service 5195f2
$2
Packit Service 5195f2
#include $3
Packit Service 5195f2
Packit Service 5195f2
#undef  LZOCHK_ASSERT
Packit Service 5195f2
#define LZOCHK_ASSERT(expr)     LZO_COMPILE_TIME_ASSERT_HEADER(expr)
Packit Service 5195f2
#define LZO_WANT_ACC_CHK_CH 1
Packit Service 5195f2
#include $3
Packit Service 5195f2
Packit Service 5195f2
#undef  LZOCHK_ASSERT
Packit Service 5195f2
#define LZOCHK_ASSERT(expr)     LZO_COMPILE_TIME_ASSERT(expr)
Packit Service 5195f2
static void test_lzo_compile_time_assert(void) {
Packit Service 5195f2
#define LZO_WANT_ACC_CHK_CH 1
Packit Service 5195f2
#include $3
Packit Service 5195f2
}
Packit Service 5195f2
Packit Service 5195f2
#undef NDEBUG
Packit Service 5195f2
#include <assert.h>
Packit Service 5195f2
#undef  LZOCHK_ASSERT
Packit Service 5195f2
#define LZOCHK_ASSERT(expr)     assert(expr);
Packit Service 5195f2
static int test_lzo_run_time_assert(int r) {
Packit Service 5195f2
#define LZO_WANT_ACC_CHK_CH 1
Packit Service 5195f2
#include $3
Packit Service 5195f2
return r;
Packit Service 5195f2
}
Packit Service 5195f2
]], [[
Packit Service 5195f2
test_lzo_compile_time_assert();
Packit Service 5195f2
if (test_lzo_run_time_assert(1) != 1) return 1;
Packit Service 5195f2
]]
Packit Service 5195f2
)])
Packit Service 5195f2
Packit Service 5195f2
mfx_tmp=FAILED
Packit Service 5195f2
_AC_COMPILE_IFELSE([], [mfx_tmp=yes])
Packit Service 5195f2
rm -f conftest.$ac_ext conftest.$ac_objext
Packit Service 5195f2
Packit Service 5195f2
CPPFLAGS=$mfx_save_CPPFLAGS
Packit Service 5195f2
Packit Service 5195f2
AC_MSG_RESULT([$mfx_tmp])
Packit Service 5195f2
case x$mfx_tmp in
Packit Service 5195f2
  xpassed | xyes) ;;
Packit Service 5195f2
  *)
Packit Service 5195f2
    AC_MSG_NOTICE([])
Packit Service 5195f2
    AC_MSG_NOTICE([Your compiler failed the LZO conformance test - for details see ])
Packit Service 5195f2
    AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
Packit Service 5195f2
    AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
Packit Service 5195f2
    AC_MSG_NOTICE([Thanks for your support.])
Packit Service 5195f2
    AC_MSG_NOTICE([])
Packit Service 5195f2
    AC_MSG_ERROR([LZO conformance test failed. Stop.])
Packit Service 5195f2
dnl    AS_EXIT
Packit Service 5195f2
    ;;
Packit Service 5195f2
esac
Packit Service 5195f2
])
Packit Service 5195f2
Packit Service 5195f2
dnl Serial 2 mfx/m4/mfx.m4
Packit Service 5195f2
Packit Service 5195f2
AC_DEFUN([mfx_CHECK_SIZEOF], [
Packit Service 5195f2
AC_CHECK_SIZEOF(__int32)
Packit Service 5195f2
AC_CHECK_SIZEOF(intmax_t)
Packit Service 5195f2
AC_CHECK_SIZEOF(uintmax_t)
Packit Service 5195f2
AC_CHECK_SIZEOF(intptr_t)
Packit Service 5195f2
AC_CHECK_SIZEOF(uintptr_t)
Packit Service 5195f2
Packit Service 5195f2
AC_CHECK_SIZEOF(float)
Packit Service 5195f2
AC_CHECK_SIZEOF(double)
Packit Service 5195f2
AC_CHECK_SIZEOF(long double)
Packit Service 5195f2
Packit Service 5195f2
AC_CHECK_SIZEOF(dev_t)
Packit Service 5195f2
AC_CHECK_SIZEOF(fpos_t)
Packit Service 5195f2
AC_CHECK_SIZEOF(mode_t)
Packit Service 5195f2
AC_CHECK_SIZEOF(off_t)
Packit Service 5195f2
AC_CHECK_SIZEOF(ssize_t)
Packit Service 5195f2
AC_CHECK_SIZEOF(time_t)
Packit Service 5195f2
])#
Packit Service 5195f2
Packit Service 5195f2
AC_DEFUN([mfx_CHECK_LIB_WINMM], [
Packit Service 5195f2
if test "X$GCC" = Xyes; then
Packit Service 5195f2
case $host_os in
Packit Service 5195f2
cygwin* | mingw* | pw32*)
Packit Service 5195f2
     test "X$LIBS" != "X" && LIBS="$LIBS "
Packit Service 5195f2
     LIBS="${LIBS}-lwinmm" ;;
Packit Service 5195f2
esac
Packit Service 5195f2
fi
Packit Service 5195f2
])
Packit Service 5195f2
Packit Service 5195f2
dnl Serial 2 mfx/m4/nrv.m4
Packit Service 5195f2
Packit Service 5195f2
AC_DEFUN([mfx_NRV_CHECK_ENDIAN], [
Packit Service 5195f2
AC_C_BIGENDIAN([AC_DEFINE(NRV_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(NRV_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
Packit Service 5195f2
])
Packit Service 5195f2
# Checks for stat-related time functions.
Packit Service 5195f2
Packit Service 5195f2
# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2014 Free Software
Packit Service 5195f2
# Foundation, Inc.
Packit Service 5195f2
Packit Service 5195f2
# This file is free software; the Free Software Foundation
Packit Service 5195f2
# gives unlimited permission to copy and/or distribute it,
Packit Service 5195f2
# with or without modifications, as long as this notice is preserved.
Packit Service 5195f2
Packit Service 5195f2
dnl From Paul Eggert.
Packit Service 5195f2
Packit Service 5195f2
# st_atim.tv_nsec - Linux, Solaris, Cygwin
Packit Service 5195f2
# st_atimespec.tv_nsec - FreeBSD, NetBSD, if ! defined _POSIX_SOURCE
Packit Service 5195f2
# st_atimensec - FreeBSD, NetBSD, if defined _POSIX_SOURCE
Packit Service 5195f2
# st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1)
Packit Service 5195f2
Packit Service 5195f2
# st_birthtimespec - FreeBSD, NetBSD (hidden on OpenBSD 3.9, anyway)
Packit Service 5195f2
# st_birthtim - Cygwin 1.7.0+
Packit Service 5195f2
Packit Service 5195f2
AC_DEFUN([gl_STAT_TIME],
Packit Service 5195f2
[
Packit Service 5195f2
  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
Packit Service 5195f2
  AC_CHECK_HEADERS_ONCE([sys/time.h])
Packit Service 5195f2
Packit Service 5195f2
  AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec],
Packit Service 5195f2
    [AC_CACHE_CHECK([whether struct stat.st_atim is of type struct timespec],
Packit Service 5195f2
       [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec],
Packit Service 5195f2
       [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
Packit Service 5195f2
          [[
Packit Service 5195f2
            #include <sys/types.h>
Packit Service 5195f2
            #include <sys/stat.h>
Packit Service 5195f2
            #if HAVE_SYS_TIME_H
Packit Service 5195f2
            # include <sys/time.h>
Packit Service 5195f2
            #endif
Packit Service 5195f2
            #include <time.h>
Packit Service 5195f2
            struct timespec ts;
Packit Service 5195f2
            struct stat st;
Packit Service 5195f2
          ]],
Packit Service 5195f2
          [[
Packit Service 5195f2
            st.st_atim = ts;
Packit Service 5195f2
          ]])],
Packit Service 5195f2
          [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes],
Packit Service 5195f2
          [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no])])
Packit Service 5195f2
     if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
Packit Service 5195f2
       AC_DEFINE([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC], [1],
Packit Service 5195f2
         [Define to 1 if the type of the st_atim member of a struct stat is
Packit Service 5195f2
          struct timespec.])
Packit Service 5195f2
     fi],
Packit Service 5195f2
    [AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec], [],
Packit Service 5195f2
       [AC_CHECK_MEMBERS([struct stat.st_atimensec], [],
Packit Service 5195f2
          [AC_CHECK_MEMBERS([struct stat.st_atim.st__tim.tv_nsec], [], [],
Packit Service 5195f2
             [#include <sys/types.h>
Packit Service 5195f2
              #include <sys/stat.h>])],
Packit Service 5195f2
          [#include <sys/types.h>
Packit Service 5195f2
           #include <sys/stat.h>])],
Packit Service 5195f2
       [#include <sys/types.h>
Packit Service 5195f2
        #include <sys/stat.h>])],
Packit Service 5195f2
    [#include <sys/types.h>
Packit Service 5195f2
     #include <sys/stat.h>])
Packit Service 5195f2
])
Packit Service 5195f2
Packit Service 5195f2
# Check for st_birthtime, a feature from UFS2 (FreeBSD, NetBSD, OpenBSD, etc.)
Packit Service 5195f2
# and NTFS (Cygwin).
Packit Service 5195f2
# There was a time when this field was named st_createtime (21 June
Packit Service 5195f2
# 2002 to 16 July 2002) But that window is very small and applied only
Packit Service 5195f2
# to development code, so systems still using that configuration are
Packit Service 5195f2
# not supported.  See revisions 1.10 and 1.11 of FreeBSD's
Packit Service 5195f2
# src/sys/ufs/ufs/dinode.h.
Packit Service 5195f2
#
Packit Service 5195f2
AC_DEFUN([gl_STAT_BIRTHTIME],
Packit Service 5195f2
[
Packit Service 5195f2
  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
Packit Service 5195f2
  AC_CHECK_HEADERS_ONCE([sys/time.h])
Packit Service 5195f2
  AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec], [],
Packit Service 5195f2
    [AC_CHECK_MEMBERS([struct stat.st_birthtimensec], [],
Packit Service 5195f2
      [AC_CHECK_MEMBERS([struct stat.st_birthtim.tv_nsec], [], [],
Packit Service 5195f2
         [#include <sys/types.h>
Packit Service 5195f2
          #include <sys/stat.h>])],
Packit Service 5195f2
       [#include <sys/types.h>
Packit Service 5195f2
        #include <sys/stat.h>])],
Packit Service 5195f2
    [#include <sys/types.h>
Packit Service 5195f2
     #include <sys/stat.h>])
Packit Service 5195f2
])
Packit Service 5195f2
Packit Service 5195f2
dnl Serial 2 mfx/m4/ucl.m4
Packit Service 5195f2
Packit Service 5195f2
AC_DEFUN([mfx_UCL_CHECK_ENDIAN], [
Packit Service 5195f2
AC_C_BIGENDIAN([AC_DEFINE(UCL_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(UCL_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
Packit Service 5195f2
])