annotate libgo/configure.ac @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
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_INIT(package-unused, version-unused,, libgo)
kono
parents:
diff changeset
10 AC_CONFIG_SRCDIR(Makefile.am)
kono
parents:
diff changeset
11 AC_CONFIG_HEADER(config.h)
kono
parents:
diff changeset
12
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
13 libtool_VERSION=16:0:0
111
kono
parents:
diff changeset
14 AC_SUBST(libtool_VERSION)
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 AM_ENABLE_MULTILIB(, ..)
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 AC_CANONICAL_SYSTEM
kono
parents:
diff changeset
19 target_alias=${target_alias-$host_alias}
kono
parents:
diff changeset
20
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
21 AM_INIT_AUTOMAKE([1.9.3 no-define foreign no-dist subdir-objects -Wall -Wno-portability -Wno-override])
111
kono
parents:
diff changeset
22 AH_TEMPLATE(PACKAGE, [Name of package])
kono
parents:
diff changeset
23 AH_TEMPLATE(VERSION, [Version number of package])
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 m4_rename([_AC_ARG_VAR_PRECIOUS],[glibgo_PRECIOUS])
kono
parents:
diff changeset
26 m4_define([_AC_ARG_VAR_PRECIOUS],[])
kono
parents:
diff changeset
27 AC_PROG_CC
kono
parents:
diff changeset
28 AC_PROG_GO
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
29 AM_PROG_AS
111
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
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
83 GCC_WITH_TOOLEXECLIBDIR
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
84
111
kono
parents:
diff changeset
85 # Version-specific runtime libs processing.
kono
parents:
diff changeset
86 if test $version_specific_libs = yes; then
kono
parents:
diff changeset
87 glibgo_toolexecdir='${libdir}/gcc/${host_alias}'
kono
parents:
diff changeset
88 glibgo_toolexeclibdir='${toolexecdir}/${gcc_version}$(MULTISUBDIR)'
kono
parents:
diff changeset
89 fi
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 # Calculate glibgo_toolexecdir, glibgo_toolexeclibdir
kono
parents:
diff changeset
92 # Install a library built with a cross compiler in tooldir, not libdir.
kono
parents:
diff changeset
93 if test -n "$with_cross_host" &&
kono
parents:
diff changeset
94 test x"$with_cross_host" != x"no"; then
kono
parents:
diff changeset
95 nover_glibgo_toolexecdir='${exec_prefix}/${host_alias}'
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
96 case ${with_toolexeclibdir} in
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
97 no)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
98 nover_glibgo_toolexeclibdir='${toolexecdir}/lib'
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
99 ;;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
100 *)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
101 nover_glibgo_toolexeclibdir=${with_toolexeclibdir}
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
102 ;;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
103 esac
111
kono
parents:
diff changeset
104 else
kono
parents:
diff changeset
105 nover_glibgo_toolexecdir='${libdir}/gcc/${host_alias}'
kono
parents:
diff changeset
106 nover_glibgo_toolexeclibdir='${libdir}'
kono
parents:
diff changeset
107 fi
kono
parents:
diff changeset
108 multi_os_directory=`$GOC -print-multi-os-directory`
kono
parents:
diff changeset
109 case $multi_os_directory in
kono
parents:
diff changeset
110 .) ;; # Avoid trailing /.
kono
parents:
diff changeset
111 *) nover_glibgo_toolexeclibdir=${nover_glibgo_toolexeclibdir}/${multi_os_directory} ;;
kono
parents:
diff changeset
112 esac
kono
parents:
diff changeset
113
kono
parents:
diff changeset
114 if test x"$glibgo_toolexecdir" = x"no"; then
kono
parents:
diff changeset
115 glibgo_toolexecdir="${nover_glibgo_toolexecdir}"
kono
parents:
diff changeset
116 glibgo_toolexeclibdir="${nover_glibgo_toolexeclibdir}"
kono
parents:
diff changeset
117 fi
kono
parents:
diff changeset
118
kono
parents:
diff changeset
119 AC_SUBST(glibgo_toolexecdir)
kono
parents:
diff changeset
120 AC_SUBST(glibgo_toolexeclibdir)
kono
parents:
diff changeset
121 AC_SUBST(nover_glibgo_toolexeclibdir)
kono
parents:
diff changeset
122
kono
parents:
diff changeset
123 # See if the user wants to configure without libffi. Some
kono
parents:
diff changeset
124 # architectures don't support it. FIXME: We should set a default
kono
parents:
diff changeset
125 # based on the host.
kono
parents:
diff changeset
126 AC_ARG_WITH(libffi,
kono
parents:
diff changeset
127 AS_HELP_STRING([--without-libffi],
kono
parents:
diff changeset
128 [don't use libffi]),
kono
parents:
diff changeset
129 [:],
kono
parents:
diff changeset
130 [with_libffi=${with_libffi_default-yes}])
kono
parents:
diff changeset
131
kono
parents:
diff changeset
132 LIBFFI=
kono
parents:
diff changeset
133 LIBFFIINCS=
kono
parents:
diff changeset
134 if test "$with_libffi" != no; then
kono
parents:
diff changeset
135 AC_DEFINE(USE_LIBFFI, 1, [Define if we're to use libffi.])
kono
parents:
diff changeset
136 LIBFFI=../libffi/libffi_convenience.la
kono
parents:
diff changeset
137 LIBFFIINCS='-I$(top_srcdir)/../libffi/include -I../libffi/include'
kono
parents:
diff changeset
138 fi
kono
parents:
diff changeset
139 AC_SUBST(LIBFFI)
kono
parents:
diff changeset
140 AC_SUBST(LIBFFIINCS)
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
141 AM_CONDITIONAL(USE_LIBFFI, test "$with_libffi" != "no")
111
kono
parents:
diff changeset
142
kono
parents:
diff changeset
143 # See if the user wants to configure without libatomic. This is useful if we are
kono
parents:
diff changeset
144 # on an architecture for which libgo does not need an atomic support library and
kono
parents:
diff changeset
145 # libatomic does not support our C compiler.
kono
parents:
diff changeset
146 AC_ARG_WITH(libatomic,
kono
parents:
diff changeset
147 AS_HELP_STRING([--without-libatomic],
kono
parents:
diff changeset
148 [don't use libatomic]),
kono
parents:
diff changeset
149 [:],
kono
parents:
diff changeset
150 [with_libatomic=${with_libatomic_default-yes}])
kono
parents:
diff changeset
151
kono
parents:
diff changeset
152 LIBATOMIC=
kono
parents:
diff changeset
153 if test "$with_libatomic" != no; then
kono
parents:
diff changeset
154 LIBATOMIC=../libatomic/libatomic_convenience.la
kono
parents:
diff changeset
155 fi
kono
parents:
diff changeset
156 AC_SUBST(LIBATOMIC)
kono
parents:
diff changeset
157
kono
parents:
diff changeset
158 # Used to tell GNU make to include a file without telling automake to
kono
parents:
diff changeset
159 # include it.
kono
parents:
diff changeset
160 go_include="-include"
kono
parents:
diff changeset
161 AC_SUBST(go_include)
kono
parents:
diff changeset
162
kono
parents:
diff changeset
163 # All known GOOS values. This is the union of all operating systems
kono
parents:
diff changeset
164 # supported by the gofrontend and all operating systems supported by
kono
parents:
diff changeset
165 # the gc toolchain.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
166 ALLGOOS="aix android darwin dragonfly freebsd hurd illumos irix js linux netbsd openbsd plan9 rtems solaris windows"
111
kono
parents:
diff changeset
167
kono
parents:
diff changeset
168 is_darwin=no
kono
parents:
diff changeset
169 is_freebsd=no
kono
parents:
diff changeset
170 is_irix=no
kono
parents:
diff changeset
171 is_linux=no
kono
parents:
diff changeset
172 is_netbsd=no
kono
parents:
diff changeset
173 is_openbsd=no
kono
parents:
diff changeset
174 is_dragonfly=no
kono
parents:
diff changeset
175 is_rtems=no
kono
parents:
diff changeset
176 is_solaris=no
kono
parents:
diff changeset
177 is_aix=no
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
178 is_hurd=no
111
kono
parents:
diff changeset
179 GOOS=unknown
kono
parents:
diff changeset
180 case ${host} in
kono
parents:
diff changeset
181 *-*-darwin*) is_darwin=yes; GOOS=darwin ;;
kono
parents:
diff changeset
182 *-*-freebsd*) is_freebsd=yes; GOOS=freebsd ;;
kono
parents:
diff changeset
183 *-*-irix6*) is_irix=yes; GOOS=irix ;;
kono
parents:
diff changeset
184 *-*-linux*) is_linux=yes; GOOS=linux ;;
kono
parents:
diff changeset
185 *-*-netbsd*) is_netbsd=yes; GOOS=netbsd ;;
kono
parents:
diff changeset
186 *-*-openbsd*) is_openbsd=yes; GOOS=openbsd ;;
kono
parents:
diff changeset
187 *-*-dragonfly*) is_dragonfly=yes; GOOS=dragonfly ;;
kono
parents:
diff changeset
188 *-*-rtems*) is_rtems=yes; GOOS=rtems ;;
kono
parents:
diff changeset
189 *-*-solaris2*) is_solaris=yes; GOOS=solaris ;;
kono
parents:
diff changeset
190 *-*-aix*) is_aix=yes; GOOS=aix ;;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
191 *-*-gnu*) is_hurd=yes; GOOS=hurd ;;
111
kono
parents:
diff changeset
192 esac
kono
parents:
diff changeset
193 AM_CONDITIONAL(LIBGO_IS_DARWIN, test $is_darwin = yes)
kono
parents:
diff changeset
194 AM_CONDITIONAL(LIBGO_IS_FREEBSD, test $is_freebsd = yes)
kono
parents:
diff changeset
195 AM_CONDITIONAL(LIBGO_IS_IRIX, test $is_irix = yes)
kono
parents:
diff changeset
196 AM_CONDITIONAL(LIBGO_IS_LINUX, test $is_linux = yes)
kono
parents:
diff changeset
197 AM_CONDITIONAL(LIBGO_IS_NETBSD, test $is_netbsd = yes)
kono
parents:
diff changeset
198 AM_CONDITIONAL(LIBGO_IS_OPENBSD, test $is_openbsd = yes)
kono
parents:
diff changeset
199 AM_CONDITIONAL(LIBGO_IS_DRAGONFLY, test $is_dragonfly = yes)
kono
parents:
diff changeset
200 AM_CONDITIONAL(LIBGO_IS_RTEMS, test $is_rtems = yes)
kono
parents:
diff changeset
201 AM_CONDITIONAL(LIBGO_IS_SOLARIS, test $is_solaris = yes)
kono
parents:
diff changeset
202 AM_CONDITIONAL(LIBGO_IS_AIX, test $is_aix = yes)
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
203 AM_CONDITIONAL(LIBGO_IS_HURD, test $is_hurd = yes)
111
kono
parents:
diff changeset
204 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
205 AC_SUBST(GOOS)
kono
parents:
diff changeset
206 AC_SUBST(ALLGOOS)
kono
parents:
diff changeset
207
kono
parents:
diff changeset
208 dnl Test whether we need to use DejaGNU or whether we can use the
kono
parents:
diff changeset
209 dnl simpler gotest approach. We can only use gotest for a native
kono
parents:
diff changeset
210 dnl build.
kono
parents:
diff changeset
211 USE_DEJAGNU=no
kono
parents:
diff changeset
212 case ${host} in
kono
parents:
diff changeset
213 *-*-rtems*) USE_DEJAGNU=yes ;;
kono
parents:
diff changeset
214 ${build}) ;;
kono
parents:
diff changeset
215 *) USE_DEJAGNU=yes ;;
kono
parents:
diff changeset
216 esac
kono
parents:
diff changeset
217 AC_SUBST(USE_DEJAGNU)
kono
parents:
diff changeset
218
kono
parents:
diff changeset
219 # All known GOARCH values. This is the union of all architectures
kono
parents:
diff changeset
220 # supported by the gofrontend and all architectures supported by the
kono
parents:
diff changeset
221 # gc toolchain.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
222 # To add a new architecture:
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
223 # - add it to this list
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
224 # - if appropriate, add an entry to ALLGOARCHFAMILY below
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
225 # - add an entry to the case on ${host} below to set GOARCH
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
226 # - update goarchList in libgo/go/go/build/syslist.go
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
227 # - update goarch.sh to report the values for this architecture
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
228 # - update go-set-goarch in gcc/testsuite/go.test/go-test.exp
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
229 # - update ptrSizeMap and intSizeMap in libgo/go/cmd/cgo/main.go
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
230 # - update arch lists in libgo/match.sh
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
231 # - update arch lists in libgo/testsuite/gotest
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
232 # - update +build lines in several places
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
233 # - libgo/go/runtime/lfstack_NNbit.go
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
234 # - libgo/go/runtime/hashNN.go
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
235 # - libgo/go/runtime/unalignedN.go
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
236 # - libgo/go/syscall/endian_XX.go
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
237 # - possibly others
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
238 # - possibly update files in libgo/go/internal/syscall/unix
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
239 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
240
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
241 # All known GOARCH family values.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
242 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
243
kono
parents:
diff changeset
244 GOARCH=unknown
kono
parents:
diff changeset
245 case ${host} in
kono
parents:
diff changeset
246 alpha*-*-*)
kono
parents:
diff changeset
247 GOARCH=alpha
kono
parents:
diff changeset
248 ;;
kono
parents:
diff changeset
249 aarch64-*-*)
kono
parents:
diff changeset
250 GOARCH=arm64
kono
parents:
diff changeset
251 ;;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
252 aarch64_be-*-*)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
253 GOARCH=arm64be
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
254 ;;
111
kono
parents:
diff changeset
255 arm*-*-* | strongarm*-*-* | ep9312*-*-* | xscale-*-*)
kono
parents:
diff changeset
256 GOARCH=arm
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
257 case ${host} in
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
258 arm*b*-*-*)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
259 GOARCH=armbe
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
260 ;;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
261 esac
111
kono
parents:
diff changeset
262 ;;
kono
parents:
diff changeset
263 changequote(,)dnl
kono
parents:
diff changeset
264 i[34567]86-*-* | x86_64-*-*)
kono
parents:
diff changeset
265 changequote([,])dnl
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
266 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
111
kono
parents:
diff changeset
267 #ifdef __x86_64__
kono
parents:
diff changeset
268 #error 64-bit
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
269 #endif
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
270 ])],
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
271 [GOARCH=386],
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
272 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
273 #ifdef __ILP32__
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
274 #error x32
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
275 #endif
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
276 ])],
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
277 [GOARCH=amd64],
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
278 [GOARCH=amd64p32]))
111
kono
parents:
diff changeset
279 ;;
kono
parents:
diff changeset
280 ia64-*-*)
kono
parents:
diff changeset
281 GOARCH=ia64
kono
parents:
diff changeset
282 ;;
kono
parents:
diff changeset
283 m68k*-*-*)
kono
parents:
diff changeset
284 GOARCH=m68k
kono
parents:
diff changeset
285 ;;
kono
parents:
diff changeset
286 mips*-*-*)
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
287 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
111
kono
parents:
diff changeset
288 #if _MIPS_SIM != _ABIO32
kono
parents:
diff changeset
289 #error not o32
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
290 #endif
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
291 ])],
111
kono
parents:
diff changeset
292 [mips_abi="o32"],
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
293 [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
111
kono
parents:
diff changeset
294 #if _MIPS_SIM != _ABIN32
kono
parents:
diff changeset
295 #error not n32
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
296 #endif
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
297 ])],
111
kono
parents:
diff changeset
298 [mips_abi="n32"],
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
299 [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
111
kono
parents:
diff changeset
300 #if _MIPS_SIM != _ABI64
kono
parents:
diff changeset
301 #error not n64
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
302 #endif
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
303 ])],
111
kono
parents:
diff changeset
304 [mips_abi="n64"],
kono
parents:
diff changeset
305 [AC_MSG_ERROR([unknown MIPS ABI])
kono
parents:
diff changeset
306 [mips_abi="n32"]])])])
kono
parents:
diff changeset
307 case "$mips_abi" in
kono
parents:
diff changeset
308 "o32") GOARCH=mips ;;
kono
parents:
diff changeset
309 "n32") GOARCH=mips64p32 ;;
kono
parents:
diff changeset
310 "n64") GOARCH=mips64 ;;
kono
parents:
diff changeset
311 esac
kono
parents:
diff changeset
312 case "${host}" in
kono
parents:
diff changeset
313 mips*el-*-*)
kono
parents:
diff changeset
314 GOARCH="${GOARCH}le"
kono
parents:
diff changeset
315 ;;
kono
parents:
diff changeset
316 esac
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
317 ;;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
318 nios2-*-*)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
319 GOARCH=nios2
111
kono
parents:
diff changeset
320 ;;
kono
parents:
diff changeset
321 rs6000*-*-* | powerpc*-*-*)
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
322 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
111
kono
parents:
diff changeset
323 #ifdef _ARCH_PPC64
kono
parents:
diff changeset
324 #error 64-bit
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
325 #endif
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
326 ])],
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
327 [GOARCH=ppc],
111
kono
parents:
diff changeset
328 [
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
329 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
111
kono
parents:
diff changeset
330 #if defined(_BIG_ENDIAN) || defined(__BIG_ENDIAN__)
kono
parents:
diff changeset
331 #error 64be
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
332 #endif
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
333 ])],
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
334 [GOARCH=ppc64le],
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
335 [GOARCH=ppc64])])
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
336 ;;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
337 riscv64-*-*)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
338 GOARCH=riscv64
111
kono
parents:
diff changeset
339 ;;
kono
parents:
diff changeset
340 s390*-*-*)
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
341 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
111
kono
parents:
diff changeset
342 #if defined(__s390x__)
kono
parents:
diff changeset
343 #error 64-bit
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
344 #endif
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
345 ])],
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
346 [GOARCH=s390],
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
347 [GOARCH=s390x])
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
348 ;;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
349 sh3eb*-*-* | sh4eb*-*-*)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
350 GOARCH=shbe
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
351 ;;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
352 sh3*-*-* | sh4*-*-*)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
353 GOARCH=sh
111
kono
parents:
diff changeset
354 ;;
kono
parents:
diff changeset
355 sparc*-*-*)
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
356 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
111
kono
parents:
diff changeset
357 #if defined(__sparcv9) || defined(__arch64__)
kono
parents:
diff changeset
358 #error 64-bit
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
359 #endif
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
360 ])],
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
361 [GOARCH=sparc],
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
362 [GOARCH=sparc64])
111
kono
parents:
diff changeset
363 ;;
kono
parents:
diff changeset
364 esac
kono
parents:
diff changeset
365 AC_SUBST(GOARCH)
kono
parents:
diff changeset
366 AC_SUBST(ALLGOARCH)
kono
parents:
diff changeset
367 AC_SUBST(ALLGOARCHFAMILY)
kono
parents:
diff changeset
368
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
369 AM_CONDITIONAL(LIBGO_IS_X86, test "$GOARCH" = "386" -o "$GOARCH" = "amd64" -o "$GOARCH" = "amd64p32")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
370
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
371 FUNCTION_DESCRIPTORS=false
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
372 case ${host} in
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
373 rs6000*-*-* | powerpc*-*-*)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
374 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
375 #if _CALL_ELF == 1
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
376 #error descriptors
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
377 #endif
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
378 ])],
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
379 [FUNCTION_DESCRIPTORS=false],
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
380 [FUNCTION_DESCRIPTORS=true])
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
381 ;;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
382 esac
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
383 AC_SUBST(FUNCTION_DESCRIPTORS)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
384
111
kono
parents:
diff changeset
385 dnl Some files are only present when needed for specific architectures.
kono
parents:
diff changeset
386 GO_LIBCALL_OS_FILE=
kono
parents:
diff changeset
387 GO_LIBCALL_OS_ARCH_FILE=
kono
parents:
diff changeset
388 GO_SYSCALL_OS_FILE=
kono
parents:
diff changeset
389 GO_SYSCALL_OS_ARCH_FILE=
kono
parents:
diff changeset
390 if test -f "${srcdir}/go/syscall/libcall_${GOOS}.go"; then
kono
parents:
diff changeset
391 GO_LIBCALL_OS_FILE="go/syscall/libcall_${GOOS}.go"
kono
parents:
diff changeset
392 fi
kono
parents:
diff changeset
393 if test -f "${srcdir}/go/syscall/libcall_${GOOS}_${GOARCH}.go"; then
kono
parents:
diff changeset
394 GO_LIBCALL_OS_ARCH_FILE="go/syscall/libcall_${GOOS}_${GOARCH}.go"
kono
parents:
diff changeset
395 fi
kono
parents:
diff changeset
396 if test -f "${srcdir}/go/syscall/syscall_${GOOS}.go"; then
kono
parents:
diff changeset
397 GO_SYSCALL_OS_FILE="go/syscall/syscall_${GOOS}.go"
kono
parents:
diff changeset
398 fi
kono
parents:
diff changeset
399 if test -f "${srcdir}/go/syscall/syscall_${GOOS}_${GOARCH}.go"; then
kono
parents:
diff changeset
400 GO_SYSCALL_OS_ARCH_FILE="go/syscall/syscall_${GOOS}_${GOARCH}.go"
kono
parents:
diff changeset
401 fi
kono
parents:
diff changeset
402 AC_SUBST(GO_LIBCALL_OS_FILE)
kono
parents:
diff changeset
403 AC_SUBST(GO_LIBCALL_OS_ARCH_FILE)
kono
parents:
diff changeset
404 AC_SUBST(GO_SYSCALL_OS_FILE)
kono
parents:
diff changeset
405 AC_SUBST(GO_SYSCALL_OS_ARCH_FILE)
kono
parents:
diff changeset
406
kono
parents:
diff changeset
407 dnl Special flags used to generate sysinfo.go.
kono
parents:
diff changeset
408 OSCFLAGS="-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
kono
parents:
diff changeset
409 case "$target" in
kono
parents:
diff changeset
410 mips-sgi-irix6.5*)
kono
parents:
diff changeset
411 # IRIX 6 needs _XOPEN_SOURCE=500 for the XPG5 version of struct
kono
parents:
diff changeset
412 # msghdr in <sys/socket.h>.
kono
parents:
diff changeset
413 OSCFLAGS="$OSCFLAGS -D_XOPEN_SOURCE=500"
kono
parents:
diff changeset
414 ;;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
415 *-*-solaris2.*)
111
kono
parents:
diff changeset
416 # Solaris 10+ needs this so struct msghdr gets the msg_control
kono
parents:
diff changeset
417 # etc. fields in <sys/socket.h> (_XPG4_2). _XOPEN_SOURCE=600 as
kono
parents:
diff changeset
418 # above doesn't work with C99.
kono
parents:
diff changeset
419 OSCFLAGS="$OSCFLAGS -std=gnu99 -D_XOPEN_SOURCE=600 -D__EXTENSIONS__"
kono
parents:
diff changeset
420 ;;
kono
parents:
diff changeset
421 esac
kono
parents:
diff changeset
422 AC_SUBST(OSCFLAGS)
kono
parents:
diff changeset
423
kono
parents:
diff changeset
424 dnl Check if assembler supports disabling hardware capability support.
kono
parents:
diff changeset
425 GCC_CHECK_ASSEMBLER_HWCAP
kono
parents:
diff changeset
426
kono
parents:
diff changeset
427 dnl Use -fsplit-stack when compiling C code if available.
kono
parents:
diff changeset
428 AC_CACHE_CHECK([whether -fsplit-stack is supported],
kono
parents:
diff changeset
429 [libgo_cv_c_split_stack_supported],
kono
parents:
diff changeset
430 [CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
431 CFLAGS="$CFLAGS -fsplit-stack"
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
432 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
111
kono
parents:
diff changeset
433 [libgo_cv_c_split_stack_supported=yes],
kono
parents:
diff changeset
434 [libgo_cv_c_split_stack_supported=no])
kono
parents:
diff changeset
435 CFLAGS=$CFLAGS_hold])
kono
parents:
diff changeset
436
kono
parents:
diff changeset
437 dnl Make sure the linker permits -fsplit-stack. Old versions of gold will
kono
parents:
diff changeset
438 dnl reject split-stack code calling non-split-stack code on targets
kono
parents:
diff changeset
439 dnl they don't support.
kono
parents:
diff changeset
440 AC_CACHE_CHECK([whether linker supports split/non-split linked together],
kono
parents:
diff changeset
441 [libgo_cv_c_linker_split_non_split],
kono
parents:
diff changeset
442 [cat > conftest1.c << EOF
kono
parents:
diff changeset
443 extern void f();
kono
parents:
diff changeset
444 int main() { f(); return 0; }
kono
parents:
diff changeset
445 EOF
kono
parents:
diff changeset
446 cat > conftest2.c << EOF
kono
parents:
diff changeset
447 void f() {}
kono
parents:
diff changeset
448 EOF
kono
parents:
diff changeset
449 $CC -c -fsplit-stack $CFLAGS $CPPFLAGS conftest1.c >/dev/null 2>&1
kono
parents:
diff changeset
450 $CC -c $CFLAGS $CPPFLAGS conftest2.c > /dev/null 2>&1
kono
parents:
diff changeset
451 if $CC -o conftest conftest1.$ac_objext conftest2.$ac_objext > /dev/null 2>&1; then
kono
parents:
diff changeset
452 libgo_cv_c_linker_split_non_split=yes
kono
parents:
diff changeset
453 else
kono
parents:
diff changeset
454 libgo_cv_c_linker_split_non_split=no
kono
parents:
diff changeset
455 fi
kono
parents:
diff changeset
456 rm -f conftest1.* conftest2.* conftest])
kono
parents:
diff changeset
457
kono
parents:
diff changeset
458 if test "$libgo_cv_c_split_stack_supported" = yes -a "$libgo_cv_c_linker_split_non_split" = yes; then
kono
parents:
diff changeset
459 SPLIT_STACK=-fsplit-stack
kono
parents:
diff changeset
460 AC_DEFINE(USING_SPLIT_STACK, 1,
kono
parents:
diff changeset
461 [Define if the compiler supports -fsplit-stack])
kono
parents:
diff changeset
462 else
kono
parents:
diff changeset
463 SPLIT_STACK=
kono
parents:
diff changeset
464 fi
kono
parents:
diff changeset
465 AC_SUBST(SPLIT_STACK)
kono
parents:
diff changeset
466 AM_CONDITIONAL(USING_SPLIT_STACK,
kono
parents:
diff changeset
467 test "$libgo_cv_c_split_stack_supported" = yes -a "$libgo_cv_c_linker_split_non_split" = yes)
kono
parents:
diff changeset
468
kono
parents:
diff changeset
469 dnl If the compiler supports split-stack but the linker does not, then
kono
parents:
diff changeset
470 dnl we need to explicitly disable split-stack for Go.
kono
parents:
diff changeset
471 if test "$libgo_cv_c_split_stack_supported" = yes -a "$libgo_cv_c_linker_split_non_split" = no; then
kono
parents:
diff changeset
472 GO_SPLIT_STACK=-fno-split-stack
kono
parents:
diff changeset
473 else
kono
parents:
diff changeset
474 GO_SPLIT_STACK=
kono
parents:
diff changeset
475 fi
kono
parents:
diff changeset
476 AC_SUBST(GO_SPLIT_STACK)
kono
parents:
diff changeset
477
kono
parents:
diff changeset
478 dnl Check whether the linker does stack munging when calling from
kono
parents:
diff changeset
479 dnl split-stack into non-split-stack code. We check this by looking
kono
parents:
diff changeset
480 dnl at the --help output. FIXME: This is only half right: it's
kono
parents:
diff changeset
481 dnl possible for the linker to support this for some targets but not
kono
parents:
diff changeset
482 dnl others.
kono
parents:
diff changeset
483 dnl This is slightly different from the above check, which is whether
kono
parents:
diff changeset
484 dnl the linker permits the call at all.
kono
parents:
diff changeset
485 AC_CACHE_CHECK([whether linker supports split stack],
kono
parents:
diff changeset
486 [libgo_cv_c_linker_supports_split_stack],
kono
parents:
diff changeset
487 [libgo_cv_c_linker_supports_split_stack=no
kono
parents:
diff changeset
488 if $GOC -Wl,--help 2>/dev/null | grep split-stack-adjust-size >/dev/null 2>&1; then
kono
parents:
diff changeset
489 libgo_cv_c_linker_supports_split_stack=yes
kono
parents:
diff changeset
490 fi])
kono
parents:
diff changeset
491 if test "$libgo_cv_c_linker_supports_split_stack" = yes; then
kono
parents:
diff changeset
492 AC_DEFINE(LINKER_SUPPORTS_SPLIT_STACK, 1,
kono
parents:
diff changeset
493 [Define if the linker support split stack adjustments])
kono
parents:
diff changeset
494 fi
kono
parents:
diff changeset
495
kono
parents:
diff changeset
496 AC_CACHE_CHECK([whether compiler is llgo],
kono
parents:
diff changeset
497 [libgo_cv_c_goc_is_llgo],
kono
parents:
diff changeset
498 [libgo_cv_c_goc_is_llgo=no
kono
parents:
diff changeset
499 if $GOC -dumpversion 2>/dev/null | grep llgo >/dev/null 2>&1; then
kono
parents:
diff changeset
500 libgo_cv_c_goc_is_llgo=yes
kono
parents:
diff changeset
501 fi])
kono
parents:
diff changeset
502 AM_CONDITIONAL(GOC_IS_LLGO, test "$libgo_cv_c_goc_is_llgo" = yes)
kono
parents:
diff changeset
503
kono
parents:
diff changeset
504 dnl Test for the -lm library.
kono
parents:
diff changeset
505 MATH_LIBS=
kono
parents:
diff changeset
506 AC_CHECK_LIB([m], [sqrt], MATH_LIBS=-lm)
kono
parents:
diff changeset
507 AC_SUBST(MATH_LIBS)
kono
parents:
diff changeset
508
kono
parents:
diff changeset
509 dnl Test for -lsocket and -lnsl. Copied from libjava/configure.ac.
kono
parents:
diff changeset
510 AC_CACHE_CHECK([for socket libraries], libgo_cv_lib_sockets,
kono
parents:
diff changeset
511 [libgo_cv_lib_sockets=
kono
parents:
diff changeset
512 libgo_check_both=no
kono
parents:
diff changeset
513 AC_CHECK_FUNC(connect, libgo_check_socket=no, libgo_check_socket=yes)
kono
parents:
diff changeset
514 if test "$libgo_check_socket" = "yes"; then
kono
parents:
diff changeset
515 unset ac_cv_func_connect
kono
parents:
diff changeset
516 AC_CHECK_LIB(socket, main, libgo_cv_lib_sockets="-lsocket",
kono
parents:
diff changeset
517 libgo_check_both=yes)
kono
parents:
diff changeset
518 fi
kono
parents:
diff changeset
519 if test "$libgo_check_both" = "yes"; then
kono
parents:
diff changeset
520 libgo_old_libs=$LIBS
kono
parents:
diff changeset
521 LIBS="$LIBS -lsocket -lnsl"
kono
parents:
diff changeset
522 unset ac_cv_func_accept
kono
parents:
diff changeset
523 AC_CHECK_FUNC(accept,
kono
parents:
diff changeset
524 [libgo_check_nsl=no
kono
parents:
diff changeset
525 libgo_cv_lib_sockets="-lsocket -lnsl"])
kono
parents:
diff changeset
526 unset ac_cv_func_accept
kono
parents:
diff changeset
527 LIBS=$libgo_old_libs
kono
parents:
diff changeset
528 fi
kono
parents:
diff changeset
529 unset ac_cv_func_gethostbyname
kono
parents:
diff changeset
530 libgo_old_libs="$LIBS"
kono
parents:
diff changeset
531 AC_CHECK_FUNC(gethostbyname, ,
kono
parents:
diff changeset
532 [AC_CHECK_LIB(nsl, main,
kono
parents:
diff changeset
533 [libgo_cv_lib_sockets="$libgo_cv_lib_sockets -lnsl"])])
kono
parents:
diff changeset
534 unset ac_cv_func_gethostbyname
kono
parents:
diff changeset
535 AC_CHECK_FUNC(sendfile, ,
kono
parents:
diff changeset
536 [AC_CHECK_LIB(sendfile, main,
kono
parents:
diff changeset
537 [libgo_cv_lib_sockets="$libgo_cv_lib_sockets -lsendfile"])])
kono
parents:
diff changeset
538 LIBS=$libgo_old_libs
kono
parents:
diff changeset
539 ])
kono
parents:
diff changeset
540 NET_LIBS="$libgo_cv_lib_sockets"
kono
parents:
diff changeset
541 AC_SUBST(NET_LIBS)
kono
parents:
diff changeset
542
kono
parents:
diff changeset
543 dnl Test whether the compiler supports the -pthread option.
kono
parents:
diff changeset
544 AC_CACHE_CHECK([whether -pthread is supported],
kono
parents:
diff changeset
545 [libgo_cv_lib_pthread],
kono
parents:
diff changeset
546 [CFLAGS_hold=$CFLAGS
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
547 CFLAGS="$CFLAGS -pthread -L../libatomic/.libs"
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
548 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
111
kono
parents:
diff changeset
549 [libgo_cv_lib_pthread=yes],
kono
parents:
diff changeset
550 [libgo_cv_lib_pthread=no])
kono
parents:
diff changeset
551 CFLAGS=$CFLAGS_hold])
kono
parents:
diff changeset
552 PTHREAD_CFLAGS=
kono
parents:
diff changeset
553 if test "$libgo_cv_lib_pthread" = yes; then
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
554 # RISC-V apparently adds -latomic when using -pthread.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
555 PTHREAD_CFLAGS="-pthread -L../libatomic/.libs"
111
kono
parents:
diff changeset
556 fi
kono
parents:
diff changeset
557 AC_SUBST(PTHREAD_CFLAGS)
kono
parents:
diff changeset
558
kono
parents:
diff changeset
559 dnl Test for the -lpthread library.
kono
parents:
diff changeset
560 PTHREAD_LIBS=
kono
parents:
diff changeset
561 AC_CHECK_LIB([pthread], [pthread_create], PTHREAD_LIBS=-lpthread)
kono
parents:
diff changeset
562 AC_SUBST(PTHREAD_LIBS)
kono
parents:
diff changeset
563
kono
parents:
diff changeset
564 dnl Test if -lrt is required for sched_yield or nanosleep or clock_gettime.
kono
parents:
diff changeset
565 AC_SEARCH_LIBS([sched_yield], [rt])
kono
parents:
diff changeset
566 AC_SEARCH_LIBS([nanosleep], [rt])
kono
parents:
diff changeset
567 AC_SEARCH_LIBS([clock_gettime], [rt])
kono
parents:
diff changeset
568
kono
parents:
diff changeset
569 AC_C_BIGENDIAN
kono
parents:
diff changeset
570
kono
parents:
diff changeset
571 GCC_CHECK_UNWIND_GETIPINFO
kono
parents:
diff changeset
572
kono
parents:
diff changeset
573 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
574
kono
parents:
diff changeset
575 AC_CHECK_HEADERS([netinet/icmp6.h], [], [],
kono
parents:
diff changeset
576 [#include <netinet/in.h>
kono
parents:
diff changeset
577 ])
kono
parents:
diff changeset
578
kono
parents:
diff changeset
579 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
580 [#ifdef HAVE_SYS_SOCKET_H
kono
parents:
diff changeset
581 #include <sys/socket.h>
kono
parents:
diff changeset
582 #endif
kono
parents:
diff changeset
583 ])
kono
parents:
diff changeset
584
kono
parents:
diff changeset
585 AM_CONDITIONAL(HAVE_SYS_MMAN_H, test "$ac_cv_header_sys_mman_h" = yes)
kono
parents:
diff changeset
586
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
587 AC_CHECK_FUNCS(strerror_r strsignal wait4 mincore setenv unsetenv dl_iterate_phdr memmem)
111
kono
parents:
diff changeset
588 AM_CONDITIONAL(HAVE_STRERROR_R, test "$ac_cv_func_strerror_r" = yes)
kono
parents:
diff changeset
589 AM_CONDITIONAL(HAVE_WAIT4, test "$ac_cv_func_wait4" = yes)
kono
parents:
diff changeset
590
kono
parents:
diff changeset
591 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
592 AC_TYPE_OFF_T
kono
parents:
diff changeset
593 AC_CHECK_TYPES([loff_t])
kono
parents:
diff changeset
594
kono
parents:
diff changeset
595 LIBS_hold="$LIBS"
kono
parents:
diff changeset
596 LIBS="$LIBS -lm"
kono
parents:
diff changeset
597 AC_CHECK_FUNCS(cosl expl logl sinl tanl acosl asinl atanl atan2l expm1l ldexpl log10l log1pl)
kono
parents:
diff changeset
598 LIBS="$LIBS_hold"
kono
parents:
diff changeset
599
kono
parents:
diff changeset
600 CFLAGS_hold="$CFLAGS"
kono
parents:
diff changeset
601 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
kono
parents:
diff changeset
602 LIBS_hold="$LIBS"
kono
parents:
diff changeset
603 LIBS="$LIBS $PTHREAD_LIBS"
kono
parents:
diff changeset
604 AC_CHECK_FUNCS(sem_timedwait)
kono
parents:
diff changeset
605 CFLAGS="$CFLAGS_hold"
kono
parents:
diff changeset
606 LIBS="$LIBS_hold"
kono
parents:
diff changeset
607
kono
parents:
diff changeset
608 LIBS_hold="$LIBS"
kono
parents:
diff changeset
609 LIBS="$LIBS $MATH_LIBS"
kono
parents:
diff changeset
610 AC_CHECK_FUNCS(matherr)
kono
parents:
diff changeset
611 LIBS="$LIBS_hold"
kono
parents:
diff changeset
612
kono
parents:
diff changeset
613 dnl For x86 we want to use the -minline-all-stringops option to avoid
kono
parents:
diff changeset
614 dnl forcing a stack split when calling memcpy and friends.
kono
parents:
diff changeset
615 AC_CACHE_CHECK([whether compiler supports -minline-all-stringops],
kono
parents:
diff changeset
616 [libgo_cv_c_stringops],
kono
parents:
diff changeset
617 [CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
618 CFLAGS="$CFLAGS -minline-all-stringops"
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
619 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
111
kono
parents:
diff changeset
620 [libgo_cv_c_stringops=yes],
kono
parents:
diff changeset
621 [libgo_cv_c_stringops=no])
kono
parents:
diff changeset
622 CFLAGS=$CFLAGS_hold])
kono
parents:
diff changeset
623 STRINGOPS_FLAG=
kono
parents:
diff changeset
624 if test "$libgo_cv_c_stringops" = yes; then
kono
parents:
diff changeset
625 STRINGOPS_FLAG=-minline-all-stringops
kono
parents:
diff changeset
626 fi
kono
parents:
diff changeset
627 AC_SUBST(STRINGOPS_FLAG)
kono
parents:
diff changeset
628
kono
parents:
diff changeset
629 dnl For x86 we want to compile the math library with -mfancy-math-387
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
630 dnl so that we can use the builtin instructions directly.
111
kono
parents:
diff changeset
631 AC_CACHE_CHECK([whether compiler supports -mfancy-math-387],
kono
parents:
diff changeset
632 [libgo_cv_c_fancymath],
kono
parents:
diff changeset
633 [CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
634 CFLAGS="$CFLAGS -mfancy-math-387"
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
635 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
111
kono
parents:
diff changeset
636 [libgo_cv_c_fancymath=yes],
kono
parents:
diff changeset
637 [libgo_cv_c_fancymath=no])
kono
parents:
diff changeset
638 CFLAGS=$CFLAGS_hold])
kono
parents:
diff changeset
639 MATH_FLAG=
kono
parents:
diff changeset
640 if test "$libgo_cv_c_fancymath" = yes; then
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
641 MATH_FLAG="-mfancy-math-387"
111
kono
parents:
diff changeset
642 fi
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
643 MATH_FLAG="${MATH_FLAG} -ffp-contract=off -fno-math-errno -fno-trapping-math"
111
kono
parents:
diff changeset
644 AC_SUBST(MATH_FLAG)
kono
parents:
diff changeset
645
kono
parents:
diff changeset
646 CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
647 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
kono
parents:
diff changeset
648 AC_CHECK_TYPES([off64_t])
kono
parents:
diff changeset
649 CFLAGS=$CFLAGS_hold
kono
parents:
diff changeset
650
kono
parents:
diff changeset
651 dnl Work out the size of the epoll_events struct on GNU/Linux.
kono
parents:
diff changeset
652 AC_CACHE_CHECK([epoll_event size],
kono
parents:
diff changeset
653 [libgo_cv_c_epoll_event_size],
kono
parents:
diff changeset
654 [AC_COMPUTE_INT(libgo_cv_c_epoll_event_size,
kono
parents:
diff changeset
655 [sizeof (struct epoll_event)],
kono
parents:
diff changeset
656 [#include <sys/epoll.h>],
kono
parents:
diff changeset
657 [libgo_cv_c_epoll_event_size=0])])
kono
parents:
diff changeset
658 SIZEOF_STRUCT_EPOLL_EVENT=${libgo_cv_c_epoll_event_size}
kono
parents:
diff changeset
659 AC_SUBST(SIZEOF_STRUCT_EPOLL_EVENT)
kono
parents:
diff changeset
660
kono
parents:
diff changeset
661 dnl Work out the offset of the fd field in the epoll_events struct on
kono
parents:
diff changeset
662 dnl GNU/Linux.
kono
parents:
diff changeset
663 AC_CACHE_CHECK([epoll_event data.fd offset],
kono
parents:
diff changeset
664 [libgo_cv_c_epoll_event_fd_offset],
kono
parents:
diff changeset
665 [AC_COMPUTE_INT(libgo_cv_c_epoll_event_fd_offset,
kono
parents:
diff changeset
666 [offsetof (struct epoll_event, data.fd)],
kono
parents:
diff changeset
667 [#include <stddef.h>
kono
parents:
diff changeset
668 #include <sys/epoll.h>],
kono
parents:
diff changeset
669 [libgo_cv_c_epoll_event_fd_offset=0])])
kono
parents:
diff changeset
670 STRUCT_EPOLL_EVENT_FD_OFFSET=${libgo_cv_c_epoll_event_fd_offset}
kono
parents:
diff changeset
671 AC_SUBST(STRUCT_EPOLL_EVENT_FD_OFFSET)
kono
parents:
diff changeset
672
kono
parents:
diff changeset
673 dnl Check if <sys/stat.h> uses timespec_t for st_?tim members. Introduced
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
674 dnl in Solaris 11.4 for XPG7 compatibility.
111
kono
parents:
diff changeset
675 AC_EGREP_HEADER([timespec_t.*st_atim], [sys/stat.h],
kono
parents:
diff changeset
676 [have_stat_timespec=yes], [have_stat_timespec=no])
kono
parents:
diff changeset
677 AM_CONDITIONAL(HAVE_STAT_TIMESPEC, test $have_stat_timespec = yes)
kono
parents:
diff changeset
678
kono
parents:
diff changeset
679 dnl See if struct exception is defined in <math.h>.
kono
parents:
diff changeset
680 AC_CHECK_TYPE([struct exception],
kono
parents:
diff changeset
681 [libgo_has_struct_exception=yes],
kono
parents:
diff changeset
682 [libgo_has_struct_exception=no],
kono
parents:
diff changeset
683 [#include <math.h>])
kono
parents:
diff changeset
684 if test "$libgo_has_struct_exception" = "yes"; then
kono
parents:
diff changeset
685 AC_DEFINE(HAVE_STRUCT_EXCEPTION, 1,
kono
parents:
diff changeset
686 [Define to 1 if <math.h> defines struct exception])
kono
parents:
diff changeset
687 fi
kono
parents:
diff changeset
688
kono
parents:
diff changeset
689 dnl See whether setcontext changes the value of TLS variables.
kono
parents:
diff changeset
690 AC_CACHE_CHECK([whether setcontext clobbers TLS variables],
kono
parents:
diff changeset
691 [libgo_cv_lib_setcontext_clobbers_tls],
kono
parents:
diff changeset
692 [CFLAGS_hold="$CFLAGS"
kono
parents:
diff changeset
693 CFLAGS="$PTHREAD_CFLAGS"
kono
parents:
diff changeset
694 LIBS_hold="$LIBS"
kono
parents:
diff changeset
695 LIBS="$LIBS $PTHREAD_LIBS"
kono
parents:
diff changeset
696 AC_CHECK_SIZEOF([void *])
kono
parents:
diff changeset
697 AS_VAR_ARITH([ptr_type_size], [$ac_cv_sizeof_void_p \* 8])
kono
parents:
diff changeset
698 AC_RUN_IFELSE(
kono
parents:
diff changeset
699 [AC_LANG_SOURCE([
kono
parents:
diff changeset
700 #include <pthread.h>
kono
parents:
diff changeset
701 #include <stdlib.h>
kono
parents:
diff changeset
702 #include <ucontext.h>
kono
parents:
diff changeset
703 #include <unistd.h>
kono
parents:
diff changeset
704
kono
parents:
diff changeset
705 __thread int tls;
kono
parents:
diff changeset
706
kono
parents:
diff changeset
707 static char stack[[10 * 1024 * 1024]];
kono
parents:
diff changeset
708 static ucontext_t c;
kono
parents:
diff changeset
709
kono
parents:
diff changeset
710 /* Called via makecontext/setcontext. */
kono
parents:
diff changeset
711
kono
parents:
diff changeset
712 static void
kono
parents:
diff changeset
713 cfn (void)
kono
parents:
diff changeset
714 {
kono
parents:
diff changeset
715 exit (tls);
kono
parents:
diff changeset
716 }
kono
parents:
diff changeset
717
kono
parents:
diff changeset
718 /* Called via pthread_create. */
kono
parents:
diff changeset
719
kono
parents:
diff changeset
720 static void *
kono
parents:
diff changeset
721 tfn (void *dummy)
kono
parents:
diff changeset
722 {
kono
parents:
diff changeset
723 /* The thread should still see this value after calling
kono
parents:
diff changeset
724 setcontext. */
kono
parents:
diff changeset
725 tls = 0;
kono
parents:
diff changeset
726
kono
parents:
diff changeset
727 setcontext (&c);
kono
parents:
diff changeset
728
kono
parents:
diff changeset
729 /* The call to setcontext should not return. */
kono
parents:
diff changeset
730 abort ();
kono
parents:
diff changeset
731 }
kono
parents:
diff changeset
732
kono
parents:
diff changeset
733 int
kono
parents:
diff changeset
734 main ()
kono
parents:
diff changeset
735 {
kono
parents:
diff changeset
736 pthread_t tid;
kono
parents:
diff changeset
737
kono
parents:
diff changeset
738 /* The thread should not see this value. */
kono
parents:
diff changeset
739 tls = 1;
kono
parents:
diff changeset
740
kono
parents:
diff changeset
741 if (getcontext (&c) < 0)
kono
parents:
diff changeset
742 abort ();
kono
parents:
diff changeset
743
kono
parents:
diff changeset
744 c.uc_stack.ss_sp = stack;
kono
parents:
diff changeset
745 #ifdef MAKECONTEXT_STACK_TOP
kono
parents:
diff changeset
746 c.uc_stack.ss_sp += sizeof stack;
kono
parents:
diff changeset
747 #endif
kono
parents:
diff changeset
748 c.uc_stack.ss_flags = 0;
kono
parents:
diff changeset
749 c.uc_stack.ss_size = sizeof stack;
kono
parents:
diff changeset
750 c.uc_link = NULL;
kono
parents:
diff changeset
751 makecontext (&c, cfn, 0);
kono
parents:
diff changeset
752
kono
parents:
diff changeset
753 if (pthread_create (&tid, NULL, tfn, NULL) != 0)
kono
parents:
diff changeset
754 abort ();
kono
parents:
diff changeset
755
kono
parents:
diff changeset
756 if (pthread_join (tid, NULL) != 0)
kono
parents:
diff changeset
757 abort ();
kono
parents:
diff changeset
758
kono
parents:
diff changeset
759 /* The thread should have called exit. */
kono
parents:
diff changeset
760 abort ();
kono
parents:
diff changeset
761 }
kono
parents:
diff changeset
762 ])],
kono
parents:
diff changeset
763 [libgo_cv_lib_setcontext_clobbers_tls=no],
kono
parents:
diff changeset
764 [libgo_cv_lib_setcontext_clobbers_tls=yes],
kono
parents:
diff changeset
765 [case "$target:$ptr_type_size" in
kono
parents:
diff changeset
766 i?86-*-solaris2.1[[01]]:64 | x86_64*-*-solaris2.1[[01]]:64)
kono
parents:
diff changeset
767 libgo_cv_lib_setcontext_clobbers_tls=yes ;;
kono
parents:
diff changeset
768 *)
kono
parents:
diff changeset
769 libgo_cv_lib_setcontext_clobbers_tls=no ;;
kono
parents:
diff changeset
770 esac
kono
parents:
diff changeset
771 ])
kono
parents:
diff changeset
772 CFLAGS="$CFLAGS_hold"
kono
parents:
diff changeset
773 LIBS="$LIBS_hold"
kono
parents:
diff changeset
774 ])
kono
parents:
diff changeset
775 if test "$libgo_cv_lib_setcontext_clobbers_tls" = "yes"; then
kono
parents:
diff changeset
776 AC_DEFINE(SETCONTEXT_CLOBBERS_TLS, 1,
kono
parents:
diff changeset
777 [Define if setcontext clobbers TLS variables])
kono
parents:
diff changeset
778 fi
kono
parents:
diff changeset
779
kono
parents:
diff changeset
780 AC_CACHE_CHECK([whether .eh_frame section should be read-only],
kono
parents:
diff changeset
781 libgo_cv_ro_eh_frame, [
kono
parents:
diff changeset
782 libgo_cv_ro_eh_frame=no
kono
parents:
diff changeset
783 echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
kono
parents:
diff changeset
784 if $CC $CFLAGS -S -fpic -fexceptions -o conftest.s conftest.c > /dev/null 2>&1; then
kono
parents:
diff changeset
785 if grep '.section.*eh_frame.*"a"' conftest.s > /dev/null; then
kono
parents:
diff changeset
786 libgo_cv_ro_eh_frame=yes
kono
parents:
diff changeset
787 elif grep '.section.*eh_frame.*#alloc' conftest.c \
kono
parents:
diff changeset
788 | grep -v '#write' > /dev/null; then
kono
parents:
diff changeset
789 libgo_cv_ro_eh_frame=yes
kono
parents:
diff changeset
790 fi
kono
parents:
diff changeset
791 fi
kono
parents:
diff changeset
792 rm -f conftest.*
kono
parents:
diff changeset
793 ])
kono
parents:
diff changeset
794 if test "x$libgo_cv_ro_eh_frame" = xyes; then
kono
parents:
diff changeset
795 AC_DEFINE(EH_FRAME_FLAGS, "a",
kono
parents:
diff changeset
796 [Define to the flags needed for the .section .eh_frame directive.])
kono
parents:
diff changeset
797 else
kono
parents:
diff changeset
798 AC_DEFINE(EH_FRAME_FLAGS, "aw",
kono
parents:
diff changeset
799 [Define to the flags needed for the .section .eh_frame directive.])
kono
parents:
diff changeset
800 fi
kono
parents:
diff changeset
801
kono
parents:
diff changeset
802 AC_CACHE_CHECK([if compiler supports -Qunused-arguments],
kono
parents:
diff changeset
803 [libgo_cv_c_unused_arguments],
kono
parents:
diff changeset
804 [CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
805 CFLAGS="$CFLAGS -Qunused-arguments"
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
806 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
111
kono
parents:
diff changeset
807 [libgo_cv_c_unused_arguments=yes],
kono
parents:
diff changeset
808 [libgo_cv_c_unused_arguments=no])
kono
parents:
diff changeset
809 CFLAGS=$CFLAGS_hold])
kono
parents:
diff changeset
810
kono
parents:
diff changeset
811 AC_CACHE_CHECK([if assembler supports GNU comdat group syntax],
kono
parents:
diff changeset
812 libgo_cv_as_comdat_gnu, [
kono
parents:
diff changeset
813 echo '.section .text,"axG",@progbits,.foo,comdat' > conftest.s
kono
parents:
diff changeset
814 CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
815 if test "$libgo_cv_c_unused_arguments" = yes; then
kono
parents:
diff changeset
816 CFLAGS="$CFLAGS -Qunused-arguments"
kono
parents:
diff changeset
817 fi
kono
parents:
diff changeset
818 if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then
kono
parents:
diff changeset
819 libgo_cv_as_comdat_gnu=yes
kono
parents:
diff changeset
820 else
kono
parents:
diff changeset
821 libgo_cv_as_comdat_gnu=no
kono
parents:
diff changeset
822 fi
kono
parents:
diff changeset
823 CFLAGS=$CFLAGS_hold
kono
parents:
diff changeset
824 ])
kono
parents:
diff changeset
825 if test "x$libgo_cv_as_comdat_gnu" = xyes; then
kono
parents:
diff changeset
826 AC_DEFINE(HAVE_AS_COMDAT_GAS, 1,
kono
parents:
diff changeset
827 [Define if your assembler supports GNU comdat group syntax.])
kono
parents:
diff changeset
828 fi
kono
parents:
diff changeset
829
kono
parents:
diff changeset
830 AC_CACHE_CHECK([assembler supports pc related relocs],
kono
parents:
diff changeset
831 libgo_cv_as_x86_pcrel, [
kono
parents:
diff changeset
832 libgo_cv_as_x86_pcrel=yes
kono
parents:
diff changeset
833 echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
kono
parents:
diff changeset
834 CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
835 if test "$libgo_cv_c_unused_arguments" = yes; then
kono
parents:
diff changeset
836 CFLAGS="$CFLAGS -Qunused-arguments"
kono
parents:
diff changeset
837 fi
kono
parents:
diff changeset
838 if $CC $CFLAGS -c conftest.s 2>&1 | $EGREP -i 'illegal|warning' > /dev/null; then
kono
parents:
diff changeset
839 libgo_cv_as_x86_pcrel=no
kono
parents:
diff changeset
840 fi
kono
parents:
diff changeset
841 CFLAGS=$CFLAGS_hold
kono
parents:
diff changeset
842 ])
kono
parents:
diff changeset
843 if test "x$libgo_cv_as_x86_pcrel" = xyes; then
kono
parents:
diff changeset
844 AC_DEFINE(HAVE_AS_X86_PCREL, 1,
kono
parents:
diff changeset
845 [Define if your assembler supports PC relative relocs.])
kono
parents:
diff changeset
846 fi
kono
parents:
diff changeset
847
kono
parents:
diff changeset
848 AC_CACHE_CHECK([assembler supports unwind section type],
kono
parents:
diff changeset
849 libgo_cv_as_x86_64_unwind_section_type, [
kono
parents:
diff changeset
850 libgo_cv_as_x86_64_unwind_section_type=yes
kono
parents:
diff changeset
851 echo '.section .eh_frame,"a",@unwind' > conftest.s
kono
parents:
diff changeset
852 CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
853 if test "$libgo_cv_c_unused_arguments" = yes; then
kono
parents:
diff changeset
854 CFLAGS="$CFLAGS -Qunused-arguments"
kono
parents:
diff changeset
855 fi
kono
parents:
diff changeset
856 if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
kono
parents:
diff changeset
857 libgo_cv_as_x86_64_unwind_section_type=no
kono
parents:
diff changeset
858 fi
kono
parents:
diff changeset
859 CFLAGS=$CFLAGS_hold
kono
parents:
diff changeset
860 ])
kono
parents:
diff changeset
861 if test "x$libgo_cv_as_x86_64_unwind_section_type" = xyes; then
kono
parents:
diff changeset
862 AC_DEFINE(HAVE_AS_X86_64_UNWIND_SECTION_TYPE, 1,
kono
parents:
diff changeset
863 [Define if your assembler supports unwind section type.])
kono
parents:
diff changeset
864 fi
kono
parents:
diff changeset
865
kono
parents:
diff changeset
866 AC_CACHE_CHECK([assembler supports AES instructions],
kono
parents:
diff changeset
867 libgo_cv_as_x86_aes, [
kono
parents:
diff changeset
868 libgo_cv_as_x86_aes=yes
kono
parents:
diff changeset
869 echo 'aesenc %xmm0, %xmm1' > conftest.s
kono
parents:
diff changeset
870 CFLAGS_hold=$CFLAGS
kono
parents:
diff changeset
871 if test "$libgo_cv_c_unused_arguments" = yes; then
kono
parents:
diff changeset
872 CFLAGS="$CFLAGS -Qunused-arguments"
kono
parents:
diff changeset
873 fi
kono
parents:
diff changeset
874 if $CC $CFLAGS -c conftest.s 2>&1 | grep -i error > /dev/null; then
kono
parents:
diff changeset
875 libgo_cv_as_x86_aes=no
kono
parents:
diff changeset
876 fi
kono
parents:
diff changeset
877 CFLAGS=$CFLAGS_hold
kono
parents:
diff changeset
878 ])
kono
parents:
diff changeset
879 if test "x$libgo_cv_as_x86_aes" = xyes; then
kono
parents:
diff changeset
880 AC_DEFINE(HAVE_AS_X86_AES, 1,
kono
parents:
diff changeset
881 [Define if your assembler supports AES instructions.])
kono
parents:
diff changeset
882 fi
kono
parents:
diff changeset
883
kono
parents:
diff changeset
884 AC_CACHE_SAVE
kono
parents:
diff changeset
885
kono
parents:
diff changeset
886 if test ${multilib} = yes; then
kono
parents:
diff changeset
887 multilib_arg="--enable-multilib"
kono
parents:
diff changeset
888 else
kono
parents:
diff changeset
889 multilib_arg=
kono
parents:
diff changeset
890 fi
kono
parents:
diff changeset
891
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
892 AC_CONFIG_FILES(Makefile testsuite/Makefile testsuite/libgo-test-support.exp)
111
kono
parents:
diff changeset
893
kono
parents:
diff changeset
894 AC_CONFIG_COMMANDS([default],
kono
parents:
diff changeset
895 [if test -n "$CONFIG_FILES"; then
kono
parents:
diff changeset
896 # Multilibs need MULTISUBDIR defined correctly in certain makefiles so
kono
parents:
diff changeset
897 # that multilib installs will end up installed in the correct place.
kono
parents:
diff changeset
898 # The testsuite needs it for multilib-aware ABI baseline files.
kono
parents:
diff changeset
899 # To work around this not being passed down from config-ml.in ->
kono
parents:
diff changeset
900 # srcdir/Makefile.am -> srcdir/{src,libsupc++,...}/Makefile.am, manually
kono
parents:
diff changeset
901 # append it here. Only modify Makefiles that have just been created.
kono
parents:
diff changeset
902 #
kono
parents:
diff changeset
903 # Also, get rid of this simulated-VPATH thing that automake does.
kono
parents:
diff changeset
904 cat > vpsed << \_EOF
kono
parents:
diff changeset
905 s!`test -f '$<' || echo '$(srcdir)/'`!!
kono
parents:
diff changeset
906 _EOF
kono
parents:
diff changeset
907 for i in $SUBDIRS; do
kono
parents:
diff changeset
908 case $CONFIG_FILES in
kono
parents:
diff changeset
909 *${i}/Makefile*)
kono
parents:
diff changeset
910 #echo "Adding MULTISUBDIR to $i/Makefile"
kono
parents:
diff changeset
911 sed -f vpsed $i/Makefile > tmp
kono
parents:
diff changeset
912 grep '^MULTISUBDIR =' Makefile >> tmp
kono
parents:
diff changeset
913 mv tmp $i/Makefile
kono
parents:
diff changeset
914 ;;
kono
parents:
diff changeset
915 esac
kono
parents:
diff changeset
916 done
kono
parents:
diff changeset
917 rm vpsed
kono
parents:
diff changeset
918 fi
kono
parents:
diff changeset
919 ],
kono
parents:
diff changeset
920 [
kono
parents:
diff changeset
921 # Variables needed in config.status (file generation) which aren't already
kono
parents:
diff changeset
922 # passed by autoconf.
kono
parents:
diff changeset
923 SUBDIRS="$SUBDIRS"
kono
parents:
diff changeset
924 ])
kono
parents:
diff changeset
925
kono
parents:
diff changeset
926 AC_OUTPUT