Mercurial > hg > octave-lyh > gnulib-hg
changeset 11966:715fd167345f
Remove dependency from unistd_h.m4, sys_stat_h.m4, fcntl_h.m4 to openat.m4.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Mon, 07 Sep 2009 01:33:12 +0200 |
parents | 26b974ecc6ff |
children | 399ddfe4310e |
files | ChangeLog lib/sys_stat.in.h lib/unistd.in.h m4/fcntl_h.m4 m4/openat.m4 m4/sys_stat_h.m4 m4/unistd_h.m4 modules/fcntl-h modules/sys_stat modules/unistd |
diffstat | 10 files changed, 106 insertions(+), 56 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,31 @@ +2009-09-06 Bruno Haible <bruno@clisp.org> + + * lib/sys_stat.in.h (fchmodat): Declare if GNULIB_FCHMODAT is set. + (fstatat): Declare if GNULIB_FSTATAT is set. + (mkdirat): Declare if GNULIB_MKDIRAT is set. + * lib/unistd.in.h (fchownat): Declare if GNULIB_FCHOWNAT is set. + (unlinkat): Declare if GNULIB_UNLINKAT is set. + * modules/fcntl-h (Files): Remove m4/openat.m4. + * modules/sys_stat (Files): Remove m4/openat.m4. + (Makefile.am): Substitute GNULIB_FCHMODAT, GNULIB_FSTATAT, + GNULIB_MKDIRAT instead of GNULIB_OPENAT. + * modules/unistd (Files): Remove m4/openat.m4. + (Makefile.am): Substitute GNULIB_FCHOWNAT, GNULIB_UNLINKAT instead of + GNULIB_OPENAT. + * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Initialize GNULIB_OPENAT, + HAVE_OPENAT here. Don't require gl_OPENAT_DEFAULTS. + * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Initialize + GNULIB_FCHMODAT, GNULIB_FSTATAT, GNULIB_MKDIRAT, HAVE_FCHMODAT, + HAVE_FSTATAT, HAVE_MKDIRAT, REPLACE_FSTATAT here. Don't require + gl_OPENAT_DEFAULTS. + * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_FCHOWNAT, + GNULIB_UNLINKAT, HAVE_FCHOWNAT, HAVE_UNLINKAT, REPLACE_FCHOWNAT here. + Don't require gl_OPENAT_DEFAULTS. + * m4/openat.m4 (gl_FUNC_OPENAT): Require gl_FCNTL_H_DEFAULTS, + gl_SYS_STAT_H_DEFAULTS, gl_UNISTD_H_DEFAULTS. Set GNULIB_FCHMODAT, + GNULIB_FSTATAT, GNULIB_MKDIRAT, GNULIB_FCHOWNAT, GNULIB_UNLINKAT. + (gl_OPENAT_DEFAULTS): Remove macro. + 2009-09-06 Bruno Haible <bruno@clisp.org> * modules/openat (configure.ac): Remove unneeded witness.
--- a/lib/sys_stat.in.h +++ b/lib/sys_stat.in.h @@ -302,40 +302,49 @@ lstat (p, b)) #endif -#if @GNULIB_OPENAT@ -# if @REPLACE_FSTATAT@ -# undef fstatat -# define fstatat rpl_fstatat -# endif -# if !@HAVE_FSTATAT@ || @REPLACE_FSTATAT@ -int fstatat (int fd, char const *name, struct stat *st, int flags); + +#if @GNULIB_FCHMODAT@ +# if !@HAVE_FCHMODAT@ +extern int fchmodat (int fd, char const *file, mode_t mode, int flag); # endif - -# if !@HAVE_FCHMODAT@ -int fchmodat (int fd, char const *file, mode_t mode, int flag); -# endif - -# if !@HAVE_MKDIRAT@ -int mkdirat (int fd, char const *file, mode_t mode); -# endif - #elif defined GNULIB_POSIXCHECK # undef fchmodat # define fchmodat(d,n,m,f) \ (GL_LINK_WARNING ("fchmodat is not portable - " \ "use gnulib module openat for portability"), \ fchmodat (d, n, m, f)) +#endif + + +#if @GNULIB_FSTATAT@ +# if @REPLACE_FSTATAT@ +# undef fstatat +# define fstatat rpl_fstatat +# endif +# if !@HAVE_FSTATAT@ || @REPLACE_FSTATAT@ +extern int fstatat (int fd, char const *name, struct stat *st, int flags); +# endif +#elif defined GNULIB_POSIXCHECK # undef fstatat # define fstatat(d,n,s,f) \ (GL_LINK_WARNING ("fstatat is not portable - " \ "use gnulib module openat for portability"), \ fstatat (d, n, s, f)) +#endif + + +#if @GNULIB_MKDIRAT@ +# if !@HAVE_MKDIRAT@ +extern int mkdirat (int fd, char const *file, mode_t mode); +# endif +#elif defined GNULIB_POSIXCHECK # undef mkdirat # define mkdirat(d,n,m) \ (GL_LINK_WARNING ("mkdirat is not portable - " \ "use gnulib module openat for portability"), \ mkdirat (d, n, m)) -#endif /* @GNULIB_OPENAT@ */ +#endif + #if @REPLACE_FCHDIR@ # define fstat rpl_fstat
--- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -147,16 +147,13 @@ #endif -#if @GNULIB_OPENAT@ +#if @GNULIB_FCHOWNAT@ # if @REPLACE_FCHOWNAT@ # undef fchownat # define fchownat rpl_fchownat # endif # if !@HAVE_FCHOWNAT@ || @REPLACE_FCHOWNAT@ -int fchownat (int fd, char const *file, uid_t owner, gid_t group, int flag); -# endif -# if !@HAVE_UNLINKAT@ -int unlinkat (int fd, char const *file, int flag); +extern int fchownat (int fd, char const *file, uid_t owner, gid_t group, int flag); # endif #elif defined GNULIB_POSIXCHECK # undef fchownat @@ -164,12 +161,20 @@ (GL_LINK_WARNING ("fchownat is not portable - " \ "use gnulib module openat for portability"), \ fchownat (d, n, o, g, f)) +#endif + + +#if @GNULIB_UNLINKAT@ +# if !@HAVE_UNLINKAT@ +extern int unlinkat (int fd, char const *file, int flag); +# endif +#elif defined GNULIB_POSIXCHECK # undef unlinkat # define unlinkat(d,n,f) \ (GL_LINK_WARNING ("unlinkat is not portable - " \ "use gnulib module openat for portability"), \ unlinkat (d, n, f)) -#endif /* @GNULIB_OPENAT@ */ +#endif #if @GNULIB_FACCESSAT@
--- a/m4/fcntl_h.m4 +++ b/m4/fcntl_h.m4 @@ -1,4 +1,4 @@ -# serial 2 +# serial 3 # Configure fcntl.h. dnl Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation @@ -91,8 +91,9 @@ AC_DEFUN([gl_FCNTL_H_DEFAULTS], [ - AC_REQUIRE([gl_OPENAT_DEFAULTS]) dnl for GNULIB_OPENAT - GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN]) + GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN]) + GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT]) dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT]) REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN]) ])
--- a/m4/openat.m4 +++ b/m4/openat.m4 @@ -1,4 +1,4 @@ -# serial 20 +# serial 21 # See if we need to use our replacement for Solaris' openat et al functions. dnl Copyright (C) 2004-2009 Free Software Foundation, Inc. @@ -10,6 +10,18 @@ AC_DEFUN([gl_FUNC_OPENAT], [ + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + GNULIB_OPENAT=1 + + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + GNULIB_FCHMODAT=1 + GNULIB_FSTATAT=1 + GNULIB_MKDIRAT=1 + + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + GNULIB_FCHOWNAT=1 + GNULIB_UNLINKAT=1 + AC_LIBOBJ([openat-proc]) AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_CHECK_FUNCS_ONCE([lchmod]) @@ -34,7 +46,6 @@ HAVE_MKDIRAT=0 fi gl_FUNC_FCHOWNAT - GNULIB_OPENAT=1 ]) # gl_FUNC_FCHOWNAT_DEREF_BUG([ACTION-IF-BUGGY[, ACTION-IF-NOT_BUGGY]]) @@ -92,17 +103,3 @@ AC_REQUIRE([gl_PROMOTED_TYPE_MODE_T]) : ]) - -AC_DEFUN([gl_OPENAT_DEFAULTS], -[ - GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT]) - dnl Assume proper GNU behavior unless another module says otherwise. - HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT]) - HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT]) - HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT]) - HAVE_MKDIRAT=1; AC_SUBST([HAVE_MKDIRAT]) - HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT]) - HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT]) - REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT]) - REPLACE_FSTATAT=0; AC_SUBST([REPLACE_FSTATAT]) -])
--- a/m4/sys_stat_h.m4 +++ b/m4/sys_stat_h.m4 @@ -1,4 +1,4 @@ -# sys_stat_h.m4 serial 12 -*- Autoconf -*- +# sys_stat_h.m4 serial 13 -*- Autoconf -*- dnl Copyright (C) 2006-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -49,11 +49,17 @@ AC_DEFUN([gl_SYS_STAT_H_DEFAULTS], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR - AC_REQUIRE([gl_OPENAT_DEFAULTS]) dnl for GNULIB_OPENAT - GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD]) - GNULIB_LSTAT=0; AC_SUBST([GNULIB_LSTAT]) + GNULIB_FCHMODAT=0; AC_SUBST([GNULIB_FCHMODAT]) + GNULIB_FSTATAT=0; AC_SUBST([GNULIB_FSTATAT]) + GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD]) + GNULIB_LSTAT=0; AC_SUBST([GNULIB_LSTAT]) + GNULIB_MKDIRAT=0; AC_SUBST([GNULIB_MKDIRAT]) dnl Assume proper GNU behavior unless another module says otherwise. - HAVE_LCHMOD=1; AC_SUBST([HAVE_LCHMOD]) - REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT]) - REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR]) + HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT]) + HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT]) + HAVE_LCHMOD=1; AC_SUBST([HAVE_LCHMOD]) + HAVE_MKDIRAT=1; AC_SUBST([HAVE_MKDIRAT]) + REPLACE_FSTATAT=0; AC_SUBST([REPLACE_FSTATAT]) + REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT]) + REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR]) ])
--- a/m4/unistd_h.m4 +++ b/m4/unistd_h.m4 @@ -1,4 +1,4 @@ -# unistd_h.m4 serial 22 +# unistd_h.m4 serial 23 dnl Copyright (C) 2006-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -32,7 +32,6 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], [ - AC_REQUIRE([gl_OPENAT_DEFAULTS]) dnl for GNULIB_OPENAT GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) @@ -41,6 +40,7 @@ GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT]) GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) + GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT]) GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC]) GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) @@ -59,12 +59,14 @@ GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT]) GNULIB_UNISTD_H_GETOPT=0; AC_SUBST([GNULIB_UNISTD_H_GETOPT]) GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) + GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT]) GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) HAVE_DUP3=1; AC_SUBST([HAVE_DUP3]) HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS]) HAVE_FACCESSAT=1; AC_SUBST([HAVE_FACCESSAT]) + HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT]) HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC]) HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) HAVE_GETDOMAINNAME=1; AC_SUBST([HAVE_GETDOMAINNAME]) @@ -82,10 +84,12 @@ HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) + HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT]) REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE]) REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2]) REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR]) + REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT]) REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE]) REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN])
--- a/modules/fcntl-h +++ b/modules/fcntl-h @@ -4,7 +4,6 @@ Files: lib/fcntl.in.h m4/fcntl_h.m4 -m4/openat.m4 Depends-on: include_next
--- a/modules/sys_stat +++ b/modules/sys_stat @@ -4,7 +4,6 @@ Files: lib/sys_stat.in.h m4/sys_stat_h.m4 -m4/openat.m4 m4/unistd_h.m4 Depends-on: @@ -27,9 +26,11 @@ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \ + -e 's|@''GNULIB_FCHMODAT''@|$(GNULIB_FCHMODAT)|g' \ + -e 's|@''GNULIB_FSTATAT''@|$(GNULIB_FSTATAT)|g' \ -e 's|@''GNULIB_LCHMOD''@|$(GNULIB_LCHMOD)|g' \ -e 's|@''GNULIB_LSTAT''@|$(GNULIB_LSTAT)|g' \ - -e 's|@''GNULIB_OPENAT''@|$(GNULIB_OPENAT)|g' \ + -e 's|@''GNULIB_MKDIRAT''@|$(GNULIB_MKDIRAT)|g' \ -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \ -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \ -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \
--- a/modules/unistd +++ b/modules/unistd @@ -4,7 +4,6 @@ Files: m4/unistd_h.m4 lib/unistd.in.h -m4/openat.m4 Depends-on: include_next @@ -34,6 +33,7 @@ -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \ -e 's|@''GNULIB_FACCESSAT''@|$(GNULIB_FACCESSAT)|g' \ -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ + -e 's|@''GNULIB_FCHOWNAT''@|$(GNULIB_FCHOWNAT)|g' \ -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \ -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ @@ -46,13 +46,13 @@ -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \ -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ - -e 's|@''GNULIB_OPENAT''@|$(GNULIB_OPENAT)|g' \ -e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \ -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ -e 's|@''GNULIB_SYMLINKAT''@|$(GNULIB_SYMLINKAT)|g' \ -e 's|@''GNULIB_UNISTD_H_GETOPT''@|$(GNULIB_UNISTD_H_GETOPT)|g' \ -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \ + -e 's|@''GNULIB_UNLINKAT''@|$(GNULIB_UNLINKAT)|g' \ -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \ -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \