-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
2116 lines (1818 loc) · 66.9 KB
/
configure.in
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.
AC_COPYRIGHT([
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 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 the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or (at
your option) any later version.
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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
])
AC_REVISION($Revision$)
AC_PREREQ(2.52)
AC_INIT(gmp-impl.h)
m4_pattern_forbid([^[ \t]*GMP_])
m4_pattern_forbid([^[ \t]*MPFR_CONFIGS])
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)
# 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
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)
AM_INIT_AUTOMAKE(gmp, GMP_VERSION)
AM_CONFIG_HEADER(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,
[./configure --enable-assert option, to enable some ASSERT()s])
fi
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(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,
[./configure --enable-fft option, to enable FFTs for multiplication])
fi
AC_ARG_ENABLE(mpbsd,
AC_HELP_STRING([--enable-mpbsd],
[build Berkley MP compatibility library [[default=no]]]),
[case $enableval in
yes|no) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-mpbsd, need yes or no]) ;;
esac],
[enable_mpbsd=no])
AM_CONDITIONAL(WANT_MPBSD, test "$enable_mpbsd" = "yes")
AC_ARG_ENABLE(mpfr,
AC_HELP_STRING([--enable-mpfr],[build MPFR [[default=no]]]),
[case $enableval in
yes|no) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-mpfr, need yes or no]) ;;
esac],
[enable_mpfr=no])
AM_CONDITIONAL(WANT_MPFR, test "$enable_mpfr" = "yes")
AC_ARG_ENABLE(nails,
AC_HELP_STRING([--enable-nails],[use nails on limbs [[default=no]]]),
[case $enableval in
[yes|no|[0-9]|[0-9][0-9]]) ;;
*) 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) ;;
*) AC_MSG_ERROR([bad value $enableval for --enable-profiling, need no/prof/gprof]) ;;
esac],
[enable_profiling=no])
GMP_DEFINE_RAW(["define(<WANT_PROFILING>,<\`$enable_profiling'>)"])
# -fomit-frame-pointer is incompatible with -pg, on x86s at least
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 calc demo program [[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])
# 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_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
#
# 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_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="-g -O2"
gcc_64_cflags="-g -O2"
cc_cflags="-O"
cc_64_cflags="-O"
SPEED_CYCLECOUNTER_OBJ=
cyclecounter_size=2
AC_SUBST(HAVE_HOST_CPU_FAMILY_power, 0)
AC_SUBST(HAVE_HOST_CPU_FAMILY_powerpc,0)
case $host in
a29k*-*-*)
path="a29k"
;;
alpha*-*-*)
case $host_cpu in
alphaev5 | alphapca5*) path="alpha/ev5 alpha" ;;
alphaev6*) path="alpha/ev6 alpha/ev5 alpha" ;;
*) path="alpha" ;;
esac
extra_functions="cntlz"
gcc_cflags_optlist="cpu asm"
# gcc 2.7.2.3 doesn't know any -mcpu= for alpha, apparently.
# gcc 2.95 and 3.0 know ev4, ev5, ev56, pca56, ev6.
# gcc 3.1 pre-releases add ev67.
#
case $host_cpu in
alpha) gcc_cflags_cpu="-mcpu=ev4" ;;
alphaev5) gcc_cflags_cpu="-mcpu=ev5" ;;
alphaev56) gcc_cflags_cpu="-mcpu=ev56" ;;
alphapca56 | alphapca57)
gcc_cflags_cpu="-mcpu=pca56" ;;
alphaev6) gcc_cflags_cpu="-mcpu=ev6" ;;
alphaev67 | alphaev68)
gcc_cflags_cpu="-mcpu=ev67 -mcpu=ev6" ;;
esac
# On old versions of gcc, which don't know -mcpu=, we believe an
# explicit -Wa,-mev5 etc will be necessary to put the assembler in
# the right mode for our .asm files and longlong.h asm blocks.
#
# On newer versions of gcc, when -mcpu= is known, we must give a
# -Wa which is at least as high as the code gcc will generate,
# since the options ordering seems to make our setting override
# that passed by gcc.
#
# gas 2.10.0 doesn't accept -mev67, but -mev6 is enough for ctlz
# and cttz, as used by longlong.h on ev67.
#
# OSF `as' accepts ev68 but stupidly treats it as ev4. -arch only seems
# to affect insns like ldbu which are expanded as macros when necessary.
# Insns like ctlz which were never available as macros are always
# accepted and always generate their plain code.
#
case $host_cpu in
alpha) gcc_cflags_asm="-Wa,-arch,ev4 -Wa,-mev4" ;;
alphaev5) gcc_cflags_asm="-Wa,-arch,ev5 -Wa,-mev5" ;;
alphaev56) gcc_cflags_asm="-Wa,-arch,ev56 -Wa,-mev56" ;;
alphapca56 | alphapca57)
gcc_cflags_asm="-Wa,-arch,pca56 -Wa,-mpca56" ;;
alphaev6) gcc_cflags_asm="-Wa,-arch,ev6 -Wa,-mev6" ;;
alphaev67 | alphaev68)
gcc_cflags_asm="-Wa,-arch,ev67 -Wa,-mev67 -Wa,-arch,ev6 -Wa,-mev6" ;;
esac
# It might be better to ask "cc" whether it's Cray C or DEC C,
# instead of relying on the OS part of $host. But it's hard to
# imagine either of those compilers anywhere except their native
# systems.
#
case $host in
*-cray-unicos*)
cc_cflags="-O" # no -g, it silently disables all optimizations
GMP_INCLUDE_MPN(alpha/unicos.m4)
# Don't perform any assembly syntax tests on this beast.
gmp_asm_syntax_testing=no
;;
*-*-osf*)
GMP_INCLUDE_MPN(alpha/default.m4)
cc_cflags=""
cc_cflags_optlist="opt cpu"
# not sure if -fast works on old versions, so make it optional
cc_cflags_opt="-fast -O2"
# DEC C V5.9-005 knows ev4, ev5, ev56, pca56, ev6.
# Compaq C V6.3-029 adds ev67.
#
case $host_cpu in
alpha) cc_cflags_cpu="-arch~ev4~-tune~ev4" ;;
alphaev5) cc_cflags_cpu="-arch~ev5~-tune~ev5" ;;
alphaev56) cc_cflags_cpu="-arch~ev56~-tune~ev56" ;;
alphapca56 | alphapca57)
cc_cflags_cpu="-arch~pca56~-tune~pca56" ;;
alphaev6) cc_cflags_cpu="-arch~ev6~-tune~ev6" ;;
alphaev67 | alphaev68)
cc_cflags_cpu="-arch~ev67~-tune~ev67 -arch~ev6~-tune~ev6" ;;
esac
;;
*)
GMP_INCLUDE_MPN(alpha/default.m4)
;;
esac
case $host in
*-*-unicos*)
# tune/alpha.asm assumes int==4bytes but unicos uses int==8bytes
;;
*)
SPEED_CYCLECOUNTER_OBJ=alpha.lo
cyclecounter_size=1 ;;
esac
;;
# Cray vector machines.
# This must come after alpha* so that we can recognize present and future
# vector processors with a wildcard.
*-cray-unicos*)
gmp_asm_syntax_testing=no
cclist="cc"
# The -hscalar0 is a workaround for miscompilation of mpz/import.c.
cc_cflags="-O3 -hscalar0 -htask0 -Wa,-B"
path="cray"
;;
arm*-*-*)
path="arm"
gcc_cflags="$gcc_cflags $fomit_frame_pointer"
gcc_testlist="gcc-arm-umodsi"
extra_functions="udiv"
GMP_INCLUDE_MPN(arm/arm-defs.m4)
;;
clipper*-*-*)
path="clipper"
;;
# Fujitsu
[f30[01]-fujitsu-sysv*])
cclist="gcc vcc"
# FIXME: flags for vcc?
vcc_cflags="-g"
path="fujitsu"
;;
hppa*-*-*)
# HP cc is K&R by default, but AM_C_PROTOTYPES will add "-Ae", or "-Aa
# -D_HPUX_SOURCE", to put it into ansi mode, if possible.
# default to pa7100
gcc_cflags="-g -O2"
gcc_cflags_optlist="arch"
gcc_cflags_arch="-mpa-risc-1-1"
cc_cflags="+DA1.1 +O2"
path="pa32/hppa1_1/pa7100 pa32/hppa1_1 pa32"
extra_functions="udiv_qrnnd"
SPEED_CYCLECOUNTER_OBJ=hppa.lo
cyclecounter_size=1
case $host in
hppa1.0*-*-*)
# override back to plain 1.0
gcc_cflags_optlist=
cc_cflags="+O2"
path="pa32"
;;
hppa7000*-*-*)
path="pa32/hppa1_1 pa32"
;;
hppa2.0*-*-*)
abilist="2.0n 1.0"
# FIXME: It's suspected that an assembler feature test might be
# necessary before -mpa-risc-2-0 can be enabled, since it's not
# clear (as of gcc 2.95.2) whether that option always gives an
# explicit ".level 2.0" or whatever to the assembler. In any case,
# under gcc 2.95.2 it only enables a few extra floating point insns,
# so it's not very important.
#
# gmp_cflags_arch="-mpa-risc-2-0 -mpa-risc-1-1"
# FIXME: path should be "pa32/hppa2_0 pa32/hppa1_1 pa32"
path="pa32/hppa2_0 pa32/hppa1_1/pa7100 pa32/hppa1_1 pa32"
# no gcc support for long long in 2.0n
cclist_20n="cc"
# +O2 to cc triggers bug in mpz/powm.c (cvs version 1.4)
cc_20n_cflags="+DA2.0 +e +O3"
cc_20n_testlist="hpc-hppa-2-0"
path_20n="pa64"
limb_20n=longlong
extra_functions_20n="umul_ppmm udiv_qrnnd"
SPEED_CYCLECOUNTER_OBJ_20n=hppa2.lo
cyclecounter_size_20n=2
# ABI=2.0w is available for hppa2.0w and hppa2.0, but not for hppa2.0n.
case $host in
hppa2.0n-*-*) ;;
*)
# HPUX 11 or up is required to run 2.0w. Not sure about other
# systems (GNU/Linux for instance), but lets assume they're ok.
case $host in
[*-*-hpux1[1-9]*]) abilist="2.0w $abilist" ;;
*-*-hpux*) ;;
*) abilist="2.0w $abilist" ;;
esac
# gcc support for 2.0w is in progress
cclist_20w="cc"
cc_20w_cflags="+DD64 +O3"
cc_20w_testlist="hpc-hppa-2-0"
path_20w="pa64"
extra_functions_20w="umul_ppmm udiv_qrnnd"
SPEED_CYCLECOUNTER_OBJ_20w=hppa2w.lo
cyclecounter_size_20w=2
;;
esac
;;
esac
;;
i960*-*-*)
path="i960"
;;
ia64*-*-*)
path="ia64"
GMP_INCLUDE_MPN(ia64/default.m4)
SPEED_CYCLECOUNTER_OBJ=ia64.lo
;;
# Motorola 68k
#
m68*-*-*)
GMP_INCLUDE_MPN(m68k/m68k-defs.m4)
gcc_cflags="-g $fomit_frame_pointer"
gcc_cflags_optlist="optimize arch"
gcc_cflags_optimize="-O2" # munged below on gcc 2.95.x
# gcc 2.7.2 doesn't know -m68060 or -mcpu32, so let them fall back
# appropriately.
# FIXME: Maybe "-m68020 -mnobitfield" would suit cpu32 on 2.7.2.
#
case $host in
m68020-*-*) gcc_cflags_arch="-m68020" ;;
m68030-*-*) gcc_cflags_arch="-m68030" ;;
m68040-*-*) gcc_cflags_arch="-m68040" ;;
m68060-*-*) gcc_cflags_arch="-m68060 -m68040" ;;
m68360-*-*) gcc_cflags_arch="-mcpu32 -m68000" ;;
*) gcc_cflags_arch="-m68000" ;;
esac
# FIXME: m68k/mc68020 looks like it's ok for cpu32, but this wants to be
# tested. Will need to introduce an m68k/cpu32 if m68k/mc62020 ever uses
# the bitfield instructions.
case $host in
[m680[2346]0-*-* | m68360-*-*]) path="m68k/mc68020 m68k"
extra_functions="udiv umul" ;;
*) path="m68k" ;;
esac
;;
# Motorola 88k
m88k*-*-*)
path="m88k"
;;
m88110*-*-*)
# FIXME: Use `-O2'?
gcc_cflags="-g -O -m88110"
path="m88k/mc88110 m88k"
;;
# National Semiconductor 32k
ns32k*-*-*)
path="ns32k"
;;
# IRIX 5 and earlier can only run 32-bit o32.
#
# IRIX 6 and up always has a 64-bit mips CPU can run n32 or 64. n32 is
# preferred over 64, but only because that's been the default in past
# versions of GMP. The two are equally efficient.
#
# Linux kernel 2.2.13 arch/mips/kernel/irixelf.c has a comment about not
# supporting n32 or 64.
#
# FIXME: It's necessary to pass -mabi or -n32 to the compiler when
# linking. Libtool used to strip them, hence the ldflags here. It
# looks like it has something equivalent itself now, so perhaps
# these can be removed.
#
mips*-*-*)
abilist="o32"
gcc_cflags_optlist="abi"
gcc_cflags_abi="-mabi=32"
gcc_testlist="gcc-mips-o32"
path="mips32"
cc_cflags="-O2 -o32" # no -g, it disables all optimizations
extra_functions="umul"
# this suits both mips32 and mips64
GMP_INCLUDE_MPN(mips32/mips-defs.m4)
case $host in
mips64*-*-* | mips*-*-irix[6789]*)
abilist="n32 64 o32"
cclist_n32="gcc cc"
gcc_n32_cflags="-g -O2 -mabi=n32"
gcc_n32_ldflags="-Wc,-mabi=n32"
# Pass just -O1, MIPSpro 7.2.1 miscompiles mpn/generic/divrem_1.c
# cvs version 1.20, for -O2 and -O3
cc_n32_cflags="-O1 -n32" # no -g, it disables all optimizations
cc_n32_ldflags="-Wc,-n32"
limb_n32=longlong
path_n32="mips64"
extra_functions_n32="umul"
cclist_64="gcc cc"
gcc_64_cflags="-g -O2 -mabi=64"
gcc_64_ldflags="-Wc,-mabi=64"
cc_64_cflags="-O2 -64" # no -g, it disables all optimizations
cc_64_ldflags="-Wc,-64"
path_64="mips64"
extra_functions_64="umul"
;;
esac
;;
# Darwin (powerpc-apple-darwin1.3) has gcc installed as cc.
#
# The darwin assembler doesn't accept "-mppc", so gcc_cflags_asm is
# optional. The right flag would be "-arch ppc" or some such, but that's
# already the default.
#
# The darwin pre-compiling preprocessor is disabled with -no-cpp-precomp
# since it doesn't like "__attribute__ ((mode (SI)))" etc in gmp-impl.h,
# and so always ends up running the plain preprocessor anyway. This could
# be done in CPPFLAGS rather than CFLAGS, but there's not many places
# preprocessing is done separately, and this is only a speedup, the normal
# preprocessor gets run if there's any problems.
#
powerpc*-*-*)
AC_DEFINE(HAVE_HOST_CPU_FAMILY_powerpc)
HAVE_HOST_CPU_FAMILY_powerpc=1
cclist="gcc cc"
cc_cflags="-g -O2"
gcc_cflags="-g -O2 -mpowerpc"
gcc_cflags_optlist="asm precomp cpu"
gcc_cflags_asm="-Wa,-mppc"
gcc_cflags_precomp="-no-cpp-precomp"
extra_functions="umul"
case $host_cpu in
powerpc740 | powerpc750 | powerpc7400)
path="powerpc32/750 powerpc32" ;;
*)
path="powerpc32" ;;
esac
# gcc 2.7.2 knows -mcpu=403, 603, 604.
# gcc 2.95 adds 401, 505, 602, 603e, ec603e, 604e, 620, 740, 750,
# 801, 821, 823, 860.
# gcc 3.0 adds 630, rs64a.
# gcc 3.1 pre-releases add 405, 7400, 7450.
#
# FIXME: The way 603e falls back to 603 for gcc 2.7.2 should be
# done for all the others too. But what would be the correct
# arrangements?
#
case $host_cpu in
powerpc401) gcc_cflags_cpu="-mcpu=401" ;;
powerpc403) gcc_cflags_cpu="-mcpu=403" ;;
powerpc405) gcc_cflags_cpu="-mcpu=405" ;;
powerpc505) gcc_cflags_cpu="-mcpu=505" ;;
powerpc602) gcc_cflags_cpu="-mcpu=602" ;;
powerpc603) gcc_cflags_cpu="-mcpu=603" ;;
powerpc603e) gcc_cflags_cpu="-mcpu=603e -mcpu=603" ;;
powerpc604) gcc_cflags_cpu="-mcpu=604" ;;
powerpc604e) gcc_cflags_cpu="-mcpu=604e -mcpu=604" ;;
powerpc620) gcc_cflags_cpu="-mcpu=620" ;;
powerpc630) gcc_cflags_cpu="-mcpu=630" ;;
powerpc740) gcc_cflags_cpu="-mcpu=740" ;;
powerpc7400) gcc_cflags_cpu="-mcpu=7400" ;;
powerpc7450) gcc_cflags_cpu="-mcpu=7450" ;;
powerpc750) gcc_cflags_cpu="-mcpu=750" ;;
powerpc801) gcc_cflags_cpu="-mcpu=801" ;;
powerpc821) gcc_cflags_cpu="-mcpu=821" ;;
powerpc823) gcc_cflags_cpu="-mcpu=823" ;;
powerpc860) gcc_cflags_cpu="-mcpu=860" ;;
esac
case $host in
*-*-aix*)
cclist="gcc xlc cc"
xlc_cflags="-g -O2 -qmaxmem=20000"
xlc_cflags_optlist="arch"
# xlc (what version?) knows -qarch=ppc, ppcgr, 601, 602, 603, 604,
# 403, rs64a
# -qarch=ppc is needed, so ensure everything falls back to that.
# FIXME: Perhaps newer versions know more flavours.
#
case $host_cpu in
powerpc403) xlc_cflags_arch="-qarch=403 -qarch=ppc" ;;
powerpc602) xlc_cflags_arch="-qarch=602 -qarch=ppc" ;;
powerpc603) xlc_cflags_arch="-qarch=603 -qarch=ppc" ;;
powerpc603e) xlc_cflags_arch="-qarch=603 -qarch=ppc" ;;
powerpc604) xlc_cflags_arch="-qarch=604 -qarch=ppc" ;;
powerpc604e) xlc_cflags_arch="-qarch=604 -qarch=ppc" ;;
*) xlc_cflags_arch="-qarch=ppc" ;;
esac
;;
esac
case $host in
POWERPC64_PATTERN)
# CPU type powerpc64 forces to a 64-bit limb
case $host in
powerpc64-*-*) abilist="32L" ;;
*) abilist="32L 32" ;;
esac
cclist_32L="gcc"
gcc_32L_cflags="-g -O2 -mpowerpc64"
gcc_32L_cflags_optlist="cpu"
limb_32L=longlong
path_32L="powerpc64"
extra_functions_32L="umul"
# On AIX a true 64-bit ABI is available.
case $host in
*-*-aix*)
# Need -Wc to pass object type flags through to the linker.
abilist="aix64 $abilist"
cclist_aix64="gcc xlc"
gcc_aix64_cflags="-g -O2 -maix64 -mpowerpc64"
gcc_aix64_cflags_optlist="cpu"
gcc_aix64_ldflags="-Wc,-maix64"
xlc_aix64_cflags="-g -O2 -q64 -qtune=pwr3 -qmaxmem=20000"
xlc_aix64_ldflags="-Wc,-q64"
# Must indicate object type to ar and nm
ar_aix64_flags="-X64"
nm_aix64_flags="-X64"
path_aix64="powerpc64"
extra_functions_aix64="umul"
;;
esac
;;
esac
;;
# POWER
[power-*-* | power[12]-*-* | power2sc-*-*])
AC_DEFINE(HAVE_HOST_CPU_FAMILY_power)
HAVE_HOST_CPU_FAMILY_power=1
cclist="gcc"
extra_functions="udiv_w_sdiv"
path="power"
gcc_cflags_optlist="cpu"
case $host in
power-*-*) gcc_cflags_cpu="-mcpu=power -mpower" ;;
power1-*-*) gcc_cflags_cpu="-mcpu=rios1 -mpower" ;;
power2-*-*) gcc_cflags_cpu="-mcpu=rios2 -mpower" ;;
power2sc-*-*) gcc_cflags_cpu="-mcpu=rsc -mpower" ;;
esac
case $host in
*-*-aix*)
cclist="gcc xlc"
xlc_cflags="-g -O2 -qarch=pwr -qmaxmem=20000"
;;
esac
;;
# FIXME: ppc601 isn't accepted by config.sub.
ppc601-*-*)
path="power powerpc32"
;;
pyramid-*-*)
path="pyr"
;;
# IBM s/370 and similar
[s3[6-9]0*-*-*])
gcc_cflags="-g -O2 $fomit_frame_pointer"
path="s390"
extra_functions="udiv_w_sdiv"
;;
sh-*-*) path="sh" ;;
sh2-*-*) path="sh/sh2 sh" ;;
*sparc*-*-*)
# For cc and acc, -g disables -O, so it's not used
cclist="gcc acc cc"
path="sparc32"
gcc_cflags="-g -O2"
gcc_cflags_optlist="cpu"
gcc_cflags_cpu=
acc_cflags="-O2"
cc_cflags="-O2"
# FIXME: This should be selected according to the CPU
if test x${floating_point} = xno
then extra_functions="udiv_nfp"
else extra_functions="udiv_fp"
fi
case $host in
sparcv8*-*-* | supersparc*-*-* | microsparc*-*-*)
gcc_cflags_cpu="-mcpu=v8 -mv8"
acc_cflags="-O2 -cg92"
path="sparc32/v8 sparc32"
extra_functions="udiv"
case $host in
*-*-solaris2.*) cc_cflags="-xtarget=native -xarch=v8 -xO4" ;;
esac
case $host in
supersparc*-*-*) path="sparc32/v8/supersparc sparc32/v8 sparc32" ;;
esac
;;
# sparc64-*-linux-gnu is a misnomer, since there's no support for any
# 64-bit operations in user mode. We assume that a future release
# will have some 64-bit support and that the gcc options will be the
# same as on solaris.
#
# cc -xarch actually controls the ABI, hence it must be v8 for 32-bit,
# even though the chip is v9.
#
sparcv9*-*-* | ultrasparc*-*-* | sparc64-*-*)
path="sparc32/v9 sparc32/v8 sparc32"
extra_functions="udiv_fp"
SPEED_CYCLECOUNTER_OBJ=sparcv9.lo
gcc_cflags="-g -O2 -Wa,-xarch=v8plus"
gcc_cflags_cpu="-mcpu=ultrasparc -mcpu=v9 -mcpu=v8 -mv8"
cc_cflags="-xtarget=native -xarch=v8 -xO4"
case $host in
[*-*-solaris2.[7-9]])
# solaris prior to 2.6 doesn't save registers properly, so the
# 64-bit ABI is only available for 2.7 up
abilist="64 32"
path_64="sparc64"
cclist_64="gcc cc"
gcc_64_cflags="-g -O2 -m64 -mptr64 -Wa,-xarch=v9 -mcpu=v9"
# -fast enables different optimizations depending compiler version
# -fns=no and -fsimple=1 disables some transformations that
# conflict with IEEE 754, which some compiler versions perform.
cc_64_cflags="-fast -fns=no -fsimple=1 -xarch=v9"
SPEED_CYCLECOUNTER_OBJ_64=sparcv9.lo
cyclecounter_size_64=2
;;
esac
;;
esac
;;
# VAX
vax*-*-*)
# Currently (version 3.0) gcc on vax always uses a frame pointer
# (config/vax/vax.h FRAME_POINTER_REQUIRED=1), so -fomit-frame-pointer
# will be ignored.
#
gcc_cflags="-g -O2 $fomit_frame_pointer"
path="vax"
extra_functions="udiv_w_sdiv"
;;
# AMD and Intel x86 configurations
X86_PATTERN)
AC_DEFINE(HAVE_HOST_CPU_FAMILY_x86)
# Rumour has it gcc -O2 used to give worse register allocation than just
# -O, but lets assume that's no longer true.
gcc_cflags="-g -O2 $fomit_frame_pointer"
GMP_INCLUDE_MPN(x86/x86-defs.m4)
extra_functions="udiv umul"
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. The
# -mcpu= and -march= options will fail, leaving just -m486.
#
# gcc 2.95.2 adds k6, pentium and pentiumpro, and allows -march= and
# -mcpu=.
#
# gcc 3.0 adds athlon.
#
# gcc 3.1 adds pentium4.
# Defaults for anything not otherwise mentioned.
path="x86"
gcc_cflags_optlist="cpu arch"
gcc_cflags_cpu="-mcpu=i486 -m486"
gcc_cflags_arch="-march=i486"
case $host in
i386*-*-*)
# Because i386 means generic x86, -mcpu=i486 is used since that
# should better suit newer processors.
# FIXME: How would a user ask for an actual 80386? Currently only by
# using CFLAGS="-mcpu=386" or whatever.
gcc_cflags_cpu="-mcpu=i486 -m486"
gcc_cflags_arch="-march=i386"
;;
i586*-*-* | pentium-*-* | pentiummmx-*-*)
gcc_cflags_cpu="-mcpu=pentium -m486"
gcc_cflags_arch="-march=pentium"
;;
[i686*-*-* | pentiumpro-*-* | pentium[23]-*-*])
gcc_cflags_cpu="-mcpu=pentiumpro -mcpu=i486 -m486"
gcc_cflags_arch="-march=pentiumpro -march=pentium -march=i486"
;;
k6*-*-*)
gcc_cflags_cpu="-mcpu=k6 -mcpu=i486 -m486"
gcc_cflags_arch="-march=k6 -march=i486"
;;
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="-mcpu=athlon -mcpu=pentiumpro -mcpu=i486 -m486"
gcc_cflags_arch="-march=athlon -march=pentiumpro -march=pentium -march=i486"
;;
pentium4-*-*)
# pentium4 is known to gcc 3.1 and up, not sure what cpu choice
# would best suit previous versions, pentiumpro will get us cmov
# from gcc 2.95.4 up, otherwise let's just try i486.
gcc_cflags_cpu="-mcpu=pentium4 -mcpu=pentiumpro -mcpu=i486 -m486"
gcc_cflags_arch="-march=pentium4 -march=pentiumpro -march=pentium -march=i486"
;;
esac
case $host in
i486*-*-*) path="x86/i486 x86" ;;
i586*-*-* | pentium-*-*) path="x86/pentium x86" ;;
pentiummmx-*-*) path="x86/pentium/mmx x86/pentium x86" ;;
i686*-*-* | pentiumpro-*-*) path="x86/p6 x86" ;;
pentium2-*-*) path="x86/p6/mmx x86/p6 x86" ;;
pentium3-*-*) path="x86/p6/p3mmx x86/p6/mmx x86/p6 x86";;
[k6[23]*-*-*]) path="x86/k6/k62mmx x86/k6/mmx x86/k6 x86" ;;
k6*-*-*) path="x86/k6/mmx x86/k6 x86" ;;
athlon-*-*) path="x86/k7/mmx x86/k7 x86" ;;
pentium4-*-*) path="x86/pentium4/sse2 x86/pentium4/mmx x86/pentium4 x86" ;;
esac
;;
# FIXME: z8kx won't get through config.sub. Could make 16 versus 32 bit
# limb an ABI option perhaps.
z8kx*-*-*)
path="z8000x"
extra_functions="udiv_w_sdiv"
;;
z8k*-*-*)
path="z8000"
extra_functions="udiv_w_sdiv"
;;
# Special CPU "none" selects generic C. -DNO_ASM is used to disable gcc
# asm blocks in longlong.h (since they're driven by cpp pre-defined
# symbols like __alpha rather than the configured $host_cpu).
#
none-*-*)
abilist="long longlong"
cclist_long=$cclist
gcc_long_cflags=$gcc_cflags
gcc_long_cppflags="-DNO_ASM"
cc_long_cflags=$cc_cflags
cclist_longlong=$cclist