summaryrefslogtreecommitdiff
path: root/gnulib/import/m4/glob.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gnulib/import/m4/glob.m4')
-rw-r--r--gnulib/import/m4/glob.m443
1 files changed, 41 insertions, 2 deletions
diff --git a/gnulib/import/m4/glob.m4 b/gnulib/import/m4/glob.m4
index 232136ef372..cf5f93930c1 100644
--- a/gnulib/import/m4/glob.m4
+++ b/gnulib/import/m4/glob.m4
@@ -1,5 +1,5 @@
-# glob.m4 serial 24
-dnl Copyright (C) 2005-2007, 2009-2021 Free Software Foundation, Inc.
+# glob.m4 serial 25
+dnl Copyright (C) 2005-2007, 2009-2022 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -66,6 +66,45 @@ char a[_GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 ? 1
esac
fi
+ if test $REPLACE_GLOB = 0; then
+ AC_CACHE_CHECK([whether glob NOTDIR*/ omits symlink to nondir],
+ [gl_cv_glob_omit_nondir_symlinks],
+ [if test $cross_compiling != yes; then
+ if ln -s conf-file conf$$-globtest 2>/dev/null && touch conf-file
+ then
+ gl_cv_glob_omit_nondir_symlinks=maybe
+ else
+ # If we can't make a symlink, then we cannot test this issue. Be
+ # pessimistic about this.
+ gl_cv_glob_omit_nondir_symlinks=no
+ fi
+ if test $gl_cv_glob_omit_nondir_symlinks = maybe; then
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stddef.h>
+ #include <glob.h>]],
+ [[glob_t found;
+ if (glob ("conf*-globtest/", 0, NULL, &found) != GLOB_NOMATCH)
+ return 1;
+ globfree (&found);
+ ]])],
+ [gl_cv_glob_omit_nondir_symlinks=yes],
+ [gl_cv_glob_omit_nondir_symlinks=no],
+ [dnl We don't get here.
+ :
+ ])
+ fi
+ rm -f conf$$-globtest
+ else
+ gl_cv_glob_omit_nondir_symlinks="$gl_cross_guess_normal"
+ fi
+ ])
+ case "$gl_cv_glob_omit_nondir_symlinks" in
+ *yes) ;;
+ *) REPLACE_GLOB=1 ;;
+ esac
+ fi
+
fi
if test $ac_cv_func_glob_pattern_p = no; then