many *.m4 files: improve m4 quoting
[gnulib.git] / m4 / d-type.m4
1 # serial 10
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-2004, 2006, 2009 Free Software Foundation, Inc.
9 #
10 # This file is free software; the Free Software Foundation
11 # gives unlimited permission to copy and/or distribute it,
12 # with or without modifications, as long as this notice is preserved.
13
14 AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE],
15   [AC_CACHE_CHECK([for d_type member in directory struct],
16                   gl_cv_struct_dirent_d_type,
17      [AC_TRY_LINK(dnl
18        [
19 #include <sys/types.h>
20 #include <dirent.h>
21        ],
22        [struct dirent dp; dp.d_type = 0;],
23
24        gl_cv_struct_dirent_d_type=yes,
25        gl_cv_struct_dirent_d_type=no)
26      ]
27    )
28    if test $gl_cv_struct_dirent_d_type = yes; then
29      AC_DEFINE([HAVE_STRUCT_DIRENT_D_TYPE], [1],
30        [Define if there is a member named d_type in the struct describing
31         directory headers.])
32    fi
33   ]
34 )