Home | History | Annotate | Download | only in m4
      1 # serial 15
      2 # Configure fcntl.h.
      3 dnl Copyright (C) 2006-2007, 2009-2012 Free Software Foundation, Inc.
      4 dnl This file is free software; the Free Software Foundation
      5 dnl gives unlimited permission to copy and/or distribute it,
      6 dnl with or without modifications, as long as this notice is preserved.
      7 
      8 dnl Written by Paul Eggert.
      9 
     10 AC_DEFUN([gl_FCNTL_H],
     11 [
     12   AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
     13   AC_REQUIRE([gl_FCNTL_O_FLAGS])
     14   gl_NEXT_HEADERS([fcntl.h])
     15 
     16   dnl Ensure the type pid_t gets defined.
     17   AC_REQUIRE([AC_TYPE_PID_T])
     18 
     19   dnl Ensure the type mode_t gets defined.
     20   AC_REQUIRE([AC_TYPE_MODE_T])
     21 
     22   dnl Check for declarations of anything we want to poison if the
     23   dnl corresponding gnulib module is not in use, if it is not common
     24   dnl enough to be declared everywhere.
     25   gl_WARN_ON_USE_PREPARE([[#include <fcntl.h>
     26     ]], [fcntl openat])
     27 ])
     28 
     29 AC_DEFUN([gl_FCNTL_MODULE_INDICATOR],
     30 [
     31   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
     32   AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
     33   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
     34   dnl Define it also as a C macro, for the benefit of the unit tests.
     35   gl_MODULE_INDICATOR_FOR_TESTS([$1])
     36 ])
     37 
     38 AC_DEFUN([gl_FCNTL_H_DEFAULTS],
     39 [
     40   GNULIB_FCNTL=0;        AC_SUBST([GNULIB_FCNTL])
     41   GNULIB_NONBLOCKING=0;  AC_SUBST([GNULIB_NONBLOCKING])
     42   GNULIB_OPEN=0;         AC_SUBST([GNULIB_OPEN])
     43   GNULIB_OPENAT=0;       AC_SUBST([GNULIB_OPENAT])
     44   dnl Assume proper GNU behavior unless another module says otherwise.
     45   HAVE_FCNTL=1;          AC_SUBST([HAVE_FCNTL])
     46   HAVE_OPENAT=1;         AC_SUBST([HAVE_OPENAT])
     47   REPLACE_FCNTL=0;       AC_SUBST([REPLACE_FCNTL])
     48   REPLACE_OPEN=0;        AC_SUBST([REPLACE_OPEN])
     49   REPLACE_OPENAT=0;      AC_SUBST([REPLACE_OPENAT])
     50 ])
     51