[BACK]Return to configure.in CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gmp

Annotation of OpenXM_contrib/gmp/configure.in, Revision 1.1.1.4

1.1.1.2   maekawa     1: dnl  Process this file with autoconf to produce a configure script.
1.1       maekawa     2:
                      3:
1.1.1.4 ! ohara       4: AC_COPYRIGHT([
1.1       maekawa     5:
1.1.1.4 ! ohara       6: Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
        !             7: Foundation, Inc.
1.1       maekawa     8:
1.1.1.4 ! ohara       9: This file is part of the GNU MP Library.
        !            10:
        !            11: The GNU MP Library is free software; you can redistribute it and/or modify
        !            12: it under the terms of the GNU Lesser General Public License as published
        !            13: by the Free Software Foundation; either version 2.1 of the License, or (at
        !            14: your option) any later version.
        !            15:
        !            16: The GNU MP Library is distributed in the hope that it will be useful, but
        !            17: WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
        !            18: or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
        !            19: License for more details.
        !            20:
        !            21: You should have received a copy of the GNU Lesser General Public License
        !            22: along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
        !            23: the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
        !            24: MA 02111-1307, USA.
        !            25: ])
        !            26:
        !            27:
        !            28: AC_REVISION($Revision: 1.425.2.17 $)
        !            29: AC_PREREQ(2.52)
1.1.1.2   maekawa    30: AC_INIT(gmp-impl.h)
1.1.1.4 ! ohara      31: m4_pattern_forbid([^[ \t]*GMP_])
        !            32: m4_pattern_forbid([^[ \t]*MPFR_CONFIGS])
        !            33: m4_pattern_allow(GMP_LDFLAGS)
        !            34: m4_pattern_allow(GMP_LIMB_BITS)
        !            35: m4_pattern_allow(GMP_MPARAM_H_SUGGEST)
        !            36: m4_pattern_allow(GMP_NAIL_BITS)
        !            37: m4_pattern_allow(GMP_NUMB_BITS)
        !            38:
        !            39: # If --target is not used then $target_alias is empty, but if say
        !            40: # "./configure athlon-pc-freebsd3.5" is used, then all three of
        !            41: # $build_alias, $host_alias and $target_alias are set to
        !            42: # "athlon-pc-freebsd3.5".
        !            43: #
        !            44: if test -n "$target_alias" && test "$target_alias" != "$host_alias"; then
        !            45:   AC_MSG_ERROR([--target is not appropriate for GMP
        !            46: Use --build=CPU-VENDOR-OS if you need to specify your CPU and/or system
        !            47: explicitly.  Use --host if cross-compiling (see "Installing GMP" in the
        !            48: manual for more on this).])
        !            49: fi
        !            50:
        !            51: GMP_INIT(config.m4)
1.1.1.2   maekawa    52:
1.1.1.4 ! ohara      53: AC_CANONICAL_HOST
        !            54: tmp_host=`echo $host_cpu | sed 's/\./_/'`
        !            55: AC_DEFINE_UNQUOTED(HAVE_HOST_CPU_$tmp_host)
        !            56: GMP_DEFINE_RAW("define_not_for_expansion(\`HAVE_HOST_CPU_$tmp_host')", POST)
1.1.1.2   maekawa    57:
                     58: AM_INIT_AUTOMAKE(gmp, GMP_VERSION)
                     59: AM_CONFIG_HEADER(config.h:config.in)
                     60: AM_MAINTAINER_MODE
                     61:
                     62:
                     63: AC_ARG_ENABLE(assert,
1.1.1.4 ! ohara      64: AC_HELP_STRING([--enable-assert],[enable ASSERT checking [[default=no]]]),
        !            65: [case $enableval in
1.1.1.2   maekawa    66: yes|no) ;;
1.1.1.4 ! ohara      67: *) AC_MSG_ERROR([bad value $enableval for --enable-assert, need yes or no]) ;;
1.1.1.2   maekawa    68: esac],
                     69: [enable_assert=no])
                     70:
                     71: if test "$enable_assert" = "yes"; then
                     72:   AC_DEFINE(WANT_ASSERT,1,
                     73:   [./configure --enable-assert option, to enable some ASSERT()s])
                     74: fi
                     75:
                     76:
                     77: AC_ARG_ENABLE(alloca,
1.1.1.4 ! ohara      78: AC_HELP_STRING([--enable-alloca],[how to get temp memory [[default=reentrant]]]),
        !            79: [case $enableval in
        !            80: alloca|malloc-reentrant|malloc-notreentrant) ;;
        !            81: yes|no|reentrant|notreentrant) ;;
        !            82: debug) ;;
        !            83: *)
        !            84:   AC_MSG_ERROR([bad value $enableval for --enable-alloca, need one of:
        !            85: yes no reentrant notreentrant alloca malloc-reentrant malloc-notreentrant debug]) ;;
1.1.1.2   maekawa    86: esac],
1.1.1.4 ! ohara      87: [enable_alloca=reentrant])
1.1.1.2   maekawa    88:
1.1.1.4 ! ohara      89:
        !            90: # IMPROVE ME: The default for C++ is disabled.  The tests currently
        !            91: # performed below for a working C++ compiler are not particularly strong,
        !            92: # and in general can't be expected to get the right setup on their own.  The
        !            93: # most significant problem is getting the ABI the same.  Defaulting CXXFLAGS
        !            94: # to CFLAGS takes only a small step towards this.  It's also probably worth
        !            95: # worrying whether the C and C++ runtimes from say gcc and a vendor C++ can
        !            96: # work together.  Some rather broken C++ installations were encountered
        !            97: # during testing, and though such things clearly aren't GMP's problem, if
        !            98: # --enable-cxx=detect were to be the default then some careful checks of
        !            99: # which, if any, C++ compiler on the system is up to scratch would be
        !           100: # wanted.
        !           101: #
        !           102: AC_ARG_ENABLE(cxx,
        !           103: AC_HELP_STRING([--enable-cxx],[enable C++ support [[default=no]]]),
        !           104: [case $enableval in
        !           105: yes|no|detect) ;;
        !           106: *) AC_MSG_ERROR([bad value $enableval for --enable-cxx, need yes/no/detect]) ;;
        !           107: esac],
        !           108: [enable_cxx=no])
1.1.1.2   maekawa   109:
                    110:
                    111: AC_ARG_ENABLE(fft,
1.1.1.4 ! ohara     112: AC_HELP_STRING([--enable-fft],[enable FFTs for multiplication [[default=yes]]]),
        !           113: [case $enableval in
1.1.1.2   maekawa   114: yes|no) ;;
1.1.1.4 ! ohara     115: *) AC_MSG_ERROR([bad value $enableval for --enable-fft, need yes or no]) ;;
1.1.1.2   maekawa   116: esac],
1.1.1.4 ! ohara     117: [enable_fft=yes])
1.1.1.2   maekawa   118:
                    119: if test "$enable_fft" = "yes"; then
                    120:   AC_DEFINE(WANT_FFT,1,
                    121:   [./configure --enable-fft option, to enable FFTs for multiplication])
                    122: fi
                    123:
                    124:
                    125: AC_ARG_ENABLE(mpbsd,
1.1.1.4 ! ohara     126: AC_HELP_STRING([--enable-mpbsd],
        !           127:                [build Berkley MP compatibility library [[default=no]]]),
        !           128: [case $enableval in
1.1.1.2   maekawa   129: yes|no) ;;
1.1.1.4 ! ohara     130: *) AC_MSG_ERROR([bad value $enableval for --enable-mpbsd, need yes or no]) ;;
1.1.1.2   maekawa   131: esac],
                    132: [enable_mpbsd=no])
                    133: AM_CONDITIONAL(WANT_MPBSD, test "$enable_mpbsd" = "yes")
                    134:
                    135:
                    136: AC_ARG_ENABLE(mpfr,
1.1.1.4 ! ohara     137: AC_HELP_STRING([--enable-mpfr],[build MPFR [[default=no]]]),
        !           138: [case $enableval in
1.1.1.2   maekawa   139: yes|no) ;;
1.1.1.4 ! ohara     140: *) AC_MSG_ERROR([bad value $enableval for --enable-mpfr, need yes or no]) ;;
1.1.1.2   maekawa   141: esac],
                    142: [enable_mpfr=no])
                    143: AM_CONDITIONAL(WANT_MPFR, test "$enable_mpfr" = "yes")
                    144:
                    145:
1.1.1.4 ! ohara     146: AC_ARG_ENABLE(nails,
        !           147: AC_HELP_STRING([--enable-nails],[use nails on limbs [[default=no]]]),
        !           148: [case $enableval in
        !           149: [yes|no|[0-9]|[0-9][0-9]]) ;;
        !           150: *) AC_MSG_ERROR([bad value $enableval for --enable-nails, need yes/no/number]) ;;
        !           151: esac],
        !           152: [enable_nails=no])
        !           153:
        !           154: case $enable_nails in
        !           155: yes) GMP_NAIL_BITS=2 ;;
        !           156: no)  GMP_NAIL_BITS=0 ;;
        !           157: *)   GMP_NAIL_BITS=$enable_nails ;;
        !           158: esac
        !           159: AC_SUBST(GMP_NAIL_BITS)
        !           160:
        !           161:
        !           162: AC_ARG_ENABLE(profiling,
        !           163: AC_HELP_STRING([--enable-profiling],
        !           164:                [build with profiler support [[default=no]]]),
        !           165: [case $enableval in
        !           166: no|prof|gprof) ;;
        !           167: *) AC_MSG_ERROR([bad value $enableval for --enable-profiling, need no/prof/gprof]) ;;
        !           168: esac],
        !           169: [enable_profiling=no])
        !           170:
        !           171: GMP_DEFINE_RAW(["define(<WANT_PROFILING>,<\`$enable_profiling'>)"])
        !           172:
        !           173: # -fomit-frame-pointer is incompatible with -pg, on x86s at least
        !           174: if test "$enable_profiling" = gprof; then
        !           175:   fomit_frame_pointer=
        !           176: else
        !           177:   fomit_frame_pointer="-fomit-frame-pointer"
        !           178: fi
        !           179:
        !           180:
        !           181: AC_ARG_WITH(readline,
        !           182: AC_HELP_STRING([--with-readline],
        !           183:                [readline support in calc demo program [[default=detect]]]),
        !           184: [case $withval in
        !           185: yes|no|detect) ;;
        !           186: *) AC_MSG_ERROR([bad value $withval for --with-readline, need yes/no/detect]) ;;
        !           187: esac],
        !           188: [with_readline=detect])
        !           189:
        !           190:
        !           191:
        !           192: # Table of compilers, options, and mpn paths.  This code has various related
        !           193: # purposes
        !           194: #
        !           195: #   - better default CC/CFLAGS selections than autoconf otherwise gives
        !           196: #   - default CC/CFLAGS selections for extra CPU types specific to GMP
        !           197: #   - a few tests for known bad compilers
        !           198: #   - choice of ABIs on suitable systems
        !           199: #   - selection of corresponding mpn search path
        !           200: #
        !           201: # After GMP specific searches and tests, the standard autoconf AC_PROG_CC is
        !           202: # called.  User selections of CC etc are respected.
        !           203: #
        !           204: # Care is taken not to use macros like AC_TRY_COMPILE during the GMP
        !           205: # pre-testing, since they of course depend on AC_PROG_CC, and also some of
        !           206: # them cache their results, which is not wanted.
        !           207: #
        !           208: # The ABI selection mechanism is unique to GMP.  All that reaches autoconf
        !           209: # is a different selection of CC/CFLAGS according to the best ABI the system
        !           210: # supports, and/or what the user selects.  Naturally the mpn assembler code
        !           211: # selected is very dependent on the ABI.
        !           212: #
        !           213: # The closest the standard tools come to a notion of ABI is something like
        !           214: # "sparc64" which encodes a CPU and an ABI together.  This doesn't seem to
        !           215: # scale well for GMP, where exact CPU types like "ultrasparc2" are wanted,
        !           216: # separate from the ABI used on them.
        !           217: #
        !           218: #
        !           219: # The variables set here are
        !           220: #
        !           221: #   cclist              the compiler choices
        !           222: #   xx_cflags           flags for compiler xx
        !           223: #   xx_cppflags         cpp flags for compiler xx
        !           224: #   xx_cflags_optlist   list of sets of optional flags
        !           225: #   xx_cflags_yyy       set yyy of optional flags for compiler xx
        !           226: #   xx_ldflags          -Wc,-foo flags for libtool linking with compiler xx
        !           227: #   ar_flags            extra flags for $AR
        !           228: #   nm_flags            extra flags for $NM
        !           229: #   limb                limb size, can be "longlong"
        !           230: #   path                mpn search path
        !           231: #   extra_functions     extra mpn functions
        !           232: #
        !           233: # Suppose xx_cflags_optlist="arch", then flags from $xx_cflags_arch are
        !           234: # tried, and the first flag that works will be used.  An optlist like "arch
        !           235: # cpu optimize" can be used to get multiple independent sets of flags tried.
        !           236: # The first that works from each will be used.  If no flag in a set works
        !           237: # then nothing from that set is added.
        !           238: #
        !           239: # For multiple ABIs, the scheme extends as follows.
        !           240: #
        !           241: #   abilist               set of ABI choices
        !           242: #   cclist_aa             compiler choices in ABI aa
        !           243: #   xx_aa_cflags          flags for xx in ABI aa
        !           244: #   xx_aa_cppflags        cpp flags for xx in ABI aa
        !           245: #   xx_aa_cflags_optlist  list of sets of optional flags in ABI aa
        !           246: #   xx_aa_cflags_yyy      set yyy of optional flags for compiler xx in ABI aa
        !           247: #   xx_aa_ldflags         -Wc,-foo flags for libtool linking
        !           248: #   ar_aa_flags           extra flags for $AR in ABI aa
        !           249: #   nm_aa_flags           extra flags for $NM in ABI aa
        !           250: #   limb_aa               limb size in ABI aa, can be "longlong"
        !           251: #   path_aa               mpn search path in ABI aa
        !           252: #   extra_functions_aa    extra mpn functions in ABI aa
        !           253: #
        !           254: # As a convenience, the unadorned xx_cflags (etc) are used for the last ABI
        !           255: # in ablist, if an xx_aa_cflags for that ABI isn't given.  For example if
        !           256: # abilist="64 32" then $cc_64_cflags will be used for the 64-bit ABI, but
        !           257: # for the 32-bit either $cc_32_cflags or $cc_cflags is used, whichever is
        !           258: # defined.  This makes it easy to add some 64-bit compilers and flags to an
        !           259: # unadorned 32-bit set.
        !           260: #
        !           261: # limb=longlong (or limb_aa=longlong) applies to all compilers within that
        !           262: # ABI.  It won't work to have some needing long long and some not, since a
        !           263: # single instantiated gmp.h will be used by both.
        !           264: #
        !           265: # SPEED_CYCLECOUNTER, cyclecounter_size and CALLING_CONVENTIONS_OBJS are
        !           266: # also set here, with an ABI suffix.
        !           267: #
        !           268: #
        !           269: #
        !           270: # A table-driven approach like this to mapping cpu type to good compiler
        !           271: # options is a bit of a maintenance burden, but there's not much uniformity
        !           272: # between options specifications on different compilers.  Some sort of
        !           273: # separately updatable tool might be cute.
        !           274: #
        !           275: # The use of lots of variables like this, direct and indirect, tends to
        !           276: # obscure when and how various things are done, but unfortunately it's
        !           277: # pretty much the only way.  If shell subroutines were portable then actual
        !           278: # code like "if this .. do that" could be written, but attempting the same
        !           279: # with full copies of GMP_PROG_CC_WORKS etc expanded at every point would
        !           280: # hugely bloat the output.
        !           281:
        !           282:
        !           283: AC_ARG_VAR(ABI, [desired ABI (for processors supporting more than one ABI)])
        !           284:
        !           285: # abilist needs to be non-empty, "standard" is just a generic name here
        !           286: abilist="standard"
        !           287:
        !           288: # FIXME: We'd like to prefer an ANSI compiler, perhaps by preferring
        !           289: # c89 over cc here.  But note that on HP-UX c89 provides a castrated
        !           290: # environment, and would want to be excluded somehow.  Maybe
        !           291: # AC_PROG_CC_STDC already does enough to stick cc into ANSI mode and
        !           292: # we don't need to worry.
        !           293: #
        !           294: cclist="gcc cc"
        !           295:
        !           296: gcc_cflags="-g -O2"
        !           297: gcc_64_cflags="-g -O2"
        !           298: cc_cflags="-O"
        !           299: cc_64_cflags="-O"
        !           300:
        !           301: SPEED_CYCLECOUNTER_OBJ=
        !           302: cyclecounter_size=2
        !           303:
        !           304: AC_SUBST(HAVE_HOST_CPU_FAMILY_power,  0)
        !           305: AC_SUBST(HAVE_HOST_CPU_FAMILY_powerpc,0)
        !           306:
        !           307: case $host in
        !           308:
        !           309:   a29k*-*-*)
        !           310:     path="a29k"
