File: configure.in

package info (click to toggle)
mpich 1.1.0-3
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 22,116 kB
  • ctags: 27,349
  • sloc: ansic: 193,435; sh: 11,172; fortran: 6,545; makefile: 5,801; cpp: 5,020; tcl: 3,548; asm: 3,536; csh: 1,079; java: 614; perl: 183; awk: 168; sed: 70; f90: 62
file content (2681 lines) | stat: -rw-r--r-- 89,243 bytes parent folder | download | duplicates (2)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
dnl This is an autoconf script.
dnl To rebuild the `configure' script from this, execute the command
dnl 	autoconf
dnl in the directory containing this script.  You must have autoconf
dnl version 1.4 or later (but NOT version 2.0 or later)
dnl
dnl The following text appears in the resulting `configure' script,
dnl explaining how to rebuild it.
[#!/bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf.
# Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.

# This program 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 a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

progname="`echo $0 | sed 's:^\./\./:\./:'`"
print_error() {
    echo "*# $*" 2>&1 ;
    }
print_usage() {
cat <<.
Usage: ${progname} [-arch=ARCH_TYPE] [-comm=COMM_TYPE]
            [-device=DEVICE]
            [-prefix=INSTALL_DIR]  [-c++[=C++_COMPILER]]
            [-cc=C_COMPILER] [-fc=FORTRAN_COMPILER]
            [-clinker=C_LINKER] [-flinker=FORTRAN_LINKER]
            [-c++linker=CC_LINKER] 
            [-mpe] [-nompe] [-nof77] [-f90nag] [-opt=OPTFLAGS] 
	    [-make=MAKEPGM]
            [-cflags=CFLAGS] [-fflags=FFLAGS] [-c++flags=CCFLAGS]
            [-optcc=C_OPTFLAGS] [-optf77=F77_OPTFLAGS]
            [-lib=LIBRARY] [-mpilibname=MPINAME]
            [-no_mpegraphics] [-no_short_longs] [-memdebug]
            [-x11_lib=X11LIB] [-x11_inc=X11INC]
            [-mpedbg] [-nompedbg] [-cross] [-devdebug] [-nodevdebug] 
            [-debug] [-nodebug] [-tracing]
	    [-var_pkt] [-pkt_size=LENGTH] [-adi_collective]
            [-adi_coll_world]
            [-wish=WISH] [-tcldir=TCLDIR] [-tkdir=TKDIR]
            [-fortnames=FORTRANNAMES]
            [-ar_nolocal] [-automountfix=AUTOMOUNTFIX]
            [-noranlib] [-rsh=RSHCOMMAND] [-rshnol]
	    [-nexusthreads] [-nexusdir=NEXUSDIR] [-nexuslib=NEXUSLIB]
            [-nexusdebug] [-nexusconfigure=NEXUSCONFIGURE]
where
   ARCH_TYPE    = the type of machine that MPI is to be configured for
   COMM_TYPE    = communications layer or option to be used
   DEVICE       = communications device to be used
   INSTALL_DIR  = directory where MPI will be installed (optional)
   C++_COMPILER = default is to use g++ (optional)
   OPTFLAGS     = optimization flags to give the compilers (e.g. -g)
   CFLAGS       = flags to give C compiler
   FFLAGS       = flags to give Fortran compiler
   MAKEPGM      = version of make to use
   LENGTH       = Length of message at which ADI switches from short
                  to long message protocol
   WISH         = Name of tcl/tk wish executable.  Configure will attempt
                  to find a version of wish for you, but if there is
                  no wish in your path or you need to use a different
                  version, use this option.  Used only for the display
                  tools (nupshot and upshot).  tk 3.x required for nupshot;
                  tk 3.x or 4.x for upshot.
   TCLDIR       = Directory containing tcl.  Must have lib/libtcl.a and
                  include/tcl.h .  Used only for nupshot.
   TKDIR        = Directory containing tk 3.3, 3.4, 3.5, or 3.6.  Must have 
                  lib/libtk.a and include/tk.h .  Used only for nupshot.  
                  May be the same as TCLDIR.
   FORTRANNAMES = Form of the Fortran names.  See below.
   X11LIB       = Full path name for libX11.a
   X11INC       = Full path name for X11.h
   AUTOMOUNTFIX = Command to fix automounters
   RSHCOMMAND   = Command to use for remote shell
   MPILIBNAME   = Name to use instead of mpi in the name of the MPI
                  library.  If set, libMPILIBNAME will be used instead
                  or libmpi.  This can be used on systems with
                  several different MPI implementations.
   NEXUSDIR     = the location of the nexus distribution
   NEXUSLIB     = the location of the nexus library, if not in the standard
                  place within the distribution
   NEXUSCONFIGURE = the actual configuration options to be propagated to 
                  the Nexus subsystem configuration. This option is for
                  experts only (i.e. you know Nexus)

All arguments are optional, but if 'arch', 'comm', or 'prefix' arguments
are provided, there must be only one.  'arch' must be specified before
'comm' if they both appear.

If '-c++' is included as an option, then the C++ interface is also built.
By default, g++ is used as the c++ compiler.  THIS IS CURRENTLY
UNSUPPORTED.

You can select a different C and Fortran compiler by using the '-cc' and
'fc' switches.  The environment variables 'CC' and 'FC' can also provide
values for these but their settings may be overridden by the configure
script.  Using '-cc=\$CC -fc=\$FC' will force configure to use those
compilers.

If '-cross' is given, configure assumes that you are cross-compiling.  If
it is not given, configure expects to be able to run programs.  Even if
'-cross' is not selected, configure will try to determine if you are
cross-compiling; this switch is needed only on systems where attempting
to run a cross-compiled program causes the configure script to hang.

If '-mpe' is included as an option, then the MPE 'helper' libraries will
also be built.  '-nompe' causes the MPE libraries to not be built.  The
default is '-mpe'.  If '-no_mpegraphics' is used, then the MPE routines
that make use of X11 graphics will NOT be built; this is appropriate for
systems that either do not have the X11 include files or that do not
support X11 graphics (some message-passing systems cannot interoperate
with X11).  The options -x11_inc and -x11_lib may be used to specify the
locations of the X11 include files and libraries in the event that
configure cannot find them (they should both be specified in that case).

The option '-mpedbg' enables the '-mpedbg' command line switch in MPI
programs.  When used with an MPI program, the default error handler
(i.e., MPI_COMM_WORLD's error handler) tries to start xterm's running dbx
for each process that detects an error.  This option is intended
primarily for workstation environments but should work on some MPPs (such
as IBM SP2).

The option '-nof77' prevents the compilation of routines that require a
Fortran compiler.  If this option is selected, you may not use the
Fortran interface to MPI.

The option '-f90nag' allows you to use the NAG Fortran 90 instead of
Fortran 77.  This is a preliminary version and is based on the version
for NeXTs.

The option '-opt' allows you to specify optimization options for the
compilers (both C and Fortran).  For example, '-opt=-O' chooses optimized
code generation on many systems.  '-optcc' and '-optf77' allow you to
specify options for just the C or Fortran compilers.  Use -cflags and
-fflags for options not related to optimization.

The option '-nexusthreads' enables multithreading within the ch_nexus
device.  The default version of the ch_nexus device is configured as
single-threaded.

The option '-nexusdebug' enables special debugging services in the
ch_nexus device.  The default version of the ch_nexus device is
configured without debugging.

The option '-nexusdir=NEXUSDIR' allows one to specify the location of an
installed version of Nexus.  The default is to use a version that is
distributed with MPICH, in the mpid/ch_nexus directory.

The option '-nexuslib=NEXUSLIB' allows one to specify a specific nexus
library to link against.  The default is -lnexus_dl.  Note that this is
not a path name.

The option '-nexusconfigure=NEXUSCONFIGURE' allows one to specify
exactly how the Nexus subsystem will be built. This option is intended
for people who are really familiar with the Nexus software and its
configuration. When using this option, the '-nexusthreads' and
'-nexusdebug' options will be be ignored.

The option '-lib' allows you to specify the location of a library that
may be needed by a particular device.  Most devices do NOT need this
option; check the installation instructions for those that might.

The option '-make' may be used to select an alternate make program.  For
example, on FreeBSD systems, -make=gnumake may be required because of
bugs in the system make.

The option '-no_short_longs' may be used to suppress support for ANSI C
types 'long long int' and 'long double' when they are the same size as
'long' and 'double' respectively.  Some systems allow these long ANSI C
types, but generate a warning message when they are used; this option may
be used to suppress these messages (and support for these types).

The option '-fortnames=FORTRANNAMES' allows you to specify the form of
the Fortran names.  This is used primarily to generate names with and
without trailing underscores for those systems that support both.
Possible values are
    FORTRANNAMES value     if Fortran MPI_SEND looks like
    DOUBLEUNDERSCORE       mpi_send__
    UNDERSCORE             mpi_send_
    CAPS                   MPI_SEND
    NOUNDERSCORE           mpi_send 

This option should normally NOT be used; configure determines what the
Fortran compiler generates.  This can be used to override that choice.

The option '-ar_nolocal' prevents the library archive command from
attempting to use the local directory for temporary space.  This option
should be used when (a) there isn't much space (less than 20 MB)
available in the partition where MPICH resides and (b) there is enough
space in /tmp (or wherever ar places temporary files by default).

The option '-noranlib' causes the 'ranlib' step (needed on some systems
to build an object library) to be skipped.  This is particularly useful
on systems where 'ranlib' is optional (allowed but not needed; because it
is allowed, configure chooses to use it just in case) but can fail (some
'ranlib's are implemented as scripts using 'ar'; if they don't use the
local directory, they can fail (destroying the library in the process) if
the temporary directory (usually '/tmp') does not have enough space.
This has occured on some OSF systems.

The option '-memdebug' enables extensive internal memory debugging code.
This should be used only if you are trying to find a memory problem (it
can be used to help find memory problems in user code as well).

The option '-debug' enables the collection of additional information for
parallel debuggers such as Totalview.

The option '-tracing' enables tracing of internal calls.  This should be
used only for debugging the MPICH implementation itself.

The option '-rsh' allows you to select an alternative remote shell
command (by default, configure will use 'rsh' or 'remsh' from your
'PATH').  If your remote shell command does not support the '-l' option
(some AFS versions of 'rsh' have this bug), also give the option
'-rshnol'.  These options are useful only when building a network version
of MPICH (e.g., '-device=ch_p4' or '-device=ch_tcp').

Special Tuning Options:

There are a number of options for tuning the behavoir of the ADI
(Abstract Device Interface) which is the low-level message-passing
interface.  These should NOT be used unless you are sure you know what
you are doing.

The option '-nodevdebug' disables the debugging code in the MPI ADI code.
This should be used only when you are sure that everything is working
correctly.  (This option is also present to remind benchmarkers that the
low level code by default may contain debugging code.)  Note also that
some of the device code (in mpid/*) has had the debugging code removed
from the source code.  '-devdebug' turns on the debugging code.
'-nodevdebug' is the default.

The option '-var_pkt' allows you to set the message size at which MPICH
changes from its short to long message protocol.

The option '-pkt_size=LENGTH' allows you to choose the message length at
which the ADI (Abstract Device Interface) switches from its short to long
message format.  LENGTH must be positive.

The option '-adi_collective' allows the ADI to provide some collective
operations in addition to the basic point-to-point operations.
Currently, most systems do not support this option (it is ignored) and on
the others it has not been extensively tested.  The option
'-adi_coll_world' asks the ADI to try and use any collective operations
that are supported only on the MPI_COMM_WORLD communicator (and any
communicator with a similiar group).  This is also untested.


Sample Configure Usage:

To make for running on sun4's running SunOS with ch_p4 as the device,
 and with the installation directory equal to the current directory:

  ./configure -device=ch_p4 -arch=sun4
  make

Known devices are 
        ch_nx     (native Intel NX calls), 
        ch_mpl    (native IBM EUI or MPL calls),
        ch_p4     (p4)
	ch_nexus  (Nexus)
        ch_meiko  (for Meiko CS2, using NX compatibility library),
        ch_shmem  (for shared memory systems, such as SMPs), 
        ch_lfshmem(for shared memory systems, such as SMPs; uses
                   lock-free message buffers), 
        ch_cenju3 (native NEC Cenju-3 calls)

The following devices were supported with ADI-1, but are currently
unsupported.  Please contact us if you are interested in helping us
support these devices:
        meiko     (for Meiko CS2, using elan tport library), and
	nx        (for Intel Paragon),
	t3d	  (for the Cray T3D, using Cray shmem library).
        ch_nc     (native nCUBE calls, requires -arch=ncube),
        ch_cmmd   (native TMC CM-5 CMMD calls), 

Known architectures include (case is important)
        sun4      (SUN OS 4.x)
        solaris   (Solaris)
	solaris86 (Solaris on Intel platforms)
        hpux      (HP UX)
        rs6000    (AIX for IBM RS6000)
        sgi       (Silicon Graphics IRIX 4.x, 5.x or 6.x)
        sgi5      (Silicon Graphics IRIX 5.x on R4400's, for the MESHINE)
        IRIX      (synonym for sgi)
        IRIX32    (IRIX with 32bit objects -32)
        IRIXN32   (IRIX with -n32)
        IRIX64    (IRIX with 64bit objects)
        alpha     (DEC alpha)
        intelnx   (Intel i860 or Intel Delta)
        paragon   (Intel Paragon)
        meiko     (Meiko CS2)
        CRAY      (CRAY XMP, YMP, C90, J90, T90)
        cray_t3d  (CRAY T3D)
        freebsd   (PC clones running FreeBSD)
	LINUX     (PC clones running LINUX)
        ksr       (Kendall Square KSR1 and KSR2)
        EWS_UX_V  (NEC EWS4800/360AD Series workstation.  Untested.)
        UXPM      (UXP/M. Untested.)
        uxpv      (uxp/v. Untested.)
        SX_4_float0
                  (NEC SX-4; Floating point format float0
                             Conforms IEEE 754 standard.
                   C:       sizeof (int)     = 4; sizeof (float) = 4
                   FORTRAN: sizeof (INTEGER) = 4; sizeof (REAL)  = 4)
        SX_4_float1
                  (NEC SX-4; Floating point format float1
                             IBM floating point format.
                   C:       sizeof (int)     = 4; sizeof (float) = 4
                   FORTRAN: sizeof (INTEGER) = 4; sizeof (REAL)  = 4)
        SX_4_float2
                  (NEC SX-4; Floating point format float2
                             CRAY floating point format.
                   C:       sizeof (int)     = 4; sizeof (float) = 8
                   FORTRAN: sizeof (INTEGER) = 8; sizeof (REAL)  = 8)
                   !!! WARNING !!! This version will not run
                                   together with FORTRAN routines.
                                   sizeof (INTEGER) != sizeof (int)
        SX_4_float2_int64
                   (NEC SX-4; Floating point format float2 and
                              64-bit int's)
                    C:       sizeof (int)     = 8; sizeof (float) = 8
                    FORTRAN: sizeof (INTEGER) = 8; sizeof (REAL)  = 8)

Special notes:

For SGI (-arch=IRIX) multiprocessors running the ch_p4 device, use
-comm=ch_p4 to disable the use of the shared-memory p4 communication
device, and -comm=shared to enable the shared-memory p4 communication
device.  The default is to enable the shared-memory communication device.

Others may be recognized.
.
}
#
ARCH=""
CPP_DIR=""
LIB_PATH=""
FLIB_PATH=""
OPTFLAGS=""
OPTFLAGSF=""
NOF77=0
AR_LOCAL=l
NOSHORTLONGS=0
HAS_FORTRAN=1
MPILIBNAME=mpi
# Nag F90 names are call f90_unix_MP_getarg(i,s) and 
# f90_unix_MP_iargc().
F77GETARG="call getarg(i,s)"
F77IARGC="iargc()"
F90UNIX="C"
MPI_FOBJECTS="\$(MPI_FOBJECTS)"
CFLAGS=""
# We use @ because configure uses %
AUTOMOUNTFIX='sed -e s@/tmp_mnt/@/@g'
#
# By not setting FFLAGS, we get the values from the environment
MPE_GRAPHICS="-DMPE_GRAPHICS"
MAKE=make
P4_MDEPCFLAGS=""
ASMFILES_O=""
PREFIX=""
DEVCFLAGS=""
CONFIGURE_ARGS="$*"
DEFAULT_MACHINE=''
DEVICE_KIND=MPP
cross_compiling=0
is_adi1=0
debug_version=0
# Note default directory is relative to mpid/ch_nexus, but user may override
# with full path
NEXUSDEFAULTDIR="nexus"
NEXUSDIR="$NEXUSDEFAULTDIR"
NEXUSLIB="-lnexus_dl"
nexusthreads=0
#
MPIFDEP="mpif.h"
#
# -mpedbg
MPE_MPI_EXT_C="$MPE_MPI_EXT_C dbxerr.c mpehname.c"
MPE_MPI_EXT_O="$MPE_MPI_EXT_O dbxerr.o mpehname.o"
#
# -mpe
MPE_DIR="mpe"
# -devdebug
DEVDEBUGCFLAGS="-DMPID_DEBUG_NONE -DMPID_STAT_NONE"
#
# This next variable is a version without quotes.
# We could also consider `echo $a | sed -e 's/"/\\"/g'`
CONFIGURE_ARGS_CLEAN=`echo $* | tr '"' ' '`
if test -n "$CONFIGURE_ARGS" ; then 
    echo "Configuring with args $CONFIGURE_ARGS"
fi
# 
MPIVERSION=`cat include/patchlevel.h | awk '{print $3}' | sed -e 's/\.[0-9]//' | tr '\012' '.'`
# Also check for exp version by looking for "mpich-exp" in the directory
# path
mpidirname=`pwd | sed -e 's%^.*/mpich-exp$%FOUND%g'`
if test "$mpidirname" = "FOUND" ; then
    MPIVERSION="$MPIVERSION (experimental)"
fi
echo "Configuring MPICH Version $MPIVERSION"
#
# IS_HETERO is set if the device supports heterogeneous machines.
# This requires additional coding, including checking for XDR
IS_HETERO=0
for arg
do
  # Handle --exec-prefix with a space before the argument.
  if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  # Handle --host with a space before the argument.
  elif test x$next_host = xyes; then next_host=
  # Handle --prefix with a space before the argument.
  elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  # Handle --srcdir with a space before the argument.
  elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  else
    case $arg in
     # For backward compatibility, also recognize exact --exec_prefix.
     -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
	exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
     -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
	next_exec_prefix=yes ;;

     -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
	PREFIX=`echo $arg | sed 's/[-a-z_]*=//'` ;;
     -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
	next_prefix=yes ;;

     -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
	srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
     -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
	next_srcdir=yes ;;

     -arch=* | --arch=*)
       package=`echo $arg|sed 's/-*arch=//'`
       # Delete all the valid chars; see if any are left.
       if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
         print_error "configure: $package: invalid architecture name"; exit 1
       fi
       ARCH=`echo $package|sed s/-/_/g`
       eval "arch_`echo $package|sed s/-/_/g`=1"
       ;;

     -bopt=* | --bopt=*)
       package=`echo $arg|sed 's/-*bopt=//'`
       # Delete all the valid chars; see if any are left.
       if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
         print_error "configure: $package: invalid bopt value" ; exit 1
       fi
       BOPT=`echo $package|sed s/-/_/g`
       eval "bopt_`echo $package|sed s/-/_/g`=1" ;;

     -comm=* | --comm=*)
       package=`echo $arg|sed 's/-*comm=//'`
       # Delete all the valid chars; see if any are left.
       if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
         print_error "configure: $package: invalid communications layer name";
	  exit 1
       fi
       COMM=`echo $package|sed s/-/_/g`	
       eval "comm_`echo $package|sed s/-/_/g`=1" 
       # Handle possible synonyms
       if test -n "$comm_ch_eui" ; then
           comm_ch_mpl=1
           COMM=ch_mpl
       fi
	;;

     -device=* | --device=*)
       package=`echo $arg|sed 's/-*device=//'`
       # Delete all the valid chars; see if any are left.
       if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
         print_error "configure: $package: invalid device name" ; exit 1
       fi
       DEVICE=$package    #|sed s/-/_/g`
       # Can't have - in variable names
       package=`echo $package | sed s/-/_/g`
       eval "device_$package=1" 
       # Handle possible synonyms
       if test -n "$device_ch_eui"; then
           device_ch_mpl=1
           DEVICE=ch_mpl
       fi
       ;;

     -adi1)
        CFLAGS="$CFLAGS -DMPI_ADI1"
	is_adi1=1
	;;

     -adi1ok)
	# THIS IS A SECRET FLAG.  DON'T USE THIS UNLESS YOU KNOW WHAT
	# YOU ARE DOING.  IF YOU DON'T KNOW WHAT WE'RE TALKING ABOUT,
	# DON'T USE IT.
	adi1_ok=1
	;;

     -mpedbg | --mpedbg)
	# Definitions of DEFS must follow the PREPARE
	MPE_MPI_EXT_C="$MPE_MPI_EXT_C dbxerr.c mpehname.c"
	MPE_MPI_EXT_O="$MPE_MPI_EXT_O dbxerr.o mpehname.o"
	;;

     -nompedbg | --nompedbg)
	# Definitions of DEFS must follow the PREPARE
	MPE_MPI_EXT_C=""
	MPE_MPI_EXT_O=""
	;;

     -ar_nolocal | --ar_nolocal)
	AR_LOCAL=''
	;;

     -noranlib | -no_ranlib)
        RANLIB=':'
	;;

     -mpilibname=*)
	MPILIBNAME=`echo A$arg|sed 's/A-*mpilibname=//'`
	;;

     -nodevdebug | --nodevdebug)
        NODEVDEBUG=1
	DEVDEBUGCFLAGS="-DMPID_DEBUG_NONE -DMPID_STAT_NONE"
	;;

     -devdebug | --devdebug)
        NODEVDEBUG=0
	DEVDEBUGCFLAGS=""
	;;

     -debug | --debug)
	debug_version=1
	;;
	
     -nodebug | --nodebug)
	debug_version=0
	;;

     -no_short_longs | --no_short_longs)
	NOSHORTLONGS=1
	;;

     -memdebug | --memdebug)
	MEMDEBUG=1
	;;

     -tracing | --tracing)
	TRDEBUG=1
	;;

     -cross)
	cross_compiling=1
	;;

     -var_pkt | --var_pkt)
        VARPKT=1
	DEVCFLAGS="$DEVCFLAGS -DMPID_PKT_VAR_SIZE"
	;;

     -pkt_size=* | --pkt_size=*)
	pktsize=`echo $arg|sed 's/-*pkt_size=//'`
	PKTSIZE=$pktsize
       	DEVCFLAGS="$DEVCFLAGS -DMPID_PKT_MAX_DATA_SIZE=$pktsize"
	;;

     -limited_buffers | --limited_buffers)
	LIMITEDBUFFERS=1
	DEVCFLAGS="$DEVCFLAGS -DMPID_LIMITED_BUFFERS"
	;;

     -tiny_buffers | --tiny_buffers)
	TINYBUFFERS=1
	DEVCFLAGS="$DEVCFLAGS -DMPID_TINY_BUFFERS"
	;;

     -nolimited_buffers | --nolimited_buffers)
	LIMITEDBUFFERS=0
	DEVCFLAGS="$DEVCFLAGS -DMPID_NO_LIMITED_BUFFERS"
	;;

     -notiny_buffers | --notiny_buffers)
	TINYBUFFERS=0
	DEVCFLAGS="$DEVCFLAGS -DMPID_NO_TINY_BUFFERS"
	;;

	# This is for p4 (and p3?)
      -socksize=*|--socksize=*)
   	SOCKSIZE="`echo $arg|sed 's/-*socksize=//'`"
     	;;

     -adi_collective | --adi_collective)
	ADI_COLLECTIVE=1
	;;

     -adi_coll_world | --adi_coll_world)
	ADI_COLL_WORLD=1
	;;

     -f77idx)
	# Force POINTER_64_BITS definition
	F77IDX=1
	;;

     -f90nag)
        # Insert module 
	F90UNIX="      use f90_unix"
	FC=f90
	# Still to do - make sure that the Fortran interface is correctly
	# selected.
        ;;

     -c++ | --c++)
       CPP_DIR="src/c++"
       CPP_COMPILER="g++"
       echo Compiling C++ interface with g++ ;;

     -c++=* | --c++=*)
       package=`echo $arg|sed 's/-*c\+\+=//'`
       # Delete all the valid chars; see if any are left.
       if test -n "`echo $package|sed 's/[-a-zA-Z0-9_+]*//g'`"; then
         print_error "configure: $package: invalid c++ compiler name"; exit 1
       fi
       CPP_DIR="src/c++"
       CPP_COMPILER=`echo $package`		
       echo Compiling C++ interface with $package ;;

     -cc=* | --cc=*)
	CC=`echo $arg|sed 's/-*cc=//'`
	USERCC=1
	;;

     -fc=* | --fc=*)
	FC=`echo $arg|sed 's/-*fc=//'`
	USERF77=1
	;;

     -fortnames=*)
	# Valid values are
	# FORTRANDOUBLEUNDERSCORE
	# FORTRANUNDERSCORE
	# FORTRANCAPS
	# FORTRANNOUNDERSCORE
	FORTRANNAMES="FORTRAN`echo $arg|sed 's/-*fortnames=//'`"
	;;

     -clinker=* | --clinker=*)
	CLINKER=`echo $arg|sed 's/-*clinker=//'`
	USERCLINKER=1
	;;

     -c++linker=* | --c++linker=*)
	CCLINKER=`echo $arg|sed 's/-*c++linker=//'`
	USERCCLINKER=1
	;;

     -flinker=* | --flinker=*)
	FLINKER=`echo $arg|sed 's/-*flinker=//'`
	USERFLINKER=1
	;;

      -rsh=*)
	rshcommand=`echo A$arg|sed 's/A-rsh=//'`
	;;

      -rshnol)
	rshnol=1
	;;

     -lib=* | --lib=*)
       package="`echo $arg|sed 's/-*lib=//'`"
       USERLIB="$package" ;;

     -opt=* | --opt=*)
       package="`echo $arg|sed 's/-*opt=//'`"
       OPTFLAGS="$package" ;;

     -optcc=* | --optcc=*)
       package="`echo $arg|sed 's/-*optcc=//'`"
       OPTFLAGSC="$package" ;;

     -optf77=* | --optf77=*)
       package="`echo $arg|sed 's/-*optf77=//'`"
       OPTFLAGSF="$package" ;;

     -cflags=* | --cflags=*)
       package="`echo $arg|sed 's/-*cflags=//'`"
       USER_CFLAGS="$package"
       CFLAGS="$CFLAGS $package" ;;

     -c++flags=* | --c++flags=*)
       package="`echo $arg|sed 's/-*c++flags=//'`"
       USER_CCFLAGS="$package"
       CCFLAGS="$CCFLAGS $package" ;;

     -fflags=* | --fflags=*)
       package="`echo $arg|sed 's/-*fflags=//'`"
       FFLAGS="$package" ;;

     -mpe | --mpe)
       MPE_DIR="mpe"
       echo "Make will build MPE routines" ;;
 
     -nompe | --nompe)
       MPE_DIR=""
       echo "Make will not build MPE routines" ;;
 
     -no_mpegraphics | --no_mpegraphics)
       MPE_GRAPHICS=""
       echo "Make will not build MPE graphics routines" ;;

     -x11_lib=* | --x11_lib=* )
       USERXLIB=1
       X11LIB="`echo $arg|sed 's/-*x11_lib=//'`"
       ;;

     -x11_inc=* | --x11_inc=* )
       USERXLIB=1
       X11INC="`echo $arg|sed 's/-*x11_inc=//'`"
       ;;

     -make=* | --make=*)
       package=`echo $arg|sed 's/-*make=//'`
       MAKE="$package"
	;;

     -nof77 | --nof77)
       echo "Don't build the Fortran interfaces"
       NOF77=1
       HAS_FORTRAN=0
       CFLAGS="-DMPID_NO_FORTRAN $CFLAGS"
       MPI_FOBJECTS="" ;;
	
     -wish=* | --wish=*)
	wishloc="`echo $arg|sed 's/-*wish=//'`"
       ;;

     -tkdir=* | --tkdir=*)
	TK_DIR="`echo $arg|sed 's/-*tkdir=//'`"
       ;;

     -tcldir=* | --tcldir=*)
	TCL_DIR="`echo $arg|sed 's/-*tcldir=//'`"
       ;;

     -automountfix=* | --automountfix=*)
	AUTOMOUNTFIX="`echo $arg | sed 's/-*automountfix=//'`"
	;;

     -nobanner)
	nobanner=1
	;;

     -echo )
	set -x 
        configure_echo=1
	;;

     -nexusthreads | --nexusthreads )
        nexusthreads=1
        ;;

     -nexusdebug | --nexusdebug )
        nexusdebug=1
        ;;

     -nexusdir=* | --nexusdir=*)
	NEXUSDIR="`echo $arg|sed 's/-*nexusdir=//'`"
       ;;

     -nexuslib=* | --nexuslib=*)
	NEXUSLIB="`echo $arg|sed 's/-*nexuslib=//'`"
       ;;

     -nexusconfigure=* | --nexusconfigure=*)
	NEXUSCONFIGURE="`echo $arg|sed 's/-*nexusconfigure=//'`"
       ;;

      -u | -usage | --usage | --usag | --usa | --us | --u | -help | --help )
	print_usage >& 2
       exit 1 ;;

     -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
       verbose=yes ;;

     *) 
	print_error "Unrecognized configure option $arg" 
	exit 1
	;;
    esac
  fi
