annotate libgo/configure.ac @ 120:f93fa5091070

fix conv1.c
author mir3636
date Thu, 08 Mar 2018 14:53:42 +0900
parents 04ced10e8804
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 # configure.ac -- Go library configure script.
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 # Copyright 2009 The Go Authors. All rights reserved.
kono
parents:
diff changeset
4 # Use of this source code is governed by a BSD-style
kono
parents:
diff changeset
5 # license that can be found in the LICENSE file.
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 # Process this file with autoreconf to produce configure.
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 AC_PREREQ(2.64)
kono
parents:
diff changeset
10 AC_INIT(package-unused, version-unused,, libgo)
kono
parents:
diff changeset
11 AC_CONFIG_SRCDIR(Makefile.am)
kono
parents:
diff changeset
12 AC_CONFIG_HEADER(config.h)
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 libtool_VERSION=12:0:0
kono
parents:
diff changeset
15 AC_SUBST(libtool_VERSION)
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 AM_ENABLE_MULTILIB(, ..)
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 AC_CANONICAL_SYSTEM
kono
parents:
diff changeset
20 target_alias=${target_alias-$host_alias}
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 AM_INIT_AUTOMAKE([1.9.3 no-define foreign no-dist -Wall -Wno-portability])
kono
parents:
diff changeset
23 AH_TEMPLATE(PACKAGE, [Name of package])
kono
parents:
diff changeset
24 AH_TEMPLATE(VERSION, [Version number of package])
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 m4_rename([_AC_ARG_VAR_PRECIOUS],[glibgo_PRECIOUS])
kono
parents:
diff changeset
27 m4_define([_AC_ARG_VAR_PRECIOUS],[])
kono
parents:
diff changeset
28 AC_PROG_CC
kono
parents:
diff changeset
29 AC_PROG_GO
kono
parents:
diff changeset
30 m4_rename_force([glibgo_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 AC_SUBST(CFLAGS)
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 case ${host} in
kono
parents:
diff changeset
35 *-*-aix*)
kono
parents:
diff changeset
36 # static hash tables crashes on AIX when libgo is built with O2
kono
parents:
diff changeset
37 CFLAGS="$CFLAGS -fno-section-anchors"
kono
parents:
diff changeset
38 GOCFLAGS="$GOCFLAGS -fno-section-anchors"
kono
parents:
diff changeset
39 ;;
kono
parents:
diff changeset
40 esac
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 AM_MAINTAINER_MODE
kono
parents:
diff changeset
43
kono
parents:
diff changeset
44 AC_PROG_LD
kono
parents:
diff changeset
45 AC_PROG_RANLIB
kono
parents:
diff changeset
46 AC_CHECK_TOOL(OBJCOPY, objcopy, missing-objcopy)
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 AC_LIBTOOL_DLOPEN
kono
parents:
diff changeset
49 AM_PROG_LIBTOOL
kono
parents:
diff changeset
50 AC_SUBST(enable_shared)
kono
parents:
diff changeset
51 AC_SUBST(enable_static)
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 CC_FOR_BUILD=${CC_FOR_BUILD:-gcc}
kono
parents:
diff changeset
54 AC_SUBST(CC_FOR_BUILD)
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 AC_PROG_AWK
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 WARN_FLAGS='-Wall -Wextra -Wwrite-strings -Wcast-qual'
kono
parents:
diff changeset
59 AC_SUBST(WARN_FLAGS)
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 AC_ARG_ENABLE(werror, [AS_HELP_STRING([--enable-werror],
kono
parents:
diff changeset
62 [turns on -Werror @<:@default=yes@:>@])])
kono
parents:
diff changeset
63 if test "x$enable_werror" != "xno"; then
kono
parents:
diff changeset
64 WERROR="-Werror"
kono
parents:
diff changeset
65 fi
kono
parents:
diff changeset
66 AC_SUBST(WERROR)
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 glibgo_toolexecdir=no
kono
parents:
diff changeset
69 glibgo_toolexeclibdir=no
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
kono
parents:
diff changeset
72 AC_ARG_ENABLE([version-specific-runtime-libs],
kono
parents:
diff changeset
73 AC_HELP_STRING([--enable-version-specific-runtime-libs],
kono
parents:
diff changeset
74 [Specify that runtime libraries should be installed in a compiler-specific directory]),
kono
parents:
diff changeset
75 [case "$enableval" in
kono
parents:
diff changeset
76 yes) version_specific_libs=yes ;;
kono
parents:
diff changeset
77 no) version_specific_libs=no ;;
kono
parents:
diff changeset
78 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
kono
parents:
diff changeset
79 esac],
kono
parents:
diff changeset
80 [version_specific_libs=no])
kono
parents:
diff changeset
81 AC_MSG_RESULT($version_specific_libs)
kono
parents:
diff changeset
82
kono
parents:
diff changeset
83 # Version-specific runtime libs processing.
kono
parents:
diff changeset
84 if test $version_specific_libs = yes; then
kono
parents:
diff changeset
85 glibgo_toolexecdir='${libdir}/gcc/${host_alias}'
kono
parents:
diff changeset
86 glibgo_toolexeclibdir='${toolexecdir}/${gcc_version}$(MULTISUBDIR)'
kono
parents:
diff changeset
87 fi
kono
parents:
diff changeset
88
kono
parents:
diff changeset
89 # Calculate glibgo_toolexecdir, glibgo_toolexeclibdir
kono
parents:
diff changeset
90 # Install a library built with a cross compiler in tooldir, not libdir.
kono
parents:
diff changeset
91 if test -n "$with_cross_host" &&
kono
parents:
diff changeset
92 test x"$with_cross_host" != x"no"; then
kono
parents:
diff changeset
93 nover_glibgo_toolexecdir='${exec_prefix}/${host_alias}'
kono
parents:
diff changeset
94 nover_glibgo_toolexeclibdir='${toolexecdir}/lib'
kono
parents:
diff changeset
95 else
kono
parents:
diff changeset
96 nover_glibgo_toolexecdir='${libdir}/gcc/${host_alias}'
kono
parents:
diff changeset
97 nover_glibgo_toolexeclibdir='${libdir}'
kono
parents:
diff changeset
98 fi
kono
parents:
diff changeset
99 multi_os_directory=`$GOC -print-multi-os-directory`
kono
parents:
diff changeset
100 case $multi_os_directory in
kono
parents:
diff changeset
101 .) ;; # Avoid trailing /.
kono
parents:
diff changeset
102 *) nover_glibgo_toolexeclibdir=${nover_glibgo_toolexeclibdir}/${multi_os_directory} ;;
kono
parents:
diff changeset
103 esac
kono
parents:
diff changeset
104
kono
parents:
diff changeset
105 if test x"$glibgo_toolexecdir" = x"no"; then
kono
parents:
diff changeset
106 glibgo_toolexecdir="${nover_glibgo_toolexecdir}"
kono
parents:
diff changeset
107 glibgo_toolexeclibdir="${nover_glibgo_toolexeclibdir}"
kono
parents:
diff changeset
108 fi
kono
parents:
diff changeset
109
kono
parents:
diff changeset
110 AC_SUBST(glibgo_toolexecdir)
kono
parents:
diff changeset
111 AC_SUBST(glibgo_toolexeclibdir)
kono
parents:
diff changeset
112 AC_SUBST(nover_glibgo_toolexeclibdir)
kono
parents:
diff changeset
113
kono
parents:
diff changeset
114 # See if the user wants to configure without libffi. Some
kono
parents:
diff changeset
115 # architectures don't support it. FIXME: We should set a default
kono
parents:
diff changeset
116 # based on the host.
kono
parents:
diff changeset
117 AC_ARG_WITH(libffi,
kono
parents:
diff changeset
118 AS_HELP_STRING([--without-libffi],
kono
parents:
diff changeset
119 [don't use libffi]),
kono
parents:
diff changeset
120 [:],
kono
parents:
diff changeset
121 [with_libffi=${with_libffi_default-yes}])
kono
parents:
diff changeset
122
kono
parents:
diff changeset
123 LIBFFI=
kono
parents:
diff changeset
124 LIBFFIINCS=
kono
parents:
diff changeset
125 if test "$with_libffi" != no; then
kono
parents:
diff changeset
126 AC_DEFINE(USE_LIBFFI, 1, [Define if we're to use libffi.])
kono
parents:
diff changeset
127 LIBFFI=../libffi/libffi_convenience.la
kono
parents:
diff changeset
128 LIBFFIINCS='-I$(top_srcdir)/../libffi/include -I../libffi/include'
kono
parents:
diff changeset
129 fi
kono
parents:
diff changeset
130 AC_SUBST(LIBFFI)
kono
parents:
diff changeset
131 AC_SUBST(LIBFFIINCS)
kono
parents:
diff changeset
132 AM_CONDITIONAL(USE_LIBFFI, test "$with_liffi" != "no")
kono
parents:
diff changeset
133
kono
parents:
diff changeset
134 # See if the user wants to configure without libatomic. This is useful if we are
kono
parents:
diff changeset
135 # on an architecture for which libgo does not need an atomic support library and
kono
parents:
diff changeset
136 # libatomic does not support our C compiler.
kono
parents:
diff changeset
137 AC_ARG_WITH(libatomic,
kono
parents:
diff changeset
138 AS_HELP_STRING([--without-libatomic],
kono
parents:
diff changeset
139 [don't use libatomic]),
kono
parents:
diff changeset
140 [:],
kono
parents:
diff changeset
141 [with_libatomic=${with_libatomic_default-yes}])
kono
parents:
diff changeset
142
kono
parents:
diff changeset
143 LIBATOMIC=
kono
parents:
diff changeset
144 if test "$with_libatomic" != no; then
kono
parents:
diff changeset
145 LIBATOMIC=../libatomic/libatomic_convenience.la
kono
parents:
diff changeset
146 fi
kono
parents:
diff changeset
147 AC_SUBST(LIBATOMIC)
kono
parents:
diff changeset
148
kono
parents:
diff changeset
149 # Used to tell GNU make to include a file without telling automake to
kono
parents:
diff changeset
150 # include it.
kono
parents:
diff changeset
151 go_include="-include"
kono
parents:
diff changeset
152 AC_SUBST(go_include)
kono
parents:
diff changeset
153
kono
parents:
diff changeset
154 # All known GOOS values. This is the union of all operating systems
kono
parents:
diff changeset
155 # supported by the gofrontend and all operating systems supported by
kono
parents:
diff changeset
156 # the gc toolchain.
kono
parents:
diff changeset
157 ALLGOOS="aix android darwin dragonfly freebsd irix linux netbsd openbsd plan9 rtems solaris windows"
kono
parents:
diff changeset
158
kono
parents:
diff changeset
159 is_darwin=no
kono
parents:
diff changeset
160 is_freebsd=no
kono
parents:
diff changeset
161 is_irix=no
kono
parents:
diff changeset
162 is_linux=no
kono
parents:
diff changeset
163 is_netbsd=no
kono
parents:
diff changeset
164 is_openbsd=no
kono
parents:
diff changeset
165 is_dragonfly=no
kono
parents:
diff changeset
166 is_rtems=no
kono
parents:
diff changeset
167 is_solaris=no
kono
parents:
diff changeset
168 is_aix=no
kono
parents:
diff changeset
169 GOOS=unknown
kono
parents:
diff changeset
170 case ${host} in
kono
parents:
diff changeset
171 *-*-darwin*) is_darwin=yes; GOOS=darwin ;;
kono
parents:
diff changeset
172 *-*-freebsd*) is_freebsd=yes; GOOS=freebsd ;;
kono
parents:
diff changeset
173 *-*-irix6*) is_irix=yes; GOOS=irix ;;
kono
parents:
diff changeset
174 *-*-linux*) is_linux=yes; GOOS=linux ;;
kono
parents:
diff changeset
175 *-*-netbsd*) is_netbsd=yes; GOOS=netbsd ;;
kono
parents:
diff changeset
176 *-*-openbsd*) is_openbsd=yes; GOOS=openbsd ;;
kono
parents:
diff changeset
177 *-*-dragonfly*) is_dragonfly=yes; GOOS=dragonfly ;;
kono
parents:
diff changeset
178 *-*-rtems*) is_rtems=yes; GOOS=rtems ;;
kono
parents:
diff changeset
179 *-*-solaris2*) is_solaris=yes; GOOS=solaris ;;
kono
parents:
diff changeset
180 *-*-aix*) is_aix=yes; GOOS=aix ;;
kono
parents:
diff changeset
181 esac
kono
parents:
diff changeset
182 AM_CONDITIONAL(LIBGO_IS_DARWIN, test $is_darwin = yes)
kono
parents:
diff changeset
183 AM_CONDITIONAL(LIBGO_IS_FREEBSD, test $is_freebsd = yes)
kono
parents:
diff changeset
184 AM_CONDITIONAL(LIBGO_IS_IRIX, test $is_irix = yes)
kono
parents:
diff changeset
185 AM_CONDITIONAL(LIBGO_IS_LINUX, test $is_linux = yes)
kono
parents:
diff changeset
186 AM_CONDITIONAL(LIBGO_IS_NETBSD, test $is_netbsd = yes)
kono
parents:
diff changeset
187 AM_CONDITIONAL(LIBGO_IS_OPENBSD, test $is_openbsd = yes)
kono
parents:
diff changeset
188 AM_CONDITIONAL(LIBGO_IS_DRAGONFLY, test $is_dragonfly = yes)
kono
parents:
diff changeset
189 AM_CONDITIONAL(LIBGO_IS_RTEMS, test $is_rtems = yes)
kono
parents:
diff changeset
190 AM_CONDITIONAL(LIBGO_IS_SOLARIS, test $is_solaris = yes)
kono
parents:
diff changeset
191 AM_CONDITIONAL(LIBGO_IS_AIX, test $is_aix = yes)
kono
parents:
diff changeset
192 AM_CONDITIONAL(LIBGO_IS_BSD, test $is_darwin = yes -o $is_dragonfly = yes -o $is_freebsd = yes -o $is_netbsd = yes -o $is_openbsd = yes)
kono
parents:
diff changeset
193 AC_SUBST(GOOS)
kono
parents:
diff changeset
194 AC_SUBST(ALLGOOS)
kono
parents:
diff changeset
195
kono
parents:
diff changeset
196 dnl Test whether we need to use DejaGNU or whether we can use the
kono
parents:
diff changeset
197 dnl simpler gotest approach. We can only use gotest for a native
kono
parents:
diff changeset
198 dnl build.
kono
parents:
diff changeset
199 USE_DEJAGNU=no
kono
parents:
diff changeset
200 case ${host} in
kono
parents:
diff changeset
201 *-*-rtems*) USE_DEJAGNU=yes ;;
kono
parents:
diff changeset
202 ${build}) ;;
kono
parents:
diff changeset
203 *) USE_DEJAGNU=yes ;;
kono
parents:
diff changeset
204 esac
kono
parents:
diff changeset
205 AC_SUBST(USE_DEJAGNU)
kono
parents:
diff changeset
206
kono
parents:
diff changeset
207 # All known GOARCH values. This is the union of all architectures
kono
parents:
diff changeset
208 # supported by the gofrontend and all architectures supported by the
kono
parents:
diff changeset
209 # gc toolchain.
kono
parents:
diff changeset
210 # N.B. Keep in sync with gcc/testsuite/go.test/go-test.exp (go-set-goarch).
kono
parents:
diff changeset
211 ALLGOARCH="386 alpha amd64 amd64p32 arm armbe arm64 arm64be ia64 m68k mips mipsle mips64 mips64le mips64p32 mips64p32le ppc ppc64 ppc64le s390 s390x sparc sparc64"
kono
parents:
diff changeset
212
kono
parents:
diff changeset
213 # All known GOARCH_FAMILY values.
kono
parents:
diff changeset
214 ALLGOARCHFAMILY="I386 ALPHA AMD64 ARM ARM64 IA64 M68K MIPS MIPS64 PPC PPC64 S390 S390X SPARC SPARC64"
kono
parents:
diff changeset
215
kono
parents:
diff changeset
216 GOARCH=unknown
kono
parents:
diff changeset
217 GOARCH_FAMILY=unknown
kono
parents:
diff changeset
218 GOARCH_BIGENDIAN=0
kono
parents:
diff changeset
219 GOARCH_CACHELINESIZE=64
kono
parents:
diff changeset
220 GOARCH_PHYSPAGESIZE=4096
kono
parents:
diff changeset
221 GOARCH_PCQUANTUM=1
kono
parents:
diff changeset
222 GOARCH_INT64ALIGN=8
kono
parents:
diff changeset
223 GOARCH_HUGEPAGESIZE=0
kono
parents:
diff changeset
224 GOARCH_MINFRAMESIZE=0
kono
parents:
diff changeset
225 case ${host} in
kono
parents:
diff changeset
226 alpha*-*-*)
kono
parents:
diff changeset
227 GOARCH=alpha
kono
parents:
diff changeset
228 GOARCH_FAMILY=ALPHA
kono
parents:
diff changeset
229 GOARCH_PHYSPAGESIZE=8192
kono
parents:
diff changeset
230 GOARCH_PCQUANTUM=4
kono
parents:
diff changeset
231 ;;
kono
parents:
diff changeset
232 aarch64-*-*)
kono
parents:
diff changeset
233 GOARCH=arm64
kono
parents:
diff changeset
234 GOARCH_FAMILY=ARM64
kono
parents:
diff changeset
235 GOARCH_CACHELINESIZE=32
kono
parents:
diff changeset
236 GOARCH_PHYSPAGESIZE=65536
kono
parents:
diff changeset
237 GOARCH_PCQUANTUM=4
kono
parents:
diff changeset
238 GOARCH_MINFRAMESIZE=8
kono
parents:
diff changeset
239 ;;
kono
parents:
diff changeset
240 arm*-*-* | strongarm*-*-* | ep9312*-*-* | xscale-*-*)
kono
parents:
diff changeset
241 GOARCH=arm
kono
parents:
diff changeset
242 GOARCH_FAMILY=ARM
kono
parents:
diff changeset
243 GOARCH_CACHELINESIZE=32
kono
parents:
diff changeset
244 GOARCH_PCQUANTUM=4
kono
parents:
diff changeset
245 GOARCH_MINFRAMESIZE=4
kono
parents:
diff changeset
246 ;;
kono
parents:
diff changeset
247 changequote(,)dnl
kono
parents:
diff changeset
248 i[34567]86-*-* | x86_64-*-*)
kono
parents:
diff changeset
249 changequote([,])dnl
kono
parents:
diff changeset
250 AC_COMPILE_IFELSE([
kono
parents:
diff changeset
251 #ifdef __x86_64__
kono
parents:
diff changeset
252 #error 64-bit
kono
parents:
diff changeset
253 #endif],
kono
parents:
diff changeset
254 [GOARCH=386
kono
parents:
diff changeset
255 GOARCH_FAMILY=I386
kono
parents:
diff changeset
256 GOARCH_INT64ALIGN=4
kono
parents:
diff changeset
257 GOARCH_HUGEPAGESIZE="1 << 21"
kono
parents:
diff changeset
258 ],
kono
parents:
diff changeset
259 [GOARCH=amd64
kono
parents:
diff changeset
260 GOARCH_FAMILY=AMD64
kono
parents:
diff changeset
261 GOARCH_HUGEPAGESIZE="1 << 21"
kono
parents:
diff changeset
262 ])
kono
parents:
diff changeset
263 ;;
kono
parents:
diff changeset
264 ia64-*-*)
kono
parents:
diff changeset
265 GOARCH=ia64
kono
parents:
diff changeset
266 GOARCH_FAMILY=IA64
kono
parents:
diff changeset
267 GOARCH_CACHELINESIZE=16384
kono
parents:
diff changeset
268 GOARCH_PHYSPAGESIZE=65536
kono
parents:
diff changeset
269 ;;
kono
parents:
diff changeset
270 m68k*-*-*)
kono
parents:
diff changeset
271 GOARCH=m68k
kono
parents:
diff changeset
272 GOARCH_FAMILY=M68K
kono
parents:
diff changeset
273 GOARCH_BIGENDIAN=1
kono
parents:
diff changeset
274 GOARCH_CACHELINESIZE=16
kono
parents:
diff changeset
275 GOARCH_PCQUANTUM=4
kono
parents:
diff changeset
276 GOARCH_INT64ALIGN=2
kono
parents:
diff changeset
277 ;;
kono
parents:
diff changeset
278 mips*-*-*)
kono
parents:
diff changeset
279 AC_COMPILE_IFELSE([
kono
parents:
diff changeset
280 #if _MIPS_SIM != _ABIO32
kono
parents:
diff changeset
281 #error not o32
kono
parents:
diff changeset
282 #endif],
kono
parents:
diff changeset
283 [mips_abi="o32"],
kono
parents:
diff changeset
284 [AC_COMPILE_IFELSE([
kono
parents:
diff changeset
285 #if _MIPS_SIM != _ABIN32
kono
parents:
diff changeset
286 #error not n32
kono
parents:
diff changeset
287 #endif],
kono
parents:
diff changeset
288 [mips_abi="n32"],
kono
parents:
diff changeset
289 [AC_COMPILE_IFELSE([
kono
parents:
diff changeset
290 #if _MIPS_SIM != _ABI64
kono
parents:
diff changeset
291 #error not n64
kono
parents:
diff changeset
292 #endif],
kono
parents:
diff changeset
293 [mips_abi="n64"],
kono
parents:
diff changeset
294 [AC_MSG_ERROR([unknown MIPS ABI])
kono
parents:
diff changeset
295 [mips_abi="n32"]])])])
kono
parents:
diff changeset
296 case "$mips_abi" in
kono
parents:
diff changeset
297 "o32") GOARCH=mips ;;
kono
parents:
diff changeset
298 "n32") GOARCH=mips64p32 ;;
kono
parents:
diff changeset
299 "n64") GOARCH=mips64 ;;
kono
parents:
diff changeset
300 esac
kono
parents:
diff changeset
301 case "$mips_abi" in
kono
parents:
diff changeset
302 "o32" | "n32")
kono
parents:
diff changeset
303 GOARCH_FAMILY=MIPS
kono
parents:
diff changeset
304 GOARCH_MINFRAMESIZE=4
kono
parents:
diff changeset
305 ;;
kono
parents:
diff changeset
306 "n64")
kono
parents:
diff changeset
307 GOARCH_FAMILY=MIPS64
kono
parents:
diff changeset
308 GOARCH_MINFRAMESIZE=8
kono
parents:
diff changeset
309 ;;
kono
parents:
diff changeset
310 esac
kono
parents:
diff changeset
311 case "${host}" in
kono
parents:
diff changeset
312 mips*el-*-*)
kono
parents:
diff changeset
313 GOARCH="${GOARCH}le"
kono
parents:
diff changeset
314 ;;
kono
parents:
diff changeset
315 *)
kono
parents:
diff changeset
316 GOARCH_BIGENDIAN=1
kono
parents:
diff changeset
317 ;;
kono
parents:
diff changeset
318 esac
kono
parents:
diff changeset
319 GOARCH_CACHELINESIZE=32
kono
parents:
diff changeset
320 GOARCH_PHYSPAGESIZE=16384
kono
parents:
diff changeset
321 GOARCH_PCQUANTUM=4
kono
parents:
diff changeset
322 ;;
kono
parents:
diff changeset
323 rs6000*-*-* | powerpc*-*-*)
kono
parents:
diff changeset
324 AC_COMPILE_IFELSE([
kono
parents:
diff changeset
325 #ifdef _ARCH_PPC64
kono
parents:
diff changeset
326 #error 64-bit
kono
parents:
diff changeset
327 #endif],
kono
parents:
diff changeset
328 [GOARCH=ppc
kono
parents:
diff changeset
329 GOARCH_FAMILY=PPC
kono
parents:
diff changeset
330 GOARCH_BIGENDIAN=1
kono
parents:
diff changeset
331 ],
kono
parents:
diff changeset
332 [
kono
parents:
diff changeset
333 GOARCH_FAMILY=PPC64
kono
parents:
diff changeset
334 AC_COMPILE_IFELSE([
kono
parents:
diff changeset
335 #if defined(_BIG_ENDIAN) || defined(__BIG_ENDIAN__)
kono
parents:
diff changeset
336 #error 64be
kono
parents:
diff changeset
337 #endif],
kono
parents:
diff changeset
338 [GOARCH=ppc64le
kono
parents:
diff changeset
339 ],
kono
parents:
diff changeset
340 [GOARCH=ppc64
kono
parents:
diff changeset
341 GOARCH_BIGENDIAN=1
kono
parents:
diff changeset
342 ])])
kono
parents:
diff changeset
343 GOARCH_PHYSPAGESIZE=65536
kono
parents:
diff changeset
344 GOARCH_PCQUANTUM=4
kono
parents:
diff changeset
345 GOARCH_MINFRAMESIZE=32
kono
parents:
diff changeset
346 ;;
kono
parents:
diff changeset
347 s390*-*-*)
kono
parents:
diff changeset
348 AC_COMPILE_IFELSE([
kono
parents:
diff changeset
349 #if defined(__s390x__)
kono
parents:
diff changeset
350 #error 64-bit
kono
parents:
diff changeset
351 #endif],
kono
parents:
diff changeset
352 [GOARCH=s390
kono
parents:
diff changeset
353 GOARCH_FAMILY=S390
kono
parents:
diff changeset
354 GOARCH_MINFRAMESIZE=4
kono
parents:
diff changeset
355 ], [GOARCH=s390x
kono
parents:
diff changeset
356 GOARCH_FAMILY=S390X
kono
parents:
diff changeset
357 GOARCH_MINFRAMESIZE=8
kono
parents:
diff changeset
358 ])
kono
parents:
diff changeset
359 GOARCH_BIGENDIAN=1
kono
parents:
diff changeset
360 GOARCH_CACHELINESIZE=256
kono
parents:
diff changeset
361 GOARCH_PCQUANTUM=2
kono
parents:
diff changeset
362 ;;
kono
parents:
diff changeset
363 sparc*-*-*)
kono
parents:
diff changeset
364 AC_COMPILE_IFELSE([
kono
parents:
diff changeset
365 #if defined(__sparcv9) || defined(__arch64__)
kono
parents:
diff changeset
366 #error 64-bit
kono
parents:
diff changeset
367 #endif],
kono
parents:
diff changeset
368 [GOARCH=sparc
kono
parents:
diff changeset
369 GOARCH_FAMILY=SPARC
kono
parents:
diff changeset
370 ],
kono
parents:
diff changeset
371 [GOARCH=sparc64
kono
parents:
diff changeset
372 GOARCH_FAMILY=SPARC64
kono
parents:
diff changeset
373 ])
kono
parents:
diff changeset
374 GOARCH_BIGENDIAN=1
kono
parents:
diff changeset
375 GOARCH_PHYSPAGESIZE=8192
kono
parents:
diff changeset
376 GOARCH_PCQUANTUM=4
kono
parents:
diff changeset
377 ;;
kono
parents:
diff changeset
378 esac
kono
parents:
diff changeset
379 AC_SUBST(GOARCH)
kono
parents:
diff changeset
380 AC_SUBST(GOARCH_FAMILY)
kono
parents:
diff changeset
381 AC_SUBST(GOARCH_BIGENDIAN)
kono
parents:
diff changeset
382 AC_SUBST(GOARCH_CACHELINESIZE)
kono
parents:
diff changeset
383 AC_SUBST(GOARCH_PHYSPAGESIZE)
kono
parents:
diff changeset
384 AC_SUBST(GOARCH_PCQUANTUM)
kono
parents:
diff changeset
385 AC_SUBST(GOARCH_INT64ALIGN)
kono
parents:
diff changeset
386 AC_SUBST(GOARCH_HUGEPAGESIZE)
kono
parents:
diff changeset
387 AC_SUBST(GOARCH_MINFRAMESIZE)
kono
parents:
diff changeset
388 AC_SUBST(ALLGOARCH)
kono
parents:
diff changeset
389 AC_SUBST(ALLGOARCHFAMILY)
kono
parents:
diff changeset
390
kono
parents:
diff changeset
391 dnl Some files are only present when needed for specific architectures.
kono
parents:
diff changeset
392 GO_LIBCALL_OS_FILE=
kono
parents:
diff changeset
393 GO_LIBCALL_OS_ARCH_FILE=
kono
parents:
diff changeset
394 GO_SYSCALL_OS_FILE=
kono
parents:
diff changeset
395 GO_SYSCALL_OS_ARCH_FILE=
kono
parents:
diff changeset
396 if test -f "${srcdir}/go/syscall/libcall_${GOOS}.go"; then
kono
parents:
diff changeset
397 GO_LIBCALL_OS_FILE="go/syscall/libcall_${GOOS}.go"
kono
parents:
diff changeset
398 fi
kono
parents:
diff changeset
399 if test -f "${srcdir}/go/syscall/libcall_${GOOS}_${GOARCH}.go"; then
kono
parents:
diff changeset
400 GO_LIBCALL_OS_ARCH_FILE="go/syscall/libcall_${GOOS}_${GOARCH}.go"
kono
parents:
diff changeset
401 fi
kono
parents:
diff changeset
402 if test -f "${srcdir}/go/syscall/syscall_${GOOS}.go"; then
kono
parents:
diff changeset
403 GO_SYSCALL_OS_FILE="go/syscall/syscall_${GOOS}.go"
kono
parents:
diff changeset
404 fi
kono
parents:
diff changeset
405 if test -f "${srcdir}/go/syscall/syscall_${GOOS}_${GOARCH}.go"; then
kono
parents:
diff changeset
406 GO_SYSCALL_OS_ARCH_FILE="go/syscall/syscall_${GOOS}_${GOARCH}.go"
kono
parents:
diff changeset
407 fi
kono
parents:
diff changeset
408 AC_SUBST(GO_LIBCALL_OS_FILE)
kono
parents:
diff changeset
409 AC_SUBST(GO_LIBCALL_OS_ARCH_FILE)
kono
parents:
diff changeset
410 AC_SUBST(GO_SYSCALL_OS_FILE)
kono
parents:
diff changeset
411 AC_SUBST(GO_SYSCALL_OS_ARCH_FILE)
kono
parents:
diff changeset
412
kono
parents:
diff changeset
413 dnl Special flags used to generate sysinfo.go.
kono
parents:
diff changeset
414 OSCFLAGS="-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
kono
parents:
diff changeset
415 case "$target" in
kono
parents:
diff changeset
416 mips-sgi-irix6.5*)
kono
parents:
diff changeset
417 # IRIX 6 needs _XOPEN_SOURCE=500 for the XPG5 version of struct
kono
parents:
diff changeset
418 # msghdr in <sys/socket.h>.
kono
parents:
diff changeset
419 OSCFLAGS="$OSCFLAGS -D_XOPEN_SOURCE=500"
kono
parents:
diff changeset
420 ;;
kono
parents:
diff changeset
421 *-*-solaris2.1[[01]])
kono
parents:
diff changeset
422 # Solaris 10+ needs this so struct msghdr gets the msg_control
kono
parents:
diff changeset
423 # etc. fields in <sys/socket.h> (_XPG4_2). _XOPEN_SOURCE=600 as
kono
parents:
diff changeset
424 # above doesn't work with C99.
kono
parents:
diff changeset
425 OSCFLAGS="$OSCFLAGS -std=gnu99 -D_XOPEN_SOURCE=600 -D__EXTENSIONS__"
kono
parents:
diff changeset
426 ;;
kono
parents:
diff changeset
427 esac
kono
parents:
diff changeset
428 AC_SUBST(OSCFLAGS)
kono
parents:
diff changeset
429
kono
parents:
diff changeset
430 dnl Check if assembler supports disabling hardware capability support.
kono
parents:
diff changeset
431 GCC_CHECK_ASSEMBLER_HWCAP
kono
parents:
diff changeset
432
kono
parents:
diff changeset
433 dnl Use -fsplit-stack when compiling C code if available.
kono
parents:
diff changeset
434 AC_CACHE_CHECK([whether -fsplit-stack is supported],
kono
parents:
diff changeset
435 [libgo_cv_c_split_stack_supported],
kono
parents:
diff changeset
436 [CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
437 CFLAGS="$CFLAGS -fsplit-stack"
kono
parents:
diff changeset
438 AC_COMPILE_IFELSE([[int i;]],
kono
parents:
diff changeset
439 [libgo_cv_c_split_stack_supported=yes],
kono
parents:
diff changeset
440 [libgo_cv_c_split_stack_supported=no])
kono
parents:
diff changeset
441 CFLAGS=$CFLAGS_hold])
kono
parents:
diff changeset
442
kono
parents:
diff changeset
443 dnl Make sure the linker permits -fsplit-stack. Old versions of gold will
kono
parents:
diff changeset
444 dnl reject split-stack code calling non-split-stack code on targets
kono
parents:
diff changeset
445 dnl they don't support.
kono
parents:
diff changeset
446 AC_CACHE_CHECK([whether linker supports split/non-split linked together],
kono
parents:
diff changeset
447 [libgo_cv_c_linker_split_non_split],
kono
parents:
diff changeset
448 [cat > conftest1.c << EOF
kono
parents:
diff changeset
449 extern void f();
kono
parents:
diff changeset
450 int main() { f(); return 0; }
kono
parents:
diff changeset
451 EOF
kono
parents:
diff changeset
452 cat > conftest2.c << EOF
kono
parents:
diff changeset
453 void f() {}
kono
parents:
diff changeset
454 EOF
kono
parents:
diff changeset
455 $CC -c -fsplit-stack $CFLAGS $CPPFLAGS conftest1.c >/dev/null 2>&1
kono
parents:
diff changeset
456 $CC -c $CFLAGS $CPPFLAGS conftest2.c > /dev/null 2>&1
kono
parents:
diff changeset
457 if $CC -o conftest conftest1.$ac_objext conftest2.$ac_objext > /dev/null 2>&1; then
kono
parents:
diff changeset
458 libgo_cv_c_linker_split_non_split=yes
kono
parents:
diff changeset
459 else
kono
parents:
diff changeset
460 libgo_cv_c_linker_split_non_split=no
kono
parents:
diff changeset
461 fi
kono
parents:
diff changeset
462 rm -f conftest1.* conftest2.* conftest])
kono
parents:
diff changeset
463
kono
parents:
diff changeset
464 if test "$libgo_cv_c_split_stack_supported" = yes -a "$libgo_cv_c_linker_split_non_split" = yes; then
kono
parents:
diff changeset
465 SPLIT_STACK=-fsplit-stack
kono
parents:
diff changeset
466 AC_DEFINE(USING_SPLIT_STACK, 1,
kono
parents:
diff changeset
467 [Define if the compiler supports -fsplit-stack])
kono
parents:
diff changeset
468 else
kono
parents:
diff changeset
469 SPLIT_STACK=
kono
parents:
diff changeset
470 fi
kono
parents:
diff changeset
471 AC_SUBST(SPLIT_STACK)
kono
parents:
diff changeset
472 AM_CONDITIONAL(USING_SPLIT_STACK,
kono
parents:
diff changeset
473 test "$libgo_cv_c_split_stack_supported" = yes -a "$libgo_cv_c_linker_split_non_split" = yes)
kono
parents:
diff changeset
474
kono
parents:
diff changeset
475 dnl If the compiler supports split-stack but the linker does not, then
kono
parents:
diff changeset
476 dnl we need to explicitly disable split-stack for Go.
kono
parents:
diff changeset
477 if test "$libgo_cv_c_split_stack_supported" = yes -a "$libgo_cv_c_linker_split_non_split" = no; then
kono
parents:
diff changeset
478 GO_SPLIT_STACK=-fno-split-stack
kono
parents:
diff changeset
479 else
kono
parents:
diff changeset
480 GO_SPLIT_STACK=
kono
parents:
diff changeset
481 fi
kono
parents:
diff changeset
482 AC_SUBST(GO_SPLIT_STACK)
kono
parents:
diff changeset
483
kono
parents:
diff changeset
484 dnl Check whether the linker does stack munging when calling from
kono
parents:
diff changeset
485 dnl split-stack into non-split-stack code. We check this by looking
kono
parents:
diff changeset
486 dnl at the --help output. FIXME: This is only half right: it's
kono
parents:
diff changeset
487 dnl possible for the linker to support this for some targets but not
kono
parents:
diff changeset
488 dnl others.
kono
parents:
diff changeset
489 dnl This is slightly different from the above check, which is whether
kono
parents:
diff changeset
490 dnl the linker permits the call at all.
kono
parents:
diff changeset
491 AC_CACHE_CHECK([whether linker supports split stack],
kono
parents:
diff changeset
492 [libgo_cv_c_linker_supports_split_stack],
kono
parents:
diff changeset
493 [libgo_cv_c_linker_supports_split_stack=no
kono
parents:
diff changeset
494 if $GOC -Wl,--help 2>/dev/null | grep split-stack-adjust-size >/dev/null 2>&1; then
kono
parents:
diff changeset
495 libgo_cv_c_linker_supports_split_stack=yes
kono
parents:
diff changeset
496 fi])
kono
parents:
diff changeset
497 if test "$libgo_cv_c_linker_supports_split_stack" = yes; then
kono
parents:
diff changeset
498 AC_DEFINE(LINKER_SUPPORTS_SPLIT_STACK, 1,
kono
parents:
diff changeset
499 [Define if the linker support split stack adjustments])
kono
parents:
diff changeset
500 fi
kono
parents:
diff changeset
501
kono
parents:
diff changeset
502 AC_CACHE_CHECK([whether compiler is llgo],
kono
parents:
diff changeset
503 [libgo_cv_c_goc_is_llgo],
kono
parents:
diff changeset
504 [libgo_cv_c_goc_is_llgo=no
kono
parents:
diff changeset
505 if $GOC -dumpversion 2>/dev/null | grep llgo >/dev/null 2>&1; then
kono
parents:
diff changeset
506 libgo_cv_c_goc_is_llgo=yes
kono
parents:
diff changeset
507 fi])
kono
parents:
diff changeset
508 AM_CONDITIONAL(GOC_IS_LLGO, test "$libgo_cv_c_goc_is_llgo" = yes)
kono
parents:
diff changeset
509
kono
parents:
diff changeset
510 dnl Test for the -lm library.
kono
parents:
diff changeset
511 MATH_LIBS=
kono
parents:
diff changeset
512 AC_CHECK_LIB([m], [sqrt], MATH_LIBS=-lm)
kono
parents:
diff changeset
513 AC_SUBST(MATH_LIBS)
kono
parents:
diff changeset
514
kono
parents:
diff changeset
515 dnl Test for -lsocket and -lnsl. Copied from libjava/configure.ac.
kono
parents:
diff changeset
516 AC_CACHE_CHECK([for socket libraries], libgo_cv_lib_sockets,
kono
parents:
diff changeset
517 [libgo_cv_lib_sockets=
kono
parents:
diff changeset
518 libgo_check_both=no
kono
parents:
diff changeset
519 AC_CHECK_FUNC(connect, libgo_check_socket=no, libgo_check_socket=yes)
kono
parents:
diff changeset
520 if test "$libgo_check_socket" = "yes"; then
kono
parents:
diff changeset
521 unset ac_cv_func_connect
kono
parents:
diff changeset
522 AC_CHECK_LIB(socket, main, libgo_cv_lib_sockets="-lsocket",
kono
parents:
diff changeset
523 libgo_check_both=yes)
kono
parents:
diff changeset
524 fi
kono
parents:
diff changeset
525 if test "$libgo_check_both" = "yes"; then
kono
parents:
diff changeset
526 libgo_old_libs=$LIBS
kono
parents:
diff changeset
527 LIBS="$LIBS -lsocket -lnsl"
kono
parents:
diff changeset
528 unset ac_cv_func_accept
kono
parents:
diff changeset
529 AC_CHECK_FUNC(accept,
kono
parents:
diff changeset
530 [libgo_check_nsl=no
kono
parents:
diff changeset
531 libgo_cv_lib_sockets="-lsocket -lnsl"])
kono
parents:
diff changeset
532 unset ac_cv_func_accept
kono
parents:
diff changeset
533 LIBS=$libgo_old_libs
kono
parents:
diff changeset
534 fi
kono
parents:
diff changeset
535 unset ac_cv_func_gethostbyname
kono
parents:
diff changeset
536 libgo_old_libs="$LIBS"
kono
parents:
diff changeset
537 AC_CHECK_FUNC(gethostbyname, ,
kono
parents:
diff changeset
538 [AC_CHECK_LIB(nsl, main,
kono
parents:
diff changeset
539 [libgo_cv_lib_sockets="$libgo_cv_lib_sockets -lnsl"])])
kono
parents:
diff changeset
540 unset ac_cv_func_gethostbyname
kono
parents:
diff changeset
541 AC_CHECK_FUNC(sendfile, ,
kono
parents:
diff changeset
542 [AC_CHECK_LIB(sendfile, main,
kono
parents:
diff changeset
543 [libgo_cv_lib_sockets="$libgo_cv_lib_sockets -lsendfile"])])
kono
parents:
diff changeset
544 LIBS=$libgo_old_libs
kono
parents:
diff changeset
545 ])
kono
parents:
diff changeset
546 NET_LIBS="$libgo_cv_lib_sockets"
kono
parents:
diff changeset
547 AC_SUBST(NET_LIBS)
kono
parents:
diff changeset
548
kono
parents:
diff changeset
549 dnl Test whether the compiler supports the -pthread option.
kono
parents:
diff changeset
550 AC_CACHE_CHECK([whether -pthread is supported],
kono
parents:
diff changeset
551 [libgo_cv_lib_pthread],
kono
parents:
diff changeset
552 [CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
553 CFLAGS="$CFLAGS -pthread"
kono
parents:
diff changeset
554 AC_COMPILE_IFELSE([[int i;]],
kono
parents:
diff changeset
555 [libgo_cv_lib_pthread=yes],
kono
parents:
diff changeset
556 [libgo_cv_lib_pthread=no])
kono
parents:
diff changeset
557 CFLAGS=$CFLAGS_hold])
kono
parents:
diff changeset
558 PTHREAD_CFLAGS=
kono
parents:
diff changeset
559 if test "$libgo_cv_lib_pthread" = yes; then
kono
parents:
diff changeset
560 PTHREAD_CFLAGS=-pthread
kono
parents:
diff changeset
561 fi
kono
parents:
diff changeset
562 AC_SUBST(PTHREAD_CFLAGS)
kono
parents:
diff changeset
563
kono
parents:
diff changeset
564 dnl Test for the -lpthread library.
kono
parents:
diff changeset
565 PTHREAD_LIBS=
kono
parents:
diff changeset
566 AC_CHECK_LIB([pthread], [pthread_create], PTHREAD_LIBS=-lpthread)
kono
parents:
diff changeset
567 AC_SUBST(PTHREAD_LIBS)
kono
parents:
diff changeset
568
kono
parents:
diff changeset
569 dnl Test if -lrt is required for sched_yield or nanosleep or clock_gettime.
kono
parents:
diff changeset
570 AC_SEARCH_LIBS([sched_yield], [rt])
kono
parents:
diff changeset
571 AC_SEARCH_LIBS([nanosleep], [rt])
kono
parents:
diff changeset
572 AC_SEARCH_LIBS([clock_gettime], [rt])
kono
parents:
diff changeset
573
kono
parents:
diff changeset
574 AC_C_BIGENDIAN
kono
parents:
diff changeset
575
kono
parents:
diff changeset
576 GCC_CHECK_UNWIND_GETIPINFO
kono
parents:
diff changeset
577
kono
parents:
diff changeset
578 AC_CHECK_HEADERS(port.h sched.h semaphore.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/event.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/ptrace.h linux/reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h)
kono
parents:
diff changeset
579
kono
parents:
diff changeset
580 AC_CHECK_HEADERS([netinet/icmp6.h], [], [],
kono
parents:
diff changeset
581 [#include <netinet/in.h>
kono
parents:
diff changeset
582 ])
kono
parents:
diff changeset
583
kono
parents:
diff changeset
584 AC_CHECK_HEADERS([linux/filter.h linux/if_addr.h linux/if_ether.h linux/if_tun.h linux/netlink.h linux/rtnetlink.h], [], [],
kono
parents:
diff changeset
585 [#ifdef HAVE_SYS_SOCKET_H
kono
parents:
diff changeset
586 #include <sys/socket.h>
kono
parents:
diff changeset
587 #endif
kono
parents:
diff changeset
588 ])
kono
parents:
diff changeset
589
kono
parents:
diff changeset
590 AC_CACHE_CHECK([whether <ustat.h> can be used],
kono
parents:
diff changeset
591 [libgo_cv_c_ustat_h],
kono
parents:
diff changeset
592 [CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
593 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE $OSCFLAGS"
kono
parents:
diff changeset
594 AC_COMPILE_IFELSE(
kono
parents:
diff changeset
595 [AC_LANG_SOURCE([
kono
parents:
diff changeset
596 #include <sys/types.h>
kono
parents:
diff changeset
597 #ifdef HAVE_LINUX_FILTER_H
kono
parents:
diff changeset
598 #include <linux/filter.h>
kono
parents:
diff changeset
599 #endif
kono
parents:
diff changeset
600 #include <ustat.h>
kono
parents:
diff changeset
601 ])], [libgo_cv_c_ustat_h=yes], [libgo_cv_c_ustat_h=no])
kono
parents:
diff changeset
602 CFLAGS=$CFLAGS_hold])
kono
parents:
diff changeset
603 if test $libgo_cv_c_ustat_h = yes; then
kono
parents:
diff changeset
604 AC_DEFINE(HAVE_USTAT_H, 1,
kono
parents:
diff changeset
605 [Define to 1 if you have the <ustat.h> header file and it works.])
kono
parents:
diff changeset
606 fi
kono
parents:
diff changeset
607
kono
parents:
diff changeset
608 AM_CONDITIONAL(HAVE_SYS_MMAN_H, test "$ac_cv_header_sys_mman_h" = yes)
kono
parents:
diff changeset
609
kono
parents:
diff changeset
610 AC_CHECK_FUNCS(strerror_r strsignal wait4 mincore setenv unsetenv dl_iterate_phdr)
kono
parents:
diff changeset
611 AM_CONDITIONAL(HAVE_STRERROR_R, test "$ac_cv_func_strerror_r" = yes)
kono
parents:
diff changeset
612 AM_CONDITIONAL(HAVE_WAIT4, test "$ac_cv_func_wait4" = yes)
kono
parents:
diff changeset
613
kono
parents:
diff changeset
614 AC_CHECK_FUNCS(accept4 dup3 epoll_create1 faccessat fallocate fchmodat fchownat futimesat getxattr inotify_add_watch inotify_init inotify_init1 inotify_rm_watch listxattr mkdirat mknodat open64 openat pipe2 removexattr renameat setxattr sync_file_range splice syscall tee unlinkat unshare utimensat)
kono
parents:
diff changeset
615 AC_TYPE_OFF_T
kono
parents:
diff changeset
616 AC_CHECK_TYPES([loff_t])
kono
parents:
diff changeset
617
kono
parents:
diff changeset
618 LIBS_hold="$LIBS"
kono
parents:
diff changeset
619 LIBS="$LIBS -lm"
kono
parents:
diff changeset
620 AC_CHECK_FUNCS(cosl expl logl sinl tanl acosl asinl atanl atan2l expm1l ldexpl log10l log1pl)
kono
parents:
diff changeset
621 LIBS="$LIBS_hold"
kono
parents:
diff changeset
622
kono
parents:
diff changeset
623 CFLAGS_hold="$CFLAGS"
kono
parents:
diff changeset
624 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
kono
parents:
diff changeset
625 LIBS_hold="$LIBS"
kono
parents:
diff changeset
626 LIBS="$LIBS $PTHREAD_LIBS"
kono
parents:
diff changeset
627 AC_CHECK_FUNCS(sem_timedwait)
kono
parents:
diff changeset
628 CFLAGS="$CFLAGS_hold"
kono
parents:
diff changeset
629 LIBS="$LIBS_hold"
kono
parents:
diff changeset
630
kono
parents:
diff changeset
631 LIBS_hold="$LIBS"
kono
parents:
diff changeset
632 LIBS="$LIBS $MATH_LIBS"
kono
parents:
diff changeset
633 AC_CHECK_FUNCS(matherr)
kono
parents:
diff changeset
634 LIBS="$LIBS_hold"
kono
parents:
diff changeset
635
kono
parents:
diff changeset
636 AC_CACHE_CHECK([for __sync_bool_compare_and_swap_4],
kono
parents:
diff changeset
637 [libgo_cv_func___sync_bool_compare_and_swap_4],
kono
parents:
diff changeset
638 [AC_LINK_IFELSE([
kono
parents:
diff changeset
639 typedef unsigned int uint32 __attribute__ ((mode (SI)));
kono
parents:
diff changeset
640 uint32 i;
kono
parents:
diff changeset
641 int main() { return __sync_bool_compare_and_swap (&i, 0, 1); }
kono
parents:
diff changeset
642 ],
kono
parents:
diff changeset
643 [libgo_cv_func___sync_bool_compare_and_swap_4=yes],
kono
parents:
diff changeset
644 [libgo_cv_func___sync_bool_compare_and_swap_4=no])])
kono
parents:
diff changeset
645 if test "$libgo_cv_func___sync_bool_compare_and_swap_4" = "yes"; then
kono
parents:
diff changeset
646 AC_DEFINE(HAVE_SYNC_BOOL_COMPARE_AND_SWAP_4, 1,
kono
parents:
diff changeset
647 [Define to 1 if the compiler provides the __sync_bool_compare_and_swap function for uint32])
kono
parents:
diff changeset
648 fi
kono
parents:
diff changeset
649
kono
parents:
diff changeset
650 AC_CACHE_CHECK([for __sync_bool_compare_and_swap_8],
kono
parents:
diff changeset
651 [libgo_cv_func___sync_bool_compare_and_swap_8],
kono
parents:
diff changeset
652 [AC_LINK_IFELSE([
kono
parents:
diff changeset
653 typedef unsigned int uint64 __attribute__ ((mode (DI)));
kono
parents:
diff changeset
654 uint64 i;
kono
parents:
diff changeset
655 int main() { return __sync_bool_compare_and_swap (&i, 0, 1); }
kono
parents:
diff changeset
656 ],
kono
parents:
diff changeset
657 [libgo_cv_func___sync_bool_compare_and_swap_8=yes],
kono
parents:
diff changeset
658 [libgo_cv_func___sync_bool_compare_and_swap_8=no])])
kono
parents:
diff changeset
659 if test "$libgo_cv_func___sync_bool_compare_and_swap_8" = "yes"; then
kono
parents:
diff changeset
660 AC_DEFINE(HAVE_SYNC_BOOL_COMPARE_AND_SWAP_8, 1,
kono
parents:
diff changeset
661 [Define to 1 if the compiler provides the __sync_bool_compare_and_swap function for uint64])
kono
parents:
diff changeset
662 fi
kono
parents:
diff changeset
663
kono
parents:
diff changeset
664 AC_CACHE_CHECK([for __sync_fetch_and_add_4],
kono
parents:
diff changeset
665 [libgo_cv_func___sync_fetch_and_add_4],
kono
parents:
diff changeset
666 [AC_LINK_IFELSE([
kono
parents:
diff changeset
667 typedef unsigned int uint32 __attribute__ ((mode (SI)));
kono
parents:
diff changeset
668 uint32 i;
kono
parents:
diff changeset
669 int main() { return __sync_fetch_and_add (&i, 1); }
kono
parents:
diff changeset
670 ],
kono
parents:
diff changeset
671 [libgo_cv_func___sync_fetch_and_add_4=yes],
kono
parents:
diff changeset
672 [libgo_cv_func___sync_fetch_and_add_4=no])])
kono
parents:
diff changeset
673 if test "$libgo_cv_func___sync_fetch_and_add_4" = "yes"; then
kono
parents:
diff changeset
674 AC_DEFINE(HAVE_SYNC_FETCH_AND_ADD_4, 1,
kono
parents:
diff changeset
675 [Define to 1 if the compiler provides the __sync_fetch_and_add function for uint32])
kono
parents:
diff changeset
676 fi
kono
parents:
diff changeset
677
kono
parents:
diff changeset
678 AC_CACHE_CHECK([for __sync_add_and_fetch_8],
kono
parents:
diff changeset
679 [libgo_cv_func___sync_add_and_fetch_8],
kono
parents:
diff changeset
680 [AC_LINK_IFELSE([
kono
parents:
diff changeset
681 typedef unsigned int uint64 __attribute__ ((mode (DI)));
kono
parents:
diff changeset
682 uint64 i;
kono
parents:
diff changeset
683 int main() { return __sync_add_and_fetch (&i, 1); }
kono
parents:
diff changeset
684 ],
kono
parents:
diff changeset
685 [libgo_cv_func___sync_add_and_fetch_8=yes],
kono
parents:
diff changeset
686 [libgo_cv_func___sync_add_and_fetch_8=no])])
kono
parents:
diff changeset
687 if test "$libgo_cv_func___sync_add_and_fetch_8" = "yes"; then
kono
parents:
diff changeset
688 AC_DEFINE(HAVE_SYNC_ADD_AND_FETCH_8, 1,
kono
parents:
diff changeset
689 [Define to 1 if the compiler provides the __sync_add_and_fetch function for uint64])
kono
parents:
diff changeset
690 fi
kono
parents:
diff changeset
691
kono
parents:
diff changeset
692 dnl For x86 we want to use the -minline-all-stringops option to avoid
kono
parents:
diff changeset
693 dnl forcing a stack split when calling memcpy and friends.
kono
parents:
diff changeset
694 AC_CACHE_CHECK([whether compiler supports -minline-all-stringops],
kono
parents:
diff changeset
695 [libgo_cv_c_stringops],
kono
parents:
diff changeset
696 [CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
697 CFLAGS="$CFLAGS -minline-all-stringops"
kono
parents:
diff changeset
698 AC_COMPILE_IFELSE([int i;],
kono
parents:
diff changeset
699 [libgo_cv_c_stringops=yes],
kono
parents:
diff changeset
700 [libgo_cv_c_stringops=no])
kono
parents:
diff changeset
701 CFLAGS=$CFLAGS_hold])
kono
parents:
diff changeset
702 STRINGOPS_FLAG=
kono
parents:
diff changeset
703 if test "$libgo_cv_c_stringops" = yes; then
kono
parents:
diff changeset
704 STRINGOPS_FLAG=-minline-all-stringops
kono
parents:
diff changeset
705 fi
kono
parents:
diff changeset
706 AC_SUBST(STRINGOPS_FLAG)
kono
parents:
diff changeset
707
kono
parents:
diff changeset
708 dnl For x86 we want to compile the math library with -mfancy-math-387
kono
parents:
diff changeset
709 dnl -funsafe-math-optimizations so that we can use the builtin
kono
parents:
diff changeset
710 dnl instructions directly.
kono
parents:
diff changeset
711 AC_CACHE_CHECK([whether compiler supports -mfancy-math-387],
kono
parents:
diff changeset
712 [libgo_cv_c_fancymath],
kono
parents:
diff changeset
713 [CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
714 CFLAGS="$CFLAGS -mfancy-math-387"
kono
parents:
diff changeset
715 AC_COMPILE_IFELSE([int i;],
kono
parents:
diff changeset
716 [libgo_cv_c_fancymath=yes],
kono
parents:
diff changeset
717 [libgo_cv_c_fancymath=no])
kono
parents:
diff changeset
718 CFLAGS=$CFLAGS_hold])
kono
parents:
diff changeset
719 MATH_FLAG=
kono
parents:
diff changeset
720 if test "$libgo_cv_c_fancymath" = yes; then
kono
parents:
diff changeset
721 MATH_FLAG="-mfancy-math-387 -funsafe-math-optimizations"
kono
parents:
diff changeset
722 else
kono
parents:
diff changeset
723 MATH_FLAG="-ffp-contract=off"
kono
parents:
diff changeset
724 fi
kono
parents:
diff changeset
725 AC_SUBST(MATH_FLAG)
kono
parents:
diff changeset
726
kono
parents:
diff changeset
727 CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
728 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
kono
parents:
diff changeset
729 AC_CHECK_TYPES([off64_t])
kono
parents:
diff changeset
730 CFLAGS=$CFLAGS_hold
kono
parents:
diff changeset
731
kono
parents:
diff changeset
732 dnl Work out the size of the epoll_events struct on GNU/Linux.
kono
parents:
diff changeset
733 AC_CACHE_CHECK([epoll_event size],
kono
parents:
diff changeset
734 [libgo_cv_c_epoll_event_size],
kono
parents:
diff changeset
735 [AC_COMPUTE_INT(libgo_cv_c_epoll_event_size,
kono
parents:
diff changeset
736 [sizeof (struct epoll_event)],
kono
parents:
diff changeset
737 [#include <sys/epoll.h>],
kono
parents:
diff changeset
738 [libgo_cv_c_epoll_event_size=0])])
kono
parents:
diff changeset
739 SIZEOF_STRUCT_EPOLL_EVENT=${libgo_cv_c_epoll_event_size}
kono
parents:
diff changeset
740 AC_SUBST(SIZEOF_STRUCT_EPOLL_EVENT)
kono
parents:
diff changeset
741
kono
parents:
diff changeset
742 dnl Work out the offset of the fd field in the epoll_events struct on
kono
parents:
diff changeset
743 dnl GNU/Linux.
kono
parents:
diff changeset
744 AC_CACHE_CHECK([epoll_event data.fd offset],
kono
parents:
diff changeset
745 [libgo_cv_c_epoll_event_fd_offset],
kono
parents:
diff changeset
746 [AC_COMPUTE_INT(libgo_cv_c_epoll_event_fd_offset,
kono
parents:
diff changeset
747 [offsetof (struct epoll_event, data.fd)],
kono
parents:
diff changeset
748 [#include <stddef.h>
kono
parents:
diff changeset
749 #include <sys/epoll.h>],
kono
parents:
diff changeset
750 [libgo_cv_c_epoll_event_fd_offset=0])])
kono
parents:
diff changeset
751 STRUCT_EPOLL_EVENT_FD_OFFSET=${libgo_cv_c_epoll_event_fd_offset}
kono
parents:
diff changeset
752 AC_SUBST(STRUCT_EPOLL_EVENT_FD_OFFSET)
kono
parents:
diff changeset
753
kono
parents:
diff changeset
754 dnl Check if <sys/stat.h> uses timespec_t for st_?tim members. Introduced
kono
parents:
diff changeset
755 dnl in Solaris 12 for XPG7 compatibility.
kono
parents:
diff changeset
756 AC_EGREP_HEADER([timespec_t.*st_atim], [sys/stat.h],
kono
parents:
diff changeset
757 [have_stat_timespec=yes], [have_stat_timespec=no])
kono
parents:
diff changeset
758 AM_CONDITIONAL(HAVE_STAT_TIMESPEC, test $have_stat_timespec = yes)
kono
parents:
diff changeset
759
kono
parents:
diff changeset
760 dnl See if struct exception is defined in <math.h>.
kono
parents:
diff changeset
761 AC_CHECK_TYPE([struct exception],
kono
parents:
diff changeset
762 [libgo_has_struct_exception=yes],
kono
parents:
diff changeset
763 [libgo_has_struct_exception=no],
kono
parents:
diff changeset
764 [#include <math.h>])
kono
parents:
diff changeset
765 if test "$libgo_has_struct_exception" = "yes"; then
kono
parents:
diff changeset
766 AC_DEFINE(HAVE_STRUCT_EXCEPTION, 1,
kono
parents:
diff changeset
767 [Define to 1 if <math.h> defines struct exception])
kono
parents:
diff changeset
768 fi
kono
parents:
diff changeset
769
kono
parents:
diff changeset
770 dnl See whether setcontext changes the value of TLS variables.
kono
parents:
diff changeset
771 AC_CACHE_CHECK([whether setcontext clobbers TLS variables],
kono
parents:
diff changeset
772 [libgo_cv_lib_setcontext_clobbers_tls],
kono
parents:
diff changeset
773 [CFLAGS_hold="$CFLAGS"
kono
parents:
diff changeset
774 CFLAGS="$PTHREAD_CFLAGS"
kono
parents:
diff changeset
775 LIBS_hold="$LIBS"
kono
parents:
diff changeset
776 LIBS="$LIBS $PTHREAD_LIBS"
kono
parents:
diff changeset
777 AC_CHECK_SIZEOF([void *])
kono
parents:
diff changeset
778 AS_VAR_ARITH([ptr_type_size], [$ac_cv_sizeof_void_p \* 8])
kono
parents:
diff changeset
779 AC_RUN_IFELSE(
kono
parents:
diff changeset
780 [AC_LANG_SOURCE([
kono
parents:
diff changeset
781 #include <pthread.h>
kono
parents:
diff changeset
782 #include <stdlib.h>
kono
parents:
diff changeset
783 #include <ucontext.h>
kono
parents:
diff changeset
784 #include <unistd.h>
kono
parents:
diff changeset
785
kono
parents:
diff changeset
786 __thread int tls;
kono
parents:
diff changeset
787
kono
parents:
diff changeset
788 static char stack[[10 * 1024 * 1024]];
kono
parents:
diff changeset
789 static ucontext_t c;
kono
parents:
diff changeset
790
kono
parents:
diff changeset
791 /* Called via makecontext/setcontext. */
kono
parents:
diff changeset
792
kono
parents:
diff changeset
793 static void
kono
parents:
diff changeset
794 cfn (void)
kono
parents:
diff changeset
795 {
kono
parents:
diff changeset
796 exit (tls);
kono
parents:
diff changeset
797 }
kono
parents:
diff changeset
798
kono
parents:
diff changeset
799 /* Called via pthread_create. */
kono
parents:
diff changeset
800
kono
parents:
diff changeset
801 static void *
kono
parents:
diff changeset
802 tfn (void *dummy)
kono
parents:
diff changeset
803 {
kono
parents:
diff changeset
804 /* The thread should still see this value after calling
kono
parents:
diff changeset
805 setcontext. */
kono
parents:
diff changeset
806 tls = 0;
kono
parents:
diff changeset
807
kono
parents:
diff changeset
808 setcontext (&c);
kono
parents:
diff changeset
809
kono
parents:
diff changeset
810 /* The call to setcontext should not return. */
kono
parents:
diff changeset
811 abort ();
kono
parents:
diff changeset
812 }
kono
parents:
diff changeset
813
kono
parents:
diff changeset
814 int
kono
parents:
diff changeset
815 main ()
kono
parents:
diff changeset
816 {
kono
parents:
diff changeset
817 pthread_t tid;
kono
parents:
diff changeset
818
kono
parents:
diff changeset
819 /* The thread should not see this value. */
kono
parents:
diff changeset
820 tls = 1;
kono
parents:
diff changeset
821
kono
parents:
diff changeset
822 if (getcontext (&c) < 0)
kono
parents:
diff changeset
823 abort ();
kono
parents:
diff changeset
824
kono
parents:
diff changeset
825 c.uc_stack.ss_sp = stack;
kono
parents:
diff changeset
826 #ifdef MAKECONTEXT_STACK_TOP
kono
parents:
diff changeset
827 c.uc_stack.ss_sp += sizeof stack;
kono
parents:
diff changeset
828 #endif
kono
parents:
diff changeset
829 c.uc_stack.ss_flags = 0;
kono
parents:
diff changeset
830 c.uc_stack.ss_size = sizeof stack;
kono
parents:
diff changeset
831 c.uc_link = NULL;
kono
parents:
diff changeset
832 makecontext (&c, cfn, 0);
kono
parents:
diff changeset
833
kono
parents:
diff changeset
834 if (pthread_create (&tid, NULL, tfn, NULL) != 0)
kono
parents:
diff changeset
835 abort ();
kono
parents:
diff changeset
836
kono
parents:
diff changeset
837 if (pthread_join (tid, NULL) != 0)
kono
parents:
diff changeset
838 abort ();
kono
parents:
diff changeset
839
kono
parents:
diff changeset
840 /* The thread should have called exit. */
kono
parents:
diff changeset
841 abort ();
kono
parents:
diff changeset
842 }
kono
parents:
diff changeset
843 ])],
kono
parents:
diff changeset
844 [libgo_cv_lib_setcontext_clobbers_tls=no],
kono
parents:
diff changeset
845 [libgo_cv_lib_setcontext_clobbers_tls=yes],
kono
parents:
diff changeset
846 [case "$target:$ptr_type_size" in
kono
parents:
diff changeset
847 i?86-*-solaris2.1[[01]]:64 | x86_64*-*-solaris2.1[[01]]:64)
kono
parents:
diff changeset
848 libgo_cv_lib_setcontext_clobbers_tls=yes ;;
kono
parents:
diff changeset
849 *)
kono
parents:
diff changeset
850 libgo_cv_lib_setcontext_clobbers_tls=no ;;
kono
parents:
diff changeset
851 esac
kono
parents:
diff changeset
852 ])
kono
parents:
diff changeset
853 CFLAGS="$CFLAGS_hold"
kono
parents:
diff changeset
854 LIBS="$LIBS_hold"
kono
parents:
diff changeset
855 ])
kono
parents:
diff changeset
856 if test "$libgo_cv_lib_setcontext_clobbers_tls" = "yes"; then
kono
parents:
diff changeset
857 AC_DEFINE(SETCONTEXT_CLOBBERS_TLS, 1,
kono
parents:
diff changeset
858 [Define if setcontext clobbers TLS variables])
kono
parents:
diff changeset
859 fi
kono
parents:
diff changeset
860
kono
parents:
diff changeset
861 AC_CACHE_CHECK([whether .eh_frame section should be read-only],
kono
parents:
diff changeset
862 libgo_cv_ro_eh_frame, [
kono
parents:
diff changeset
863 libgo_cv_ro_eh_frame=no
kono
parents:
diff changeset
864 echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
kono
parents:
diff changeset
865 if $CC $CFLAGS -S -fpic -fexceptions -o conftest.s conftest.c > /dev/null 2>&1; then
kono
parents:
diff changeset
866 if grep '.section.*eh_frame.*"a"' conftest.s > /dev/null; then
kono
parents:
diff changeset
867 libgo_cv_ro_eh_frame=yes
kono
parents:
diff changeset
868 elif grep '.section.*eh_frame.*#alloc' conftest.c \
kono
parents:
diff changeset
869 | grep -v '#write' > /dev/null; then
kono
parents:
diff changeset
870 libgo_cv_ro_eh_frame=yes
kono
parents:
diff changeset
871 fi
kono
parents:
diff changeset
872 fi
kono
parents:
diff changeset
873 rm -f conftest.*
kono
parents:
diff changeset
874 ])
kono
parents:
diff changeset
875 if test "x$libgo_cv_ro_eh_frame" = xyes; then
kono
parents:
diff changeset
876 AC_DEFINE(EH_FRAME_FLAGS, "a",
kono
parents:
diff changeset
877 [Define to the flags needed for the .section .eh_frame directive.])
kono
parents:
diff changeset
878 else
kono
parents:
diff changeset
879 AC_DEFINE(EH_FRAME_FLAGS, "aw",
kono
parents:
diff changeset
880 [Define to the flags needed for the .section .eh_frame directive.])
kono
parents:
diff changeset
881 fi
kono
parents:
diff changeset
882
kono
parents:
diff changeset
883 AC_CACHE_CHECK([if compiler supports -Qunused-arguments],
kono
parents:
diff changeset
884 [libgo_cv_c_unused_arguments],
kono
parents:
diff changeset
885 [CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
886 CFLAGS="$CFLAGS -Qunused-arguments"
kono
parents:
diff changeset
887 AC_COMPILE_IFELSE([[int i;]],
kono
parents:
diff changeset
888 [libgo_cv_c_unused_arguments=yes],
kono
parents:
diff changeset
889 [libgo_cv_c_unused_arguments=no])
kono
parents:
diff changeset
890 CFLAGS=$CFLAGS_hold])
kono
parents:
diff changeset
891
kono
parents:
diff changeset
892 AC_CACHE_CHECK([if assembler supports GNU comdat group syntax],
kono
parents:
diff changeset
893 libgo_cv_as_comdat_gnu, [
kono
parents:
diff changeset
894 echo '.section .text,"axG",@progbits,.foo,comdat' > conftest.s
kono
parents:
diff changeset
895 CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
896 if test "$libgo_cv_c_unused_arguments" = yes; then
kono
parents:
diff changeset
897 CFLAGS="$CFLAGS -Qunused-arguments"
kono
parents:
diff changeset
898 fi
kono
parents:
diff changeset
899 if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then
kono
parents:
diff changeset
900 libgo_cv_as_comdat_gnu=yes
kono
parents:
diff changeset
901 else
kono
parents:
diff changeset
902 libgo_cv_as_comdat_gnu=no
kono
parents:
diff changeset
903 fi
kono
parents:
diff changeset
904 CFLAGS=$CFLAGS_hold
kono
parents:
diff changeset
905 ])
kono
parents:
diff changeset
906 if test "x$libgo_cv_as_comdat_gnu" = xyes; then
kono
parents:
diff changeset
907 AC_DEFINE(HAVE_AS_COMDAT_GAS, 1,
kono
parents:
diff changeset
908 [Define if your assembler supports GNU comdat group syntax.])
kono
parents:
diff changeset
909 fi
kono
parents:
diff changeset
910
kono
parents:
diff changeset
911 AC_CACHE_CHECK([assembler supports pc related relocs],
kono
parents:
diff changeset
912 libgo_cv_as_x86_pcrel, [
kono
parents:
diff changeset
913 libgo_cv_as_x86_pcrel=yes
kono
parents:
diff changeset
914 echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
kono
parents:
diff changeset
915 CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
916 if test "$libgo_cv_c_unused_arguments" = yes; then
kono
parents:
diff changeset
917 CFLAGS="$CFLAGS -Qunused-arguments"
kono
parents:
diff changeset
918 fi
kono
parents:
diff changeset
919 if $CC $CFLAGS -c conftest.s 2>&1 | $EGREP -i 'illegal|warning' > /dev/null; then
kono
parents:
diff changeset
920 libgo_cv_as_x86_pcrel=no
kono
parents:
diff changeset
921 fi
kono
parents:
diff changeset
922 CFLAGS=$CFLAGS_hold
kono
parents:
diff changeset
923 ])
kono
parents:
diff changeset
924 if test "x$libgo_cv_as_x86_pcrel" = xyes; then
kono
parents:
diff changeset
925 AC_DEFINE(HAVE_AS_X86_PCREL, 1,
kono
parents:
diff changeset
926 [Define if your assembler supports PC relative relocs.])
kono
parents:
diff changeset
927 fi
kono
parents:
diff changeset
928
kono
parents:
diff changeset
929 AC_CACHE_CHECK([assembler supports unwind section type],
kono
parents:
diff changeset
930 libgo_cv_as_x86_64_unwind_section_type, [
kono
parents:
diff changeset
931 libgo_cv_as_x86_64_unwind_section_type=yes
kono
parents:
diff changeset
932 echo '.section .eh_frame,"a",@unwind' > conftest.s
kono
parents:
diff changeset
933 CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
934 if test "$libgo_cv_c_unused_arguments" = yes; then
kono
parents:
diff changeset
935 CFLAGS="$CFLAGS -Qunused-arguments"
kono
parents:
diff changeset
936 fi
kono
parents:
diff changeset
937 if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
kono
parents:
diff changeset
938 libgo_cv_as_x86_64_unwind_section_type=no
kono
parents:
diff changeset
939 fi
kono
parents:
diff changeset
940 CFLAGS=$CFLAGS_hold
kono
parents:
diff changeset
941 ])
kono
parents:
diff changeset
942 if test "x$libgo_cv_as_x86_64_unwind_section_type" = xyes; then
kono
parents:
diff changeset
943 AC_DEFINE(HAVE_AS_X86_64_UNWIND_SECTION_TYPE, 1,
kono
parents:
diff changeset
944 [Define if your assembler supports unwind section type.])
kono
parents:
diff changeset
945 fi
kono
parents:
diff changeset
946
kono
parents:
diff changeset
947 AC_CACHE_CHECK([assembler supports AES instructions],
kono
parents:
diff changeset
948 libgo_cv_as_x86_aes, [
kono
parents:
diff changeset
949 libgo_cv_as_x86_aes=yes
kono
parents:
diff changeset
950 echo 'aesenc %xmm0, %xmm1' > conftest.s
kono
parents:
diff changeset
951 CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
952 if test "$libgo_cv_c_unused_arguments" = yes; then
kono
parents:
diff changeset
953 CFLAGS="$CFLAGS -Qunused-arguments"
kono
parents:
diff changeset
954 fi
kono
parents:
diff changeset
955 if $CC $CFLAGS -c conftest.s 2>&1 | grep -i error > /dev/null; then
kono
parents:
diff changeset
956 libgo_cv_as_x86_aes=no
kono
parents:
diff changeset
957 fi
kono
parents:
diff changeset
958 CFLAGS=$CFLAGS_hold
kono
parents:
diff changeset
959 ])
kono
parents:
diff changeset
960 if test "x$libgo_cv_as_x86_aes" = xyes; then
kono
parents:
diff changeset
961 AC_DEFINE(HAVE_AS_X86_AES, 1,
kono
parents:
diff changeset
962 [Define if your assembler supports AES instructions.])
kono
parents:
diff changeset
963 fi
kono
parents:
diff changeset
964
kono
parents:
diff changeset
965 AC_CACHE_SAVE
kono
parents:
diff changeset
966
kono
parents:
diff changeset
967 if test ${multilib} = yes; then
kono
parents:
diff changeset
968 multilib_arg="--enable-multilib"
kono
parents:
diff changeset
969 else
kono
parents:
diff changeset
970 multilib_arg=
kono
parents:
diff changeset
971 fi
kono
parents:
diff changeset
972
kono
parents:
diff changeset
973 AC_CONFIG_FILES(Makefile testsuite/Makefile)
kono
parents:
diff changeset
974
kono
parents:
diff changeset
975 AC_CONFIG_COMMANDS([default],
kono
parents:
diff changeset
976 [if test -n "$CONFIG_FILES"; then
kono
parents:
diff changeset
977 # Multilibs need MULTISUBDIR defined correctly in certain makefiles so
kono
parents:
diff changeset
978 # that multilib installs will end up installed in the correct place.
kono
parents:
diff changeset
979 # The testsuite needs it for multilib-aware ABI baseline files.
kono
parents:
diff changeset
980 # To work around this not being passed down from config-ml.in ->
kono
parents:
diff changeset
981 # srcdir/Makefile.am -> srcdir/{src,libsupc++,...}/Makefile.am, manually
kono
parents:
diff changeset
982 # append it here. Only modify Makefiles that have just been created.
kono
parents:
diff changeset
983 #
kono
parents:
diff changeset
984 # Also, get rid of this simulated-VPATH thing that automake does.
kono
parents:
diff changeset
985 cat > vpsed << \_EOF
kono
parents:
diff changeset
986 s!`test -f '$<' || echo '$(srcdir)/'`!!
kono
parents:
diff changeset
987 _EOF
kono
parents:
diff changeset
988 for i in $SUBDIRS; do
kono
parents:
diff changeset
989 case $CONFIG_FILES in
kono
parents:
diff changeset
990 *${i}/Makefile*)
kono
parents:
diff changeset
991 #echo "Adding MULTISUBDIR to $i/Makefile"
kono
parents:
diff changeset
992 sed -f vpsed $i/Makefile > tmp
kono
parents:
diff changeset
993 grep '^MULTISUBDIR =' Makefile >> tmp
kono
parents:
diff changeset
994 mv tmp $i/Makefile
kono
parents:
diff changeset
995 ;;
kono
parents:
diff changeset
996 esac
kono
parents:
diff changeset
997 done
kono
parents:
diff changeset
998 rm vpsed
kono
parents:
diff changeset
999 fi
kono
parents:
diff changeset
1000 ],
kono
parents:
diff changeset
1001 [
kono
parents:
diff changeset
1002 # Variables needed in config.status (file generation) which aren't already
kono
parents:
diff changeset
1003 # passed by autoconf.
kono
parents:
diff changeset
1004 SUBDIRS="$SUBDIRS"
kono
parents:
diff changeset
1005 ])
kono
parents:
diff changeset
1006
kono
parents:
diff changeset
1007 AC_OUTPUT