X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fsys_select_h.m4;h=95e7818fd83c0a83e1e2318b16832a12a5ff016c;hb=1bce9152c7fa70ba4408e43c758900df25f9a775;hp=0bb097e1a7395af4f103fe94ce7b5de947705076;hpb=d93c1f1b00e1dea78b919c7fb7b6ddebecfcf3a5;p=gnulib.git diff --git a/m4/sys_select_h.m4 b/m4/sys_select_h.m4 index 0bb097e1a..95e7818fd 100644 --- a/m4/sys_select_h.m4 +++ b/m4/sys_select_h.m4 @@ -1,5 +1,5 @@ -# sys_select_h.m4 serial 8 -dnl Copyright (C) 2006-2009 Free Software Foundation, Inc. +# sys_select_h.m4 serial 14 +dnl Copyright (C) 2006-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -17,7 +17,7 @@ AC_DEFUN([gl_HEADER_SYS_SELECT], dnl 2. On OSF/1 4.0, provides only a forward declaration dnl of 'struct timeval', and no definition of this type. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[struct timeval b;]])], + [[struct timeval b;]])], [gl_cv_header_sys_select_h_selfcontained=yes], [gl_cv_header_sys_select_h_selfcontained=no]) dnl Test against another bug: @@ -45,27 +45,36 @@ AC_DEFUN([gl_HEADER_SYS_SELECT], ]) fi ]) - if test $gl_cv_header_sys_select_h_selfcontained = yes; then - SYS_SELECT_H='' + AC_CHECK_HEADERS_ONCE([sys/select.h]) + dnl is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([sys/select.h]) + if test $ac_cv_header_sys_select_h = yes; then + HAVE_SYS_SELECT_H=1 else - SYS_SELECT_H='sys/select.h' - gl_CHECK_NEXT_HEADERS([sys/select.h]) - if test $ac_cv_header_sys_select_h = yes; then - HAVE_SYS_SELECT_H=1 - else - HAVE_SYS_SELECT_H=0 - fi - AC_SUBST([HAVE_SYS_SELECT_H]) - gl_PREREQ_SYS_H_WINSOCK2 + HAVE_SYS_SELECT_H=0 fi - AC_SUBST([SYS_SELECT_H]) + AC_SUBST([HAVE_SYS_SELECT_H]) + gl_PREREQ_SYS_H_WINSOCK2 + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ +/* Some systems require prerequisite headers. */ +#include +#if !defined __GLIBC__ && HAVE_SYS_TIME_H +# include +#endif +#include + ]], [select]) ]) AC_DEFUN([gl_SYS_SELECT_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_SYS_SELECT_H_DEFAULTS]) - GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_SYS_SELECT_H_DEFAULTS],