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
  
2682
  
2683
  
2684
  
2685
  
2686
  
2687
  
2688
  
2689
  
2690
  
2691
  
2692
  
2693
  
2694
  
2695
  
2696
  
2697
  
2698
  
2699
  
2700
  
2701
  
2702
  
2703
  
2704
  
2705
  
2706
  
2707
  
2708
  
2709
  
2710
  
2711
  
2712
  
2713
  
2714
  
2715
  
2716
  
2717
  
2718
  
2719
  
2720
  
2721
  
2722
  
2723
  
2724
  
2725
  
2726
  
2727
  
2728
  
2729
  
2730
  
2731
  
2732
  
2733
  
2734
  
2735
  
2736
  
2737
  
2738
  
2739
  
2740
  
2741
  
2742
  
2743
  
2744
  
2745
  
2746
  
2747
  
2748
  
2749
  
2750
  
2751
  
2752
  
2753
  
2754
  
2755
  
2756
  
2757
  
2758
  
2759
  
2760
  
2761
  
2762
  
2763
  
2764
  
2765
  
2766
  
2767
  
2768
  
2769
  
2770
  
2771
  
2772
  
2773
  
2774
  
2775
  
2776
  
2777
  
2778
  
2779
  
2780
  
2781
  
2782
  
2783
  
2784
  
2785
  
2786
  
2787
  
2788
  
2789
  
2790
  
2791
  
2792
  
2793
  
2794
  
2795
  
2796
  
2797
  
2798
  
2799
  
2800
  
2801
  
2802
  
2803
  
2804
  
2805
  
2806
  
2807
  
2808
  
2809
  
2810
  
2811
  
2812
  
2813
  
2814
  
2815
  
2816
  
2817
  
2818
  
2819
  
2820
  
2821
  
2822
  
2823
  
2824
  
2825
  
2826
  
2827
  
2828
  
2829
  
2830
  
2831
  
2832
  
2833
  
2834
  
2835
  
2836
  
2837
  
2838
  
2839
  
2840
  
2841
  
2842
  
2843
  
2844
  
2845
  
2846
  
2847
  
2848
  
2849
  
2850
  
2851
  
2852
  
2853
  
2854
  
2855
  
2856
  
2857
  
2858
  
2859
  
2860
  
2861
  
2862
  
2863
  
2864
  
2865
  
2866
  
2867
  
2868
  
2869
  
2870
  
2871
  
2872
  
2873
  
2874
  
2875
  
2876
  
2877
  
2878
  
2879
  
2880
  
2881
  
2882
  
2883
  
2884
  
2885
  
2886
  
2887
  
2888
  
2889
  
2890
  
2891
  
2892
  
2893
  
2894
  
2895
  
2896
  
2897
  
2898
  
2899
  
2900
  
2901
  
2902
  
2903
  
2904
  
2905
  
2906
  
2907
  
2908
  
2909
  
2910
  
2911
  
2912
  
2913
  
2914
  
2915
  
2916
  
2917
  
2918
  
2919
  
2920
  
2921
  
2922
  
2923
  
2924
  
2925
  
2926
  
2927
  
2928
  
2929
  
2930
  
2931
  
2932
  
2933
  
2934
  
2935
  
2936
  
2937
  
2938
  
2939
  
2940
  
2941
  
2942
  
2943
  
2944
  
2945
  
2946
  
2947
  
2948
  
2949
  
2950
  
2951
  
2952
  
2953
  
2954
  
2955
  
2956
  
2957
  
2958
  
2959
  
2960
  
2961
  
2962
  
2963
  
2964
  
2965
  
2966
  
2967
  
2968
  
2969
  
2970
  
2971
  
2972
  
2973
  
2974
  
2975
  
2976
  
2977
  
2978
  
2979
  
2980
  
2981
  
2982
  
2983
  
2984
  
2985
  
2986
  
2987
  
2988
  
2989
  
2990
  
2991
  
2992
  
2993
  
2994
  
2995
  
2996
  
2997
  
2998
  
2999
  
3000
  
3001
  
3002
  
3003
  
3004
  
3005
  
3006
  
3007
  
3008
  
3009
  
3010
  
3011
  
3012
  
3013
  
3014
  
3015
  
3016
  
3017
  
3018
  
3019
  
3020
  
3021
  
3022
  
3023
  
3024
  
3025
  
3026
  
3027
  
3028
  
3029
  
3030
  
3031
  
3032
  
3033
  
3034
  
3035
  
3036
  
3037
  
3038
  
3039
  
3040
  
3041
  
3042
  
3043
  
3044
  
3045
  
3046
  
3047
  
3048
  
3049
  
3050
  
3051
  
3052
  
3053
  
3054
  
3055
  
3056
  
3057
  
3058
  
3059
  
3060
  
3061
  
3062
  
3063
  
3064
  
3065
  
3066
  
3067
  
3068
  
3069
  
3070
  
3071
  
3072
  
3073
  
3074
  
3075
  
3076
  
3077
  
3078
  
3079
  
3080
  
3081
  
3082
  
3083
  
3084
  
3085
  
3086
  
3087
  
3088
  
3089
  
3090
  
3091
  
3092
  
3093
  
3094
  
3095
  
3096
  
3097
  
3098
  
3099
  
3100
  
3101
  
3102
  
3103
  
3104
  
3105
  
3106
  
3107
  
3108
  
3109
  
3110
  
3111
  
3112
  
3113
  
3114
  
3115
  
3116
  
3117
  
3118
  
3119
  
3120
  
3121
  
3122
  
3123
  
3124
  
3125
  
3126
  
3127
  
3128
  
3129
  
3130
  
3131
  
3132
  
3133
  
3134
  
3135
  
3136
  
3137
  
3138
  
3139
  
3140
  
3141
  
3142
  
3143
  
3144
  
3145
  
3146
  
3147
  
3148
  
3149
  
3150
  
3151
  
3152
  
3153
  
3154
  
3155
  
3156
  
3157
  
3158
  
3159
  
3160
  
3161
  
3162
  
3163
  
3164
  
3165
  
3166
  
3167
  
3168
  
3169
  
3170
  
3171
  
3172
  
3173
  
3174
  
3175
  
3176
  
3177
  
3178
  
3179
  
3180
  
3181
  
3182
  
3183
  
3184
  
3185
  
3186
  
3187
  
3188
  
3189
  
3190
  
3191
  
3192
  
3193
  
3194
  
3195
  
3196
  
3197
  
3198
  
3199
  
3200
  
3201
  
3202
  
3203
  
3204
  
3205
  
3206
  
3207
  
3208
  
3209
  
3210
  
3211
  
3212
  
3213
  
3214
  
3215
  
3216
  
3217
  
3218
  
3219
  
3220
  
3221
  
3222
  
3223
  
3224
  
3225
  
3226
  
3227
  
3228
  
3229
  
3230
  
3231
  
3232
  
3233
  
3234
  
3235
  
3236
  
3237
  
3238
  
3239
  
3240
  
3241
  
3242
  
3243
  
3244
  
3245
  
3246
  
3247
  
3248
  
3249
  
3250
  
3251
  
3252
  
3253
  
3254
  
3255
  
3256
  
3257
  
3258
  
3259
  
3260
  
3261
  
3262
  
3263
  
3264
  
3265
  
3266
  
3267
  
3268
  
3269
  
3270
  
3271
  
3272
  
3273
  
3274
  
3275
  
3276
  
3277
  
3278
  
3279
  
3280
  
3281
  
3282
  
3283
  
3284
  
3285
  
3286
  
3287
  
3288
  
3289
  
3290
  
3291
  
3292
  
3293
  
3294
  
3295
  
3296
  
3297
  
3298
  
3299
  
3300
  
3301
  
3302
  
3303
  
3304
  
3305
  
3306
  
3307
  
3308
  
3309
  
3310
  
3311
  
3312
  
3313
  
3314
  
3315
  
3316
  
3317
  
3318
  
3319
  
3320
  
3321
  
3322
  
3323
  
3324
  
3325
  
3326
  
3327
  
3328
  
3329
  
3330
  
3331
  
3332
  
3333
  
3334
  
3335
  
3336
  
3337
  
3338
  
3339
  
3340
  
3341
  
3342
  
3343
  
3344
  
3345
  
3346
  
3347
  
3348
  
3349
  
3350
  
3351
  
3352
  
3353
  
3354
  
3355
  
3356
  
3357
  
3358
  
3359
  
3360
  
3361
  
3362
  
3363
  
3364
  
3365
  
3366
  
3367
  
3368
  
3369
  
3370
  
3371
  
3372
  
3373
  
3374
  
3375
  
3376
  
3377
  
3378
  
3379
  
3380
  
3381
  
3382
  
3383
  
3384
  
3385
  
3386
  
3387
  
3388
  
3389
  
3390
  
3391
  
3392
  
3393
  
3394
  
3395
  
3396
  
3397
  
3398
  
3399
  
3400
  
3401
  
3402
  
3403
  
3404
  
3405
  
3406
  
3407
  
3408
  
3409
  
3410
  
3411
  
3412
  
3413
  
3414
  
3415
  
3416
  
3417
  
3418
  
3419
  
3420
  
3421
  
3422
  
3423
  
3424
  
3425
  
3426
  
3427
  
3428
  
3429
  
3430
  
3431
  
3432
  
3433
  
3434
  
3435
  
3436
  
3437
  
3438
  
3439
  
3440
  
3441
  
3442
  
3443
  
3444
  
3445
  
3446
  
3447
  
3448
  
3449
  
3450
  
3451
  
3452
  
3453
  
3454
  
3455
  
3456
  
3457
  
3458
  
3459
  
3460
  
3461
  
3462
  
3463
  
3464
  
3465
  
3466
  
3467
  
3468
  
3469
  
3470
  
3471
  
3472
  
3473
  
3474
  
3475
  
3476
  
3477
  
3478
  
3479
  
3480
  
3481
  
3482
  
3483
  
3484
  
3485
  
3486
  
3487
  
3488
  
3489
  
3490
  
3491
  
3492
  
3493
  
3494
  
3495
  
3496
  
3497
  
3498
  
3499
  
3500
  
3501
  
3502
  
3503
  
3504
  
3505
  
3506
  
3507
  
3508
  
3509
  
3510
  
3511
  
3512
  
3513
  
3514
  
3515
  
3516
  
3517
  
3518
  
3519
  
3520
  
3521
  
3522
  
3523
  
3524
  
3525
  
3526
  
3527
  
3528
  
3529
  
3530
  
3531
  
3532
  
3533
  
3534
  
3535
  
3536
  
3537
  
3538
  
3539
  
3540
  
3541
  
3542
  
3543
  
3544
  
3545
  
3546
  
3547
  
3548
  
3549
  
3550
  
3551
  
3552
  
3553
  
3554
  
3555
  
3556
  
3557
  
3558
  
3559
  
3560
  
3561
  
3562
  
3563
  
3564
  
3565
  
3566
  
3567
  
3568
  
3569
  
3570
  
3571
  
3572
  
3573
  
3574
  
3575
  
3576
  
3577
  
3578
  
3579
  
3580
  
3581
  
3582
  
3583
  
3584
  
3585
  
3586
  
3587
  
3588
  
3589
  
3590
  
3591
  
3592
  
3593
  
3594
  
3595
  
3596
  
3597
  
3598
  
3599
  
3600
  
3601
  
3602
  
3603
  
3604
  
3605
  
3606
  
3607
  
3608
  
3609
  
3610
  
3611
  
3612
  
3613
  
3614
  
3615
  
3616
  
3617
  
3618
  
3619
  
3620
  
3621
  
3622
  
3623
  
3624
  
3625
  
3626
  
3627
  
3628
  
3629
  
3630
  
3631
  
3632
  
3633
  
3634
  
3635
  
3636
  
3637
  
3638
  
3639
  
3640
  
3641
  
3642
  
3643
  
3644
  
3645
  
3646
  
3647
  
3648
  
3649
  
3650
  
3651
  
3652
  
3653
  
3654
  
3655
  
3656
  
AC_REVISION("$Id: configure.in,v 1.379 2000/06/17 13:43:57 grubba Exp $") 
AC_INIT(interpret.c) 
AC_CONFIG_HEADER(machine.h) 
 
