1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles.
3# Generated by GNU Autoconf 2.71 for thread 2.8.7.
4#
5#
6# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
7# Inc.
8#
9#
10# This configure script is free software; the Free Software Foundation
11# gives unlimited permission to copy, distribute and modify it.
12## -------------------- ##
13## M4sh Initialization. ##
14## -------------------- ##
15
16# Be more Bourne compatible
17DUALCASE=1; export DUALCASE # for MKS sh
18as_nop=:
19if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
20then :
21  emulate sh
22  NULLCMD=:
23  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
24  # is contrary to our usage.  Disable this feature.
25  alias -g '${1+"$@"}'='"$@"'
26  setopt NO_GLOB_SUBST
27else $as_nop
28  case `(set -o) 2>/dev/null` in #(
29  *posix*) :
30    set -o posix ;; #(
31  *) :
32     ;;
33esac
34fi
35
36
37
38# Reset variables that may have inherited troublesome values from
39# the environment.
40
41# IFS needs to be set, to space, tab, and newline, in precisely that order.
42# (If _AS_PATH_WALK were called with IFS unset, it would have the
43# side effect of setting IFS to empty, thus disabling word splitting.)
44# Quoting is to prevent editors from complaining about space-tab.
45as_nl='
46'
47export as_nl
48IFS=" ""	$as_nl"
49
50PS1='$ '
51PS2='> '
52PS4='+ '
53
54# Ensure predictable behavior from utilities with locale-dependent output.
55LC_ALL=C
56export LC_ALL
57LANGUAGE=C
58export LANGUAGE
59
60# We cannot yet rely on "unset" to work, but we need these variables
61# to be unset--not just set to an empty or harmless value--now, to
62# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh).  This construct
63# also avoids known problems related to "unset" and subshell syntax
64# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
65for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
66do eval test \${$as_var+y} \
67  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
68done
69
70# Ensure that fds 0, 1, and 2 are open.
71if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi
72if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
73if (exec 3>&2)            ; then :; else exec 2>/dev/null; fi
74
75# The user is always right.
76if ${PATH_SEPARATOR+false} :; then
77  PATH_SEPARATOR=:
78  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
79    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
80      PATH_SEPARATOR=';'
81  }
82fi
83
84
85# Find who we are.  Look in the path if we contain no directory separator.
86as_myself=
87case $0 in #((
88  *[\\/]* ) as_myself=$0 ;;
89  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
90for as_dir in $PATH
91do
92  IFS=$as_save_IFS
93  case $as_dir in #(((
94    '') as_dir=./ ;;
95    */) ;;
96    *) as_dir=$as_dir/ ;;
97  esac
98    test -r "$as_dir$0" && as_myself=$as_dir$0 && break
99  done
100IFS=$as_save_IFS
101
102     ;;
103esac
104# We did not find ourselves, most probably we were run as `sh COMMAND'
105# in which case we are not to be found in the path.
106if test "x$as_myself" = x; then
107  as_myself=$0
108fi
109if test ! -f "$as_myself"; then
110  printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
111  exit 1
112fi
113
114
115# Use a proper internal environment variable to ensure we don't fall
116  # into an infinite loop, continuously re-executing ourselves.
117  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
118    _as_can_reexec=no; export _as_can_reexec;
119    # We cannot yet assume a decent shell, so we have to provide a
120# neutralization value for shells without unset; and this also
121# works around shells that cannot unset nonexistent variables.
122# Preserve -v and -x to the replacement shell.
123BASH_ENV=/dev/null
124ENV=/dev/null
125(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
126case $- in # ((((
127  *v*x* | *x*v* ) as_opts=-vx ;;
128  *v* ) as_opts=-v ;;
129  *x* ) as_opts=-x ;;
130  * ) as_opts= ;;
131esac
132exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
133# Admittedly, this is quite paranoid, since all the known shells bail
134# out after a failed `exec'.
135printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
136exit 255
137  fi
138  # We don't want this to propagate to other subprocesses.
139          { _as_can_reexec=; unset _as_can_reexec;}
140if test "x$CONFIG_SHELL" = x; then
141  as_bourne_compatible="as_nop=:
142if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
143then :
144  emulate sh
145  NULLCMD=:
146  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
147  # is contrary to our usage.  Disable this feature.
148  alias -g '\${1+\"\$@\"}'='\"\$@\"'
149  setopt NO_GLOB_SUBST
150else \$as_nop
151  case \`(set -o) 2>/dev/null\` in #(
152  *posix*) :
153    set -o posix ;; #(
154  *) :
155     ;;
156esac
157fi
158"
159  as_required="as_fn_return () { (exit \$1); }
160as_fn_success () { as_fn_return 0; }
161as_fn_failure () { as_fn_return 1; }
162as_fn_ret_success () { return 0; }
163as_fn_ret_failure () { return 1; }
164
165exitcode=0
166as_fn_success || { exitcode=1; echo as_fn_success failed.; }
167as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
168as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
169as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
170if ( set x; as_fn_ret_success y && test x = \"\$1\" )
171then :
172
173else \$as_nop
174  exitcode=1; echo positional parameters were not saved.
175fi
176test x\$exitcode = x0 || exit 1
177blah=\$(echo \$(echo blah))
178test x\"\$blah\" = xblah || exit 1
179test -x / || exit 1"
180  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
181  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
182  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
183  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
184test \$(( 1 + 1 )) = 2 || exit 1"
185  if (eval "$as_required") 2>/dev/null
186then :
187  as_have_required=yes
188else $as_nop
189  as_have_required=no
190fi
191  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null
192then :
193
194else $as_nop
195  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
196as_found=false
197for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
198do
199  IFS=$as_save_IFS
200  case $as_dir in #(((
201    '') as_dir=./ ;;
202    */) ;;
203    *) as_dir=$as_dir/ ;;
204  esac
205  as_found=:
206  case $as_dir in #(
207	 /*)
208	   for as_base in sh bash ksh sh5; do
209	     # Try only shells that exist, to save several forks.
210	     as_shell=$as_dir$as_base
211	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
212		    as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null
213then :
214  CONFIG_SHELL=$as_shell as_have_required=yes
215		   if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null
216then :
217  break 2
218fi
219fi
220	   done;;
221       esac
222  as_found=false
223done
224IFS=$as_save_IFS
225if $as_found
226then :
227
228else $as_nop
229  if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
230	      as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null
231then :
232  CONFIG_SHELL=$SHELL as_have_required=yes
233fi
234fi
235
236
237      if test "x$CONFIG_SHELL" != x
238then :
239  export CONFIG_SHELL
240             # We cannot yet assume a decent shell, so we have to provide a
241# neutralization value for shells without unset; and this also
242# works around shells that cannot unset nonexistent variables.
243# Preserve -v and -x to the replacement shell.
244BASH_ENV=/dev/null
245ENV=/dev/null
246(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
247case $- in # ((((
248  *v*x* | *x*v* ) as_opts=-vx ;;
249  *v* ) as_opts=-v ;;
250  *x* ) as_opts=-x ;;
251  * ) as_opts= ;;
252esac
253exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
254# Admittedly, this is quite paranoid, since all the known shells bail
255# out after a failed `exec'.
256printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
257exit 255
258fi
259
260    if test x$as_have_required = xno
261then :
262  printf "%s\n" "$0: This script requires a shell more modern than all"
263  printf "%s\n" "$0: the shells that I found on your system."
264  if test ${ZSH_VERSION+y} ; then
265    printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should"
266    printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later."
267  else
268    printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system,
269$0: including any error possibly output before this
270$0: message. Then install a modern shell, or manually run
271$0: the script under such a shell if you do have one."
272  fi
273  exit 1
274fi
275fi
276fi
277SHELL=${CONFIG_SHELL-/bin/sh}
278export SHELL
279# Unset more variables known to interfere with behavior of common tools.
280CLICOLOR_FORCE= GREP_OPTIONS=
281unset CLICOLOR_FORCE GREP_OPTIONS
282
283## --------------------- ##
284## M4sh Shell Functions. ##
285## --------------------- ##
286# as_fn_unset VAR
287# ---------------
288# Portably unset VAR.
289as_fn_unset ()
290{
291  { eval $1=; unset $1;}
292}
293as_unset=as_fn_unset
294
295
296# as_fn_set_status STATUS
297# -----------------------
298# Set $? to STATUS, without forking.
299as_fn_set_status ()
300{
301  return $1
302} # as_fn_set_status
303
304# as_fn_exit STATUS
305# -----------------
306# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
307as_fn_exit ()
308{
309  set +e
310  as_fn_set_status $1
311  exit $1
312} # as_fn_exit
313# as_fn_nop
314# ---------
315# Do nothing but, unlike ":", preserve the value of $?.
316as_fn_nop ()
317{
318  return $?
319}
320as_nop=as_fn_nop
321
322# as_fn_mkdir_p
323# -------------
324# Create "$as_dir" as a directory, including parents if necessary.
325as_fn_mkdir_p ()
326{
327
328  case $as_dir in #(
329  -*) as_dir=./$as_dir;;
330  esac
331  test -d "$as_dir" || eval $as_mkdir_p || {
332    as_dirs=
333    while :; do
334      case $as_dir in #(
335      *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
336      *) as_qdir=$as_dir;;
337      esac
338      as_dirs="'$as_qdir' $as_dirs"
339      as_dir=`$as_dirname -- "$as_dir" ||
340$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
341	 X"$as_dir" : 'X\(//\)[^/]' \| \
342	 X"$as_dir" : 'X\(//\)$' \| \
343	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
344printf "%s\n" X"$as_dir" |
345    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
346	    s//\1/
347	    q
348	  }
349	  /^X\(\/\/\)[^/].*/{
350	    s//\1/
351	    q
352	  }
353	  /^X\(\/\/\)$/{
354	    s//\1/
355	    q
356	  }
357	  /^X\(\/\).*/{
358	    s//\1/
359	    q
360	  }
361	  s/.*/./; q'`
362      test -d "$as_dir" && break
363    done
364    test -z "$as_dirs" || eval "mkdir $as_dirs"
365  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
366
367
368} # as_fn_mkdir_p
369
370# as_fn_executable_p FILE
371# -----------------------
372# Test if FILE is an executable regular file.
373as_fn_executable_p ()
374{
375  test -f "$1" && test -x "$1"
376} # as_fn_executable_p
377# as_fn_append VAR VALUE
378# ----------------------
379# Append the text in VALUE to the end of the definition contained in VAR. Take
380# advantage of any shell optimizations that allow amortized linear growth over
381# repeated appends, instead of the typical quadratic growth present in naive
382# implementations.
383if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
384then :
385  eval 'as_fn_append ()
386  {
387    eval $1+=\$2
388  }'
389else $as_nop
390  as_fn_append ()
391  {
392    eval $1=\$$1\$2
393  }
394fi # as_fn_append
395
396# as_fn_arith ARG...
397# ------------------
398# Perform arithmetic evaluation on the ARGs, and store the result in the
399# global $as_val. Take advantage of shells that can avoid forks. The arguments
400# must be portable across $(()) and expr.
401if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
402then :
403  eval 'as_fn_arith ()
404  {
405    as_val=$(( $* ))
406  }'
407else $as_nop
408  as_fn_arith ()
409  {
410    as_val=`expr "$@" || test $? -eq 1`
411  }
412fi # as_fn_arith
413
414# as_fn_nop
415# ---------
416# Do nothing but, unlike ":", preserve the value of $?.
417as_fn_nop ()
418{
419  return $?
420}
421as_nop=as_fn_nop
422
423# as_fn_error STATUS ERROR [LINENO LOG_FD]
424# ----------------------------------------
425# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
426# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
427# script with STATUS, using 1 if that was 0.
428as_fn_error ()
429{
430  as_status=$1; test $as_status -eq 0 && as_status=1
431  if test "$4"; then
432    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
433    printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
434  fi
435  printf "%s\n" "$as_me: error: $2" >&2
436  as_fn_exit $as_status
437} # as_fn_error
438
439if expr a : '\(a\)' >/dev/null 2>&1 &&
440   test "X`expr 00001 : '.*\(...\)'`" = X001; then
441  as_expr=expr
442else
443  as_expr=false
444fi
445
446if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
447  as_basename=basename
448else
449  as_basename=false
450fi
451
452if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
453  as_dirname=dirname
454else
455  as_dirname=false
456fi
457
458as_me=`$as_basename -- "$0" ||
459$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
460	 X"$0" : 'X\(//\)$' \| \
461	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
462printf "%s\n" X/"$0" |
463    sed '/^.*\/\([^/][^/]*\)\/*$/{
464	    s//\1/
465	    q
466	  }
467	  /^X\/\(\/\/\)$/{
468	    s//\1/
469	    q
470	  }
471	  /^X\/\(\/\).*/{
472	    s//\1/
473	    q
474	  }
475	  s/.*/./; q'`
476
477# Avoid depending upon Character Ranges.
478as_cr_letters='abcdefghijklmnopqrstuvwxyz'
479as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
480as_cr_Letters=$as_cr_letters$as_cr_LETTERS
481as_cr_digits='0123456789'
482as_cr_alnum=$as_cr_Letters$as_cr_digits
483
484
485  as_lineno_1=$LINENO as_lineno_1a=$LINENO
486  as_lineno_2=$LINENO as_lineno_2a=$LINENO
487  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
488  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
489  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
490  sed -n '
491    p
492    /[$]LINENO/=
493  ' <$as_myself |
494    sed '
495      s/[$]LINENO.*/&-/
496      t lineno
497      b
498      :lineno
499      N
500      :loop
501      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
502      t loop
503      s/-\n.*//
504    ' >$as_me.lineno &&
505  chmod +x "$as_me.lineno" ||
506    { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
507
508  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
509  # already done that, so ensure we don't try to do so again and fall
510  # in an infinite loop.  This has already happened in practice.
511  _as_can_reexec=no; export _as_can_reexec
512  # Don't try to exec as it changes $[0], causing all sort of problems
513  # (the dirname of $[0] is not the place where we might find the
514  # original and so on.  Autoconf is especially sensitive to this).
515  . "./$as_me.lineno"
516  # Exit status is that of the last command.
517  exit
518}
519
520
521# Determine whether it's possible to make 'echo' print without a newline.
522# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
523# for compatibility with existing Makefiles.
524ECHO_C= ECHO_N= ECHO_T=
525case `echo -n x` in #(((((
526-n*)
527  case `echo 'xy\c'` in
528  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
529  xy)  ECHO_C='\c';;
530  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
531       ECHO_T='	';;
532  esac;;
533*)
534  ECHO_N='-n';;
535esac
536
537# For backward compatibility with old third-party macros, we provide
538# the shell variables $as_echo and $as_echo_n.  New code should use
539# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
540as_echo='printf %s\n'
541as_echo_n='printf %s'
542
543
544rm -f conf$$ conf$$.exe conf$$.file
545if test -d conf$$.dir; then
546  rm -f conf$$.dir/conf$$.file
547else
548  rm -f conf$$.dir
549  mkdir conf$$.dir 2>/dev/null
550fi
551if (echo >conf$$.file) 2>/dev/null; then
552  if ln -s conf$$.file conf$$ 2>/dev/null; then
553    as_ln_s='ln -s'
554    # ... but there are two gotchas:
555    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
556    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
557    # In both cases, we have to default to `cp -pR'.
558    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
559      as_ln_s='cp -pR'
560  elif ln conf$$.file conf$$ 2>/dev/null; then
561    as_ln_s=ln
562  else
563    as_ln_s='cp -pR'
564  fi
565else
566  as_ln_s='cp -pR'
567fi
568rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
569rmdir conf$$.dir 2>/dev/null
570
571if mkdir -p . 2>/dev/null; then
572  as_mkdir_p='mkdir -p "$as_dir"'
573else
574  test -d ./-p && rmdir ./-p
575  as_mkdir_p=false
576fi
577
578as_test_x='test -x'
579as_executable_p=as_fn_executable_p
580
581# Sed expression to map a string onto a valid CPP name.
582as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
583
584# Sed expression to map a string onto a valid variable name.
585as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
586
587
588test -n "$DJDIR" || exec 7<&0 </dev/null
589exec 6>&1
590
591# Name of the host.
592# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
593# so uname gets run too.
594ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
595
596#
597# Initializations.
598#
599ac_default_prefix=/usr/local
600ac_clean_files=
601ac_config_libobj_dir=.
602LIBOBJS=
603cross_compiling=no
604subdirs=
605MFLAGS=
606MAKEFLAGS=
607
608# Identity of this package.
609PACKAGE_NAME='thread'
610PACKAGE_TARNAME='thread'
611PACKAGE_VERSION='2.8.7'
612PACKAGE_STRING='thread 2.8.7'
613PACKAGE_BUGREPORT=''
614PACKAGE_URL=''
615
616# Factoring default headers for most tests.
617ac_includes_default="\
618#include <stddef.h>
619#ifdef HAVE_STDIO_H
620# include <stdio.h>
621#endif
622#ifdef HAVE_STDLIB_H
623# include <stdlib.h>
624#endif
625#ifdef HAVE_STRING_H
626# include <string.h>
627#endif
628#ifdef HAVE_INTTYPES_H
629# include <inttypes.h>
630#endif
631#ifdef HAVE_STDINT_H
632# include <stdint.h>
633#endif
634#ifdef HAVE_STRINGS_H
635# include <strings.h>
636#endif
637#ifdef HAVE_SYS_TYPES_H
638# include <sys/types.h>
639#endif
640#ifdef HAVE_SYS_STAT_H
641# include <sys/stat.h>
642#endif
643#ifdef HAVE_UNISTD_H
644# include <unistd.h>
645#endif"
646
647ac_header_c_list=
648ac_subst_vars='LTLIBOBJS
649TCLSH_PROG
650VC_MANIFEST_EMBED_EXE
651VC_MANIFEST_EMBED_DLL
652RANLIB_STUB
653MAKE_STUB_LIB
654MAKE_STATIC_LIB
655MAKE_SHARED_LIB
656MAKE_LIB
657EGREP
658GREP
659LDFLAGS_DEFAULT
660CFLAGS_DEFAULT
661LD_LIBRARY_PATH_VAR
662SHLIB_CFLAGS
663SHLIB_LD_LIBS
664SHLIB_LD
665STLIB_LD
666LDFLAGS_OPTIMIZE
667LDFLAGS_DEBUG
668CFLAGS_WARNING
669CFLAGS_OPTIMIZE
670CFLAGS_DEBUG
671LIBOBJS
672RC
673AR
674STUBS_BUILD
675SHARED_BUILD
676TCL_THREADS
677TCL_INCLUDES
678INSTALL_FLAGS
679CCLD
680PKG_OBJECTS
681PKG_SOURCES
682HAVE_CXX17
683HAVE_CXX14
684HAVE_CXX11
685RANLIB
686SET_MAKE
687CPP
688ac_ct_CXX
689CXXFLAGS
690CXX
691TCL_SHLIB_LD_LIBS
692TCL_LD_FLAGS
693TCL_EXTRA_CFLAGS
694TCL_DEFS
695TCL_LIBS
696CLEANFILES
697OBJEXT
698ac_ct_CC
699CPPFLAGS
700LDFLAGS
701CFLAGS
702CC
703TCL_STUB_LIB_SPEC
704TCL_STUB_LIB_FLAG
705TCL_STUB_LIB_FILE
706TCL_LIB_SPEC
707TCL_LIB_FLAG
708TCL_LIB_FILE
709TCL_SRC_DIR
710TCL_BIN_DIR
711TCL_PATCH_LEVEL
712TCL_VERSION
713INSTALL_LIBRARY
714INSTALL_SCRIPT
715INSTALL_PROGRAM
716INSTALL_DATA
717INSTALL_DATA_DIR
718INSTALL
719SWIG_WRAP
720PKG_CFLAGS
721PKG_LIBS
722PKG_INCLUDES
723PKG_HEADERS
724PKG_TCL_SOURCES
725PKG_STUB_OBJECTS
726PKG_STUB_SOURCES
727PKG_STUB_LIB_FILE
728PKG_LIB_FILE9
729PKG_LIB_FILE8
730PKG_LIB_FILE
731EXEEXT
732CYGPATH
733target_alias
734host_alias
735build_alias
736LIBS
737ECHO_T
738ECHO_N
739ECHO_C
740DEFS
741mandir
742localedir
743libdir
744psdir
745pdfdir
746dvidir
747htmldir
748infodir
749docdir
750oldincludedir
751includedir
752runstatedir
753localstatedir
754sharedstatedir
755sysconfdir
756datadir
757datarootdir
758libexecdir
759sbindir
760bindir
761program_transform_name
762prefix
763exec_prefix
764PACKAGE_URL
765PACKAGE_BUGREPORT
766PACKAGE_STRING
767PACKAGE_VERSION
768PACKAGE_TARNAME
769PACKAGE_NAME
770PATH_SEPARATOR
771SHELL'
772ac_subst_files=''
773ac_user_opts='
774enable_option_checking
775with_tcl
776with_gdbm
777with_lmdb
778with_naviserver
779with_tclinclude
780enable_threads
781enable_shared
782enable_stubs
783enable_64bit
784enable_64bit_vis
785enable_rpath
786enable_symbols
787'
788      ac_precious_vars='build_alias
789host_alias
790target_alias
791CC
792CFLAGS
793LDFLAGS
794LIBS
795CPPFLAGS
796CXX
797CXXFLAGS
798CCC
799CPP'
800
801
802# Initialize some variables set by options.
803ac_init_help=
804ac_init_version=false
805ac_unrecognized_opts=
806ac_unrecognized_sep=
807# The variables have the same names as the options, with
808# dashes changed to underlines.
809cache_file=/dev/null
810exec_prefix=NONE
811no_create=
812no_recursion=
813prefix=NONE
814program_prefix=NONE
815program_suffix=NONE
816program_transform_name=s,x,x,
817silent=
818site=
819srcdir=
820verbose=
821x_includes=NONE
822x_libraries=NONE
823
824# Installation directory options.
825# These are left unexpanded so users can "make install exec_prefix=/foo"
826# and all the variables that are supposed to be based on exec_prefix
827# by default will actually change.
828# Use braces instead of parens because sh, perl, etc. also accept them.
829# (The list follows the same order as the GNU Coding Standards.)
830bindir='${exec_prefix}/bin'
831sbindir='${exec_prefix}/sbin'
832libexecdir='${exec_prefix}/libexec'
833datarootdir='${prefix}/share'
834datadir='${datarootdir}'
835sysconfdir='${prefix}/etc'
836sharedstatedir='${prefix}/com'
837localstatedir='${prefix}/var'
838runstatedir='${localstatedir}/run'
839includedir='${prefix}/include'
840oldincludedir='/usr/include'
841docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
842infodir='${datarootdir}/info'
843htmldir='${docdir}'
844dvidir='${docdir}'
845pdfdir='${docdir}'
846psdir='${docdir}'
847libdir='${exec_prefix}/lib'
848localedir='${datarootdir}/locale'
849mandir='${datarootdir}/man'
850
851ac_prev=
852ac_dashdash=
853for ac_option
854do
855  # If the previous option needs an argument, assign it.
856  if test -n "$ac_prev"; then
857    eval $ac_prev=\$ac_option
858    ac_prev=
859    continue
860  fi
861
862  case $ac_option in
863  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
864  *=)   ac_optarg= ;;
865  *)    ac_optarg=yes ;;
866  esac
867
868  case $ac_dashdash$ac_option in
869  --)
870    ac_dashdash=yes ;;
871
872  -bindir | --bindir | --bindi | --bind | --bin | --bi)
873    ac_prev=bindir ;;
874  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
875    bindir=$ac_optarg ;;
876
877  -build | --build | --buil | --bui | --bu)
878    ac_prev=build_alias ;;
879  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
880    build_alias=$ac_optarg ;;
881
882  -cache-file | --cache-file | --cache-fil | --cache-fi \
883  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
884    ac_prev=cache_file ;;
885  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
886  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
887    cache_file=$ac_optarg ;;
888
889  --config-cache | -C)
890    cache_file=config.cache ;;
891
892  -datadir | --datadir | --datadi | --datad)
893    ac_prev=datadir ;;
894  -datadir=* | --datadir=* | --datadi=* | --datad=*)
895    datadir=$ac_optarg ;;
896
897  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
898  | --dataroo | --dataro | --datar)
899    ac_prev=datarootdir ;;
900  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
901  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
902    datarootdir=$ac_optarg ;;
903
904  -disable-* | --disable-*)
905    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
906    # Reject names that are not valid shell variable names.
907    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
908      as_fn_error $? "invalid feature name: \`$ac_useropt'"
909    ac_useropt_orig=$ac_useropt
910    ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
911    case $ac_user_opts in
912      *"
913"enable_$ac_useropt"
914"*) ;;
915      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
916	 ac_unrecognized_sep=', ';;
917    esac
918    eval enable_$ac_useropt=no ;;
919
920  -docdir | --docdir | --docdi | --doc | --do)
921    ac_prev=docdir ;;
922  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
923    docdir=$ac_optarg ;;
924
925  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
926    ac_prev=dvidir ;;
927  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
928    dvidir=$ac_optarg ;;
929
930  -enable-* | --enable-*)
931    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
932    # Reject names that are not valid shell variable names.
933    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
934      as_fn_error $? "invalid feature name: \`$ac_useropt'"
935    ac_useropt_orig=$ac_useropt
936    ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
937    case $ac_user_opts in
938      *"
939"enable_$ac_useropt"
940"*) ;;
941      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
942	 ac_unrecognized_sep=', ';;
943    esac
944    eval enable_$ac_useropt=\$ac_optarg ;;
945
946  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
947  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
948  | --exec | --exe | --ex)
949    ac_prev=exec_prefix ;;
950  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
951  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
952  | --exec=* | --exe=* | --ex=*)
953    exec_prefix=$ac_optarg ;;
954
955  -gas | --gas | --ga | --g)
956    # Obsolete; use --with-gas.
957    with_gas=yes ;;
958
959  -help | --help | --hel | --he | -h)
960    ac_init_help=long ;;
961  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
962    ac_init_help=recursive ;;
963  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
964    ac_init_help=short ;;
965
966  -host | --host | --hos | --ho)
967    ac_prev=host_alias ;;
968  -host=* | --host=* | --hos=* | --ho=*)
969    host_alias=$ac_optarg ;;
970
971  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
972    ac_prev=htmldir ;;
973  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
974  | --ht=*)
975    htmldir=$ac_optarg ;;
976
977  -includedir | --includedir | --includedi | --included | --include \
978  | --includ | --inclu | --incl | --inc)
979    ac_prev=includedir ;;
980  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
981  | --includ=* | --inclu=* | --incl=* | --inc=*)
982    includedir=$ac_optarg ;;
983
984  -infodir | --infodir | --infodi | --infod | --info | --inf)
985    ac_prev=infodir ;;
986  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
987    infodir=$ac_optarg ;;
988
989  -libdir | --libdir | --libdi | --libd)
990    ac_prev=libdir ;;
991  -libdir=* | --libdir=* | --libdi=* | --libd=*)
992    libdir=$ac_optarg ;;
993
994  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
995  | --libexe | --libex | --libe)
996    ac_prev=libexecdir ;;
997  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
998  | --libexe=* | --libex=* | --libe=*)
999    libexecdir=$ac_optarg ;;
1000
1001  -localedir | --localedir | --localedi | --localed | --locale)
1002    ac_prev=localedir ;;
1003  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
1004    localedir=$ac_optarg ;;
1005
1006  -localstatedir | --localstatedir | --localstatedi | --localstated \
1007  | --localstate | --localstat | --localsta | --localst | --locals)
1008    ac_prev=localstatedir ;;
1009  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
1010  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
1011    localstatedir=$ac_optarg ;;
1012
1013  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
1014    ac_prev=mandir ;;
1015  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
1016    mandir=$ac_optarg ;;
1017
1018  -nfp | --nfp | --nf)
1019    # Obsolete; use --without-fp.
1020    with_fp=no ;;
1021
1022  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1023  | --no-cr | --no-c | -n)
1024    no_create=yes ;;
1025
1026  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1027  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
1028    no_recursion=yes ;;
1029
1030  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
1031  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
1032  | --oldin | --oldi | --old | --ol | --o)
1033    ac_prev=oldincludedir ;;
1034  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
1035  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
1036  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
1037    oldincludedir=$ac_optarg ;;
1038
1039  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1040    ac_prev=prefix ;;
1041  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1042    prefix=$ac_optarg ;;
1043
1044  -program-prefix | --program-prefix | --program-prefi | --program-pref \
1045  | --program-pre | --program-pr | --program-p)
1046    ac_prev=program_prefix ;;
1047  -program-prefix=* | --program-prefix=* | --program-prefi=* \
1048  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
1049    program_prefix=$ac_optarg ;;
1050
1051  -program-suffix | --program-suffix | --program-suffi | --program-suff \
1052  | --program-suf | --program-su | --program-s)
1053    ac_prev=program_suffix ;;
1054  -program-suffix=* | --program-suffix=* | --program-suffi=* \
1055  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
1056    program_suffix=$ac_optarg ;;
1057
1058  -program-transform-name | --program-transform-name \
1059  | --program-transform-nam | --program-transform-na \
1060  | --program-transform-n | --program-transform- \
1061  | --program-transform | --program-transfor \
1062  | --program-transfo | --program-transf \
1063  | --program-trans | --program-tran \
1064  | --progr-tra | --program-tr | --program-t)
1065    ac_prev=program_transform_name ;;
1066  -program-transform-name=* | --program-transform-name=* \
1067  | --program-transform-nam=* | --program-transform-na=* \
1068  | --program-transform-n=* | --program-transform-=* \
1069  | --program-transform=* | --program-transfor=* \
1070  | --program-transfo=* | --program-transf=* \
1071  | --program-trans=* | --program-tran=* \
1072  | --progr-tra=* | --program-tr=* | --program-t=*)
1073    program_transform_name=$ac_optarg ;;
1074
1075  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
1076    ac_prev=pdfdir ;;
1077  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
1078    pdfdir=$ac_optarg ;;
1079
1080  -psdir | --psdir | --psdi | --psd | --ps)
1081    ac_prev=psdir ;;
1082  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
1083    psdir=$ac_optarg ;;
1084
1085  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1086  | -silent | --silent | --silen | --sile | --sil)
1087    silent=yes ;;
1088
1089  -runstatedir | --runstatedir | --runstatedi | --runstated \
1090  | --runstate | --runstat | --runsta | --runst | --runs \
1091  | --run | --ru | --r)
1092    ac_prev=runstatedir ;;
1093  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1094  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1095  | --run=* | --ru=* | --r=*)
1096    runstatedir=$ac_optarg ;;
1097
1098  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1099    ac_prev=sbindir ;;
1100  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
1101  | --sbi=* | --sb=*)
1102    sbindir=$ac_optarg ;;
1103
1104  -sharedstatedir | --sharedstatedir | --sharedstatedi \
1105  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
1106  | --sharedst | --shareds | --shared | --share | --shar \
1107  | --sha | --sh)
1108    ac_prev=sharedstatedir ;;
1109  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
1110  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
1111  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
1112  | --sha=* | --sh=*)
1113    sharedstatedir=$ac_optarg ;;
1114
1115  -site | --site | --sit)
1116    ac_prev=site ;;
1117  -site=* | --site=* | --sit=*)
1118    site=$ac_optarg ;;
1119
1120  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1121    ac_prev=srcdir ;;
1122  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1123    srcdir=$ac_optarg ;;
1124
1125  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
1126  | --syscon | --sysco | --sysc | --sys | --sy)
1127    ac_prev=sysconfdir ;;
1128  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
1129  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
1130    sysconfdir=$ac_optarg ;;
1131
1132  -target | --target | --targe | --targ | --tar | --ta | --t)
1133    ac_prev=target_alias ;;
1134  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
1135    target_alias=$ac_optarg ;;
1136
1137  -v | -verbose | --verbose | --verbos | --verbo | --verb)
1138    verbose=yes ;;
1139
1140  -version | --version | --versio | --versi | --vers | -V)
1141    ac_init_version=: ;;
1142
1143  -with-* | --with-*)
1144    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
1145    # Reject names that are not valid shell variable names.
1146    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1147      as_fn_error $? "invalid package name: \`$ac_useropt'"
1148    ac_useropt_orig=$ac_useropt
1149    ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
1150    case $ac_user_opts in
1151      *"
1152"with_$ac_useropt"
1153"*) ;;
1154      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
1155	 ac_unrecognized_sep=', ';;
1156    esac
1157    eval with_$ac_useropt=\$ac_optarg ;;
1158
1159  -without-* | --without-*)
1160    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
1161    # Reject names that are not valid shell variable names.
1162    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1163      as_fn_error $? "invalid package name: \`$ac_useropt'"
1164    ac_useropt_orig=$ac_useropt
1165    ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
1166    case $ac_user_opts in
1167      *"
1168"with_$ac_useropt"
1169"*) ;;
1170      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
1171	 ac_unrecognized_sep=', ';;
1172    esac
1173    eval with_$ac_useropt=no ;;
1174
1175  --x)
1176    # Obsolete; use --with-x.
1177    with_x=yes ;;
1178
1179  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
1180  | --x-incl | --x-inc | --x-in | --x-i)
1181    ac_prev=x_includes ;;
1182  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
1183  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
1184    x_includes=$ac_optarg ;;
1185
1186  -x-libraries | --x-libraries | --x-librarie | --x-librari \
1187  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
1188    ac_prev=x_libraries ;;
1189  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
1190  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1191    x_libraries=$ac_optarg ;;
1192
1193  -*) as_fn_error $? "unrecognized option: \`$ac_option'
1194Try \`$0 --help' for more information"
1195    ;;
1196
1197  *=*)
1198    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
1199    # Reject names that are not valid shell variable names.
1200    case $ac_envvar in #(
1201      '' | [0-9]* | *[!_$as_cr_alnum]* )
1202      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
1203    esac
1204    eval $ac_envvar=\$ac_optarg
1205    export $ac_envvar ;;
1206
1207  *)
1208    # FIXME: should be removed in autoconf 3.0.
1209    printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2
1210    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
1211      printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2
1212    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
1213    ;;
1214
1215  esac
1216done
1217
1218if test -n "$ac_prev"; then
1219  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
1220  as_fn_error $? "missing argument to $ac_option"
1221fi
1222
1223if test -n "$ac_unrecognized_opts"; then
1224  case $enable_option_checking in
1225    no) ;;
1226    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
1227    *)     printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
1228  esac
1229fi
1230
1231# Check all directory arguments for consistency.
1232for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
1233		datadir sysconfdir sharedstatedir localstatedir includedir \
1234		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1235		libdir localedir mandir runstatedir
1236do
1237  eval ac_val=\$$ac_var
1238  # Remove trailing slashes.
1239  case $ac_val in
1240    */ )
1241      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
1242      eval $ac_var=\$ac_val;;
1243  esac
1244  # Be sure to have absolute directory names.
1245  case $ac_val in
1246    [\\/$]* | ?:[\\/]* )  continue;;
1247    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
1248  esac
1249  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
1250done
1251
1252# There might be people who depend on the old broken behavior: `$host'
1253# used to hold the argument of --host etc.
1254# FIXME: To remove some day.
1255build=$build_alias
1256host=$host_alias
1257target=$target_alias
1258
1259# FIXME: To remove some day.
1260if test "x$host_alias" != x; then
1261  if test "x$build_alias" = x; then
1262    cross_compiling=maybe
1263  elif test "x$build_alias" != "x$host_alias"; then
1264    cross_compiling=yes
1265  fi
1266fi
1267
1268ac_tool_prefix=
1269test -n "$host_alias" && ac_tool_prefix=$host_alias-
1270
1271test "$silent" = yes && exec 6>/dev/null
1272
1273
1274ac_pwd=`pwd` && test -n "$ac_pwd" &&
1275ac_ls_di=`ls -di .` &&
1276ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
1277  as_fn_error $? "working directory cannot be determined"
1278test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
1279  as_fn_error $? "pwd does not report name of working directory"
1280
1281
1282# Find the source files, if location was not specified.
1283if test -z "$srcdir"; then
1284  ac_srcdir_defaulted=yes
1285  # Try the directory containing this script, then the parent directory.
1286  ac_confdir=`$as_dirname -- "$as_myself" ||
1287$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1288	 X"$as_myself" : 'X\(//\)[^/]' \| \
1289	 X"$as_myself" : 'X\(//\)$' \| \
1290	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
1291printf "%s\n" X"$as_myself" |
1292    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1293	    s//\1/
1294	    q
1295	  }
1296	  /^X\(\/\/\)[^/].*/{
1297	    s//\1/
1298	    q
1299	  }
1300	  /^X\(\/\/\)$/{
1301	    s//\1/
1302	    q
1303	  }
1304	  /^X\(\/\).*/{
1305	    s//\1/
1306	    q
1307	  }
1308	  s/.*/./; q'`
1309  srcdir=$ac_confdir
1310  if test ! -r "$srcdir/$ac_unique_file"; then
1311    srcdir=..
1312  fi
1313else
1314  ac_srcdir_defaulted=no
1315fi
1316if test ! -r "$srcdir/$ac_unique_file"; then
1317  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
1318  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
1319fi
1320ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
1321ac_abs_confdir=`(
1322	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
1323	pwd)`
1324# When building in place, set srcdir=.
1325if test "$ac_abs_confdir" = "$ac_pwd"; then
1326  srcdir=.
1327fi
1328# Remove unnecessary trailing slashes from srcdir.
1329# Double slashes in file names in object file debugging info
1330# mess up M-x gdb in Emacs.
1331case $srcdir in
1332*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
1333esac
1334for ac_var in $ac_precious_vars; do
1335  eval ac_env_${ac_var}_set=\${${ac_var}+set}
1336  eval ac_env_${ac_var}_value=\$${ac_var}
1337  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1338  eval ac_cv_env_${ac_var}_value=\$${ac_var}
1339done
1340
1341#
1342# Report the --help message.
1343#
1344if test "$ac_init_help" = "long"; then
1345  # Omit some internal or obsolete options to make the list less imposing.
1346  # This message is too long to be a string in the A/UX 3.1 sh.
1347  cat <<_ACEOF
1348\`configure' configures thread 2.8.7 to adapt to many kinds of systems.
1349
1350Usage: $0 [OPTION]... [VAR=VALUE]...
1351
1352To assign environment variables (e.g., CC, CFLAGS...), specify them as
1353VAR=VALUE.  See below for descriptions of some of the useful variables.
1354
1355Defaults for the options are specified in brackets.
1356
1357Configuration:
1358  -h, --help              display this help and exit
1359      --help=short        display options specific to this package
1360      --help=recursive    display the short help of all the included packages
1361  -V, --version           display version information and exit
1362  -q, --quiet, --silent   do not print \`checking ...' messages
1363      --cache-file=FILE   cache test results in FILE [disabled]
1364  -C, --config-cache      alias for \`--cache-file=config.cache'
1365  -n, --no-create         do not create output files
1366      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
1367
1368Installation directories:
1369  --prefix=PREFIX         install architecture-independent files in PREFIX
1370                          [$ac_default_prefix]
1371  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
1372                          [PREFIX]
1373
1374By default, \`make install' will install all the files in
1375\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
1376an installation prefix other than \`$ac_default_prefix' using \`--prefix',
1377for instance \`--prefix=\$HOME'.
1378
1379For better control, use the options below.
1380
1381Fine tuning of the installation directories:
1382  --bindir=DIR            user executables [EPREFIX/bin]
1383  --sbindir=DIR           system admin executables [EPREFIX/sbin]
1384  --libexecdir=DIR        program executables [EPREFIX/libexec]
1385  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
1386  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
1387  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
1388  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
1389  --libdir=DIR            object code libraries [EPREFIX/lib]
1390  --includedir=DIR        C header files [PREFIX/include]
1391  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
1392  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
1393  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
1394  --infodir=DIR           info documentation [DATAROOTDIR/info]
1395  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
1396  --mandir=DIR            man documentation [DATAROOTDIR/man]
1397  --docdir=DIR            documentation root [DATAROOTDIR/doc/thread]
1398  --htmldir=DIR           html documentation [DOCDIR]
1399  --dvidir=DIR            dvi documentation [DOCDIR]
1400  --pdfdir=DIR            pdf documentation [DOCDIR]
1401  --psdir=DIR             ps documentation [DOCDIR]
1402_ACEOF
1403
1404  cat <<\_ACEOF
1405_ACEOF
1406fi
1407
1408if test -n "$ac_init_help"; then
1409  case $ac_init_help in
1410     short | recursive ) echo "Configuration of thread 2.8.7:";;
1411   esac
1412  cat <<\_ACEOF
1413
1414Optional Features:
1415  --disable-option-checking  ignore unrecognized --enable/--with options
1416  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
1417  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
1418  --enable-threads        build with threads (default: on)
1419  --enable-shared         build and link with shared libraries (default: on)
1420  --enable-stubs          build and link with stub libraries. Always true for
1421                          shared builds (default: on)
1422  --enable-64bit          enable 64bit support (default: off)
1423  --enable-64bit-vis      enable 64bit Sparc VIS support (default: off)
1424  --disable-rpath         disable rpath support (default: on)
1425  --enable-symbols        build with debugging symbols (default: off)
1426
1427Optional Packages:
1428  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
1429  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
1430  --with-tcl              directory containing tcl configuration
1431                          (tclConfig.sh)
1432  --with-gdbm             link with optional GDBM support
1433  --with-lmdb             link with optional LMDB support
1434  --with-naviserver       directory with NaviServer/AOLserver distribution
1435  --with-tclinclude       directory containing the public Tcl header files
1436
1437Some influential environment variables:
1438  CC          C compiler command
1439  CFLAGS      C compiler flags
1440  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
1441              nonstandard directory <lib dir>
1442  LIBS        libraries to pass to the linker, e.g. -l<library>
1443  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
1444              you have headers in a nonstandard directory <include dir>
1445  CXX         C++ compiler command
1446  CXXFLAGS    C++ compiler flags
1447  CPP         C preprocessor
1448
1449Use these variables to override the choices made by `configure' or to help
1450it to find libraries and programs with nonstandard names/locations.
1451
1452Report bugs to the package provider.
1453_ACEOF
1454ac_status=$?
1455fi
1456
1457if test "$ac_init_help" = "recursive"; then
1458  # If there are subdirs, report their specific --help.
1459  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1460    test -d "$ac_dir" ||
1461      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
1462      continue
1463    ac_builddir=.
1464
1465case "$ac_dir" in
1466.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
1467*)
1468  ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
1469  # A ".." for each directory in $ac_dir_suffix.
1470  ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
1471  case $ac_top_builddir_sub in
1472  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
1473  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
1474  esac ;;
1475esac
1476ac_abs_top_builddir=$ac_pwd
1477ac_abs_builddir=$ac_pwd$ac_dir_suffix
1478# for backward compatibility:
1479ac_top_builddir=$ac_top_build_prefix
1480
1481case $srcdir in
1482  .)  # We are building in place.
1483    ac_srcdir=.
1484    ac_top_srcdir=$ac_top_builddir_sub
1485    ac_abs_top_srcdir=$ac_pwd ;;
1486  [\\/]* | ?:[\\/]* )  # Absolute name.
1487    ac_srcdir=$srcdir$ac_dir_suffix;
1488    ac_top_srcdir=$srcdir
1489    ac_abs_top_srcdir=$srcdir ;;
1490  *) # Relative name.
1491    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
1492    ac_top_srcdir=$ac_top_build_prefix$srcdir
1493    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
1494esac
1495ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
1496
1497    cd "$ac_dir" || { ac_status=$?; continue; }
1498    # Check for configure.gnu first; this name is used for a wrapper for
1499    # Metaconfig's "Configure" on case-insensitive file systems.
1500    if test -f "$ac_srcdir/configure.gnu"; then
1501      echo &&
1502      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1503    elif test -f "$ac_srcdir/configure"; then
1504      echo &&
1505      $SHELL "$ac_srcdir/configure" --help=recursive
1506    else
1507      printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2
1508    fi || ac_status=$?
1509    cd "$ac_pwd" || { ac_status=$?; break; }
1510  done
1511fi
1512
1513test -n "$ac_init_help" && exit $ac_status
1514if $ac_init_version; then
1515  cat <<\_ACEOF
1516thread configure 2.8.7
1517generated by GNU Autoconf 2.71
1518
1519Copyright (C) 2021 Free Software Foundation, Inc.
1520This configure script is free software; the Free Software Foundation
1521gives unlimited permission to copy, distribute and modify it.
1522_ACEOF
1523  exit
1524fi
1525
1526## ------------------------ ##
1527## Autoconf initialization. ##
1528## ------------------------ ##
1529
1530# ac_fn_c_try_compile LINENO
1531# --------------------------
1532# Try to compile conftest.$ac_ext, and return whether this succeeded.
1533ac_fn_c_try_compile ()
1534{
1535  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1536  rm -f conftest.$ac_objext conftest.beam
1537  if { { ac_try="$ac_compile"
1538case "(($ac_try" in
1539  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1540  *) ac_try_echo=$ac_try;;
1541esac
1542eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1543printf "%s\n" "$ac_try_echo"; } >&5
1544  (eval "$ac_compile") 2>conftest.err
1545  ac_status=$?
1546  if test -s conftest.err; then
1547    grep -v '^ *+' conftest.err >conftest.er1
1548    cat conftest.er1 >&5
1549    mv -f conftest.er1 conftest.err
1550  fi
1551  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1552  test $ac_status = 0; } && {
1553	 test -z "$ac_c_werror_flag" ||
1554	 test ! -s conftest.err
1555       } && test -s conftest.$ac_objext
1556then :
1557  ac_retval=0
1558else $as_nop
1559  printf "%s\n" "$as_me: failed program was:" >&5
1560sed 's/^/| /' conftest.$ac_ext >&5
1561
1562	ac_retval=1
1563fi
1564  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1565  as_fn_set_status $ac_retval
1566
1567} # ac_fn_c_try_compile
1568
1569# ac_fn_cxx_try_compile LINENO
1570# ----------------------------
1571# Try to compile conftest.$ac_ext, and return whether this succeeded.
1572ac_fn_cxx_try_compile ()
1573{
1574  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1575  rm -f conftest.$ac_objext conftest.beam
1576  if { { ac_try="$ac_compile"
1577case "(($ac_try" in
1578  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1579  *) ac_try_echo=$ac_try;;
1580esac
1581eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1582printf "%s\n" "$ac_try_echo"; } >&5
1583  (eval "$ac_compile") 2>conftest.err
1584  ac_status=$?
1585  if test -s conftest.err; then
1586    grep -v '^ *+' conftest.err >conftest.er1
1587    cat conftest.er1 >&5
1588    mv -f conftest.er1 conftest.err
1589  fi
1590  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1591  test $ac_status = 0; } && {
1592	 test -z "$ac_cxx_werror_flag" ||
1593	 test ! -s conftest.err
1594       } && test -s conftest.$ac_objext
1595then :
1596  ac_retval=0
1597else $as_nop
1598  printf "%s\n" "$as_me: failed program was:" >&5
1599sed 's/^/| /' conftest.$ac_ext >&5
1600
1601	ac_retval=1
1602fi
1603  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1604  as_fn_set_status $ac_retval
1605
1606} # ac_fn_cxx_try_compile
1607
1608# ac_fn_c_try_cpp LINENO
1609# ----------------------
1610# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
1611ac_fn_c_try_cpp ()
1612{
1613  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1614  if { { ac_try="$ac_cpp conftest.$ac_ext"
1615case "(($ac_try" in
1616  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1617  *) ac_try_echo=$ac_try;;
1618esac
1619eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1620printf "%s\n" "$ac_try_echo"; } >&5
1621  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
1622  ac_status=$?
1623  if test -s conftest.err; then
1624    grep -v '^ *+' conftest.err >conftest.er1
1625    cat conftest.er1 >&5
1626    mv -f conftest.er1 conftest.err
1627  fi
1628  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1629  test $ac_status = 0; } > conftest.i && {
1630	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
1631	 test ! -s conftest.err
1632       }
1633then :
1634  ac_retval=0
1635else $as_nop
1636  printf "%s\n" "$as_me: failed program was:" >&5
1637sed 's/^/| /' conftest.$ac_ext >&5
1638
1639    ac_retval=1
1640fi
1641  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1642  as_fn_set_status $ac_retval
1643
1644} # ac_fn_c_try_cpp
1645
1646# ac_fn_cxx_try_link LINENO
1647# -------------------------
1648# Try to link conftest.$ac_ext, and return whether this succeeded.
1649ac_fn_cxx_try_link ()
1650{
1651  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1652  rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext
1653  if { { ac_try="$ac_link"
1654case "(($ac_try" in
1655  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1656  *) ac_try_echo=$ac_try;;
1657esac
1658eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1659printf "%s\n" "$ac_try_echo"; } >&5
1660  (eval "$ac_link") 2>conftest.err
1661  ac_status=$?
1662  if test -s conftest.err; then
1663    grep -v '^ *+' conftest.err >conftest.er1
1664    cat conftest.er1 >&5
1665    mv -f conftest.er1 conftest.err
1666  fi
1667  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1668  test $ac_status = 0; } && {
1669	 test -z "$ac_cxx_werror_flag" ||
1670	 test ! -s conftest.err
1671       } && test -s conftest$ac_exeext && {
1672	 test "$cross_compiling" = yes ||
1673	 test -x conftest$ac_exeext
1674       }
1675then :
1676  ac_retval=0
1677else $as_nop
1678  printf "%s\n" "$as_me: failed program was:" >&5
1679sed 's/^/| /' conftest.$ac_ext >&5
1680
1681	ac_retval=1
1682fi
1683  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
1684  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
1685  # interfere with the next link command; also delete a directory that is
1686  # left behind by Apple's compiler.  We do this before executing the actions.
1687  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1688  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1689  as_fn_set_status $ac_retval
1690
1691} # ac_fn_cxx_try_link
1692
1693# ac_fn_c_try_run LINENO
1694# ----------------------
1695# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that
1696# executables *can* be run.
1697ac_fn_c_try_run ()
1698{
1699  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1700  if { { ac_try="$ac_link"
1701case "(($ac_try" in
1702  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1703  *) ac_try_echo=$ac_try;;
1704esac
1705eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1706printf "%s\n" "$ac_try_echo"; } >&5
1707  (eval "$ac_link") 2>&5
1708  ac_status=$?
1709  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1710  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
1711  { { case "(($ac_try" in
1712  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1713  *) ac_try_echo=$ac_try;;
1714esac
1715eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1716printf "%s\n" "$ac_try_echo"; } >&5
1717  (eval "$ac_try") 2>&5
1718  ac_status=$?
1719  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1720  test $ac_status = 0; }; }
1721then :
1722  ac_retval=0
1723else $as_nop
1724  printf "%s\n" "$as_me: program exited with status $ac_status" >&5
1725       printf "%s\n" "$as_me: failed program was:" >&5
1726sed 's/^/| /' conftest.$ac_ext >&5
1727
1728       ac_retval=$ac_status
1729fi
1730  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1731  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1732  as_fn_set_status $ac_retval
1733
1734} # ac_fn_c_try_run
1735
1736# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
1737# -------------------------------------------------------
1738# Tests whether HEADER exists and can be compiled using the include files in
1739# INCLUDES, setting the cache variable VAR accordingly.
1740ac_fn_c_check_header_compile ()
1741{
1742  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1743  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1744printf %s "checking for $2... " >&6; }
1745if eval test \${$3+y}
1746then :
1747  printf %s "(cached) " >&6
1748else $as_nop
1749  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1750/* end confdefs.h.  */
1751$4
1752#include <$2>
1753_ACEOF
1754if ac_fn_c_try_compile "$LINENO"
1755then :
1756  eval "$3=yes"
1757else $as_nop
1758  eval "$3=no"
1759fi
1760rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
1761fi
1762eval ac_res=\$$3
1763	       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1764printf "%s\n" "$ac_res" >&6; }
1765  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1766
1767} # ac_fn_c_check_header_compile
1768
1769# ac_fn_c_try_link LINENO
1770# -----------------------
1771# Try to link conftest.$ac_ext, and return whether this succeeded.
1772ac_fn_c_try_link ()
1773{
1774  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1775  rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext
1776  if { { ac_try="$ac_link"
1777case "(($ac_try" in
1778  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1779  *) ac_try_echo=$ac_try;;
1780esac
1781eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1782printf "%s\n" "$ac_try_echo"; } >&5
1783  (eval "$ac_link") 2>conftest.err
1784  ac_status=$?
1785  if test -s conftest.err; then
1786    grep -v '^ *+' conftest.err >conftest.er1
1787    cat conftest.er1 >&5
1788    mv -f conftest.er1 conftest.err
1789  fi
1790  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1791  test $ac_status = 0; } && {
1792	 test -z "$ac_c_werror_flag" ||
1793	 test ! -s conftest.err
1794       } && test -s conftest$ac_exeext && {
1795	 test "$cross_compiling" = yes ||
1796	 test -x conftest$ac_exeext
1797       }
1798then :
1799  ac_retval=0
1800else $as_nop
1801  printf "%s\n" "$as_me: failed program was:" >&5
1802sed 's/^/| /' conftest.$ac_ext >&5
1803
1804	ac_retval=1
1805fi
1806  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
1807  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
1808  # interfere with the next link command; also delete a directory that is
1809  # left behind by Apple's compiler.  We do this before executing the actions.
1810  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1811  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1812  as_fn_set_status $ac_retval
1813
1814} # ac_fn_c_try_link
1815
1816# ac_fn_c_check_func LINENO FUNC VAR
1817# ----------------------------------
1818# Tests whether FUNC exists, setting the cache variable VAR accordingly
1819ac_fn_c_check_func ()
1820{
1821  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1822  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1823printf %s "checking for $2... " >&6; }
1824if eval test \${$3+y}
1825then :
1826  printf %s "(cached) " >&6
1827else $as_nop
1828  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1829/* end confdefs.h.  */
1830/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
1831   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
1832#define $2 innocuous_$2
1833
1834/* System header to define __stub macros and hopefully few prototypes,
1835   which can conflict with char $2 (); below.  */
1836
1837#include <limits.h>
1838#undef $2
1839
1840/* Override any GCC internal prototype to avoid an error.
1841   Use char because int might match the return type of a GCC
1842   builtin and then its argument prototype would still apply.  */
1843#ifdef __cplusplus
1844extern "C"
1845#endif
1846char $2 ();
1847/* The GNU C library defines this for functions which it implements
1848    to always fail with ENOSYS.  Some functions are actually named
1849    something starting with __ and the normal name is an alias.  */
1850#if defined __stub_$2 || defined __stub___$2
1851choke me
1852#endif
1853
1854int
1855main (void)
1856{
1857return $2 ();
1858  ;
1859  return 0;
1860}
1861_ACEOF
1862if ac_fn_c_try_link "$LINENO"
1863then :
1864  eval "$3=yes"
1865else $as_nop
1866  eval "$3=no"
1867fi
1868rm -f core conftest.err conftest.$ac_objext conftest.beam \
1869    conftest$ac_exeext conftest.$ac_ext
1870fi
1871eval ac_res=\$$3
1872	       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1873printf "%s\n" "$ac_res" >&6; }
1874  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1875
1876} # ac_fn_c_check_func
1877ac_configure_args_raw=
1878for ac_arg
1879do
1880  case $ac_arg in
1881  *\'*)
1882    ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
1883  esac
1884  as_fn_append ac_configure_args_raw " '$ac_arg'"
1885done
1886
1887case $ac_configure_args_raw in
1888  *$as_nl*)
1889    ac_safe_unquote= ;;
1890  *)
1891    ac_unsafe_z='|&;<>()$`\\"*?[ ''	' # This string ends in space, tab.
1892    ac_unsafe_a="$ac_unsafe_z#~"
1893    ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g"
1894    ac_configure_args_raw=`      printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;;
1895esac
1896
1897cat >config.log <<_ACEOF
1898This file contains any messages produced by compilers while
1899running configure, to aid debugging if configure makes a mistake.
1900
1901It was created by thread $as_me 2.8.7, which was
1902generated by GNU Autoconf 2.71.  Invocation command line was
1903
1904  $ $0$ac_configure_args_raw
1905
1906_ACEOF
1907exec 5>>config.log
1908{
1909cat <<_ASUNAME
1910## --------- ##
1911## Platform. ##
1912## --------- ##
1913
1914hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1915uname -m = `(uname -m) 2>/dev/null || echo unknown`
1916uname -r = `(uname -r) 2>/dev/null || echo unknown`
1917uname -s = `(uname -s) 2>/dev/null || echo unknown`
1918uname -v = `(uname -v) 2>/dev/null || echo unknown`
1919
1920/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
1921/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
1922
1923/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
1924/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
1925/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
1926/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
1927/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
1928/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
1929/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
1930
1931_ASUNAME
1932
1933as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1934for as_dir in $PATH
1935do
1936  IFS=$as_save_IFS
1937  case $as_dir in #(((
1938    '') as_dir=./ ;;
1939    */) ;;
1940    *) as_dir=$as_dir/ ;;
1941  esac
1942    printf "%s\n" "PATH: $as_dir"
1943  done
1944IFS=$as_save_IFS
1945
1946} >&5
1947
1948cat >&5 <<_ACEOF
1949
1950
1951## ----------- ##
1952## Core tests. ##
1953## ----------- ##
1954
1955_ACEOF
1956
1957
1958# Keep a trace of the command line.
1959# Strip out --no-create and --no-recursion so they do not pile up.
1960# Strip out --silent because we don't want to record it for future runs.
1961# Also quote any args containing shell meta-characters.
1962# Make two passes to allow for proper duplicate-argument suppression.
1963ac_configure_args=
1964ac_configure_args0=
1965ac_configure_args1=
1966ac_must_keep_next=false
1967for ac_pass in 1 2
1968do
1969  for ac_arg
1970  do
1971    case $ac_arg in
1972    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
1973    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1974    | -silent | --silent | --silen | --sile | --sil)
1975      continue ;;
1976    *\'*)
1977      ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
1978    esac
1979    case $ac_pass in
1980    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
1981    2)
1982      as_fn_append ac_configure_args1 " '$ac_arg'"
1983      if test $ac_must_keep_next = true; then
1984	ac_must_keep_next=false # Got value, back to normal.
1985      else
1986	case $ac_arg in
1987	  *=* | --config-cache | -C | -disable-* | --disable-* \
1988	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
1989	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
1990	  | -with-* | --with-* | -without-* | --without-* | --x)
1991	    case "$ac_configure_args0 " in
1992	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
1993	    esac
1994	    ;;
1995	  -* ) ac_must_keep_next=true ;;
1996	esac
1997      fi
1998      as_fn_append ac_configure_args " '$ac_arg'"
1999      ;;
2000    esac
2001  done
2002done
2003{ ac_configure_args0=; unset ac_configure_args0;}
2004{ ac_configure_args1=; unset ac_configure_args1;}
2005
2006# When interrupted or exit'd, cleanup temporary files, and complete
2007# config.log.  We remove comments because anyway the quotes in there
2008# would cause problems or look ugly.
2009# WARNING: Use '\'' to represent an apostrophe within the trap.
2010# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
2011trap 'exit_status=$?
2012  # Sanitize IFS.
2013  IFS=" ""	$as_nl"
2014  # Save into config.log some information that might help in debugging.
2015  {
2016    echo
2017
2018    printf "%s\n" "## ---------------- ##
2019## Cache variables. ##
2020## ---------------- ##"
2021    echo
2022    # The following way of writing the cache mishandles newlines in values,
2023(
2024  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
2025    eval ac_val=\$$ac_var
2026    case $ac_val in #(
2027    *${as_nl}*)
2028      case $ac_var in #(
2029      *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
2030printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
2031      esac
2032      case $ac_var in #(
2033      _ | IFS | as_nl) ;; #(
2034      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
2035      *) { eval $ac_var=; unset $ac_var;} ;;
2036      esac ;;
2037    esac
2038  done
2039  (set) 2>&1 |
2040    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
2041    *${as_nl}ac_space=\ *)
2042      sed -n \
2043	"s/'\''/'\''\\\\'\'''\''/g;
2044	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
2045      ;; #(
2046    *)
2047      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
2048      ;;
2049    esac |
2050    sort
2051)
2052    echo
2053
2054    printf "%s\n" "## ----------------- ##
2055## Output variables. ##
2056## ----------------- ##"
2057    echo
2058    for ac_var in $ac_subst_vars
2059    do
2060      eval ac_val=\$$ac_var
2061      case $ac_val in
2062      *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2063      esac
2064      printf "%s\n" "$ac_var='\''$ac_val'\''"
2065    done | sort
2066    echo
2067
2068    if test -n "$ac_subst_files"; then
2069      printf "%s\n" "## ------------------- ##
2070## File substitutions. ##
2071## ------------------- ##"
2072      echo
2073      for ac_var in $ac_subst_files
2074      do
2075	eval ac_val=\$$ac_var
2076	case $ac_val in
2077	*\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2078	esac
2079	printf "%s\n" "$ac_var='\''$ac_val'\''"
2080      done | sort
2081      echo
2082    fi
2083
2084    if test -s confdefs.h; then
2085      printf "%s\n" "## ----------- ##
2086## confdefs.h. ##
2087## ----------- ##"
2088      echo
2089      cat confdefs.h
2090      echo
2091    fi
2092    test "$ac_signal" != 0 &&
2093      printf "%s\n" "$as_me: caught signal $ac_signal"
2094    printf "%s\n" "$as_me: exit $exit_status"
2095  } >&5
2096  rm -f core *.core core.conftest.* &&
2097    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
2098    exit $exit_status
2099' 0
2100for ac_signal in 1 2 13 15; do
2101  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
2102done
2103ac_signal=0
2104
2105# confdefs.h avoids OS command line length limits that DEFS can exceed.
2106rm -f -r conftest* confdefs.h
2107
2108printf "%s\n" "/* confdefs.h */" > confdefs.h
2109
2110# Predefined preprocessor variables.
2111
2112printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h
2113
2114printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h
2115
2116printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h
2117
2118printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h
2119
2120printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h
2121
2122printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h
2123
2124
2125# Let the site file select an alternate cache file if it wants to.
2126# Prefer an explicitly selected file to automatically selected ones.
2127if test -n "$CONFIG_SITE"; then
2128  ac_site_files="$CONFIG_SITE"
2129elif test "x$prefix" != xNONE; then
2130  ac_site_files="$prefix/share/config.site $prefix/etc/config.site"
2131else
2132  ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
2133fi
2134
2135for ac_site_file in $ac_site_files
2136do
2137  case $ac_site_file in #(
2138  */*) :
2139     ;; #(
2140  *) :
2141    ac_site_file=./$ac_site_file ;;
2142esac
2143  if test -f "$ac_site_file" && test -r "$ac_site_file"; then
2144    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
2145printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;}
2146    sed 's/^/| /' "$ac_site_file" >&5
2147    . "$ac_site_file" \
2148      || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2149printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
2150as_fn_error $? "failed to load site script $ac_site_file
2151See \`config.log' for more details" "$LINENO" 5; }
2152  fi
2153done
2154
2155if test -r "$cache_file"; then
2156  # Some versions of bash will fail to source /dev/null (special files
2157  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
2158  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
2159    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
2160printf "%s\n" "$as_me: loading cache $cache_file" >&6;}
2161    case $cache_file in
2162      [\\/]* | ?:[\\/]* ) . "$cache_file";;
2163      *)                      . "./$cache_file";;
2164    esac
2165  fi
2166else
2167  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
2168printf "%s\n" "$as_me: creating cache $cache_file" >&6;}
2169  >$cache_file
2170fi
2171
2172# Test code for whether the C compiler supports C89 (global declarations)
2173ac_c_conftest_c89_globals='
2174/* Does the compiler advertise C89 conformance?
2175   Do not test the value of __STDC__, because some compilers set it to 0
2176   while being otherwise adequately conformant. */
2177#if !defined __STDC__
2178# error "Compiler does not advertise C89 conformance"
2179#endif
2180
2181#include <stddef.h>
2182#include <stdarg.h>
2183struct stat;
2184/* Most of the following tests are stolen from RCS 5.7 src/conf.sh.  */
2185struct buf { int x; };
2186struct buf * (*rcsopen) (struct buf *, struct stat *, int);
2187static char *e (p, i)
2188     char **p;
2189     int i;
2190{
2191  return p[i];
2192}
2193static char *f (char * (*g) (char **, int), char **p, ...)
2194{
2195  char *s;
2196  va_list v;
2197  va_start (v,p);
2198  s = g (p, va_arg (v,int));
2199  va_end (v);
2200  return s;
2201}
2202
2203/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
2204   function prototypes and stuff, but not \xHH hex character constants.
2205   These do not provoke an error unfortunately, instead are silently treated
2206   as an "x".  The following induces an error, until -std is added to get
2207   proper ANSI mode.  Curiously \x00 != x always comes out true, for an
2208   array size at least.  It is necessary to write \x00 == 0 to get something
2209   that is true only with -std.  */
2210int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1];
2211
2212/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
2213   inside strings and character constants.  */
2214#define FOO(x) '\''x'\''
2215int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1];
2216
2217int test (int i, double x);
2218struct s1 {int (*f) (int a);};
2219struct s2 {int (*f) (double a);};
2220int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int),
2221               int, int);'
2222
2223# Test code for whether the C compiler supports C89 (body of main).
2224ac_c_conftest_c89_main='
2225ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]);
2226'
2227
2228# Test code for whether the C compiler supports C99 (global declarations)
2229ac_c_conftest_c99_globals='
2230// Does the compiler advertise C99 conformance?
2231#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
2232# error "Compiler does not advertise C99 conformance"
2233#endif
2234
2235#include <stdbool.h>
2236extern int puts (const char *);
2237extern int printf (const char *, ...);
2238extern int dprintf (int, const char *, ...);
2239extern void *malloc (size_t);
2240
2241// Check varargs macros.  These examples are taken from C99 6.10.3.5.
2242// dprintf is used instead of fprintf to avoid needing to declare
2243// FILE and stderr.
2244#define debug(...) dprintf (2, __VA_ARGS__)
2245#define showlist(...) puts (#__VA_ARGS__)
2246#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
2247static void
2248test_varargs_macros (void)
2249{
2250  int x = 1234;
2251  int y = 5678;
2252  debug ("Flag");
2253  debug ("X = %d\n", x);
2254  showlist (The first, second, and third items.);
2255  report (x>y, "x is %d but y is %d", x, y);
2256}
2257
2258// Check long long types.
2259#define BIG64 18446744073709551615ull
2260#define BIG32 4294967295ul
2261#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
2262#if !BIG_OK
2263  #error "your preprocessor is broken"
2264#endif
2265#if BIG_OK
2266#else
2267  #error "your preprocessor is broken"
2268#endif
2269static long long int bignum = -9223372036854775807LL;
2270static unsigned long long int ubignum = BIG64;
2271
2272struct incomplete_array
2273{
2274  int datasize;
2275  double data[];
2276};
2277
2278struct named_init {
2279  int number;
2280  const wchar_t *name;
2281  double average;
2282};
2283
2284typedef const char *ccp;
2285
2286static inline int
2287test_restrict (ccp restrict text)
2288{
2289  // See if C++-style comments work.
2290  // Iterate through items via the restricted pointer.
2291  // Also check for declarations in for loops.
2292  for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i)
2293    continue;
2294  return 0;
2295}
2296
2297// Check varargs and va_copy.
2298static bool
2299test_varargs (const char *format, ...)
2300{
2301  va_list args;
2302  va_start (args, format);
2303  va_list args_copy;
2304  va_copy (args_copy, args);
2305
2306  const char *str = "";
2307  int number = 0;
2308  float fnumber = 0;
2309
2310  while (*format)
2311    {
2312      switch (*format++)
2313	{
2314	case '\''s'\'': // string
2315	  str = va_arg (args_copy, const char *);
2316	  break;
2317	case '\''d'\'': // int
2318	  number = va_arg (args_copy, int);
2319	  break;
2320	case '\''f'\'': // float
2321	  fnumber = va_arg (args_copy, double);
2322	  break;
2323	default:
2324	  break;
2325	}
2326    }
2327  va_end (args_copy);
2328  va_end (args);
2329
2330  return *str && number && fnumber;
2331}
2332'
2333
2334# Test code for whether the C compiler supports C99 (body of main).
2335ac_c_conftest_c99_main='
2336  // Check bool.
2337  _Bool success = false;
2338  success |= (argc != 0);
2339
2340  // Check restrict.
2341  if (test_restrict ("String literal") == 0)
2342    success = true;
2343  char *restrict newvar = "Another string";
2344
2345  // Check varargs.
2346  success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234);
2347  test_varargs_macros ();
2348
2349  // Check flexible array members.
2350  struct incomplete_array *ia =
2351    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
2352  ia->datasize = 10;
2353  for (int i = 0; i < ia->datasize; ++i)
2354    ia->data[i] = i * 1.234;
2355
2356  // Check named initializers.
2357  struct named_init ni = {
2358    .number = 34,
2359    .name = L"Test wide string",
2360    .average = 543.34343,
2361  };
2362
2363  ni.number = 58;
2364
2365  int dynamic_array[ni.number];
2366  dynamic_array[0] = argv[0][0];
2367  dynamic_array[ni.number - 1] = 543;
2368
2369  // work around unused variable warnings
2370  ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\''
2371	 || dynamic_array[ni.number - 1] != 543);
2372'
2373
2374# Test code for whether the C compiler supports C11 (global declarations)
2375ac_c_conftest_c11_globals='
2376// Does the compiler advertise C11 conformance?
2377#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L
2378# error "Compiler does not advertise C11 conformance"
2379#endif
2380
2381// Check _Alignas.
2382char _Alignas (double) aligned_as_double;
2383char _Alignas (0) no_special_alignment;
2384extern char aligned_as_int;
2385char _Alignas (0) _Alignas (int) aligned_as_int;
2386
2387// Check _Alignof.
2388enum
2389{
2390  int_alignment = _Alignof (int),
2391  int_array_alignment = _Alignof (int[100]),
2392  char_alignment = _Alignof (char)
2393};
2394_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
2395
2396// Check _Noreturn.
2397int _Noreturn does_not_return (void) { for (;;) continue; }
2398
2399// Check _Static_assert.
2400struct test_static_assert
2401{
2402  int x;
2403  _Static_assert (sizeof (int) <= sizeof (long int),
2404                  "_Static_assert does not work in struct");
2405  long int y;
2406};
2407
2408// Check UTF-8 literals.
2409#define u8 syntax error!
2410char const utf8_literal[] = u8"happens to be ASCII" "another string";
2411
2412// Check duplicate typedefs.
2413typedef long *long_ptr;
2414typedef long int *long_ptr;
2415typedef long_ptr long_ptr;
2416
2417// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
2418struct anonymous
2419{
2420  union {
2421    struct { int i; int j; };
2422    struct { int k; long int l; } w;
2423  };
2424  int m;
2425} v1;
2426'
2427
2428# Test code for whether the C compiler supports C11 (body of main).
2429ac_c_conftest_c11_main='
2430  _Static_assert ((offsetof (struct anonymous, i)
2431		   == offsetof (struct anonymous, w.k)),
2432		  "Anonymous union alignment botch");
2433  v1.i = 2;
2434  v1.w.k = 5;
2435  ok |= v1.i != 5;
2436'
2437
2438# Test code for whether the C compiler supports C11 (complete).
2439ac_c_conftest_c11_program="${ac_c_conftest_c89_globals}
2440${ac_c_conftest_c99_globals}
2441${ac_c_conftest_c11_globals}
2442
2443int
2444main (int argc, char **argv)
2445{
2446  int ok = 0;
2447  ${ac_c_conftest_c89_main}
2448  ${ac_c_conftest_c99_main}
2449  ${ac_c_conftest_c11_main}
2450  return ok;
2451}
2452"
2453
2454# Test code for whether the C compiler supports C99 (complete).
2455ac_c_conftest_c99_program="${ac_c_conftest_c89_globals}
2456${ac_c_conftest_c99_globals}
2457
2458int
2459main (int argc, char **argv)
2460{
2461  int ok = 0;
2462  ${ac_c_conftest_c89_main}
2463  ${ac_c_conftest_c99_main}
2464  return ok;
2465}
2466"
2467
2468# Test code for whether the C compiler supports C89 (complete).
2469ac_c_conftest_c89_program="${ac_c_conftest_c89_globals}
2470
2471int
2472main (int argc, char **argv)
2473{
2474  int ok = 0;
2475  ${ac_c_conftest_c89_main}
2476  return ok;
2477}
2478"
2479
2480# Test code for whether the C++ compiler supports C++98 (global declarations)
2481ac_cxx_conftest_cxx98_globals='
2482// Does the compiler advertise C++98 conformance?
2483#if !defined __cplusplus || __cplusplus < 199711L
2484# error "Compiler does not advertise C++98 conformance"
2485#endif
2486
2487// These inclusions are to reject old compilers that
2488// lack the unsuffixed header files.
2489#include <cstdlib>
2490#include <exception>
2491
2492// <cassert> and <cstring> are *not* freestanding headers in C++98.
2493extern void assert (int);
2494namespace std {
2495  extern int strcmp (const char *, const char *);
2496}
2497
2498// Namespaces, exceptions, and templates were all added after "C++ 2.0".
2499using std::exception;
2500using std::strcmp;
2501
2502namespace {
2503
2504void test_exception_syntax()
2505{
2506  try {
2507    throw "test";
2508  } catch (const char *s) {
2509    // Extra parentheses suppress a warning when building autoconf itself,
2510    // due to lint rules shared with more typical C programs.
2511    assert (!(strcmp) (s, "test"));
2512  }
2513}
2514
2515template <typename T> struct test_template
2516{
2517  T const val;
2518  explicit test_template(T t) : val(t) {}
2519  template <typename U> T add(U u) { return static_cast<T>(u) + val; }
2520};
2521
2522} // anonymous namespace
2523'
2524
2525# Test code for whether the C++ compiler supports C++98 (body of main)
2526ac_cxx_conftest_cxx98_main='
2527  assert (argc);
2528  assert (! argv[0]);
2529{
2530  test_exception_syntax ();
2531  test_template<double> tt (2.0);
2532  assert (tt.add (4) == 6.0);
2533  assert (true && !false);
2534}
2535'
2536
2537# Test code for whether the C++ compiler supports C++11 (global declarations)
2538ac_cxx_conftest_cxx11_globals='
2539// Does the compiler advertise C++ 2011 conformance?
2540#if !defined __cplusplus || __cplusplus < 201103L
2541# error "Compiler does not advertise C++11 conformance"
2542#endif
2543
2544namespace cxx11test
2545{
2546  constexpr int get_val() { return 20; }
2547
2548  struct testinit
2549  {
2550    int i;
2551    double d;
2552  };
2553
2554  class delegate
2555  {
2556  public:
2557    delegate(int n) : n(n) {}
2558    delegate(): delegate(2354) {}
2559
2560    virtual int getval() { return this->n; };
2561  protected:
2562    int n;
2563  };
2564
2565  class overridden : public delegate
2566  {
2567  public:
2568    overridden(int n): delegate(n) {}
2569    virtual int getval() override final { return this->n * 2; }
2570  };
2571
2572  class nocopy
2573  {
2574  public:
2575    nocopy(int i): i(i) {}
2576    nocopy() = default;
2577    nocopy(const nocopy&) = delete;
2578    nocopy & operator=(const nocopy&) = delete;
2579  private:
2580    int i;
2581  };
2582
2583  // for testing lambda expressions
2584  template <typename Ret, typename Fn> Ret eval(Fn f, Ret v)
2585  {
2586    return f(v);
2587  }
2588
2589  // for testing variadic templates and trailing return types
2590  template <typename V> auto sum(V first) -> V
2591  {
2592    return first;
2593  }
2594  template <typename V, typename... Args> auto sum(V first, Args... rest) -> V
2595  {
2596    return first + sum(rest...);
2597  }
2598}
2599'
2600
2601# Test code for whether the C++ compiler supports C++11 (body of main)
2602ac_cxx_conftest_cxx11_main='
2603{
2604  // Test auto and decltype
2605  auto a1 = 6538;
2606  auto a2 = 48573953.4;
2607  auto a3 = "String literal";
2608
2609  int total = 0;
2610  for (auto i = a3; *i; ++i) { total += *i; }
2611
2612  decltype(a2) a4 = 34895.034;
2613}
2614{
2615  // Test constexpr
2616  short sa[cxx11test::get_val()] = { 0 };
2617}
2618{
2619  // Test initializer lists
2620  cxx11test::testinit il = { 4323, 435234.23544 };
2621}
2622{
2623  // Test range-based for
2624  int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3,
2625                 14, 19, 17, 8, 6, 20, 16, 2, 11, 1};
2626  for (auto &x : array) { x += 23; }
2627}
2628{
2629  // Test lambda expressions
2630  using cxx11test::eval;
2631  assert (eval ([](int x) { return x*2; }, 21) == 42);
2632  double d = 2.0;
2633  assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0);
2634  assert (d == 5.0);
2635  assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0);
2636  assert (d == 5.0);
2637}
2638{
2639  // Test use of variadic templates
2640  using cxx11test::sum;
2641  auto a = sum(1);
2642  auto b = sum(1, 2);
2643  auto c = sum(1.0, 2.0, 3.0);
2644}
2645{
2646  // Test constructor delegation
2647  cxx11test::delegate d1;
2648  cxx11test::delegate d2();
2649  cxx11test::delegate d3(45);
2650}
2651{
2652  // Test override and final
2653  cxx11test::overridden o1(55464);
2654}
2655{
2656  // Test nullptr
2657  char *c = nullptr;
2658}
2659{
2660  // Test template brackets
2661  test_template<::test_template<int>> v(test_template<int>(12));
2662}
2663{
2664  // Unicode literals
2665  char const *utf8 = u8"UTF-8 string \u2500";
2666  char16_t const *utf16 = u"UTF-8 string \u2500";
2667  char32_t const *utf32 = U"UTF-32 string \u2500";
2668}
2669'
2670
2671# Test code for whether the C compiler supports C++11 (complete).
2672ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals}
2673${ac_cxx_conftest_cxx11_globals}
2674
2675int
2676main (int argc, char **argv)
2677{
2678  int ok = 0;
2679  ${ac_cxx_conftest_cxx98_main}
2680  ${ac_cxx_conftest_cxx11_main}
2681  return ok;
2682}
2683"
2684
2685# Test code for whether the C compiler supports C++98 (complete).
2686ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals}
2687int
2688main (int argc, char **argv)
2689{
2690  int ok = 0;
2691  ${ac_cxx_conftest_cxx98_main}
2692  return ok;
2693}
2694"
2695
2696as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H"
2697as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H"
2698as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H"
2699as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H"
2700as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H"
2701as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H"
2702as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H"
2703as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H"
2704as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H"
2705# Check that the precious variables saved in the cache have kept the same
2706# value.
2707ac_cache_corrupted=false
2708for ac_var in $ac_precious_vars; do
2709  eval ac_old_set=\$ac_cv_env_${ac_var}_set
2710  eval ac_new_set=\$ac_env_${ac_var}_set
2711  eval ac_old_val=\$ac_cv_env_${ac_var}_value
2712  eval ac_new_val=\$ac_env_${ac_var}_value
2713  case $ac_old_set,$ac_new_set in
2714    set,)
2715      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
2716printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
2717      ac_cache_corrupted=: ;;
2718    ,set)
2719      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
2720printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
2721      ac_cache_corrupted=: ;;
2722    ,);;
2723    *)
2724      if test "x$ac_old_val" != "x$ac_new_val"; then
2725	# differences in whitespace do not lead to failure.
2726	ac_old_val_w=`echo x $ac_old_val`
2727	ac_new_val_w=`echo x $ac_new_val`
2728	if test "$ac_old_val_w" != "$ac_new_val_w"; then
2729	  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
2730printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
2731	  ac_cache_corrupted=:
2732	else
2733	  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
2734printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
2735	  eval $ac_var=\$ac_old_val
2736	fi
2737	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
2738printf "%s\n" "$as_me:   former value:  \`$ac_old_val'" >&2;}
2739	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
2740printf "%s\n" "$as_me:   current value: \`$ac_new_val'" >&2;}
2741      fi;;
2742  esac
2743  # Pass precious variables to config.status.
2744  if test "$ac_new_set" = set; then
2745    case $ac_new_val in
2746    *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
2747    *) ac_arg=$ac_var=$ac_new_val ;;
2748    esac
2749    case " $ac_configure_args " in
2750      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
2751      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
2752    esac
2753  fi
2754done
2755if $ac_cache_corrupted; then
2756  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2757printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
2758  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
2759printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;}
2760  as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file'
2761	    and start over" "$LINENO" 5
2762fi
2763## -------------------- ##
2764## Main body of script. ##
2765## -------------------- ##
2766
2767ac_ext=c
2768ac_cpp='$CPP $CPPFLAGS'
2769ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2770ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2771ac_compiler_gnu=$ac_cv_c_compiler_gnu
2772
2773
2774
2775#--------------------------------------------------------------------
2776# Call TEA_INIT as the first TEA_ macro to set up initial vars.
2777# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
2778# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
2779#--------------------------------------------------------------------
2780
2781
2782    TEA_VERSION="3.14"
2783
2784    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking TEA configuration" >&5
2785printf %s "checking TEA configuration... " >&6; }
2786    if test x"${PACKAGE_NAME}" = x ; then
2787	as_fn_error $? "
2788The PACKAGE_NAME variable must be defined by your TEA configure.ac" "$LINENO" 5
2789    fi
2790    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok (TEA ${TEA_VERSION})" >&5
2791printf "%s\n" "ok (TEA ${TEA_VERSION})" >&6; }
2792
2793    # If the user did not set CFLAGS, set it now to keep macros
2794    # like AC_PROG_CC and AC_TRY_COMPILE from adding "-g -O2".
2795    if test "${CFLAGS+set}" != "set" ; then
2796	CFLAGS=""
2797    fi
2798
2799    case "`uname -s`" in
2800	*win32*|*WIN32*|*MINGW32_*|*MINGW64_*|*MSYS_*)
2801	    # Extract the first word of "cygpath", so it can be a program name with args.
2802set dummy cygpath; ac_word=$2
2803{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2804printf %s "checking for $ac_word... " >&6; }
2805if test ${ac_cv_prog_CYGPATH+y}
2806then :
2807  printf %s "(cached) " >&6
2808else $as_nop
2809  if test -n "$CYGPATH"; then
2810  ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test.
2811else
2812as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2813for as_dir in $PATH
2814do
2815  IFS=$as_save_IFS
2816  case $as_dir in #(((
2817    '') as_dir=./ ;;
2818    */) ;;
2819    *) as_dir=$as_dir/ ;;
2820  esac
2821    for ac_exec_ext in '' $ac_executable_extensions; do
2822  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
2823    ac_cv_prog_CYGPATH="cygpath -m"
2824    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
2825    break 2
2826  fi
2827done
2828  done
2829IFS=$as_save_IFS
2830
2831  test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo"
2832fi
2833fi
2834CYGPATH=$ac_cv_prog_CYGPATH
2835if test -n "$CYGPATH"; then
2836  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5
2837printf "%s\n" "$CYGPATH" >&6; }
2838else
2839  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
2840printf "%s\n" "no" >&6; }
2841fi
2842
2843
2844	    EXEEXT=".exe"
2845	    TEA_PLATFORM="windows"
2846	    ;;
2847	*CYGWIN_*)
2848	    EXEEXT=".exe"
2849	    # CYGPATH and TEA_PLATFORM are determined later in LOAD_TCLCONFIG
2850	    ;;
2851	*)
2852	    CYGPATH=echo
2853	    # Maybe we are cross-compiling....
2854	    case ${host_alias} in
2855		*mingw32*)
2856		EXEEXT=".exe"
2857		TEA_PLATFORM="windows"
2858		;;
2859	    *)
2860		EXEEXT=""
2861		TEA_PLATFORM="unix"
2862		;;
2863	    esac
2864	    ;;
2865    esac
2866
2867    # Check if exec_prefix is set. If not use fall back to prefix.
2868    # Note when adjusted, so that TEA_PREFIX can correct for this.
2869    # This is needed for recursive configures, since autoconf propagates
2870    # $prefix, but not $exec_prefix (doh!).
2871    if test x$exec_prefix = xNONE ; then
2872	exec_prefix_default=yes
2873	exec_prefix=$prefix
2874    fi
2875
2876    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}" >&5
2877printf "%s\n" "$as_me: configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}" >&6;}
2878
2879
2880
2881
2882    # This package name must be replaced statically for AC_SUBST to work
2883
2884
2885
2886    # Substitute STUB_LIB_FILE in case package creates a stub library too.
2887
2888
2889    # We AC_SUBST these here to ensure they are subst'ed,
2890    # in case the user doesn't call TEA_ADD_...
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900    # Configure the installer.
2901
2902    INSTALL='$(SHELL) $(srcdir)/tclconfig/install-sh -c'
2903    INSTALL_DATA_DIR='${INSTALL} -d -m 755'
2904    INSTALL_DATA='${INSTALL} -m 644'
2905    INSTALL_PROGRAM='${INSTALL} -m 755'
2906    INSTALL_SCRIPT='${INSTALL} -m 755'
2907
2908
2909    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking system version" >&5
2910printf %s "checking system version... " >&6; }
2911if test ${tcl_cv_sys_version+y}
2912then :
2913  printf %s "(cached) " >&6
2914else $as_nop
2915
2916	# TEA specific:
2917	if test "${TEA_PLATFORM}" = "windows" ; then
2918	    tcl_cv_sys_version=windows
2919	else
2920	    tcl_cv_sys_version=`uname -s`-`uname -r`
2921	    if test "$?" -ne 0 ; then
2922		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5
2923printf "%s\n" "$as_me: WARNING: can't find uname command" >&2;}
2924		tcl_cv_sys_version=unknown
2925	    else
2926		if test "`uname -s`" = "AIX" ; then
2927		    tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
2928		fi
2929		if test "`uname -s`" = "NetBSD" -a -f /etc/debian_version ; then
2930		    tcl_cv_sys_version=NetBSD-Debian
2931		fi
2932	    fi
2933	fi
2934
2935fi
2936{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5
2937printf "%s\n" "$tcl_cv_sys_version" >&6; }
2938    system=$tcl_cv_sys_version
2939
2940    case $system in
2941	HP-UX-*) INSTALL_LIBRARY='${INSTALL} -m 755' ;;
2942	      *) INSTALL_LIBRARY='${INSTALL} -m 644' ;;
2943    esac
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956#--------------------------------------------------------------------
2957# Load the tclConfig.sh file
2958#--------------------------------------------------------------------
2959
2960
2961
2962    #
2963    # Ok, lets find the tcl configuration
2964    # First, look for one uninstalled.
2965    # the alternative search directory is invoked by --with-tcl
2966    #
2967
2968    if test x"${no_tcl}" = x ; then
2969	# we reset no_tcl in case something fails here
2970	no_tcl=true
2971
2972# Check whether --with-tcl was given.
2973if test ${with_tcl+y}
2974then :
2975  withval=$with_tcl; with_tclconfig="${withval}"
2976fi
2977
2978	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Tcl configuration" >&5
2979printf %s "checking for Tcl configuration... " >&6; }
2980	if test ${ac_cv_c_tclconfig+y}
2981then :
2982  printf %s "(cached) " >&6
2983else $as_nop
2984
2985
2986	    # First check to see if --with-tcl was specified.
2987	    if test x"${with_tclconfig}" != x ; then
2988		case "${with_tclconfig}" in
2989		    */tclConfig.sh )
2990			if test -f "${with_tclconfig}"; then
2991			    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5
2992printf "%s\n" "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;}
2993			    with_tclconfig="`echo "${with_tclconfig}" | sed 's!/tclConfig\.sh$!!'`"
2994			fi ;;
2995		esac
2996		if test -f "${with_tclconfig}/tclConfig.sh" ; then
2997		    ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`"
2998		else
2999		    as_fn_error $? "${with_tclconfig} directory doesn't contain tclConfig.sh" "$LINENO" 5
3000		fi
3001	    fi
3002
3003	    # then check for a private Tcl installation
3004	    if test x"${ac_cv_c_tclconfig}" = x ; then
3005		for i in \
3006			../tcl \
3007			`ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
3008			`ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \
3009			`ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \
3010			../../tcl \
3011			`ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
3012			`ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \
3013			`ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \
3014			../../../tcl \
3015			`ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
3016			`ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \
3017			`ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do
3018		    if test "${TEA_PLATFORM}" = "windows" \
3019			    -a -f "$i/win/tclConfig.sh" ; then
3020			ac_cv_c_tclconfig="`(cd $i/win; pwd)`"
3021			break
3022		    fi
3023		    if test -f "$i/unix/tclConfig.sh" ; then
3024			ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
3025			break
3026		    fi
3027		done
3028	    fi
3029
3030	    # on Darwin, check in Framework installation locations
3031	    if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then
3032		for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
3033			`ls -d /Library/Frameworks 2>/dev/null` \
3034			`ls -d /Network/Library/Frameworks 2>/dev/null` \
3035			`ls -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks/Tcl.framework 2>/dev/null` \
3036			`ls -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Network/Library/Frameworks/Tcl.framework 2>/dev/null` \
3037			`ls -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Tcl.framework 2>/dev/null` \
3038			; do
3039		    if test -f "$i/Tcl.framework/tclConfig.sh" ; then
3040			ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`"
3041			break
3042		    fi
3043		done
3044	    fi
3045
3046	    # TEA specific: on Windows, check in common installation locations
3047	    if test "${TEA_PLATFORM}" = "windows" \
3048		-a x"${ac_cv_c_tclconfig}" = x ; then
3049		for i in `ls -d C:/Tcl/lib 2>/dev/null` \
3050			`ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
3051			; do
3052		    if test -f "$i/tclConfig.sh" ; then
3053			ac_cv_c_tclconfig="`(cd $i; pwd)`"
3054			break
3055		    fi
3056		done
3057	    fi
3058
3059	    # check in a few common install locations
3060	    if test x"${ac_cv_c_tclconfig}" = x ; then
3061		for i in `ls -d ${libdir} 2>/dev/null` \
3062			`ls -d ${exec_prefix}/lib 2>/dev/null` \
3063			`ls -d ${prefix}/lib 2>/dev/null` \
3064			`ls -d /usr/local/lib 2>/dev/null` \
3065			`ls -d /usr/contrib/lib 2>/dev/null` \
3066			`ls -d /usr/pkg/lib 2>/dev/null` \
3067			`ls -d /usr/lib 2>/dev/null` \
3068			`ls -d /usr/lib64 2>/dev/null` \
3069			`ls -d /usr/lib/tcl8.6 2>/dev/null` \
3070			`ls -d /usr/lib/tcl8.5 2>/dev/null` \
3071			`ls -d /usr/local/lib/tcl8.6 2>/dev/null` \
3072			`ls -d /usr/local/lib/tcl8.5 2>/dev/null` \
3073			`ls -d /usr/local/lib/tcl/tcl8.6 2>/dev/null` \
3074			`ls -d /usr/local/lib/tcl/tcl8.5 2>/dev/null` \
3075			; do
3076		    if test -f "$i/tclConfig.sh" ; then
3077			ac_cv_c_tclconfig="`(cd $i; pwd)`"
3078			break
3079		    fi
3080		done
3081	    fi
3082
3083	    # check in a few other private locations
3084	    if test x"${ac_cv_c_tclconfig}" = x ; then
3085		for i in \
3086			${srcdir}/../tcl \
3087			`ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
3088			`ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \
3089			`ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do
3090		    if test "${TEA_PLATFORM}" = "windows" \
3091			    -a -f "$i/win/tclConfig.sh" ; then
3092			ac_cv_c_tclconfig="`(cd $i/win; pwd)`"
3093			break
3094		    fi
3095		    if test -f "$i/unix/tclConfig.sh" ; then
3096			ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
3097			break
3098		    fi
3099		done
3100	    fi
3101
3102fi
3103
3104
3105	if test x"${ac_cv_c_tclconfig}" = x ; then
3106	    TCL_BIN_DIR="# no Tcl configs found"
3107	    as_fn_error $? "Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh" "$LINENO" 5
3108	else
3109	    no_tcl=
3110	    TCL_BIN_DIR="${ac_cv_c_tclconfig}"
3111	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5
3112printf "%s\n" "found ${TCL_BIN_DIR}/tclConfig.sh" >&6; }
3113	fi
3114    fi
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125ac_ext=c
3126ac_cpp='$CPP $CPPFLAGS'
3127ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3128ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3129ac_compiler_gnu=$ac_cv_c_compiler_gnu
3130if test -n "$ac_tool_prefix"; then
3131  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
3132set dummy ${ac_tool_prefix}gcc; ac_word=$2
3133{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3134printf %s "checking for $ac_word... " >&6; }
3135if test ${ac_cv_prog_CC+y}
3136then :
3137  printf %s "(cached) " >&6
3138else $as_nop
3139  if test -n "$CC"; then
3140  ac_cv_prog_CC="$CC" # Let the user override the test.
3141else
3142as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3143for as_dir in $PATH
3144do
3145  IFS=$as_save_IFS
3146  case $as_dir in #(((
3147    '') as_dir=./ ;;
3148    */) ;;
3149    *) as_dir=$as_dir/ ;;
3150  esac
3151    for ac_exec_ext in '' $ac_executable_extensions; do
3152  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
3153    ac_cv_prog_CC="${ac_tool_prefix}gcc"
3154    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
3155    break 2
3156  fi
3157done
3158  done
3159IFS=$as_save_IFS
3160
3161fi
3162fi
3163CC=$ac_cv_prog_CC
3164if test -n "$CC"; then
3165  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3166printf "%s\n" "$CC" >&6; }
3167else
3168  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
3169printf "%s\n" "no" >&6; }
3170fi
3171
3172
3173fi
3174if test -z "$ac_cv_prog_CC"; then
3175  ac_ct_CC=$CC
3176  # Extract the first word of "gcc", so it can be a program name with args.
3177set dummy gcc; ac_word=$2
3178{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3179printf %s "checking for $ac_word... " >&6; }
3180if test ${ac_cv_prog_ac_ct_CC+y}
3181then :
3182  printf %s "(cached) " >&6
3183else $as_nop
3184  if test -n "$ac_ct_CC"; then
3185  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3186else
3187as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3188for as_dir in $PATH
3189do
3190  IFS=$as_save_IFS
3191  case $as_dir in #(((
3192    '') as_dir=./ ;;
3193    */) ;;
3194    *) as_dir=$as_dir/ ;;
3195  esac
3196    for ac_exec_ext in '' $ac_executable_extensions; do
3197  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
3198    ac_cv_prog_ac_ct_CC="gcc"
3199    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
3200    break 2
3201  fi
3202done
3203  done
3204IFS=$as_save_IFS
3205
3206fi
3207fi
3208ac_ct_CC=$ac_cv_prog_ac_ct_CC
3209if test -n "$ac_ct_CC"; then
3210  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3211printf "%s\n" "$ac_ct_CC" >&6; }
3212else
3213  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
3214printf "%s\n" "no" >&6; }
3215fi
3216
3217  if test "x$ac_ct_CC" = x; then
3218    CC=""
3219  else
3220    case $cross_compiling:$ac_tool_warned in
3221yes:)
3222{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3223printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3224ac_tool_warned=yes ;;
3225esac
3226    CC=$ac_ct_CC
3227  fi
3228else
3229  CC="$ac_cv_prog_CC"
3230fi
3231
3232if test -z "$CC"; then
3233          if test -n "$ac_tool_prefix"; then
3234    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
3235set dummy ${ac_tool_prefix}cc; ac_word=$2
3236{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3237printf %s "checking for $ac_word... " >&6; }
3238if test ${ac_cv_prog_CC+y}
3239then :
3240  printf %s "(cached) " >&6
3241else $as_nop
3242  if test -n "$CC"; then
3243  ac_cv_prog_CC="$CC" # Let the user override the test.
3244else
3245as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3246for as_dir in $PATH
3247do
3248  IFS=$as_save_IFS
3249  case $as_dir in #(((
3250    '') as_dir=./ ;;
3251    */) ;;
3252    *) as_dir=$as_dir/ ;;
3253  esac
3254    for ac_exec_ext in '' $ac_executable_extensions; do
3255  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
3256    ac_cv_prog_CC="${ac_tool_prefix}cc"
3257    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
3258    break 2
3259  fi
3260done
3261  done
3262IFS=$as_save_IFS
3263
3264fi
3265fi
3266CC=$ac_cv_prog_CC
3267if test -n "$CC"; then
3268  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3269printf "%s\n" "$CC" >&6; }
3270else
3271  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
3272printf "%s\n" "no" >&6; }
3273fi
3274
3275
3276  fi
3277fi
3278if test -z "$CC"; then
3279  # Extract the first word of "cc", so it can be a program name with args.
3280set dummy cc; ac_word=$2
3281{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3282printf %s "checking for $ac_word... " >&6; }
3283if test ${ac_cv_prog_CC+y}
3284then :
3285  printf %s "(cached) " >&6
3286else $as_nop
3287  if test -n "$CC"; then
3288  ac_cv_prog_CC="$CC" # Let the user override the test.
3289else
3290  ac_prog_rejected=no
3291as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3292for as_dir in $PATH
3293do
3294  IFS=$as_save_IFS
3295  case $as_dir in #(((
3296    '') as_dir=./ ;;
3297    */) ;;
3298    *) as_dir=$as_dir/ ;;
3299  esac
3300    for ac_exec_ext in '' $ac_executable_extensions; do
3301  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
3302    if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
3303       ac_prog_rejected=yes
3304       continue
3305     fi
3306    ac_cv_prog_CC="cc"
3307    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
3308    break 2
3309  fi
3310done
3311  done
3312IFS=$as_save_IFS
3313
3314if test $ac_prog_rejected = yes; then
3315  # We found a bogon in the path, so make sure we never use it.
3316  set dummy $ac_cv_prog_CC
3317  shift
3318  if test $# != 0; then
3319    # We chose a different compiler from the bogus one.
3320    # However, it has the same basename, so the bogon will be chosen
3321    # first if we set CC to just the basename; use the full file name.
3322    shift
3323    ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@"
3324  fi
3325fi
3326fi
3327fi
3328CC=$ac_cv_prog_CC
3329if test -n "$CC"; then
3330  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3331printf "%s\n" "$CC" >&6; }
3332else
3333  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
3334printf "%s\n" "no" >&6; }
3335fi
3336
3337
3338fi
3339if test -z "$CC"; then
3340  if test -n "$ac_tool_prefix"; then
3341  for ac_prog in cl.exe
3342  do
3343    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3344set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3345{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3346printf %s "checking for $ac_word... " >&6; }
3347if test ${ac_cv_prog_CC+y}
3348then :
3349  printf %s "(cached) " >&6
3350else $as_nop
3351  if test -n "$CC"; then
3352  ac_cv_prog_CC="$CC" # Let the user override the test.
3353else
3354as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3355for as_dir in $PATH
3356do
3357  IFS=$as_save_IFS
3358  case $as_dir in #(((
3359    '') as_dir=./ ;;
3360    */) ;;
3361    *) as_dir=$as_dir/ ;;
3362  esac
3363    for ac_exec_ext in '' $ac_executable_extensions; do
3364  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
3365    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
3366    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
3367    break 2
3368  fi
3369done
3370  done
3371IFS=$as_save_IFS
3372
3373fi
3374fi
3375CC=$ac_cv_prog_CC
3376if test -n "$CC"; then
3377  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3378printf "%s\n" "$CC" >&6; }
3379else
3380  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
3381printf "%s\n" "no" >&6; }
3382fi
3383
3384
3385    test -n "$CC" && break
3386  done
3387fi
3388if test -z "$CC"; then
3389  ac_ct_CC=$CC
3390  for ac_prog in cl.exe
3391do
3392  # Extract the first word of "$ac_prog", so it can be a program name with args.
3393set dummy $ac_prog; ac_word=$2
3394{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3395printf %s "checking for $ac_word... " >&6; }
3396if test ${ac_cv_prog_ac_ct_CC+y}
3397then :
3398  printf %s "(cached) " >&6
3399else $as_nop
3400  if test -n "$ac_ct_CC"; then
3401  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3402else
3403as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3404for as_dir in $PATH
3405do
3406  IFS=$as_save_IFS
3407  case $as_dir in #(((
3408    '') as_dir=./ ;;
3409    */) ;;
3410    *) as_dir=$as_dir/ ;;
3411  esac
3412    for ac_exec_ext in '' $ac_executable_extensions; do
3413  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
3414    ac_cv_prog_ac_ct_CC="$ac_prog"
3415    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
3416    break 2
3417  fi
3418done
3419  done
3420IFS=$as_save_IFS
3421
3422fi
3423fi
3424ac_ct_CC=$ac_cv_prog_ac_ct_CC
3425if test -n "$ac_ct_CC"; then
3426  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3427printf "%s\n" "$ac_ct_CC" >&6; }
3428else
3429  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
3430printf "%s\n" "no" >&6; }
3431fi
3432
3433
3434  test -n "$ac_ct_CC" && break
3435done
3436
3437  if test "x$ac_ct_CC" = x; then
3438    CC=""
3439  else
3440    case $cross_compiling:$ac_tool_warned in
3441yes:)
3442{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3443printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3444ac_tool_warned=yes ;;
3445esac
3446    CC=$ac_ct_CC
3447  fi
3448fi
3449
3450fi
3451if test -z "$CC"; then
3452  if test -n "$ac_tool_prefix"; then
3453  # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.
3454set dummy ${ac_tool_prefix}clang; ac_word=$2
3455{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3456printf %s "checking for $ac_word... " >&6; }
3457if test ${ac_cv_prog_CC+y}
3458then :
3459  printf %s "(cached) " >&6
3460else $as_nop
3461  if test -n "$CC"; then
3462  ac_cv_prog_CC="$CC" # Let the user override the test.
3463else
3464as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3465for as_dir in $PATH
3466do
3467  IFS=$as_save_IFS
3468  case $as_dir in #(((
3469    '') as_dir=./ ;;
3470    */) ;;
3471    *) as_dir=$as_dir/ ;;
3472  esac
3473    for ac_exec_ext in '' $ac_executable_extensions; do
3474  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
3475    ac_cv_prog_CC="${ac_tool_prefix}clang"
3476    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
3477    break 2
3478  fi
3479done
3480  done
3481IFS=$as_save_IFS
3482
3483fi
3484fi
3485CC=$ac_cv_prog_CC
3486if test -n "$CC"; then
3487  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3488printf "%s\n" "$CC" >&6; }
3489else
3490  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
3491printf "%s\n" "no" >&6; }
3492fi
3493
3494
3495fi
3496if test -z "$ac_cv_prog_CC"; then
3497  ac_ct_CC=$CC
3498  # Extract the first word of "clang", so it can be a program name with args.
3499set dummy clang; ac_word=$2
3500{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3501printf %s "checking for $ac_word... " >&6; }
3502if test ${ac_cv_prog_ac_ct_CC+y}
3503then :
3504  printf %s "(cached) " >&6
3505else $as_nop
3506  if test -n "$ac_ct_CC"; then
3507  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3508else
3509as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3510for as_dir in $PATH
3511do
3512  IFS=$as_save_IFS
3513  case $as_dir in #(((
3514    '') as_dir=./ ;;
3515    */) ;;
3516    *) as_dir=$as_dir/ ;;
3517  esac
3518    for ac_exec_ext in '' $ac_executable_extensions; do
3519  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
3520    ac_cv_prog_ac_ct_CC="clang"
3521    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
3522    break 2
3523  fi
3524done
3525  done
3526IFS=$as_save_IFS
3527
3528fi
3529fi
3530ac_ct_CC=$ac_cv_prog_ac_ct_CC
3531if test -n "$ac_ct_CC"; then
3532  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3533printf "%s\n" "$ac_ct_CC" >&6; }
3534else
3535  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
3536printf "%s\n" "no" >&6; }
3537fi
3538
3539  if test "x$ac_ct_CC" = x; then
3540    CC=""
3541  else
3542    case $cross_compiling:$ac_tool_warned in
3543yes:)
3544{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3545printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3546ac_tool_warned=yes ;;
3547esac
3548    CC=$ac_ct_CC
3549  fi
3550else
3551  CC="$ac_cv_prog_CC"
3552fi
3553
3554fi
3555
3556
3557test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3558printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
3559as_fn_error $? "no acceptable C compiler found in \$PATH
3560See \`config.log' for more details" "$LINENO" 5; }
3561
3562# Provide some information about the compiler.
3563printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
3564set X $ac_compile
3565ac_compiler=$2
3566for ac_option in --version -v -V -qversion -version; do
3567  { { ac_try="$ac_compiler $ac_option >&5"
3568case "(($ac_try" in
3569  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3570  *) ac_try_echo=$ac_try;;
3571esac
3572eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3573printf "%s\n" "$ac_try_echo"; } >&5
3574  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
3575  ac_status=$?
3576  if test -s conftest.err; then
3577    sed '10a\
3578... rest of stderr output deleted ...
3579         10q' conftest.err >conftest.er1
3580    cat conftest.er1 >&5
3581  fi
3582  rm -f conftest.er1 conftest.err
3583  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3584  test $ac_status = 0; }
3585done
3586
3587cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3588/* end confdefs.h.  */
3589
3590int
3591main (void)
3592{
3593
3594  ;
3595  return 0;
3596}
3597_ACEOF
3598ac_clean_files_save=$ac_clean_files
3599ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
3600# Try to create an executable without -o first, disregard a.out.
3601# It will help us diagnose broken compilers, and finding out an intuition
3602# of exeext.
3603{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
3604printf %s "checking whether the C compiler works... " >&6; }
3605ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
3606
3607# The possible output files:
3608ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
3609
3610ac_rmfiles=
3611for ac_file in $ac_files
3612do
3613  case $ac_file in
3614    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3615    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
3616  esac
3617done
3618rm -f $ac_rmfiles
3619
3620if { { ac_try="$ac_link_default"
3621case "(($ac_try" in
3622  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3623  *) ac_try_echo=$ac_try;;
3624esac
3625eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3626printf "%s\n" "$ac_try_echo"; } >&5
3627  (eval "$ac_link_default") 2>&5
3628  ac_status=$?
3629  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3630  test $ac_status = 0; }
3631then :
3632  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
3633# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
3634# in a Makefile.  We should not override ac_cv_exeext if it was cached,
3635# so that the user can short-circuit this test for compilers unknown to
3636# Autoconf.
3637for ac_file in $ac_files ''
3638do
3639  test -f "$ac_file" || continue
3640  case $ac_file in
3641    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
3642	;;
3643    [ab].out )
3644	# We found the default executable, but exeext='' is most
3645	# certainly right.
3646	break;;
3647    *.* )
3648	if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no;
3649	then :; else
3650	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3651	fi
3652	# We set ac_cv_exeext here because the later test for it is not
3653	# safe: cross compilers may not add the suffix if given an `-o'
3654	# argument, so we may need to know it at that point already.
3655	# Even if this section looks crufty: it has the advantage of
3656	# actually working.
3657	break;;
3658    * )
3659	break;;
3660  esac
3661done
3662test "$ac_cv_exeext" = no && ac_cv_exeext=
3663
3664else $as_nop
3665  ac_file=''
3666fi
3667if test -z "$ac_file"
3668then :
3669  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
3670printf "%s\n" "no" >&6; }
3671printf "%s\n" "$as_me: failed program was:" >&5
3672sed 's/^/| /' conftest.$ac_ext >&5
3673
3674{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3675printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
3676as_fn_error 77 "C compiler cannot create executables
3677See \`config.log' for more details" "$LINENO" 5; }
3678else $as_nop
3679  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3680printf "%s\n" "yes" >&6; }
3681fi
3682{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
3683printf %s "checking for C compiler default output file name... " >&6; }
3684{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
3685printf "%s\n" "$ac_file" >&6; }
3686ac_exeext=$ac_cv_exeext
3687
3688rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
3689ac_clean_files=$ac_clean_files_save
3690{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
3691printf %s "checking for suffix of executables... " >&6; }
3692if { { ac_try="$ac_link"
3693case "(($ac_try" in
3694  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3695  *) ac_try_echo=$ac_try;;
3696esac
3697eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3698printf "%s\n" "$ac_try_echo"; } >&5
3699  (eval "$ac_link") 2>&5
3700  ac_status=$?
3701  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3702  test $ac_status = 0; }
3703then :
3704  # If both `conftest.exe' and `conftest' are `present' (well, observable)
3705# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
3706# work properly (i.e., refer to `conftest.exe'), while it won't with
3707# `rm'.
3708for ac_file in conftest.exe conftest conftest.*; do
3709  test -f "$ac_file" || continue
3710  case $ac_file in
3711    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3712    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3713	  break;;
3714    * ) break;;
3715  esac
3716done
3717else $as_nop
3718  { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3719printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
3720as_fn_error $? "cannot compute suffix of executables: cannot compile and link
3721See \`config.log' for more details" "$LINENO" 5; }
3722fi
3723rm -f conftest conftest$ac_cv_exeext
3724{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
3725printf "%s\n" "$ac_cv_exeext" >&6; }
3726
3727rm -f conftest.$ac_ext
3728EXEEXT=$ac_cv_exeext
3729ac_exeext=$EXEEXT
3730cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3731/* end confdefs.h.  */
3732#include <stdio.h>
3733int
3734main (void)
3735{
3736FILE *f = fopen ("conftest.out", "w");
3737 return ferror (f) || fclose (f) != 0;
3738
3739  ;
3740  return 0;
3741}
3742_ACEOF
3743ac_clean_files="$ac_clean_files conftest.out"
3744# Check that the compiler produces executables we can run.  If not, either
3745# the compiler is broken, or we cross compile.
3746{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
3747printf %s "checking whether we are cross compiling... " >&6; }
3748if test "$cross_compiling" != yes; then
3749  { { ac_try="$ac_link"
3750case "(($ac_try" in
3751  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3752  *) ac_try_echo=$ac_try;;
3753esac
3754eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3755printf "%s\n" "$ac_try_echo"; } >&5
3756  (eval "$ac_link") 2>&5
3757  ac_status=$?
3758  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3759  test $ac_status = 0; }
3760  if { ac_try='./conftest$ac_cv_exeext'
3761  { { case "(($ac_try" in
3762  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3763  *) ac_try_echo=$ac_try;;
3764esac
3765eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3766printf "%s\n" "$ac_try_echo"; } >&5
3767  (eval "$ac_try") 2>&5
3768  ac_status=$?
3769  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3770  test $ac_status = 0; }; }; then
3771    cross_compiling=no
3772  else
3773    if test "$cross_compiling" = maybe; then
3774	cross_compiling=yes
3775    else
3776	{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3777printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
3778as_fn_error 77 "cannot run C compiled programs.
3779If you meant to cross compile, use \`--host'.
3780See \`config.log' for more details" "$LINENO" 5; }
3781    fi
3782  fi
3783fi
3784{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
3785printf "%s\n" "$cross_compiling" >&6; }
3786
3787rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
3788ac_clean_files=$ac_clean_files_save
3789{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
3790printf %s "checking for suffix of object files... " >&6; }
3791if test ${ac_cv_objext+y}
3792then :
3793  printf %s "(cached) " >&6
3794else $as_nop
3795  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3796/* end confdefs.h.  */
3797
3798int
3799main (void)
3800{
3801
3802  ;
3803  return 0;
3804}
3805_ACEOF
3806rm -f conftest.o conftest.obj
3807if { { ac_try="$ac_compile"
3808case "(($ac_try" in
3809  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3810  *) ac_try_echo=$ac_try;;
3811esac
3812eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3813printf "%s\n" "$ac_try_echo"; } >&5
3814  (eval "$ac_compile") 2>&5
3815  ac_status=$?
3816  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3817  test $ac_status = 0; }
3818then :
3819  for ac_file in conftest.o conftest.obj conftest.*; do
3820  test -f "$ac_file" || continue;
3821  case $ac_file in
3822    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
3823    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
3824       break;;
3825  esac
3826done
3827else $as_nop
3828  printf "%s\n" "$as_me: failed program was:" >&5
3829sed 's/^/| /' conftest.$ac_ext >&5
3830
3831{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3832printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
3833as_fn_error $? "cannot compute suffix of object files: cannot compile
3834See \`config.log' for more details" "$LINENO" 5; }
3835fi
3836rm -f conftest.$ac_cv_objext conftest.$ac_ext
3837fi
3838{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
3839printf "%s\n" "$ac_cv_objext" >&6; }
3840OBJEXT=$ac_cv_objext
3841ac_objext=$OBJEXT
3842{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5
3843printf %s "checking whether the compiler supports GNU C... " >&6; }
3844if test ${ac_cv_c_compiler_gnu+y}
3845then :
3846  printf %s "(cached) " >&6
3847else $as_nop
3848  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3849/* end confdefs.h.  */
3850
3851int
3852main (void)
3853{
3854#ifndef __GNUC__
3855       choke me
3856#endif
3857
3858  ;
3859  return 0;
3860}
3861_ACEOF
3862if ac_fn_c_try_compile "$LINENO"
3863then :
3864  ac_compiler_gnu=yes
3865else $as_nop
3866  ac_compiler_gnu=no
3867fi
3868rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
3869ac_cv_c_compiler_gnu=$ac_compiler_gnu
3870
3871fi
3872{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
3873printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; }
3874ac_compiler_gnu=$ac_cv_c_compiler_gnu
3875
3876if test $ac_compiler_gnu = yes; then
3877  GCC=yes
3878else
3879  GCC=
3880fi
3881ac_test_CFLAGS=${CFLAGS+y}
3882ac_save_CFLAGS=$CFLAGS
3883{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
3884printf %s "checking whether $CC accepts -g... " >&6; }
3885if test ${ac_cv_prog_cc_g+y}
3886then :
3887  printf %s "(cached) " >&6
3888else $as_nop
3889  ac_save_c_werror_flag=$ac_c_werror_flag
3890   ac_c_werror_flag=yes
3891   ac_cv_prog_cc_g=no
3892   CFLAGS="-g"
3893   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3894/* end confdefs.h.  */
3895
3896int
3897main (void)
3898{
3899
3900  ;
3901  return 0;
3902}
3903_ACEOF
3904if ac_fn_c_try_compile "$LINENO"
3905then :
3906  ac_cv_prog_cc_g=yes
3907else $as_nop
3908  CFLAGS=""
3909      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3910/* end confdefs.h.  */
3911
3912int
3913main (void)
3914{
3915
3916  ;
3917  return 0;
3918}
3919_ACEOF
3920if ac_fn_c_try_compile "$LINENO"
3921then :
3922
3923else $as_nop
3924  ac_c_werror_flag=$ac_save_c_werror_flag
3925	 CFLAGS="-g"
3926	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3927/* end confdefs.h.  */
3928
3929int
3930main (void)
3931{
3932
3933  ;
3934  return 0;
3935}
3936_ACEOF
3937if ac_fn_c_try_compile "$LINENO"
3938then :
3939  ac_cv_prog_cc_g=yes
3940fi
3941rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
3942fi
3943rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
3944fi
3945rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
3946   ac_c_werror_flag=$ac_save_c_werror_flag
3947fi
3948{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
3949printf "%s\n" "$ac_cv_prog_cc_g" >&6; }
3950if test $ac_test_CFLAGS; then
3951  CFLAGS=$ac_save_CFLAGS
3952elif test $ac_cv_prog_cc_g = yes; then
3953  if test "$GCC" = yes; then
3954    CFLAGS="-g -O2"
3955  else
3956    CFLAGS="-g"
3957  fi
3958else
3959  if test "$GCC" = yes; then
3960    CFLAGS="-O2"
3961  else
3962    CFLAGS=
3963  fi
3964fi
3965ac_prog_cc_stdc=no
3966if test x$ac_prog_cc_stdc = xno
3967then :
3968  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
3969printf %s "checking for $CC option to enable C11 features... " >&6; }
3970if test ${ac_cv_prog_cc_c11+y}
3971then :
3972  printf %s "(cached) " >&6
3973else $as_nop
3974  ac_cv_prog_cc_c11=no
3975ac_save_CC=$CC
3976cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3977/* end confdefs.h.  */
3978$ac_c_conftest_c11_program
3979_ACEOF
3980for ac_arg in '' -std=gnu11
3981do
3982  CC="$ac_save_CC $ac_arg"
3983  if ac_fn_c_try_compile "$LINENO"
3984then :
3985  ac_cv_prog_cc_c11=$ac_arg
3986fi
3987rm -f core conftest.err conftest.$ac_objext conftest.beam
3988  test "x$ac_cv_prog_cc_c11" != "xno" && break
3989done
3990rm -f conftest.$ac_ext
3991CC=$ac_save_CC
3992fi
3993
3994if test "x$ac_cv_prog_cc_c11" = xno
3995then :
3996  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
3997printf "%s\n" "unsupported" >&6; }
3998else $as_nop
3999  if test "x$ac_cv_prog_cc_c11" = x
4000then :
4001  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4002printf "%s\n" "none needed" >&6; }
4003else $as_nop
4004  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
4005printf "%s\n" "$ac_cv_prog_cc_c11" >&6; }
4006     CC="$CC $ac_cv_prog_cc_c11"
4007fi
4008  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
4009  ac_prog_cc_stdc=c11
4010fi
4011fi
4012if test x$ac_prog_cc_stdc = xno
4013then :
4014  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
4015printf %s "checking for $CC option to enable C99 features... " >&6; }
4016if test ${ac_cv_prog_cc_c99+y}
4017then :
4018  printf %s "(cached) " >&6
4019else $as_nop
4020  ac_cv_prog_cc_c99=no
4021ac_save_CC=$CC
4022cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4023/* end confdefs.h.  */
4024$ac_c_conftest_c99_program
4025_ACEOF
4026for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99=
4027do
4028  CC="$ac_save_CC $ac_arg"
4029  if ac_fn_c_try_compile "$LINENO"
4030then :
4031  ac_cv_prog_cc_c99=$ac_arg
4032fi
4033rm -f core conftest.err conftest.$ac_objext conftest.beam
4034  test "x$ac_cv_prog_cc_c99" != "xno" && break
4035done
4036rm -f conftest.$ac_ext
4037CC=$ac_save_CC
4038fi
4039
4040if test "x$ac_cv_prog_cc_c99" = xno
4041then :
4042  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4043printf "%s\n" "unsupported" >&6; }
4044else $as_nop
4045  if test "x$ac_cv_prog_cc_c99" = x
4046then :
4047  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4048printf "%s\n" "none needed" >&6; }
4049else $as_nop
4050  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
4051printf "%s\n" "$ac_cv_prog_cc_c99" >&6; }
4052     CC="$CC $ac_cv_prog_cc_c99"
4053fi
4054  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
4055  ac_prog_cc_stdc=c99
4056fi
4057fi
4058if test x$ac_prog_cc_stdc = xno
4059then :
4060  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
4061printf %s "checking for $CC option to enable C89 features... " >&6; }
4062if test ${ac_cv_prog_cc_c89+y}
4063then :
4064  printf %s "(cached) " >&6
4065else $as_nop
4066  ac_cv_prog_cc_c89=no
4067ac_save_CC=$CC
4068cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4069/* end confdefs.h.  */
4070$ac_c_conftest_c89_program
4071_ACEOF
4072for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4073do
4074  CC="$ac_save_CC $ac_arg"
4075  if ac_fn_c_try_compile "$LINENO"
4076then :
4077  ac_cv_prog_cc_c89=$ac_arg
4078fi
4079rm -f core conftest.err conftest.$ac_objext conftest.beam
4080  test "x$ac_cv_prog_cc_c89" != "xno" && break
4081done
4082rm -f conftest.$ac_ext
4083CC=$ac_save_CC
4084fi
4085
4086if test "x$ac_cv_prog_cc_c89" = xno
4087then :
4088  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4089printf "%s\n" "unsupported" >&6; }
4090else $as_nop
4091  if test "x$ac_cv_prog_cc_c89" = x
4092then :
4093  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4094printf "%s\n" "none needed" >&6; }
4095else $as_nop
4096  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
4097printf "%s\n" "$ac_cv_prog_cc_c89" >&6; }
4098     CC="$CC $ac_cv_prog_cc_c89"
4099fi
4100  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
4101  ac_prog_cc_stdc=c89
4102fi
4103fi
4104
4105ac_ext=c
4106ac_cpp='$CPP $CPPFLAGS'
4107ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4108ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4109ac_compiler_gnu=$ac_cv_c_compiler_gnu
4110
4111
4112
4113    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5
4114printf %s "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... " >&6; }
4115
4116    if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
4117        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: loading" >&5
4118printf "%s\n" "loading" >&6; }
4119	. "${TCL_BIN_DIR}/tclConfig.sh"
4120    else
4121        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5
4122printf "%s\n" "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; }
4123    fi
4124
4125    # If the TCL_BIN_DIR is the build directory (not the install directory),
4126    # then set the common variable name to the value of the build variables.
4127    # For example, the variable TCL_LIB_SPEC will be set to the value
4128    # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
4129    # instead of TCL_BUILD_LIB_SPEC since it will work with both an
4130    # installed and uninstalled version of Tcl.
4131    if test -f "${TCL_BIN_DIR}/Makefile" ; then
4132        TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}"
4133        TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}"
4134        TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}"
4135    elif test "`uname -s`" = "Darwin"; then
4136	# If Tcl was built as a framework, attempt to use the libraries
4137	# from the framework at the given location so that linking works
4138	# against Tcl.framework installed in an arbitrary location.
4139	case ${TCL_DEFS} in
4140	    *TCL_FRAMEWORK*)
4141		if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then
4142		    for i in "`cd "${TCL_BIN_DIR}"; pwd`" \
4143			     "`cd "${TCL_BIN_DIR}"/../..; pwd`"; do
4144			if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
4145			    TCL_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TCL_LIB_FILE}"
4146			    break
4147			fi
4148		    done
4149		fi
4150		if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then
4151		    TCL_STUB_LIB_SPEC="-L`echo "${TCL_BIN_DIR}"  | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}"
4152		    TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
4153		fi
4154		;;
4155	esac
4156    fi
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking platform" >&5
4172printf %s "checking platform... " >&6; }
4173    hold_cc=$CC; CC="$TCL_CC"
4174    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4175/* end confdefs.h.  */
4176
4177int
4178main (void)
4179{
4180
4181	    #ifdef _WIN32
4182		#error win32
4183	    #endif
4184
4185  ;
4186  return 0;
4187}
4188_ACEOF
4189if ac_fn_c_try_compile "$LINENO"
4190then :
4191
4192	    # first test we've already retrieved platform (cross-compile), fallback to unix otherwise:
4193	    TEA_PLATFORM="${TEA_PLATFORM-unix}"
4194	    CYGPATH=echo
4195
4196else $as_nop
4197
4198	    TEA_PLATFORM="windows"
4199	    # Extract the first word of "cygpath", so it can be a program name with args.
4200set dummy cygpath; ac_word=$2
4201{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4202printf %s "checking for $ac_word... " >&6; }
4203if test ${ac_cv_prog_CYGPATH+y}
4204then :
4205  printf %s "(cached) " >&6
4206else $as_nop
4207  if test -n "$CYGPATH"; then
4208  ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test.
4209else
4210as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4211for as_dir in $PATH
4212do
4213  IFS=$as_save_IFS
4214  case $as_dir in #(((
4215    '') as_dir=./ ;;
4216    */) ;;
4217    *) as_dir=$as_dir/ ;;
4218  esac
4219    for ac_exec_ext in '' $ac_executable_extensions; do
4220  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
4221    ac_cv_prog_CYGPATH="cygpath -m"
4222    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
4223    break 2
4224  fi
4225done
4226  done
4227IFS=$as_save_IFS
4228
4229  test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo"
4230fi
4231fi
4232CYGPATH=$ac_cv_prog_CYGPATH
4233if test -n "$CYGPATH"; then
4234  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5
4235printf "%s\n" "$CYGPATH" >&6; }
4236else
4237  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
4238printf "%s\n" "no" >&6; }
4239fi
4240
4241
4242
4243fi
4244rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
4245    CC=$hold_cc
4246    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $TEA_PLATFORM" >&5
4247printf "%s\n" "$TEA_PLATFORM" >&6; }
4248
4249    # The BUILD_$pkg is to define the correct extern storage class
4250    # handling when making this package
4251
4252printf "%s\n" "#define BUILD_${PACKAGE_NAME} /**/" >>confdefs.h
4253
4254    # Do this here as we have fully defined TEA_PLATFORM now
4255    if test "${TEA_PLATFORM}" = "windows" ; then
4256	EXEEXT=".exe"
4257	CLEANFILES="$CLEANFILES *.lib *.dll *.pdb *.exp"
4258    fi
4259
4260    # TEA specific:
4261
4262
4263
4264
4265
4266
4267
4268
4269if test "${TCL_MAJOR_VERSION}" -ne 8 ; then
4270    as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.4+
4271Found config for Tcl ${TCL_VERSION}" "$LINENO" 5
4272fi
4273if test "${TCL_MINOR_VERSION}" -lt 4 ; then
4274    as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.4+
4275Found config for Tcl ${TCL_VERSION}" "$LINENO" 5
4276fi
4277
4278#--------------------------------------------------------------------
4279# Load the tkConfig.sh file if necessary (Tk extension)
4280#--------------------------------------------------------------------
4281
4282#TEA_PATH_TKCONFIG
4283#TEA_LOAD_TKCONFIG
4284
4285#-----------------------------------------------------------------------
4286# Handle the --prefix=... option by defaulting to what Tcl gave.
4287# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
4288#-----------------------------------------------------------------------
4289
4290
4291    if test "${prefix}" = "NONE"; then
4292	prefix_default=yes
4293	if test x"${TCL_PREFIX}" != x; then
4294	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5
4295printf "%s\n" "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;}
4296	    prefix=${TCL_PREFIX}
4297	else
4298	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: --prefix defaulting to /usr/local" >&5
4299printf "%s\n" "$as_me: --prefix defaulting to /usr/local" >&6;}
4300	    prefix=/usr/local
4301	fi
4302    fi
4303    if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \
4304	-o x"${exec_prefix_default}" = x"yes" ; then
4305	if test x"${TCL_EXEC_PREFIX}" != x; then
4306	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5
4307printf "%s\n" "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;}
4308	    exec_prefix=${TCL_EXEC_PREFIX}
4309	else
4310	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: --exec-prefix defaulting to ${prefix}" >&5
4311printf "%s\n" "$as_me: --exec-prefix defaulting to ${prefix}" >&6;}
4312	    exec_prefix=$prefix
4313	fi
4314    fi
4315
4316
4317#-----------------------------------------------------------------------
4318# Standard compiler checks.
4319# This sets up CC by using the CC env var, or looks for gcc otherwise.
4320# This also calls AC_PROG_CC and a few others to create the basic setup
4321# necessary to compile executables.
4322#-----------------------------------------------------------------------
4323
4324
4325
4326
4327
4328
4329
4330
4331    # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE)
4332    # in this macro, they need to go into TEA_SETUP_COMPILER instead.
4333
4334    ac_ext=c
4335ac_cpp='$CPP $CPPFLAGS'
4336ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4337ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4338ac_compiler_gnu=$ac_cv_c_compiler_gnu
4339if test -n "$ac_tool_prefix"; then
4340  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
4341set dummy ${ac_tool_prefix}gcc; ac_word=$2
4342{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4343printf %s "checking for $ac_word... " >&6; }
4344if test ${ac_cv_prog_CC+y}
4345then :
4346  printf %s "(cached) " >&6
4347else $as_nop
4348  if test -n "$CC"; then
4349  ac_cv_prog_CC="$CC" # Let the user override the test.
4350else
4351as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4352for as_dir in $PATH
4353do
4354  IFS=$as_save_IFS
4355  case $as_dir in #(((
4356    '') as_dir=./ ;;
4357    */) ;;
4358    *) as_dir=$as_dir/ ;;
4359  esac
4360    for ac_exec_ext in '' $ac_executable_extensions; do
4361  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
4362    ac_cv_prog_CC="${ac_tool_prefix}gcc"
4363    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
4364    break 2
4365  fi
4366done
4367  done
4368IFS=$as_save_IFS
4369
4370fi
4371fi
4372CC=$ac_cv_prog_CC
4373if test -n "$CC"; then
4374  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4375printf "%s\n" "$CC" >&6; }
4376else
4377  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
4378printf "%s\n" "no" >&6; }
4379fi
4380
4381
4382fi
4383if test -z "$ac_cv_prog_CC"; then
4384  ac_ct_CC=$CC
4385  # Extract the first word of "gcc", so it can be a program name with args.
4386set dummy gcc; ac_word=$2
4387{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4388printf %s "checking for $ac_word... " >&6; }
4389if test ${ac_cv_prog_ac_ct_CC+y}
4390then :
4391  printf %s "(cached) " >&6
4392else $as_nop
4393  if test -n "$ac_ct_CC"; then
4394  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
4395else
4396as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4397for as_dir in $PATH
4398do
4399  IFS=$as_save_IFS
4400  case $as_dir in #(((
4401    '') as_dir=./ ;;
4402    */) ;;
4403    *) as_dir=$as_dir/ ;;
4404  esac
4405    for ac_exec_ext in '' $ac_executable_extensions; do
4406  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
4407    ac_cv_prog_ac_ct_CC="gcc"
4408    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
4409    break 2
4410  fi
4411done
4412  done
4413IFS=$as_save_IFS
4414
4415fi
4416fi
4417ac_ct_CC=$ac_cv_prog_ac_ct_CC
4418if test -n "$ac_ct_CC"; then
4419  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4420printf "%s\n" "$ac_ct_CC" >&6; }
4421else
4422  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
4423printf "%s\n" "no" >&6; }
4424fi
4425
4426  if test "x$ac_ct_CC" = x; then
4427    CC=""
4428  else
4429    case $cross_compiling:$ac_tool_warned in
4430yes:)
4431{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4432printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4433ac_tool_warned=yes ;;
4434esac
4435    CC=$ac_ct_CC
4436  fi
4437else
4438  CC="$ac_cv_prog_CC"
4439fi
4440
4441if test -z "$CC"; then
4442          if test -n "$ac_tool_prefix"; then
4443    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
4444set dummy ${ac_tool_prefix}cc; ac_word=$2
4445{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4446printf %s "checking for $ac_word... " >&6; }
4447if test ${ac_cv_prog_CC+y}
4448then :
4449  printf %s "(cached) " >&6
4450else $as_nop
4451  if test -n "$CC"; then
4452  ac_cv_prog_CC="$CC" # Let the user override the test.
4453else
4454as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4455for as_dir in $PATH
4456do
4457  IFS=$as_save_IFS
4458  case $as_dir in #(((
4459    '') as_dir=./ ;;
4460    */) ;;
4461    *) as_dir=$as_dir/ ;;
4462  esac
4463    for ac_exec_ext in '' $ac_executable_extensions; do
4464  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
4465    ac_cv_prog_CC="${ac_tool_prefix}cc"
4466    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
4467    break 2
4468  fi
4469done
4470  done
4471IFS=$as_save_IFS
4472
4473fi
4474fi
4475CC=$ac_cv_prog_CC
4476if test -n "$CC"; then
4477  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4478printf "%s\n" "$CC" >&6; }
4479else
4480  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
4481printf "%s\n" "no" >&6; }
4482fi
4483
4484
4485  fi
4486fi
4487if test -z "$CC"; then
4488  # Extract the first word of "cc", so it can be a program name with args.
4489set dummy cc; ac_word=$2
4490{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4491printf %s "checking for $ac_word... " >&6; }
4492if test ${ac_cv_prog_CC+y}
4493then :
4494  printf %s "(cached) " >&6
4495else $as_nop
4496  if test -n "$CC"; then
4497  ac_cv_prog_CC="$CC" # Let the user override the test.
4498else
4499  ac_prog_rejected=no
4500as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4501for as_dir in $PATH
4502do
4503  IFS=$as_save_IFS
4504  case $as_dir in #(((
4505    '') as_dir=./ ;;
4506    */) ;;
4507    *) as_dir=$as_dir/ ;;
4508  esac
4509    for ac_exec_ext in '' $ac_executable_extensions; do
4510  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
4511    if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
4512       ac_prog_rejected=yes
4513       continue
4514     fi
4515    ac_cv_prog_CC="cc"
4516    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
4517    break 2
4518  fi
4519done
4520  done
4521IFS=$as_save_IFS
4522
4523if test $ac_prog_rejected = yes; then
4524  # We found a bogon in the path, so make sure we never use it.
4525  set dummy $ac_cv_prog_CC
4526  shift
4527  if test $# != 0; then
4528    # We chose a different compiler from the bogus one.
4529    # However, it has the same basename, so the bogon will be chosen
4530    # first if we set CC to just the basename; use the full file name.
4531    shift
4532    ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@"
4533  fi
4534fi
4535fi
4536fi
4537CC=$ac_cv_prog_CC
4538if test -n "$CC"; then
4539  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4540printf "%s\n" "$CC" >&6; }
4541else
4542  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
4543printf "%s\n" "no" >&6; }
4544fi
4545
4546
4547fi
4548if test -z "$CC"; then
4549  if test -n "$ac_tool_prefix"; then
4550  for ac_prog in cl.exe
4551  do
4552    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4553set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4554{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4555printf %s "checking for $ac_word... " >&6; }
4556if test ${ac_cv_prog_CC+y}
4557then :
4558  printf %s "(cached) " >&6
4559else $as_nop
4560  if test -n "$CC"; then
4561  ac_cv_prog_CC="$CC" # Let the user override the test.
4562else
4563as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4564for as_dir in $PATH
4565do
4566  IFS=$as_save_IFS
4567  case $as_dir in #(((
4568    '') as_dir=./ ;;
4569    */) ;;
4570    *) as_dir=$as_dir/ ;;
4571  esac
4572    for ac_exec_ext in '' $ac_executable_extensions; do
4573  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
4574    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
4575    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
4576    break 2
4577  fi
4578done
4579  done
4580IFS=$as_save_IFS
4581
4582fi
4583fi
4584CC=$ac_cv_prog_CC
4585if test -n "$CC"; then
4586  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4587printf "%s\n" "$CC" >&6; }
4588else
4589  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
4590printf "%s\n" "no" >&6; }
4591fi
4592
4593
4594    test -n "$CC" && break
4595  done
4596fi
4597if test -z "$CC"; then
4598  ac_ct_CC=$CC
4599  for ac_prog in cl.exe
4600do
4601  # Extract the first word of "$ac_prog", so it can be a program name with args.
4602set dummy $ac_prog; ac_word=$2
4603{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4604printf %s "checking for $ac_word... " >&6; }
4605if test ${ac_cv_prog_ac_ct_CC+y}
4606then :
4607  printf %s "(cached) " >&6
4608else $as_nop
4609  if test -n "$ac_ct_CC"; then
4610  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
4611else
4612as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4613for as_dir in $PATH
4614do
4615  IFS=$as_save_IFS
4616  case $as_dir in #(((
4617    '') as_dir=./ ;;
4618    */) ;;
4619    *) as_dir=$as_dir/ ;;
4620  esac
4621    for ac_exec_ext in '' $ac_executable_extensions; do
4622  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
4623    ac_cv_prog_ac_ct_CC="$ac_prog"
4624    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
4625    break 2
4626  fi
4627done
4628  done
4629IFS=$as_save_IFS
4630
4631fi
4632fi
4633ac_ct_CC=$ac_cv_prog_ac_ct_CC
4634if test -n "$ac_ct_CC"; then
4635  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4636printf "%s\n" "$ac_ct_CC" >&6; }
4637else
4638  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
4639printf "%s\n" "no" >&6; }
4640fi
4641
4642
4643  test -n "$ac_ct_CC" && break
4644done
4645
4646  if test "x$ac_ct_CC" = x; then
4647    CC=""
4648  else
4649    case $cross_compiling:$ac_tool_warned in
4650yes:)
4651{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4652printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4653ac_tool_warned=yes ;;
4654esac
4655    CC=$ac_ct_CC
4656  fi
4657fi
4658
4659fi
4660if test -z "$CC"; then
4661  if test -n "$ac_tool_prefix"; then
4662  # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.
4663set dummy ${ac_tool_prefix}clang; ac_word=$2
4664{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4665printf %s "checking for $ac_word... " >&6; }
4666if test ${ac_cv_prog_CC+y}
4667then :
4668  printf %s "(cached) " >&6
4669else $as_nop
4670  if test -n "$CC"; then
4671  ac_cv_prog_CC="$CC" # Let the user override the test.
4672else
4673as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4674for as_dir in $PATH
4675do
4676  IFS=$as_save_IFS
4677  case $as_dir in #(((
4678    '') as_dir=./ ;;
4679    */) ;;
4680    *) as_dir=$as_dir/ ;;
4681  esac
4682    for ac_exec_ext in '' $ac_executable_extensions; do
4683  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
4684    ac_cv_prog_CC="${ac_tool_prefix}clang"
4685    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
4686    break 2
4687  fi
4688done
4689  done
4690IFS=$as_save_IFS
4691
4692fi
4693fi
4694CC=$ac_cv_prog_CC
4695if test -n "$CC"; then
4696  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4697printf "%s\n" "$CC" >&6; }
4698else
4699  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
4700printf "%s\n" "no" >&6; }
4701fi
4702
4703
4704fi
4705if test -z "$ac_cv_prog_CC"; then
4706  ac_ct_CC=$CC
4707  # Extract the first word of "clang", so it can be a program name with args.
4708set dummy clang; ac_word=$2
4709{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4710printf %s "checking for $ac_word... " >&6; }
4711if test ${ac_cv_prog_ac_ct_CC+y}
4712then :
4713  printf %s "(cached) " >&6
4714else $as_nop
4715  if test -n "$ac_ct_CC"; then
4716  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
4717else
4718as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4719for as_dir in $PATH
4720do
4721  IFS=$as_save_IFS
4722  case $as_dir in #(((
4723    '') as_dir=./ ;;
4724    */) ;;
4725    *) as_dir=$as_dir/ ;;
4726  esac
4727    for ac_exec_ext in '' $ac_executable_extensions; do
4728  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
4729    ac_cv_prog_ac_ct_CC="clang"
4730    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
4731    break 2
4732  fi
4733done
4734  done
4735IFS=$as_save_IFS
4736
4737fi
4738fi
4739ac_ct_CC=$ac_cv_prog_ac_ct_CC
4740if test -n "$ac_ct_CC"; then
4741  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4742printf "%s\n" "$ac_ct_CC" >&6; }
4743else
4744  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
4745printf "%s\n" "no" >&6; }
4746fi
4747
4748  if test "x$ac_ct_CC" = x; then
4749    CC=""
4750  else
4751    case $cross_compiling:$ac_tool_warned in
4752yes:)
4753{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4754printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4755ac_tool_warned=yes ;;
4756esac
4757    CC=$ac_ct_CC
4758  fi
4759else
4760  CC="$ac_cv_prog_CC"
4761fi
4762
4763fi
4764
4765
4766test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4767printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
4768as_fn_error $? "no acceptable C compiler found in \$PATH
4769See \`config.log' for more details" "$LINENO" 5; }
4770
4771# Provide some information about the compiler.
4772printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
4773set X $ac_compile
4774ac_compiler=$2
4775for ac_option in --version -v -V -qversion -version; do
4776  { { ac_try="$ac_compiler $ac_option >&5"
4777case "(($ac_try" in
4778  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4779  *) ac_try_echo=$ac_try;;
4780esac
4781eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4782printf "%s\n" "$ac_try_echo"; } >&5
4783  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
4784  ac_status=$?
4785  if test -s conftest.err; then
4786    sed '10a\
4787... rest of stderr output deleted ...
4788         10q' conftest.err >conftest.er1
4789    cat conftest.er1 >&5
4790  fi
4791  rm -f conftest.er1 conftest.err
4792  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4793  test $ac_status = 0; }
4794done
4795
4796{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5
4797printf %s "checking whether the compiler supports GNU C... " >&6; }
4798if test ${ac_cv_c_compiler_gnu+y}
4799then :
4800  printf %s "(cached) " >&6
4801else $as_nop
4802  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4803/* end confdefs.h.  */
4804
4805int
4806main (void)
4807{
4808#ifndef __GNUC__
4809       choke me
4810#endif
4811
4812  ;
4813  return 0;
4814}
4815_ACEOF
4816if ac_fn_c_try_compile "$LINENO"
4817then :
4818  ac_compiler_gnu=yes
4819else $as_nop
4820  ac_compiler_gnu=no
4821fi
4822rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
4823ac_cv_c_compiler_gnu=$ac_compiler_gnu
4824
4825fi
4826{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
4827printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; }
4828ac_compiler_gnu=$ac_cv_c_compiler_gnu
4829
4830if test $ac_compiler_gnu = yes; then
4831  GCC=yes
4832else
4833  GCC=
4834fi
4835ac_test_CFLAGS=${CFLAGS+y}
4836ac_save_CFLAGS=$CFLAGS
4837{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
4838printf %s "checking whether $CC accepts -g... " >&6; }
4839if test ${ac_cv_prog_cc_g+y}
4840then :
4841  printf %s "(cached) " >&6
4842else $as_nop
4843  ac_save_c_werror_flag=$ac_c_werror_flag
4844   ac_c_werror_flag=yes
4845   ac_cv_prog_cc_g=no
4846   CFLAGS="-g"
4847   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4848/* end confdefs.h.  */
4849
4850int
4851main (void)
4852{
4853
4854  ;
4855  return 0;
4856}
4857_ACEOF
4858if ac_fn_c_try_compile "$LINENO"
4859then :
4860  ac_cv_prog_cc_g=yes
4861else $as_nop
4862  CFLAGS=""
4863      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4864/* end confdefs.h.  */
4865
4866int
4867main (void)
4868{
4869
4870  ;
4871  return 0;
4872}
4873_ACEOF
4874if ac_fn_c_try_compile "$LINENO"
4875then :
4876
4877else $as_nop
4878  ac_c_werror_flag=$ac_save_c_werror_flag
4879	 CFLAGS="-g"
4880	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4881/* end confdefs.h.  */
4882
4883int
4884main (void)
4885{
4886
4887  ;
4888  return 0;
4889}
4890_ACEOF
4891if ac_fn_c_try_compile "$LINENO"
4892then :
4893  ac_cv_prog_cc_g=yes
4894fi
4895rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
4896fi
4897rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
4898fi
4899rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
4900   ac_c_werror_flag=$ac_save_c_werror_flag
4901fi
4902{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
4903printf "%s\n" "$ac_cv_prog_cc_g" >&6; }
4904if test $ac_test_CFLAGS; then
4905  CFLAGS=$ac_save_CFLAGS
4906elif test $ac_cv_prog_cc_g = yes; then
4907  if test "$GCC" = yes; then
4908    CFLAGS="-g -O2"
4909  else
4910    CFLAGS="-g"
4911  fi
4912else
4913  if test "$GCC" = yes; then
4914    CFLAGS="-O2"
4915  else
4916    CFLAGS=
4917  fi
4918fi
4919ac_prog_cc_stdc=no
4920if test x$ac_prog_cc_stdc = xno
4921then :
4922  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
4923printf %s "checking for $CC option to enable C11 features... " >&6; }
4924if test ${ac_cv_prog_cc_c11+y}
4925then :
4926  printf %s "(cached) " >&6
4927else $as_nop
4928  ac_cv_prog_cc_c11=no
4929ac_save_CC=$CC
4930cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4931/* end confdefs.h.  */
4932$ac_c_conftest_c11_program
4933_ACEOF
4934for ac_arg in '' -std=gnu11
4935do
4936  CC="$ac_save_CC $ac_arg"
4937  if ac_fn_c_try_compile "$LINENO"
4938then :
4939  ac_cv_prog_cc_c11=$ac_arg
4940fi
4941rm -f core conftest.err conftest.$ac_objext conftest.beam
4942  test "x$ac_cv_prog_cc_c11" != "xno" && break
4943done
4944rm -f conftest.$ac_ext
4945CC=$ac_save_CC
4946fi
4947
4948if test "x$ac_cv_prog_cc_c11" = xno
4949then :
4950  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4951printf "%s\n" "unsupported" >&6; }
4952else $as_nop
4953  if test "x$ac_cv_prog_cc_c11" = x
4954then :
4955  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4956printf "%s\n" "none needed" >&6; }
4957else $as_nop
4958  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
4959printf "%s\n" "$ac_cv_prog_cc_c11" >&6; }
4960     CC="$CC $ac_cv_prog_cc_c11"
4961fi
4962  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
4963  ac_prog_cc_stdc=c11
4964fi
4965fi
4966if test x$ac_prog_cc_stdc = xno
4967then :
4968  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
4969printf %s "checking for $CC option to enable C99 features... " >&6; }
4970if test ${ac_cv_prog_cc_c99+y}
4971then :
4972  printf %s "(cached) " >&6
4973else $as_nop
4974  ac_cv_prog_cc_c99=no
4975ac_save_CC=$CC
4976cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4977/* end confdefs.h.  */
4978$ac_c_conftest_c99_program
4979_ACEOF
4980for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99=
4981do
4982  CC="$ac_save_CC $ac_arg"
4983  if ac_fn_c_try_compile "$LINENO"
4984then :
4985  ac_cv_prog_cc_c99=$ac_arg
4986fi
4987rm -f core conftest.err conftest.$ac_objext conftest.beam
4988  test "x$ac_cv_prog_cc_c99" != "xno" && break
4989done
4990rm -f conftest.$ac_ext
4991CC=$ac_save_CC
4992fi
4993
4994if test "x$ac_cv_prog_cc_c99" = xno
4995then :
4996  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4997printf "%s\n" "unsupported" >&6; }
4998else $as_nop
4999  if test "x$ac_cv_prog_cc_c99" = x
5000then :
5001  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
5002printf "%s\n" "none needed" >&6; }
5003else $as_nop
5004  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
5005printf "%s\n" "$ac_cv_prog_cc_c99" >&6; }
5006     CC="$CC $ac_cv_prog_cc_c99"
5007fi
5008  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
5009  ac_prog_cc_stdc=c99
5010fi
5011fi
5012if test x$ac_prog_cc_stdc = xno
5013then :
5014  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
5015printf %s "checking for $CC option to enable C89 features... " >&6; }
5016if test ${ac_cv_prog_cc_c89+y}
5017then :
5018  printf %s "(cached) " >&6
5019else $as_nop
5020  ac_cv_prog_cc_c89=no
5021ac_save_CC=$CC
5022cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5023/* end confdefs.h.  */
5024$ac_c_conftest_c89_program
5025_ACEOF
5026for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
5027do
5028  CC="$ac_save_CC $ac_arg"
5029  if ac_fn_c_try_compile "$LINENO"
5030then :
5031  ac_cv_prog_cc_c89=$ac_arg
5032fi
5033rm -f core conftest.err conftest.$ac_objext conftest.beam
5034  test "x$ac_cv_prog_cc_c89" != "xno" && break
5035done
5036rm -f conftest.$ac_ext
5037CC=$ac_save_CC
5038fi
5039
5040if test "x$ac_cv_prog_cc_c89" = xno
5041then :
5042  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
5043printf "%s\n" "unsupported" >&6; }
5044else $as_nop
5045  if test "x$ac_cv_prog_cc_c89" = x
5046then :
5047  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
5048printf "%s\n" "none needed" >&6; }
5049else $as_nop
5050  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
5051printf "%s\n" "$ac_cv_prog_cc_c89" >&6; }
5052     CC="$CC $ac_cv_prog_cc_c89"
5053fi
5054  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
5055  ac_prog_cc_stdc=c89
5056fi
5057fi
5058
5059ac_ext=c
5060ac_cpp='$CPP $CPPFLAGS'
5061ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5062ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5063ac_compiler_gnu=$ac_cv_c_compiler_gnu
5064
5065
5066    if test "x$TEA_CXX" != "x"; then
5067        ac_ext=cpp
5068ac_cpp='$CXXCPP $CPPFLAGS'
5069ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5070ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5071ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
5072if test -z "$CXX"; then
5073  if test -n "$CCC"; then
5074    CXX=$CCC
5075  else
5076    if test -n "$ac_tool_prefix"; then
5077  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++
5078  do
5079    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5080set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5081{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5082printf %s "checking for $ac_word... " >&6; }
5083if test ${ac_cv_prog_CXX+y}
5084then :
5085  printf %s "(cached) " >&6
5086else $as_nop
5087  if test -n "$CXX"; then
5088  ac_cv_prog_CXX="$CXX" # Let the user override the test.
5089else
5090as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5091for as_dir in $PATH
5092do
5093  IFS=$as_save_IFS
5094  case $as_dir in #(((
5095    '') as_dir=./ ;;
5096    */) ;;
5097    *) as_dir=$as_dir/ ;;
5098  esac
5099    for ac_exec_ext in '' $ac_executable_extensions; do
5100  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
5101    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
5102    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
5103    break 2
5104  fi
5105done
5106  done
5107IFS=$as_save_IFS
5108
5109fi
5110fi
5111CXX=$ac_cv_prog_CXX
5112if test -n "$CXX"; then
5113  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
5114printf "%s\n" "$CXX" >&6; }
5115else
5116  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
5117printf "%s\n" "no" >&6; }
5118fi
5119
5120
5121    test -n "$CXX" && break
5122  done
5123fi
5124if test -z "$CXX"; then
5125  ac_ct_CXX=$CXX
5126  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++
5127do
5128  # Extract the first word of "$ac_prog", so it can be a program name with args.
5129set dummy $ac_prog; ac_word=$2
5130{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5131printf %s "checking for $ac_word... " >&6; }
5132if test ${ac_cv_prog_ac_ct_CXX+y}
5133then :
5134  printf %s "(cached) " >&6
5135else $as_nop
5136  if test -n "$ac_ct_CXX"; then
5137  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
5138else
5139as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5140for as_dir in $PATH
5141do
5142  IFS=$as_save_IFS
5143  case $as_dir in #(((
5144    '') as_dir=./ ;;
5145    */) ;;
5146    *) as_dir=$as_dir/ ;;
5147  esac
5148    for ac_exec_ext in '' $ac_executable_extensions; do
5149  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
5150    ac_cv_prog_ac_ct_CXX="$ac_prog"
5151    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
5152    break 2
5153  fi
5154done
5155  done
5156IFS=$as_save_IFS
5157
5158fi
5159fi
5160ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
5161if test -n "$ac_ct_CXX"; then
5162  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
5163printf "%s\n" "$ac_ct_CXX" >&6; }
5164else
5165  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
5166printf "%s\n" "no" >&6; }
5167fi
5168
5169
5170  test -n "$ac_ct_CXX" && break
5171done
5172
5173  if test "x$ac_ct_CXX" = x; then
5174    CXX="g++"
5175  else
5176    case $cross_compiling:$ac_tool_warned in
5177yes:)
5178{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5179printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5180ac_tool_warned=yes ;;
5181esac
5182    CXX=$ac_ct_CXX
5183  fi
5184fi
5185
5186  fi
5187fi
5188# Provide some information about the compiler.
5189printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
5190set X $ac_compile
5191ac_compiler=$2
5192for ac_option in --version -v -V -qversion; do
5193  { { ac_try="$ac_compiler $ac_option >&5"
5194case "(($ac_try" in
5195  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5196  *) ac_try_echo=$ac_try;;
5197esac
5198eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
5199printf "%s\n" "$ac_try_echo"; } >&5
5200  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
5201  ac_status=$?
5202  if test -s conftest.err; then
5203    sed '10a\
5204... rest of stderr output deleted ...
5205         10q' conftest.err >conftest.er1
5206    cat conftest.er1 >&5
5207  fi
5208  rm -f conftest.er1 conftest.err
5209  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5210  test $ac_status = 0; }
5211done
5212
5213{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5
5214printf %s "checking whether the compiler supports GNU C++... " >&6; }
5215if test ${ac_cv_cxx_compiler_gnu+y}
5216then :
5217  printf %s "(cached) " >&6
5218else $as_nop
5219  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5220/* end confdefs.h.  */
5221
5222int
5223main (void)
5224{
5225#ifndef __GNUC__
5226       choke me
5227#endif
5228
5229  ;
5230  return 0;
5231}
5232_ACEOF
5233if ac_fn_cxx_try_compile "$LINENO"
5234then :
5235  ac_compiler_gnu=yes
5236else $as_nop
5237  ac_compiler_gnu=no
5238fi
5239rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
5240ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
5241
5242fi
5243{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
5244printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; }
5245ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
5246
5247if test $ac_compiler_gnu = yes; then
5248  GXX=yes
5249else
5250  GXX=
5251fi
5252ac_test_CXXFLAGS=${CXXFLAGS+y}
5253ac_save_CXXFLAGS=$CXXFLAGS
5254{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
5255printf %s "checking whether $CXX accepts -g... " >&6; }
5256if test ${ac_cv_prog_cxx_g+y}
5257then :
5258  printf %s "(cached) " >&6
5259else $as_nop
5260  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
5261   ac_cxx_werror_flag=yes
5262   ac_cv_prog_cxx_g=no
5263   CXXFLAGS="-g"
5264   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5265/* end confdefs.h.  */
5266
5267int
5268main (void)
5269{
5270
5271  ;
5272  return 0;
5273}
5274_ACEOF
5275if ac_fn_cxx_try_compile "$LINENO"
5276then :
5277  ac_cv_prog_cxx_g=yes
5278else $as_nop
5279  CXXFLAGS=""
5280      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5281/* end confdefs.h.  */
5282
5283int
5284main (void)
5285{
5286
5287  ;
5288  return 0;
5289}
5290_ACEOF
5291if ac_fn_cxx_try_compile "$LINENO"
5292then :
5293
5294else $as_nop
5295  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
5296	 CXXFLAGS="-g"
5297	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5298/* end confdefs.h.  */
5299
5300int
5301main (void)
5302{
5303
5304  ;
5305  return 0;
5306}
5307_ACEOF
5308if ac_fn_cxx_try_compile "$LINENO"
5309then :
5310  ac_cv_prog_cxx_g=yes
5311fi
5312rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
5313fi
5314rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
5315fi
5316rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
5317   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
5318fi
5319{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
5320printf "%s\n" "$ac_cv_prog_cxx_g" >&6; }
5321if test $ac_test_CXXFLAGS; then
5322  CXXFLAGS=$ac_save_CXXFLAGS
5323elif test $ac_cv_prog_cxx_g = yes; then
5324  if test "$GXX" = yes; then
5325    CXXFLAGS="-g -O2"
5326  else
5327    CXXFLAGS="-g"
5328  fi
5329else
5330  if test "$GXX" = yes; then
5331    CXXFLAGS="-O2"
5332  else
5333    CXXFLAGS=
5334  fi
5335fi
5336ac_prog_cxx_stdcxx=no
5337if test x$ac_prog_cxx_stdcxx = xno
5338then :
5339  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5
5340printf %s "checking for $CXX option to enable C++11 features... " >&6; }
5341if test ${ac_cv_prog_cxx_11+y}
5342then :
5343  printf %s "(cached) " >&6
5344else $as_nop
5345  ac_cv_prog_cxx_11=no
5346ac_save_CXX=$CXX
5347cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5348/* end confdefs.h.  */
5349$ac_cxx_conftest_cxx11_program
5350_ACEOF
5351for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA
5352do
5353  CXX="$ac_save_CXX $ac_arg"
5354  if ac_fn_cxx_try_compile "$LINENO"
5355then :
5356  ac_cv_prog_cxx_cxx11=$ac_arg
5357fi
5358rm -f core conftest.err conftest.$ac_objext conftest.beam
5359  test "x$ac_cv_prog_cxx_cxx11" != "xno" && break
5360done
5361rm -f conftest.$ac_ext
5362CXX=$ac_save_CXX
5363fi
5364
5365if test "x$ac_cv_prog_cxx_cxx11" = xno
5366then :
5367  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
5368printf "%s\n" "unsupported" >&6; }
5369else $as_nop
5370  if test "x$ac_cv_prog_cxx_cxx11" = x
5371then :
5372  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
5373printf "%s\n" "none needed" >&6; }
5374else $as_nop
5375  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5
5376printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; }
5377     CXX="$CXX $ac_cv_prog_cxx_cxx11"
5378fi
5379  ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11
5380  ac_prog_cxx_stdcxx=cxx11
5381fi
5382fi
5383if test x$ac_prog_cxx_stdcxx = xno
5384then :
5385  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5
5386printf %s "checking for $CXX option to enable C++98 features... " >&6; }
5387if test ${ac_cv_prog_cxx_98+y}
5388then :
5389  printf %s "(cached) " >&6
5390else $as_nop
5391  ac_cv_prog_cxx_98=no
5392ac_save_CXX=$CXX
5393cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5394/* end confdefs.h.  */
5395$ac_cxx_conftest_cxx98_program
5396_ACEOF
5397for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA
5398do
5399  CXX="$ac_save_CXX $ac_arg"
5400  if ac_fn_cxx_try_compile "$LINENO"
5401then :
5402  ac_cv_prog_cxx_cxx98=$ac_arg
5403fi
5404rm -f core conftest.err conftest.$ac_objext conftest.beam
5405  test "x$ac_cv_prog_cxx_cxx98" != "xno" && break
5406done
5407rm -f conftest.$ac_ext
5408CXX=$ac_save_CXX
5409fi
5410
5411if test "x$ac_cv_prog_cxx_cxx98" = xno
5412then :
5413  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
5414printf "%s\n" "unsupported" >&6; }
5415else $as_nop
5416  if test "x$ac_cv_prog_cxx_cxx98" = x
5417then :
5418  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
5419printf "%s\n" "none needed" >&6; }
5420else $as_nop
5421  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5
5422printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; }
5423     CXX="$CXX $ac_cv_prog_cxx_cxx98"
5424fi
5425  ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98
5426  ac_prog_cxx_stdcxx=cxx98
5427fi
5428fi
5429
5430ac_ext=c
5431ac_cpp='$CPP $CPPFLAGS'
5432ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5433ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5434ac_compiler_gnu=$ac_cv_c_compiler_gnu
5435
5436    fi
5437
5438    ac_ext=c
5439ac_cpp='$CPP $CPPFLAGS'
5440ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5441ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5442ac_compiler_gnu=$ac_cv_c_compiler_gnu
5443{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
5444printf %s "checking how to run the C preprocessor... " >&6; }
5445# On Suns, sometimes $CPP names a directory.
5446if test -n "$CPP" && test -d "$CPP"; then
5447  CPP=
5448fi
5449if test -z "$CPP"; then
5450  if test ${ac_cv_prog_CPP+y}
5451then :
5452  printf %s "(cached) " >&6
5453else $as_nop
5454      # Double quotes because $CC needs to be expanded
5455    for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp
5456    do
5457      ac_preproc_ok=false
5458for ac_c_preproc_warn_flag in '' yes
5459do
5460  # Use a header file that comes with gcc, so configuring glibc
5461  # with a fresh cross-compiler works.
5462  # On the NeXT, cc -E runs the code through the compiler's parser,
5463  # not just through cpp. "Syntax error" is here to catch this case.
5464  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5465/* end confdefs.h.  */
5466#include <limits.h>
5467		     Syntax error
5468_ACEOF
5469if ac_fn_c_try_cpp "$LINENO"
5470then :
5471
5472else $as_nop
5473  # Broken: fails on valid input.
5474continue
5475fi
5476rm -f conftest.err conftest.i conftest.$ac_ext
5477
5478  # OK, works on sane cases.  Now check whether nonexistent headers
5479  # can be detected and how.
5480  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5481/* end confdefs.h.  */
5482#include <ac_nonexistent.h>
5483_ACEOF
5484if ac_fn_c_try_cpp "$LINENO"
5485then :
5486  # Broken: success on invalid input.
5487continue
5488else $as_nop
5489  # Passes both tests.
5490ac_preproc_ok=:
5491break
5492fi
5493rm -f conftest.err conftest.i conftest.$ac_ext
5494
5495done
5496# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
5497rm -f conftest.i conftest.err conftest.$ac_ext
5498if $ac_preproc_ok
5499then :
5500  break
5501fi
5502
5503    done
5504    ac_cv_prog_CPP=$CPP
5505
5506fi
5507  CPP=$ac_cv_prog_CPP
5508else
5509  ac_cv_prog_CPP=$CPP
5510fi
5511{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
5512printf "%s\n" "$CPP" >&6; }
5513ac_preproc_ok=false
5514for ac_c_preproc_warn_flag in '' yes
5515do
5516  # Use a header file that comes with gcc, so configuring glibc
5517  # with a fresh cross-compiler works.
5518  # On the NeXT, cc -E runs the code through the compiler's parser,
5519  # not just through cpp. "Syntax error" is here to catch this case.
5520  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5521/* end confdefs.h.  */
5522#include <limits.h>
5523		     Syntax error
5524_ACEOF
5525if ac_fn_c_try_cpp "$LINENO"
5526then :
5527
5528else $as_nop
5529  # Broken: fails on valid input.
5530continue
5531fi
5532rm -f conftest.err conftest.i conftest.$ac_ext
5533
5534  # OK, works on sane cases.  Now check whether nonexistent headers
5535  # can be detected and how.
5536  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5537/* end confdefs.h.  */
5538#include <ac_nonexistent.h>
5539_ACEOF
5540if ac_fn_c_try_cpp "$LINENO"
5541then :
5542  # Broken: success on invalid input.
5543continue
5544else $as_nop
5545  # Passes both tests.
5546ac_preproc_ok=:
5547break
5548fi
5549rm -f conftest.err conftest.i conftest.$ac_ext
5550
5551done
5552# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
5553rm -f conftest.i conftest.err conftest.$ac_ext
5554if $ac_preproc_ok
5555then :
5556
5557else $as_nop
5558  { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5559printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
5560as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
5561See \`config.log' for more details" "$LINENO" 5; }
5562fi
5563
5564ac_ext=c
5565ac_cpp='$CPP $CPPFLAGS'
5566ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5567ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5568ac_compiler_gnu=$ac_cv_c_compiler_gnu
5569
5570
5571    #--------------------------------------------------------------------
5572    # Checks to see if the make program sets the $MAKE variable.
5573    #--------------------------------------------------------------------
5574
5575    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
5576printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
5577set x ${MAKE-make}
5578ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
5579if eval test \${ac_cv_prog_make_${ac_make}_set+y}
5580then :
5581  printf %s "(cached) " >&6
5582else $as_nop
5583  cat >conftest.make <<\_ACEOF
5584SHELL = /bin/sh
5585all:
5586	@echo '@@@%%%=$(MAKE)=@@@%%%'
5587_ACEOF
5588# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
5589case `${MAKE-make} -f conftest.make 2>/dev/null` in
5590  *@@@%%%=?*=@@@%%%*)
5591    eval ac_cv_prog_make_${ac_make}_set=yes;;
5592  *)
5593    eval ac_cv_prog_make_${ac_make}_set=no;;
5594esac
5595rm -f conftest.make
5596fi
5597if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
5598  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5599printf "%s\n" "yes" >&6; }
5600  SET_MAKE=
5601else
5602  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
5603printf "%s\n" "no" >&6; }
5604  SET_MAKE="MAKE=${MAKE-make}"
5605fi
5606
5607
5608    #--------------------------------------------------------------------
5609    # Find ranlib
5610    #--------------------------------------------------------------------
5611
5612    if test -n "$ac_tool_prefix"; then
5613  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
5614set dummy ${ac_tool_prefix}ranlib; ac_word=$2
5615{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5616printf %s "checking for $ac_word... " >&6; }
5617if test ${ac_cv_prog_RANLIB+y}
5618then :
5619  printf %s "(cached) " >&6
5620else $as_nop
5621  if test -n "$RANLIB"; then
5622  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
5623else
5624as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5625for as_dir in $PATH
5626do
5627  IFS=$as_save_IFS
5628  case $as_dir in #(((
5629    '') as_dir=./ ;;
5630    */) ;;
5631    *) as_dir=$as_dir/ ;;
5632  esac
5633    for ac_exec_ext in '' $ac_executable_extensions; do
5634  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
5635    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
5636    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
5637    break 2
5638  fi
5639done
5640  done
5641IFS=$as_save_IFS
5642
5643fi
5644fi
5645RANLIB=$ac_cv_prog_RANLIB
5646if test -n "$RANLIB"; then
5647  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
5648printf "%s\n" "$RANLIB" >&6; }
5649else
5650  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
5651printf "%s\n" "no" >&6; }
5652fi
5653
5654
5655fi
5656if test -z "$ac_cv_prog_RANLIB"; then
5657  ac_ct_RANLIB=$RANLIB
5658  # Extract the first word of "ranlib", so it can be a program name with args.
5659set dummy ranlib; ac_word=$2
5660{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5661printf %s "checking for $ac_word... " >&6; }
5662if test ${ac_cv_prog_ac_ct_RANLIB+y}
5663then :
5664  printf %s "(cached) " >&6
5665else $as_nop
5666  if test -n "$ac_ct_RANLIB"; then
5667  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
5668else
5669as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5670for as_dir in $PATH
5671do
5672  IFS=$as_save_IFS
5673  case $as_dir in #(((
5674    '') as_dir=./ ;;
5675    */) ;;
5676    *) as_dir=$as_dir/ ;;
5677  esac
5678    for ac_exec_ext in '' $ac_executable_extensions; do
5679  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
5680    ac_cv_prog_ac_ct_RANLIB="ranlib"
5681    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
5682    break 2
5683  fi
5684done
5685  done
5686IFS=$as_save_IFS
5687
5688fi
5689fi
5690ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
5691if test -n "$ac_ct_RANLIB"; then
5692  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
5693printf "%s\n" "$ac_ct_RANLIB" >&6; }
5694else
5695  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
5696printf "%s\n" "no" >&6; }
5697fi
5698
5699  if test "x$ac_ct_RANLIB" = x; then
5700    RANLIB=""
5701  else
5702    case $cross_compiling:$ac_tool_warned in
5703yes:)
5704{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5705printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5706ac_tool_warned=yes ;;
5707esac
5708    RANLIB=$ac_ct_RANLIB
5709  fi
5710else
5711  RANLIB="$ac_cv_prog_RANLIB"
5712fi
5713
5714
5715    #--------------------------------------------------------------------
5716    # Determines the correct binary file extension (.o, .obj, .exe etc.)
5717    #--------------------------------------------------------------------
5718
5719
5720
5721
5722
5723ac_header= ac_cache=
5724for ac_item in $ac_header_c_list
5725do
5726  if test $ac_cache; then
5727    ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default"
5728    if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then
5729      printf "%s\n" "#define $ac_item 1" >> confdefs.h
5730    fi
5731    ac_header= ac_cache=
5732  elif test $ac_header; then
5733    ac_cache=$ac_item
5734  else
5735    ac_header=$ac_item
5736  fi
5737done
5738
5739
5740
5741
5742
5743
5744
5745
5746if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes
5747then :
5748
5749printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h
5750
5751fi
5752
5753    # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here.
5754
5755
5756    #------------------------------------------------------------------------
5757    # If we're using GCC, see if the compiler understands -pipe. If so, use it.
5758    # It makes compiling go faster.  (This is only a performance feature.)
5759    #------------------------------------------------------------------------
5760
5761    if test -z "$no_pipe" -a -n "$GCC"; then
5762	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -pipe" >&5
5763printf %s "checking if the compiler understands -pipe... " >&6; }
5764if test ${tcl_cv_cc_pipe+y}
5765then :
5766  printf %s "(cached) " >&6
5767else $as_nop
5768
5769	    hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe"
5770	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5771/* end confdefs.h.  */
5772
5773int
5774main (void)
5775{
5776
5777  ;
5778  return 0;
5779}
5780_ACEOF
5781if ac_fn_c_try_compile "$LINENO"
5782then :
5783  tcl_cv_cc_pipe=yes
5784else $as_nop
5785  tcl_cv_cc_pipe=no
5786fi
5787rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
5788	    CFLAGS=$hold_cflags
5789fi
5790{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_pipe" >&5
5791printf "%s\n" "$tcl_cv_cc_pipe" >&6; }
5792	if test $tcl_cv_cc_pipe = yes; then
5793	    CFLAGS="$CFLAGS -pipe"
5794	fi
5795    fi
5796
5797    if test "x$TEA_CXX" != "x"; then
5798	ac_ext=cpp
5799ac_cpp='$CXXCPP $CPPFLAGS'
5800ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5801ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5802ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
5803
5804	# 1. Find the flags for the requested standard version
5805        if test "x$TEA_CXX_VERSION" != "x"; then
5806            # AX_CXX_COMPILE_STDCXX is implemented with m4_if
5807            # therefore distinguish in case
5808            case "$TEA_CXX_VERSION" in
5809                11)   ax_cxx_compile_alternatives="11 0x"    ax_cxx_compile_cxx11_required=true
5810  ac_ext=cpp
5811ac_cpp='$CXXCPP $CPPFLAGS'
5812ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5813ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5814ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
5815  ac_success=no
5816
5817      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5
5818printf %s "checking whether $CXX supports C++11 features by default... " >&6; }
5819if test ${ax_cv_cxx_compile_cxx11+y}
5820then :
5821  printf %s "(cached) " >&6
5822else $as_nop
5823  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5824/* end confdefs.h.  */
5825
5826
5827// If the compiler admits that it is not ready for C++11, why torture it?
5828// Hopefully, this will speed up the test.
5829
5830#ifndef __cplusplus
5831
5832#error "This is not a C++ compiler"
5833
5834#elif __cplusplus < 201103L
5835
5836#error "This is not a C++11 compiler"
5837
5838#else
5839
5840namespace cxx11
5841{
5842
5843  namespace test_static_assert
5844  {
5845
5846    template <typename T>
5847    struct check
5848    {
5849      static_assert(sizeof(int) <= sizeof(T), "not big enough");
5850    };
5851
5852  }
5853
5854  namespace test_final_override
5855  {
5856
5857    struct Base
5858    {
5859      virtual ~Base() {}
5860      virtual void f() {}
5861    };
5862
5863    struct Derived : public Base
5864    {
5865      virtual ~Derived() override {}
5866      virtual void f() override {}
5867    };
5868
5869  }
5870
5871  namespace test_double_right_angle_brackets
5872  {
5873
5874    template < typename T >
5875    struct check {};
5876
5877    typedef check<void> single_type;
5878    typedef check<check<void>> double_type;
5879    typedef check<check<check<void>>> triple_type;
5880    typedef check<check<check<check<void>>>> quadruple_type;
5881
5882  }
5883
5884  namespace test_decltype
5885  {
5886
5887    int
5888    f()
5889    {
5890      int a = 1;
5891      decltype(a) b = 2;
5892      return a + b;
5893    }
5894
5895  }
5896
5897  namespace test_type_deduction
5898  {
5899
5900    template < typename T1, typename T2 >
5901    struct is_same
5902    {
5903      static const bool value = false;
5904    };
5905
5906    template < typename T >
5907    struct is_same<T, T>
5908    {
5909      static const bool value = true;
5910    };
5911
5912    template < typename T1, typename T2 >
5913    auto
5914    add(T1 a1, T2 a2) -> decltype(a1 + a2)
5915    {
5916      return a1 + a2;
5917    }
5918
5919    int
5920    test(const int c, volatile int v)
5921    {
5922      static_assert(is_same<int, decltype(0)>::value == true, "");
5923      static_assert(is_same<int, decltype(c)>::value == false, "");
5924      static_assert(is_same<int, decltype(v)>::value == false, "");
5925      auto ac = c;
5926      auto av = v;
5927      auto sumi = ac + av + 'x';
5928      auto sumf = ac + av + 1.0;
5929      static_assert(is_same<int, decltype(ac)>::value == true, "");
5930      static_assert(is_same<int, decltype(av)>::value == true, "");
5931      static_assert(is_same<int, decltype(sumi)>::value == true, "");
5932      static_assert(is_same<int, decltype(sumf)>::value == false, "");
5933      static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
5934      return (sumf > 0.0) ? sumi : add(c, v);
5935    }
5936
5937  }
5938
5939  namespace test_noexcept
5940  {
5941
5942    int f() { return 0; }
5943    int g() noexcept { return 0; }
5944
5945    static_assert(noexcept(f()) == false, "");
5946    static_assert(noexcept(g()) == true, "");
5947
5948  }
5949
5950  namespace test_constexpr
5951  {
5952
5953    template < typename CharT >
5954    unsigned long constexpr
5955    strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
5956    {
5957      return *s ? strlen_c_r(s + 1, acc + 1) : acc;
5958    }
5959
5960    template < typename CharT >
5961    unsigned long constexpr
5962    strlen_c(const CharT *const s) noexcept
5963    {
5964      return strlen_c_r(s, 0UL);
5965    }
5966
5967    static_assert(strlen_c("") == 0UL, "");
5968    static_assert(strlen_c("1") == 1UL, "");
5969    static_assert(strlen_c("example") == 7UL, "");
5970    static_assert(strlen_c("another\0example") == 7UL, "");
5971
5972  }
5973
5974  namespace test_rvalue_references
5975  {
5976
5977    template < int N >
5978    struct answer
5979    {
5980      static constexpr int value = N;
5981    };
5982
5983    answer<1> f(int&)       { return answer<1>(); }
5984    answer<2> f(const int&) { return answer<2>(); }
5985    answer<3> f(int&&)      { return answer<3>(); }
5986
5987    void
5988    test()
5989    {
5990      int i = 0;
5991      const int c = 0;
5992      static_assert(decltype(f(i))::value == 1, "");
5993      static_assert(decltype(f(c))::value == 2, "");
5994      static_assert(decltype(f(0))::value == 3, "");
5995    }
5996
5997  }
5998
5999  namespace test_uniform_initialization
6000  {
6001
6002    struct test
6003    {
6004      static const int zero {};
6005      static const int one {1};
6006    };
6007
6008    static_assert(test::zero == 0, "");
6009    static_assert(test::one == 1, "");
6010
6011  }
6012
6013  namespace test_lambdas
6014  {
6015
6016    void
6017    test1()
6018    {
6019      auto lambda1 = [](){};
6020      auto lambda2 = lambda1;
6021      lambda1();
6022      lambda2();
6023    }
6024
6025    int
6026    test2()
6027    {
6028      auto a = [](int i, int j){ return i + j; }(1, 2);
6029      auto b = []() -> int { return '0'; }();
6030      auto c = [=](){ return a + b; }();
6031      auto d = [&](){ return c; }();
6032      auto e = [a, &b](int x) mutable {
6033        const auto identity = [](int y){ return y; };
6034        for (auto i = 0; i < a; ++i)
6035          a += b--;
6036        return x + identity(a + b);
6037      }(0);
6038      return a + b + c + d + e;
6039    }
6040
6041    int
6042    test3()
6043    {
6044      const auto nullary = [](){ return 0; };
6045      const auto unary = [](int x){ return x; };
6046      using nullary_t = decltype(nullary);
6047      using unary_t = decltype(unary);
6048      const auto higher1st = [](nullary_t f){ return f(); };
6049      const auto higher2nd = [unary](nullary_t f1){
6050        return [unary, f1](unary_t f2){ return f2(unary(f1())); };
6051      };
6052      return higher1st(nullary) + higher2nd(nullary)(unary);
6053    }
6054
6055  }
6056
6057  namespace test_variadic_templates
6058  {
6059
6060    template <int...>
6061    struct sum;
6062
6063    template <int N0, int... N1toN>
6064    struct sum<N0, N1toN...>
6065    {
6066      static constexpr auto value = N0 + sum<N1toN...>::value;
6067    };
6068
6069    template <>
6070    struct sum<>
6071    {
6072      static constexpr auto value = 0;
6073    };
6074
6075    static_assert(sum<>::value == 0, "");
6076    static_assert(sum<1>::value == 1, "");
6077    static_assert(sum<23>::value == 23, "");
6078    static_assert(sum<1, 2>::value == 3, "");
6079    static_assert(sum<5, 5, 11>::value == 21, "");
6080    static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
6081
6082  }
6083
6084  // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
6085  // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
6086  // because of this.
6087  namespace test_template_alias_sfinae
6088  {
6089
6090    struct foo {};
6091
6092    template<typename T>
6093    using member = typename T::member_type;
6094
6095    template<typename T>
6096    void func(...) {}
6097
6098    template<typename T>
6099    void func(member<T>*) {}
6100
6101    void test();
6102
6103    void test() { func<foo>(0); }
6104
6105  }
6106
6107}  // namespace cxx11
6108
6109#endif  // __cplusplus >= 201103L
6110
6111
6112
6113_ACEOF
6114if ac_fn_cxx_try_compile "$LINENO"
6115then :
6116  ax_cv_cxx_compile_cxx11=yes
6117else $as_nop
6118  ax_cv_cxx_compile_cxx11=no
6119fi
6120rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
6121fi
6122{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5
6123printf "%s\n" "$ax_cv_cxx_compile_cxx11" >&6; }
6124    if test x$ax_cv_cxx_compile_cxx11 = xyes; then
6125      ac_success=yes
6126    fi
6127
6128    if test x$ac_success = xno; then
6129    for alternative in ${ax_cxx_compile_alternatives}; do
6130      switch="-std=gnu++${alternative}"
6131      cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh`
6132      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5
6133printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; }
6134if eval test \${$cachevar+y}
6135then :
6136  printf %s "(cached) " >&6
6137else $as_nop
6138  ac_save_CXX="$CXX"
6139         CXX="$CXX $switch"
6140         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6141/* end confdefs.h.  */
6142
6143
6144// If the compiler admits that it is not ready for C++11, why torture it?
6145// Hopefully, this will speed up the test.
6146
6147#ifndef __cplusplus
6148
6149#error "This is not a C++ compiler"
6150
6151#elif __cplusplus < 201103L
6152
6153#error "This is not a C++11 compiler"
6154
6155#else
6156
6157namespace cxx11
6158{
6159
6160  namespace test_static_assert
6161  {
6162
6163    template <typename T>
6164    struct check
6165    {
6166      static_assert(sizeof(int) <= sizeof(T), "not big enough");
6167    };
6168
6169  }
6170
6171  namespace test_final_override
6172  {
6173
6174    struct Base
6175    {
6176      virtual ~Base() {}
6177      virtual void f() {}
6178    };
6179
6180    struct Derived : public Base
6181    {
6182      virtual ~Derived() override {}
6183      virtual void f() override {}
6184    };
6185
6186  }
6187
6188  namespace test_double_right_angle_brackets
6189  {
6190
6191    template < typename T >
6192    struct check {};
6193
6194    typedef check<void> single_type;
6195    typedef check<check<void>> double_type;
6196    typedef check<check<check<void>>> triple_type;
6197    typedef check<check<check<check<void>>>> quadruple_type;
6198
6199  }
6200
6201  namespace test_decltype
6202  {
6203
6204    int
6205    f()
6206    {
6207      int a = 1;
6208      decltype(a) b = 2;
6209      return a + b;
6210    }
6211
6212  }
6213
6214  namespace test_type_deduction
6215  {
6216
6217    template < typename T1, typename T2 >
6218    struct is_same
6219    {
6220      static const bool value = false;
6221    };
6222
6223    template < typename T >
6224    struct is_same<T, T>
6225    {
6226      static const bool value = true;
6227    };
6228
6229    template < typename T1, typename T2 >
6230    auto
6231    add(T1 a1, T2 a2) -> decltype(a1 + a2)
6232    {
6233      return a1 + a2;
6234    }
6235
6236    int
6237    test(const int c, volatile int v)
6238    {
6239      static_assert(is_same<int, decltype(0)>::value == true, "");
6240      static_assert(is_same<int, decltype(c)>::value == false, "");
6241      static_assert(is_same<int, decltype(v)>::value == false, "");
6242      auto ac = c;
6243      auto av = v;
6244      auto sumi = ac + av + 'x';
6245      auto sumf = ac + av + 1.0;
6246      static_assert(is_same<int, decltype(ac)>::value == true, "");
6247      static_assert(is_same<int, decltype(av)>::value == true, "");
6248      static_assert(is_same<int, decltype(sumi)>::value == true, "");
6249      static_assert(is_same<int, decltype(sumf)>::value == false, "");
6250      static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
6251      return (sumf > 0.0) ? sumi : add(c, v);
6252    }
6253
6254  }
6255
6256  namespace test_noexcept
6257  {
6258
6259    int f() { return 0; }
6260    int g() noexcept { return 0; }
6261
6262    static_assert(noexcept(f()) == false, "");
6263    static_assert(noexcept(g()) == true, "");
6264
6265  }
6266
6267  namespace test_constexpr
6268  {
6269
6270    template < typename CharT >
6271    unsigned long constexpr
6272    strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
6273    {
6274      return *s ? strlen_c_r(s + 1, acc + 1) : acc;
6275    }
6276
6277    template < typename CharT >
6278    unsigned long constexpr
6279    strlen_c(const CharT *const s) noexcept
6280    {
6281      return strlen_c_r(s, 0UL);
6282    }
6283
6284    static_assert(strlen_c("") == 0UL, "");
6285    static_assert(strlen_c("1") == 1UL, "");
6286    static_assert(strlen_c("example") == 7UL, "");
6287    static_assert(strlen_c("another\0example") == 7UL, "");
6288
6289  }
6290
6291  namespace test_rvalue_references
6292  {
6293
6294    template < int N >
6295    struct answer
6296    {
6297      static constexpr int value = N;
6298    };
6299
6300    answer<1> f(int&)       { return answer<1>(); }
6301    answer<2> f(const int&) { return answer<2>(); }
6302    answer<3> f(int&&)      { return answer<3>(); }
6303
6304    void
6305    test()
6306    {
6307      int i = 0;
6308      const int c = 0;
6309      static_assert(decltype(f(i))::value == 1, "");
6310      static_assert(decltype(f(c))::value == 2, "");
6311      static_assert(decltype(f(0))::value == 3, "");
6312    }
6313
6314  }
6315
6316  namespace test_uniform_initialization
6317  {
6318
6319    struct test
6320    {
6321      static const int zero {};
6322      static const int one {1};
6323    };
6324
6325    static_assert(test::zero == 0, "");
6326    static_assert(test::one == 1, "");
6327
6328  }
6329
6330  namespace test_lambdas
6331  {
6332
6333    void
6334    test1()
6335    {
6336      auto lambda1 = [](){};
6337      auto lambda2 = lambda1;
6338      lambda1();
6339      lambda2();
6340    }
6341
6342    int
6343    test2()
6344    {
6345      auto a = [](int i, int j){ return i + j; }(1, 2);
6346      auto b = []() -> int { return '0'; }();
6347      auto c = [=](){ return a + b; }();
6348      auto d = [&](){ return c; }();
6349      auto e = [a, &b](int x) mutable {
6350        const auto identity = [](int y){ return y; };
6351        for (auto i = 0; i < a; ++i)
6352          a += b--;
6353        return x + identity(a + b);
6354      }(0);
6355      return a + b + c + d + e;
6356    }
6357
6358    int
6359    test3()
6360    {
6361      const auto nullary = [](){ return 0; };
6362      const auto unary = [](int x){ return x; };
6363      using nullary_t = decltype(nullary);
6364      using unary_t = decltype(unary);
6365      const auto higher1st = [](nullary_t f){ return f(); };
6366      const auto higher2nd = [unary](nullary_t f1){
6367        return [unary, f1](unary_t f2){ return f2(unary(f1())); };
6368      };
6369      return higher1st(nullary) + higher2nd(nullary)(unary);
6370    }
6371
6372  }
6373
6374  namespace test_variadic_templates
6375  {
6376
6377    template <int...>
6378    struct sum;
6379
6380    template <int N0, int... N1toN>
6381    struct sum<N0, N1toN...>
6382    {
6383      static constexpr auto value = N0 + sum<N1toN...>::value;
6384    };
6385
6386    template <>
6387    struct sum<>
6388    {
6389      static constexpr auto value = 0;
6390    };
6391
6392    static_assert(sum<>::value == 0, "");
6393    static_assert(sum<1>::value == 1, "");
6394    static_assert(sum<23>::value == 23, "");
6395    static_assert(sum<1, 2>::value == 3, "");
6396    static_assert(sum<5, 5, 11>::value == 21, "");
6397    static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
6398
6399  }
6400
6401  // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
6402  // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
6403  // because of this.
6404  namespace test_template_alias_sfinae
6405  {
6406
6407    struct foo {};
6408
6409    template<typename T>
6410    using member = typename T::member_type;
6411
6412    template<typename T>
6413    void func(...) {}
6414
6415    template<typename T>
6416    void func(member<T>*) {}
6417
6418    void test();
6419
6420    void test() { func<foo>(0); }
6421
6422  }
6423
6424}  // namespace cxx11
6425
6426#endif  // __cplusplus >= 201103L
6427
6428
6429
6430_ACEOF
6431if ac_fn_cxx_try_compile "$LINENO"
6432then :
6433  eval $cachevar=yes
6434else $as_nop
6435  eval $cachevar=no
6436fi
6437rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
6438         CXX="$ac_save_CXX"
6439fi
6440eval ac_res=\$$cachevar
6441	       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
6442printf "%s\n" "$ac_res" >&6; }
6443      if eval test x\$$cachevar = xyes; then
6444        CXX="$CXX $switch"
6445        if test -n "$CXXCPP" ; then
6446          CXXCPP="$CXXCPP $switch"
6447        fi
6448        ac_success=yes
6449        break
6450      fi
6451    done
6452  fi
6453
6454    if test x$ac_success = xno; then
6455                for alternative in ${ax_cxx_compile_alternatives}; do
6456      for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
6457        cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh`
6458        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5
6459printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; }
6460if eval test \${$cachevar+y}
6461then :
6462  printf %s "(cached) " >&6
6463else $as_nop
6464  ac_save_CXX="$CXX"
6465           CXX="$CXX $switch"
6466           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6467/* end confdefs.h.  */
6468
6469
6470// If the compiler admits that it is not ready for C++11, why torture it?
6471// Hopefully, this will speed up the test.
6472
6473#ifndef __cplusplus
6474
6475#error "This is not a C++ compiler"
6476
6477#elif __cplusplus < 201103L
6478
6479#error "This is not a C++11 compiler"
6480
6481#else
6482
6483namespace cxx11
6484{
6485
6486  namespace test_static_assert
6487  {
6488
6489    template <typename T>
6490    struct check
6491    {
6492      static_assert(sizeof(int) <= sizeof(T), "not big enough");
6493    };
6494
6495  }
6496
6497  namespace test_final_override
6498  {
6499
6500    struct Base
6501    {
6502      virtual ~Base() {}
6503      virtual void f() {}
6504    };
6505
6506    struct Derived : public Base
6507    {
6508      virtual ~Derived() override {}
6509      virtual void f() override {}
6510    };
6511
6512  }
6513
6514  namespace test_double_right_angle_brackets
6515  {
6516
6517    template < typename T >
6518    struct check {};
6519
6520    typedef check<void> single_type;
6521    typedef check<check<void>> double_type;
6522    typedef check<check<check<void>>> triple_type;
6523    typedef check<check<check<check<void>>>> quadruple_type;
6524
6525  }
6526
6527  namespace test_decltype
6528  {
6529
6530    int
6531    f()
6532    {
6533      int a = 1;
6534      decltype(a) b = 2;
6535      return a + b;
6536    }
6537
6538  }
6539
6540  namespace test_type_deduction
6541  {
6542
6543    template < typename T1, typename T2 >
6544    struct is_same
6545    {
6546      static const bool value = false;
6547    };
6548
6549    template < typename T >
6550    struct is_same<T, T>
6551    {
6552      static const bool value = true;
6553    };
6554
6555    template < typename T1, typename T2 >
6556    auto
6557    add(T1 a1, T2 a2) -> decltype(a1 + a2)
6558    {
6559      return a1 + a2;
6560    }
6561
6562    int
6563    test(const int c, volatile int v)
6564    {
6565      static_assert(is_same<int, decltype(0)>::value == true, "");
6566      static_assert(is_same<int, decltype(c)>::value == false, "");
6567      static_assert(is_same<int, decltype(v)>::value == false, "");
6568      auto ac = c;
6569      auto av = v;
6570      auto sumi = ac + av + 'x';
6571      auto sumf = ac + av + 1.0;
6572      static_assert(is_same<int, decltype(ac)>::value == true, "");
6573      static_assert(is_same<int, decltype(av)>::value == true, "");
6574      static_assert(is_same<int, decltype(sumi)>::value == true, "");
6575      static_assert(is_same<int, decltype(sumf)>::value == false, "");
6576      static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
6577      return (sumf > 0.0) ? sumi : add(c, v);
6578    }
6579
6580  }
6581
6582  namespace test_noexcept
6583  {
6584
6585    int f() { return 0; }
6586    int g() noexcept { return 0; }
6587
6588    static_assert(noexcept(f()) == false, "");
6589    static_assert(noexcept(g()) == true, "");
6590
6591  }
6592
6593  namespace test_constexpr
6594  {
6595
6596    template < typename CharT >
6597    unsigned long constexpr
6598    strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
6599    {
6600      return *s ? strlen_c_r(s + 1, acc + 1) : acc;
6601    }
6602
6603    template < typename CharT >
6604    unsigned long constexpr
6605    strlen_c(const CharT *const s) noexcept
6606    {
6607      return strlen_c_r(s, 0UL);
6608    }
6609
6610    static_assert(strlen_c("") == 0UL, "");
6611    static_assert(strlen_c("1") == 1UL, "");
6612    static_assert(strlen_c("example") == 7UL, "");
6613    static_assert(strlen_c("another\0example") == 7UL, "");
6614
6615  }
6616
6617  namespace test_rvalue_references
6618  {
6619
6620    template < int N >
6621    struct answer
6622    {
6623      static constexpr int value = N;
6624    };
6625
6626    answer<1> f(int&)       { return answer<1>(); }
6627    answer<2> f(const int&) { return answer<2>(); }
6628    answer<3> f(int&&)      { return answer<3>(); }
6629
6630    void
6631    test()
6632    {
6633      int i = 0;
6634      const int c = 0;
6635      static_assert(decltype(f(i))::value == 1, "");
6636      static_assert(decltype(f(c))::value == 2, "");
6637      static_assert(decltype(f(0))::value == 3, "");
6638    }
6639
6640  }
6641
6642  namespace test_uniform_initialization
6643  {
6644
6645    struct test
6646    {
6647      static const int zero {};
6648      static const int one {1};
6649    };
6650
6651    static_assert(test::zero == 0, "");
6652    static_assert(test::one == 1, "");
6653
6654  }
6655
6656  namespace test_lambdas
6657  {
6658
6659    void
6660    test1()
6661    {
6662      auto lambda1 = [](){};
6663      auto lambda2 = lambda1;
6664      lambda1();
6665      lambda2();
6666    }
6667
6668    int
6669    test2()
6670    {
6671      auto a = [](int i, int j){ return i + j; }(1, 2);
6672      auto b = []() -> int { return '0'; }();
6673      auto c = [=](){ return a + b; }();
6674      auto d = [&](){ return c; }();
6675      auto e = [a, &b](int x) mutable {
6676        const auto identity = [](int y){ return y; };
6677        for (auto i = 0; i < a; ++i)
6678          a += b--;
6679        return x + identity(a + b);
6680      }(0);
6681      return a + b + c + d + e;
6682    }
6683
6684    int
6685    test3()
6686    {
6687      const auto nullary = [](){ return 0; };
6688      const auto unary = [](int x){ return x; };
6689      using nullary_t = decltype(nullary);
6690      using unary_t = decltype(unary);
6691      const auto higher1st = [](nullary_t f){ return f(); };
6692      const auto higher2nd = [unary](nullary_t f1){
6693        return [unary, f1](unary_t f2){ return f2(unary(f1())); };
6694      };
6695      return higher1st(nullary) + higher2nd(nullary)(unary);
6696    }
6697
6698  }
6699
6700  namespace test_variadic_templates
6701  {
6702
6703    template <int...>
6704    struct sum;
6705
6706    template <int N0, int... N1toN>
6707    struct sum<N0, N1toN...>
6708    {
6709      static constexpr auto value = N0 + sum<N1toN...>::value;
6710    };
6711
6712    template <>
6713    struct sum<>
6714    {
6715      static constexpr auto value = 0;
6716    };
6717
6718    static_assert(sum<>::value == 0, "");
6719    static_assert(sum<1>::value == 1, "");
6720    static_assert(sum<23>::value == 23, "");
6721    static_assert(sum<1, 2>::value == 3, "");
6722    static_assert(sum<5, 5, 11>::value == 21, "");
6723    static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
6724
6725  }
6726
6727  // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
6728  // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
6729  // because of this.
6730  namespace test_template_alias_sfinae
6731  {
6732
6733    struct foo {};
6734
6735    template<typename T>
6736    using member = typename T::member_type;
6737
6738    template<typename T>
6739    void func(...) {}
6740
6741    template<typename T>
6742    void func(member<T>*) {}
6743
6744    void test();
6745
6746    void test() { func<foo>(0); }
6747
6748  }
6749
6750}  // namespace cxx11
6751
6752#endif  // __cplusplus >= 201103L
6753
6754
6755
6756_ACEOF
6757if ac_fn_cxx_try_compile "$LINENO"
6758then :
6759  eval $cachevar=yes
6760else $as_nop
6761  eval $cachevar=no
6762fi
6763rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
6764           CXX="$ac_save_CXX"
6765fi
6766eval ac_res=\$$cachevar
6767	       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
6768printf "%s\n" "$ac_res" >&6; }
6769        if eval test x\$$cachevar = xyes; then
6770          CXX="$CXX $switch"
6771          if test -n "$CXXCPP" ; then
6772            CXXCPP="$CXXCPP $switch"
6773          fi
6774          ac_success=yes
6775          break
6776        fi
6777      done
6778      if test x$ac_success = xyes; then
6779        break
6780      fi
6781    done
6782  fi
6783  ac_ext=cpp
6784ac_cpp='$CXXCPP $CPPFLAGS'
6785ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6786ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6787ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
6788
6789  if test x$ax_cxx_compile_cxx11_required = xtrue; then
6790    if test x$ac_success = xno; then
6791      as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5
6792    fi
6793  fi
6794  if test x$ac_success = xno; then
6795    HAVE_CXX11=0
6796    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5
6797printf "%s\n" "$as_me: No compiler with C++11 support was found" >&6;}
6798  else
6799    HAVE_CXX11=1
6800
6801printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h
6802
6803  fi
6804
6805
6806                    ;;
6807                14)   ax_cxx_compile_alternatives="14 1y"    ax_cxx_compile_cxx14_required=true
6808  ac_ext=cpp
6809ac_cpp='$CXXCPP $CPPFLAGS'
6810ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6811ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6812ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
6813  ac_success=no
6814
6815      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features by default" >&5
6816printf %s "checking whether $CXX supports C++14 features by default... " >&6; }
6817if test ${ax_cv_cxx_compile_cxx14+y}
6818then :
6819  printf %s "(cached) " >&6
6820else $as_nop
6821  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6822/* end confdefs.h.  */
6823
6824
6825// If the compiler admits that it is not ready for C++11, why torture it?
6826// Hopefully, this will speed up the test.
6827
6828#ifndef __cplusplus
6829
6830#error "This is not a C++ compiler"
6831
6832#elif __cplusplus < 201103L
6833
6834#error "This is not a C++11 compiler"
6835
6836#else
6837
6838namespace cxx11
6839{
6840
6841  namespace test_static_assert
6842  {
6843
6844    template <typename T>
6845    struct check
6846    {
6847      static_assert(sizeof(int) <= sizeof(T), "not big enough");
6848    };
6849
6850  }
6851
6852  namespace test_final_override
6853  {
6854
6855    struct Base
6856    {
6857      virtual ~Base() {}
6858      virtual void f() {}
6859    };
6860
6861    struct Derived : public Base
6862    {
6863      virtual ~Derived() override {}
6864      virtual void f() override {}
6865    };
6866
6867  }
6868
6869  namespace test_double_right_angle_brackets
6870  {
6871
6872    template < typename T >
6873    struct check {};
6874
6875    typedef check<void> single_type;
6876    typedef check<check<void>> double_type;
6877    typedef check<check<check<void>>> triple_type;
6878    typedef check<check<check<check<void>>>> quadruple_type;
6879
6880  }
6881
6882  namespace test_decltype
6883  {
6884
6885    int
6886    f()
6887    {
6888      int a = 1;
6889      decltype(a) b = 2;
6890      return a + b;
6891    }
6892
6893  }
6894
6895  namespace test_type_deduction
6896  {
6897
6898    template < typename T1, typename T2 >
6899    struct is_same
6900    {
6901      static const bool value = false;
6902    };
6903
6904    template < typename T >
6905    struct is_same<T, T>
6906    {
6907      static const bool value = true;
6908    };
6909
6910    template < typename T1, typename T2 >
6911    auto
6912    add(T1 a1, T2 a2) -> decltype(a1 + a2)
6913    {
6914      return a1 + a2;
6915    }
6916
6917    int
6918    test(const int c, volatile int v)
6919    {
6920      static_assert(is_same<int, decltype(0)>::value == true, "");
6921      static_assert(is_same<int, decltype(c)>::value == false, "");
6922      static_assert(is_same<int, decltype(v)>::value == false, "");
6923      auto ac = c;
6924      auto av = v;
6925      auto sumi = ac + av + 'x';
6926      auto sumf = ac + av + 1.0;
6927      static_assert(is_same<int, decltype(ac)>::value == true, "");
6928      static_assert(is_same<int, decltype(av)>::value == true, "");
6929      static_assert(is_same<int, decltype(sumi)>::value == true, "");
6930      static_assert(is_same<int, decltype(sumf)>::value == false, "");
6931      static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
6932      return (sumf > 0.0) ? sumi : add(c, v);
6933    }
6934
6935  }
6936
6937  namespace test_noexcept
6938  {
6939
6940    int f() { return 0; }
6941    int g() noexcept { return 0; }
6942
6943    static_assert(noexcept(f()) == false, "");
6944    static_assert(noexcept(g()) == true, "");
6945
6946  }
6947
6948  namespace test_constexpr
6949  {
6950
6951    template < typename CharT >
6952    unsigned long constexpr
6953    strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
6954    {
6955      return *s ? strlen_c_r(s + 1, acc + 1) : acc;
6956    }
6957
6958    template < typename CharT >
6959    unsigned long constexpr
6960    strlen_c(const CharT *const s) noexcept
6961    {
6962      return strlen_c_r(s, 0UL);
6963    }
6964
6965    static_assert(strlen_c("") == 0UL, "");
6966    static_assert(strlen_c("1") == 1UL, "");
6967    static_assert(strlen_c("example") == 7UL, "");
6968    static_assert(strlen_c("another\0example") == 7UL, "");
6969
6970  }
6971
6972  namespace test_rvalue_references
6973  {
6974
6975    template < int N >
6976    struct answer
6977    {
6978      static constexpr int value = N;
6979    };
6980
6981    answer<1> f(int&)       { return answer<1>(); }
6982    answer<2> f(const int&) { return answer<2>(); }
6983    answer<3> f(int&&)      { return answer<3>(); }
6984
6985    void
6986    test()
6987    {
6988      int i = 0;
6989      const int c = 0;
6990      static_assert(decltype(f(i))::value == 1, "");
6991      static_assert(decltype(f(c))::value == 2, "");
6992      static_assert(decltype(f(0))::value == 3, "");
6993    }
6994
6995  }
6996
6997  namespace test_uniform_initialization
6998  {
6999
7000    struct test
7001    {
7002      static const int zero {};
7003      static const int one {1};
7004    };
7005
7006    static_assert(test::zero == 0, "");
7007    static_assert(test::one == 1, "");
7008
7009  }
7010
7011  namespace test_lambdas
7012  {
7013
7014    void
7015    test1()
7016    {
7017      auto lambda1 = [](){};
7018      auto lambda2 = lambda1;
7019      lambda1();
7020      lambda2();
7021    }
7022
7023    int
7024    test2()
7025    {
7026      auto a = [](int i, int j){ return i + j; }(1, 2);
7027      auto b = []() -> int { return '0'; }();
7028      auto c = [=](){ return a + b; }();
7029      auto d = [&](){ return c; }();
7030      auto e = [a, &b](int x) mutable {
7031        const auto identity = [](int y){ return y; };
7032        for (auto i = 0; i < a; ++i)
7033          a += b--;
7034        return x + identity(a + b);
7035      }(0);
7036      return a + b + c + d + e;
7037    }
7038
7039    int
7040    test3()
7041    {
7042      const auto nullary = [](){ return 0; };
7043      const auto unary = [](int x){ return x; };
7044      using nullary_t = decltype(nullary);
7045      using unary_t = decltype(unary);
7046      const auto higher1st = [](nullary_t f){ return f(); };
7047      const auto higher2nd = [unary](nullary_t f1){
7048        return [unary, f1](unary_t f2){ return f2(unary(f1())); };
7049      };
7050      return higher1st(nullary) + higher2nd(nullary)(unary);
7051    }
7052
7053  }
7054
7055  namespace test_variadic_templates
7056  {
7057
7058    template <int...>
7059    struct sum;
7060
7061    template <int N0, int... N1toN>
7062    struct sum<N0, N1toN...>
7063    {
7064      static constexpr auto value = N0 + sum<N1toN...>::value;
7065    };
7066
7067    template <>
7068    struct sum<>
7069    {
7070      static constexpr auto value = 0;
7071    };
7072
7073    static_assert(sum<>::value == 0, "");
7074    static_assert(sum<1>::value == 1, "");
7075    static_assert(sum<23>::value == 23, "");
7076    static_assert(sum<1, 2>::value == 3, "");
7077    static_assert(sum<5, 5, 11>::value == 21, "");
7078    static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
7079
7080  }
7081
7082  // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
7083  // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
7084  // because of this.
7085  namespace test_template_alias_sfinae
7086  {
7087
7088    struct foo {};
7089
7090    template<typename T>
7091    using member = typename T::member_type;
7092
7093    template<typename T>
7094    void func(...) {}
7095
7096    template<typename T>
7097    void func(member<T>*) {}
7098
7099    void test();
7100
7101    void test() { func<foo>(0); }
7102
7103  }
7104
7105}  // namespace cxx11
7106
7107#endif  // __cplusplus >= 201103L
7108
7109
7110
7111
7112// If the compiler admits that it is not ready for C++14, why torture it?
7113// Hopefully, this will speed up the test.
7114
7115#ifndef __cplusplus
7116
7117#error "This is not a C++ compiler"
7118
7119#elif __cplusplus < 201402L
7120
7121#error "This is not a C++14 compiler"
7122
7123#else
7124
7125namespace cxx14
7126{
7127
7128  namespace test_polymorphic_lambdas
7129  {
7130
7131    int
7132    test()
7133    {
7134      const auto lambda = [](auto&&... args){
7135        const auto istiny = [](auto x){
7136          return (sizeof(x) == 1UL) ? 1 : 0;
7137        };
7138        const int aretiny[] = { istiny(args)... };
7139        return aretiny[0];
7140      };
7141      return lambda(1, 1L, 1.0f, '1');
7142    }
7143
7144  }
7145
7146  namespace test_binary_literals
7147  {
7148
7149    constexpr auto ivii = 0b0000000000101010;
7150    static_assert(ivii == 42, "wrong value");
7151
7152  }
7153
7154  namespace test_generalized_constexpr
7155  {
7156
7157    template < typename CharT >
7158    constexpr unsigned long
7159    strlen_c(const CharT *const s) noexcept
7160    {
7161      auto length = 0UL;
7162      for (auto p = s; *p; ++p)
7163        ++length;
7164      return length;
7165    }
7166
7167    static_assert(strlen_c("") == 0UL, "");
7168    static_assert(strlen_c("x") == 1UL, "");
7169    static_assert(strlen_c("test") == 4UL, "");
7170    static_assert(strlen_c("another\0test") == 7UL, "");
7171
7172  }
7173
7174  namespace test_lambda_init_capture
7175  {
7176
7177    int
7178    test()
7179    {
7180      auto x = 0;
7181      const auto lambda1 = [a = x](int b){ return a + b; };
7182      const auto lambda2 = [a = lambda1(x)](){ return a; };
7183      return lambda2();
7184    }
7185
7186  }
7187
7188  namespace test_digit_separators
7189  {
7190
7191    constexpr auto ten_million = 100'000'000;
7192    static_assert(ten_million == 100000000, "");
7193
7194  }
7195
7196  namespace test_return_type_deduction
7197  {
7198
7199    auto f(int& x) { return x; }
7200    decltype(auto) g(int& x) { return x; }
7201
7202    template < typename T1, typename T2 >
7203    struct is_same
7204    {
7205      static constexpr auto value = false;
7206    };
7207
7208    template < typename T >
7209    struct is_same<T, T>
7210    {
7211      static constexpr auto value = true;
7212    };
7213
7214    int
7215    test()
7216    {
7217      auto x = 0;
7218      static_assert(is_same<int, decltype(f(x))>::value, "");
7219      static_assert(is_same<int&, decltype(g(x))>::value, "");
7220      return x;
7221    }
7222
7223  }
7224
7225}  // namespace cxx14
7226
7227#endif  // __cplusplus >= 201402L
7228
7229
7230
7231_ACEOF
7232if ac_fn_cxx_try_compile "$LINENO"
7233then :
7234  ax_cv_cxx_compile_cxx14=yes
7235else $as_nop
7236  ax_cv_cxx_compile_cxx14=no
7237fi
7238rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
7239fi
7240{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx14" >&5
7241printf "%s\n" "$ax_cv_cxx_compile_cxx14" >&6; }
7242    if test x$ax_cv_cxx_compile_cxx14 = xyes; then
7243      ac_success=yes
7244    fi
7245
7246    if test x$ac_success = xno; then
7247    for alternative in ${ax_cxx_compile_alternatives}; do
7248      switch="-std=gnu++${alternative}"
7249      cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx14_$switch" | $as_tr_sh`
7250      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features with $switch" >&5
7251printf %s "checking whether $CXX supports C++14 features with $switch... " >&6; }
7252if eval test \${$cachevar+y}
7253then :
7254  printf %s "(cached) " >&6
7255else $as_nop
7256  ac_save_CXX="$CXX"
7257         CXX="$CXX $switch"
7258         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7259/* end confdefs.h.  */
7260
7261
7262// If the compiler admits that it is not ready for C++11, why torture it?
7263// Hopefully, this will speed up the test.
7264
7265#ifndef __cplusplus
7266
7267#error "This is not a C++ compiler"
7268
7269#elif __cplusplus < 201103L
7270
7271#error "This is not a C++11 compiler"
7272
7273#else
7274
7275namespace cxx11
7276{
7277
7278  namespace test_static_assert
7279  {
7280
7281    template <typename T>
7282    struct check
7283    {
7284      static_assert(sizeof(int) <= sizeof(T), "not big enough");
7285    };
7286
7287  }
7288
7289  namespace test_final_override
7290  {
7291
7292    struct Base
7293    {
7294      virtual ~Base() {}
7295      virtual void f() {}
7296    };
7297
7298    struct Derived : public Base
7299    {
7300      virtual ~Derived() override {}
7301      virtual void f() override {}
7302    };
7303
7304  }
7305
7306  namespace test_double_right_angle_brackets
7307  {
7308
7309    template < typename T >
7310    struct check {};
7311
7312    typedef check<void> single_type;
7313    typedef check<check<void>> double_type;
7314    typedef check<check<check<void>>> triple_type;
7315    typedef check<check<check<check<void>>>> quadruple_type;
7316
7317  }
7318
7319  namespace test_decltype
7320  {
7321
7322    int
7323    f()
7324    {
7325      int a = 1;
7326      decltype(a) b = 2;
7327      return a + b;
7328    }
7329
7330  }
7331
7332  namespace test_type_deduction
7333  {
7334
7335    template < typename T1, typename T2 >
7336    struct is_same
7337    {
7338      static const bool value = false;
7339    };
7340
7341    template < typename T >
7342    struct is_same<T, T>
7343    {
7344      static const bool value = true;
7345    };
7346
7347    template < typename T1, typename T2 >
7348    auto
7349    add(T1 a1, T2 a2) -> decltype(a1 + a2)
7350    {
7351      return a1 + a2;
7352    }
7353
7354    int
7355    test(const int c, volatile int v)
7356    {
7357      static_assert(is_same<int, decltype(0)>::value == true, "");
7358      static_assert(is_same<int, decltype(c)>::value == false, "");
7359      static_assert(is_same<int, decltype(v)>::value == false, "");
7360      auto ac = c;
7361      auto av = v;
7362      auto sumi = ac + av + 'x';
7363      auto sumf = ac + av + 1.0;
7364      static_assert(is_same<int, decltype(ac)>::value == true, "");
7365      static_assert(is_same<int, decltype(av)>::value == true, "");
7366      static_assert(is_same<int, decltype(sumi)>::value == true, "");
7367      static_assert(is_same<int, decltype(sumf)>::value == false, "");
7368      static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
7369      return (sumf > 0.0) ? sumi : add(c, v);
7370    }
7371
7372  }
7373
7374  namespace test_noexcept
7375  {
7376
7377    int f() { return 0; }
7378    int g() noexcept { return 0; }
7379
7380    static_assert(noexcept(f()) == false, "");
7381    static_assert(noexcept(g()) == true, "");
7382
7383  }
7384
7385  namespace test_constexpr
7386  {
7387
7388    template < typename CharT >
7389    unsigned long constexpr
7390    strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
7391    {
7392      return *s ? strlen_c_r(s + 1, acc + 1) : acc;
7393    }
7394
7395    template < typename CharT >
7396    unsigned long constexpr
7397    strlen_c(const CharT *const s) noexcept
7398    {
7399      return strlen_c_r(s, 0UL);
7400    }
7401
7402    static_assert(strlen_c("") == 0UL, "");
7403    static_assert(strlen_c("1") == 1UL, "");
7404    static_assert(strlen_c("example") == 7UL, "");
7405    static_assert(strlen_c("another\0example") == 7UL, "");
7406
7407  }
7408
7409  namespace test_rvalue_references
7410  {
7411
7412    template < int N >
7413    struct answer
7414    {
7415      static constexpr int value = N;
7416    };
7417
7418    answer<1> f(int&)       { return answer<1>(); }
7419    answer<2> f(const int&) { return answer<2>(); }
7420    answer<3> f(int&&)      { return answer<3>(); }
7421
7422    void
7423    test()
7424    {
7425      int i = 0;
7426      const int c = 0;
7427      static_assert(decltype(f(i))::value == 1, "");
7428      static_assert(decltype(f(c))::value == 2, "");
7429      static_assert(decltype(f(0))::value == 3, "");
7430    }
7431
7432  }
7433
7434  namespace test_uniform_initialization
7435  {
7436
7437    struct test
7438    {
7439      static const int zero {};
7440      static const int one {1};
7441    };
7442
7443    static_assert(test::zero == 0, "");
7444    static_assert(test::one == 1, "");
7445
7446  }
7447
7448  namespace test_lambdas
7449  {
7450
7451    void
7452    test1()
7453    {
7454      auto lambda1 = [](){};
7455      auto lambda2 = lambda1;
7456      lambda1();
7457      lambda2();
7458    }
7459
7460    int
7461    test2()
7462    {
7463      auto a = [](int i, int j){ return i + j; }(1, 2);
7464      auto b = []() -> int { return '0'; }();
7465      auto c = [=](){ return a + b; }();
7466      auto d = [&](){ return c; }();
7467      auto e = [a, &b](int x) mutable {
7468        const auto identity = [](int y){ return y; };
7469        for (auto i = 0; i < a; ++i)
7470          a += b--;
7471        return x + identity(a + b);
7472      }(0);
7473      return a + b + c + d + e;
7474    }
7475
7476    int
7477    test3()
7478    {
7479      const auto nullary = [](){ return 0; };
7480      const auto unary = [](int x){ return x; };
7481      using nullary_t = decltype(nullary);
7482      using unary_t = decltype(unary);
7483      const auto higher1st = [](nullary_t f){ return f(); };
7484      const auto higher2nd = [unary](nullary_t f1){
7485        return [unary, f1](unary_t f2){ return f2(unary(f1())); };
7486      };
7487      return higher1st(nullary) + higher2nd(nullary)(unary);
7488    }
7489
7490  }
7491
7492  namespace test_variadic_templates
7493  {
7494
7495    template <int...>
7496    struct sum;
7497
7498    template <int N0, int... N1toN>
7499    struct sum<N0, N1toN...>
7500    {
7501      static constexpr auto value = N0 + sum<N1toN...>::value;
7502    };
7503
7504    template <>
7505    struct sum<>
7506    {
7507      static constexpr auto value = 0;
7508    };
7509
7510    static_assert(sum<>::value == 0, "");
7511    static_assert(sum<1>::value == 1, "");
7512    static_assert(sum<23>::value == 23, "");
7513    static_assert(sum<1, 2>::value == 3, "");
7514    static_assert(sum<5, 5, 11>::value == 21, "");
7515    static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
7516
7517  }
7518
7519  // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
7520  // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
7521  // because of this.
7522  namespace test_template_alias_sfinae
7523  {
7524
7525    struct foo {};
7526
7527    template<typename T>
7528    using member = typename T::member_type;
7529
7530    template<typename T>
7531    void func(...) {}
7532
7533    template<typename T>
7534    void func(member<T>*) {}
7535
7536    void test();
7537
7538    void test() { func<foo>(0); }
7539
7540  }
7541
7542}  // namespace cxx11
7543
7544#endif  // __cplusplus >= 201103L
7545
7546
7547
7548
7549// If the compiler admits that it is not ready for C++14, why torture it?
7550// Hopefully, this will speed up the test.
7551
7552#ifndef __cplusplus
7553
7554#error "This is not a C++ compiler"
7555
7556#elif __cplusplus < 201402L
7557
7558#error "This is not a C++14 compiler"
7559
7560#else
7561
7562namespace cxx14
7563{
7564
7565  namespace test_polymorphic_lambdas
7566  {
7567
7568    int
7569    test()
7570    {
7571      const auto lambda = [](auto&&... args){
7572        const auto istiny = [](auto x){
7573          return (sizeof(x) == 1UL) ? 1 : 0;
7574        };
7575        const int aretiny[] = { istiny(args)... };
7576        return aretiny[0];
7577      };
7578      return lambda(1, 1L, 1.0f, '1');
7579    }
7580
7581  }
7582
7583  namespace test_binary_literals
7584  {
7585
7586    constexpr auto ivii = 0b0000000000101010;
7587    static_assert(ivii == 42, "wrong value");
7588
7589  }
7590
7591  namespace test_generalized_constexpr
7592  {
7593
7594    template < typename CharT >
7595    constexpr unsigned long
7596    strlen_c(const CharT *const s) noexcept
7597    {
7598      auto length = 0UL;
7599      for (auto p = s; *p; ++p)
7600        ++length;
7601      return length;
7602    }
7603
7604    static_assert(strlen_c("") == 0UL, "");
7605    static_assert(strlen_c("x") == 1UL, "");
7606    static_assert(strlen_c("test") == 4UL, "");
7607    static_assert(strlen_c("another\0test") == 7UL, "");
7608
7609  }
7610
7611  namespace test_lambda_init_capture
7612  {
7613
7614    int
7615    test()
7616    {
7617      auto x = 0;
7618      const auto lambda1 = [a = x](int b){ return a + b; };
7619      const auto lambda2 = [a = lambda1(x)](){ return a; };
7620      return lambda2();
7621    }
7622
7623  }
7624
7625  namespace test_digit_separators
7626  {
7627
7628    constexpr auto ten_million = 100'000'000;
7629    static_assert(ten_million == 100000000, "");
7630
7631  }
7632
7633  namespace test_return_type_deduction
7634  {
7635
7636    auto f(int& x) { return x; }
7637    decltype(auto) g(int& x) { return x; }
7638
7639    template < typename T1, typename T2 >
7640    struct is_same
7641    {
7642      static constexpr auto value = false;
7643    };
7644
7645    template < typename T >
7646    struct is_same<T, T>
7647    {
7648      static constexpr auto value = true;
7649    };
7650
7651    int
7652    test()
7653    {
7654      auto x = 0;
7655      static_assert(is_same<int, decltype(f(x))>::value, "");
7656      static_assert(is_same<int&, decltype(g(x))>::value, "");
7657      return x;
7658    }
7659
7660  }
7661
7662}  // namespace cxx14
7663
7664#endif  // __cplusplus >= 201402L
7665
7666
7667
7668_ACEOF
7669if ac_fn_cxx_try_compile "$LINENO"
7670then :
7671  eval $cachevar=yes
7672else $as_nop
7673  eval $cachevar=no
7674fi
7675rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
7676         CXX="$ac_save_CXX"
7677fi
7678eval ac_res=\$$cachevar
7679	       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
7680printf "%s\n" "$ac_res" >&6; }
7681      if eval test x\$$cachevar = xyes; then
7682        CXX="$CXX $switch"
7683        if test -n "$CXXCPP" ; then
7684          CXXCPP="$CXXCPP $switch"
7685        fi
7686        ac_success=yes
7687        break
7688      fi
7689    done
7690  fi
7691
7692    if test x$ac_success = xno; then
7693                for alternative in ${ax_cxx_compile_alternatives}; do
7694      for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
7695        cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx14_$switch" | $as_tr_sh`
7696        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features with $switch" >&5
7697printf %s "checking whether $CXX supports C++14 features with $switch... " >&6; }
7698if eval test \${$cachevar+y}
7699then :
7700  printf %s "(cached) " >&6
7701else $as_nop
7702  ac_save_CXX="$CXX"
7703           CXX="$CXX $switch"
7704           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7705/* end confdefs.h.  */
7706
7707
7708// If the compiler admits that it is not ready for C++11, why torture it?
7709// Hopefully, this will speed up the test.
7710
7711#ifndef __cplusplus
7712
7713#error "This is not a C++ compiler"
7714
7715#elif __cplusplus < 201103L
7716
7717#error "This is not a C++11 compiler"
7718
7719#else
7720
7721namespace cxx11
7722{
7723
7724  namespace test_static_assert
7725  {
7726
7727    template <typename T>
7728    struct check
7729    {
7730      static_assert(sizeof(int) <= sizeof(T), "not big enough");
7731    };
7732
7733  }
7734
7735  namespace test_final_override
7736  {
7737
7738    struct Base
7739    {
7740      virtual ~Base() {}
7741      virtual void f() {}
7742    };
7743
7744    struct Derived : public Base
7745    {
7746      virtual ~Derived() override {}
7747      virtual void f() override {}
7748    };
7749
7750  }
7751
7752  namespace test_double_right_angle_brackets
7753  {
7754
7755    template < typename T >
7756    struct check {};
7757
7758    typedef check<void> single_type;
7759    typedef check<check<void>> double_type;
7760    typedef check<check<check<void>>> triple_type;
7761    typedef check<check<check<check<void>>>> quadruple_type;
7762
7763  }
7764
7765  namespace test_decltype
7766  {
7767
7768    int
7769    f()
7770    {
7771      int a = 1;
7772      decltype(a) b = 2;
7773      return a + b;
7774    }
7775
7776  }
7777
7778  namespace test_type_deduction
7779  {
7780
7781    template < typename T1, typename T2 >
7782    struct is_same
7783    {
7784      static const bool value = false;
7785    };
7786
7787    template < typename T >
7788    struct is_same<T, T>
7789    {
7790      static const bool value = true;
7791    };
7792
7793    template < typename T1, typename T2 >
7794    auto
7795    add(T1 a1, T2 a2) -> decltype(a1 + a2)
7796    {
7797      return a1 + a2;
7798    }
7799
7800    int
7801    test(const int c, volatile int v)
7802    {
7803      static_assert(is_same<int, decltype(0)>::value == true, "");
7804      static_assert(is_same<int, decltype(c)>::value == false, "");
7805      static_assert(is_same<int, decltype(v)>::value == false, "");
7806      auto ac = c;
7807      auto av = v;
7808      auto sumi = ac + av + 'x';
7809      auto sumf = ac + av + 1.0;
7810      static_assert(is_same<int, decltype(ac)>::value == true, "");
7811      static_assert(is_same<int, decltype(av)>::value == true, "");
7812      static_assert(is_same<int, decltype(sumi)>::value == true, "");
7813      static_assert(is_same<int, decltype(sumf)>::value == false, "");
7814      static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
7815      return (sumf > 0.0) ? sumi : add(c, v);
7816    }
7817
7818  }
7819
7820  namespace test_noexcept
7821  {
7822
7823    int f() { return 0; }
7824    int g() noexcept { return 0; }
7825
7826    static_assert(noexcept(f()) == false, "");
7827    static_assert(noexcept(g()) == true, "");
7828
7829  }
7830
7831  namespace test_constexpr
7832  {
7833
7834    template < typename CharT >
7835    unsigned long constexpr
7836    strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
7837    {
7838      return *s ? strlen_c_r(s + 1, acc + 1) : acc;
7839    }
7840
7841    template < typename CharT >
7842    unsigned long constexpr
7843    strlen_c(const CharT *const s) noexcept
7844    {
7845      return strlen_c_r(s, 0UL);
7846    }
7847
7848    static_assert(strlen_c("") == 0UL, "");
7849    static_assert(strlen_c("1") == 1UL, "");
7850    static_assert(strlen_c("example") == 7UL, "");
7851    static_assert(strlen_c("another\0example") == 7UL, "");
7852
7853  }
7854
7855  namespace test_rvalue_references
7856  {
7857
7858    template < int N >
7859    struct answer
7860    {
7861      static constexpr int value = N;
7862    };
7863
7864    answer<1> f(int&)       { return answer<1>(); }
7865    answer<2> f(const int&) { return answer<2>(); }
7866    answer<3> f(int&&)      { return answer<3>(); }
7867
7868    void
7869    test()
7870    {
7871      int i = 0;
7872      const int c = 0;
7873      static_assert(decltype(f(i))::value == 1, "");
7874      static_assert(decltype(f(c))::value == 2, "");
7875      static_assert(decltype(f(0))::value == 3, "");
7876    }
7877
7878  }
7879
7880  namespace test_uniform_initialization
7881  {
7882
7883    struct test
7884    {
7885      static const int zero {};
7886      static const int one {1};
7887    };
7888
7889    static_assert(test::zero == 0, "");
7890    static_assert(test::one == 1, "");
7891
7892  }
7893
7894  namespace test_lambdas
7895  {
7896
7897    void
7898    test1()
7899    {
7900      auto lambda1 = [](){};
7901      auto lambda2 = lambda1;
7902      lambda1();
7903      lambda2();
7904    }
7905
7906    int
7907    test2()
7908    {
7909      auto a = [](int i, int j){ return i + j; }(1, 2);
7910      auto b = []() -> int { return '0'; }();
7911      auto c = [=](){ return a + b; }();
7912      auto d = [&](){ return c; }();
7913      auto e = [a, &b](int x) mutable {
7914        const auto identity = [](int y){ return y; };
7915        for (auto i = 0; i < a; ++i)
7916          a += b--;
7917        return x + identity(a + b);
7918      }(0);
7919      return a + b + c + d + e;
7920    }
7921
7922    int
7923    test3()
7924    {
7925      const auto nullary = [](){ return 0; };
7926      const auto unary = [](int x){ return x; };
7927      using nullary_t = decltype(nullary);
7928      using unary_t = decltype(unary);
7929      const auto higher1st = [](nullary_t f){ return f(); };
7930      const auto higher2nd = [unary](nullary_t f1){
7931        return [unary, f1](unary_t f2){ return f2(unary(f1())); };
7932      };
7933      return higher1st(nullary) + higher2nd(nullary)(unary);
7934    }
7935
7936  }
7937
7938  namespace test_variadic_templates
7939  {
7940
7941    template <int...>
7942    struct sum;
7943
7944    template <int N0, int... N1toN>
7945    struct sum<N0, N1toN...>
7946    {
7947      static constexpr auto value = N0 + sum<N1toN...>::value;
7948    };
7949
7950    template <>
7951    struct sum<>
7952    {
7953      static constexpr auto value = 0;
7954    };
7955
7956    static_assert(sum<>::value == 0, "");
7957    static_assert(sum<1>::value == 1, "");
7958    static_assert(sum<23>::value == 23, "");
7959    static_assert(sum<1, 2>::value == 3, "");
7960    static_assert(sum<5, 5, 11>::value == 21, "");
7961    static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
7962
7963  }
7964
7965  // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
7966  // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
7967  // because of this.
7968  namespace test_template_alias_sfinae
7969  {
7970
7971    struct foo {};
7972
7973    template<typename T>
7974    using member = typename T::member_type;
7975
7976    template<typename T>
7977    void func(...) {}
7978
7979    template<typename T>
7980    void func(member<T>*) {}
7981
7982    void test();
7983
7984    void test() { func<foo>(0); }
7985
7986  }
7987
7988}  // namespace cxx11
7989
7990#endif  // __cplusplus >= 201103L
7991
7992
7993
7994
7995// If the compiler admits that it is not ready for C++14, why torture it?
7996// Hopefully, this will speed up the test.
7997
7998#ifndef __cplusplus
7999
8000#error "This is not a C++ compiler"
8001
8002#elif __cplusplus < 201402L
8003
8004#error "This is not a C++14 compiler"
8005
8006#else
8007
8008namespace cxx14
8009{
8010
8011  namespace test_polymorphic_lambdas
8012  {
8013
8014    int
8015    test()
8016    {
8017      const auto lambda = [](auto&&... args){
8018        const auto istiny = [](auto x){
8019          return (sizeof(x) == 1UL) ? 1 : 0;
8020        };
8021        const int aretiny[] = { istiny(args)... };
8022        return aretiny[0];
8023      };
8024      return lambda(1, 1L, 1.0f, '1');
8025    }
8026
8027  }
8028
8029  namespace test_binary_literals
8030  {
8031
8032    constexpr auto ivii = 0b0000000000101010;
8033    static_assert(ivii == 42, "wrong value");
8034
8035  }
8036
8037  namespace test_generalized_constexpr
8038  {
8039
8040    template < typename CharT >
8041    constexpr unsigned long
8042    strlen_c(const CharT *const s) noexcept
8043    {
8044      auto length = 0UL;
8045      for (auto p = s; *p; ++p)
8046        ++length;
8047      return length;
8048    }
8049
8050    static_assert(strlen_c("") == 0UL, "");
8051    static_assert(strlen_c("x") == 1UL, "");
8052    static_assert(strlen_c("test") == 4UL, "");
8053    static_assert(strlen_c("another\0test") == 7UL, "");
8054
8055  }
8056
8057  namespace test_lambda_init_capture
8058  {
8059
8060    int
8061    test()
8062    {
8063      auto x = 0;
8064      const auto lambda1 = [a = x](int b){ return a + b; };
8065      const auto lambda2 = [a = lambda1(x)](){ return a; };
8066      return lambda2();
8067    }
8068
8069  }
8070
8071  namespace test_digit_separators
8072  {
8073
8074    constexpr auto ten_million = 100'000'000;
8075    static_assert(ten_million == 100000000, "");
8076
8077  }
8078
8079  namespace test_return_type_deduction
8080  {
8081
8082    auto f(int& x) { return x; }
8083    decltype(auto) g(int& x) { return x; }
8084
8085    template < typename T1, typename T2 >
8086    struct is_same
8087    {
8088      static constexpr auto value = false;
8089    };
8090
8091    template < typename T >
8092    struct is_same<T, T>
8093    {
8094      static constexpr auto value = true;
8095    };
8096
8097    int
8098    test()
8099    {
8100      auto x = 0;
8101      static_assert(is_same<int, decltype(f(x))>::value, "");
8102      static_assert(is_same<int&, decltype(g(x))>::value, "");
8103      return x;
8104    }
8105
8106  }
8107
8108}  // namespace cxx14
8109
8110#endif  // __cplusplus >= 201402L
8111
8112
8113
8114_ACEOF
8115if ac_fn_cxx_try_compile "$LINENO"
8116then :
8117  eval $cachevar=yes
8118else $as_nop
8119  eval $cachevar=no
8120fi
8121rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
8122           CXX="$ac_save_CXX"
8123fi
8124eval ac_res=\$$cachevar
8125	       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
8126printf "%s\n" "$ac_res" >&6; }
8127        if eval test x\$$cachevar = xyes; then
8128          CXX="$CXX $switch"
8129          if test -n "$CXXCPP" ; then
8130            CXXCPP="$CXXCPP $switch"
8131          fi
8132          ac_success=yes
8133          break
8134        fi
8135      done
8136      if test x$ac_success = xyes; then
8137        break
8138      fi
8139    done
8140  fi
8141  ac_ext=cpp
8142ac_cpp='$CXXCPP $CPPFLAGS'
8143ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8144ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8145ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
8146
8147  if test x$ax_cxx_compile_cxx14_required = xtrue; then
8148    if test x$ac_success = xno; then
8149      as_fn_error $? "*** A compiler with support for C++14 language features is required." "$LINENO" 5
8150    fi
8151  fi
8152  if test x$ac_success = xno; then
8153    HAVE_CXX14=0
8154    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++14 support was found" >&5
8155printf "%s\n" "$as_me: No compiler with C++14 support was found" >&6;}
8156  else
8157    HAVE_CXX14=1
8158
8159printf "%s\n" "#define HAVE_CXX14 1" >>confdefs.h
8160
8161  fi
8162
8163 ;;
8164                17)   ax_cxx_compile_alternatives="17 1z"    ax_cxx_compile_cxx17_required=true
8165  ac_ext=cpp
8166ac_cpp='$CXXCPP $CPPFLAGS'
8167ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8168ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8169ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
8170  ac_success=no
8171
8172      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features by default" >&5
8173printf %s "checking whether $CXX supports C++17 features by default... " >&6; }
8174if test ${ax_cv_cxx_compile_cxx17+y}
8175then :
8176  printf %s "(cached) " >&6
8177else $as_nop
8178  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8179/* end confdefs.h.  */
8180
8181
8182// If the compiler admits that it is not ready for C++11, why torture it?
8183// Hopefully, this will speed up the test.
8184
8185#ifndef __cplusplus
8186
8187#error "This is not a C++ compiler"
8188
8189#elif __cplusplus < 201103L
8190
8191#error "This is not a C++11 compiler"
8192
8193#else
8194
8195namespace cxx11
8196{
8197
8198  namespace test_static_assert
8199  {
8200
8201    template <typename T>
8202    struct check
8203    {
8204      static_assert(sizeof(int) <= sizeof(T), "not big enough");
8205    };
8206
8207  }
8208
8209  namespace test_final_override
8210  {
8211
8212    struct Base
8213    {
8214      virtual ~Base() {}
8215      virtual void f() {}
8216    };
8217
8218    struct Derived : public Base
8219    {
8220      virtual ~Derived() override {}
8221      virtual void f() override {}
8222    };
8223
8224  }
8225
8226  namespace test_double_right_angle_brackets
8227  {
8228
8229    template < typename T >
8230    struct check {};
8231
8232    typedef check<void> single_type;
8233    typedef check<check<void>> double_type;
8234    typedef check<check<check<void>>> triple_type;
8235    typedef check<check<check<check<void>>>> quadruple_type;
8236
8237  }
8238
8239  namespace test_decltype
8240  {
8241
8242    int
8243    f()
8244    {
8245      int a = 1;
8246      decltype(a) b = 2;
8247      return a + b;
8248    }
8249
8250  }
8251
8252  namespace test_type_deduction
8253  {
8254
8255    template < typename T1, typename T2 >
8256    struct is_same
8257    {
8258      static const bool value = false;
8259    };
8260
8261    template < typename T >
8262    struct is_same<T, T>
8263    {
8264      static const bool value = true;
8265    };
8266
8267    template < typename T1, typename T2 >
8268    auto
8269    add(T1 a1, T2 a2) -> decltype(a1 + a2)
8270    {
8271      return a1 + a2;
8272    }
8273
8274    int
8275    test(const int c, volatile int v)
8276    {
8277      static_assert(is_same<int, decltype(0)>::value == true, "");
8278      static_assert(is_same<int, decltype(c)>::value == false, "");
8279      static_assert(is_same<int, decltype(v)>::value == false, "");
8280      auto ac = c;
8281      auto av = v;
8282      auto sumi = ac + av + 'x';
8283      auto sumf = ac + av + 1.0;
8284      static_assert(is_same<int, decltype(ac)>::value == true, "");
8285      static_assert(is_same<int, decltype(av)>::value == true, "");
8286      static_assert(is_same<int, decltype(sumi)>::value == true, "");
8287      static_assert(is_same<int, decltype(sumf)>::value == false, "");
8288      static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
8289      return (sumf > 0.0) ? sumi : add(c, v);
8290    }
8291
8292  }
8293
8294  namespace test_noexcept
8295  {
8296
8297    int f() { return 0; }
8298    int g() noexcept { return 0; }
8299
8300    static_assert(noexcept(f()) == false, "");
8301    static_assert(noexcept(g()) == true, "");
8302
8303  }
8304
8305  namespace test_constexpr
8306  {
8307
8308    template < typename CharT >
8309    unsigned long constexpr
8310    strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
8311    {
8312      return *s ? strlen_c_r(s + 1, acc + 1) : acc;
8313    }
8314
8315    template < typename CharT >
8316    unsigned long constexpr
8317    strlen_c(const CharT *const s) noexcept
8318    {
8319      return strlen_c_r(s, 0UL);
8320    }
8321
8322    static_assert(strlen_c("") == 0UL, "");
8323    static_assert(strlen_c("1") == 1UL, "");
8324    static_assert(strlen_c("example") == 7UL, "");
8325    static_assert(strlen_c("another\0example") == 7UL, "");
8326
8327  }
8328
8329  namespace test_rvalue_references
8330  {
8331
8332    template < int N >
8333    struct answer
8334    {
8335      static constexpr int value = N;
8336    };
8337
8338    answer<1> f(int&)       { return answer<1>(); }
8339    answer<2> f(const int&) { return answer<2>(); }
8340    answer<3> f(int&&)      { return answer<3>(); }
8341
8342    void
8343    test()
8344    {
8345      int i = 0;
8346      const int c = 0;
8347      static_assert(decltype(f(i))::value == 1, "");
8348      static_assert(decltype(f(c))::value == 2, "");
8349      static_assert(decltype(f(0))::value == 3, "");
8350    }
8351
8352  }
8353
8354  namespace test_uniform_initialization
8355  {
8356
8357    struct test
8358    {
8359      static const int zero {};
8360      static const int one {1};
8361    };
8362
8363    static_assert(test::zero == 0, "");
8364    static_assert(test::one == 1, "");
8365
8366  }
8367
8368  namespace test_lambdas
8369  {
8370
8371    void
8372    test1()
8373    {
8374      auto lambda1 = [](){};
8375      auto lambda2 = lambda1;
8376      lambda1();
8377      lambda2();
8378    }
8379
8380    int
8381    test2()
8382    {
8383      auto a = [](int i, int j){ return i + j; }(1, 2);
8384      auto b = []() -> int { return '0'; }();
8385      auto c = [=](){ return a + b; }();
8386      auto d = [&](){ return c; }();
8387      auto e = [a, &b](int x) mutable {
8388        const auto identity = [](int y){ return y; };
8389        for (auto i = 0; i < a; ++i)
8390          a += b--;
8391        return x + identity(a + b);
8392      }(0);
8393      return a + b + c + d + e;
8394    }
8395
8396    int
8397    test3()
8398    {
8399      const auto nullary = [](){ return 0; };
8400      const auto unary = [](int x){ return x; };
8401      using nullary_t = decltype(nullary);
8402      using unary_t = decltype(unary);
8403      const auto higher1st = [](nullary_t f){ return f(); };
8404      const auto higher2nd = [unary](nullary_t f1){
8405        return [unary, f1](unary_t f2){ return f2(unary(f1())); };
8406      };
8407      return higher1st(nullary) + higher2nd(nullary)(unary);
8408    }
8409
8410  }
8411
8412  namespace test_variadic_templates
8413  {
8414
8415    template <int...>
8416    struct sum;
8417
8418    template <int N0, int... N1toN>
8419    struct sum<N0, N1toN...>
8420    {
8421      static constexpr auto value = N0 + sum<N1toN...>::value;
8422    };
8423
8424    template <>
8425    struct sum<>
8426    {
8427      static constexpr auto value = 0;
8428    };
8429
8430    static_assert(sum<>::value == 0, "");
8431    static_assert(sum<1>::value == 1, "");
8432    static_assert(sum<23>::value == 23, "");
8433    static_assert(sum<1, 2>::value == 3, "");
8434    static_assert(sum<5, 5, 11>::value == 21, "");
8435    static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
8436
8437  }
8438
8439  // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
8440  // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
8441  // because of this.
8442  namespace test_template_alias_sfinae
8443  {
8444
8445    struct foo {};
8446
8447    template<typename T>
8448    using member = typename T::member_type;
8449
8450    template<typename T>
8451    void func(...) {}
8452
8453    template<typename T>
8454    void func(member<T>*) {}
8455
8456    void test();
8457
8458    void test() { func<foo>(0); }
8459
8460  }
8461
8462}  // namespace cxx11
8463
8464#endif  // __cplusplus >= 201103L
8465
8466
8467
8468
8469// If the compiler admits that it is not ready for C++14, why torture it?
8470// Hopefully, this will speed up the test.
8471
8472#ifndef __cplusplus
8473
8474#error "This is not a C++ compiler"
8475
8476#elif __cplusplus < 201402L
8477
8478#error "This is not a C++14 compiler"
8479
8480#else
8481
8482namespace cxx14
8483{
8484
8485  namespace test_polymorphic_lambdas
8486  {
8487
8488    int
8489    test()
8490    {
8491      const auto lambda = [](auto&&... args){
8492        const auto istiny = [](auto x){
8493          return (sizeof(x) == 1UL) ? 1 : 0;
8494        };
8495        const int aretiny[] = { istiny(args)... };
8496        return aretiny[0];
8497      };
8498      return lambda(1, 1L, 1.0f, '1');
8499    }
8500
8501  }
8502
8503  namespace test_binary_literals
8504  {
8505
8506    constexpr auto ivii = 0b0000000000101010;
8507    static_assert(ivii == 42, "wrong value");
8508
8509  }
8510
8511  namespace test_generalized_constexpr
8512  {
8513
8514    template < typename CharT >
8515    constexpr unsigned long
8516    strlen_c(const CharT *const s) noexcept
8517    {
8518      auto length = 0UL;
8519      for (auto p = s; *p; ++p)
8520        ++length;
8521      return length;
8522    }
8523
8524    static_assert(strlen_c("") == 0UL, "");
8525    static_assert(strlen_c("x") == 1UL, "");
8526    static_assert(strlen_c("test") == 4UL, "");
8527    static_assert(strlen_c("another\0test") == 7UL, "");
8528
8529  }
8530
8531  namespace test_lambda_init_capture
8532  {
8533
8534    int
8535    test()
8536    {
8537      auto x = 0;
8538      const auto lambda1 = [a = x](int b){ return a + b; };
8539      const auto lambda2 = [a = lambda1(x)](){ return a; };
8540      return lambda2();
8541    }
8542
8543  }
8544
8545  namespace test_digit_separators
8546  {
8547
8548    constexpr auto ten_million = 100'000'000;
8549    static_assert(ten_million == 100000000, "");
8550
8551  }
8552
8553  namespace test_return_type_deduction
8554  {
8555
8556    auto f(int& x) { return x; }
8557    decltype(auto) g(int& x) { return x; }
8558
8559    template < typename T1, typename T2 >
8560    struct is_same
8561    {
8562      static constexpr auto value = false;
8563    };
8564
8565    template < typename T >
8566    struct is_same<T, T>
8567    {
8568      static constexpr auto value = true;
8569    };
8570
8571    int
8572    test()
8573    {
8574      auto x = 0;
8575      static_assert(is_same<int, decltype(f(x))>::value, "");
8576      static_assert(is_same<int&, decltype(g(x))>::value, "");
8577      return x;
8578    }
8579
8580  }
8581
8582}  // namespace cxx14
8583
8584#endif  // __cplusplus >= 201402L
8585
8586
8587
8588
8589// If the compiler admits that it is not ready for C++17, why torture it?
8590// Hopefully, this will speed up the test.
8591
8592#ifndef __cplusplus
8593
8594#error "This is not a C++ compiler"
8595
8596#elif __cplusplus < 201703L
8597
8598#error "This is not a C++17 compiler"
8599
8600#else
8601
8602#include <initializer_list>
8603#include <utility>
8604#include <type_traits>
8605
8606namespace cxx17
8607{
8608
8609  namespace test_constexpr_lambdas
8610  {
8611
8612    constexpr int foo = [](){return 42;}();
8613
8614  }
8615
8616  namespace test::nested_namespace::definitions
8617  {
8618
8619  }
8620
8621  namespace test_fold_expression
8622  {
8623
8624    template<typename... Args>
8625    int multiply(Args... args)
8626    {
8627      return (args * ... * 1);
8628    }
8629
8630    template<typename... Args>
8631    bool all(Args... args)
8632    {
8633      return (args && ...);
8634    }
8635
8636  }
8637
8638  namespace test_extended_static_assert
8639  {
8640
8641    static_assert (true);
8642
8643  }
8644
8645  namespace test_auto_brace_init_list
8646  {
8647
8648    auto foo = {5};
8649    auto bar {5};
8650
8651    static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value);
8652    static_assert(std::is_same<int, decltype(bar)>::value);
8653  }
8654
8655  namespace test_typename_in_template_template_parameter
8656  {
8657
8658    template<template<typename> typename X> struct D;
8659
8660  }
8661
8662  namespace test_fallthrough_nodiscard_maybe_unused_attributes
8663  {
8664
8665    int f1()
8666    {
8667      return 42;
8668    }
8669
8670    [[nodiscard]] int f2()
8671    {
8672      [[maybe_unused]] auto unused = f1();
8673
8674      switch (f1())
8675      {
8676      case 17:
8677        f1();
8678        [[fallthrough]];
8679      case 42:
8680        f1();
8681      }
8682      return f1();
8683    }
8684
8685  }
8686
8687  namespace test_extended_aggregate_initialization
8688  {
8689
8690    struct base1
8691    {
8692      int b1, b2 = 42;
8693    };
8694
8695    struct base2
8696    {
8697      base2() {
8698        b3 = 42;
8699      }
8700      int b3;
8701    };
8702
8703    struct derived : base1, base2
8704    {
8705        int d;
8706    };
8707
8708    derived d1 {{1, 2}, {}, 4};  // full initialization
8709    derived d2 {{}, {}, 4};      // value-initialized bases
8710
8711  }
8712
8713  namespace test_general_range_based_for_loop
8714  {
8715
8716    struct iter
8717    {
8718      int i;
8719
8720      int& operator* ()
8721      {
8722        return i;
8723      }
8724
8725      const int& operator* () const
8726      {
8727        return i;
8728      }
8729
8730      iter& operator++()
8731      {
8732        ++i;
8733        return *this;
8734      }
8735    };
8736
8737    struct sentinel
8738    {
8739      int i;
8740    };
8741
8742    bool operator== (const iter& i, const sentinel& s)
8743    {
8744      return i.i == s.i;
8745    }
8746
8747    bool operator!= (const iter& i, const sentinel& s)
8748    {
8749      return !(i == s);
8750    }
8751
8752    struct range
8753    {
8754      iter begin() const
8755      {
8756        return {0};
8757      }
8758
8759      sentinel end() const
8760      {
8761        return {5};
8762      }
8763    };
8764
8765    void f()
8766    {
8767      range r {};
8768
8769      for (auto i : r)
8770      {
8771        [[maybe_unused]] auto v = i;
8772      }
8773    }
8774
8775  }
8776
8777  namespace test_lambda_capture_asterisk_this_by_value
8778  {
8779
8780    struct t
8781    {
8782      int i;
8783      int foo()
8784      {
8785        return [*this]()
8786        {
8787          return i;
8788        }();
8789      }
8790    };
8791
8792  }
8793
8794  namespace test_enum_class_construction
8795  {
8796
8797    enum class byte : unsigned char
8798    {};
8799
8800    byte foo {42};
8801
8802  }
8803
8804  namespace test_constexpr_if
8805  {
8806
8807    template <bool cond>
8808    int f ()
8809    {
8810      if constexpr(cond)
8811      {
8812        return 13;
8813      }
8814      else
8815      {
8816        return 42;
8817      }
8818    }
8819
8820  }
8821
8822  namespace test_selection_statement_with_initializer
8823  {
8824
8825    int f()
8826    {
8827      return 13;
8828    }
8829
8830    int f2()
8831    {
8832      if (auto i = f(); i > 0)
8833      {
8834        return 3;
8835      }
8836
8837      switch (auto i = f(); i + 4)
8838      {
8839      case 17:
8840        return 2;
8841
8842      default:
8843        return 1;
8844      }
8845    }
8846
8847  }
8848
8849  namespace test_template_argument_deduction_for_class_templates
8850  {
8851
8852    template <typename T1, typename T2>
8853    struct pair
8854    {
8855      pair (T1 p1, T2 p2)
8856        : m1 {p1},
8857          m2 {p2}
8858      {}
8859
8860      T1 m1;
8861      T2 m2;
8862    };
8863
8864    void f()
8865    {
8866      [[maybe_unused]] auto p = pair{13, 42u};
8867    }
8868
8869  }
8870
8871  namespace test_non_type_auto_template_parameters
8872  {
8873
8874    template <auto n>
8875    struct B
8876    {};
8877
8878    B<5> b1;
8879    B<'a'> b2;
8880
8881  }
8882
8883  namespace test_structured_bindings
8884  {
8885
8886    int arr[2] = { 1, 2 };
8887    std::pair<int, int> pr = { 1, 2 };
8888
8889    auto f1() -> int(&)[2]
8890    {
8891      return arr;
8892    }
8893
8894    auto f2() -> std::pair<int, int>&
8895    {
8896      return pr;
8897    }
8898
8899    struct S
8900    {
8901      int x1 : 2;
8902      volatile double y1;
8903    };
8904
8905    S f3()
8906    {
8907      return {};
8908    }
8909
8910    auto [ x1, y1 ] = f1();
8911    auto& [ xr1, yr1 ] = f1();
8912    auto [ x2, y2 ] = f2();
8913    auto& [ xr2, yr2 ] = f2();
8914    const auto [ x3, y3 ] = f3();
8915
8916  }
8917
8918  namespace test_exception_spec_type_system
8919  {
8920
8921    struct Good {};
8922    struct Bad {};
8923
8924    void g1() noexcept;
8925    void g2();
8926
8927    template<typename T>
8928    Bad
8929    f(T*, T*);
8930
8931    template<typename T1, typename T2>
8932    Good
8933    f(T1*, T2*);
8934
8935    static_assert (std::is_same_v<Good, decltype(f(g1, g2))>);
8936
8937  }
8938
8939  namespace test_inline_variables
8940  {
8941
8942    template<class T> void f(T)
8943    {}
8944
8945    template<class T> inline T g(T)
8946    {
8947      return T{};
8948    }
8949
8950    template<> inline void f<>(int)
8951    {}
8952
8953    template<> int g<>(int)
8954    {
8955      return 5;
8956    }
8957
8958  }
8959
8960}  // namespace cxx17
8961
8962#endif  // __cplusplus < 201703L
8963
8964
8965
8966_ACEOF
8967if ac_fn_cxx_try_compile "$LINENO"
8968then :
8969  ax_cv_cxx_compile_cxx17=yes
8970else $as_nop
8971  ax_cv_cxx_compile_cxx17=no
8972fi
8973rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
8974fi
8975{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx17" >&5
8976printf "%s\n" "$ax_cv_cxx_compile_cxx17" >&6; }
8977    if test x$ax_cv_cxx_compile_cxx17 = xyes; then
8978      ac_success=yes
8979    fi
8980
8981    if test x$ac_success = xno; then
8982    for alternative in ${ax_cxx_compile_alternatives}; do
8983      switch="-std=gnu++${alternative}"
8984      cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_$switch" | $as_tr_sh`
8985      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5
8986printf %s "checking whether $CXX supports C++17 features with $switch... " >&6; }
8987if eval test \${$cachevar+y}
8988then :
8989  printf %s "(cached) " >&6
8990else $as_nop
8991  ac_save_CXX="$CXX"
8992         CXX="$CXX $switch"
8993         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8994/* end confdefs.h.  */
8995
8996
8997// If the compiler admits that it is not ready for C++11, why torture it?
8998// Hopefully, this will speed up the test.
8999
9000#ifndef __cplusplus
9001
9002#error "This is not a C++ compiler"
9003
9004#elif __cplusplus < 201103L
9005
9006#error "This is not a C++11 compiler"
9007
9008#else
9009
9010namespace cxx11
9011{
9012
9013  namespace test_static_assert
9014  {
9015
9016    template <typename T>
9017    struct check
9018    {
9019      static_assert(sizeof(int) <= sizeof(T), "not big enough");
9020    };
9021
9022  }
9023
9024  namespace test_final_override
9025  {
9026
9027    struct Base
9028    {
9029      virtual ~Base() {}
9030      virtual void f() {}
9031    };
9032
9033    struct Derived : public Base
9034    {
9035      virtual ~Derived() override {}
9036      virtual void f() override {}
9037    };
9038
9039  }
9040
9041  namespace test_double_right_angle_brackets
9042  {
9043
9044    template < typename T >
9045    struct check {};
9046
9047    typedef check<void> single_type;
9048    typedef check<check<void>> double_type;
9049    typedef check<check<check<void>>> triple_type;
9050    typedef check<check<check<check<void>>>> quadruple_type;
9051
9052  }
9053
9054  namespace test_decltype
9055  {
9056
9057    int
9058    f()
9059    {
9060      int a = 1;
9061      decltype(a) b = 2;
9062      return a + b;
9063    }
9064
9065  }
9066
9067  namespace test_type_deduction
9068  {
9069
9070    template < typename T1, typename T2 >
9071    struct is_same
9072    {
9073      static const bool value = false;
9074    };
9075
9076    template < typename T >
9077    struct is_same<T, T>
9078    {
9079      static const bool value = true;
9080    };
9081
9082    template < typename T1, typename T2 >
9083    auto
9084    add(T1 a1, T2 a2) -> decltype(a1 + a2)
9085    {
9086      return a1 + a2;
9087    }
9088
9089    int
9090    test(const int c, volatile int v)
9091    {
9092      static_assert(is_same<int, decltype(0)>::value == true, "");
9093      static_assert(is_same<int, decltype(c)>::value == false, "");
9094      static_assert(is_same<int, decltype(v)>::value == false, "");
9095      auto ac = c;
9096      auto av = v;
9097      auto sumi = ac + av + 'x';
9098      auto sumf = ac + av + 1.0;
9099      static_assert(is_same<int, decltype(ac)>::value == true, "");
9100      static_assert(is_same<int, decltype(av)>::value == true, "");
9101      static_assert(is_same<int, decltype(sumi)>::value == true, "");
9102      static_assert(is_same<int, decltype(sumf)>::value == false, "");
9103      static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
9104      return (sumf > 0.0) ? sumi : add(c, v);
9105    }
9106
9107  }
9108
9109  namespace test_noexcept
9110  {
9111
9112    int f() { return 0; }
9113    int g() noexcept { return 0; }
9114
9115    static_assert(noexcept(f()) == false, "");
9116    static_assert(noexcept(g()) == true, "");
9117
9118  }
9119
9120  namespace test_constexpr
9121  {
9122
9123    template < typename CharT >
9124    unsigned long constexpr
9125    strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
9126    {
9127      return *s ? strlen_c_r(s + 1, acc + 1) : acc;
9128    }
9129
9130    template < typename CharT >
9131    unsigned long constexpr
9132    strlen_c(const CharT *const s) noexcept
9133    {
9134      return strlen_c_r(s, 0UL);
9135    }
9136
9137    static_assert(strlen_c("") == 0UL, "");
9138    static_assert(strlen_c("1") == 1UL, "");
9139    static_assert(strlen_c("example") == 7UL, "");
9140    static_assert(strlen_c("another\0example") == 7UL, "");
9141
9142  }
9143
9144  namespace test_rvalue_references
9145  {
9146
9147    template < int N >
9148    struct answer
9149    {
9150      static constexpr int value = N;
9151    };
9152
9153    answer<1> f(int&)       { return answer<1>(); }
9154    answer<2> f(const int&) { return answer<2>(); }
9155    answer<3> f(int&&)      { return answer<3>(); }
9156
9157    void
9158    test()
9159    {
9160      int i = 0;
9161      const int c = 0;
9162      static_assert(decltype(f(i))::value == 1, "");
9163      static_assert(decltype(f(c))::value == 2, "");
9164      static_assert(decltype(f(0))::value == 3, "");
9165    }
9166
9167  }
9168
9169  namespace test_uniform_initialization
9170  {
9171
9172    struct test
9173    {
9174      static const int zero {};
9175      static const int one {1};
9176    };
9177
9178    static_assert(test::zero == 0, "");
9179    static_assert(test::one == 1, "");
9180
9181  }
9182
9183  namespace test_lambdas
9184  {
9185
9186    void
9187    test1()
9188    {
9189      auto lambda1 = [](){};
9190      auto lambda2 = lambda1;
9191      lambda1();
9192      lambda2();
9193    }
9194
9195    int
9196    test2()
9197    {
9198      auto a = [](int i, int j){ return i + j; }(1, 2);
9199      auto b = []() -> int { return '0'; }();
9200      auto c = [=](){ return a + b; }();
9201      auto d = [&](){ return c; }();
9202      auto e = [a, &b](int x) mutable {
9203        const auto identity = [](int y){ return y; };
9204        for (auto i = 0; i < a; ++i)
9205          a += b--;
9206        return x + identity(a + b);
9207      }(0);
9208      return a + b + c + d + e;
9209    }
9210
9211    int
9212    test3()
9213    {
9214      const auto nullary = [](){ return 0; };
9215      const auto unary = [](int x){ return x; };
9216      using nullary_t = decltype(nullary);
9217      using unary_t = decltype(unary);
9218      const auto higher1st = [](nullary_t f){ return f(); };
9219      const auto higher2nd = [unary](nullary_t f1){
9220        return [unary, f1](unary_t f2){ return f2(unary(f1())); };
9221      };
9222      return higher1st(nullary) + higher2nd(nullary)(unary);
9223    }
9224
9225  }
9226
9227  namespace test_variadic_templates
9228  {
9229
9230    template <int...>
9231    struct sum;
9232
9233    template <int N0, int... N1toN>
9234    struct sum<N0, N1toN...>
9235    {
9236      static constexpr auto value = N0 + sum<N1toN...>::value;
9237    };
9238
9239    template <>
9240    struct sum<>
9241    {
9242      static constexpr auto value = 0;
9243    };
9244
9245    static_assert(sum<>::value == 0, "");
9246    static_assert(sum<1>::value == 1, "");
9247    static_assert(sum<23>::value == 23, "");
9248    static_assert(sum<1, 2>::value == 3, "");
9249    static_assert(sum<5, 5, 11>::value == 21, "");
9250    static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
9251
9252  }
9253
9254  // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
9255  // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
9256  // because of this.
9257  namespace test_template_alias_sfinae
9258  {
9259
9260    struct foo {};
9261
9262    template<typename T>
9263    using member = typename T::member_type;
9264
9265    template<typename T>
9266    void func(...) {}
9267
9268    template<typename T>
9269    void func(member<T>*) {}
9270
9271    void test();
9272
9273    void test() { func<foo>(0); }
9274
9275  }
9276
9277}  // namespace cxx11
9278
9279#endif  // __cplusplus >= 201103L
9280
9281
9282
9283
9284// If the compiler admits that it is not ready for C++14, why torture it?
9285// Hopefully, this will speed up the test.
9286
9287#ifndef __cplusplus
9288
9289#error "This is not a C++ compiler"
9290
9291#elif __cplusplus < 201402L
9292
9293#error "This is not a C++14 compiler"
9294
9295#else
9296
9297namespace cxx14
9298{
9299
9300  namespace test_polymorphic_lambdas
9301  {
9302
9303    int
9304    test()
9305    {
9306      const auto lambda = [](auto&&... args){
9307        const auto istiny = [](auto x){
9308          return (sizeof(x) == 1UL) ? 1 : 0;
9309        };
9310        const int aretiny[] = { istiny(args)... };
9311        return aretiny[0];
9312      };
9313      return lambda(1, 1L, 1.0f, '1');
9314    }
9315
9316  }
9317
9318  namespace test_binary_literals
9319  {
9320
9321    constexpr auto ivii = 0b0000000000101010;
9322    static_assert(ivii == 42, "wrong value");
9323
9324  }
9325
9326  namespace test_generalized_constexpr
9327  {
9328
9329    template < typename CharT >
9330    constexpr unsigned long
9331    strlen_c(const CharT *const s) noexcept
9332    {
9333      auto length = 0UL;
9334      for (auto p = s; *p; ++p)
9335        ++length;
9336      return length;
9337    }
9338
9339    static_assert(strlen_c("") == 0UL, "");
9340    static_assert(strlen_c("x") == 1UL, "");
9341    static_assert(strlen_c("test") == 4UL, "");
9342    static_assert(strlen_c("another\0test") == 7UL, "");
9343
9344  }
9345
9346  namespace test_lambda_init_capture
9347  {
9348
9349    int
9350    test()
9351    {
9352      auto x = 0;
9353      const auto lambda1 = [a = x](int b){ return a + b; };
9354      const auto lambda2 = [a = lambda1(x)](){ return a; };
9355      return lambda2();
9356    }
9357
9358  }
9359
9360  namespace test_digit_separators
9361  {
9362
9363    constexpr auto ten_million = 100'000'000;
9364    static_assert(ten_million == 100000000, "");
9365
9366  }
9367
9368  namespace test_return_type_deduction
9369  {
9370
9371    auto f(int& x) { return x; }
9372    decltype(auto) g(int& x) { return x; }
9373
9374    template < typename T1, typename T2 >
9375    struct is_same
9376    {
9377      static constexpr auto value = false;
9378    };
9379
9380    template < typename T >
9381    struct is_same<T, T>
9382    {
9383      static constexpr auto value = true;
9384    };
9385
9386    int
9387    test()
9388    {
9389      auto x = 0;
9390      static_assert(is_same<int, decltype(f(x))>::value, "");
9391      static_assert(is_same<int&, decltype(g(x))>::value, "");
9392      return x;
9393    }
9394
9395  }
9396
9397}  // namespace cxx14
9398
9399#endif  // __cplusplus >= 201402L
9400
9401
9402
9403
9404// If the compiler admits that it is not ready for C++17, why torture it?
9405// Hopefully, this will speed up the test.
9406
9407#ifndef __cplusplus
9408
9409#error "This is not a C++ compiler"
9410
9411#elif __cplusplus < 201703L
9412
9413#error "This is not a C++17 compiler"
9414
9415#else
9416
9417#include <initializer_list>
9418#include <utility>
9419#include <type_traits>
9420
9421namespace cxx17
9422{
9423
9424  namespace test_constexpr_lambdas
9425  {
9426
9427    constexpr int foo = [](){return 42;}();
9428
9429  }
9430
9431  namespace test::nested_namespace::definitions
9432  {
9433
9434  }
9435
9436  namespace test_fold_expression
9437  {
9438
9439    template<typename... Args>
9440    int multiply(Args... args)
9441    {
9442      return (args * ... * 1);
9443    }
9444
9445    template<typename... Args>
9446    bool all(Args... args)
9447    {
9448      return (args && ...);
9449    }
9450
9451  }
9452
9453  namespace test_extended_static_assert
9454  {
9455
9456    static_assert (true);
9457
9458  }
9459
9460  namespace test_auto_brace_init_list
9461  {
9462
9463    auto foo = {5};
9464    auto bar {5};
9465
9466    static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value);
9467    static_assert(std::is_same<int, decltype(bar)>::value);
9468  }
9469
9470  namespace test_typename_in_template_template_parameter
9471  {
9472
9473    template<template<typename> typename X> struct D;
9474
9475  }
9476
9477  namespace test_fallthrough_nodiscard_maybe_unused_attributes
9478  {
9479
9480    int f1()
9481    {
9482      return 42;
9483    }
9484
9485    [[nodiscard]] int f2()
9486    {
9487      [[maybe_unused]] auto unused = f1();
9488
9489      switch (f1())
9490      {
9491      case 17:
9492        f1();
9493        [[fallthrough]];
9494      case 42:
9495        f1();
9496      }
9497      return f1();
9498    }
9499
9500  }
9501
9502  namespace test_extended_aggregate_initialization
9503  {
9504
9505    struct base1
9506    {
9507      int b1, b2 = 42;
9508    };
9509
9510    struct base2
9511    {
9512      base2() {
9513        b3 = 42;
9514      }
9515      int b3;
9516    };
9517
9518    struct derived : base1, base2
9519    {
9520        int d;
9521    };
9522
9523    derived d1 {{1, 2}, {}, 4};  // full initialization
9524    derived d2 {{}, {}, 4};      // value-initialized bases
9525
9526  }
9527
9528  namespace test_general_range_based_for_loop
9529  {
9530
9531    struct iter
9532    {
9533      int i;
9534
9535      int& operator* ()
9536      {
9537        return i;
9538      }
9539
9540      const int& operator* () const
9541      {
9542        return i;
9543      }
9544
9545      iter& operator++()
9546      {
9547        ++i;
9548        return *this;
9549      }
9550    };
9551
9552    struct sentinel
9553    {
9554      int i;
9555    };
9556
9557    bool operator== (const iter& i, const sentinel& s)
9558    {
9559      return i.i == s.i;
9560    }
9561
9562    bool operator!= (const iter& i, const sentinel& s)
9563    {
9564      return !(i == s);
9565    }
9566
9567    struct range
9568    {
9569      iter begin() const
9570      {
9571        return {0};
9572      }
9573
9574      sentinel end() const
9575      {
9576        return {5};
9577      }
9578    };
9579
9580    void f()
9581    {
9582      range r {};
9583
9584      for (auto i : r)
9585      {
9586        [[maybe_unused]] auto v = i;
9587      }
9588    }
9589
9590  }
9591
9592  namespace test_lambda_capture_asterisk_this_by_value
9593  {
9594
9595    struct t
9596    {
9597      int i;
9598      int foo()
9599      {
9600        return [*this]()
9601        {
9602          return i;
9603        }();
9604      }
9605    };
9606
9607  }
9608
9609  namespace test_enum_class_construction
9610  {
9611
9612    enum class byte : unsigned char
9613    {};
9614
9615    byte foo {42};
9616
9617  }
9618
9619  namespace test_constexpr_if
9620  {
9621
9622    template <bool cond>
9623    int f ()
9624    {
9625      if constexpr(cond)
9626      {
9627        return 13;
9628      }
9629      else
9630      {
9631        return 42;
9632      }
9633    }
9634
9635  }
9636
9637  namespace test_selection_statement_with_initializer
9638  {
9639
9640    int f()
9641    {
9642      return 13;
9643    }
9644
9645    int f2()
9646    {
9647      if (auto i = f(); i > 0)
9648      {
9649        return 3;
9650      }
9651
9652      switch (auto i = f(); i + 4)
9653      {
9654      case 17:
9655        return 2;
9656
9657      default:
9658        return 1;
9659      }
9660    }
9661
9662  }
9663
9664  namespace test_template_argument_deduction_for_class_templates
9665  {
9666
9667    template <typename T1, typename T2>
9668    struct pair
9669    {
9670      pair (T1 p1, T2 p2)
9671        : m1 {p1},
9672          m2 {p2}
9673      {}
9674
9675      T1 m1;
9676      T2 m2;
9677    };
9678
9679    void f()
9680    {
9681      [[maybe_unused]] auto p = pair{13, 42u};
9682    }
9683
9684  }
9685
9686  namespace test_non_type_auto_template_parameters
9687  {
9688
9689    template <auto n>
9690    struct B
9691    {};
9692
9693    B<5> b1;
9694    B<'a'> b2;
9695
9696  }
9697
9698  namespace test_structured_bindings
9699  {
9700
9701    int arr[2] = { 1, 2 };
9702    std::pair<int, int> pr = { 1, 2 };
9703
9704    auto f1() -> int(&)[2]
9705    {
9706      return arr;
9707    }
9708
9709    auto f2() -> std::pair<int, int>&
9710    {
9711      return pr;
9712    }
9713
9714    struct S
9715    {
9716      int x1 : 2;
9717      volatile double y1;
9718    };
9719
9720    S f3()
9721    {
9722      return {};
9723    }
9724
9725    auto [ x1, y1 ] = f1();
9726    auto& [ xr1, yr1 ] = f1();
9727    auto [ x2, y2 ] = f2();
9728    auto& [ xr2, yr2 ] = f2();
9729    const auto [ x3, y3 ] = f3();
9730
9731  }
9732
9733  namespace test_exception_spec_type_system
9734  {
9735
9736    struct Good {};
9737    struct Bad {};
9738
9739    void g1() noexcept;
9740    void g2();
9741
9742    template<typename T>
9743    Bad
9744    f(T*, T*);
9745
9746    template<typename T1, typename T2>
9747    Good
9748    f(T1*, T2*);
9749
9750    static_assert (std::is_same_v<Good, decltype(f(g1, g2))>);
9751
9752  }
9753
9754  namespace test_inline_variables
9755  {
9756
9757    template<class T> void f(T)
9758    {}
9759
9760    template<class T> inline T g(T)
9761    {
9762      return T{};
9763    }
9764
9765    template<> inline void f<>(int)
9766    {}
9767
9768    template<> int g<>(int)
9769    {
9770      return 5;
9771    }
9772
9773  }
9774
9775}  // namespace cxx17
9776
9777#endif  // __cplusplus < 201703L
9778
9779
9780
9781_ACEOF
9782if ac_fn_cxx_try_compile "$LINENO"
9783then :
9784  eval $cachevar=yes
9785else $as_nop
9786  eval $cachevar=no
9787fi
9788rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
9789         CXX="$ac_save_CXX"
9790fi
9791eval ac_res=\$$cachevar
9792	       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
9793printf "%s\n" "$ac_res" >&6; }
9794      if eval test x\$$cachevar = xyes; then
9795        CXX="$CXX $switch"
9796        if test -n "$CXXCPP" ; then
9797          CXXCPP="$CXXCPP $switch"
9798        fi
9799        ac_success=yes
9800        break
9801      fi
9802    done
9803  fi
9804
9805    if test x$ac_success = xno; then
9806                for alternative in ${ax_cxx_compile_alternatives}; do
9807      for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
9808        cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_$switch" | $as_tr_sh`
9809        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5
9810printf %s "checking whether $CXX supports C++17 features with $switch... " >&6; }
9811if eval test \${$cachevar+y}
9812then :
9813  printf %s "(cached) " >&6
9814else $as_nop
9815  ac_save_CXX="$CXX"
9816           CXX="$CXX $switch"
9817           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9818/* end confdefs.h.  */
9819
9820
9821// If the compiler admits that it is not ready for C++11, why torture it?
9822// Hopefully, this will speed up the test.
9823
9824#ifndef __cplusplus
9825
9826#error "This is not a C++ compiler"
9827
9828#elif __cplusplus < 201103L
9829
9830#error "This is not a C++11 compiler"
9831
9832#else
9833
9834namespace cxx11
9835{
9836
9837  namespace test_static_assert
9838  {
9839
9840    template <typename T>
9841    struct check
9842    {
9843      static_assert(sizeof(int) <= sizeof(T), "not big enough");
9844    };
9845
9846  }
9847
9848  namespace test_final_override
9849  {
9850
9851    struct Base
9852    {
9853      virtual ~Base() {}
9854      virtual void f() {}
9855    };
9856
9857    struct Derived : public Base
9858    {
9859      virtual ~Derived() override {}
9860      virtual void f() override {}
9861    };
9862
9863  }
9864
9865  namespace test_double_right_angle_brackets
9866  {
9867
9868    template < typename T >
9869    struct check {};
9870
9871    typedef check<void> single_type;
9872    typedef check<check<void>> double_type;
9873    typedef check<check<check<void>>> triple_type;
9874    typedef check<check<check<check<void>>>> quadruple_type;
9875
9876  }
9877
9878  namespace test_decltype
9879  {
9880
9881    int
9882    f()
9883    {
9884      int a = 1;
9885      decltype(a) b = 2;
9886      return a + b;
9887    }
9888
9889  }
9890
9891  namespace test_type_deduction
9892  {
9893
9894    template < typename T1, typename T2 >
9895    struct is_same
9896    {
9897      static const bool value = false;
9898    };
9899
9900    template < typename T >
9901    struct is_same<T, T>
9902    {
9903      static const bool value = true;
9904    };
9905
9906    template < typename T1, typename T2 >
9907    auto
9908    add(T1 a1, T2 a2) -> decltype(a1 + a2)
9909    {
9910      return a1 + a2;
9911    }
9912
9913    int
9914    test(const int c, volatile int v)
9915    {
9916      static_assert(is_same<int, decltype(0)>::value == true, "");
9917      static_assert(is_same<int, decltype(c)>::value == false, "");
9918      static_assert(is_same<int, decltype(v)>::value == false, "");
9919      auto ac = c;
9920      auto av = v;
9921      auto sumi = ac + av + 'x';
9922      auto sumf = ac + av + 1.0;
9923      static_assert(is_same<int, decltype(ac)>::value == true, "");
9924      static_assert(is_same<int, decltype(av)>::value == true, "");
9925      static_assert(is_same<int, decltype(sumi)>::value == true, "");
9926      static_assert(is_same<int, decltype(sumf)>::value == false, "");
9927      static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
9928      return (sumf > 0.0) ? sumi : add(c, v);
9929    }
9930
9931  }
9932
9933  namespace test_noexcept
9934  {
9935
9936    int f() { return 0; }
9937    int g() noexcept { return 0; }
9938
9939    static_assert(noexcept(f()) == false, "");
9940    static_assert(noexcept(g()) == true, "");
9941
9942  }
9943
9944  namespace test_constexpr
9945  {
9946
9947    template < typename CharT >
9948    unsigned long constexpr
9949    strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
9950    {
9951      return *s ? strlen_c_r(s + 1, acc + 1) : acc;
9952    }
9953
9954    template < typename CharT >
9955    unsigned long constexpr
9956    strlen_c(const CharT *const s) noexcept
9957    {
9958      return strlen_c_r(s, 0UL);
9959    }
9960
9961    static_assert(strlen_c("") == 0UL, "");
9962    static_assert(strlen_c("1") == 1UL, "");
9963    static_assert(strlen_c("example") == 7UL, "");
9964    static_assert(strlen_c("another\0example") == 7UL, "");
9965
9966  }
9967
9968  namespace test_rvalue_references
9969  {
9970
9971    template < int N >
9972    struct answer
9973    {
9974      static constexpr int value = N;
9975    };
9976
9977    answer<1> f(int&)       { return answer<1>(); }
9978    answer<2> f(const int&) { return answer<2>(); }
9979    answer<3> f(int&&)      { return answer<3>(); }
9980
9981    void
9982    test()
9983    {
9984      int i = 0;
9985      const int c = 0;
9986      static_assert(decltype(f(i))::value == 1, "");
9987      static_assert(decltype(f(c))::value == 2, "");
9988      static_assert(decltype(f(0))::value == 3, "");
9989    }
9990
9991  }
9992
9993  namespace test_uniform_initialization
9994  {
9995
9996    struct test
9997    {
9998      static const int zero {};
9999      static const int one {1};
10000    };
10001
10002    static_assert(test::zero == 0, "");
10003    static_assert(test::one == 1, "");
10004
10005  }
10006
10007  namespace test_lambdas
10008  {
10009
10010    void
10011    test1()
10012    {
10013      auto lambda1 = [](){};
10014      auto lambda2 = lambda1;
10015      lambda1();
10016      lambda2();
10017    }
10018
10019    int
10020    test2()
10021    {
10022      auto a = [](int i, int j){ return i + j; }(1, 2);
10023      auto b = []() -> int { return '0'; }();
10024      auto c = [=](){ return a + b; }();
10025      auto d = [&](){ return c; }();
10026      auto e = [a, &b](int x) mutable {
10027        const auto identity = [](int y){ return y; };
10028        for (auto i = 0; i < a; ++i)
10029          a += b--;
10030        return x + identity(a + b);
10031      }(0);
10032      return a + b + c + d + e;
10033    }
10034
10035    int
10036    test3()
10037    {
10038      const auto nullary = [](){ return 0; };
10039      const auto unary = [](int x){ return x; };
10040      using nullary_t = decltype(nullary);
10041      using unary_t = decltype(unary);
10042      const auto higher1st = [](nullary_t f){ return f(); };
10043      const auto higher2nd = [unary](nullary_t f1){
10044        return [unary, f1](unary_t f2){ return f2(unary(f1())); };
10045      };
10046      return higher1st(nullary) + higher2nd(nullary)(unary);
10047    }
10048
10049  }
10050
10051  namespace test_variadic_templates
10052  {
10053
10054    template <int...>
10055    struct sum;
10056
10057    template <int N0, int... N1toN>
10058    struct sum<N0, N1toN...>
10059    {
10060      static constexpr auto value = N0 + sum<N1toN...>::value;
10061    };
10062
10063    template <>
10064    struct sum<>
10065    {
10066      static constexpr auto value = 0;
10067    };
10068
10069    static_assert(sum<>::value == 0, "");
10070    static_assert(sum<1>::value == 1, "");
10071    static_assert(sum<23>::value == 23, "");
10072    static_assert(sum<1, 2>::value == 3, "");
10073    static_assert(sum<5, 5, 11>::value == 21, "");
10074    static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
10075
10076  }
10077
10078  // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
10079  // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
10080  // because of this.
10081  namespace test_template_alias_sfinae
10082  {
10083
10084    struct foo {};
10085
10086    template<typename T>
10087    using member = typename T::member_type;
10088
10089    template<typename T>
10090    void func(...) {}
10091
10092    template<typename T>
10093    void func(member<T>*) {}
10094
10095    void test();
10096
10097    void test() { func<foo>(0); }
10098
10099  }
10100
10101}  // namespace cxx11
10102
10103#endif  // __cplusplus >= 201103L
10104
10105
10106
10107
10108// If the compiler admits that it is not ready for C++14, why torture it?
10109// Hopefully, this will speed up the test.
10110
10111#ifndef __cplusplus
10112
10113#error "This is not a C++ compiler"
10114
10115#elif __cplusplus < 201402L
10116
10117#error "This is not a C++14 compiler"
10118
10119#else
10120
10121namespace cxx14
10122{
10123
10124  namespace test_polymorphic_lambdas
10125  {
10126
10127    int
10128    test()
10129    {
10130      const auto lambda = [](auto&&... args){
10131        const auto istiny = [](auto x){
10132          return (sizeof(x) == 1UL) ? 1 : 0;
10133        };
10134        const int aretiny[] = { istiny(args)... };
10135        return aretiny[0];
10136      };
10137      return lambda(1, 1L, 1.0f, '1');
10138    }
10139
10140  }
10141
10142  namespace test_binary_literals
10143  {
10144
10145    constexpr auto ivii = 0b0000000000101010;
10146    static_assert(ivii == 42, "wrong value");
10147
10148  }
10149
10150  namespace test_generalized_constexpr
10151  {
10152
10153    template < typename CharT >
10154    constexpr unsigned long
10155    strlen_c(const CharT *const s) noexcept
10156    {
10157      auto length = 0UL;
10158      for (auto p = s; *p; ++p)
10159        ++length;
10160      return length;
10161    }
10162
10163    static_assert(strlen_c("") == 0UL, "");
10164    static_assert(strlen_c("x") == 1UL, "");
10165    static_assert(strlen_c("test") == 4UL, "");
10166    static_assert(strlen_c("another\0test") == 7UL, "");
10167
10168  }
10169
10170  namespace test_lambda_init_capture
10171  {
10172
10173    int
10174    test()
10175    {
10176      auto x = 0;
10177      const auto lambda1 = [a = x](int b){ return a + b; };
10178      const auto lambda2 = [a = lambda1(x)](){ return a; };
10179      return lambda2();
10180    }
10181
10182  }
10183
10184  namespace test_digit_separators
10185  {
10186
10187    constexpr auto ten_million = 100'000'000;
10188    static_assert(ten_million == 100000000, "");
10189
10190  }
10191
10192  namespace test_return_type_deduction
10193  {
10194
10195    auto f(int& x) { return x; }
10196    decltype(auto) g(int& x) { return x; }
10197
10198    template < typename T1, typename T2 >
10199    struct is_same
10200    {
10201      static constexpr auto value = false;
10202    };
10203
10204    template < typename T >
10205    struct is_same<T, T>
10206    {
10207      static constexpr auto value = true;
10208    };
10209
10210    int
10211    test()
10212    {
10213      auto x = 0;
10214      static_assert(is_same<int, decltype(f(x))>::value, "");
10215      static_assert(is_same<int&, decltype(g(x))>::value, "");
10216      return x;
10217    }
10218
10219  }
10220
10221}  // namespace cxx14
10222
10223#endif  // __cplusplus >= 201402L
10224
10225
10226
10227
10228// If the compiler admits that it is not ready for C++17, why torture it?
10229// Hopefully, this will speed up the test.
10230
10231#ifndef __cplusplus
10232
10233#error "This is not a C++ compiler"
10234
10235#elif __cplusplus < 201703L
10236
10237#error "This is not a C++17 compiler"
10238
10239#else
10240
10241#include <initializer_list>
10242#include <utility>
10243#include <type_traits>
10244
10245namespace cxx17
10246{
10247
10248  namespace test_constexpr_lambdas
10249  {
10250
10251    constexpr int foo = [](){return 42;}();
10252
10253  }
10254
10255  namespace test::nested_namespace::definitions
10256  {
10257
10258  }
10259
10260  namespace test_fold_expression
10261  {
10262
10263    template<typename... Args>
10264    int multiply(Args... args)
10265    {
10266      return (args * ... * 1);
10267    }
10268
10269    template<typename... Args>
10270    bool all(Args... args)
10271    {
10272      return (args && ...);
10273    }
10274
10275  }
10276
10277  namespace test_extended_static_assert
10278  {
10279
10280    static_assert (true);
10281
10282  }
10283
10284  namespace test_auto_brace_init_list
10285  {
10286
10287    auto foo = {5};
10288    auto bar {5};
10289
10290    static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value);
10291    static_assert(std::is_same<int, decltype(bar)>::value);
10292  }
10293
10294  namespace test_typename_in_template_template_parameter
10295  {
10296
10297    template<template<typename> typename X> struct D;
10298
10299  }
10300
10301  namespace test_fallthrough_nodiscard_maybe_unused_attributes
10302  {
10303
10304    int f1()
10305    {
10306      return 42;
10307    }
10308
10309    [[nodiscard]] int f2()
10310    {
10311      [[maybe_unused]] auto unused = f1();
10312
10313      switch (f1())
10314      {
10315      case 17:
10316        f1();
10317        [[fallthrough]];
10318      case 42:
10319        f1();
10320      }
10321      return f1();
10322    }
10323
10324  }
10325
10326  namespace test_extended_aggregate_initialization
10327  {
10328
10329    struct base1
10330    {
10331      int b1, b2 = 42;
10332    };
10333
10334    struct base2
10335    {
10336      base2() {
10337        b3 = 42;
10338      }
10339      int b3;
10340    };
10341
10342    struct derived : base1, base2
10343    {
10344        int d;
10345    };
10346
10347    derived d1 {{1, 2}, {}, 4};  // full initialization
10348    derived d2 {{}, {}, 4};      // value-initialized bases
10349
10350  }
10351
10352  namespace test_general_range_based_for_loop
10353  {
10354
10355    struct iter
10356    {
10357      int i;
10358
10359      int& operator* ()
10360      {
10361        return i;
10362      }
10363
10364      const int& operator* () const
10365      {
10366        return i;
10367      }
10368
10369      iter& operator++()
10370      {
10371        ++i;
10372        return *this;
10373      }
10374    };
10375
10376    struct sentinel
10377    {
10378      int i;
10379    };
10380
10381    bool operator== (const iter& i, const sentinel& s)
10382    {
10383      return i.i == s.i;
10384    }
10385
10386    bool operator!= (const iter& i, const sentinel& s)
10387    {
10388      return !(i == s);
10389    }
10390
10391    struct range
10392    {
10393      iter begin() const
10394      {
10395        return {0};
10396      }
10397
10398      sentinel end() const
10399      {
10400        return {5};
10401      }
10402    };
10403
10404    void f()
10405    {
10406      range r {};
10407
10408      for (auto i : r)
10409      {
10410        [[maybe_unused]] auto v = i;
10411      }
10412    }
10413
10414  }
10415
10416  namespace test_lambda_capture_asterisk_this_by_value
10417  {
10418
10419    struct t
10420    {
10421      int i;
10422      int foo()
10423      {
10424        return [*this]()
10425        {
10426          return i;
10427        }();
10428      }
10429    };
10430
10431  }
10432
10433  namespace test_enum_class_construction
10434  {
10435
10436    enum class byte : unsigned char
10437    {};
10438
10439    byte foo {42};
10440
10441  }
10442
10443  namespace test_constexpr_if
10444  {
10445
10446    template <bool cond>
10447    int f ()
10448    {
10449      if constexpr(cond)
10450      {
10451        return 13;
10452      }
10453      else
10454      {
10455        return 42;
10456      }
10457    }
10458
10459  }
10460
10461  namespace test_selection_statement_with_initializer
10462  {
10463
10464    int f()
10465    {
10466      return 13;
10467    }
10468
10469    int f2()
10470    {
10471      if (auto i = f(); i > 0)
10472      {
10473        return 3;
10474      }
10475
10476      switch (auto i = f(); i + 4)
10477      {
10478      case 17:
10479        return 2;
10480
10481      default:
10482        return 1;
10483      }
10484    }
10485
10486  }
10487
10488  namespace test_template_argument_deduction_for_class_templates
10489  {
10490
10491    template <typename T1, typename T2>
10492    struct pair
10493    {
10494      pair (T1 p1, T2 p2)
10495        : m1 {p1},
10496          m2 {p2}
10497      {}
10498
10499      T1 m1;
10500      T2 m2;
10501    };
10502
10503    void f()
10504    {
10505      [[maybe_unused]] auto p = pair{13, 42u};
10506    }
10507
10508  }
10509
10510  namespace test_non_type_auto_template_parameters
10511  {
10512
10513    template <auto n>
10514    struct B
10515    {};
10516
10517    B<5> b1;
10518    B<'a'> b2;
10519
10520  }
10521
10522  namespace test_structured_bindings
10523  {
10524
10525    int arr[2] = { 1, 2 };
10526    std::pair<int, int> pr = { 1, 2 };
10527
10528    auto f1() -> int(&)[2]
10529    {
10530      return arr;
10531    }
10532
10533    auto f2() -> std::pair<int, int>&
10534    {
10535      return pr;
10536    }
10537
10538    struct S
10539    {
10540      int x1 : 2;
10541      volatile double y1;
10542    };
10543
10544    S f3()
10545    {
10546      return {};
10547    }
10548
10549    auto [ x1, y1 ] = f1();
10550    auto& [ xr1, yr1 ] = f1();
10551    auto [ x2, y2 ] = f2();
10552    auto& [ xr2, yr2 ] = f2();
10553    const auto [ x3, y3 ] = f3();
10554
10555  }
10556
10557  namespace test_exception_spec_type_system
10558  {
10559
10560    struct Good {};
10561    struct Bad {};
10562
10563    void g1() noexcept;
10564    void g2();
10565
10566    template<typename T>
10567    Bad
10568    f(T*, T*);
10569
10570    template<typename T1, typename T2>
10571    Good
10572    f(T1*, T2*);
10573
10574    static_assert (std::is_same_v<Good, decltype(f(g1, g2))>);
10575
10576  }
10577
10578  namespace test_inline_variables
10579  {
10580
10581    template<class T> void f(T)
10582    {}
10583
10584    template<class T> inline T g(T)
10585    {
10586      return T{};
10587    }
10588
10589    template<> inline void f<>(int)
10590    {}
10591
10592    template<> int g<>(int)
10593    {
10594      return 5;
10595    }
10596
10597  }
10598
10599}  // namespace cxx17
10600
10601#endif  // __cplusplus < 201703L
10602
10603
10604
10605_ACEOF
10606if ac_fn_cxx_try_compile "$LINENO"
10607then :
10608  eval $cachevar=yes
10609else $as_nop
10610  eval $cachevar=no
10611fi
10612rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
10613           CXX="$ac_save_CXX"
10614fi
10615eval ac_res=\$$cachevar
10616	       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
10617printf "%s\n" "$ac_res" >&6; }
10618        if eval test x\$$cachevar = xyes; then
10619          CXX="$CXX $switch"
10620          if test -n "$CXXCPP" ; then
10621            CXXCPP="$CXXCPP $switch"
10622          fi
10623          ac_success=yes
10624          break
10625        fi
10626      done
10627      if test x$ac_success = xyes; then
10628        break
10629      fi
10630    done
10631  fi
10632  ac_ext=cpp
10633ac_cpp='$CXXCPP $CPPFLAGS'
10634ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10635ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10636ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
10637
10638  if test x$ax_cxx_compile_cxx17_required = xtrue; then
10639    if test x$ac_success = xno; then
10640      as_fn_error $? "*** A compiler with support for C++17 language features is required." "$LINENO" 5
10641    fi
10642  fi
10643  if test x$ac_success = xno; then
10644    HAVE_CXX17=0
10645    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++17 support was found" >&5
10646printf "%s\n" "$as_me: No compiler with C++17 support was found" >&6;}
10647  else
10648    HAVE_CXX17=1
10649
10650printf "%s\n" "#define HAVE_CXX17 1" >>confdefs.h
10651
10652  fi
10653
10654 ;;
10655                *) echo "Unknown version of C++ $TEA_CXX_VERSION" ;;
10656            esac
10657        fi
10658
10659        # 2. Try to link the C++ libraries statically
10660	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -static-libgcc" >&5
10661printf %s "checking whether the linker accepts -static-libgcc... " >&6; }
10662if test ${ax_cv_check_ldflags___static_libgcc+y}
10663then :
10664  printf %s "(cached) " >&6
10665else $as_nop
10666
10667  ax_check_save_flags=$LDFLAGS
10668  LDFLAGS="$LDFLAGS  -static-libgcc"
10669  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10670/* end confdefs.h.  */
10671
10672int
10673main (void)
10674{
10675
10676  ;
10677  return 0;
10678}
10679_ACEOF
10680if ac_fn_cxx_try_link "$LINENO"
10681then :
10682  ax_cv_check_ldflags___static_libgcc=yes
10683else $as_nop
10684  ax_cv_check_ldflags___static_libgcc=no
10685fi
10686rm -f core conftest.err conftest.$ac_objext conftest.beam \
10687    conftest$ac_exeext conftest.$ac_ext
10688  LDFLAGS=$ax_check_save_flags
10689fi
10690{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___static_libgcc" >&5
10691printf "%s\n" "$ax_cv_check_ldflags___static_libgcc" >&6; }
10692if test "x$ax_cv_check_ldflags___static_libgcc" = xyes
10693then :
10694  LDFLAGS="$LDFLAGS -static-libgcc"
10695else $as_nop
10696  :
10697fi
10698
10699
10700	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -static-libstdc++" >&5
10701printf %s "checking whether the linker accepts -static-libstdc++... " >&6; }
10702if test ${ax_cv_check_ldflags___static_libstdcpp+y}
10703then :
10704  printf %s "(cached) " >&6
10705else $as_nop
10706
10707  ax_check_save_flags=$LDFLAGS
10708  LDFLAGS="$LDFLAGS  -static-libstdc++"
10709  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10710/* end confdefs.h.  */
10711
10712int
10713main (void)
10714{
10715
10716  ;
10717  return 0;
10718}
10719_ACEOF
10720if ac_fn_cxx_try_link "$LINENO"
10721then :
10722  ax_cv_check_ldflags___static_libstdcpp=yes
10723else $as_nop
10724  ax_cv_check_ldflags___static_libstdcpp=no
10725fi
10726rm -f core conftest.err conftest.$ac_objext conftest.beam \
10727    conftest$ac_exeext conftest.$ac_ext
10728  LDFLAGS=$ax_check_save_flags
10729fi
10730{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___static_libstdcpp" >&5
10731printf "%s\n" "$ax_cv_check_ldflags___static_libstdcpp" >&6; }
10732if test "x$ax_cv_check_ldflags___static_libstdcpp" = xyes
10733then :
10734  LDFLAGS="$LDFLAGS -static-libstdc++"
10735else $as_nop
10736  :
10737fi
10738
10739
10740	ac_ext=c
10741ac_cpp='$CPP $CPPFLAGS'
10742ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10743ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10744ac_compiler_gnu=$ac_cv_c_compiler_gnu
10745
10746    fi
10747    #--------------------------------------------------------------------
10748    # Common compiler flag setup
10749    #--------------------------------------------------------------------
10750
10751     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
10752printf %s "checking whether byte ordering is bigendian... " >&6; }
10753if test ${ac_cv_c_bigendian+y}
10754then :
10755  printf %s "(cached) " >&6
10756else $as_nop
10757  ac_cv_c_bigendian=unknown
10758    # See if we're dealing with a universal compiler.
10759    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10760/* end confdefs.h.  */
10761#ifndef __APPLE_CC__
10762	       not a universal capable compiler
10763	     #endif
10764	     typedef int dummy;
10765
10766_ACEOF
10767if ac_fn_c_try_compile "$LINENO"
10768then :
10769
10770	# Check for potential -arch flags.  It is not universal unless
10771	# there are at least two -arch flags with different values.
10772	ac_arch=
10773	ac_prev=
10774	for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
10775	 if test -n "$ac_prev"; then
10776	   case $ac_word in
10777	     i?86 | x86_64 | ppc | ppc64)
10778	       if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
10779		 ac_arch=$ac_word
10780	       else
10781		 ac_cv_c_bigendian=universal
10782		 break
10783	       fi
10784	       ;;
10785	   esac
10786	   ac_prev=
10787	 elif test "x$ac_word" = "x-arch"; then
10788	   ac_prev=arch
10789	 fi
10790       done
10791fi
10792rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
10793    if test $ac_cv_c_bigendian = unknown; then
10794      # See if sys/param.h defines the BYTE_ORDER macro.
10795      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10796/* end confdefs.h.  */
10797#include <sys/types.h>
10798	     #include <sys/param.h>
10799
10800int
10801main (void)
10802{
10803#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
10804		     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
10805		     && LITTLE_ENDIAN)
10806	      bogus endian macros
10807	     #endif
10808
10809  ;
10810  return 0;
10811}
10812_ACEOF
10813if ac_fn_c_try_compile "$LINENO"
10814then :
10815  # It does; now see whether it defined to BIG_ENDIAN or not.
10816	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10817/* end confdefs.h.  */
10818#include <sys/types.h>
10819		#include <sys/param.h>
10820
10821int
10822main (void)
10823{
10824#if BYTE_ORDER != BIG_ENDIAN
10825		 not big endian
10826		#endif
10827
10828  ;
10829  return 0;
10830}
10831_ACEOF
10832if ac_fn_c_try_compile "$LINENO"
10833then :
10834  ac_cv_c_bigendian=yes
10835else $as_nop
10836  ac_cv_c_bigendian=no
10837fi
10838rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
10839fi
10840rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
10841    fi
10842    if test $ac_cv_c_bigendian = unknown; then
10843      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
10844      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10845/* end confdefs.h.  */
10846#include <limits.h>
10847
10848int
10849main (void)
10850{
10851#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
10852	      bogus endian macros
10853	     #endif
10854
10855  ;
10856  return 0;
10857}
10858_ACEOF
10859if ac_fn_c_try_compile "$LINENO"
10860then :
10861  # It does; now see whether it defined to _BIG_ENDIAN or not.
10862	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10863/* end confdefs.h.  */
10864#include <limits.h>
10865
10866int
10867main (void)
10868{
10869#ifndef _BIG_ENDIAN
10870		 not big endian
10871		#endif
10872
10873  ;
10874  return 0;
10875}
10876_ACEOF
10877if ac_fn_c_try_compile "$LINENO"
10878then :
10879  ac_cv_c_bigendian=yes
10880else $as_nop
10881  ac_cv_c_bigendian=no
10882fi
10883rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
10884fi
10885rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
10886    fi
10887    if test $ac_cv_c_bigendian = unknown; then
10888      # Compile a test program.
10889      if test "$cross_compiling" = yes
10890then :
10891  # Try to guess by grepping values from an object file.
10892	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10893/* end confdefs.h.  */
10894unsigned short int ascii_mm[] =
10895		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
10896		unsigned short int ascii_ii[] =
10897		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
10898		int use_ascii (int i) {
10899		  return ascii_mm[i] + ascii_ii[i];
10900		}
10901		unsigned short int ebcdic_ii[] =
10902		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
10903		unsigned short int ebcdic_mm[] =
10904		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
10905		int use_ebcdic (int i) {
10906		  return ebcdic_mm[i] + ebcdic_ii[i];
10907		}
10908		extern int foo;
10909
10910int
10911main (void)
10912{
10913return use_ascii (foo) == use_ebcdic (foo);
10914  ;
10915  return 0;
10916}
10917_ACEOF
10918if ac_fn_c_try_compile "$LINENO"
10919then :
10920  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
10921	      ac_cv_c_bigendian=yes
10922	    fi
10923	    if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
10924	      if test "$ac_cv_c_bigendian" = unknown; then
10925		ac_cv_c_bigendian=no
10926	      else
10927		# finding both strings is unlikely to happen, but who knows?
10928		ac_cv_c_bigendian=unknown
10929	      fi
10930	    fi
10931fi
10932rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
10933else $as_nop
10934  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10935/* end confdefs.h.  */
10936$ac_includes_default
10937int
10938main (void)
10939{
10940
10941	     /* Are we little or big endian?  From Harbison&Steele.  */
10942	     union
10943	     {
10944	       long int l;
10945	       char c[sizeof (long int)];
10946	     } u;
10947	     u.l = 1;
10948	     return u.c[sizeof (long int) - 1] == 1;
10949
10950  ;
10951  return 0;
10952}
10953_ACEOF
10954if ac_fn_c_try_run "$LINENO"
10955then :
10956  ac_cv_c_bigendian=no
10957else $as_nop
10958  ac_cv_c_bigendian=yes
10959fi
10960rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
10961  conftest.$ac_objext conftest.beam conftest.$ac_ext
10962fi
10963
10964    fi
10965fi
10966{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
10967printf "%s\n" "$ac_cv_c_bigendian" >&6; }
10968 case $ac_cv_c_bigendian in #(
10969   yes)
10970     printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h
10971;; #(
10972   no)
10973      ;; #(
10974   universal)
10975
10976printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
10977
10978     ;; #(
10979   *)
10980     as_fn_error $? "unknown endianness
10981 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
10982 esac
10983
10984
10985
10986#--------------------------------------------------------------------
10987# Check if building with optional Gdbm package. This will declare
10988# GDBM_CFLAGS and GDBM_LIBS variables.
10989#--------------------------------------------------------------------
10990
10991
10992
10993# Check whether --with-gdbm was given.
10994if test ${with_gdbm+y}
10995then :
10996  withval=$with_gdbm; \
10997	with_gdbm=${withval}
10998fi
10999
11000
11001    if test x"${with_gdbm}" != x -a "${with_gdbm}" != no; then
11002
11003    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gdbm library" >&5
11004printf %s "checking for GNU gdbm library... " >&6; }
11005
11006    if test ${ac_cv_c_gdbm+y}
11007then :
11008  printf %s "(cached) " >&6
11009else $as_nop
11010
11011    if test x"${with_gdbm}" != x -a "${with_gdbm}" != "yes"; then
11012        if test -f "${with_gdbm}/gdbm.h" -a x"`ls ${with_gdbm}/libgdbm* 2>/dev/null`" != x; then
11013            ac_cv_c_gdbm=`(cd ${with_gdbm}; pwd)`
11014            gincdir=$ac_cv_c_gdbm
11015            glibdir=$ac_cv_c_gdbm
11016            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found in $glibdir" >&5
11017printf "%s\n" "found in $glibdir" >&6; }
11018        else
11019            as_fn_error $? "${with_gdbm} directory doesn't contain gdbm library" "$LINENO" 5
11020        fi
11021    fi
11022
11023fi
11024
11025    if test x"${gincdir}" = x -o x"${glibdir}" = x; then
11026        for i in \
11027                `ls -d ${exec_prefix}/lib 2>/dev/null`\
11028                `ls -d ${prefix}/lib 2>/dev/null`\
11029                `ls -d /usr/local/lib 2>/dev/null`\
11030                `ls -d /usr/lib 2>/dev/null`\
11031                `ls -d /usr/lib/x86_64-linux-gnu 2>/dev/null` ; do
11032            if test x"`ls $i/libgdbm* 2>/dev/null`" != x ; then
11033                glibdir=`(cd $i; pwd)`
11034                break
11035            fi
11036        done
11037        for i in \
11038                `ls -d ${prefix}/include 2>/dev/null`\
11039                `ls -d /usr/local/include 2>/dev/null`\
11040                `ls -d /usr/include 2>/dev/null` ; do
11041            if test -f "$i/gdbm.h" ; then
11042                gincdir=`(cd $i; pwd)`
11043                break
11044            fi
11045        done
11046        if test x"$glibdir" = x -o x"$gincdir" = x ; then
11047            as_fn_error $? "none found" "$LINENO" 5
11048        else
11049            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found in $glibdir, includes in $gincdir" >&5
11050printf "%s\n" "found in $glibdir, includes in $gincdir" >&6; }
11051            printf "%s\n" "#define HAVE_GDBM 1" >>confdefs.h
11052
11053            GDBM_CFLAGS="-I\"$gincdir\""
11054            GDBM_LIBS="-L\"$glibdir\" -lgdbm"
11055        fi
11056    fi
11057    fi
11058
11059
11060#--------------------------------------------------------------------
11061# Check if building with optional lmdb package. This will declare
11062# LMDB_CFLAGS and LMDB_LIBS variables.
11063#--------------------------------------------------------------------
11064
11065
11066
11067# Check whether --with-lmdb was given.
11068if test ${with_lmdb+y}
11069then :
11070  withval=$with_lmdb; with_lmdb=${withval}
11071fi
11072
11073
11074    if test x"${with_lmdb}" != "x" -a "${with_lmdb}" != no; then
11075        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LMDB library" >&5
11076printf %s "checking for LMDB library... " >&6; }
11077        if test ${ac_cv_c_lmdb+y}
11078then :
11079  printf %s "(cached) " >&6
11080else $as_nop
11081
11082        if test x"${with_lmdb}" != x -a "${with_lmdb}" != "yes"; then
11083            if test -f "${with_lmdb}/lmdb.h" -a x"`ls ${with_lmdb}/liblmdb* 2>/dev/null`" != x; then
11084                ac_cv_c_lmdb=`(cd ${with_lmdb}; pwd)`
11085                lincdir=$ac_cv_c_lmdb
11086                llibdir=$ac_cv_c_lmdb
11087                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found in $llibdir" >&5
11088printf "%s\n" "found in $llibdir" >&6; }
11089            else
11090                as_fn_error $? "${with_lmdb} directory doesn't contain lmdb library" "$LINENO" 5
11091            fi
11092        fi
11093
11094fi
11095
11096        if test x"${lincdir}" = x -o x"${llibdir}" = x; then
11097            for i in \
11098                    `ls -d ${exec_prefix}/lib 2>/dev/null`\
11099                    `ls -d ${prefix}/lib 2>/dev/null`\
11100                    `ls -d /usr/local/lib 2>/dev/null`\
11101                    `ls -d /usr/lib 2>/dev/null`\
11102                    `ls -d /usr/lib/x86_64-linux-gnu 2>/dev/null` ; do
11103                if test x"`ls $i/liblmdb* 2>/dev/null`" != x ; then
11104                    llibdir=`(cd $i; pwd)`
11105                    break
11106                fi
11107            done
11108            for i in \
11109                    `ls -d ${prefix}/include 2>/dev/null`\
11110                    `ls -d /usr/local/include 2>/dev/null`\
11111                    `ls -d /usr/include 2>/dev/null` ; do
11112                if test -f "$i/lmdb.h" ; then
11113                    lincdir=`(cd $i; pwd)`
11114                    break
11115                fi
11116            done
11117            if test x"$llibdir" = x -o x"$lincdir" = x ; then
11118                as_fn_error $? "none found" "$LINENO" 5
11119            else
11120                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found in $llibdir, includes in $lincdir" >&5
11121printf "%s\n" "found in $llibdir, includes in $lincdir" >&6; }
11122                printf "%s\n" "#define HAVE_LMDB 1" >>confdefs.h
11123
11124                LMDB_CFLAGS="-I\"$lincdir\""
11125                LMDB_LIBS="-L\"$llibdir\" -llmdb"
11126            fi
11127        fi
11128    fi
11129
11130
11131#--------------------------------------------------------------------
11132# Locate the NaviServer/AOLserver dir for compilation as NaviServer/AOLserver module.
11133# This will declare NS_INCLUDES, NS_LIBS and define NS_AOLSERVER.
11134#--------------------------------------------------------------------
11135
11136
11137    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for NaviServer/AOLserver configuration" >&5
11138printf %s "checking for NaviServer/AOLserver configuration... " >&6; }
11139
11140# Check whether --with-naviserver was given.
11141if test ${with_naviserver+y}
11142then :
11143  withval=$with_naviserver; \
11144    with_naviserver=${withval}
11145fi
11146
11147
11148    if test ${ac_cv_c_naviserver+y}
11149then :
11150  printf %s "(cached) " >&6
11151else $as_nop
11152
11153    if test x"${with_naviserver}" != x ; then
11154        if test -f "${with_naviserver}/include/ns.h" ; then
11155            ac_cv_c_naviserver=`(cd ${with_naviserver}; pwd)`
11156        else
11157            as_fn_error $? "${with_naviserver} directory doesn't contain ns.h" "$LINENO" 5
11158        fi
11159    fi
11160
11161fi
11162
11163    if test x"${ac_cv_c_naviserver}" = x ; then
11164        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none found" >&5
11165printf "%s\n" "none found" >&6; }
11166    else
11167        NS_DIR=${ac_cv_c_naviserver}
11168        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found NaviServer/AOLserver in $NS_DIR" >&5
11169printf "%s\n" "found NaviServer/AOLserver in $NS_DIR" >&6; }
11170        NS_INCLUDES="-I\"${NS_DIR}/include\""
11171        if test "`uname -s`" = Darwin ; then
11172            aollibs=`ls ${NS_DIR}/lib/libns* 2>/dev/null`
11173            if test x"$aollibs" != x ; then
11174                NS_LIBS="-L\"${NS_DIR}/lib\" -lnsd -lnsthread"
11175            fi
11176        fi
11177        printf "%s\n" "#define NS_AOLSERVER 1" >>confdefs.h
11178
11179    fi
11180
11181
11182#-----------------------------------------------------------------------
11183# __CHANGE__
11184# Specify the C source files to compile in TEA_ADD_SOURCES,
11185# public headers that need to be installed in TEA_ADD_HEADERS,
11186# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
11187# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
11188# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
11189# and PKG_TCL_SOURCES.
11190#-----------------------------------------------------------------------
11191
11192
11193    vars="generic/threadNs.c           \
11194                 generic/threadCmd.c          \
11195                 generic/threadSvCmd.c        \
11196                 generic/threadSpCmd.c        \
11197                 generic/threadPoolCmd.c      \
11198                 generic/psGdbm.c             \
11199                 generic/psLmdb.c             \
11200                 generic/threadSvListCmd.c    \
11201                 generic/threadSvKeylistCmd.c \
11202                 generic/tclXkeylist.c        \
11203"
11204    for i in $vars; do
11205	case $i in
11206	    \$*)
11207		# allow $-var names
11208		PKG_SOURCES="$PKG_SOURCES $i"
11209		PKG_OBJECTS="$PKG_OBJECTS $i"
11210		;;
11211	    *)
11212		# check for existence - allows for generic/win/unix VPATH
11213		# To add more dirs here (like 'src'), you have to update VPATH
11214		# in Makefile.in as well
11215		if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
11216		    -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
11217		    -a ! -f "${srcdir}/macosx/$i" \
11218		    ; then
11219		    as_fn_error $? "could not find source file '$i'" "$LINENO" 5
11220		fi
11221		PKG_SOURCES="$PKG_SOURCES $i"
11222		# this assumes it is in a VPATH dir
11223		i=`basename $i`
11224		# handle user calling this before or after TEA_SETUP_COMPILER
11225		if test x"${OBJEXT}" != x ; then
11226		    j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}"
11227		else
11228		    j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}"
11229		fi
11230		PKG_OBJECTS="$PKG_OBJECTS $j"
11231		;;
11232	esac
11233    done
11234
11235
11236
11237
11238
11239    vars="generic/tclThread.h"
11240    for i in $vars; do
11241	# check for existence, be strict because it is installed
11242	if test ! -f "${srcdir}/$i" ; then
11243	    as_fn_error $? "could not find header file '${srcdir}/$i'" "$LINENO" 5
11244	fi
11245	PKG_HEADERS="$PKG_HEADERS $i"
11246    done
11247
11248
11249
11250    vars="${NS_INCLUDES}"
11251    for i in $vars; do
11252	PKG_INCLUDES="$PKG_INCLUDES $i"
11253    done
11254
11255
11256
11257    vars="${GDBM_LIBS} ${LMDB_LIBS} ${NS_LIBS}"
11258    for i in $vars; do
11259	if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
11260	    # Convert foo.lib to -lfoo for GCC.  No-op if not *.lib
11261	    i=`echo "$i" | sed -e 's/^\([^-].*\)\.[lL][iI][bB]$/-l\1/'`
11262	fi
11263	PKG_LIBS="$PKG_LIBS $i"
11264    done
11265
11266
11267
11268    PKG_CFLAGS="$PKG_CFLAGS ${GDBM_CFLAGS} ${LMDB_CFLAGS}"
11269
11270
11271
11272
11273
11274    vars=""
11275    for i in $vars; do
11276	# check for existence - allows for generic/win/unix VPATH
11277	if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
11278	    -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
11279	    -a ! -f "${srcdir}/macosx/$i" \
11280	    ; then
11281	    as_fn_error $? "could not find stub source file '$i'" "$LINENO" 5
11282	fi
11283	PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i"
11284	# this assumes it is in a VPATH dir
11285	i=`basename $i`
11286	# handle user calling this before or after TEA_SETUP_COMPILER
11287	if test x"${OBJEXT}" != x ; then
11288	    j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}"
11289	else
11290	    j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}"
11291	fi
11292	PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j"
11293    done
11294
11295
11296
11297
11298    vars="lib/ttrace.tcl"
11299    for i in $vars; do
11300	# check for existence, be strict because it is installed
11301	if test ! -f "${srcdir}/$i" ; then
11302	    as_fn_error $? "could not find tcl source file '${srcdir}/$i'" "$LINENO" 5
11303	fi
11304	PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i"
11305    done
11306
11307
11308
11309#--------------------------------------------------------------------
11310# __CHANGE__
11311# A few miscellaneous platform-specific items:
11312#
11313# Define a special symbol for Windows (BUILD_sample in this case) so
11314# that we create the export library with the dll.
11315#
11316# Windows creates a few extra files that need to be cleaned up.
11317# You can add more files to clean if your extension creates any extra
11318# files.
11319#
11320# TEA_ADD_* any platform specific compiler/build info here.
11321#--------------------------------------------------------------------
11322
11323if test "${TEA_PLATFORM}" = "windows" ; then
11324
11325    vars="-I\"$(${CYGPATH} ${srcdir}/win)\""
11326    for i in $vars; do
11327	PKG_INCLUDES="$PKG_INCLUDES $i"
11328    done
11329
11330
11331else
11332
11333    vars="unix/threadUnix.c"
11334    for i in $vars; do
11335	case $i in
11336	    \$*)
11337		# allow $-var names
11338		PKG_SOURCES="$PKG_SOURCES $i"
11339		PKG_OBJECTS="$PKG_OBJECTS $i"
11340		;;
11341	    *)
11342		# check for existence - allows for generic/win/unix VPATH
11343		# To add more dirs here (like 'src'), you have to update VPATH
11344		# in Makefile.in as well
11345		if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
11346		    -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
11347		    -a ! -f "${srcdir}/macosx/$i" \
11348		    ; then
11349		    as_fn_error $? "could not find source file '$i'" "$LINENO" 5
11350		fi
11351		PKG_SOURCES="$PKG_SOURCES $i"
11352		# this assumes it is in a VPATH dir
11353		i=`basename $i`
11354		# handle user calling this before or after TEA_SETUP_COMPILER
11355		if test x"${OBJEXT}" != x ; then
11356		    j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}"
11357		else
11358		    j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}"
11359		fi
11360		PKG_OBJECTS="$PKG_OBJECTS $j"
11361		;;
11362	esac
11363    done
11364
11365
11366
11367fi
11368
11369#--------------------------------------------------------------------
11370# __CHANGE__
11371# Choose which headers you need.  Extension authors should try very
11372# hard to only rely on the Tcl public header files.  Internal headers
11373# contain private data structures and are subject to change without
11374# notice.
11375# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
11376#--------------------------------------------------------------------
11377
11378
11379    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Tcl public headers" >&5
11380printf %s "checking for Tcl public headers... " >&6; }
11381
11382
11383# Check whether --with-tclinclude was given.
11384if test ${with_tclinclude+y}
11385then :
11386  withval=$with_tclinclude; with_tclinclude=${withval}
11387fi
11388
11389
11390    if test ${ac_cv_c_tclh+y}
11391then :
11392  printf %s "(cached) " >&6
11393else $as_nop
11394
11395	# Use the value from --with-tclinclude, if it was given
11396
11397	if test x"${with_tclinclude}" != x ; then
11398	    if test -f "${with_tclinclude}/tcl.h" ; then
11399		ac_cv_c_tclh=${with_tclinclude}
11400	    else
11401		as_fn_error $? "${with_tclinclude} directory does not contain tcl.h" "$LINENO" 5
11402	    fi
11403	else
11404	    list=""
11405	    if test "`uname -s`" = "Darwin"; then
11406		# If Tcl was built as a framework, attempt to use
11407		# the framework's Headers directory
11408		case ${TCL_DEFS} in
11409		    *TCL_FRAMEWORK*)
11410			list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`"
11411			;;
11412		esac
11413	    fi
11414
11415	    # Look in the source dir only if Tcl is not installed,
11416	    # and in that situation, look there before installed locations.
11417	    if test -f "${TCL_BIN_DIR}/Makefile" ; then
11418		list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`"
11419	    fi
11420
11421	    # Check order: pkg --prefix location, Tcl's --prefix location,
11422	    # relative to directory of tclConfig.sh.
11423
11424	    eval "temp_includedir=${includedir}"
11425	    list="$list \
11426		`ls -d ${temp_includedir}        2>/dev/null` \
11427		`ls -d ${TCL_PREFIX}/include     2>/dev/null` \
11428		`ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
11429	    if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
11430		list="$list /usr/local/include /usr/include"
11431		if test x"${TCL_INCLUDE_SPEC}" != x ; then
11432		    d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'`
11433		    list="$list `ls -d ${d} 2>/dev/null`"
11434		fi
11435	    fi
11436	    for i in $list ; do
11437		if test -f "$i/tcl.h" ; then
11438		    ac_cv_c_tclh=$i
11439		    break
11440		fi
11441	    done
11442	fi
11443
11444fi
11445
11446
11447    # Print a message based on how we determined the include path
11448
11449    if test x"${ac_cv_c_tclh}" = x ; then
11450	as_fn_error $? "tcl.h not found.  Please specify its location with --with-tclinclude" "$LINENO" 5
11451    else
11452	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_c_tclh}" >&5
11453printf "%s\n" "${ac_cv_c_tclh}" >&6; }
11454    fi
11455
11456    # Convert to a native path and substitute into the output files.
11457
11458    INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}`
11459
11460    TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
11461
11462
11463
11464#TEA_PRIVATE_TCL_HEADERS
11465
11466#TEA_PUBLIC_TK_HEADERS
11467#TEA_PRIVATE_TK_HEADERS
11468#TEA_PATH_X
11469
11470#--------------------------------------------------------------------
11471# Check whether --enable-threads or --disable-threads was given.
11472# This auto-enables if Tcl was compiled threaded.
11473#--------------------------------------------------------------------
11474
11475
11476    # Check whether --enable-threads was given.
11477if test ${enable_threads+y}
11478then :
11479  enableval=$enable_threads; tcl_ok=$enableval
11480else $as_nop
11481  tcl_ok=yes
11482fi
11483
11484
11485    if test "${enable_threads+set}" = set; then
11486	enableval="$enable_threads"
11487	tcl_ok=$enableval
11488    else
11489	tcl_ok=yes
11490    fi
11491
11492    if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
11493	TCL_THREADS=1
11494
11495	if test "${TEA_PLATFORM}" != "windows" ; then
11496	    # We are always OK on Windows, so check what this platform wants:
11497
11498	    # USE_THREAD_ALLOC tells us to try the special thread-based
11499	    # allocator that significantly reduces lock contention
11500
11501printf "%s\n" "#define USE_THREAD_ALLOC 1" >>confdefs.h
11502
11503
11504printf "%s\n" "#define _REENTRANT 1" >>confdefs.h
11505
11506	    if test "`uname -s`" = "SunOS" ; then
11507
11508printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
11509
11510	    fi
11511
11512printf "%s\n" "#define _THREAD_SAFE 1" >>confdefs.h
11513
11514	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5
11515printf %s "checking for pthread_mutex_init in -lpthread... " >&6; }
11516if test ${ac_cv_lib_pthread_pthread_mutex_init+y}
11517then :
11518  printf %s "(cached) " >&6
11519else $as_nop
11520  ac_check_lib_save_LIBS=$LIBS
11521LIBS="-lpthread  $LIBS"
11522cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11523/* end confdefs.h.  */
11524
11525/* Override any GCC internal prototype to avoid an error.
11526   Use char because int might match the return type of a GCC
11527   builtin and then its argument prototype would still apply.  */
11528char pthread_mutex_init ();
11529int
11530main (void)
11531{
11532return pthread_mutex_init ();
11533  ;
11534  return 0;
11535}
11536_ACEOF
11537if ac_fn_c_try_link "$LINENO"
11538then :
11539  ac_cv_lib_pthread_pthread_mutex_init=yes
11540else $as_nop
11541  ac_cv_lib_pthread_pthread_mutex_init=no
11542fi
11543rm -f core conftest.err conftest.$ac_objext conftest.beam \
11544    conftest$ac_exeext conftest.$ac_ext
11545LIBS=$ac_check_lib_save_LIBS
11546fi
11547{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5
11548printf "%s\n" "$ac_cv_lib_pthread_pthread_mutex_init" >&6; }
11549if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes
11550then :
11551  tcl_ok=yes
11552else $as_nop
11553  tcl_ok=no
11554fi
11555
11556	    if test "$tcl_ok" = "no"; then
11557		# Check a little harder for __pthread_mutex_init in the same
11558		# library, as some systems hide it there until pthread.h is
11559		# defined.  We could alternatively do an AC_TRY_COMPILE with
11560		# pthread.h, but that will work with libpthread really doesn't
11561		# exist, like AIX 4.2.  [Bug: 4359]
11562		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __pthread_mutex_init in -lpthread" >&5
11563printf %s "checking for __pthread_mutex_init in -lpthread... " >&6; }
11564if test ${ac_cv_lib_pthread___pthread_mutex_init+y}
11565then :
11566  printf %s "(cached) " >&6
11567else $as_nop
11568  ac_check_lib_save_LIBS=$LIBS
11569LIBS="-lpthread  $LIBS"
11570cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11571/* end confdefs.h.  */
11572
11573/* Override any GCC internal prototype to avoid an error.
11574   Use char because int might match the return type of a GCC
11575   builtin and then its argument prototype would still apply.  */
11576char __pthread_mutex_init ();
11577int
11578main (void)
11579{
11580return __pthread_mutex_init ();
11581  ;
11582  return 0;
11583}
11584_ACEOF
11585if ac_fn_c_try_link "$LINENO"
11586then :
11587  ac_cv_lib_pthread___pthread_mutex_init=yes
11588else $as_nop
11589  ac_cv_lib_pthread___pthread_mutex_init=no
11590fi
11591rm -f core conftest.err conftest.$ac_objext conftest.beam \
11592    conftest$ac_exeext conftest.$ac_ext
11593LIBS=$ac_check_lib_save_LIBS
11594fi
11595{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5
11596printf "%s\n" "$ac_cv_lib_pthread___pthread_mutex_init" >&6; }
11597if test "x$ac_cv_lib_pthread___pthread_mutex_init" = xyes
11598then :
11599  tcl_ok=yes
11600else $as_nop
11601  tcl_ok=no
11602fi
11603
11604	    fi
11605
11606	    if test "$tcl_ok" = "yes"; then
11607		# The space is needed
11608		THREADS_LIBS=" -lpthread"
11609	    else
11610		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthreads" >&5
11611printf %s "checking for pthread_mutex_init in -lpthreads... " >&6; }
11612if test ${ac_cv_lib_pthreads_pthread_mutex_init+y}
11613then :
11614  printf %s "(cached) " >&6
11615else $as_nop
11616  ac_check_lib_save_LIBS=$LIBS
11617LIBS="-lpthreads  $LIBS"
11618cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11619/* end confdefs.h.  */
11620
11621/* Override any GCC internal prototype to avoid an error.
11622   Use char because int might match the return type of a GCC
11623   builtin and then its argument prototype would still apply.  */
11624char pthread_mutex_init ();
11625int
11626main (void)
11627{
11628return pthread_mutex_init ();
11629  ;
11630  return 0;
11631}
11632_ACEOF
11633if ac_fn_c_try_link "$LINENO"
11634then :
11635  ac_cv_lib_pthreads_pthread_mutex_init=yes
11636else $as_nop
11637  ac_cv_lib_pthreads_pthread_mutex_init=no
11638fi
11639rm -f core conftest.err conftest.$ac_objext conftest.beam \
11640    conftest$ac_exeext conftest.$ac_ext
11641LIBS=$ac_check_lib_save_LIBS
11642fi
11643{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5
11644printf "%s\n" "$ac_cv_lib_pthreads_pthread_mutex_init" >&6; }
11645if test "x$ac_cv_lib_pthreads_pthread_mutex_init" = xyes
11646then :
11647  tcl_ok=yes
11648else $as_nop
11649  tcl_ok=no
11650fi
11651
11652		if test "$tcl_ok" = "yes"; then
11653		    # The space is needed
11654		    THREADS_LIBS=" -lpthreads"
11655		else
11656		    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc" >&5
11657printf %s "checking for pthread_mutex_init in -lc... " >&6; }
11658if test ${ac_cv_lib_c_pthread_mutex_init+y}
11659then :
11660  printf %s "(cached) " >&6
11661else $as_nop
11662  ac_check_lib_save_LIBS=$LIBS
11663LIBS="-lc  $LIBS"
11664cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11665/* end confdefs.h.  */
11666
11667/* Override any GCC internal prototype to avoid an error.
11668   Use char because int might match the return type of a GCC
11669   builtin and then its argument prototype would still apply.  */
11670char pthread_mutex_init ();
11671int
11672main (void)
11673{
11674return pthread_mutex_init ();
11675  ;
11676  return 0;
11677}
11678_ACEOF
11679if ac_fn_c_try_link "$LINENO"
11680then :
11681  ac_cv_lib_c_pthread_mutex_init=yes
11682else $as_nop
11683  ac_cv_lib_c_pthread_mutex_init=no
11684fi
11685rm -f core conftest.err conftest.$ac_objext conftest.beam \
11686    conftest$ac_exeext conftest.$ac_ext
11687LIBS=$ac_check_lib_save_LIBS
11688fi
11689{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_pthread_mutex_init" >&5
11690printf "%s\n" "$ac_cv_lib_c_pthread_mutex_init" >&6; }
11691if test "x$ac_cv_lib_c_pthread_mutex_init" = xyes
11692then :
11693  tcl_ok=yes
11694else $as_nop
11695  tcl_ok=no
11696fi
11697
11698		    if test "$tcl_ok" = "no"; then
11699			{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc_r" >&5
11700printf %s "checking for pthread_mutex_init in -lc_r... " >&6; }
11701if test ${ac_cv_lib_c_r_pthread_mutex_init+y}
11702then :
11703  printf %s "(cached) " >&6
11704else $as_nop
11705  ac_check_lib_save_LIBS=$LIBS
11706LIBS="-lc_r  $LIBS"
11707cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11708/* end confdefs.h.  */
11709
11710/* Override any GCC internal prototype to avoid an error.
11711   Use char because int might match the return type of a GCC
11712   builtin and then its argument prototype would still apply.  */
11713char pthread_mutex_init ();
11714int
11715main (void)
11716{
11717return pthread_mutex_init ();
11718  ;
11719  return 0;
11720}
11721_ACEOF
11722if ac_fn_c_try_link "$LINENO"
11723then :
11724  ac_cv_lib_c_r_pthread_mutex_init=yes
11725else $as_nop
11726  ac_cv_lib_c_r_pthread_mutex_init=no
11727fi
11728rm -f core conftest.err conftest.$ac_objext conftest.beam \
11729    conftest$ac_exeext conftest.$ac_ext
11730LIBS=$ac_check_lib_save_LIBS
11731fi
11732{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5
11733printf "%s\n" "$ac_cv_lib_c_r_pthread_mutex_init" >&6; }
11734if test "x$ac_cv_lib_c_r_pthread_mutex_init" = xyes
11735then :
11736  tcl_ok=yes
11737else $as_nop
11738  tcl_ok=no
11739fi
11740
11741			if test "$tcl_ok" = "yes"; then
11742			    # The space is needed
11743			    THREADS_LIBS=" -pthread"
11744			else
11745			    TCL_THREADS=0
11746			    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5
11747printf "%s\n" "$as_me: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&2;}
11748			fi
11749		    fi
11750		fi
11751	    fi
11752	fi
11753    else
11754	TCL_THREADS=0
11755    fi
11756    # Do checking message here to not mess up interleaved configure output
11757    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for building with threads" >&5
11758printf %s "checking for building with threads... " >&6; }
11759    if test "${TCL_THREADS}" = 1; then
11760
11761printf "%s\n" "#define TCL_THREADS 1" >>confdefs.h
11762
11763	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5
11764printf "%s\n" "yes (default)" >&6; }
11765    else
11766	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
11767printf "%s\n" "no" >&6; }
11768    fi
11769    # TCL_THREADS sanity checking.  See if our request for building with
11770    # threads is the same as the way Tcl was built.  If not, warn the user.
11771    case ${TCL_DEFS} in
11772	*THREADS=1*)
11773	    if test "${TCL_THREADS}" = "0"; then
11774		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING:
11775    Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
11776    that IS thread-enabled.  It is recommended to use --enable-threads." >&5
11777printf "%s\n" "$as_me: WARNING:
11778    Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
11779    that IS thread-enabled.  It is recommended to use --enable-threads." >&2;}
11780	    fi
11781	    ;;
11782    esac
11783
11784
11785
11786#--------------------------------------------------------------------
11787# The statement below defines a collection of symbols related to
11788# building as a shared library instead of a static library.
11789#--------------------------------------------------------------------
11790
11791
11792    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5
11793printf %s "checking how to build libraries... " >&6; }
11794    # Check whether --enable-shared was given.
11795if test ${enable_shared+y}
11796then :
11797  enableval=$enable_shared; shared_ok=$enableval
11798else $as_nop
11799  shared_ok=yes
11800fi
11801
11802
11803    if test "${enable_shared+set}" = set; then
11804	enableval="$enable_shared"
11805	shared_ok=$enableval
11806    else
11807	shared_ok=yes
11808    fi
11809
11810    # Check whether --enable-stubs was given.
11811if test ${enable_stubs+y}
11812then :
11813  enableval=$enable_stubs; stubs_ok=$enableval
11814else $as_nop
11815  stubs_ok=yes
11816fi
11817
11818
11819    if test "${enable_stubs+set}" = set; then
11820	enableval="$enable_stubs"
11821	stubs_ok=$enableval
11822    else
11823	stubs_ok=yes
11824    fi
11825
11826    # Stubs are always enabled for shared builds
11827    if test "$shared_ok" = "yes" ; then
11828	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: shared" >&5
11829printf "%s\n" "shared" >&6; }
11830	SHARED_BUILD=1
11831        STUBS_BUILD=1
11832    else
11833	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static" >&5
11834printf "%s\n" "static" >&6; }
11835	SHARED_BUILD=0
11836
11837printf "%s\n" "#define STATIC_BUILD 1" >>confdefs.h
11838
11839        if test "$stubs_ok" = "yes" ; then
11840          STUBS_BUILD=1
11841        else
11842          STUBS_BUILD=0
11843        fi
11844    fi
11845    if test "${STUBS_BUILD}" = "1" ; then
11846
11847printf "%s\n" "#define USE_TCL_STUBS 1" >>confdefs.h
11848
11849
11850printf "%s\n" "#define USE_TCLOO_STUBS 1" >>confdefs.h
11851
11852      if test "${TEA_WINDOWINGSYSTEM}" != ""; then
11853
11854printf "%s\n" "#define USE_TK_STUBS 1" >>confdefs.h
11855
11856      fi
11857    fi
11858
11859
11860
11861
11862
11863#--------------------------------------------------------------------
11864# This macro figures out what flags to use with the compiler/linker
11865# when building shared/static debug/optimized objects.  This information
11866# can be taken from the tclConfig.sh file, but this figures it all out.
11867#--------------------------------------------------------------------
11868
11869if test -n "$ac_tool_prefix"; then
11870  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
11871set dummy ${ac_tool_prefix}ranlib; ac_word=$2
11872{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
11873printf %s "checking for $ac_word... " >&6; }
11874if test ${ac_cv_prog_RANLIB+y}
11875then :
11876  printf %s "(cached) " >&6
11877else $as_nop
11878  if test -n "$RANLIB"; then
11879  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
11880else
11881as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11882for as_dir in $PATH
11883do
11884  IFS=$as_save_IFS
11885  case $as_dir in #(((
11886    '') as_dir=./ ;;
11887    */) ;;
11888    *) as_dir=$as_dir/ ;;
11889  esac
11890    for ac_exec_ext in '' $ac_executable_extensions; do
11891  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
11892    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
11893    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
11894    break 2
11895  fi
11896done
11897  done
11898IFS=$as_save_IFS
11899
11900fi
11901fi
11902RANLIB=$ac_cv_prog_RANLIB
11903if test -n "$RANLIB"; then
11904  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
11905printf "%s\n" "$RANLIB" >&6; }
11906else
11907  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
11908printf "%s\n" "no" >&6; }
11909fi
11910
11911
11912fi
11913if test -z "$ac_cv_prog_RANLIB"; then
11914  ac_ct_RANLIB=$RANLIB
11915  # Extract the first word of "ranlib", so it can be a program name with args.
11916set dummy ranlib; ac_word=$2
11917{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
11918printf %s "checking for $ac_word... " >&6; }
11919if test ${ac_cv_prog_ac_ct_RANLIB+y}
11920then :
11921  printf %s "(cached) " >&6
11922else $as_nop
11923  if test -n "$ac_ct_RANLIB"; then
11924  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
11925else
11926as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11927for as_dir in $PATH
11928do
11929  IFS=$as_save_IFS
11930  case $as_dir in #(((
11931    '') as_dir=./ ;;
11932    */) ;;
11933    *) as_dir=$as_dir/ ;;
11934  esac
11935    for ac_exec_ext in '' $ac_executable_extensions; do
11936  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
11937    ac_cv_prog_ac_ct_RANLIB="ranlib"
11938    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
11939    break 2
11940  fi
11941done
11942  done
11943IFS=$as_save_IFS
11944
11945fi
11946fi
11947ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
11948if test -n "$ac_ct_RANLIB"; then
11949  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
11950printf "%s\n" "$ac_ct_RANLIB" >&6; }
11951else
11952  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
11953printf "%s\n" "no" >&6; }
11954fi
11955
11956  if test "x$ac_ct_RANLIB" = x; then
11957    RANLIB=":"
11958  else
11959    case $cross_compiling:$ac_tool_warned in
11960yes:)
11961{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
11962printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
11963ac_tool_warned=yes ;;
11964esac
11965    RANLIB=$ac_ct_RANLIB
11966  fi
11967else
11968  RANLIB="$ac_cv_prog_RANLIB"
11969fi
11970
11971
11972
11973
11974    # Step 0.a: Enable 64 bit support?
11975
11976    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if 64bit support is requested" >&5
11977printf %s "checking if 64bit support is requested... " >&6; }
11978    # Check whether --enable-64bit was given.
11979if test ${enable_64bit+y}
11980then :
11981  enableval=$enable_64bit; do64bit=$enableval
11982else $as_nop
11983  do64bit=no
11984fi
11985
11986    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5
11987printf "%s\n" "$do64bit" >&6; }
11988
11989    # Step 0.b: Enable Solaris 64 bit VIS support?
11990
11991    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if 64bit Sparc VIS support is requested" >&5
11992printf %s "checking if 64bit Sparc VIS support is requested... " >&6; }
11993    # Check whether --enable-64bit-vis was given.
11994if test ${enable_64bit_vis+y}
11995then :
11996  enableval=$enable_64bit_vis; do64bitVIS=$enableval
11997else $as_nop
11998  do64bitVIS=no
11999fi
12000
12001    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $do64bitVIS" >&5
12002printf "%s\n" "$do64bitVIS" >&6; }
12003    # Force 64bit on with VIS
12004    if test "$do64bitVIS" = "yes"
12005then :
12006  do64bit=yes
12007fi
12008
12009    # Step 0.c: Check if visibility support is available. Do this here so
12010    # that platform specific alternatives can be used below if this fails.
12011
12012    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler supports visibility \"hidden\"" >&5
12013printf %s "checking if compiler supports visibility \"hidden\"... " >&6; }
12014if test ${tcl_cv_cc_visibility_hidden+y}
12015then :
12016  printf %s "(cached) " >&6
12017else $as_nop
12018
12019	hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
12020	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12021/* end confdefs.h.  */
12022
12023	    extern __attribute__((__visibility__("hidden"))) void f(void);
12024	    void f(void) {}
12025int
12026main (void)
12027{
12028f();
12029  ;
12030  return 0;
12031}
12032_ACEOF
12033if ac_fn_c_try_link "$LINENO"
12034then :
12035  tcl_cv_cc_visibility_hidden=yes
12036else $as_nop
12037  tcl_cv_cc_visibility_hidden=no
12038fi
12039rm -f core conftest.err conftest.$ac_objext conftest.beam \
12040    conftest$ac_exeext conftest.$ac_ext
12041	CFLAGS=$hold_cflags
12042fi
12043{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_visibility_hidden" >&5
12044printf "%s\n" "$tcl_cv_cc_visibility_hidden" >&6; }
12045    if test $tcl_cv_cc_visibility_hidden = yes
12046then :
12047
12048
12049printf "%s\n" "#define MODULE_SCOPE extern __attribute__((__visibility__(\"hidden\")))" >>confdefs.h
12050
12051
12052printf "%s\n" "#define HAVE_HIDDEN 1" >>confdefs.h
12053
12054
12055fi
12056
12057    # Step 0.d: Disable -rpath support?
12058
12059    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if rpath support is requested" >&5
12060printf %s "checking if rpath support is requested... " >&6; }
12061    # Check whether --enable-rpath was given.
12062if test ${enable_rpath+y}
12063then :
12064  enableval=$enable_rpath; doRpath=$enableval
12065else $as_nop
12066  doRpath=yes
12067fi
12068
12069    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $doRpath" >&5
12070printf "%s\n" "$doRpath" >&6; }
12071
12072    # Set the variable "system" to hold the name and version number
12073    # for the system.
12074
12075
12076    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking system version" >&5
12077printf %s "checking system version... " >&6; }
12078if test ${tcl_cv_sys_version+y}
12079then :
12080  printf %s "(cached) " >&6
12081else $as_nop
12082
12083	# TEA specific:
12084	if test "${TEA_PLATFORM}" = "windows" ; then
12085	    tcl_cv_sys_version=windows
12086	else
12087	    tcl_cv_sys_version=`uname -s`-`uname -r`
12088	    if test "$?" -ne 0 ; then
12089		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5
12090printf "%s\n" "$as_me: WARNING: can't find uname command" >&2;}
12091		tcl_cv_sys_version=unknown
12092	    else
12093		if test "`uname -s`" = "AIX" ; then
12094		    tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
12095		fi
12096		if test "`uname -s`" = "NetBSD" -a -f /etc/debian_version ; then
12097		    tcl_cv_sys_version=NetBSD-Debian
12098		fi
12099	    fi
12100	fi
12101
12102fi
12103{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5
12104printf "%s\n" "$tcl_cv_sys_version" >&6; }
12105    system=$tcl_cv_sys_version
12106
12107
12108    # Require ranlib early so we can override it in special cases below.
12109
12110
12111
12112    # Set configuration options based on system name and version.
12113    # This is similar to Tcl's unix/tcl.m4 except that we've added a
12114    # "windows" case and removed some core-only vars.
12115
12116    do64bit_ok=no
12117    # default to '{$LIBS}' and set to "" on per-platform necessary basis
12118    SHLIB_LD_LIBS='${LIBS}'
12119    # When ld needs options to work in 64-bit mode, put them in
12120    # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
12121    # is disabled by the user. [Bug 1016796]
12122    LDFLAGS_ARCH=""
12123    UNSHARED_LIB_SUFFIX=""
12124    # TEA specific: use PACKAGE_VERSION instead of VERSION
12125    TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`'
12126    ECHO_VERSION='`echo ${PACKAGE_VERSION}`'
12127    TCL_LIB_VERSIONS_OK=ok
12128    CFLAGS_DEBUG=-g
12129    if test "$GCC" = yes
12130then :
12131
12132	CFLAGS_OPTIMIZE=-O2
12133	CFLAGS_WARNING="-Wall"
12134
12135else $as_nop
12136
12137	CFLAGS_OPTIMIZE=-O
12138	CFLAGS_WARNING=""
12139
12140fi
12141    if test -n "$ac_tool_prefix"; then
12142  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
12143set dummy ${ac_tool_prefix}ar; ac_word=$2
12144{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12145printf %s "checking for $ac_word... " >&6; }
12146if test ${ac_cv_prog_AR+y}
12147then :
12148  printf %s "(cached) " >&6
12149else $as_nop
12150  if test -n "$AR"; then
12151  ac_cv_prog_AR="$AR" # Let the user override the test.
12152else
12153as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12154for as_dir in $PATH
12155do
12156  IFS=$as_save_IFS
12157  case $as_dir in #(((
12158    '') as_dir=./ ;;
12159    */) ;;
12160    *) as_dir=$as_dir/ ;;
12161  esac
12162    for ac_exec_ext in '' $ac_executable_extensions; do
12163  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
12164    ac_cv_prog_AR="${ac_tool_prefix}ar"
12165    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
12166    break 2
12167  fi
12168done
12169  done
12170IFS=$as_save_IFS
12171
12172fi
12173fi
12174AR=$ac_cv_prog_AR
12175if test -n "$AR"; then
12176  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
12177printf "%s\n" "$AR" >&6; }
12178else
12179  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
12180printf "%s\n" "no" >&6; }
12181fi
12182
12183
12184fi
12185if test -z "$ac_cv_prog_AR"; then
12186  ac_ct_AR=$AR
12187  # Extract the first word of "ar", so it can be a program name with args.
12188set dummy ar; ac_word=$2
12189{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12190printf %s "checking for $ac_word... " >&6; }
12191if test ${ac_cv_prog_ac_ct_AR+y}
12192then :
12193  printf %s "(cached) " >&6
12194else $as_nop
12195  if test -n "$ac_ct_AR"; then
12196  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
12197else
12198as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12199for as_dir in $PATH
12200do
12201  IFS=$as_save_IFS
12202  case $as_dir in #(((
12203    '') as_dir=./ ;;
12204    */) ;;
12205    *) as_dir=$as_dir/ ;;
12206  esac
12207    for ac_exec_ext in '' $ac_executable_extensions; do
12208  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
12209    ac_cv_prog_ac_ct_AR="ar"
12210    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
12211    break 2
12212  fi
12213done
12214  done
12215IFS=$as_save_IFS
12216
12217fi
12218fi
12219ac_ct_AR=$ac_cv_prog_ac_ct_AR
12220if test -n "$ac_ct_AR"; then
12221  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
12222printf "%s\n" "$ac_ct_AR" >&6; }
12223else
12224  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
12225printf "%s\n" "no" >&6; }
12226fi
12227
12228  if test "x$ac_ct_AR" = x; then
12229    AR=""
12230  else
12231    case $cross_compiling:$ac_tool_warned in
12232yes:)
12233{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
12234printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
12235ac_tool_warned=yes ;;
12236esac
12237    AR=$ac_ct_AR
12238  fi
12239else
12240  AR="$ac_cv_prog_AR"
12241fi
12242
12243    STLIB_LD='${AR} cr'
12244    LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
12245    if test "x$SHLIB_VERSION" = x
12246then :
12247  SHLIB_VERSION=""
12248else $as_nop
12249  SHLIB_VERSION=".$SHLIB_VERSION"
12250fi
12251
12252    # if the compiler is used for linking,
12253    # choose the C++ compiler if CXX is enabled
12254    if test x"$TEA_CXX" != "x"; then
12255	CCLD=$CXX
12256    else
12257	CCLD=$CC
12258    fi
12259
12260
12261    case $system in
12262	# TEA specific:
12263	windows)
12264	    MACHINE="X86"
12265	    if test "$do64bit" != "no" ; then
12266		case "$do64bit" in
12267		    amd64|x64|yes)
12268			MACHINE="AMD64" ; # default to AMD64 64-bit build
12269			;;
12270		    ia64)
12271			MACHINE="IA64"
12272			;;
12273		esac
12274	    fi
12275
12276	    if test "$GCC" != "yes" ; then
12277	        if test "${SHARED_BUILD}" = "0" ; then
12278		    runtime=-MT
12279	        else
12280		    runtime=-MD
12281	        fi
12282	        case "x`echo \${VisualStudioVersion}`" in
12283	            x1[4-9]*)
12284		        lflags="${lflags} -nodefaultlib:libucrt.lib"
12285
12286    vars="ucrt.lib"
12287    for i in $vars; do
12288	if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
12289	    # Convert foo.lib to -lfoo for GCC.  No-op if not *.lib
12290	    i=`echo "$i" | sed -e 's/^\([^-].*\)\.[lL][iI][bB]$/-l\1/'`
12291	fi
12292	PKG_LIBS="$PKG_LIBS $i"
12293    done
12294
12295
12296	            ;;
12297	            *)
12298	            ;;
12299	        esac
12300
12301                if test "$do64bit" != "no" ; then
12302		    CC="cl.exe"
12303		    RC="rc.exe"
12304		    lflags="${lflags} -nologo -MACHINE:${MACHINE} "
12305		    LINKBIN="link.exe"
12306		    CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d"
12307		    CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
12308		    # Avoid 'unresolved external symbol __security_cookie'
12309		    # errors, c.f. http://support.microsoft.com/?id=894573
12310
12311    vars="bufferoverflowU.lib"
12312    for i in $vars; do
12313	if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
12314	    # Convert foo.lib to -lfoo for GCC.  No-op if not *.lib
12315	    i=`echo "$i" | sed -e 's/^\([^-].*\)\.[lL][iI][bB]$/-l\1/'`
12316	fi
12317	PKG_LIBS="$PKG_LIBS $i"
12318    done
12319
12320
12321		else
12322		    RC="rc"
12323		    lflags="${lflags} -nologo"
12324		    LINKBIN="link"
12325		    CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d"
12326		    CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
12327		fi
12328	    fi
12329
12330	    if test "$GCC" = "yes"; then
12331		# mingw gcc mode
12332		if test -n "$ac_tool_prefix"; then
12333  # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
12334set dummy ${ac_tool_prefix}windres; ac_word=$2
12335{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12336printf %s "checking for $ac_word... " >&6; }
12337if test ${ac_cv_prog_RC+y}
12338then :
12339  printf %s "(cached) " >&6
12340else $as_nop
12341  if test -n "$RC"; then
12342  ac_cv_prog_RC="$RC" # Let the user override the test.
12343else
12344as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12345for as_dir in $PATH
12346do
12347  IFS=$as_save_IFS
12348  case $as_dir in #(((
12349    '') as_dir=./ ;;
12350    */) ;;
12351    *) as_dir=$as_dir/ ;;
12352  esac
12353    for ac_exec_ext in '' $ac_executable_extensions; do
12354  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
12355    ac_cv_prog_RC="${ac_tool_prefix}windres"
12356    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
12357    break 2
12358  fi
12359done
12360  done
12361IFS=$as_save_IFS
12362
12363fi
12364fi
12365RC=$ac_cv_prog_RC
12366if test -n "$RC"; then
12367  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RC" >&5
12368printf "%s\n" "$RC" >&6; }
12369else
12370  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
12371printf "%s\n" "no" >&6; }
12372fi
12373
12374
12375fi
12376if test -z "$ac_cv_prog_RC"; then
12377  ac_ct_RC=$RC
12378  # Extract the first word of "windres", so it can be a program name with args.
12379set dummy windres; ac_word=$2
12380{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12381printf %s "checking for $ac_word... " >&6; }
12382if test ${ac_cv_prog_ac_ct_RC+y}
12383then :
12384  printf %s "(cached) " >&6
12385else $as_nop
12386  if test -n "$ac_ct_RC"; then
12387  ac_cv_prog_ac_ct_RC="$ac_ct_RC" # Let the user override the test.
12388else
12389as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12390for as_dir in $PATH
12391do
12392  IFS=$as_save_IFS
12393  case $as_dir in #(((
12394    '') as_dir=./ ;;
12395    */) ;;
12396    *) as_dir=$as_dir/ ;;
12397  esac
12398    for ac_exec_ext in '' $ac_executable_extensions; do
12399  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
12400    ac_cv_prog_ac_ct_RC="windres"
12401    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
12402    break 2
12403  fi
12404done
12405  done
12406IFS=$as_save_IFS
12407
12408fi
12409fi
12410ac_ct_RC=$ac_cv_prog_ac_ct_RC
12411if test -n "$ac_ct_RC"; then
12412  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RC" >&5
12413printf "%s\n" "$ac_ct_RC" >&6; }
12414else
12415  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
12416printf "%s\n" "no" >&6; }
12417fi
12418
12419  if test "x$ac_ct_RC" = x; then
12420    RC=""
12421  else
12422    case $cross_compiling:$ac_tool_warned in
12423yes:)
12424{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
12425printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
12426ac_tool_warned=yes ;;
12427esac
12428    RC=$ac_ct_RC
12429  fi
12430else
12431  RC="$ac_cv_prog_RC"
12432fi
12433
12434		CFLAGS_DEBUG="-g"
12435		CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
12436		SHLIB_LD='${CCLD} -shared'
12437		UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
12438		LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}"
12439		LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}"
12440
12441		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cross-compile version of gcc" >&5
12442printf %s "checking for cross-compile version of gcc... " >&6; }
12443if test ${ac_cv_cross+y}
12444then :
12445  printf %s "(cached) " >&6
12446else $as_nop
12447  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12448/* end confdefs.h.  */
12449
12450			    #ifdef _WIN32
12451				#error cross-compiler
12452			    #endif
12453
12454int
12455main (void)
12456{
12457
12458  ;
12459  return 0;
12460}
12461_ACEOF
12462if ac_fn_c_try_compile "$LINENO"
12463then :
12464  ac_cv_cross=yes
12465else $as_nop
12466  ac_cv_cross=no
12467fi
12468rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
12469
12470fi
12471{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cross" >&5
12472printf "%s\n" "$ac_cv_cross" >&6; }
12473		      if test "$ac_cv_cross" = "yes"; then
12474			case "$do64bit" in
12475			    amd64|x64|yes)
12476				CC="x86_64-w64-mingw32-${CC}"
12477				LD="x86_64-w64-mingw32-ld"
12478				AR="x86_64-w64-mingw32-ar"
12479				RANLIB="x86_64-w64-mingw32-ranlib"
12480				RC="x86_64-w64-mingw32-windres"
12481			    ;;
12482			    *)
12483				CC="i686-w64-mingw32-${CC}"
12484				LD="i686-w64-mingw32-ld"
12485				AR="i686-w64-mingw32-ar"
12486				RANLIB="i686-w64-mingw32-ranlib"
12487				RC="i686-w64-mingw32-windres"
12488			    ;;
12489			esac
12490		fi
12491
12492	    else
12493		SHLIB_LD="${LINKBIN} -dll ${lflags}"
12494		# link -lib only works when -lib is the first arg
12495		STLIB_LD="${LINKBIN} -lib ${lflags}"
12496		UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib'
12497		PATHTYPE=-w
12498		# For information on what debugtype is most useful, see:
12499		# http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
12500		# and also
12501		# http://msdn2.microsoft.com/en-us/library/y0zzbyt4%28VS.80%29.aspx
12502		# This essentially turns it all on.
12503		LDFLAGS_DEBUG="-debug -debugtype:cv"
12504		LDFLAGS_OPTIMIZE="-release"
12505		LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
12506		LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
12507	    fi
12508
12509	    SHLIB_SUFFIX=".dll"
12510	    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll'
12511
12512	    TCL_LIB_VERSIONS_OK=nodots
12513    	    ;;
12514	AIX-*)
12515	    if test "$GCC" != "yes"
12516then :
12517
12518		# AIX requires the _r compiler when gcc isn't being used
12519		case "${CC}" in
12520		    *_r|*_r\ *)
12521			# ok ...
12522			;;
12523		    *)
12524			# Make sure only first arg gets _r
12525		    	CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'`
12526			;;
12527		esac
12528		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using $CC for compiling with threads" >&5
12529printf "%s\n" "Using $CC for compiling with threads" >&6; }
12530
12531fi
12532	    LIBS="$LIBS -lc"
12533	    SHLIB_CFLAGS=""
12534	    SHLIB_SUFFIX=".so"
12535
12536	    LD_LIBRARY_PATH_VAR="LIBPATH"
12537
12538	    # Check to enable 64-bit flags for compiler/linker
12539	    if test "$do64bit" = yes
12540then :
12541
12542		if test "$GCC" = yes
12543then :
12544
12545		    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5
12546printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;}
12547
12548else $as_nop
12549
12550		    do64bit_ok=yes
12551		    CFLAGS="$CFLAGS -q64"
12552		    LDFLAGS_ARCH="-q64"
12553		    RANLIB="${RANLIB} -X64"
12554		    AR="${AR} -X64"
12555		    SHLIB_LD_FLAGS="-b64"
12556
12557fi
12558
12559fi
12560
12561	    if test "`uname -m`" = ia64
12562then :
12563
12564		# AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
12565		SHLIB_LD="/usr/ccs/bin/ld -G -z text"
12566		if test "$GCC" = yes
12567then :
12568
12569		    CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"'
12570
12571else $as_nop
12572
12573		    CC_SEARCH_FLAGS='"-R${LIB_RUNTIME_DIR}"'
12574
12575fi
12576		LD_SEARCH_FLAGS='-R "${LIB_RUNTIME_DIR}"'
12577
12578else $as_nop
12579
12580		if test "$GCC" = yes
12581then :
12582
12583		    SHLIB_LD='${CCLD} -shared -Wl,-bexpall'
12584
12585else $as_nop
12586
12587		    SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry"
12588		    LDFLAGS="$LDFLAGS -brtl"
12589
12590fi
12591		SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}"
12592		CC_SEARCH_FLAGS='"-L${LIB_RUNTIME_DIR}"'
12593		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
12594
12595fi
12596	    ;;
12597	BeOS*)
12598	    SHLIB_CFLAGS="-fPIC"
12599	    SHLIB_LD='${CCLD} -nostart'
12600	    SHLIB_SUFFIX=".so"
12601
12602	    #-----------------------------------------------------------
12603	    # Check for inet_ntoa in -lbind, for BeOS (which also needs
12604	    # -lsocket, even if the network functions are in -lnet which
12605	    # is always linked to, for compatibility.
12606	    #-----------------------------------------------------------
12607	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lbind" >&5
12608printf %s "checking for inet_ntoa in -lbind... " >&6; }
12609if test ${ac_cv_lib_bind_inet_ntoa+y}
12610then :
12611  printf %s "(cached) " >&6
12612else $as_nop
12613  ac_check_lib_save_LIBS=$LIBS
12614LIBS="-lbind  $LIBS"
12615cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12616/* end confdefs.h.  */
12617
12618/* Override any GCC internal prototype to avoid an error.
12619   Use char because int might match the return type of a GCC
12620   builtin and then its argument prototype would still apply.  */
12621char inet_ntoa ();
12622int
12623main (void)
12624{
12625return inet_ntoa ();
12626  ;
12627  return 0;
12628}
12629_ACEOF
12630if ac_fn_c_try_link "$LINENO"
12631then :
12632  ac_cv_lib_bind_inet_ntoa=yes
12633else $as_nop
12634  ac_cv_lib_bind_inet_ntoa=no
12635fi
12636rm -f core conftest.err conftest.$ac_objext conftest.beam \
12637    conftest$ac_exeext conftest.$ac_ext
12638LIBS=$ac_check_lib_save_LIBS
12639fi
12640{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bind_inet_ntoa" >&5
12641printf "%s\n" "$ac_cv_lib_bind_inet_ntoa" >&6; }
12642if test "x$ac_cv_lib_bind_inet_ntoa" = xyes
12643then :
12644  LIBS="$LIBS -lbind -lsocket"
12645fi
12646
12647	    ;;
12648	BSD/OS-2.1*|BSD/OS-3*)
12649	    SHLIB_CFLAGS=""
12650	    SHLIB_LD="shlicc -r"
12651	    SHLIB_SUFFIX=".so"
12652	    CC_SEARCH_FLAGS=""
12653	    LD_SEARCH_FLAGS=""
12654	    ;;
12655	BSD/OS-4.*)
12656	    SHLIB_CFLAGS="-export-dynamic -fPIC"
12657	    SHLIB_LD='${CCLD} -shared'
12658	    SHLIB_SUFFIX=".so"
12659	    LDFLAGS="$LDFLAGS -export-dynamic"
12660	    CC_SEARCH_FLAGS=""
12661	    LD_SEARCH_FLAGS=""
12662	    ;;
12663	CYGWIN_*)
12664	    SHLIB_CFLAGS=""
12665	    SHLIB_LD='${CCLD} -shared'
12666	    SHLIB_SUFFIX=".dll"
12667	    SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$@.a"
12668	    EXEEXT=".exe"
12669	    do64bit_ok=yes
12670	    CC_SEARCH_FLAGS=""
12671	    LD_SEARCH_FLAGS=""
12672	    ;;
12673	dgux*)
12674	    SHLIB_CFLAGS="-K PIC"
12675	    SHLIB_LD='${CCLD} -G'
12676	    SHLIB_LD_LIBS=""
12677	    SHLIB_SUFFIX=".so"
12678	    CC_SEARCH_FLAGS=""
12679	    LD_SEARCH_FLAGS=""
12680	    ;;
12681	Haiku*)
12682	    LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
12683	    SHLIB_CFLAGS="-fPIC"
12684	    SHLIB_SUFFIX=".so"
12685	    SHLIB_LD='${CCLD} ${CFLAGS} ${LDFLAGS} -shared'
12686	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnetwork" >&5
12687printf %s "checking for inet_ntoa in -lnetwork... " >&6; }
12688if test ${ac_cv_lib_network_inet_ntoa+y}
12689then :
12690  printf %s "(cached) " >&6
12691else $as_nop
12692  ac_check_lib_save_LIBS=$LIBS
12693LIBS="-lnetwork  $LIBS"
12694cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12695/* end confdefs.h.  */
12696
12697/* Override any GCC internal prototype to avoid an error.
12698   Use char because int might match the return type of a GCC
12699   builtin and then its argument prototype would still apply.  */
12700char inet_ntoa ();
12701int
12702main (void)
12703{
12704return inet_ntoa ();
12705  ;
12706  return 0;
12707}
12708_ACEOF
12709if ac_fn_c_try_link "$LINENO"
12710then :
12711  ac_cv_lib_network_inet_ntoa=yes
12712else $as_nop
12713  ac_cv_lib_network_inet_ntoa=no
12714fi
12715rm -f core conftest.err conftest.$ac_objext conftest.beam \
12716    conftest$ac_exeext conftest.$ac_ext
12717LIBS=$ac_check_lib_save_LIBS
12718fi
12719{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_inet_ntoa" >&5
12720printf "%s\n" "$ac_cv_lib_network_inet_ntoa" >&6; }
12721if test "x$ac_cv_lib_network_inet_ntoa" = xyes
12722then :
12723  LIBS="$LIBS -lnetwork"
12724fi
12725
12726	    ;;
12727	HP-UX-*.11.*)
12728	    # Use updated header definitions where possible
12729
12730printf "%s\n" "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h
12731
12732	    # TEA specific: Needed by Tcl, but not most extensions
12733	    #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?])
12734	    #LIBS="$LIBS -lxnet"               # Use the XOPEN network library
12735
12736	    if test "`uname -m`" = ia64
12737then :
12738
12739		SHLIB_SUFFIX=".so"
12740
12741else $as_nop
12742
12743		SHLIB_SUFFIX=".sl"
12744
12745fi
12746	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
12747printf %s "checking for shl_load in -ldld... " >&6; }
12748if test ${ac_cv_lib_dld_shl_load+y}
12749then :
12750  printf %s "(cached) " >&6
12751else $as_nop
12752  ac_check_lib_save_LIBS=$LIBS
12753LIBS="-ldld  $LIBS"
12754cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12755/* end confdefs.h.  */
12756
12757/* Override any GCC internal prototype to avoid an error.
12758   Use char because int might match the return type of a GCC
12759   builtin and then its argument prototype would still apply.  */
12760char shl_load ();
12761int
12762main (void)
12763{
12764return shl_load ();
12765  ;
12766  return 0;
12767}
12768_ACEOF
12769if ac_fn_c_try_link "$LINENO"
12770then :
12771  ac_cv_lib_dld_shl_load=yes
12772else $as_nop
12773  ac_cv_lib_dld_shl_load=no
12774fi
12775rm -f core conftest.err conftest.$ac_objext conftest.beam \
12776    conftest$ac_exeext conftest.$ac_ext
12777LIBS=$ac_check_lib_save_LIBS
12778fi
12779{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
12780printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; }
12781if test "x$ac_cv_lib_dld_shl_load" = xyes
12782then :
12783  tcl_ok=yes
12784else $as_nop
12785  tcl_ok=no
12786fi
12787
12788	    if test "$tcl_ok" = yes
12789then :
12790
12791		SHLIB_CFLAGS="+z"
12792		SHLIB_LD="ld -b"
12793		LDFLAGS="$LDFLAGS -Wl,-E"
12794		CC_SEARCH_FLAGS='"-Wl,+s,+b,${LIB_RUNTIME_DIR}:."'
12795		LD_SEARCH_FLAGS='+s +b "${LIB_RUNTIME_DIR}:."'
12796		LD_LIBRARY_PATH_VAR="SHLIB_PATH"
12797
12798fi
12799	    if test "$GCC" = yes
12800then :
12801
12802		SHLIB_LD='${CCLD} -shared'
12803		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
12804
12805else $as_nop
12806
12807		CFLAGS="$CFLAGS -z"
12808
12809fi
12810
12811	    # Check to enable 64-bit flags for compiler/linker
12812	    if test "$do64bit" = "yes"
12813then :
12814
12815		if test "$GCC" = yes
12816then :
12817
12818		    case `${CC} -dumpmachine` in
12819			hppa64*)
12820			    # 64-bit gcc in use.  Fix flags for GNU ld.
12821			    do64bit_ok=yes
12822			    SHLIB_LD='${CCLD} -shared'
12823			    if test $doRpath = yes
12824then :
12825
12826				CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
12827fi
12828			    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
12829			    ;;
12830			*)
12831			    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5
12832printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;}
12833			    ;;
12834		    esac
12835
12836else $as_nop
12837
12838		    do64bit_ok=yes
12839		    CFLAGS="$CFLAGS +DD64"
12840		    LDFLAGS_ARCH="+DD64"
12841
12842fi
12843
12844fi ;;
12845	HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
12846	    SHLIB_SUFFIX=".sl"
12847	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
12848printf %s "checking for shl_load in -ldld... " >&6; }
12849if test ${ac_cv_lib_dld_shl_load+y}
12850then :
12851  printf %s "(cached) " >&6
12852else $as_nop
12853  ac_check_lib_save_LIBS=$LIBS
12854LIBS="-ldld  $LIBS"
12855cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12856/* end confdefs.h.  */
12857
12858/* Override any GCC internal prototype to avoid an error.
12859   Use char because int might match the return type of a GCC
12860   builtin and then its argument prototype would still apply.  */
12861char shl_load ();
12862int
12863main (void)
12864{
12865return shl_load ();
12866  ;
12867  return 0;
12868}
12869_ACEOF
12870if ac_fn_c_try_link "$LINENO"
12871then :
12872  ac_cv_lib_dld_shl_load=yes
12873else $as_nop
12874  ac_cv_lib_dld_shl_load=no
12875fi
12876rm -f core conftest.err conftest.$ac_objext conftest.beam \
12877    conftest$ac_exeext conftest.$ac_ext
12878LIBS=$ac_check_lib_save_LIBS
12879fi
12880{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
12881printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; }
12882if test "x$ac_cv_lib_dld_shl_load" = xyes
12883then :
12884  tcl_ok=yes
12885else $as_nop
12886  tcl_ok=no
12887fi
12888
12889	    if test "$tcl_ok" = yes
12890then :
12891
12892		SHLIB_CFLAGS="+z"
12893		SHLIB_LD="ld -b"
12894		SHLIB_LD_LIBS=""
12895		LDFLAGS="$LDFLAGS -Wl,-E"
12896		CC_SEARCH_FLAGS='"-Wl,+s,+b,${LIB_RUNTIME_DIR}:."'
12897		LD_SEARCH_FLAGS='+s +b "${LIB_RUNTIME_DIR}:."'
12898		LD_LIBRARY_PATH_VAR="SHLIB_PATH"
12899
12900fi ;;
12901	IRIX-5.*)
12902	    SHLIB_CFLAGS=""
12903	    SHLIB_LD="ld -shared -rdata_shared"
12904	    SHLIB_SUFFIX=".so"
12905	    case " $LIBOBJS " in
12906  *" mkstemp.$ac_objext "* ) ;;
12907  *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext"
12908 ;;
12909esac
12910
12911	    if test $doRpath = yes
12912then :
12913
12914		CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
12915		LD_SEARCH_FLAGS='-rpath "${LIB_RUNTIME_DIR}"'
12916fi
12917	    ;;
12918	IRIX-6.*)
12919	    SHLIB_CFLAGS=""
12920	    SHLIB_LD="ld -n32 -shared -rdata_shared"
12921	    SHLIB_SUFFIX=".so"
12922	    if test $doRpath = yes
12923then :
12924
12925		CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
12926		LD_SEARCH_FLAGS='-rpath "${LIB_RUNTIME_DIR}"'
12927fi
12928	    if test "$GCC" = yes
12929then :
12930
12931		CFLAGS="$CFLAGS -mabi=n32"
12932		LDFLAGS="$LDFLAGS -mabi=n32"
12933
12934else $as_nop
12935
12936		case $system in
12937		    IRIX-6.3)
12938			# Use to build 6.2 compatible binaries on 6.3.
12939			CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
12940			;;
12941		    *)
12942			CFLAGS="$CFLAGS -n32"
12943			;;
12944		esac
12945		LDFLAGS="$LDFLAGS -n32"
12946
12947fi
12948	    ;;
12949	IRIX64-6.*)
12950	    SHLIB_CFLAGS=""
12951	    SHLIB_LD="ld -n32 -shared -rdata_shared"
12952	    SHLIB_SUFFIX=".so"
12953	    if test $doRpath = yes
12954then :
12955
12956		CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
12957		LD_SEARCH_FLAGS='-rpath "${LIB_RUNTIME_DIR}"'
12958fi
12959
12960	    # Check to enable 64-bit flags for compiler/linker
12961
12962	    if test "$do64bit" = yes
12963then :
12964
12965	        if test "$GCC" = yes
12966then :
12967
12968	            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported by gcc" >&5
12969printf "%s\n" "$as_me: WARNING: 64bit mode not supported by gcc" >&2;}
12970
12971else $as_nop
12972
12973	            do64bit_ok=yes
12974	            SHLIB_LD="ld -64 -shared -rdata_shared"
12975	            CFLAGS="$CFLAGS -64"
12976	            LDFLAGS_ARCH="-64"
12977
12978fi
12979
12980fi
12981	    ;;
12982	Linux*|GNU*|NetBSD-Debian|DragonFly-*|FreeBSD-*)
12983	    SHLIB_CFLAGS="-fPIC"
12984	    SHLIB_SUFFIX=".so"
12985
12986	    # TEA specific:
12987	    CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
12988
12989	    # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
12990	    SHLIB_LD='${CCLD} ${CFLAGS} ${LDFLAGS_DEFAULT} -shared'
12991	    LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
12992
12993	    case $system in
12994	    DragonFly-*|FreeBSD-*)
12995		if test "${TCL_THREADS}" = "1"
12996then :
12997
12998		    # The -pthread needs to go in the LDFLAGS, not LIBS
12999		    LIBS=`echo $LIBS | sed s/-pthread//`
13000		    CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
13001		    LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
13002fi
13003	    ;;
13004            esac
13005
13006	    if test $doRpath = yes
13007then :
13008
13009		CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
13010fi
13011	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
13012	    if test "`uname -m`" = "alpha"
13013then :
13014  CFLAGS="$CFLAGS -mieee"
13015fi
13016	    if test $do64bit = yes
13017then :
13018
13019		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -m64 flag" >&5
13020printf %s "checking if compiler accepts -m64 flag... " >&6; }
13021if test ${tcl_cv_cc_m64+y}
13022then :
13023  printf %s "(cached) " >&6
13024else $as_nop
13025
13026		    hold_cflags=$CFLAGS
13027		    CFLAGS="$CFLAGS -m64"
13028		    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13029/* end confdefs.h.  */
13030
13031int
13032main (void)
13033{
13034
13035  ;
13036  return 0;
13037}
13038_ACEOF
13039if ac_fn_c_try_link "$LINENO"
13040then :
13041  tcl_cv_cc_m64=yes
13042else $as_nop
13043  tcl_cv_cc_m64=no
13044fi
13045rm -f core conftest.err conftest.$ac_objext conftest.beam \
13046    conftest$ac_exeext conftest.$ac_ext
13047		    CFLAGS=$hold_cflags
13048fi
13049{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_m64" >&5
13050printf "%s\n" "$tcl_cv_cc_m64" >&6; }
13051		if test $tcl_cv_cc_m64 = yes
13052then :
13053
13054		    CFLAGS="$CFLAGS -m64"
13055		    do64bit_ok=yes
13056
13057fi
13058
13059fi
13060
13061	    # The combo of gcc + glibc has a bug related to inlining of
13062	    # functions like strtod(). The -fno-builtin flag should address
13063	    # this problem but it does not work. The -fno-inline flag is kind
13064	    # of overkill but it works. Disable inlining only when one of the
13065	    # files in compat/*.c is being linked in.
13066
13067	    if test x"${USE_COMPAT}" != x
13068then :
13069  CFLAGS="$CFLAGS -fno-inline"
13070fi
13071	    ;;
13072	Lynx*)
13073	    SHLIB_CFLAGS="-fPIC"
13074	    SHLIB_SUFFIX=".so"
13075	    CFLAGS_OPTIMIZE=-02
13076	    SHLIB_LD='${CCLD} -shared'
13077	    LD_FLAGS="-Wl,--export-dynamic"
13078	    if test $doRpath = yes
13079then :
13080
13081		CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
13082		LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
13083fi
13084	    ;;
13085	OpenBSD-*)
13086	    arch=`arch -s`
13087	    case "$arch" in
13088	    alpha|sparc64)
13089		SHLIB_CFLAGS="-fPIC"
13090		;;
13091	    *)
13092		SHLIB_CFLAGS="-fpic"
13093		;;
13094	    esac
13095	    SHLIB_LD='${CCLD} ${SHLIB_CFLAGS} -shared'
13096	    SHLIB_SUFFIX=".so"
13097	    if test $doRpath = yes
13098then :
13099
13100		CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
13101fi
13102	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
13103	    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so${SHLIB_VERSION}'
13104	    LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
13105	    CFLAGS_OPTIMIZE="-O2"
13106	    # On OpenBSD:	Compile with -pthread
13107	    #		Don't link with -lpthread
13108	    LIBS=`echo $LIBS | sed s/-lpthread//`
13109	    CFLAGS="$CFLAGS -pthread"
13110	    # OpenBSD doesn't do version numbers with dots.
13111	    UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
13112	    TCL_LIB_VERSIONS_OK=nodots
13113	    ;;
13114	NetBSD-*)
13115	    # NetBSD has ELF and can use 'cc -shared' to build shared libs
13116	    SHLIB_CFLAGS="-fPIC"
13117	    SHLIB_LD='${CCLD} ${SHLIB_CFLAGS} -shared'
13118	    SHLIB_SUFFIX=".so"
13119	    LDFLAGS="$LDFLAGS -export-dynamic"
13120	    if test $doRpath = yes
13121then :
13122
13123		CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
13124fi
13125	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
13126	    # The -pthread needs to go in the CFLAGS, not LIBS
13127	    LIBS=`echo $LIBS | sed s/-pthread//`
13128	    CFLAGS="$CFLAGS -pthread"
13129	    LDFLAGS="$LDFLAGS -pthread"
13130	    ;;
13131	Darwin-*)
13132	    CFLAGS_OPTIMIZE="-Os"
13133	    SHLIB_CFLAGS="-fno-common"
13134	    # To avoid discrepancies between what headers configure sees during
13135	    # preprocessing tests and compiling tests, move any -isysroot and
13136	    # -mmacosx-version-min flags from CFLAGS to CPPFLAGS:
13137	    CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \
13138		awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
13139		if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`"
13140	    CFLAGS="`echo " ${CFLAGS}" | \
13141		awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
13142		if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`"
13143	    if test $do64bit = yes
13144then :
13145
13146		case `arch` in
13147		    ppc)
13148			{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch ppc64 flag" >&5
13149printf %s "checking if compiler accepts -arch ppc64 flag... " >&6; }
13150if test ${tcl_cv_cc_arch_ppc64+y}
13151then :
13152  printf %s "(cached) " >&6
13153else $as_nop
13154
13155			    hold_cflags=$CFLAGS
13156			    CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
13157			    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13158/* end confdefs.h.  */
13159
13160int
13161main (void)
13162{
13163
13164  ;
13165  return 0;
13166}
13167_ACEOF
13168if ac_fn_c_try_link "$LINENO"
13169then :
13170  tcl_cv_cc_arch_ppc64=yes
13171else $as_nop
13172  tcl_cv_cc_arch_ppc64=no
13173fi
13174rm -f core conftest.err conftest.$ac_objext conftest.beam \
13175    conftest$ac_exeext conftest.$ac_ext
13176			    CFLAGS=$hold_cflags
13177fi
13178{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_ppc64" >&5
13179printf "%s\n" "$tcl_cv_cc_arch_ppc64" >&6; }
13180			if test $tcl_cv_cc_arch_ppc64 = yes
13181then :
13182
13183			    CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
13184			    do64bit_ok=yes
13185
13186fi;;
13187		    i386)
13188			{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch x86_64 flag" >&5
13189printf %s "checking if compiler accepts -arch x86_64 flag... " >&6; }
13190if test ${tcl_cv_cc_arch_x86_64+y}
13191then :
13192  printf %s "(cached) " >&6
13193else $as_nop
13194
13195			    hold_cflags=$CFLAGS
13196			    CFLAGS="$CFLAGS -arch x86_64"
13197			    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13198/* end confdefs.h.  */
13199
13200int
13201main (void)
13202{
13203
13204  ;
13205  return 0;
13206}
13207_ACEOF
13208if ac_fn_c_try_link "$LINENO"
13209then :
13210  tcl_cv_cc_arch_x86_64=yes
13211else $as_nop
13212  tcl_cv_cc_arch_x86_64=no
13213fi
13214rm -f core conftest.err conftest.$ac_objext conftest.beam \
13215    conftest$ac_exeext conftest.$ac_ext
13216			    CFLAGS=$hold_cflags
13217fi
13218{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_x86_64" >&5
13219printf "%s\n" "$tcl_cv_cc_arch_x86_64" >&6; }
13220			if test $tcl_cv_cc_arch_x86_64 = yes
13221then :
13222
13223			    CFLAGS="$CFLAGS -arch x86_64"
13224			    do64bit_ok=yes
13225
13226fi;;
13227		    *)
13228			{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5
13229printf "%s\n" "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};;
13230		esac
13231
13232else $as_nop
13233
13234		# Check for combined 32-bit and 64-bit fat build
13235		if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \
13236		    && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '
13237then :
13238
13239		    fat_32_64=yes
13240fi
13241
13242fi
13243	    # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
13244	    SHLIB_LD='${CCLD} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}'
13245	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ld accepts -single_module flag" >&5
13246printf %s "checking if ld accepts -single_module flag... " >&6; }
13247if test ${tcl_cv_ld_single_module+y}
13248then :
13249  printf %s "(cached) " >&6
13250else $as_nop
13251
13252		hold_ldflags=$LDFLAGS
13253		LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
13254		cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13255/* end confdefs.h.  */
13256
13257int
13258main (void)
13259{
13260int i;
13261  ;
13262  return 0;
13263}
13264_ACEOF
13265if ac_fn_c_try_link "$LINENO"
13266then :
13267  tcl_cv_ld_single_module=yes
13268else $as_nop
13269  tcl_cv_ld_single_module=no
13270fi
13271rm -f core conftest.err conftest.$ac_objext conftest.beam \
13272    conftest$ac_exeext conftest.$ac_ext
13273		LDFLAGS=$hold_ldflags
13274fi
13275{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_single_module" >&5
13276printf "%s\n" "$tcl_cv_ld_single_module" >&6; }
13277	    if test $tcl_cv_ld_single_module = yes
13278then :
13279
13280		SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
13281
13282fi
13283	    # TEA specific: link shlib with current and compatibility version flags
13284	    vers=`echo ${PACKAGE_VERSION} | sed -e 's/^\([0-9]\{1,5\}\)\(\(\.[0-9]\{1,3\}\)\{0,2\}\).*$/\1\2/p' -e d`
13285	    SHLIB_LD="${SHLIB_LD} -current_version ${vers:-0} -compatibility_version ${vers:-0}"
13286	    SHLIB_SUFFIX=".dylib"
13287	    LDFLAGS="$LDFLAGS -headerpad_max_install_names"
13288	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ld accepts -search_paths_first flag" >&5
13289printf %s "checking if ld accepts -search_paths_first flag... " >&6; }
13290if test ${tcl_cv_ld_search_paths_first+y}
13291then :
13292  printf %s "(cached) " >&6
13293else $as_nop
13294
13295		hold_ldflags=$LDFLAGS
13296		LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
13297		cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13298/* end confdefs.h.  */
13299
13300int
13301main (void)
13302{
13303int i;
13304  ;
13305  return 0;
13306}
13307_ACEOF
13308if ac_fn_c_try_link "$LINENO"
13309then :
13310  tcl_cv_ld_search_paths_first=yes
13311else $as_nop
13312  tcl_cv_ld_search_paths_first=no
13313fi
13314rm -f core conftest.err conftest.$ac_objext conftest.beam \
13315    conftest$ac_exeext conftest.$ac_ext
13316		LDFLAGS=$hold_ldflags
13317fi
13318{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_search_paths_first" >&5
13319printf "%s\n" "$tcl_cv_ld_search_paths_first" >&6; }
13320	    if test $tcl_cv_ld_search_paths_first = yes
13321then :
13322
13323		LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
13324
13325fi
13326	    if test "$tcl_cv_cc_visibility_hidden" != yes
13327then :
13328
13329
13330printf "%s\n" "#define MODULE_SCOPE __private_extern__" >>confdefs.h
13331
13332		tcl_cv_cc_visibility_hidden=yes
13333
13334fi
13335	    CC_SEARCH_FLAGS=""
13336	    LD_SEARCH_FLAGS=""
13337	    LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
13338	    # TEA specific: for combined 32 & 64 bit fat builds of Tk
13339	    # extensions, verify that 64-bit build is possible.
13340	    if test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"
13341then :
13342
13343		if test "${TEA_WINDOWINGSYSTEM}" = x11
13344then :
13345
13346		    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit X11" >&5
13347printf %s "checking for 64-bit X11... " >&6; }
13348if test ${tcl_cv_lib_x11_64+y}
13349then :
13350  printf %s "(cached) " >&6
13351else $as_nop
13352
13353			for v in CFLAGS CPPFLAGS LDFLAGS; do
13354			    eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
13355			done
13356			CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include"
13357			LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
13358			cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13359/* end confdefs.h.  */
13360#include <X11/Xlib.h>
13361int
13362main (void)
13363{
13364XrmInitialize();
13365  ;
13366  return 0;
13367}
13368_ACEOF
13369if ac_fn_c_try_link "$LINENO"
13370then :
13371  tcl_cv_lib_x11_64=yes
13372else $as_nop
13373  tcl_cv_lib_x11_64=no
13374fi
13375rm -f core conftest.err conftest.$ac_objext conftest.beam \
13376    conftest$ac_exeext conftest.$ac_ext
13377			for v in CFLAGS CPPFLAGS LDFLAGS; do
13378			    eval $v'="$hold_'$v'"'
13379			done
13380fi
13381{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_x11_64" >&5
13382printf "%s\n" "$tcl_cv_lib_x11_64" >&6; }
13383
13384fi
13385		if test "${TEA_WINDOWINGSYSTEM}" = aqua
13386then :
13387
13388		    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit Tk" >&5
13389printf %s "checking for 64-bit Tk... " >&6; }
13390if test ${tcl_cv_lib_tk_64+y}
13391then :
13392  printf %s "(cached) " >&6
13393else $as_nop
13394
13395			for v in CFLAGS CPPFLAGS LDFLAGS; do
13396			    eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
13397			done
13398			CPPFLAGS="$CPPFLAGS -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 ${TCL_INCLUDES} ${TK_INCLUDES}"
13399			LDFLAGS="$LDFLAGS ${TCL_STUB_LIB_SPEC} ${TK_STUB_LIB_SPEC}"
13400			cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13401/* end confdefs.h.  */
13402#include <tk.h>
13403int
13404main (void)
13405{
13406Tk_InitStubs(NULL, "", 0);
13407  ;
13408  return 0;
13409}
13410_ACEOF
13411if ac_fn_c_try_link "$LINENO"
13412then :
13413  tcl_cv_lib_tk_64=yes
13414else $as_nop
13415  tcl_cv_lib_tk_64=no
13416fi
13417rm -f core conftest.err conftest.$ac_objext conftest.beam \
13418    conftest$ac_exeext conftest.$ac_ext
13419			for v in CFLAGS CPPFLAGS LDFLAGS; do
13420			    eval $v'="$hold_'$v'"'
13421			done
13422fi
13423{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_tk_64" >&5
13424printf "%s\n" "$tcl_cv_lib_tk_64" >&6; }
13425
13426fi
13427		# remove 64-bit arch flags from CFLAGS et al. if configuration
13428		# does not support 64-bit.
13429		if test "$tcl_cv_lib_tk_64" = no -o "$tcl_cv_lib_x11_64" = no
13430then :
13431
13432		    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Removing 64-bit architectures from compiler & linker flags" >&5
13433printf "%s\n" "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;}
13434		    for v in CFLAGS CPPFLAGS LDFLAGS; do
13435			eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
13436		    done
13437fi
13438
13439fi
13440	    ;;
13441	OS/390-*)
13442	    CFLAGS_OPTIMIZE=""		# Optimizer is buggy
13443
13444printf "%s\n" "#define _OE_SOCKETS 1" >>confdefs.h
13445
13446	    ;;
13447	OSF1-V*)
13448	    # Digital OSF/1
13449	    SHLIB_CFLAGS=""
13450	    if test "$SHARED_BUILD" = 1
13451then :
13452
13453	        SHLIB_LD='ld -shared -expect_unresolved "*"'
13454
13455else $as_nop
13456
13457	        SHLIB_LD='ld -non_shared -expect_unresolved "*"'
13458
13459fi
13460	    SHLIB_SUFFIX=".so"
13461	    if test $doRpath = yes
13462then :
13463
13464		CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
13465		LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
13466fi
13467	    if test "$GCC" = yes
13468then :
13469  CFLAGS="$CFLAGS -mieee"
13470else $as_nop
13471
13472		CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"
13473fi
13474	    # see pthread_intro(3) for pthread support on osf1, k.furukawa
13475	    CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
13476	    CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
13477	    LIBS=`echo $LIBS | sed s/-lpthreads//`
13478	    if test "$GCC" = yes
13479then :
13480
13481		LIBS="$LIBS -lpthread -lmach -lexc"
13482
13483else $as_nop
13484
13485		CFLAGS="$CFLAGS -pthread"
13486		LDFLAGS="$LDFLAGS -pthread"
13487
13488fi
13489	    ;;
13490	QNX-6*)
13491	    # QNX RTP
13492	    # This may work for all QNX, but it was only reported for v6.
13493	    SHLIB_CFLAGS="-fPIC"
13494	    SHLIB_LD="ld -Bshareable -x"
13495	    SHLIB_LD_LIBS=""
13496	    SHLIB_SUFFIX=".so"
13497	    CC_SEARCH_FLAGS=""
13498	    LD_SEARCH_FLAGS=""
13499	    ;;
13500	SCO_SV-3.2*)
13501	    if test "$GCC" = yes
13502then :
13503
13504		SHLIB_CFLAGS="-fPIC -melf"
13505		LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
13506
13507else $as_nop
13508
13509		SHLIB_CFLAGS="-Kpic -belf"
13510		LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
13511
13512fi
13513	    SHLIB_LD="ld -G"
13514	    SHLIB_LD_LIBS=""
13515	    SHLIB_SUFFIX=".so"
13516	    CC_SEARCH_FLAGS=""
13517	    LD_SEARCH_FLAGS=""
13518	    ;;
13519	SunOS-5.[0-6])
13520	    # Careful to not let 5.10+ fall into this case
13521
13522	    # Note: If _REENTRANT isn't defined, then Solaris
13523	    # won't define thread-safe library routines.
13524
13525
13526printf "%s\n" "#define _REENTRANT 1" >>confdefs.h
13527
13528
13529printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
13530
13531
13532	    SHLIB_CFLAGS="-KPIC"
13533	    SHLIB_SUFFIX=".so"
13534	    if test "$GCC" = yes
13535then :
13536
13537		SHLIB_LD='${CCLD} -shared'
13538		CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"'
13539		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
13540
13541else $as_nop
13542
13543		SHLIB_LD="/usr/ccs/bin/ld -G -z text"
13544		CC_SEARCH_FLAGS='-R "${LIB_RUNTIME_DIR}"'
13545		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
13546
13547fi
13548	    ;;
13549	SunOS-5*)
13550	    # Note: If _REENTRANT isn't defined, then Solaris
13551	    # won't define thread-safe library routines.
13552
13553
13554printf "%s\n" "#define _REENTRANT 1" >>confdefs.h
13555
13556
13557printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
13558
13559
13560	    SHLIB_CFLAGS="-KPIC"
13561
13562	    # Check to enable 64-bit flags for compiler/linker
13563	    if test "$do64bit" = yes
13564then :
13565
13566		arch=`isainfo`
13567		if test "$arch" = "sparcv9 sparc"
13568then :
13569
13570		    if test "$GCC" = yes
13571then :
13572
13573			if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3
13574then :
13575
13576			    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5
13577printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;}
13578
13579else $as_nop
13580
13581			    do64bit_ok=yes
13582			    CFLAGS="$CFLAGS -m64 -mcpu=v9"
13583			    LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
13584			    SHLIB_CFLAGS="-fPIC"
13585
13586fi
13587
13588else $as_nop
13589
13590			do64bit_ok=yes
13591			if test "$do64bitVIS" = yes
13592then :
13593
13594			    CFLAGS="$CFLAGS -xarch=v9a"
13595			    LDFLAGS_ARCH="-xarch=v9a"
13596
13597else $as_nop
13598
13599			    CFLAGS="$CFLAGS -xarch=v9"
13600			    LDFLAGS_ARCH="-xarch=v9"
13601
13602fi
13603			# Solaris 64 uses this as well
13604			#LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
13605
13606fi
13607
13608else $as_nop
13609  if test "$arch" = "amd64 i386"
13610then :
13611
13612		    if test "$GCC" = yes
13613then :
13614
13615			case $system in
13616			    SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*)
13617				do64bit_ok=yes
13618				CFLAGS="$CFLAGS -m64"
13619				LDFLAGS="$LDFLAGS -m64";;
13620			    *)
13621				{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5
13622printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};;
13623			esac
13624
13625else $as_nop
13626
13627			do64bit_ok=yes
13628			case $system in
13629			    SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*)
13630				CFLAGS="$CFLAGS -m64"
13631				LDFLAGS="$LDFLAGS -m64";;
13632			    *)
13633				CFLAGS="$CFLAGS -xarch=amd64"
13634				LDFLAGS="$LDFLAGS -xarch=amd64";;
13635			esac
13636
13637fi
13638
13639else $as_nop
13640  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported for $arch" >&5
13641printf "%s\n" "$as_me: WARNING: 64bit mode not supported for $arch" >&2;}
13642fi
13643fi
13644
13645fi
13646
13647	    SHLIB_SUFFIX=".so"
13648	    if test "$GCC" = yes
13649then :
13650
13651		SHLIB_LD='${CCLD} -shared'
13652		CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"'
13653		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
13654		if test "$do64bit_ok" = yes
13655then :
13656
13657		    if test "$arch" = "sparcv9 sparc"
13658then :
13659
13660			# We need to specify -static-libgcc or we need to
13661			# add the path to the sparv9 libgcc.
13662			# JH: static-libgcc is necessary for core Tcl, but may
13663			# not be necessary for extensions.
13664			SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
13665			# for finding sparcv9 libgcc, get the regular libgcc
13666			# path, remove so name and append 'sparcv9'
13667			#v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
13668			#CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
13669
13670else $as_nop
13671  if test "$arch" = "amd64 i386"
13672then :
13673
13674			# JH: static-libgcc is necessary for core Tcl, but may
13675			# not be necessary for extensions.
13676			SHLIB_LD="$SHLIB_LD -m64 -static-libgcc"
13677
13678fi
13679fi
13680
13681fi
13682
13683else $as_nop
13684
13685		case $system in
13686		    SunOS-5.[1-9][0-9]*)
13687			# TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
13688			SHLIB_LD='${CCLD} -G -z text ${LDFLAGS_DEFAULT}';;
13689		    *)
13690			SHLIB_LD='/usr/ccs/bin/ld -G -z text';;
13691		esac
13692		CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"'
13693		LD_SEARCH_FLAGS='-R "${LIB_RUNTIME_DIR}"'
13694
13695fi
13696	    ;;
13697	UNIX_SV* | UnixWare-5*)
13698	    SHLIB_CFLAGS="-KPIC"
13699	    SHLIB_LD='${CCLD} -G'
13700	    SHLIB_LD_LIBS=""
13701	    SHLIB_SUFFIX=".so"
13702	    # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
13703	    # that don't grok the -Bexport option.  Test that it does.
13704	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld accepts -Bexport flag" >&5
13705printf %s "checking for ld accepts -Bexport flag... " >&6; }
13706if test ${tcl_cv_ld_Bexport+y}
13707then :
13708  printf %s "(cached) " >&6
13709else $as_nop
13710
13711		hold_ldflags=$LDFLAGS
13712		LDFLAGS="$LDFLAGS -Wl,-Bexport"
13713		cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13714/* end confdefs.h.  */
13715
13716int
13717main (void)
13718{
13719int i;
13720  ;
13721  return 0;
13722}
13723_ACEOF
13724if ac_fn_c_try_link "$LINENO"
13725then :
13726  tcl_cv_ld_Bexport=yes
13727else $as_nop
13728  tcl_cv_ld_Bexport=no
13729fi
13730rm -f core conftest.err conftest.$ac_objext conftest.beam \
13731    conftest$ac_exeext conftest.$ac_ext
13732	        LDFLAGS=$hold_ldflags
13733fi
13734{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_Bexport" >&5
13735printf "%s\n" "$tcl_cv_ld_Bexport" >&6; }
13736	    if test $tcl_cv_ld_Bexport = yes
13737then :
13738
13739		LDFLAGS="$LDFLAGS -Wl,-Bexport"
13740
13741fi
13742	    CC_SEARCH_FLAGS=""
13743	    LD_SEARCH_FLAGS=""
13744	    ;;
13745    esac
13746
13747    if test "$do64bit" = yes -a "$do64bit_ok" = no
13748then :
13749
13750	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5
13751printf "%s\n" "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;}
13752
13753fi
13754
13755
13756
13757    # Add in the arch flags late to ensure it wasn't removed.
13758    # Not necessary in TEA, but this is aligned with core
13759    LDFLAGS="$LDFLAGS $LDFLAGS_ARCH"
13760
13761    # If we're running gcc, then change the C flags for compiling shared
13762    # libraries to the right flags for gcc, instead of those for the
13763    # standard manufacturer compiler.
13764
13765    if test "$GCC" = yes
13766then :
13767
13768	case $system in
13769	    AIX-*) ;;
13770	    BSD/OS*) ;;
13771	    CYGWIN_*|MINGW32_*|MINGW64_*|MSYS_*) ;;
13772	    IRIX*) ;;
13773	    NetBSD-*|DragonFly-*|FreeBSD-*|OpenBSD-*) ;;
13774	    Darwin-*) ;;
13775	    SCO_SV-3.2*) ;;
13776	    windows) ;;
13777	    *) SHLIB_CFLAGS="-fPIC" ;;
13778	esac
13779fi
13780
13781    if test "$tcl_cv_cc_visibility_hidden" != yes
13782then :
13783
13784
13785printf "%s\n" "#define MODULE_SCOPE extern" >>confdefs.h
13786
13787
13788fi
13789
13790    if test "$SHARED_LIB_SUFFIX" = ""
13791then :
13792
13793    # TEA specific: use PACKAGE_VERSION instead of VERSION
13794    SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}'
13795fi
13796    if test "$UNSHARED_LIB_SUFFIX" = ""
13797then :
13798
13799    # TEA specific: use PACKAGE_VERSION instead of VERSION
13800    UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a'
13801fi
13802
13803    if test "${GCC}" = "yes" -a ${SHLIB_SUFFIX} = ".dll"; then
13804	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SEH support in compiler" >&5
13805printf %s "checking for SEH support in compiler... " >&6; }
13806if test ${tcl_cv_seh+y}
13807then :
13808  printf %s "(cached) " >&6
13809else $as_nop
13810  if test "$cross_compiling" = yes
13811then :
13812  tcl_cv_seh=no
13813else $as_nop
13814  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13815/* end confdefs.h.  */
13816
13817#define WIN32_LEAN_AND_MEAN
13818#include <windows.h>
13819#undef WIN32_LEAN_AND_MEAN
13820
13821	    int main(int argc, char** argv) {
13822		int a, b = 0;
13823		__try {
13824		    a = 666 / b;
13825		}
13826		__except (EXCEPTION_EXECUTE_HANDLER) {
13827		    return 0;
13828		}
13829		return 1;
13830	    }
13831
13832_ACEOF
13833if ac_fn_c_try_run "$LINENO"
13834then :
13835  tcl_cv_seh=yes
13836else $as_nop
13837  tcl_cv_seh=no
13838fi
13839rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13840  conftest.$ac_objext conftest.beam conftest.$ac_ext
13841fi
13842
13843
13844fi
13845{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_seh" >&5
13846printf "%s\n" "$tcl_cv_seh" >&6; }
13847	if test "$tcl_cv_seh" = "no" ; then
13848
13849printf "%s\n" "#define HAVE_NO_SEH 1" >>confdefs.h
13850
13851	fi
13852
13853	#
13854	# Check to see if the excpt.h include file provided contains the
13855	# definition for EXCEPTION_DISPOSITION; if not, which is the case
13856	# with Cygwin's version as of 2002-04-10, define it to be int,
13857	# sufficient for getting the current code to work.
13858	#
13859	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EXCEPTION_DISPOSITION support in include files" >&5
13860printf %s "checking for EXCEPTION_DISPOSITION support in include files... " >&6; }
13861if test ${tcl_cv_eh_disposition+y}
13862then :
13863  printf %s "(cached) " >&6
13864else $as_nop
13865  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13866/* end confdefs.h.  */
13867
13868#	    define WIN32_LEAN_AND_MEAN
13869#	    include <windows.h>
13870#	    undef WIN32_LEAN_AND_MEAN
13871
13872int
13873main (void)
13874{
13875
13876		EXCEPTION_DISPOSITION x;
13877
13878  ;
13879  return 0;
13880}
13881_ACEOF
13882if ac_fn_c_try_compile "$LINENO"
13883then :
13884  tcl_cv_eh_disposition=yes
13885else $as_nop
13886  tcl_cv_eh_disposition=no
13887fi
13888rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
13889
13890fi
13891{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_eh_disposition" >&5
13892printf "%s\n" "$tcl_cv_eh_disposition" >&6; }
13893	if test "$tcl_cv_eh_disposition" = "no" ; then
13894
13895printf "%s\n" "#define EXCEPTION_DISPOSITION int" >>confdefs.h
13896
13897	fi
13898
13899	# Check to see if winnt.h defines CHAR, SHORT, and LONG
13900	# even if VOID has already been #defined. The win32api
13901	# used by mingw and cygwin is known to do this.
13902
13903	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for winnt.h that ignores VOID define" >&5
13904printf %s "checking for winnt.h that ignores VOID define... " >&6; }
13905if test ${tcl_cv_winnt_ignore_void+y}
13906then :
13907  printf %s "(cached) " >&6
13908else $as_nop
13909  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13910/* end confdefs.h.  */
13911
13912#define VOID void
13913#define WIN32_LEAN_AND_MEAN
13914#include <windows.h>
13915#undef WIN32_LEAN_AND_MEAN
13916
13917int
13918main (void)
13919{
13920
13921		CHAR c;
13922		SHORT s;
13923		LONG l;
13924
13925  ;
13926  return 0;
13927}
13928_ACEOF
13929if ac_fn_c_try_compile "$LINENO"
13930then :
13931  tcl_cv_winnt_ignore_void=yes
13932else $as_nop
13933  tcl_cv_winnt_ignore_void=no
13934fi
13935rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
13936
13937fi
13938{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_winnt_ignore_void" >&5
13939printf "%s\n" "$tcl_cv_winnt_ignore_void" >&6; }
13940	if test "$tcl_cv_winnt_ignore_void" = "yes" ; then
13941
13942printf "%s\n" "#define HAVE_WINNT_IGNORE_VOID 1" >>confdefs.h
13943
13944	fi
13945    fi
13946
13947	# See if the compiler supports casting to a union type.
13948	# This is used to stop gcc from printing a compiler
13949	# warning when initializing a union member.
13950
13951	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5
13952printf %s "checking for cast to union support... " >&6; }
13953if test ${tcl_cv_cast_to_union+y}
13954then :
13955  printf %s "(cached) " >&6
13956else $as_nop
13957  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13958/* end confdefs.h.  */
13959
13960int
13961main (void)
13962{
13963
13964		  union foo { int i; double d; };
13965		  union foo f = (union foo) (int) 0;
13966
13967  ;
13968  return 0;
13969}
13970_ACEOF
13971if ac_fn_c_try_compile "$LINENO"
13972then :
13973  tcl_cv_cast_to_union=yes
13974else $as_nop
13975  tcl_cv_cast_to_union=no
13976fi
13977rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
13978
13979fi
13980{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cast_to_union" >&5
13981printf "%s\n" "$tcl_cv_cast_to_union" >&6; }
13982	if test "$tcl_cv_cast_to_union" = "yes"; then
13983
13984printf "%s\n" "#define HAVE_CAST_TO_UNION 1" >>confdefs.h
13985
13986	fi
13987
13988	ac_fn_c_check_header_compile "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" "$ac_includes_default"
13989if test "x$ac_cv_header_stdbool_h" = xyes
13990then :
13991
13992printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h
13993
13994fi
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011    # These must be called after we do the basic CFLAGS checks and
14012    # verify any possible 64-bit or similar switches are necessary
14013
14014    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for required early compiler flags" >&5
14015printf %s "checking for required early compiler flags... " >&6; }
14016    tcl_flags=""
14017
14018    if test ${tcl_cv_flag__isoc99_source+y}
14019then :
14020  printf %s "(cached) " >&6
14021else $as_nop
14022  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14023/* end confdefs.h.  */
14024#include <stdlib.h>
14025int
14026main (void)
14027{
14028char *p = (char *)strtoll; char *q = (char *)strtoull;
14029  ;
14030  return 0;
14031}
14032_ACEOF
14033if ac_fn_c_try_compile "$LINENO"
14034then :
14035  tcl_cv_flag__isoc99_source=no
14036else $as_nop
14037  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14038/* end confdefs.h.  */
14039#define _ISOC99_SOURCE 1
14040#include <stdlib.h>
14041int
14042main (void)
14043{
14044char *p = (char *)strtoll; char *q = (char *)strtoull;
14045  ;
14046  return 0;
14047}
14048_ACEOF
14049if ac_fn_c_try_compile "$LINENO"
14050then :
14051  tcl_cv_flag__isoc99_source=yes
14052else $as_nop
14053  tcl_cv_flag__isoc99_source=no
14054fi
14055rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
14056fi
14057rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
14058fi
14059
14060    if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then
14061
14062printf "%s\n" "#define _ISOC99_SOURCE 1" >>confdefs.h
14063
14064	tcl_flags="$tcl_flags _ISOC99_SOURCE"
14065    fi
14066
14067
14068    if test ${tcl_cv_flag__largefile64_source+y}
14069then :
14070  printf %s "(cached) " >&6
14071else $as_nop
14072  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14073/* end confdefs.h.  */
14074#include <sys/stat.h>
14075int
14076main (void)
14077{
14078struct stat64 buf; int i = stat64("/", &buf);
14079  ;
14080  return 0;
14081}
14082_ACEOF
14083if ac_fn_c_try_compile "$LINENO"
14084then :
14085  tcl_cv_flag__largefile64_source=no
14086else $as_nop
14087  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14088/* end confdefs.h.  */
14089#define _LARGEFILE64_SOURCE 1
14090#include <sys/stat.h>
14091int
14092main (void)
14093{
14094struct stat64 buf; int i = stat64("/", &buf);
14095  ;
14096  return 0;
14097}
14098_ACEOF
14099if ac_fn_c_try_compile "$LINENO"
14100then :
14101  tcl_cv_flag__largefile64_source=yes
14102else $as_nop
14103  tcl_cv_flag__largefile64_source=no
14104fi
14105rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
14106fi
14107rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
14108fi
14109
14110    if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then
14111
14112printf "%s\n" "#define _LARGEFILE64_SOURCE 1" >>confdefs.h
14113
14114	tcl_flags="$tcl_flags _LARGEFILE64_SOURCE"
14115    fi
14116
14117
14118    if test ${tcl_cv_flag__largefile_source64+y}
14119then :
14120  printf %s "(cached) " >&6
14121else $as_nop
14122  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14123/* end confdefs.h.  */
14124#include <sys/stat.h>
14125int
14126main (void)
14127{
14128char *p = (char *)open64;
14129  ;
14130  return 0;
14131}
14132_ACEOF
14133if ac_fn_c_try_compile "$LINENO"
14134then :
14135  tcl_cv_flag__largefile_source64=no
14136else $as_nop
14137  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14138/* end confdefs.h.  */
14139#define _LARGEFILE_SOURCE64 1
14140#include <sys/stat.h>
14141int
14142main (void)
14143{
14144char *p = (char *)open64;
14145  ;
14146  return 0;
14147}
14148_ACEOF
14149if ac_fn_c_try_compile "$LINENO"
14150then :
14151  tcl_cv_flag__largefile_source64=yes
14152else $as_nop
14153  tcl_cv_flag__largefile_source64=no
14154fi
14155rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
14156fi
14157rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
14158fi
14159
14160    if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then
14161
14162printf "%s\n" "#define _LARGEFILE_SOURCE64 1" >>confdefs.h
14163
14164	tcl_flags="$tcl_flags _LARGEFILE_SOURCE64"
14165    fi
14166
14167    if test "x${tcl_flags}" = "x" ; then
14168	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5
14169printf "%s\n" "none" >&6; }
14170    else
14171	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${tcl_flags}" >&5
14172printf "%s\n" "${tcl_flags}" >&6; }
14173    fi
14174
14175
14176    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit integer type" >&5
14177printf %s "checking for 64-bit integer type... " >&6; }
14178    if test ${tcl_cv_type_64bit+y}
14179then :
14180  printf %s "(cached) " >&6
14181else $as_nop
14182
14183	tcl_cv_type_64bit=none
14184	# See if the compiler knows natively about __int64
14185	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14186/* end confdefs.h.  */
14187
14188int
14189main (void)
14190{
14191__int64 value = (__int64) 0;
14192  ;
14193  return 0;
14194}
14195_ACEOF
14196if ac_fn_c_try_compile "$LINENO"
14197then :
14198  tcl_type_64bit=__int64
14199else $as_nop
14200  tcl_type_64bit="long long"
14201fi
14202rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
14203	# See if we could use long anyway  Note that we substitute in the
14204	# type that is our current guess for a 64-bit type inside this check
14205	# program, so it should be modified only carefully...
14206        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14207/* end confdefs.h.  */
14208
14209int
14210main (void)
14211{
14212switch (0) {
14213            case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ;
14214        }
14215  ;
14216  return 0;
14217}
14218_ACEOF
14219if ac_fn_c_try_compile "$LINENO"
14220then :
14221  tcl_cv_type_64bit=${tcl_type_64bit}
14222fi
14223rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
14224fi
14225
14226    if test "${tcl_cv_type_64bit}" = none ; then
14227
14228printf "%s\n" "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h
14229
14230	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14231printf "%s\n" "yes" >&6; }
14232    elif test "${tcl_cv_type_64bit}" = "__int64" \
14233		-a "${TEA_PLATFORM}" = "windows" ; then
14234	# TEA specific: We actually want to use the default tcl.h checks in
14235	# this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER*
14236	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: using Tcl header defaults" >&5
14237printf "%s\n" "using Tcl header defaults" >&6; }
14238    else
14239
14240printf "%s\n" "#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit}" >>confdefs.h
14241
14242	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${tcl_cv_type_64bit}" >&5
14243printf "%s\n" "${tcl_cv_type_64bit}" >&6; }
14244
14245	# Now check for auxiliary declarations
14246	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5
14247printf %s "checking for struct dirent64... " >&6; }
14248if test ${tcl_cv_struct_dirent64+y}
14249then :
14250  printf %s "(cached) " >&6
14251else $as_nop
14252
14253	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14254/* end confdefs.h.  */
14255#include <sys/types.h>
14256#include <dirent.h>
14257int
14258main (void)
14259{
14260struct dirent64 p;
14261  ;
14262  return 0;
14263}
14264_ACEOF
14265if ac_fn_c_try_compile "$LINENO"
14266then :
14267  tcl_cv_struct_dirent64=yes
14268else $as_nop
14269  tcl_cv_struct_dirent64=no
14270fi
14271rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
14272fi
14273{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_dirent64" >&5
14274printf "%s\n" "$tcl_cv_struct_dirent64" >&6; }
14275	if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
14276
14277printf "%s\n" "#define HAVE_STRUCT_DIRENT64 1" >>confdefs.h
14278
14279	fi
14280
14281	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for DIR64" >&5
14282printf %s "checking for DIR64... " >&6; }
14283if test ${tcl_cv_DIR64+y}
14284then :
14285  printf %s "(cached) " >&6
14286else $as_nop
14287
14288	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14289/* end confdefs.h.  */
14290#include <sys/types.h>
14291#include <dirent.h>
14292int
14293main (void)
14294{
14295struct dirent64 *p; DIR64 d = opendir64(".");
14296            p = readdir64(d); rewinddir64(d); closedir64(d);
14297  ;
14298  return 0;
14299}
14300_ACEOF
14301if ac_fn_c_try_compile "$LINENO"
14302then :
14303  tcl_cv_DIR64=yes
14304else $as_nop
14305  tcl_cv_DIR64=no
14306fi
14307rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
14308fi
14309{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_DIR64" >&5
14310printf "%s\n" "$tcl_cv_DIR64" >&6; }
14311	if test "x${tcl_cv_DIR64}" = "xyes" ; then
14312
14313printf "%s\n" "#define HAVE_DIR64 1" >>confdefs.h
14314
14315	fi
14316
14317	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5
14318printf %s "checking for struct stat64... " >&6; }
14319if test ${tcl_cv_struct_stat64+y}
14320then :
14321  printf %s "(cached) " >&6
14322else $as_nop
14323
14324	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14325/* end confdefs.h.  */
14326#include <sys/stat.h>
14327int
14328main (void)
14329{
14330struct stat64 p;
14331
14332  ;
14333  return 0;
14334}
14335_ACEOF
14336if ac_fn_c_try_compile "$LINENO"
14337then :
14338  tcl_cv_struct_stat64=yes
14339else $as_nop
14340  tcl_cv_struct_stat64=no
14341fi
14342rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
14343fi
14344{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_stat64" >&5
14345printf "%s\n" "$tcl_cv_struct_stat64" >&6; }
14346	if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
14347
14348printf "%s\n" "#define HAVE_STRUCT_STAT64 1" >>confdefs.h
14349
14350	fi
14351
14352	ac_fn_c_check_func "$LINENO" "open64" "ac_cv_func_open64"
14353if test "x$ac_cv_func_open64" = xyes
14354then :
14355  printf "%s\n" "#define HAVE_OPEN64 1" >>confdefs.h
14356
14357fi
14358ac_fn_c_check_func "$LINENO" "lseek64" "ac_cv_func_lseek64"
14359if test "x$ac_cv_func_lseek64" = xyes
14360then :
14361  printf "%s\n" "#define HAVE_LSEEK64 1" >>confdefs.h
14362
14363fi
14364
14365	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for off64_t" >&5
14366printf %s "checking for off64_t... " >&6; }
14367	if test ${tcl_cv_type_off64_t+y}
14368then :
14369  printf %s "(cached) " >&6
14370else $as_nop
14371
14372	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14373/* end confdefs.h.  */
14374#include <sys/types.h>
14375int
14376main (void)
14377{
14378off64_t offset;
14379
14380  ;
14381  return 0;
14382}
14383_ACEOF
14384if ac_fn_c_try_compile "$LINENO"
14385then :
14386  tcl_cv_type_off64_t=yes
14387else $as_nop
14388  tcl_cv_type_off64_t=no
14389fi
14390rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
14391fi
14392
14393			if test "x${tcl_cv_type_off64_t}" = "xyes" && \
14394	        test "x${ac_cv_func_lseek64}" = "xyes" && \
14395	        test "x${ac_cv_func_open64}" = "xyes" ; then
14396
14397printf "%s\n" "#define HAVE_TYPE_OFF64_T 1" >>confdefs.h
14398
14399	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14400printf "%s\n" "yes" >&6; }
14401	else
14402	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
14403printf "%s\n" "no" >&6; }
14404	fi
14405    fi
14406
14407
14408
14409#--------------------------------------------------------------------
14410# Set the default compiler switches based on the --enable-symbols option.
14411#--------------------------------------------------------------------
14412
14413
14414
14415    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for build with symbols" >&5
14416printf %s "checking for build with symbols... " >&6; }
14417    # Check whether --enable-symbols was given.
14418if test ${enable_symbols+y}
14419then :
14420  enableval=$enable_symbols; tcl_ok=$enableval
14421else $as_nop
14422  tcl_ok=no
14423fi
14424
14425    if test "$tcl_ok" = "no"; then
14426	CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE} -DNDEBUG"
14427	LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
14428	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
14429printf "%s\n" "no" >&6; }
14430
14431printf "%s\n" "#define TCL_CFG_OPTIMIZED 1" >>confdefs.h
14432
14433    else
14434	CFLAGS_DEFAULT="${CFLAGS_DEBUG}"
14435	LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}"
14436	if test "$tcl_ok" = "yes"; then
14437	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (standard debugging)" >&5
14438printf "%s\n" "yes (standard debugging)" >&6; }
14439	fi
14440    fi
14441
14442
14443
14444    if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
14445
14446printf "%s\n" "#define TCL_MEM_DEBUG 1" >>confdefs.h
14447
14448    fi
14449
14450    if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
14451	if test "$tcl_ok" = "all"; then
14452	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: enabled symbols mem debugging" >&5
14453printf "%s\n" "enabled symbols mem debugging" >&6; }
14454	else
14455	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: enabled $tcl_ok debugging" >&5
14456printf "%s\n" "enabled $tcl_ok debugging" >&6; }
14457	fi
14458    fi
14459
14460
14461#--------------------------------------------------------------------
14462# Everyone should be linking against the Tcl stub library.  If you
14463# can't for some reason, remove this definition.  If you aren't using
14464# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
14465# link against the non-stubbed Tcl library.  Add Tk too if necessary.
14466#--------------------------------------------------------------------
14467
14468
14469printf "%s\n" "#define USE_TCL_STUBS 1" >>confdefs.h
14470
14471
14472#--------------------------------------------------------------------
14473# Enable compile-time support for TIP #143 and TIP #285.  When using
14474# a pre-Tcl 8.5 or 8.6 core, respectively, the actual functionality
14475# will not be available at runtime.
14476#--------------------------------------------------------------------
14477
14478
14479printf "%s\n" "#define TCL_TIP143 1" >>confdefs.h
14480
14481
14482printf "%s\n" "#define TCL_TIP285 1" >>confdefs.h
14483
14484
14485#--------------------------------------------------------------------
14486# This macro generates a line to use when building a library.  It
14487# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
14488# and TEA_LOAD_TCLCONFIG macros above.
14489#--------------------------------------------------------------------
14490
14491
14492{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
14493printf %s "checking for grep that handles long lines and -e... " >&6; }
14494if test ${ac_cv_path_GREP+y}
14495then :
14496  printf %s "(cached) " >&6
14497else $as_nop
14498  if test -z "$GREP"; then
14499  ac_path_GREP_found=false
14500  # Loop through the user's path and test for each of PROGNAME-LIST
14501  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14502for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
14503do
14504  IFS=$as_save_IFS
14505  case $as_dir in #(((
14506    '') as_dir=./ ;;
14507    */) ;;
14508    *) as_dir=$as_dir/ ;;
14509  esac
14510    for ac_prog in grep ggrep
14511   do
14512    for ac_exec_ext in '' $ac_executable_extensions; do
14513      ac_path_GREP="$as_dir$ac_prog$ac_exec_ext"
14514      as_fn_executable_p "$ac_path_GREP" || continue
14515# Check for GNU ac_path_GREP and select it if it is found.
14516  # Check for GNU $ac_path_GREP
14517case `"$ac_path_GREP" --version 2>&1` in
14518*GNU*)
14519  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
14520*)
14521  ac_count=0
14522  printf %s 0123456789 >"conftest.in"
14523  while :
14524  do
14525    cat "conftest.in" "conftest.in" >"conftest.tmp"
14526    mv "conftest.tmp" "conftest.in"
14527    cp "conftest.in" "conftest.nl"
14528    printf "%s\n" 'GREP' >> "conftest.nl"
14529    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
14530    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
14531    as_fn_arith $ac_count + 1 && ac_count=$as_val
14532    if test $ac_count -gt ${ac_path_GREP_max-0}; then
14533      # Best one so far, save it but keep looking for a better one
14534      ac_cv_path_GREP="$ac_path_GREP"
14535      ac_path_GREP_max=$ac_count
14536    fi
14537    # 10*(2^10) chars as input seems more than enough
14538    test $ac_count -gt 10 && break
14539  done
14540  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
14541esac
14542
14543      $ac_path_GREP_found && break 3
14544    done
14545  done
14546  done
14547IFS=$as_save_IFS
14548  if test -z "$ac_cv_path_GREP"; then
14549    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
14550  fi
14551else
14552  ac_cv_path_GREP=$GREP
14553fi
14554
14555fi
14556{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
14557printf "%s\n" "$ac_cv_path_GREP" >&6; }
14558 GREP="$ac_cv_path_GREP"
14559
14560
14561{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
14562printf %s "checking for egrep... " >&6; }
14563if test ${ac_cv_path_EGREP+y}
14564then :
14565  printf %s "(cached) " >&6
14566else $as_nop
14567  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
14568   then ac_cv_path_EGREP="$GREP -E"
14569   else
14570     if test -z "$EGREP"; then
14571  ac_path_EGREP_found=false
14572  # Loop through the user's path and test for each of PROGNAME-LIST
14573  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14574for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
14575do
14576  IFS=$as_save_IFS
14577  case $as_dir in #(((
14578    '') as_dir=./ ;;
14579    */) ;;
14580    *) as_dir=$as_dir/ ;;
14581  esac
14582    for ac_prog in egrep
14583   do
14584    for ac_exec_ext in '' $ac_executable_extensions; do
14585      ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext"
14586      as_fn_executable_p "$ac_path_EGREP" || continue
14587# Check for GNU ac_path_EGREP and select it if it is found.
14588  # Check for GNU $ac_path_EGREP
14589case `"$ac_path_EGREP" --version 2>&1` in
14590*GNU*)
14591  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
14592*)
14593  ac_count=0
14594  printf %s 0123456789 >"conftest.in"
14595  while :
14596  do
14597    cat "conftest.in" "conftest.in" >"conftest.tmp"
14598    mv "conftest.tmp" "conftest.in"
14599    cp "conftest.in" "conftest.nl"
14600    printf "%s\n" 'EGREP' >> "conftest.nl"
14601    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
14602    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
14603    as_fn_arith $ac_count + 1 && ac_count=$as_val
14604    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
14605      # Best one so far, save it but keep looking for a better one
14606      ac_cv_path_EGREP="$ac_path_EGREP"
14607      ac_path_EGREP_max=$ac_count
14608    fi
14609    # 10*(2^10) chars as input seems more than enough
14610    test $ac_count -gt 10 && break
14611  done
14612  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
14613esac
14614
14615      $ac_path_EGREP_found && break 3
14616    done
14617  done
14618  done
14619IFS=$as_save_IFS
14620  if test -z "$ac_cv_path_EGREP"; then
14621    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
14622  fi
14623else
14624  ac_cv_path_EGREP=$EGREP
14625fi
14626
14627   fi
14628fi
14629{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
14630printf "%s\n" "$ac_cv_path_EGREP" >&6; }
14631 EGREP="$ac_cv_path_EGREP"
14632
14633
14634
14635    if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then
14636	MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)"
14637	MAKE_SHARED_LIB="\${SHLIB_LD} \${LDFLAGS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}"
14638	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14639/* end confdefs.h.  */
14640
14641#if defined(_MSC_VER) && _MSC_VER >= 1400
14642print("manifest needed")
14643#endif
14644
14645_ACEOF
14646if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14647  $EGREP "manifest needed" >/dev/null 2>&1
14648then :
14649
14650	# Could do a CHECK_PROG for mt, but should always be with MSVC8+
14651	VC_MANIFEST_EMBED_DLL="if test -f \$@.manifest ; then mt.exe -nologo -manifest \$@.manifest -outputresource:\$@\;2 ; fi"
14652	VC_MANIFEST_EMBED_EXE="if test -f \$@.manifest ; then mt.exe -nologo -manifest \$@.manifest -outputresource:\$@\;1 ; fi"
14653	MAKE_SHARED_LIB="${MAKE_SHARED_LIB} ; ${VC_MANIFEST_EMBED_DLL}"
14654
14655    CLEANFILES="$CLEANFILES *.manifest"
14656
14657
14658fi
14659rm -rf conftest*
14660
14661	MAKE_STUB_LIB="\${STLIB_LD} -nodefaultlib -out:\$@ \$(PKG_STUB_OBJECTS)"
14662    else
14663	MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)"
14664	MAKE_SHARED_LIB="\${SHLIB_LD} \${LDFLAGS} \${LDFLAGS_DEFAULT} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}"
14665	MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)"
14666    fi
14667
14668    if test "${SHARED_BUILD}" = "1" ; then
14669	MAKE_LIB="${MAKE_SHARED_LIB} "
14670    else
14671	MAKE_LIB="${MAKE_STATIC_LIB} "
14672    fi
14673
14674    #--------------------------------------------------------------------
14675    # Shared libraries and static libraries have different names.
14676    # Use the double eval to make sure any variables in the suffix is
14677    # substituted. (@@@ Might not be necessary anymore)
14678    #--------------------------------------------------------------------
14679
14680    PACKAGE_LIB_PREFIX8="${PACKAGE_LIB_PREFIX}"
14681    PACKAGE_LIB_PREFIX9="${PACKAGE_LIB_PREFIX}tcl9"
14682    if test "${TCL_MAJOR_VERSION}" -gt 8 ; then
14683	PACKAGE_LIB_PREFIX="${PACKAGE_LIB_PREFIX9}"
14684    else
14685	PACKAGE_LIB_PREFIX="${PACKAGE_LIB_PREFIX8}"
14686    fi
14687    if test "${TEA_PLATFORM}" = "windows" ; then
14688	if test "${SHARED_BUILD}" = "1" ; then
14689	    # We force the unresolved linking of symbols that are really in
14690	    # the private libraries of Tcl and Tk.
14691	    if test x"${TK_BIN_DIR}" != x ; then
14692		SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\""
14693	    fi
14694	    SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\""
14695	    if test "$GCC" = "yes"; then
14696		SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -static-libgcc"
14697	    fi
14698	    eval eval "PKG_LIB_FILE8=${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
14699	    eval eval "PKG_LIB_FILE9=${PACKAGE_LIB_PREFIX9}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
14700	    eval eval "PKG_LIB_FILE=${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
14701	else
14702	    if test "$GCC" = "yes"; then
14703		PACKAGE_LIB_PREFIX=lib${PACKAGE_LIB_PREFIX}
14704	    fi
14705	    eval eval "PKG_LIB_FILE8=${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
14706	    eval eval "PKG_LIB_FILE9=${PACKAGE_LIB_PREFIX9}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
14707	    eval eval "PKG_LIB_FILE=${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
14708	fi
14709	# Some packages build their own stubs libraries
14710	eval eval "PKG_STUB_LIB_FILE=${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
14711	if test "$GCC" = "yes"; then
14712	    PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE}
14713	fi
14714	# These aren't needed on Windows (either MSVC or gcc)
14715	RANLIB=:
14716	RANLIB_STUB=:
14717    else
14718	RANLIB_STUB="${RANLIB}"
14719	if test "${SHARED_BUILD}" = "1" ; then
14720	    SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}"
14721	    if test x"${TK_BIN_DIR}" != x ; then
14722		SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}"
14723	    fi
14724	    eval eval "PKG_LIB_FILE8=lib${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
14725	    eval eval "PKG_LIB_FILE9=lib${PACKAGE_LIB_PREFIX9}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
14726	    eval eval "PKG_LIB_FILE=lib${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
14727	    RANLIB=:
14728	else
14729	    eval eval "PKG_LIB_FILE=lib${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
14730	    eval eval "PKG_LIB_FILE=lib${PACKAGE_LIB_PREFIX9}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
14731	    eval eval "PKG_LIB_FILE=lib${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
14732	fi
14733	# Some packages build their own stubs libraries
14734	eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
14735    fi
14736
14737    # These are escaped so that only CFLAGS is picked up at configure time.
14738    # The other values will be substituted at make time.
14739    CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}"
14740    if test "${SHARED_BUILD}" = "1" ; then
14741	CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}"
14742    fi
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753#--------------------------------------------------------------------
14754# Determine the name of the tclsh and/or wish executables in the
14755# Tcl and Tk build directories or the location they were installed
14756# into. These paths are used to support running test cases only,
14757# the Makefile should not be making use of these paths to generate
14758# a pkgIndex.tcl file or anything else at extension build time.
14759#--------------------------------------------------------------------
14760
14761
14762    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tclsh" >&5
14763printf %s "checking for tclsh... " >&6; }
14764    if test -f "${TCL_BIN_DIR}/Makefile" ; then
14765        # tclConfig.sh is in Tcl build directory
14766        if test "${TEA_PLATFORM}" = "windows"; then
14767          if test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}" ; then
14768            TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}"
14769          elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}s${EXEEXT}" ; then
14770            TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}s${EXEEXT}"
14771          elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}t${EXEEXT}" ; then
14772            TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}t${EXEEXT}"
14773          elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}st${EXEEXT}" ; then
14774            TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}st${EXEEXT}"
14775          fi
14776        else
14777            TCLSH_PROG="${TCL_BIN_DIR}/tclsh"
14778        fi
14779    else
14780        # tclConfig.sh is in install location
14781        if test "${TEA_PLATFORM}" = "windows"; then
14782            TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}"
14783        else
14784            TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}"
14785        fi
14786        list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \
14787              `ls -d ${TCL_BIN_DIR}/..     2>/dev/null` \
14788              `ls -d ${TCL_PREFIX}/bin     2>/dev/null`"
14789        for i in $list ; do
14790            if test -f "$i/${TCLSH_PROG}" ; then
14791                REAL_TCL_BIN_DIR="`cd "$i"; pwd`/"
14792                break
14793            fi
14794        done
14795        TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}"
14796    fi
14797    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${TCLSH_PROG}" >&5
14798printf "%s\n" "${TCLSH_PROG}" >&6; }
14799
14800
14801#TEA_PROG_WISH
14802
14803#--------------------------------------------------------------------
14804# Finally, substitute all of the various values into the Makefile.
14805# You may alternatively have a special pkgIndex.tcl.in or other files
14806# which require substituting th AC variables in.  Include these here.
14807#--------------------------------------------------------------------
14808
14809ac_config_files="$ac_config_files Makefile pkgIndex.tcl"
14810
14811cat >confcache <<\_ACEOF
14812# This file is a shell script that caches the results of configure
14813# tests run on this system so they can be shared between configure
14814# scripts and configure runs, see configure's option --config-cache.
14815# It is not useful on other systems.  If it contains results you don't
14816# want to keep, you may remove or edit it.
14817#
14818# config.status only pays attention to the cache file if you give it
14819# the --recheck option to rerun configure.
14820#
14821# `ac_cv_env_foo' variables (set or unset) will be overridden when
14822# loading this file, other *unset* `ac_cv_foo' will be assigned the
14823# following values.
14824
14825_ACEOF
14826
14827# The following way of writing the cache mishandles newlines in values,
14828# but we know of no workaround that is simple, portable, and efficient.
14829# So, we kill variables containing newlines.
14830# Ultrix sh set writes to stderr and can't be redirected directly,
14831# and sets the high bit in the cache file unless we assign to the vars.
14832(
14833  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
14834    eval ac_val=\$$ac_var
14835    case $ac_val in #(
14836    *${as_nl}*)
14837      case $ac_var in #(
14838      *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
14839printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
14840      esac
14841      case $ac_var in #(
14842      _ | IFS | as_nl) ;; #(
14843      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
14844      *) { eval $ac_var=; unset $ac_var;} ;;
14845      esac ;;
14846    esac
14847  done
14848
14849  (set) 2>&1 |
14850    case $as_nl`(ac_space=' '; set) 2>&1` in #(
14851    *${as_nl}ac_space=\ *)
14852      # `set' does not quote correctly, so add quotes: double-quote
14853      # substitution turns \\\\ into \\, and sed turns \\ into \.
14854      sed -n \
14855	"s/'/'\\\\''/g;
14856	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
14857      ;; #(
14858    *)
14859      # `set' quotes correctly as required by POSIX, so do not add quotes.
14860      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
14861      ;;
14862    esac |
14863    sort
14864) |
14865  sed '
14866     /^ac_cv_env_/b end
14867     t clear
14868     :clear
14869     s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/
14870     t end
14871     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
14872     :end' >>confcache
14873if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
14874  if test -w "$cache_file"; then
14875    if test "x$cache_file" != "x/dev/null"; then
14876      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
14877printf "%s\n" "$as_me: updating cache $cache_file" >&6;}
14878      if test ! -f "$cache_file" || test -h "$cache_file"; then
14879	cat confcache >"$cache_file"
14880      else
14881        case $cache_file in #(
14882        */* | ?:*)
14883	  mv -f confcache "$cache_file"$$ &&
14884	  mv -f "$cache_file"$$ "$cache_file" ;; #(
14885        *)
14886	  mv -f confcache "$cache_file" ;;
14887	esac
14888      fi
14889    fi
14890  else
14891    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
14892printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;}
14893  fi
14894fi
14895rm -f confcache
14896
14897test "x$prefix" = xNONE && prefix=$ac_default_prefix
14898# Let make expand exec_prefix.
14899test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
14900
14901# Transform confdefs.h into DEFS.
14902# Protect against shell expansion while executing Makefile rules.
14903# Protect against Makefile macro expansion.
14904#
14905# If the first sed substitution is executed (which looks for macros that
14906# take arguments), then branch to the quote section.  Otherwise,
14907# look for a macro that doesn't take arguments.
14908ac_script='
14909:mline
14910/\\$/{
14911 N
14912 s,\\\n,,
14913 b mline
14914}
14915t clear
14916:clear
14917s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\)/-D\1=\2/g
14918t quote
14919s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)/-D\1=\2/g
14920t quote
14921b any
14922:quote
14923s/[	 `~#$^&*(){}\\|;'\''"<>?]/\\&/g
14924s/\[/\\&/g
14925s/\]/\\&/g
14926s/\$/$$/g
14927H
14928:any
14929${
14930	g
14931	s/^\n//
14932	s/\n/ /g
14933	p
14934}
14935'
14936DEFS=`sed -n "$ac_script" confdefs.h`
14937
14938
14939ac_libobjs=
14940ac_ltlibobjs=
14941U=
14942for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
14943  # 1. Remove the extension, and $U if already installed.
14944  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
14945  ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"`
14946  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
14947  #    will be set to the directory where LIBOBJS objects are built.
14948  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
14949  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
14950done
14951LIBOBJS=$ac_libobjs
14952
14953LTLIBOBJS=$ac_ltlibobjs
14954
14955
14956
14957CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""
14958
14959: "${CONFIG_STATUS=./config.status}"
14960ac_write_fail=0
14961ac_clean_files_save=$ac_clean_files
14962ac_clean_files="$ac_clean_files $CONFIG_STATUS"
14963{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
14964printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;}
14965as_write_fail=0
14966cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
14967#! $SHELL
14968# Generated by $as_me.
14969# Run this file to recreate the current configuration.
14970# Compiler output produced by configure, useful for debugging
14971# configure, is in config.log if it exists.
14972
14973debug=false
14974ac_cs_recheck=false
14975ac_cs_silent=false
14976
14977SHELL=\${CONFIG_SHELL-$SHELL}
14978export SHELL
14979_ASEOF
14980cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
14981## -------------------- ##
14982## M4sh Initialization. ##
14983## -------------------- ##
14984
14985# Be more Bourne compatible
14986DUALCASE=1; export DUALCASE # for MKS sh
14987as_nop=:
14988if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
14989then :
14990  emulate sh
14991  NULLCMD=:
14992  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
14993  # is contrary to our usage.  Disable this feature.
14994  alias -g '${1+"$@"}'='"$@"'
14995  setopt NO_GLOB_SUBST
14996else $as_nop
14997  case `(set -o) 2>/dev/null` in #(
14998  *posix*) :
14999    set -o posix ;; #(
15000  *) :
15001     ;;
15002esac
15003fi
15004
15005
15006
15007# Reset variables that may have inherited troublesome values from
15008# the environment.
15009
15010# IFS needs to be set, to space, tab, and newline, in precisely that order.
15011# (If _AS_PATH_WALK were called with IFS unset, it would have the
15012# side effect of setting IFS to empty, thus disabling word splitting.)
15013# Quoting is to prevent editors from complaining about space-tab.
15014as_nl='
15015'
15016export as_nl
15017IFS=" ""	$as_nl"
15018
15019PS1='$ '
15020PS2='> '
15021PS4='+ '
15022
15023# Ensure predictable behavior from utilities with locale-dependent output.
15024LC_ALL=C
15025export LC_ALL
15026LANGUAGE=C
15027export LANGUAGE
15028
15029# We cannot yet rely on "unset" to work, but we need these variables
15030# to be unset--not just set to an empty or harmless value--now, to
15031# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh).  This construct
15032# also avoids known problems related to "unset" and subshell syntax
15033# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
15034for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
15035do eval test \${$as_var+y} \
15036  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
15037done
15038
15039# Ensure that fds 0, 1, and 2 are open.
15040if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi
15041if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
15042if (exec 3>&2)            ; then :; else exec 2>/dev/null; fi
15043
15044# The user is always right.
15045if ${PATH_SEPARATOR+false} :; then
15046  PATH_SEPARATOR=:
15047  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
15048    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
15049      PATH_SEPARATOR=';'
15050  }
15051fi
15052
15053
15054# Find who we are.  Look in the path if we contain no directory separator.
15055as_myself=
15056case $0 in #((
15057  *[\\/]* ) as_myself=$0 ;;
15058  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15059for as_dir in $PATH
15060do
15061  IFS=$as_save_IFS
15062  case $as_dir in #(((
15063    '') as_dir=./ ;;
15064    */) ;;
15065    *) as_dir=$as_dir/ ;;
15066  esac
15067    test -r "$as_dir$0" && as_myself=$as_dir$0 && break
15068  done
15069IFS=$as_save_IFS
15070
15071     ;;
15072esac
15073# We did not find ourselves, most probably we were run as `sh COMMAND'
15074# in which case we are not to be found in the path.
15075if test "x$as_myself" = x; then
15076  as_myself=$0
15077fi
15078if test ! -f "$as_myself"; then
15079  printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
15080  exit 1
15081fi
15082
15083
15084
15085# as_fn_error STATUS ERROR [LINENO LOG_FD]
15086# ----------------------------------------
15087# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
15088# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
15089# script with STATUS, using 1 if that was 0.
15090as_fn_error ()
15091{
15092  as_status=$1; test $as_status -eq 0 && as_status=1
15093  if test "$4"; then
15094    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
15095    printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
15096  fi
15097  printf "%s\n" "$as_me: error: $2" >&2
15098  as_fn_exit $as_status
15099} # as_fn_error
15100
15101
15102
15103# as_fn_set_status STATUS
15104# -----------------------
15105# Set $? to STATUS, without forking.
15106as_fn_set_status ()
15107{
15108  return $1
15109} # as_fn_set_status
15110
15111# as_fn_exit STATUS
15112# -----------------
15113# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
15114as_fn_exit ()
15115{
15116  set +e
15117  as_fn_set_status $1
15118  exit $1
15119} # as_fn_exit
15120
15121# as_fn_unset VAR
15122# ---------------
15123# Portably unset VAR.
15124as_fn_unset ()
15125{
15126  { eval $1=; unset $1;}
15127}
15128as_unset=as_fn_unset
15129
15130# as_fn_append VAR VALUE
15131# ----------------------
15132# Append the text in VALUE to the end of the definition contained in VAR. Take
15133# advantage of any shell optimizations that allow amortized linear growth over
15134# repeated appends, instead of the typical quadratic growth present in naive
15135# implementations.
15136if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
15137then :
15138  eval 'as_fn_append ()
15139  {
15140    eval $1+=\$2
15141  }'
15142else $as_nop
15143  as_fn_append ()
15144  {
15145    eval $1=\$$1\$2
15146  }
15147fi # as_fn_append
15148
15149# as_fn_arith ARG...
15150# ------------------
15151# Perform arithmetic evaluation on the ARGs, and store the result in the
15152# global $as_val. Take advantage of shells that can avoid forks. The arguments
15153# must be portable across $(()) and expr.
15154if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
15155then :
15156  eval 'as_fn_arith ()
15157  {
15158    as_val=$(( $* ))
15159  }'
15160else $as_nop
15161  as_fn_arith ()
15162  {
15163    as_val=`expr "$@" || test $? -eq 1`
15164  }
15165fi # as_fn_arith
15166
15167
15168if expr a : '\(a\)' >/dev/null 2>&1 &&
15169   test "X`expr 00001 : '.*\(...\)'`" = X001; then
15170  as_expr=expr
15171else
15172  as_expr=false
15173fi
15174
15175if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
15176  as_basename=basename
15177else
15178  as_basename=false
15179fi
15180
15181if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
15182  as_dirname=dirname
15183else
15184  as_dirname=false
15185fi
15186
15187as_me=`$as_basename -- "$0" ||
15188$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
15189	 X"$0" : 'X\(//\)$' \| \
15190	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
15191printf "%s\n" X/"$0" |
15192    sed '/^.*\/\([^/][^/]*\)\/*$/{
15193	    s//\1/
15194	    q
15195	  }
15196	  /^X\/\(\/\/\)$/{
15197	    s//\1/
15198	    q
15199	  }
15200	  /^X\/\(\/\).*/{
15201	    s//\1/
15202	    q
15203	  }
15204	  s/.*/./; q'`
15205
15206# Avoid depending upon Character Ranges.
15207as_cr_letters='abcdefghijklmnopqrstuvwxyz'
15208as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
15209as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15210as_cr_digits='0123456789'
15211as_cr_alnum=$as_cr_Letters$as_cr_digits
15212
15213
15214# Determine whether it's possible to make 'echo' print without a newline.
15215# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
15216# for compatibility with existing Makefiles.
15217ECHO_C= ECHO_N= ECHO_T=
15218case `echo -n x` in #(((((
15219-n*)
15220  case `echo 'xy\c'` in
15221  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
15222  xy)  ECHO_C='\c';;
15223  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
15224       ECHO_T='	';;
15225  esac;;
15226*)
15227  ECHO_N='-n';;
15228esac
15229
15230# For backward compatibility with old third-party macros, we provide
15231# the shell variables $as_echo and $as_echo_n.  New code should use
15232# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
15233as_echo='printf %s\n'
15234as_echo_n='printf %s'
15235
15236rm -f conf$$ conf$$.exe conf$$.file
15237if test -d conf$$.dir; then
15238  rm -f conf$$.dir/conf$$.file
15239else
15240  rm -f conf$$.dir
15241  mkdir conf$$.dir 2>/dev/null
15242fi
15243if (echo >conf$$.file) 2>/dev/null; then
15244  if ln -s conf$$.file conf$$ 2>/dev/null; then
15245    as_ln_s='ln -s'
15246    # ... but there are two gotchas:
15247    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
15248    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
15249    # In both cases, we have to default to `cp -pR'.
15250    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
15251      as_ln_s='cp -pR'
15252  elif ln conf$$.file conf$$ 2>/dev/null; then
15253    as_ln_s=ln
15254  else
15255    as_ln_s='cp -pR'
15256  fi
15257else
15258  as_ln_s='cp -pR'
15259fi
15260rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
15261rmdir conf$$.dir 2>/dev/null
15262
15263
15264# as_fn_mkdir_p
15265# -------------
15266# Create "$as_dir" as a directory, including parents if necessary.
15267as_fn_mkdir_p ()
15268{
15269
15270  case $as_dir in #(
15271  -*) as_dir=./$as_dir;;
15272  esac
15273  test -d "$as_dir" || eval $as_mkdir_p || {
15274    as_dirs=
15275    while :; do
15276      case $as_dir in #(
15277      *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
15278      *) as_qdir=$as_dir;;
15279      esac
15280      as_dirs="'$as_qdir' $as_dirs"
15281      as_dir=`$as_dirname -- "$as_dir" ||
15282$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15283	 X"$as_dir" : 'X\(//\)[^/]' \| \
15284	 X"$as_dir" : 'X\(//\)$' \| \
15285	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
15286printf "%s\n" X"$as_dir" |
15287    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
15288	    s//\1/
15289	    q
15290	  }
15291	  /^X\(\/\/\)[^/].*/{
15292	    s//\1/
15293	    q
15294	  }
15295	  /^X\(\/\/\)$/{
15296	    s//\1/
15297	    q
15298	  }
15299	  /^X\(\/\).*/{
15300	    s//\1/
15301	    q
15302	  }
15303	  s/.*/./; q'`
15304      test -d "$as_dir" && break
15305    done
15306    test -z "$as_dirs" || eval "mkdir $as_dirs"
15307  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
15308
15309
15310} # as_fn_mkdir_p
15311if mkdir -p . 2>/dev/null; then
15312  as_mkdir_p='mkdir -p "$as_dir"'
15313else
15314  test -d ./-p && rmdir ./-p
15315  as_mkdir_p=false
15316fi
15317
15318
15319# as_fn_executable_p FILE
15320# -----------------------
15321# Test if FILE is an executable regular file.
15322as_fn_executable_p ()
15323{
15324  test -f "$1" && test -x "$1"
15325} # as_fn_executable_p
15326as_test_x='test -x'
15327as_executable_p=as_fn_executable_p
15328
15329# Sed expression to map a string onto a valid CPP name.
15330as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
15331
15332# Sed expression to map a string onto a valid variable name.
15333as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
15334
15335
15336exec 6>&1
15337## ----------------------------------- ##
15338## Main body of $CONFIG_STATUS script. ##
15339## ----------------------------------- ##
15340_ASEOF
15341test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
15342
15343cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
15344# Save the log message, to keep $0 and so on meaningful, and to
15345# report actual input values of CONFIG_FILES etc. instead of their
15346# values after options handling.
15347ac_log="
15348This file was extended by thread $as_me 2.8.7, which was
15349generated by GNU Autoconf 2.71.  Invocation command line was
15350
15351  CONFIG_FILES    = $CONFIG_FILES
15352  CONFIG_HEADERS  = $CONFIG_HEADERS
15353  CONFIG_LINKS    = $CONFIG_LINKS
15354  CONFIG_COMMANDS = $CONFIG_COMMANDS
15355  $ $0 $@
15356
15357on `(hostname || uname -n) 2>/dev/null | sed 1q`
15358"
15359
15360_ACEOF
15361
15362case $ac_config_files in *"
15363"*) set x $ac_config_files; shift; ac_config_files=$*;;
15364esac
15365
15366
15367
15368cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
15369# Files that config.status was made for.
15370config_files="$ac_config_files"
15371
15372_ACEOF
15373
15374cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
15375ac_cs_usage="\
15376\`$as_me' instantiates files and other configuration actions
15377from templates according to the current configuration.  Unless the files
15378and actions are specified as TAGs, all are instantiated by default.
15379
15380Usage: $0 [OPTION]... [TAG]...
15381
15382  -h, --help       print this help, then exit
15383  -V, --version    print version number and configuration settings, then exit
15384      --config     print configuration, then exit
15385  -q, --quiet, --silent
15386                   do not print progress messages
15387  -d, --debug      don't remove temporary files
15388      --recheck    update $as_me by reconfiguring in the same conditions
15389      --file=FILE[:TEMPLATE]
15390                   instantiate the configuration file FILE
15391
15392Configuration files:
15393$config_files
15394
15395Report bugs to the package provider."
15396
15397_ACEOF
15398ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"`
15399ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"`
15400cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
15401ac_cs_config='$ac_cs_config_escaped'
15402ac_cs_version="\\
15403thread config.status 2.8.7
15404configured by $0, generated by GNU Autoconf 2.71,
15405  with options \\"\$ac_cs_config\\"
15406
15407Copyright (C) 2021 Free Software Foundation, Inc.
15408This config.status script is free software; the Free Software Foundation
15409gives unlimited permission to copy, distribute and modify it."
15410
15411ac_pwd='$ac_pwd'
15412srcdir='$srcdir'
15413test -n "\$AWK" || AWK=awk
15414_ACEOF
15415
15416cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
15417# The default lists apply if the user does not specify any file.
15418ac_need_defaults=:
15419while test $# != 0
15420do
15421  case $1 in
15422  --*=?*)
15423    ac_option=`expr "X$1" : 'X\([^=]*\)='`
15424    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
15425    ac_shift=:
15426    ;;
15427  --*=)
15428    ac_option=`expr "X$1" : 'X\([^=]*\)='`
15429    ac_optarg=
15430    ac_shift=:
15431    ;;
15432  *)
15433    ac_option=$1
15434    ac_optarg=$2
15435    ac_shift=shift
15436    ;;
15437  esac
15438
15439  case $ac_option in
15440  # Handling of the options.
15441  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
15442    ac_cs_recheck=: ;;
15443  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
15444    printf "%s\n" "$ac_cs_version"; exit ;;
15445  --config | --confi | --conf | --con | --co | --c )
15446    printf "%s\n" "$ac_cs_config"; exit ;;
15447  --debug | --debu | --deb | --de | --d | -d )
15448    debug=: ;;
15449  --file | --fil | --fi | --f )
15450    $ac_shift
15451    case $ac_optarg in
15452    *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
15453    '') as_fn_error $? "missing file argument" ;;
15454    esac
15455    as_fn_append CONFIG_FILES " '$ac_optarg'"
15456    ac_need_defaults=false;;
15457  --he | --h |  --help | --hel | -h )
15458    printf "%s\n" "$ac_cs_usage"; exit ;;
15459  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
15460  | -silent | --silent | --silen | --sile | --sil | --si | --s)
15461    ac_cs_silent=: ;;
15462
15463  # This is an error.
15464  -*) as_fn_error $? "unrecognized option: \`$1'
15465Try \`$0 --help' for more information." ;;
15466
15467  *) as_fn_append ac_config_targets " $1"
15468     ac_need_defaults=false ;;
15469
15470  esac
15471  shift
15472done
15473
15474ac_configure_extra_args=
15475
15476if $ac_cs_silent; then
15477  exec 6>/dev/null
15478  ac_configure_extra_args="$ac_configure_extra_args --silent"
15479fi
15480
15481_ACEOF
15482cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
15483if \$ac_cs_recheck; then
15484  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
15485  shift
15486  \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6
15487  CONFIG_SHELL='$SHELL'
15488  export CONFIG_SHELL
15489  exec "\$@"
15490fi
15491
15492_ACEOF
15493cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
15494exec 5>>config.log
15495{
15496  echo
15497  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
15498## Running $as_me. ##
15499_ASBOX
15500  printf "%s\n" "$ac_log"
15501} >&5
15502
15503_ACEOF
15504cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
15505_ACEOF
15506
15507cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
15508
15509# Handling of arguments.
15510for ac_config_target in $ac_config_targets
15511do
15512  case $ac_config_target in
15513    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
15514    "pkgIndex.tcl") CONFIG_FILES="$CONFIG_FILES pkgIndex.tcl" ;;
15515
15516  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
15517  esac
15518done
15519
15520
15521# If the user did not use the arguments to specify the items to instantiate,
15522# then the envvar interface is used.  Set only those that are not.
15523# We use the long form for the default assignment because of an extremely
15524# bizarre bug on SunOS 4.1.3.
15525if $ac_need_defaults; then
15526  test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files
15527fi
15528
15529# Have a temporary directory for convenience.  Make it in the build tree
15530# simply because there is no reason against having it here, and in addition,
15531# creating and moving files from /tmp can sometimes cause problems.
15532# Hook for its removal unless debugging.
15533# Note that there is a small window in which the directory will not be cleaned:
15534# after its creation but before its name has been assigned to `$tmp'.
15535$debug ||
15536{
15537  tmp= ac_tmp=
15538  trap 'exit_status=$?
15539  : "${ac_tmp:=$tmp}"
15540  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
15541' 0
15542  trap 'as_fn_exit 1' 1 2 13 15
15543}
15544# Create a (secure) tmp directory for tmp files.
15545
15546{
15547  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
15548  test -d "$tmp"
15549}  ||
15550{
15551  tmp=./conf$$-$RANDOM
15552  (umask 077 && mkdir "$tmp")
15553} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
15554ac_tmp=$tmp
15555
15556# Set up the scripts for CONFIG_FILES section.
15557# No need to generate them if there are no CONFIG_FILES.
15558# This happens for instance with `./config.status config.h'.
15559if test -n "$CONFIG_FILES"; then
15560
15561
15562ac_cr=`echo X | tr X '\015'`
15563# On cygwin, bash can eat \r inside `` if the user requested igncr.
15564# But we know of no other shell where ac_cr would be empty at this
15565# point, so we can use a bashism as a fallback.
15566if test "x$ac_cr" = x; then
15567  eval ac_cr=\$\'\\r\'
15568fi
15569ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
15570if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
15571  ac_cs_awk_cr='\\r'
15572else
15573  ac_cs_awk_cr=$ac_cr
15574fi
15575
15576echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
15577_ACEOF
15578
15579
15580{
15581  echo "cat >conf$$subs.awk <<_ACEOF" &&
15582  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
15583  echo "_ACEOF"
15584} >conf$$subs.sh ||
15585  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
15586ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
15587ac_delim='%!_!# '
15588for ac_last_try in false false false false false :; do
15589  . ./conf$$subs.sh ||
15590    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
15591
15592  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
15593  if test $ac_delim_n = $ac_delim_num; then
15594    break
15595  elif $ac_last_try; then
15596    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
15597  else
15598    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
15599  fi
15600done
15601rm -f conf$$subs.sh
15602
15603cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
15604cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
15605_ACEOF
15606sed -n '
15607h
15608s/^/S["/; s/!.*/"]=/
15609p
15610g
15611s/^[^!]*!//
15612:repl
15613t repl
15614s/'"$ac_delim"'$//
15615t delim
15616:nl
15617h
15618s/\(.\{148\}\)..*/\1/
15619t more1
15620s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
15621p
15622n
15623b repl
15624:more1
15625s/["\\]/\\&/g; s/^/"/; s/$/"\\/
15626p
15627g
15628s/.\{148\}//
15629t nl
15630:delim
15631h
15632s/\(.\{148\}\)..*/\1/
15633t more2
15634s/["\\]/\\&/g; s/^/"/; s/$/"/
15635p
15636b
15637:more2
15638s/["\\]/\\&/g; s/^/"/; s/$/"\\/
15639p
15640g
15641s/.\{148\}//
15642t delim
15643' <conf$$subs.awk | sed '
15644/^[^""]/{
15645  N
15646  s/\n//
15647}
15648' >>$CONFIG_STATUS || ac_write_fail=1
15649rm -f conf$$subs.awk
15650cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
15651_ACAWK
15652cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
15653  for (key in S) S_is_set[key] = 1
15654  FS = ""
15655
15656}
15657{
15658  line = $ 0
15659  nfields = split(line, field, "@")
15660  substed = 0
15661  len = length(field[1])
15662  for (i = 2; i < nfields; i++) {
15663    key = field[i]
15664    keylen = length(key)
15665    if (S_is_set[key]) {
15666      value = S[key]
15667      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
15668      len += length(value) + length(field[++i])
15669      substed = 1
15670    } else
15671      len += 1 + keylen
15672  }
15673
15674  print line
15675}
15676
15677_ACAWK
15678_ACEOF
15679cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
15680if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
15681  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
15682else
15683  cat
15684fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
15685  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
15686_ACEOF
15687
15688# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
15689# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
15690# trailing colons and then remove the whole line if VPATH becomes empty
15691# (actually we leave an empty line to preserve line numbers).
15692if test "x$srcdir" = x.; then
15693  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
15694h
15695s///
15696s/^/:/
15697s/[	 ]*$/:/
15698s/:\$(srcdir):/:/g
15699s/:\${srcdir}:/:/g
15700s/:@srcdir@:/:/g
15701s/^:*//
15702s/:*$//
15703x
15704s/\(=[	 ]*\).*/\1/
15705G
15706s/\n//
15707s/^[^=]*=[	 ]*$//
15708}'
15709fi
15710
15711cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
15712fi # test -n "$CONFIG_FILES"
15713
15714
15715eval set X "  :F $CONFIG_FILES      "
15716shift
15717for ac_tag
15718do
15719  case $ac_tag in
15720  :[FHLC]) ac_mode=$ac_tag; continue;;
15721  esac
15722  case $ac_mode$ac_tag in
15723  :[FHL]*:*);;
15724  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
15725  :[FH]-) ac_tag=-:-;;
15726  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
15727  esac
15728  ac_save_IFS=$IFS
15729  IFS=:
15730  set x $ac_tag
15731  IFS=$ac_save_IFS
15732  shift
15733  ac_file=$1
15734  shift
15735
15736  case $ac_mode in
15737  :L) ac_source=$1;;
15738  :[FH])
15739    ac_file_inputs=
15740    for ac_f
15741    do
15742      case $ac_f in
15743      -) ac_f="$ac_tmp/stdin";;
15744      *) # Look for the file first in the build tree, then in the source tree
15745	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
15746	 # because $ac_f cannot contain `:'.
15747	 test -f "$ac_f" ||
15748	   case $ac_f in
15749	   [\\/$]*) false;;
15750	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
15751	   esac ||
15752	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
15753      esac
15754      case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
15755      as_fn_append ac_file_inputs " '$ac_f'"
15756    done
15757
15758    # Let's still pretend it is `configure' which instantiates (i.e., don't
15759    # use $as_me), people would be surprised to read:
15760    #    /* config.h.  Generated by config.status.  */
15761    configure_input='Generated from '`
15762	  printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
15763	`' by configure.'
15764    if test x"$ac_file" != x-; then
15765      configure_input="$ac_file.  $configure_input"
15766      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
15767printf "%s\n" "$as_me: creating $ac_file" >&6;}
15768    fi
15769    # Neutralize special characters interpreted by sed in replacement strings.
15770    case $configure_input in #(
15771    *\&* | *\|* | *\\* )
15772       ac_sed_conf_input=`printf "%s\n" "$configure_input" |
15773       sed 's/[\\\\&|]/\\\\&/g'`;; #(
15774    *) ac_sed_conf_input=$configure_input;;
15775    esac
15776
15777    case $ac_tag in
15778    *:-:* | *:-) cat >"$ac_tmp/stdin" \
15779      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
15780    esac
15781    ;;
15782  esac
15783
15784  ac_dir=`$as_dirname -- "$ac_file" ||
15785$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15786	 X"$ac_file" : 'X\(//\)[^/]' \| \
15787	 X"$ac_file" : 'X\(//\)$' \| \
15788	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
15789printf "%s\n" X"$ac_file" |
15790    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
15791	    s//\1/
15792	    q
15793	  }
15794	  /^X\(\/\/\)[^/].*/{
15795	    s//\1/
15796	    q
15797	  }
15798	  /^X\(\/\/\)$/{
15799	    s//\1/
15800	    q
15801	  }
15802	  /^X\(\/\).*/{
15803	    s//\1/
15804	    q
15805	  }
15806	  s/.*/./; q'`
15807  as_dir="$ac_dir"; as_fn_mkdir_p
15808  ac_builddir=.
15809
15810case "$ac_dir" in
15811.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
15812*)
15813  ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
15814  # A ".." for each directory in $ac_dir_suffix.
15815  ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
15816  case $ac_top_builddir_sub in
15817  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
15818  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
15819  esac ;;
15820esac
15821ac_abs_top_builddir=$ac_pwd
15822ac_abs_builddir=$ac_pwd$ac_dir_suffix
15823# for backward compatibility:
15824ac_top_builddir=$ac_top_build_prefix
15825
15826case $srcdir in
15827  .)  # We are building in place.
15828    ac_srcdir=.
15829    ac_top_srcdir=$ac_top_builddir_sub
15830    ac_abs_top_srcdir=$ac_pwd ;;
15831  [\\/]* | ?:[\\/]* )  # Absolute name.
15832    ac_srcdir=$srcdir$ac_dir_suffix;
15833    ac_top_srcdir=$srcdir
15834    ac_abs_top_srcdir=$srcdir ;;
15835  *) # Relative name.
15836    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
15837    ac_top_srcdir=$ac_top_build_prefix$srcdir
15838    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
15839esac
15840ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
15841
15842
15843  case $ac_mode in
15844  :F)
15845  #
15846  # CONFIG_FILE
15847  #
15848
15849_ACEOF
15850
15851cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
15852# If the template does not know about datarootdir, expand it.
15853# FIXME: This hack should be removed a few years after 2.60.
15854ac_datarootdir_hack=; ac_datarootdir_seen=
15855ac_sed_dataroot='
15856/datarootdir/ {
15857  p
15858  q
15859}
15860/@datadir@/p
15861/@docdir@/p
15862/@infodir@/p
15863/@localedir@/p
15864/@mandir@/p'
15865case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
15866*datarootdir*) ac_datarootdir_seen=yes;;
15867*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
15868  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
15869printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
15870_ACEOF
15871cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
15872  ac_datarootdir_hack='
15873  s&@datadir@&$datadir&g
15874  s&@docdir@&$docdir&g
15875  s&@infodir@&$infodir&g
15876  s&@localedir@&$localedir&g
15877  s&@mandir@&$mandir&g
15878  s&\\\${datarootdir}&$datarootdir&g' ;;
15879esac
15880_ACEOF
15881
15882# Neutralize VPATH when `$srcdir' = `.'.
15883# Shell code in configure.ac might set extrasub.
15884# FIXME: do we really want to maintain this feature?
15885cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
15886ac_sed_extra="$ac_vpsub
15887$extrasub
15888_ACEOF
15889cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
15890:t
15891/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
15892s|@configure_input@|$ac_sed_conf_input|;t t
15893s&@top_builddir@&$ac_top_builddir_sub&;t t
15894s&@top_build_prefix@&$ac_top_build_prefix&;t t
15895s&@srcdir@&$ac_srcdir&;t t
15896s&@abs_srcdir@&$ac_abs_srcdir&;t t
15897s&@top_srcdir@&$ac_top_srcdir&;t t
15898s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
15899s&@builddir@&$ac_builddir&;t t
15900s&@abs_builddir@&$ac_abs_builddir&;t t
15901s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
15902$ac_datarootdir_hack
15903"
15904eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
15905  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
15906
15907test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
15908  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
15909  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
15910      "$ac_tmp/out"`; test -z "$ac_out"; } &&
15911  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
15912which seems to be undefined.  Please make sure it is defined" >&5
15913printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
15914which seems to be undefined.  Please make sure it is defined" >&2;}
15915
15916  rm -f "$ac_tmp/stdin"
15917  case $ac_file in
15918  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
15919  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
15920  esac \
15921  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
15922 ;;
15923
15924
15925
15926  esac
15927
15928done # for ac_tag
15929
15930
15931as_fn_exit 0
15932_ACEOF
15933ac_clean_files=$ac_clean_files_save
15934
15935test $ac_write_fail = 0 ||
15936  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
15937
15938
15939# configure is writing to config.log, and then calls config.status.
15940# config.status does its own redirection, appending to config.log.
15941# Unfortunately, on DOS this fails, as config.log is still kept open
15942# by configure, so config.status won't be able to write to it; its
15943# output is simply discarded.  So we exec the FD to /dev/null,
15944# effectively closing config.log, so it can be properly (re)opened and
15945# appended to by config.status.  When coming back to configure, we
15946# need to make the FD available again.
15947if test "$no_create" != yes; then
15948  ac_cs_success=:
15949  ac_config_status_args=
15950  test "$silent" = yes &&
15951    ac_config_status_args="$ac_config_status_args --quiet"
15952  exec 5>/dev/null
15953  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
15954  exec 5>>config.log
15955  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
15956  # would make configure fail if this is the last instruction.
15957  $ac_cs_success || as_fn_exit 1
15958fi
15959if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
15960  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
15961printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
15962fi
15963
15964
15965