Mercurial > hg > octave-jordi > gnulib-hg
annotate m4/fcntl_h.m4 @ 11007:f6cba5a556ce
many *.m4 files: improve m4 quoting
99% of this change was performed by running the following commands:
git ls-files | grep '\.m4$' | xargs perl -pi \
-e 's/(AC_\w+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_\w+\((?:\[[^,]+?\], ){1})([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_\w+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_\w+\((?:\[[^,]+?\], ){3})([^,[()]+?)([,)])/$1\[$2]$3/g'
perl -pi -e 's/\[\.\.\.\]/.../' m4/onceonly.m4
The remainder were to add Copyright dates, increment serial numbers,
undo some changes in comments, exclude m4/intl.m4, and add quotes
around the "1" in ",1" where the unusual spacing prohibited the
above regexps from doing the job. For more details, see
<http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/16175>.
author | Jim Meyering <meyering@redhat.com> |
---|---|
date | Tue, 13 Jan 2009 08:48:48 +0100 |
parents | ada4d73c37a6 |
children | 2e168b9fc9aa |
rev | line source |
---|---|
7225 | 1 # Configure fcntl.h. |
11007
f6cba5a556ce
many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents:
9299
diff
changeset
|
2 dnl Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc. |
7225 | 3 dnl This file is free software; the Free Software Foundation |
4 dnl gives unlimited permission to copy and/or distribute it, | |
5 dnl with or without modifications, as long as this notice is preserved. | |
6 | |
7 dnl Written by Paul Eggert. | |
8 | |
9 AC_DEFUN([gl_FCNTL_H], | |
10 [ | |
9299 | 11 AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) |
11007
f6cba5a556ce
many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents:
9299
diff
changeset
|
12 AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h], |
7225 | 13 [AC_RUN_IFELSE( |
14 [AC_LANG_PROGRAM( | |
15 [[#include <sys/types.h> | |
16 #include <sys/stat.h> | |
17 #include <unistd.h> | |
18 #include <fcntl.h> | |
7408 | 19 #ifndef O_NOATIME |
20 #define O_NOATIME 0 | |
21 #endif | |
7225 | 22 #ifndef O_NOFOLLOW |
23 #define O_NOFOLLOW 0 | |
24 #endif | |
25 static int const constants[] = | |
26 { | |
27 O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, | |
28 O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY | |
29 }; | |
30 ]], | |
7408 | 31 [[ |
32 int status = !constants; | |
33 { | |
34 static char const sym[] = "conftest.sym"; | |
35 if (symlink (".", sym) != 0 | |
36 || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0) | |
37 status |= 32; | |
38 } | |
39 { | |
40 static char const file[] = "confdefs.h"; | |
41 int fd = open (file, O_RDONLY | O_NOATIME); | |
42 char c; | |
43 struct stat st0, st1; | |
44 if (fd < 0 | |
45 || fstat (fd, &st0) != 0 | |
46 || sleep (1) != 0 | |
47 || read (fd, &c, 1) != 1 | |
48 || close (fd) != 0 | |
49 || stat (file, &st1) != 0 | |
7687
7fcc949f763a
* m4/fcntl_h.m4 (gl_FCNTL_H): Test the atime, not the mtime.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7408
diff
changeset
|
50 || st0.st_atime != st1.st_atime) |
7408 | 51 status |= 64; |
52 } | |
53 return status;]])], | |
7225 | 54 [gl_cv_header_working_fcntl_h=yes], |
7408 | 55 [case $? in #( |
56 32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( | |
57 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( | |
58 96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( | |
59 *) gl_cv_header_working_fcntl_h='no';; | |
60 esac], | |
7225 | 61 [gl_cv_header_working_fcntl_h=cross-compiling])]) |
62 | |
7408 | 63 case $gl_cv_header_working_fcntl_h in #( |
64 *O_NOATIME* | no | cross-compiling) ac_val=0;; #( | |
65 *) ac_val=1;; | |
66 esac | |
67 AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val], | |
68 [Define to 1 if O_NOATIME works.]) | |
69 | |
70 case $gl_cv_header_working_fcntl_h in #( | |
71 *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( | |
72 *) ac_val=1;; | |
73 esac | |
74 AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val], | |
75 [Define to 1 if O_NOFOLLOW works.]) | |
7225 | 76 |
8995
1025663f7658
* m4/include_next.m4 (gl_INCLUDE_NEXT): Define and AC_SUBST
Paul Eggert <eggert@cs.ucla.edu>
parents:
7687
diff
changeset
|
77 gl_CHECK_NEXT_HEADERS([fcntl.h]) |
7225 | 78 FCNTL_H='fcntl.h' |
79 AC_SUBST([FCNTL_H]) | |
80 ]) | |
9299 | 81 |
82 AC_DEFUN([gl_FCNTL_MODULE_INDICATOR], | |
83 [ | |
84 dnl Use AC_REQUIRE here, so that the default settings are expanded once only. | |
85 AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) | |
86 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 | |
87 ]) | |
88 | |
89 AC_DEFUN([gl_FCNTL_H_DEFAULTS], | |
90 [ | |
91 GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN]) | |
92 dnl Assume proper GNU behavior unless another module says otherwise. | |
93 REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN]) | |
94 ]) |