# We want an absolute path to the source-dir. 
case "$srcdir" in 
    /*) 
    ;; 
    *) 
        oldsrcdir="$srcdir" 
        srcdir="`cd \"$srcdir\";pwd`" 
        AC_MSG_WARN([ Converted $oldsrcdir to $srcdir, 
If this does not work, please use an absolute path to the configure script. ]) 
    ;; 
esac 
 
if test "x${CFLAGS-}" = x ; then 
  cflags_is_set=no 
else 
  cflags_is_set=yes 
fi 
 
if test "x${CPPFLAGS-}" = x ; then 
  cppflags_is_set=no 
else 
  cppflags_is_set=yes 
fi 
 
if test "x${LDFLAGS-}" = x ; then 
  ldflags_is_set=no 
else 
  ldflags_is_set=yes 
fi 
 
for ac_site_file in $CONFIG_SITE; do 
  if test -r "$ac_site_file"; then 
    AC_MSG_WARN([You are using a site file to initialize configure, please 
note that this can lead to problems if anything in 
$ac_site_file is not correct. If Pike does not compile, or 
does not run, please try this to compile Pike again: 
rm ./config.cache ; CONFIG_SITE=x ./configure ; make]) 
  fi 
done 
 
if test ! -z "$pike_cv_prog_CC_save" -a ! -z "$CC" -a "$CC" != "$pike_cv_prog_CC_save" 
then 
  AC_MSG_WARN([CC is different than last time Pike was compiled, 
It is probably best to delete ./config.cache before proceeding]) 
fi 
 
pike_cv_prog_CC_save="$CC" 
 
# MY_AC_PROG_CC 
# The above has problems if the smartlink binary is removed. /grubba 
AC_PROG_CC 
AC_ISC_POSIX 
AC_PROG_CPP 
 
############################################################################# 
 
# 
# The purpose of this test is to check that there is no filesystem 
# caching preventing pike from compiling correctly. 
# 
AC_MSG_CHECKING([filesystem synchronization]) 
 
AC_CACHE_VAL(pike_cv_filesystem_syncronization, 
[ 
  pike_cv_filesystem_syncronization=working 
 
  AC_EGREP_CPP(true, [ true ], , pike_cv_filesystem_syncronization=broken) 
  AC_EGREP_CPP(false, [ false ], , pike_cv_filesystem_syncronization=broken) 
  AC_EGREP_CPP(yes, [ yes ], , pike_cv_filesystem_syncronization=broken) 
  AC_EGREP_CPP(no, [ no ], , pike_cv_filesystem_syncronization=broken) 
  AC_EGREP_CPP(near, [ far ], pike_cv_filesystem_syncronization=broken, ) 
  AC_EGREP_CPP(up, [ up ], , pike_cv_filesystem_syncronization=broken) 
  AC_EGREP_CPP(down, [ down], , pike_cv_filesystem_syncronization=broken) 
]) 
 
AC_MSG_RESULT($pike_cv_filesystem_syncronization) 
if test "x$pike_cv_filesystem_syncronization" = xbroken ; then 
  AC_MSG_ERROR([Filesystem caching is too aggressive. If you are using 
Samba, make sure to have the following line in your smb.conf: 
oplocks = False 
]) 
  exit 1 
fi 
 
############################################################################# 
 
AC_CHECK_HEADERS(fnord/fnord/fnord.h) 
 
AC_MSG_CHECKING([if CHECK_HEADERS works]) 
if test "x$ac_cv_header_fnord_fnord_fnord_h" = xyes ; then 
  AC_MSG_RESULT(no) 
  exit 1 
fi 
AC_MSG_RESULT(yes) 
############################################################################# 
AC_MINIX 
 
if test $ac_cv_prog_gcc = yes; then 
  AC_MSG_CHECKING(for libgcc file name) 
  AC_CACHE_VAL(pike_cv_libgcc_filename, 
  [ 
    pike_cv_libgcc_filename="`${CC-cc} -print-libgcc-file-name`" 
    if test -z "$pike_cv_libgcc_filename"; then 
      pike_cv_libgcc_filename=no 
    else 
       if test -f "$pike_cv_libgcc_filename"; then 
         : 
       else 
         pike_cv_libgcc_filename=no 
       fi 
    fi 
  ]) 
  AC_MSG_RESULT($pike_cv_libgcc_filename) 
  if test x"$pike_cv_libgcc_filename" = xno; then 
    LIBGCC="" 
  else 
    LIBGCC="$pike_cv_libgcc_filename" 
  fi 
else 
  LIBGCC="" 
fi 
AC_SUBST(LIBGCC) 
 
############################################################################# 
 
LIBDIR=`(cd $srcdir/../lib ; pwd)` 
BINDIR=`(cd $srcdir/../bin ; pwd)` 
BUILDDIR=`pwd` 
AC_SUBST(LIBDIR) 
AC_SUBST(BINDIR) 
AC_SUBST(BUILDDIR) 
 
############################################################################# 
 
## Build smartlink 
 
AC_CHECK_HEADERS(stdlib.h string.h unistd.h sys/stat.h sys/types.h sys/errno.h) 
 
if test -x /usr/bin/uname 2>/dev/null; then 
  UNAME=`/usr/bin/uname -sr` 
elif test -x /bin/uname 2>/dev/null; then 
  UNAME=`/bin/uname -sr` 
else 
  UNAME=unknown 
fi 
 
# FIXME: Add proper tests 
case "$UNAME" in 
  OSF1\ V4.*) 
    AC_DEFINE(USE_RPATH) 
    ;; 
  IRIX\ 6.*) 
    AC_DEFINE(USE_RPATH) 
    ;; 
  IRIX\ 5.*) 
    AC_DEFINE(USE_RPATH) 
    ;; 
  SunOS\ 5.*) 
    if test "$TCC" = "yes"; then 
      # tcc doesn't know about -R 
      AC_DEFINE(USE_Wl_R) 
    else 
      AC_DEFINE(USE_R) 
    fi 
    ;; 
  Linux\ 2.*) 
    AC_DEFINE(USE_Wl) 
    ;; 
  UnixWare\ 7.*) 
    if test "$ac_cv_prog_gcc" = "yes"; then 
      AC_DEFINE(USE_XLINKER_YP_) 
    else 
      AC_DEFINE(USE_YP_) 
    fi 
    ;; 
  *) 
    AC_DEFINE(USE_LD_LIBRARY_PATH) 
    ;; 
esac 
 
# Strip smartlink from $CC 
REALCC="`echo $CC|sed -e 's/.*smartlink //'`" 
 
# Fix a smartlink 
SMARTLINK="$BUILDDIR/smartlink" 
 
AC_MSG_CHECKING(if $SMARTLINK exists is up to date and works) 
if ls -1tr "$SMARTLINK${ac_exeext}" "$srcdir/smartlink.$ac_ext" 2>/dev/null | head -1 | grep "smartlink.$ac_ext" >/dev/null 2>&5 && "$SMARTLINK" -v >/dev/null 2>&5; then 
  AC_MSG_RESULT(yes) 
else 
  AC_MSG_RESULT(no) 
 
  if echo foo "$CC" | egrep rntc. >/dev/null; then 
    echo Warning: rntcc/rntcl detected. Using the smartlink /bin/sh script. 
    SMARTLINK="$BINDIR/smartlink" 
  else 
    rm -f "$SMARTLINK" 
 
    AC_MSG_CHECKING(whether smartlink compiles) 
 
    link_cmd='${REALCC-cc} -o smartlink${ac_exeext} $CFLAGS -I. $CPPFLAGS $LDFLAGS $srcdir/smartlink.$ac_ext $LIBS 2>&5' 
    if { (eval echo Compiling smartlink: \"$link_cmd\") 1>&5; (eval $link_cmd) 2>&5; } && "$BUILDDIR/smartlink" -v >/dev/null 2>&5; then 
      AC_MSG_RESULT(yes) 
    else 
      AC_MSG_RESULT(no - use the sh script) 
 
      SMARTLINK="$BINDIR/smartlink" 
    fi 
  fi 
fi 
 
CC="$SMARTLINK $REALCC" 
pike_cv_prog_CC="$CC" 
 
AC_SUBST(SMARTLINK) 
AC_SUBST(REALCC) 
export REALCC SMARTLINK 
 
############################################################################# 
 
AC_AIX 
AC_MINIX 
  
############################################################################# 
 
# option, cache_name, variable 
AC_DEFUN(AC_SYS_COMPILER_FLAG, 
[ 
  AC_MSG_CHECKING($1) 
  AC_CACHE_VAL(pike_cv_option_$2, 
  [ 
    OLD_CFLAGS="[$]CFLAGS" 
    CFLAGS="[$]OLD_CFLAGS $1" 
    AC_TRY_RUN([int main(){exit(0);}],pike_cv_option_$2=yes,pike_cv_option_$2=no,pike_cv_option_$2=no) 
    CFLAGS="[$]OLD_CFLAGS" 
  ]) 
   
  if test x"[$]pike_cv_option_$2" = "xyes" ; then 
    $3="[$]$3 $1" 
    case "$3" in 
      OPTIMIZE) 
        CFLAGS="[$]CFLAGS $1" 
      ;; 
    esac 
    AC_MSG_RESULT(yes) 
    $5 
  else 
    AC_MSG_RESULT(no) 
    $4 
  fi 
]) 
 
# arch, option, cache_name, variable 
AC_DEFUN(AC_SYS_CPU_COMPILER_FLAG, 
[ 
 if test "`uname -m 2>/dev/null`" = "$1" ; then 
    AC_SYS_COMPILER_FLAG($2,$3,$4,$5,$6) 
    $7 
 fi 
]) 
 
# os, option, cache_name, variable 
AC_DEFUN(AC_SYS_OS_COMPILER_FLAG, 
[ 
 if test "x$pike_cv_sys_os" = "x$1" ; then 
    AC_SYS_COMPILER_FLAG($2,$3,$4,$5,$6) 
    $7 
 fi 
]) 
 
define([DO_IF_OS], 
[ 
 if test "x$pike_cv_sys_os" = "x$1" ; then 
$2 
fi 
]) 
 
define([DO_IF_CPU], 
[ 
if test "`uname -m 2>/dev/null`" = "$1" ; then 
$2 
fi 
]) 
 
############################################################################# 
 
# We need some special hacks when running slowaris 
AC_PATH_PROG(uname_prog,uname,no) 
AC_MSG_CHECKING(operating system) 
AC_CACHE_VAL(pike_cv_sys_os, 
[ 
if test "$uname_prog" != "no"; then 
  pike_cv_sys_os="`uname`" 
 
  case "$pike_cv_sys_os" in 
    SunOS) 
      case "`uname -r`" in 
        5.*) pike_cv_sys_os="Solaris" ;; 
      esac 
    ;; 
  esac 
else 
  pike_cv_sys_os="Not Solaris" 
fi 
]) 
AC_MSG_RESULT($pike_cv_sys_os) 
 
LD='$(CC) $(CFLAGS)' 
 
case "$pike_cv_sys_os" in 
  SCO*) 
     case "$CFLAGS" in 
        *-belf*)  
          AC_SYS_COMPILER_FLAG(-belf,sco_belf_option,CFLAGS,[],[ 
            case "$LDFLAGS" in 
              *-belf*) ;; 
              *) 
                echo "Adding -belf option to ldflags." 
                LDFLAGS="$LDFLAGS -belf" 
              ;; 
            esac 
          ]) 
       ;; 
       *) 
         AC_SYS_COMPILER_FLAG(-belf,belf,CFLAGS) 
       ;; 
     esac 
     case "$LDFLAGS" in 
       *-belf*) ;; 
       *) 
          AC_SYS_COMPILER_FLAG(-belf,belf,LDFLAGS) 
       ;; 
     esac 
  ;; 
  SunOS*) 
    # gcc on SunOS 4 forgets to define this: 
    echo "SunOS. Adding -D__USE_FIXED_PROTOTYPES__" 
    CFLAGS="$CFLAGS -D__USE_FIXED_PROTOTYPES__" 
  ;; 
  BSD/OS*) 
    LD="$BINDIR/smartlink shlicc" 
  ;; 
  UnixWare*) 
    case "$CFLAGS" in 
      *-Kalloca*) ;; 
      *) 
        if test "$GCC" != "yes"; then 
          # We are using built-in inline function 
          CFLAGS="$CFLAGS -Kalloca" 
          CXX="$CXX -DNO_CPLUSPLUS_ALLOCA" 
        fi 
      ;; 
    esac 
  ;; 
esac 
 
AC_SUBST(LD) 
 
############################################################################# 
 
# Some sanity checks. 
 
if test "$GCC" = "yes" -a "$pike_cv_sys_os" = "Solaris" && test "`uname -p`" = "sparc"; then 
  # Solaris/sparc: 
  #   Check that gnu ld isn't used. 
  #   It's usually hidden in $prefix/sparc-sun-solaris2.?/bin/. 
  # NOTE: M4 uses [] as quotes. 
  gcc_ld_path="`$CC -v 2>&1 | sed -e '1,1s/[[^\/]]*\(\/.*\/\)[[^\/]]*$/\1/p;d' | sed -e '/lib\/gcc-lib\//s/lib\/gcc-lib\///;s/\/[[0-9]]*\.[[0-9]]*\.[[0-9]]*\/$/\/bin/'`" 
  if test "x$gcc_ld_path" = "x"; then :; else 
    if test -d "$gcc_ld_path/."; then 
      if "$gcc_ld_path/ld" -v 2>&1 | grep -i GNU >/dev/null; then 
        AC_MSG_WARN([GNU ld found on Solaris sparc system ($gcc_ld_path/ld).]) 
        AC_MSG_WARN([This may cause the dynamic module support to fail.]) 
      else :; fi 
    else :; fi 
  fi 
  unset gcc_ld_path 
 
 
  # Watch out for gcc-2.8.1 on Solaris 7 sparc machines. It generates 
  # assembler code which contains .uaword directives, which in turn 
  # generates code with R_SPARC_UA32 relocations, which /usr/bin/ld.so 
  # has buggy support for (it doesn't relocate the MSB). 
 
  #  Check that gcc doesn't generate uaword opcodes 
  AC_MSG_CHECKING(if your gcc generates uaword opcodes) 
  AC_CACHE_VAL(pike_cv_gcc_uaword, [ 
    cat > conftest.c <<EOF     
char *foo[[]] = { "bar" }; 
EOF 
    pike_compile='${CC-cc} -S $CFLAGS $CPPFLAGS conftest.c 1>&5' 
    pike_cv_gcc_uaword=no 
    if { (eval echo configure: \"$pike_compile\") >&5; (eval $pike_compile) 2>&5; }; then 
      if grep ".uaword" conftest.s 2>&5 >/dev/null; then 
        echo "configure: result contains .uaword:" >&5 
        cat conftest.s >&5 
        pike_cv_gcc_uaword=yes 
      else :; fi 
    else 
      echo "configure: failed program was:" >&5 
      cat conftest.c >&5 
    fi 
    rm -rf conftest.* 
  ]) 
  AC_MSG_RESULT($pike_cv_gcc_uaword) 
 
  # Check if as generates R_SPARC_UA32 relocations from .uaword. 
  if test "$pike_cv_gcc_uaword" = "yes"; then 
    AC_MSG_CHECKING([if your as generates R_SPARC_UA32 relocations]) 
    AC_CACHE_VAL(pike_cv_as_r_sparc_ua32, [ 
      AC_TRY_ASSEMBLE([ 
.section        ".rodata" 
        .align 8 
.STRING: 
        .asciz  "String" 
.section        ".data" 
        .align 4 
        .type   string,#object 
        .size   string,4 
string: 
        .uaword .STRING 
      ],[ 
        if /usr/ccs/bin/elfdump -r conftest.o | grep -i R_SPARC_UA32 >/dev/null 2>&AC_FD_CC; then 
          pike_cv_ac_r_sparc_ua32=yes 
        else 
          pike_cv_ac_r_sparc_ua32=no 
        fi 
      ],[ 
        pike_cv_ac_r_sparc_ua32=no 
      ]) 
    ]) 
    AC_MSG_RESULT($pike_cv_ac_r_sparc_ua32) 
    if test "$pike_cv_ac_r_sparc_ua32" = "yes"; then 
      AC_MSG_WARN([Your gcc/as combo may generate R_SPARC_UA32 relocations.]) 
      AC_MSG_WARN([R_SPARC_UA32 relocations are unsupported in Solaris >= 2.3,]) 
      AC_MSG_WARN([and have broken support in Solaris 7.]) 
      if test -d "/var/sadm/patch/107058-01/."; then 
        AC_MSG_WARN([Back out patch 107058-01, or]) 
        AC_MSG_WARN([recompile gcc with a modified config/sparc/sol2.h.]) 
      else 
        AC_MSG_WARN([Recompile gcc with a modified config/sparc/sol2.h.]) 
      fi 
      exit 1 
    else :; fi 
  else :; fi 
else :; fi 
 
############################################################################# 
 
 
 
AC_ARG_WITH(dynamic_modules,   [  --without-dynamic-modules        link modules statically],[],[with_dynamic_modules=yes]) 
AC_ARG_WITH(static_linking,    [  --with-static-linking            link statically, if possible],[with_static_linking=yes],[]) 
AC_ARG_WITH(include-path,[  --with-include-path    A list of paths to search for include files.]) 
AC_ARG_WITH(lib-path,    [  --with-lib-path        A list of paths to search for libraries.]) 
 
AC_ARG_WITH(double-precision,  [  --with-double-precision          use double precision floats ], [ AC_DEFINE(WITH_DOUBLE_PRECISION_SVALUE) ] ) 
AC_ARG_WITH(long-double-precision,  [  --with-long-double-precision          use long double precision floats ], [ AC_DEFINE(WITH_LONG_DOUBLE_PRECISION_SVALUE) ] ) 
 
AC_ARG_WITH(gdbm,        [  --without-gdbm         no GNU database manager support ]) 
AC_ARG_WITH(gmp,         [  --without-gmp          no support for Gmp bignums]) 
AC_ARG_WITH(debug,       [  --without-debug        disable run debugging],[],[with_debug=]) 
AC_ARG_WITH(rtldebug,    [  --without-rtldebug     disable run time self tests],[],[with_rtldebug=]) 
AC_ARG_WITH(cdebug,      [  --without-cdebug       disable -g],[],[ 
  case "$pike_cv_sys_os:$GCC" in 
    Solaris:no) 
      # Solaris/cc has problems with combining optimizations and debuginfo. 
      AC_MSG_WARN([Defaulting to --without-cdebug since the OS is Solaris, 
and gcc is not being used.]) 
      with_cdebug=no 
    ;; 
    *) 
      with_cdebug= 
    ;; 
  esac 
]) 
AC_ARG_WITH(copt,        [  --without-copt         disable -O2],[],[with_copt=]) 
AC_ARG_WITH(threads,     [  --without-threads      no threads support],[],[ 
   case "x$pike_cv_sys_os" in 
     xFreeBSD*) 
        if test "`uname -r`" -gt 3; then 
           AC_MSG_WARN([ 
FreeBSD <= 3.x detected, disabling threads. 
Use --with-threads to force threads support. 
]) 
           with_threads=no 
        fi 
     ;; 
     xIRIX*) 
           AC_MSG_WARN([ 
IRIX detected, disabling threads. 
Use --with-threads to force threads support. 
]) 
           with_threads=no 
     ;; 
   esac 
 
   if test "x${with_threads-}" = x; then 
     with_threads=yes 
   fi 
]) 
AC_ARG_WITH(zlib,        [  --without-zlib         no gz compression support],[],[with_zlib=yes]) 
AC_ARG_WITH(ssleay,      [  --without-ssleay       no support for the secure socket protocol],[],[with_ssleay=yes]) 
AC_ARG_WITH(mysql,       [  --without-mysql        no support for the Mysql database],[],[with_mysql=yes]) 
AC_ARG_WITH(gif-rle,     [  --with-gif-rle         use kind-of-rle packing instead of lzw],[],[]) 
AC_ARG_WITH(rsaref,      [  --with-rsaref[=path]   Support for RSAREF],[],[]) 
AC_ARG_WITH(dmalloc,     [  --with-dmalloc         enable memory-leak tests],[AC_DEFINE(DEBUG_MALLOC,10)],[]) 
AC_ARG_WITH(checker,     [  --with-checker         add extra memory checking overhead (Purify)]) 
AC_ARG_WITH(profiling,   [  --with-profiling       add code used to profile pike code ],[AC_DEFINE(PROFILING)],[]) 
AC_ARG_WITH(pg,          [  --with-pg              Use the gcc -pg option], 
[ 
  if test "x$with_pg" = xyes; then 
    PROFIL=-pg 
  else 
    PROFIL= 
  fi 
], 
[ 
 PROFIL= 
]) 
AC_ARG_WITH(poll,        [  --with-poll            use poll instead of select],[],[ 
  # Neither --with-poll nor --without-poll was specified 
  case "$pike_cv_sys_os" in 
    Solaris|HP-UX|OSF1|IRIX) 
      AC_MSG_WARN([Defaulting to --with-poll since the OS is $pike_cv_sys_os.]) 
      with_poll=yes 
    ;; 
    AIX) 
      # poll(2) is broken on AIX 4.1 and earlier. 
      if test "`uname -r`" -ge 2 -a "`uname -v`" -ge 4 ; then 
        with_poll=yes 
      else if test "`uname -v`" -gt 4 ; then 
          with_poll=yes 
        else :; fi 
      fi 
      if test "$with_poll" = "yes" ; then 
        AC_MSG_WARN([Defaulting to --with-poll since the OS is AIX 4.2 or later.]) 
      else :; fi 
    ;; 
  esac 
]) 
AC_ARG_WITH(max-fd,      [  --with-max-fd=X        set how many filedescriptors can be used at once],[pike_cv_max_open_fd=$withval],[]) 
AC_ARG_WITH(oob,         [  --with-oob             enable out-of-band data handling],[AC_DEFINE(WITH_OOB)],[]) 
AC_ARG_WITH(thread-trace,[  --without-thread-trace disable individual tracing of threads],[],[with_thread_trace=yes]) 
AC_ARG_WITH(compiler-trace,[  --with-compiler-trace  enable tracing of the compiler],[AC_DEFINE(YYDEBUG)],[]) 
AC_ARG_WITH(security,    [  --with-security        enable internal pike security system],[AC_DEFINE(PIKE_SECURITY)],[]) 
AC_ARG_WITH(bignums,     [  --without-bignums      disable internal conversion to bignums],[],[with_bignums=yes]) 
AC_ARG_WITH(shared-nodes,[  --without-shared-nodes disable the SHARED_NODES mode of the optimizer],[],[with_shared_nodes=yes]) 
 
# This makes configure default to --without-Perl 
# Remove this when the Perl module stops crashing and hanging. -Hubbe 
AC_ARG_WITH(perl,        [  --with-perl            enable the embedded Perl module (EXPERIMENTAL)],[], 
[ac_configure_args="$ac_configure_args --without-perl" 
 with_perl="no" 
] 
) 
 
if test "x$with_bignums" = xyes; then 
  AC_DEFINE(AUTO_BIGNUM) 
  if test "x$with_gmp" = xno; then 
    AC_MSG_ERROR([Cannot compile --with-bignums without the GMP library 
It is highly recommended that you install a working GMP 
library on your system as that will add features to Pike 
required by many applications.  (Such as Roxen) However, 
if you know that you do not need GMP, you may re-run configure 
with the option --without-bignums instead. 
]) 
  else :; fi 
else :; fi 
 
if test "x$with_shared_nodes" != xno; then 
  AC_MSG_WARN([Enabling the SHARED_NODES mode of the optimizer.]) 
  AC_MSG_WARN([Note that this is EXPERIMENTAL.]) 
  AC_DEFINE(SHARED_NODES) 
else :; fi 
 
if test "x$with_poll" = "xyes"; then 
  AC_DEFINE(HAVE_AND_USE_POLL) 
else :; fi 
 
if test "x$with_checker" = "xyes"; then 
  AC_DEFINE(__CHECKER__) 
else :; fi 
 
if test "x$with_thread_trace" = "xyes"; then 
  AC_DEFINE(THREAD_TRACE) 
else :; fi 
 
# 
# Allow --with(out)-debug to toggle both cdebug and rtldebug, but 
# let --with(out)-{c,rtl}debug take precedence. 
# 
if test "x$with_cdebug" = x ; then 
  with_cdebug="$with_debug" 
fi 
 
if test "x$with_rtldebug" = x ; then 
  with_rtldebug="$with_debug" 
fi 
 
 
# 
# Defaults for cdebug and rtldebug here: 
# 
 
if test "x$with_cdebug" = x ; then 
  with_cdebug=yes 
fi 
 
if test "x$with_rtldebug" = x ; then 
  with_rtldebug=yes 
fi 
 
if test "x$with_rtldebug" = xyes ; then 
  AC_DEFINE(PIKE_DEBUG) 
fi 
 
############################################################################# 
 
 
WARN="" 
OPTIMIZE="" 
 
if test $cflags_is_set = no; then 
  if test "x$with_cdebug" = "xno" ; then 
    CFLAGS=`echo " $CFLAGS " | sed -e 's@ -g @ @g'` 
  else 
    : 
  fi 
 
 
 if test "x${GCC-}" = xyes ; then 
  WARN="-W -Wall -Wpointer-arith -Wno-unused" 
 
  if test "x${with_static_linking-}" = "xyes" ; then 
    AC_SYS_COMPILER_FLAG(-static,link_static,CFLAGS) 
  else 
    : 
  fi 
 
  ## 
  ## -fomit-frame-pointer does not work with egcs 1.1.1 
  ## /Hubbe 1998-12-20 
  ## 
  #if test "x$with_cdebug" = "xno" ; then 
  #  AC_SYS_COMPILER_FLAG(-fomit-frame-pointer,fomit_frame_pointer,OPTIMIZE) 
  #else 
  #  : 
  #fi   
 
### Optimize for different SUN machines. If there is no working 'uname' 
### no extra optimization will be done, but nothing should break either. 
  case "`uname -m 2>/dev/null`" in 
   sun4c) 
    # The -sparclite option seems to generate assembler that /bin/as doesn't 
    # understand.       /grubba 1998-07-17 
    # AC_SYS_COMPILER_FLAG(-msparclite,sparclite,OPTIMIZE)  
   ;; 
   sun4m) 
    AC_SYS_COMPILER_FLAG(-mv8,microsparc,OPTIMIZE) 
   ;; 
   sun4d) 
    AC_SYS_COMPILER_FLAG(-msupersparc,supersparc,OPTIMIZE) 
   ;; 
   sun4u) 
    # FIXME: Optimize for V9 
    AC_SYS_COMPILER_FLAG(-msupersparc,ultrasparc,OPTIMIZE) 
   ;; 
   i586) 
    AC_SYS_COMPILER_FLAG(-mpentium,pentium,OPTIMIZE) 
   ;; 
   i686) 
    AC_SYS_COMPILER_FLAG(-mpentiumpro,pentiumpro,OPTIMIZE,[ 
       AC_SYS_COMPILER_FLAG(-mpentium,pentium,OPTIMIZE) 
    ]) 
   ;; 
  esac 
 
  # AIX 
  DO_IF_OS(AIX, 
  [ 
    # Tell the linker to generate a large toc if needed 
    AC_SYS_COMPILER_FLAG(-bbigtoc,bbigtoc,LDFLAGS) 
    AC_SYS_COMPILER_FLAG([-Wl,-bbigtoc],Wlbbigtoc,LDFLAGS) 
  ]) 
 
 else if test "x${TCC-}" = xyes ; then 
 
  # Yikes! We're using the TenDRA compiler! 
 
  # Make sure we can use the system headerfiles... 
  AC_SYS_COMPILER_FLAG(-Ysystem, ysystem, CFLAGS) 
 
  # Use lenient ANSI compliance... 
  AC_SYS_COMPILER_FLAG(-Xa, xa, CFLAGS) 
 
  # Find out where libtdf.a is hidden. 
  AC_MSG_CHECKING(for machine dependant library directory) 
  AC_CACHE_VAL(pike_cv_tcc_lib_path, 
  [ 
    pike_cv_tcc_lib_path="`${CC-cc} -dry conftest.c -i 2>&1 | sed -e '/tdfc/s/bin\/tdfc.*/lib\/sys/p' -ed| head -1`" 
    if test -d "$pike_cv_tcc_lib_path/." ; then :; else 
      # Failed. 
      pike_cv_tcc_lib_path="no" 
    fi 
  ]) 
  AC_MSG_RESULT($pike_cv_tcc_lib_path) 
 
  if test "$pike_cv_tcc_lib_path" = "no" ; then :; else 
    LDFLAGS="$LDFLAGS -L$pike_cv_tcc_lib_path" 
 
    # This library is needed for 64bit support on 32bit machines/OS's. 
    AC_CHECK_LIB(tdf, __TDFUnot) 
  fi 
 
 else 
 
  # Assume system compiler "cc". 
 
  if test "x${with_static_linking-}" = "xyes" ; then 
    DO_IF_OS(AIX, 
    [ 
      AC_SYS_COMPILER_FLAG([-Wl,-bstatic],wl_link_static,CFLAGS) 
      LD_FALLBACK_FLAGS="${LD_FALLBACK_FLAGS} -bstatic" 
    ]) 
 
    DO_IF_OS(OSF1, 
    [ 
      AC_SYS_COMPILER_FLAG(-non_shared,non_shared,CFLAGS) 
      LD_FALLBACK_FLAGS="${LD_FALLBACK_FLAGS} -non_shared" 
    ]) 
 
    DO_IF_OS(IRIX, 
    [ 
      AC_SYS_COMPILER_FLAG(-non_shared,non_shared,CFLAGS) 
      LD_FALLBACK_FLAGS="${LD_FALLBACK_FLAGS} -B static" 
    ]) 
 
    # how do you link statically on HP-UX ? 
  else 
    : 
  fi 
 
