diff options
author | Mark H Weaver <mhw@netris.org> | 2014-02-26 22:15:13 -0500 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2014-02-27 22:34:30 -0500 |
commit | 3243fffcc19144fc0b30e983c3e50d1d1fc19ef4 (patch) | |
tree | 7fe5533d4b47c7dea583170b42fb01ed91e68d11 /m4/mkdir.m4 | |
parent | caa3d99be9932077230303a5571697f7d45f3da2 (diff) | |
download | guile-3243fffcc19144fc0b30e983c3e50d1d1fc19ef4.tar.gz |
Import Gnulib modules: link, fsync, readlink, rename, mkdir, rmdir, unistd.
* lib/fsync.c:
* lib/link.c:
* lib/mkdir.c:
* lib/strdup.c:
* m4/fsync.m4:
* m4/link.m4:
* m4/mkdir.m4:
* m4/strdup.m4: New files.
* lib/Makefile.am
* m4/gnulib-cache.m4
* m4/gnulib-comp.m4: Add modules.
Diffstat (limited to 'm4/mkdir.m4')
-rw-r--r-- | m4/mkdir.m4 | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/m4/mkdir.m4 b/m4/mkdir.m4 new file mode 100644 index 000000000..51e78c13d --- /dev/null +++ b/m4/mkdir.m4 @@ -0,0 +1,69 @@ +# serial 11 + +# Copyright (C) 2001, 2003-2004, 2006, 2008-2014 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# On some systems, mkdir ("foo/", 0700) fails because of the trailing slash. +# On others, mkdir ("foo/./", 0700) mistakenly succeeds. +# On such systems, arrange to use a wrapper function. +AC_DEFUN([gl_FUNC_MKDIR], +[dnl + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CHECK_HEADERS_ONCE([unistd.h]) + AC_CACHE_CHECK([whether mkdir handles trailing slash], + [gl_cv_func_mkdir_trailing_slash_works], + [rm -rf conftest.dir + AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +# include <sys/types.h> +# include <sys/stat.h> +]], [return mkdir ("conftest.dir/", 0700);])], + [gl_cv_func_mkdir_trailing_slash_works=yes], + [gl_cv_func_mkdir_trailing_slash_works=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_mkdir_trailing_slash_works="guessing no" ;; + esac + ]) + rm -rf conftest.dir + ] + ) + case "$gl_cv_func_mkdir_trailing_slash_works" in + *yes) ;; + *) + REPLACE_MKDIR=1 + ;; + esac + + AC_CACHE_CHECK([whether mkdir handles trailing dot], + [gl_cv_func_mkdir_trailing_dot_works], + [rm -rf conftest.dir + AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +# include <sys/types.h> +# include <sys/stat.h> +]], [return !mkdir ("conftest.dir/./", 0700);])], + [gl_cv_func_mkdir_trailing_dot_works=yes], + [gl_cv_func_mkdir_trailing_dot_works=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;; + esac + ]) + rm -rf conftest.dir + ] + ) + case "$gl_cv_func_mkdir_trailing_dot_works" in + *yes) ;; + *) + REPLACE_MKDIR=1 + AC_DEFINE([FUNC_MKDIR_DOT_BUG], [1], [Define to 1 if mkdir mistakenly + creates a directory given with a trailing dot component.]) + ;; + esac +]) |