1.1       maekawa   311:     ;;
1.1.1.4 ! ohara     312:
        !           313:
1.1.1.2   maekawa   314:   alpha*-*-*)
1.1.1.4 ! ohara     315:     case $host_cpu in
        !           316:       alphaev5* | alphapca5*) path="alpha/ev5 alpha" ;;
        !           317:       alphaev6*)             path="alpha/ev6 alpha/ev5 alpha" ;;
        !           318:       *)                     path="alpha" ;;
        !           319:     esac
        !           320:     extra_functions="cntlz"
        !           321:     gcc_cflags_optlist="cpu asm"
1.1.1.2   maekawa   322:
1.1.1.4 ! ohara     323:     # gcc 2.7.2.3 doesn't know any -mcpu= for alpha, apparently.
        !           324:     # gcc 2.95 and 3.0 know ev4, ev5, ev56, pca56, ev6.
        !           325:     # gcc 3.1 pre-releases add ev67.
        !           326:     #
        !           327:     case $host_cpu in
        !           328:       alpha)        gcc_cflags_cpu="-mcpu=ev4" ;;
        !           329:       alphaev5)     gcc_cflags_cpu="-mcpu=ev5" ;;
        !           330:       alphaev56)    gcc_cflags_cpu="-mcpu=ev56" ;;
        !           331:       alphapca56 | alphapca57)
        !           332:                     gcc_cflags_cpu="-mcpu=pca56" ;;
        !           333:       alphaev6)     gcc_cflags_cpu="-mcpu=ev6" ;;
        !           334:       alphaev67 | alphaev68)
        !           335:                     gcc_cflags_cpu="-mcpu=ev67 -mcpu=ev6" ;;
        !           336:     esac
1.1.1.2   maekawa   337:
1.1.1.4 ! ohara     338:     # On old versions of gcc, which don't know -mcpu=, we believe an
        !           339:     # explicit -Wa,-mev5 etc will be necessary to put the assembler in
        !           340:     # the right mode for our .asm files and longlong.h asm blocks.
        !           341:     #
        !           342:     # On newer versions of gcc, when -mcpu= is known, we must give a
        !           343:     # -Wa which is at least as high as the code gcc will generate,
        !           344:     # since the options ordering seems to make our setting override
        !           345:     # that passed by gcc.
        !           346:     #
        !           347:     # gas prior to 2.14 doesn't accept -mev67, but -mev6 seems enough for
        !           348:     # ctlz and cttz (in 2.10.0 at least).
        !           349:     #
        !           350:     # OSF `as' accepts ev68 but stupidly treats it as ev4.  -arch only seems
        !           351:     # to affect insns like ldbu which are expanded as macros when necessary.
        !           352:     # Insns like ctlz which were never available as macros are always
        !           353:     # accepted and always generate their plain code.
        !           354:     #
        !           355:     case $host_cpu in
        !           356:       alpha)        gcc_cflags_asm="-Wa,-arch,ev4 -Wa,-mev4" ;;
        !           357:       alphaev5)     gcc_cflags_asm="-Wa,-arch,ev5 -Wa,-mev5" ;;
        !           358:       alphaev56)    gcc_cflags_asm="-Wa,-arch,ev56 -Wa,-mev56" ;;
        !           359:       alphapca56 | alphapca57)
        !           360:                     gcc_cflags_asm="-Wa,-arch,pca56 -Wa,-mpca56" ;;
        !           361:       alphaev6)     gcc_cflags_asm="-Wa,-arch,ev6 -Wa,-mev6" ;;
        !           362:       alphaev67 | alphaev68)
        !           363:                     gcc_cflags_asm="-Wa,-arch,ev67 -Wa,-mev67 -Wa,-arch,ev6 -Wa,-mev6" ;;
        !           364:     esac
1.1.1.2   maekawa   365:
1.1.1.4 ! ohara     366:     # It might be better to ask "cc" whether it's Cray C or DEC C,
        !           367:     # instead of relying on the OS part of $host.  But it's hard to
        !           368:     # imagine either of those compilers anywhere except their native
        !           369:     # systems.
        !           370:     #
        !           371:     case $host in
        !           372:       *-cray-unicos*)
        !           373:         cc_cflags="-O"         # no -g, it silently disables all optimizations
        !           374:         GMP_INCLUDE_MPN(alpha/unicos.m4)
        !           375:         # Don't perform any assembly syntax tests on this beast.
        !           376:         gmp_asm_syntax_testing=no
        !           377:         ;;
        !           378:       *-*-osf*)
        !           379:         GMP_INCLUDE_MPN(alpha/default.m4)
        !           380:         cc_cflags=""
        !           381:         cc_cflags_optlist="opt cpu"
        !           382:
        !           383:         # not sure if -fast works on old versions, so make it optional
        !           384:        cc_cflags_opt="-fast -O2"
        !           385:
        !           386:        # DEC C V5.9-005 knows ev4, ev5, ev56, pca56, ev6.
        !           387:        # Compaq C V6.3-029 adds ev67.
        !           388:        #
        !           389:        case $host_cpu in
        !           390:          alpha)       cc_cflags_cpu="-arch~ev4~-tune~ev4" ;;
        !           391:          alphaev5)    cc_cflags_cpu="-arch~ev5~-tune~ev5" ;;
        !           392:          alphaev56)   cc_cflags_cpu="-arch~ev56~-tune~ev56" ;;
        !           393:          alphapca56 | alphapca57)
        !           394:                       cc_cflags_cpu="-arch~pca56~-tune~pca56" ;;
        !           395:          alphaev6)    cc_cflags_cpu="-arch~ev6~-tune~ev6" ;;
        !           396:          alphaev67 | alphaev68)
        !           397:                       cc_cflags_cpu="-arch~ev67~-tune~ev67 -arch~ev6~-tune~ev6" ;;
        !           398:        esac
        !           399:         ;;
        !           400:       *)
        !           401:         GMP_INCLUDE_MPN(alpha/default.m4)
        !           402:         ;;
        !           403:     esac
1.1.1.2   maekawa   404:
1.1.1.4 ! ohara     405:     case $host in
        !           406:       *-*-unicos*)
        !           407:         # tune/alpha.asm assumes int==4bytes but unicos uses int==8bytes
        !           408:         ;;
        !           409:       *)
        !           410:         SPEED_CYCLECOUNTER_OBJ=alpha.lo
        !           411:         cyclecounter_size=1 ;;
1.1.1.2   maekawa   412:     esac
                    413:     ;;
                    414:
1.1.1.4 ! ohara     415:
        !           416:   # Cray vector machines.
        !           417:   # This must come after alpha* so that we can recognize present and future
        !           418:   # vector processors with a wildcard.
        !           419:   *-cray-unicos*)
        !           420:     gmp_asm_syntax_testing=no
        !           421:     cclist="cc"
        !           422:     # We used to have -hscalar0 here as a workaround for miscompilation of
        !           423:     # mpz/import.c, but let's hope Cray fixes their bugs instead, since
        !           424:     # -hscalar0 causes disastrously poor code to be generated.
        !           425:     cc_cflags="-O3 -hnofastmd -htask0 -Wa,-B"
        !           426:     path="cray"
1.1.1.2   maekawa   427:     ;;
1.1.1.4 ! ohara     428:
        !           429:
        !           430:   arm*-*-*)
        !           431:     path="arm"
        !           432:     gcc_cflags="$gcc_cflags $fomit_frame_pointer"
        !           433:     gcc_testlist="gcc-arm-umodsi"
        !           434:     extra_functions="udiv"
        !           435:     GMP_INCLUDE_MPN(arm/arm-defs.m4)
1.1.1.2   maekawa   436:     ;;
1.1.1.4 ! ohara     437:
        !           438:
        !           439:   clipper*-*-*)
        !           440:     path="clipper"
1.1.1.2   maekawa   441:     ;;
                    442:
1.1.1.4 ! ohara     443:
        !           444:   # Fujitsu
        !           445:   [f30[01]-fujitsu-sysv*])
        !           446:     cclist="gcc vcc"
        !           447:     # FIXME: flags for vcc?
        !           448:     vcc_cflags="-g"
        !           449:     path="fujitsu"
1.1.1.2   maekawa   450:     ;;
1.1.1.4 ! ohara     451:
        !           452:
        !           453:   hppa*-*-*)
        !           454:     # HP cc is K&R by default, but AM_C_PROTOTYPES will add "-Ae", or "-Aa
        !           455:     # -D_HPUX_SOURCE", to put it into ansi mode, if possible.
        !           456:
        !           457:     # default to pa7100
        !           458:     gcc_cflags="-g -O2"
        !           459:     gcc_cflags_optlist="arch"
        !           460:     gcc_cflags_arch="-mpa-risc-1-1"
        !           461:     cc_cflags="+DA1.1 +O2"
        !           462:     path="pa32/hppa1_1/pa7100 pa32/hppa1_1 pa32"
        !           463:     extra_functions="udiv_qrnnd"
        !           464:
        !           465:     SPEED_CYCLECOUNTER_OBJ=hppa.lo
        !           466:     cyclecounter_size=1
        !           467:
        !           468:     case $host in
        !           469:       hppa1.0*-*-*)
        !           470:         # override back to plain 1.0
        !           471:         gcc_cflags_optlist=
        !           472:         cc_cflags="+O2"
        !           473:         path="pa32"
        !           474:         ;;
        !           475:       hppa7000*-*-*)
        !           476:         path="pa32/hppa1_1 pa32"
        !           477:         ;;
        !           478:
        !           479:       hppa2.0*-*-*)
        !           480:         abilist="2.0n 1.0"
        !           481:
        !           482:         # FIXME: It's suspected that an assembler feature test might be
        !           483:         # necessary before -mpa-risc-2-0 can be enabled, since it's not
        !           484:         # clear (as of gcc 2.95.2) whether that option always gives an
        !           485:         # explicit ".level 2.0" or whatever to the assembler.  In any case,
        !           486:         # under gcc 2.95.2 it only enables a few extra floating point insns,
        !           487:         # so it's not very important.
        !           488:         #
        !           489:         # gmp_cflags_arch="-mpa-risc-2-0 -mpa-risc-1-1"
        !           490:
        !           491:         # FIXME: path should be "pa32/hppa2_0 pa32/hppa1_1 pa32"
        !           492:         path="pa32/hppa2_0 pa32/hppa1_1/pa7100 pa32/hppa1_1 pa32"
        !           493:
        !           494:         # no gcc support for long long in 2.0n
        !           495:        cclist_20n="cc"
        !           496:         # +O3 causes problems with fp rounding in mpfr/tests/tdiv.
        !           497:         cc_20n_cflags="+DA2.0 +e +O2"
        !           498:         cc_20n_testlist="hpc-hppa-2-0"
        !           499:         path_20n="pa64"
        !           500:        limb_20n=longlong
        !           501:         extra_functions_20n="umul_ppmm udiv_qrnnd"
        !           502:         SPEED_CYCLECOUNTER_OBJ_20n=hppa2.lo
        !           503:         cyclecounter_size_20n=2
        !           504:
        !           505:        # ABI=2.0w is available for hppa2.0w and hppa2.0, but not for hppa2.0n.
        !           506:        case $host in
        !           507:         hppa2.0n-*-*) ;;
        !           508:         *)
        !           509:           # HPUX 11 or up is required to run 2.0w.  Not sure about other
        !           510:           # systems (GNU/Linux for instance), but lets assume they're ok.
        !           511:           case $host in
        !           512:           [*-*-hpux1[1-9]*]) abilist="2.0w $abilist" ;;
        !           513:          *-*-hpux*)                                 ;;
        !           514:           *)                 abilist="2.0w $abilist" ;;
        !           515:           esac
        !           516:
        !           517:           # gcc support for 2.0w is in progress
        !           518:           cclist_20w="cc"
        !           519:           cc_20w_cflags="+DD64 +O2" # +O3 causes problems with fp rounding in mpfr/tests/tdiv.
        !           520:           cc_20w_testlist="hpc-hppa-2-0"
        !           521:           path_20w="pa64"
        !           522:           extra_functions_20w="umul_ppmm udiv_qrnnd"
        !           523:           SPEED_CYCLECOUNTER_OBJ_20w=hppa2w.lo
        !           524:           cyclecounter_size_20w=2
        !           525:          ;;
        !           526:         esac
        !           527:         ;;
        !           528:     esac
1.1.1.2   maekawa   529:     ;;
                    530:
1.1.1.4 ! ohara     531:
        !           532:   i960*-*-*)
        !           533:     path="i960"
1.1.1.2   maekawa   534:     ;;
                    535:
1.1.1.4 ! ohara     536:
        !           537:   ia64*-*-*)
        !           538:     path="ia64"
        !           539:     GMP_INCLUDE_MPN(ia64/default.m4)
        !           540:     SPEED_CYCLECOUNTER_OBJ=ia64.lo
1.1.1.2   maekawa   541:     ;;
1.1.1.4 ! ohara     542:
        !           543:
        !           544:   # Motorola 68k
        !           545:   #