### Non-gcc thingies. This should probably be enhanced... 
 
  # Solaris 
  DO_IF_OS(Solaris, 
  [ 
    AC_SYS_COMPILER_FLAG(-fast,fast,OPTIMIZE) 
    AC_SYS_COMPILER_FLAG(-xdepend,xdepend,OPTIMIZE) 
    AC_SYS_COMPILER_FLAG(-xs,xs,CFLAGS) 
    # Causes __STDC__ to be 1 which causes several headerfiles to behave 
    # differently. 
    # AC_SYS_OS_COMPILER_FLAG(-Xc,Xc,WARN) 
  ]) 
 
  # AIX 
  DO_IF_OS(AIX, 
  [ 
    # This one is needed to get the compiler to fail on errors, 
    # which is needed for several configure-scripts. 
    AC_SYS_COMPILER_FLAG(-qhalt=e,qhalt_e,CFLAGS) 
    AC_SYS_COMPILER_FLAG(-qro,qro,OPTIMIZE) 
    # Tell the linker to generate a large toc if needed 
    AC_SYS_COMPILER_FLAG(-bbigtoc,bbigtoc,LDFLAGS) 
  ]) 
 
  # HP-UX 
  DO_IF_OS(HP-UX, 
  [ 
    AC_SYS_COMPILER_FLAG(-D__STDC_EXT__,stdc_ext,CFLAGS) 
    AC_SYS_COMPILER_FLAG([-Wp,-H50000],cpp_buffer_size,CFLAGS) 
    AC_SYS_COMPILER_FLAG(+ESlit,plus_ESlit,OPTIMIZE) 
    AC_SYS_COMPILER_FLAG(+Odataprefetch,plus_Odataprefetch,OPTIMIZE) 
    AC_SYS_COMPILER_FLAG(+Ofailsafe,plus_Ofailsafe,OPTIMIZE) 
    AC_SYS_COMPILER_FLAG(+O3,plus_O3,OPTIMIZE) 
    # Ignore the following warnings if you enable +w1 
    #   414 Optimization reduced to +O2 for compatibility with Debug. 
    #   530 Casting from loose to strict alignment 
    #   558 Empty declaration. 
    # AC_SYS_COMPILER_FLAG(+w1,plus_w1,WARN) 
  ]) 
 
  # OSF/1 
  DO_IF_OS(OSF1, 
  [ 
    AC_SYS_COMPILER_FLAG(-fast,fast,OPTIMIZE) 
    # The need for -ieee is not detected properly by the FPE tests below. 
    # AC_SYS_COMPILER_FLAG(-ieee,ieee,CFLAGS) 
    AC_SYS_COMPILER_FLAG(-readonly_strings,readonly_strings,OPTIMIZE) 
    AC_SYS_COMPILER_FLAG(-assume trusted_short_alignment, 
      assume_trusted_short_alignment,OPTIMIZE) 
    AC_SYS_COMPILER_FLAG(-assume aligned_objects, 
      assume_aligned_objects,OPTIMIZE) 
    AC_SYS_COMPILER_FLAG(-no_misalign,no_misalign,OPTIMIZE) 
   
    if test "x$with_cdebug" = "xyes" ; then 
      # FIXME: 
      # Maybe should remove the -g flag if this succeeds. 
      AC_SYS_COMPILER_FLAG(-g3,g3,OPTIMIZE) 
      AC_SYS_COMPILER_FLAG(-trapuv,trapuv,WARN) 
    fi 
    AC_SYS_COMPILER_FLAG(-host,host,OPTIMIZE) 
 
    # Flags that cause errors or change compiler behaviour 
    # must go in CFLAGS, they can not go in WARN 
    # /Hubbe 
    AC_SYS_COMPILER_FLAG(-std1,std1,CFLAGS) 
    AC_SYS_COMPILER_FLAG(-warnprotos,warnprotos,WARN) 
  ]) 
 
  # IRIX 
  DO_IF_OS(IRIX, 
  [ 
    # sopt disabled since it takes too long time on interpret.c (>45min on an O²) 
    # AC_SYS_COMPILER_FLAG(-sopt,sopt,OPTIMIZE) 
 
    # -n32 moved to smartlink so it will affekt cc as well as linker 
    # this way the user can override it by setting LDFLAGS and/or CFLAGS 
    # AC_SYS_COMPILER_FLAG(-n32,n32,CFLAGS) 
    AC_SYS_COMPILER_FLAG(-fullwarn,fullwarn,WARN) 
    AC_SYS_COMPILER_FLAG(-woff 1209,woff_1209,WARN) 
    if test x$with_cdebug = xyes ; then 
      AC_SYS_COMPILER_FLAG(-g3,g3,OPTIMIZE) 
    fi 
    if test x$with_rtldebug = xyes ; then 
      AC_SYS_COMPILER_FLAG(-trapuw,trapuw,WARN) 
    fi 
  ]) 
 
  # Windows NT 
  DO_IF_OS(Windows_NT, 
  [ 
    # FIXME: The test below probably doesn't work. 
    if test "x$CC" = "xecl"; then 
      # Some options used by ecl (Intel's IA64 compiler). 
 
      # We want threads, and link libc statically. 
      AC_SYS_COMPILER_FLAG(-MT,MT,LDFLAGS) 
 
      # Interprocedural optimizations. 
      AC_SYS_COMPILER_FLAG(-Qip,Qip,OPTIMIZE) 
 
      # More warnings. 
      AC_SYS_COMPILER_FLAG(-W4,W3,WARN) 
 
      if test x$with_rtldebug = xyes ; then 
        # Initialize auto variables to 0xcc. 
        # (Only if optimizations are turned off with -Od). 
        AC_SYS_COMPILER_FLAG(-GZ,GZ,WARN) 
      fi 
    else :; fi 
  ]) 
 
dnl 
dnl This does not work with Digital UNIX cc/ld (cc thinks it is ok, ld does not) 
dnl   
dnl AC_SYS_COMPILER_FLAG(-native,native,OPTIMIZE) 
dnl 
 
dnl ### Ok. This is for apcc... 
case "$CC" in 
  *apcc) 
    AC_SYS_COMPILER_FLAG(-XO=5,apcc_opt,OPTIMIZE) 
    AC_SYS_COMPILER_FLAG(-Xcallmod=2,apcc_opt_2,OPTIMIZE) 
  ;; 
esac 
 
# Old cc for solaris. 
#  AC_SYS_CPU_COMPILER_FLAG(sun4m,-Xpipe=micro,microsparc,OPTIMIZE) 
#  AC_SYS_CPU_COMPILER_FLAG(sun4d,-Xpipe=super,supersparc,OPTIMIZE) 
#  AC_SYS_CPU_COMPILER_FLAG(sun4u,-Xpipe=super,ultrasparc,OPTIMIZE) 
 
  case "${CFLAGS-} $OPTIMIZE" in 
    *-O*) ;; 
    *+O*) ;; 
    *-fast*) ;; 
    *) 
      case "$pike_cv_sys_os:$GCC" in 
        UnixWare*:no) 
          OPTIMIZE="" 
        ;; 
        *) 
          AC_SYS_COMPILER_FLAG(-O2,O2,OPTIMIZE) 
          if test "x$pike_cv_option_O2" != "xyes"; then 
            AC_SYS_COMPILER_FLAG(-O,O,OPTIMIZE) 
          fi 
        ;; 
      esac 
    ;; 
  esac 
 fi 
 fi 
fi 
 
 
 
if test "$GCC" = "yes"; then 
  if test $cflags_is_set = no; then 
    AC_SYS_COMPILER_FLAG(-pipe, pipe, CFLAGS) 
  fi 
else 
# 
# Special hack for HP-UX stupid cc 
# 
  if test "$pike_cv_sys_os" = "HP-UX"; then 
    AC_TRY_COMPILE([int foo(int bar);],[],[], 
    [ 
      OLD_CC="${CC-cc}" 
      OLD_CFLAGS="$CFLAGS" 
      case "/$CC" in 
        */smartlink\ cc) 
           if test -x /usr/bin/cc; then 
             CC="$SMARTLINK /usr/bin/cc" 
           else 
             : ; 
           fi 
        ;; 
      esac 
      CFLAGS="-Ae +Olibcalls $CFLAGS" 
      AC_TRY_COMPILE([int foo(int bar);],[],[],[ 
        CC="$OLD_CC" 
        CFLAGS="$OLD_CFLAGS" 
      ]) 
      pike_cv_prog_CC="${CC}" 
    ]) 
  fi 
fi 
 
if test "$pike_cv_sys_os" = "Solaris" ; then 
  AC_DEFINE(SOLARIS) 
else 
  : 
fi 
 
if test ! -d modules/. ; then 
  mkdir modules 
fi 
 
############################################################################# 
 
## Search for some popular places where libraries may be hidden. 
 
############################################################################# 
 
if test x$"pike_cv_sys_os" != xWindows_NT ; then 
 
echo Searching for include-file directories... 
 
if test $cppflags_is_set = no -a x${C_INCLUDE_PATH-} = x ; then 
  real_include_dirs='' 
  for d in `echo ${with_include_path} | sed 's/:/ /g'` \ 
    `echo $prefix | sed "s@^NONE@$ac_default_prefix@g"`/include \ 
    /usr/local/include /sw/local/include /usr/gnu/include /opt/gnu/include \ 
    /sw/gnu/include /sw/include /usr/freeware/include /usr/pkg/include \ 
    `echo /usr/X11*/include | sort -r` $srcdir `pwd` 
  do 
    AC_MSG_CHECKING($d) 
    case x$d in 
      x/usr/include | x/usr//include) 
      ;; 
      *) 
        if test -d "$d/." ; then 
          REALDIR="`cd $d/. ; /bin/pwd`" 
          if test "x$REALDIR" = x ; then 
            REALDIR=UNKNOWN 
          else 
            : 
          fi 
 
          case " $CPPFLAGS $real_include_dirs " in 
            *\ -I$d\ * | *\ -I$REALDIR\ *) 
               AC_MSG_RESULT(already added) 
            ;; 
            *) 
              AC_MSG_RESULT(added) 
              CPPFLAGS="${CPPFLAGS} -I$d" 
              if test "x$REALDIR" != xUNKNOWN; then 
                real_include_dirs="${real_include_dirs} -I$REALDIR" 
              else 
                : 
              fi 
            ;; 
          esac 
        else 
          AC_MSG_RESULT(no) 
        fi 
      ;; 
    esac 
  done 
else 
  : 
fi 
 
#CPPFLAGS="${CPPFLAGS} -I$srcdir -I`pwd`" 
 
echo Searching for library directories... 
if test $ldflags_is_set = no ; then 
  for d in `echo ${with_lib_path} | sed 's/:/ /g'` \ 
    `echo $exec_prefix | sed "s@^NONE@$prefix/lib@g" | sed "s@^NONE@$ac_default_prefix/lib@g"` \ 
    /usr/local/lib /sw/local/lib /sw/lib \ 
    /usr/gnu/lib /opt/gnu/lib /sw/gnu/lib /usr/freeware/lib /usr/pkg/lib \ 
    `echo /usr/X11*/lib | sort -r` 
  do 
    AC_MSG_CHECKING($d) 
    if test -d "$d/." ; then 
      case " $LDFLAGS " in 
        *\ -L$d\ -R$d\ * | *\ -R$d\ -L$d\ *) 
          AC_MSG_RESULT(already added) 
        ;; 
        *) 
          AC_MSG_RESULT(added) 
          LDFLAGS="${LDFLAGS} -R$d -L$d" 
        ;; 
      esac 
    else 
      AC_MSG_RESULT(no) 
    fi 
  done 
else 
  : 
fi 
 
echo Searching for binary directories... 
for d in `echo $exec_prefix | sed "s@^NONE@$prefix@g" | sed "s@^NONE@$ac_default_prefix@g"` \ 
    "" /usr /usr/ccs /usr/local /sw/local /usr/gnu /opt/gnu /sw/gnu \ 
    /sw /usr/freeware /usr/pkg 
do 
  AC_MSG_CHECKING($d/bin) 
  if test -d "$d/bin/." ; then 
    AC_MSG_RESULT(added) 
    EXTRA_PATH="${EXTRA_PATH}:$d/bin" 
  else 
    AC_MSG_RESULT(no) 
  fi 
done 
export EXTRA_PATH 
 
else 
  # We are running NT 
  CPPFLAGS="${CPPFLAGS} -I$srcdir -I`pwd`"   