done]

dnl Finish the initalization
AC_PREPARE()
dnl
dnl Place the definitions into a configuration file, rather than sedding
dnl them into Makefiles.  
dnl Comment out this line (with dnl!) to force the definitions into
dnl the Makefiles.  Also, make sure that this file gets moved into the
dnl library directory before the builds take place.
AC_CONFIG_HEADER(mpichconf.h)
# Make sure we remove any configuration file incase there is out-of-date data.
/bin/rm -f mpichconf.h
PAC_FIXUP_SRCDIR
if test ! -f .mpich -a -z "$nobanner" ; then
  print_error " "
  print_error You should register your copy of MPICH with us by sending mail
  print_error to majordomo@mcs.anl.gov containing the message
  print_error subscribe mpi-users
  print_error This will allow us to notify you of new releases of MPICH.
  print_error " "
  print_error "You can also check the MPICH home page at "
  print_error "http://www.mcs.anl.gov/mpi/mpich/index.html"
  print_error " "
fi
#
# There are definitions in aclocal.m4 that must be in the same directory
# as this configure file for autoconf to properly build configure.
#
# Set basic defintions based on flags set from commandline
#
if test "$ADI_COLLECTIVE" = 1 ; then
    AC_DEFINE(MPID_USE_ADI_COLLECTIVE)