1.1.1.2   maekawa   546:   m68*-*-*)
1.1.1.4 ! ohara     547:     GMP_INCLUDE_MPN(m68k/m68k-defs.m4)
        !           548:     gcc_cflags="-g $fomit_frame_pointer"
        !           549:     gcc_cflags_optlist="optimize arch"
        !           550:     gcc_cflags_optimize="-O2"   # munged below on gcc 2.95.x
        !           551:
        !           552:     # gcc 2.7.2 doesn't know -m68060 or -mcpu32, so let them fall back
        !           553:     # appropriately.
        !           554:     # FIXME: Maybe "-m68020 -mnobitfield" would suit cpu32 on 2.7.2.
        !           555:     #
        !           556:     case $host in
        !           557:     m68020-*-*)  gcc_cflags_arch="-m68020" ;;
        !           558:     m68030-*-*)  gcc_cflags_arch="-m68030" ;;
        !           559:     m68040-*-*)  gcc_cflags_arch="-m68040" ;;
        !           560:     m68060-*-*)  gcc_cflags_arch="-m68060 -m68040" ;;
        !           561:     m68360-*-*)  gcc_cflags_arch="-mcpu32 -m68000" ;;
        !           562:     *)           gcc_cflags_arch="-m68000" ;;
        !           563:     esac
1.1.1.2   maekawa   564:
1.1.1.4 ! ohara     565:     # FIXME: m68k/mc68020 looks like it's ok for cpu32, but this wants to be
        !           566:     # tested.  Will need to introduce an m68k/cpu32 if m68k/mc62020 ever uses
        !           567:     # the bitfield instructions.
        !           568:     case $host in
        !           569:     [m680[2346]0-*-* | m68360-*-*])  path="m68k/mc68020 m68k"
        !           570:                                      extra_functions="udiv umul" ;;
        !           571:     *)                               path="m68k" ;;
        !           572:     esac
1.1.1.2   maekawa   573:     ;;
                    574:
                    575:
1.1.1.4 ! ohara     576:   # Motorola 88k
        !           577:   m88k*-*-*)
        !           578:     path="m88k"
        !           579:     ;;
        !           580:   m88110*-*-*)
        !           581:     # FIXME: Use `-O2'?
        !           582:     gcc_cflags="-g -O -m88110"
        !           583:     path="m88k/mc88110 m88k"
1.1.1.2   maekawa   584:     ;;
                    585:
1.1.1.4 ! ohara     586:
        !           587:   # National Semiconductor 32k
        !           588:   ns32k*-*-*)
        !           589:     path="ns32k"
1.1.1.2   maekawa   590:     ;;
                    591:
                    592:
1.1.1.4 ! ohara     593:   # IRIX 5 and earlier can only run 32-bit o32.
        !           594:   #
        !           595:   # IRIX 6 and up always has a 64-bit mips CPU can run n32 or 64.  n32 is
        !           596:   # preferred over 64, but only because that's been the default in past
        !           597:   # versions of GMP.  The two are equally efficient.
        !           598:   #
        !           599:   # Linux kernel 2.2.13 arch/mips/kernel/irixelf.c has a comment about not
        !           600:   # supporting n32 or 64.
        !           601:   #
        !           602:   # FIXME: It's necessary to pass -mabi or -n32 to the compiler when
        !           603:   # linking.  Libtool used to strip them, hence the ldflags here.  It
        !           604:   # looks like it has something equivalent itself now, so perhaps
        !           605:   # these can be removed.
        !           606:   #
        !           607:   mips*-*-*)
        !           608:     abilist="o32"
        !           609:     gcc_cflags_optlist="abi"
        !           610:     gcc_cflags_abi="-mabi=32"
        !           611:     gcc_testlist="gcc-mips-o32"
        !           612:     path="mips32"
        !           613:     cc_cflags="-O2 -o32"   # no -g, it disables all optimizations
        !           614:     extra_functions="umul"
        !           615:     # this suits both mips32 and mips64
        !           616:     GMP_INCLUDE_MPN(mips32/mips-defs.m4)
        !           617:
        !           618:     case $host in
        !           619:       mips64*-*-* | mips*-*-irix[6789]*)
        !           620:         abilist="n32 64 o32"
        !           621:
        !           622:         cclist_n32="gcc cc"
        !           623:         gcc_n32_cflags="-g -O2 -mabi=n32"
        !           624:         gcc_n32_ldflags="-Wc,-mabi=n32"
        !           625:        # Pass just -O1, MIPSpro 7.2.1 miscompiles mpn/generic/divrem_1.c
        !           626:        # cvs version 1.20, for -O2 and -O3
        !           627:         cc_n32_cflags="-O1 -n32"        # no -g, it disables all optimizations
        !           628:         cc_n32_ldflags="-Wc,-n32"
        !           629:         limb_n32=longlong
        !           630:         path_n32="mips64"
        !           631:         extra_functions_n32="umul"
        !           632:
        !           633:         cclist_64="gcc cc"
        !           634:         gcc_64_cflags="-g -O2 -mabi=64"
        !           635:         gcc_64_ldflags="-Wc,-mabi=64"
        !           636:         cc_64_cflags="-O2 -64"         # no -g, it disables all optimizations
        !           637:         cc_64_ldflags="-Wc,-64"
        !           638:         path_64="mips64"
        !           639:         extra_functions_64="umul"
        !           640:         ;;
        !           641:     esac
        !           642:     ;;
1.1.1.2   maekawa   643:
                    644:
1.1.1.4 ! ohara     645:   # Darwin (powerpc-apple-darwin1.3) has gcc installed as cc.
        !           646:   #
        !           647:   # The darwin assembler doesn't accept "-mppc", so gcc_cflags_asm is
        !           648:   # optional.  The right flag would be "-arch ppc" or some such, but that's
        !           649:   # already the default.
        !           650:   #
        !           651:   # The darwin pre-compiling preprocessor is disabled with -no-cpp-precomp
        !           652:   # since it doesn't like "__attribute__ ((mode (SI)))" etc in gmp-impl.h,
        !           653:   # and so always ends up running the plain preprocessor anyway.  This could
        !           654:   # be done in CPPFLAGS rather than CFLAGS, but there's not many places
        !           655:   # preprocessing is done separately, and this is only a speedup, the normal
        !           656:   # preprocessor gets run if there's any problems.
        !           657:   #
        !           658:   powerpc*-*-*)
        !           659:     AC_DEFINE(HAVE_HOST_CPU_FAMILY_powerpc)
        !           660:     HAVE_HOST_CPU_FAMILY_powerpc=1
        !           661:     cclist="gcc cc"
        !           662:     cc_cflags="-g -O2"
        !           663:     gcc_cflags="-g -O2 -mpowerpc"
        !           664:     gcc_cflags_optlist="asm precomp cpu"
        !           665:     gcc_cflags_asm="-Wa,-mppc"
        !           666:     gcc_cflags_precomp="-no-cpp-precomp"
        !           667:     extra_functions="umul"
        !           668:
        !           669:     case $host_cpu in
        !           670:       powerpc740 | powerpc750 | powerpc7400)
        !           671:         path="powerpc32/750 powerpc32" ;;
        !           672:       *)
        !           673:         path="powerpc32" ;;
        !           674:     esac
1.1.1.2   maekawa   675:
1.1.1.4 ! ohara     676:     # gcc 2.7.2 knows -mcpu=403, 603, 604.
        !           677:     # gcc 2.95 adds 401, 505, 602, 603e, ec603e, 604e, 620, 740, 750,
        !           678:     #   801, 821, 823, 860.
        !           679:     # gcc 3.0 adds 630, rs64a.
        !           680:     # gcc 3.1 pre-releases add 405, 7400, 7450.
        !           681:     #
        !           682:     # FIXME: The way 603e falls back to 603 for gcc 2.7.2 should be
        !           683:     # done for all the others too.  But what would be the correct
        !           684:     # arrangements?
        !           685:     #
        !           686:     case $host_cpu in
        !           687:       powerpc401)   gcc_cflags_cpu="-mcpu=401" ;;
        !           688:       powerpc403)   gcc_cflags_cpu="-mcpu=403" ;;
        !           689:       powerpc405)   gcc_cflags_cpu="-mcpu=405" ;;
        !           690:       powerpc505)   gcc_cflags_cpu="-mcpu=505" ;;
        !           691:       powerpc602)   gcc_cflags_cpu="-mcpu=602" ;;
        !           692:       powerpc603)   gcc_cflags_cpu="-mcpu=603" ;;
        !           693:       powerpc603e)  gcc_cflags_cpu="-mcpu=603e -mcpu=603" ;;
        !           694:       powerpc604)   gcc_cflags_cpu="-mcpu=604" ;;
        !           695:       powerpc604e)  gcc_cflags_cpu="-mcpu=604e -mcpu=604" ;;
        !           696:       powerpc620)   gcc_cflags_cpu="-mcpu=620" ;;
        !           697:       powerpc630)   gcc_cflags_cpu="-mcpu=630" ;;
        !           698:       powerpc740)   gcc_cflags_cpu="-mcpu=740" ;;
        !           699:       powerpc7400)  gcc_cflags_cpu="-mcpu=7400" ;;
        !           700:       powerpc7450)  gcc_cflags_cpu="-mcpu=7450" ;;
        !           701:       powerpc750)   gcc_cflags_cpu="-mcpu=750" ;;
        !           702:       powerpc801)   gcc_cflags_cpu="-mcpu=801" ;;
        !           703:       powerpc821)   gcc_cflags_cpu="-mcpu=821" ;;
        !           704:       powerpc823)   gcc_cflags_cpu="-mcpu=823" ;;
        !           705:       powerpc860)   gcc_cflags_cpu="-mcpu=860" ;;
        !           706:     esac
1.1.1.2   maekawa   707:
1.1.1.4 ! ohara     708:     case $host in
        !           709:       *-*-aix*)
        !           710:         cclist="gcc xlc cc"
        !           711:         xlc_cflags="-g -O2 -qmaxmem=20000"
        !           712:         xlc_cflags_optlist="arch"
        !           713:
        !           714:         # xlc (what version?) knows -qarch=ppc, ppcgr, 601, 602, 603, 604,
        !           715:         # 403, rs64a
        !           716:         # -qarch=ppc is needed, so ensure everything falls back to that.
        !           717:         # FIXME: Perhaps newer versions know more flavours.
        !           718:         #
        !           719:        case $host_cpu in
        !           720:          powerpc403)   xlc_cflags_arch="-qarch=403 -qarch=ppc" ;;
        !           721:          powerpc602)   xlc_cflags_arch="-qarch=602 -qarch=ppc" ;;
        !           722:          powerpc603)   xlc_cflags_arch="-qarch=603 -qarch=ppc" ;;
        !           723:          powerpc603e)  xlc_cflags_arch="-qarch=603 -qarch=ppc" ;;
        !           724:          powerpc604)   xlc_cflags_arch="-qarch=604 -qarch=ppc" ;;
        !           725:          powerpc604e)  xlc_cflags_arch="-qarch=604 -qarch=ppc" ;;
        !           726:          *)            xlc_cflags_arch="-qarch=ppc" ;;
        !           727:         esac
        !           728:         ;;
        !           729:     esac
1.1.1.2   maekawa   730:
1.1.1.4 ! ohara     731:     case $host in
        !           732:       POWERPC64_PATTERN)
        !           733:         # On AIX a true 64-bit ABI is available.
        !           734:         case $host in
        !           735:           *-*-aix*)
        !           736:             # Need -Wc to pass object type flags through to the linker.
        !           737:             abilist="aix64 32"
        !           738:             cclist_aix64="gcc xlc"
        !           739:             gcc_aix64_cflags="-g -O2 -maix64 -mpowerpc64"
        !           740:             gcc_aix64_cflags_optlist="cpu"
        !           741:            gcc_aix64_ldflags="-Wc,-maix64"
        !           742:             xlc_aix64_cflags="-g -O2 -q64 -qtune=pwr3 -qmaxmem=20000"
        !           743:            xlc_aix64_ldflags="-Wc,-q64"
        !           744:             # Must indicate object type to ar and nm
        !           745:            ar_aix64_flags="-X64"
        !           746:            nm_aix64_flags="-X64"
        !           747:             path_aix64="powerpc64"
        !           748:             extra_functions_aix64="umul"
        !           749:             ;;
        !           750:         esac
        !           751:         ;;
        !           752:     esac
        !           753:     ;;
1.1.1.2   maekawa   754:
                    755:
1.1.1.4 ! ohara     756:   # POWER
        !           757:   [power-*-* | power[12]-*-* | power2sc-*-*])
        !           758:     AC_DEFINE(HAVE_HOST_CPU_FAMILY_power)
        !           759:     HAVE_HOST_CPU_FAMILY_power=1
        !           760:     cclist="gcc"
        !           761:     extra_functions="udiv_w_sdiv"
        !           762:     path="power"
1.1.1.2   maekawa   763:
1.1.1.4 ! ohara     764:     gcc_cflags_optlist="cpu"
        !           765:     case $host in
        !           766:       power-*-*)    gcc_cflags_cpu="-mcpu=power -mpower" ;;
        !           767:       power1-*-*)   gcc_cflags_cpu="-mcpu=rios1 -mpower" ;;
        !           768:       power2-*-*)   gcc_cflags_cpu="-mcpu=rios2 -mpower" ;;
        !           769:       power2sc-*-*) gcc_cflags_cpu="-mcpu=rsc   -mpower" ;;
        !           770:     esac
        !           771:     case $host in
        !           772:     *-*-aix*)
        !           773:       cclist="gcc xlc"
        !           774:       xlc_cflags="-g -O2 -qarch=pwr -qmaxmem=20000"
        !           775:       ;;
        !           776:     esac
1.1.1.2   maekawa   777:     ;;
1.1.1.4 ! ohara     778:
        !           779:
        !           780:   # FIXME: ppc601 isn't accepted by config.sub.
        !           781:   ppc601-*-*)
        !           782:     path="power powerpc32"
1.1.1.2   maekawa   783:     ;;
1.1.1.4 ! ohara     784:
        !           785:
        !           786:   pyramid-*-*)
        !           787:     path="pyr"
1.1.1.2   maekawa   788:     ;;
1.1.1.4 ! ohara     789:
        !           790:
        !           791:   # IBM s/370 and similar
        !           792:   [s3[6-9]0*-*-*])
        !           793:     gcc_cflags="-g -O2 $fomit_frame_pointer"
        !           794:     path="s390"
        !           795:     extra_functions="udiv_w_sdiv"
1.1.1.2   maekawa   796:     ;;
1.1.1.4 ! ohara     797:
        !           798:
        !           799:   sh-*-*)   path="sh" ;;
        !           800:   sh2-*-*)  path="sh/sh2 sh" ;;
        !           801:
        !           802:
        !           803:   *sparc*-*-*)
        !           804:     # For cc and acc, -g disables -O, so it's not used
        !           805:     cclist="gcc acc cc"
        !           806:     path="sparc32"
        !           807:     gcc_cflags="-g -O2"
        !           808:     gcc_cflags_optlist="cpu"
        !           809:     gcc_cflags_cpu=
        !           810:     acc_cflags="-O2"
        !           811:     cc_cflags="-O2"
        !           812:     GMP_INCLUDE_MPN(sparc32/sparc-defs.m4)
        !           813:
        !           814:     # FIXME: This should be selected according to the CPU
        !           815:     if test x${floating_point} = xno
        !           816:     then extra_functions="udiv_nfp"
        !           817:     else extra_functions="udiv_fp"
