diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2009-03-19 23:48:20 +0100 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2009-03-21 17:40:30 +0100 |
commit | 48a9e9afb9436c587ae29148a3dfa507e88adf36 (patch) | |
tree | af553adf19e22d115b613741291e41d9c9f5f990 /m4 | |
parent | 2b05b5c02083f87b12e48f6262d18691dd5fa8c5 (diff) | |
download | patch-48a9e9afb9436c587ae29148a3dfa507e88adf36.tar.gz |
Various changes lumped together
(Imported from working tree by Andreas Gruenbacher)
Diffstat (limited to 'm4')
-rw-r--r-- | m4/exitfail.m4 | 13 | ||||
-rw-r--r-- | m4/extensions.m4 | 15 | ||||
-rw-r--r-- | m4/hash.m4 | 13 | ||||
-rw-r--r-- | m4/st_mtim.m4 | 32 | ||||
-rw-r--r-- | m4/timespec.m4 | 52 |
5 files changed, 125 insertions, 0 deletions
diff --git a/m4/exitfail.m4 b/m4/exitfail.m4 new file mode 100644 index 0000000..fa5b149 --- /dev/null +++ b/m4/exitfail.m4 @@ -0,0 +1,13 @@ +# exitfail.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_EXITFAIL], +[ + dnl No prerequisites of lib/exitfail.c. + : +]) diff --git a/m4/extensions.m4 b/m4/extensions.m4 new file mode 100644 index 0000000..7faaa83 --- /dev/null +++ b/m4/extensions.m4 @@ -0,0 +1,15 @@ +# gl_USE_SYSTEM_EXTENSIONS +# ------------------------ +# Enable extensions on systems that normally disable them, +# typically due to standards-conformance issues. +AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS], [ + AC_REQUIRE([AC_GNU_SOURCE]) + AH_VERBATIM([__EXTENSIONS__], +[/* Enable extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif]) + AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl + AC_BEFORE([$0], [AC_RUN_IFELSE])dnl + AC_DEFINE([__EXTENSIONS__]) +]) diff --git a/m4/hash.m4 b/m4/hash.m4 new file mode 100644 index 0000000..9fe3211 --- /dev/null +++ b/m4/hash.m4 @@ -0,0 +1,13 @@ +# hash.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_HASH], +[ + dnl Prerequisites of lib/hash.c. + AC_REQUIRE([AM_STDBOOL_H]) +]) diff --git a/m4/st_mtim.m4 b/m4/st_mtim.m4 new file mode 100644 index 0000000..4d03c8e --- /dev/null +++ b/m4/st_mtim.m4 @@ -0,0 +1,32 @@ +#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 + ] +) diff --git a/m4/timespec.m4 b/m4/timespec.m4 new file mode 100644 index 0000000..5ca16d4 --- /dev/null +++ b/m4/timespec.m4 @@ -0,0 +1,52 @@ +#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 +]) |