fi
if test "$ADI_COLL_WORLD" = 1 ; then
    AC_DEFINE(MPID_COLL_WORLD)
fi
#
if test -n "$DEVDEBUGCFLAGS" ; then 
    DEVCFLAGS="$DEVCFLAGS $DEVDEBUGCFLAGS"
fi
#
# Definitions for special debugging features.  
if test $debug_version = 1 ; then
    # Make the code keep separate send queues.
    AC_DEFINE(MPI_KEEP_SEND_QUEUE)
fi
#
PAC_GETWD(MPIR_TRIAL,src/pt2pt/Makefile.in)
MPIR_HOME=$MPIR_TRIAL
#
#
# Check that an ARCH was set
# If it wasn't set, try to guess using "util/tarch"
#
if test -z "$ARCH" ; then 
    # First check for some special cases
    if test -n "$device_t3d" ; then 
	ARCH=cray_t3d
        arch_cray_t3d=1
    fi
fi
if test -z "$ARCH" -a -x util/tarch ; then
    AC_MSG_CHECKING(for architecture)
    ARCH=`./util/tarch | sed s/-/_/g`
    if test -z "$ARCH" ; then
       AC_MSG_RESULT(Unknown!)
       print_error "Error: Couldn't guess target architecture, you must"
       print_error "       set an architecture type with -arch=<value>"
       exit 1
    fi
    eval "arch_$ARCH=1"
    AC_MSG_RESULT($ARCH)
fi
if test -n "$arch_sgi" ; then
    arch_IRIX=1
    ARCH=IRIX
fi
if test -n "$arch_IRIX64" ; then
    arch_IRIX=1
fi
if test -n "$arch_IRIX32" ; then
    arch_IRIX=1
fi
if test -n "$arch_IRIXN32" ; then
    arch_IRIX=1
fi
#  Handle solaris on Intel platforms, needed to get heterogeneity right in p4
if test -n "$arch_solaris86" ; then
    arch_solaris=1
    ARCH=solaris86
fi
if test -n "$arch_sgi5" ; then
    arch_IRIX5=1
    ARCH=IRIX
fi
if test -n "$arch_cray" ; then
    arch_CRAY=1
    ARCH=CRAY
fi
#
# Check that a DEVICE was set
# If it wasn't set, try to guess using "util/tdevice"
#
if test -z "$DEVICE" -a -x util/tdevice ; then
    AC_MSG_CHECKING(device)
    DEVICE=`util/tdevice $ARCH`
    if test ! -n "$DEVICE" ; then
	AC_MSG_RESULT(Unknown!)
       print_error "Error: Couldn't guess device, you must" 
       print_error "       set a device with -device=<value>" 
       exit 1
    fi
    eval "device_$DEVICE=1" 
    AC_MSG_RESULT($DEVICE)
fi
#
# Check for a VALID device
if test ! -d mpid/$DEVICE ; then
    print_error "$DEVICE is not a valid device!" 
    exit 1
fi
#
#
# Set Default values of variables
CC=${CC:-cc}
F77=${FC:-f77}
if test -n "$FC" ; then
    USERF77=1
fi
# CLINKER and FLINKER are set by PAC _GET_CC and F77
#
# First, check for the basic CC and Ranlib 
if test -z "$USERCC" ; then
    AC_PROG_CC()
fi
# AC _PROG_INSTALL
#
# Using this autoconf macro for ranlib doesn't handle the problem 
# of 'helpful' ranlib's that issue error messages (!).  Once
# we've identified the proper compiler etc, we'll try this 
# ranlib below; if it fails, we'll replace it with ':'
#
if test -z "$RANLIB" ; then
    AC_PROG_RANLIB
fi
AR="ar cr$AR_LOCAL"
# CPRP is the version of cp that accepts -r and -p arguments.
# See CRAY below
CPRP="cp"
INCLUDE_PATH=""
USER_INCLUDE_PATH=""
USER_DEFS=""
LIB_LIST=""
MPE_LIBS=""
# Fixup for make
PAC_MAKE_IS_GNUMAKE
PAC_MAKE_IS_BSD44
PAC_MAKE_IS_OSF
#
# Check that a DEVICE was set
if test -z "$DEVICE" ; then
    print_error "You must set a device type with -device=<value>" 
    exit 1
fi
#
# Check that an ARCH was set
if test -z "$ARCH" ; then
    print_error "You must set an architecture type with -arch=<value>"
    exit 1
fi
#
# Set comm from device?
if test -z "$COMM" ; then
    COMM=$DEVICE
    # Remember that COMM set as default, not explicitly, 7/13/95, bri@sgi.com
    default_comm=1
fi
# If some extensions are set, mark the defs
if test -n "$MPE_MPI_EXT_C" ; then
   AC_DEFINE(MPE_USE_EXTENSIONS)
fi

############################################################################
# In order to determine the correct compilers and options to use, 
# we sometimes need to get more detailed information on the system
# This is osversion, osvminor, and cputype.
# Currently, only IRIX uses this
############################################################################
PAC_GET_SPECIAL_SYSTEM_INFO

# special case 'sgi5' for use on MESHINE which is much like an SGI running
# irix 5 with r4400 chips, but does not have 'hinv', so above code doesn't
# work
if test -n "$arch_sgi5"; then
   osversion=5
   cputype=4400
   IRIXARCH="$ARCH_$osversion"
   IRIXARCH="$IRIXARCH_$cputype"
   echo "IRIX-specific architecture is $IRIXARCH"
fi

if test -n "$arch_EWS_UX_V" ; then
    # This is a Unix System V system running on MIP/SGI processors
    LIB_LIST="$LIB_LIST -lsocket -lnsl -lc"	
fi
#
# End of architecture-specific tests
#
if test ! -d lib ; then 
   mkdir lib
fi
if test ! -d lib/$ARCH ; then 
   mkdir lib/$ARCH
fi
if test ! -d lib/$ARCH/$COMM ; then 
   mkdir lib/$ARCH/$COMM
fi

# Check all of the devices first; they need to be known 
# before doing the transport layer

# check whether --device=chameleon was given
if test -n "$device_chameleon"; then
  echo "Chameleon is no longer supported.  There are specific devices for"
  echo "each system that Chameleon provided (except for PVM, which is not"
  echo "supported)."
  exit 1
