Fix last line.
[platform/upstream/glibc.git] / sysdeps / x86_64 / configure
1
2 # as_fn_set_status STATUS
3 # -----------------------
4 # Set $? to STATUS, without forking.
5 as_fn_set_status ()
6 {
7   return $1
8 } # as_fn_set_status
9
10 # as_fn_exit STATUS
11 # -----------------
12 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
13 as_fn_exit ()
14 {
15   set +e
16   as_fn_set_status $1
17   exit $1
18 } # as_fn_exit
19 if expr a : '\(a\)' >/dev/null 2>&1 &&
20    test "X`expr 00001 : '.*\(...\)'`" = X001; then
21   as_expr=expr
22 else
23   as_expr=false
24 fi
25
26 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
27   as_basename=basename
28 else
29   as_basename=false
30 fi
31
32 as_me=`$as_basename -- "$0" ||
33 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
34          X"$0" : 'X\(//\)$' \| \
35          X"$0" : 'X\(/\)' \| . 2>/dev/null ||
36 $as_echo X/"$0" |
37     sed '/^.*\/\([^/][^/]*\)\/*$/{
38             s//\1/
39             q
40           }
41           /^X\/\(\/\/\)$/{
42             s//\1/
43             q
44           }
45           /^X\/\(\/\).*/{
46             s//\1/
47             q
48           }
49           s/.*/./; q'`
50
51
52   as_lineno_1=$LINENO as_lineno_1a=$LINENO
53   as_lineno_2=$LINENO as_lineno_2a=$LINENO
54   eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
55   test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
56   # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
57   sed -n '
58     p
59     /[$]LINENO/=
60   ' <$as_myself |
61     sed '
62       s/[$]LINENO.*/&-/
63       t lineno
64       b
65       :lineno
66       N
67       :loop
68       s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
69       t loop
70       s/-\n.*//
71     ' >$as_me.lineno &&
72   chmod +x "$as_me.lineno" ||
73     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
74
75   # Don't try to exec as it changes $[0], causing all sort of problems
76   # (the dirname of $[0] is not the place where we might find the
77   # original and so on.  Autoconf is especially sensitive to this).
78   . "./$as_me.lineno"
79   # Exit status is that of the last command.
80   exit
81 }
82
83
84 # ac_fn_c_try_compile LINENO
85 # --------------------------
86 # Try to compile conftest.$ac_ext, and return whether this succeeded.
87 ac_fn_c_try_compile ()
88 {
89   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
90   rm -f conftest.$ac_objext
91   if { { ac_try="$ac_compile"
92 case "(($ac_try" in
93   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
94   *) ac_try_echo=$ac_try;;
95 esac
96 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
97 $as_echo "$ac_try_echo"; } >&5
98   (eval "$ac_compile") 2>conftest.err
99   ac_status=$?
100   if test -s conftest.err; then
101     grep -v '^ *+' conftest.err >conftest.er1
102     cat conftest.er1 >&5
103     mv -f conftest.er1 conftest.err
104   fi
105   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
106   test $ac_status = 0; } && {
107          test -z "$ac_c_werror_flag" ||
108          test ! -s conftest.err
109        } && test -s conftest.$ac_objext; then :
110   ac_retval=0
111 else
112   $as_echo "$as_me: failed program was:" >&5
113 sed 's/^/| /' conftest.$ac_ext >&5
114
115         ac_retval=1
116 fi
117   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
118   as_fn_set_status $ac_retval
119
120 } # ac_fn_c_try_compile
121
122 # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
123 # -------------------------------------------------------
124 # Tests whether HEADER exists and can be compiled using the include files in
125 # INCLUDES, setting the cache variable VAR accordingly.
126 ac_fn_c_check_header_compile ()
127 {
128   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
129   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
130 $as_echo_n "checking for $2... " >&6; }
131 if eval \${$3+:} false; then :
132   $as_echo_n "(cached) " >&6
133 else
134   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
135 /* end confdefs.h.  */
136 $4
137 #include <$2>
138 _ACEOF
139 if ac_fn_c_try_compile "$LINENO"; then :
140   eval "$3=yes"
141 else
142   eval "$3=no"
143 fi
144 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
145 fi
146 eval ac_res=\$$3
147                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
148 $as_echo "$ac_res" >&6; }
149   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
150
151 } # ac_fn_c_check_header_compile
152 # This file is generated from configure.in by Autoconf.  DO NOT EDIT!
153  # Local configure fragment for sysdeps/x86_64.
154
155
156 ac_fn_c_check_header_compile "$LINENO" "cpuid.h" "ac_cv_header_cpuid_h" "/* No default includes.  */
157 "
158 if test "x$ac_cv_header_cpuid_h" = xyes; then :
159
160 else
161   as_fn_error $? "gcc must provide the <cpuid.h> header" "$LINENO" 5
162 fi
163
164
165
166 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -g produces usable source locations for assembler-with-cpp" >&5
167 $as_echo_n "checking if -g produces usable source locations for assembler-with-cpp... " >&6; }
168 if ${libc_cv_cpp_asm_debuginfo+:} false; then :
169   $as_echo_n "(cached) " >&6
170 else
171   cat > conftest.S <<EOF
172 #include "confdefs.h"
173
174 /* comment on
175    two lines */
176         ${libc_cv_dot_text}
177         ${libc_cv_asm_global_directive} foo
178 foo:
179         /* Unfortunately this test only works for a real instruction,
180            not for any of the machine-independent pseudo-ops.
181            So we just have to assume everybody has a "nop".  */
182         nop
183         /* comment */
184         nop
185         /* comment */
186         nop
187 EOF
188 if { ac_try='${CC-cc} $CPPFLAGS $ASFLAGS -g -c conftest.S 1>&5'
189   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
190   (eval $ac_try) 2>&5
191   ac_status=$?
192   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
193   test $ac_status = 0; }; } && {
194    ac_pattern='conftest\.S'
195    { ac_try='readelf --debug-dump=line conftest.o |
196                    grep $ac_pattern 1>&5'
197   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
198   (eval $ac_try) 2>&5
199   ac_status=$?
200   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
201   test $ac_status = 0; }; }
202   }; then
203   libc_cv_cpp_asm_debuginfo=yes
204 else
205   libc_cv_cpp_asm_debuginfo=no
206 fi
207 rm -f conftest*
208 fi
209 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cpp_asm_debuginfo" >&5
210 $as_echo "$libc_cv_cpp_asm_debuginfo" >&6; }
211 if test $libc_cv_cpp_asm_debuginfo = yes; then
212   $as_echo "#define HAVE_CPP_ASM_DEBUGINFO 1" >>confdefs.h
213
214 fi
215
216 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSE4 support" >&5
217 $as_echo_n "checking for SSE4 support... " >&6; }
218 if ${libc_cv_cc_sse4+:} false; then :
219   $as_echo_n "(cached) " >&6
220 else
221   if { ac_try='${CC-cc} -msse4 -xc /dev/null -S -o /dev/null'
222   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
223   (eval $ac_try) 2>&5
224   ac_status=$?
225   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
226   test $ac_status = 0; }; }; then
227   libc_cv_cc_sse4=yes
228 else
229   libc_cv_cc_sse4=no
230 fi
231 fi
232 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_sse4" >&5
233 $as_echo "$libc_cv_cc_sse4" >&6; }
234 if test $libc_cv_cc_sse4 = yes; then
235   $as_echo "#define HAVE_SSE4_SUPPORT 1" >>confdefs.h
236
237 fi
238
239 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX support" >&5
240 $as_echo_n "checking for AVX support... " >&6; }
241 if ${libc_cv_cc_avx+:} false; then :
242   $as_echo_n "(cached) " >&6
243 else
244   if { ac_try='${CC-cc} -mavx -xc /dev/null -S -o /dev/null'
245   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
246   (eval $ac_try) 2>&5
247   ac_status=$?
248   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
249   test $ac_status = 0; }; }; then
250   libc_cv_cc_avx=yes
251 else
252   libc_cv_cc_avx=no
253 fi
254 fi
255 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_avx" >&5
256 $as_echo "$libc_cv_cc_avx" >&6; }
257 if test $libc_cv_cc_avx = yes; then
258   $as_echo "#define HAVE_AVX_SUPPORT 1" >>confdefs.h
259
260 fi
261
262 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX encoding of SSE instructions" >&5
263 $as_echo_n "checking for AVX encoding of SSE instructions... " >&6; }
264 if ${libc_cv_cc_sse2avx+:} false; then :
265   $as_echo_n "(cached) " >&6
266 else
267   if { ac_try='${CC-cc} -msse2avx -xc /dev/null -S -o /dev/null'
268   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
269   (eval $ac_try) 2>&5
270   ac_status=$?
271   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
272   test $ac_status = 0; }; }; then
273   libc_cv_cc_sse2avx=yes
274 else
275   libc_cv_cc_sse2avx=no
276 fi
277 fi
278 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_sse2avx" >&5
279 $as_echo "$libc_cv_cc_sse2avx" >&6; }
280 if test $libc_cv_cc_sse2avx = yes; then
281   $as_echo "#define HAVE_SSE2AVX_SUPPORT 1" >>confdefs.h
282
283 fi
284
285 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FMA4 support" >&5
286 $as_echo_n "checking for FMA4 support... " >&6; }
287 if ${libc_cv_cc_fma4+:} false; then :
288   $as_echo_n "(cached) " >&6
289 else
290   if { ac_try='${CC-cc} -mfma4 -xc /dev/null -S -o /dev/null'
291   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
292   (eval $ac_try) 2>&5
293   ac_status=$?
294   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
295   test $ac_status = 0; }; }; then
296   libc_cv_cc_fma4=yes
297 else
298   libc_cv_cc_fma4=no
299 fi
300 fi
301 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_fma4" >&5
302 $as_echo "$libc_cv_cc_fma4" >&6; }
303 if test $libc_cv_cc_fma4 = yes; then
304   $as_echo "#define HAVE_FMA4_SUPPORT 1" >>confdefs.h
305
306 fi
307
308 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -mno-vzeroupper support" >&5
309 $as_echo_n "checking for -mno-vzeroupper support... " >&6; }
310 if ${libc_cv_cc_novzeroupper+:} false; then :
311   $as_echo_n "(cached) " >&6
312 else
313   if { ac_try='${CC-cc} -mno-vzeroupper -xc /dev/null -S -o /dev/null'
314   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
315   (eval $ac_try) 2>&5
316   ac_status=$?
317   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
318   test $ac_status = 0; }; }; then
319   libc_cv_cc_novzeroupper=yes
320 else
321   libc_cv_cc_novzeroupper=no
322 fi
323 fi
324 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_novzeroupper" >&5
325 $as_echo "$libc_cv_cc_novzeroupper" >&6; }
326
327 # Check for support of thread-local storage handling in assembler and linker.
328 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for x86-64 TLS support" >&5
329 $as_echo_n "checking for x86-64 TLS support... " >&6; }
330 if ${libc_cv_x86_64_tls+:} false; then :
331   $as_echo_n "(cached) " >&6
332 else
333   cat > conftest.s <<\EOF
334         .section ".tdata", "awT", @progbits
335         .globl foo
336 foo:    .quad   1
337         .section ".tbss", "awT", @nobits
338         .globl bar
339 bar:    .skip   8
340         .text
341 baz:    leaq    bar@TLSLD(%rip), %rdi
342         leaq    bar@DTPOFF(%rax), %rcx
343         addq    foo@GOTTPOFF(%rip), %rax
344         movq    $bar@TPOFF, %rdx
345 EOF
346 if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'
347   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
348   (eval $ac_try) 2>&5
349   ac_status=$?
350   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
351   test $ac_status = 0; }; }; then
352   libc_cv_x86_64_tls=yes
353 else
354   libc_cv_x86_64_tls=no
355 fi
356 rm -f conftest*
357 fi
358 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_x86_64_tls" >&5
359 $as_echo "$libc_cv_x86_64_tls" >&6; }
360 if test $libc_cv_x86_64_tls = no; then
361   as_fn_error $? "the assembler must support TLS" "$LINENO" 5
362 fi
363
364 $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
365
366 # work around problem with autoconf and empty lines at the end of files