diff options
author | Jim Meyering <jim@meyering.net> | 2003-08-09 18:37:08 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-08-09 18:37:08 +0000 |
commit | d51e9c474b8a4938824b37a6808b2cd9ed3b4655 (patch) | |
tree | 64861353c30b32c6048a0932602241a074f67e21 /aclocal.m4 | |
parent | 67c22b0af278f61fb2d6ec27941b1ca0b9944008 (diff) | |
download | coreutils-d51e9c474b8a4938824b37a6808b2cd9ed3b4655.tar.xz |
.
Diffstat (limited to 'aclocal.m4')
-rw-r--r-- | aclocal.m4 | 192 |
1 files changed, 106 insertions, 86 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index 24475a536..09d335eae 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1863,6 +1863,7 @@ AC_DEFUN([jm_PREREQ], AC_REQUIRE([jm_PREREQ_STAT]) AC_REQUIRE([jm_PREREQ_STRNLEN]) AC_REQUIRE([jm_PREREQ_TEMPNAME]) # called by mkstemp + AC_REQUIRE([gl_UTIMENS]) AC_REQUIRE([jm_PREREQ_XGETCWD]) AC_REQUIRE([jm_PREREQ_XREADLINK]) ]) @@ -2418,6 +2419,108 @@ AC_DEFUN([jm_FUNC_MBRTOWC], fi ]) +dnl Copyright (C) 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_UTIMENS], +[ + dnl Prerequisites of lib/utimens.c. + AC_REQUIRE([gl_TIMESPEC]) + AC_REQUIRE([jm_CHECK_TYPE_STRUCT_TIMESPEC]) + AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF]) + AC_CHECK_FUNCS_ONCE(utime) +]) + +#serial 7 + +dnl From Jim Meyering + +AC_DEFUN([gl_TIMESPEC], +[ + dnl Prerequisites of lib/timespec.h. + AC_REQUIRE([AC_HEADER_TIME]) + AC_CHECK_HEADERS_ONCE(sys/time.h) + jm_CHECK_TYPE_STRUCT_TIMESPEC + AC_STRUCT_ST_MTIM_NSEC + + dnl Persuade glibc <time.h> to declare nanosleep(). + AC_REQUIRE([AC_GNU_SOURCE]) + + AC_CHECK_DECLS(nanosleep, , , [#include <time.h>]) +]) + +dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared +dnl in time.h or sys/time.h. + +AC_DEFUN([jm_CHECK_TYPE_STRUCT_TIMESPEC], +[ + dnl Persuade pedantic Solaris to declare struct timespec. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([AC_HEADER_TIME]) + AC_CHECK_HEADERS_ONCE(sys/time.h) + AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec, + [AC_TRY_COMPILE( + [ +# if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +# else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +# endif + ], + [static struct timespec x; x.tv_sec = x.tv_nsec;], + fu_cv_sys_struct_timespec=yes, + fu_cv_sys_struct_timespec=no) + ]) + + if test $fu_cv_sys_struct_timespec = yes; then + AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, + [Define if struct timespec is declared in <time.h>. ]) + fi +]) + +#serial 6 + +dnl From Paul Eggert. + +# Define ST_MTIM_NSEC to be the nanoseconds member of struct stat's st_mtim, +# if it exists. + +AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC], + [AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim], + ac_cv_struct_st_mtim_nsec, + [ac_save_CPPFLAGS="$CPPFLAGS" + ac_cv_struct_st_mtim_nsec=no + # tv_nsec -- the usual case + # _tv_nsec -- Solaris 2.6, if + # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1 + # && !defined __EXTENSIONS__) + # st__tim.tv_nsec -- UnixWare 2.1.2 + for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do + CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val" + AC_TRY_COMPILE([#include <sys/types.h> +#include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;], + [ac_cv_struct_st_mtim_nsec=$ac_val; break]) + done + CPPFLAGS="$ac_save_CPPFLAGS"]) + + if test $ac_cv_struct_st_mtim_nsec != no; then + AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec, + [Define to be the nanoseconds member of struct stat's st_mtim, + if it exists.]) + fi + ] +) + #serial 5 dnl A replacement for autoconf's macro by the same name. This version @@ -4368,6 +4471,9 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF], AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) AC_CHECK_FUNCS(snprintf) + + # Solaris 2.5.1 needs -lw to get the wcslen function. + AC_SEARCH_LIBS(wcslen, [w]) ]) # Prerequisites of lib/asnprintf.c. @@ -6470,39 +6576,6 @@ AC_DEFUN([AC_FUNC_CANONICALIZE_FILE_NAME], AC_CHECK_FUNC([canonicalize_file_name], , [AC_LIBOBJ(canonicalize)]) ]) -#serial 6 - -dnl From Paul Eggert. - -# Define ST_MTIM_NSEC to be the nanoseconds member of struct stat's st_mtim, -# if it exists. - -AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC], - [AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim], - ac_cv_struct_st_mtim_nsec, - [ac_save_CPPFLAGS="$CPPFLAGS" - ac_cv_struct_st_mtim_nsec=no - # tv_nsec -- the usual case - # _tv_nsec -- Solaris 2.6, if - # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1 - # && !defined __EXTENSIONS__) - # st__tim.tv_nsec -- UnixWare 2.1.2 - for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do - CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val" - AC_TRY_COMPILE([#include <sys/types.h> -#include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;], - [ac_cv_struct_st_mtim_nsec=$ac_val; break]) - done - CPPFLAGS="$ac_save_CPPFLAGS"]) - - if test $ac_cv_struct_st_mtim_nsec != no; then - AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec, - [Define to be the nanoseconds member of struct stat's st_mtim, - if it exists.]) - fi - ] -) - #serial 3 # Define HAVE_ST_DM_MODE if struct stat has an st_dm_mode member. @@ -6521,59 +6594,6 @@ AC_DEFUN([AC_STRUCT_ST_DM_MODE], ] ) -#serial 7 - -dnl From Jim Meyering - -AC_DEFUN([gl_TIMESPEC], -[ - dnl Prerequisites of lib/timespec.h. - AC_REQUIRE([AC_HEADER_TIME]) - AC_CHECK_HEADERS_ONCE(sys/time.h) - jm_CHECK_TYPE_STRUCT_TIMESPEC - AC_STRUCT_ST_MTIM_NSEC - - dnl Persuade glibc <time.h> to declare nanosleep(). - AC_REQUIRE([AC_GNU_SOURCE]) - - AC_CHECK_DECLS(nanosleep, , , [#include <time.h>]) -]) - -dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared -dnl in time.h or sys/time.h. - -AC_DEFUN([jm_CHECK_TYPE_STRUCT_TIMESPEC], -[ - dnl Persuade pedantic Solaris to declare struct timespec. - AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) - - AC_REQUIRE([AC_HEADER_TIME]) - AC_CHECK_HEADERS_ONCE(sys/time.h) - AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec, - [AC_TRY_COMPILE( - [ -# if TIME_WITH_SYS_TIME -# include <sys/time.h> -# include <time.h> -# else -# if HAVE_SYS_TIME_H -# include <sys/time.h> -# else -# include <time.h> -# endif -# endif - ], - [static struct timespec x; x.tv_sec = x.tv_nsec;], - fu_cv_sys_struct_timespec=yes, - fu_cv_sys_struct_timespec=no) - ]) - - if test $fu_cv_sys_struct_timespec = yes; then - AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, - [Define if struct timespec is declared in <time.h>. ]) - fi -]) - #serial 6 dnl From Jim Meyering and Paul Eggert. AC_DEFUN([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H], |