fi
# 
# Check for Unix Variants
AC_AIX
AC_MINIX
#
# This is a first cut at the information needed.  Information that I am
# providing is:
#
# 1. path to Nexus libraries && libraries to include
# 2. path to Nexus include files
# 3. compiler (if necessary)
# 4. path to debugger \___ for debugging Nexus
# 5. path to xterm    /    programs with xterm
# 5. ?
#
#  More can be needed if necessary.
if test -n "$device_ch_nexus"; then
  CC=gcc
  USERCC=1
  DEVICE_KIND=network
  # find some way to find Nexus since there is no standard location for
  # it, currently (/usr/local/nexus ?)
  DEVCFLAGS="$DEVCFLAGS -DHAVE_GETTIMEOFDAY "
  case $ARCH in
    rs6000)
      # DCE threads assumed until QT works correctly
      # (only with full Nexus)
      # NEXUS_EXTRA_LIBS="-lpthreads"
      # MPL assumed.  We need to give user option between:
      #
      #  A.  MPL <-------------------\
      #  B.  TCP                      |----> need CC=mpxlc
      #  C.  MPL+TCP (preferred) <---/
      AC_PROGRAMS_CHECK(CCval,mpCC mpcc "$CC")
      if test -n "$CCval" ; then
	    CC=$CCval
	    if test "$CC" = mpcc ; then 
	        TESTCC=xlc
	    elif test "$CC" = mpCC ; then
        	TESTCC=xlC
	    fi
      else
            echo "Could not find mpCC or mpcc!"
	    exit 1
      fi
      AC_PROGRAMS_CHECK(F77val,mpxlf "$F77")
      if test -n "$F77val" ; then
	    F77=$F77val
            USERF77=1
	    FLINKER=$F77val
      else
            echo "Could not find mpxlf!"
      fi
      ;;
    IRIX)
      # (only with full Nexus)
      dnl # PAC_FIND_USER_INCLUDE(qt, /usr/local/qt /usr/local/nexus/include /usr/local/iway/app/nexus/qt)
      #if [ "x$pac_inc_dir" != "x" ] ; then
      #  NEXUS_EXTRA_INC_PATH="-I$pac_inc_dir"
      #else
      #  print_error "Could not locate Quickthreads header file"
      #  exit 1
      #fi
      dnl # PAC_FIND_USER_LIB(qt, /usr/local/qt /usr/local/nexus/lib /usr/local/iway/app/nexus/lib)
      #if [ "x$pac_lib_dir" != "x" ] ; then
      #  NEXUS_EXTRA_LIB_PATH="-L$pac_lib_dir"
      #  NEXUS_EXTRA_LIBS="-lqt"
      #else
      #  print_error "Could not locate Quickthreads library"
      #  exit 1
      #fi
      # CC="ncc"
      ;;
    sun4)
      # FSU pthreads assumed until QT is tested.  We need a way to find
      # where the preferred threads library is located on the machine
      # (only with full Nexus)
      dnl # PAC_FIND_USER_INCLUDE(pthread, /usr/local/fsu-pthreads/include /usr/local/nexus/include /usr/local/iway/app/nexus/fsu-pthreads-2.6/include)
      #if [ "x$pac_inc_dir" != "x" ] ; then
      #	NEXUS_EXTRA_INC_PATH="-I$pac_inc_dir"
      #else
      #	print_error "Path to pthreads include files not found"
      #	exit 1
      #fi
      dnl # PAC_FIND_USER_LIB(gthreads, /usr/local/fsu-pthreads/lib /usr/local/nexus/lib /usr/local/iway/app/nexus/fsu-pthreads-2.6/lib)
      #if [ "x$pac_lib_dir" != "x" ] ; then
      #	NEXUS_EXTRA_LIB_PATH="-L$pac_lib_dir"
      #	NEXUS_EXTRA_LIBS="-lgthreads -lmalloc"
      #else
      #	print_error "Path to pthreads libraries not found"
      #	exit 1
      #fi
      # FSU pthreads requires gcc 2.7.0 to work properly. Or to have the
      # pthread include files to be munged for earlier versions.  Assume
      # that the default compiler can work with the installed include
      # files.

      # For interoperation with Fortran to work correctly, gcc 2.7.0
      # must be used with the -munaligned-doubles command line option
      # This isn't quite correct.  We need to check that the option is
      # accepted.  Note that there are MANY ANSI-C compilers for the Sun,
      # and only gcc uses these flags.
      CFLAGS="$CFLAGS -munaligned-doubles"
      ;;
    solaris)
      # More stuff, but I've never tried this version, so I don't know
      # them, yet.
      NEXUS_EXTRA_LIBS="-lnsl -lsocket";;
    solaris86)
      # reported to be specified on solaris86 as well
      NEXUS_EXTRA_LIBS="-lnsl -lsocket";;
    alpha)
      # More stuff, but I've never tried this version, so I don't know
      # them, yet.
      NEXUS_EXTRA_LIBS="";;
    NeXT)
      # This should just work.  Thank goodness for one sane platform. :)
      NEXUS_EXTRA_LIBS="";;
    paragon)
      # More stuff, but I've never tried this version, so I don't know
      # them, yet.
      NEXUS_EXTRA_LIBS="";;
    freebsd)
      # Working on this version, but the department needs to upgrade to
      # 2.0.5 or later because of severe VM problems that hit earlier
      # versions and crash the entire machine.
      NEXUS_EXTRA_LIBS="";;
  esac
  # We must have an ANSI C compiler
  PAC_CHECK_CC_PROTOTYPES(notansi=0,notansi=1)
  if test $notansi = 1 ; then
      print_error "NEXUS requires an ANSI C compiler; $CC failed to"
      print_error "handle a routine prototype."
      exit 1
  fi
  
  # Here we override the above code that hunts for 
  # the nexus libraries in favor of using either the default location
  # (inside the distribution) or a location specified as an argument to
  # configure.  Then we will build nexus ourselves.

  NEXUS_INCLUDE_DIR=$NEXUSDIR/include
  NEXUS_LIB_DIR=$MPIR_HOME/mpid/ch_nexus/nexus/lib

  # Here we build Nexus from the source files included here, if the default
  # location for Nexus was not overridden to specify a previously-installed
  # Nexus


  if test "$NEXUSDIR" = "$NEXUSDEFAULTDIR" ; then
    # By default, Nexus will be built w/o threads unless specified
    # as an option to configure (--without-threads is the Nexus configure
    # flag which must be propagated.

    echo "Configuring Nexus subsystem..."

    if test "$nexusthreads" = 0; then
        nexusthreadsflag="--without-threads"
    else
        nexusthreadsflag=""
    fi
    if test "$nexusdebug" = 1; then
        nexusdebugflag="--enable-debug"
    else
        nexusdebugflag=""
    fi

    if test "$USERCC" = "1" && test "$ARCH" != "rs6000" \
       && test "$CC" != "mpCC" && test "$CC" != "mpcc" ; then
	export CC
    fi
    export MAKE

    if test "$NEXUSCONFIGURE" = ""; then
       NEXUSCONFIGURE="$nexusthreadsflag $nexusdebugflag"
    fi

    (cd mpid/ch_nexus/nexus; rm -f config.cache; ./configure $NEXUSCONFIGURE)



    if test $? != 0 ; then
      print_error "Configure of the Nexus sub-system may have failed!"
    fi

    NEXUS_LIBG=`grep \^STATIC_LIB mpid/ch_nexus/nexus/nexus/Makefile`
      
    NEXUSLIB=`echo $NEXUS_LIBG | sed 's/.*\///'`

    NEXUSLIB=`echo $NEXUSLIB | sed 's/\..*//'`

    NEXUSLIB=`echo $NEXUSLIB | sed 's/^lib//'`

    NEXUSLIB="-l$NEXUSLIB"

    echo "Configuration of Nexus successful; extra libraries include $NEXUSLIB"
  fi

  # Need a way to find where Nexus is located.
  if test -z "$NEXUS_INCLUDE_DIR" ; then
      PAC_FIND_USER_INCLUDE(nexus,/usr/local/nexus/include /usr/local/iway/app/nexus/include /usr/local/iway/app/nexus/nexus/include)
      if test -n "$pac_inc_dir" ; then
          NEXUS_INCLUDE_PATH=-I$pac_inc_dir
      else
          print_error "Could not find NEXUS include files"
          exit 1
      fi
  else
      NEXUS_INCLUDE_PATH=-I$NEXUS_INCLUDE_DIR
  fi
  if test -z "$NEXUS_LIB_DIR" ; then
      PAC_FIND_USER_LIB(nexuslite_opt,/usr/local/nexus /usr/local/iway/app/nexus/lib /usr/local/iway/app/nexus/nexus/lib)
      if test -n "$pac_lib_dir" ; then
          NEXUS_LIB_PATH="-L$pac_lib_dir"
      else
          print_error "Could not find NEXUS library"
          exit 1
      fi
  else
      NEXUS_LIB_PATH="-L$NEXUS_LIB_DIR"
  fi
  #
  # Need a way to find which Nexus to use. (i.e., Lite vs. Full)
  # Lite is assumed currently
  #
  #NEXUS_LIBS="-lnexuslite_opt"
  NEXUS_LIBS=$NEXUSLIB

  # test whether we are using an external Nexus or the one in ch_nexus
  if test "$NEXUSDIR" = "$NEXUSDEFAULTDIR" ; then
     # Nexus includes should precede device ch_nexus includes!
     CFLAGS="-I$MPIR_HOME/mpid/ch_nexus $CFLAGS"
     CFLAGS="-I$MPIR_HOME/mpid/ch_nexus/$NEXUSDIR/include $CFLAGS"
  else
    NEXUS_LIB_PATH="-L$NEXUS_LIB_DIR"
    CFLAGS="-I$NEXUS_INCLUDE_DIR -I$MPIR_HOME/mpid/ch_nexus $CFLAGS"
  fi

  LIB_PATH="$LIB_PATH $NEXUS_LIB_PATH $NEXUS_EXTRA_LIB_PATH"
  LIB_LIST="$LIB_LIST $NEXUS_LIBS $NEXUS_EXTRA_LIBS"
  # These files are only included by files in mpich/mpid/ch_nexus/*.c
  # and not by the user.
  INCLUDE_PATH="$INCLUDE_PATH $NEXUS_INCLUDE_PATH $NEXUS_EXTRA_INC_PATH"

  # Determine where the XTERM and dbx/gdb executables live
  XTERMLOC=""
  PAC_PROGRAM_CHECK(XTERM,xterm,1,,XTERMLOC)
  GDBLOC=""
  PAC_PROGRAM_CHECK(GDB,gdb,1,,GDBLOC)
  DBXLOC=""
  PAC_PROGRAM_CHECK(DBX,dbx,1,,DBXLOC)
  AC_SUBST(XTERMLOC)
  AC_SUBST(GDBLOC)
  AC_SUBST(DBXLOC)
# Nexus doesn't yet have long doubles, even though gcc does
  NOSHORTLONGS=1
  echo "Finished configuring Nexus subsystem"
fi

# Get the C compiler, Fortran compiler, and archiver
CARCH=$ARCH
case $DEVICE in
    ch_cenju3)       CARCH=cenju3 ;;
    ch_cmmd)         CARCH=cm5 ;;
    ch_mpl|ch_eui)   CARCH=ibmpoe ;;
    ch_meiko|meiko)  CARCH=meiko ;;
    ch_nx|nx)        CARCH=intelnx ;;
    ch_nc)           CARCH=ncube ;;
    ch_spp)          CARCH=convex_spp ;;
esac
PAC_GET_CC($CARCH)
if test $NOF77 = 0 ; then
    PAC_GET_F77($CARCH)
else
    HAS_F77=0
fi
PAC_GET_AR($CARCH)
#
# Check to see if the compiler accepts prototypes
PAC_CHECK_CC_PROTOTYPES(AC_DEFINE(HAVE_PROTOTYPES)
MPE_CFLAGS="$MPE_CFLAGS -DHAVE_PROTOTYPES")
#
# Check to see if it accepts const
PAC_CHECK_CC_CONST(,AC_DEFINE(HAVE_NO_C_CONST)
MPE_CFLAGS="$MPE_CFLAGS -DHAVE_NO_C_CONST")
#
# Special flags for dbx versions; this should go into aclocal eventually
if test "$CARCH" = "alpha" ; then
    MPE_CFLAGS="$MPE_CFLAGS -DDBX_IS_OSF"
fi
#
# Various systems have known special needs (particularly libraries);
# get thos here
#    
DEFAULT_MACHINE=$DEVICE
#
if test -n "$device_nx"; then
  DEFAULT_MACHINE="paragon"
  is_adi1=1
  # Check for fast collective routines
  if test  -r /usr/lib/libjmc.a; then
    CFLAGS="$CFLAGS -DICCLIB"
    ICCLIB="iCClib"
  fi
fi

if test -n "$device_ch_shmem" -o -n "$device_ch_lfshmem" ; then
  if test -n "$arch_solaris" ; then
    AC_HAVE_LIBRARY(thread,LIB_LIST="$LIB_LIST -lthread")
    # the C compiler might include this for us, but the Fortran compiler
    # does not
    AC_HAVE_LIBRARY(nsl,LIB_LIST="$LIB_LIST -lnsl")
  fi
  if test -n "$arch_ksr" ; then
    AC_HAVE_LIBRARY(rpc,LIB_LIST="$LIB_LIST -lrpc")
  fi
  if test -n "$arch_alpha" ; then
    AC_HAVE_LIBRARY(rpc,LIB_LIST="$LIB_LIST -lrpc")
  fi
fi
#
if test -n "$device_ch_meiko" -o -n "$device_meiko" ; then
  is_adi1=1
  DEFAULT_MACHINE="meiko"
  # Jim Cownie claims that -laio is no longer needed ...
  if test -s /opt/MEIKOcs2/lib/libmpsc.a ; then
      if test -n "$device_meiko" ; then
          LIB_LIST="$LIB_LIST -L/opt/MEIKOcs2/lib -lew -lelan"
      else
          LIB_LIST="$LIB_LIST -L/opt/MEIKOcs2/lib -lmpsc -lew -lelan"
      fi
  else
      print_error "Could not find the library /opt/MEIKOcs2/lib/libmpsc.a"
      print_error "Cannot build MEIKO version"
      exit 1
  fi
  # This include is needed for the elan.h files
  DEVCFLAGS="$DEVCFLAGS -I/opt/MEIKOcs2/include"
  # These were recommended by Jim Cownie
  if test -z "$OPTFLAGS" ; then
#      OPTFLAGS="-xcg92 -xO2"
       OPTFLAGS="-O"
  fi
  #RANLIB=true
fi
#
if test -n "$device_ch_mpl" ; then
    # Check for ANL default machine:
    if test -d /etc/FRAMES -a -d /mcs ; then
        DEFAULT_MACHINE="anlspx"
    fi
    # check for mpproto.h
    PAC_CHECK_HEADER(mpproto.h,pre_req=1,pre_req=0)
    if test $pre_req = 0 ; then
	print_error "Could not find the header file mpproto.h that is needed"
	print_error "by the ch_mpl device.  Check that you have"
	print_error "IBMs parallel operating environment (POE), which is "
	print_error "required for this device."
	exit 1
    fi
    if test $MPILIBNAME = "mpi" ; then 
	print_error "You should select a name for the MPICH library with"
	print_error "-mpilibname=name_of_library.  Using mpich as the"
	print_error "library name."
	MPILIBNAME="mpich"
    fi
    # We need to check for gettimeofday in case we are not using the Switch
    # timer
    AC_HAVE_FUNCS(gettimeofday)
fi
#
dnl if test -n "$device_ch_spp" ; then
dnl    DEFAULT_MACHINE="convex_spp"
dnl   if test -z "$OPTFLAGS" ; then
dnl	# If optimization is turned on, the wrong code is generated for
dnl	# some operations with unsigned chars.
dnl	OPTFLAGS=-O0
dnl   fi
dnl   AC_RETSIGTYPE
dnl   PAC_HAVE_VOLATILE
dnl   PAC_SIGNALS_WORK
dnl   #  
dnl   LIB_LIST="$LIB_LIST -lcnx_syscall /lib/libail.sl"
dnl fi
#
# Shared-memory (processes) device.  Only need to set mpirun default machine.
if test -n "$device_ch_shmem" -o -n "$device_ch_lfshmem" ; then
   DEFAULT_MACHINE="smp"
   # Check for MMAP
dnl   SAVEDEFS="$DEFS"
dnl   DEFS=""
   # mmap doesn't help if it does not have MAP_ANONYMOUS
   AC_HAVE_FUNCS(mmap)
   dnl A C _ HAVE_FUNCS(msem_init)
   AC_FUNC_CHECK(msem_init,AC_DEFINE(HAVE_MSEM_INIT)have_msem_init=1)
   if test "$have_msem_init" = 1 ; then
       # If have msem_init, we need to see if we need struct msemaphore or just
       # msemaphore.
       true
       AC_COMPILE_CHECK(Is msemaphore a typedef or struct name?,[
#include <ctype.h>
#include <sys/mman.h>],[
typedef struct msemaphore MPID_Msemaphore;
typedef struct { MPID_Msemaphor lock; int a; } Msem;
Msem sem;
       ],is_struct=1,is_struct=0)
        if test $is_struct = 1 ; then
	    AC_DEFINE(MSEMAPHORE_IS_STRUCT)
	    echo struct
        else
	    echo typedef
        fi
   fi
   #
   # Here's a horrible "feature".  Solaris include null stubs for 
   # mutex_init in libc (!), so that users can build threaded code that
   # doesn't work (rather than putting this null stubs in -lnothread, 
   # where they belong).  Thus, if mutex_init IS found, we need to 
   # check for -lthread.   (Which we should have done above)
   #
   AC_HAVE_FUNCS(mutex_init)
   AC_HAVE_FUNCS(shmat)
   AC_HAVE_FUNCS(semop)
   PAC_HAVE_VOLATILE
   #
   # Look for sigaction routine (instead of signal)
   AC_HAVE_FUNCS(sigaction)
   AC_HAVE_FUNCS(signal)
   AC_HAVE_FUNCS(sigset)
   # Also need to get signal hander arg count 1? 3? 4? something else?
   PAC_SIGNALS_WORK
   AC_RETSIGTYPE
   #
   AC_HAVE_FUNCS(gettimeofday)
