annotate libatomic/acinclude.m4 @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 dnl
kono
parents:
diff changeset
2 dnl Unconditionally define a preprocessor macro, translating the shell
kono
parents:
diff changeset
3 dnl macro from yes/no to 1/0.
kono
parents:
diff changeset
4 dnl
kono
parents:
diff changeset
5 AC_DEFUN([LIBAT_DEFINE_YESNO], [
kono
parents:
diff changeset
6 yesno=`echo $2 | tr 'yesno' '1 0 '`
kono
parents:
diff changeset
7 AC_DEFINE_UNQUOTED([$1], $yesno, [$3])
kono
parents:
diff changeset
8 ])
kono
parents:
diff changeset
9 dnl
kono
parents:
diff changeset
10 dnl Iterate over all of the modes we're prepared to check.
kono
parents:
diff changeset
11 dnl
kono
parents:
diff changeset
12 AC_DEFUN([LIBAT_FORALL_MODES],
kono
parents:
diff changeset
13 [$1(QI,1)
kono
parents:
diff changeset
14 $1(HI,2)
kono
parents:
diff changeset
15 $1(SI,4)
kono
parents:
diff changeset
16 $1(DI,8)
kono
parents:
diff changeset
17 $1(TI,16)]
kono
parents:
diff changeset
18 )
kono
parents:
diff changeset
19 dnl
kono
parents:
diff changeset
20 dnl Check for builtin types by mode.
kono
parents:
diff changeset
21 dnl
kono
parents:
diff changeset
22 dnl A less interesting of size checking than autoconf normally provides.
kono
parents:
diff changeset
23 dnl We know that gcc always provides <stdint.h>, but we don't often
kono
parents:
diff changeset
24 dnl provide a builtin type for TImode.
kono
parents:
diff changeset
25 dnl
kono
parents:
diff changeset
26 AC_DEFUN([LIBAT_HAVE_INT_MODE],[
kono
parents:
diff changeset
27 AC_CACHE_CHECK([for $2 byte integer],[libat_cv_have_mode_$1],
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
28 [AC_COMPILE_IFELSE([AC_LANG_SOURCE([int x __attribute__((mode($1)));])],
111
kono
parents:
diff changeset
29 [libat_cv_have_mode_$1=yes],[libat_cv_have_mode_$1=no])])
kono
parents:
diff changeset
30 LIBAT_DEFINE_YESNO([HAVE_INT$2], [$libat_cv_have_mode_$1],
kono
parents:
diff changeset
31 [Have support for $2 byte integers.])
kono
parents:
diff changeset
32 if test x$libat_cv_have_mode_$1 = xyes; then
kono
parents:
diff changeset
33 SIZES="$SIZES $2"
kono
parents:
diff changeset
34 fi
kono
parents:
diff changeset
35 ])
kono
parents:
diff changeset
36 dnl
kono
parents:
diff changeset
37 dnl Check for atomic builtins.
kono
parents:
diff changeset
38 dnl See:
kono
parents:
diff changeset
39 dnl http://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html
kono
parents:
diff changeset
40 dnl
kono
parents:
diff changeset
41 dnl This checks to see if the host supports the compiler-generated
kono
parents:
diff changeset
42 dnl builtins for atomic operations for various integral sizes.
kono
parents:
diff changeset
43 dnl
kono
parents:
diff changeset
44 AC_DEFUN([LIBAT_TEST_ATOMIC_INIT],[
kono
parents:
diff changeset
45 # Do link tests if possible, instead asm tests, limited to some platforms
kono
parents:
diff changeset
46 # see discussion in PR target/40134, PR libstdc++/40133 and the thread
kono
parents:
diff changeset
47 # starting at http://gcc.gnu.org/ml/gcc-patches/2009-07/msg00322.html
kono
parents:
diff changeset
48 atomic_builtins_link_tests=no
kono
parents:
diff changeset
49 if test x$gcc_no_link != xyes; then
kono
parents:
diff changeset
50 # Can do link tests. Limit to some tested platforms
kono
parents:
diff changeset
51 case "$host" in
kono
parents:
diff changeset
52 *-*-linux* | *-*-uclinux* | *-*-kfreebsd*-gnu | *-*-gnu*)
kono
parents:
diff changeset
53 atomic_builtins_link_tests=yes
kono
parents:
diff changeset
54 ;;
kono
parents:
diff changeset
55 esac
kono
parents:
diff changeset
56 fi
kono
parents:
diff changeset
57 ])
kono
parents:
diff changeset
58 AC_DEFUN([LIBAT_TEST_ATOMIC_BUILTIN],[
kono
parents:
diff changeset
59 AC_CACHE_CHECK([$1],[$2],[
kono
parents:
diff changeset
60 AC_LANG_CONFTEST([AC_LANG_PROGRAM([],[$3])])
kono
parents:
diff changeset
61 if test x$atomic_builtins_link_tests = xyes; then
kono
parents:
diff changeset
62 if AC_TRY_EVAL(ac_link); then
kono
parents:
diff changeset
63 eval $2=yes
kono
parents:
diff changeset
64 else
kono
parents:
diff changeset
65 eval $2=no
kono
parents:
diff changeset
66 fi
kono
parents:
diff changeset
67 else
kono
parents:
diff changeset
68 old_CFLAGS="$CFLAGS"
kono
parents:
diff changeset
69 # Compile unoptimized.
kono
parents:
diff changeset
70 CFLAGS="$CFLAGS -O0 -S"
kono
parents:
diff changeset
71 if AC_TRY_EVAL(ac_compile); then
kono
parents:
diff changeset
72 if grep __atomic_ conftest.s >/dev/null 2>&1 ; then
kono
parents:
diff changeset
73 eval $2=no
kono
parents:
diff changeset
74 else
kono
parents:
diff changeset
75 eval $2=yes
kono
parents:
diff changeset
76 fi
kono
parents:
diff changeset
77 else
kono
parents:
diff changeset
78 eval $2=no
kono
parents:
diff changeset
79 fi
kono
parents:
diff changeset
80 CFLAGS="$old_CFLAGS"
kono
parents:
diff changeset
81 fi
kono
parents:
diff changeset
82 rm -f conftest*
kono
parents:
diff changeset
83 ])
kono
parents:
diff changeset
84 ])
kono
parents:
diff changeset
85
kono
parents:
diff changeset
86 dnl
kono
parents:
diff changeset
87 dnl Test if we have __atomic_load and __atomic_store for mode $1, size $2
kono
parents:
diff changeset
88 dnl
kono
parents:
diff changeset
89 AC_DEFUN([LIBAT_HAVE_ATOMIC_LOADSTORE],[
kono
parents:
diff changeset
90 LIBAT_TEST_ATOMIC_BUILTIN([for __atomic_load/store for size $2],
kono
parents:
diff changeset
91 [libat_cv_have_at_ldst_$2],
kono
parents:
diff changeset
92 [typedef int T __attribute__((mode($1)));
kono
parents:
diff changeset
93 T *x; volatile T sink; asm("" : "=g"(x));
kono
parents:
diff changeset
94 sink = __atomic_load_n(x, 0);
kono
parents:
diff changeset
95 __atomic_store_n(x, sink, 0);])
kono
parents:
diff changeset
96 LIBAT_DEFINE_YESNO([HAVE_ATOMIC_LDST_$2], [$libat_cv_have_at_ldst_$2],
kono
parents:
diff changeset
97 [Have __atomic_load/store for $2 byte integers.])
kono
parents:
diff changeset
98 AH_BOTTOM([#define MAYBE_HAVE_ATOMIC_LDST_$2 HAVE_ATOMIC_LDST_$2])
kono
parents:
diff changeset
99 AH_BOTTOM([#define FAST_ATOMIC_LDST_$2 HAVE_ATOMIC_LDST_$2])
kono
parents:
diff changeset
100 ])
kono
parents:
diff changeset
101
kono
parents:
diff changeset
102 dnl
kono
parents:
diff changeset
103 dnl Test if we have __atomic_test_and_set for mode $1, size $2
kono
parents:
diff changeset
104 dnl
kono
parents:
diff changeset
105 AC_DEFUN([LIBAT_HAVE_ATOMIC_TAS],[
kono
parents:
diff changeset
106 LIBAT_TEST_ATOMIC_BUILTIN([for __atomic_test_and_set for size $2],
kono
parents:
diff changeset
107 [libat_cv_have_at_tas_$2],
kono
parents:
diff changeset
108 [typedef int T __attribute__((mode($1))); T *x; asm("" : "=g"(x));
kono
parents:
diff changeset
109 __atomic_test_and_set(x, 0);])
kono
parents:
diff changeset
110 LIBAT_DEFINE_YESNO([HAVE_ATOMIC_TAS_$2], [$libat_cv_have_at_tas_$2],
kono
parents:
diff changeset
111 [Have __atomic_test_and_set for $2 byte integers.])
kono
parents:
diff changeset
112 AH_BOTTOM([#define MAYBE_HAVE_ATOMIC_TAS_$2 HAVE_ATOMIC_TAS_$2])
kono
parents:
diff changeset
113 ])
kono
parents:
diff changeset
114
kono
parents:
diff changeset
115 dnl
kono
parents:
diff changeset
116 dnl Test if we have __atomic_exchange for mode $1, size $2
kono
parents:
diff changeset
117 dnl
kono
parents:
diff changeset
118 AC_DEFUN([LIBAT_HAVE_ATOMIC_EXCHANGE],[
kono
parents:
diff changeset
119 LIBAT_TEST_ATOMIC_BUILTIN([for __atomic_exchange for size $2],
kono
parents:
diff changeset
120 [libat_cv_have_at_exch_$2],
kono
parents:
diff changeset
121 [typedef int T __attribute__((mode($1))); T *x; asm("" : "=g"(x));
kono
parents:
diff changeset
122 __atomic_exchange_n(x, 0, 0);])
kono
parents:
diff changeset
123 LIBAT_DEFINE_YESNO([HAVE_ATOMIC_EXCHANGE_$2], [$libat_cv_have_at_exch_$2],
kono
parents:
diff changeset
124 [Have __atomic_exchange for $2 byte integers.])
kono
parents:
diff changeset
125 AH_BOTTOM([#define MAYBE_HAVE_ATOMIC_EXCHANGE_$2 HAVE_ATOMIC_EXCHANGE_$2])
kono
parents:
diff changeset
126 ])
kono
parents:
diff changeset
127
kono
parents:
diff changeset
128 dnl
kono
parents:
diff changeset
129 dnl Test if we have __atomic_compare_exchange for mode $1, size $2
kono
parents:
diff changeset
130 dnl
kono
parents:
diff changeset
131 AC_DEFUN([LIBAT_HAVE_ATOMIC_CAS],[
kono
parents:
diff changeset
132 LIBAT_TEST_ATOMIC_BUILTIN([for __atomic_compare_exchange for size $2],
kono
parents:
diff changeset
133 [libat_cv_have_at_cas_$2],
kono
parents:
diff changeset
134 [typedef int T __attribute__((mode($1))); T *x, *y;
kono
parents:
diff changeset
135 asm("" : "=g"(x), "=g"(y));
kono
parents:
diff changeset
136 __atomic_compare_exchange_n(x, y, 0, 0, 0, 0);])
kono
parents:
diff changeset
137 LIBAT_DEFINE_YESNO([HAVE_ATOMIC_CAS_$2], [$libat_cv_have_at_cas_$2],
kono
parents:
diff changeset
138 [Have __atomic_compare_exchange for $2 byte integers.])
kono
parents:
diff changeset
139 AH_BOTTOM([#define MAYBE_HAVE_ATOMIC_CAS_$2 HAVE_ATOMIC_CAS_$2])
kono
parents:
diff changeset
140 ])
kono
parents:
diff changeset
141
kono
parents:
diff changeset
142 dnl
kono
parents:
diff changeset
143 dnl Test if we have __atomic_fetch_add for mode $1, size $2
kono
parents:
diff changeset
144 dnl
kono
parents:
diff changeset
145 AC_DEFUN([LIBAT_HAVE_ATOMIC_FETCH_ADD],[
kono
parents:
diff changeset
146 LIBAT_TEST_ATOMIC_BUILTIN([for __atomic_fetch_add for size $2],
kono
parents:
diff changeset
147 [libat_cv_have_at_fadd_$2],
kono
parents:
diff changeset
148 [typedef int T __attribute__((mode($1))); T *x, y;
kono
parents:
diff changeset
149 asm("" : "=g"(x), "=g"(y));
kono
parents:
diff changeset
150 __atomic_fetch_add (x, y, 0);
kono
parents:
diff changeset
151 __atomic_add_fetch (x, y, 0);])
kono
parents:
diff changeset
152 LIBAT_DEFINE_YESNO([HAVE_ATOMIC_FETCH_ADD_$2], [$libat_cv_have_at_fadd_$2],
kono
parents:
diff changeset
153 [Have __atomic_fetch_add for $2 byte integers.])
kono
parents:
diff changeset
154 AH_BOTTOM([#define MAYBE_HAVE_ATOMIC_FETCH_ADD_$2 HAVE_ATOMIC_FETCH_ADD_$2])
kono
parents:
diff changeset
155 ])
kono
parents:
diff changeset
156
kono
parents:
diff changeset
157 dnl
kono
parents:
diff changeset
158 dnl Test if we have __atomic_fetch_op for all op for mode $1, size $2
kono
parents:
diff changeset
159 dnl
kono
parents:
diff changeset
160 AC_DEFUN([LIBAT_HAVE_ATOMIC_FETCH_OP],[
kono
parents:
diff changeset
161 LIBAT_TEST_ATOMIC_BUILTIN([for __atomic_fetch_op for size $2],
kono
parents:
diff changeset
162 [libat_cv_have_at_fop_$2],
kono
parents:
diff changeset
163 [typedef int T __attribute__((mode($1))); T *x, y;
kono
parents:
diff changeset
164 asm("" : "=g"(x), "=g"(y));
kono
parents:
diff changeset
165 __atomic_fetch_add (x, y, 0); __atomic_add_fetch (x, y, 0);
kono
parents:
diff changeset
166 __atomic_fetch_sub (x, y, 0); __atomic_sub_fetch (x, y, 0);
kono
parents:
diff changeset
167 __atomic_fetch_and (x, y, 0); __atomic_and_fetch (x, y, 0);
kono
parents:
diff changeset
168 __atomic_fetch_nand (x, y, 0); __atomic_nand_fetch (x, y, 0);
kono
parents:
diff changeset
169 __atomic_fetch_xor (x, y, 0); __atomic_xor_fetch (x, y, 0);
kono
parents:
diff changeset
170 __atomic_fetch_or (x, y, 0); __atomic_or_fetch (x, y, 0); ])
kono
parents:
diff changeset
171 LIBAT_DEFINE_YESNO([HAVE_ATOMIC_FETCH_OP_$2], [$libat_cv_have_at_fop_$2],
kono
parents:
diff changeset
172 [Have __atomic_fetch_op for all op for $2 byte integers.])
kono
parents:
diff changeset
173 AH_BOTTOM([#define MAYBE_HAVE_ATOMIC_FETCH_OP_$2 HAVE_ATOMIC_FETCH_OP_$2])
kono
parents:
diff changeset
174 ])
kono
parents:
diff changeset
175
kono
parents:
diff changeset
176 dnl
kono
parents:
diff changeset
177 dnl Test for the size of the target word.
kono
parents:
diff changeset
178 dnl
kono
parents:
diff changeset
179 AC_DEFUN([LIBAT_WORDSIZE],[
kono
parents:
diff changeset
180 AC_CACHE_CHECK([for the word size],[libat_cv_wordsize],
kono
parents:
diff changeset
181 [AC_COMPUTE_INT(libat_cv_wordsize,
kono
parents:
diff changeset
182 [sizeof(word)], [typedef int word __attribute__((mode(word)));],
kono
parents:
diff changeset
183 AC_ERROR([Could not determine word size.]))])
kono
parents:
diff changeset
184 AC_DEFINE_UNQUOTED(WORDSIZE, $libat_cv_wordsize,
kono
parents:
diff changeset
185 [The word size in bytes of the machine.])
kono
parents:
diff changeset
186 ])
kono
parents:
diff changeset
187
kono
parents:
diff changeset
188 dnl
kono
parents:
diff changeset
189 dnl Check whether the target supports the ifunc attribute.
kono
parents:
diff changeset
190 dnl
kono
parents:
diff changeset
191 AC_DEFUN([LIBAT_CHECK_IFUNC], [
kono
parents:
diff changeset
192 AC_CACHE_CHECK([whether the target supports the ifunc attribute],
kono
parents:
diff changeset
193 libat_cv_have_ifunc, [
kono
parents:
diff changeset
194 save_CFLAGS="$CFLAGS"
kono
parents:
diff changeset
195 CFLAGS="$CFLAGS -Werror"
kono
parents:
diff changeset
196 AC_TRY_LINK([
kono
parents:
diff changeset
197 int foo_alt(void) { return 0; }
kono
parents:
diff changeset
198 typedef int F (void);
kono
parents:
diff changeset
199 F *foo_sel(void) { return foo_alt; }
kono
parents:
diff changeset
200 int foo(void) __attribute__((ifunc("foo_sel")));],
kono
parents:
diff changeset
201 [return foo();], libat_cv_have_ifunc=yes, libat_cv_have_ifunc=no)])
kono
parents:
diff changeset
202 LIBAT_DEFINE_YESNO([HAVE_IFUNC], [$libat_cv_have_ifunc],
kono
parents:
diff changeset
203 [Define to 1 if the target supports __attribute__((ifunc(...))).])
kono
parents:
diff changeset
204 ])
kono
parents:
diff changeset
205
kono
parents:
diff changeset
206 dnl ----------------------------------------------------------------------
kono
parents:
diff changeset
207 dnl This whole bit snagged from libitm.
kono
parents:
diff changeset
208
kono
parents:
diff changeset
209 dnl Check whether the target supports hidden visibility.
kono
parents:
diff changeset
210 AC_DEFUN([LIBAT_CHECK_ATTRIBUTE_VISIBILITY], [
kono
parents:
diff changeset
211 AC_CACHE_CHECK([whether the target supports hidden visibility],
kono
parents:
diff changeset
212 libat_cv_have_attribute_visibility, [
kono
parents:
diff changeset
213 save_CFLAGS="$CFLAGS"
kono
parents:
diff changeset
214 CFLAGS="$CFLAGS -Werror"
kono
parents:
diff changeset
215 AC_TRY_COMPILE([void __attribute__((visibility("hidden"))) foo(void) { }],
kono
parents:
diff changeset
216 [], libat_cv_have_attribute_visibility=yes,
kono
parents:
diff changeset
217 libat_cv_have_attribute_visibility=no)
kono
parents:
diff changeset
218 CFLAGS="$save_CFLAGS"])
kono
parents:
diff changeset
219 if test $libat_cv_have_attribute_visibility = yes; then
kono
parents:
diff changeset
220 AC_DEFINE(HAVE_ATTRIBUTE_VISIBILITY, 1,
kono
parents:
diff changeset
221 [Define to 1 if the target supports __attribute__((visibility(...))).])
kono
parents:
diff changeset
222 fi])
kono
parents:
diff changeset
223
kono
parents:
diff changeset
224 dnl Check whether the target supports dllexport
kono
parents:
diff changeset
225 AC_DEFUN([LIBAT_CHECK_ATTRIBUTE_DLLEXPORT], [
kono
parents:
diff changeset
226 AC_CACHE_CHECK([whether the target supports dllexport],
kono
parents:
diff changeset
227 libat_cv_have_attribute_dllexport, [
kono
parents:
diff changeset
228 save_CFLAGS="$CFLAGS"
kono
parents:
diff changeset
229 CFLAGS="$CFLAGS -Werror"
kono
parents:
diff changeset
230 AC_TRY_COMPILE([void __attribute__((dllexport)) foo(void) { }],
kono
parents:
diff changeset
231 [], libat_cv_have_attribute_dllexport=yes,
kono
parents:
diff changeset
232 libat_cv_have_attribute_dllexport=no)
kono
parents:
diff changeset
233 CFLAGS="$save_CFLAGS"])
kono
parents:
diff changeset
234 if test $libat_cv_have_attribute_dllexport = yes; then
kono
parents:
diff changeset
235 AC_DEFINE(HAVE_ATTRIBUTE_DLLEXPORT, 1,
kono
parents:
diff changeset
236 [Define to 1 if the target supports __attribute__((dllexport)).])
kono
parents:
diff changeset
237 fi])
kono
parents:
diff changeset
238
kono
parents:
diff changeset
239 dnl Check whether the target supports symbol aliases.
kono
parents:
diff changeset
240 AC_DEFUN([LIBAT_CHECK_ATTRIBUTE_ALIAS], [
kono
parents:
diff changeset
241 AC_CACHE_CHECK([whether the target supports symbol aliases],
kono
parents:
diff changeset
242 libat_cv_have_attribute_alias, [
kono
parents:
diff changeset
243 AC_TRY_LINK([
kono
parents:
diff changeset
244 void foo(void) { }
kono
parents:
diff changeset
245 extern void bar(void) __attribute__((alias("foo")));],
kono
parents:
diff changeset
246 [bar();], libat_cv_have_attribute_alias=yes, libat_cv_have_attribute_alias=no)])
kono
parents:
diff changeset
247 if test $libat_cv_have_attribute_alias = yes; then
kono
parents:
diff changeset
248 AC_DEFINE(HAVE_ATTRIBUTE_ALIAS, 1,
kono
parents:
diff changeset
249 [Define to 1 if the target supports __attribute__((alias(...))).])
kono
parents:
diff changeset
250 fi])
kono
parents:
diff changeset
251
kono
parents:
diff changeset
252 dnl ----------------------------------------------------------------------
kono
parents:
diff changeset
253 dnl This whole bit snagged from libstdc++-v3.
kono
parents:
diff changeset
254
kono
parents:
diff changeset
255 dnl
kono
parents:
diff changeset
256 dnl LIBAT_ENABLE
kono
parents:
diff changeset
257 dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING)
kono
parents:
diff changeset
258 dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, permit a|b|c)
kono
parents:
diff changeset
259 dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, SHELL-CODE-HANDLER)
kono
parents:
diff changeset
260 dnl
kono
parents:
diff changeset
261 dnl See docs/html/17_intro/configury.html#enable for documentation.
kono
parents:
diff changeset
262 dnl
kono
parents:
diff changeset
263 m4_define([LIBAT_ENABLE],[dnl
kono
parents:
diff changeset
264 m4_define([_g_switch],[--enable-$1])dnl
kono
parents:
diff changeset
265 m4_define([_g_help],[AC_HELP_STRING(_g_switch$3,[$4 @<:@default=$2@:>@])])dnl
kono
parents:
diff changeset
266 AC_ARG_ENABLE($1,_g_help,
kono
parents:
diff changeset
267 m4_bmatch([$5],
kono
parents:
diff changeset
268 [^permit ],
kono
parents:
diff changeset
269 [[
kono
parents:
diff changeset
270 case "$enableval" in
kono
parents:
diff changeset
271 m4_bpatsubst([$5],[permit ])) ;;
kono
parents:
diff changeset
272 *) AC_MSG_ERROR(Unknown argument to enable/disable $1) ;;
kono
parents:
diff changeset
273 dnl Idea for future: generate a URL pointing to
kono
parents:
diff changeset
274 dnl "onlinedocs/configopts.html#whatever"
kono
parents:
diff changeset
275 esac
kono
parents:
diff changeset
276 ]],
kono
parents:
diff changeset
277 [^$],
kono
parents:
diff changeset
278 [[
kono
parents:
diff changeset
279 case "$enableval" in
kono
parents:
diff changeset
280 yes|no) ;;
kono
parents:
diff changeset
281 *) AC_MSG_ERROR(Argument to enable/disable $1 must be yes or no) ;;
kono
parents:
diff changeset
282 esac
kono
parents:
diff changeset
283 ]],
kono
parents:
diff changeset
284 [[$5]]),
kono
parents:
diff changeset
285 [enable_]m4_bpatsubst([$1],-,_)[=][$2])
kono
parents:
diff changeset
286 m4_undefine([_g_switch])dnl
kono
parents:
diff changeset
287 m4_undefine([_g_help])dnl
kono
parents:
diff changeset
288 ])
kono
parents:
diff changeset
289
kono
parents:
diff changeset
290 dnl
kono
parents:
diff changeset
291 dnl If GNU ld is in use, check to see if tricky linker opts can be used. If
kono
parents:
diff changeset
292 dnl the native linker is in use, all variables will be defined to something
kono
parents:
diff changeset
293 dnl safe (like an empty string).
kono
parents:
diff changeset
294 dnl
kono
parents:
diff changeset
295 dnl Defines:
kono
parents:
diff changeset
296 dnl SECTION_LDFLAGS='-Wl,--gc-sections' if possible
kono
parents:
diff changeset
297 dnl OPT_LDFLAGS='-Wl,-O1' if possible
kono
parents:
diff changeset
298 dnl LD (as a side effect of testing)
kono
parents:
diff changeset
299 dnl Sets:
kono
parents:
diff changeset
300 dnl with_gnu_ld
kono
parents:
diff changeset
301 dnl libat_ld_is_gold (possibly)
kono
parents:
diff changeset
302 dnl libat_gnu_ld_version (possibly)
kono
parents:
diff changeset
303 dnl
kono
parents:
diff changeset
304 dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will
kono
parents:
diff changeset
305 dnl set libat_gnu_ld_version to 12345. Zeros cause problems.
kono
parents:
diff changeset
306 dnl
kono
parents:
diff changeset
307 AC_DEFUN([LIBAT_CHECK_LINKER_FEATURES], [
kono
parents:
diff changeset
308 # If we're not using GNU ld, then there's no point in even trying these
kono
parents:
diff changeset
309 # tests. Check for that first. We should have already tested for gld
kono
parents:
diff changeset
310 # by now (in libtool), but require it now just to be safe...
kono
parents:
diff changeset
311 test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
kono
parents:
diff changeset
312 test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
kono
parents:
diff changeset
313 AC_REQUIRE([AC_PROG_LD])
kono
parents:
diff changeset
314 AC_REQUIRE([AC_PROG_AWK])
kono
parents:
diff changeset
315
kono
parents:
diff changeset
316 # The name set by libtool depends on the version of libtool. Shame on us
kono
parents:
diff changeset
317 # for depending on an impl detail, but c'est la vie. Older versions used
kono
parents:
diff changeset
318 # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
kono
parents:
diff changeset
319 # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
kono
parents:
diff changeset
320 # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
kono
parents:
diff changeset
321 # set (hence we're using an older libtool), then set it.
kono
parents:
diff changeset
322 if test x${with_gnu_ld+set} != xset; then
kono
parents:
diff changeset
323 if test x${ac_cv_prog_gnu_ld+set} != xset; then
kono
parents:
diff changeset
324 # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
kono
parents:
diff changeset
325 with_gnu_ld=no
kono
parents:
diff changeset
326 else
kono
parents:
diff changeset
327 with_gnu_ld=$ac_cv_prog_gnu_ld
kono
parents:
diff changeset
328 fi
kono
parents:
diff changeset
329 fi
kono
parents:
diff changeset
330
kono
parents:
diff changeset
331 # Start by getting the version number. I think the libtool test already
kono
parents:
diff changeset
332 # does some of this, but throws away the result.
kono
parents:
diff changeset
333 libat_ld_is_gold=no
kono
parents:
diff changeset
334 if $LD --version 2>/dev/null | grep 'GNU gold'> /dev/null 2>&1; then
kono
parents:
diff changeset
335 libat_ld_is_gold=yes
kono
parents:
diff changeset
336 fi
kono
parents:
diff changeset
337 changequote(,)
kono
parents:
diff changeset
338 ldver=`$LD --version 2>/dev/null |
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
339 sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
111
kono
parents:
diff changeset
340 changequote([,])
kono
parents:
diff changeset
341 libat_gnu_ld_version=`echo $ldver | \
kono
parents:
diff changeset
342 $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
kono
parents:
diff changeset
343
kono
parents:
diff changeset
344 # Set --gc-sections.
kono
parents:
diff changeset
345 if test "$with_gnu_ld" = "notbroken"; then
kono
parents:
diff changeset
346 # GNU ld it is! Joy and bunny rabbits!
kono
parents:
diff changeset
347
kono
parents:
diff changeset
348 # All these tests are for C++; save the language and the compiler flags.
kono
parents:
diff changeset
349 # Need to do this so that g++ won't try to link in libstdc++
kono
parents:
diff changeset
350 ac_test_CFLAGS="${CFLAGS+set}"
kono
parents:
diff changeset
351 ac_save_CFLAGS="$CFLAGS"
kono
parents:
diff changeset
352 CFLAGS='-x c++ -Wl,--gc-sections'
kono
parents:
diff changeset
353
kono
parents:
diff changeset
354 # Check for -Wl,--gc-sections
kono
parents:
diff changeset
355 # XXX This test is broken at the moment, as symbols required for linking
kono
parents:
diff changeset
356 # are now in libsupc++ (not built yet). In addition, this test has
kono
parents:
diff changeset
357 # cored on solaris in the past. In addition, --gc-sections doesn't
kono
parents:
diff changeset
358 # really work at the moment (keeps on discarding used sections, first
kono
parents:
diff changeset
359 # .eh_frame and now some of the glibc sections for iconv).
kono
parents:
diff changeset
360 # Bzzzzt. Thanks for playing, maybe next time.
kono
parents:
diff changeset
361 AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
kono
parents:
diff changeset
362 AC_TRY_RUN([
kono
parents:
diff changeset
363 int main(void)
kono
parents:
diff changeset
364 {
kono
parents:
diff changeset
365 try { throw 1; }
kono
parents:
diff changeset
366 catch (...) { };
kono
parents:
diff changeset
367 return 0;
kono
parents:
diff changeset
368 }
kono
parents:
diff changeset
369 ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes])
kono
parents:
diff changeset
370 if test "$ac_test_CFLAGS" = set; then
kono
parents:
diff changeset
371 CFLAGS="$ac_save_CFLAGS"
kono
parents:
diff changeset
372 else
kono
parents:
diff changeset
373 # this is the suspicious part
kono
parents:
diff changeset
374 CFLAGS=''
kono
parents:
diff changeset
375 fi
kono
parents:
diff changeset
376 if test "$ac_sectionLDflags" = "yes"; then
kono
parents:
diff changeset
377 SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
kono
parents:
diff changeset
378 fi
kono
parents:
diff changeset
379 AC_MSG_RESULT($ac_sectionLDflags)
kono
parents:
diff changeset
380 fi
kono
parents:
diff changeset
381
kono
parents:
diff changeset
382 # Set linker optimization flags.
kono
parents:
diff changeset
383 if test x"$with_gnu_ld" = x"yes"; then
kono
parents:
diff changeset
384 OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
kono
parents:
diff changeset
385 fi
kono
parents:
diff changeset
386
kono
parents:
diff changeset
387 AC_SUBST(SECTION_LDFLAGS)
kono
parents:
diff changeset
388 AC_SUBST(OPT_LDFLAGS)
kono
parents:
diff changeset
389 ])
kono
parents:
diff changeset
390
kono
parents:
diff changeset
391
kono
parents:
diff changeset
392 dnl
kono
parents:
diff changeset
393 dnl If GNU ld is in use, check to see if tricky linker opts can be used. If
kono
parents:
diff changeset
394 dnl the native linker is in use, all variables will be defined to something
kono
parents:
diff changeset
395 dnl safe (like an empty string).
kono
parents:
diff changeset
396 dnl
kono
parents:
diff changeset
397 dnl Defines:
kono
parents:
diff changeset
398 dnl SECTION_LDFLAGS='-Wl,--gc-sections' if possible
kono
parents:
diff changeset
399 dnl OPT_LDFLAGS='-Wl,-O1' if possible
kono
parents:
diff changeset
400 dnl LD (as a side effect of testing)
kono
parents:
diff changeset
401 dnl Sets:
kono
parents:
diff changeset
402 dnl with_gnu_ld
kono
parents:
diff changeset
403 dnl libat_ld_is_gold (possibly)
kono
parents:
diff changeset
404 dnl libat_gnu_ld_version (possibly)
kono
parents:
diff changeset
405 dnl
kono
parents:
diff changeset
406 dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will
kono
parents:
diff changeset
407 dnl set libat_gnu_ld_version to 12345. Zeros cause problems.
kono
parents:
diff changeset
408 dnl
kono
parents:
diff changeset
409 AC_DEFUN([LIBAT_CHECK_LINKER_FEATURES], [
kono
parents:
diff changeset
410 # If we're not using GNU ld, then there's no point in even trying these
kono
parents:
diff changeset
411 # tests. Check for that first. We should have already tested for gld
kono
parents:
diff changeset
412 # by now (in libtool), but require it now just to be safe...
kono
parents:
diff changeset
413 test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
kono
parents:
diff changeset
414 test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
kono
parents:
diff changeset
415 AC_REQUIRE([AC_PROG_LD])
kono
parents:
diff changeset
416 AC_REQUIRE([AC_PROG_AWK])
kono
parents:
diff changeset
417
kono
parents:
diff changeset
418 # The name set by libtool depends on the version of libtool. Shame on us
kono
parents:
diff changeset
419 # for depending on an impl detail, but c'est la vie. Older versions used
kono
parents:
diff changeset
420 # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
kono
parents:
diff changeset
421 # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
kono
parents:
diff changeset
422 # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
kono
parents:
diff changeset
423 # set (hence we're using an older libtool), then set it.
kono
parents:
diff changeset
424 if test x${with_gnu_ld+set} != xset; then
kono
parents:
diff changeset
425 if test x${ac_cv_prog_gnu_ld+set} != xset; then
kono
parents:
diff changeset
426 # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
kono
parents:
diff changeset
427 with_gnu_ld=no
kono
parents:
diff changeset
428 else
kono
parents:
diff changeset
429 with_gnu_ld=$ac_cv_prog_gnu_ld
kono
parents:
diff changeset
430 fi
kono
parents:
diff changeset
431 fi
kono
parents:
diff changeset
432
kono
parents:
diff changeset
433 # Start by getting the version number. I think the libtool test already
kono
parents:
diff changeset
434 # does some of this, but throws away the result.
kono
parents:
diff changeset
435 libat_ld_is_gold=no
kono
parents:
diff changeset
436 if $LD --version 2>/dev/null | grep 'GNU gold'> /dev/null 2>&1; then
kono
parents:
diff changeset
437 libat_ld_is_gold=yes
kono
parents:
diff changeset
438 fi
kono
parents:
diff changeset
439 changequote(,)
kono
parents:
diff changeset
440 ldver=`$LD --version 2>/dev/null |
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
441 sed -e 's/[. ][0-9]\{8\}$//;s/.* \([^ ]\{1,\}\)$/\1/; q'`
111
kono
parents:
diff changeset
442 changequote([,])
kono
parents:
diff changeset
443 libat_gnu_ld_version=`echo $ldver | \
kono
parents:
diff changeset
444 $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
kono
parents:
diff changeset
445
kono
parents:
diff changeset
446 # Set --gc-sections.
kono
parents:
diff changeset
447 if test "$with_gnu_ld" = "notbroken"; then
kono
parents:
diff changeset
448 # GNU ld it is! Joy and bunny rabbits!
kono
parents:
diff changeset
449
kono
parents:
diff changeset
450 # All these tests are for C++; save the language and the compiler flags.
kono
parents:
diff changeset
451 # Need to do this so that g++ won't try to link in libstdc++
kono
parents:
diff changeset
452 ac_test_CFLAGS="${CFLAGS+set}"
kono
parents:
diff changeset
453 ac_save_CFLAGS="$CFLAGS"
kono
parents:
diff changeset
454 CFLAGS='-x c++ -Wl,--gc-sections'
kono
parents:
diff changeset
455
kono
parents:
diff changeset
456 # Check for -Wl,--gc-sections
kono
parents:
diff changeset
457 # XXX This test is broken at the moment, as symbols required for linking
kono
parents:
diff changeset
458 # are now in libsupc++ (not built yet). In addition, this test has
kono
parents:
diff changeset
459 # cored on solaris in the past. In addition, --gc-sections doesn't
kono
parents:
diff changeset
460 # really work at the moment (keeps on discarding used sections, first
kono
parents:
diff changeset
461 # .eh_frame and now some of the glibc sections for iconv).
kono
parents:
diff changeset
462 # Bzzzzt. Thanks for playing, maybe next time.
kono
parents:
diff changeset
463 AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
kono
parents:
diff changeset
464 AC_TRY_RUN([
kono
parents:
diff changeset
465 int main(void)
kono
parents:
diff changeset
466 {
kono
parents:
diff changeset
467 try { throw 1; }
kono
parents:
diff changeset
468 catch (...) { };
kono
parents:
diff changeset
469 return 0;
kono
parents:
diff changeset
470 }
kono
parents:
diff changeset
471 ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes])
kono
parents:
diff changeset
472 if test "$ac_test_CFLAGS" = set; then
kono
parents:
diff changeset
473 CFLAGS="$ac_save_CFLAGS"
kono
parents:
diff changeset
474 else
kono
parents:
diff changeset
475 # this is the suspicious part
kono
parents:
diff changeset
476 CFLAGS=''
kono
parents:
diff changeset
477 fi
kono
parents:
diff changeset
478 if test "$ac_sectionLDflags" = "yes"; then
kono
parents:
diff changeset
479 SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
kono
parents:
diff changeset
480 fi
kono
parents:
diff changeset
481 AC_MSG_RESULT($ac_sectionLDflags)
kono
parents:
diff changeset
482 fi
kono
parents:
diff changeset
483
kono
parents:
diff changeset
484 # Set linker optimization flags.
kono
parents:
diff changeset
485 if test x"$with_gnu_ld" = x"yes"; then
kono
parents:
diff changeset
486 OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
kono
parents:
diff changeset
487 fi
kono
parents:
diff changeset
488
kono
parents:
diff changeset
489 AC_SUBST(SECTION_LDFLAGS)
kono
parents:
diff changeset
490 AC_SUBST(OPT_LDFLAGS)
kono
parents:
diff changeset
491 ])
kono
parents:
diff changeset
492
kono
parents:
diff changeset
493
kono
parents:
diff changeset
494 dnl
kono
parents:
diff changeset
495 dnl Add version tags to symbols in shared library (or not), additionally
kono
parents:
diff changeset
496 dnl marking other symbols as private/local (or not).
kono
parents:
diff changeset
497 dnl
kono
parents:
diff changeset
498 dnl --enable-symvers=style adds a version script to the linker call when
kono
parents:
diff changeset
499 dnl creating the shared library. The choice of version script is
kono
parents:
diff changeset
500 dnl controlled by 'style'.
kono
parents:
diff changeset
501 dnl --disable-symvers does not.
kono
parents:
diff changeset
502 dnl + Usage: LIBAT_ENABLE_SYMVERS[(DEFAULT)]
kono
parents:
diff changeset
503 dnl Where DEFAULT is either 'yes' or 'no'. Passing `yes' tries to
kono
parents:
diff changeset
504 dnl choose a default style based on linker characteristics. Passing
kono
parents:
diff changeset
505 dnl 'no' disables versioning.
kono
parents:
diff changeset
506 dnl
kono
parents:
diff changeset
507 AC_DEFUN([LIBAT_ENABLE_SYMVERS], [
kono
parents:
diff changeset
508
kono
parents:
diff changeset
509 LIBAT_ENABLE(symvers,yes,[=STYLE],
kono
parents:
diff changeset
510 [enables symbol versioning of the shared library],
kono
parents:
diff changeset
511 [permit yes|no|gnu*|sun])
kono
parents:
diff changeset
512
kono
parents:
diff changeset
513 # If we never went through the LIBAT_CHECK_LINKER_FEATURES macro, then we
kono
parents:
diff changeset
514 # don't know enough about $LD to do tricks...
kono
parents:
diff changeset
515 AC_REQUIRE([LIBAT_CHECK_LINKER_FEATURES])
kono
parents:
diff changeset
516
kono
parents:
diff changeset
517 # Turn a 'yes' into a suitable default.
kono
parents:
diff changeset
518 if test x$enable_symvers = xyes ; then
kono
parents:
diff changeset
519 # FIXME The following test is too strict, in theory.
kono
parents:
diff changeset
520 if test $enable_shared = no || test "x$LD" = x; then
kono
parents:
diff changeset
521 enable_symvers=no
kono
parents:
diff changeset
522 else
kono
parents:
diff changeset
523 if test $with_gnu_ld = yes ; then
kono
parents:
diff changeset
524 enable_symvers=gnu
kono
parents:
diff changeset
525 else
kono
parents:
diff changeset
526 case ${target_os} in
kono
parents:
diff changeset
527 # Sun symbol versioning exists since Solaris 2.5.
kono
parents:
diff changeset
528 solaris2.[[5-9]]* | solaris2.1[[0-9]]*)
kono
parents:
diff changeset
529 enable_symvers=sun ;;
kono
parents:
diff changeset
530 *)
kono
parents:
diff changeset
531 enable_symvers=no ;;
kono
parents:
diff changeset
532 esac
kono
parents:
diff changeset
533 fi
kono
parents:
diff changeset
534 fi
kono
parents:
diff changeset
535 fi
kono
parents:
diff changeset
536
kono
parents:
diff changeset
537 # Check if 'sun' was requested on non-Solaris 2 platforms.
kono
parents:
diff changeset
538 if test x$enable_symvers = xsun ; then
kono
parents:
diff changeset
539 case ${target_os} in
kono
parents:
diff changeset
540 solaris2*)
kono
parents:
diff changeset
541 # All fine.
kono
parents:
diff changeset
542 ;;
kono
parents:
diff changeset
543 *)
kono
parents:
diff changeset
544 # Unlikely to work.
kono
parents:
diff changeset
545 AC_MSG_WARN([=== You have requested Sun symbol versioning, but])
kono
parents:
diff changeset
546 AC_MSG_WARN([=== you are not targetting Solaris 2.])
kono
parents:
diff changeset
547 AC_MSG_WARN([=== Symbol versioning will be disabled.])
kono
parents:
diff changeset
548 enable_symvers=no
kono
parents:
diff changeset
549 ;;
kono
parents:
diff changeset
550 esac
kono
parents:
diff changeset
551 fi
kono
parents:
diff changeset
552
kono
parents:
diff changeset
553 # Check to see if libgcc_s exists, indicating that shared libgcc is possible.
kono
parents:
diff changeset
554 if test $enable_symvers != no; then
kono
parents:
diff changeset
555 AC_MSG_CHECKING([for shared libgcc])
kono
parents:
diff changeset
556 ac_save_CFLAGS="$CFLAGS"
kono
parents:
diff changeset
557 CFLAGS=' -lgcc_s'
kono
parents:
diff changeset
558 AC_TRY_LINK(, [return 0;], libat_shared_libgcc=yes, libat_shared_libgcc=no)
kono
parents:
diff changeset
559 CFLAGS="$ac_save_CFLAGS"
kono
parents:
diff changeset
560 if test $libat_shared_libgcc = no; then
kono
parents:
diff changeset
561 cat > conftest.c <<EOF
kono
parents:
diff changeset
562 int main (void) { return 0; }
kono
parents:
diff changeset
563 EOF
kono
parents:
diff changeset
564 changequote(,)dnl
kono
parents:
diff changeset
565 libat_libgcc_s_suffix=`${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
kono
parents:
diff changeset
566 -shared -shared-libgcc -o conftest.so \
kono
parents:
diff changeset
567 conftest.c -v 2>&1 >/dev/null \
kono
parents:
diff changeset
568 | sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'`
kono
parents:
diff changeset
569 changequote([,])dnl
kono
parents:
diff changeset
570 rm -f conftest.c conftest.so
kono
parents:
diff changeset
571 if test x${libat_libgcc_s_suffix+set} = xset; then
kono
parents:
diff changeset
572 CFLAGS=" -lgcc_s$libat_libgcc_s_suffix"
kono
parents:
diff changeset
573 AC_TRY_LINK(, [return 0;], libat_shared_libgcc=yes)
kono
parents:
diff changeset
574 CFLAGS="$ac_save_CFLAGS"
kono
parents:
diff changeset
575 fi
kono
parents:
diff changeset
576 fi
kono
parents:
diff changeset
577 AC_MSG_RESULT($libat_shared_libgcc)
kono
parents:
diff changeset
578 fi
kono
parents:
diff changeset
579
kono
parents:
diff changeset
580 # For GNU ld, we need at least this version. The format is described in
kono
parents:
diff changeset
581 # LIBAT_CHECK_LINKER_FEATURES above.
kono
parents:
diff changeset
582 libat_min_gnu_ld_version=21400
kono
parents:
diff changeset
583 # XXXXXXXXXXX libat_gnu_ld_version=21390
kono
parents:
diff changeset
584
kono
parents:
diff changeset
585 # Check to see if unspecified "yes" value can win, given results above.
kono
parents:
diff changeset
586 # Change "yes" into either "no" or a style name.
kono
parents:
diff changeset
587 if test $enable_symvers != no && test $libat_shared_libgcc = yes; then
kono
parents:
diff changeset
588 if test $with_gnu_ld = yes; then
kono
parents:
diff changeset
589 if test $libat_gnu_ld_version -ge $libat_min_gnu_ld_version ; then
kono
parents:
diff changeset
590 enable_symvers=gnu
kono
parents:
diff changeset
591 elif test $libat_ld_is_gold = yes ; then
kono
parents:
diff changeset
592 enable_symvers=gnu
kono
parents:
diff changeset
593 else
kono
parents:
diff changeset
594 # The right tools, the right setup, but too old. Fallbacks?
kono
parents:
diff changeset
595 AC_MSG_WARN(=== Linker version $libat_gnu_ld_version is too old for)
kono
parents:
diff changeset
596 AC_MSG_WARN(=== full symbol versioning support in this release of GCC.)
kono
parents:
diff changeset
597 AC_MSG_WARN(=== You would need to upgrade your binutils to version)
kono
parents:
diff changeset
598 AC_MSG_WARN(=== $libat_min_gnu_ld_version or later and rebuild GCC.)
kono
parents:
diff changeset
599 if test $libat_gnu_ld_version -ge 21200 ; then
kono
parents:
diff changeset
600 # Globbing fix is present, proper block support is not.
kono
parents:
diff changeset
601 dnl AC_MSG_WARN([=== Dude, you are soooo close. Maybe we can fake it.])
kono
parents:
diff changeset
602 dnl enable_symvers=???
kono
parents:
diff changeset
603 AC_MSG_WARN([=== Symbol versioning will be disabled.])
kono
parents:
diff changeset
604 enable_symvers=no
kono
parents:
diff changeset
605 else
kono
parents:
diff changeset
606 # 2.11 or older.
kono
parents:
diff changeset
607 AC_MSG_WARN([=== Symbol versioning will be disabled.])
kono
parents:
diff changeset
608 enable_symvers=no
kono
parents:
diff changeset
609 fi
kono
parents:
diff changeset
610 fi
kono
parents:
diff changeset
611 elif test $enable_symvers = sun; then
kono
parents:
diff changeset
612 : All interesting versions of Sun ld support sun style symbol versioning.
kono
parents:
diff changeset
613 else
kono
parents:
diff changeset
614 # just fail for now
kono
parents:
diff changeset
615 AC_MSG_WARN([=== You have requested some kind of symbol versioning, but])
kono
parents:
diff changeset
616 AC_MSG_WARN([=== either you are not using a supported linker, or you are])
kono
parents:
diff changeset
617 AC_MSG_WARN([=== not building a shared libgcc_s (which is required).])
kono
parents:
diff changeset
618 AC_MSG_WARN([=== Symbol versioning will be disabled.])
kono
parents:
diff changeset
619 enable_symvers=no
kono
parents:
diff changeset
620 fi
kono
parents:
diff changeset
621 fi
kono
parents:
diff changeset
622 if test $enable_symvers = gnu; then
kono
parents:
diff changeset
623 AC_DEFINE(LIBAT_GNU_SYMBOL_VERSIONING, 1,
kono
parents:
diff changeset
624 [Define to 1 if GNU symbol versioning is used for libatomic.])
kono
parents:
diff changeset
625 fi
kono
parents:
diff changeset
626
kono
parents:
diff changeset
627 AM_CONDITIONAL(LIBAT_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
kono
parents:
diff changeset
628 AM_CONDITIONAL(LIBAT_BUILD_VERSIONED_SHLIB_GNU, test $enable_symvers = gnu)
kono
parents:
diff changeset
629 AM_CONDITIONAL(LIBAT_BUILD_VERSIONED_SHLIB_SUN, test $enable_symvers = sun)
kono
parents:
diff changeset
630 AC_MSG_NOTICE(versioning on shared library symbols is $enable_symvers)
kono
parents:
diff changeset
631 ])
kono
parents:
diff changeset
632
kono
parents:
diff changeset
633 dnl ----------------------------------------------------------------------
kono
parents:
diff changeset
634 sinclude(../libtool.m4)
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
635 sinclude(../config/enable.m4)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
636 sinclude(../config/cet.m4)
111
kono
parents:
diff changeset
637 dnl The lines below arrange for aclocal not to bring an installed
kono
parents:
diff changeset
638 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
kono
parents:
diff changeset
639 dnl add a definition of LIBTOOL to Makefile.in.
kono
parents:
diff changeset
640 ifelse(,,,[AC_SUBST(LIBTOOL)
kono
parents:
diff changeset
641 AC_DEFUN([AM_PROG_LIBTOOL])
kono
parents:
diff changeset
642 AC_DEFUN([AC_LIBTOOL_DLOPEN])
kono
parents:
diff changeset
643 AC_DEFUN([AC_PROG_LD])
kono
parents:
diff changeset
644 ])