1.1.1.2   maekawa   818:     fi
1.1.1.4 ! ohara     819:
        !           820:     case $host in
        !           821:       sparcv8*-*-* | supersparc*-*-* | microsparc*-*-*)
        !           822:         gcc_cflags_cpu="-mcpu=v8 -mv8"
        !           823:         acc_cflags="-O2 -cg92"
        !           824:         path="sparc32/v8 sparc32"
        !           825:         extra_functions="udiv"
        !           826:
        !           827:         case $host in
        !           828:           *-*-solaris2.*)  cc_cflags="-xtarget=native -xarch=v8 -xO4" ;;
        !           829:         esac
        !           830:         case $host in
        !           831:           supersparc*-*-*) path="sparc32/v8/supersparc sparc32/v8 sparc32" ;;
        !           832:         esac
        !           833:         ;;
        !           834:
        !           835:       # sparc64-*-linux-gnu is a misnomer, since there's no support for any
        !           836:       # 64-bit operations in user mode.  We assume that a future release
        !           837:       # will have some 64-bit support and that the gcc options will be the
        !           838:       # same as on solaris.
        !           839:       #
        !           840:       # cc -xarch actually controls the ABI, hence it must be v8 for 32-bit,
        !           841:       # even though the chip is v9.
        !           842:       #
        !           843:       sparcv9*-*-* | ultrasparc*-*-* | sparc64-*-*)
        !           844:         path="sparc32/v9 sparc32/v8 sparc32"
        !           845:         extra_functions="udiv_fp"
        !           846:
        !           847:         SPEED_CYCLECOUNTER_OBJ=sparcv9.lo
        !           848:
        !           849:         gcc_cflags="-g -O2 -Wa,-xarch=v8plus"
        !           850:         gcc_cflags_cpu="-mcpu=ultrasparc -mcpu=v9 -mcpu=v8 -mv8"
        !           851:
        !           852:         cc_cflags="-xtarget=native -xarch=v8 -xO4"
        !           853:
        !           854:         case $host in
        !           855:           [*-*-solaris2.[7-9]])
        !           856:             # solaris prior to 2.6 doesn't save registers properly, so the
        !           857:             # 64-bit ABI is only available for 2.7 up
        !           858:             abilist="64 32"
        !           859:             path_64="sparc64"
        !           860:             cclist_64="gcc cc"
        !           861:             gcc_64_cflags="-g -O2 -m64 -mptr64 -Wa,-xarch=v9 -mcpu=v9"
        !           862:             gcc_64_ldflags="-Wc,-m64"
        !           863:            # -fast enables different optimizations depending compiler version
        !           864:            # -fns=no and -fsimple=1 disables some transformations that
        !           865:            # conflict with IEEE 754, which some compiler versions perform.
        !           866:             cc_64_cflags="-fast -fns=no -fsimple=1 -xarch=v9"
        !           867:             SPEED_CYCLECOUNTER_OBJ_64=sparcv9.lo
        !           868:             cyclecounter_size_64=2
        !           869:             ;;
        !           870:           *-*-*bsd*)
        !           871:             # NetBSD and OpenBSD sparc64
        !           872:             abilist="64"
        !           873:             extra_functions=
        !           874:             path="sparc64"
        !           875:             gcc_cflags="-g -O2"
        !           876:             cyclecounter_size=2
        !           877:             ;;
        !           878:         esac
        !           879:       ;;
        !           880:     esac
        !           881:     ;;
        !           882:
        !           883:
        !           884:   # VAX
        !           885:   vax*-*-*)
        !           886:     # Currently (version 3.0) gcc on vax always uses a frame pointer
        !           887:     # (config/vax/vax.h FRAME_POINTER_REQUIRED=1), so -fomit-frame-pointer
        !           888:     # will be ignored.
        !           889:     #
        !           890:     gcc_cflags="-g -O2 $fomit_frame_pointer"
        !           891:     path="vax"
        !           892:     extra_functions="udiv_w_sdiv"
1.1.1.2   maekawa   893:     ;;
                    894:
                    895:
1.1.1.4 ! ohara     896:   # AMD and Intel x86 configurations
        !           897:   X86_PATTERN)
        !           898:     AC_DEFINE(HAVE_HOST_CPU_FAMILY_x86)
        !           899:     # Rumour has it gcc -O2 used to give worse register allocation than just
        !           900:     # -O, but lets assume that's no longer true.
        !           901:     gcc_cflags="-g -O2 $fomit_frame_pointer"
        !           902:     GMP_INCLUDE_MPN(x86/x86-defs.m4)
1.1.1.2   maekawa   903:     extra_functions="udiv umul"
1.1.1.4 ! ohara     904:     CALLING_CONVENTIONS_OBJS='x86call.lo x86check$U.lo'
1.1.1.2   maekawa   905:
1.1.1.4 ! ohara     906:     # Availability of rdtsc is checked at run-time.
        !           907:     SPEED_CYCLECOUNTER_OBJ=pentium.lo
1.1.1.2   maekawa   908:
1.1.1.4 ! ohara     909:     # gcc 2.7.2 only knows i386 and i486, using -m386 or -m486.  These
        !           910:     # represent -mcpu= since -m486 doesn't generate 486 specific insns.  The
        !           911:     # -mcpu= and -march= options will fail, leaving just -m486.
        !           912:     #
        !           913:     # gcc 2.95.2 adds k6, pentium and pentiumpro, and allows -march= and
        !           914:     # -mcpu=.
        !           915:     #
        !           916:     # gcc 3.0 adds athlon.
        !           917:     #
        !           918:     # gcc 3.1 adds pentium4.
1.1.1.2   maekawa   919:
1.1.1.4 ! ohara     920:     # Defaults for anything not otherwise mentioned.
1.1.1.2   maekawa   921:     path="x86"
1.1.1.4 ! ohara     922:     gcc_cflags_optlist="cpu arch"
        !           923:     gcc_cflags_cpu="-mcpu=i486 -m486"
        !           924:     gcc_cflags_arch="-march=i486"
        !           925:
        !           926:     case $host in
        !           927:       i386*-*-*)
        !           928:         # Because i386 means generic x86, -mcpu=i486 is used since that
        !           929:         # should better suit newer processors.
        !           930:         # FIXME: How would a user ask for an actual 80386? Currently only by
        !           931:         # using CFLAGS="-mcpu=386" or whatever.
        !           932:         gcc_cflags_cpu="-mcpu=i486 -m486"
        !           933:         gcc_cflags_arch="-march=i386"
1.1.1.2   maekawa   934:         ;;
1.1.1.4 ! ohara     935:       i586*-*-* | pentium-*-* | pentiummmx-*-*)
        !           936:         gcc_cflags_cpu="-mcpu=pentium -m486"
        !           937:         gcc_cflags_arch="-march=pentium"
1.1.1.2   maekawa   938:         ;;
1.1.1.4 ! ohara     939:       [i686*-*-* | pentiumpro-*-* | pentium[23]-*-*])
        !           940:         gcc_cflags_cpu="-mcpu=pentiumpro -mcpu=i486 -m486"
        !           941:         gcc_cflags_arch="-march=pentiumpro -march=pentium -march=i486"
1.1.1.2   maekawa   942:         ;;
                    943:       k6*-*-*)
1.1.1.4 ! ohara     944:         gcc_cflags_cpu="-mcpu=k6 -mcpu=i486 -m486"
        !           945:         gcc_cflags_arch="-march=k6 -march=i486"
1.1.1.2   maekawa   946:         ;;
                    947:       athlon-*-*)
1.1.1.4 ! ohara     948:         # Athlon instruction costs are close to P6 (3 cycle load latency,
        !           949:         # 4-6 cycle mul, 40 cycle div, pairable adc, etc) so if gcc doesn't
        !           950:         # know athlon (eg. 2.95.2 doesn't) then fall back on pentiumpro.
        !           951:         gcc_cflags_cpu="-mcpu=athlon -mcpu=pentiumpro -mcpu=i486 -m486"
        !           952:         gcc_cflags_arch="-march=athlon -march=pentiumpro -march=pentium -march=i486"
        !           953:         ;;
        !           954:       pentium4-*-*)
        !           955:         # pentium4 is known to gcc 3.1 and up, not sure what cpu choice
        !           956:         # would best suit previous versions, pentiumpro will get us cmov
        !           957:         # from gcc 2.95.4 up, otherwise let's just try i486.
        !           958:         gcc_cflags_cpu="-mcpu=pentium4 -mcpu=pentiumpro -mcpu=i486 -m486"
        !           959:         gcc_cflags_arch="-march=pentium4 -march=pentiumpro -march=pentium -march=i486"
1.1.1.2   maekawa   960:         ;;
                    961:     esac
1.1.1.4 ! ohara     962:
        !           963:     case $host in
        !           964:       i486*-*-*)                  path="x86/i486 x86" ;;
        !           965:       i586*-*-* | pentium-*-*)    path="x86/pentium x86" ;;
        !           966:       pentiummmx-*-*)             path="x86/pentium/mmx x86/pentium x86" ;;
        !           967:       i686*-*-* | pentiumpro-*-*) path="x86/p6 x86" ;;
        !           968:       pentium2-*-*)   path="x86/p6/mmx x86/p6 x86" ;;
        !           969:       pentium3-*-*)   path="x86/p6/p3mmx x86/p6/mmx x86/p6 x86";;
        !           970:       [k6[23]*-*-*])  path="x86/k6/k62mmx x86/k6/mmx x86/k6 x86" ;;
        !           971:       k6*-*-*)        path="x86/k6/mmx x86/k6 x86" ;;
        !           972:       athlon-*-*)     path="x86/k7/mmx x86/k7 x86" ;;
        !           973:       pentium4-*-*)   path="x86/pentium4/sse2 x86/pentium4/mmx x86/pentium4 x86" ;;
        !           974:     esac
1.1.1.2   maekawa   975:     ;;
                    976:
                    977:
1.1.1.4 ! ohara     978:   # FIXME: z8kx won't get through config.sub.  Could make 16 versus 32 bit
        !           979:   # limb an ABI option perhaps.
        !           980:   z8kx*-*-*)
        !           981:     path="z8000x"
        !           982:     extra_functions="udiv_w_sdiv"
        !           983:     ;;
        !           984:   z8k*-*-*)
        !           985:     path="z8000"
        !           986:     extra_functions="udiv_w_sdiv"
        !           987:     ;;
1.1.1.2   maekawa   988:
                    989:
1.1.1.4 ! ohara     990:   # Special CPU "none" selects generic C.  -DNO_ASM is used to disable gcc
        !           991:   # asm blocks in longlong.h (since they're driven by cpp pre-defined
        !           992:   # symbols like __alpha rather than the configured $host_cpu).
        !           993:   #
        !           994:   none-*-*)
        !           995:     abilist="long longlong"
        !           996:     cclist_long=$cclist
        !           997:     gcc_long_cflags=$gcc_cflags
        !           998:     gcc_long_cppflags="-DNO_ASM"
        !           999:     cc_long_cflags=$cc_cflags
        !          1000:     cclist_longlong=$cclist
        !          1001:     gcc_longlong_cflags=$gcc_cflags
        !          1002:     gcc_longlong_cppflags="-DNO_ASM"
        !          1003:     cc_longlong_cflags=$cc_cflags
        !          1004:     limb_longlong=longlong
1.1.1.2   maekawa  1005:     ;;
                   1006:
1.1.1.4 ! ohara    1007: esac
1.1.1.2   maekawa  1008:
                   1009:
1.1.1.4 ! ohara    1010: CFLAGS_or_unset=${CFLAGS-'(unset)'}
        !          1011: CPPFLAGS_or_unset=${CPPFLAGS-'(unset)'}
1.1.1.2   maekawa  1012:
1.1.1.4 ! ohara    1013: cat >&AC_FD_CC <<EOF
        !          1014: configure:__line__: User:
        !          1015: ABI=$ABI
        !          1016: CC=$CC
        !          1017: CFLAGS=$CFLAGS_or_unset
        !          1018: CPPFLAGS=$CPPFLAGS_or_unset
        !          1019: MPN_PATH=$MPN_PATH
        !          1020: configure:__line__: GMP:
        !          1021: abilist=$abilist
        !          1022: cclist=$cclist
        !          1023: EOF
1.1.1.2   maekawa  1024:
                   1025:
1.1.1.4 ! ohara    1026: test_CFLAGS=${CFLAGS+set}
        !          1027: test_CPPFLAGS=${CPPFLAGS+set}