dnl   AC_MSG_CHECKING(for how many arguments gettimeofday takes)
dnl   AC_TEST_PROGRAM([#include <sys/time.h>
dnl   main() {struct timeval tp;
dnl   gettimeofday(&tp,(void*)0);return 0;}],AC_MSG_RESULT(two - whew),
dnl   DEV_CFLAGS="$DEV_CFLAGS -DUSE_WIERDGETTIMEOFDAY"
dnl   AC_MSG_RESULT(one!))
   AC_HAVE_FUNCS(BSDgettimeofday)

dnl   DEV_DEFS="$DEFS"
dnl   DEFS="$SAVEDEFS"
fi

if test -n "$device_ch_tcp" ; then
    DEVICE_KIND=network
    AC_VPRINTF
fi

if test -n "$device_ch_p4"; then
  echo "About to do p4 device"
  DEVICE_KIND=network
#  INCLUDE_PATH="$INCLUDE_PATH -I$MPIR_HOME/mpid/ch_p4/p4-1.4/include"
# This needs to get the other libraries as required for the specific
# architecture.  
#
# P4's arch specification is different from MPI's (sun4 vs. SUN, etc.)
# Here we set P4_ARCH to the right value, which we deduce from $ARCH and $COMM
# Note that the IRIX code further below may make further changes to 
# P4_ARCH
  if test "$ARCH" = "rs6000"; then
    case $COMM in
      eui|mpl)
        P4_ARCH=SP1_EUI ;;
      p4)
        P4_ARCH=RS6000 ;;
      *)
        P4_ARCH=RS6000 ;;
    esac

########################################################################
#
# Document the IRIX p4 parameter selection a bit, 7/13/95, bri@sgi.com
#
#       OS      COMM    CPU             P4_ARCH         DEFAULT_MACHINE
#       --      ----    ---             -------         ---------------
#       6.x     shared  R8000           SGI_CH64        sgi_mp
#       6.x     shared  *               SGI_CH
#       6.x     *       R8000           SGI             sgi
#       6.x     *       *               SGI
#       5.x     shared  *               SGI_MP          sgi_mp
#       5.x     *       *               SGI
#       *       *       *               SGI
#
# What to do with R10000?  R5000?
########################################################################
# NEW TABLE
#
#       OS      COMM    CPU             P4_ARCH         Other options
#       --      ----    ---             -------         ---------------
#       6                               SGI6
#       6       shared                  SGI6            -p4comm=shared
#       5                               SGI5
#       5       shared                  SGI5            -p4comm=shared
#       *                               SGI
#       *       shared                  SGI             -p4comm=shared
#
# Also supported are special cases of SGI6: SGIN32, SGI32, and SGI64
#              
########################################################################

  elif test "$ARCH" = "IRIX64" ; then
    P4_ARCH=SGI6       #SGI_CH64
#    DEFAULT_MACHINE="sgi_mp"
  elif test "$ARCH" = "IRIX" ; then
    P4_ARCH=SGI
    if test $osversion = 6 ; then
#        if test "$COMM" = "shared" ; then
#  	    # Use IRIX64 for SGI_CH64
# 	    P4_ARCH=SGI_CH32
##	    if test $cputype = 8000 ; then
##	        P4_ARCH=SGI_CH32
#	        DEFAULT_MACHINE="sgi_mp"
##	    fi
#	else
     	    P4_ARCH=SGI6
#	    if test $cputype = 8000 ; then
#	        P4_ARCH=SGI6
#	        #DEFAULT_MACHINE="sgi"
#	    fi
#	fi
    elif test $osversion = 5 ; then 
        P4_ARCH=SGI5         # SGI
#        if test "$COMM" = "shared" ; then
#	    P4_ARCH=SGI_MP
#	    DEFAULT_MACHINE="sgi_mp"
#	fi
    fi
    if test "$COMM" = "shared" ; then
	DEFAULT_MACHINE="sgi_mp"
    fi
  else
    # Note that this will change IRIXxxx to SGIxxx (i.e., IRIX32 to SGI32)
    P4_ARCH=`echo $ARCH | sed \
	    -e 's/sun4/SUN/g'              -e 's/intelnx/IPSC860/g'  \
	    -e 's/IRIX/SGI/g'              -e 's/hpux/HP/g'          \
	    -e 's/solaris86/I86_SOLARIS/g' -e 's/solaris/SUN_SOLARIS/g' \
	    -e 's/c2mp/CONVEX/g'           -e 's/uxpv/UXPV/g'          \
	    -e 's/alpha/ALPHA/g'           -e 's/dec5000/DEC5000/g'       \
	    -e 's/NeXT/NEXT/g'             -e 's/paragon/PARAGONIP/g'     \
	    -e 's/inteldelta/DELTA/g'      -e 's/symmetry/SYMMETRY/g'\
	    -e 's/cray/CRAY/g'             -e 's/tc2000/TC_2000/g'   \
	    -e 's/ksr/KSR/g'               -e 's/freebsd/FREEBSD/g'  \
	    -e 's/cm5/CM5/g'               -e 's/meiko/MEIKO_CS2/g'  \
            -e 's/rs6000/RS6000/g'	   -e 's/symm_ptx/SYMMETRY_PTX/g'`
  fi
echo "Finished setting p4arch..."
#
echo "Configuring p4 subsystem..."
# Make sure that the lib Makefile gets remade
  if test -n "$SOCKSIZE" ; then
      otherargs="-socksize=$SOCKSIZE"
  fi
  if test -n "$configure_echo" ; then
      otherargs="$otherargs -echo"
  fi
  if test -n "$rshcommand" ; then
      otherargs="$otherargs -rsh=$rshcommand"
  fi
  if test -n "$rshnol" ; then
      otherargs="$otherargs -rshnol"
  fi
  if test "$USERCC" = 1 ; then 
      (cd mpid/ch_p4/p4-1.4 ; \
	./configure -p4arch=$P4_ARCH -p4make="$MAKE" -opt="$OPTFLAGS" -cc="$CC" -p4comm="$COMM" -cflags="$USER_CFLAGS $P4_CFLAGS" $otherargs )
      if test $? != 0 ; then
          print_error "Configure of the p4 sub-system may have failed!"
      fi
    else
      (cd mpid/ch_p4/p4-1.4 ; \
	./configure -p4arch=$P4_ARCH -p4make="$MAKE" -opt="$OPTFLAGS" -p4comm="$COMM" -cflags="$USER_CFLAGS $P4_CFLAGS" $otherargs )
      if test $? != 0 ; then
          print_error "Configure of the p4 sub-system may have failed"
      fi
  fi
  echo "Finished configuring the p4 subsystem"
  P4_MDEPLIBS=`$MAKE -f mpid/ch_p4/p4-1.4/lib/Makefile p4mdeplibs | grep -v make`
  LIB_LIST="$LIB_LIST $P4_MDEPLIBS"
  #
  P4_MDEPCFLAGS=`$MAKE -f mpid/ch_p4/p4-1.4/lib/Makefile p4mdepcflags | grep -v make`
  if test -n "$P4_MDEPCFLAGS" ; then
      CFLAGS="$CFLAGS $P4_MDEPCFLAGS"
      # Note that USER_CFLAGS inherits all of CFLAGS.
  fi
  if test ! -d lib/$ARCH/ch_p4 ; then 
      mkdir lib/$ARCH/ch_p4
  fi 
#   
#   We need to change the makefile.protos in mpid/ch_p4/p4-1.4 to use
#   the correct libraries
#   if test -n "$COMM" ; then 
#       COMM="ch_p4_$COMM"
#   else
       COMM="ch_p4"
#   fi
  if test ! -d lib/$ARCH/$COMM ; then 
       mkdir lib/$ARCH/$COMM
  fi 
#   p4 library is intergrated with libmpi.a...
#   LIB_PATH="$LIB_PATH -L$lib/$ARCH/$COMM"
#   LIB_LIST="$LIB_LIST -lp4";
  IS_HETERO=1
  PAC_SIGNALS_WORK
  # For the timers, we try for gettimeofday.  Just for the device
dnl  SAVEDEFS="$DEFS"
  AC_HAVE_FUNCS(gettimeofday)
dnl  AC_MSG_CHECKING(for how many arguments gettimeofday takes)
dnl  AC_TEST_PROGRAM([#include <sys/time.h>
dnl  main() {struct timeval tp;
dnl  gettimeofday(&tp,(void*)0);return 0;}],AC_MSG_RESULT(two - whew),
dnl  DEV_CFLAGS="$DEV_CFLAGS -DUSE_WIERDGETTIMEOFDAY"
dnl  AC_MSG_RESULT(one!))
  AC_HAVE_FUNCS(BSDgettimeofday)
dnl  DEV_DEFS="$DEV_DEFS $DEFS"
dnl  DEFS="$SAVEDEFS"
fi

#
# This is incomplete
dnl if test -n "$device_ch_p4_1" ; then
dnl   AC_HAVE_FUNCS(gettimeofday)
dnl   LIB_LIST="$LIB_LIST /home/MPI/mpich/mpid/ch_p4/libp4.a"
dnl   IS_HETERO=1
dnl fi

if test -n "$arch_IRIX"; then
   # We now have to look at  all sorts of things to determine the
   # various flags.  We need to set both the CFLAGS and various options
   # for the linkers (by setting CLINKER and FLINKER).
   # The OS version and chipset were determined above so that they could
   # be used to set the P4_ARCH if necessary.
   #
   # Latest information we have is that (thanks to Winfrid Tschiedel 
   # <Winfrid.Tschiedel@mch.sni.de>):
   #  cputype          Instruction sets
   #  R4X00            -mips2 -mips3 (mips2 requires -32)
   #  R5000, R8000 and R10000 : -mips2 (-32) and -mips3 (-n32 or -64)
   #                            -mips4 (-n32 or -64)
   # Also, IRIX 6.2 supports R4X00 only in 32 bit mode (requires -n32)
   # EXCEPT for R4400, which also supports -64.
   # In 6.2, the defaults SEEM to be -32 -mips 2
   # but you may need -64 -mips3 OR -mips 4 OR -n32 -mips3 or -mips4
   # Also, some systems REQUIRE -non_shared and others REQUIRE NOT 
   # -non_shared.  
   # 
   # Finally, compilation with optimization may stree the linker;
   # include -TENV:large_GOT=ON in this case
   #
   if test $osversion = 4 ; then
	# Nathan's tests showed that we needed this.
	RANLIB="ar ts"
   elif test $osversion = 5 ; then
        # Turn off warnings about long doubles not being supported.
	if test "$CC" != "gcc" ; then
            CFLAGS="$CFLAGS -woff 728"
	    # Other useful woff values are: 852,635,813,831,835
        fi
   elif test $osversion = 6 ; then
#       these flags settings are handled by including MDEPCFLAGS from p4
	SYMTYPE=""
	if test $cputype = 8000 -o $cputype = 10000 ; then
	    if test -n "$arch_IRIX64" ; then
	        SYMTYPE="-64 -mips4"
            elif test -n "$arch_IRIXN32" ; then
		SYMTYPE="-n32"
            else 
		SYMTYPE="-32"
            fi
	elif test $cputype -gt 4000 ; then
	    if test -n "$arch_IRIX64" ; then
		SYMTYPE="-64 -mips3"
            elif test -n "$arch_IRIXN32" ; then
		SYMTYPE="-n32"
            else 
		SYMTYPE="-32"
            fi
        else
	    # According to winfrid.tschiedel@mch.sni.de, need -n32 for R4000
	    SYMTYPE="-n32"
            # Not "-n32 -mips3"?
        fi
	if test -n "$P4_MDEPCFLAGS" ; then
  	    FFLAGS="$FFLAGS $P4_MDEPCFLAGS"
        fi
        # Warning flags are > 1000
#       CFLAGS="$CFLAGS -woff 1152,1174,1184"
#       1184 not in the p4 list
        if test "$CC" != "gcc" ; then
            CFLAGS="$CFLAGS -woff 1184,1174"
        fi
	# Check whether we need to add SYMTYPE to CFLAGS and FFLAGS
	hasarg=`echo A$CFLAGS | sed -n -e '/-n32/p' -e '/-32/p' -e '/-64/p'`
#       override SYMTYPE computed above (2/21)
        SYMTYPE=""
	if test -z "$hasarg" ; then
            CC="$CC $SYMTYPE"
	    F77="$F77 $SYMTYPE"
	    CLINKER="$CC $SYMTYPE"
	    FLINKER="$F77 $SYMTYPE"
#	else 
#	    hasarg=`echo A$CLINKER | sed -n -e '/-n32/p' -e '/-32/p' -e '/-64/p'`
#	    if test -z "$hasarg" ; then
#		# We need to make the linker compatible with the compiler.
#	    fi
	fi
   fi
   echo "Messages about long doubles not being supported are being suppressed"
   dnl AC_HAVE_ LIBRARY ( sun )
fi

# for symm_ptx, add the ptx_ifile to  LIB_LIST
if test -n "$arch_symm_ptx"; then
  LIB_LIST="$LIB_LIST $MPIR_HOME/ptx_ifile"
fi

