A better solution to making the default build optimization -O3
authorSam Lantinga <slouken@libsdl.org>
Sun, 11 Oct 2009 10:38:38 +0000
changeset 3382294fb5e6f301
parent 3381 c4d6458121db
child 3383 90935231e9b6
A better solution to making the default build optimization -O3
Cygwin32 autoconf complains about c.m4 ... of course. :)
acinclude/c.m4
configure.in
     1.1 --- a/acinclude/c.m4	Sun Oct 11 10:30:47 2009 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,1958 +0,0 @@
     1.4 -# This file is part of Autoconf.			-*- Autoconf -*-
     1.5 -# Programming languages support.
     1.6 -# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free
     1.7 -# Software Foundation, Inc.
     1.8 -#
     1.9 -# This program is free software: you can redistribute it and/or modify
    1.10 -# it under the terms of the GNU General Public License as published by
    1.11 -# the Free Software Foundation; either version 2, or (at your option)
    1.12 -# any later version.
    1.13 -#
    1.14 -# This program is distributed in the hope that it will be useful,
    1.15 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.16 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.17 -# GNU General Public License for more details.
    1.18 -#
    1.19 -# You should have received a copy of the GNU General Public License
    1.20 -# along with this program; if not, write to the Free Software
    1.21 -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    1.22 -# 02110-1301, USA.
    1.23 -#
    1.24 -# As a special exception, the Free Software Foundation gives unlimited
    1.25 -# permission to copy, distribute and modify the configure scripts that
    1.26 -# are the output of Autoconf.  You need not follow the terms of the GNU
    1.27 -# General Public License when using or distributing such scripts, even
    1.28 -# though portions of the text of Autoconf appear in them.  The GNU
    1.29 -# General Public License (GPL) does govern all other use of the material
    1.30 -# that constitutes the Autoconf program.
    1.31 -#
    1.32 -# Certain portions of the Autoconf source text are designed to be copied
    1.33 -# (in certain cases, depending on the input) into the output of
    1.34 -# Autoconf.  We call these the "data" portions.  The rest of the Autoconf
    1.35 -# source text consists of comments plus executable code that decides which
    1.36 -# of the data portions to output in any given case.  We call these
    1.37 -# comments and executable code the "non-data" portions.  Autoconf never
    1.38 -# copies any of the non-data portions into its output.
    1.39 -#
    1.40 -# This special exception to the GPL applies to versions of Autoconf
    1.41 -# released by the Free Software Foundation.  When you make and
    1.42 -# distribute a modified version of Autoconf, you may extend this special
    1.43 -# exception to the GPL to apply to your modified version as well, *unless*
    1.44 -# your modified version has the potential to copy into its output some
    1.45 -# of the text that was the non-data portion of the version that you started
    1.46 -# with.  (In other words, unless your change moves or copies text from
    1.47 -# the non-data portions to the data portions.)  If your modification has
    1.48 -# such potential, you must delete any notice of this special exception
    1.49 -# to the GPL from your modified version.
    1.50 -#
    1.51 -# Written by David MacKenzie, with help from
    1.52 -# Akim Demaille, Paul Eggert,
    1.53 -# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
    1.54 -# Roland McGrath, Noah Friedman, david d zuhn, and many others.
    1.55 -
    1.56 -
    1.57 -# Table of Contents:
    1.58 -#
    1.59 -# 1. Language selection
    1.60 -#    and routines to produce programs in a given language.
    1.61 -#      1a. C   1b. C++   1c. Objective C
    1.62 -#
    1.63 -# 2. Producing programs in a given language.
    1.64 -#      2a. C   2b. C++   2c. Objective C
    1.65 -#
    1.66 -# 3. Looking for a compiler
    1.67 -#    And possibly the associated preprocessor.
    1.68 -#      3a. C   3b. C++   3c. Objective C
    1.69 -#
    1.70 -# 4. Compilers' characteristics.
    1.71 -#      4a. C
    1.72 -
    1.73 -
    1.74 -
    1.75 -## ----------------------- ##
    1.76 -## 1. Language selection.  ##
    1.77 -## ----------------------- ##
    1.78 -
    1.79 -# -------------------- #
    1.80 -# 1a. The C language.  #
    1.81 -# -------------------- #
    1.82 -
    1.83 -
    1.84 -# AC_LANG(C)
    1.85 -# ----------
    1.86 -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
    1.87 -m4_define([AC_LANG(C)],
    1.88 -[ac_ext=c
    1.89 -ac_cpp='$CPP $CPPFLAGS'
    1.90 -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
    1.91 -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
    1.92 -ac_compiler_gnu=$ac_cv_c_compiler_gnu
    1.93 -])
    1.94 -
    1.95 -
    1.96 -# AC_LANG_C
    1.97 -# ---------
    1.98 -AU_DEFUN([AC_LANG_C], [AC_LANG(C)])
    1.99 -
   1.100 -
   1.101 -# _AC_LANG_ABBREV(C)
   1.102 -# ------------------
   1.103 -m4_define([_AC_LANG_ABBREV(C)], [c])
   1.104 -
   1.105 -
   1.106 -# _AC_LANG_PREFIX(C)
   1.107 -# ------------------
   1.108 -m4_define([_AC_LANG_PREFIX(C)], [C])
   1.109 -
   1.110 -
   1.111 -
   1.112 -# ---------------------- #
   1.113 -# 1b. The C++ language.  #
   1.114 -# ---------------------- #
   1.115 -
   1.116 -
   1.117 -# AC_LANG(C++)
   1.118 -# ------------
   1.119 -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
   1.120 -m4_define([AC_LANG(C++)],
   1.121 -[ac_ext=cpp
   1.122 -ac_cpp='$CXXCPP $CPPFLAGS'
   1.123 -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
   1.124 -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
   1.125 -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
   1.126 -])
   1.127 -
   1.128 -
   1.129 -# AC_LANG_CPLUSPLUS
   1.130 -# -----------------
   1.131 -AU_DEFUN([AC_LANG_CPLUSPLUS], [AC_LANG(C++)])
   1.132 -
   1.133 -
   1.134 -# _AC_LANG_ABBREV(C++)
   1.135 -# --------------------
   1.136 -m4_define([_AC_LANG_ABBREV(C++)], [cxx])
   1.137 -
   1.138 -
   1.139 -# _AC_LANG_PREFIX(C++)
   1.140 -# --------------------
   1.141 -m4_define([_AC_LANG_PREFIX(C++)], [CXX])
   1.142 -
   1.143 -
   1.144 -
   1.145 -# ------------------------------ #
   1.146 -# 1c. The Objective C language.  #
   1.147 -# ------------------------------ #
   1.148 -
   1.149 -
   1.150 -# AC_LANG(Objective C)
   1.151 -# --------------------
   1.152 -m4_define([AC_LANG(Objective C)],
   1.153 -[ac_ext=m
   1.154 -ac_cpp='$OBJCPP $CPPFLAGS'
   1.155 -ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
   1.156 -ac_link='$OBJC -o conftest$ac_exeext $OBJCFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
   1.157 -ac_compiler_gnu=$ac_cv_objc_compiler_gnu
   1.158 -])
   1.159 -
   1.160 -
   1.161 -# AC_LANG_OBJC
   1.162 -# ------------
   1.163 -AU_DEFUN([AC_LANG_OBJC], [AC_LANG(Objective C)])
   1.164 -
   1.165 -
   1.166 -# _AC_LANG_ABBREV(Objective C)
   1.167 -# ----------------------------
   1.168 -m4_define([_AC_LANG_ABBREV(Objective C)], [objc])
   1.169 -
   1.170 -
   1.171 -# _AC_LANG_PREFIX(Objective C)
   1.172 -# ----------------------------
   1.173 -m4_define([_AC_LANG_PREFIX(Objective C)], [OBJC])
   1.174 -
   1.175 -
   1.176 -
   1.177 -## ----------------------- ##
   1.178 -## 2. Producing programs.  ##
   1.179 -## ----------------------- ##
   1.180 -
   1.181 -# --------------- #
   1.182 -# 2a. C sources.  #
   1.183 -# --------------- #
   1.184 -
   1.185 -
   1.186 -# AC_LANG_SOURCE(C)(BODY)
   1.187 -# -----------------------
   1.188 -# We can't use '#line $LINENO "configure"' here, since
   1.189 -# Sun c89 (Sun WorkShop 6 update 2 C 5.3 Patch 111679-08 2002/05/09)
   1.190 -# rejects $LINENO greater than 32767, and some configure scripts
   1.191 -# are longer than 32767 lines.
   1.192 -m4_define([AC_LANG_SOURCE(C)],
   1.193 -[/* confdefs.h.  */
   1.194 -_ACEOF
   1.195 -cat confdefs.h >>conftest.$ac_ext
   1.196 -cat >>conftest.$ac_ext <<_ACEOF
   1.197 -/* end confdefs.h.  */
   1.198 -$1])
   1.199 -
   1.200 -
   1.201 -# AC_LANG_PROGRAM(C)([PROLOGUE], [BODY])
   1.202 -# --------------------------------------
   1.203 -m4_define([AC_LANG_PROGRAM(C)],
   1.204 -[$1
   1.205 -m4_ifdef([_AC_LANG_PROGRAM_C_F77_HOOKS], [_AC_LANG_PROGRAM_C_F77_HOOKS])[]dnl
   1.206 -m4_ifdef([_AC_LANG_PROGRAM_C_FC_HOOKS], [_AC_LANG_PROGRAM_C_FC_HOOKS])[]dnl
   1.207 -int
   1.208 -main ()
   1.209 -{
   1.210 -dnl Do *not* indent the following line: there may be CPP directives.
   1.211 -dnl Don't move the `;' right after for the same reason.
   1.212 -$2
   1.213 -  ;
   1.214 -  return 0;
   1.215 -}])
   1.216 -
   1.217 -
   1.218 -# AC_LANG_CALL(C)(PROLOGUE, FUNCTION)
   1.219 -# -----------------------------------
   1.220 -# Avoid conflicting decl of main.
   1.221 -m4_define([AC_LANG_CALL(C)],
   1.222 -[AC_LANG_PROGRAM([$1
   1.223 -m4_if([$2], [main], ,
   1.224 -[/* Override any GCC internal prototype to avoid an error.
   1.225 -   Use char because int might match the return type of a GCC
   1.226 -   builtin and then its argument prototype would still apply.  */
   1.227 -#ifdef __cplusplus
   1.228 -extern "C"
   1.229 -#endif
   1.230 -char $2 ();])], [return $2 ();])])
   1.231 -
   1.232 -
   1.233 -# AC_LANG_FUNC_LINK_TRY(C)(FUNCTION)
   1.234 -# ----------------------------------
   1.235 -# Don't include <ctype.h> because on OSF/1 3.0 it includes
   1.236 -# <sys/types.h> which includes <sys/select.h> which contains a
   1.237 -# prototype for select.  Similarly for bzero.
   1.238 -#
   1.239 -# This test used to merely assign f=$1 in main(), but that was
   1.240 -# optimized away by HP unbundled cc A.05.36 for ia64 under +O3,
   1.241 -# presumably on the basis that there's no need to do that store if the
   1.242 -# program is about to exit.  Conversely, the AIX linker optimizes an
   1.243 -# unused external declaration that initializes f=$1.  So this test
   1.244 -# program has both an external initialization of f, and a use of f in
   1.245 -# main that affects the exit status.
   1.246 -#
   1.247 -m4_define([AC_LANG_FUNC_LINK_TRY(C)],
   1.248 -[AC_LANG_PROGRAM(
   1.249 -[/* Define $1 to an innocuous variant, in case <limits.h> declares $1.
   1.250 -   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
   1.251 -#define $1 innocuous_$1
   1.252 -
   1.253 -/* System header to define __stub macros and hopefully few prototypes,
   1.254 -    which can conflict with char $1 (); below.
   1.255 -    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
   1.256 -    <limits.h> exists even on freestanding compilers.  */
   1.257 -
   1.258 -#ifdef __STDC__
   1.259 -# include <limits.h>
   1.260 -#else
   1.261 -# include <assert.h>
   1.262 -#endif
   1.263 -
   1.264 -#undef $1
   1.265 -
   1.266 -/* Override any GCC internal prototype to avoid an error.
   1.267 -   Use char because int might match the return type of a GCC
   1.268 -   builtin and then its argument prototype would still apply.  */
   1.269 -#ifdef __cplusplus
   1.270 -extern "C"
   1.271 -#endif
   1.272 -char $1 ();
   1.273 -/* The GNU C library defines this for functions which it implements
   1.274 -    to always fail with ENOSYS.  Some functions are actually named
   1.275 -    something starting with __ and the normal name is an alias.  */
   1.276 -#if defined __stub_$1 || defined __stub___$1
   1.277 -choke me
   1.278 -#endif
   1.279 -], [return $1 ();])])
   1.280 -
   1.281 -
   1.282 -# AC_LANG_BOOL_COMPILE_TRY(C)(PROLOGUE, EXPRESSION)
   1.283 -# -------------------------------------------------
   1.284 -# Return a program that is valid if EXPRESSION is nonzero.
   1.285 -# EXPRESSION must be an integer constant expression.
   1.286 -# Be sure to use this array to avoid `unused' warnings, which are even
   1.287 -# errors with `-W error'.
   1.288 -m4_define([AC_LANG_BOOL_COMPILE_TRY(C)],
   1.289 -[AC_LANG_PROGRAM([$1], [static int test_array @<:@1 - 2 * !($2)@:>@;
   1.290 -test_array @<:@0@:>@ = 0
   1.291 -])])
   1.292 -
   1.293 -
   1.294 -# AC_LANG_INT_SAVE(C)(PROLOGUE, EXPRESSION)
   1.295 -# -----------------------------------------
   1.296 -# We need `stdio.h' to open a `FILE' and `stdlib.h' for `exit'.
   1.297 -# But we include them only after the EXPRESSION has been evaluated.
   1.298 -m4_define([AC_LANG_INT_SAVE(C)],
   1.299 -[AC_LANG_PROGRAM([$1
   1.300 -static long int longval () { return $2; }
   1.301 -static unsigned long int ulongval () { return $2; }
   1.302 -@%:@include <stdio.h>
   1.303 -@%:@include <stdlib.h>],
   1.304 -[
   1.305 -  FILE *f = fopen ("conftest.val", "w");
   1.306 -  if (! f)
   1.307 -    return 1;
   1.308 -  if (($2) < 0)
   1.309 -    {
   1.310 -      long int i = longval ();
   1.311 -      if (i != ($2))
   1.312 -	return 1;
   1.313 -      fprintf (f, "%ld", i);
   1.314 -    }
   1.315 -  else
   1.316 -    {
   1.317 -      unsigned long int i = ulongval ();
   1.318 -      if (i != ($2))
   1.319 -	return 1;
   1.320 -      fprintf (f, "%lu", i);
   1.321 -    }
   1.322 -  /* Do not output a trailing newline, as this causes \r\n confusion
   1.323 -     on some platforms.  */
   1.324 -  return ferror (f) || fclose (f) != 0;
   1.325 -])])
   1.326 -
   1.327 -
   1.328 -
   1.329 -# ----------------- #
   1.330 -# 2b. C++ sources.  #
   1.331 -# ----------------- #
   1.332 -
   1.333 -
   1.334 -# AC_LANG_SOURCE(C++)(BODY)
   1.335 -# -------------------------
   1.336 -m4_copy([AC_LANG_SOURCE(C)], [AC_LANG_SOURCE(C++)])
   1.337 -
   1.338 -
   1.339 -# AC_LANG_PROGRAM(C++)([PROLOGUE], [BODY])
   1.340 -# ----------------------------------------
   1.341 -m4_copy([AC_LANG_PROGRAM(C)], [AC_LANG_PROGRAM(C++)])
   1.342 -
   1.343 -
   1.344 -# AC_LANG_CALL(C++)(PROLOGUE, FUNCTION)
   1.345 -# -------------------------------------
   1.346 -m4_copy([AC_LANG_CALL(C)], [AC_LANG_CALL(C++)])
   1.347 -
   1.348 -
   1.349 -# AC_LANG_FUNC_LINK_TRY(C++)(FUNCTION)
   1.350 -# ------------------------------------
   1.351 -m4_copy([AC_LANG_FUNC_LINK_TRY(C)], [AC_LANG_FUNC_LINK_TRY(C++)])
   1.352 -
   1.353 -
   1.354 -# AC_LANG_BOOL_COMPILE_TRY(C++)(PROLOGUE, EXPRESSION)
   1.355 -# ---------------------------------------------------
   1.356 -m4_copy([AC_LANG_BOOL_COMPILE_TRY(C)], [AC_LANG_BOOL_COMPILE_TRY(C++)])
   1.357 -
   1.358 -
   1.359 -# AC_LANG_INT_SAVE(C++)(PROLOGUE, EXPRESSION)
   1.360 -# -------------------------------------------
   1.361 -m4_copy([AC_LANG_INT_SAVE(C)], [AC_LANG_INT_SAVE(C++)])
   1.362 -
   1.363 -
   1.364 -
   1.365 -# ------------------------- #
   1.366 -# 2c. Objective C sources.  #
   1.367 -# ------------------------- #
   1.368 -
   1.369 -
   1.370 -# AC_LANG_SOURCE(Objective C)(BODY)
   1.371 -# ---------------------------------
   1.372 -m4_copy([AC_LANG_SOURCE(C)], [AC_LANG_SOURCE(Objective C)])
   1.373 -
   1.374 -
   1.375 -# AC_LANG_PROGRAM(Objective C)([PROLOGUE], [BODY])
   1.376 -# ------------------------------------------------
   1.377 -m4_copy([AC_LANG_PROGRAM(C)], [AC_LANG_PROGRAM(Objective C)])
   1.378 -
   1.379 -
   1.380 -# AC_LANG_CALL(Objective C)(PROLOGUE, FUNCTION)
   1.381 -# ---------------------------------------------
   1.382 -m4_copy([AC_LANG_CALL(C)], [AC_LANG_CALL(Objective C)])
   1.383 -
   1.384 -
   1.385 -# AC_LANG_FUNC_LINK_TRY(Objective C)(FUNCTION)
   1.386 -# --------------------------------------------
   1.387 -m4_copy([AC_LANG_FUNC_LINK_TRY(C)], [AC_LANG_FUNC_LINK_TRY(Objective C)])
   1.388 -
   1.389 -
   1.390 -# AC_LANG_BOOL_COMPILE_TRY(Objective C)(PROLOGUE, EXPRESSION)
   1.391 -# -----------------------------------------------------------
   1.392 -m4_copy([AC_LANG_BOOL_COMPILE_TRY(C)], [AC_LANG_BOOL_COMPILE_TRY(Objective C)])
   1.393 -
   1.394 -
   1.395 -# AC_LANG_INT_SAVE(Objective C)(PROLOGUE, EXPRESSION)
   1.396 -# ---------------------------------------------------
   1.397 -m4_copy([AC_LANG_INT_SAVE(C)], [AC_LANG_INT_SAVE(Objective C)])
   1.398 -
   1.399 -
   1.400 -
   1.401 -## -------------------------------------------- ##
   1.402 -## 3. Looking for Compilers and Preprocessors.  ##
   1.403 -## -------------------------------------------- ##
   1.404 -
   1.405 -# -------------------- #
   1.406 -# 3a. The C compiler.  #
   1.407 -# -------------------- #
   1.408 -
   1.409 -
   1.410 -# _AC_ARG_VAR_CPPFLAGS
   1.411 -# --------------------
   1.412 -# Document and register CPPFLAGS, which is used by
   1.413 -# AC_PROG_{CC, CPP, CXX, CXXCPP, OBJC, OBJCPP}.
   1.414 -AC_DEFUN([_AC_ARG_VAR_CPPFLAGS],
   1.415 -[AC_ARG_VAR([CPPFLAGS],
   1.416 -	    [C/C++/Objective C preprocessor flags, e.g. -I<include dir>
   1.417 -	     if you have headers in a nonstandard directory <include dir>])])
   1.418 -
   1.419 -
   1.420 -# _AC_ARG_VAR_LDFLAGS
   1.421 -# -------------------
   1.422 -# Document and register LDFLAGS, which is used by
   1.423 -# AC_PROG_{CC, CXX, F77, FC, OBJC}.
   1.424 -AC_DEFUN([_AC_ARG_VAR_LDFLAGS],
   1.425 -[AC_ARG_VAR([LDFLAGS],
   1.426 -	    [linker flags, e.g. -L<lib dir> if you have libraries in a
   1.427 -	     nonstandard directory <lib dir>])])
   1.428 -
   1.429 -
   1.430 -# _AC_ARG_VAR_LIBS
   1.431 -# ----------------
   1.432 -# Document and register LIBS, which is used by
   1.433 -# AC_PROG_{CC, CXX, F77, FC, OBJS}.
   1.434 -AC_DEFUN([_AC_ARG_VAR_LIBS],
   1.435 -[AC_ARG_VAR([LIBS],
   1.436 -	    [libraries to pass to the linker, e.g. -l<library>])])
   1.437 -
   1.438 -
   1.439 -# AC_LANG_PREPROC(C)
   1.440 -# -------------------
   1.441 -# Find the C preprocessor.  Must be AC_DEFUN'd to be AC_REQUIRE'able.
   1.442 -AC_DEFUN([AC_LANG_PREPROC(C)],
   1.443 -[AC_REQUIRE([AC_PROG_CPP])])
   1.444 -
   1.445 -
   1.446 -# _AC_PROG_PREPROC_WORKS_IFELSE(IF-WORKS, IF-NOT)
   1.447 -# -----------------------------------------------
   1.448 -# Check if $ac_cpp is a working preprocessor that can flag absent
   1.449 -# includes either by the exit status or by warnings.
   1.450 -# This macro is for all languages, not only C.
   1.451 -AC_DEFUN([_AC_PROG_PREPROC_WORKS_IFELSE],
   1.452 -[ac_preproc_ok=false
   1.453 -for ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag in '' yes
   1.454 -do
   1.455 -  # Use a header file that comes with gcc, so configuring glibc
   1.456 -  # with a fresh cross-compiler works.
   1.457 -  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
   1.458 -  # <limits.h> exists even on freestanding compilers.
   1.459 -  # On the NeXT, cc -E runs the code through the compiler's parser,
   1.460 -  # not just through cpp. "Syntax error" is here to catch this case.
   1.461 -  _AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@ifdef __STDC__
   1.462 -@%:@ include <limits.h>
   1.463 -@%:@else
   1.464 -@%:@ include <assert.h>
   1.465 -@%:@endif
   1.466 -		     Syntax error]])],
   1.467 -		     [],
   1.468 -		     [# Broken: fails on valid input.
   1.469 -continue])
   1.470 -
   1.471 -  # OK, works on sane cases.  Now check whether nonexistent headers
   1.472 -  # can be detected and how.
   1.473 -  _AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@include <ac_nonexistent.h>]])],
   1.474 -		     [# Broken: success on invalid input.
   1.475 -continue],
   1.476 -		     [# Passes both tests.
   1.477 -ac_preproc_ok=:
   1.478 -break])
   1.479 -
   1.480 -done
   1.481 -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
   1.482 -rm -f conftest.err conftest.$ac_ext
   1.483 -AS_IF([$ac_preproc_ok], [$1], [$2])])# _AC_PROG_PREPROC_WORKS_IFELSE
   1.484 -
   1.485 -
   1.486 -# AC_PROG_CPP
   1.487 -# -----------
   1.488 -# Find a working C preprocessor.
   1.489 -# We shouldn't have to require AC_PROG_CC, but this is due to the concurrency
   1.490 -# between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CC.
   1.491 -AN_MAKEVAR([CPP], [AC_PROG_CPP])
   1.492 -AN_PROGRAM([cpp], [AC_PROG_CPP])
   1.493 -AC_DEFUN([AC_PROG_CPP],
   1.494 -[AC_REQUIRE([AC_PROG_CC])dnl
   1.495 -AC_ARG_VAR([CPP],      [C preprocessor])dnl
   1.496 -_AC_ARG_VAR_CPPFLAGS()dnl
   1.497 -AC_LANG_PUSH(C)dnl
   1.498 -AC_MSG_CHECKING([how to run the C preprocessor])
   1.499 -# On Suns, sometimes $CPP names a directory.
   1.500 -if test -n "$CPP" && test -d "$CPP"; then
   1.501 -  CPP=
   1.502 -fi
   1.503 -if test -z "$CPP"; then
   1.504 -  AC_CACHE_VAL([ac_cv_prog_CPP],
   1.505 -  [dnl
   1.506 -    # Double quotes because CPP needs to be expanded
   1.507 -    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
   1.508 -    do
   1.509 -      _AC_PROG_PREPROC_WORKS_IFELSE([break])
   1.510 -    done
   1.511 -    ac_cv_prog_CPP=$CPP
   1.512 -  ])dnl
   1.513 -  CPP=$ac_cv_prog_CPP
   1.514 -else
   1.515 -  ac_cv_prog_CPP=$CPP
   1.516 -fi
   1.517 -AC_MSG_RESULT([$CPP])
   1.518 -_AC_PROG_PREPROC_WORKS_IFELSE([],
   1.519 -		[AC_MSG_FAILURE([C preprocessor "$CPP" fails sanity check])])
   1.520 -AC_SUBST(CPP)dnl
   1.521 -AC_LANG_POP(C)dnl
   1.522 -])# AC_PROG_CPP
   1.523 -
   1.524 -# AC_PROG_CPP_WERROR
   1.525 -# ------------------
   1.526 -# Treat warnings from the preprocessor as errors.
   1.527 -AC_DEFUN([AC_PROG_CPP_WERROR],
   1.528 -[AC_REQUIRE([AC_PROG_CPP])dnl
   1.529 -ac_c_preproc_warn_flag=yes])# AC_PROG_CPP_WERROR
   1.530 -
   1.531 -# AC_LANG_COMPILER(C)
   1.532 -# -------------------
   1.533 -# Find the C compiler.  Must be AC_DEFUN'd to be AC_REQUIRE'able.
   1.534 -AC_DEFUN([AC_LANG_COMPILER(C)],
   1.535 -[AC_REQUIRE([AC_PROG_CC])])
   1.536 -
   1.537 -
   1.538 -# ac_cv_prog_gcc
   1.539 -# --------------
   1.540 -# We used to name the cache variable this way.
   1.541 -AU_DEFUN([ac_cv_prog_gcc],
   1.542 -[ac_cv_c_compiler_gnu])
   1.543 -
   1.544 -
   1.545 -# AC_PROG_CC([COMPILER ...])
   1.546 -# --------------------------
   1.547 -# COMPILER ... is a space separated list of C compilers to search for.
   1.548 -# This just gives the user an opportunity to specify an alternative
   1.549 -# search list for the C compiler.
   1.550 -AN_MAKEVAR([CC],  [AC_PROG_CC])
   1.551 -AN_PROGRAM([cc],  [AC_PROG_CC])
   1.552 -AN_PROGRAM([gcc], [AC_PROG_CC])
   1.553 -AC_DEFUN([AC_PROG_CC],
   1.554 -[AC_LANG_PUSH(C)dnl
   1.555 -AC_ARG_VAR([CC],     [C compiler command])dnl
   1.556 -AC_ARG_VAR([CFLAGS], [C compiler flags])dnl
   1.557 -_AC_ARG_VAR_LDFLAGS()dnl
   1.558 -_AC_ARG_VAR_LIBS()dnl
   1.559 -_AC_ARG_VAR_CPPFLAGS()dnl
   1.560 -m4_ifval([$1],
   1.561 -      [AC_CHECK_TOOLS(CC, [$1])],
   1.562 -[AC_CHECK_TOOL(CC, gcc)
   1.563 -if test -z "$CC"; then
   1.564 -  dnl Here we want:
   1.565 -  dnl	AC_CHECK_TOOL(CC, cc)
   1.566 -  dnl but without the check for a tool without the prefix.
   1.567 -  dnl Until the check is removed from there, copy the code:
   1.568 -  if test -n "$ac_tool_prefix"; then
   1.569 -    AC_CHECK_PROG(CC, [${ac_tool_prefix}cc], [${ac_tool_prefix}cc])
   1.570 -  fi
   1.571 -fi
   1.572 -if test -z "$CC"; then
   1.573 -  AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
   1.574 -fi
   1.575 -if test -z "$CC"; then
   1.576 -  AC_CHECK_TOOLS(CC, cl.exe)
   1.577 -fi
   1.578 -])
   1.579 -
   1.580 -test -z "$CC" && AC_MSG_FAILURE([no acceptable C compiler found in \$PATH])
   1.581 -
   1.582 -# Provide some information about the compiler.
   1.583 -_AS_ECHO_LOG([checking for _AC_LANG compiler version])
   1.584 -set X $ac_compile
   1.585 -ac_compiler=$[2]
   1.586 -_AC_DO([$ac_compiler --version >&AS_MESSAGE_LOG_FD])
   1.587 -_AC_DO([$ac_compiler -v >&AS_MESSAGE_LOG_FD])
   1.588 -_AC_DO([$ac_compiler -V >&AS_MESSAGE_LOG_FD])
   1.589 -
   1.590 -m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
   1.591 -m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
   1.592 -_AC_LANG_COMPILER_GNU
   1.593 -if test $ac_compiler_gnu = yes; then
   1.594 -  GCC=yes
   1.595 -else
   1.596 -  GCC=
   1.597 -fi
   1.598 -_AC_PROG_CC_G
   1.599 -_AC_PROG_CC_C89
   1.600 -AC_LANG_POP(C)dnl
   1.601 -])# AC_PROG_CC
   1.602 -
   1.603 -
   1.604 -# _AC_PROG_CC_G
   1.605 -# -------------
   1.606 -# Check whether -g works, even if CFLAGS is set, in case the package
   1.607 -# plays around with CFLAGS (such as to build both debugging and normal
   1.608 -# versions of a library), tasteless as that idea is.
   1.609 -# Don't consider -g to work if it generates warnings when plain compiles don't.
   1.610 -m4_define([_AC_PROG_CC_G],
   1.611 -[ac_test_CFLAGS=${CFLAGS+set}
   1.612 -ac_save_CFLAGS=$CFLAGS
   1.613 -AC_CACHE_CHECK(whether $CC accepts -g, ac_cv_prog_cc_g,
   1.614 -  [ac_save_c_werror_flag=$ac_c_werror_flag
   1.615 -   ac_c_werror_flag=yes
   1.616 -   ac_cv_prog_cc_g=no
   1.617 -   CFLAGS="-g"
   1.618 -   _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
   1.619 -     [ac_cv_prog_cc_g=yes],
   1.620 -     [CFLAGS=""
   1.621 -      _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
   1.622 -	[],
   1.623 -	[ac_c_werror_flag=$ac_save_c_werror_flag
   1.624 -	 CFLAGS="-g"
   1.625 -	 _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
   1.626 -	   [ac_cv_prog_cc_g=yes])])])
   1.627 -   ac_c_werror_flag=$ac_save_c_werror_flag])
   1.628 -if test "$ac_test_CFLAGS" = set; then
   1.629 -  CFLAGS=$ac_save_CFLAGS
   1.630 -elif test $ac_cv_prog_cc_g = yes; then
   1.631 -  if test "$GCC" = yes; then
   1.632 -    CFLAGS="-g -O3"
   1.633 -  else
   1.634 -    CFLAGS="-g"
   1.635 -  fi
   1.636 -else
   1.637 -  if test "$GCC" = yes; then
   1.638 -    CFLAGS="-O3"
   1.639 -  else
   1.640 -    CFLAGS=
   1.641 -  fi
   1.642 -fi[]dnl
   1.643 -])# _AC_PROG_CC_G
   1.644 -
   1.645 -
   1.646 -# AC_PROG_GCC_TRADITIONAL
   1.647 -# -----------------------
   1.648 -AC_DEFUN([AC_PROG_GCC_TRADITIONAL],
   1.649 -[AC_REQUIRE([AC_PROG_CC])dnl
   1.650 -if test $ac_cv_c_compiler_gnu = yes; then
   1.651 -    AC_CACHE_CHECK(whether $CC needs -traditional,
   1.652 -      ac_cv_prog_gcc_traditional,
   1.653 -[  ac_pattern="Autoconf.*'x'"
   1.654 -  AC_EGREP_CPP($ac_pattern, [#include <sgtty.h>
   1.655 -Autoconf TIOCGETP],
   1.656 -  ac_cv_prog_gcc_traditional=yes, ac_cv_prog_gcc_traditional=no)
   1.657 -
   1.658 -  if test $ac_cv_prog_gcc_traditional = no; then
   1.659 -    AC_EGREP_CPP($ac_pattern, [#include <termio.h>
   1.660 -Autoconf TCGETA],
   1.661 -    ac_cv_prog_gcc_traditional=yes)
   1.662 -  fi])
   1.663 -  if test $ac_cv_prog_gcc_traditional = yes; then
   1.664 -    CC="$CC -traditional"
   1.665 -  fi
   1.666 -fi
   1.667 -])# AC_PROG_GCC_TRADITIONAL
   1.668 -
   1.669 -
   1.670 -# AC_PROG_CC_C_O
   1.671 -# --------------
   1.672 -AC_DEFUN([AC_PROG_CC_C_O],
   1.673 -[AC_REQUIRE([AC_PROG_CC])dnl
   1.674 -if test "x$CC" != xcc; then
   1.675 -  AC_MSG_CHECKING([whether $CC and cc understand -c and -o together])
   1.676 -else
   1.677 -  AC_MSG_CHECKING([whether cc understands -c and -o together])
   1.678 -fi
   1.679 -set dummy $CC; ac_cc=`AS_ECHO(["$[2]"]) |
   1.680 -		      sed 's/[[^a-zA-Z0-9_]]/_/g;s/^[[0-9]]/_/'`
   1.681 -AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o,
   1.682 -[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
   1.683 -# Make sure it works both with $CC and with simple cc.
   1.684 -# We do the test twice because some compilers refuse to overwrite an
   1.685 -# existing .o file with -o, though they will create one.
   1.686 -ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&AS_MESSAGE_LOG_FD'
   1.687 -rm -f conftest2.*
   1.688 -if _AC_DO_VAR(ac_try) &&
   1.689 -   test -f conftest2.$ac_objext && _AC_DO_VAR(ac_try);
   1.690 -then
   1.691 -  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
   1.692 -  if test "x$CC" != xcc; then
   1.693 -    # Test first that cc exists at all.
   1.694 -    if _AC_DO_TOKENS(cc -c conftest.$ac_ext >&AS_MESSAGE_LOG_FD); then
   1.695 -      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&AS_MESSAGE_LOG_FD'
   1.696 -      rm -f conftest2.*
   1.697 -      if _AC_DO_VAR(ac_try) &&
   1.698 -	 test -f conftest2.$ac_objext && _AC_DO_VAR(ac_try);
   1.699 -      then
   1.700 -	# cc works too.
   1.701 -	:
   1.702 -      else
   1.703 -	# cc exists but doesn't like -o.
   1.704 -	eval ac_cv_prog_cc_${ac_cc}_c_o=no
   1.705 -      fi
   1.706 -    fi
   1.707 -  fi
   1.708 -else
   1.709 -  eval ac_cv_prog_cc_${ac_cc}_c_o=no
   1.710 -fi
   1.711 -rm -f core conftest*
   1.712 -])dnl
   1.713 -if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
   1.714 -  AC_MSG_RESULT([yes])
   1.715 -else
   1.716 -  AC_MSG_RESULT([no])
   1.717 -  AC_DEFINE(NO_MINUS_C_MINUS_O, 1,
   1.718 -	   [Define to 1 if your C compiler doesn't accept -c and -o together.])
   1.719 -fi
   1.720 -])# AC_PROG_CC_C_O
   1.721 -
   1.722 -
   1.723 -
   1.724 -# ---------------------- #
   1.725 -# 3b. The C++ compiler.  #
   1.726 -# ---------------------- #
   1.727 -
   1.728 -
   1.729 -# AC_LANG_PREPROC(C++)
   1.730 -# ---------------------
   1.731 -# Find the C++ preprocessor.  Must be AC_DEFUN'd to be AC_REQUIRE'able.
   1.732 -AC_DEFUN([AC_LANG_PREPROC(C++)],
   1.733 -[AC_REQUIRE([AC_PROG_CXXCPP])])
   1.734 -
   1.735 -
   1.736 -# AC_PROG_CXXCPP
   1.737 -# --------------
   1.738 -# Find a working C++ preprocessor.
   1.739 -# We shouldn't have to require AC_PROG_CC, but this is due to the concurrency
   1.740 -# between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CXX.
   1.741 -AC_DEFUN([AC_PROG_CXXCPP],
   1.742 -[AC_REQUIRE([AC_PROG_CXX])dnl
   1.743 -AC_ARG_VAR([CXXCPP],   [C++ preprocessor])dnl
   1.744 -_AC_ARG_VAR_CPPFLAGS()dnl
   1.745 -AC_LANG_PUSH(C++)dnl
   1.746 -AC_MSG_CHECKING([how to run the C++ preprocessor])
   1.747 -if test -z "$CXXCPP"; then
   1.748 -  AC_CACHE_VAL(ac_cv_prog_CXXCPP,
   1.749 -  [dnl
   1.750 -    # Double quotes because CXXCPP needs to be expanded
   1.751 -    for CXXCPP in "$CXX -E" "/lib/cpp"
   1.752 -    do
   1.753 -      _AC_PROG_PREPROC_WORKS_IFELSE([break])
   1.754 -    done
   1.755 -    ac_cv_prog_CXXCPP=$CXXCPP
   1.756 -  ])dnl
   1.757 -  CXXCPP=$ac_cv_prog_CXXCPP
   1.758 -else
   1.759 -  ac_cv_prog_CXXCPP=$CXXCPP
   1.760 -fi
   1.761 -AC_MSG_RESULT([$CXXCPP])
   1.762 -_AC_PROG_PREPROC_WORKS_IFELSE([],
   1.763 -	  [AC_MSG_FAILURE([C++ preprocessor "$CXXCPP" fails sanity check])])
   1.764 -AC_SUBST(CXXCPP)dnl
   1.765 -AC_LANG_POP(C++)dnl
   1.766 -])# AC_PROG_CXXCPP
   1.767 -
   1.768 -
   1.769 -# AC_LANG_COMPILER(C++)
   1.770 -# ---------------------
   1.771 -# Find the C++ compiler.  Must be AC_DEFUN'd to be AC_REQUIRE'able.
   1.772 -AC_DEFUN([AC_LANG_COMPILER(C++)],
   1.773 -[AC_REQUIRE([AC_PROG_CXX])])
   1.774 -
   1.775 -
   1.776 -# ac_cv_prog_gxx
   1.777 -# --------------
   1.778 -# We used to name the cache variable this way.
   1.779 -AU_DEFUN([ac_cv_prog_gxx],
   1.780 -[ac_cv_cxx_compiler_gnu])
   1.781 -
   1.782 -
   1.783 -# AC_PROG_CXX([LIST-OF-COMPILERS])
   1.784 -# --------------------------------
   1.785 -# LIST-OF-COMPILERS is a space separated list of C++ compilers to search
   1.786 -# for (if not specified, a default list is used).  This just gives the
   1.787 -# user an opportunity to specify an alternative search list for the C++
   1.788 -# compiler.
   1.789 -# aCC	HP-UX C++ compiler much better than `CC', so test before.
   1.790 -# FCC   Fujitsu C++ compiler
   1.791 -# KCC	KAI C++ compiler
   1.792 -# RCC	Rational C++
   1.793 -# xlC_r	AIX C Set++ (with support for reentrant code)
   1.794 -# xlC	AIX C Set++
   1.795 -AN_MAKEVAR([CXX],  [AC_PROG_CXX])
   1.796 -AN_PROGRAM([CC],   [AC_PROG_CXX])
   1.797 -AN_PROGRAM([c++],  [AC_PROG_CXX])
   1.798 -AN_PROGRAM([g++],  [AC_PROG_CXX])
   1.799 -AC_DEFUN([AC_PROG_CXX],
   1.800 -[AC_LANG_PUSH(C++)dnl
   1.801 -AC_ARG_VAR([CXX],      [C++ compiler command])dnl
   1.802 -AC_ARG_VAR([CXXFLAGS], [C++ compiler flags])dnl
   1.803 -_AC_ARG_VAR_LDFLAGS()dnl
   1.804 -_AC_ARG_VAR_LIBS()dnl
   1.805 -_AC_ARG_VAR_CPPFLAGS()dnl
   1.806 -_AC_ARG_VAR_PRECIOUS([CCC])dnl
   1.807 -if test -z "$CXX"; then
   1.808 -  if test -n "$CCC"; then
   1.809 -    CXX=$CCC
   1.810 -  else
   1.811 -    AC_CHECK_TOOLS(CXX,
   1.812 -		   [m4_default([$1],
   1.813 -			       [g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC])],
   1.814 -		   g++)
   1.815 -  fi
   1.816 -fi
   1.817 -# Provide some information about the compiler.
   1.818 -_AS_ECHO_LOG([checking for _AC_LANG compiler version])
   1.819 -set X $ac_compile
   1.820 -ac_compiler=$[2]
   1.821 -_AC_DO([$ac_compiler --version >&AS_MESSAGE_LOG_FD])
   1.822 -_AC_DO([$ac_compiler -v >&AS_MESSAGE_LOG_FD])
   1.823 -_AC_DO([$ac_compiler -V >&AS_MESSAGE_LOG_FD])
   1.824 -
   1.825 -m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
   1.826 -m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
   1.827 -_AC_LANG_COMPILER_GNU
   1.828 -if test $ac_compiler_gnu = yes; then
   1.829 -  GXX=yes
   1.830 -else
   1.831 -  GXX=
   1.832 -fi
   1.833 -_AC_PROG_CXX_G
   1.834 -AC_LANG_POP(C++)dnl
   1.835 -])# AC_PROG_CXX
   1.836 -
   1.837 -
   1.838 -# _AC_PROG_CXX_G
   1.839 -# --------------
   1.840 -# Check whether -g works, even if CXXFLAGS is set, in case the package
   1.841 -# plays around with CXXFLAGS (such as to build both debugging and
   1.842 -# normal versions of a library), tasteless as that idea is.
   1.843 -# Don't consider -g to work if it generates warnings when plain compiles don't.
   1.844 -m4_define([_AC_PROG_CXX_G],
   1.845 -[ac_test_CXXFLAGS=${CXXFLAGS+set}
   1.846 -ac_save_CXXFLAGS=$CXXFLAGS
   1.847 -AC_CACHE_CHECK(whether $CXX accepts -g, ac_cv_prog_cxx_g,
   1.848 -  [ac_save_cxx_werror_flag=$ac_cxx_werror_flag
   1.849 -   ac_cxx_werror_flag=yes
   1.850 -   ac_cv_prog_cxx_g=no
   1.851 -   CXXFLAGS="-g"
   1.852 -   _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
   1.853 -     [ac_cv_prog_cxx_g=yes],
   1.854 -     [CXXFLAGS=""
   1.855 -      _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
   1.856 -	[],
   1.857 -	[ac_cxx_werror_flag=$ac_save_cxx_werror_flag
   1.858 -	 CXXFLAGS="-g"
   1.859 -	 _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
   1.860 -	   [ac_cv_prog_cxx_g=yes])])])
   1.861 -   ac_cxx_werror_flag=$ac_save_cxx_werror_flag])
   1.862 -if test "$ac_test_CXXFLAGS" = set; then
   1.863 -  CXXFLAGS=$ac_save_CXXFLAGS
   1.864 -elif test $ac_cv_prog_cxx_g = yes; then
   1.865 -  if test "$GXX" = yes; then
   1.866 -    CXXFLAGS="-g -O3"
   1.867 -  else
   1.868 -    CXXFLAGS="-g"
   1.869 -  fi
   1.870 -else
   1.871 -  if test "$GXX" = yes; then
   1.872 -    CXXFLAGS="-O3"
   1.873 -  else
   1.874 -    CXXFLAGS=
   1.875 -  fi
   1.876 -fi[]dnl
   1.877 -])# _AC_PROG_CXX_G
   1.878 -
   1.879 -
   1.880 -# AC_PROG_CXX_C_O
   1.881 -# ---------------
   1.882 -# Test if the C++ compiler accepts the options `-c' and `-o'
   1.883 -# simultaneously, and define `CXX_NO_MINUS_C_MINUS_O' if it does not.
   1.884 -AC_DEFUN([AC_PROG_CXX_C_O],
   1.885 -[AC_REQUIRE([AC_PROG_CXX])dnl
   1.886 -AC_LANG_PUSH([C++])dnl
   1.887 -AC_CACHE_CHECK([whether $CXX understands -c and -o together],
   1.888 -               [ac_cv_prog_cxx_c_o],
   1.889 -[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
   1.890 -# We test twice because some compilers refuse to overwrite an existing
   1.891 -# `.o' file with `-o', although they will create one.
   1.892 -ac_try='$CXX $CXXFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&AS_MESSAGE_LOG_FD'
   1.893 -rm -f conftest2.*
   1.894 -if _AC_DO_VAR(ac_try) &&
   1.895 -     test -f conftest2.$ac_objext &&
   1.896 -     _AC_DO_VAR(ac_try); then
   1.897 -  ac_cv_prog_cxx_c_o=yes
   1.898 -else
   1.899 -  ac_cv_prog_cxx_c_o=no
   1.900 -fi
   1.901 -rm -f conftest*])
   1.902 -if test $ac_cv_prog_cxx_c_o = no; then
   1.903 -  AC_DEFINE(CXX_NO_MINUS_C_MINUS_O, 1,
   1.904 -            [Define to 1 if your C++ compiler doesn't accept
   1.905 -             -c and -o together.])
   1.906 -fi
   1.907 -AC_LANG_POP([C++])dnl
   1.908 -])# AC_PROG_CXX_C_O
   1.909 -
   1.910 -
   1.911 -
   1.912 -# ------------------------------ #
   1.913 -# 3c. The Objective C compiler.  #
   1.914 -# ------------------------------ #
   1.915 -
   1.916 -
   1.917 -# AC_LANG_PREPROC(Objective C)
   1.918 -# ----------------------------
   1.919 -# Find the Objective C preprocessor.  Must be AC_DEFUN'd to be AC_REQUIRE'able.
   1.920 -AC_DEFUN([AC_LANG_PREPROC(Objective C)],
   1.921 -[AC_REQUIRE([AC_PROG_OBJCPP])])
   1.922 -
   1.923 -
   1.924 -# AC_PROG_OBJCPP
   1.925 -# --------------
   1.926 -# Find a working Objective C preprocessor.
   1.927 -AC_DEFUN([AC_PROG_OBJCPP],
   1.928 -[AC_REQUIRE([AC_PROG_OBJC])dnl
   1.929 -AC_ARG_VAR([OBJCPP],   [Objective C preprocessor])dnl
   1.930 -_AC_ARG_VAR_CPPFLAGS()dnl
   1.931 -AC_LANG_PUSH(Objective C)dnl
   1.932 -AC_MSG_CHECKING([how to run the Objective C preprocessor])
   1.933 -if test -z "$OBJCPP"; then
   1.934 -  AC_CACHE_VAL(ac_cv_prog_OBJCPP,
   1.935 -  [dnl
   1.936 -    # Double quotes because OBJCPP needs to be expanded
   1.937 -    for OBJCPP in "$OBJC -E" "/lib/cpp"
   1.938 -    do
   1.939 -      _AC_PROG_PREPROC_WORKS_IFELSE([break])
   1.940 -    done
   1.941 -    ac_cv_prog_OBJCPP=$OBJCPP
   1.942 -  ])dnl
   1.943 -  OBJCPP=$ac_cv_prog_OBJCPP
   1.944 -else
   1.945 -  ac_cv_prog_OBJCPP=$OBJCPP
   1.946 -fi
   1.947 -AC_MSG_RESULT([$OBJCPP])
   1.948 -_AC_PROG_PREPROC_WORKS_IFELSE([],
   1.949 -	  [AC_MSG_FAILURE([Objective C preprocessor "$OBJCPP" fails sanity check])])
   1.950 -AC_SUBST(OBJCPP)dnl
   1.951 -AC_LANG_POP(Objective C)dnl
   1.952 -])# AC_PROG_OBJCPP
   1.953 -
   1.954 -
   1.955 -# AC_LANG_COMPILER(Objective C)
   1.956 -# -----------------------------
   1.957 -# Find the Objective C compiler.  Must be AC_DEFUN'd to be AC_REQUIRE'able.
   1.958 -AC_DEFUN([AC_LANG_COMPILER(Objective C)],
   1.959 -[AC_REQUIRE([AC_PROG_OBJC])])
   1.960 -
   1.961 -
   1.962 -
   1.963 -# AC_PROG_OBJC([LIST-OF-COMPILERS])
   1.964 -# ---------------------------------
   1.965 -# LIST-OF-COMPILERS is a space separated list of Objective C compilers to
   1.966 -# search for (if not specified, a default list is used).  This just gives
   1.967 -# the user an opportunity to specify an alternative search list for the
   1.968 -# Objective C compiler.
   1.969 -# objcc StepStone Objective-C compiler (also "standard" name for OBJC)
   1.970 -# objc  David Stes' POC.  If you installed this, you likely want it.
   1.971 -# cc    Native C compiler (for instance, Apple).
   1.972 -# CC    You never know.
   1.973 -AN_MAKEVAR([OBJC],  [AC_PROG_OBJC])
   1.974 -AN_PROGRAM([objcc],  [AC_PROG_OBJC])
   1.975 -AN_PROGRAM([objc],  [AC_PROG_OBJC])
   1.976 -AC_DEFUN([AC_PROG_OBJC],
   1.977 -[AC_LANG_PUSH(Objective C)dnl
   1.978 -AC_ARG_VAR([OBJC],      [Objective C compiler command])dnl
   1.979 -AC_ARG_VAR([OBJCFLAGS], [Objective C compiler flags])dnl
   1.980 -_AC_ARG_VAR_LDFLAGS()dnl
   1.981 -_AC_ARG_VAR_LIBS()dnl
   1.982 -_AC_ARG_VAR_CPPFLAGS()dnl
   1.983 -_AC_ARG_VAR_PRECIOUS([OBJC])dnl
   1.984 -AC_CHECK_TOOLS(OBJC,
   1.985 -	       [m4_default([$1], [gcc objcc objc cc CC])],
   1.986 -	       gcc)
   1.987 -# Provide some information about the compiler.
   1.988 -_AS_ECHO_LOG([checking for _AC_LANG compiler version])
   1.989 -set X $ac_compile
   1.990 -ac_compiler=$[2]
   1.991 -_AC_DO([$ac_compiler --version >&AS_MESSAGE_LOG_FD])
   1.992 -_AC_DO([$ac_compiler -v >&AS_MESSAGE_LOG_FD])
   1.993 -_AC_DO([$ac_compiler -V >&AS_MESSAGE_LOG_FD])
   1.994 -
   1.995 -m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
   1.996 -m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
   1.997 -_AC_LANG_COMPILER_GNU
   1.998 -if test $ac_compiler_gnu = yes; then
   1.999 -  GOBJC=yes
  1.1000 -else
  1.1001 -  GOBJC=
  1.1002 -fi
  1.1003 -_AC_PROG_OBJC_G
  1.1004 -AC_LANG_POP(Objective C)dnl
  1.1005 -])# AC_PROG_OBJC
  1.1006 -
  1.1007 -
  1.1008 -# _AC_PROG_OBJC_G
  1.1009 -# ---------------
  1.1010 -# Check whether -g works, even if OBJCFLAGS is set, in case the package
  1.1011 -# plays around with OBJCFLAGS (such as to build both debugging and
  1.1012 -# normal versions of a library), tasteless as that idea is.
  1.1013 -# Don't consider -g to work if it generates warnings when plain compiles don't.
  1.1014 -m4_define([_AC_PROG_OBJC_G],
  1.1015 -[ac_test_OBJCFLAGS=${OBJCFLAGS+set}
  1.1016 -ac_save_OBJCFLAGS=$OBJCFLAGS
  1.1017 -AC_CACHE_CHECK(whether $OBJC accepts -g, ac_cv_prog_objc_g,
  1.1018 -  [ac_save_objc_werror_flag=$ac_objc_werror_flag
  1.1019 -   ac_objc_werror_flag=yes
  1.1020 -   ac_cv_prog_objc_g=no
  1.1021 -   OBJCFLAGS="-g"
  1.1022 -   _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
  1.1023 -     [ac_cv_prog_objc_g=yes],
  1.1024 -     [OBJCFLAGS=""
  1.1025 -      _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
  1.1026 -	[],
  1.1027 -	[ac_objc_werror_flag=$ac_save_objc_werror_flag
  1.1028 -	 OBJCFLAGS="-g"
  1.1029 -	 _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
  1.1030 -	   [ac_cv_prog_objc_g=yes])])])
  1.1031 -   ac_objc_werror_flag=$ac_save_objc_werror_flag])
  1.1032 -if test "$ac_test_OBJCFLAGS" = set; then
  1.1033 -  OBJCFLAGS=$ac_save_OBJCFLAGS
  1.1034 -elif test $ac_cv_prog_objc_g = yes; then
  1.1035 -  if test "$GOBJC" = yes; then
  1.1036 -    OBJCFLAGS="-g -O3"
  1.1037 -  else
  1.1038 -    OBJCFLAGS="-g"
  1.1039 -  fi
  1.1040 -else
  1.1041 -  if test "$GOBJC" = yes; then
  1.1042 -    OBJCFLAGS="-O3"
  1.1043 -  else
  1.1044 -    OBJCFLAGS=
  1.1045 -  fi
  1.1046 -fi[]dnl
  1.1047 -])# _AC_PROG_OBJC_G
  1.1048 -
  1.1049 -
  1.1050 -
  1.1051 -## ------------------------------- ##
  1.1052 -## 4. Compilers' characteristics.  ##
  1.1053 -## ------------------------------- ##
  1.1054 -
  1.1055 -# -------------------------------- #
  1.1056 -# 4a. C compiler characteristics.  #
  1.1057 -# -------------------------------- #
  1.1058 -
  1.1059 -
  1.1060 -# _AC_PROG_CC_C89 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE])
  1.1061 -# ----------------------------------------------------------------
  1.1062 -# If the C compiler is not in ANSI C89 (ISO C90) mode by default, try
  1.1063 -# to add an option to output variable CC to make it so.  This macro
  1.1064 -# tries various options that select ANSI C89 on some system or
  1.1065 -# another.  It considers the compiler to be in ANSI C89 mode if it
  1.1066 -# handles function prototypes correctly.
  1.1067 -AC_DEFUN([_AC_PROG_CC_C89],
  1.1068 -[_AC_C_STD_TRY([c89],
  1.1069 -[[#include <stdarg.h>
  1.1070 -#include <stdio.h>
  1.1071 -#include <sys/types.h>
  1.1072 -#include <sys/stat.h>
  1.1073 -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
  1.1074 -struct buf { int x; };
  1.1075 -FILE * (*rcsopen) (struct buf *, struct stat *, int);
  1.1076 -static char *e (p, i)
  1.1077 -     char **p;
  1.1078 -     int i;
  1.1079 -{
  1.1080 -  return p[i];
  1.1081 -}
  1.1082 -static char *f (char * (*g) (char **, int), char **p, ...)
  1.1083 -{
  1.1084 -  char *s;
  1.1085 -  va_list v;
  1.1086 -  va_start (v,p);
  1.1087 -  s = g (p, va_arg (v,int));
  1.1088 -  va_end (v);
  1.1089 -  return s;
  1.1090 -}
  1.1091 -
  1.1092 -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
  1.1093 -   function prototypes and stuff, but not '\xHH' hex character constants.
  1.1094 -   These don't provoke an error unfortunately, instead are silently treated
  1.1095 -   as 'x'.  The following induces an error, until -std is added to get
  1.1096 -   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
  1.1097 -   array size at least.  It's necessary to write '\x00'==0 to get something
  1.1098 -   that's true only with -std.  */
  1.1099 -int osf4_cc_array ['\x00' == 0 ? 1 : -1];
  1.1100 -
  1.1101 -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
  1.1102 -   inside strings and character constants.  */
  1.1103 -#define FOO(x) 'x'
  1.1104 -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
  1.1105 -
  1.1106 -int test (int i, double x);
  1.1107 -struct s1 {int (*f) (int a);};
  1.1108 -struct s2 {int (*f) (double a);};
  1.1109 -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
  1.1110 -int argc;
  1.1111 -char **argv;]],
  1.1112 -[[return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];]],
  1.1113 -dnl Don't try gcc -ansi; that turns off useful extensions and
  1.1114 -dnl breaks some systems' header files.
  1.1115 -dnl AIX circa 2003	-qlanglvl=extc89
  1.1116 -dnl old AIX		-qlanglvl=ansi
  1.1117 -dnl Ultrix, OSF/1, Tru64	-std
  1.1118 -dnl HP-UX 10.20 and later	-Ae
  1.1119 -dnl HP-UX older versions	-Aa -D_HPUX_SOURCE
  1.1120 -dnl SVR4			-Xc -D__EXTENSIONS__
  1.1121 -[-qlanglvl=extc89 -qlanglvl=ansi -std \
  1.1122 -	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"], [$1], [$2])[]dnl
  1.1123 -])# _AC_PROG_CC_C89
  1.1124 -
  1.1125 -
  1.1126 -# _AC_C_STD_TRY(STANDARD, TEST-PROLOGUE, TEST-BODY, OPTION-LIST,
  1.1127 -#		ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE)
  1.1128 -# --------------------------------------------------------------
  1.1129 -# Check whether the C compiler accepts features of STANDARD (e.g `c89', `c99')
  1.1130 -# by trying to compile a program of TEST-PROLOGUE and TEST-BODY.  If this fails,
  1.1131 -# try again with each compiler option in the space-separated OPTION-LIST; if one
  1.1132 -# helps, append it to CC.  If eventually successful, run ACTION-IF-AVAILABLE,
  1.1133 -# else ACTION-IF-UNAVAILABLE.
  1.1134 -AC_DEFUN([_AC_C_STD_TRY],
  1.1135 -[AC_MSG_CHECKING([for $CC option to accept ISO ]m4_translit($1, [c], [C]))
  1.1136 -AC_CACHE_VAL(ac_cv_prog_cc_$1,
  1.1137 -[ac_cv_prog_cc_$1=no
  1.1138 -ac_save_CC=$CC
  1.1139 -AC_LANG_CONFTEST([AC_LANG_PROGRAM([$2], [$3])])
  1.1140 -for ac_arg in '' $4
  1.1141 -do
  1.1142 -  CC="$ac_save_CC $ac_arg"
  1.1143 -  _AC_COMPILE_IFELSE([], [ac_cv_prog_cc_$1=$ac_arg])
  1.1144 -  test "x$ac_cv_prog_cc_$1" != "xno" && break
  1.1145 -done
  1.1146 -rm -f conftest.$ac_ext
  1.1147 -CC=$ac_save_CC
  1.1148 -])# AC_CACHE_VAL
  1.1149 -case "x$ac_cv_prog_cc_$1" in
  1.1150 -  x)
  1.1151 -    AC_MSG_RESULT([none needed]) ;;
  1.1152 -  xno)
  1.1153 -    AC_MSG_RESULT([unsupported]) ;;
  1.1154 -  *)
  1.1155 -    CC="$CC $ac_cv_prog_cc_$1"
  1.1156 -    AC_MSG_RESULT([$ac_cv_prog_cc_$1]) ;;
  1.1157 -esac
  1.1158 -AS_IF([test "x$ac_cv_prog_cc_$1" != xno], [$5], [$6])
  1.1159 -])# _AC_C_STD_TRY
  1.1160 -
  1.1161 -
  1.1162 -# _AC_PROG_CC_C99 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE])
  1.1163 -# ----------------------------------------------------------------
  1.1164 -# If the C compiler is not in ISO C99 mode by default, try to add an
  1.1165 -# option to output variable CC to make it so.  This macro tries
  1.1166 -# various options that select ISO C99 on some system or another.  It
  1.1167 -# considers the compiler to be in ISO C99 mode if it handles _Bool,
  1.1168 -# // comments, flexible array members, inline, long long int, mixed
  1.1169 -# code and declarations, named initialization of structs, restrict,
  1.1170 -# va_copy, varargs macros, variable declarations in for loops and
  1.1171 -# variable length arrays.
  1.1172 -AC_DEFUN([_AC_PROG_CC_C99],
  1.1173 -[_AC_C_STD_TRY([c99],
  1.1174 -[[#include <stdarg.h>
  1.1175 -#include <stdbool.h>
  1.1176 -#include <stdlib.h>
  1.1177 -#include <wchar.h>
  1.1178 -#include <stdio.h>
  1.1179 -
  1.1180 -// Check varargs macros.  These examples are taken from C99 6.10.3.5.
  1.1181 -#define debug(...) fprintf (stderr, __VA_ARGS__)
  1.1182 -#define showlist(...) puts (#__VA_ARGS__)
  1.1183 -#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
  1.1184 -static void
  1.1185 -test_varargs_macros (void)
  1.1186 -{
  1.1187 -  int x = 1234;
  1.1188 -  int y = 5678;
  1.1189 -  debug ("Flag");
  1.1190 -  debug ("X = %d\n", x);
  1.1191 -  showlist (The first, second, and third items.);
  1.1192 -  report (x>y, "x is %d but y is %d", x, y);
  1.1193 -}
  1.1194 -
  1.1195 -// Check long long types.
  1.1196 -#define BIG64 18446744073709551615ull
  1.1197 -#define BIG32 4294967295ul
  1.1198 -#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
  1.1199 -#if !BIG_OK
  1.1200 -  your preprocessor is broken;
  1.1201 -#endif
  1.1202 -#if BIG_OK
  1.1203 -#else
  1.1204 -  your preprocessor is broken;
  1.1205 -#endif
  1.1206 -static long long int bignum = -9223372036854775807LL;
  1.1207 -static unsigned long long int ubignum = BIG64;
  1.1208 -
  1.1209 -struct incomplete_array
  1.1210 -{
  1.1211 -  int datasize;
  1.1212 -  double data[];
  1.1213 -};
  1.1214 -
  1.1215 -struct named_init {
  1.1216 -  int number;
  1.1217 -  const wchar_t *name;
  1.1218 -  double average;
  1.1219 -};
  1.1220 -
  1.1221 -typedef const char *ccp;
  1.1222 -
  1.1223 -static inline int
  1.1224 -test_restrict (ccp restrict text)
  1.1225 -{
  1.1226 -  // See if C++-style comments work.
  1.1227 -  // Iterate through items via the restricted pointer.
  1.1228 -  // Also check for declarations in for loops.
  1.1229 -  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
  1.1230 -    continue;
  1.1231 -  return 0;
  1.1232 -}
  1.1233 -
  1.1234 -// Check varargs and va_copy.
  1.1235 -static void
  1.1236 -test_varargs (const char *format, ...)
  1.1237 -{
  1.1238 -  va_list args;
  1.1239 -  va_start (args, format);
  1.1240 -  va_list args_copy;
  1.1241 -  va_copy (args_copy, args);
  1.1242 -
  1.1243 -  const char *str;
  1.1244 -  int number;
  1.1245 -  float fnumber;
  1.1246 -
  1.1247 -  while (*format)
  1.1248 -    {
  1.1249 -      switch (*format++)
  1.1250 -	{
  1.1251 -	case 's': // string
  1.1252 -	  str = va_arg (args_copy, const char *);
  1.1253 -	  break;
  1.1254 -	case 'd': // int
  1.1255 -	  number = va_arg (args_copy, int);
  1.1256 -	  break;
  1.1257 -	case 'f': // float
  1.1258 -	  fnumber = va_arg (args_copy, double);
  1.1259 -	  break;
  1.1260 -	default:
  1.1261 -	  break;
  1.1262 -	}
  1.1263 -    }
  1.1264 -  va_end (args_copy);
  1.1265 -  va_end (args);
  1.1266 -}
  1.1267 -]],
  1.1268 -[[
  1.1269 -  // Check bool.
  1.1270 -  _Bool success = false;
  1.1271 -
  1.1272 -  // Check restrict.
  1.1273 -  if (test_restrict ("String literal") == 0)
  1.1274 -    success = true;
  1.1275 -  char *restrict newvar = "Another string";
  1.1276 -
  1.1277 -  // Check varargs.
  1.1278 -  test_varargs ("s, d' f .", "string", 65, 34.234);
  1.1279 -  test_varargs_macros ();
  1.1280 -
  1.1281 -  // Check flexible array members.
  1.1282 -  struct incomplete_array *ia =
  1.1283 -    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
  1.1284 -  ia->datasize = 10;
  1.1285 -  for (int i = 0; i < ia->datasize; ++i)
  1.1286 -    ia->data[i] = i * 1.234;
  1.1287 -
  1.1288 -  // Check named initializers.
  1.1289 -  struct named_init ni = {
  1.1290 -    .number = 34,
  1.1291 -    .name = L"Test wide string",
  1.1292 -    .average = 543.34343,
  1.1293 -  };
  1.1294 -
  1.1295 -  ni.number = 58;
  1.1296 -
  1.1297 -  int dynamic_array[ni.number];
  1.1298 -  dynamic_array[ni.number - 1] = 543;
  1.1299 -
  1.1300 -  // work around unused variable warnings
  1.1301 -  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
  1.1302 -	  || dynamic_array[ni.number - 1] != 543);
  1.1303 -]],
  1.1304 -dnl Try
  1.1305 -dnl GCC		-std=gnu99 (unused restrictive modes: -std=c99 -std=iso9899:1999)
  1.1306 -dnl AIX		-qlanglvl=extc99 (unused restrictive mode: -qlanglvl=stdc99)
  1.1307 -dnl HP cc	-AC99
  1.1308 -dnl Intel ICC	-std=c99, -c99 (deprecated)
  1.1309 -dnl IRIX	-c99
  1.1310 -dnl Solaris	-xc99=all (Forte Developer 7 C mishandles -xc99 on Solaris 9,
  1.1311 -dnl		as it incorrectly assumes C99 semantics for library functions)
  1.1312 -dnl Tru64	-c99
  1.1313 -dnl with extended modes being tried first.
  1.1314 -[[-std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99]], [$1], [$2])[]dnl
  1.1315 -])# _AC_PROG_CC_C99
  1.1316 -
  1.1317 -
  1.1318 -# AC_PROG_CC_C89
  1.1319 -# --------------
  1.1320 -AC_DEFUN([AC_PROG_CC_C89],
  1.1321 -[ AC_REQUIRE([AC_PROG_CC])dnl
  1.1322 -  _AC_PROG_CC_C89
  1.1323 -])
  1.1324 -
  1.1325 -
  1.1326 -# AC_PROG_CC_C99
  1.1327 -# --------------
  1.1328 -AC_DEFUN([AC_PROG_CC_C99],
  1.1329 -[ AC_REQUIRE([AC_PROG_CC])dnl
  1.1330 -  _AC_PROG_CC_C99
  1.1331 -])
  1.1332 -
  1.1333 -
  1.1334 -# AC_PROG_CC_STDC
  1.1335 -# ---------------
  1.1336 -AC_DEFUN([AC_PROG_CC_STDC],
  1.1337 -[ AC_REQUIRE([AC_PROG_CC])dnl
  1.1338 -  AS_CASE([$ac_cv_prog_cc_stdc],
  1.1339 -    [no], [ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no],
  1.1340 -	  [_AC_PROG_CC_C99([ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99],
  1.1341 -	     [_AC_PROG_CC_C89([ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89],
  1.1342 -			      [ac_cv_prog_cc_stdc=no])])])dnl
  1.1343 -  AC_MSG_CHECKING([for $CC option to accept ISO Standard C])
  1.1344 -  AC_CACHE_VAL([ac_cv_prog_cc_stdc], [])
  1.1345 -  AS_CASE([$ac_cv_prog_cc_stdc],
  1.1346 -    [no], [AC_MSG_RESULT([unsupported])],
  1.1347 -    [''], [AC_MSG_RESULT([none needed])],
  1.1348 -          [AC_MSG_RESULT([$ac_cv_prog_cc_stdc])])
  1.1349 -])
  1.1350 -
  1.1351 -
  1.1352 -# AC_C_BACKSLASH_A
  1.1353 -# ----------------
  1.1354 -AC_DEFUN([AC_C_BACKSLASH_A],
  1.1355 -[
  1.1356 -  AC_CACHE_CHECK([whether backslash-a works in strings], ac_cv_c_backslash_a,
  1.1357 -   [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
  1.1358 -     [[
  1.1359 -#if '\a' == 'a'
  1.1360 -      syntax error;
  1.1361 -#endif
  1.1362 -      char buf['\a' == 'a' ? -1 : 1];
  1.1363 -      buf[0] = '\a';
  1.1364 -      return buf[0] != "\a"[0];
  1.1365 -     ]])],
  1.1366 -     [ac_cv_c_backslash_a=yes],
  1.1367 -     [ac_cv_c_backslash_a=no])])
  1.1368 -  if test $ac_cv_c_backslash_a = yes; then
  1.1369 -    AC_DEFINE(HAVE_C_BACKSLASH_A, 1,
  1.1370 -      [Define if backslash-a works in C strings.])
  1.1371 -  fi
  1.1372 -])
  1.1373 -
  1.1374 -
  1.1375 -# AC_C_CROSS
  1.1376 -# ----------
  1.1377 -# Has been merged into AC_PROG_CC.
  1.1378 -AU_DEFUN([AC_C_CROSS], [])
  1.1379 -
  1.1380 -
  1.1381 -# AC_C_CHAR_UNSIGNED
  1.1382 -# ------------------
  1.1383 -AC_DEFUN([AC_C_CHAR_UNSIGNED],
  1.1384 -[AH_VERBATIM([__CHAR_UNSIGNED__],
  1.1385 -[/* Define to 1 if type `char' is unsigned and you are not using gcc.  */
  1.1386 -#ifndef __CHAR_UNSIGNED__
  1.1387 -# undef __CHAR_UNSIGNED__
  1.1388 -#endif])dnl
  1.1389 -AC_CACHE_CHECK(whether char is unsigned, ac_cv_c_char_unsigned,
  1.1390 -[AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([])],
  1.1391 -					     [((char) -1) < 0])],
  1.1392 -		   ac_cv_c_char_unsigned=no, ac_cv_c_char_unsigned=yes)])
  1.1393 -if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
  1.1394 -  AC_DEFINE(__CHAR_UNSIGNED__)
  1.1395 -fi
  1.1396 -])# AC_C_CHAR_UNSIGNED
  1.1397 -
  1.1398 -
  1.1399 -# AC_C_BIGENDIAN ([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN],
  1.1400 -#                 [ACTION-IF-UNIVERSAL])
  1.1401 -# -------------------------------------------------------------------------
  1.1402 -AC_DEFUN([AC_C_BIGENDIAN],
  1.1403 -[AH_VERBATIM([WORDS_BIGENDIAN],
  1.1404 -[/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
  1.1405 -   significant byte first (like Motorola and SPARC, unlike Intel). */
  1.1406 -#if defined AC_APPLE_UNIVERSAL_BUILD
  1.1407 -# if defined __BIG_ENDIAN__
  1.1408 -#  define WORDS_BIGENDIAN 1
  1.1409 -# endif
  1.1410 -#else
  1.1411 -# ifndef WORDS_BIGENDIAN
  1.1412 -#  undef WORDS_BIGENDIAN
  1.1413 -# endif
  1.1414 -#endif])dnl
  1.1415 - AC_CACHE_CHECK([whether byte ordering is bigendian], [ac_cv_c_bigendian],
  1.1416 -   [ac_cv_c_bigendian=unknown
  1.1417 -    # See if we're dealing with a universal compiler.
  1.1418 -    AC_COMPILE_IFELSE(
  1.1419 -	 [AC_LANG_SOURCE(
  1.1420 -	    [[#ifndef __APPLE_CC__
  1.1421 -	       not a universal capable compiler
  1.1422 -	     #endif
  1.1423 -	     typedef int dummy;
  1.1424 -	    ]])],
  1.1425 -	 [
  1.1426 -	# Check for potential -arch flags.  It is not universal unless
  1.1427 -	# there are some -arch flags.  Note that *ppc* also matches
  1.1428 -	# ppc64.  This check is also rather less than ideal.
  1.1429 -	case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in  #(
  1.1430 -	  *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;;
  1.1431 -	esac])
  1.1432 -    if test $ac_cv_c_bigendian = unknown; then
  1.1433 -      # See if sys/param.h defines the BYTE_ORDER macro.
  1.1434 -      AC_COMPILE_IFELSE(
  1.1435 -	[AC_LANG_PROGRAM(
  1.1436 -	   [[#include <sys/types.h>
  1.1437 -	     #include <sys/param.h>
  1.1438 -	   ]],
  1.1439 -	   [[#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
  1.1440 -		     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
  1.1441 -		     && LITTLE_ENDIAN)
  1.1442 -	      bogus endian macros
  1.1443 -	     #endif
  1.1444 -	   ]])],
  1.1445 -	[# It does; now see whether it defined to BIG_ENDIAN or not.
  1.1446 -	 AC_COMPILE_IFELSE(
  1.1447 -	   [AC_LANG_PROGRAM(
  1.1448 -	      [[#include <sys/types.h>
  1.1449 -		#include <sys/param.h>
  1.1450 -	      ]],
  1.1451 -	      [[#if BYTE_ORDER != BIG_ENDIAN
  1.1452 -		 not big endian
  1.1453 -		#endif
  1.1454 -	      ]])],
  1.1455 -	   [ac_cv_c_bigendian=yes],
  1.1456 -	   [ac_cv_c_bigendian=no])])
  1.1457 -    fi
  1.1458 -    if test $ac_cv_c_bigendian = unknown; then
  1.1459 -      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
  1.1460 -      AC_COMPILE_IFELSE(
  1.1461 -	[AC_LANG_PROGRAM(
  1.1462 -	   [[#include <limits.h>
  1.1463 -	   ]],
  1.1464 -	   [[#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
  1.1465 -	      bogus endian macros
  1.1466 -	     #endif
  1.1467 -	   ]])],
  1.1468 -	[# It does; now see whether it defined to _BIG_ENDIAN or not.
  1.1469 -	 AC_COMPILE_IFELSE(
  1.1470 -	   [AC_LANG_PROGRAM(
  1.1471 -	      [[#include <limits.h>
  1.1472 -	      ]],
  1.1473 -	      [[#ifndef _BIG_ENDIAN
  1.1474 -		 not big endian
  1.1475 -		#endif
  1.1476 -	      ]])],
  1.1477 -	   [ac_cv_c_bigendian=yes],
  1.1478 -	   [ac_cv_c_bigendian=no])])
  1.1479 -    fi
  1.1480 -    if test $ac_cv_c_bigendian = unknown; then
  1.1481 -      # Compile a test program.
  1.1482 -      AC_RUN_IFELSE(
  1.1483 -	[AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
  1.1484 -	   [[
  1.1485 -	     /* Are we little or big endian?  From Harbison&Steele.  */
  1.1486 -	     union
  1.1487 -	     {
  1.1488 -	       long int l;
  1.1489 -	       char c[sizeof (long int)];
  1.1490 -	     } u;
  1.1491 -	     u.l = 1;
  1.1492 -	     return u.c[sizeof (long int) - 1] == 1;
  1.1493 -	   ]])],
  1.1494 -	[ac_cv_c_bigendian=no],
  1.1495 -	[ac_cv_c_bigendian=yes],
  1.1496 -	[# Try to guess by grepping values from an object file.
  1.1497 -	 AC_COMPILE_IFELSE(
  1.1498 -	   [AC_LANG_PROGRAM(
  1.1499 -	      [[short int ascii_mm[] =
  1.1500 -		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
  1.1501 -		short int ascii_ii[] =
  1.1502 -		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
  1.1503 -		int use_ascii (int i) {
  1.1504 -		  return ascii_mm[i] + ascii_ii[i];
  1.1505 -		}
  1.1506 -		short int ebcdic_ii[] =
  1.1507 -		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
  1.1508 -		short int ebcdic_mm[] =
  1.1509 -		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
  1.1510 -		int use_ebcdic (int i) {
  1.1511 -		  return ebcdic_mm[i] + ebcdic_ii[i];
  1.1512 -		}
  1.1513 -		extern int foo;
  1.1514 -	      ]],
  1.1515 -	      [[return use_ascii (foo) == use_ebcdic (foo);]])],
  1.1516 -	   [if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
  1.1517 -	      ac_cv_c_bigendian=yes
  1.1518 -	    fi
  1.1519 -	    if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
  1.1520 -	      if test "$ac_cv_c_bigendian" = unknown; then
  1.1521 -		ac_cv_c_bigendian=no
  1.1522 -	      else
  1.1523 -		# finding both strings is unlikely to happen, but who knows?
  1.1524 -		ac_cv_c_bigendian=unknown
  1.1525 -	      fi
  1.1526 -	    fi])])
  1.1527 -    fi])
  1.1528 - case $ac_cv_c_bigendian in #(
  1.1529 -   yes)
  1.1530 -     m4_default([$1],
  1.1531 -       [AC_DEFINE([WORDS_BIGENDIAN], 1)]);; #(
  1.1532 -   no)
  1.1533 -     $2 ;; #(
  1.1534 -   universal)
  1.1535 -dnl Note that AC_APPLE_UNIVERSAL_BUILD sorts less than WORDS_BIGENDIAN;
  1.1536 -dnl this is a necessity for proper config header operation.  Warn if
  1.1537 -dnl the user did not specify a config header but is relying on the
  1.1538 -dnl default behavior for universal builds.
  1.1539 -     m4_default([$4],
  1.1540 -       [AC_CONFIG_COMMANDS_PRE([m4_ifset([AH_HEADER], [],
  1.1541 -         [AC_DIAGNOSE([obsolete],
  1.1542 -           [AC_C_BIGENDIAN should be used with AC_CONFIG_HEADERS])])])dnl
  1.1543 -        AC_DEFINE([AC_APPLE_UNIVERSAL_BUILD],1,
  1.1544 -          [Define if building universal (internal helper macro)])])
  1.1545 -     ;; #(
  1.1546 -   *)
  1.1547 -     m4_default([$3],
  1.1548 -       [AC_MSG_ERROR([unknown endianness
  1.1549 - presetting ac_cv_c_bigendian=no (or yes) will help])]) ;;
  1.1550 - esac
  1.1551 -])# AC_C_BIGENDIAN
  1.1552 -
  1.1553 -
  1.1554 -# AC_C_INLINE
  1.1555 -# -----------
  1.1556 -# Do nothing if the compiler accepts the inline keyword.
  1.1557 -# Otherwise define inline to __inline__ or __inline if one of those work,
  1.1558 -# otherwise define inline to be empty.
  1.1559 -#
  1.1560 -# HP C version B.11.11.04 doesn't allow a typedef as the return value for an
  1.1561 -# inline function, only builtin types.
  1.1562 -#
  1.1563 -AN_IDENTIFIER([inline], [AC_C_INLINE])
  1.1564 -AC_DEFUN([AC_C_INLINE],
  1.1565 -[AC_CACHE_CHECK([for inline], ac_cv_c_inline,
  1.1566 -[ac_cv_c_inline=no
  1.1567 -for ac_kw in inline __inline__ __inline; do
  1.1568 -  AC_COMPILE_IFELSE([AC_LANG_SOURCE(
  1.1569 -[#ifndef __cplusplus
  1.1570 -typedef int foo_t;
  1.1571 -static $ac_kw foo_t static_foo () {return 0; }
  1.1572 -$ac_kw foo_t foo () {return 0; }
  1.1573 -#endif
  1.1574 -])],
  1.1575 -		    [ac_cv_c_inline=$ac_kw])
  1.1576 -  test "$ac_cv_c_inline" != no && break
  1.1577 -done
  1.1578 -])
  1.1579 -AH_VERBATIM([inline],
  1.1580 -[/* Define to `__inline__' or `__inline' if that's what the C compiler
  1.1581 -   calls it, or to nothing if 'inline' is not supported under any name.  */
  1.1582 -#ifndef __cplusplus
  1.1583 -#undef inline
  1.1584 -#endif])
  1.1585 -case $ac_cv_c_inline in
  1.1586 -  inline | yes) ;;
  1.1587 -  *)
  1.1588 -    case $ac_cv_c_inline in
  1.1589 -      no) ac_val=;;
  1.1590 -      *) ac_val=$ac_cv_c_inline;;
  1.1591 -    esac
  1.1592 -    cat >>confdefs.h <<_ACEOF
  1.1593 -#ifndef __cplusplus
  1.1594 -#define inline $ac_val
  1.1595 -#endif
  1.1596 -_ACEOF
  1.1597 -    ;;
  1.1598 -esac
  1.1599 -])# AC_C_INLINE
  1.1600 -
  1.1601 -
  1.1602 -# AC_C_CONST
  1.1603 -# ----------
  1.1604 -AC_DEFUN([AC_C_CONST],
  1.1605 -[AC_CACHE_CHECK([for an ANSI C-conforming const], ac_cv_c_const,
  1.1606 -[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
  1.1607 -[[/* FIXME: Include the comments suggested by Paul. */
  1.1608 -#ifndef __cplusplus
  1.1609 -  /* Ultrix mips cc rejects this.  */
  1.1610 -  typedef int charset[2];
  1.1611 -  const charset cs;
  1.1612 -  /* SunOS 4.1.1 cc rejects this.  */
  1.1613 -  char const *const *pcpcc;
  1.1614 -  char **ppc;
  1.1615 -  /* NEC SVR4.0.2 mips cc rejects this.  */
  1.1616 -  struct point {int x, y;};
  1.1617 -  static struct point const zero = {0,0};
  1.1618 -  /* AIX XL C 1.02.0.0 rejects this.
  1.1619 -     It does not let you subtract one const X* pointer from another in
  1.1620 -     an arm of an if-expression whose if-part is not a constant
  1.1621 -     expression */
  1.1622 -  const char *g = "string";
  1.1623 -  pcpcc = &g + (g ? g-g : 0);
  1.1624 -  /* HPUX 7.0 cc rejects these. */
  1.1625 -  ++pcpcc;
  1.1626 -  ppc = (char**) pcpcc;
  1.1627 -  pcpcc = (char const *const *) ppc;
  1.1628 -  { /* SCO 3.2v4 cc rejects this.  */
  1.1629 -    char *t;
  1.1630 -    char const *s = 0 ? (char *) 0 : (char const *) 0;
  1.1631 -
  1.1632 -    *t++ = 0;
  1.1633 -    if (s) return 0;
  1.1634 -  }
  1.1635 -  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  1.1636 -    int x[] = {25, 17};
  1.1637 -    const int *foo = &x[0];
  1.1638 -    ++foo;
  1.1639 -  }
  1.1640 -  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  1.1641 -    typedef const int *iptr;
  1.1642 -    iptr p = 0;
  1.1643 -    ++p;
  1.1644 -  }
  1.1645 -  { /* AIX XL C 1.02.0.0 rejects this saying
  1.1646 -       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  1.1647 -    struct s { int j; const int *ap[3]; };
  1.1648 -    struct s *b; b->j = 5;
  1.1649 -  }
  1.1650 -  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  1.1651 -    const int foo = 10;
  1.1652 -    if (!foo) return 0;
  1.1653 -  }
  1.1654 -  return !cs[0] && !zero.x;
  1.1655 -#endif
  1.1656 -]])],
  1.1657 -		   [ac_cv_c_const=yes],
  1.1658 -		   [ac_cv_c_const=no])])
  1.1659 -if test $ac_cv_c_const = no; then
  1.1660 -  AC_DEFINE(const,,
  1.1661 -	    [Define to empty if `const' does not conform to ANSI C.])
  1.1662 -fi
  1.1663 -])# AC_C_CONST
  1.1664 -
  1.1665 -
  1.1666 -# AC_C_RESTRICT
  1.1667 -# -------------
  1.1668 -# based on acx_restrict.m4, from the GNU Autoconf Macro Archive at:
  1.1669 -# http://autoconf-archive.cryp.to/acx_restrict.html
  1.1670 -#
  1.1671 -# Determine whether the C/C++ compiler supports the "restrict" keyword
  1.1672 -# introduced in ANSI C99, or an equivalent.  Define "restrict" to the alternate
  1.1673 -# spelling, if any; these are more likely to work in both C and C++ compilers of
  1.1674 -# the same family, and in the presence of varying compiler options.  If only
  1.1675 -# plain "restrict" works, do nothing.  Here are some variants:
  1.1676 -# - GCC supports both __restrict and __restrict__
  1.1677 -# - older DEC Alpha C compilers support only __restrict
  1.1678 -# - _Restrict is the only spelling accepted by Sun WorkShop 6 update 2 C
  1.1679 -# Otherwise, define "restrict" to be empty.
  1.1680 -AN_IDENTIFIER([restrict], [AC_C_RESTRICT])
  1.1681 -AC_DEFUN([AC_C_RESTRICT],
  1.1682 -[AC_CACHE_CHECK([for C/C++ restrict keyword], ac_cv_c_restrict,
  1.1683 -  [ac_cv_c_restrict=no
  1.1684 -   # The order here caters to the fact that C++ does not require restrict.
  1.1685 -   for ac_kw in __restrict __restrict__ _Restrict restrict; do
  1.1686 -     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
  1.1687 -      [[typedef int * int_ptr;
  1.1688 -	int foo (int_ptr $ac_kw ip) {
  1.1689 -	return ip[0];
  1.1690 -       }]],
  1.1691 -      [[int s[1];
  1.1692 -	int * $ac_kw t = s;
  1.1693 -	t[0] = 0;
  1.1694 -	return foo(t)]])],
  1.1695 -      [ac_cv_c_restrict=$ac_kw])
  1.1696 -     test "$ac_cv_c_restrict" != no && break
  1.1697 -   done
  1.1698 -  ])
  1.1699 - AH_VERBATIM([restrict],
  1.1700 -[/* Define to the equivalent of the C99 'restrict' keyword, or to
  1.1701 -   nothing if this is not supported.  Do not define if restrict is
  1.1702 -   supported directly.  */
  1.1703 -#undef restrict
  1.1704 -/* Work around a bug in Sun C++: it does not support _Restrict, even
  1.1705 -   though the corresponding Sun C compiler does, which causes
  1.1706 -   "#define restrict _Restrict" in the previous line.  Perhaps some future
  1.1707 -   version of Sun C++ will work with _Restrict; if so, it'll probably
  1.1708 -   define __RESTRICT, just as Sun C does.  */
  1.1709 -#if defined __SUNPRO_CC && !defined __RESTRICT
  1.1710 -# define _Restrict
  1.1711 -#endif])
  1.1712 - case $ac_cv_c_restrict in
  1.1713 -   restrict) ;;
  1.1714 -   no) AC_DEFINE([restrict], []) ;;
  1.1715 -   *)  AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
  1.1716 - esac
  1.1717 -])# AC_C_RESTRICT
  1.1718 -
  1.1719 -
  1.1720 -# AC_C_VOLATILE
  1.1721 -# -------------
  1.1722 -# Note that, unlike const, #defining volatile to be the empty string can
  1.1723 -# actually turn a correct program into an incorrect one, since removing
  1.1724 -# uses of volatile actually grants the compiler permission to perform
  1.1725 -# optimizations that could break the user's code.  So, do not #define
  1.1726 -# volatile away unless it is really necessary to allow the user's code
  1.1727 -# to compile cleanly.  Benign compiler failures should be tolerated.
  1.1728 -AC_DEFUN([AC_C_VOLATILE],
  1.1729 -[AC_CACHE_CHECK([for working volatile], ac_cv_c_volatile,
  1.1730 -[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
  1.1731 -volatile int x;
  1.1732 -int * volatile y = (int *) 0;
  1.1733 -return !x && !y;])],
  1.1734 -		   [ac_cv_c_volatile=yes],
  1.1735 -		   [ac_cv_c_volatile=no])])
  1.1736 -if test $ac_cv_c_volatile = no; then
  1.1737 -  AC_DEFINE(volatile,,
  1.1738 -	    [Define to empty if the keyword `volatile' does not work.
  1.1739 -	     Warning: valid code using `volatile' can become incorrect
  1.1740 -	     without.  Disable with care.])
  1.1741 -fi
  1.1742 -])# AC_C_VOLATILE
  1.1743 -
  1.1744 -
  1.1745 -# AC_C_STRINGIZE
  1.1746 -# --------------
  1.1747 -# Checks if `#' can be used to glue strings together at the CPP level.
  1.1748 -# Defines HAVE_STRINGIZE if positive.
  1.1749 -AC_DEFUN([AC_C_STRINGIZE],
  1.1750 -[AC_CACHE_CHECK([for preprocessor stringizing operator],
  1.1751 -		[ac_cv_c_stringize],
  1.1752 -[AC_EGREP_CPP([@%:@teststring],
  1.1753 -	      [@%:@define x(y) #y
  1.1754 -
  1.1755 -char *s = x(teststring);],
  1.1756 -	      [ac_cv_c_stringize=no],
  1.1757 -	      [ac_cv_c_stringize=yes])])
  1.1758 -if test $ac_cv_c_stringize = yes; then
  1.1759 -  AC_DEFINE(HAVE_STRINGIZE, 1,
  1.1760 -	    [Define to 1 if cpp supports the ANSI @%:@ stringizing operator.])
  1.1761 -fi
  1.1762 -])# AC_C_STRINGIZE
  1.1763 -
  1.1764 -
  1.1765 -# AC_C_PROTOTYPES
  1.1766 -# ---------------
  1.1767 -# Check if the C compiler supports prototypes, included if it needs
  1.1768 -# options.
  1.1769 -AC_DEFUN([AC_C_PROTOTYPES],
  1.1770 -[AC_REQUIRE([AC_PROG_CC])dnl
  1.1771 -AC_MSG_CHECKING([for function prototypes])
  1.1772 -if test "$ac_cv_prog_cc_c89" != no; then
  1.1773 -  AC_MSG_RESULT([yes])
  1.1774 -  AC_DEFINE(PROTOTYPES, 1,
  1.1775 -	    [Define to 1 if the C compiler supports function prototypes.])
  1.1776 -  AC_DEFINE(__PROTOTYPES, 1,
  1.1777 -	    [Define like PROTOTYPES; this can be used by system headers.])
  1.1778 -else
  1.1779 -  AC_MSG_RESULT([no])
  1.1780 -fi
  1.1781 -])# AC_C_PROTOTYPES
  1.1782 -
  1.1783 -
  1.1784 -# AC_C_FLEXIBLE_ARRAY_MEMBER
  1.1785 -# --------------------------
  1.1786 -# Check whether the C compiler supports flexible array members.
  1.1787 -AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER],
  1.1788 -[
  1.1789 -  AC_CACHE_CHECK([for flexible array members],
  1.1790 -    ac_cv_c_flexmember,
  1.1791 -    [AC_COMPILE_IFELSE(
  1.1792 -       [AC_LANG_PROGRAM(
  1.1793 -	  [[#include <stdlib.h>
  1.1794 -	    #include <stdio.h>
  1.1795 -	    #include <stddef.h>
  1.1796 -	    struct s { int n; double d[]; };]],
  1.1797 -	  [[int m = getchar ();
  1.1798 -	    struct s *p = malloc (offsetof (struct s, d)
  1.1799 -				  + m * sizeof (double));
  1.1800 -	    p->d[0] = 0.0;
  1.1801 -	    return p->d != (double *) NULL;]])],
  1.1802 -       [ac_cv_c_flexmember=yes],
  1.1803 -       [ac_cv_c_flexmember=no])])
  1.1804 -  if test $ac_cv_c_flexmember = yes; then
  1.1805 -    AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [],
  1.1806 -      [Define to nothing if C supports flexible array members, and to
  1.1807 -       1 if it does not.  That way, with a declaration like `struct s
  1.1808 -       { int n; double d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };', the struct hack
  1.1809 -       can be used with pre-C99 compilers.
  1.1810 -       When computing the size of such an object, don't use 'sizeof (struct s)'
  1.1811 -       as it overestimates the size.  Use 'offsetof (struct s, d)' instead.
  1.1812 -       Don't use 'offsetof (struct s, d@<:@0@:>@)', as this doesn't work with
  1.1813 -       MSVC and with C++ compilers.])
  1.1814 -  else
  1.1815 -    AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], 1)
  1.1816 -  fi
  1.1817 -])
  1.1818 -
  1.1819 -
  1.1820 -# AC_C_VARARRAYS
  1.1821 -# --------------
  1.1822 -# Check whether the C compiler supports variable-length arrays.
  1.1823 -AC_DEFUN([AC_C_VARARRAYS],
  1.1824 -[
  1.1825 -  AC_CACHE_CHECK([for variable-length arrays],
  1.1826 -    ac_cv_c_vararrays,
  1.1827 -    [AC_COMPILE_IFELSE(
  1.1828 -       [AC_LANG_PROGRAM([],
  1.1829 -	  [[static int x; char a[++x]; a[sizeof a - 1] = 0; return a[0];]])],
  1.1830 -       [ac_cv_c_vararrays=yes],
  1.1831 -       [ac_cv_c_vararrays=no])])
  1.1832 -  if test $ac_cv_c_vararrays = yes; then
  1.1833 -    AC_DEFINE([HAVE_C_VARARRAYS], 1,
  1.1834 -      [Define to 1 if C supports variable-length arrays.])
  1.1835 -  fi
  1.1836 -])
  1.1837 -
  1.1838 -
  1.1839 -# AC_C_TYPEOF
  1.1840 -# -----------
  1.1841 -# Check if the C compiler supports GCC's typeof syntax.
  1.1842 -# The test case provokes incompatibilities in the Sun C compilers
  1.1843 -# (both Solaris 8 and Solaris 10).
  1.1844 -AC_DEFUN([AC_C_TYPEOF],
  1.1845 -[
  1.1846 -  AC_CACHE_CHECK([for typeof syntax and keyword spelling], ac_cv_c_typeof,
  1.1847 -    [ac_cv_c_typeof=no
  1.1848 -     for ac_kw in typeof __typeof__ no; do
  1.1849 -       test $ac_kw = no && break
  1.1850 -       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
  1.1851 -	 [[
  1.1852 -	   int value;
  1.1853 -	   typedef struct {
  1.1854 -		   char a [1
  1.1855 -			   + ! (($ac_kw (value))
  1.1856 -				(($ac_kw (value)) 0 < ($ac_kw (value)) -1
  1.1857 -				 ? ($ac_kw (value)) - 1
  1.1858 -				 : ~ (~ ($ac_kw (value)) 0
  1.1859 -				      << sizeof ($ac_kw (value)))))]; }
  1.1860 -	      ac__typeof_type_;
  1.1861 -	   return
  1.1862 -	     (! ((void) ((ac__typeof_type_ *) 0), 0));
  1.1863 -	 ]])],
  1.1864 -	 [ac_cv_c_typeof=$ac_kw])
  1.1865 -       test $ac_cv_c_typeof != no && break
  1.1866 -     done])
  1.1867 -  if test $ac_cv_c_typeof != no; then
  1.1868 -    AC_DEFINE([HAVE_TYPEOF], 1,
  1.1869 -      [Define to 1 if typeof works with your compiler.])
  1.1870 -    if test $ac_cv_c_typeof != typeof; then
  1.1871 -      AC_DEFINE_UNQUOTED([typeof], [$ac_cv_c_typeof],
  1.1872 -	[Define to __typeof__ if your compiler spells it that way.])
  1.1873 -    fi
  1.1874 -  fi
  1.1875 -])
  1.1876 -
  1.1877 -
  1.1878 -# _AC_LANG_OPENMP
  1.1879 -# ---------------
  1.1880 -# Expands to some language dependent source code for testing the presence of
  1.1881 -# OpenMP.
  1.1882 -AC_DEFUN([_AC_LANG_OPENMP],
  1.1883 -[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
  1.1884 -
  1.1885 -# _AC_LANG_OPENMP(C)
  1.1886 -# ------------------
  1.1887 -m4_define([_AC_LANG_OPENMP(C)],
  1.1888 -[
  1.1889 -#ifndef _OPENMP
  1.1890 - choke me
  1.1891 -#endif
  1.1892 -#include <omp.h>
  1.1893 -int main () { return omp_get_num_threads (); }
  1.1894 -])
  1.1895 -
  1.1896 -# _AC_LANG_OPENMP(C++)
  1.1897 -# --------------------
  1.1898 -m4_copy([_AC_LANG_OPENMP(C)], [_AC_LANG_OPENMP(C++)])
  1.1899 -
  1.1900 -# _AC_LANG_OPENMP(Fortran 77)
  1.1901 -# ---------------------------
  1.1902 -m4_define([_AC_LANG_OPENMP(Fortran 77)],
  1.1903 -[AC_LANG_FUNC_LINK_TRY([omp_get_num_threads])])
  1.1904 -
  1.1905 -# _AC_LANG_OPENMP(Fortran)
  1.1906 -# ---------------------------
  1.1907 -m4_copy([_AC_LANG_OPENMP(Fortran 77)], [_AC_LANG_OPENMP(Fortran)])
  1.1908 -
  1.1909 -# AC_OPENMP
  1.1910 -# ---------
  1.1911 -# Check which options need to be passed to the C compiler to support OpenMP.
  1.1912 -# Set the OPENMP_CFLAGS / OPENMP_CXXFLAGS / OPENMP_FFLAGS variable to these
  1.1913 -# options.
  1.1914 -# The options are necessary at compile time (so the #pragmas are understood)
  1.1915 -# and at link time (so the appropriate library is linked with).
  1.1916 -# This macro takes care to not produce redundant options if $CC $CFLAGS already
  1.1917 -# supports OpenMP. It also is careful to not pass options to compilers that
  1.1918 -# misinterpret them; for example, most compilers accept "-openmp" and create
  1.1919 -# an output file called 'penmp' rather than activating OpenMP support.
  1.1920 -AC_DEFUN([AC_OPENMP],
  1.1921 -[
  1.1922 -  OPENMP_[]_AC_LANG_PREFIX[]FLAGS=
  1.1923 -  AC_ARG_ENABLE([openmp],
  1.1924 -    [AS_HELP_STRING([--disable-openmp], [do not use OpenMP])])
  1.1925 -  if test "$enable_openmp" != no; then
  1.1926 -    AC_CACHE_CHECK([for $CC option to support OpenMP],
  1.1927 -      [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp],
  1.1928 -      [AC_LINK_IFELSE([_AC_LANG_OPENMP],
  1.1929 -	 [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='none needed'],
  1.1930 -	 [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='unsupported'
  1.1931 -	  dnl Try these flags:
  1.1932 -	  dnl   GCC >= 4.2           -fopenmp
  1.1933 -	  dnl   SunPRO C             -xopenmp
  1.1934 -	  dnl   Intel C              -openmp
  1.1935 -	  dnl   SGI C, PGI C         -mp
  1.1936 -	  dnl   Tru64 Compaq C       -omp
  1.1937 -	  dnl   IBM C (AIX, Linux)   -qsmp=omp
  1.1938 -	  dnl If in this loop a compiler is passed an option that it doesn't
  1.1939 -	  dnl understand or that it misinterprets, the AC_LINK_IFELSE test
  1.1940 -	  dnl will fail (since we know that it failed without the option),
  1.1941 -	  dnl therefore the loop will continue searching for an option, and
  1.1942 -	  dnl no output file called 'penmp' or 'mp' is created.
  1.1943 -	  for ac_option in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp; do
  1.1944 -	    ac_save_[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
  1.1945 -	    _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $ac_option"
  1.1946 -	    AC_LINK_IFELSE([_AC_LANG_OPENMP],
  1.1947 -	      [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp=$ac_option])
  1.1948 -	    _AC_LANG_PREFIX[]FLAGS=$ac_save_[]_AC_LANG_PREFIX[]FLAGS
  1.1949 -	    if test "$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp" != unsupported; then
  1.1950 -	      break
  1.1951 -	    fi
  1.1952 -	  done])])
  1.1953 -    case $ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp in #(
  1.1954 -      "none needed" | unsupported)
  1.1955 -        ;; #(
  1.1956 -      *)
  1.1957 -        OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp ;;
  1.1958 -    esac
  1.1959 -  fi
  1.1960 -  AC_SUBST([OPENMP_]_AC_LANG_PREFIX[FLAGS])
  1.1961 -])
     2.1 --- a/configure.in	Sun Oct 11 10:30:47 2009 +0000
     2.2 +++ b/configure.in	Sun Oct 11 10:38:38 2009 +0000
     2.3 @@ -4,6 +4,9 @@
     2.4  AC_GNU_SOURCE
     2.5  AC_CONFIG_AUX_DIRS($srcdir/build-scripts)
     2.6  
     2.7 +dnl Save the CFLAGS to see whether they were passed in or generated
     2.8 +orig_CFLAGS="$CFLAGS"
     2.9 +
    2.10  dnl Set various version strings - taken gratefully from the GTk sources
    2.11  #
    2.12  # Making releases:
    2.13 @@ -87,6 +90,10 @@
    2.14          ;;
    2.15  esac
    2.16  BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
    2.17 +# The default optimization for SDL 1.3 is -O3 (Bug #31)
    2.18 +if test x$orig_CFLAGS = x; then
    2.19 +    BUILD_CFLAGS=`echo $BUILD_CFLAGS | sed 's/-O2/-O3/'`
    2.20 +fi
    2.21  EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
    2.22  BUILD_LDFLAGS="$LDFLAGS"
    2.23  EXTRA_LDFLAGS="$BASE_LDFLAGS"