-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
1932 lines (1716 loc) · 66.9 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
dnl Process this file with autoconf to produce a configure script.
define(GMP_COPYRIGHT,[[
Copyright 1996-2016 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any
later version.
or both in parallel, as here.
The GNU MP Library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received copies of the GNU General Public License and the
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/.
]])
AC_COPYRIGHT(GMP_COPYRIGHT)
AH_TOP(/*GMP_COPYRIGHT*/)
AC_REVISION($Revision$)
AC_PREREQ(2.59)
AC_INIT(GNU MP, GMP_VERSION, [[email protected], see https://gmplib.org/manual/Reporting-Bugs.html], gmp)
AC_CONFIG_SRCDIR(gmp-impl.h)
m4_pattern_forbid([^[ \t]*GMP_])
m4_pattern_allow(GMP_LDFLAGS)
m4_pattern_allow(GMP_LIMB_BITS)
m4_pattern_allow(GMP_MPARAM_H_SUGGEST)
m4_pattern_allow(GMP_NAIL_BITS)
m4_pattern_allow(GMP_NUMB_BITS)
m4_pattern_allow(GMP_NONSTD_ABI)
m4_pattern_allow(GMP_CPU_TYPE)
# If --target is not used then $target_alias is empty, but if say
# "./configure athlon-pc-freebsd3.5" is used, then all three of
# $build_alias, $host_alias and $target_alias are set to
# "athlon-pc-freebsd3.5".
#
if test -n "$target_alias" && test "$target_alias" != "$host_alias"; then
AC_MSG_ERROR([--target is not appropriate for GMP
Use --build=CPU-VENDOR-OS if you need to specify your CPU and/or system
explicitly. Use --host if cross-compiling (see "Installing GMP" in the
manual for more on this).])
fi
GMP_INIT(config.m4)
AC_CANONICAL_HOST
dnl Automake "no-dependencies" is used because include file dependencies
dnl are not useful to us. Pretty much everything depends just on gmp.h,
dnl gmp-impl.h and longlong.h, and yet only rarely does everything need to
dnl be rebuilt for changes to those files.
dnl
dnl "no-dependencies" also helps with the way we're setup to run
dnl AC_PROG_CXX only conditionally. If dependencies are used then recent
dnl automake (eg 1.7.2) appends an AM_CONDITIONAL to AC_PROG_CXX, and then
dnl gets upset if it's not actually executed.
dnl
dnl Note that there's a copy of these options in the top-level Makefile.am,
dnl so update there too if changing anything.
dnl
AM_INIT_AUTOMAKE([1.8 gnu no-dependencies])
AC_CONFIG_HEADERS(config.h:config.in)
AM_MAINTAINER_MODE
AC_ARG_ENABLE(assert,
AC_HELP_STRING([--enable-assert],[enable ASSERT checking [default=no]]),
[case $enableval in
yes|no) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-assert, need yes or no]) ;;
esac],
[enable_assert=no])
if test "$enable_assert" = "yes"; then
AC_DEFINE(WANT_ASSERT,1,
[Define to 1 to enable ASSERT checking, per --enable-assert])
want_assert_01=1
else
want_assert_01=0
fi
GMP_DEFINE_RAW(["define(<WANT_ASSERT>,$want_assert_01)"])
AC_ARG_ENABLE(alloca,
AC_HELP_STRING([--enable-alloca],[how to get temp memory [default=reentrant]]),
[case $enableval in
alloca|malloc-reentrant|malloc-notreentrant) ;;
yes|no|reentrant|notreentrant) ;;
debug) ;;
*)
AC_MSG_ERROR([bad value $enableval for --enable-alloca, need one of:
yes no reentrant notreentrant alloca malloc-reentrant malloc-notreentrant debug]) ;;
esac],
[enable_alloca=reentrant])
# IMPROVE ME: The default for C++ is disabled. The tests currently
# performed below for a working C++ compiler are not particularly strong,
# and in general can't be expected to get the right setup on their own. The
# most significant problem is getting the ABI the same. Defaulting CXXFLAGS
# to CFLAGS takes only a small step towards this. It's also probably worth
# worrying whether the C and C++ runtimes from say gcc and a vendor C++ can
# work together. Some rather broken C++ installations were encountered
# during testing, and though such things clearly aren't GMP's problem, if
# --enable-cxx=detect were to be the default then some careful checks of
# which, if any, C++ compiler on the system is up to scratch would be
# wanted.
#
AC_ARG_ENABLE(cxx,
AC_HELP_STRING([--enable-cxx],[enable C++ support [default=no]]),
[case $enableval in
yes|no|detect) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-cxx, need yes/no/detect]) ;;
esac],
[enable_cxx=no])
AC_ARG_ENABLE(assembly,
AC_HELP_STRING([--enable-assembly],[enable the use of assembly loops [default=yes]]),
[case $enableval in
yes|no) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-assembly, need yes or no]) ;;
esac],
[enable_assembly=yes])
AC_ARG_ENABLE(fft,
AC_HELP_STRING([--enable-fft],[enable FFTs for multiplication [default=yes]]),
[case $enableval in
yes|no) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-fft, need yes or no]) ;;
esac],
[enable_fft=yes])
if test "$enable_fft" = "yes"; then
AC_DEFINE(WANT_FFT,1,
[Define to 1 to enable FFTs for multiplication, per --enable-fft])
fi
AC_ARG_ENABLE(old-fft-full,
AC_HELP_STRING([--enable-old-fft-full],[enable old mpn_mul_fft_full for multiplication [default=no]]),
[case $enableval in
yes|no) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-old-fft-full, need yes or no]) ;;
esac],
[enable_old_fft_full=no])
if test "$enable_old_fft_full" = "yes"; then
AC_DEFINE(WANT_OLD_FFT_FULL,1,
[Define to 1 to enable old mpn_mul_fft_full for multiplication, per --enable-old-fft-full])
fi
AC_ARG_ENABLE(nails,
AC_HELP_STRING([--enable-nails],[use nails on limbs [default=no]]),
[case $enableval in
[yes|no|[02468]|[0-9][02468]]) ;;
[*[13579]])
AC_MSG_ERROR([bad value $enableval for --enable-nails, only even nail sizes supported]) ;;
*)
AC_MSG_ERROR([bad value $enableval for --enable-nails, need yes/no/number]) ;;
esac],
[enable_nails=no])
case $enable_nails in
yes) GMP_NAIL_BITS=2 ;;
no) GMP_NAIL_BITS=0 ;;
*) GMP_NAIL_BITS=$enable_nails ;;
esac
AC_SUBST(GMP_NAIL_BITS)
AC_ARG_ENABLE(profiling,
AC_HELP_STRING([--enable-profiling],
[build with profiler support [default=no]]),
[case $enableval in
no|prof|gprof|instrument) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-profiling, need no/prof/gprof/instrument]) ;;
esac],
[enable_profiling=no])
case $enable_profiling in
prof)
AC_DEFINE(WANT_PROFILING_PROF, 1,
[Define to 1 if --enable-profiling=prof])
;;
gprof)
AC_DEFINE(WANT_PROFILING_GPROF, 1,
[Define to 1 if --enable-profiling=gprof])
;;
instrument)
AC_DEFINE(WANT_PROFILING_INSTRUMENT, 1,
[Define to 1 if --enable-profiling=instrument])
;;
esac
GMP_DEFINE_RAW(["define(<WANT_PROFILING>,<\`$enable_profiling'>)"])
# -fomit-frame-pointer is incompatible with -pg on some chips
if test "$enable_profiling" = gprof; then
fomit_frame_pointer=
else
fomit_frame_pointer="-fomit-frame-pointer"
fi
AC_ARG_WITH(readline,
AC_HELP_STRING([--with-readline],
[readline support in demo programs [default=detect]]),
[case $withval in
yes|no|detect) ;;
*) AC_MSG_ERROR([bad value $withval for --with-readline, need yes/no/detect]) ;;
esac],
[with_readline=detect])
AC_ARG_ENABLE(fat,
AC_HELP_STRING([--enable-fat],
[build fat libraries on systems that support it [default=no]]),
[case $enableval in
yes|no) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-fat, need yes or no]) ;;
esac],
[enable_fat=no])
AC_ARG_ENABLE(fake-cpuid,
AC_HELP_STRING([--enable-fake-cpuid],[enable GMP_CPU_TYPE faking cpuid [default=no]]),
[case $enableval in
yes|no) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-fake-cpuid, need yes or no]) ;;
esac],
[enable_fake_cpuid=no])
if test "$enable_fake_cpuid" = "yes"; then
AC_DEFINE(WANT_FAKE_CPUID,1,
[Define to 1 to enable GMP_CPU_TYPE faking cpuid, per --enable-fake-cpuid])
fi
if test $enable_fat = yes && test $enable_assembly = no ; then
AC_MSG_ERROR([when doing a fat build, disabling assembly will not work])
fi
if test $enable_fake_cpuid = yes && test $enable_fat = no ; then
AC_MSG_ERROR([--enable-fake-cpuid requires --enable-fat])
fi
tmp_host=`echo $host_cpu | sed 's/\./_/'`
AC_DEFINE_UNQUOTED(HAVE_HOST_CPU_$tmp_host)
GMP_DEFINE_RAW("define_not_for_expansion(\`HAVE_HOST_CPU_$tmp_host')", POST)
dnl The HAVE_HOST_CPU_ list here only needs to have entries for those which
dnl are going to be tested, not everything that can possibly be selected.
dnl
dnl The HAVE_HOST_CPU_FAMILY_ list similarly, and note that the AC_DEFINEs
dnl for these are under the cpu specific setups below.
AH_VERBATIM([HAVE_HOST_CPU_1],
[/* Define one of these to 1 for the host CPU family.
If your CPU is not in any of these families, leave all undefined.
For an AMD64 chip, define "x86" in ABI=32, but not in ABI=64. */
#undef HAVE_HOST_CPU_FAMILY_m68k
#undef HAVE_HOST_CPU_FAMILY_x86
#undef HAVE_HOST_CPU_FAMILY_x86_64
/* Define one of the following to 1 for the host CPU, as per the output of
./config.guess. If your CPU is not listed here, leave all undefined. */
#undef HAVE_HOST_CPU_i386
#undef HAVE_HOST_CPU_i586
#undef HAVE_HOST_CPU_i686
#undef HAVE_HOST_CPU_pentium
#undef HAVE_HOST_CPU_pentiummmx
#undef HAVE_HOST_CPU_pentiumpro
#undef HAVE_HOST_CPU_pentium2
#undef HAVE_HOST_CPU_pentium3
])
# Table of compilers, options, and mpn paths. This code has various related
# purposes
#
# - better default CC/CFLAGS selections than autoconf otherwise gives
# - default CC/CFLAGS selections for extra CPU types specific to GMP
# - a few tests for known bad compilers
# - choice of ABIs on suitable systems
# - selection of corresponding mpn search path
#
# After GMP specific searches and tests, the standard autoconf AC_PROG_CC is
# called. User selections of CC etc are respected.
#
# Care is taken not to use macros like AC_TRY_COMPILE during the GMP
# pre-testing, since they of course depend on AC_PROG_CC, and also some of
# them cache their results, which is not wanted.
#
# The ABI selection mechanism is unique to GMP. All that reaches autoconf
# is a different selection of CC/CFLAGS according to the best ABI the system
# supports, and/or what the user selects. Naturally the mpn assembler code
# selected is very dependent on the ABI.
#
# The closest the standard tools come to a notion of ABI is something like
# "sparc64" which encodes a CPU and an ABI together. This doesn't seem to
# scale well for GMP, where exact CPU types like "ultrasparc2" are wanted,
# separate from the ABI used on them.
#
#
# The variables set here are
#
# cclist the compiler choices
# xx_cflags flags for compiler xx
# xx_cflags_maybe flags for compiler xx, if they work
# xx_cppflags cpp flags for compiler xx
# xx_cflags_optlist list of sets of optional flags
# xx_cflags_yyy set yyy of optional flags for compiler xx
# xx_ldflags -Wc,-foo flags for libtool linking with compiler xx
# ar_flags extra flags for $AR
# nm_flags extra flags for $NM
# limb limb size, can be "longlong"
# path mpn search path
# extra_functions extra mpn functions
# fat_path fat binary mpn search path [if fat binary desired]
# fat_functions fat functions
# fat_thresholds fat thresholds
#
# Suppose xx_cflags_optlist="arch", then flags from $xx_cflags_arch are
# tried, and the first flag that works will be used. An optlist like "arch
# cpu optimize" can be used to get multiple independent sets of flags tried.
# The first that works from each will be used. If no flag in a set works
# then nothing from that set is added.
#
# For multiple ABIs, the scheme extends as follows.
#
# abilist set of ABI choices
# cclist_aa compiler choices in ABI aa
# xx_aa_cflags flags for xx in ABI aa
# xx_aa_cflags_maybe flags for xx in ABI aa, if they work
# xx_aa_cppflags cpp flags for xx in ABI aa
# xx_aa_cflags_optlist list of sets of optional flags in ABI aa
# xx_aa_cflags_yyy set yyy of optional flags for compiler xx in ABI aa
# xx_aa_ldflags -Wc,-foo flags for libtool linking
# ar_aa_flags extra flags for $AR in ABI aa
# nm_aa_flags extra flags for $NM in ABI aa
# limb_aa limb size in ABI aa, can be "longlong"
# path_aa mpn search path in ABI aa
# extra_functions_aa extra mpn functions in ABI aa
#
# As a convenience, the unadorned xx_cflags (etc) are used for the last ABI
# in ablist, if an xx_aa_cflags for that ABI isn't given. For example if
# abilist="64 32" then $cc_64_cflags will be used for the 64-bit ABI, but
# for the 32-bit either $cc_32_cflags or $cc_cflags is used, whichever is
# defined. This makes it easy to add some 64-bit compilers and flags to an
# unadorned 32-bit set.
#
# limb=longlong (or limb_aa=longlong) applies to all compilers within that
# ABI. It won't work to have some needing long long and some not, since a
# single instantiated gmp.h will be used by both.
#
# SPEED_CYCLECOUNTER, cyclecounter_size and CALLING_CONVENTIONS_OBJS are
# also set here, with an ABI suffix.
#
#
#
# A table-driven approach like this to mapping cpu type to good compiler
# options is a bit of a maintenance burden, but there's not much uniformity
# between options specifications on different compilers. Some sort of
# separately updatable tool might be cute.
#
# The use of lots of variables like this, direct and indirect, tends to
# obscure when and how various things are done, but unfortunately it's
# pretty much the only way. If shell subroutines were portable then actual
# code like "if this .. do that" could be written, but attempting the same
# with full copies of GMP_PROG_CC_WORKS etc expanded at every point would
# hugely bloat the output.
AC_ARG_VAR(ABI, [desired ABI (for processors supporting more than one ABI)])
# abilist needs to be non-empty, "standard" is just a generic name here
abilist="standard"
# FIXME: We'd like to prefer an ANSI compiler, perhaps by preferring
# c89 over cc here. But note that on HP-UX c89 provides a castrated
# environment, and would want to be excluded somehow. Maybe
# AC_PROG_CC_STDC already does enough to stick cc into ANSI mode and
# we don't need to worry.
#
cclist="gcc cc"
gcc_cflags="-O2 -pedantic"
gcc_64_cflags="-O2 -pedantic"
cc_cflags="-O"
cc_64_cflags="-O"
SPEED_CYCLECOUNTER_OBJ=
cyclecounter_size=2
case $host in
# AMD and Intel x86 configurations, including AMD64
#
# Rumour has it gcc -O2 used to give worse register allocation than just
# -O, but lets assume that's no longer true.
#
# -m32 forces 32-bit mode on a bi-arch 32/64 amd64 build of gcc. -m64 is
# the default in such a build (we think), so -m32 is essential for ABI=32.
# This is, of course, done for any $host_cpu, not just x86_64, so we can
# get such a gcc into the right mode to cross-compile to say i486-*-*.
#
# -m32 is not available in gcc 2.95 and earlier, hence cflags_maybe to use
# it when it works. We check sizeof(long)==4 to ensure we get the right
# mode, in case -m32 has failed not because it's an old gcc, but because
# it's a dual 32/64-bit gcc without a 32-bit libc, or whatever.
#
X86_PATTERN | X86_64_PATTERN)
abilist="32"
cclist="gcc icc cc"
gcc_cflags="$gcc_cflags $fomit_frame_pointer"
gcc_32_cflags_maybe="-m32"
icc_cflags="-no-gcc"
icc_cflags_optlist="opt"
icc_cflags_opt="-O3 -O2 -O1"
icc_cflags_opt_maybe="-fp-model~precise"
any_32_testlist="sizeof-long-4"
gcc_cflags_optlist="cpu arch noavx"
CALLING_CONVENTIONS_OBJS='x86call.lo x86check$U.lo'
# Availability of rdtsc is checked at run-time.
SPEED_CYCLECOUNTER_OBJ=pentium.lo
# gcc 2.7.2 only knows i386 and i486, using -m386 or -m486. These
# represent -mcpu= since -m486 doesn't generate 486 specific insns.
# gcc 2.95 adds k6, pentium and pentiumpro, and takes -march= and -mcpu=.
# gcc 3.0 adds athlon.
# gcc 3.1 adds k6-2, k6-3, pentium-mmx, pentium2, pentium3, pentium4,
# athlon-tbird, athlon-4, athlon-xp, athlon-mp.
# gcc 3.2 adds winchip2.
# gcc 3.3 adds winchip-c6.
# gcc 3.3.1 from mandrake adds k8 and knows -mtune.
# gcc 3.4 adds c3, c3-2, k8, and deprecates -mcpu in favour of -mtune.
#
# In gcc 2.95.[0123], -march=pentiumpro provoked a stack slot bug in an
# old version of mpz/powm.c. Seems to be fine with the current code, so
# no need for any restrictions on that option.
#
# -march=pentiumpro can fail if the assembler doesn't know "cmov"
# (eg. solaris 2.8 native "as"), so always have -march=pentium after
# that as a fallback.
#
# -march=pentium4 and -march=k8 enable SSE2 instructions, which may or
# may not be supported by the assembler and/or the OS, and is bad in gcc
# prior to 3.3. The tests will reject these if no good, so fallbacks
# like "-march=pentium4 -mno-sse2" are given to try also without SSE2.
# Note the relevant -march types are listed in the optflags handling
# below, be sure to update there if adding new types emitting SSE2.
#
# -mtune is used at the start of each cpu option list to give something
# gcc 3.4 will use, thereby avoiding warnings from -mcpu. -mcpu forms
# are retained for use by prior gcc. For example pentium has
# "-mtune=pentium -mcpu=pentium ...", the -mtune is for 3.4 and the
# -mcpu for prior. If there's a brand new choice in 3.4 for a chip,
# like k8 for x86_64, then it can be the -mtune at the start, no need to
# duplicate anything.
#
case $host_cpu in
i386*)
gcc_cflags_cpu="-mtune=i386 -mcpu=i386 -m386"
gcc_cflags_arch="-march=i386"
path="x86"
;;
i486*)
gcc_cflags_cpu="-mtune=i486 -mcpu=i486 -m486"
gcc_cflags_arch="-march=i486"
path="x86/i486 x86"
;;
i586 | pentium)
gcc_cflags_cpu="-mtune=pentium -mcpu=pentium -m486"
gcc_cflags_arch="-march=pentium"
path="x86/pentium x86"
;;
pentiummmx)
gcc_cflags_cpu="-mtune=pentium-mmx -mcpu=pentium-mmx -mcpu=pentium -m486"
gcc_cflags_arch="-march=pentium-mmx -march=pentium"
path="x86/pentium/mmx x86/pentium x86/mmx x86"
;;
i686 | pentiumpro)
gcc_cflags_cpu="-mtune=pentiumpro -mcpu=pentiumpro -mcpu=i486 -m486"
gcc_cflags_arch="-march=pentiumpro -march=pentium"
path="x86/p6 x86"
;;
pentium2)
gcc_cflags_cpu="-mtune=pentium2 -mcpu=pentium2 -mcpu=pentiumpro -mcpu=i486 -m486"
gcc_cflags_arch="-march=pentium2 -march=pentiumpro -march=pentium"
path="x86/p6/mmx x86/p6 x86/mmx x86"
;;
pentium3)
gcc_cflags_cpu="-mtune=pentium3 -mcpu=pentium3 -mcpu=pentiumpro -mcpu=i486 -m486"
gcc_cflags_arch="-march=pentium3 -march=pentiumpro -march=pentium"
path="x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
;;
pentiumm)
gcc_cflags_cpu="-mtune=pentium3 -mcpu=pentium3 -mcpu=pentiumpro -mcpu=i486 -m486"
gcc_cflags_arch="-march=pentium3 -march=pentiumpro -march=pentium"
path="x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
;;
k6)
gcc_cflags_cpu="-mtune=k6 -mcpu=k6 -mcpu=i486 -m486"
gcc_cflags_arch="-march=k6"
path="x86/k6/mmx x86/k6 x86/mmx x86"
;;
k62)
gcc_cflags_cpu="-mtune=k6-2 -mcpu=k6-2 -mcpu=k6 -mcpu=i486 -m486"
gcc_cflags_arch="-march=k6-2 -march=k6"
path="x86/k6/k62mmx x86/k6/mmx x86/k6 x86/mmx x86"
;;
k63)
gcc_cflags_cpu="-mtune=k6-3 -mcpu=k6-3 -mcpu=k6 -mcpu=i486 -m486"
gcc_cflags_arch="-march=k6-3 -march=k6"
path="x86/k6/k62mmx x86/k6/mmx x86/k6 x86/mmx x86"
;;
geode)
gcc_cflags_cpu="-mtune=k6-3 -mcpu=k6-3 -mcpu=k6 -mcpu=i486 -m486"
gcc_cflags_arch="-march=k6-3 -march=k6"
path="x86/geode x86/k6/k62mmx x86/k6/mmx x86/k6 x86/mmx x86"
;;
athlon)
# Athlon instruction costs are close to P6 (3 cycle load latency,
# 4-6 cycle mul, 40 cycle div, pairable adc, etc) so if gcc doesn't
# know athlon (eg. 2.95.2 doesn't) then fall back on pentiumpro.
gcc_cflags_cpu="-mtune=athlon -mcpu=athlon -mcpu=pentiumpro -mcpu=i486 -m486"
gcc_cflags_arch="-march=athlon -march=pentiumpro -march=pentium"
path="x86/k7/mmx x86/k7 x86/mmx x86"
;;
i786 | pentium4)
# pentiumpro is the primary fallback when gcc doesn't know pentium4.
# This gets us cmov to eliminate branches. Maybe "athlon" would be
# a possibility on gcc 3.0.
#
gcc_cflags_cpu="-mtune=pentium4 -mcpu=pentium4 -mcpu=pentiumpro -mcpu=i486 -m486"
gcc_cflags_arch="-march=pentium4 -march=pentium4~-mno-sse2 -march=pentiumpro -march=pentium"
gcc_64_cflags_cpu="-mtune=nocona"
path="x86/pentium4/sse2 x86/pentium4/mmx x86/pentium4 x86/mmx x86"
path_64="x86_64/pentium4 x86_64"
;;
viac32)
# Not sure of the best fallbacks here for -mcpu.
# c3-2 has sse and mmx, so pentium3 is good for -march.
gcc_cflags_cpu="-mtune=c3-2 -mcpu=c3-2 -mcpu=i486 -m486"
gcc_cflags_arch="-march=c3-2 -march=pentium3 -march=pentiumpro -march=pentium"
path="x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
;;
viac3*)
# Not sure of the best fallbacks here.
gcc_cflags_cpu="-mtune=c3 -mcpu=c3 -mcpu=i486 -m486"
gcc_cflags_arch="-march=c3 -march=pentium-mmx -march=pentium"
path="x86/pentium/mmx x86/pentium x86/mmx x86"
;;
athlon64 | k8 | x86_64)
gcc_cflags_cpu="-mtune=k8 -mcpu=athlon -mcpu=pentiumpro -mcpu=i486 -m486"
gcc_cflags_arch="-march=k8 -march=k8~-mno-sse2 -march=athlon -march=pentiumpro -march=pentium"
path="x86/k8 x86/k7/mmx x86/k7 x86/mmx x86"
path_64="x86_64/k8 x86_64"
;;
k10)
gcc_cflags_cpu="-mtune=amdfam10 -mtune=k8"
gcc_cflags_arch="-march=amdfam10 -march=k8 -march=k8~-mno-sse2"
path="x86/k10 x86/k8 x86/k7/mmx x86/k7 x86/mmx x86"
path_64="x86_64/k10 x86_64/k8 x86_64"
;;
bobcat)
gcc_cflags_cpu="-mtune=btver1 -mtune=amdfam10 -mtune=k8"
gcc_cflags_arch="-march=btver1 -march=amdfam10 -march=k8 -march=k8~-mno-sse2"
path="x86/bobcat x86/k7/mmx x86/k7 x86/mmx x86"
path_64="x86_64/bobcat x86_64/k10 x86_64/k8 x86_64"
;;
jaguar | jaguarnoavx)
gcc_cflags_cpu="-mtune=btver2 -mtune=btver1 -mtune=amdfam10 -mtune=k8"
gcc_cflags_arch="-march=btver2 -march=btver1 -march=amdfam10 -march=k8 -march=k8~-mno-sse2"
path="x86/jaguar x86/bobcat x86/k7/mmx x86/k7 x86/mmx x86"
path_64="x86_64/jaguar x86_64/bobcat x86_64/k10 x86_64/k8 x86_64"
;;
bulldozer | bd1 | bulldozernoavx | bd1noavx)
gcc_cflags_cpu="-mtune=bdver1 -mtune=amdfam10 -mtune=k8"
gcc_cflags_arch="-march=bdver1 -march=amdfam10 -march=k8 -march=k8~-mno-sse2"
path="x86/bd1 x86/k7/mmx x86/k7 x86/mmx x86"
path_64="x86_64/bd1 x86_64/k10 x86_64/k8 x86_64"
;;
piledriver | bd2 | piledrivernoavx | bd2noavx)
gcc_cflags_cpu="-mtune=bdver2 -mtune=bdver1 -mtune=amdfam10 -mtune=k8"
gcc_cflags_arch="-march=bdver2 -march=bdver1 -march=amdfam10 -march=k8 -march=k8~-mno-sse2"
path="x86/bd2 x86/bd1 x86/k7/mmx x86/k7 x86/mmx x86"
path_64="x86_64/bd2 x86_64/bd1 x86_64/k10 x86_64/k8 x86_64"
;;
steamroller | bd3 | steamrollernoavx | bd3noavx)
gcc_cflags_cpu="-mtune=bdver3 -mtune=bdver2 -mtune=bdver1 -mtune=amdfam10 -mtune=k8"
gcc_cflags_arch="-march=bdver3 -march=bdver2 -march=bdver1 -march=amdfam10 -march=k8 -march=k8~-mno-sse2"
path="x86/bd3 x86/bd2 x86/bd1 x86/k7/mmx x86/k7 x86/mmx x86"
path_64="x86_64/bd3 x86_64/bd2 x86_64/bd1 x86_64/k10 x86_64/k8 x86_64"
;;
excavator | bd4 | excavatornoavx | bd4noavx)
gcc_cflags_cpu="-mtune=bdver4 -mtune=bdver3 -mtune=bdver2 -mtune=bdver1 -mtune=amdfam10 -mtune=k8"
gcc_cflags_arch="-march=bdver4 -march=bdver3 -march=bdver2 -march=bdver1 -march=amdfam10 -march=k8 -march=k8~-mno-sse2"
path="x86/bd4 x86/bd3 x86/bd2 x86/bd1 x86/k7/mmx x86/k7 x86/mmx x86"
path_64="x86_64/bd4 x86_64/bd3 x86_64/bd2 x86_64/bd1 x86_64/k10 x86_64/k8 x86_64"
;;
core2)
gcc_cflags_cpu="-mtune=core2 -mtune=k8"
gcc_cflags_arch="-march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
path="x86/core2 x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
path_64="x86_64/core2 x86_64"
;;
corei | coreinhm | coreiwsm | nehalem | westmere)
gcc_cflags_cpu="-mtune=corei7 -mtune=core2 -mtune=k8"
gcc_cflags_arch="-march=corei7 -march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
path="x86/coreinhm x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
path_64="x86_64/coreinhm x86_64/core2 x86_64"
;;
coreisbr | coreisbrnoavx | coreiibr | coreiibrnoavx | \
sandybridge | sandybridgenoavx | ivybridge | ivybridgenoavx)
gcc_cflags_cpu="-mtune=sandybridge -mtune=corei7 -mtune=core2 -mtune=k8"
gcc_cflags_arch="-march=sandybridge -march=corei7 -march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
path="x86/coreisbr x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
path_64="x86_64/coreisbr x86_64/coreinhm x86_64/core2 x86_64"
;;
coreihwl | coreihwlnoavx | haswell | haswellnoavx)
gcc_cflags_cpu="-mtune=haswell -mtune=corei7 -mtune=core2 -mtune=k8"
gcc_cflags_arch="-march=haswell -march=corei7 -march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
path="x86/coreisbr x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
path_64="x86_64/coreihwl x86_64/coreisbr x86_64/coreinhm x86_64/core2 x86_64"
;;
coreibwl | coreibwlnoavx | broadwell | broadwellnoavx)
gcc_cflags_cpu="-mtune=broadwell -mtune=corei7 -mtune=core2 -mtune=k8"
gcc_cflags_arch="-march=broadwell -march=corei7 -march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
path="x86/coreisbr x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
path_64="x86_64/coreibwl x86_64/coreihwl x86_64/coreisbr x86_64/coreinhm x86_64/core2 x86_64"
# extra_functions_64="missing" # enable for bmi2/adx simulation
;;
skylake | skylakenoavx | kabylake | kabylakenoavx)
gcc_cflags_cpu="-mtune=skylake -mtune=broadwell -mtune=corei7 -mtune=core2 -mtune=k8"
# Don't pass -march=skylake for now as then some compilers emit AVX512.
gcc_cflags_arch="-march=broadwell -march=corei7 -march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
path="x86/coreisbr x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
path_64="x86_64/skylake x86_64/coreibwl x86_64/coreihwl x86_64/coreisbr x86_64/coreinhm x86_64/core2 x86_64"
# extra_functions_64="missing" # enable for bmi2/adx simulation
;;
atom) # in-order pipeline atom
gcc_cflags_cpu="-mtune=atom -mtune=pentium3"
gcc_cflags_arch="-march=atom -march=pentium3"
path="x86/atom/sse2 x86/atom/mmx x86/atom x86/mmx x86"
path_64="x86_64/atom x86_64"
;;
silvermont | goldmont) # out-of-order pipeline atom
gcc_cflags_cpu="-mtune=slm -mtune=atom -mtune=pentium3"
gcc_cflags_arch="-march=slm -march=atom -march=pentium3"
path="x86/atom/sse2 x86/atom/mmx x86/atom x86/mmx x86"
path_64="x86_64/silvermont x86_64/atom x86_64"
;;
nano)
gcc_cflags_cpu="-mtune=nano"
gcc_cflags_arch="-march=nano"
path="x86/nano x86/mmx x86"
path_64="x86_64/nano x86_64"
;;
*)
gcc_cflags_cpu="-mtune=i486 -mcpu=i486 -m486"
gcc_cflags_arch="-march=i486"
path="x86"
path_64="x86_64"
;;
esac
case $host in
# Disable AVX if the CPU part tells us AVX is unavailable, but also
# unconditionally for NetBSD where they don't work but OSXSAVE is set
# to claim the contrary.
*noavx-*-* | *-*-netbsd*)
gcc_cflags_noavx="-mno-avx";;
esac
case $host in
X86_64_PATTERN)
cclist_64="gcc cc"
gcc_64_cflags="$gcc_cflags -m64"
gcc_64_cflags_optlist="cpu arch noavx"
CALLING_CONVENTIONS_OBJS_64='amd64call.lo amd64check$U.lo'
SPEED_CYCLECOUNTER_OBJ_64=x86_64.lo
cyclecounter_size_64=2
cclist_x32="gcc cc"
gcc_x32_cflags="$gcc_cflags -mx32"
gcc_x32_cflags_optlist="$gcc_64_cflags_optlist"
CALLING_CONVENTIONS_OBJS_x32="$CALLING_CONVENTIONS_OBJS_64"
SPEED_CYCLECOUNTER_OBJ_x32="$SPEED_CYCLECOUNTER_OBJ_64"
cyclecounter_size_x32="$cyclecounter_size_64"
path_x32="$path_64"
limb_x32=longlong
any_x32_testlist="sizeof-long-4"
abilist="64 x32 32"
if test "$enable_assembly" = "yes" ; then
extra_functions_64="$extra_functions_64 invert_limb_table"
extra_functions_x32=$extra_functions_64
fi
case $host in
*-*-solaris*)
# Sun cc.
cc_64_cflags="-xO3 -m64"
;;
*-*-mingw* | *-*-cygwin)
limb_64=longlong
CALLING_CONVENTIONS_OBJS_64=""
AC_DEFINE(HOST_DOS64,1,[Define to 1 for Windos/64])
GMP_NONSTD_ABI_64=DOS64
;;
esac
;;
esac
;;
# Special CPU "none" used to select generic C, now this is obsolete.
none-*-*)
enable_assembly=no
AC_MSG_WARN([the \"none\" host is obsolete, use --disable-assembly])
;;
esac
# mingw can be built by the cygwin gcc if -mno-cygwin is added. For
# convenience add this automatically if it works. Actual mingw gcc accepts
# -mno-cygwin too, but of course is the default. mingw only runs on the
# x86s, but allow any CPU here so as to catch "none" too.
#
case $host in
*-*-mingw*)
gcc_cflags_optlist="$gcc_cflags_optlist nocygwin"
gcc_cflags_nocygwin="-mno-cygwin"
;;
esac
CFLAGS_or_unset=${CFLAGS-'(unset)'}
CPPFLAGS_or_unset=${CPPFLAGS-'(unset)'}
cat >&AC_FD_CC <<EOF
User:
ABI=$ABI
CC=$CC
CFLAGS=$CFLAGS_or_unset
CPPFLAGS=$CPPFLAGS_or_unset
MPN_PATH=$MPN_PATH
GMP:
abilist=$abilist
cclist=$cclist
EOF
test_CFLAGS=${CFLAGS+set}
test_CPPFLAGS=${CPPFLAGS+set}
for abi in $abilist; do
abi_last="$abi"
done
# If we recognised the CPU, as indicated by $path being set, then insist
# that we have a working compiler, either from our $cclist choices or from
# $CC. We can't let AC_PROG_CC look around for a compiler because it might
# find one that we've rejected (for not supporting the modes our asm code
# demands, etc).
#
# If we didn't recognise the CPU (and this includes host_cpu=none), then
# fall through and let AC_PROG_CC look around for a compiler too. This is
# mostly in the interests of following a standard autoconf setup, after all
# we've already tested cc and gcc adequately (hopefully). As of autoconf
# 2.50 the only thing AC_PROG_CC really adds is a check for "cl" (Microsoft
# C on MS-DOS systems).
#
if test $found_compiler = no && test -n "$path"; then
AC_MSG_ERROR([could not find a working compiler, see config.log for details])
fi
case $host in
X86_PATTERN | X86_64_PATTERN)
# If the user asked for a fat build, override the path and flags set above
if test $enable_fat = yes; then
gcc_cflags_cpu=""
gcc_cflags_arch=""
fat_functions="add_n addmul_1 bdiv_dbm1c com cnd_add_n cnd_sub_n
copyd copyi dive_1 divrem_1
gcd_1 lshift lshiftc mod_1 mod_1_1 mod_1_1_cps mod_1_2
mod_1_2_cps mod_1_4 mod_1_4_cps mod_34lsub1 mode1o mul_1
mul_basecase mullo_basecase pre_divrem_1 pre_mod_1 redc_1
redc_2 rshift sqr_basecase sub_n submul_1"
if test "$abi" = 32; then
extra_functions="$extra_functions fat fat_entry"
path="x86/fat x86"
fat_path="x86 x86/fat x86/i486
x86/k6 x86/k6/mmx x86/k6/k62mmx
x86/k7 x86/k7/mmx
x86/k8 x86/k10 x86/bobcat
x86/pentium x86/pentium/mmx
x86/p6 x86/p6/mmx x86/p6/p3mmx x86/p6/sse2
x86/pentium4 x86/pentium4/mmx x86/pentium4/sse2
x86/core2 x86/coreinhm x86/coreisbr
x86/atom x86/atom/mmx x86/atom/sse2 x86/nano"
fi
if test "$abi" = 64; then
gcc_64_cflags=""
extra_functions_64="$extra_functions_64 fat fat_entry"
path_64="x86_64/fat x86_64"
fat_path="x86_64 x86_64/fat
x86_64/k8 x86_64/k10 x86_64/bd1 x86_64/bobcat x86_64/pentium4
x86_64/core2 x86_64/coreinhm x86_64/coreisbr x86_64/coreihwl
x86_64/coreibwl x86_64/skylake x86_64/atom x86_64/silvermont
x86_64/nano"
fat_functions="$fat_functions addmul_2 addlsh1_n addlsh2_n sublsh1_n"
fi
fat_thresholds="MUL_TOOM22_THRESHOLD MUL_TOOM33_THRESHOLD
SQR_TOOM2_THRESHOLD SQR_TOOM3_THRESHOLD
BMOD_1_TO_MOD_1_THRESHOLD"
fi
;;
esac
if test $found_compiler = yes; then
# If we're creating CFLAGS, then look for optional additions. If the user
# set CFLAGS then leave it alone.
#
if test "$test_CFLAGS" != set; then
eval optlist=\"\$${ccbase}${abi1}_cflags_optlist\"
test -n "$optlist" || eval optlist=\"\$${ccbase}${abi2}_cflags_optlist\"
for opt in $optlist; do
eval optflags=\"\$${ccbase}${abi1}_cflags_${opt}\"
test -n "$optflags" || eval optflags=\"\$${ccbase}${abi2}_cflags_${opt}\"
test -n "$optflags" || eval optflags=\"\$${ccbase}_cflags_${opt}\"
for flag in $optflags; do
# ~ represents a space in an option spec
flag=`echo "$flag" | tr '~' ' '`
case $flag in
-march=pentium4 | -march=k8)
# For -march settings which enable SSE2 we exclude certain bad
# gcc versions and we need an OS knowing how to save xmm regs.
#
# This is only for ABI=32, any 64-bit gcc is good and any OS
# knowing x86_64 will know xmm.
#
# -march=k8 was only introduced in gcc 3.3, so we shouldn't need
# the GMP_GCC_PENTIUM4_SSE2 check (for gcc 3.2 and prior). But
# it doesn't hurt to run it anyway, sharing code with the
# pentium4 case.
#
if test "$abi" = 32; then
GMP_GCC_PENTIUM4_SSE2($cc $cflags $cppflags,, continue)
GMP_OS_X86_XMM($cc $cflags $cppflags,, continue)
fi
;;
-no-cpp-precomp)
# special check, avoiding a warning
GMP_GCC_NO_CPP_PRECOMP($ccbase,$cc,$cflags,
[cflags="$cflags $flag"
break],
[continue])
;;
-Wa,-oldas)
GMP_GCC_WA_OLDAS($cc $cflags $cppflags,
[cflags="$cflags $flag"
break],
[continue])
;;
esac
GMP_PROG_CC_WORKS($cc $cflags $cppflags $flag,
[cflags="$cflags $flag"
break])
done
done
fi
ABI="$abi"
CC="$cc"
CFLAGS="$cflags"
CPPFLAGS="$cppflags"
eval GMP_NONSTD_ABI=\"\$GMP_NONSTD_ABI_$ABI\"
# Could easily have this in config.h too, if desired.
ABI_nodots=`echo $ABI | sed 's/\./_/'`
GMP_DEFINE_RAW("define_not_for_expansion(\`HAVE_ABI_$ABI_nodots')", POST)
# GMP_LDFLAGS substitution, selected according to ABI.
# These are needed on libgmp.la and libmp.la, but currently not on
# convenience libraries like tune/libspeed.la or mpz/libmpz.la.
#
eval GMP_LDFLAGS=\"\$${ccbase}${abi1}_ldflags\"
test -n "$GMP_LDFLAGS" || eval GMP_LDFLAGS=\"\$${ccbase}${abi1}_ldflags\"
AC_SUBST(GMP_LDFLAGS)
AC_SUBST(LIBGMP_LDFLAGS)
AC_SUBST(LIBGMPXX_LDFLAGS)
# extra_functions, selected according to ABI
eval tmp=\"\$extra_functions$abi1\"
test -n "$tmp" || eval tmp=\"\$extra_functions$abi2\"
extra_functions="$tmp"
# Cycle counter, selected according to ABI.
#
eval tmp=\"\$SPEED_CYCLECOUNTER_OBJ$abi1\"
test -n "$tmp" || eval tmp=\"\$SPEED_CYCLECOUNTER_OBJ$abi2\"
SPEED_CYCLECOUNTER_OBJ="$tmp"
eval tmp=\"\$cyclecounter_size$abi1\"
test -n "$tmp" || eval tmp=\"\$cyclecounter_size$abi2\"
cyclecounter_size="$tmp"
if test -n "$SPEED_CYCLECOUNTER_OBJ"; then
AC_DEFINE_UNQUOTED(HAVE_SPEED_CYCLECOUNTER, $cyclecounter_size,
[Tune directory speed_cyclecounter, undef=none, 1=32bits, 2=64bits)])
fi
AC_SUBST(SPEED_CYCLECOUNTER_OBJ)
# Calling conventions checking, selected according to ABI.
#
eval tmp=\"\$CALLING_CONVENTIONS_OBJS$abi1\"
test -n "$tmp" || eval tmp=\"\$CALLING_CONVENTIONS_OBJS$abi2\"
if test "$enable_assembly" = "yes"; then
CALLING_CONVENTIONS_OBJS="$tmp"
else
CALLING_CONVENTIONS_OBJS=""
fi
if test -n "$CALLING_CONVENTIONS_OBJS"; then
AC_DEFINE(HAVE_CALLING_CONVENTIONS,1,
[Define to 1 if tests/libtests has calling conventions checking for the CPU])
fi
AC_SUBST(CALLING_CONVENTIONS_OBJS)
fi
# If the user gave an MPN_PATH, use that verbatim, otherwise choose
# according to the ABI and add "generic".
#
if test -n "$MPN_PATH"; then
path="$MPN_PATH"
else
eval tmp=\"\$path$abi1\"
test -n "$tmp" || eval tmp=\"\$path$abi2\"
path="$tmp generic"
fi
# Long long limb setup for gmp.h.
case $limb_chosen in
longlong) DEFN_LONG_LONG_LIMB="#define _LONG_LONG_LIMB 1" ;;
*) DEFN_LONG_LONG_LIMB="/* #undef _LONG_LONG_LIMB */" ;;
esac
AC_SUBST(DEFN_LONG_LONG_LIMB)
# The C compiler and preprocessor, put into ANSI mode if possible.
AC_PROG_CC
AC_PROG_CC_STDC
AC_PROG_CPP
# The C compiler on the build system, and associated tests.
GMP_PROG_CC_FOR_BUILD
GMP_PROG_CPP_FOR_BUILD
GMP_PROG_EXEEXT_FOR_BUILD