# check whether --arch=intelnx was given
# Use this for both i860 and Delta
if test -n "$arch_intelnx"; then
  DEFAULT_MACHINE="i860"
  # Note that RANLIB may be set incorrectly if we are cross-compiling...
  RANLIB=true
  # inteldelta is used to select the appropriate args to killproc...
  DEVCFLAGS="$DEVCFLAGS -Dinteldelta"
  #
  # X11 includes are in /usr/ipsc/XDEV/i860/include-ipsc/X11
  # X11 libs are in /usr/ipsc/XDEV/i860/lib-coff
  # at least on one system
fi

# check whether --arch=paragon was given
if test -n "$arch_paragon"; then
  DEFAULT_MACHINE="paragon"
  #OPTFLAGS="-O"
  # Note that RANLIB may be set incorrectly if we are cross-compiling...
  RANLIB=true
  #echo "If you get errors about killproc, uncomment this line"
  #DEVCFLAGS="$DEVCFLAGS -DPARAGON_HAS_NO_KILLPROC"
fi


if test -n "$arch_CRAY"; then
   # The CRAY cp doesn't even support -r (!!) but at least there 
   # is a version that does work.
   if test -x /usr/ucb/cp ; then
       CPRP="/usr/ucb/cp"
   else
       print_error "Using default cp for copy; install may fail if -r and -p"
       print_error "switches are not supported."
   fi
   # It might be better to use AR="bld qvz" than the regular ar clr
   DEVCFLAGS="$DEVCFLAGS -DMPID_FLOAT_CRAY"
   # We might want to add
   # -DMPIR_FORT_INT_T=long
   # to the defines.
   # According to Laurie Costello <lmc@cray.com>, the Triton needs this
   # definition
   AC_COMPILE_CHECK([whether TWO_WORD_FCDs are used],
[#include <fortran.h>],[void  *buf;_fcd temp;temp = _fcdtocp(buf);],
AC_DEFINE(_TWO_WORD_FCD))
   # 
dnl   if test -n "$arch_CRAYTS" ; then 
dnl       AC_DEFINE(_TWO_WORD_FCD)
dnl   fi
fi

#
# The compilers are in /mpp/bin (at least on some systems)
# You may also need 
# setenv TARGET cray-t3d
# Also need -lsma library
if test -n "$arch_cray_t3d"; then
   is_adi1=0
   DEFAULT_MACHINE="cray_t3d"
   LIB_LIST="$LIB_LIST -lsma"
   RANLIB=true
   # dbxerr not supported by T3D (-mpedbg)
   MPE_MPI_EXT_C="mpehname.c"
   MPE_MPI_EXT_O="mpehname.o"
   AC_DEFINE(MPI_NO_MPEDBG)
   # The CRAY cp doesn't even support -r (!!) but at least there 
   # is a version that does work.
   if test -x /usr/ucb/cp ; then
       CPRP="/usr/ucb/cp"
   else
       print_error "Using default cp for copy; install may fail if -r and -p"
       print_error "switches are not supported."
   fi
   #  ASMFILES_O="shmem_stack.o get_stack.o"
   # Some users needed /mpp/bin/asm, others /opt/ctl/bin/cam
   for asm in /mpp/bin/cam /opt/ctl/bin/cam /mpp/bin/asm ; do
       if test -s $asm ; then
           ASM=$asm
           break
       fi
   done
   if test -z "$ASM" ; then 
        print_error Cannot find assembler needed to build MPICH
        print_error Neither /mpp/bin/cam, /opt/ctl/bin/cam,  nor 
        print_error /mpp/bin/asm is available
        exit 1
   fi
   # 
   # This is needed for the Fortran interfaces (also for the triton CRAY TS)
   AC_DEFINE(_TWO_WORD_FCD)
fi

# In default (pre-ANSI) mode, nested #if's cause most of the file to
# be SILENTLY skipped.  
if test -n "$arch_hpux" ; then
    if test -n "$device_ch_shmem" -o -n "$device_ch_lfshmem" ; then
       ASMFILES_O="amem.o"
       DEVCFILES="mem.c"
       DEVOFILES="mem.o"
    fi
    if test -n "$device_ch_shmem" -a -n "$comm_convex_spp" ; then
       DEVCFILES="shmem1stbar.c cnxCxdb.c cnxQuerySC.c cnxGlobalop.c cnxCopy.c"
       DEVOFILES="shmem1stbar.o cnxCxdb.o cnxQuerySC.o cnxGlobalop.o cnxCopy.o"
    fi
    # We can also remove +U77 and -lU77 from the p4 lib/defs.all file.
fi

if test -n "$arch_UXPM" ; then
    # This asserts that Fortran passes functions by passing the address of the
    # pointer to the function.
    # We really need a TEST for this
    AC_DEFINE(FORTRAN_SPECIAL_FUNCTION_PTR)
    # Suggested values for these are
    #CFLAGS=-O
    dnl    #FFLAGS=-Oe,-U -Aabe ( Parameter e is not supported on  uxp/m )
    FLINKER=frt
    FLIBS="$(FLIB_PATH) $(LIB_LIST)"
fi
if test -n "$arch_uxpv" ; then
    # This asserts that Fortran passes functions by passing the address of the
    # pointer to the function.
    # We really need a TEST for this
    AC_DEFINE(FORTRAN_SPECIAL_FUNCTION_PTR)
    # Suggested values for these are
    #CFLAGS=-O
    # Thanks to Winfrid Tschiedel <Winfrid.Tschiedel@mch.sni.de> for
    # this information
    dnl FLINKER="ld -dy -J /usr/ccs/lib/crt0.o /usr/lang/lib/fj90rt0.o /usr/ccs/lib/values-Xt.o"
    FLINKER="frt  -sc -Wl,-dy" # it works already and it is close the final solution
    # This isn't quite correct, but at least this is a place to put this 
    # information.
dnl    FLIBS="$(FLIB_PATH) $(LIB_LIST)  -lfj90 -lfj90fv -lfj90f -lfjsamp -lm -lelf        -lsocket -lnsl -lgen -lpx -ljsp -lvfl -lc"
    FLIBS="$(FLIB_PATH) $(LIB_LIST)"
fi
#
# Not all versions of gcc support -munalign-doubles!
#if test -n "$arch_sun4" -o -n "$arch_solaris" ; then
#    if test "$CC" = "gcc" -a "$NOF77" = 0 ; then
#        CC="$CC -munaliged-doubles"
#    fi
#fi
#
# check whether --comm=p4 was given
if test -n "$comm_p4"; then
  echo "Please use -device=ch_p4 instead of -device=chameleon -comm=p4"
  exit 1
fi

dnl if test -n "$arch_SX_4" ; then 
dnl     CFLAGS="$CFLAGS -pvctl,nomsg -DCHAR_PTR_IS_ADDRESS"
dnl fi
if test -n "$arch_SX_4" ; then 
    # The -pvctl,nomsg option suppresses "vec inf: Unvectorized loop"
    # messages from the compiler.  Need to test that this is a valid
    # option....
    # Also note that it causes -hobjlst (assembly listing) to silently fail.
    dnl CFLAGS="$CFLAGS -pvctl,nomsg -DCHAR_PTR_IS_ADDRESS"
    if test -n "$device_ch_lfshmem" ; then
       ASMFILES_O="vtest1.o syncvset0.o syncvset1.o vmemcpy.o tslock.o tsunlock.o tslock_init.o"
       DEVCFLAGS="$DEVCFLAGS -DLOCKS_PICKED -DUSE_TSLOCKS -DMPID_USE_SX4_VOPS"
#
       for file in $ASMFILES_O
       do
          files=`echo $file | sed -e "s/.o$/.s/"`
          rm -f mpid/$DEVICE/$files
          cp mpid/$DEVICE/sx4_$sx4int/$files mpid/$DEVICE/$files
       done
    else
       DEVCFLAGS="$DEVCFLAGS -DLOCKS_PICKED -DUSE_SEMOP"
    fi
    DEVCFLAGS="$DEVCFLAGS -DHAVE_SHMAT=1 -DHAVE_SEMOP=1 -DRETSIGTYPE=void -DHAVE_SIGACTION -DMPI_SX_4 -DMPID_SETUP_SIGNALS"
dnl    # We've learned that if Fortran is selected, you should use Fortran to
dnl    # link with.
dnl    if test "$USERCLINKER" != 1 -a "$NOF77" != 1 -a -n "$FLINKER" ; then 
dnl	CLINKER="$FLINKER"
dnl    fi
fi
# check whether --comm=pvm3 was given
if test -n "$comm_pvm3"; then
  echo "PVM 3 no longer supported."
  echo "Note that MPICH was NEVER implemented on top of PVM; PVM was merely"
  echo "one of the many devices supported from the very beginning."
  exit 1
fi

#
# Finally, we are ready to check to see if we are cross-compiling.
#
if test $cross_compiling = 0 ; then
    AC_CROSS_CHECK()
fi
if test $cross_compiling = 1 ; then
    if test $DEVICE = ch_shmem -o $DEVICE = ch_p4 -o $DEVICE = ch_tcp -o \
	$DEVICE = ch_lfshmem ; then
        print_error "Configure was unable to compile and run a simple program."
    fi
fi
#
# Some devices use gettimeofday.  If this is one of them, check to see 
# what form it is
if test -n "$arch_solaris" -o -n "$arch_SX_4" ; then
    PAC_IS_GETTIMEOFDAY_OK(,DEVCFLAGS="$DEVCFLAGS -DUSE_WIERDGETTIMEOFDAY")
fi
#
#
# 
# Tests for X etc should go here ...
#
MPEGRAPHICS_SOURCE=""
MPEGRAPHICS_OBJS=""
MPEGRAPHICS_FSOURCE=""
MPEGRAPHICS_FOBJS=""
X_INC=""
X_LIB=""

if test -n "$MPE_DIR"; then
  MPE_DIR="$MPIR_HOME/$MPE_DIR"
  if test -n "$MPE_GRAPHICS"; then
   # FIND_X doesn't always work correctly when cross compiling, so we
   # try to be more careful and conservative
   PAC_FIND_X11
  fi
  if test -n "$MPE_GRAPHICS" -a -z "$no_x" ; then
    MPE_LIBS="-lmpe -lpmpi -lX11 -lm"
    MPEGRAPHICS_SOURCE="mpe_graphics.c xcolor.c xframe.c xinit.c xwmap.c xmouse.c"
    MPEGRAPHICS_OBJS="mpe_graphics.o xcolor.o xframe.o xinit.o xwmap.o xmouse.o"
    MPEGRAPHICS_FSOURCE="mpe_graphicsf.c"
    MPEGRAPHICS_FOBJS="mpe_graphicsf.o"
    if test -z "$x_includes" ; then
      X_INC=""
    else
      X_INC="-I$x_includes"
    fi
    if test -z "$x_libraries" ; then
      X_LIB=""
    else
      X_LIB="-L$x_libraries"
      MPE_LIBS="$X_LIB -lmpe -lX11 -lm"
    fi
    # On the Meiko CS2, you have to add additional libraries to satisfy
    # the externals needed by -X11.
    if test -n "$arch_meiko" ; then
        MPE_LIBS="$MPE_LIBS -lsocket -lnsl"
    fi
  else
    MPE_GRAPHICS=""
    MPE_LIBS="-lmpe"
  fi
else
  MPE_GRAPHICS=""
fi
#
# Check for remote shell program
#
RSH_COMMAND=
if test -z "$RSHCOMMAND" ; then
    PAC_PROGRAMS_CHECK(RSH_COMMAND,remsh rsh)
else
    RSH_COMMAND=$RSHCOMMAND
    echo "Using $RSHCOMMAND for remote shell"
fi
#
if test $HAS_F77 = 0 -a $NOF77 = 0 ; then
    NOF77=1
    HAS_FORTRAN=0
    AC_DEFINE(MPID_NO_FORTRAN)
    dnl CFLAGS="$CFLAGS -DMPID_NO_FORTRAN"
    MPI_FOBJECTS="" 
elif test $HAS_F77 = 1 ; then
    PAC_GET_FORTNAMES
    if test $HAS_FORTRAN = 0 ; then
	dnl CFLAGS="$CFLAGS -DMPID_NO_FORTRAN"
	AC_DEFINE(MPID_NO_FORTRAN)
        MPI_FOBJECTS=""
    elif test -n "$WDEF" ; then
        CFLAGS="$CFLAGS $WDEF"
dnl     elif test -n "$FORTRANNAMES" ; then
dnl	AC_DEFINE($FORTRANNAMES)
    fi
fi
if test $HAS_FORTRAN != 0 ; then
    PAC_FORTRAN_HAS_INCDIR(FINC="-I@MPIR_HOME@/include",)
    # some systems support FINC="-Wf,-I@MPIR_HOME@/include" (SGI for one)
    # If I can find others, I'll try them.  For this, I'll need
    # to test for it (the test above tries -Iinclude for mpif.h)
fi
#
# Check for xdr available and properly installed (our FreeBSD machines
# have incorrect xdr header files, for examples).  Currently, we just
# set a dummy function body and see if rpc/xdr.h is available and
# can be included.
#
# Just to complicate things, some systems have "xdr.h" that is complete
# and can be used by itself; more frequently, xdr.h does NOT include
# definitions that it requires!  rpc.h seems to be more reliable.
#
if test "$IS_HETERO" = 1 ; then
    AC_COMPILE_CHECK("XDR includes and functions",[#include <rpc/rpc.h>],[
    int a=1;
    ],HAS_XDR=1,HAS_XDR=0)
    if test "$HAS_XDR" = 1 ; then
	AC_DEFINE(HAS_XDR)
    else 
        print_error  "XDR not available on this system" 
    fi
fi
# Check for the functions that may be needed by the ADI to implement
# Processor_name.  Save these defines in a special place.
SAVEDEFS="$DEFS"
DEFS=""
AC_FUNC_CHECK(uname,AC_DEFINE(HAVE_UNAME)haveuname=1)
AC_FUNC_CHECK(gethostbyname,AC_DEFINE(HAVE_GETHOSTBYNAME)havegethostbyname=1)
dnl AC_HAVE_FUNCS(uname gethostbyname)
# If we have uname and gethostbyname, we can skip getdomainname ...
if test "$haveuname" != 1 -o "$havegethostbyname" != 1 ; then
    AC_HAVE_FUNCS(gethostname sysinfo)
    #
    # systeminfo is needed for sysinfo 
    PAC_CHECK_HEADERS(sys/systeminfo.h)
    #
    # getdomainname is special BECAUSE IT MAY BE USELESS (!Network computing 
    # indeed - stuff like this is why Windows95/NT WILL WIN). 
    AC_CHECK_FUNC(getdomainname,has_getdomainname=1,has_getdomainname=0)
    if test $has_getdomainname = 1 -a $cross_compiling = 0 ; then
        PAC_PROGRAM_CHECK(has_domainname,domainname,1,0,d_domainname)
        PAC_PROGRAM_CHECK(has_hostname,hostname,1,0,d_hostname)
        PAC_PROGRAM_CHECK(has_rup,rup,1,0,d_rup)
        # Form hostname.domainname, do rup to it
        # rup may not be enabled, but short of running a program to lookup the
        # local host, there does not seem to be a better alternative.
        #
        if test $has_domainname = 1 -a $has_hostname = 1 -a $has_rup = 1 ; then
changequote(,)
            fullhost=`$d_hostname | sed -e 's/^\([^\.]*\)\..*/\1/'`
changequote([,])
#	    echo $fullhost
            fullhost="${fullhost}.`$d_domainname`"
            response=`($d_rup $fullhost 2>&1) | egrep '(Unknown host|translation failed)'`
#	    echo $fullhost
            if test -n "$response" ; then
   print_error "The getdomainname system routine has been rendered USELESS"
   print_error "on your system.  This is not a bug and will not affect"
   print_error "MPICH.  Some MPE routines (particularly those that"
   print_error "interact with X Windows) may not work."
            else
                AC_DEFINE(HAVE_GETDOMAINNAME)
	    fi
        fi
    fi
fi
GETNAME_DEFS="$DEFS"
DEFS="$SAVEDEFS"
#
# Check for message archive routines (to be used for internationalization)
#
SAVEDEFS="$DEFS"
DEFS=""
# 
# Some systems have these in /usr/xpg2lib/libxpg.a (our Suns did)
# The includes (for nl_types) might be in /usr/xpg2include 
# This hasn't been handled yet.
AC_HAVE_FUNCS(catopen catclose catgets)
# Will need to generate binary form of file
# !!! We have a report that on Cray, gencat is a completely different command
# (parallel fscks?).  We're supposed to use 
# caterr -c cat_file msg_file.  Instead, we'll skip it
if test -n "$device_td3" ; then 
 # May try caterr -c cat_file msg_file
 print_error "Configure needs the gencat program to generate message catalogs"
 print_error "Some (all?) Cray T3D systems have a program named gencat"
 print_error "that performs file system checks instead.  For this reason,"
 print_error "message catalogs will not be created for the T3D device."
 print_error "You may be able to use the caterr command instead."
 print_error "MPICH will work without the message catalogs (though the"
 print_error "ability to generate error messages in languages other than"
 print_error "US English will be lost)."
else
 PAC_PROGRAM_CHECK(has_gencat,gencat,1,0,d_gencat)
 if test $has_gencat = 1 ; then
    AC_DEFINE(HAVE_GENCAT)
    PAC_CHECK_HEADERS(nl_types.h)
    NLS_DEFS="$DEFS"
    # Generate the cataloge
    AC_MSG("Generating message catalogs")
    # WARNING: IRIX systems seem to use a DIFFERENT MESSAGE CATALOG FORMAT
    # AND (AS USUAL) MAY NOT WORK AS EXPECTED.  This is the "....cat.m" file.
    (cd src/env ; \
    for file in mpich.*.msg ; do \
	fileroot=`basename $file .msg` ; \
        /bin/rm -f $fileroot.cat $fileroot.cat.m ; \
        gencat $fileroot.cat $file > /dev/null 2>&1 ; \
        if test -s $fileroot.cat ; then \
	    /bin/rm -f ../../lib/$ARCH/$fileroot.cat ; \
	    cp $fileroot.cat ../../lib/$ARCH ; \
        fi ; \
        if test -s $fileroot.cat.m ; then \
	    /bin/rm -f ../../lib/$ARCH/$fileroot.cat.m ; \
	    cp $fileroot.cat.m ../../lib/$ARCH ; \
        fi ; \
    done \
    )
    if test -s src/env/mpich.En_US.cat ; then
	if test ! -s lib/$ARCH/mpich.cat ; then
	   (cd lib/$ARCH ; ln -s mpich.En_US.cat mpich.cat )
        fi
	AC_MSG_RESULT("done")
    else
        AC_MSG_RESULT("Could not create catalog; US English messages will be used")
    fi
 fi
fi
DEFS="$SAVEDEFS"
#
AC_STDC_HEADERS
SAVEDEFS="$DEFS"
DEFS=""
PAC_CHECK_HEADERS(stdlib.h)
# MPE needs to know about stdlib.h
MPE_CFLAGS="$MPE_CFLAGS $DEFS"
PAC_CHECK_HEADERS(unistd.h)
PAC_CHECK_HEADER(stdarg.h,[AC_DEFINE(HAVE_STDARG_H)
havestdarg=1])
#
# It isn't enough to check for stdarg.  Even gcc doesn't get it right;
# on some systems, the gcc version of stdio.h loads stdarg.h WITH THE WRONG
# OPTIONS (causing it to choose the OLD STYLE va_start etc).
#
if test -n "$havestdarg" ; then
    PAC_COMPILE_CHECK_FUNC(stdarg is correct,[
/* DEC Alpha compiler by default does NOT define __STDC__ but DOES
   accept prototypes */
#if !defined(__STDC__)
'bad text'
#endif
#include <stdio.h>
#include <stdarg.h>
int func( int a, ... ){
int b;
va_list ap;
va_start( ap, a );
b = va_arg(ap, int);
printf( "%d-%d\n", a, b );
va_end(ap);
fflush(stdout);
return 0;
}
int main() { func( 1, 2 ); return 0;}],
AC_DEFINE(USE_STDARG)
MPE_CFLAGS="$MPE_CFLAGS -DUSE_STDARG")
fi
PAC_MALLOC_RETURNS_VOID()
USER_DEFS="$USER_DEFS $DEFS"
DEFS="$SAVEDEFS $DEFS"
#
# System is used only in MPE; i860's do not support it.
AC_HAVE_FUNCS(system)
#
# Nice is used only in env/init.c
AC_HAVE_FUNCS(nice)
#
# Look for headers that might have memset()....
PAC_CHECK_HEADERS(memory.h string.h)
#
# Turn off F77
# One problem with this is that some part of the ar will fail.  Lets hope
# it isn't fatal.  We've tried to fix this by defining MPI_FOBJECTS
# as the object files created from Fortran.
if test $NOF77 = 1 ; then
  F77="echo no Fortran compiler"
  FLINKER="$F77"
fi
#
#
# Check for erroneous C compilers
broken=0
do_test=1
if test $cross_compiling = 1 ; then
   if test "$CC" = mpcc ; then 
	TESTCC=xlc
   elif test "$CC" = mpCC ; then
        TESTCC=xlC
   else
        do_test=0
   fi
else 
    # If not cross compiling, testcc is just the compiler
    TESTCC="$CC"
fi
# 
# Should eventually use a file like $file.run to see if the program should
# be run or just compiled.  And eventually, this should be run EARLY,
# before checking for things like functions and include files.
#
PAC_CHECK_COMPILER_OK(cc_works=1,cc_works=0)
if test $cc_works = 0 ; then
    print_error "Could not compile a simple file with $CC!"
    print_error "Check for license and path restrictions on $CC."
    exit 1
fi
if test $NOF77 = 0 ; then
    PAC_CHECK_F77_COMPILER_OK(,NOF77=1;HAS_FORTRAN=0;HAS_F77=0;
       AC_DEFINE(MPID_NO_FORTRAN)
       dnl CFLAGS="-DMPID_NO_FORTRAN $CFLAGS"
       F77="echo no Fortran compiler"
       FLINKER="$F77"
       MPI_FOBJECTS="")
    # 
    # This test will allow us to make MPI_BOTTOM a 0 pointer on
    # some (many?) systems.  Currently here just for testing.
    if test $NOF77 = 0 ; then
        PAC_FORTRAN_HAS_POINTER(f77_pointer=1,f77_pointer=0)
    fi

fi
if test $do_test = 1 ; then
    PAC_CORRECT_COMPILER()
fi
#
if test "$RANLIB" != ":" ; then
    PAC_RANLIB_WORKS
fi
#
# Some Sun SOLARIS systems don't have AR (at least, not in a typical user
# path)
# Remove any arguments from the string AR
ARTEST=`expr "$AR" : "\(.*\) "`
PAC_PROGRAM_CHECK(ARFOUND,$ARTEST,1,,ARLOC)
if test -z "$ARLOC" ; then 
    # Check for /usr/ccs/bin/ar ; Solaris likes to hide anything remotely
    # useful in this directory
    print_error "The library archiver $AR is not in your path"
    print_error "MPICH cannot be built without this program, which"
    print_error "should be part of ANY program development environment."
    if test -x /usr/ccs/bin/ar ; then 
        print_error "You need /usr/ccs/bin in your path."
    else
        print_error "Check your path; contact your system vendor if your"
        print_error "path appears to be ok."
    fi
    exit 1
fi
#
#
# Check for long pointers.  All such options are placed into DEFS (see
# autoconf manual, AC _ DEFINE)
#
PAC_POINTER_64_BITS()
PAC_INT_LT_POINTER()
if test -n "$F77IDX" ; then
    AC_DEFINE(POINTER_64_BITS)
fi

# 
# Do not test 
if test "$NOSHORTLONGS" = 0 ; then
    # If not cross-compiling, we could dynamically check
    dnl The AC_LONG_DOUBLE macro is junk (it doesn't check that 
    dnl long double exists at all!
    PAC_LONG_DOUBLE()
    PAC_LONG_LONG_INT()
    PAC_CHECK_SIZEOF(double,doublesize)
    PAC_CHECK_SIZEOF(long double,longdoublesize)
    if test $doublesize -eq $longdoublesize ; then
	# Suppress long double if == double?
	# NOSHORTLONGS=1
     print_error "If you get warning messages about long doubles not supported"
     print_error "on $ARCH, use the -no_short_longs argument to configure."
    fi
fi
#
# Look for wish (the tcl/tk windowing shell; this is used by the new
# Upshot
#
if test -z "$wishloc" ; then
    PAC_FIND_WISH
fi
#
# Test that wish exists
if test -n "$wishloc" ; then
   namelen=`expr "$wishloc" : ".*"`
   if test $namelen -gt 26 ; then
	print_error "The path for wish, $wishloc, may be too long"
        print_error "for some Unix systems to accept as a command interpreter."
	print_error "This may cause problems when using upshot."
        print_error "(Some systems limit the length to 26 characters!)"
   fi
   if test ! -x $wishloc ; then
       wishloc=
   fi
fi
if test -z "$wishloc" ; then
    print_error "Could not find executable wish (needed for Upshot)"
fi
if test -z "$TCL_DIR" ; then
    PAC_FIND_TCL
fi
#
# Test the tcl was found
if test -z "$TCL_DIR" ; then
    print_error "Could not find libraries for TCL and TK (needed for Nupshot)"
fi
#
# Get TK version for Upshot.
TK_VERSION="3.6"
if test -n "$TK_DIR" -a $cross_compiling != 1 ; then
    if test -z "$XINCLUDES" ; then
	# Try to find X11 needed for TK_VERSION
	PAC_FIND_X11
    fi
    PAC_TK_VERSION
fi
#
# Set the location of the bitmaps
#
USER_CFLAGS="$CFLAGS $USER_DEFS"
dnl definitions should be passed to the configuration file
dnl CFLAGS="$CFLAGS $DEFS"
CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
#
if test $is_adi1 = 0 ; then
    AC_DEFINE(MPI_ADI2)
    dnl CFLAGS="$CFLAGS -DMPI_ADI2 -I../../mpid/ch2"
    CFLAGS="$CFLAGS -I../../mpid/ch2 -I../../lib/$ARCH/$COMM"
    if test "$MEMDEBUG" = "1" ; then 
	AC_DEFINE(MPIR_MEMDEBUG)
	AC_DEFINE(MPIR_OBJDEBUG)
	dnl CFLAGS="$CFLAGS -DMPIR_MEMDEBUG -DMPIR_OBJDEBUG"
    fi
    if test "$TRDEBUG" = "1" ; then 
	AC_DEFINE(DEBUG_TRACE)
        dnl CFLAGS="$CFLAGS -DDEBUG_TRACE"
    fi
fi
if test $is_adi1 = 1 -a -z "$adi1_ok" ; then
    cat <<EOF
The MPICH implementation of MPI no longer supports the ADI-1 interface.
The supported devices are all ADI-2 interfaces (e.g., ch_p4, ch_shmem, 
ch_nx, etc.).  

All implementors that we know about are notified about changes in the MPICH
implementation.  If you are an implementor using MPICH, please let us know
about you so that we can add you to the list of MPICH developers.  Send
mail to mpi-bugs@mcs.anl.gov and asked to be added to the MPICH developers 
list.
EOF
    exit 1
fi
LIB_PATH="-L$MPIR_HOME/lib/$ARCH/$COMM $LIB_PATH"
#
# hpux's Fortran compiler f77 (but not the POSIX version fort77) does
# not accept -L <dir> for library search path.
FLIB_PATH_LEADER="-L"
if test -n "$arch_hpux" -a "$F77" = "f77" ; then
   FLIB_PATH=`echo $LIB_PATH | sed -e 's/-L/-Wl,-L,/g'`
   FLIB_PATH_LEADER="-Wl,-L,"
else
   FLIB_PATH="$LIB_PATH"
fi
#
# Add any user libraries
if test -n "$USERLIB" ; then
    LIB_LIST="$LIB_LIST $USERLIB"
fi
#
# mpirun needs sync to try and fix NFS problems on some machines.  Some
# users may not have sync in their path, so we try to find it here.
SYNCLOC=""
PAC_PROGRAM_CHECK(SYNCFOUND,sync,1,,SYNCLOC)
if test -z "$SYNCLOC" ; then SYNCLOC=true ; fi
#
#
# if the device uses the machines file and there is no machines.$ARCH, 
# create one using hostname (or uname)
#
if test $DEVICE_KIND = network ; then
    if test ! -s util/machines/machines.$ARCH ; then
        HOST=""
        PAC_PROGRAM_CHECK(HOSTNAME_PGM,hostname,,,hostname)
        if test -x "$hostname" ; then
	    HOST="`$hostname`"
        fi
        # Note that uname -n may not produce a usable hostname.  
	# Any suggestions?
        if test "$HOST" = "" ; then
	    HOST="`uname -n`"
        fi
   	cat > util/machines/machines.$ARCH <<.
$HOST
$HOST
$HOST
$HOST
$HOST
.
	echo "Created util/machines/machines.$ARCH with five copies of $HOST"
	echo "You may want to edit this file to add and delete hosts"
	echo "(These hosts are used by mpirun.)"
    fi
fi
#
# Make sure that configure is group writable
#
chmod g+w configure > /dev/null 2>&1
#
# BASE_LIB_LIST lets us separate the MPI library from the other libs
BASE_LIB_LIST="$LIB_LIST"
# used to be LIB_LIST="$LIB_LIST -lmpi" I switched it, inspired by HPUX
LIB_LIST="-l$MPILIBNAME $LIB_LIST"
#
# Generate the name for the MPI-C, MPI-CC, and MPI-F77 compilers (for use
# in Makefiles that should not be MPICH dependent
MPICC=$MPIR_HOME/lib/$ARCH/$COMM/mpicc
MPIF77=$MPIR_HOME/lib/$ARCH/$COMM/mpif77
MPICPLUSPLUS=$MPIR_HOME/lib/$ARCH/$COMM/mpiCC
LIB_DIR=$MPIR_HOME/lib/$ARCH/$COMM
#
# Some mpi2 commands supported (for the testing scripts)
HAS_MPI2=1
#
# Substitute variables
# Variables used in scripts only
AC_SUBST(AUTOMOUNTFIX)dnl
# We really need to unify RSHCOMMAND and RSH_COMMAND
RSHCOMMAND=$rshcommand
AC_SUBST(RSHCOMMAND)dnl
AC_SUBST(RSH_COMMAND)dnl
# FINC contains an @MPIR_HOME@, so it needs to come first
AC_SUBST(FINC)dnl
AC_SUBST(wishloc)dnl
AC_SUBST(TK_DIR)dnl
AC_SUBST(TCL_DIR)dnl
AC_SUBST(TK_VERSION)dnl
dnl not used AC_SUBST(BITMAP_DIR)dnl
AC_SUBST(SYNCLOC)dnl
# Variables defined ONLY for the doc/port file:
AC_SUBST(COMPRESSEDPKT)dnl
AC_SUBST(CONFIGURE_ARGS)dnl
AC_SUBST(CONFIGURE_ARGS_CLEAN)dnl
AC_SUBST(NODEVDEBUG)dnl
AC_SUBST(PKTSIZE)dnl
dnl AC_SUBST(PREALLOC)dnl
dnl AC_SUBST(PREPOST)dnl
dnl AC_SUBST(USERNDV)dnl
AC_SUBST(VARPKT)dnl
AC_SUBST(LIMITEDBUFFERS)dnl
AC_SUBST(ADI_COLLECTIVE)dnl
AC_SUBST(cross_compiling)dnl
# Variables used by Makefile.in's:
AC_SUBST(ASM)dnl
AC_SUBST(ASMFILES_O)dnl
AC_SUBST(AR)dnl
AC_SUBST(ARCH)dnl
AC_SUBST(BASE_LIB_LIST)dnl
AC_SUBST(BOPT)dnl
AC_SUBST(CC)dnl
AC_SUBST(CFLAGS)dnl
AC_SUBST(CLINKER)dnl
AC_SUBST(CCFLAGS)dnl
AC_SUBST(CCLINKER)dnl
AC_SUBST(COMM)dnl
AC_SUBST(CPP_COMPILER)dnl
AC_SUBST(CPP_DIR)dnl
AC_SUBST(CPRP)dnl
AC_SUBST(DEFAULT_MACHINE)dnl
AC_SUBST(DEVCFLAGS)dnl
AC_SUBST(DEVCFILES)dnl
AC_SUBST(DEVOFILES)dnl
AC_SUBST(DEV_DEFS)dnl
AC_SUBST(DEVICE)dnl
AC_SUBST(DEVICE_MAKE_INCLUDE)dnl
AC_SUBST(F77)dnl
AC_SUBST(FAST_COPY)dnl
AC_SUBST(FFLAGS)dnl
AC_SUBST(FLIB_PATH)dnl
AC_SUBST(FLIB_PATH_LEADER)dnl
AC_SUBST(FLINKER)dnl
AC_SUBST(GETNAME_DEFS)dnl
AC_SUBST(HAS_FORTRAN)dnl
AC_SUBST(HAS_MPI2)dnl
AC_SUBST(ICCLIB)dnl    Used by -device=nx
AC_SUBST(INCLUDE_PATH)dnl
AC_SUBST(LIB_LIST)dnl
AC_SUBST(LIB_PATH)dnl
AC_SUBST(LIB_DIR)dnl
AC_SUBST(MAKE)dnl
AC_SUBST(MPEGRAPHICS_FOBJS)dnl
AC_SUBST(MPEGRAPHICS_FSOURCE)dnl
AC_SUBST(MPEGRAPHICS_OBJS)dnl
AC_SUBST(MPEGRAPHICS_SOURCE)dnl
AC_SUBST(MPE_CFLAGS)dnl
AC_SUBST(MPE_DIR)dnl
AC_SUBST(MPE_GRAPHICS)dnl
AC_SUBST(MPE_LIBS)dnl
AC_SUBST(MPE_MPI_EXT_C)dnl
AC_SUBST(MPE_MPI_EXT_O)dnl
AC_SUBST(MPIR_HOME)dnl
AC_SUBST(MPIFDEP)dnl
AC_SUBST(MPI_FOBJECTS)dnl
AC_SUBST(MPILIBNAME)dnl
AC_SUBST(MPICC)dnl
AC_SUBST(MPIF77)dnl
AC_SUBST(MPICPLUSPLUS)dnl
AC_SUBST(MEMDEBUG)dnl
AC_SUBST(NEXUSDIR)dnl
AC_SUBST(NLS_DEFS)dnl
AC_SUBST(OPTFLAGS)dnl
AC_SUBST(OPTFLAGSC)dnl
AC_SUBST(OPTFLAGSF)dnl
AC_SUBST(P4_ARCH)dnl
AC_SUBST(P4_DIR)dnl
AC_SUBST(RHS_COMMAND)dnl
# P4_MDEPCFLAGS now used only in doc/port.in
AC_SUBST(P4_MDEPCFLAGS)dnl
AC_SUBST(PREFIX)dnl
AC_SUBST(RANLIB)dnl
AC_SUBST(USER_CFLAGS)dnl
AC_SUBST(USER_INCLUDE_PATH)dnl
AC_SUBST(X_INC)dnl
AC_SUBST(X_LIB)dnl
#
# src/env/farg.f
# 
AC_SUBST(F77IARGC)dnl
AC_SUBST(F77GETARG)dnl
AC_SUBST(F90UNIX)dnl
# End configuration file
AC_OUTPUT(Makefile util/Makefile examples/Makefile examples/test/Makefile examples/test/pt2pt/Makefile examples/test/coll/Makefile examples/test/topol/Makefile examples/test/context/Makefile examples/test/env/Makefile examples/test/profile/Makefile examples/test/lederman/Makefile examples/contrib/Makefile examples/contrib/usingmpi/Makefile examples/contrib/life/Makefile examples/contrib/nuclei/Makefile examples/contrib/C++/Makefile examples/contrib/mandel-pvm/Makefile examples/perftest/Makefile src/pt2pt/Makefile src/coll/Makefile src/context/Makefile src/dmpi/Makefile src/env/Makefile src/topol/Makefile src/profile/Makefile src/util/Makefile src/c++/Makefile mpe/Makefile mpe/Makefile_nompi examples/basic/Makefile profiling/examples/Makefile profiling/lib/Makefile mpe/contrib/mandel/Makefile mpe/contrib/mastermind/Makefile mpe/contrib/life/Makefile mpe/test/Makefile )
PAC_OUTPUT_EXEC(examples/test/pt2pt/runtests examples/test/coll/runtests examples/test/topol/runtests examples/test/context/runtests examples/test/env/runtests examples/test/profile/runtests util/mpicc util/mpiCC util/mpif77 util/mpiinstall,a+x )
PAC_OUTPUT_EXEC(src/env/farg.f)
#
# Configure JUST the correct device file
CONFIG_FILES="mpid/$DEVICE/Makefile"
if test -f mpid/tests/Makefile.in ; then
    CONFIG_FILES="$CONFIG_FILES mpid/tests/Makefile"
fi
if test -n "$device_ch_shmem" ; then
    if test -s mpid/ch_shmem/p2ptest/Makefile.in ; then
        CONFIG_FILES="$CONFIG_FILES mpid/ch_shmem/p2ptest/Makefile"
    fi
fi
if test -n "$device_ch_tcp" -a -s mpid/ch_tcp/p3/Makefile.in ; then
    CONFIG_FILES="$CONFIG_FILES  mpid/ch_tcp/p3/Makefile"
fi
export CONFIG_FILES
./config.status
CONFIG_FILES=""
#
# The programs that run on the front end need a different compiler
if test $cross_compiling != 1 ; then
    CONFIG_FILES="profiling/wrappergen/Makefile"
    # nupshot is handled with its own configure file
    #  "profiling/nupshot/Makefile"
    export CONFIG_FILES
    ./config.status
    CONFIG_FILES=""
else
    print_error Not creating Makefiles in profiling/wrappergen and nupshot
    print_error when cross-compiling for arch $ARCH and device $DEVICE.
    print_error profiling/nupshot and profiling/wrappergen both have
    print_error their own configure scripts.  You can use these on 
    print_error another platform to build these programs.
fi
#
# Scripts in util: Copy to lib directory
for src in mpicc mpiCC mpif77 mpiinstall ; do 
  (cd util ; cp $src ../lib/$ARCH/$COMM ) 
done
#
# Set the final choices of flags
if test "$is_adi1" = 1 ; then 
    if test "$MEMDEBUG" = "1" ; then
        /bin/rm -f include/mpisys.h
        (cd include ; echo "#define MPIR_MEMDEBUG" | cat - mpisys.h.in > mpisys.h)
    else 
        /bin/rm -f include/mpisys.h
        cp include/mpisys.h.in include/mpisys.h
    fi
fi

#
# If the test suite is part of the directory, generate its makefiles
if test -d tsuite ; then
    CONFIG_FILES="tsuite/Makefile tsuite/coll/Makefile tsuite/pt2pt/Makefile tsuite/mpitc2/Makefile"
    export CONFIG_FILES
    ./config.status
fi
#
# If the bugs directory is available, generate its makefiles
if test -d bugs ; then
    CONFIG_FILES="bugs/Makefile bugs/irecv/Makefile bugs/fort/Makefile bugs/sockperf/Makefile bugs/srleak/Makefile bugs/ssend/Makefile bugs/testsendrecv/Makefile bugs/wait/Makefile"
    export CONFIG_FILES
    ./config.status
fi
#
# If the xmpi directory is available, generate its files
if test -d xmpi ; then 
    CONFIG_FILES="xmpi/buildinfo.tcl"
    export CONFIG_FILES
    ./config.status
fi
#
# If the mpich-ibm testsuite is available, generate its files
if test -d examples/test/mpitc ; then
    CONFIG_FILES="examples/test/mpitc examples/test/mpitc/ccl examples/test/mpitc/comm examples/test/mpitc/dtyp examples/test/mpitc/env examples/test/mpitc/group examples/test/mpitc/pt2pt examples/test/mpitc/topo"
    export CONFIG_FILES
    ./config.status
fi
#
# If the doc/port.in file is available, generate it
if test -f doc/port.in ; then
    PAC_OUTPUT_EXEC(doc/port doc/portbuild doc/portperf doc/porttest,a+x)
fi
#
# Remove the old config.status and copy new one; this allows mpireconfig to
# work with the current configuration.
# 
/bin/rm -f lib/$ARCH/$COMM/config.status
cp ./config.status lib/$ARCH/$COMM
#
# If we put the DEF values into this file, copy it to the library directory
# We also need the .in file for config.status (used by mpireconfig)
if test -f mpichconf.h ; then
    mv mpichconf.h lib/$ARCH/$COMM
    cp mpichconf.h.in lib/$ARCH/$COMM
fi
#
# Try to update the upshot script
#if test -f profiling/upshot/bin/upshot.in
#    CONFIG_FILES="profiling/upshot/bin/upshot"
#    export CONFIG_FILES
#    ./config.status
#    (cd profiling/upshot/bin ; /bin/rm -f .run1 ; \
#	sed -e '1d' upshot > .run1 ; \
#    /bin/rm -f upshot ; /bin/mv .run1 upshot ; chmod a+x upshot )
#fi
exit 0