fi 
 
############################################################################# 
 
## At this point we have at last initialized the compiler! 
 
############################################################################# 
 
if test ! -f confdefs.h ; then 
  AC_MSG_WARN([Warning, lost confdefs.h, testing will be flawed!! 
You might need to use bash instead of /bin/sh to get correct results. 
To do this, please type the following at an sh prompt: 
        \$ rm ./config.cache 
        \$ CONFIG_SHELL=/path/to/bash 
        \$ export CONFIG_SHELL 
        \$ $CONFIG_SHELL ./configure 
]) 
fi 
 
############################################################################# 
 
AC_DEFINE(POSIX_SOURCE) 
 
AC_MSG_CHECKING(ansi prototype capability) 
AC_CACHE_VAL(pike_cv_sys_ansi_prototypes, 
[ 
  AC_TRY_COMPILE([int foo(int bar);],[], 
  [pike_cv_sys_ansi_prototypes=yes], 
  [pike_cv_sys_ansi_prototypes=no]) 
]) 
 
if test "$pike_cv_sys_ansi_prototypes" = "yes"; then 
  AC_MSG_RESULT(yes) 
else 
  AC_MSG_RESULT(no, giving up...) 
  exit 1 
fi 
 
 
############################################################################# 
 
# The AC_PROG_INSTALL test is broken if $INSTALL is specified by hand. 
# The FreeBSD ports system does this... 
# Workaround: 
 
if test "x$INSTALL" = "x"; then :; else 
  # $INSTALL overrides ac_cv_path_install anyway... 
  ac_cv_path_install="$INSTALL" 
fi 
 
AC_PROG_INSTALL 
AC_PROG_CPP 
AC_PROG_RANLIB 
AC_SET_MAKE 
 
AC_PATH_PROG(AR, ar, ar, $PATH:$EXTRA_PATH) 
export AR 
AC_SUBST(AR) 
 
############################################################################# 
 
# installbsd seems to be broken on some versions of AIX 
# 
# /grubba 1997-08-16 
 
case "$ac_cv_path_install" in 
  *installbsd*) 
    AC_MSG_CHECKING(if $ac_cv_path_install works) 
    AC_CACHE_VAL(pike_cv_install_works, 
[ 
    if $ac_cv_path_install "$srcdir/configure.in" ./conftest >/dev/null 2>&1 
    then 
      if cmp "$srcdir/configure.in" ./conftest >/dev/null 2>&1; then 
        pike_cv_install_works=yes; 
      else 
        pike_cv_install_works=no; 
      fi 
    else 
      pike_cv_install_works=no; 
    fi 
    if test -f ./conftest; then 
      rm -f ./conftest 
    fi 
]) 
    AC_MSG_RESULT($pike_cv_install_works) 
    if test "$pike_cv_install_works" = "no"; then 
      echo "Warning: Falling back to $ac_install_sh" 
      INSTALL="$ac_install_sh" 
    fi 
  ;; 
esac 
 
############################################################################# 
 
AC_MSG_CHECKING(for yacc clone that handles %pure_parser) 
AC_CACHE_VAL(pike_cv_prog_working_yacc, 
[ 
for YACC in pyacc byacc "bison -y" yacc "None"; do 
  set dummy $YACC; ac_word=$2 
  has_it=no 
  IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:" 
  for ac_dir in $PATH; do 
    test -z "$ac_dir" && ac_dir=. 
    if test -f $ac_dir/$ac_word; then 
      has_it="yes" 
      break 
    fi 
  done 
  IFS="$ac_save_ifs" 
   
  if test "$has_it" = "yes"; then 
cat >conftest.y<<\EOF 
%pure_parser 
%{ 
void parse(); 
void yyerror(char *); 
%} 
%% 
all: foo bar 
foo: 'f' 'o' 'o' { parse(); } ; 
bar: 'b' 'a' 'r' ; 
%% 
int context; 
 
int yylex(YYSTYPE *yylval) 
{ 
  switch(context++) 
  { 
    case 0: return 'f'; 
    case 1: return 'o'; 
    case 2: return 'o'; 
    case 3: return 'b'; 
    case 4: return 'a'; 
    case 5: return 'r'; 
    default: return 0; 
  } 
} 
 
int depth=0; 
void parse() 
{ 
  int tmp; 
  if(depth++>5) return; 
  tmp=context; 
  context=0; 
  yyparse(); 
  context=tmp; 
} 
int errors=0; 
void yyerror(char *fel) { errors++; } 
int main() 
{ 
  parse(); 
  exit(errors); 
} 
EOF 
    if $YACC -d conftest.y 1>&5 2>&5; then 
      AC_TRY_RUN([ 
#include "y.tab.c" 
],pure_parser_works=yes,pure_parser_works=no,pure_parser_works=no) 
      if test "$pure_parser_works" = "yes"; then 
        break 
      fi 
    fi 
  fi 
done 
pike_cv_prog_working_yacc="$YACC" 
]) 
 
YACC="$pike_cv_prog_working_yacc" 
 
if test "x$YACC" = "xNone" ; then 
  AC_MSG_RESULT('Get bison if you want to do "make export"') 
  YACC="bison -y" 
else 
  AC_MSG_RESULT($YACC) 
fi 
 
############################################################################# 
 
## At this point we have found all binaries we are going to use. 
 
############################################################################# 
 
AC_C_CONST 
 
# The above doesn't find IBM C's buggy const. 
 
if test "$ac_cv_c_const" = "yes"; then 
  AC_MSG_CHECKING(if const really does work) 
  AC_CACHE_VAL(pike_cv_c_really_const,[ 
    AC_TRY_COMPILE([ 
const int foo(int bar) { return bar; } 
    ], [ 
      return bar(0); 
    ], [ 
       pike_cv_c_really_const=yes 
    ], [ 
       pike_cv_c_really_const=no 
    ]) 
  ]) 
 
  AC_MSG_RESULT($pike_cv_c_really_const) 
  if test "x$pike_cv_c_really_const" = xno ; then 
    AC_DEFINE(const, []) 
  else 
    : 
  fi 
fi 
 
AC_MSG_CHECKING(if we can cast void * to a function pointer) 
AC_CACHE_VAL(pike_cv_function_cast, [ 
  AC_TRY_COMPILE([ 
    void *foo = 0; 
  ],[ 
    void (*bar)(void) = (void (*)(void)) foo; 
  ],[ pike_cv_function_cast="yes" ], [ pike_cv_function_cast="no" ]) 
]) 
if test "$pike_cv_function_cast" = "yes"; then 
  AC_MSG_RESULT(yes) 
else 
  AC_MSG_RESULT(no) 
  AC_DEFINE(NO_CAST_TO_FUN) 
fi 
 
############################################################################# 
 
AC_HEADER_TIME 
AC_HEADER_STDC 
AC_CHECK_HEADERS(sys/rusage.h time.h sys/time.h sys/types.h unistd.h stdlib.h \ 
memory.h values.h string.h strings.h fcntl.h sys/filio.h sys/sockio.h crypt.h \ 
locale.h sys/resource.h sys/select.h sys/mman.h setjmp.h limits.h pthread.h \ 
thread.h dlfcn.h dld.h dl.h sys/times.h sched.h sys/procfs.h sys/param.h \ 
winsock.h sys/ioct.h sys/socket.h malloc.h netinet/in.h sys/wait.h winbase.h \ 
grp.h pwd.h passwd.h group.h winsock2.h signal.h sys/file.h poll.h sys/poll.h \ 
socket.h ieeefp.h fp_class.h floatingpoint.h  sys/priocntl.h sched.h \ 
windows.h errno.h stddef.h mmx.h) 
 
AC_CHECK_SIZEOF(char *,4) 
AC_CHECK_SIZEOF(int,4) 
AC_CHECK_SIZEOF(short,2) 
AC_CHECK_SIZEOF(float,4) 
AC_CHECK_SIZEOF(double,8) 
AC_CHECK_SIZEOF(long,4) 
AC_CHECK_SIZEOF(long long,0) 
AC_CHECK_SIZEOF(__int64,0) 
 
AC_MY_CHECK_TYPE(size_t,long) 
AC_MY_CHECK_TYPE(off_t,long) 
AC_MY_CHECK_TYPE(pid_t,int) 
AC_MY_CHECK_TYPE(uid_t,int) 
AC_MY_CHECK_TYPE(gid_t,int) 
AC_MY_CHECK_TYPE(time_t,INT32) 
AC_MY_CHECK_TYPE(pri_t, short) 
 
AC_TYPE_SIGNAL 
 
dnl AC_CHECK_LIB(PW, alloca) 
 
AC_CHECK_LIB(m, floor) 
 
AC_CHECK_LIB(socket, socket) 
 
if test x"$pike_cv_sys_os" = xWindows_NT ; then 
  LIBS="-lkernel32 -lws2_32 -ladvapi32 $LIBS" 
fi 
 
AC_CHECK_LIB(nsl, gethostbyname) 
AC_CHECK_LIB(rt, nanosleep) 
 
AC_CHECK_LIB(dl, dlopen) 
AC_CHECK_LIB(dld, shl_load) 
AC_CHECK_LIB(dld, dld_link) 
 
 
if test "${pike_cv_sys_os}" = "Linux"; then 
  if test "${ac_cv_lib_m_floor}" = "no"; then 
    AC_MSG_WARN(I will compensate for this by adding -lc -lm) 
    LIBS="${LIBS} -lc -lm" 
  fi 
 
  if test "$ac_cv_header_sched_h" = "yes"; then 
    AC_MSG_CHECKING(if sched.h has a typo) 
    AC_CACHE_VAL(pike_cv_broken_sched_h, [ 
      AC_TRY_COMPILE([ 
#include <sched.h> 
      ],[ ],[ pike_cv_broken_shed_h=no ], [ 
        OLDCPPFLAGS="$CPPFLAGS" 
        CPPFLAGS="$CPPFLAGS -D_P=__P" 
        AC_TRY_COMPILE([ 
#include <sched.h> 
        ],[ ],[ pike_cv_broken_sched_h=yes ],[ 
          pike_cv_broken_sched_h="very broken" 
        ]) 
        CPPFLAGS="$OLDCPPFLAGS" 
      ]) 
    ]) 
    AC_MSG_RESULT($pike_cv_broken_sched_h) 
    if test "$pike_cv_broken_sched_h" = "yes"; then 
      AC_MSG_WARN(Applying workaround) 
      CPPFLAGS="$CPPFLAGS -D_P=__P" 
    fi 
  fi 
fi 
 
######################################################################## 
 
if test x$with_threads = xyes ; then 
  OLDLIBS="$LIBS" 
  OLDCFLAGS="$CFLAGS" 
 
if test "x$pike_cv_sys_os" = "xWindows_NT" ; then 
  # NT has threads... 
 
  AC_DEFINE(_REENTRANT) 
  AC_DEFINE(_THREAD_SAFE) 
  AC_DEFINE(_UNIX_THREADS) 
  AC_DEFINE(NT_THREADS) 
  AC_DEFINE(PIKE_THREADS) 
 
else 
 
  # Test for POSIX threads 
 
  case "x$pike_cv_sys_os" in 
    xOSF1*) 
#      LIBS="${OLDLIBS} -lpthread -lmach -lexc -lc" 
      LIBS="${OLDLIBS} -lpthread -lmach -lexc" 
    ;; 
  
    xBSD/OS*) 
      LIBS="${OLDLIBS}" 
    ;; 
 
    xUnixWare*) 
      if test "$GCC" = yes ; then 
        CFLAGS="${CFLAGS} -pthread" 
      else 
        CFLAGS="${CFLAGS} -Kthread" 
      fi 
    ;; 
 
    xFreeBSD*)       
      # Threads on FreeBSD earlier than 1998-06-07 are broken. 
      LIBS="${OLDLIBS}" 
      AC_MSG_CHECKING(if this version of FreeBSD may have working threads) 
      AC_CACHE_VAL(pike_cv_freebsd_threads, [ 
        AC_TRY_RUN([ 
#include <osreldate.h> 
 
int main(int argc, char **argv) 
{ 
  /* FreeBSD before 228000 and 300000 - 300005 have broken threads. 
   */ 
  if (__FreeBSD_version < 228000) 
    return(1); 
  if (__FreeBSD_version < 300000) 
    return(0); 
  if (__FreeBSD_version < 300006) 
    return(1); 
  return(0); 
} 
        ], pike_cv_freebsd_threads=yes, pike_cv_freebsd_threads=no, 
        pike_cv_freebsd_threads=yes) 
      ]) 
      if test "x$pike_cv_freebsd_threads" = "xno"; then 
        AC_MSG_RESULT(no) 
      else 
        AC_MSG_RESULT(yes) 
 
        AC_PATH_PROG(PTHREAD_CONFIG,pthread-config,no) 
        if test "x$PTHREAD_CONFIG" = xno ; then 
          CFLAGS="${CFLAGS} -pthread" 
          LD_FALLBACK_FLAGS="${LD_FALLBACK_FLAGS-} -lc_r" 
 
          AC_MSG_CHECKING(Initial stack limit) 
          AC_CACHE_VAL(pike_cv_initial_stack_size,[ 
          AC_TRY_RUN([ 
#include <stdio.h> 
 
static int depth=0; 
FILE *f; 
 
void save_depth(void); 
 
void use_stack(void *page) 
{ 
  void *X[8190]; 
  X[0]=page; 
  save_depth(); 
  use_stack(&X); 
} 
 
void save_depth(void) 
{ 
  depth+=sizeof(void *)*8192; 
  fprintf(f,"%d\n",depth); 
  fflush(f); 
  if(depth>0x80000000) exit(0); 
} 
 
int main(int argc) 
{ 
  f=fopen("confdefs.out.2","w"); /* weird filename to circumvent configure weirdness */ 
  save_depth(); 
  use_stack(0); 
} 
], 
pike_cv_initial_stack_size='', 
while read x; do pike_cv_initial_stack_size=$x ; done <confdefs.out.2) 
rm confdefs.out.2 >/dev/null 2>/dev/null || : 
]) 
          if test x$pike_cv_initial_stack_size = x ; then 
             AC_MSG_RESULT(unlimited) 
          else 
             AC_MSG_RESULT($pike_cv_initial_stack_size) 
             AC_DEFINE_UNQUOTED(Pike_INITIAL_STACK_SIZE,$pike_cv_initial_stack_size) 
          fi 
 
        else 
          CFLAGS="$CFLAGS `pthread-config --cflags`" 
          LIBS="$LIBS `pthread-config --libs`" 
          LDFLAGS="$CFLAGS `pthread-config --ldflags`" 
        fi 
      fi 
    ;; 
 
    xAIX*) 
      LIBS="${OLDLIBS} -lpthreads -lc_r" 
    ;; 
 
    *) 
      LIBS="${OLDLIBS} -lpthread" 
    ;; 
  esac 
 
  AC_CHECK_FUNCS(pthread_init) 
  AC_CHECK_FUNCS(pthread_mutexattr_init) 
 
  AC_MSG_CHECKING(posix threads) 
 
  AC_CACHE_VAL(pike_cv_posix_threads, [ 
    AC_TRY_RUN([ 
#define _REENTRANT 
#define _THREAD_SAFE 
#define _MIT_POSIX_THREADS 1 
 
#include <pthread.h> 
 
void *foo(void *bar) { pthread_exit(0); return 0; } 
pthread_mutexattr_t attr; 
pthread_mutex_t tmp; 
pthread_t gazonk; 
 
int main() 
{ 
  void *sune; 
#ifdef HAVE_PTHREAD_INIT 
  pthread_init(); 
#endif /* HAVE_PTHREAD_INIT */ 
#ifdef HAVE_PTHREAD_MUTEXATTR_INIT 
  pthread_mutexattr_init(&attr); 
#else 
  memset(&attr, 0, sizeof(attr)); 
#endif /* HAVE_PTHREAD_MUTEXATTR_INIT */ 
  pthread_mutex_init(&tmp, &attr); 
  pthread_mutex_lock(&tmp); 
  pthread_create(&gazonk,0,foo,0); 
  pthread_join(gazonk,&sune); 
  exit(0); 
} 
    ],pike_cv_posix_threads=yes,pike_cv_posix_threads=no,pike_cv_posix_threads=no) 
  ]) 
 
  if test $pike_cv_posix_threads = yes ; then 
    AC_MSG_RESULT(yes) 
    AC_DEFINE(_REENTRANT) 
    AC_DEFINE(_THREAD_SAFE) 
    AC_DEFINE(_MIT_POSIX_THREADS,1) 
    AC_DEFINE(PIKE_THREADS) 
 
########################################################################## 
 
    AC_MSG_CHECKING(for pthread_attr_setstacksize) 
    AC_CACHE_VAL(pike_cv_have_pthread_attr_setstacksize,[ 
      AC_TRY_LINK([#include <pthread.h> 
        void foo(pthread_attr_t*x) { pthread_attr_setstacksize(x, 1024*1024); } 
      ],[],[ 
        pike_cv_have_pthread_attr_setstacksize=yes 
      ],[ 
        pike_cv_have_pthread_attr_setstacksize=no 
      ]) 
    ]) 
    AC_MSG_RESULT($pike_cv_have_pthread_attr_setstacksize) 
    if test x$pike_cv_have_pthread_attr_setstacksize = xyes ; then 
      AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE) 
    else 
      : 
    fi 
 
########################################################################## 
 
    AC_MSG_CHECKING(for pthread_atfork) 
    AC_CACHE_VAL(pike_cv_have_pthread_atfork,[ 
      AC_TRY_LINK([#include <pthread.h> 
        void foo(void) { pthread_atfork(0,0,0); } 
      ],[],[ 
        pike_cv_have_pthread_atfork=yes 
      ],[ 
        pike_cv_have_pthread_atfork=no 
      ]) 
    ]) 
    if test x$pike_cv_have_pthread_atfork = xyes ; then 
      AC_MSG_RESULT(yes) 
      AC_DEFINE(HAVE_PTHREAD_ATFORK) 
    else 
      AC_MSG_RESULT([no - FreeBSD?]) 
    fi 
 