1.1.1.2   maekawa  1028:
1.1.1.4 ! ohara    1029: for abi in $abilist; do
        !          1030:   abi_last="$abi"
        !          1031: done
        !          1032:
        !          1033: # If the user specifies an ABI then it must be in $abilist, after that
        !          1034: # $abilist is restricted to just that choice.
        !          1035: #
        !          1036: if test -n "$ABI"; then
        !          1037:   found=no
        !          1038:   for abi in $abilist; do
        !          1039:     if test $abi = "$ABI"; then found=yes; break; fi
        !          1040:   done
        !          1041:   if test $found = no; then
        !          1042:     AC_MSG_ERROR([ABI=$ABI is not among the following valid choices: $abilist])
        !          1043:   fi
        !          1044:   abilist="$ABI"
        !          1045: fi
        !          1046:
        !          1047: found_compiler=no
        !          1048:
        !          1049: for abi in $abilist; do
        !          1050:
        !          1051:   # Suppose abilist="64 32", then for abi=64, will have abi1="_64" and
        !          1052:   # abi2="_64".  For abi=32, will have abi1="_32" and abi2="".  This is how
        !          1053:   # $gcc_cflags becomes a fallback for $gcc_32_cflags (the last in the
        !          1054:   # abilist), but there's no fallback for $gcc_64_cflags.
        !          1055:   #
        !          1056:   abi1=[`echo _$abi | sed 's/[.]//g'`]
        !          1057:   if test $abi = $abi_last; then abi2=; else abi2="$abi1"; fi
        !          1058:
        !          1059:   # Compiler choices under this ABI
        !          1060:                               eval cclist_chosen=\"\$cclist$abi1\"
        !          1061:   test -n "$cclist_chosen" || eval cclist_chosen=\"\$cclist$abi2\"
        !          1062:
        !          1063:   # If there's a user specified $CC then don't use a list for
        !          1064:   # $cclist_chosen, just a single value for $ccbase.
        !          1065:   #
        !          1066:   if test -n "$CC"; then
        !          1067:
        !          1068:     # The first word of $CC, stripped of any directory.  For instance
        !          1069:     # CC="/usr/local/bin/gcc -pipe" will give "gcc".
        !          1070:     #
        !          1071:     for ccbase in $CC; do break; done
        !          1072:     ccbase=`echo $ccbase | sed 's:.*/::'`
        !          1073:
        !          1074:     # If this $ccbase is in $cclist_chosen then it's a compiler we know and
        !          1075:     # we can do flags defaulting with it.  If not, then $cclist_chosen is
        !          1076:     # set to "unrecognised" so no default flags are used.
        !          1077:     #
        !          1078:     # "unrecognised" is used to avoid bad effects with eval if $ccbase has
        !          1079:     # non-symbol characters.  For instance ccbase=my+cc would end up with
        !          1080:     # something like cflags="$my+cc_cflags" which would give
        !          1081:     # cflags="+cc_cflags" rather than the intended empty string for an
        !          1082:     # unknown compiler.
        !          1083:     #
        !          1084:     found=unrecognised
        !          1085:     for i in $cclist_chosen; do
        !          1086:       if test "$ccbase" = $i; then
        !          1087:         found=$ccbase
        !          1088:         break
        !          1089:       fi
        !          1090:     done
        !          1091:     cclist_chosen=$found
        !          1092:   fi
        !          1093:
        !          1094:   for ccbase in $cclist_chosen; do
        !          1095:
        !          1096:     # When cross compiling, look for a compiler with the $host_alias as a
        !          1097:     # prefix, the same way that AC_CHECK_TOOL does.  But don't do this to a
        !          1098:     # user-selected $CC.
        !          1099:     #
        !          1100:     # $cross_compiling will be yes/no/maybe at this point.  Do the host
        !          1101:     # prefixing for "maybe" as well as "yes".
        !          1102:     #
        !          1103:     if test "$cross_compiling" != no && test -z "$CC"; then
        !          1104:       cross_compiling_prefix="${host_alias}-"
        !          1105:     fi
        !          1106:
        !          1107:     for ccprefix in $cross_compiling_prefix ""; do
        !          1108:
        !          1109:       cc="$CC"
        !          1110:       test -n "$cc" || cc="$ccprefix$ccbase"
        !          1111:
        !          1112:       # If the compiler is gcc but installed under another name, then change
        !          1113:       # $ccbase so as to use the flags we know for gcc.  This helps for
        !          1114:       # instance when specifying CC=gcc272 on Debian GNU/Linux, or the
        !          1115:       # native cc which is really gcc on NeXT or MacOS-X.
        !          1116:       #
        !          1117:       # FIXME: There's a slight misfeature here.  If cc is actually gcc but
        !          1118:       # gcc is not a known compiler under this $abi then we'll end up
        !          1119:       # testing it with no flags and it'll work, but chances are it won't be
        !          1120:       # in the right mode for the ABI we desire.  Let's quietly hope this
        !          1121:       # doesn't happen.
        !          1122:       #
        !          1123:       if test $ccbase != gcc; then
        !          1124:         GMP_PROG_CC_IS_GNU($cc,ccbase=gcc)
        !          1125:       fi
        !          1126:
        !          1127:       # Similarly if the compiler is IBM xlc but invoked as cc or whatever
        !          1128:       # then change $ccbase and make the default xlc flags available.
        !          1129:       if test $ccbase != xlc; then
        !          1130:         GMP_PROG_CC_IS_XLC($cc,ccbase=xlc)
        !          1131:       fi
        !          1132:
        !          1133:       # Any user CFLAGS, even an empty string, takes precendence
        !          1134:                            eval cflags=\"\$${ccbase}${abi1}_cflags\"
        !          1135:       test -n "$cflags" || eval cflags=\"\$${ccbase}${abi2}_cflags\"
        !          1136:       if test "$test_CFLAGS" = set; then cflags=$CFLAGS; fi
        !          1137:
        !          1138:       # Any user CPPFLAGS, even an empty string, takes precendence
        !          1139:                              eval cppflags=\"\$${ccbase}${abi1}_cppflags\"
        !          1140:       test -n "$cppflags" || eval cppflags=\"\$${ccbase}${abi2}_cppflags\"
        !          1141:       if test "$test_CPPFLAGS" = set; then cppflags=$CPPFLAGS; fi
        !          1142:
        !          1143:       # --enable-profiling adds -p/-pg even to user-specified CFLAGS.
        !          1144:       # This is convenient, but it's perhaps a bit naughty to modify user
        !          1145:       # CFLAGS.
        !          1146:       case "$enable_profiling" in
        !          1147:       prof)  cflags="$cflags -p" ;;
        !          1148:       gprof) cflags="$cflags -pg" ;;
        !          1149:       esac
        !          1150:
        !          1151:       GMP_PROG_CC_WORKS($cc $cflags $cppflags,,continue)
        !          1152:
        !          1153:       # The tests to perform on this $cc, if any
        !          1154:                              eval testlist=\"\$${ccbase}${abi1}_testlist\"
        !          1155:       test -n "$testlist" || eval testlist=\"\$${ccbase}${abi2}_testlist\"
        !          1156:
        !          1157:       testlist_pass=yes
        !          1158:       for tst in $testlist; do
        !          1159:         case $tst in
        !          1160:         hpc-hppa-2-0)   GMP_HPC_HPPA_2_0($cc,,testlist_pass=no) ;;
        !          1161:         gcc-arm-umodsi) GMP_GCC_ARM_UMODSI($cc,,testlist_pass=no) ;;
        !          1162:         gcc-mips-o32)   GMP_GCC_MIPS_O32($cc,,testlist_pass=no) ;;
        !          1163:         esac
        !          1164:         if test $testlist_pass = no; then break; fi
        !          1165:       done
        !          1166:
        !          1167:       if test $testlist_pass = yes; then
        !          1168:         found_compiler=yes
        !          1169:         break
        !          1170:       fi
        !          1171:     done
        !          1172:
        !          1173:     if test $found_compiler = yes; then break; fi
        !          1174:   done
        !          1175:
        !          1176:   if test $found_compiler = yes; then break; fi
        !          1177: done
1.1.1.2   maekawa  1178:
                   1179:
1.1.1.4 ! ohara    1180: # If we recognised the CPU, as indicated by $path being set, then insist
        !          1181: # that we have a working compiler, either from our $cclist choices or from
        !          1182: # $CC.  We can't let AC_PROG_CC look around for a compiler because it might
        !          1183: # find one that we've rejected (for not supporting the modes our asm code
        !          1184: # demands, etc).
        !          1185: #
        !          1186: # If we didn't recognise the CPU (and this includes host_cpu=none), then
        !          1187: # fall through and let AC_PROG_CC look around for a compiler too.  This is
        !          1188: # mostly in the interests of following a standard autoconf setup, after all
        !          1189: # we've already tested cc and gcc adequately (hopefully).  As of autoconf
        !          1190: # 2.50 the only thing AC_PROG_CC really adds is a check for "cl" (Microsoft
        !          1191: # C on MS-DOS systems).
        !          1192: #
        !          1193: if test $found_compiler = no && test -n "$path"; then
        !          1194:   AC_MSG_ERROR([could not find a working compiler])
1.1.1.2   maekawa  1195: fi
                   1196:
                   1197:
1.1.1.4 ! ohara    1198: if test $found_compiler = yes; then
        !          1199:
        !          1200:   # If we're creating CFLAGS, then look for optional additions.  If the user
        !          1201:   # set CFLAGS then leave it alone.
        !          1202:   #
        !          1203:   if test "$test_CFLAGS" != set; then
        !          1204:                           eval optlist=\"\$${ccbase}${abi1}_cflags_optlist\"
        !          1205:     test -n "$optlist" || eval optlist=\"\$${ccbase}${abi2}_cflags_optlist\"
        !          1206:
        !          1207:     for opt in $optlist; do
        !          1208:                              eval optflags=\"\$${ccbase}${abi1}_cflags_${opt}\"
        !          1209:       test -n "$optflags" || eval optflags=\"\$${ccbase}${abi2}_cflags_${opt}\"
        !          1210:       test -n "$optflags" || eval optflags=\"\$${ccbase}_cflags_${opt}\"
        !          1211:
        !          1212:       for flag in $optflags; do
        !          1213:
        !          1214:        # ~ respresents a space in an option spec
        !          1215:         flag=`echo "$flag" | tr '~' ' '`
        !          1216:
        !          1217:         case $flag in
        !          1218:           -O*)
        !          1219:             # ease back to just -O on m68k gcc 2.95.x
        !          1220:             GMP_GCC_M68K_OPTIMIZE($ccbase,$cc,flag)
        !          1221:             ;;
        !          1222:           -no-cpp-precomp)
        !          1223:             # special check, avoiding a warning
        !          1224:             GMP_GCC_NO_CPP_PRECOMP($ccbase,$cc,$cflags,
        !          1225:                                    [cflags="$cflags $flag"
        !          1226:                                    break],
        !          1227:                                    [continue])
        !          1228:             ;;
        !          1229:           -Wa,-m*)
        !          1230:             case $host in
        !          1231:               alpha*-*-*)
        !          1232:                 GMP_GCC_WA_MCPU($cc $cflags, $flag, , [continue])
        !          1233:               ;;
        !          1234:             esac
        !          1235:             ;;
        !          1236:         esac
        !          1237:
        !          1238:         GMP_PROG_CC_WORKS($cc $cflags $cppflags $flag,
        !          1239:           [cflags="$cflags $flag"
        !          1240:           break])
        !          1241:       done
        !          1242:     done
        !          1243:   fi
        !          1244:
        !          1245:   ABI="$abi"
        !          1246:   CC="$cc"
        !          1247:   CFLAGS="$cflags"
        !          1248:   CPPFLAGS="$cppflags"
        !          1249:
        !          1250:
        !          1251:   # Could easily have this in config.h too, if desired.
        !          1252:   ABI_nodots=`echo $ABI | sed 's/\./_/'`
        !          1253:   GMP_DEFINE_RAW("define_not_for_expansion(\`HAVE_ABI_$ABI_nodots')", POST)
        !          1254:
        !          1255:
        !          1256:   # GMP_LDFLAGS substitution, selected according to ABI.
        !          1257:   # These are needed on libgmp.la and libmp.la, but currently not on
        !          1258:   # convenience libraries like tune/libspeed.la or mpz/libmpz.la.
        !          1259:   #
        !          1260:                             eval GMP_LDFLAGS=\"\$${ccbase}${abi1}_ldflags\"
        !          1261:   test -n "$GMP_LDFLAGS" || eval GMP_LDFLAGS=\"\$${ccbase}${abi1}_ldflags\"
        !          1262:   AC_SUBST(GMP_LDFLAGS)
        !          1263:
        !          1264:   # extra_functions, selected according to ABI
        !          1265:                     eval tmp=\"\$extra_functions$abi1\"
        !          1266:   test -n "$tmp" || eval tmp=\"\$extra_functions$abi2\"
        !          1267:   extra_functions="$tmp"
        !          1268:
        !          1269:
        !          1270:   # Cycle counter, selected according to ABI.
        !          1271:   #
        !          1272:                     eval tmp=\"\$SPEED_CYCLECOUNTER_OBJ$abi1\"
        !          1273:   test -n "$tmp" || eval tmp=\"\$SPEED_CYCLECOUNTER_OBJ$abi2\"
        !          1274:   SPEED_CYCLECOUNTER_OBJ="$tmp"
        !          1275:                     eval tmp=\"\$cyclecounter_size$abi1\"
        !          1276:   test -n "$tmp" || eval tmp=\"\$cyclecounter_size$abi2\"
        !          1277:   cyclecounter_size="$tmp"
        !          1278:
        !          1279:   if test -n "$SPEED_CYCLECOUNTER_OBJ"; then
        !          1280:     AC_DEFINE_UNQUOTED(HAVE_SPEED_CYCLECOUNTER, $cyclecounter_size,
        !          1281:     [Tune directory speed_cyclecounter, undef=none, 1=32bits, 2=64bits)])
        !          1282:   fi
        !          1283:   AC_SUBST(SPEED_CYCLECOUNTER_OBJ)
        !          1284:
        !          1285:
        !          1286:   # Calling conventions checking, selected according to ABI.
        !          1287:   #
        !          1288:                     eval tmp=\"\$CALLING_CONVENTIONS_OBJS$abi1\"
        !          1289:   test -n "$tmp" || eval tmp=\"\$CALLING_CONVENTIONS_OBJS$abi2\"
        !          1290:   CALLING_CONVENTIONS_OBJS="$tmp"
        !          1291:
        !          1292:   if test -n "$CALLING_CONVENTIONS_OBJS"; then
        !          1293:     AC_DEFINE(HAVE_CALLING_CONVENTIONS,1,
        !          1294:     [Define if tests/libtests has calling conventions checking for the CPU])
        !          1295:   fi
        !          1296:   AC_SUBST(CALLING_CONVENTIONS_OBJS)
        !          1297:
        !          1298: fi
        !          1299:
        !          1300:
        !          1301: # If the user gave an MPN_PATH, use that verbatim, otherwise choose
        !          1302: # according to the ABI and add "generic".
        !          1303: #
        !          1304: if test -n "$MPN_PATH"; then
        !          1305:   path="$MPN_PATH"
        !          1306: else
        !          1307:                     eval tmp=\"\$path$abi1\"
        !          1308:   test -n "$tmp" || eval tmp=\"\$path$abi2\"
        !          1309:   path="$tmp generic"
        !          1310: fi
        !          1311:
        !          1312:
        !          1313: # Whether using a long long limb in this ABI.
        !          1314:                           eval limb_chosen=\"\$limb$abi1\"
        !          1315: test -n "$limb_chosen" || eval limb_chosen=\"\$limb$abi2\"
        !          1316: case $limb_chosen in
        !          1317: longlong) DEFN_LONG_LONG_LIMB="#define _LONG_LONG_LIMB 1"    ;;
        !          1318: *)        DEFN_LONG_LONG_LIMB="/* #undef _LONG_LONG_LIMB */" ;;
1.1.1.2   maekawa  1319: esac
1.1.1.4 ! ohara    1320: AC_SUBST(DEFN_LONG_LONG_LIMB)
        !          1321:
        !          1322:
        !          1323: # The C compiler and preprocessor, put into ANSI mode if possible.
        !          1324: AC_PROG_CC
        !          1325: AC_PROG_CC_STDC
        !          1326: AC_PROG_CPP
        !          1327: GMP_H_ANSI
1.1.1.2   maekawa  1328:
                   1329:
