X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=m4%2Fnanosleep.m4;h=2d6c90b47bf322be1e8d86b9dfb9534407d5a605;hb=3585608d42307ab95969d64555a9c2f92fd90caa;hp=43df207cf62c58503fcb77956c6c73d73ad1e432;hpb=a965c0038c4b72af2497d3ec44aeb4587c2478d5;p=gnulib.git diff --git a/m4/nanosleep.m4 b/m4/nanosleep.m4 index 43df207cf..2d6c90b47 100644 --- a/m4/nanosleep.m4 +++ b/m4/nanosleep.m4 @@ -1,23 +1,33 @@ -#serial 7 +#serial 14 dnl From Jim Meyering. dnl Check for the nanosleep function. dnl If not found, use the supplied replacement. dnl -AC_DEFUN(jm_FUNC_NANOSLEEP, +# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_NANOSLEEP], [ + AC_LIBSOURCES([nanosleep.c]) + nanosleep_save_libs=$LIBS # Solaris 2.5.1 needs -lposix4 to get the nanosleep function. # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. - AC_SEARCH_LIBS(nanosleep, [rt posix4], [LIB_NANOSLEEP=$ac_cv_search_nanosleep]) - AC_SUBST(LIB_NANOSLEEP) + AC_SEARCH_LIBS([nanosleep], [rt posix4], + [test "$ac_cv_search_nanosleep" = "none required" || + LIB_NANOSLEEP=$ac_cv_search_nanosleep]) + AC_SUBST([LIB_NANOSLEEP]) AC_CACHE_CHECK([whether nanosleep works], jm_cv_func_nanosleep_works, [ AC_REQUIRE([AC_HEADER_TIME]) + AC_CHECK_HEADERS_ONCE(sys/time.h) AC_TRY_RUN([ # if TIME_WITH_SYS_TIME # include @@ -45,10 +55,17 @@ AC_DEFUN(jm_FUNC_NANOSLEEP, jm_cv_func_nanosleep_works=no) ]) if test $jm_cv_func_nanosleep_works = no; then - AC_LIBOBJ([nanosleep]) - AC_DEFINE_UNQUOTED(nanosleep, rpl_nanosleep, + AC_LIBOBJ(nanosleep) + AC_DEFINE(nanosleep, rpl_nanosleep, [Define to rpl_nanosleep if the replacement function should be used.]) + gl_PREREQ_NANOSLEEP fi LIBS=$nanosleep_save_libs ]) + +# Prerequisites of lib/nanosleep.c. +AC_DEFUN([gl_PREREQ_NANOSLEEP], +[ + AC_CHECK_FUNCS_ONCE(siginterrupt) +])