Use an all-permissive copyright notice, recommended by RMS.
[gnulib.git] / m4 / d-type.m4
1 #serial 8
2
3 dnl From Jim Meyering.
4 dnl
5 dnl Check whether struct dirent has a member named d_type.
6 dnl
7
8 # Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
9 # Foundation, Inc.
10 #
11 # This file is free software; the Free Software Foundation
12 # gives unlimited permission to copy and/or distribute it,
13 # with or without modifications, as long as this notice is preserved.
14
15 AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE],
16   [AC_REQUIRE([AC_HEADER_DIRENT])dnl
17    AC_CACHE_CHECK([for d_type member in directory struct],
18                   jm_cv_struct_dirent_d_type,
19      [AC_TRY_LINK(dnl
20        [
21 #include <sys/types.h>
22 #ifdef HAVE_DIRENT_H
23 # include <dirent.h>
24 #else /* not HAVE_DIRENT_H */
25 # define dirent direct
26 # ifdef HAVE_SYS_NDIR_H
27 #  include <sys/ndir.h>
28 # endif /* HAVE_SYS_NDIR_H */
29 # ifdef HAVE_SYS_DIR_H
30 #  include <sys/dir.h>
31 # endif /* HAVE_SYS_DIR_H */
32 # ifdef HAVE_NDIR_H
33 #  include <ndir.h>
34 # endif /* HAVE_NDIR_H */
35 #endif /* HAVE_DIRENT_H */
36        ],
37        [struct dirent dp; dp.d_type = 0;],
38
39        jm_cv_struct_dirent_d_type=yes,
40        jm_cv_struct_dirent_d_type=no)
41      ]
42    )
43    if test $jm_cv_struct_dirent_d_type = yes; then
44      AC_DEFINE(HAVE_STRUCT_DIRENT_D_TYPE, 1,
45        [Define if there is a member named d_type in the struct describing
46         directory headers.])
47    fi
48   ]
49 )