########################################################################## 
 
    AC_MSG_CHECKING(for pthread_yield) 
    AC_CACHE_VAL(pike_cv_have_pthread_yield,[ 
      AC_TRY_LINK([#include <pthread.h> 
        void foo(void) { pthread_yield(); } 
      ],[],[ 
        pike_cv_have_pthread_yield=yes 
      ],[ 
        pike_cv_have_pthread_yield=no 
      ]) 
    ]) 
    AC_MSG_RESULT($pike_cv_have_pthread_yield) 
    if test x$pike_cv_have_pthread_yield = xyes ; then 
      AC_DEFINE(HAVE_PTHREAD_YIELD) 
    else 
      : 
    fi 
 
########################################################################## 
 
    AC_MSG_CHECKING(for pthread_cond_init) 
    AC_CACHE_VAL(pike_cv_have_pthread_cond_init,[ 
      AC_TRY_LINK([#include <pthread.h> 
        void foo(pthread_cond_t*x, pthread_condattr_t*y) { pthread_cond_init(x,y); } 
      ],[],[ 
        pike_cv_have_pthread_cond_init=yes 
      ],[ 
        pike_cv_have_pthread_cond_init=no 
      ]) 
    ]) 
    AC_MSG_RESULT($pike_cv_have_pthread_cond_init) 
    if test x$pike_cv_have_pthread_cond_init = xyes ; then 
      AC_DEFINE(HAVE_PTHREAD_COND_INIT) 
    else 
      : 
    fi 
 
########################################################################## 
 
    AC_MSG_CHECKING(if pthread_condattr_default is defined) 
    AC_CACHE_VAL(pike_cv_have_pthread_condattr_default,[ 
      AC_TRY_LINK([#include <pthread.h> 
        void foo(pthread_cond_t *bar) { pthread_cond_init(bar, pthread_condattr_default); } 
      ],[],[ 
        pike_cv_have_pthread_condattr_default=yes 
      ],[ 
        pike_cv_have_pthread_condattr_default=no 
      ]) 
    ]) 
 
    AC_MSG_RESULT($pike_cv_have_pthread_condattr_default) 
 
    if test x$pike_cv_have_pthread_condattr_default = xyes ; then 
      AC_DEFINE(HAVE_PTHREAD_CONDATTR_DEFAULT) 
    else 
      : 
    fi 
 
 
    # 
    # FreeBSD doesn't like the &, while AIX requires it... 
    # 
 
    AC_MSG_CHECKING(if pthread_condattr_default is needs an & (AIX)) 
    AC_CACHE_VAL(pike_cv_have_pthread_condattr_default_aix,[ 
      AC_TRY_LINK([#include <pthread.h> 
        void foo(pthread_cond_t *bar) { pthread_cond_init(bar, &pthread_condattr_default); } 
      ],[],[ 
        pike_cv_have_pthread_condattr_default_aix=yes 
      ],[ 
        pike_cv_have_pthread_condattr_default_aix=no 
      ]) 
    ]) 
 
    AC_MSG_RESULT($pike_cv_have_pthread_condattr_default_aix) 
 
    if test x$pike_cv_have_pthread_condattr_default_aix = xyes ; then 
      AC_DEFINE(HAVE_PTHREAD_CONDATTR_DEFAULT_AIX) 
    else 
      : 
    fi 
 
########################################################################## 
 
    AC_MSG_CHECKING(for __pthread_initial_thread_bos) 
    AC_CACHE_VAL(pike_cv_have_pthread_initial_thread_bos,[ 
      AC_TRY_LINK([#include <pthread.h> 
        char *foo(void) { extern char *__pthread_initial_thread_bos;  
           return __pthread_initial_thread_bos; } 
      ],[],[ 
        pike_cv_have_pthread_initial_thread_bos=yes 
      ],[ 
        pike_cv_have_pthread_initial_thread_bos=no 
      ]) 
    ]) 
 
    AC_MSG_RESULT($pike_cv_have_pthread_initial_thread_bos) 
 
    if test x$pike_cv_have_pthread_initial_thread_bos = xyes ; then 
      AC_DEFINE(HAVE_PTHREAD_INITIAL_THREAD_BOS) 
    else 
      : 
    fi 
 
########################################################################## 
 
    # On Linux the threads don't inherit euid & egid from the main thread. 
    # FIXME: Add a real test here! 
    if test "x$pike_cv_sys_os" = "xLinux"; then 
      AC_DEFINE(HAVE_BROKEN_LINUX_THREAD_EUID) 
    else :; fi 
 
  else 
    AC_MSG_RESULT(no) 
    LIBS="$OLDLIBS" 
    CFLAGS="$OLDCFLAGS" 
 
    # No POSIX threads. 
 
    # Try UNIX threads instead 
 
    AC_MSG_CHECKING(unix threads) 
    case "x$pike_cv_sys_os" in 
      xUnixWare*) 
        if test "$GCC" = yes ; then 
          CFLAGS="${CFLAGS} -pthread" 
        else 
          CFLAGS="${CFLAGS} -Kthread" 
        fi 
        CFLAGS="${CFLAGS} -D_UNIXWARE_THREADS_" 
      ;; 
      *) 
        LIBS="${LIBS} -lthread" 
      ;; 
    esac 
   
    AC_CACHE_VAL(pike_cv_unix_threads, [ 
      AC_TRY_RUN([ 
#define _REENTRANT 
#define _THREAD_SAFE 
#define _MIT_POSIX_THREADS 1 
#include <thread.h> 
#ifdef _UNIXWARE_THREADS_ 
#include <synch.h> 
#endif 
 
void *foo(void *bar) { thr_exit(0); return 0; } 
mutex_t tmp; 
thread_t gazonk; 
 
int main() 
{ 
  void *sune; 
  mutex_lock(& tmp); 
  thr_create(0,0,foo,0,0,&gazonk); 
  thr_join(gazonk,0,&sune); 
  exit(0); 
} 
      ],pike_cv_unix_threads=yes,pike_cv_unix_threads=no,pike_cv_unix_threads=no) 
    ]) 
 
    if test x$pike_cv_unix_threads = xyes ; then 
      AC_MSG_RESULT(yes) 
      AC_DEFINE(_REENTRANT) 
      AC_DEFINE(_THREAD_SAFE) 
      AC_DEFINE(_UNIX_THREADS) 
      AC_DEFINE(PIKE_THREADS) 
    else 
      AC_MSG_RESULT(no) 
      LIBS="$OLDLIBS" 
      CFLAGS="$OLDCFLAGS" 
 
      # Now we've sunk really low -- test for proprietary threads 
 
      # SGI old-style shared group processes 
      # AC_CHECK_FUNCS(sproc oserror) 
      #  
      # AC_MSG_CHECKING(Fallback to sproc) 
      #  
      # if test x$ac_cv_func_sproc$ac_cv_func_oserror = xyesyes; then 
      #   AC_MSG_RESULT(yes) 
      #   AC_DEFINE(_REENTRANT) 
      #   AC_DEFINE(_THREAD_SAFE) 
      #   AC_DEFINE(_SGI_SPROC_THREADS) 
      #   AC_DEFINE(_SGI_MP_SOURCE) 
      # else 
      #   AC_MSG_RESULT(no) 
      #   : 
      # fi 
    fi # UNIX threads 
  fi # POSIX threads 
fi  # NT 
else 
  # Without threads 
  : 
fi 
 
######################################################################## 
 
AC_FUNC_MEMCMP 
 
if test "${OLD_LIBOBJS}" = "${LIBOBJS}" ; then 
  AC_DEFINE(HAVE_MEMCMP) 
fi 
 
LIBOBJS="${OLD_LIBOBJS}" 
 
AC_FUNC_MMAP 
 
AC_CHECK_FUNCS( \ 
 _crypt \ 
 poll \ 
 bcopy \ 
 bzero \ 
 clock \ 
 crypt \ 
 fchmod \ 
 gethrtime \ 
 gethrvtime \ 
 getenv \ 
 getrlimit \ 
 getrusage \ 
 gettimeofday \ 
 index \ 
 localtime \ 
 gmtime \ 
 memchr \ 
 mktime \ 
 perror \ 
 rindex \ 
 setlocale \ 
 setrlimit \ 
 setresuid \ 
 sigaction \ 
 sigblock \ 
 sigprocmask \ 
 sigvec \ 
 strcasecmp \ 
 strchr \ 
 strcspn \ 
 strerror \ 
 strrchr \ 
 strtod \ 
 strtok \ 
 strtol \ 
 time \ 
 times \ 
 vfprintf \ 
 vsprintf \ 
 vsnprintf \ 
 wait3 \ 
 wait4 \ 
 waitpid \ 
 munmap \ 
 shl_load \ 
 dld_link \ 
 dld_get_func \ 
 pipe \ 
 strdup \ 
 strstr \ 
 kill \ 
 alarm \ 
 fork1 \ 
 flock \ 
 lockf \ 
 setuid getuid seteuid geteuid \ 
 setgid getgid setegid getegid \ 
 getpwent getpwnam getpwuid \ 
 getgrent getgrnam \ 
 initgroups setgroups \ 
 socketpair \ 
 fpclass \ 
 fp_class_d \ 
 isinf \ 
 isnan \ 
 iszero \ 
 finite \ 
 signbit \ 
 nice \ 
 __priocntl \ 
 sched_setscheduler \ 
 setpriority \ 
 usleep \ 
 nanosleep \ 
) 
 
AC_MSG_CHECKING(if the last argument to accept is a size_t *) 
AC_CACHE_VAL(pike_cv_accept_size_t, [ 
  AC_TRY_COMPILE([ 
#ifndef _LARGEFILE_SOURCE 
#  define _FILE_OFFSET_BITS 64 
#  define _LARGEFILE_SOURCE 
#  define _LARGEFILE64_SOURCE 1 
#endif 
/* HPUX needs these too... */ 
#ifndef __STDC_EXT__ 
#  define __STDC_EXT__ 
#endif /* !__STDC_EXT__ */ 
 
#include <sys/types.h> 
#ifdef HAVE_UNISTD_H 
#include <unistd.h> 
#endif 
#ifdef HAVE_SYS_SOCKET_H 
#include <sys/socket.h> 
#endif 
 
/* NT */ 
#ifdef HAVE_WINSOCK_H 
#include <winsock.h> 
#endif 
 
/* Here's the actual test: */ 
int accept(int, struct sockaddr *, size_t *); 
  ], [ 
    /* EMPTY */ 
  ], pike_cv_accept_size_t=size_t, pike_cv_accept_size_t=int) 
]) 
AC_MSG_RESULT($pike_cv_accept_size_t) 
AC_DEFINE_UNQUOTED(ACCEPT_SIZE_T, $pike_cv_accept_size_t) 
 
if test x"$pike_cv_sys_os" = xWindows_NT ; then 
 AC_DEFINE(HAVE_LOADLIBRARY) 
 AC_DEFINE(HAVE_FREELIBRARY) 
 AC_DEFINE(HAVE_GETPROCADDRESS) 
 AC_DEFINE(DL_EXPORT, _dlspec(export)) 
else 
 AC_DEFINE(DL_EXPORT, []) 
fi 
 
if test $ac_cv_func_crypt$ac_cv_func__crypt = nono ; then 
  AC_CHECK_LIB(crypt,crypt,[LIBS="${LIBS} -lcrypt" ; AC_DEFINE(HAVE_CRYPT)], 
[ 
  if test -f "$srcdir/crypt.c"; then 
    AC_MSG_RESULT(Using crypt.c for BSD style crypt()) 
    EXTRA_OBJS="${EXTRA_OBJS} crypt.o" 
    AC_DEFINE(HAVE_CRYPT) 
  else 
    : 
  fi 
]) 
 
fi 
 
 
############################################################################# 
 
# FreeBSD 3.0 has broken F_SETFD when running with threads. 
 
AC_MSG_CHECKING(whether F_SETFD exists and works) 
 
AC_CACHE_VAL(pike_cv_broken_f_setfd, [ 
  AC_TRY_RUN([ 
#ifdef HAVE_SYS_TYPES_H 
#include <sys/types.h> 
#endif /* HAVE_SYS_TYPES_H */ 
#include <sys/stat.h> 
#ifdef HAVE_FCNTL_H 
#include <fcntl.h> 
#endif /* HAVE_FCNTL_H */ 
#include <stdio.h> 
#ifndef FD_CLOEXEC 
#define FD_CLOEXEC 1 
#endif /* FD_CLOEXEC */ 
int main(int argc, char **argv) 
{ 
  int fd = 0; 
  if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) { 
    exit(1); 
  } 
  if (fcntl(fd, F_GETFD) != FD_CLOEXEC) { 
    exit(1); 
  } 
  exit(0); 
} 
], pike_cv_broken_f_setfd=no, pike_cv_broken_f_setfd=yes, 
   pike_cv_broken_f_setfd=no) 
]) 
 
if test "x$pike_cv_broken_f_setfd" = "xyes"; then 
  AC_MSG_RESULT(no) 
  AC_DEFINE(HAVE_BROKEN_F_SETFD) 
else 
  AC_MSG_RESULT(yes) 
fi 
 
############################################################################# 
 
AC_STRUCT_TM 
 
############################################################################# 
 
AC_MSG_CHECKING(extern int timezone) 
 
AC_CACHE_VAL(pike_cv_has_external_timezone,[ 
AC_TRY_LINK([ 
#include <time.h> 
],[ 
  int _tz; 
  _tz=timezone; 
  timezone=_tz; 
],pike_cv_has_external_timezone=yes,pike_cv_has_external_timezone=no) 
]) 
 
if test "$pike_cv_has_external_timezone" = "yes"; then 
  AC_DEFINE(HAVE_EXTERNAL_TIMEZONE) 
fi 
 
AC_MSG_RESULT($pike_cv_has_external_timezone) 
 
############################################################################# 
 
# No test for this yet... 
AC_DEFINE(HAVE_STRUCT_TIMEVAL) 
 
############################################################################# 
 
if test "x$ac_cv_func_strtol" = "xyes"; then 
  AC_MSG_CHECKING(if strtol works for large hexadecimal constants) 
  AC_CACHE_VAL(pike_cv_func_strtol_works, [ 
    AC_TRY_RUN([ 
#include <stdlib.h> 
int main(int argc, char **argv) 
{ 
  /* On some OS's strtol() rounds this to 0x7fffffff. */ 
  return(strtol("0xffffffff", NULL, 0) != 0xffffffff); 
} 
    ], pike_cv_func_strtol_works=yes, 
       pike_cv_func_strtol_works=no, 
       pike_cv_func_strtol_works=no) 
  ]) 
  AC_MSG_RESULT($pike_cv_func_strtol_works) 
  if test "x$pike_cv_func_strtol_works" = "xyes"; then 
    AC_DEFINE(HAVE_WORKING_STRTOL) 
  else :; fi 
else :; fi 
 
############################################################################# 
 
AC_MSG_CHECKING(if gettimeofday takes two arguments) 
AC_CACHE_VAL(pike_cv_func_gettimeofday_has_two_args, 
[ 
AC_TRY_RUN([ 
#if TIME_WITH_SYS_TIME 
# include <sys/time.h> 
# include <time.h> 
#else 
# if HAVE_SYS_TIME_H 
#  include <sys/time.h> 
# else 
#  if HAVE_TIME_H 
#   include <time.h> 
#  endif 
# endif 
#endif 
 
#ifndef HAVE_STRUCT_TIMEVAL 
struct timeval 
{ 
  long tv_sec; 
  long tv_usec; 
}; 
#endif 
 
int main() { 
  struct timeval tv; 
  gettimeofday(&tv,(void *)0); 
  exit(0); 
} 
], 
pike_cv_func_gettimeofday_has_two_args=yes, 
pike_cv_func_gettimeofday_has_two_args=no, 
pike_cv_func_gettimeofday_has_two_args=no)]) 
 
if test $pike_cv_func_gettimeofday_has_two_args = yes; then 
  AC_DEFINE(GETTIMEOFDAY_TAKES_TWO_ARGS) 
fi 
 
AC_MSG_RESULT($pike_cv_func_gettimeofday_has_two_args) 
 
AC_MSG_CHECKING(if struct tm has tm_gmtoff) 
 
AC_CACHE_VAL(pike_cv_struct_tm_has_gmtoff,[ 
AC_TRY_COMPILE([ 
#ifdef TM_IN_SYS_TIME 
#include <sys/time.h> 
#else 
#include <time.h> 
#endif 
],[ 
  int _tz; 
  struct tm foo; 
  _tz=foo->tm_gmtoff; 
],pike_cv_struct_tm_has_gmtoff=yes,pike_cv_struct_tm_has_gmtoff=no) 
]) 
 
if test "$pike_cv_struct_tm_has_gmtoff" = "yes"; then 
  AC_DEFINE(STRUCT_TM_HAS_GMTOFF) 
fi 
 
AC_MSG_RESULT($pike_cv_struct_tm_has_gmtoff) 
 
AC_MSG_CHECKING(for USHRT_MAX definition) 
 
AC_CACHE_VAL(pike_cv_ushrt_max_is_defined,[ 
AC_EGREP_CPP(yes,[ 
#include <limits.h> 
#ifdef USHRT_MAX 
yes 
#endif 
],pike_cv_ushrt_max_is_defined=yes,pike_cv_ushrt_max_is_defined=no) 
]) 
 
if test "$pike_cv_ushrt_max_is_defined" = "no" ; then 
  AC_DEFINE(USHRT_MAX,65535) 
fi 
 
AC_MSG_RESULT($pike_cv_ushrt_max_is_defined) 
 
define(MY_CHECK_HEADERS, 
[ 
 AC_MSG_CHECKING(for $1 declaration) 
 AC_CACHE_VAL(pike_cv_decl_$1, 
 [ 
   pike_cv_decl_$1=nonexistant 
   for a in $2 
   do 
     AC_EGREP_HEADER($1,$a,[ pike_cv_decl_$1=existant; break ]) 
   done 
 ]) 
 AC_MSG_RESULT($pike_cv_decl_$1) 
 if test "$pike_cv_decl_$1" = nonexistant; then 
   AC_DEFINE(translit($1,[a-z],[A-Z])[]_DECL_MISSING) 
 fi 
]) 
 
