glob: merge from glibc with Zanella glob changes
[gnulib.git] / m4 / obstack-printf-posix.m4
blob744438aa1bb5df5e2954901f27671206639b9262
1 # obstack-printf-posix.m4 serial 4
2 dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 AC_DEFUN([gl_FUNC_OBSTACK_PRINTF_POSIX],
9   dnl Persuade glibc <stdio.h> to declare obstack_printf(), obstack_vprintf().
10   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
12   AC_REQUIRE([gl_PRINTF_SIZES_C99])
13   AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
14   AC_REQUIRE([gl_PRINTF_INFINITE])
15   AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE])
16   AC_REQUIRE([gl_PRINTF_DIRECTIVE_A])
17   AC_REQUIRE([gl_PRINTF_DIRECTIVE_F])
18   AC_REQUIRE([gl_PRINTF_DIRECTIVE_N])
19   AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS])
20   AC_REQUIRE([gl_PRINTF_POSITIONS])
21   AC_REQUIRE([gl_PRINTF_FLAG_GROUPING])
22   AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST])
23   AC_REQUIRE([gl_PRINTF_FLAG_ZERO])
24   AC_REQUIRE([gl_PRINTF_PRECISION])
25   AC_REQUIRE([gl_PRINTF_ENOMEM])
26   gl_cv_func_obstack_printf_posix=no
27   AC_CHECK_FUNCS_ONCE([obstack_printf])
28   if test $ac_cv_func_obstack_printf = yes ; then
29     case "$gl_cv_func_printf_sizes_c99" in
30       *yes)
31         case "$gl_cv_func_printf_long_double" in
32           *yes)
33             case "$gl_cv_func_printf_infinite" in
34               *yes)
35                 case "$gl_cv_func_printf_infinite_long_double" in
36                   *yes)
37                     case "$gl_cv_func_printf_directive_a" in
38                       *yes)
39                         case "$gl_cv_func_printf_directive_f" in
40                           *yes)
41                             case "$gl_cv_func_printf_directive_n" in
42                               *yes)
43                                 case "$gl_cv_func_printf_directive_ls" in
44                                   *yes)
45                                     case "$gl_cv_func_printf_positions" in
46                                       *yes)
47                                         case "$gl_cv_func_printf_flag_grouping" in
48                                           *yes)
49                                             case "$gl_cv_func_printf_flag_leftadjust" in
50                                               *yes)
51                                                 case "$gl_cv_func_printf_flag_zero" in
52                                                   *yes)
53                                                     case "$gl_cv_func_printf_precision" in
54                                                       *yes)
55                                                         case "$gl_cv_func_printf_enomem" in
56                                                           *yes)
57                                                             # obstack_printf exists and is
58                                                             # already POSIX compliant.
59                                                             gl_cv_func_obstack_printf_posix=yes
60                                                             ;;
61                                                         esac
62                                                         ;;
63                                                     esac
64                                                     ;;
65                                                 esac
66                                                 ;;
67                                             esac
68                                             ;;
69                                         esac
70                                         ;;
71                                     esac
72                                     ;;
73                                 esac
74                                 ;;
75                             esac
76                             ;;
77                         esac
78                         ;;
79                     esac
80                     ;;
81                 esac
82                 ;;
83             esac
84             ;;
85         esac
86         ;;
87     esac
88   fi
89   if test $gl_cv_func_obstack_printf_posix = no; then
90     gl_PREREQ_VASNPRINTF_LONG_DOUBLE
91     gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE
92     gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE
93     gl_PREREQ_VASNPRINTF_DIRECTIVE_A
94     gl_PREREQ_VASNPRINTF_DIRECTIVE_F
95     gl_PREREQ_VASNPRINTF_DIRECTIVE_LS
96     gl_PREREQ_VASNPRINTF_FLAG_GROUPING
97     gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST
98     gl_PREREQ_VASNPRINTF_FLAG_ZERO
99     gl_PREREQ_VASNPRINTF_PRECISION
100     gl_PREREQ_VASNPRINTF_ENOMEM
101     gl_REPLACE_VASNPRINTF
102     gl_REPLACE_OBSTACK_PRINTF
103   fi
104   gl_DECL_OBSTACK_PRINTF