1.1.1.4 ! ohara    1330: # The C++ compiler, if desired.
        !          1331: want_cxx=no
        !          1332: if test $enable_cxx != no; then
        !          1333:   test_CXXFLAGS=${CXXFLAGS+set}
        !          1334:   AC_PROG_CXX
        !          1335:
        !          1336:   echo "CXXFLAGS chosen by autoconf: $CXXFLAGS" >&AC_FD_CC
        !          1337:   cxxflags_ac_prog_cxx=$CXXFLAGS
        !          1338:   cxxflags_list=ac_prog_cxx
        !          1339:
        !          1340:   # If the user didn't specify $CXXFLAGS, then try $CFLAGS, with -g removed
        !          1341:   # if AC_PROG_CXX thinks that doesn't work.  $CFLAGS stands a good chance
        !          1342:   # of working, eg. on a GNU system where CC=gcc and CXX=g++.
        !          1343:   #
        !          1344:   if test "$test_CXXFLAGS" != set; then
        !          1345:     cxxflags_cflags=$CFLAGS
        !          1346:     cxxflags_list="cflags $cxxflags_list"
        !          1347:     if test "$ac_prog_cxx_g" = no; then
        !          1348:       cxxflags_cflags=`echo "$cxxflags_cflags" | sed -e 's/ -g //' -e 's/^-g //' -e 's/ -g$//'`
        !          1349:     fi
        !          1350:   fi
        !          1351:
        !          1352:   # See if the C++ compiler works.  If the user specified CXXFLAGS then all
        !          1353:   # we're doing is checking whether AC_PROG_CXX succeeded, since it doesn't
        !          1354:   # give a fatal error, just leaves CXX set to a default g++.  If on the
        !          1355:   # other hand the user didn't specify CXXFLAGS then we get to try here our
        !          1356:   # $cxxflags_list alternatives.
        !          1357:   #
        !          1358:   for cxxflags_choice in $cxxflags_list; do
        !          1359:     eval CXXFLAGS=\"\$cxxflags_$cxxflags_choice\"
        !          1360:     GMP_PROG_CXX_WORKS($CXX $CXXFLAGS,
        !          1361:       [want_cxx=yes
        !          1362:       break])
        !          1363:   done
        !          1364:
        !          1365:   # If --enable-cxx=yes but a C++ compiler can't be found, then abort.
        !          1366:   if test $want_cxx = no && test $enable_cxx = yes; then
        !          1367:     AC_MSG_ERROR([C++ compiler not available])
        !          1368:   fi
1.1.1.2   maekawa  1369: fi
                   1370:
1.1.1.4 ! ohara    1371: AM_CONDITIONAL(WANT_CXX, test $want_cxx = yes)
1.1.1.2   maekawa  1372:
1.1.1.4 ! ohara    1373: # FIXME: We're not interested in CXXCPP for ourselves, but if we don't call
        !          1374: # it here then AC_PROG_LIBTOOL (via _LT_AC_TAGCONFIG) will do so
        !          1375: # unconditionally, and that will fail if there's no C++ compiler (and no
        !          1376: # generic /lib/cpp).
        !          1377: #
        !          1378: if test $want_cxx = yes; then
        !          1379:   AC_PROG_CXXCPP
        !          1380: fi
1.1.1.2   maekawa  1381:
1.1.1.4 ! ohara    1382: case $host_cpu in
        !          1383:   c90 | t90)
        !          1384:     AC_EGREP_CPP(yes,
        !          1385: [#ifdef _CRAYIEEE
        !          1386: yes
        !          1387: #endif],
        !          1388:     [add_path="cray/ieee"],
        !          1389:     [add_path="cray/cfp"; extra_functions="mulwwc90"]) ;;
        !          1390:   j90 | sv1)
        !          1391:     extra_functions="mulwwj90"
        !          1392:     add_path="cray/cfp" ;;
1.1.1.2   maekawa  1393: esac
                   1394:
1.1.1.4 ! ohara    1395: if test -z "$MPN_PATH"; then
        !          1396:   path="$add_path $path"
        !          1397: fi
1.1.1.2   maekawa  1398:
1.1.1.4 ! ohara    1399: # for a nail build, also look in "nails" subdirectories
        !          1400: if test $GMP_NAIL_BITS != 0 && test -z "$MPN_PATH"; then
        !          1401:   new_path=
        !          1402:   for i in $path; do
        !          1403:     case $i in
        !          1404:     generic) new_path="$new_path $i" ;;
        !          1405:     *)       new_path="$new_path $i/nails $i" ;;
        !          1406:     esac
        !          1407:   done
        !          1408:   path=$new_path
        !          1409: fi
1.1.1.2   maekawa  1410:
                   1411:
1.1.1.4 ! ohara    1412: cat >&AC_FD_CC <<EOF
        !          1413: configure:__line__: Decided:
        !          1414: ABI=$ABI
        !          1415: CC=$CC
        !          1416: CFLAGS=$CFLAGS
        !          1417: CPPFLAGS=$CPPFLAGS
        !          1418: GMP_LDFLAGS=$GMP_LDFLAGS
        !          1419: CXX=$CXX
        !          1420: CXXFLAGS=$CXXFLAGS
        !          1421: path=$path
        !          1422: EOF
        !          1423: echo "using ABI=\"$ABI\""
        !          1424: echo "      CC=\"$CC\""
        !          1425: echo "      CFLAGS=\"$CFLAGS\""
        !          1426: echo "      CPPFLAGS=\"$CPPFLAGS\""
        !          1427: if test $want_cxx = yes; then
        !          1428:   echo "      CXX=\"$CXX\""
        !          1429:   echo "      CXXFLAGS=\"$CXXFLAGS\""
        !          1430: fi
        !          1431: echo "      MPN_PATH=\"$path\""
        !          1432:
        !          1433:
        !          1434: # Automake ansi2knr support.
1.1.1.2   maekawa  1435: AM_C_PROTOTYPES
                   1436:
1.1.1.4 ! ohara    1437: GMP_PROG_AR
        !          1438: GMP_PROG_NM
1.1.1.2   maekawa  1439:
1.1.1.4 ! ohara    1440: case $host in
        !          1441:   # FIXME: On AIX 3 and 4, $libname.a is included in libtool
        !          1442:   # $library_names_spec, so libgmp.a becomes a symlink to libgmp.so, making
        !          1443:   # it impossible to build shared and static libraries simultaneously.
        !          1444:   # Disable shared libraries by default, but let the user override with
        !          1445:   # --enable-shared --disable-static.
        !          1446:   #
        !          1447:   # FIXME: This $libname.a problem looks like it might apply to *-*-amigaos*
        !          1448:   # and *-*-os2* too, but wait for someone to test this before worrying
        !          1449:   # about it.  If there is a problem then of course libtool is the right
        !          1450:   # place to fix it.
        !          1451:   #
        !          1452:   [*-*-aix[34]*])
        !          1453:     if test -z "$enable_shared"; then enable_shared=no; fi ;;
        !          1454:
        !          1455:   # FIXME: Libtool recognises djgpp can't build shared libraries, but still
        !          1456:   # makes tests/.libs/libtests.al out of PIC objects, which then fail to
        !          1457:   # link into the test programs.  Forcibly disable shared stuff until
        !          1458:   # libtool gets it right,
        !          1459:   #
        !          1460:   *-*-msdosdjgpp*)
        !          1461:     enable_shared=no ;;
        !          1462:
        !          1463:   # FIXME: On SCO 5, an explicit -lc is not wanted when making shared
        !          1464:   # libraries.  Giving it makes strange things happen, like ctype.h macros
        !          1465:   # not working and profiler mcount calls segfaulting.  Libtool ought to
        !          1466:   # know about this, but as of Dec 2000 it doesn't, so forcibly disable -lc
        !          1467:   # on relevant systems.
        !          1468:   #
        !          1469:   *-*-sco3.2v5*)
        !          1470:     lt_cv_archive_cmds_need_lc=no ;;
        !          1471:
        !          1472:   # FIXME: Shared libraries aren't supported on unicos, but as of Dec 2000
        !          1473:   # libtool doesn't seem to detect this correctly, so forcibly disable them.
        !          1474:   #
        !          1475:   *-*-unicos*)
        !          1476:     enable_shared=no ;;
        !          1477:
        !          1478:   # It seems there are no shared libs on ultrix, and it is not very important
        !          1479:   # to work on this.  Just disable for now.
        !          1480:   *-*-ultrix*)
        !          1481:     enable_shared=no ;;
        !          1482: esac
        !          1483:
        !          1484: # FIXME: AC_LIBTOOL_SYS_MAX_CMD_LEN has been reported to blow up in some
        !          1485: # fashion on windows 9x (but not 2k), taking a very long time and
        !          1486: # temporarily locking the whole PC.  Clearly this is a libtool problem, but
        !          1487: # for now force a sensible value to avoid the test.
        !          1488: #
        !          1489: case $build in
        !          1490:   *-*-cygwin*)
        !          1491:     if test -z "$lt_cv_sys_max_cmd_len"; then
        !          1492:       lt_cv_sys_max_cmd_len=20000
        !          1493:     fi
        !          1494:     ;;
1.1.1.2   maekawa  1495: esac
                   1496:
                   1497:
1.1.1.4 ! ohara    1498: # Configs for Windows DLLs.
        !          1499:
        !          1500: AC_LIBTOOL_WIN32_DLL
        !          1501:
        !          1502: AC_SUBST(LIBGMP_DLL,0)
        !          1503: case $host in
        !          1504:   *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
        !          1505:     # By default, build only static.
        !          1506:     if test -z "$enable_shared"; then
        !          1507:       enable_shared=no
        !          1508:     fi
        !          1509:     # Don't allow both static and DLL.
        !          1510:     if test "$enable_shared" != no && test "$enable_static" != no; then
        !          1511:       AC_MSG_ERROR([cannot build both static and DLL, since gmp.h is different for each.
        !          1512: Use "--disable-static --enable-shared" to build just a DLL.])
        !          1513:     fi
        !          1514:     if test "$enable_shared" = yes; then
        !          1515:       # libtool requires "-no-undefined", see AC_LIBTOOL_WIN32_DLL doco.
        !          1516:       GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined"
        !          1517:       LIBGMP_DLL=1
        !          1518:     fi
1.1.1.2   maekawa  1519:     ;;
1.1.1.4 ! ohara    1520: esac
        !          1521:
        !          1522: # When cross compiling a DLL, libtool requires $HOST_CC, to compile impgen.c
        !          1523: # on the build system.  It's a well-known misfeature that libtool doesn't
        !          1524: # hunt around for a useful HOST_CC on its own.
        !          1525: # FIXME: Newer libtool looks like it'll need this only for "*-*-mingw* |
        !          1526: # *-*-pw32*", not *-*-cygwin*.
        !          1527: #
        !          1528: case $host in
        !          1529:   *-*-cygwin* | *-*-mingw* | *-*-pw32*)
        !          1530:     if test "$cross_compiling" != no && test "$enable_shared" != no; then
        !          1531:       GMP_PROG_HOST_CC
        !          1532:     fi
1.1.1.2   maekawa  1533:     ;;
1.1.1.4 ! ohara    1534: esac
        !          1535:
        !          1536:
        !          1537: # Ensure that $CONFIG_SHELL is available for AC_LIBTOOL_SYS_MAX_CMD_LEN.
        !          1538: # It's often set already by _LT_AC_PROG_ECHO_BACKSLASH or
        !          1539: # _AS_LINENO_PREPARE, but not always.
        !          1540: #
        !          1541: # The symptom of CONFIG_SHELL unset is some "expr" errors during the test,
        !          1542: # and an empty result.  This only happens when invoked as "sh configure",
        !          1543: # ie. no path, and can be seen for instance on ia64-*-hpux*.
        !          1544: #
        !          1545: # FIXME: Newer libtool should have it's own fix for this.
        !          1546: #
        !          1547: if test -z "$CONFIG_SHELL"; then
        !          1548:   CONFIG_SHELL=$SHELL
        !          1549: fi
        !          1550:
        !          1551: # Enable CXX in libtool only if we want it, and never enable GCJ, nor RC on
        !          1552: # mingw and cygwin.  Under --disable-cxx this avoids some error messages
        !          1553: # from libtool arising from the fact we didn't actually run AC_PROG_CXX.
        !          1554: # Notice that any user-supplied --with-tags setting takes precedence.
        !          1555: #
        !          1556: # FIXME: Is this the right way to get this effect?  Very possibly not, but
        !          1557: # the current _LT_AC_TAGCONFIG doesn't really suggest an alternative.
        !          1558: #
        !          1559: if test "${with_tags+set}" != set; then
        !          1560:   if test $want_cxx = yes; then
        !          1561:     with_tags=CXX
        !          1562:   else
        !          1563:     with_tags=
        !          1564:   fi
        !          1565: fi
        !          1566:
        !          1567: AC_PROG_LIBTOOL
        !          1568:
        !          1569: # Generate an error here if attempting to build both shared and static when
        !          1570: # $libname.a is in $library_names_spec (as mentioned above), rather than
        !          1571: # wait for ar or ld to fail.
        !          1572: #
        !          1573: if test "$enable_shared" = yes && test "$enable_static" = yes; then
        !          1574:   case $library_names_spec in
        !          1575:     *libname.a*)
        !          1576:       AC_MSG_ERROR([cannot create both shared and static libraries on this system, --disable one of the two])
        !          1577:       ;;
        !          1578:   esac
        !          1579: fi
        !          1580:
        !          1581:
        !          1582: # How to assemble, used with CFLAGS etc, see mpn/Makeasm.am.
        !          1583: # Using the compiler is a lot easier than figuring out how to invoke the
        !          1584: # assembler directly.
        !          1585: #
        !          1586: test -n "$CCAS" || CCAS="$CC -c"
        !          1587: AC_SUBST(CCAS)
        !          1588:
        !          1589: case $host in
        !          1590:   X86_PATTERN)
        !          1591:     # If there's any sse2 or mmx in the path, check whether the assembler
        !          1592:     # supports it, and remove if not.
        !          1593:     case "$path" in
        !          1594:       *mmx*)   GMP_ASM_X86_MMX( , [GMP_STRIP_PATH(*mmx*)]) ;;
1.1.1.2   maekawa  1595:     esac
1.1.1.4 ! ohara    1596:     case "$path" in
        !          1597:       *sse2*)  GMP_ASM_X86_SSE2( , [GMP_STRIP_PATH(sse2)]) ;;
        !          1598:     esac
        !          1599:   ;;
1.1.1.2   maekawa  1600: esac
                   1601:
                   1602:
1.1.1.4 ! ohara    1603: # The library and header checks are mostly for the benefit of supplementary
        !          1604: # programs.  libgmp doesn't use anything too weird.
1.1.1.2   maekawa  1605:
1.1.1.4 ! ohara    1606: AC_HEADER_STDC
        !          1607: AC_HEADER_TIME
