annotate m4/wchar.m4 @ 448:5cccf90bf838 3.0 tip

Fixed bug with complex external references generating invalid relocations in the object file
author lost@l-w.ca
date Fri, 05 Nov 2010 22:27:00 -0600
parents b8bf63962a99
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
434
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
1 dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
2
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
3 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
4 dnl This file is free software; the Free Software Foundation
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
5 dnl gives unlimited permission to copy and/or distribute it,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
6 dnl with or without modifications, as long as this notice is preserved.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
7
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
8 dnl Written by Eric Blake.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
9
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
10 # wchar.m4 serial 30
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
11
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
12 AC_DEFUN([gl_WCHAR_H],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
13 [
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
14 AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
15 AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
16 dnl Prepare for creating substitute <wchar.h>.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
17 dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
18 dnl character support).
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
19 dnl <wchar.h> is always overridden, because of GNULIB_POSIXCHECK.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
20 AC_CHECK_HEADERS_ONCE([wchar.h])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
21 gl_CHECK_NEXT_HEADERS([wchar.h])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
22 if test $ac_cv_header_wchar_h = yes; then
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
23 HAVE_WCHAR_H=1
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
24 else
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
25 HAVE_WCHAR_H=0
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
26 fi
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
27 AC_SUBST([HAVE_WCHAR_H])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
28
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
29 AC_REQUIRE([gt_TYPE_WINT_T])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
30 if test $gt_cv_c_wint_t = yes; then
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
31 HAVE_WINT_T=1
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
32 else
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
33 HAVE_WINT_T=0
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
34 fi
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
35 AC_SUBST([HAVE_WINT_T])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
36 ])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
37
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
38 dnl Check whether <wchar.h> is usable at all.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
39 AC_DEFUN([gl_WCHAR_H_INLINE_OK],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
40 [
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
41 dnl Test whether <wchar.h> suffers due to the transition from '__inline' to
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
42 dnl 'gnu_inline'. See <http://sourceware.org/bugzilla/show_bug.cgi?id=4022>
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
43 dnl and <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. In summary,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
44 dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
45 dnl the option -std=c99 or -std=gnu99, leads to a broken <wchar.h>.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
46 AC_CACHE_CHECK([whether <wchar.h> uses 'inline' correctly],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
47 [gl_cv_header_wchar_h_correct_inline],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
48 [gl_cv_header_wchar_h_correct_inline=yes
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
49 AC_LANG_CONFTEST([
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
50 AC_LANG_SOURCE([[#define wcstod renamed_wcstod
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
51 #include <wchar.h>
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
52 extern int zero (void);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
53 int main () { return zero(); }
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
54 ]])])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
55 if AC_TRY_EVAL([ac_compile]); then
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
56 mv conftest.$ac_objext conftest1.$ac_objext
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
57 AC_LANG_CONFTEST([
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
58 AC_LANG_SOURCE([[#define wcstod renamed_wcstod
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
59 #include <wchar.h>
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
60 int zero (void) { return 0; }
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
61 ]])])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
62 if AC_TRY_EVAL([ac_compile]); then
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
63 mv conftest.$ac_objext conftest2.$ac_objext
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
64 if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
65 :
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
66 else
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
67 gl_cv_header_wchar_h_correct_inline=no
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
68 fi
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
69 fi
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
70 fi
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
71 rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
72 ])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
73 if test $gl_cv_header_wchar_h_correct_inline = no; then
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
74 AC_MSG_ERROR([<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
75 This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
76 C99 mode. You have four options:
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
77 - Add the flag -fgnu89-inline to CC and reconfigure, or
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
78 - Fix your include files, using parts of
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
79 <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
80 - Use a gcc version older than 4.3, or
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
81 - Don't use the flags -std=c99 or -std=gnu99.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
82 Configuration aborted.])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
83 fi
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
84 ])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
85
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
86 dnl Unconditionally enables the replacement of <wchar.h>.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
87 AC_DEFUN([gl_REPLACE_WCHAR_H],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
88 [
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
89 dnl This is a no-op, because <wchar.h> is always overridden.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
90 :
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
91 ])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
92
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
93 AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
94 [
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
95 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
96 AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
97 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
98 ])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
99
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
100 AC_DEFUN([gl_WCHAR_H_DEFAULTS],
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
101 [
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
102 GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
103 GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
104 GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
105 GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
106 GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
107 GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
108 GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
109 GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
110 GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
111 GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
112 GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
113 dnl Assume proper GNU behavior unless another module says otherwise.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
114 HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
115 HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
116 HAVE_MBRTOWC=1; AC_SUBST([HAVE_MBRTOWC])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
117 HAVE_MBRLEN=1; AC_SUBST([HAVE_MBRLEN])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
118 HAVE_MBSRTOWCS=1; AC_SUBST([HAVE_MBSRTOWCS])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
119 HAVE_MBSNRTOWCS=1; AC_SUBST([HAVE_MBSNRTOWCS])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
120 HAVE_WCRTOMB=1; AC_SUBST([HAVE_WCRTOMB])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
121 HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
122 HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
123 HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
124 HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
125 REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
126 REPLACE_BTOWC=0; AC_SUBST([REPLACE_BTOWC])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
127 REPLACE_WCTOB=0; AC_SUBST([REPLACE_WCTOB])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
128 REPLACE_MBSINIT=0; AC_SUBST([REPLACE_MBSINIT])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
129 REPLACE_MBRTOWC=0; AC_SUBST([REPLACE_MBRTOWC])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
130 REPLACE_MBRLEN=0; AC_SUBST([REPLACE_MBRLEN])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
131 REPLACE_MBSRTOWCS=0; AC_SUBST([REPLACE_MBSRTOWCS])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
132 REPLACE_MBSNRTOWCS=0; AC_SUBST([REPLACE_MBSNRTOWCS])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
133 REPLACE_WCRTOMB=0; AC_SUBST([REPLACE_WCRTOMB])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
134 REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
135 REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
136 REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH])
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
137 ])