MY_CHECK_HEADERS(strchr,string.h unistd.h stdlib.h) 
MY_CHECK_HEADERS(malloc,memory.h unistd.h stdlib.h) 
MY_CHECK_HEADERS(getpeername,sys/socket.h sys/socketvar.h sys/socketio.h winsock.h winsock2.h) 
MY_CHECK_HEADERS(popen,stdio.h unistd.h) 
MY_CHECK_HEADERS(getenv,unistd.h stdlib.h) 
MY_CHECK_HEADERS(gethostname,unistd.h netdb.h winsock.h winsock2.h) 
 
AC_ALLOCA 
 
AC_C_CONST 
AC_C_INLINE 
 
AC_CHECK_FUNCS(ualarm setitimer) 
 
if test "x$ac_cv_func_ualarm" = "xyes"; then 
  AC_MSG_CHECKING(no of arguments to ualarm) 
  AC_CACHE_VAL(pike_cv_ualarm_takes_two_args, 
  [ 
    AC_TRY_COMPILE([ 
#ifdef HAVE_UNISTD_H 
#include <unistd.h> 
#endif /* HAVE_UNISTD_H */ 
    ],[ 
      ualarm(0,0); 
    ],pike_cv_ualarm_takes_two_args=yes,pike_cv_ualarm_takes_two_args=no) 
  ]) 
  if test "$pike_cv_ualarm_takes_two_args" = yes; then 
    AC_MSG_RESULT(2) 
    AC_DEFINE(UALARM_TAKES_TWO_ARGS) 
  else 
    AC_MSG_RESULT(1) 
  fi 
fi 
 
OLD_LIBOBJS="${LIBOBJS}" 
 
######################################################################## 
AC_MSG_CHECKING(stack direction) 
AC_CACHE_VAL(pike_cv_hardware_stack_direction, 
[ 
AC_TRY_RUN([ 
#include <stdio.h> 
static int find_stack_direction(void *foo) 
{ 
  if (((void *)&foo) > foo) { 
    return 1; 
  } else { 
    return -1; 
  } 
} 
 
int main() { void *bar; exit( find_stack_direction(&bar) > 0); } 
],pike_cv_hardware_stack_direction=down,pike_cv_hardware_stack_direction=up) 
]) 
 
AC_MSG_RESULT($pike_cv_hardware_stack_direction) 
 
if grep STACK_DIRECTION confdefs.h >/dev/null 2>&1; then 
  : 
else 
  if test "x$pike_cv_hardware_stack_direction" = "xup" ; then 
    AC_DEFINE(STACK_DIRECTION, 1) 
  else 
    AC_DEFINE(STACK_DIRECTION, -1) 
  fi 
fi 
 
######################################################################## 
 
AC_MSG_CHECKING(byteorder) 
AC_CACHE_VAL(pike_cv_hardware_byteorder, 
[ 
AC_TRY_RUN([ 
#include <stdio.h> 
 
int main() 
{ 
#if SIZEOF_INT == 4 
#define T int 
#else 
#define T long 
#endif 
  FILE *f; 
  T a; 
  int e; 
  for(e=0;e<sizeof(T);e++) 
    ((char *)&a)[e]=(e+1) % 10; 
 
  f=fopen("conftest.out.2","w"); 
  for(e=0;e<sizeof(T);e++) 
  { 
    fprintf(f,"%d",(int)(a & 255)); 
    a>>=8; 
  } 
  fprintf(f,"\n"); 
  fclose(f); 
   
  return 0; 
}], 
pike_cv_hardware_byteorder=`cat conftest.out.2` 
, 
pike_cv_hardware_byteorder=0 
, 
pike_cv_hardware_byteorder=0 
)]) 
 
AC_MSG_RESULT($pike_cv_hardware_byteorder) 
AC_DEFINE_UNQUOTED(PIKE_BYTEORDER,$pike_cv_hardware_byteorder) 
 
######################################################################## 
MY_CHECK_FUNCTION(fork, 
[ 
#ifdef HAVE_SYS_TYPES_H 
#include <sys/types.h> 
#endif 
#ifdef HAVE_UNISTD_H 
#include <unistd.h> 
#endif 
 
int main() 
{ 
  exit(fork()==-1); 
} 
]); 
######################################################################## 
MY_CHECK_FUNCTION(fpsetmask, 
[ 
#include <math.h> 
#ifdef HAVE_FLOATINGPOINT_H 
#include <floatingpoint.h> 
#endif 
 
#ifdef HAVE_IEEEFP_H 
#include <ieeefp.h> 
#endif 
 
int main() 
{ 
  fpsetmask(0); 
  exit(0); 
} 
]); 
######################################################################## 
MY_CHECK_FUNCTION(fpsetround, 
[ 
#include <math.h> 
#ifdef HAVE_FLOATINGPOINT_H 
#include <floatingpoint.h> 
#endif 
 
#ifdef HAVE_IEEEFP_H 
#include <ieeefp.h> 
#endif 
 
#ifndef FP_RN 
#define FP_RN 0 
#endif /* FP_RN */ 
 
int main() 
{ 
  fpsetround(FP_RN); 
  exit(0); 
} 
]); 
######################################################################## 
 
MY_CHECK_FUNCTION(dlopen, 
[ 
#include <dlfcn.h> 
int main() 
{ 
  dlopen(0, 0); 
  exit(0); 
}]) 
 
######################################################################## 
 
MY_CHECK_FUNCTION(ldexp, 
[ 
#include <math.h> 
int main() 
{ 
  double x; 
  int p; 
 
  for(x=0.0;x<2.0;x+=1.0/64.0) 
    for(p=-6;p<7;p++) 
      if(ldexp(x,p) != x*pow(2.0, (double)p)) 
        exit(1); 
    exit(0); 
}]) 
 
######################################################################## 
MY_CHECK_FUNCTION(rint, 
[ 
#include <math.h> 
#ifdef HAVE_FLOATINGPOINT_H 
#include <floatingpoint.h> 
#endif 
 
#ifdef HAVE_IEEEFP_H 
#include <ieeefp.h> 
#endif /* HAVE_IEEEFP_H */ 
int main() 
{ 
#ifdef HAVE_FPSETROUND 
  /* Round to nearest */ 
#ifndef FP_RN 
#define FP_RN 0 
#endif /* FP_RN */ 
  fpsetround(FP_RN); 
#endif /* HAVE_FPSETROUND */ 
  if(rint(0.1) != 0.0 || 
     rint(0.6) != 1.0) exit(1); 
  exit(0); 
}]) 
 
######################################################################## 
 
MY_CHECK_FUNCTION(frexp, 
[ 
#include <math.h> 
int main() 
{ 
  double x,y; 
  int p,e; 
 
  x=frexp(1.0, &e); 
  if(x * pow(2.0,(double)e) != 1.0) exit(3); 
 
  p=-7; 
  for(x=3.0/4.0*pow(2.0,(double)p);x<50000.0;x*=2.0,p++) 
  { 
    if(frexp(x, &e)!=3.0/4.0) exit(1); 
    if(e!=p) exit(2); 
  } 
  exit(0); 
}]) 
 
############################################################################# 
MY_CHECK_FUNCTION(GetSystemTimeAsFileTime, 
[ 
#include <windows.h> 
#include <winbase.h> 
 
int main() 
{ 
  FILETIME f; 
  GetSystemTimeAsFileTime(&f); 
  exit(0); 
} 
]) 
############################################################################# 
MY_CHECK_FUNCTION(gethostname, 
[ 
#ifdef HAVE_UNISTD_H 
#include <unistd.h> 
#endif 
#ifdef HAVE_WINSOCK_H 
#include <winsock.h> 
#endif 
 
int main(int argc, char **argv) 
{ 
  char buffer[10000]; 
  char *x=gethostname(buffer,sizeof(buffer)); 
  exit(0); 
} 
]) 
############################################################################# 
MY_CHECK_FUNCTION(strcoll, 
[ 
#include <string.h> 
#include <locale.h> 
int main() 
{ 
  setlocale(LC_CTYPE, "ISO-8859-1"); 
  exit(strcoll("abc", "def") >= 0 || 
       strcoll("ABC", "DEF") >= 0 || 
       strcoll("ABC", "ABCD") >= 0 || 
       strcoll("ABCD", "ABC") <= 0 || 
       strcoll("*^#", "*^#") != 0 || 
       strcoll("123", "456") >= 0); 
} 
]) 
 
######################################################################## 
 
MY_CHECK_FUNCTION(memmem, 
[ 
#include <string.h> 
char *a="foo bar gazonk"; 
char *b="foo"; 
char *c="bar"; 
char *d="gazonk"; 
int main() 
{ 
  if(((char *)memmem(b,strlen(b),a,strlen(a)))!=a || 
     ((char *)memmem(c,strlen(c),a,strlen(a)))!=(a+4) || 
     ((char *)memmem(d,strlen(d),a,strlen(a)))!=(a+8) || 
     ((char *)memmem(d,0,a,strlen(a)))!=a || 
     memmem(d,strlen(d)+1,a,strlen(a))!=0) 
    exit(1); 
  exit(0); 
} 
]) 
 
######################################################################## 
 
MY_CHECK_FUNCTION(memcpy, 
[ 
#include <string.h> 
char *a="foo bar gazonk"; 
char foo[23]; 
int main() 
{ 
  memcpy(foo, a, strlen(a)+1); 
  memcpy(foo, a+4, 3); 
  if(strcmp(foo,"bar bar gazonk")) exit(1); 
  exit(0); 
} 
]) 
 
######################################################################## 
 
MY_CHECK_FUNCTION(memset, 
[ 
#include <string.h> 
char foo[23]; 
int main() 
{ 
  memset(foo, 0, 11); 
  memset(foo, 'a', 10); 
  memset(foo, 'b', 5); 
  if(strcmp(foo,"bbbbbaaaaa")) exit(1); 
  exit(0); 
} 
]) 
 
######################################################################## 
 
MY_CHECK_FUNCTION(memmove, 
[ 
#include <string.h> 
char buf[100]; 
int main() 
{ 
  strcpy(buf,"foo bar gazonk elefantsnabel."); 
  if(strcmp(buf,"foo bar gazonk elefantsnabel.")) exit(1); 
  memmove(buf,buf+1,7); 
  if(strcmp(buf,"oo bar  gazonk elefantsnabel.")) exit(1); 
  memmove(buf+1,buf+1,9); 
  if(strcmp(buf,"oo bar  gazonk elefantsnabel.")) exit(1); 
  memmove(buf+1,buf,11); 
  if(strcmp(buf,"ooo bar  gaznk elefantsnabel.")) exit(1); 
  exit(0); 
} 
]) 
 
######################################################################## 
 
MY_CHECK_FUNCTION(isspace, 
[ 
#include <ctype.h> 
int main() 
{ 
  if(isspace(' ')) exit(0); 
  exit(1); 
} 
]) 
 
############################################################################# 
 
AC_MSG_CHECKING(if we can declare environ) 
AC_CACHE_VAL(pike_cv_declare_environ,[ 
AC_TRY_COMPILE([ 
#include <stdlib.h> 
],[ 
  extern char **environ; 
  exit(0); 
],pike_cv_declare_environ=yes,pike_cv_declare_environ=no,pike_cv_declare_environ=yes) 
]) 
 
AC_MSG_RESULT($pike_cv_declare_environ) 
if test "x$pike_cv_declare_environ" = xyes ; then 
  AC_DEFINE(DECLARE_ENVIRON) 
fi 
 
############################################################################# 
 
AC_MSG_CHECKING([for union wait (old BSD convention)]) 
AC_CACHE_VAL(pike_cv_union_wait, [ AC_TRY_COMPILE([ 
#ifdef HAVE_SYS_WAIT_H 
#include <sys/wait.h> 
#endif /* HAVE_SYS_WAIT_H */ 
], [ 
  union wait status; 
  exit(0); 
], pike_cv_union_wait=yes, pike_cv_union_wait=no) 
]) 
 
AC_MSG_RESULT($pike_cv_union_wait) 
if test "x$pike_cv_union_wait" = "xyes" ; then 
  AC_MSG_CHECKING([whether union wait is really needed]) 
  AC_CACHE_VAL(pike_cv_union_wait_needed, [ AC_TRY_COMPILE([ 
#ifdef HAVE_SYS_WAIT_H 
#include <sys/wait.h> 
#endif /* HAVE_SYS_WAIT_H */ 
], [ 
  int status; 
  return WIFEXITED(status) || 0; 
], pike_cv_union_wait_needed=no, pike_cv_union_wait_needed=yes) 
]) 
  AC_MSG_RESULT($pike_cv_union_wait_needed) 
  if test "x$pike_cv_union_wait_needed" = "xyes" ; then 
    AC_DEFINE(HAVE_UNION_WAIT) 
  else :; fi 
else :; fi 
 
############################################################################# 
 
AC_MSG_CHECKING(how to extract an unsigned char) 
AC_CACHE_VAL(pike_cv_method_extract_uchar, 
[ 
AC_TRY_RUN([ 
int main() 
{ 
  char i,*p; 
  i=-10; 
  p=&i; 
  if(*(unsigned char *)(p)!= 0x100 - 10) exit(1); 
  exit(0); 
} 
],pike_cv_method_extract_uchar=by_cast, 
pike_cv_method_extract_uchar=not_by_cast, 
pike_cv_method_extract_uchar=not_by_cast)]) 
 
if test "$pike_cv_method_extract_uchar" = by_cast; then 
  AC_MSG_RESULT(by cast) 
  AC_DEFINE(EXTRACT_UCHAR_BY_CAST) 
else 
  AC_MSG_RESULT(not by cast) 
fi 
 
######################################################################## 
 
AC_MSG_CHECKING(how to extract a signed char) 
AC_CACHE_VAL(pike_cv_method_extract_char, 
[ 
AC_TRY_RUN([ 
int main() 
{ 
  char i,*p; 
  i=-10; 
  p=&i; 
  if(*(signed char *)(p)!= -10) exit(1); 
  exit(0); 
} 
],pike_cv_method_extract_char=by_cast, 
pike_cv_method_extract_char=not_by_cast, 
pike_cv_method_extract_char=not_by_cast)]) 
 
if test "$pike_cv_method_extract_char" = by_cast; then 
  AC_MSG_RESULT(by cast) 
  AC_DEFINE(EXTRACT_CHAR_BY_CAST) 
else 
  AC_MSG_RESULT(not by cast) 
fi 
 
############################################################################# 
if test "x$ac_cv_header_mmx_h" = xyes ; then 
  AC_MSG_CHECKING(for working MMX) 
 
  AC_CACHE_VAL(pike_cv_sys_has_working_mmx, 
  [ 
    AC_TRY_LINK([ 
#include <mmx.h> 
    ],[ 
    { 
      int try_use_mmx; 
      char a[8]; 
      movq_m2r( *a, mm0 ); 
      paddb_r2r( mm0, mm0 ); 
      movq_r2m( mm0, *a ); 
      try_use_mmx=mmx_ok(); 
    } 
    ], pike_cv_sys_has_working_mmx=yes,pike_cv_sys_has_working_mmx=no) 
  ]) 
 
  AC_MSG_RESULT($pike_cv_sys_has_working_mmx) 
 
  if test "x$pike_cv_sys_has_working_mmx" = xyes ; then 
    AC_DEFINE(TRY_USE_MMX) 
  else :; fi 
else :; fi 
 
############################################################################# 
 
AC_MSG_CHECKING(if float conversion can cause SIGFPE) 
AC_CACHE_VAL(pike_cv_sys_idiot_sigfpe, 
[ 
 AC_TRY_RUN([ 
#include <math.h> 
 
#ifdef HAVE_FLOATINGPOINT_H 
#include <floatingpoint.h> 
#endif 
 
#ifdef HAVE_IEEEFP_H 
#include <ieeefp.h> 
#endif 
 
float foo_float = 0.0; 
 
int main(int argc, char **argv) 
{ 
  float x=2.0, y=-128.0; 
#ifdef HAVE_FPSETMASK 
  fpsetmask(0); 
#endif 
  x = pow(2.0, -128.0); 
  foo_float = x; 
  if (x == 2.0) exit(1); 
  x = pow(2.0, 1024.0); 
  foo_float = x; 
  if(x == 2.0) exit(1); 
  exit(0); 
} 
],pike_cv_sys_idiot_sigfpe=no,pike_cv_sys_idiot_sigfpe=yes, 
  pike_cv_sys_idiot_sigfpe=yes) 
]) 
 
if test $pike_cv_sys_idiot_sigfpe = yes ; then 
  AC_MSG_RESULT(yes) 
 
  IEEE_FLAG=no 
  if test "x${GCC-}" = xyes ; then 
    AC_SYS_COMPILER_FLAG(-mieee, mieee, CFLAGS,[],IEEE_FLAG=yes) 
  else 
    AC_SYS_COMPILER_FLAG(-ieee, ieee, CFLAGS,[],IEEE_FLAG=yes) 
  fi 
  TEST_IGNORE_SIGFPE=yes 
 
  if test $IEEE_FLAG = yes; then 
    AC_MSG_CHECKING(if float conversion is still broken) 
    AC_CACHE_VAL(pike_cv_sys_idiot_sigfpe_with_ieee, 
[ 
 OLD_CFLAGS="$CFLAGS" 
 CFLAGS="$CFLAGS $OPTIMIZE" 
 AC_TRY_RUN([ 
#include <math.h> 
 
#ifdef HAVE_FLOATINGPOINT_H 
#include <floatingpoint.h> 
#endif 
 
#ifdef HAVE_IEEEFP_H 
#include <ieeefp.h> 
#endif 
 
float foo_float = 0.0; 
 
int main(int argc, char **argv) 
{ 
  float x=2.0, y=-128.0; 
#ifdef HAVE_FPSETMASK 
  fpsetmask(0); 
#endif 
  x = pow(2.0, -128.0); 
  foo_float = x; 
  if (x == 2.0) exit(1); 
  x = pow(2.0, 1024.0); 
  foo_float = x; 
  if(x == 2.0) exit(1); 
  exit(0); 
} 
],pike_cv_sys_idiot_sigfpe_with_ieee=no,pike_cv_sys_idiot_sigfpe_with_ieee=yes, 
  pike_cv_sys_idiot_sigfpe_with_ieee=yes) 
  CFLAGS="$OLD_CFLAGS" 
]) 
    
  if test $pike_cv_sys_idiot_sigfpe_with_ieee = yes ; then 
    AC_MSG_RESULT(yes) 
  else 
    AC_MSG_RESULT(no) 
    TEST_IGNORE_SIGFPE=no 
  fi 