1.1.1.2   maekawa  1608:
1.1.1.4 ! ohara    1609: # Reasons for testing:
        !          1610: #   sys/param.h - not in mingw
        !          1611: #   sys/processor.h - solaris specific, though also present in macos
        !          1612: #   sys/resource.h - not in mingw
        !          1613: #   sys/sysctl.h - not in mingw
        !          1614: #   sys/syssgi.h - IRIX specific
        !          1615: #   sys/systemcfg.h - AIX specific
        !          1616: #   sys/times.h - not in mingw
        !          1617: #
        !          1618: # inttypes.h, stdint.h, unistd.h and sys/types.h are already in the autoconf
        !          1619: # default tests
        !          1620: #
        !          1621: AC_CHECK_HEADERS(fcntl.h locale.h sys/mman.h sys/param.h sys/processor.h sys/resource.h sys/sysctl.h sys/syssgi.h sys/systemcfg.h sys/time.h sys/times.h)
        !          1622:
        !          1623: # optarg should be in unistd.h, which is already in the default includes
        !          1624: AC_CHECK_DECLS([fgetc, fscanf, optarg, ungetc, vfprintf])
        !          1625:
        !          1626: AC_TYPE_SIGNAL
        !          1627:
        !          1628: # the default includes are sufficient for all these types
        !          1629: AC_CHECK_TYPES([intmax_t, long double, long long, ptrdiff_t, quad_t])
        !          1630:
        !          1631: AC_C_STRINGIZE
        !          1632: AC_C_VOLATILE
        !          1633: GMP_C_STDARG
        !          1634: GMP_C_ATTRIBUTE_CONST
        !          1635: GMP_C_ATTRIBUTE_MALLOC
        !          1636: GMP_C_ATTRIBUTE_MODE
        !          1637: GMP_C_ATTRIBUTE_NORETURN
        !          1638:
        !          1639: GMP_C_INLINE
        !          1640: GMP_H_EXTERN_INLINE
        !          1641:
        !          1642: # from libtool
        !          1643: AC_CHECK_LIBM
        !          1644: AC_SUBST(LIBM)
        !          1645:
        !          1646: GMP_FUNC_ALLOCA
        !          1647: GMP_OPTION_ALLOCA
        !          1648:
        !          1649: GMP_H_HAVE_FILE
        !          1650: GMP_IMPL_H_IEEE_FLOATS
        !          1651:
        !          1652: # FIXME: Autoconf 2.52 AC_C_BIGENDIAN bombs when cross compiling, but in the
        !          1653: # future the probes will be better and this override can be removed.
        !          1654: if test "$cross_compiling" = yes; then
        !          1655:   ac_cv_c_bigendian=unknown
        !          1656: fi
        !          1657: AC_C_BIGENDIAN
        !          1658: # Enhancement: In the future AC_C_BIGENDIAN will accept these actions as
        !          1659: # parameters.
        !          1660: case $ac_cv_c_bigendian in
        !          1661:   yes)     AC_DEFINE(HAVE_LIMB_BIG_ENDIAN, 1) ;;
        !          1662:   no)      AC_DEFINE(HAVE_LIMB_LITTLE_ENDIAN, 1) ;;
        !          1663:   unknown) ;;
        !          1664:   *)       AC_MSG_ERROR([Oops, unrecognised ac_cv_c_bigendian]) ;;
        !          1665: esac
        !          1666: AH_VERBATIM([HAVE_LIMB],
        !          1667: [/* Define one (just one) of the following for the endiannes of `mp_limb_t'.
        !          1668:    If the endianness is not a simple big or little, or you don't know what
        !          1669:    it is, then leave both of these undefined. */
        !          1670: #undef HAVE_LIMB_BIG_ENDIAN
        !          1671: #undef HAVE_LIMB_LITTLE_ENDIAN])
        !          1672:
        !          1673: GMP_C_DOUBLE_FORMAT
        !          1674:
        !          1675:
        !          1676: # On m68k NetBSD 1.4.1 getrusage() is doubtful.  ru_utime looks microsecond
        !          1677: # accurate but has been seen remaining unchanged after many microseconds
        !          1678: # have elapsed.  This upsets the tune and speed programs, so pretend it
        !          1679: # doesn't exist.
        !          1680: #
        !          1681: # FIXME: Would prefer tune/time.c to do a run-time test for this rather than
        !          1682: # driving it from the system name.
        !          1683: #
        !          1684: case $host in
        !          1685:   m68*-*-netbsd1.4*) ac_cv_func_getrusage=no ;;
        !          1686: esac
        !          1687:
        !          1688: # Reasons for testing:
        !          1689: #   alarm - not in mingw
        !          1690: #   clock_gettime - not in glibc 2.2.4, only very recent systems
        !          1691: #   cputime - not in glibc
        !          1692: #   gettimeofday - not in mingw
        !          1693: #   mmap - not in mingw, djgpp
        !          1694: #   obstack_vprintf - glibc specific
        !          1695: #   processor_info - solaris specific
        !          1696: #   read_real_time - AIX specific
        !          1697: #   sigaction - not in mingw
        !          1698: #   sigaltstack - not in mingw, old AIX (reputedly)
        !          1699: #   sigstack - not in mingw
        !          1700: #   strnlen - glibc extension
        !          1701: #   syssgi - IRIX specific
        !          1702: #   times - not in mingw
        !          1703: #
        !          1704: # clock_gettime is in librt on *-*-osf5.1.  We could look for it
        !          1705: # there, but that's not worth bothering with unless it has a decent
        !          1706: # resolution (in a quick test clock_getres said only 1 millisecond).
        !          1707: #
        !          1708: AC_CHECK_FUNCS(alarm clock clock_gettime cputime getpagesize getrusage gettimeofday localeconv memset mmap mprotect obstack_vprintf popen processor_info read_real_time sigaction sigaltstack sigstack syssgi strchr strnlen strtoul sysconf sysctl sysctlbyname times)
        !          1709:
        !          1710: # FIXME: Would have done this with an AM_CONDITIONAL, but automake 1.5
        !          1711: # doesn't like that under libgmp_la_DEPENDENCIES.
        !          1712: GMP_FUNC_VSNPRINTF
        !          1713: if test "$gmp_cv_func_vsnprintf" = no; then
        !          1714:   AC_SUBST(REPL_VSNPRINTF_PRINTF_OBJ, 'printf/repl-vsnprintf$U.lo')
        !          1715:   AC_SUBST(REPL_VSNPRINTF_OBJ,        'repl-vsnprintf$U.lo')
1.1.1.2   maekawa  1716: fi
                   1717:
1.1.1.4 ! ohara    1718: GMP_FUNC_SSCANF_WRITABLE_INPUT
        !          1719:
        !          1720:
1.1.1.2   maekawa  1721: # Pick the correct source files in $path and link them to mpn/.
                   1722: # $gmp_mpn_functions lists all functions we need.
                   1723: #
                   1724: # The rule is to find a file with the function name and a .asm, .S,
                   1725: # .s, or .c extension.  Certain multi-function files with special names
                   1726: # can provide some functions too.  (mpn/Makefile.am passes
                   1727: # -DOPERATION_<func> to get them to generate the right code.)
                   1728:
                   1729: # FIXME: udiv and umul aren't in $gmp_mpn_functions_optional yet since
                   1730: # there's some versions of those files which should be checked for bit
1.1.1.4 ! ohara    1731: # rot first.  Put them in $extra_functions for each host for now,
1.1.1.2   maekawa  1732: # change to standard optionals when all are ready.
                   1733:
                   1734: # Note: The following lines defining $gmp_mpn_functions_optional
                   1735: #       and $gmp_mpn_functions are parsed by the "macos/configure"
                   1736: #       Perl script. So if you change the lines in a major way
                   1737: #       make sure to run and examine the output from
                   1738: #
                   1739: #           % (cd macos; perl configure)
1.1.1.4 ! ohara    1740: #
        !          1741: # Note: $gmp_mpn_functions must have mod_1 before pre_mod_1 so the former
        !          1742: #       can optionally provide the latter as an extra entrypoint.  Likewise
        !          1743: #       divrem_1 and pre_divrem_1.
        !          1744:
        !          1745: gmp_mpn_functions_optional="copyi copyd com_n
        !          1746:   and_n andn_n nand_n ior_n iorn_n nior_n xor_n xnor_n                 \
        !          1747:   gcd_finda invert_limb sqr_diagonal                                   \
        !          1748:   mul_2 mul_3 mul_4 addmul_2 addmul_3 addmul_4"
        !          1749:
        !          1750: gmp_mpn_functions="$extra_functions                                       \
        !          1751:   add add_1 add_n sub sub_1 sub_n mul_1 addmul_1                          \
        !          1752:   submul_1 lshift rshift dive_1 diveby3 divis divrem divrem_1 divrem_2     \
        !          1753:   fib2_ui mod_1 mod_34lsub1 mode1o pre_divrem_1 pre_mod_1 dump             \
        !          1754:   mul mul_fft mul_n mul_basecase sqr_basecase random random2 pow_1        \
        !          1755:   rootrem sqrtrem get_str set_str scan0 scan1 popcount hamdist cmp perfsqr \
        !          1756:   bdivmod gcd_1 gcd gcdext tdiv_qr dc_divrem_n sb_divrem_mn jacbase        \
1.1.1.2   maekawa  1757:   $gmp_mpn_functions_optional"
                   1758:
                   1759: # the list of all object files used by mpn/Makefile.in and the
                   1760: # top-level Makefile.in, respectively
                   1761: mpn_objects=
                   1762: mpn_objs_in_libgmp="mpn/mp_bases.lo"
                   1763:
1.1.1.4 ! ohara    1764: # links from the sources, to be removed by "make distclean"
        !          1765: gmp_srclinks=
        !          1766:
        !          1767: define(MPN_SUFFIXES,[asm S s c])
        !          1768:
        !          1769: for tmp_ext in MPN_SUFFIXES; do
        !          1770:   eval found_$tmp_ext=no
        !          1771: done
        !          1772:
        !          1773: for tmp_fn in $gmp_mpn_functions; do
        !          1774:   for tmp_ext in MPN_SUFFIXES; do
        !          1775:     test "$no_create" = yes || rm -f mpn/$tmp_fn.$tmp_ext
        !          1776:   done
        !          1777:
        !          1778:   # mpn_preinv_divrem_1 might have been provided by divrem_1.asm, likewise
        !          1779:   # mpn_preinv_mod_1 by mod_1.asm.
        !          1780:   case $tmp_fn in
        !          1781:   pre_divrem_1)
        !          1782:     if test "$HAVE_NATIVE_mpn_preinv_divrem_1" = yes; then continue; fi ;;
        !          1783:   pre_mod_1)
        !          1784:     if test "$HAVE_NATIVE_mpn_preinv_mod_1" = yes; then continue; fi ;;
        !          1785:   esac
1.1.1.2   maekawa  1786:
                   1787:   # functions that can be provided by multi-function files
                   1788:   tmp_mulfunc=
                   1789:   case $tmp_fn in
                   1790:   add_n|sub_n)       tmp_mulfunc="aors_n"    ;;
                   1791:   addmul_1|submul_1) tmp_mulfunc="aorsmul_1" ;;
                   1792:   popcount|hamdist)  tmp_mulfunc="popham"    ;;
                   1793:   and_n|andn_n|nand_n | ior_n|iorn_n|nior_n | xor_n|xnor_n)
                   1794:                      tmp_mulfunc="logops_n"  ;;
1.1.1.4 ! ohara    1795:   lshift|rshift)     tmp_mulfunc="lorrshift";;
1.1.1.2   maekawa  1796:   esac
                   1797:
                   1798:   found=no
                   1799:   for tmp_dir in $path; do
                   1800:     for tmp_base in $tmp_fn $tmp_mulfunc; do
1.1.1.4 ! ohara    1801:       for tmp_ext in MPN_SUFFIXES; do
1.1.1.2   maekawa  1802:         tmp_file=$srcdir/mpn/$tmp_dir/$tmp_base.$tmp_ext
                   1803:         if test -f $tmp_file; then
1.1.1.4 ! ohara    1804:
        !          1805:           # For a nails build, check if the file supports our nail bits.
        !          1806:           # Generic code always supports all nails.
        !          1807:           #
        !          1808:           # FIXME: When a multi-function file is selected to provide one of
        !          1809:           # the nails-neutral routines, like logops_n for and_n, the
        !          1810:           # PROLOGUE grepping will create HAVE_NATIVE_mpn_<foo> defines for
        !          1811:           # all functions in that file, even if they haven't all been
        !          1812:           # nailified.  Not sure what to do about this, it's only really a
        !          1813:           # problem for logops_n, and it's not too terrible to insist those
        !          1814:           # get nailified alwasy.
        !          1815:           #
        !          1816:           if test $GMP_NAIL_BITS != 0 && test $tmp_dir != generic; then
        !          1817:             case $tmp_fn in
        !          1818:               and_n | ior_n | xor_n | \
        !          1819:               copyi | copyd | \
        !          1820:               popcount | hamdist | \
        !          1821:               udiv | udiv_qrnnd | udiv_w_sdiv | udiv_fp | udiv_nfp | \
        !          1822:               umul | umul_ppmm | \
        !          1823:               cntlz | invert_limb)
        !          1824:                 # these operations are either unaffected by nails or defined
        !          1825:                 # to operate on full limbs
        !          1826:                 ;;
        !          1827:               *)
        !          1828:                 nails=[`sed -n 's/^[   ]*NAILS_SUPPORT(\(.*\))/\1/p' $tmp_file `]
        !          1829:                 for n in $nails; do
        !          1830:                   case $n in
        !          1831:                   *-*)
        !          1832:                     n_start=`echo "$n" | sed -n 's/\(.*\)-.*/\1/p'`
        !          1833:                     n_end=`echo "$n" | sed -n 's/.*-\(.*\)/\1/p'`
        !          1834:                     ;;
        !          1835:                   *)
        !          1836:                     n_start=$n
        !          1837:                     n_end=$n
        !          1838:                     ;;
        !          1839:                   esac
        !          1840:                   if test $GMP_NAIL_BITS -ge $n_start && test $GMP_NAIL_BITS -le $n_end; then
        !          1841:                     found=yes
        !          1842:                     break
        !          1843:                   fi
        !          1844:                 done
        !          1845:                 if test $found != yes; then
        !          1846:                   continue
        !          1847:                 fi
        !          1848:                 ;;
        !          1849:             esac
        !          1850:           fi
        !          1851:
1.1.1.2   maekawa  1852:           found=yes
1.1.1.4 ! ohara    1853:           eval found_$tmp_ext=yes
1.1.1.2   maekawa  1854:
1.1.1.4 ! ohara    1855:           if test $tmp_ext = c; then
        !          1856:             tmp_u='$U'
        !          1857:           else
        !          1858:             tmp_u=
        !          1859:           fi
        !          1860:
        !          1861:           mpn_objects="$mpn_objects $tmp_fn$tmp_u.lo"
        !          1862:           mpn_objs_in_libgmp="$mpn_objs_in_libgmp mpn/$tmp_fn$tmp_u.lo"
        !          1863:           AC_CONFIG_LINKS(mpn/$tmp_fn.$tmp_ext:mpn/$tmp_dir/$tmp_base.$tmp_ext)
        !          1864:           gmp_srclinks="$gmp_srclinks mpn/$tmp_fn.$tmp_ext"
        !          1865:
        !          1866:           # Duplicate AC_DEFINEs are harmless, so it doesn't matter
        !          1867:           # that multi-function files get grepped here repeatedly.
        !          1868:           # The PROLOGUE pattern excludes the optional second parameter.
        !          1869:           gmp_ep=[`
1.1.1.2   maekawa  1870:             sed -n 's/^[       ]*MULFUNC_PROLOGUE(\(.*\))/\1/p' $tmp_file ;
1.1.1.4 ! ohara    1871:             sed -n 's/^[       ]*PROLOGUE(\([^,]*\).*)/\1/p' $tmp_file
        !          1872:           `]
