summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2002-05-16 18:45:56 +0000
committerChristos Zoulas <christos@zoulas.com>2002-05-16 18:45:56 +0000
commit3ea3bab85453826ea4fc58058b86d571ffd8db55 (patch)
tree51ad642c3ec86eaf927cef36e79381aed369e080 /acinclude.m4
parent556eedbdc851488980aa40894a4d95873c3306b4 (diff)
downloadfile-git-3ea3bab85453826ea4fc58058b86d571ffd8db55.tar.gz
- pt_note elf additions from NetBSD
- EMX os specific changes (Alexander Mai) - stdint.h detection, acconfig.h fixes (Maciej W. Rozycki, Franz Korntner) - regex file additions (Kim Cromie) - getopt_long support and misc cleanups (Michael Piefel) - many magic fixes and additions
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m493
1 files changed, 63 insertions, 30 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 0b1b0a53..79ecb0e1 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1,5 +1,5 @@
dnl cloned from autoconf 2.13 acspecific.m4
-AC_DEFUN(AC_C_LONG_LONG,
+AC_DEFUN([AC_C_LONG_LONG],
[AC_CACHE_CHECK(for long long, ac_cv_c_long_long,
[if test "$GCC" = yes; then
ac_cv_c_long_long=yes
@@ -14,23 +14,16 @@ if test $ac_cv_c_long_long = yes; then
fi
])
-dnl from autoconf 2.13 acgeneral.m4, with patch:
-dnl Date: Fri, 15 Jan 1999 05:52:41 -0800
-dnl Message-ID: <199901151352.FAA18237@shade.twinsun.com>
-dnl From: eggert@twinsun.com (Paul Eggert)
-dnl Subject: autoconf 2.13 AC_CHECK_TYPE doesn't allow shell vars
-dnl Newsgroups: gnu.utils.bug
-
dnl from autoconf 2.13 acspecific.m4, with changes to check for daylight
-AC_DEFUN(AC_STRUCT_TIMEZONE_DAYLIGHT,
+AC_DEFUN([AC_STRUCT_TIMEZONE_DAYLIGHT],
[AC_REQUIRE([AC_STRUCT_TM])dnl
AC_CACHE_CHECK([for tm_zone in struct tm], ac_cv_struct_tm_zone,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_zone;],
ac_cv_struct_tm_zone=yes, ac_cv_struct_tm_zone=no)])
if test "$ac_cv_struct_tm_zone" = yes; then
- AC_DEFINE(HAVE_TM_ZONE)
+ AC_DEFINE(HAVE_TM_ZONE,1,[HAVE_TM_ZONE])
fi
AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
[AC_TRY_LINK(
@@ -42,7 +35,7 @@ extern char *tzname[]; /* RS6000 and others reject char **tzname. */
changequote([, ])dnl
[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])
if test $ac_cv_var_tzname = yes; then
- AC_DEFINE(HAVE_TZNAME)
+ AC_DEFINE(HAVE_TZNAME,1,[HAVE_TZNAME])
fi
AC_CACHE_CHECK([for tm_isdst in struct tm], ac_cv_struct_tm_isdst,
@@ -66,15 +59,27 @@ changequote([, ])dnl
fi
])
-dnl AC_CHECK_TYPE2(TYPE, DEFAULT)
-AC_DEFUN(AC_CHECK_TYPE2,
+dnl from autoconf 2.13 acgeneral.m4, with patch:
+dnl Date: Fri, 15 Jan 1999 05:52:41 -0800
+dnl Message-ID: <199901151352.FAA18237@shade.twinsun.com>
+dnl From: eggert@twinsun.com (Paul Eggert)
+dnl Subject: autoconf 2.13 AC_CHECK_TYPE doesn't allow shell vars
+dnl Newsgroups: gnu.utils.bug
+dnl
+dnl now include <stdint.h> if available
+
+dnl AC_CHECK_TYPE2_STDC(TYPE, DEFAULT)
+AC_DEFUN([AC_CHECK_TYPE2_STDC],
[AC_REQUIRE([AC_HEADER_STDC])dnl
+AC_REQUIRE([AC_HEADER_STDINT])dnl
AC_MSG_CHECKING(for $1)
AC_CACHE_VAL(ac_cv_type_$1,
[AC_EGREP_CPP(dnl
-changequote(<<,>>)dnl
-<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
-changequote([,]), [#include <sys/types.h>
+[(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]],
+[#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
@@ -88,14 +93,12 @@ fi
])
dnl from autoconf 2.13 acgeneral.m4, with additional third argument
-dnl AC_CHECK_SIZEOF_INCLUDES(TYPE [, CROSS-SIZE, [INCLUDES]])
-AC_DEFUN(AC_CHECK_SIZEOF_INCLUDES,
-[changequote(<<, >>)dnl
-dnl The name to #define.
-define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
+dnl AC_CHECK_SIZEOF_INCLUDES(TYPE [, CROSS-SIZE [, INCLUDES]])
+AC_DEFUN([AC_CHECK_SIZEOF_INCLUDES],
+[dnl The name to #define.
+define([AC_TYPE_NAME], translit(sizeof_$1, [[[a-z *]]], [[[A-Z_P]]]))dnl
dnl The cache variable name.
-define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
-changequote([, ])dnl
+define([AC_CV_NAME], translit(ac_cv_sizeof_$1, [[[ *]]], [[[_p]]]))dnl
AC_MSG_CHECKING(size of $1)
AC_CACHE_VAL(AC_CV_NAME,
[AC_TRY_RUN([$3
@@ -114,9 +117,14 @@ undefine([AC_CV_NAME])dnl
])
dnl AC_CHECK_SIZEOF_STDC_HEADERS(TYPE [, CROSS_SIZE])
-AC_DEFUN(AC_CHECK_SIZEOF_STDC_HEADERS,
-[AC_CHECK_SIZEOF_INCLUDES($1, $2,
-[#include <sys/types.h>
+AC_DEFUN([AC_CHECK_SIZEOF_STDC_HEADERS],
+[AC_REQUIRE([AC_HEADER_STDC])dnl
+AC_REQUIRE([AC_HEADER_STDINT])dnl
+AC_CHECK_SIZEOF_INCLUDES($1, $2,
+[#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include <sys/types.h>
#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
@@ -124,6 +132,31 @@ AC_DEFUN(AC_CHECK_SIZEOF_STDC_HEADERS,
])
+dnl AC_CHECK_TYPE_STDC(TYPE, DEFAULT)
+AC_DEFUN([AC_CHECK_TYPE_STDC],
+[AC_REQUIRE([AC_HEADER_STDC])dnl
+AC_REQUIRE([AC_HEADER_STDINT])dnl
+AC_MSG_CHECKING(for $1)
+AC_CACHE_VAL(ac_cv_type_$1,
+[AC_EGREP_CPP(dnl
+[(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]],
+[#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
+AC_MSG_RESULT($ac_cv_type_$1)
+if test $ac_cv_type_$1 = no; then
+ AC_DEFINE($1, $2)
+fi
+])
+
+dnl AC_HEADER_STDINT
+AC_DEFUN([AC_HEADER_STDINT], [AC_CHECK_HEADERS(stdint.h)])
+
#serial 19
dnl By default, many hosts won't let programs access large files;
@@ -135,7 +168,7 @@ dnl Written by Paul Eggert <eggert@twinsun.com>.
dnl Internal subroutine of AC_SYS_LARGEFILE.
dnl AC_SYS_LARGEFILE_TEST_INCLUDES
-AC_DEFUN(AC_SYS_LARGEFILE_TEST_INCLUDES,
+AC_DEFUN([AC_SYS_LARGEFILE_TEST_INCLUDES],
[[#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply "#define LARGE_OFF_T 9223372036854775807",
@@ -150,7 +183,7 @@ AC_DEFUN(AC_SYS_LARGEFILE_TEST_INCLUDES,
dnl Internal subroutine of AC_SYS_LARGEFILE.
dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR, COMMENT, INCLU=
DES, FUNCTION-BODY)
-AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
+AC_DEFUN([AC_SYS_LARGEFILE_MACRO_VALUE],
[AC_CACHE_CHECK([for $1 value needed for large files], $3,
[$3=no
AC_TRY_COMPILE([$5],
@@ -165,7 +198,7 @@ AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
AC_DEFINE_UNQUOTED([$1], [$]$3, [$4])
fi])
-AC_DEFUN(AC_SYS_LARGEFILE,
+AC_DEFUN([AC_SYS_LARGEFILE],
[AC_REQUIRE([AC_PROG_CC])
AC_ARG_ENABLE(largefile,
[ --disable-largefile omit support for large files])
@@ -200,7 +233,7 @@ AC_DEFUN(AC_SYS_LARGEFILE,
fi
])
-AC_DEFUN(AC_FUNC_FSEEKO,
+AC_DEFUN([AC_FUNC_FSEEKO],
[AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
ac_cv_sys_largefile_source,
[Define to make fseeko visible on some hosts (e.g. glibc 2.2).],