doc: Strengthen the case for pattern matching.
[bpt/guile.git] / gnulib-local / m4 / canonicalize.m4.diff
1 Fix `canonicalize_file_name' replacement handling when cross-compiling.
2 Without this patch, we end up with:
3
4 ./.libs/libguile-2.0.so: undefined reference to `rpl_canonicalize_file_name'
5
6 See <http://hydra.nixos.org/build/2765567> for details.
7
8 index 69b3f4c..3c4c5ee 100644
9 --- a/m4/canonicalize.m4
10 +++ b/m4/canonicalize.m4
11 @@ -16,8 +16,11 @@ AC_DEFUN([gl_FUNC_CANONICALIZE_FILENAME_MODE],
12 AC_REQUIRE([gl_FUNC_REALPATH_WORKS])
13 if test $ac_cv_func_canonicalize_file_name = no; then
14 HAVE_CANONICALIZE_FILE_NAME=0
15 - elif test "$gl_cv_func_realpath_works" != yes; then
16 - REPLACE_CANONICALIZE_FILE_NAME=1
17 + else
18 + case "$gl_cv_func_realpath_works" in
19 + *yes) ;;
20 + *) REPLACE_CANONICALIZE_FILE_NAME=1 ;;
21 + esac
22 fi
23 ])
24
25 @@ -30,12 +33,21 @@ AC_DEFUN([gl_CANONICALIZE_LGPL],
26 HAVE_CANONICALIZE_FILE_NAME=0
27 if test $ac_cv_func_realpath = no; then
28 HAVE_REALPATH=0
29 - elif test "$gl_cv_func_realpath_works" != yes; then
30 - REPLACE_REALPATH=1
31 + else
32 + case "$gl_cv_func_realpath_works" in
33 + *yes) ;;
34 + *) REPLACE_REALPATH=1 ;;
35 + esac
36 fi
37 - elif test "$gl_cv_func_realpath_works" != yes; then
38 - REPLACE_CANONICALIZE_FILE_NAME=1
39 - REPLACE_REALPATH=1
40 + else
41 + case "$gl_cv_func_realpath_works" in
42 + *yes)
43 + ;;
44 + *)
45 + REPLACE_CANONICALIZE_FILE_NAME=1
46 + REPLACE_REALPATH=1
47 + ;;
48 + esac
49 fi
50 ])
51
52
53 Now, work around a second bug: fix default value when cross-compiling
54 for GNU/Hurd.
55
56 index 69b3f4c..111ddf8 100644
57 --- a/m4/canonicalize.m4
58 +++ b/m4/canonicalize.m4
59 @@ -95,7 +95,7 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS],
60 [gl_cv_func_realpath_works=no],
61 [case "$host_os" in
62 # Guess yes on glibc systems.
63 - *-gnu*) gl_cv_func_realpath_works="guessing yes" ;;
64 + *gnu*) gl_cv_func_realpath_works="guessing yes" ;;
65 # If we don't know, assume the worst.
66 *) gl_cv_func_realpath_works="guessing no" ;;
67 esac