1.1.1.2   maekawa  1873:           for gmp_tmp in $gmp_ep; do
1.1.1.4 ! ohara    1874:             AC_DEFINE_UNQUOTED(HAVE_NATIVE_$gmp_tmp)
        !          1875:             eval HAVE_NATIVE_$gmp_tmp=yes
1.1.1.2   maekawa  1876:           done
                   1877:
1.1.1.4 ! ohara    1878:           case $tmp_fn in
        !          1879:           sqr_basecase) sqr_basecase_source=$tmp_file ;;
        !          1880:           esac
        !          1881:
1.1.1.2   maekawa  1882:           break
                   1883:         fi
                   1884:       done
                   1885:       if test $found = yes; then break ; fi
                   1886:     done
                   1887:     if test $found = yes; then break ; fi
                   1888:   done
                   1889:
                   1890:   if test $found = no; then
                   1891:     for tmp_optional in $gmp_mpn_functions_optional; do
                   1892:       if test $tmp_optional = $tmp_fn; then
                   1893:         found=yes
                   1894:       fi
                   1895:     done
                   1896:     if test $found = no; then
                   1897:       AC_MSG_ERROR([no version of $tmp_fn found in path: $path])
                   1898:     fi
                   1899:   fi
                   1900: done
                   1901:
1.1.1.4 ! ohara    1902: # All cycle counters are .asm files currently
        !          1903: if test -n "$SPEED_CYCLECOUNTER_OBJ"; then
        !          1904:   found_asm=yes
        !          1905: fi
        !          1906:
        !          1907:
        !          1908: # Don't demand an m4 unless it's actually needed.
        !          1909: if test $found_asm = yes; then
        !          1910:   GMP_PROG_M4
        !          1911:   GMP_M4_M4WRAP_SPURIOUS
        !          1912: else
        !          1913:   M4=m4-not-needed
        !          1914: fi
        !          1915:
        !          1916: # Only do the GMP_ASM checks if there's a .S or .asm wanting them.
        !          1917: if test $found_asm = no && test $found_S = no; then
        !          1918:   gmp_asm_syntax_testing=no
        !          1919: fi
        !          1920:
        !          1921: if test "$gmp_asm_syntax_testing" != no; then
        !          1922:   GMP_ASM_TEXT
        !          1923:   GMP_ASM_DATA
        !          1924:   GMP_ASM_LABEL_SUFFIX
        !          1925:   GMP_ASM_GLOBL
        !          1926:   GMP_ASM_UNDERSCORE
        !          1927:   GMP_ASM_RODATA
        !          1928:   GMP_ASM_GLOBL_ATTR
        !          1929:   GMP_ASM_TYPE
        !          1930:   GMP_ASM_SIZE
        !          1931:   GMP_ASM_LSYM_PREFIX
        !          1932:   GMP_ASM_W32
        !          1933:   GMP_ASM_ALIGN_LOG
        !          1934:
        !          1935:   case $host in
        !          1936:     m68*-*-*)
        !          1937:       GMP_ASM_M68K_INSTRUCTION
        !          1938:       GMP_ASM_M68K_ADDRESSING
        !          1939:       GMP_ASM_M68K_BRANCHES
        !          1940:       ;;
        !          1941:     powerpc*-*-*)
        !          1942:       GMP_ASM_POWERPC_R_REGISTERS
        !          1943:       GMP_INCLUDE_MPN(powerpc32/powerpc-defs.m4)
        !          1944:       case $host in
        !          1945:         powerpc*-*-aix*)
        !          1946:          case $ABI in
        !          1947:            64 | aix64) GMP_INCLUDE_MPN(powerpc64/aix.m4) ;;
        !          1948:             *)          GMP_INCLUDE_MPN(powerpc32/aix.m4) ;;
        !          1949:           esac
        !          1950:           ;;
        !          1951:       esac
        !          1952:       ;;
        !          1953:     power*-*-aix*)
        !          1954:       GMP_INCLUDE_MPN(powerpc32/aix.m4)
        !          1955:       ;;
        !          1956:     sparcv9*-*-* | ultrasparc*-*-* | sparc64-*-*)
        !          1957:       case $ABI in
        !          1958:         64)
        !          1959:           GMP_ASM_SPARC_REGISTER
        !          1960:           ;;
        !          1961:       esac
        !          1962:       ;;
        !          1963:     X86_PATTERN)
        !          1964:       GMP_ASM_ALIGN_FILL_0x90
        !          1965:       GMP_ASM_X86_SHLDL_CL
        !          1966:       if test "$enable_profiling" != no; then
        !          1967:         GMP_ASM_X86_MCOUNT
        !          1968:       fi
        !          1969:       case $host in
        !          1970:         *-*-openbsd*)
        !          1971:           GMP_DEFINE(_GLOBAL_OFFSET_TABLE_,__GLOBAL_OFFSET_TABLE_)
        !          1972:           ;;
        !          1973:       esac
        !          1974:       ;;
        !          1975:   esac
        !          1976: fi
        !          1977:
1.1.1.2   maekawa  1978:
1.1.1.4 ! ohara    1979: # Create link for gmp-mparam.h.
        !          1980: gmp_mparam_source=
        !          1981: for gmp_mparam_dir in $path; do
        !          1982:   test "$no_create" = yes || rm -f gmp-mparam.h
        !          1983:   tmp_file=$srcdir/mpn/$gmp_mparam_dir/gmp-mparam.h
        !          1984:   if test -f $tmp_file; then
        !          1985:     AC_CONFIG_LINKS(gmp-mparam.h:mpn/$gmp_mparam_dir/gmp-mparam.h)
        !          1986:     gmp_srclinks="$gmp_srclinks gmp-mparam.h"
        !          1987:     gmp_mparam_source=$tmp_file
1.1.1.2   maekawa  1988:     break
                   1989:   fi
                   1990: done
1.1.1.4 ! ohara    1991: if test -z "$gmp_mparam_source"; then
        !          1992:   AC_MSG_ERROR([no version of gmp-mparam.h found in path: $path])
        !          1993: fi
1.1.1.2   maekawa  1994:
1.1.1.4 ! ohara    1995: # For a helpful message from tune/tuneup.c
        !          1996: gmp_mparam_suggest=$gmp_mparam_source
        !          1997: if test "$gmp_mparam_dir" = generic; then
        !          1998:   for i in $path; do break; done
        !          1999:   if test "$i" != generic; then
        !          2000:     gmp_mparam_suggest="new file $srcdir/mpn/$i/gmp-mparam.h"
        !          2001:   fi
        !          2002: fi
        !          2003: AC_DEFINE_UNQUOTED(GMP_MPARAM_H_SUGGEST, "$gmp_mparam_source",
        !          2004:                    [The gmp-mparam.h to update when tuning.])
        !          2005:
        !          2006:
        !          2007: # Copy any SQR_KARATSUBA_THRESHOLD from gmp-mparam.h to config.m4.
        !          2008: # Some versions of sqr_basecase.asm use this.
        !          2009: tmp_gmp_karatsuba_sqr_threshold=`sed -n 's/^#define SQR_KARATSUBA_THRESHOLD[   ]*\([0-9][0-9]*\).*$/\1/p' $gmp_mparam_source`
        !          2010: if test -n "$tmp_gmp_karatsuba_sqr_threshold"; then
        !          2011:   GMP_DEFINE_RAW(["define(<SQR_KARATSUBA_THRESHOLD>,<$tmp_gmp_karatsuba_sqr_threshold>)"])
        !          2012: fi
        !          2013:
        !          2014: # This must come after gmp-mparam.h has been chosen.
        !          2015: GMP_C_SIZES
        !          2016:
        !          2017: GMP_DEFINE_RAW(["define(<GMP_LIMB_BITS>,$BITS_PER_MP_LIMB)"])
        !          2018: GMP_DEFINE_RAW(["define(<GMP_NAIL_BITS>,$GMP_NAIL_BITS)"])
        !          2019: GMP_DEFINE_RAW(["define(<GMP_NUMB_BITS>,eval(GMP_LIMB_BITS-GMP_NAIL_BITS))"])
        !          2020:
        !          2021:
        !          2022: # Exclude the mpn random functions from mpbsd since that would drag in the
        !          2023: # top-level rand things, all of which are unnecessary for libmp.  There's
        !          2024: # other unnecessary objects too actually, if we could be bothered figuring
        !          2025: # out exactly which they are.
        !          2026: #
        !          2027: mpn_objs_in_libmp=
        !          2028: for i in $mpn_objs_in_libgmp; do
        !          2029:   case $i in
        !          2030:   *random*) ;;
        !          2031:   *) mpn_objs_in_libmp="$mpn_objs_in_libmp $i" ;;
        !          2032:   esac
1.1.1.2   maekawa  2033: done
1.1.1.4 ! ohara    2034: AC_SUBST(mpn_objs_in_libmp)
1.1.1.2   maekawa  2035:
                   2036: AC_SUBST(mpn_objects)
                   2037: AC_SUBST(mpn_objs_in_libgmp)
                   2038: AC_SUBST(gmp_srclinks)
                   2039:
                   2040:
1.1.1.4 ! ohara    2041: # Configs for mpfr.
        !          2042: #
        !          2043: if test $enable_mpfr = yes; then
        !          2044:   gmp_CFLAGS=$CFLAGS
        !          2045:   gmp_LIBS=$LIBS
        !          2046:   LIBS="$LIBS $LIBM"
        !          2047:
        !          2048:   MPFR_CONFIGS
        !          2049:
        !          2050:   AC_SUBST(MPFR_CFLAGS,$CFLAGS)
        !          2051:   AC_SUBST(MPFR_LIBS,  $LIBS)
        !          2052:   CFLAGS=$gmp_CFLAGS
        !          2053:   LIBS=$gmp_LIBS
        !          2054: fi
        !          2055:
        !          2056:
        !          2057: # A recompiled sqr_basecase for use in the tune program, if necessary.
        !          2058: TUNE_SQR_OBJ=
        !          2059: test -d tune || mkdir tune
        !          2060: case $sqr_basecase_source in
        !          2061:   *.asm)
        !          2062:     sqr_max=[`sed -n 's/^def...(SQR_KARATSUBA_THRESHOLD_MAX, *\([0-9]*\))/\1/p' $sqr_basecase_source`]
        !          2063:     if test -n "$sqr_max"; then
        !          2064:       TUNE_SQR_OBJ=sqr_asm.o
        !          2065:       AC_DEFINE_UNQUOTED(TUNE_SQR_KARATSUBA_MAX,$sqr_max,
        !          2066:       [Maximum size the tune program can test for SQR_KARATSUBA_THRESHOLD])
        !          2067:     fi
        !          2068:     cat >tune/sqr_basecase.c <<EOF
        !          2069: /* not sure that an empty file can compile, so put in a dummy */
        !          2070: int sqr_basecase_dummy;
        !          2071: EOF
        !          2072:     ;;
        !          2073:   *.c)
        !          2074:     TUNE_SQR_OBJ=
        !          2075:     AC_DEFINE(TUNE_SQR_KARATSUBA_MAX,SQR_KARATSUBA_MAX_GENERIC)
        !          2076:     cat >tune/sqr_basecase.c <<EOF
        !          2077: #define TUNE_PROGRAM_BUILD 1
        !          2078: #define TUNE_PROGRAM_BUILD_SQR 1
        !          2079: #include "mpn/sqr_basecase.c"
        !          2080: EOF
        !          2081:     ;;
        !          2082: esac
        !          2083: AC_SUBST(TUNE_SQR_OBJ)
        !          2084:
        !          2085:
        !          2086: # Configs for demos/pexpr.c.
        !          2087: #
        !          2088: AC_CONFIG_FILES(demos/pexpr-config.h:demos/pexpr-config-h.in)
        !          2089: GMP_SUBST_CHECK_FUNCS(clock, cputime, getrusage, gettimeofday, sigaction, sigaltstack, sigstack)
        !          2090: GMP_SUBST_CHECK_HEADERS(sys/resource.h)
        !          2091: AC_CHECK_TYPES([stack_t], HAVE_STACK_T_01=1, HAVE_STACK_T_01=0,
        !          2092:                [#include <signal.h>])
        !          2093: AC_SUBST(HAVE_STACK_T_01)
        !          2094:
        !          2095: # Configs for demos/calc directory
        !          2096: #
        !          2097: # AC_SUBST is used here since with AM_CONFIG_HEADER automake would put
        !          2098: # demos/calc in the default $(DEFAULT_INCLUDES) for every directory,
        !          2099: # which would look very strange.  Likewise demos/expr below.
        !          2100: #
        !          2101: AC_CONFIG_FILES(demos/calc/calc-config.h:demos/calc/calc-config-h.in)
        !          2102: use_readline=$with_readline
        !          2103: if test $with_readline = detect; then
        !          2104:   AC_CHECK_LIB(readline, readline, use_readline=yes)
        !          2105: fi
        !          2106: if test $use_readline = yes; then
        !          2107:   AC_SUBST(WITH_READLINE_01, 1)
        !          2108:   AC_SUBST(LIBREADLINE, -lreadline)
        !          2109: else
        !          2110:   WITH_READLINE_01=0
        !          2111: fi
        !          2112: AC_PROG_YACC
        !          2113: GMP_PROG_LEX
        !          2114:
        !          2115: # Configs for demos/expr directory
        !          2116: AC_CONFIG_FILES(demos/expr/expr-config.h:demos/expr/expr-config-h.in)
        !          2117: if test $enable_mpfr = yes; then
        !          2118:   AC_SUBST(HAVE_MPFR_01, 1)
        !          2119: else
        !          2120:   HAVE_MPFR_01=0
        !          2121: fi
        !          2122: if test $ac_cv_have_decl_optarg = yes; then
        !          2123:   AC_SUBST(HAVE_DECL_OPTARG, 1)
        !          2124: else
        !          2125:   HAVE_DECL_OPTARG=0
        !          2126: fi
        !          2127:
        !          2128:
        !          2129: # Create config.m4.
1.1.1.2   maekawa  2130: GMP_FINISH
                   2131:
1.1.1.4 ! ohara    2132: # Create Makefiles
        !          2133: # FIXME: Upcoming version of autoconf/automake may not like broken lines.
        !          2134: #        Right now automake isn't accepting the new AC_CONFIG_FILES scheme.
        !          2135:
        !          2136: AC_OUTPUT(Makefile                                                     \
        !          2137:   mpbsd/Makefile mpf/Makefile mpn/Makefile mpq/Makefile                        \
        !          2138:   mpz/Makefile printf/Makefile scanf/Makefile cxx/Makefile             \
        !          2139:   tests/Makefile tests/devel/Makefile tests/mpbsd/Makefile             \
        !          2140:   tests/mpf/Makefile tests/mpn/Makefile tests/mpq/Makefile             \
        !          2141:   tests/mpz/Makefile tests/rand/Makefile tests/misc/Makefile           \
        !          2142:   tests/cxx/Makefile                                                   \
        !          2143:   mpfr/Makefile mpfr/tests/Makefile                                    \
        !          2144:   tune/Makefile                                                                \
        !          2145:   demos/Makefile demos/calc/Makefile demos/expr/Makefile               \
        !          2146:   gmp.h:gmp-h.in mp.h:mp-h.in)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>