annotate m4/glob.m4 @ 17480:f40b3156a43e

selinux-at: omit unnecessary include * lib/selinux-at.c: Don't include dosname.h; not needed, since this source file doesn't use its macros, and subsidiary files that use the macros already include it.
author Paul Eggert <eggert@cs.ucla.edu>
date Fri, 23 Aug 2013 13:53:46 -0700
parents e542fd46ad6f
children 344018b6e5d7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14977
dba5736dcefe glob: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents: 14712
diff changeset
1 # glob.m4 serial 14
17249
e542fd46ad6f maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 16201
diff changeset
2 dnl Copyright (C) 2005-2007, 2009-2013 Free Software Foundation, Inc.
5898
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
3 dnl This file is free software; the Free Software Foundation
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
6
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
7 # The glob module assumes you want GNU glob, with glob_pattern_p etc,
6942
9e87d8474fb1 * lib/argp-pv.c: Remove a doubled word in a comment.
Jim Meyering <jim@meyering.net>
parents: 6934
diff changeset
8 # rather than vanilla POSIX glob. This means your code should
5898
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
9 # always include <glob.h> for the glob prototypes.
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
10
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
11 AC_DEFUN([gl_GLOB],
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
12 [ GLOB_H=
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
13 AC_CHECK_HEADERS([glob.h], [], [GLOB_H=glob.h])
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
14
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
15 if test -z "$GLOB_H"; then
5986
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
16 AC_CACHE_CHECK([for GNU glob interface version 1],
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
17 [gl_cv_gnu_glob_interface_version_1],
13584
ac5cb0e1a58f glob: fix compile test
Eric Blake <eblake@redhat.com>
parents: 12559
diff changeset
18 [ AC_COMPILE_IFELSE([AC_LANG_SOURCE(
5898
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
19 [[#include <gnu-versions.h>
13584
ac5cb0e1a58f glob: fix compile test
Eric Blake <eblake@redhat.com>
parents: 12559
diff changeset
20 char a[_GNU_GLOB_INTERFACE_VERSION == 1 ? 1 : -1];]])],
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 9557
diff changeset
21 [gl_cv_gnu_glob_interface_version_1=yes],
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 9557
diff changeset
22 [gl_cv_gnu_glob_interface_version_1=no])])
5986
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
23
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
24 if test "$gl_cv_gnu_glob_interface_version_1" = "no"; then
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
25 GLOB_H=glob.h
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
26 fi
5898
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
27 fi
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
28
5986
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
29 if test -z "$GLOB_H"; then
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
30 AC_CACHE_CHECK([whether glob lists broken symlinks],
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
31 [gl_cv_glob_lists_symlinks],
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
32 [ if ln -s conf-doesntexist conf$$-globtest 2>/dev/null; then
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
33 gl_cv_glob_lists_symlinks=maybe
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
34 else
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
35 # If we can't make a symlink, then we cannot test this issue. Be
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
36 # pessimistic about this.
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
37 gl_cv_glob_lists_symlinks=no
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
38 fi
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
39
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
40 if test $gl_cv_glob_lists_symlinks = maybe; then
13584
ac5cb0e1a58f glob: fix compile test
Eric Blake <eblake@redhat.com>
parents: 12559
diff changeset
41 AC_RUN_IFELSE([
5986
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
42 AC_LANG_PROGRAM(
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
43 [[#include <stddef.h>
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
44 #include <glob.h>]],
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
45 [[glob_t found;
13584
ac5cb0e1a58f glob: fix compile test
Eric Blake <eblake@redhat.com>
parents: 12559
diff changeset
46 if (glob ("conf*-globtest", 0, NULL, &found) == GLOB_NOMATCH) return 1;]])],
5986
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
47 [gl_cv_glob_lists_symlinks=yes],
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
48 [gl_cv_glob_lists_symlinks=no], [gl_cv_glob_lists_symlinks=no])
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
49 fi])
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
50
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
51 if test $gl_cv_glob_lists_symlinks = no; then
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
52 GLOB_H=glob.h
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
53 fi
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
54 fi
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
55
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
56 rm -f conf$$-globtest
f84b6f02ec36 * m4/glob.m4 (gl_GLOB): Cache glob interface check result. Add check for
Derek R. Price <derek@ximbiot.com>
parents: 5901
diff changeset
57
14528
662ae53d8d37 Remove leftover generated .h files after config.status changed.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
58 AC_SUBST([GLOB_H])
662ae53d8d37 Remove leftover generated .h files after config.status changed.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
59 AM_CONDITIONAL([GL_GENERATE_GLOB_H], [test -n "$GLOB_H"])
5898
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
60 ])
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
61
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
62 # Prerequisites of lib/glob.*.
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
63 AC_DEFUN([gl_PREREQ_GLOB],
8777
b0892cca14c9 Make the generated glob.h self-contained.
Bruno Haible <bruno@clisp.org>
parents: 7172
diff changeset
64 [
b0892cca14c9 Make the generated glob.h self-contained.
Bruno Haible <bruno@clisp.org>
parents: 7172
diff changeset
65 AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])dnl
7100
1401e9cfcacd Remove the 'restrict' module, and modify everybody to use AC_C_RESTRICT
Paul Eggert <eggert@cs.ucla.edu>
parents: 6949
diff changeset
66 AC_REQUIRE([AC_C_RESTRICT])dnl
9209
5a0294ce5372 Track CVS Autoconf on AC_USE_SYSTEM_EXTENSIONS.
Eric Blake <ebb9@byu.net>
parents: 8779
diff changeset
67 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])dnl
5898
429b55c14554 * MODULES.html.sh: Add glob to Enhanced POSIX.2001 section.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
68 AC_CHECK_HEADERS_ONCE([sys/cdefs.h unistd.h])dnl
8777
b0892cca14c9 Make the generated glob.h self-contained.
Bruno Haible <bruno@clisp.org>
parents: 7172
diff changeset
69 if test $ac_cv_header_sys_cdefs_h = yes; then
b0892cca14c9 Make the generated glob.h self-contained.
Bruno Haible <bruno@clisp.org>
parents: 7172
diff changeset
70 HAVE_SYS_CDEFS_H=1
b0892cca14c9 Make the generated glob.h self-contained.
Bruno Haible <bruno@clisp.org>
parents: 7172
diff changeset
71 else
b0892cca14c9 Make the generated glob.h self-contained.
Bruno Haible <bruno@clisp.org>
parents: 7172
diff changeset
72 HAVE_SYS_CDEFS_H=0
b0892cca14c9 Make the generated glob.h self-contained.
Bruno Haible <bruno@clisp.org>
parents: 7172
diff changeset
73 fi
b0892cca14c9 Make the generated glob.h self-contained.
Bruno Haible <bruno@clisp.org>
parents: 7172
diff changeset
74 AC_SUBST([HAVE_SYS_CDEFS_H])
9557
81a0ee2e4e00 Ensure that 'glob' stays under LGPLv2+.
Bruno Haible <bruno@clisp.org>
parents: 9209
diff changeset
75 AC_CHECK_FUNCS_ONCE([fstatat getlogin_r getpwnam_r])dnl
8777
b0892cca14c9 Make the generated glob.h self-contained.
Bruno Haible <bruno@clisp.org>
parents: 7172
diff changeset
76 ])