fi # IEEE_FLAG 
 
if test $TEST_IGNORE_SIGFPE = yes; then 
  AC_MSG_CHECKING(if ignoring SIGFPE helps) 
  AC_CACHE_VAL(pike_cv_sys_ignore_sigfpe, 
[ 
 OLD_CFLAGS="$CFLAGS" 
 CFLAGS="$CFLAGS $OPTIMIZE" 
AC_TRY_RUN([ 
#include <signal.h> 
#include <math.h> 
int counter=0; 
RETSIGTYPE func(void) 
{ 
 if(counter++>10) exit(7); 
 signal(SIGFPE,func); 
} 
 
float foo_float = 0.0; 
 
int main(int argc, char **argv) 
{ 
  float x=2.0, y=-128.0; 
  signal(SIGFPE,func); 
  x = pow(2.0, -128.0); 
  foo_float = x; 
  if (x == 2.0) exit(1); 
  x = pow(2.0, 1024.0); 
  foo_float = x; 
  if(x == 2.0) exit(1); 
  exit(0); 
} 
],pike_cv_sys_ignore_sigfpe=yes,pike_cv_sys_ignore_sigfpe=no, 
  pike_cv_sys_ignore_sigfpe=yes) 
  CFLAGS="$OLD_CFLAGS" 
]) 
 
if test "$pike_cv_sys_ignore_sigfpe" = yes; then 
 AC_MSG_RESULT(yes) 
 AC_DEFINE(IGNORE_SIGFPE) 
else 
 AC_MSG_RESULT(no) 
fi 
fi # TEST_IGNORE_SIGFPE 
 
else 
 AC_MSG_RESULT(no) 
fi # pike_cv_sys_idiot_sigfpe 
 
############################################################################# 
 
define(float_check, [[ 
#include <math.h> 
#define TY $1 
#define TEST_$1 
#define TEST_$2 
#define EXPECTED_SIZE_float 4 
#define EXPECTED_SIZE_double 8 
void check(TY n, char *pf, char *pd) 
{ 
  int i; 
  char *p, *p2 = (char*)&n; 
#ifdef TEST_float 
    p = pf; 
#else 
    p = pd; 
#endif 
  for(i=0; i<sizeof(TY); i++) 
#ifdef TEST_BIG 
    if(p[i] != p2[i]) 
      exit(1); 
#else 
    if(p[i] != p2[sizeof(TY)-i-1]) 
      exit(1); 
#endif 
} 
int main() 
{ 
  if(sizeof(TY)!=EXPECTED_SIZE_$1) 
    exit(1); 
  check((TY)0.0, "\000\000\000\000", "\000\000\000\000\000\000\000\000"); 
  check((TY)1.0, "\077\200\000\000", "\077\360\000\000\000\000\000\000"); 
  check((TY)-1.0, "\277\200\000\000", "\277\360\000\000\000\000\000\000"); 
  check((TY)2.0, "\100\000\000\000", "\100\000\000\000\000\000\000\000"); 
  check((TY)1.5, "\077\300\000\000", "\077\370\000\000\000\000\000\000"); 
  check((TY)0.032999999821186065673828125, "\075\007\053\002", "\077\240\345\140\100\000\000\000"); 
  exit(0); 
} 
]]) 
 
AC_MSG_CHECKING(for type of float) 
AC_CACHE_VAL(pike_cv_float_type, 
[AC_TRY_RUN(float_check(float,BIG),pike_cv_float_type=ieee_big, 
  [AC_TRY_RUN(float_check(float,LITTLE),pike_cv_float_type=ieee_little, 
    pike_cv_float_type=not_ieee)],pike_cv_float_type=not_ieee)]) 
if test "$pike_cv_float_type" = ieee_big; then 
  AC_MSG_RESULT(IEEE big endian) 
  AC_DEFINE(FLOAT_IS_IEEE_BIG) 
else 
  if test "$pike_cv_float_type" = ieee_little; then 
    AC_MSG_RESULT(IEEE little endian) 
    AC_DEFINE(FLOAT_IS_IEEE_LITTLE) 
  else 
    AC_MSG_RESULT(not IEEE) 
  fi 
fi 
 
AC_MSG_CHECKING(for type of double) 
AC_CACHE_VAL(pike_cv_double_type, 
[AC_TRY_RUN(float_check(double,BIG),pike_cv_double_type=ieee_big, 
  [AC_TRY_RUN(float_check(double,LITTLE),pike_cv_double_type=ieee_little, 
    pike_cv_double_type=not_ieee)],pike_cv_double_type=not_ieee)]) 
if test "$pike_cv_double_type" = ieee_big; then 
  AC_MSG_RESULT(IEEE big endian) 
  AC_DEFINE(DOUBLE_IS_IEEE_BIG) 
else 
  if test "$pike_cv_double_type" = ieee_little; then 
    AC_MSG_RESULT(IEEE little endian) 
    AC_DEFINE(DOUBLE_IS_IEEE_LITTLE) 
  else 
    AC_MSG_RESULT(not IEEE) 
  fi 
fi 
 
############################################################################# 
 
AC_MSG_CHECKING(for volatile) 
AC_CACHE_VAL(pike_cv_volatile, 
[ 
 AC_TRY_COMPILE([],[ volatile int foo=1;], pike_cv_volatile=yes,pike_cv_volatile=no) 
]) 
 
if test "$pike_cv_volatile" = yes; then 
 AC_MSG_RESULT(yes) 
 AC_DEFINE(VOLATILE,volatile) 
else 
 AC_MSG_RESULT(no) 
 AC_DEFINE(VOLATILE,) 
fi 
 
######################################################################## 
 
AC_MSG_CHECKING(for sig_atomic_t) 
AC_CACHE_VAL(ac_cv_type_sig_atomic_t, 
[ 
  AC_EGREP_CPP(sig_atomic_t, [ 
#ifdef HAVE_SIGNAL_H 
#include <signal.h> 
#endif 
#include <sys/types.h> 
#if STDC_HEADERS 
#include <stdlib.h> 
#include <stddef.h> 
#endif], ac_cv_type_sig_atomic_t=yes, ac_cv_type_sig_atomic_t=no)]) 
AC_MSG_RESULT($ac_cv_type_sig_atomic_t) 
if test x"$ac_cv_type_sig_atomic_t" = xno; then 
  AC_DEFINE(sig_atomic_t, int) 
else 
  : 
fi 
 
AC_MSG_CHECKING(if signal handlers reset automatically) 
AC_CACHE_VAL(pike_cv_sys_signal_oneshot, 
[ 
AC_TRY_RUN([ 
#ifdef HAVE_SIGNAL_H 
#include <signal.h> 
#endif 
#include <sys/types.h> 
#if STDC_HEADERS 
#include <stdlib.h> 
#include <stddef.h> 
#endif 
VOLATILE sig_atomic_t sigrun=0; 
RETSIGTYPE func(int sig) 
{ 
  write(2, "func called\n", sizeof("func called\n") - sizeof("")); 
  sigrun=1; 
} 
 
int main() 
{ 
#define sig SIGSEGV 
 
#ifdef HAVE_SIGACTION 
  { 
    struct sigaction action; 
    action.sa_handler= func; 
    sigfillset(&action.sa_mask); 
#ifdef SA_INTERRUPT 
    action.sa_flags=SA_INTERRUPT; 
#endif 
    sigaction(sig,&action,0); 
  } 
#else 
#ifdef HAVE_SIGVEC 
  { 
    struct sigvec action; 
    action.sv_handler= func; 
    action.sv_mask=-1; 
#ifdef SV_INTERRUPT 
    action.sv_flags=SV_INTERRUPT; 
#endif 
    sigvec(sig,&action,0); 
  } 
#else 
  signal(sig, func); 
#endif 
#endif 
 
  kill(getpid(), sig); 
  while(!sigrun) sleep(1); 
  sigrun=0; 
  kill(getpid(), sig); 
  while(!sigrun) sleep(1); 
  sigrun=0; 
  exit(0); 
} 
],pike_cv_sys_signal_oneshot=no,pike_cv_sys_signal_oneshot=yes,pike_cv_sys_signal_oneshot=yes)]) 
 
if test "$pike_cv_sys_signal_oneshot" = yes; then 
  AC_MSG_RESULT(yes) 
  AC_DEFINE(SIGNAL_ONESHOT) 
else 
  AC_MSG_RESULT(no) 
fi 
 
######################################################################## 
 
AC_MSG_CHECKING(available file descriptors) 
AC_CACHE_VAL(pike_cv_max_open_fd, 
[ 
AC_TRY_RUN([ 
#include <stdio.h> 
#ifdef HAVE_SYS_TIME_H 
#include <sys/time.h> 
#endif 
#ifdef HAVE_SYS_RESOURCE_H 
#include <sys/resource.h> 
#endif 
 
#ifndef MAX_FD 
#define MAX_FD 65536 
#endif 
 
int main() 
{ 
  FILE *f; 
  long limit; 
 
#if !defined(RLIMIT_NOFILE) && defined(RLIMIT_OFILE) 
#define RLIMIT_NOFILE RLIMIT_OFILE 
#endif 
 
#if defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE) 
  struct rlimit lim; 
 
  if(getrlimit(RLIMIT_NOFILE,&lim)) 
  { 
    limit = MAX_FD; 
  }else{ 
    if(lim.rlim_max == RLIM_INFINITY) 
    { 
      limit = 1024 * 1024 * 2; /* Noone needs more :-) */ 
    }else{ 
      limit=lim.rlim_max; 
      if(limit > 1024 * 1024 * 2) limit= 1024 * 1024 * 2; 
    } 
  } 
#else 
  limit = MAX_FD; 
#endif 
 
  f=fopen("conftest.out.2","w"); 
  fprintf(f,"%ld\n",(long)limit); 
  fclose(f); 
 
  return 0; 
} 
], 
pike_cv_max_open_fd=`cat conftest.out.2` 
, 
pike_cv_max_open_fd=256 
, 
pike_cv_max_open_fd=256 
)]) 
AC_MSG_RESULT($pike_cv_max_open_fd) 
AC_DEFINE_UNQUOTED(MAX_OPEN_FILEDESCRIPTORS,$pike_cv_max_open_fd) 
 
AC_MSG_CHECKING(full availability of struct rusage members) 
AC_CACHE_VAL(pike_cv_func_getrusage_full, 
[ 
AC_TRY_LINK([ 
#include <sys/time.h> 
#ifdef HAVE_SYS_RUSAGE_H 
#include <sys/rusage.h> 
#endif 
#include <sys/resource.h> 
#ifndef RUSAGE_SELF 
#define RUSAGE_SELF     0 
#endif 
],[ 
    struct rusage rus; 
    long *v = (long *)main; 
    getrusage(RUSAGE_SELF, &rus); 
    *v++ = rus.ru_maxrss; 
    *v++ = rus.ru_ixrss; 
    *v++ = rus.ru_idrss; 
    *v++ = rus.ru_isrss; 
    *v++ = rus.ru_minflt; 
    *v++ = rus.ru_majflt; 
    *v++ = rus.ru_nswap; 
    *v++ = rus.ru_inblock; 
    *v++ = rus.ru_oublock; 
    *v++ = rus.ru_msgsnd; 
    *v++ = rus.ru_msgrcv; 
    *v++ = rus.ru_nsignals; 
    *v++ = rus.ru_nvcsw; 
    *v++ = rus.ru_nivcsw; 
], 
  pike_cv_func_getrusage_full=yes 
, 
  pike_cv_func_getrusage_full=no 
)]) 
 
if test "$pike_cv_func_getrusage_full" = yes; then 
  AC_MSG_RESULT(all there) 
else 
  AC_MSG_RESULT(getrusage is restricted) 
  AC_DEFINE(GETRUSAGE_RESTRICTED) 
fi 
 
######################################################################## 
#  
# IRIX also has procfs support, but it it different, a separate test 
# should be made. /Hubbe 
# 
 
if test "$ac_cv_header_sys_procfs_h" = "yes"; then 
  AC_MSG_CHECKING(getrusage() through procfs) 
  AC_CACHE_VAL(pike_cv_getrusage_procfs, [ 
    AC_TRY_COMPILE([ 
#ifndef _LARGEFILE_SOURCE 
#  define _FILE_OFFSET_BITS 64 
#  define _LARGEFILE_SOURCE 
#  define _LARGEFILE64_SOURCE 1 
#endif 
#include <sys/procfs.h> 
#include <sys/fcntl.h> 
int proc_fd; 
long tmp; 
char proc_name[20]; 
prusage_t  pru; 
    ],[ 
      sprintf(proc_name, "/proc/%05d", getpid()); 
      proc_fd = open(proc_name, O_RDONLY); 
      ioctl(proc_fd, PIOCUSAGE, &pru); 
      tmp=pru.pr_utime.tv_sec; 
    ], 
      pike_cv_getrusage_procfs=yes 
    , 
      pike_cv_getrusage_procfs=no 
    ) 
  ]) 
 
  if test "$pike_cv_getrusage_procfs" = yes; then 
    AC_MSG_RESULT(yes) 
    AC_DEFINE(GETRUSAGE_THROUGH_PROCFS) 
  else 
    AC_MSG_RESULT(no) 
  fi 
fi 
 
############################################################################# 
 
if test "$ac_cv_getrusage_procfs" = "yes"; then 
  AC_MSG_CHECKING(prstatus_t contains pr_brksize and pr_stksize) 
  AC_CACHE_VAL(pike_cv_getrusage_procfs_prs, [ 
    AC_TRY_COMPILE([ 
#ifndef _LARGEFILE_SOURCE 
#  define _FILE_OFFSET_BITS 64 
#  define _LARGEFILE_SOURCE 
#  define _LARGEFILE64_SOURCE 1 
#endif 
#include <sys/procfs.h> 
#include <sys/fcntl.h> 
int proc_fd; 
long tmp; 
char proc_name[20]; 
prstatus_t prs; 
    ],[ 
      sprintf(proc_name, "/proc/%05d", getpid()); 
      proc_fd = open(proc_name, O_RDONLY); 
      ioctl(proc_fd, PIOCSTATUS, &prs); 
      tmp=prs.pr_brksize + prs.pr_stksize; 
    ], 
      pike_cv_getrusage_procfs_prs=yes 
    , 
      pike_cv_getrusage_procfs_prs=no 
    ) 
  ]) 
 
  if test "$pike_cv_getrusage_procfs_prs" = yes; then 
    AC_MSG_RESULT(yes) 
    AC_DEFINE(GETRUSAGE_THROUGH_PROCFS_PRS) 
  else 
    AC_MSG_RESULT(no) 
  fi 
fi 
 
############################################################################# 
 
AC_MSG_CHECKING(for isgraph) 
AC_CACHE_VAL(pike_cv_func_isgraph, [ AC_TRY_LINK([ 
#include <ctype.h> 
], [ 
return(!isgraph('A')); 
], pike_cv_func_isgraph=yes, pike_cv_func_isgraph=no) 
]) 
AC_MSG_RESULT($pike_cv_func_isgraph) 
if test "x$pike_cv_func_isgraph" = "xyes" ; then 
  AC_DEFINE(HAVE_ISGRAPH) 
else :; fi 
 
############################################################################# 
# 
# __func__ is new in ISO C 9x 
# 
# It should expand to the name of the current function, and is 
# useful for debug. 
 
AC_MSG_CHECKING(if __func__ exists and works) 
AC_CACHE_VAL(pike_cv_have_working___func__, 
[ 
  AC_TRY_RUN([ 
#ifdef HAVE_STRING_H 
#include <string.h> 
#else /* !HAVE_STRING_H */ 
#ifdef HAVE_STRINGS_H 
#include <strings.h> 
#endif /* HAVE_STRIGNS_H */ 
#endif /* HAVE_STRING_H */ 
int main() 
{ 
  exit(strcmp("main", __func__)); 
} 
  ], pike_cv_have_working___func__=yes, pike_cv_have_working___func__=no, 
     pike_cv_have_working___func__=no) 
]) 
AC_MSG_RESULT($pike_cv_have_working___func__) 
if test "$pike_cv_have_working___func__" = yes; then 
  AC_DEFINE(HAVE_WORKING___FUNC__) 
else :; fi 
 
# gcc has __FUNCTION__ instead. 
 
AC_MSG_CHECKING(if __FUNCTION__ exists and works) 
AC_CACHE_VAL(pike_cv_have_working___FUNCTION__, 
[ 
  AC_TRY_RUN([ 
#ifdef HAVE_STRING_H 
#include <string.h> 
#else /* !HAVE_STRING_H */ 
#ifdef HAVE_STRINGS_H 
#include <strings.h> 
#endif /* HAVE_STRIGNS_H */ 
#endif /* HAVE_STRING_H */ 
int main() 
{ 
  exit(strcmp("main", __FUNCTION__)); 
} 
  ], pike_cv_have_working___FUNCTION__=yes, 
     pike_cv_have_working___FUNCTION__=no, 
     pike_cv_have_working___FUNCTION__=no) 
]) 
AC_MSG_RESULT($pike_cv_have_working___FUNCTION__) 
if test "$pike_cv_have_working___FUNCTION__" = yes; then 
  AC_DEFINE(HAVE_WORKING___FUNCTION__) 
else :; fi 
 
############################################################################# 
 
AC_MSG_CHECKING(for gcc function attributes) 
AC_CACHE_VAL(pike_cv_gcc_attributes, 
[ 
AC_TRY_RUN([ 
#include <stdarg.h> 
void fatal(char *foo,...) __attribute__ ((noreturn,format (printf,1,2))); 
int sqr(int x) __attribute__ ((const)); 
 
int sqr(int x) { return x*x; } 
 
void fatal(char *foo,...) 
{ 
  va_list args; 
  va_start(foo,args); 
  printf(foo,args); 
  va_end(args); 
  exit(2); 
} 
 
int main() {  exit(0); } 
 
], pike_cv_gcc_attributes=yes, pike_cv_gcc_attributes=no, pike_cv_gcc_attributes=no)]) 
 
AC_MSG_RESULT($pike_cv_gcc_attributes) 
if test "$pike_cv_gcc_attributes" = yes; then 
 AC_DEFINE(HAVE_FUNCTION_ATTRIBUTES) 
fi 
 
############################################################################# 
 
AC_MSG_CHECKING(how to concatenate two symbols) 
AC_CACHE_VAL(pike_cv_cpp_symbol_concat, [ 
  AC_TRY_COMPILE([ 
int AABB=0; 
#define CONCAT(X,Y)     X##Y 
  ], [ 
    return CONCAT(AA,BB); 
  ], pike_cv_cpp_symbol_concat=ANSI, [ 
    AC_TRY_COMPILE([ 
int AABB=0; 
#define CONCAT(X,Y)     X/**/Y 
    ], [ 
      return CONCAT(AA,BB); 
    ], pike_cv_cpp_symbol_concat=KR, [ 
      pike_cv_cpp_symbol_concat=Unknown 
    ]) 
  ]) 
]) 
AC_MSG_RESULT($pike_cv_cpp_symbol_concat) 
case "$pike_cv_cpp_symbol_concat" in 
  "ANSI") 
    AC_DEFINE(HAVE_ANSI_CONCAT) 
  ;; 
  "KR") 
    AC_DEFINE(HAVE_KR_CONCAT) 
  ;; 
esac 
 
############################################################################# 
 
AC_MSG_CHECKING(how to set things nonblocking) 
AC_CACHE_VAL(pike_cv_sys_nonblock, 
[ 
  # Kludge needed for AmigaOS 
  if test "$pike_cv_sys_os" = "AmigaOS" ; then 
    pike_cv_sys_nonblock=USE_FCNTL_O_NONBLOCK 
  else 
    # Make sure we can run configure in a separate directory. 
    OCPPFLAGS="$CPPFLAGS" 
    CPPFLAGS="-I$srcdir $CPPFLAGS" 
    AC_TRY_RUN([ 
#define TESTING 
#define USE_FCNTL_FNDELAY 
#include "fd_control.c" 
], pike_cv_sys_nonblock=USE_FCNTL_FNDELAY, 
    AC_TRY_RUN([ 
#define TESTING 
#define USE_FCNTL_O_NDELAY 
#include "fd_control.c" 
], pike_cv_sys_nonblock=USE_FCNTL_O_NDELAY, 
    AC_TRY_RUN([ 
#define TESTING 
#define USE_FCNTL_O_NONBLOCK 
#include "fd_control.c" 
], pike_cv_sys_nonblock=USE_FCNTL_O_NONBLOCK, 
    AC_TRY_RUN([ 
#define TESTING 
#define USE_IOCTL_FIONBIO 
#include "fd_control.c" 
], pike_cv_sys_nonblock=USE_IOCTL_FIONBIO, 
    AC_TRY_RUN([ 
#define TESTING 
#define USE_IOCTLSOCKET_FIONBIO 
#include "fd_control.c" 
], pike_cv_sys_nonblock=USE_IOCTLSOCKET_FIONBIO, 
unset pike_cv_sys_nonblock, 
unset pike_cv_sys_nonblock), 
unset pike_cv_sys_nonblock), 
unset pike_cv_sys_nonblock), 
unset pike_cv_sys_nonblock), 
unset pike_cv_sys_nonblock) 
    # Restore CPPFLAGS 
    CPPFLAGS="$OCPPFLAGS" 
  fi 
]) 
 
if test "${pike_cv_sys_nonblock}" = ""; then 
  AC_MSG_RESULT(none found) 
else 
 AC_MSG_RESULT($pike_cv_sys_nonblock) 
 AC_DEFINE_UNQUOTED($pike_cv_sys_nonblock) 
fi 
 
rm -f core 
 
########################################################################## 
 
# Set info about shared libraries. 
AC_SUBST(SO) 
AC_SUBST(LDSHARED) 
AC_SUBST(CCSHARED) 
AC_SUBST(LINKFORSHARED) 
 
# SO is the extension of shared libraries 
# -- usually so, sl on HP-UX 
AC_MSG_CHECKING(SO) 
if test -z "$SO" 
then 
        case "$pike_cv_sys_os" in 
        hp*|HP*)   SO=sl;; 
        *)     SO=so;; 
        esac 
