annotate libgo/configure.ac @ 138:fc828634a951

merge
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 08 Nov 2018 14:17:14 +0900
parents 84e7813d76e9
children 1830386684a0
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
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
14 libtool_VERSION=13:0:0
111
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.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
210 # To add a new architecture:
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
211 # - add it to this list
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
212 # - if appropriate, add an entry to ALLGOARCHFAMILY below
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
213 # - add an entry to the case on ${host} below to set GOARCH
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
214 # - update goarchList in libgo/go/go/build/syslist.go
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
215 # - update goarch.sh to report the values for this architecture
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
216 # - update go-set-goarch in gcc/testsuite/go.test/go-test.exp
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
217 # - update ptrSizeMap and intSizeMap in libgo/go/cmd/cgo/main.go
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
218 # - update arch lists in libgo/match.sh
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
219 # - update arch lists in libgo/testsuite/gotest
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
220 # - update +build lines in several places
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
221 # - libgo/go/runtime/lfstack_NNbit.go
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
222 # - libgo/go/runtime/hashNN.go
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
223 # - libgo/go/runtime/unalignedN.go
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
224 # - libgo/go/syscall/endian_XX.go
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
225 # - possibly others
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
226 # - possibly update files in libgo/go/internal/syscall/unix
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
227 ALLGOARCH="386 alpha amd64 amd64p32 arm armbe arm64 arm64be ia64 m68k mips mipsle mips64 mips64le mips64p32 mips64p32le nios2 ppc ppc64 ppc64le riscv riscv64 s390 s390x sh shbe sparc sparc64 wasm"
111
kono
parents:
diff changeset
228
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
229 # All known GOARCH family values.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
230 ALLGOARCHFAMILY="I386 ALPHA AMD64 ARM ARM64 IA64 M68K MIPS MIPS64 NIOS2 PPC PPC64 RISCV RISCV64 S390 S390X SH SPARC SPARC64 WASM"
111
kono
parents:
diff changeset
231
kono
parents:
diff changeset
232 GOARCH=unknown
kono
parents:
diff changeset
233 case ${host} in
kono
parents:
diff changeset
234 alpha*-*-*)
kono
parents:
diff changeset
235 GOARCH=alpha
kono
parents:
diff changeset
236 ;;
kono
parents:
diff changeset
237 aarch64-*-*)
kono
parents:
diff changeset
238 GOARCH=arm64
kono
parents:
diff changeset
239 ;;
kono
parents:
diff changeset
240 arm*-*-* | strongarm*-*-* | ep9312*-*-* | xscale-*-*)
kono
parents:
diff changeset
241 GOARCH=arm
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
242 case ${host} in
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
243 arm*b*-*-*)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
244 GOARCH=armbe
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
245 ;;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
246 esac
111
kono
parents:
diff changeset
247 ;;
kono
parents:
diff changeset
248 changequote(,)dnl
kono
parents:
diff changeset
249 i[34567]86-*-* | x86_64-*-*)
kono
parents:
diff changeset
250 changequote([,])dnl
kono
parents:
diff changeset
251 AC_COMPILE_IFELSE([
kono
parents:
diff changeset
252 #ifdef __x86_64__
kono
parents:
diff changeset
253 #error 64-bit
kono
parents:
diff changeset
254 #endif],
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
255 [GOARCH=386],
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
256 AC_COMPILE_IFELSE([
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
257 #ifdef __ILP32__
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
258 #error x32
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
259 #endif],
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
260 [GOARCH=amd64],
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
261 [GOARCH=amd64p32]))
111
kono
parents:
diff changeset
262 ;;
kono
parents:
diff changeset
263 ia64-*-*)
kono
parents:
diff changeset
264 GOARCH=ia64
kono
parents:
diff changeset
265 ;;
kono
parents:
diff changeset
266 m68k*-*-*)
kono
parents:
diff changeset
267 GOARCH=m68k
kono
parents:
diff changeset
268 ;;
kono
parents:
diff changeset
269 mips*-*-*)
kono
parents:
diff changeset
270 AC_COMPILE_IFELSE([
kono
parents:
diff changeset
271 #if _MIPS_SIM != _ABIO32
kono
parents:
diff changeset
272 #error not o32
kono
parents:
diff changeset
273 #endif],
kono
parents:
diff changeset
274 [mips_abi="o32"],
kono
parents:
diff changeset
275 [AC_COMPILE_IFELSE([
kono
parents:
diff changeset
276 #if _MIPS_SIM != _ABIN32
kono
parents:
diff changeset
277 #error not n32
kono
parents:
diff changeset
278 #endif],
kono
parents:
diff changeset
279 [mips_abi="n32"],
kono
parents:
diff changeset
280 [AC_COMPILE_IFELSE([
kono
parents:
diff changeset
281 #if _MIPS_SIM != _ABI64
kono
parents:
diff changeset
282 #error not n64
kono
parents:
diff changeset
283 #endif],
kono
parents:
diff changeset
284 [mips_abi="n64"],
kono
parents:
diff changeset
285 [AC_MSG_ERROR([unknown MIPS ABI])
kono
parents:
diff changeset
286 [mips_abi="n32"]])])])
kono
parents:
diff changeset
287 case "$mips_abi" in
kono
parents:
diff changeset
288 "o32") GOARCH=mips ;;
kono
parents:
diff changeset
289 "n32") GOARCH=mips64p32 ;;
kono
parents:
diff changeset
290 "n64") GOARCH=mips64 ;;
kono
parents:
diff changeset
291 esac
kono
parents:
diff changeset
292 case "${host}" in
kono
parents:
diff changeset
293 mips*el-*-*)
kono
parents:
diff changeset
294 GOARCH="${GOARCH}le"
kono
parents:
diff changeset
295 ;;
kono
parents:
diff changeset
296 esac
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
297 ;;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
298 nios2-*-*)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
299 GOARCH=nios2
111
kono
parents:
diff changeset
300 ;;
kono
parents:
diff changeset
301 rs6000*-*-* | powerpc*-*-*)
kono
parents:
diff changeset
302 AC_COMPILE_IFELSE([
kono
parents:
diff changeset
303 #ifdef _ARCH_PPC64
kono
parents:
diff changeset
304 #error 64-bit
kono
parents:
diff changeset
305 #endif],
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
306 [GOARCH=ppc],
111
kono
parents:
diff changeset
307 [
kono
parents:
diff changeset
308 AC_COMPILE_IFELSE([
kono
parents:
diff changeset
309 #if defined(_BIG_ENDIAN) || defined(__BIG_ENDIAN__)
kono
parents:
diff changeset
310 #error 64be
kono
parents:
diff changeset
311 #endif],
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
312 [GOARCH=ppc64le],
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
313 [GOARCH=ppc64])])
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
314 ;;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
315 riscv64-*-*)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
316 GOARCH=riscv64
111
kono
parents:
diff changeset
317 ;;
kono
parents:
diff changeset
318 s390*-*-*)
kono
parents:
diff changeset
319 AC_COMPILE_IFELSE([
kono
parents:
diff changeset
320 #if defined(__s390x__)
kono
parents:
diff changeset
321 #error 64-bit
kono
parents:
diff changeset
322 #endif],
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
323 [GOARCH=s390],
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
324 [GOARCH=s390x])
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
325 ;;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
326 sh3eb*-*-* | sh4eb*-*-*)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
327 GOARCH=shbe
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
328 ;;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
329 sh3*-*-* | sh4*-*-*)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
330 GOARCH=sh
111
kono
parents:
diff changeset
331 ;;
kono
parents:
diff changeset
332 sparc*-*-*)
kono
parents:
diff changeset
333 AC_COMPILE_IFELSE([
kono
parents:
diff changeset
334 #if defined(__sparcv9) || defined(__arch64__)
kono
parents:
diff changeset
335 #error 64-bit
kono
parents:
diff changeset
336 #endif],
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
337 [GOARCH=sparc],
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
338 [GOARCH=sparc64])
111
kono
parents:
diff changeset
339 ;;
kono
parents:
diff changeset
340 esac
kono
parents:
diff changeset
341 AC_SUBST(GOARCH)
kono
parents:
diff changeset
342 AC_SUBST(ALLGOARCH)
kono
parents:
diff changeset
343 AC_SUBST(ALLGOARCHFAMILY)
kono
parents:
diff changeset
344
kono
parents:
diff changeset
345 dnl Some files are only present when needed for specific architectures.
kono
parents:
diff changeset
346 GO_LIBCALL_OS_FILE=
kono
parents:
diff changeset
347 GO_LIBCALL_OS_ARCH_FILE=
kono
parents:
diff changeset
348 GO_SYSCALL_OS_FILE=
kono
parents:
diff changeset
349 GO_SYSCALL_OS_ARCH_FILE=
kono
parents:
diff changeset
350 if test -f "${srcdir}/go/syscall/libcall_${GOOS}.go"; then
kono
parents:
diff changeset
351 GO_LIBCALL_OS_FILE="go/syscall/libcall_${GOOS}.go"
kono
parents:
diff changeset
352 fi
kono
parents:
diff changeset
353 if test -f "${srcdir}/go/syscall/libcall_${GOOS}_${GOARCH}.go"; then
kono
parents:
diff changeset
354 GO_LIBCALL_OS_ARCH_FILE="go/syscall/libcall_${GOOS}_${GOARCH}.go"
kono
parents:
diff changeset
355 fi
kono
parents:
diff changeset
356 if test -f "${srcdir}/go/syscall/syscall_${GOOS}.go"; then
kono
parents:
diff changeset
357 GO_SYSCALL_OS_FILE="go/syscall/syscall_${GOOS}.go"
kono
parents:
diff changeset
358 fi
kono
parents:
diff changeset
359 if test -f "${srcdir}/go/syscall/syscall_${GOOS}_${GOARCH}.go"; then
kono
parents:
diff changeset
360 GO_SYSCALL_OS_ARCH_FILE="go/syscall/syscall_${GOOS}_${GOARCH}.go"
kono
parents:
diff changeset
361 fi
kono
parents:
diff changeset
362 AC_SUBST(GO_LIBCALL_OS_FILE)
kono
parents:
diff changeset
363 AC_SUBST(GO_LIBCALL_OS_ARCH_FILE)
kono
parents:
diff changeset
364 AC_SUBST(GO_SYSCALL_OS_FILE)
kono
parents:
diff changeset
365 AC_SUBST(GO_SYSCALL_OS_ARCH_FILE)
kono
parents:
diff changeset
366
kono
parents:
diff changeset
367 dnl Special flags used to generate sysinfo.go.
kono
parents:
diff changeset
368 OSCFLAGS="-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
kono
parents:
diff changeset
369 case "$target" in
kono
parents:
diff changeset
370 mips-sgi-irix6.5*)
kono
parents:
diff changeset
371 # IRIX 6 needs _XOPEN_SOURCE=500 for the XPG5 version of struct
kono
parents:
diff changeset
372 # msghdr in <sys/socket.h>.
kono
parents:
diff changeset
373 OSCFLAGS="$OSCFLAGS -D_XOPEN_SOURCE=500"
kono
parents:
diff changeset
374 ;;
kono
parents:
diff changeset
375 *-*-solaris2.1[[01]])
kono
parents:
diff changeset
376 # Solaris 10+ needs this so struct msghdr gets the msg_control
kono
parents:
diff changeset
377 # etc. fields in <sys/socket.h> (_XPG4_2). _XOPEN_SOURCE=600 as
kono
parents:
diff changeset
378 # above doesn't work with C99.
kono
parents:
diff changeset
379 OSCFLAGS="$OSCFLAGS -std=gnu99 -D_XOPEN_SOURCE=600 -D__EXTENSIONS__"
kono
parents:
diff changeset
380 ;;
kono
parents:
diff changeset
381 esac
kono
parents:
diff changeset
382 AC_SUBST(OSCFLAGS)
kono
parents:
diff changeset
383
kono
parents:
diff changeset
384 dnl Check if assembler supports disabling hardware capability support.
kono
parents:
diff changeset
385 GCC_CHECK_ASSEMBLER_HWCAP
kono
parents:
diff changeset
386
kono
parents:
diff changeset
387 dnl Use -fsplit-stack when compiling C code if available.
kono
parents:
diff changeset
388 AC_CACHE_CHECK([whether -fsplit-stack is supported],
kono
parents:
diff changeset
389 [libgo_cv_c_split_stack_supported],
kono
parents:
diff changeset
390 [CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
391 CFLAGS="$CFLAGS -fsplit-stack"
kono
parents:
diff changeset
392 AC_COMPILE_IFELSE([[int i;]],
kono
parents:
diff changeset
393 [libgo_cv_c_split_stack_supported=yes],
kono
parents:
diff changeset
394 [libgo_cv_c_split_stack_supported=no])
kono
parents:
diff changeset
395 CFLAGS=$CFLAGS_hold])
kono
parents:
diff changeset
396
kono
parents:
diff changeset
397 dnl Make sure the linker permits -fsplit-stack. Old versions of gold will
kono
parents:
diff changeset
398 dnl reject split-stack code calling non-split-stack code on targets
kono
parents:
diff changeset
399 dnl they don't support.
kono
parents:
diff changeset
400 AC_CACHE_CHECK([whether linker supports split/non-split linked together],
kono
parents:
diff changeset
401 [libgo_cv_c_linker_split_non_split],
kono
parents:
diff changeset
402 [cat > conftest1.c << EOF
kono
parents:
diff changeset
403 extern void f();
kono
parents:
diff changeset
404 int main() { f(); return 0; }
kono
parents:
diff changeset
405 EOF
kono
parents:
diff changeset
406 cat > conftest2.c << EOF
kono
parents:
diff changeset
407 void f() {}
kono
parents:
diff changeset
408 EOF
kono
parents:
diff changeset
409 $CC -c -fsplit-stack $CFLAGS $CPPFLAGS conftest1.c >/dev/null 2>&1
kono
parents:
diff changeset
410 $CC -c $CFLAGS $CPPFLAGS conftest2.c > /dev/null 2>&1
kono
parents:
diff changeset
411 if $CC -o conftest conftest1.$ac_objext conftest2.$ac_objext > /dev/null 2>&1; then
kono
parents:
diff changeset
412 libgo_cv_c_linker_split_non_split=yes
kono
parents:
diff changeset
413 else
kono
parents:
diff changeset
414 libgo_cv_c_linker_split_non_split=no
kono
parents:
diff changeset
415 fi
kono
parents:
diff changeset
416 rm -f conftest1.* conftest2.* conftest])
kono
parents:
diff changeset
417
kono
parents:
diff changeset
418 if test "$libgo_cv_c_split_stack_supported" = yes -a "$libgo_cv_c_linker_split_non_split" = yes; then
kono
parents:
diff changeset
419 SPLIT_STACK=-fsplit-stack
kono
parents:
diff changeset
420 AC_DEFINE(USING_SPLIT_STACK, 1,
kono
parents:
diff changeset
421 [Define if the compiler supports -fsplit-stack])
kono
parents:
diff changeset
422 else
kono
parents:
diff changeset
423 SPLIT_STACK=
kono
parents:
diff changeset
424 fi
kono
parents:
diff changeset
425 AC_SUBST(SPLIT_STACK)
kono
parents:
diff changeset
426 AM_CONDITIONAL(USING_SPLIT_STACK,
kono
parents:
diff changeset
427 test "$libgo_cv_c_split_stack_supported" = yes -a "$libgo_cv_c_linker_split_non_split" = yes)
kono
parents:
diff changeset
428
kono
parents:
diff changeset
429 dnl If the compiler supports split-stack but the linker does not, then
kono
parents:
diff changeset
430 dnl we need to explicitly disable split-stack for Go.
kono
parents:
diff changeset
431 if test "$libgo_cv_c_split_stack_supported" = yes -a "$libgo_cv_c_linker_split_non_split" = no; then
kono
parents:
diff changeset
432 GO_SPLIT_STACK=-fno-split-stack
kono
parents:
diff changeset
433 else
kono
parents:
diff changeset
434 GO_SPLIT_STACK=
kono
parents:
diff changeset
435 fi
kono
parents:
diff changeset
436 AC_SUBST(GO_SPLIT_STACK)
kono
parents:
diff changeset
437
kono
parents:
diff changeset
438 dnl Check whether the linker does stack munging when calling from
kono
parents:
diff changeset
439 dnl split-stack into non-split-stack code. We check this by looking
kono
parents:
diff changeset
440 dnl at the --help output. FIXME: This is only half right: it's
kono
parents:
diff changeset
441 dnl possible for the linker to support this for some targets but not
kono
parents:
diff changeset
442 dnl others.
kono
parents:
diff changeset
443 dnl This is slightly different from the above check, which is whether
kono
parents:
diff changeset
444 dnl the linker permits the call at all.
kono
parents:
diff changeset
445 AC_CACHE_CHECK([whether linker supports split stack],
kono
parents:
diff changeset
446 [libgo_cv_c_linker_supports_split_stack],
kono
parents:
diff changeset
447 [libgo_cv_c_linker_supports_split_stack=no
kono
parents:
diff changeset
448 if $GOC -Wl,--help 2>/dev/null | grep split-stack-adjust-size >/dev/null 2>&1; then
kono
parents:
diff changeset
449 libgo_cv_c_linker_supports_split_stack=yes
kono
parents:
diff changeset
450 fi])
kono
parents:
diff changeset
451 if test "$libgo_cv_c_linker_supports_split_stack" = yes; then
kono
parents:
diff changeset
452 AC_DEFINE(LINKER_SUPPORTS_SPLIT_STACK, 1,
kono
parents:
diff changeset
453 [Define if the linker support split stack adjustments])
kono
parents:
diff changeset
454 fi
kono
parents:
diff changeset
455
kono
parents:
diff changeset
456 AC_CACHE_CHECK([whether compiler is llgo],
kono
parents:
diff changeset
457 [libgo_cv_c_goc_is_llgo],
kono
parents:
diff changeset
458 [libgo_cv_c_goc_is_llgo=no
kono
parents:
diff changeset
459 if $GOC -dumpversion 2>/dev/null | grep llgo >/dev/null 2>&1; then
kono
parents:
diff changeset
460 libgo_cv_c_goc_is_llgo=yes
kono
parents:
diff changeset
461 fi])
kono
parents:
diff changeset
462 AM_CONDITIONAL(GOC_IS_LLGO, test "$libgo_cv_c_goc_is_llgo" = yes)
kono
parents:
diff changeset
463
kono
parents:
diff changeset
464 dnl Test for the -lm library.
kono
parents:
diff changeset
465 MATH_LIBS=
kono
parents:
diff changeset
466 AC_CHECK_LIB([m], [sqrt], MATH_LIBS=-lm)
kono
parents:
diff changeset
467 AC_SUBST(MATH_LIBS)
kono
parents:
diff changeset
468
kono
parents:
diff changeset
469 dnl Test for -lsocket and -lnsl. Copied from libjava/configure.ac.
kono
parents:
diff changeset
470 AC_CACHE_CHECK([for socket libraries], libgo_cv_lib_sockets,
kono
parents:
diff changeset
471 [libgo_cv_lib_sockets=
kono
parents:
diff changeset
472 libgo_check_both=no
kono
parents:
diff changeset
473 AC_CHECK_FUNC(connect, libgo_check_socket=no, libgo_check_socket=yes)
kono
parents:
diff changeset
474 if test "$libgo_check_socket" = "yes"; then
kono
parents:
diff changeset
475 unset ac_cv_func_connect
kono
parents:
diff changeset
476 AC_CHECK_LIB(socket, main, libgo_cv_lib_sockets="-lsocket",
kono
parents:
diff changeset
477 libgo_check_both=yes)
kono
parents:
diff changeset
478 fi
kono
parents:
diff changeset
479 if test "$libgo_check_both" = "yes"; then
kono
parents:
diff changeset
480 libgo_old_libs=$LIBS
kono
parents:
diff changeset
481 LIBS="$LIBS -lsocket -lnsl"
kono
parents:
diff changeset
482 unset ac_cv_func_accept
kono
parents:
diff changeset
483 AC_CHECK_FUNC(accept,
kono
parents:
diff changeset
484 [libgo_check_nsl=no
kono
parents:
diff changeset
485 libgo_cv_lib_sockets="-lsocket -lnsl"])
kono
parents:
diff changeset
486 unset ac_cv_func_accept
kono
parents:
diff changeset
487 LIBS=$libgo_old_libs
kono
parents:
diff changeset
488 fi
kono
parents:
diff changeset
489 unset ac_cv_func_gethostbyname
kono
parents:
diff changeset
490 libgo_old_libs="$LIBS"
kono
parents:
diff changeset
491 AC_CHECK_FUNC(gethostbyname, ,
kono
parents:
diff changeset
492 [AC_CHECK_LIB(nsl, main,
kono
parents:
diff changeset
493 [libgo_cv_lib_sockets="$libgo_cv_lib_sockets -lnsl"])])
kono
parents:
diff changeset
494 unset ac_cv_func_gethostbyname
kono
parents:
diff changeset
495 AC_CHECK_FUNC(sendfile, ,
kono
parents:
diff changeset
496 [AC_CHECK_LIB(sendfile, main,
kono
parents:
diff changeset
497 [libgo_cv_lib_sockets="$libgo_cv_lib_sockets -lsendfile"])])
kono
parents:
diff changeset
498 LIBS=$libgo_old_libs
kono
parents:
diff changeset
499 ])
kono
parents:
diff changeset
500 NET_LIBS="$libgo_cv_lib_sockets"
kono
parents:
diff changeset
501 AC_SUBST(NET_LIBS)
kono
parents:
diff changeset
502
kono
parents:
diff changeset
503 dnl Test whether the compiler supports the -pthread option.
kono
parents:
diff changeset
504 AC_CACHE_CHECK([whether -pthread is supported],
kono
parents:
diff changeset
505 [libgo_cv_lib_pthread],
kono
parents:
diff changeset
506 [CFLAGS_hold=$CFLAGS
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
507 CFLAGS="$CFLAGS -pthread -L../libatomic/.libs"
111
kono
parents:
diff changeset
508 AC_COMPILE_IFELSE([[int i;]],
kono
parents:
diff changeset
509 [libgo_cv_lib_pthread=yes],
kono
parents:
diff changeset
510 [libgo_cv_lib_pthread=no])
kono
parents:
diff changeset
511 CFLAGS=$CFLAGS_hold])
kono
parents:
diff changeset
512 PTHREAD_CFLAGS=
kono
parents:
diff changeset
513 if test "$libgo_cv_lib_pthread" = yes; then
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
514 # RISC-V apparently adds -latomic when using -pthread.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
515 PTHREAD_CFLAGS="-pthread -L../libatomic/.libs"
111
kono
parents:
diff changeset
516 fi
kono
parents:
diff changeset
517 AC_SUBST(PTHREAD_CFLAGS)
kono
parents:
diff changeset
518
kono
parents:
diff changeset
519 dnl Test for the -lpthread library.
kono
parents:
diff changeset
520 PTHREAD_LIBS=
kono
parents:
diff changeset
521 AC_CHECK_LIB([pthread], [pthread_create], PTHREAD_LIBS=-lpthread)
kono
parents:
diff changeset
522 AC_SUBST(PTHREAD_LIBS)
kono
parents:
diff changeset
523
kono
parents:
diff changeset
524 dnl Test if -lrt is required for sched_yield or nanosleep or clock_gettime.
kono
parents:
diff changeset
525 AC_SEARCH_LIBS([sched_yield], [rt])
kono
parents:
diff changeset
526 AC_SEARCH_LIBS([nanosleep], [rt])
kono
parents:
diff changeset
527 AC_SEARCH_LIBS([clock_gettime], [rt])
kono
parents:
diff changeset
528
kono
parents:
diff changeset
529 AC_C_BIGENDIAN
kono
parents:
diff changeset
530
kono
parents:
diff changeset
531 GCC_CHECK_UNWIND_GETIPINFO
kono
parents:
diff changeset
532
kono
parents:
diff changeset
533 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
534
kono
parents:
diff changeset
535 AC_CHECK_HEADERS([netinet/icmp6.h], [], [],
kono
parents:
diff changeset
536 [#include <netinet/in.h>
kono
parents:
diff changeset
537 ])
kono
parents:
diff changeset
538
kono
parents:
diff changeset
539 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
540 [#ifdef HAVE_SYS_SOCKET_H
kono
parents:
diff changeset
541 #include <sys/socket.h>
kono
parents:
diff changeset
542 #endif
kono
parents:
diff changeset
543 ])
kono
parents:
diff changeset
544
kono
parents:
diff changeset
545 AM_CONDITIONAL(HAVE_SYS_MMAN_H, test "$ac_cv_header_sys_mman_h" = yes)
kono
parents:
diff changeset
546
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
547 AC_CHECK_FUNCS(strerror_r strsignal wait4 mincore setenv unsetenv dl_iterate_phdr memmem)
111
kono
parents:
diff changeset
548 AM_CONDITIONAL(HAVE_STRERROR_R, test "$ac_cv_func_strerror_r" = yes)
kono
parents:
diff changeset
549 AM_CONDITIONAL(HAVE_WAIT4, test "$ac_cv_func_wait4" = yes)
kono
parents:
diff changeset
550
kono
parents:
diff changeset
551 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
552 AC_TYPE_OFF_T
kono
parents:
diff changeset
553 AC_CHECK_TYPES([loff_t])
kono
parents:
diff changeset
554
kono
parents:
diff changeset
555 LIBS_hold="$LIBS"
kono
parents:
diff changeset
556 LIBS="$LIBS -lm"
kono
parents:
diff changeset
557 AC_CHECK_FUNCS(cosl expl logl sinl tanl acosl asinl atanl atan2l expm1l ldexpl log10l log1pl)
kono
parents:
diff changeset
558 LIBS="$LIBS_hold"
kono
parents:
diff changeset
559
kono
parents:
diff changeset
560 CFLAGS_hold="$CFLAGS"
kono
parents:
diff changeset
561 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
kono
parents:
diff changeset
562 LIBS_hold="$LIBS"
kono
parents:
diff changeset
563 LIBS="$LIBS $PTHREAD_LIBS"
kono
parents:
diff changeset
564 AC_CHECK_FUNCS(sem_timedwait)
kono
parents:
diff changeset
565 CFLAGS="$CFLAGS_hold"
kono
parents:
diff changeset
566 LIBS="$LIBS_hold"
kono
parents:
diff changeset
567
kono
parents:
diff changeset
568 LIBS_hold="$LIBS"
kono
parents:
diff changeset
569 LIBS="$LIBS $MATH_LIBS"
kono
parents:
diff changeset
570 AC_CHECK_FUNCS(matherr)
kono
parents:
diff changeset
571 LIBS="$LIBS_hold"
kono
parents:
diff changeset
572
kono
parents:
diff changeset
573 AC_CACHE_CHECK([for __sync_bool_compare_and_swap_4],
kono
parents:
diff changeset
574 [libgo_cv_func___sync_bool_compare_and_swap_4],
kono
parents:
diff changeset
575 [AC_LINK_IFELSE([
kono
parents:
diff changeset
576 typedef unsigned int uint32 __attribute__ ((mode (SI)));
kono
parents:
diff changeset
577 uint32 i;
kono
parents:
diff changeset
578 int main() { return __sync_bool_compare_and_swap (&i, 0, 1); }
kono
parents:
diff changeset
579 ],
kono
parents:
diff changeset
580 [libgo_cv_func___sync_bool_compare_and_swap_4=yes],
kono
parents:
diff changeset
581 [libgo_cv_func___sync_bool_compare_and_swap_4=no])])
kono
parents:
diff changeset
582 if test "$libgo_cv_func___sync_bool_compare_and_swap_4" = "yes"; then
kono
parents:
diff changeset
583 AC_DEFINE(HAVE_SYNC_BOOL_COMPARE_AND_SWAP_4, 1,
kono
parents:
diff changeset
584 [Define to 1 if the compiler provides the __sync_bool_compare_and_swap function for uint32])
kono
parents:
diff changeset
585 fi
kono
parents:
diff changeset
586
kono
parents:
diff changeset
587 AC_CACHE_CHECK([for __sync_bool_compare_and_swap_8],
kono
parents:
diff changeset
588 [libgo_cv_func___sync_bool_compare_and_swap_8],
kono
parents:
diff changeset
589 [AC_LINK_IFELSE([
kono
parents:
diff changeset
590 typedef unsigned int uint64 __attribute__ ((mode (DI)));
kono
parents:
diff changeset
591 uint64 i;
kono
parents:
diff changeset
592 int main() { return __sync_bool_compare_and_swap (&i, 0, 1); }
kono
parents:
diff changeset
593 ],
kono
parents:
diff changeset
594 [libgo_cv_func___sync_bool_compare_and_swap_8=yes],
kono
parents:
diff changeset
595 [libgo_cv_func___sync_bool_compare_and_swap_8=no])])
kono
parents:
diff changeset
596 if test "$libgo_cv_func___sync_bool_compare_and_swap_8" = "yes"; then
kono
parents:
diff changeset
597 AC_DEFINE(HAVE_SYNC_BOOL_COMPARE_AND_SWAP_8, 1,
kono
parents:
diff changeset
598 [Define to 1 if the compiler provides the __sync_bool_compare_and_swap function for uint64])
kono
parents:
diff changeset
599 fi
kono
parents:
diff changeset
600
kono
parents:
diff changeset
601 AC_CACHE_CHECK([for __sync_fetch_and_add_4],
kono
parents:
diff changeset
602 [libgo_cv_func___sync_fetch_and_add_4],
kono
parents:
diff changeset
603 [AC_LINK_IFELSE([
kono
parents:
diff changeset
604 typedef unsigned int uint32 __attribute__ ((mode (SI)));
kono
parents:
diff changeset
605 uint32 i;
kono
parents:
diff changeset
606 int main() { return __sync_fetch_and_add (&i, 1); }
kono
parents:
diff changeset
607 ],
kono
parents:
diff changeset
608 [libgo_cv_func___sync_fetch_and_add_4=yes],
kono
parents:
diff changeset
609 [libgo_cv_func___sync_fetch_and_add_4=no])])
kono
parents:
diff changeset
610 if test "$libgo_cv_func___sync_fetch_and_add_4" = "yes"; then
kono
parents:
diff changeset
611 AC_DEFINE(HAVE_SYNC_FETCH_AND_ADD_4, 1,
kono
parents:
diff changeset
612 [Define to 1 if the compiler provides the __sync_fetch_and_add function for uint32])
kono
parents:
diff changeset
613 fi
kono
parents:
diff changeset
614
kono
parents:
diff changeset
615 AC_CACHE_CHECK([for __sync_add_and_fetch_8],
kono
parents:
diff changeset
616 [libgo_cv_func___sync_add_and_fetch_8],
kono
parents:
diff changeset
617 [AC_LINK_IFELSE([
kono
parents:
diff changeset
618 typedef unsigned int uint64 __attribute__ ((mode (DI)));
kono
parents:
diff changeset
619 uint64 i;
kono
parents:
diff changeset
620 int main() { return __sync_add_and_fetch (&i, 1); }
kono
parents:
diff changeset
621 ],
kono
parents:
diff changeset
622 [libgo_cv_func___sync_add_and_fetch_8=yes],
kono
parents:
diff changeset
623 [libgo_cv_func___sync_add_and_fetch_8=no])])
kono
parents:
diff changeset
624 if test "$libgo_cv_func___sync_add_and_fetch_8" = "yes"; then
kono
parents:
diff changeset
625 AC_DEFINE(HAVE_SYNC_ADD_AND_FETCH_8, 1,
kono
parents:
diff changeset
626 [Define to 1 if the compiler provides the __sync_add_and_fetch function for uint64])
kono
parents:
diff changeset
627 fi
kono
parents:
diff changeset
628
kono
parents:
diff changeset
629 dnl For x86 we want to use the -minline-all-stringops option to avoid
kono
parents:
diff changeset
630 dnl forcing a stack split when calling memcpy and friends.
kono
parents:
diff changeset
631 AC_CACHE_CHECK([whether compiler supports -minline-all-stringops],
kono
parents:
diff changeset
632 [libgo_cv_c_stringops],
kono
parents:
diff changeset
633 [CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
634 CFLAGS="$CFLAGS -minline-all-stringops"
kono
parents:
diff changeset
635 AC_COMPILE_IFELSE([int i;],
kono
parents:
diff changeset
636 [libgo_cv_c_stringops=yes],
kono
parents:
diff changeset
637 [libgo_cv_c_stringops=no])
kono
parents:
diff changeset
638 CFLAGS=$CFLAGS_hold])
kono
parents:
diff changeset
639 STRINGOPS_FLAG=
kono
parents:
diff changeset
640 if test "$libgo_cv_c_stringops" = yes; then
kono
parents:
diff changeset
641 STRINGOPS_FLAG=-minline-all-stringops
kono
parents:
diff changeset
642 fi
kono
parents:
diff changeset
643 AC_SUBST(STRINGOPS_FLAG)
kono
parents:
diff changeset
644
kono
parents:
diff changeset
645 dnl For x86 we want to compile the math library with -mfancy-math-387
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
646 dnl so that we can use the builtin instructions directly.
111
kono
parents:
diff changeset
647 AC_CACHE_CHECK([whether compiler supports -mfancy-math-387],
kono
parents:
diff changeset
648 [libgo_cv_c_fancymath],
kono
parents:
diff changeset
649 [CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
650 CFLAGS="$CFLAGS -mfancy-math-387"
kono
parents:
diff changeset
651 AC_COMPILE_IFELSE([int i;],
kono
parents:
diff changeset
652 [libgo_cv_c_fancymath=yes],
kono
parents:
diff changeset
653 [libgo_cv_c_fancymath=no])
kono
parents:
diff changeset
654 CFLAGS=$CFLAGS_hold])
kono
parents:
diff changeset
655 MATH_FLAG=
kono
parents:
diff changeset
656 if test "$libgo_cv_c_fancymath" = yes; then
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
657 MATH_FLAG="-mfancy-math-387"
111
kono
parents:
diff changeset
658 fi
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
659 MATH_FLAG="${MATH_FLAG} -ffp-contract=off -fno-math-errno -fno-trapping-math"
111
kono
parents:
diff changeset
660 AC_SUBST(MATH_FLAG)
kono
parents:
diff changeset
661
kono
parents:
diff changeset
662 CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
663 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
kono
parents:
diff changeset
664 AC_CHECK_TYPES([off64_t])
kono
parents:
diff changeset
665 CFLAGS=$CFLAGS_hold
kono
parents:
diff changeset
666
kono
parents:
diff changeset
667 dnl Work out the size of the epoll_events struct on GNU/Linux.
kono
parents:
diff changeset
668 AC_CACHE_CHECK([epoll_event size],
kono
parents:
diff changeset
669 [libgo_cv_c_epoll_event_size],
kono
parents:
diff changeset
670 [AC_COMPUTE_INT(libgo_cv_c_epoll_event_size,
kono
parents:
diff changeset
671 [sizeof (struct epoll_event)],
kono
parents:
diff changeset
672 [#include <sys/epoll.h>],
kono
parents:
diff changeset
673 [libgo_cv_c_epoll_event_size=0])])
kono
parents:
diff changeset
674 SIZEOF_STRUCT_EPOLL_EVENT=${libgo_cv_c_epoll_event_size}
kono
parents:
diff changeset
675 AC_SUBST(SIZEOF_STRUCT_EPOLL_EVENT)
kono
parents:
diff changeset
676
kono
parents:
diff changeset
677 dnl Work out the offset of the fd field in the epoll_events struct on
kono
parents:
diff changeset
678 dnl GNU/Linux.
kono
parents:
diff changeset
679 AC_CACHE_CHECK([epoll_event data.fd offset],
kono
parents:
diff changeset
680 [libgo_cv_c_epoll_event_fd_offset],
kono
parents:
diff changeset
681 [AC_COMPUTE_INT(libgo_cv_c_epoll_event_fd_offset,
kono
parents:
diff changeset
682 [offsetof (struct epoll_event, data.fd)],
kono
parents:
diff changeset
683 [#include <stddef.h>
kono
parents:
diff changeset
684 #include <sys/epoll.h>],
kono
parents:
diff changeset
685 [libgo_cv_c_epoll_event_fd_offset=0])])
kono
parents:
diff changeset
686 STRUCT_EPOLL_EVENT_FD_OFFSET=${libgo_cv_c_epoll_event_fd_offset}
kono
parents:
diff changeset
687 AC_SUBST(STRUCT_EPOLL_EVENT_FD_OFFSET)
kono
parents:
diff changeset
688
kono
parents:
diff changeset
689 dnl Check if <sys/stat.h> uses timespec_t for st_?tim members. Introduced
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
690 dnl in Solaris 11.4 for XPG7 compatibility.
111
kono
parents:
diff changeset
691 AC_EGREP_HEADER([timespec_t.*st_atim], [sys/stat.h],
kono
parents:
diff changeset
692 [have_stat_timespec=yes], [have_stat_timespec=no])
kono
parents:
diff changeset
693 AM_CONDITIONAL(HAVE_STAT_TIMESPEC, test $have_stat_timespec = yes)
kono
parents:
diff changeset
694
kono
parents:
diff changeset
695 dnl See if struct exception is defined in <math.h>.
kono
parents:
diff changeset
696 AC_CHECK_TYPE([struct exception],
kono
parents:
diff changeset
697 [libgo_has_struct_exception=yes],
kono
parents:
diff changeset
698 [libgo_has_struct_exception=no],
kono
parents:
diff changeset
699 [#include <math.h>])
kono
parents:
diff changeset
700 if test "$libgo_has_struct_exception" = "yes"; then
kono
parents:
diff changeset
701 AC_DEFINE(HAVE_STRUCT_EXCEPTION, 1,
kono
parents:
diff changeset
702 [Define to 1 if <math.h> defines struct exception])
kono
parents:
diff changeset
703 fi
kono
parents:
diff changeset
704
kono
parents:
diff changeset
705 dnl See whether setcontext changes the value of TLS variables.
kono
parents:
diff changeset
706 AC_CACHE_CHECK([whether setcontext clobbers TLS variables],
kono
parents:
diff changeset
707 [libgo_cv_lib_setcontext_clobbers_tls],
kono
parents:
diff changeset
708 [CFLAGS_hold="$CFLAGS"
kono
parents:
diff changeset
709 CFLAGS="$PTHREAD_CFLAGS"
kono
parents:
diff changeset
710 LIBS_hold="$LIBS"
kono
parents:
diff changeset
711 LIBS="$LIBS $PTHREAD_LIBS"
kono
parents:
diff changeset
712 AC_CHECK_SIZEOF([void *])
kono
parents:
diff changeset
713 AS_VAR_ARITH([ptr_type_size], [$ac_cv_sizeof_void_p \* 8])
kono
parents:
diff changeset
714 AC_RUN_IFELSE(
kono
parents:
diff changeset
715 [AC_LANG_SOURCE([
kono
parents:
diff changeset
716 #include <pthread.h>
kono
parents:
diff changeset
717 #include <stdlib.h>
kono
parents:
diff changeset
718 #include <ucontext.h>
kono
parents:
diff changeset
719 #include <unistd.h>
kono
parents:
diff changeset
720
kono
parents:
diff changeset
721 __thread int tls;
kono
parents:
diff changeset
722
kono
parents:
diff changeset
723 static char stack[[10 * 1024 * 1024]];
kono
parents:
diff changeset
724 static ucontext_t c;
kono
parents:
diff changeset
725
kono
parents:
diff changeset
726 /* Called via makecontext/setcontext. */
kono
parents:
diff changeset
727
kono
parents:
diff changeset
728 static void
kono
parents:
diff changeset
729 cfn (void)
kono
parents:
diff changeset
730 {
kono
parents:
diff changeset
731 exit (tls);
kono
parents:
diff changeset
732 }
kono
parents:
diff changeset
733
kono
parents:
diff changeset
734 /* Called via pthread_create. */
kono
parents:
diff changeset
735
kono
parents:
diff changeset
736 static void *
kono
parents:
diff changeset
737 tfn (void *dummy)
kono
parents:
diff changeset
738 {
kono
parents:
diff changeset
739 /* The thread should still see this value after calling
kono
parents:
diff changeset
740 setcontext. */
kono
parents:
diff changeset
741 tls = 0;
kono
parents:
diff changeset
742
kono
parents:
diff changeset
743 setcontext (&c);
kono
parents:
diff changeset
744
kono
parents:
diff changeset
745 /* The call to setcontext should not return. */
kono
parents:
diff changeset
746 abort ();
kono
parents:
diff changeset
747 }
kono
parents:
diff changeset
748
kono
parents:
diff changeset
749 int
kono
parents:
diff changeset
750 main ()
kono
parents:
diff changeset
751 {
kono
parents:
diff changeset
752 pthread_t tid;
kono
parents:
diff changeset
753
kono
parents:
diff changeset
754 /* The thread should not see this value. */
kono
parents:
diff changeset
755 tls = 1;
kono
parents:
diff changeset
756
kono
parents:
diff changeset
757 if (getcontext (&c) < 0)
kono
parents:
diff changeset
758 abort ();
kono
parents:
diff changeset
759
kono
parents:
diff changeset
760 c.uc_stack.ss_sp = stack;
kono
parents:
diff changeset
761 #ifdef MAKECONTEXT_STACK_TOP
kono
parents:
diff changeset
762 c.uc_stack.ss_sp += sizeof stack;
kono
parents:
diff changeset
763 #endif
kono
parents:
diff changeset
764 c.uc_stack.ss_flags = 0;
kono
parents:
diff changeset
765 c.uc_stack.ss_size = sizeof stack;
kono
parents:
diff changeset
766 c.uc_link = NULL;
kono
parents:
diff changeset
767 makecontext (&c, cfn, 0);
kono
parents:
diff changeset
768
kono
parents:
diff changeset
769 if (pthread_create (&tid, NULL, tfn, NULL) != 0)
kono
parents:
diff changeset
770 abort ();
kono
parents:
diff changeset
771
kono
parents:
diff changeset
772 if (pthread_join (tid, NULL) != 0)
kono
parents:
diff changeset
773 abort ();
kono
parents:
diff changeset
774
kono
parents:
diff changeset
775 /* The thread should have called exit. */
kono
parents:
diff changeset
776 abort ();
kono
parents:
diff changeset
777 }
kono
parents:
diff changeset
778 ])],
kono
parents:
diff changeset
779 [libgo_cv_lib_setcontext_clobbers_tls=no],
kono
parents:
diff changeset
780 [libgo_cv_lib_setcontext_clobbers_tls=yes],
kono
parents:
diff changeset
781 [case "$target:$ptr_type_size" in
kono
parents:
diff changeset
782 i?86-*-solaris2.1[[01]]:64 | x86_64*-*-solaris2.1[[01]]:64)
kono
parents:
diff changeset
783 libgo_cv_lib_setcontext_clobbers_tls=yes ;;
kono
parents:
diff changeset
784 *)
kono
parents:
diff changeset
785 libgo_cv_lib_setcontext_clobbers_tls=no ;;
kono
parents:
diff changeset
786 esac
kono
parents:
diff changeset
787 ])
kono
parents:
diff changeset
788 CFLAGS="$CFLAGS_hold"
kono
parents:
diff changeset
789 LIBS="$LIBS_hold"
kono
parents:
diff changeset
790 ])
kono
parents:
diff changeset
791 if test "$libgo_cv_lib_setcontext_clobbers_tls" = "yes"; then
kono
parents:
diff changeset
792 AC_DEFINE(SETCONTEXT_CLOBBERS_TLS, 1,
kono
parents:
diff changeset
793 [Define if setcontext clobbers TLS variables])
kono
parents:
diff changeset
794 fi
kono
parents:
diff changeset
795
kono
parents:
diff changeset
796 AC_CACHE_CHECK([whether .eh_frame section should be read-only],
kono
parents:
diff changeset
797 libgo_cv_ro_eh_frame, [
kono
parents:
diff changeset
798 libgo_cv_ro_eh_frame=no
kono
parents:
diff changeset
799 echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
kono
parents:
diff changeset
800 if $CC $CFLAGS -S -fpic -fexceptions -o conftest.s conftest.c > /dev/null 2>&1; then
kono
parents:
diff changeset
801 if grep '.section.*eh_frame.*"a"' conftest.s > /dev/null; then
kono
parents:
diff changeset
802 libgo_cv_ro_eh_frame=yes
kono
parents:
diff changeset
803 elif grep '.section.*eh_frame.*#alloc' conftest.c \
kono
parents:
diff changeset
804 | grep -v '#write' > /dev/null; then
kono
parents:
diff changeset
805 libgo_cv_ro_eh_frame=yes
kono
parents:
diff changeset
806 fi
kono
parents:
diff changeset
807 fi
kono
parents:
diff changeset
808 rm -f conftest.*
kono
parents:
diff changeset
809 ])
kono
parents:
diff changeset
810 if test "x$libgo_cv_ro_eh_frame" = xyes; then
kono
parents:
diff changeset
811 AC_DEFINE(EH_FRAME_FLAGS, "a",
kono
parents:
diff changeset
812 [Define to the flags needed for the .section .eh_frame directive.])
kono
parents:
diff changeset
813 else
kono
parents:
diff changeset
814 AC_DEFINE(EH_FRAME_FLAGS, "aw",
kono
parents:
diff changeset
815 [Define to the flags needed for the .section .eh_frame directive.])
kono
parents:
diff changeset
816 fi
kono
parents:
diff changeset
817
kono
parents:
diff changeset
818 AC_CACHE_CHECK([if compiler supports -Qunused-arguments],
kono
parents:
diff changeset
819 [libgo_cv_c_unused_arguments],
kono
parents:
diff changeset
820 [CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
821 CFLAGS="$CFLAGS -Qunused-arguments"
kono
parents:
diff changeset
822 AC_COMPILE_IFELSE([[int i;]],
kono
parents:
diff changeset
823 [libgo_cv_c_unused_arguments=yes],
kono
parents:
diff changeset
824 [libgo_cv_c_unused_arguments=no])
kono
parents:
diff changeset
825 CFLAGS=$CFLAGS_hold])
kono
parents:
diff changeset
826
kono
parents:
diff changeset
827 AC_CACHE_CHECK([if assembler supports GNU comdat group syntax],
kono
parents:
diff changeset
828 libgo_cv_as_comdat_gnu, [
kono
parents:
diff changeset
829 echo '.section .text,"axG",@progbits,.foo,comdat' > conftest.s
kono
parents:
diff changeset
830 CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
831 if test "$libgo_cv_c_unused_arguments" = yes; then
kono
parents:
diff changeset
832 CFLAGS="$CFLAGS -Qunused-arguments"
kono
parents:
diff changeset
833 fi
kono
parents:
diff changeset
834 if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then
kono
parents:
diff changeset
835 libgo_cv_as_comdat_gnu=yes
kono
parents:
diff changeset
836 else
kono
parents:
diff changeset
837 libgo_cv_as_comdat_gnu=no
kono
parents:
diff changeset
838 fi
kono
parents:
diff changeset
839 CFLAGS=$CFLAGS_hold
kono
parents:
diff changeset
840 ])
kono
parents:
diff changeset
841 if test "x$libgo_cv_as_comdat_gnu" = xyes; then
kono
parents:
diff changeset
842 AC_DEFINE(HAVE_AS_COMDAT_GAS, 1,
kono
parents:
diff changeset
843 [Define if your assembler supports GNU comdat group syntax.])
kono
parents:
diff changeset
844 fi
kono
parents:
diff changeset
845
kono
parents:
diff changeset
846 AC_CACHE_CHECK([assembler supports pc related relocs],
kono
parents:
diff changeset
847 libgo_cv_as_x86_pcrel, [
kono
parents:
diff changeset
848 libgo_cv_as_x86_pcrel=yes
kono
parents:
diff changeset
849 echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
kono
parents:
diff changeset
850 CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
851 if test "$libgo_cv_c_unused_arguments" = yes; then
kono
parents:
diff changeset
852 CFLAGS="$CFLAGS -Qunused-arguments"
kono
parents:
diff changeset
853 fi
kono
parents:
diff changeset
854 if $CC $CFLAGS -c conftest.s 2>&1 | $EGREP -i 'illegal|warning' > /dev/null; then
kono
parents:
diff changeset
855 libgo_cv_as_x86_pcrel=no
kono
parents:
diff changeset
856 fi
kono
parents:
diff changeset
857 CFLAGS=$CFLAGS_hold
kono
parents:
diff changeset
858 ])
kono
parents:
diff changeset
859 if test "x$libgo_cv_as_x86_pcrel" = xyes; then
kono
parents:
diff changeset
860 AC_DEFINE(HAVE_AS_X86_PCREL, 1,
kono
parents:
diff changeset
861 [Define if your assembler supports PC relative relocs.])
kono
parents:
diff changeset
862 fi
kono
parents:
diff changeset
863
kono
parents:
diff changeset
864 AC_CACHE_CHECK([assembler supports unwind section type],
kono
parents:
diff changeset
865 libgo_cv_as_x86_64_unwind_section_type, [
kono
parents:
diff changeset
866 libgo_cv_as_x86_64_unwind_section_type=yes
kono
parents:
diff changeset
867 echo '.section .eh_frame,"a",@unwind' > conftest.s
kono
parents:
diff changeset
868 CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
869 if test "$libgo_cv_c_unused_arguments" = yes; then
kono
parents:
diff changeset
870 CFLAGS="$CFLAGS -Qunused-arguments"
kono
parents:
diff changeset
871 fi
kono
parents:
diff changeset
872 if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
kono
parents:
diff changeset
873 libgo_cv_as_x86_64_unwind_section_type=no
kono
parents:
diff changeset
874 fi
kono
parents:
diff changeset
875 CFLAGS=$CFLAGS_hold
kono
parents:
diff changeset
876 ])
kono
parents:
diff changeset
877 if test "x$libgo_cv_as_x86_64_unwind_section_type" = xyes; then
kono
parents:
diff changeset
878 AC_DEFINE(HAVE_AS_X86_64_UNWIND_SECTION_TYPE, 1,
kono
parents:
diff changeset
879 [Define if your assembler supports unwind section type.])
kono
parents:
diff changeset
880 fi
kono
parents:
diff changeset
881
kono
parents:
diff changeset
882 AC_CACHE_CHECK([assembler supports AES instructions],
kono
parents:
diff changeset
883 libgo_cv_as_x86_aes, [
kono
parents:
diff changeset
884 libgo_cv_as_x86_aes=yes
kono
parents:
diff changeset
885 echo 'aesenc %xmm0, %xmm1' > conftest.s
kono
parents:
diff changeset
886 CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
887 if test "$libgo_cv_c_unused_arguments" = yes; then
kono
parents:
diff changeset
888 CFLAGS="$CFLAGS -Qunused-arguments"
kono
parents:
diff changeset
889 fi
kono
parents:
diff changeset
890 if $CC $CFLAGS -c conftest.s 2>&1 | grep -i error > /dev/null; then
kono
parents:
diff changeset
891 libgo_cv_as_x86_aes=no
kono
parents:
diff changeset
892 fi
kono
parents:
diff changeset
893 CFLAGS=$CFLAGS_hold
kono
parents:
diff changeset
894 ])
kono
parents:
diff changeset
895 if test "x$libgo_cv_as_x86_aes" = xyes; then
kono
parents:
diff changeset
896 AC_DEFINE(HAVE_AS_X86_AES, 1,
kono
parents:
diff changeset
897 [Define if your assembler supports AES instructions.])
kono
parents:
diff changeset
898 fi
kono
parents:
diff changeset
899
kono
parents:
diff changeset
900 AC_CACHE_SAVE
kono
parents:
diff changeset
901
kono
parents:
diff changeset
902 if test ${multilib} = yes; then
kono
parents:
diff changeset
903 multilib_arg="--enable-multilib"
kono
parents:
diff changeset
904 else
kono
parents:
diff changeset
905 multilib_arg=
kono
parents:
diff changeset
906 fi
kono
parents:
diff changeset
907
kono
parents:
diff changeset
908 AC_CONFIG_FILES(Makefile testsuite/Makefile)
kono
parents:
diff changeset
909
kono
parents:
diff changeset
910 AC_CONFIG_COMMANDS([default],
kono
parents:
diff changeset
911 [if test -n "$CONFIG_FILES"; then
kono
parents:
diff changeset
912 # Multilibs need MULTISUBDIR defined correctly in certain makefiles so
kono
parents:
diff changeset
913 # that multilib installs will end up installed in the correct place.
kono
parents:
diff changeset
914 # The testsuite needs it for multilib-aware ABI baseline files.
kono
parents:
diff changeset
915 # To work around this not being passed down from config-ml.in ->
kono
parents:
diff changeset
916 # srcdir/Makefile.am -> srcdir/{src,libsupc++,...}/Makefile.am, manually
kono
parents:
diff changeset
917 # append it here. Only modify Makefiles that have just been created.
kono
parents:
diff changeset
918 #
kono
parents:
diff changeset
919 # Also, get rid of this simulated-VPATH thing that automake does.
kono
parents:
diff changeset
920 cat > vpsed << \_EOF
kono
parents:
diff changeset
921 s!`test -f '$<' || echo '$(srcdir)/'`!!
kono
parents:
diff changeset
922 _EOF
kono
parents:
diff changeset
923 for i in $SUBDIRS; do
kono
parents:
diff changeset
924 case $CONFIG_FILES in
kono
parents:
diff changeset
925 *${i}/Makefile*)
kono
parents:
diff changeset
926 #echo "Adding MULTISUBDIR to $i/Makefile"
kono
parents:
diff changeset
927 sed -f vpsed $i/Makefile > tmp
kono
parents:
diff changeset
928 grep '^MULTISUBDIR =' Makefile >> tmp
kono
parents:
diff changeset
929 mv tmp $i/Makefile
kono
parents:
diff changeset
930 ;;
kono
parents:
diff changeset
931 esac
kono
parents:
diff changeset
932 done
kono
parents:
diff changeset
933 rm vpsed
kono
parents:
diff changeset
934 fi
kono
parents:
diff changeset
935 ],
kono
parents:
diff changeset
936 [
kono
parents:
diff changeset
937 # Variables needed in config.status (file generation) which aren't already
kono
parents:
diff changeset
938 # passed by autoconf.
kono
parents:
diff changeset
939 SUBDIRS="$SUBDIRS"
kono
parents:
diff changeset
940 ])
kono
parents:
diff changeset
941
kono
parents:
diff changeset
942 AC_OUTPUT