Mercurial > hg > octave-jordi > gnulib-hg
annotate m4/euidaccess.m4 @ 17848:ab58d4870664
version-etc: new year
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date.
* all files: Run 'make update-copyright'.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Thu, 01 Jan 2015 01:38:23 +0000 |
parents | 344018b6e5d7 |
children |
rev | line source |
---|---|
17139
86a770762a4e
euidaccess: speed up 'configure' on GNU hosts
Paul Eggert <eggert@cs.ucla.edu>
parents:
16201
diff
changeset
|
1 # euidaccess.m4 serial 15 |
17848 | 2 dnl Copyright (C) 2002-2015 Free Software Foundation, Inc. |
5611
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5158
diff
changeset
|
3 dnl This file is free software; the Free Software Foundation |
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5158
diff
changeset
|
4 dnl gives unlimited permission to copy and/or distribute it, |
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5158
diff
changeset
|
5 dnl with or without modifications, as long as this notice is preserved. |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 |
5158
c710d6c89900
(gl_PREREQ_EUIDACCESS): Don't bother checking for
Paul Eggert <eggert@cs.ucla.edu>
parents:
4531
diff
changeset
|
7 AC_DEFUN([gl_FUNC_NONREENTRANT_EUIDACCESS], |
c710d6c89900
(gl_PREREQ_EUIDACCESS): Don't bother checking for
Paul Eggert <eggert@cs.ucla.edu>
parents:
4531
diff
changeset
|
8 [ |
c710d6c89900
(gl_PREREQ_EUIDACCESS): Don't bother checking for
Paul Eggert <eggert@cs.ucla.edu>
parents:
4531
diff
changeset
|
9 AC_REQUIRE([gl_FUNC_EUIDACCESS]) |
17139
86a770762a4e
euidaccess: speed up 'configure' on GNU hosts
Paul Eggert <eggert@cs.ucla.edu>
parents:
16201
diff
changeset
|
10 AC_CHECK_DECLS([setregid]) |
11007
f6cba5a556ce
many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents:
10662
diff
changeset
|
11 AC_DEFINE([PREFER_NONREENTRANT_EUIDACCESS], [1], |
5158
c710d6c89900
(gl_PREREQ_EUIDACCESS): Don't bother checking for
Paul Eggert <eggert@cs.ucla.edu>
parents:
4531
diff
changeset
|
12 [Define this if you prefer euidaccess to return the correct result |
c710d6c89900
(gl_PREREQ_EUIDACCESS): Don't bother checking for
Paul Eggert <eggert@cs.ucla.edu>
parents:
4531
diff
changeset
|
13 even if this would make it nonreentrant. Define this only if your |
c710d6c89900
(gl_PREREQ_EUIDACCESS): Don't bother checking for
Paul Eggert <eggert@cs.ucla.edu>
parents:
4531
diff
changeset
|
14 entire application is safe even if the uid or gid might temporarily |
c710d6c89900
(gl_PREREQ_EUIDACCESS): Don't bother checking for
Paul Eggert <eggert@cs.ucla.edu>
parents:
4531
diff
changeset
|
15 change. If your application uses signal handlers or threads it |
c710d6c89900
(gl_PREREQ_EUIDACCESS): Don't bother checking for
Paul Eggert <eggert@cs.ucla.edu>
parents:
4531
diff
changeset
|
16 is probably not safe.]) |
c710d6c89900
(gl_PREREQ_EUIDACCESS): Don't bother checking for
Paul Eggert <eggert@cs.ucla.edu>
parents:
4531
diff
changeset
|
17 ]) |
c710d6c89900
(gl_PREREQ_EUIDACCESS): Don't bother checking for
Paul Eggert <eggert@cs.ucla.edu>
parents:
4531
diff
changeset
|
18 |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
19 AC_DEFUN([gl_FUNC_EUIDACCESS], |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
20 [ |
10662
ad36db29dad7
Move the euidaccess() declaration to <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
9209
diff
changeset
|
21 AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) |
ad36db29dad7
Move the euidaccess() declaration to <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
9209
diff
changeset
|
22 |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
23 dnl Persuade glibc <unistd.h> to declare euidaccess(). |
9209
5a0294ce5372
Track CVS Autoconf on AC_USE_SYSTEM_EXTENSIONS.
Eric Blake <ebb9@byu.net>
parents:
7683
diff
changeset
|
24 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
25 |
14935
f852b19fc41a
euidaccess: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
26 AC_CHECK_FUNCS([euidaccess]) |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
27 if test $ac_cv_func_euidaccess = no; then |
10662
ad36db29dad7
Move the euidaccess() declaration to <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
9209
diff
changeset
|
28 HAVE_EUIDACCESS=0 |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
29 fi |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
30 ]) |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
31 |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
32 # Prerequisites of lib/euidaccess.c. |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
33 AC_DEFUN([gl_PREREQ_EUIDACCESS], [ |
11944
660d7f74a5e8
euidaccess: prefer POSIX over non-standard implementation
Eric Blake <ebb9@byu.net>
parents:
11007
diff
changeset
|
34 dnl Prefer POSIX faccessat over non-standard euidaccess. |
660d7f74a5e8
euidaccess: prefer POSIX over non-standard implementation
Eric Blake <ebb9@byu.net>
parents:
11007
diff
changeset
|
35 AC_CHECK_FUNCS_ONCE([faccessat]) |
660d7f74a5e8
euidaccess: prefer POSIX over non-standard implementation
Eric Blake <ebb9@byu.net>
parents:
11007
diff
changeset
|
36 dnl Try various other non-standard fallbacks. |
17139
86a770762a4e
euidaccess: speed up 'configure' on GNU hosts
Paul Eggert <eggert@cs.ucla.edu>
parents:
16201
diff
changeset
|
37 AC_CHECK_HEADERS([libgen.h]) |
86a770762a4e
euidaccess: speed up 'configure' on GNU hosts
Paul Eggert <eggert@cs.ucla.edu>
parents:
16201
diff
changeset
|
38 AC_FUNC_GETGROUPS |
5158
c710d6c89900
(gl_PREREQ_EUIDACCESS): Don't bother checking for
Paul Eggert <eggert@cs.ucla.edu>
parents:
4531
diff
changeset
|
39 |
15728
d653c053dc60
euidaccess: Update comments.
Bruno Haible <bruno@clisp.org>
parents:
14935
diff
changeset
|
40 # Solaris 9 and 10 need -lgen to get the eaccess function. |
5158
c710d6c89900
(gl_PREREQ_EUIDACCESS): Don't bother checking for
Paul Eggert <eggert@cs.ucla.edu>
parents:
4531
diff
changeset
|
41 # Save and restore LIBS so -lgen isn't added to it. Otherwise, *all* |
c710d6c89900
(gl_PREREQ_EUIDACCESS): Don't bother checking for
Paul Eggert <eggert@cs.ucla.edu>
parents:
4531
diff
changeset
|
42 # programs in the package would end up linked with that potentially-shared |
c710d6c89900
(gl_PREREQ_EUIDACCESS): Don't bother checking for
Paul Eggert <eggert@cs.ucla.edu>
parents:
4531
diff
changeset
|
43 # library, inducing unnecessary run-time overhead. |
12169
d9a855dec815
don't let environment settings perturb build
Jim Meyering <meyering@redhat.com>
parents:
11944
diff
changeset
|
44 LIB_EACCESS= |
12182
8ba00f285749
m4: stylistic-only: hoist AC_SUBST to be adjacent to initialization
Jim Meyering <meyering@redhat.com>
parents:
12169
diff
changeset
|
45 AC_SUBST([LIB_EACCESS]) |
5158
c710d6c89900
(gl_PREREQ_EUIDACCESS): Don't bother checking for
Paul Eggert <eggert@cs.ucla.edu>
parents:
4531
diff
changeset
|
46 gl_saved_libs=$LIBS |
11007
f6cba5a556ce
many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents:
10662
diff
changeset
|
47 AC_SEARCH_LIBS([eaccess], [gen], |
5158
c710d6c89900
(gl_PREREQ_EUIDACCESS): Don't bother checking for
Paul Eggert <eggert@cs.ucla.edu>
parents:
4531
diff
changeset
|
48 [test "$ac_cv_search_eaccess" = "none required" || |
c710d6c89900
(gl_PREREQ_EUIDACCESS): Don't bother checking for
Paul Eggert <eggert@cs.ucla.edu>
parents:
4531
diff
changeset
|
49 LIB_EACCESS=$ac_cv_search_eaccess]) |
11007
f6cba5a556ce
many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents:
10662
diff
changeset
|
50 AC_CHECK_FUNCS([eaccess]) |
5158
c710d6c89900
(gl_PREREQ_EUIDACCESS): Don't bother checking for
Paul Eggert <eggert@cs.ucla.edu>
parents:
4531
diff
changeset
|
51 LIBS=$gl_saved_libs |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
52 ]) |