fi 
AC_MSG_RESULT($SO) 
# LDSHARED is the ld *command* used to create shared library 
# -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5 
AC_MSG_CHECKING(LDSHARED) 
if test -z "$LDSHARED" ; then 
  case "$pike_cv_sys_os" in 
    AIX*) 
      if test "$GCC" = yes ; then 
        if test "`uname -r`" -ge 2 -a "`uname -v`" -ge 4 ; then 
          LDSHARED="ld -G -bexpall" 
        else if test "`uname -v`" -gt 4 ; then 
            # Extra forward compatibility... 
          # AIX 5+ 
          LDSHARED="ld -G -bexpall" 
          else 
            # AIX 4.1 and earlier don't have/have unreliable 
          # handling of dlopen et al. 
          # 
          # Even AIX 4.2.1 has buggy dlopen -- NEVER attempt 
          # to dlopen a file that hasn't been linked with -G. 
          pike_cv_sys_dynamic_loading=no 
            LDSHARED="ld" 
          fi 
        fi 
      else 
        # Dynamic linking turned off for AIX-cc 
      # 
      # In addition, the dynamic loading test seems to 
      # cause our RS/6000 to hang, which causes the 
      # watchdog-timer to PANIC. 
      pike_cv_sys_dynamic_loading=no 
        LDSHARED="ld" 
      fi 
    ;; 
    IRIX*) 
      if test "$GCC" = yes ; then 
        # egcs defaults to building -n32 objects 
        LDSHARED="ld -shared -n32" 
      else 
        LDSHARED="ld -shared" 
      fi 
      # -woff isn't understood by ld on Irix 5. 
      if test "`uname -r`" -ge 6 ; then 
        LDSHARED="$LDSHARED -woff 84,85,134" 
      else :; fi 
    ;; 
    SunOS*) LDSHARED="ld";; 
    Solaris) LDSHARED="/usr/ccs/bin/ld -G";; 
    hp*|HP*) LDSHARED="ld -b";; 
    OSF*) LDSHARED="ld -expect_unresolved '*' -shared -msym -O3";; 
    DYNIX/ptx*) LDSHARED="ld -G";; 
    next*) LDSHARED="$CC $CFLAGS -nostdlib -r";; 
    Linux*) LDSHARED="$CC -shared";; 
    GNU*) LDSHARED="ld -Bshareable";; 
    FreeBSD*) LDSHARED="$CC -Wl,-Bshareable";; 
    NetBSD*) LDSHARED="ld -Bshareable";; 
    OpenBSD*) LDSHARED="ld -Bshareable";; 
    BSD/OS*) LDSHARED="shlicc -r";; 
    SCO_SV*) LDSHARED="cc -G -KPIC -Wl,-Bexport";; 
    UNIX_SV*) LDSHARED="ld -G";; 
    UnixWare*) 
      if test "$GCC" = yes ; then 
        LDSHARED="ld -G" 
      else 
        LDSHARED="cc -G -KPIC -Wl,-Bexport" 
      fi 
    ;; 
    Windows_NT*) LDSHARED="$CC -shared";; 
    *) LDSHARED="ld";; 
  esac 
fi 
AC_MSG_RESULT($LDSHARED) 
 
# CCSHARED are the C *flags* used to create objects to go into a shared 
# library -- this is only needed for a few systems 
AC_MSG_CHECKING(CCSHARED) 
AC_CACHE_VAL(pike_cv_sys_ccshared,[ 
  if test -z "$CCSHARED" ; then 
    if test "$GCC" = yes ; then 
      case "$pike_cv_sys_os" in 
        BSD/OS*) 
          CCSHARED="" 
        ;; 
        Solaris*) 
          # The Image module runs out of symbol reference space unless we 
          # use the large PIC model: 
          # ld: fatal: too many symbols require `small' PIC references: 
          #     have 2205, maximum 2048 -- recompile some modules -K PIC. 
          CCSHARED="-fPIC" 
        ;; 
        *) 
          CCSHARED="-fpic" 
        ;; 
      esac 
    else 
      case "$pike_cv_sys_os" in 
        IRIX*) 
          AC_SYS_COMPILER_FLAG(-share,cc_shared,CCSHARED) 
        ;; 
        hp*|HP*) CCSHARED="+z"; ;; 
        FreeBSD*) CCSHARED="-fpic";; 
        SCO_SV*) CCSHARED="-KPIC -dy -Bdynamic";; 
        UnixWare*) CCSHARED="-KPIC -dy -Bdynamic";; 
        Solaris*) CCSHARED="-KPIC -Bdynamic";; 
        Windows_NT*) CCSHARED="-shared" ;; 
      esac 
    fi 
  fi 
  OLD_CFLAGS="$CFLAGS" 
  CFLAGS="$CFLAGS $CCSHARED" 
  AC_TRY_COMPILE([], [int main() { exit(0); }], 
    pike_cv_sys_ccshared="$CCSHARED", pike_cv_sys_ccshared='') 
  CFLAGS="$OLD_CFLAGS" 
]) 
CCSHARED="$pike_cv_sys_ccshared" 
AC_MSG_RESULT($CCSHARED) 
 
AC_MSG_CHECKING(LINKFORSHARED) 
 
AC_CACHE_VAL(pike_cv_sys_linkforshared,[ 
# LINKFORSHARED are the flags passed to the $(CC) command that links 
# the pike executable -- this is only needed for a few systems 
if test -z "$LINKFORSHARED" 
then 
  LINKFORSHARED="" 
  if test "$GCC" = yes ; then 
    case "$pike_cv_sys_os" in 
      AIX*)     LINKFORSHARED="-Wl,-bexpall -Wl,-brtl";; 
      hp*|HP*) LINKFORSHARED="-Wl,-E";; 
      Linux*) LINKFORSHARED="-rdynamic";; 
      GNU*) LINKFORSHARED="-rdynamic";; 
      next*) LINKFORSHARED="-u libsys_s";; 
      SCO_SV*) LINKFORSHARED="-fpic -Wl,-Bexport";; 
      # What about UNIX_SV? 
      UnixWare*) LINKFORSHARED="-fpic -Wl,-Bexport";; 
 
      FreeBSD*) 
        AC_TRY_RUN([int main(){exit( 
#ifdef __ELF__ 
    0 
#else 
    1 
#endif 
);} 
        ],LINKFORSHARED=-rdynamic) 
      ;; 
    esac 
  else 
    case "$pike_cv_sys_os" in 
      AIX*)     LINKFORSHARED="-Wl,-bexpall -Wl,-brtl";; 
      hp*|HP*) LINKFORSHARED="-Wl,-E";; 
      Linux*) LINKFORSHARED="-rdynamic";; 
      GNU*) LINKFORSHARED="-rdynamic";; 
      next*) LINKFORSHARED="-u libsys_s";; 
      SCO_SV*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";; 
      # What about UNIX_SV? 
      UnixWare*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";; 
    esac 
  fi 
fi 
 
 
   OLD_CFLAGS="$CFLAGS" 
   CFLAGS="$CFLAGS $LINKFORSHARED" 
   AC_TRY_RUN([int main() { exit(0); }], 
 pike_cv_sys_linkforshared="$LINKFORSHARED", pike_cv_sys_linkforshared='', pike_cv_sys_linkforshared='') 
   CFLAGS="$OLD_CFLAGS" 
]) 
 
LINKFORSHARED="$pike_cv_sys_linkforshared" 
 
AC_MSG_RESULT($LINKFORSHARED) 
 
############################################################################# 
 
cat >conftest.c <<EOF 
#include <stdio.h> 
void testfunc(void) { 
  fprintf(stderr,"Calling testfunc2\n"); 
  testfunc2(); 
  fprintf(stderr,"testfunc2 returned!\n"); 
  exit(1); 
} 
EOF 
 
AC_MSG_CHECKING(if dynamic loading works) 
AC_CACHE_VAL(pike_cv_sys_dynamic_loading, 
[ 
  echo $CC -c $CFLAGS $CCSHARED conftest.c -o conftest.o 1>&5 
  $CC -c $CFLAGS $CCSHARED conftest.c -o conftest.o 1>&5 2>&5 
 
  echo $BINDIR/smartlink $LDSHARED $LDFLAGS conftest.o -o conftest.$SO 1>&5 
  $BINDIR/smartlink $LDSHARED $LDFLAGS conftest.o -o conftest.$SO 1>&5 2>&5 
 
  if test -f conftest.$SO ; then 
    mv conftest.$SO myconftest.so 
 
    OLD_CFLAGS="$CFLAGS" 
    CFLAGS="$CFLAGS $LINKFORSHARED" 
    OLD_CC="$CC" 
    case "$LD" in 
      *shlicc) 
        CC="$BINDIR/smartlink shlicc" 
      ;; 
    esac 
    AC_TRY_RUN([ 
#define TESTING 
#include "dynamic_load.c" 
void testfunc2(void) { exit(0); } 
], pike_cv_sys_dynamic_loading=yes, pike_cv_sys_dynamic_loading=no, pike_cv_sys_dynamic_loading=no) 
    CFLAGS="$OLD_CFLAGS" 
    CC="$OLD_CC" 
  else     
    pike_cv_sys_dynamic_loading=no 
  fi 
  rm -f myconftest.so >/dev/null 2>/dev/null 
]) 
AC_MSG_RESULT($pike_cv_sys_dynamic_loading) 
 
if test x$pike_cv_sys_dynamic_loading = xno ; then 
  with_dynamic_modules=no 
fi 
 
####################################################################### 
# Since configure doesn't always know if we will be linking with ld or cc, 
# We use this little code snippet to add flags to ld that would otherwise 
# be given automatically by $(CC) $(CFLAGS) 
# /Hubbe 
# 
 
case "x$LD" in 
  $CC*) 
    # Options in CFLAGS, no stuff needs to be added 
  ;; 
  \$\(CC\)*) 
    # Options in CFLAGS, no stuff needs to be added 
  ;; 
  *) 
    LD="${LD} ${LD_FALLBACK_FLAGS-}" 
  ;; 
esac 
 
####################################################################### 
# Since all $OPTIMIZE flags have to be automatically included in $CFLAGS 
# (because otherwise the tests will not be accurate) we have to remove all 
# OPTIMIZE flags from the regular CFLAGS... 
 
NEW_CFLAGS= 
for opt in ${CFLAGS-} 
do 
   case " $OPTIMIZE " in 
     *\ $opt\ *) ;; 
     *) 
       case "$opt" in 
         -O2|-pipe) OPTIMIZE="${OPTIMIZE-} $opt" ;; 
          *)  NEW_CFLAGS="$NEW_CFLAGS $opt" ;; 
       esac 
     ;; 
   esac 
done 
CFLAGS="$NEW_CFLAGS" 
 
########################################################################## 
 
case "x$pike_cv_sys_os" in 
  xSolaris | xAIX) 
   if grep _REENTRANT confdefs.h >/dev/null 2>&1; then 
     AC_DEFINE(USE_WAIT_THREAD) 
   else 
     AC_DEFINE(USE_SIGCHILD) 
   fi 
  ;; 
 
  xWindows_NT) 
  ;; 
 
  *) 
    AC_DEFINE(USE_SIGCHILD) 
  ;; 
esac 
 
############################################################################# 
if test "x$with_copt" = xno ; then 
  OPTIMIZE= 
fi 
############################################################################# 
 
echo 
echo "Compiler summary:" 
echo 
echo "C Compiler:    $CC" 
echo "Linker:        $LD" 
echo "Shared linker: $LDSHARED" 
echo 
echo "Shared object extension: $SO" 
echo 
echo "CPPFLAGS:      $CPPFLAGS" 
echo "CFLAGS:        $CFLAGS" 
echo "CCSHARED:      $CCSHARED" 
echo "LINKFORSHARED: $LINKFORSHARED" 
echo "LIBGCC:        $LIBGCC" 
echo "WARN:          $WARN" 
echo "PROFIL:        $PROFIL" 
echo "OPTIMIZE:      $OPTIMIZE" 
echo "LDFLAGS:       $LDFLAGS" 
echo "LIBS:          $LIBS" 
echo "prefix:        $prefix" 
echo 
 
############################################################################# 
 
export LDFLAGS CFLAGS CPPFLAGS LIBS 
export prefix exec_prefix OTHERFLAGS 
export TMP_BINDIR DEFINES INSTALL 
 
AC_CONFIG_SUBDIRS(modules post_modules) 
 
default_master=$prefix/pike/%d.%d.%d/lib/master.pike 
AC_DEFINE_UNQUOTED(DEFAULT_MASTER,"$default_master") 
 
AC_SUBST_FILE(dependencies) 
dependencies=$srcdir/dependencies 
 
AC_SUBST(YACC) 
AC_SUBST(INSTALL) 
AC_SUBST(WARN) 
AC_SUBST(PROFIL) 
AC_SUBST(OPTIMIZE) 
AC_SUBST(EXTRA_OBJS) 
AC_SUBST(RANLIB) 
AC_SUBST(DEBUGDEF) 
AC_SUBST(ac_configure_args) 
pike_cv_prog_CC="${CC}" 
 
if test x$pike_cv_func_dlopen$ac_cv_func_dld_link$ac_cv_func_shl_load = xnonono; 
then 
  if test x"$pike_cv_sys_os" != xWindows_NT ; then 
    with_dynamic_modules=no 
  fi 
fi 
 
if test x$with_dynamic_modules = xyes ; then 
  dmmsrc="modules/dynamic_module_makefile.in" 
else 
  dmmsrc="modules/static_module_makefile.in" 
fi 
 
AC_SUBST(dmmsrc) 
 
AC_OUTPUT(Makefile modules/static_module_makefile  post_modules/static_module_makefile:modules/static_module_makefile.in modules/dynamic_module_makefile:$dmmsrc post_modules/dynamic_module_makefile:$dmmsrc precompile.sh,[echo foo >stamp-h ; chmod +x precompile.sh])