aboutsummaryrefslogtreecommitdiff
path: root/etc/configure.texi
blob: 91401671f9254ca75de2efcfe5b504eb210a6720 (plain)
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
\input texinfo
@c %**start of header
@setfilename configure.info
@settitle The GNU configure and build system
@setchapternewpage off
@c %**end of header

@dircategory GNU admin
@direntry
* configure: (configure).	The GNU configure and build system
@end direntry

@ifinfo
This file documents the GNU configure and build system.

Copyright (C) 1998 Cygnus Solutions.

Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.

@ignore
Permission is granted to process this file through TeX and print the
results, provided the printed document carries copying permission
notice identical to this one except for the removal of this paragraph


@end ignore
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.

Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be stated in a translation approved
by the Foundation.
@end ifinfo

@titlepage
@title The GNU configure and build system
@author Ian Lance Taylor

@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1998 Cygnus Solutions

Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.

Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.

Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be stated in a translation
approved by the Free Software Foundation.
@end titlepage

@ifinfo
@node Top
@top GNU configure and build system

The GNU configure and build system.

@menu
* Introduction::		Introduction.
* Getting Started::		Getting Started.
* Files::			Files.
* Configuration Names::		Configuration Names.
* Cross Compilation Tools::	Cross Compilation Tools.
* Canadian Cross::		Canadian Cross.
* Cygnus Configure::		Cygnus Configure.
* Multilibs::			Multilibs.
* FAQ::				Frequently Asked Questions.
* Index::			Index.
@end menu

@end ifinfo

@node Introduction
@chapter Introduction

This document describes the GNU configure and build systems.  It
describes how autoconf, automake, libtool, and make fit together.  It
also includes a discussion of the older Cygnus configure system.

This document does not describe in detail how to use each of the tools;
see the respective manuals for that.  Instead, it describes which files
the developer must write, which files are machine generated and how they
are generated, and where certain common problems should be addressed.

@ifnothtml
This document draws on several sources, including the autoconf manual by
David MacKenzie (@pxref{Top, , autoconf overview, autoconf, Autoconf}),
the automake manual by David MacKenzie and Tom Tromey (@pxref{Top, ,
automake overview, automake, GNU Automake}), the libtool manual by
Gordon Matzigkeit (@pxref{Top, , libtool overview, libtool, GNU
libtool}), and the Cygnus configure manual by K. Richard Pixley.
@end ifnothtml
@ifhtml
This document draws on several sources, including
@uref{http://www.delorie.com/gnu/docs/autoconf/autoconf_toc.html, the
autoconf manual} by David MacKenzie,
@uref{http://www.delorie.com/gnu/docs/automake/automake_toc.html, the
automake manual} by David MacKenzie and Tom Tromey,
@uref{http://www.delorie.com/gnu/docs/libtool/libtool_toc.html, the
libtool manual} by Gordon Matzigkeit, and the Cygnus configure manual by
K. Richard Pixley.
@end ifhtml

@menu
* Goals::			Goals.
* Tools::			The tools.
* History::			History.
* Building::			Building.
@end menu

@node Goals
@section Goals
@cindex goals

The GNU configure and build system has two main goals.

The first is to simplify the development of portable programs.  The
system permits the developer to concentrate on writing the program,
simplifying many details of portability across Unix and even Windows
systems, and permitting the developer to describe how to build the
program using simple rules rather than complex Makefiles.

The second is to simplify the building of programs distributed as source
code.  All programs are built using a simple, standardized, two step
process.  The program builder need not install any special tools in
order to build the program.

@node Tools
@section Tools

The GNU configure and build system is comprised of several different
tools.  Program developers must build and install all of these tools.

People who just want to build programs from distributed sources normally
do not need any special tools beyond a Unix shell, a make program, and a
C compiler.

@table @asis
@item autoconf
provides a general portability framework, based on testing the features
of the host system at build time.
@item automake
a system for describing how to build a program, permitting the developer
to write a simplified @file{Makefile}.
@item libtool
a standardized approach to building shared libraries.
@item gettext
provides a framework for translation of text messages into other
languages; not really discussed in this document.
@item m4
autoconf requires the GNU version of m4; the standard Unix m4 does not
suffice.
@item perl
automake requires perl.
@end table

@node History
@section History
@cindex history

This is a very brief and probably inaccurate history.

As the number of Unix variants increased during the 1980s, it became
harder to write programs which could run on all variants.  While it was
often possible to use @code{#ifdef} to identify particular systems,
developers frequently did not have access to every system, and the
characteristics of some systems changed from version to version.

By 1992, at least three different approaches had been developed:
@itemize @bullet
@item
The Metaconfig program, by Larry Wall, Harlan Stenn, and Raphael
Manfredi.
@item
The Cygnus configure script, by K. Richard Pixley, and the gcc configure
script, by Richard Stallman.  These use essentially the same approach,
and the developers communicated regularly.
@item
The autoconf program, by David MacKenzie.
@end itemize

The Metaconfig program is still used for Perl and a few other programs.
It is part of the Dist package.  I do not know if it is being developed.

In 1994, David MacKenzie and others modified autoconf to incorporate all
the features of Cygnus configure.  Since then, there has been a slow but
steady conversion of GNU programs from Cygnus configure to autoconf. gcc
has been converted, eliminating the gcc configure script.

GNU autoconf was regularly maintained until late 1996.  As of this
writing in June, 1998, it has no public maintainer.

Most programs are built using the make program, which requires the
developer to write Makefiles describing how to build the programs.
Since most programs are built in pretty much the same way, this led to a
lot of duplication.

The X Window system is built using the imake tool, which uses a database
of rules to eliminate the duplication.  However, building a tool which
was developed using imake requires that the builder have imake
installed, violating one of the goals of the GNU system.

The new BSD make provides a standard library of Makefile fragments,
which permits developers to write very simple Makefiles.  However, this
requires that the builder install the new BSD make program.

In 1994, David MacKenzie wrote the first version of automake, which
permitted writing a simple build description which was converted into a
Makefile which could be used by the standard make program.  In 1995, Tom
Tromey completely rewrote automake in Perl, and he continues to enhance
it.

Various free packages built libraries, and by around 1995 several
included support to build shared libraries on various platforms.
However, there was no consistent approach.  In early 1996, Gordon
Matzigkeit began working on libtool, which provided a standardized
approach to building shared libraries.  This was integrated into
automake from the start.

The development of automake and libtool was driven by the GNITS project,
a group of GNU maintainers who designed standardized tools to help meet
the GNU coding standards.

@node Building
@section Building

Most readers of this document should already know how to build a tool by
running @samp{configure} and @samp{make}.  This section may serve as a
quick introduction or reminder.

Building a tool is normally as simple as running @samp{configure}
followed by @samp{make}.  You should normally run @samp{configure} from
an empty directory, using some path to refer to the @samp{configure}
script in the source directory.  The directory in which you run
@samp{configure} is called the @dfn{object directory}.

In order to use a object directory which is different from the source
directory, you must be using the GNU version of @samp{make}, which has
the required @samp{VPATH} support.  Despite this restriction, using a
different object directory is highly recommended:
@itemize @bullet
@item
It keeps the files generated during the build from cluttering up your
sources.
@item 
It permits you to remove the built files by simply removing the entire
build directory.
@item
It permits you to build from the same sources with several sets of
configure options simultaneously.
@end itemize

If you don't have GNU @samp{make}, you will have to run @samp{configure}
in the source directory.  All GNU packages should support this; in
particular, GNU packages should not assume the presence of GNU
@samp{make}.

After running @samp{configure}, you can build the tools by running
@samp{make}.

To install the tools, run @samp{make install}.  Installing the tools
will copy the programs and any required support files to the
@dfn{installation directory}.  The location of the installation
directory is controlled by @samp{configure} options, as described below.

In the Cygnus tree at present, the info files are built and installed as
a separate step.  To build them, run @samp{make info}.  To install them,
run @samp{make install-info}.

All @samp{configure} scripts support a wide variety of options.  The
most interesting ones are @samp{--with} and @samp{--enable} options
which are generally specific to particular tools.  You can usually use
the @samp{--help} option to get a list of interesting options for a
particular configure script.

The only generic options you are likely to use are the @samp{--prefix}
and @samp{--exec-prefix} options.  These options are used to specify the
installation directory.

The directory named by the @samp{--prefix} option will hold machine
independent files such as info files.

The directory named by the @samp{--exec-prefix} option, which is
normally a subdirectory of the @samp{--prefix} directory, will hold
machine dependent files such as executables.

The default for @samp{--prefix} is @file{/usr/local}.  The default for
@samp{--exec-prefix} is the value used for @samp{--prefix}.

The convention used in Cygnus releases is to use a @samp{--prefix}
option of @file{/usr/cygnus/@var{release}}, where @var{release} is the
name of the release, and to use a @samp{--exec-prefix} option of
@file{/usr/cygnus/@var{release}/H-@var{host}}, where @var{host} is the
configuration name of the host system (@pxref{Configuration Names}).

Do not use either the source or the object directory as the installation
directory.  That will just lead to confusion.

@node Getting Started
@chapter Getting Started

To start using the GNU configure and build system with your software
package, you must write three files, and you must run some tools to
manually generate additional files.

@menu
* Write configure.in::		Write configure.in.
* Write Makefile.am::		Write Makefile.am.
* Write acconfig.h::		Write acconfig.h.
* Generate files::		Generate files.
* Getting Started Example::	Example.
@end menu

@node Write configure.in
@section Write configure.in
@cindex @file{configure.in}, writing

You must first write the file @file{configure.in}.  This is an autoconf
input file, and the autoconf manual describes in detail what this file
should look like.

You will write tests in your @file{configure.in} file to check for
conditions that may change from one system to another, such as the
presence of particular header files or functions.

For example, not all systems support the @samp{gettimeofday} function.
If you want to use the @samp{gettimeofday} function when it is
available, and to use some other function when it is not, you would
check for this by putting @samp{AC_CHECK_FUNCS(gettimeofday)} in
@file{configure.in}.

When the configure script is run at build time, this will arrange to
define the preprocessor macro @samp{HAVE_GETTIMEOFDAY} to the value 1 if
the @samp{gettimeofday} function is available, and to not define the
macro at all if the function is not available.  Your code can then use
@samp{#ifdef} to test whether it is safe to call @samp{gettimeofday}.

If you have an existing body of code, the @samp{autoscan} program may
help identify potential portability problems, and hence configure tests
that you will want to use.
@ifnothtml
@xref{Invoking autoscan, , , autoconf, the autoconf manual}.
@end ifnothtml
@ifhtml
See @uref{http://www.delorie.com/gnu/docs/autoconf/autoconf_4.html, the
autoscan documentation}.
@end ifhtml

Another handy tool for an existing body of code is @samp{ifnames}.  This
will show you all the preprocessor conditionals that the code already
uses.
@ifnothtml
@xref{Invoking ifnames, , , autoconf, the autoconf manual}.
@end ifnothtml
@ifhtml
See @uref{http://www.delorie.com/gnu/docs/autoconf/autoconf_5.html, the
ifnames documentation}.
@end ifhtml

Besides the portability tests which are specific to your particular
package, every @file{configure.in} file should contain the following
macros.

@table @samp
@item AC_INIT
@cindex @samp{AC_INIT}
This macro takes a single argument, which is the name of a file in your
package.  For example, @samp{AC_INIT(foo.c)}.

@item AC_PREREQ(@var{VERSION})
@cindex @samp{AC_PREREQ}
This macro is optional.  It may be used to indicate the version of
@samp{autoconf} that you are using.  This will prevent users from
running an earlier version of @samp{autoconf} and perhaps getting an
invalid @file{configure} script.  For example, @samp{AC_PREREQ(2.12)}.

@item AM_INIT_AUTOMAKE
@cindex @samp{AM_INIT_AUTOMAKE}
This macro takes two arguments: the name of the package, and a version
number.  For example, @samp{AM_INIT_AUTOMAKE(foo, 1.0)}.  (This macro is
not needed if you are not using automake).

@item AM_CONFIG_HEADER
@cindex @samp{AM_CONFIG_HEADER}
This macro names the header file which will hold the preprocessor macro
definitions at run time.  Normally this should be @file{config.h}.  Your
sources would then use @samp{#include "config.h"} to include it.

This macro may optionally name the input file for that header file; by
default, this is @file{config.h.in}, but that file name works poorly on
DOS filesystems.  Therefore, it is often better to name it explicitly as
@file{config.in}.

This is what you should normally put in @file{configure.in}:
@example
AM_CONFIG_HEADER(config.h:config.in)
@end example

@cindex @samp{AC_CONFIG_HEADER}
(If you are not using automake, use @samp{AC_CONFIG_HEADER} rather than
@samp{AM_CONFIG_HEADER}).

@item AM_MAINTAINER_MODE
@cindex @samp{AM_MAINTAINER_MODE}
This macro always appears in Cygnus configure scripts.  Other programs
may or may not use it.

If this macro is used, the @samp{--enable-maintainer-mode} option is
required to enable automatic rebuilding of generated files used by the
configure system.  This of course requires that developers be aware of,
and use, that option.

If this macro is not used, then the generated files will always be
rebuilt automatically.  This will cause problems if the wrong versions
of autoconf, automake, or others are in the builder's @samp{PATH}.

(If you are not using automake, you do not need to use this macro).

@item AC_EXEEXT
@cindex @samp{AC_EXEEXT}
@cindex @samp{AM_EXEEXT}
Either this macro or @samp{AM_EXEEXT} always appears in Cygnus configure
files.  Other programs may or may not use one of them.

This macro looks for the executable suffix used on the host system.  On
Unix systems, this is the empty string.  On Windows systems, this is
@samp{.exe}.  This macro directs automake to use the executable suffix
as appropriate when creating programs.  This macro does not take any
arguments.

The @samp{AC_EXEEXT} form is new, and is part of a Cygnus patch to
autoconf to support compiling with Visual C++.  Older programs use
@samp{AM_EXEEXT} instead.

(Programs which do not use automake use neither @samp{AC_EXEEXT} nor
@samp{AM_EXEEXT}).

@item AC_PROG_CC
@cindex @samp{AC_PROG_CC}
If you are writing C code, you will normally want to use this macro.  It
locates the C compiler to use.  It does not take any arguments.

However, if this @file{configure.in} file is for a library which is to
be compiled by a cross compiler which may not fully work, then you will
not want to use @samp{AC_PROG_CC}.  Instead, you will want to use a
variant which does not call the macro @samp{AC_PROG_CC_WORKS}.  Examples
can be found in various @file{configure.in} files for libraries that are
compiled with cross compilers, such as libiberty or libgloss.  This is
essentially a bug in autoconf, and there will probably be a better
workaround at some point.

@item AC_PROG_CXX
@cindex @samp{AC_PROG_CXX}
If you are writing C++ code, you will want to use this macro.  It
locates the C++ compiler to use.  It does not take any arguments.  The
same cross compiler comments apply as for @samp{AC_PROG_CC}.

@item AM_PROG_LIBTOOL
@cindex @samp{AM_PROG_LIBTOOL}
If you want to build libraries, and you want to permit them to be
shared, or you want to link against libraries which were built using
libtool, then you will need this macro.  This macro is required in order
to use libtool.

@cindex @samp{AM_DISABLE_SHARED}
By default, this will cause all libraries to be built as shared
libraries.  To prevent this--to change the default--use
@samp{AM_DISABLE_SHARED} before @samp{AM_PROG_LIBTOOL}.  The configure
options @samp{--enable-shared} and @samp{--disable-shared} may be used
to override the default at build time.

@item AC_DEFINE(_GNU_SOURCE)
@cindex @samp{_GNU_SOURCE}
GNU packages should normally include this line before any other feature
tests.  This defines the macro @samp{_GNU_SOURCE} when compiling, which
directs the libc header files to provide the standard GNU system
interfaces including all GNU extensions.  If this macro is not defined,
certain GNU extensions may not be available.

@item AC_OUTPUT
@cindex @samp{AC_OUTPUT}
This macro takes a list of file names which the configure process should
produce.  This is normally a list of one or more @file{Makefile} files
in different directories.  If your package lives entirely in a single
directory, you would use simply @samp{AC_OUTPUT(Makefile)}.  If you also
have, for example, a @file{lib} subdirectory, you would use
@samp{AC_OUTPUT(Makefile lib/Makefile)}.
@end table

If you want to use locally defined macros in your @file{configure.in}
file, then you will need to write a @file{acinclude.m4} file which
defines them (if not using automake, this file is called
@file{aclocal.m4}).  Alternatively, you can put separate macros in an
@file{m4} subdirectory, and put @samp{ACLOCAL_AMFLAGS = -I m4} in your
@file{Makefile.am} file so that the @samp{aclocal} program will be able
to find them.

The different macro prefixes indicate which tool defines the macro.
Macros which start with @samp{AC_} are part of autoconf.  Macros which
start with @samp{AM_} are provided by automake or libtool.

@node Write Makefile.am
@section Write Makefile.am
@cindex @file{Makefile.am}, writing

You must write the file @file{Makefile.am}.  This is an automake input
file, and the automake manual describes in detail what this file should
look like.

The automake commands in @file{Makefile.am} mostly look like variable
assignments in a @file{Makefile}.  automake recognizes special variable
names, and automatically add make rules to the output as needed.

There will be one @file{Makefile.am} file for each directory in your
package.  For each directory with subdirectories, the @file{Makefile.am}
file should contain the line
@smallexample
SUBDIRS = @var{dir} @var{dir} @dots{}
@end smallexample
@noindent
where each @var{dir} is the name of a subdirectory.

For each @file{Makefile.am}, there should be a corresponding
@file{Makefile} in the @samp{AC_OUTPUT} macro in @file{configure.in}.

Every @file{Makefile.am} written at Cygnus should contain the line
@smallexample
AUTOMAKE_OPTIONS = cygnus
@end smallexample
@noindent
This puts automake into Cygnus mode.  See the automake manual for
details.

You may to include the version number of @samp{automake} that you are
using on the @samp{AUTOMAKE_OPTIONS} line.  For example,
@smallexample
AUTOMAKE_OPTIONS = cygnus 1.3
@end smallexample
@noindent
This will prevent users from running an earlier version of
@samp{automake} and perhaps getting an invalid @file{Makefile.in}.

If your package builds a program, then in the directory where that
program is built you will normally want a line like
@smallexample
bin_PROGRAMS = @var{program}
@end smallexample
@noindent
where @var{program} is the name of the program.  You will then want a
line like
@smallexample
@var{program}_SOURCES = @var{file} @var{file} @dots{}
@end smallexample
@noindent
where each @var{file} is the name of a source file to link into the
program (e.g., @samp{foo.c}).

If your package builds a library, and you do not want the library to
ever be built as a shared library, then in the directory where that
library is built you will normally want a line like
@smallexample
lib_LIBRARIES = lib@var{name}.a
@end smallexample
@noindent
where @samp{lib@var{name}.a} is the name of the library.  You will then
want a line like
@smallexample
lib@var{name}_a_SOURCES = @var{file} @var{file} @dots{}
@end smallexample
@noindent
where each @var{file} is the name of a source file to add to the
library.

If your package builds a library, and you want to permit building the
library as a shared library, then in the directory where that library is
built you will normally want a line like
@smallexample
lib_LTLIBRARIES = lib@var{name}.la
@end smallexample
The use of @samp{LTLIBRARIES}, and the @samp{.la} extension, indicate a
library to be built using libtool.  As usual, you will then want a line
like
@smallexample
lib@var{name}_la_SOURCES = @var{file} @var{file} @dots{}
@end smallexample

The strings @samp{bin} and @samp{lib} that appear above in
@samp{bin_PROGRAMS} and @samp{lib_LIBRARIES} are not arbitrary.  They
refer to particular directories, which may be set by the @samp{--bindir}
and @samp{--libdir} options to @file{configure}.  If those options are
not used, the default values are based on the @samp{--prefix} or
@samp{--exec-prefix} options to @file{configure}.  It is possible to use
other names if the program or library should be installed in some other
directory.

The @file{Makefile.am} file may also contain almost anything that may
appear in a normal @file{Makefile}.  automake also supports many other
special variables, as well as conditionals.

See the automake manual for more information.

@node Write acconfig.h
@section Write acconfig.h
@cindex @file{acconfig.h}, writing

If you are generating a portability header file, (i.e., you are using
@samp{AM_CONFIG_HEADER} in @file{configure.in}), then you will have to
write a @file{acconfig.h} file.  It will have to contain the following
lines.

@smallexample
/* Name of package.  */
#undef PACKAGE

/* Version of package.  */
#undef VERSION
@end smallexample

This requirement is really a bug in the system, and the requirement may
be eliminated at some later date.

The @file{acconfig.h} file will also similar comment and @samp{#undef}
lines for any unusual macros in the @file{configure.in} file, including
any macro which appears in a @samp{AC_DEFINE} macro.

In particular, if you are writing a GNU package and therefore include
@samp{AC_DEFINE(_GNU_SOURCE)} in @file{configure.in} as suggested above,
you will need lines like this in @file{acconfig.h}:
@smallexample
/* Enable GNU extensions.  */
#undef _GNU_SOURCE
@end smallexample

Normally the @samp{autoheader} program will inform you of any such
requirements by printing an error message when it is run.  However, if
you do anything particular odd in your @file{configure.in} file, you
will have to make sure that the right entries appear in
@file{acconfig.h}, since otherwise the results of the tests may not be
available in the @file{config.h} file which your code will use.

(Thee @samp{PACKAGE} and @samp{VERSION} lines are not required if you
are not using automake, and in that case you may not need a
@file{acconfig.h} file at all).

@node Generate files
@section Generate files

Once you have written @file{configure.in}, @file{Makefile.am},
@file{acconfig.h}, and possibly @file{acinclude.m4}, you must use
autoconf and automake programs to produce the first versions of the
generated files.  This is done by executing the following sequence of
commands.

@smallexample
aclocal
autoconf
autoheader
automake
@end smallexample

The @samp{aclocal} and @samp{automake} commands are part of the automake
package, and the @samp{autoconf} and @samp{autoheader} commands are part
of the autoconf package.

If you are using a @file{m4} subdirectory for your macros, you will need
to use the @samp{-I m4} option when you run @samp{aclocal}.

If you are not using the Cygnus tree, use the @samp{-a} option when
running @samp{automake} command in order to copy the required support
files into your source directory.

If you are using libtool, you must build and install the libtool package
with the same @samp{--prefix} and @samp{--exec-prefix} options as you
used with the autoconf and automake packages.  You must do this before
running any of the above commands.  If you are not using the Cygnus
tree, you will need to run the @samp{libtoolize} program to copy the
libtool support files into your directory.

Once you have managed to run these commands without getting any errors,
you should create a new empty directory, and run the @samp{configure}
script which will have been created by @samp{autoconf} with the
@samp{--enable-maintainer-mode} option.  This will give you a set of
Makefiles which will include rules to automatically rebuild all the
generated files.

After doing that, whenever you have changed some of the input files and
want to regenerated the other files, go to your object directory and run
@samp{make}.  Doing this is more reliable than trying to rebuild the
files manually, because there are complex order dependencies and it is
easy to forget something.

@node Getting Started Example
@section Example

Let's consider a trivial example.

Suppose we want to write a simple version of @samp{touch}.  Our program,
which we will call @samp{poke}, will take a single file name argument,
and use the @samp{utime} system call to set the modification and access
times of the file to the current time.  We want this program to be
highly portable.

We'll first see what this looks like without using autoconf and
automake, and then see what it looks like with them.

@menu
* Getting Started Example 1::		First Try.
* Getting Started Example 2::		Second Try.
* Getting Started Example 3::		Third Try.
* Generate Files in Example::		Generate Files.
@end menu

@node Getting Started Example 1
@subsection First Try

Here is our first try at @samp{poke.c}.  Note that we've written it
without ANSI/ISO C prototypes, since we want it to be highly portable.

@example
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <utime.h>

int
main (argc, argv)
     int argc;
     char **argv;
@{
  if (argc != 2)
    @{
      fprintf (stderr, "Usage: poke file\n");
      exit (1);
    @}

  if (utime (argv[1], NULL) < 0)
    @{
      perror ("utime");
      exit (1);
    @}

  exit (0);
@}
@end example

We also write a simple @file{Makefile}.

@example
CC = gcc
CFLAGS = -g -O2

all: poke

poke: poke.o
	$(CC) -o poke $(CFLAGS) $(LDFLAGS) poke.o
@end example

So far, so good.

Unfortunately, there are a few problems.

On older Unix systems derived from BSD 4.3, the @samp{utime} system call
does not accept a second argument of @samp{NULL}.  On those systems, we
need to pass a pointer to @samp{struct utimbuf} structure.
Unfortunately, even older systems don't define that structure; on those
systems, we need to pass an array of two @samp{long} values.

The header file @file{stdlib.h} was invented by ANSI C, and older
systems don't have a copy.  We included it above to get a declaration of
@samp{exit}.

We can find some of these portability problems by running
@samp{autoscan}, which will create a @file{configure.scan} file which we
can use as a prototype for our @file{configure.in} file.  I won't show
the output, but it will notice the potential problems with @samp{utime}
and @file{stdlib.h}.

In our @file{Makefile}, we don't provide any way to install the program.
This doesn't matter much for such a simple example, but a real program
will need an @samp{install} target.  For that matter, we will also want
a @samp{clean} target.

@node Getting Started Example 2
@subsection Second Try

Here is our second try at this program.

We modify @file{poke.c} to use preprocessor macros to control what
features are available.  (I've cheated a bit by using the same macro
names which autoconf will use).

@example
#include <stdio.h>

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif

#include <sys/types.h>

#ifdef HAVE_UTIME_H
#include <utime.h>
#endif

#ifndef HAVE_UTIME_NULL

#include <time.h>

#ifndef HAVE_STRUCT_UTIMBUF

struct utimbuf
@{
  long actime;
  long modtime;
@};

#endif

static int
utime_now (file)
     char *file;
@{
  struct utimbuf now;

  now.actime = now.modtime = time (NULL);
  return utime (file, &now);
@}

#define utime(f, p) utime_now (f)

#endif /* HAVE_UTIME_NULL  */

int
main (argc, argv)
     int argc;
     char **argv;
@{
  if (argc != 2)
    @{
      fprintf (stderr, "Usage: poke file\n");
      exit (1);
    @}

  if (utime (argv[1], NULL) < 0)
    @{
      perror ("utime");
      exit (1);
    @}

  exit (0);
@}
@end example

Here is the associated @file{Makefile}.  We've added support for the
preprocessor flags we use.  We've also added @samp{install} and
@samp{clean} targets.

@example
# Set this to your installation directory.
bindir = /usr/local/bin

# Uncomment this if you have the standard ANSI/ISO C header files.
# STDC_HDRS = -DSTDC_HEADERS

# Uncomment this if you have utime.h.
# UTIME_H = -DHAVE_UTIME_H

# Uncomment this if utime (FILE, NULL) works on your system.
# UTIME_NULL = -DHAVE_UTIME_NULL

# Uncomment this if struct utimbuf is defined in utime.h.
# UTIMBUF = -DHAVE_STRUCT_UTIMBUF

CC = gcc
CFLAGS = -g -O2

ALL_CFLAGS = $(STDC_HDRS) $(UTIME_H) $(UTIME_NULL) $(UTIMBUF) $(CFLAGS)

all: poke

poke: poke.o
	$(CC) -o poke $(ALL_CFLAGS) $(LDFLAGS) poke.o

.c.o:
	$(CC) -c $(ALL_CFLAGS) poke.c

install: poke
	cp poke $(bindir)/poke

clean:
	rm poke poke.o
@end example

Some problems with this approach should be clear.

Users who want to compile poke will have to know how @samp{utime} works
on their systems, so that they can uncomment the @file{Makefile}
correctly.

The installation is done using @samp{cp}, but many systems have an
@samp{install} program which may be used, and which supports optional
features such as stripping debugging information out of the installed
binary.

The use of @file{Makefile} variables like @samp{CC}, @samp{CFLAGS} and
@samp{LDFLAGS} follows the requirements of the GNU standards.  This is
convenient for all packages, since it reduces surprises for users.
However, it is easy to get the details wrong, and wind up with a
slightly nonstandard distribution.

@node Getting Started Example 3
@subsection Third Try

For our third try at this program, we will write a @file{configure.in}
script to discover the configuration features on the host system, rather
than requiring the user to edit the @file{Makefile}.  We will also write
a @file{Makefile.am} rather than a @file{Makefile}.

The only change to @file{poke.c} is to add a line at the start of the
file:
@smallexample
#include "config.h"
@end smallexample

The new @file{configure.in} file is as follows.

@example
AC_INIT(poke.c)
AM_INIT_AUTOMAKE(poke, 1.0)
AM_CONFIG_HEADER(config.h:config.in)
AC_PROG_CC
AC_HEADER_STDC
AC_CHECK_HEADERS(utime.h)
AC_EGREP_HEADER(utimbuf, utime.h, AC_DEFINE(HAVE_STRUCT_UTIMBUF))
AC_FUNC_UTIME_NULL
AC_OUTPUT(Makefile)
@end example

The first four macros in this file, and the last one, were described
above; see @ref{Write configure.in}.  If we omit these macros, then when
we run @samp{automake} we will get a reminder that we need them.

The other macros are standard autoconf macros.

@table @samp
@item AC_HEADER_STDC
Check for standard C headers.
@item AC_CHECK_HEADERS
Check whether a particular header file exists.
@item AC_EGREP_HEADER
Check for a particular string in a particular header file, in this case
checking for @samp{utimbuf} in @file{utime.h}.
@item AC_FUNC_UTIME_NULL
Check whether @samp{utime} accepts a NULL second argument to set the
file change time to the current time.
@end table

See the autoconf manual for a more complete description.

The new @file{Makefile.am} file is as follows.  Note how simple this is
compared to our earlier @file{Makefile}.

@example
bin_PROGRAMS = poke

poke_SOURCES = poke.c
@end example

This means that we should build a single program name @samp{poke}.  It
should be installed in the binary directory, which we called
@samp{bindir} earlier.  The program @samp{poke} is built from the source
file @file{poke.c}.

We must also write a @file{acconfig.h} file.  Besides @samp{PACKAGE} and
@samp{VERSION}, which must be mentioned for all packages which use
automake, we must include @samp{HAVE_STRUCT_UTIMBUF}, since we mentioned
it in an @samp{AC_DEFINE}.

@example
/* Name of package.  */
#undef PACKAGE

/* Version of package.  */
#undef VERSION

/* Whether utime.h defines struct utimbuf.  */
#undef HAVE_STRUCT_UTIMBUF
@end example

@node Generate Files in Example
@subsection Generate Files

We must now generate the other files, using the following commands.

@smallexample
aclocal
autoconf
autoheader
automake
@end smallexample

When we run @samp{autoheader}, it will remind us of any macros we forgot
to add to @file{acconfig.h}.

When we run @samp{automake}, it will want to add some files to our
distribution.  It will add them automatically if we use the
@samp{--add-missing} option.

By default, @samp{automake} will run in GNU mode, which means that it
will want us to create certain additional files; as of this writing, it
will want @file{NEWS}, @file{README}, @file{AUTHORS}, and
@file{ChangeLog}, all of which are files which should appear in a
standard GNU distribution.  We can either add those files, or run
@samp{automake} with the @samp{--foreign} option.

Running these tools will generate the following files, all of which are
described in the next chapter.

@itemize @bullet
@item
@file{aclocal.m4}
@item
@file{configure}
@item
@file{config.in}
@item
@file{Makefile.in}
@item
@file{stamp-h.in}
@end itemize

@node Files
@chapter Files

As was seen in the previous chapter, the GNU configure and build system
uses a number of different files.  The developer must write a few files.
The others are generated by various tools.

The system is rather flexible, and can be used in many different ways.
In describing the files that it uses, I will describe the common case,
and mention some other cases that may arise.

@menu
* Developer Files::		Developer Files.
* Build Files::			Build Files.
* Support Files::		Support Files.
@end menu

@node Developer Files
@section Developer Files

This section describes the files written or generated by the developer
of a package.

@menu
* Developer Files Picture::	Developer Files Picture.
* Written Developer Files::	Written Developer Files.
* Generated Developer Files::	Generated Developer Files.
@end menu

@node Developer Files Picture
@subsection Developer Files Picture

Here is a picture of the files which are written by the developer, the
generated files which would be included with a complete source
distribution, and the tools which create those files.
@ifinfo
The file names are plain text and the tool names are enclosed by
@samp{*} characters
@end ifinfo
@ifnotinfo
The file names are in rectangles with square corners and the tool names
are in rectangles with rounded corners
@end ifnotinfo
(e.g., @samp{autoheader} is the name of a tool, not the name of a file).

@image{configdev}

@node Written Developer Files
@subsection Written Developer Files

The following files would be written by the developer.

@table @file
@item configure.in
@cindex @file{configure.in}
This is the configuration script.  This script contains invocations of
autoconf macros.  It may also contain ordinary shell script code.  This
file will contain feature tests for portability issues.  The last thing
in the file will normally be an @samp{AC_OUTPUT} macro listing which
files to create when the builder runs the configure script.  This file
is always required when using the GNU configure system.  @xref{Write
configure.in}.

@item Makefile.am
@cindex @file{Makefile.am}
This is the automake input file.  It describes how the code should be
built.  It consists of definitions of automake variables.  It may also
contain ordinary Makefile targets.  This file is only needed when using
automake (newer tools normally use automake, but there are still older
tools which have not been converted, in which the developer writes
@file{Makefile.in} directly).  @xref{Write Makefile.am}.

@item acconfig.h
@cindex @file{acconfig.h}
When the configure script creates a portability header file, by using
@samp{AM_CONFIG_HEADER} (or, if not using automake,
@samp{AC_CONFIG_HEADER}), this file is used to describe macros which are
not recognized by the @samp{autoheader} command.  This is normally a
fairly uninteresting file, consisting of a collection of @samp{#undef}
lines with comments.  Normally any call to @samp{AC_DEFINE} in
@file{configure.in} will require a line in this file. @xref{Write
acconfig.h}.

@item acinclude.m4
@cindex @file{acinclude.m4}
This file is not always required.  It defines local autoconf macros.
These macros may then be used in @file{configure.in}.  If you don't need
any local autoconf macros, then you don't need this file at all.  In
fact, in general, you never need local autoconf macros, since you can
put everything in @file{configure.in}, but sometimes a local macro is
convenient.

Newer tools may omit @file{acinclude.m4}, and instead use a
subdirectory, typically named @file{m4}, and define
@samp{ACLOCAL_AMFLAGS = -I m4} in @file{Makefile.am} to force
@samp{aclocal} to look there for macro definitions.  The macro
definitions are then placed in separate files in that directory.

The @file{acinclude.m4} file is only used when using automake; in older
tools, the developer writes @file{aclocal.m4} directly, if it is needed.
@end table

@node Generated Developer Files
@subsection Generated Developer Files

The following files would be generated by the developer.

When using automake, these files are normally not generated manually
after the first time.  Instead, the generated @file{Makefile} contains
rules to automatically rebuild the files as required.  When
@samp{AM_MAINTAINER_MODE} is used in @file{configure.in} (the normal
case in Cygnus code), the automatic rebuilding rules will only be
defined if you configure using the @samp{--enable-maintainer-mode}
option.

When using automatic rebuilding, it is important to ensure that all the
various tools have been built and installed on your @samp{PATH}.  Using
automatic rebuilding is highly recommended, so much so that I'm not
going to explain what you have to do if you don't use it.

@table @file
@item configure
@cindex @file{configure}
This is the configure script which will be run when building the
package.  This is generated by @samp{autoconf} from @file{configure.in}
and @file{aclocal.m4}.  This is a shell script.

@item Makefile.in
@cindex @file{Makefile.in}
This is the file which the configure script will turn into the
@file{Makefile} at build time.  This file is generated by
@samp{automake} from @file{Makefile.am}.  If you aren't using automake,
you must write this file yourself.  This file is pretty much a normal
@file{Makefile}, with some configure substitutions for certain
variables.

@item aclocal.m4
@cindex @file{aclocal.m4}
This file is created by the @samp{aclocal} program, based on the
contents of @file{configure.in} and @file{acinclude.m4} (or, as noted in
the description of @file{acinclude.m4} above, on the contents of an
@file{m4} subdirectory).  This file contains definitions of autoconf
macros which @samp{autoconf} will use when generating the file
@file{configure}.  These autoconf macros may be defined by you in
@file{acinclude.m4} or they may be defined by other packages such as
automake, libtool or gettext.  If you aren't using automake, you will
normally write this file yourself; in that case, if @file{configure.in}
uses only standard autoconf macros, this file will not be needed at all.

@item config.in
@cindex @file{config.in}
@cindex @file{config.h.in}
This file is created by @samp{autoheader} based on @file{acconfig.h} and
@file{configure.in}.  At build time, the configure script will define
some of the macros in it to create @file{config.h}, which may then be
included by your program.  This permits your C code to use preprocessor
conditionals to change its behaviour based on the characteristics of the
host system.  This file may also be called @file{config.h.in}.

@item stamp.h-in
@cindex @file{stamp-h.in}
This rather uninteresting file, which I omitted from the picture, is
generated by @samp{automake}.  It always contains the string
@samp{timestamp}.  It is used as a timestamp file indicating whether
@file{config.in} is up to date.  Using a timestamp file means that
@file{config.in} can be marked as up to date without actually changing
its modification time.  This is useful since @file{config.in} depends
upon @file{configure.in}, but it is easy to change @file{configure.in}
in a way which does not affect @file{config.in}.
@end table

@node Build Files
@section Build Files

This section describes the files which are created at configure and
build time.  These are the files which somebody who builds the package
will see.

Of course, the developer will also build the package.  The distinction
between developer files and build files is not that the developer does
not see the build files, but that somebody who only builds the package
does not have to worry about the developer files.

@menu
* Build Files Picture::		Build Files Picture.
* Build Files Description::	Build Files Description.
@end menu

@node Build Files Picture
@subsection Build Files Picture

Here is a picture of the files which will be created at build time.
@file{config.status} is both a created file and a shell script which is
run to create other files, and the picture attempts to show that.

@image{configbuild}

@node Build Files Description
@subsection Build Files Description

This is a description of the files which are created at build time.

@table @file
@item config.status
@cindex @file{config.status}
The first step in building a package is to run the @file{configure}
script.  The @file{configure} script will create the file
@file{config.status}, which is itself a shell script.  When you first
run @file{configure}, it will automatically run @file{config.status}.
An @file{Makefile} derived from an automake generated @file{Makefile.in}
will contain rules to automatically run @file{config.status} again when
necessary to recreate certain files if their inputs change.

@item Makefile
@cindex @file{Makefile}
This is the file which make will read to build the program.  The
@file{config.status} script will transform @file{Makefile.in} into
@file{Makefile}.

@item config.h
@cindex @file{config.h}
This file defines C preprocessor macros which C code can use to adjust
its behaviour on different systems.  The @file{config.status} script
will transform @file{config.in} into @file{config.h}.

@item config.cache
@cindex @file{config.cache}
This file did not fit neatly into the picture, and I omitted it.  It is
used by the @file{configure} script to cache results between runs.  This
can be an important speedup.  If you modify @file{configure.in} in such
a way that the results of old tests should change (perhaps you have
added a new library to @samp{LDFLAGS}), then you will have to remove
@file{config.cache} to force the tests to be rerun.

The autoconf manual explains how to set up a site specific cache file.
This can speed up running @file{configure} scripts on your system.

@item stamp.h
@cindex @file{stamp-h}
This file, which I omitted from the picture, is similar to
@file{stamp-h.in}.  It is used as a timestamp file indicating whether
@file{config.h} is up to date.  This is useful since @file{config.h}
depends upon @file{config.status}, but it is easy for
@file{config.status} to change in a way which does not affect
@file{config.h}.
@end table

@node Support Files
@section Support Files

The GNU configure and build system requires several support files to be
included with your distribution.  You do not normally need to concern
yourself with these.  If you are using the Cygnus tree, most are already
present.  Otherwise, they will be installed with your source by
@samp{automake} (with the @samp{--add-missing} option) and
@samp{libtoolize}.

You don't have to put the support files in the top level directory.  You
can put them in a subdirectory, and use the @samp{AC_CONFIG_AUX_DIR}
macro in @file{configure.in} to tell @samp{automake} and the
@file{configure} script where they are.

In this section, I describe the support files, so that you can know what
they are and why they are there.

@table @file
@item ABOUT-NLS
Added by automake if you are using gettext.  This is a documentation
file about the gettext project.
@item ansi2knr.c
Used by an automake generated @file{Makefile} if you put @samp{ansi2knr}
in @samp{AUTOMAKE_OPTIONS} in @file{Makefile.am}.  This permits
compiling ANSI C code with a K&R C compiler.
@item ansi2knr.1
The man page which goes with @file{ansi2knr.c}.
@item config.guess
A shell script which determines the configuration name for the system on
which it is run.
@item config.sub
A shell script which canonicalizes a configuration name entered by a
user.
@item elisp-comp
Used to compile Emacs LISP files.
@item install-sh
A shell script which installs a program.  This is used if the configure
script can not find an install binary.
@item ltconfig
Used by libtool.  This is a shell script which configures libtool for
the particular system on which it is used.
@item ltmain.sh
Used by libtool.  This is the actual libtool script which is used, after
it is configured by @file{ltconfig} to build a library.
@item mdate-sh
A shell script used by an automake generated @file{Makefile} to pretty
print the modification time of a file.  This is used to maintain version
numbers for texinfo files.
@item missing
A shell script used if some tool is missing entirely.  This is used by
an automake generated @file{Makefile} to avoid certain sorts of
timestamp problems.
@item mkinstalldirs
A shell script which creates a directory, including all parent
directories.  This is used by an automake generated @file{Makefile}
during installation.
@item texinfo.tex
Required if you have any texinfo files.  This is used when converting
Texinfo files into DVI using @samp{texi2dvi} and @TeX{}.
@item ylwrap
A shell script used by an automake generated @file{Makefile} to run
programs like @samp{bison}, @samp{yacc}, @samp{flex}, and @samp{lex}.
These programs default to producing output files with a fixed name, and
the @file{ylwrap} script runs them in a subdirectory to avoid file name
conflicts when using a parallel make program.
@end table

@node Configuration Names
@chapter Configuration Names
@cindex configuration names
@cindex configuration triplets
@cindex triplets
@cindex host names
@cindex host triplets
@cindex canonical system names
@cindex system names
@cindex system types

The GNU configure system names all systems using a @dfn{configuration
name}.  All such names used to be triplets (they may now contain four
parts in certain cases), and the term @dfn{configuration triplet} is
still seen.

@menu
* Configuration Name Definition::	Configuration Name Definition.
* Using Configuration Names::		Using Configuration Names.
@end menu

@node Configuration Name Definition
@section Configuration Name Definition

This is a string of the form
@var{cpu}-@var{manufacturer}-@var{operating_system}.  In some cases,
this is extended to a four part form:
@var{cpu}-@var{manufacturer}-@var{kernel}-@var{operating_system}.

When using a configuration name in a configure option, it is normally
not necessary to specify an entire name.  In particular, the
@var{manufacturer} field is often omitted, leading to strings such as
@samp{i386-linux} or @samp{sparc-sunos}.  The shell script
@file{config.sub} will translate these shortened strings into the
canonical form.  autoconf will arrange for @file{config.sub} to be run
automatically when it is needed.

The fields of a configuration name are as follows:

@table @var
@item cpu
The type of processor.  This is typically something like @samp{i386} or
@samp{sparc}.  More specific variants are used as well, such as
@samp{mipsel} to indicate a little endian MIPS processor.
@item manufacturer
A somewhat freeform field which indicates the manufacturer of the
system.  This is often simply @samp{unknown}.  Other common strings are
@samp{pc} for an IBM PC compatible system, or the name of a workstation
vendor, such as @samp{sun}.
@item operating_system
The name of the operating system which is run on the system.  This will
be something like @samp{solaris2.5} or @samp{irix6.3}.  There is no
particular restriction on the version number, and strings like
@samp{aix4.1.4.0} are seen.  For an embedded system, which has no
operating system, this field normally indicates the type of object file
format, such as @samp{elf} or @samp{coff}.
@item kernel
This is used mainly for GNU/Linux.  A typical GNU/Linux configuration
name is @samp{i586-pc-linux-gnulibc1}.  In this case the kernel,
@samp{linux}, is separated from the operating system, @samp{gnulibc1}.
@end table

The shell script @file{config.guess} will normally print the correct
configuration name for the system on which it is run.  It does by
running @samp{uname} and by examining other characteristics of the
system.

Because @file{config.guess} can normally determine the configuration
name for a machine, it is normally only necessary to specify a
configuration name when building a cross-compiler or when building using
a cross-compiler.

@node Using Configuration Names
@section Using Configuration Names

A configure script will sometimes have to make a decision based on a
configuration name.  You will need to do this if you have to compile
code differently based on something which can not be tested using a
standard autoconf feature test.

It is normally better to test for particular features, rather than to
test for a particular system.  This is because as Unix evolves,
different systems copy features from one another.  Even if you need to
determine whether the feature is supported based on a configuration
name, you should define a macro which describes the feature, rather than
defining a macro which describes the particular system you are on.

Testing for a particular system is normally done using a case statement
in @file{configure.in}.  The case statement might look something like
the following, assuming that @samp{host} is a shell variable holding a
canonical configuration name (which will be the case if
@file{configure.in} uses the @samp{AC_CANONICAL_HOST} or
@samp{AC_CANONICAL_SYSTEM} macro).

@smallexample
case "$@{host@}" in
i[3456]86-*-linux-gnu*) do something ;;
sparc*-sun-solaris2.[56789]*) do something ;;
sparc*-sun-solaris*) do something ;;
mips*-*-elf*) do something ;;
esac
@end smallexample

It is particularly important to use @samp{*} after the operating system
field, in order to match the version number which will be generated by
@file{config.guess}.

In most cases you must be careful to match a range of processor types.
For most processor families, a trailing @samp{*} suffices, as in
@samp{mips*} above.  For the i386 family, something along the lines of
@samp{i[3456]86} suffices at present.  For the m68k family, you will
need something like @samp{m68*}.  Of course, if you do not need to match
on the processor, it is simpler to just replace the entire field by a
@samp{*}, as in @samp{*-*-irix*}.

@node Cross Compilation Tools
@chapter Cross Compilation Tools
@cindex cross tools

The GNU configure and build system can be used to build @dfn{cross
compilation} tools.  A cross compilation tool is a tool which runs on
one system and produces code which runs on another system.

@menu
* Cross Compilation Concepts::		Cross Compilation Concepts.
* Host and Target::			Host and Target.
* Using the Host Type::			Using the Host Type.
* Specifying the Target::       	Specifying the Target.
* Using the Target Type::		Using the Target Type.
* Cross Tools in the Cygnus Tree::	Cross Tools in the Cygnus Tree
@end menu

@node Cross Compilation Concepts
@section Cross Compilation Concepts

@cindex cross compiler
A compiler which produces programs which run on a different system is a
cross compilation compiler, or simply a @dfn{cross compiler}.
Similarly, we speak of cross assemblers, cross linkers, etc.

In the normal case, a compiler produces code which runs on the same
system as the one on which the compiler runs.  When it is necessary to
distinguish this case from the cross compilation case, such a compiler
is called a @dfn{native compiler}.  Similarly, we speak of native
assemblers, etc.

Although the debugger is not strictly speaking a compilation tool, it is
nevertheless meaningful to speak of a cross debugger: a debugger which
is used to debug code which runs on another system.  Everything that is
said below about configuring cross compilation tools applies to the
debugger as well.

@node Host and Target
@section Host and Target
@cindex host system
@cindex target system

When building cross compilation tools, there are two different systems
involved: the system on which the tools will run, and the system for
which the tools generate code.

The system on which the tools will run is called the @dfn{host} system.

The system for which the tools generate code is called the @dfn{target}
system.

For example, suppose you have a compiler which runs on a GNU/Linux
system and generates ELF programs for a MIPS embedded system.  In this
case the GNU/Linux system is the host, and the MIPS ELF system is the
target.  Such a compiler could be called a GNU/Linux cross MIPS ELF
compiler, or, equivalently, a @samp{i386-linux-gnu} cross
@samp{mips-elf} compiler.

Naturally, most programs are not cross compilation tools.  For those
programs, it does not make sense to speak of a target.  It only makes
sense to speak of a target for tools like @samp{gcc} or the
@samp{binutils} which actually produce running code.  For example, it
does not make sense to speak of the target of a tool like @samp{bison}
or @samp{make}.

Most cross compilation tools can also serve as native tools.  For a
native compilation tool, it is still meaningful to speak of a target.
For a native tool, the target is the same as the host.  For example, for
a GNU/Linux native compiler, the host is GNU/Linux, and the target is
also GNU/Linux.

@node Using the Host Type
@section Using the Host Type

In almost all cases the host system is the system on which you run the
@samp{configure} script, and on which you build the tools (for the case
when they differ, @pxref{Canadian Cross}).

@cindex @samp{AC_CANONICAL_HOST}
If your configure script needs to know the configuration name of the
host system, and the package is not a cross compilation tool and
therefore does not have a target, put @samp{AC_CANONICAL_HOST} in
@file{configure.in}.  This macro will arrange to define a few shell
variables when the @samp{configure} script is run.

@table @samp
@item host
The canonical configuration name of the host.  This will normally be
determined by running the @file{config.guess} shell script, although the
user is permitted to override this by using an explicit @samp{--host}
option.
@item host_alias
In the unusual case that the user used an explicit @samp{--host} option,
this will be the argument to @samp{--host}.  In the normal case, this
will be the same as the @samp{host} variable.
@item host_cpu
@itemx host_vendor
@itemx host_os
The first three parts of the canonical configuration name.
@end table

The shell variables may be used by putting shell code in
@file{configure.in}.  For an example, see @ref{Using Configuration
Names}.

@node Specifying the Target
@section Specifying the Target

By default, the @samp{configure} script will assume that the target is
the same as the host.  This is the more common case; for example, it
leads to a native compiler rather than a cross compiler.

@cindex @samp{--target} option
@cindex target option
@cindex configure target
If you want to build a cross compilation tool, you must specify the
target explicitly by using the @samp{--target} option when you run
@samp{configure}.  The argument to @samp{--target} is the configuration
name of the system for which you wish to generate code.
@xref{Configuration Names}.

For example, to build tools which generate code for a MIPS ELF embedded
system, you would use @samp{--target mips-elf}.

@node Using the Target Type
@section Using the Target Type

@cindex @samp{AC_CANONICAL_SYSTEM}
When writing @file{configure.in} for a cross compilation tool, you will
need to use information about the target.  To do this, put
@samp{AC_CANONICAL_SYSTEM} in @file{configure.in}.

@samp{AC_CANONICAL_SYSTEM} will look for a @samp{--target} option and
canonicalize it using the @file{config.sub} shell script.  It will also
run @samp{AC_CANONICAL_HOST} (@pxref{Using the Host Type}).

The target type will be recorded in the following shell variables.  Note
that the host versions of these variables will also be defined by
@samp{AC_CANONICAL_HOST}.

@table @samp
@item target
The canonical configuration name of the target.
@item target_alias
The argument to the @samp{--target} option.  If the user did not specify
a @samp{--target} option, this will be the same as @samp{host_alias}.
@item target_cpu
@itemx target_vendor
@itemx target_os
The first three parts of the canonical target configuration name.
@end table

Note that if @samp{host} and @samp{target} are the same string, you can
assume a native configuration.  If they are different, you can assume a
cross configuration.

It is arguably possible for @samp{host} and @samp{target} to represent
the same system, but for the strings to not be identical.  For example,
if @samp{config.guess} returns @samp{sparc-sun-sunos4.1.4}, and somebody
configures with @samp{--target sparc-sun-sunos4.1}, then the slight
differences between the two versions of SunOS may be unimportant for
your tool.  However, in the general case it can be quite difficult to
determine whether the differences between two configuration names are
significant or not.  Therefore, by convention, if the user specifies a
@samp{--target} option without specifying a @samp{--host} option, it is
assumed that the user wants to configure a cross compilation tool.

The variables @samp{target} and @samp{target_alias} should be handled
differently.

In general, whenever the user may actually see a string,
@samp{target_alias} should be used.  This includes anything which may
appear in the file system, such as a directory name or part of a tool
name.  It also includes any tool output, unless it is clearly labelled
as the canonical target configuration name.  This permits the user to
use the @samp{--target} option to specify how the tool will appear to
the outside world.

On the other hand, when checking for characteristics of the target
system, @samp{target} should be used.  This is because a wide variety of
@samp{--target} options may map into the same canonical configuration
name.  You should not attempt to duplicate the canonicalization done by
@samp{config.sub} in your own code.

By convention, cross tools are installed with a prefix of the argument
used with the @samp{--target} option, also known as @samp{target_alias}
(@pxref{Using the Target Type}).  If the user does not use the
@samp{--target} option, and thus is building a native tool, no prefix is
used.

For example, if gcc is configured with @samp{--target mips-elf}, then
the installed binary will be named @samp{mips-elf-gcc}.  If gcc is
configured without a @samp{--target} option, then the installed binary
will be named @samp{gcc}.

The autoconf macro @samp{AC_ARG_PROGRAM} will handle this for you.  If
you are using automake, no more need be done; the programs will
automatically be installed with the correct prefixes.  Otherwise, see
the autoconf documentation for @samp{AC_ARG_PROGRAM}.

@node Cross Tools in the Cygnus Tree
@section Cross Tools in the Cygnus Tree

The Cygnus tree is used for various packages including gdb, the GNU
binutils, and egcs.  It is also, of course, used for Cygnus releases.

In the Cygnus tree, the top level @file{configure} script uses the old
Cygnus configure system, not autoconf.  The top level @file{Makefile.in}
is written to build packages based on what is in the source tree, and
supports building a large number of tools in a single
@samp{configure}/@samp{make} step.

The Cygnus tree may be configured with a @samp{--target} option.  The
@samp{--target} option applies recursively to every subdirectory, and
permits building an entire set of cross tools at once.

@menu
* Host and Target Libraries::		Host and Target Libraries.
* Target Library Configure Scripts::	Target Library Configure Scripts.
* Make Targets in Cygnus Tree::         Make Targets in Cygnus Tree.
* Target libiberty::			Target libiberty
@end menu

@node Host and Target Libraries
@subsection Host and Target Libraries

The Cygnus tree distinguishes host libraries from target libraries.

Host libraries are built with the compiler used to build the programs
which run on the host, which is called the host compiler.  This includes
libraries such as @samp{bfd} and @samp{tcl}.  These libraries are built
with the host compiler, and are linked into programs like the binutils
or gcc which run on the host.

Target libraries are built with the target compiler.  If gcc is present
in the source tree, then the target compiler is the gcc that is built
using the host compiler.  Target libraries are libraries such as
@samp{newlib} and @samp{libstdc++}.  These libraries are not linked into
the host programs, but are instead made available for use with programs
built with the target compiler.

For the rest of this section, assume that gcc is present in the source
tree, so that it will be used to build the target libraries.

There is a complication here.  The configure process needs to know which
compiler you are going to use to build a tool; otherwise, the feature
tests will not work correctly.  The Cygnus tree handles this by not
configuring the target libraries until the target compiler is built.  In
order to permit everything to build using a single
@samp{configure}/@samp{make}, the configuration of the target libraries
is actually triggered during the make step.

When the target libraries are configured, the @samp{--target} option is
not used.  Instead, the @samp{--host} option is used with the argument
of the @samp{--target} option for the overall configuration.  If no
@samp{--target} option was used for the overall configuration, the
@samp{--host} option will be passed with the output of the
@file{config.guess} shell script.  Any @samp{--build} option is passed
down unchanged.

This translation of configuration options is done because since the
target libraries are compiled with the target compiler, they are being
built in order to run on the target of the overall configuration.  By
the definition of host, this means that their host system is the same as
the target system of the overall configuration.

The same process is used for both a native configuration and a cross
configuration.  Even when using a native configuration, the target
libraries will be configured and built using the newly built compiler.
This is particularly important for the C++ libraries, since there is no
reason to assume that the C++ compiler used to build the host tools (if
there even is one) uses the same ABI as the g++ compiler which will be
used to build the target libraries.

There is one difference between a native configuration and a cross
configuration.  In a native configuration, the target libraries are
normally configured and built as siblings of the host tools.  In a cross
configuration, the target libraries are normally built in a subdirectory
whose name is the argument to @samp{--target}.  This is mainly for
historical reasons.

To summarize, running @samp{configure} in the Cygnus tree configures all
the host libraries and tools, but does not configure any of the target
libraries.  Running @samp{make} then does the following steps:

@itemize @bullet
@item
Build the host libraries.
@item
Build the host programs, including gcc.  Note that we call gcc both a
host program (since it runs on the host) and a target compiler (since it
generates code for the target).
@item
Using the newly built target compiler, configure the target libraries.
@item
Build the target libraries.
@end itemize

The steps need not be done in precisely this order, since they are
actually controlled by @file{Makefile} targets.

@node Target Library Configure Scripts
@subsection Target Library Configure Scripts

There are a few things you must know in order to write a configure
script for a target library.  This is just a quick sketch, and beginners
shouldn't worry if they don't follow everything here.

The target libraries are configured and built using a newly built target
compiler.  There may not be any startup files or libraries for this
target compiler.  In fact, those files will probably be built as part of
some target library, which naturally means that they will not exist when
your target library is configured.

This means that the configure script for a target library may not use
any test which requires doing a link.  This unfortunately includes many
useful autoconf macros, such as @samp{AC_CHECK_FUNCS}.  autoconf macros
which do a compile but not a link, such as @samp{AC_CHECK_HEADERS}, may
be used.

This is a severe restriction, but normally not a fatal one, as target
libraries can often assume the presence of other target libraries, and
thus know which functions will be available.

As of this writing, the autoconf macro @samp{AC_PROG_CC} does a link to
make sure that the compiler works.  This may fail in a target library,
so target libraries must use a different set of macros to locate the
compiler.  See the @file{configure.in} file in a directory like
@file{libiberty} or @file{libgloss} for an example.

As noted in the previous section, target libraries are sometimes built
in directories which are siblings to the host tools, and are sometimes
built in a subdirectory.  The @samp{--with-target-subdir} configure
option will be passed when the library is configured.  Its value will be
an empty string if the target library is a sibling.  Its value will be
the name of the subdirectory if the target library is in a subdirectory.

If the overall build is not a native build (i.e., the overall configure
used the @samp{--target} option), then the library will be configured
with the @samp{--with-cross-host} option.  The value of this option will
be the host system of the overall build.  Recall that the host system of
the library will be the target of the overall build.  If the overall
build is a native build, the @samp{--with-cross-host} option will not be
used.

A library which can be built both standalone and as a target library may
want to install itself into different directories depending upon the
case.  When built standalone, or when built native, the library should
be installed in @samp{$(libdir)}.  When built as a target library which
is not native, the library should be installed in @samp{$(tooldir)/lib}.
The @samp{--with-cross-host} option may be used to distinguish these
cases.

This same test of @samp{--with-cross-host} may be used to see whether it
is OK to use link tests in the configure script.  If the
@samp{--with-cross-host} option is not used, then the library is being
built either standalone or native, and a link should work.

@node Make Targets in Cygnus Tree
@subsection Make Targets in Cygnus Tree

The top level @file{Makefile} in the Cygnus tree defines targets for
every known subdirectory.

For every subdirectory @var{dir} which holds a host library or program,
the @file{Makefile} target @samp{all-@var{dir}} will build that library
or program.

There are dependencies among host tools.  For example, building gcc
requires first building gas, because the gcc build process invokes the
target assembler.  These dependencies are reflected in the top level
@file{Makefile}.

For every subdirectory @var{dir} which holds a target library, the
@file{Makefile} target @samp{configure-target-@var{dir}} will configure
that library.  The @file{Makefile} target @samp{all-target-@var{dir}}
will build that library.

Every @samp{configure-target-@var{dir}} target depends upon
@samp{all-gcc}, since gcc, the target compiler, is required to configure
the tool.  Every @samp{all-target-@var{dir}} target depends upon the
corresponding @samp{configure-target-@var{dir}} target.

There are several other targets which may be of interest for each
directory: @samp{install-@var{dir}}, @samp{clean-@var{dir}}, and
@samp{check-@var{dir}}.  There are also corresponding @samp{target}
versions of these for the target libraries , such as
@samp{install-target-@var{dir}}.

@node Target libiberty
@subsection Target libiberty

The @file{libiberty} subdirectory is currently a special case, in that
it is the only directory which is built both using the host compiler and
using the target compiler.

This is because the files in @file{libiberty} are used when building the
host tools, and they are also incorporated into the @file{libstdc++}
target library as support code.

This duality does not pose any particular difficulties.  It means that
there are targets for both @samp{all-libiberty} and
@samp{all-target-libiberty}.

In a native configuration, when target libraries are not built in a
subdirectory, the same objects are normally used as both the host build
and the target build.  This is normally OK, since libiberty contains
only C code, and in a native configuration the results of the host
compiler and the target compiler are normally interoperable.

Irix 6 is again an exception here, since the SGI native compiler
defaults to using the @samp{O32} ABI, and gcc defaults to using the
@samp{N32} ABI.  On Irix 6, the target libraries are built in a
subdirectory even for a native configuration, avoiding this problem.

There are currently no other libraries built for both the host and the
target, but there is no conceptual problem with adding more.

@node Canadian Cross
@chapter Canadian Cross
@cindex canadian cross
@cindex building with a cross compiler
@cindex cross compiler, building with

It is possible to use the GNU configure and build system to build a
program which will run on a system which is different from the system on
which the tools are built.  In other words, it is possible to build
programs using a cross compiler.

This is referred to as a @dfn{Canadian Cross}.

@menu
* Canadian Cross Example::		Canadian Cross Example.
* Canadian Cross Concepts::		Canadian Cross Concepts.
* Build Cross Host Tools::		Build Cross Host Tools.
* Build and Host Options::		Build and Host Options.
* CCross not in Cygnus Tree::		Canadian Cross not in Cygnus Tree.
* CCross in Cygnus Tree::		Canadian Cross in Cygnus Tree.
* Supporting Canadian Cross::		Supporting Canadian Cross.
@end menu

@node Canadian Cross Example
@section Canadian Cross Example

Here is an example of a Canadian Cross.

While running on a GNU/Linux, you can build a program which will run on
a Solaris system.  You would use a GNU/Linux cross Solaris compiler to
build the program.

Of course, you could not run the resulting program on your GNU/Linux
system.  You would have to copy it over to a Solaris system before you
would run it.

Of course, you could also simply build the programs on the Solaris
system in the first place.  However, perhaps the Solaris system is not
available for some reason; perhaps you actually don't have one, but you
want to build the tools for somebody else to use.  Or perhaps your
GNU/Linux system is much faster than your Solaris system.

A Canadian Cross build is most frequently used when building programs to
run on a non-Unix system, such as DOS or Windows.  It may be simpler to
configure and build on a Unix system than to support the configuration
machinery on a non-Unix system.

@node Canadian Cross Concepts
@section Canadian Cross Concepts

When building a Canadian Cross, there are at least two different systems
involved: the system on which the tools are being built, and the system
on which the tools will run.

The system on which the tools are being built is called the @dfn{build}
system.

The system on which the tools will run is called the host system.

For example, if you are building a Solaris program on a GNU/Linux
system, as in the previous section, the build system would be GNU/Linux,
and the host system would be Solaris.

It is, of course, possible to build a cross compiler using a Canadian
Cross (i.e., build a cross compiler using a cross compiler).  In this
case, the system for which the resulting cross compiler generates code
is called the target system.  (For a more complete discussion of host
and target systems, @pxref{Host and Target}).

An example of building a cross compiler using a Canadian Cross would be
building a Windows cross MIPS ELF compiler on a GNU/Linux system.  In
this case the build system would be GNU/Linux, the host system would be
Windows, and the target system would be MIPS ELF.

The name Canadian Cross comes from the case when the build, host, and
target systems are all different.  At the time that these issues were
all being hashed out, Canada had three national political parties.

@node Build Cross Host Tools
@section Build Cross Host Tools

In order to configure a program for a Canadian Cross build, you must
first build and install the set of cross tools you will use to build the
program.

These tools will be build cross host tools.  That is, they will run on
the build system, and will produce code that runs on the host system.

It is easy to confuse the meaning of build and host here.  Always
remember that the build system is where you are doing the build, and the
host system is where the resulting program will run.  Therefore, you
need a build cross host compiler.

In general, you must have a complete cross environment in order to do
the build.  This normally means a cross compiler, cross assembler, and
so forth, as well as libraries and include files for the host system.

@node Build and Host Options
@section Build and Host Options
@cindex configuring a canadian cross
@cindex canadian cross, configuring

When you run @file{configure}, you must use both the @samp{--build} and
@samp{--host} options.

@cindex @samp{--build} option
@cindex build option
@cindex configure build system
The @samp{--build} option is used to specify the configuration name of
the build system.  This can normally be the result of running the
@file{config.guess} shell script, and it is reasonable to use
@samp{--build=`config.guess`}.

@cindex @samp{--host} option
@cindex host option
@cindex configure host
The @samp{--host} option is used to specify the configuration name of
the host system.

As we explained earlier, @file{config.guess} is used to set the default
value for the @samp{--host} option (@pxref{Using the Host Type}).  We
can now see that since @file{config.guess} returns the type of system on
which it is run, it really identifies the build system.  Since the host
system is normally the same as the build system (i.e., people do not
normally build using a cross compiler), it is reasonable to use the
result of @file{config.guess} as the default for the host system when
the @samp{--host} option is not used.

It might seem that if the @samp{--host} option were used without the
@samp{--build} option that the configure script could run
@file{config.guess} to determine the build system, and presume a
Canadian Cross if the result of @file{config.guess} differed from the
@samp{--host} option.  However, for historical reasons, some configure
scripts are routinely run using an explicit @samp{--host} option, rather
than using the default from @file{config.guess}.  As noted earlier, it
is difficult or impossible to reliably compare configuration names
(@pxref{Using the Target Type}).  Therefore, by convention, if the
@samp{--host} option is used, but the @samp{--build} option is not used,
then the build system defaults to the host system.

@node CCross not in Cygnus Tree
@section Canadian Cross not in Cygnus Tree.

If you are not using the Cygnus tree, you must explicitly specify the
cross tools which you want to use to build the program.  This is done by
setting environment variables before running the @file{configure}
script.

You must normally set at least the environment variables @samp{CC},
@samp{AR}, and @samp{RANLIB} to the cross tools which you want to use to
build.

For some programs, you must set additional cross tools as well, such as
@samp{AS}, @samp{LD}, or @samp{NM}.

You would set these environment variables to the build cross tools which
you are going to use.

For example, if you are building a Solaris program on a GNU/Linux
system, and your GNU/Linux cross Solaris compiler were named
@samp{solaris-gcc}, then you would set the environment variable
@samp{CC} to @samp{solaris-gcc}.

@node CCross in Cygnus Tree
@section Canadian Cross in Cygnus Tree
@cindex canadian cross in cygnus tree

This section describes configuring and building a Canadian Cross when
using the Cygnus tree.

@menu
* Standard Cygnus CCross::	Building a Normal Program.
* Cross Cygnus CCross::		Building a Cross Program.
@end menu

@node Standard Cygnus CCross
@subsection Building a Normal Program

When configuring a Canadian Cross in the Cygnus tree, all the
appropriate environment variables are automatically set to
@samp{@var{host}-@var{tool}}, where @var{host} is the value used for the
@samp{--host} option, and @var{tool} is the name of the tool (e.g.,
@samp{gcc}, @samp{as}, etc.).  These tools must be on your @samp{PATH}.

Adding a prefix of @var{host} will give the usual name for the build
cross host tools.  To see this, consider that when these cross tools
were built, they were configured to run on the build system and to
produce code for the host system.  That is, they were configured with a
@samp{--target} option that is the same as the system which we are now
calling the host.  Recall that the default name for installed cross
tools uses the target system as a prefix (@pxref{Using the Target
Type}).  Since that is the system which we are now calling the host,
@var{host} is the right prefix to use.

For example, if you configure with @samp{--build=i386-linux-gnu} and
@samp{--host=solaris}, then the Cygnus tree will automatically default
to using the compiler @samp{solaris-gcc}.  You must have previously
built and installed this compiler, probably by doing a build with no
@samp{--host} option and with a @samp{--target} option of
@samp{solaris}.

@node Cross Cygnus CCross
@subsection Building a Cross Program

There are additional considerations if you want to build a cross
compiler, rather than a native compiler, in the Cygnus tree using a
Canadian Cross.

When you build a cross compiler using the Cygnus tree, then the target
libraries will normally be built with the newly built target compiler
(@pxref{Host and Target Libraries}).  However, this will not work when
building with a Canadian Cross.  This is because the newly built target
compiler will be a program which runs on the host system, and therefore
will not be able to run on the build system.

Therefore, when building a cross compiler with the Cygnus tree, you must
first install a set of build cross target tools.  These tools will be
used when building the target libraries.

Note that this is not a requirement of a Canadian Cross in general.  For
example, it would be possible to build just the host cross target tools
on the build system, to copy the tools to the host system, and to build
the target libraries on the host system.  The requirement for build
cross target tools is imposed by the Cygnus tree, which expects to be
able to build both host programs and target libraries in a single
@samp{configure}/@samp{make} step.  Because it builds these in a single
step, it expects to be able to build the target libraries on the build
system, which means that it must use a build cross target toolchain.

For example, suppose you want to build a Windows cross MIPS ELF compiler
on a GNU/Linux system.  You must have previously installed both a
GNU/Linux cross Windows compiler and a GNU/Linux cross MIPS ELF
compiler.

In order to build the Windows (configuration name @samp{i386-cygwin32})
cross MIPS ELF (configure name @samp{mips-elf}) compiler, you might
execute the following commands (long command lines are broken across
lines with a trailing backslash as a continuation character).

@example
mkdir linux-x-cygwin32
cd linux-x-cygwin32
@var{srcdir}/configure --target i386-cygwin32 --prefix=@var{installdir} \
  --exec-prefix=@var{installdir}/H-i386-linux
make
make install
cd ..
mkdir linux-x-mips-elf
cd linux-x-mips-elf
@var{srcdir}/configure --target mips-elf --prefix=@var{installdir} \
  --exec-prefix=@var{installdir}/H-i386-linux
make
make install
cd ..
mkdir cygwin32-x-mips-elf
cd cygwin32-x-mips-elf
@var{srcdir}/configure --build=i386-linux-gnu --host=i386-cygwin32 \
  --target=mips-elf --prefix=@var{wininstalldir} \
  --exec-prefix=@var{wininstalldir}/H-i386-cygwin32
make
make install
@end example

You would then copy the contents of @var{wininstalldir} over to the
Windows machine, and run the resulting programs.

@node Supporting Canadian Cross
@section Supporting Canadian Cross

If you want to make it possible to build a program you are developing
using a Canadian Cross, you must take some care when writing your
configure and make rules.  Simple cases will normally work correctly.
However, it is not hard to write configure and make tests which will
fail in a Canadian Cross.

@menu
* CCross in Configure::		Supporting Canadian Cross in Configure Scripts.
* CCross in Make::		Supporting Canadian Cross in Makefiles.
@end menu

@node CCross in Configure
@subsection Supporting Canadian Cross in Configure Scripts
@cindex canadian cross in configure

In a @file{configure.in} file, after calling @samp{AC_PROG_CC}, you can
find out whether this is a Canadian Cross configure by examining the
shell variable @samp{cross_compiling}.  In a Canadian Cross, which means
that the compiler is a cross compiler, @samp{cross_compiling} will be
@samp{yes}.  In a normal configuration, @samp{cross_compiling} will be
@samp{no}.

You ordinarily do not need to know the type of the build system in a
configure script.  However, if you do need that information, you can get
it by using the macro @samp{AC_CANONICAL_SYSTEM}, the same macro that is
used to determine the target system.  This macro will set the variables
@samp{build}, @samp{build_alias}, @samp{build_cpu}, @samp{build_vendor},
and @samp{build_os}, which correspond to the similar @samp{target} and
@samp{host} variables, except that they describe the build system.

When writing tests in @file{configure.in}, you must remember that you
want to test the host environment, not the build environment.

Macros like @samp{AC_CHECK_FUNCS} which use the compiler will test the
host environment.  That is because the tests will be done by running the
compiler, which is actually a build cross host compiler.  If the
compiler can find the function, that means that the function is present
in the host environment.

Tests like @samp{test -f /dev/ptyp0}, on the other hand, will test the
build environment.  Remember that the configure script is running on the
build system, not the host system.  If your configure scripts examines
files, those files will be on the build system.  Whatever you determine
based on those files may or may not be the case on the host system.

Most autoconf macros will work correctly for a Canadian Cross.  The main
exception is @samp{AC_TRY_RUN}.  This macro tries to compile and run a
test program.  This will fail in a Canadian Cross, because the program
will be compiled for the host system, which means that it will not run
on the build system.

The @samp{AC_TRY_RUN} macro provides an optional argument to tell the
configure script what to do in a Canadian Cross.  If that argument is
not present, you will get a warning when you run @samp{autoconf}:
@smallexample
warning: AC_TRY_RUN called without default to allow cross compiling
@end smallexample
@noindent
This tells you that the resulting @file{configure} script will not work
with a Canadian Cross.

In some cases while it may better to perform a test at configure time,
it is also possible to perform the test at run time.  In such a case you
can use the cross compiling argument to @samp{AC_TRY_RUN} to tell your
program that the test could not be performed at configure time.

There are a few other autoconf macros which will not work correctly with
a Canadian Cross: a partial list is @samp{AC_FUNC_GETPGRP},
@samp{AC_FUNC_SETPGRP}, @samp{AC_FUNC_SETVBUF_REVERSED}, and
@samp{AC_SYS_RESTARTABLE_SYSCALLS}.  The @samp{AC_CHECK_SIZEOF} macro is
generally not very useful with a Canadian Cross; it permits an optional
argument indicating the default size, but there is no way to know what
the correct default should be.

@node CCross in Make
@subsection Supporting Canadian Cross in Makefiles.
@cindex canadian cross in makefile

The main Canadian Cross issue in a @file{Makefile} arises when you want
to use a subsidiary program to generate code or data which you will then
include in your real program.

If you compile this subsidiary program using @samp{$(CC)} in the usual
way, you will not be able to run it.  This is because @samp{$(CC)} will
build a program for the host system, but the program is being built on
the build system.

You must instead use a compiler for the build system, rather than the
host system.  In the Cygnus tree, this make variable
@samp{$(CC_FOR_BUILD)} will hold a compiler for the build system.

Note that you should not include @file{config.h} in a file you are
compiling with @samp{$(CC_FOR_BUILD)}.  The @file{configure} script will
build @file{config.h} with information for the host system.  However,
you are compiling the file using a compiler for the build system (a
native compiler).  Subsidiary programs are normally simple filters which
do no user interaction, and it is normally possible to write them in a
highly portable fashion so that the absence of @file{config.h} is not
crucial.

@cindex @samp{HOST_CC}
The gcc @file{Makefile.in} shows a complex situation in which certain
files, such as @file{rtl.c}, must be compiled into both subsidiary
programs run on the build system and into the final program.  This
approach may be of interest for advanced build system hackers.  Note
that the build system compiler is rather confusingly called
@samp{HOST_CC}.

@node Cygnus Configure
@chapter Cygnus Configure
@cindex cygnus configure

The Cygnus configure script predates autoconf.  All of its interesting
features have been incorporated into autoconf.  No new programs should
be written to use the Cygnus configure script.

However, the Cygnus configure script is still used in a few places: at
the top of the Cygnus tree and in a few target libraries in the Cygnus
tree.  Until those uses have been replaced with autoconf, some brief
notes are appropriate here.  This is not complete documentation, but it
should be possible to use this as a guide while examining the scripts
themselves.

@menu
* Cygnus Configure Basics::		Cygnus Configure Basics.
* Cygnus Configure in C++ Libraries::	Cygnus Configure in C++ Libraries.
@end menu

@node Cygnus Configure Basics
@section Cygnus Configure Basics

Cygnus configure does not use any generated files; there is no program
corresponding to @samp{autoconf}.  Instead, there is a single shell
script named @samp{configure} which may be found at the top of the
Cygnus tree.  This shell script was written by hand; it was not
generated by autoconf, and it is incorrect, and indeed harmful, to run
@samp{autoconf} in the top level of a Cygnus tree.

Cygnus configure works in a particular directory by examining the file
@file{configure.in} in that directory.  That file is broken into four
separate shell scripts.

The first is the contents of @file{configure.in} up to a line that
starts with @samp{# per-host:}.  This is the common part.

The second is the rest of @file{configure.in} up to a line that starts
with @samp{# per-target:}.  This is the per host part.

The third is the rest of @file{configure.in} up to a line that starts
with @samp{# post-target:}.  This is the per target part.

The fourth is the remainder of @file{configure.in}.  This is the post
target part.

If any of these comment lines are missing, the corresponding shell
script is empty.

Cygnus configure will first execute the common part.  This must set the
shell variable @samp{srctrigger} to the name of a source file, to
confirm that Cygnus configure is looking at the right directory.  This
may set the shell variables @samp{package_makefile_frag} and
@samp{package_makefile_rules_frag}.

Cygnus configure will next set the @samp{build} and @samp{host} shell
variables, and execute the per host part.  This may set the shell
variable @samp{host_makefile_frag}.

Cygnus configure will next set the @samp{target} variable, and execute
the per target part.  This may set the shell variable
@samp{target_makefile_frag}.

Any of these scripts may set the @samp{subdirs} shell variable.  This
variable is a list of subdirectories where a @file{Makefile.in} file may
be found.  Cygnus configure will automatically look for a
@file{Makefile.in} file in the current directory.  The @samp{subdirs}
shell variable is not normally used, and I believe that the only
directory which uses it at present is @file{newlib}.

For each @file{Makefile.in}, Cygnus configure will automatically create
a @file{Makefile} by adding definitions for @samp{make} variables such
as @samp{host} and @samp{target}, and automatically editing the values
of @samp{make} variables such as @samp{prefix} if they are present.

Also, if any of the @samp{makefile_frag} shell variables are set, Cygnus
configure will interpret them as file names relative to either the
working directory or the source directory, and will read the contents of
the file into the generated @file{Makefile}.  The file contents will be
read in after the first line in @file{Makefile.in} which starts with
@samp{####}.

These @file{Makefile} fragments are used to customize behaviour for a
particular host or target.  They serve to select particular files to
compile, and to define particular preprocessor macros by providing
values for @samp{make} variables which are then used during compilation.
Cygnus configure, unlike autoconf, normally does not do feature tests,
and normally requires support to be added manually for each new host.

The @file{Makefile} fragment support is similar to the autoconf
@samp{AC_SUBST_FILE} macro.

After creating each @file{Makefile}, the post target script will be run
(i.e., it may be run several times).  This script may further customize
the @file{Makefile}.  When it is run, the shell variable @samp{Makefile}
will hold the name of the @file{Makefile}, including the appropriate
directory component.

Like an autoconf generated @file{configure} script, Cygnus configure
will create a file named @file{config.status} which, when run, will
automatically recreate the configuration.  The @file{config.status} file
will simply execute the Cygnus configure script again with the
appropriate arguments.

Any of the parts of @file{configure.in} may set the shell variables
@samp{files} and @samp{links}.  Cygnus configure will set up symlinks
from the names in @samp{links} to the files named in @samp{files}.  This
is similar to the autoconf @samp{AC_LINK_FILES} macro.

Finally, any of the parts of @file{configure.in} may set the shell
variable @samp{configdirs} to a set of subdirectories.  If it is set,
Cygnus configure will recursively run the configure process in each
subdirectory.  If the subdirectory uses Cygnus configure, it will
contain a @file{configure.in} file but no @file{configure} file, in
which case Cygnus configure will invoke itself recursively.  If the
subdirectory has a @file{configure} file, Cygnus configure assumes that
it is an autoconf generated @file{configure} script, and simply invokes
it directly.

@node Cygnus Configure in C++ Libraries
@section Cygnus Configure in C++ Libraries
@cindex @file{libstdc++} configure
@cindex @file{libio} configure
@cindex @file{libg++} configure

The C++ library configure system, written by Per Bothner, deserves
special mention.  It uses Cygnus configure, but it does feature testing
like that done by autoconf generated @file{configure} scripts.  This
approach is used in the libraries @file{libio}, @file{libstdc++}, and
@file{libg++}.

Most of the @file{Makefile} information is written out by the shell
script @file{libio/config.shared}.  Each @file{configure.in} file sets
certain shell variables, and then invokes @file{config.shared} to create
two package @file{Makefile} fragments.  These fragments are then
incorporated into the resulting @file{Makefile} by the Cygnus configure
script.

The file @file{_G_config.h} is created in the @file{libio} object
directory by running the shell script @file{libio/gen-params}.  This
shell script uses feature tests to define macros and typedefs in
@file{_G_config.h}.

@node Multilibs
@chapter Multilibs
@cindex multilibs

For some targets gcc may have different processor requirements depending
upon command line options.  An obvious example is the
@samp{-msoft-float} option supported on several processors.  This option
means that the floating point registers are not available, which means
that floating point operations must be done by calling an emulation
subroutine rather than by using machine instructions.

For such options, gcc is often configured to compile target libraries
twice: once with @samp{-msoft-float} and once without.  When gcc
compiles target libraries more than once, the resulting libraries are
called @dfn{multilibs}.

Multilibs are not really part of the GNU configure and build system, but
we discuss them here since they require support in the @file{configure}
scripts and @file{Makefile}s used for target libraries.

@menu
* Multilibs in gcc::		        Multilibs in gcc.
* Multilibs in Target Libraries::	Multilibs in Target Libraries.
@end menu

@node Multilibs in gcc
@section Multilibs in gcc

In gcc, multilibs are defined by setting the variable
@samp{MULTILIB_OPTIONS} in the target @file{Makefile} fragment.  Several
other @samp{MULTILIB} variables may also be defined there.  @xref{Target
Fragment, , The Target Makefile Fragment, gcc, Using and Porting GNU
CC}.

If you have built gcc, you can see what multilibs it uses by running it
with the @samp{-print-multi-lib} option.  The output @samp{.;} means
that no multilibs are used.  In general, the output is a sequence of
lines, one per multilib.  The first part of each line, up to the
@samp{;}, is the name of the multilib directory.  The second part is a
list of compiler options separated by @samp{@@} characters.

Multilibs are built in a tree of directories.  The top of the tree,
represented by @samp{.} in the list of multilib directories, is the
default library to use when no special compiler options are used.  The
subdirectories of the tree hold versions of the library to use when
particular compiler options are used.

@node Multilibs in Target Libraries
@section Multilibs in Target Libraries

The target libraries in the Cygnus tree are automatically built with
multilibs.  That means that each library is built multiple times.

This default is set in the top level @file{configure.in} file, by adding
@samp{--enable-multilib} to the list of arguments passed to configure
when it is run for the target libraries (@pxref{Host and Target
Libraries}).

Each target library uses the shell script @file{config-ml.in}, written
by Doug Evans, to prepare to build target libraries.  This shell script
is invoked after the @file{Makefile} has been created by the
@file{configure} script.  If multilibs are not enabled, it does nothing,
otherwise it modifies the @file{Makefile} to support multilibs.

The @file{config-ml.in} script makes one copy of the @file{Makefile} for
each multilib in the appropriate subdirectory.  When configuring in the
source directory (which is not recommended), it will build a symlink
tree of the sources in each subdirectory.

The @file{config-ml.in} script sets several variables in the various
@file{Makefile}s.  The @file{Makefile.in} must have definitions for
these variables already; @file{config-ml.in} simply changes the existing
values.  The @file{Makefile} should use default values for these
variables which will do the right thing in the subdirectories.

@table @samp
@item MULTISRCTOP
@file{config-ml.in} will set this to a sequence of @samp{../} strings,
where the number of strings is the number of multilib levels in the
source tree.  The default value should be the empty string.
@item MULTIBUILDTOP
@file{config-ml.in} will set this to a sequence of @samp{../} strings,
where the number of strings is number of multilib levels in the object
directory.  The default value should be the empty string.  This will
differ from @samp{MULTISRCTOP} when configuring in the source tree
(which is not recommended).
@item MULTIDIRS
In the top level @file{Makefile} only, @file{config-ml.in} will set this
to the list of multilib subdirectories.  The default value should be the
empty string.
@item MULTISUBDIR
@file{config-ml.in} will set this to the installed subdirectory name to
use for this subdirectory, with a leading @samp{/}.  The default value
shold be the empty string.
@item MULTIDO
@itemx MULTICLEAN
In the top level @file{Makefile} only, @file{config-ml.in} will set
these variables to commands to use when doing a recursive make.  These
variables should both default to the string @samp{true}, so that by
default nothing happens.
@end table

All references to the parent of the source directory should use the
variable @samp{MULTISRCTOP}.  Instead of writing @samp{$(srcdir)/..},
you must write @samp{$(srcdir)/$(MULTISRCTOP)..}.

Similarly, references to the parent of the object directory should use
the variable @samp{MULTIBUILDTOP}.

In the installation target, the libraries should be installed in the
subdirectory @samp{MULTISUBDIR}.  Instead of installing
@samp{$(libdir)/libfoo.a}, install
@samp{$(libdir)$(MULTISUBDIR)/libfoo.a}.

The @file{config-ml.in} script also modifies the top level
@file{Makefile} to add @samp{multi-do} and @samp{multi-clean} targets
which are used when building multilibs.

The default target of the @file{Makefile} should include the following
command:
@smallexample
@@$(MULTIDO) $(FLAGS_TO_PASS) DO=all multi-do
@end smallexample
@noindent
This assumes that @samp{$(FLAGS_TO_PASS)} is defined as a set of
variables to pass to a recursive invocation of @samp{make}.  This will
build all the multilibs.  Note that the default value of @samp{MULTIDO}
is @samp{true}, so by default this command will do nothing.  It will
only do something in the top level @file{Makefile} if multilibs were
enabled.

The @samp{install} target of the @file{Makefile} should include the
following command:
@smallexample
@@$(MULTIDO) $(FLAGS_TO_PASS) DO=install multi-do
@end smallexample

In general, any operation, other than clean, which should be performed
on all the multilibs should use a @samp{$(MULTIDO)} line, setting the
variable @samp{DO} to the target of each recursive call to @samp{make}.

The @samp{clean} targets (@samp{clean}, @samp{mostlyclean}, etc.) should
use @samp{$(MULTICLEAN)}.  For example, the @samp{clean} target should
do this:
@smallexample
@@$(MULTICLEAN) DO=clean multi-clean
@end smallexample

@node FAQ
@chapter Frequently Asked Questions

@table @asis
@item Which do I run first, @samp{autoconf} or @samp{automake}?
Except when you first add autoconf or automake support to a package, you
shouldn't run either by hand.  Instead, configure with the
@samp{--enable-maintainer-mode} option, and let @samp{make} take care of
it.

@cindex undefined macros
@item @samp{autoconf} says something about undefined macros.
This means that you have macros in your @file{configure.in} which are
not defined by @samp{autoconf}.  You may be using an old version of
@samp{autoconf}; try building and installing a newer one.  Make sure the
newly installled @samp{autoconf} is first on your @samp{PATH}.  Also,
see the next question.

@cindex @samp{CY_GNU_GETTEXT} in @file{configure}
@cindex @samp{AM_PROG_LIBTOOL} in @file{configure}
@item My @file{configure} script has stuff like @samp{CY_GNU_GETTEXT} in it.
This means that you have macros in your @file{configure.in} which should
be defined in your @file{aclocal.m4} file, but aren't.  This usually
means that @samp{aclocal} was not able to appropriate definitions of the
macros.  Make sure that you have installed all the packages you need.
In particular, make sure that you have installed libtool (this is where
@samp{AM_PROG_LIBTOOL} is defined) and gettext (this is where
@samp{CY_GNU_GETTEXT} is defined, at least in the Cygnus version of
gettext).

@cindex @file{Makefile}, garbage characters
@item My @file{Makefile} has @samp{@@} characters in it.
This may mean that you tried to use an autoconf substitution in your
@file{Makefile.in} without adding the appropriate @samp{AC_SUBST} call
to your @file{configure} script.  Or it may just mean that you need to
rebuild @file{Makefile} in your build directory.  To rebuild
@file{Makefile} from @file{Makefile.in}, run the shell script
@file{config.status} with no arguments.  If you need to force
@file{configure} to run again, first run @samp{config.status --recheck}.
These runs are normally done automatically by @file{Makefile} targets,
but if your @file{Makefile} has gotten messed up you'll need to help
them along.

@cindex @samp{config.status --recheck}
@item Why do I have to run both @samp{config.status --recheck} and @samp{config.status}?
Normally, you don't; they will be run automatically by @file{Makefile}
targets.  If you do need to run them, use @samp{config.status --recheck}
to run the @file{configure} script again with the same arguments as the
first time you ran it.  Use @samp{config.status} (with no arguments) to
regenerate all files (@file{Makefile}, @file{config.h}, etc.) based on
the results of the configure script.  The two cases are separate because
it isn't always necessary to regenerate all the files after running
@samp{config.status --recheck}.  The @file{Makefile} targets generated
by automake will use the environment variables @samp{CONFIG_FILES} and
@samp{CONFIG_HEADERS} to only regenerate files as they are needed.

@item What is the Cygnus tree?
The Cygnus tree is used for various packages including gdb, the GNU
binutils, and egcs.  It is also, of course, used for Cygnus releases.
It is the build system which was developed at Cygnus, using the Cygnus
configure script.  It permits building many different packages with a
single configure and make.  The configure scripts in the tree are being
converted to autoconf, but the general build structure remains intact.

@item Why do I have to keep rebuilding and reinstalling the tools?
I know, it's a pain.  Unfortunately, there are bugs in the tools
themselves which need to be fixed, and each time that happens everybody
who uses the tools need to reinstall new versions of them.  I don't know
if there is going to be a clever fix until the tools stabilize.

@item Why not just have a Cygnus tree @samp{make} target to update the tools?
The tools unfortunately need to be installed before they can be used.
That means that they must be built using an appropriate prefix, and it
seems unwise to assume that every configuration uses an appropriate
prefix.  It might be possible to make them work in place, or it might be
possible to install them in some subdirectory; so far these approaches
have not been implemented.
@end table

@node Index
@unnumbered Index

@printindex cp

@contents
@bye
iles individually so we don't accidently get random files from the readline directory. * m-news.h (STORE_RETURN_VALUE, EXTRACT_RETURN_VALUE): Expect floating point returns to be in fp0. * gdb.texinfo (Format options): New node. * gdb.texinfo: Comment out "@include"s until bfox fixes the readline & history docs. * dbxread.c (read_addl_syms): Set startup_file_* if necessary at the end (as well as when we hit ".o"). * printcmd.c (decode_format): Set val.format & val.size to '?' at start and set defaults at end. * symtab.c (decode_line_1): Check for class_name null. * valops.c: Each place where it compares against field names, check for null field names. (new t_field_name variables). * utils.c (fputs_filtered): Check for linebuffer null before checking whether to call fputs. Remove later check for linebuffer null. Sun Aug 13 15:56:50 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * m-isi.h, m-sun3.h ({PUSH,POP}_FP_REGS): New macros. m-sun3.h (NUM_REGS): Conditionalize on FPU. config.gdb (sun3, isi): Add message about support for machines without FPU. * main.c (catch_termination, initialize_signals): new functions. * main.c (editing_info): Add "info editing n" and "info editing +". Rewrite much of this function. gdb.texinfo (GDB Readline): Document it. * values.c (history_info): Add "info history +". Also add code to do "info history +" when command is repeated. gdb.texinfo (Value History): Document "info history +". * expprint.c (print_subexp): Add OP_THIS to case stmt. * config.gdb (sun4os4): Put quotes around make define. * config.gdb: Canonicalize machine name at beginning. Sat Aug 12 00:50:59 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * config.gdb: define M_MAKEDEFINE Makefile (Makefile, MD): Be able to re-make Makefile. * main.c (command_line_input): Add comments to the command history. * Makefile.dist (Makefile): Add /bin/false. Fri Aug 11 14:35:33 1989 Jim Kingdon (kingdon at spiff) * Makefile.dist: Comment out .c.o rule and add TARGET_ARCH. * m-altos.h: Include sys/page.h & sys/net.h * m-altos.h (FRAME_CHAIN{,_VALID}): Use outside_startup_file. * config.gdb (altos, altosgas): Add M_SYSV & M_BSD_NM and remove M_ALLOCA=alloca.o from makedefine. * coffread.c (complete_symtab): Change a_entry to entry. * m-altosgas.h: New file. * m-symmetry (REGISTER_BYTE): Fix dumb mistake. Fri Aug 11 06:39:49 1989 Roland McGrath (roland at hobbes.ai.mit.edu) * utils.c (set_screensize_command): Check for ARG being nil, since that's what execute_command will pass if there's no argument. * expread.y (yylex): Recognize "0x" or "0X" as the beginning of a number. Thu Aug 10 15:43:12 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * config.gdb, Makefile.dist: Rename Makefile.c to Makefile.dist. * m-altos.h: Add comment about porting to USGR2. * config.gdb (sparc): Add -Usparc. Wed Aug 9 14:20:39 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * m-sun3os4.h: Define BROKEN_LARGE_ALLOCA. * values.c (modify_field): Check for value too large to fit in bitfield. * utils.c (fputs_filtered): Allow LINEBUFFER to be NULL. * breakpoint.c (condition_command): Check for attempt to specify non-numeric breakpoint number. * config.gdb, Makefile, m-altos.h, altos-dep.c: Merge Altos port. * README: Change message about editing Makefile. * config.gdb: Edit Makefile. Copied Makefile to Makefile.c and changed to let config.gdb run us through the C preprocessor. * expread.y (yylex): Test correctly for definition of number. Wed Aug 9 11:56:05 1989 Randy Smith (randy at hobbes.ai.mit.edu) * dbxread.c (read_dbx_symtab): Put bracketing of entry point in test case for .o symbols so that it will be correct even without debugging symbols. (end_psymtab): Took bracketing out. * blockframe.c (outside_startup_file): Reverse the sense of the return value to make the functionality implied by the name correct. Tue Aug 8 11:48:38 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * coffread.c (symbol_file_command): Do not assume presence of a.out header. * blockframe.c: Replace first_object_file_end with startup_file_{start,end} (outside_startup_file): New function. dbxread.c (read_addl_syms, read_dbx_symtab, end_psymbol): set startup_file_*. Delete first_object_file_end code. Add entry_point and ENTRY_POINT coffread.c (complete_symtab): Set startup_file_*. (first_object_file_end): Add as static. m-*.h (FRAME_CHAIN, FRAME_CHAIN_VALID): Call outside_startup_file instead of comparing with first_object_file_end. * breakpoint.c (breakpoint_1): Change -1 to (CORE_ADDR)-1. * config.gdb (i386, i386gas): Add missing quotes at end of "echo" * source.c (directory_command): Add dont_repeat (); Mon Aug 7 18:03:51 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * dbxread.c (read_addl_syms): Change strcmp to strncmp and put 3rd arg back. * command.h (struct cmd_list_element): Add comment clarifying purpose of abbrev_flag. Mon Aug 7 12:51:03 1989 Randy Smith (randy at hobbes.ai.mit.edu) * printcmd.c (_initialize_printcmd): Changed "undisplay" not to have abbrev flag set; it isn't an abbreviation of "delete display", it's an alias. Mon Aug 7 00:25:15 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * symtab.c (lookup_symtab_1): Remove filematch (never used). * expread.y [type]: Add second argument to 2 calls to lookup_member_type which were missing them. * dbxread.c (symbol_file_command): Add from_tty arg. Check it before calling query. * infcmd.c (tty_command): Add from_tty arg. * eval.c (evaluate_subexp): Remove 3rd argument from calls to value_x_unop. * dbxread.c (read_addl_syms): Remove 3rd argument from call to strcmp. * gdb.texinfo (Command editing): @include inc-readline.texinfo and inc-history.texinfo and reorganize GDB-specific stuff. * Makefile: Add line MAKE=make. * README (second paragraph): Fix trivial errors. * dbxread.c (read_struct_type): Make sure p is initialized. * main.c (symbol_completion_function): Complete correctly on the empty string. Sun Aug 6 21:01:59 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * symmetry-dep.c: Remove "long" from definition of i386_follow_jump. * gdb.texinfo (Backtrace): Document "where" and "info stack". * dbxread.c (cleanup_undefined_types): Strip off "struct " or "union " from type names before doing comparison Sat Aug 5 02:05:36 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * config.gdb (i386, i386gas): Improve makefile editing instructions. * Makefile: Fix typo in CLIBS for SYSV. * dbxread.c (read_dbx_symtab): Deal with N_GSYM typedefs. * dbxread.c (add_file_command): Do not free name. We didn't allocate it; it just points into arg_string. * Makefile, m-*.h: Change LACK_VPRINTF to HAVE_VPRINTF. Fri Jul 28 00:07:48 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * valprint.c (val_print): Made sure that all returns returned a value (usually 0, indicating no memory printed). * core.c (read_memory): Changed "return" to "return 0". * expread.y (parse_number): Handle scientific notation when the string does not contain a '.'. Thu Jul 27 15:14:03 1989 Randy Smith (randy at hobbes.ai.mit.edu) * infrun.c (signals_info): Error if signal number passed is out of bounds. * defs.h: Define alloca to be __builtin_alloca if compiling with gcc and localized inclusion of alloca.h on the sparc with the other alloca stuff. * command.c: Doesn't need to include alloca.h on the sparc; defs.h does it for you. * printcmd.c (print_frame_args): Changed test for call to print_frame_nameless_args to check i to tell if any args had been printed. Thu Jul 27 04:40:56 1989 Roland McGrath (roland at hobbes.ai.mit.edu) * blockframe.c (find_pc_partial_function): Always check that NAME and/or ADDRESS are not nil before storing into them. Wed Jul 26 23:41:21 1989 Roland McGrath (roland at hobbes.ai.mit.edu) * m-newsos3.h: Define BROKEN_LARGE_ALLOCA. * dbxread.c (symbol_file_command, psymtab_to_symtab): Use xmalloc #ifdef BROKEN_LARGE_ALLOCA. Tue Jul 25 16:28:18 1989 Jay Fenlason (hack at apple-gunkies.ai.mit.edu) * m68k-opcode.h: moved some of the fmovem entries so they're all consecutive. This way the assembler doesn't bomb. Mon Jul 24 22:45:54 1989 Randy Smith (randy at hobbes.ai.mit.edu) * symtab.c (lookup_symbol): Changed error to an informational (if not very comforting) message about internal problems. This will get a null symbol returned to decode_line_1, which should force things to be looked up in the misc function vector. Wed Jul 19 13:47:34 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * symtab.c (lookup_symbol): Changed "fatal" to "error" in external symbol not found in symtab in which it was supposed to be found. This can be reached because of a bug in ar. Tue Jul 18 22:57:43 1989 Randy Smith (roland at hobbes.ai.mit.edu) * m-news.h [REGISTER_U_ADDR]: Decreased the assumed offset of fp0 by 4 to bring it into (apparently) appropriate alignment with reality. Tue Jul 18 18:14:42 1989 Randy Smith (randy at hobbes.ai.mit.edu) * Makefile: pinsn.o should depend on opcode.h * m68k-opcode.h: Moved fmovemx with register lists to before other fmovemx. Tue Jul 18 11:21:42 1989 Jim Kingdon (kingdon at susie) * Makefile, m*.h: Only #define vprintf (to _doprnt or printf, depends on the system) if the library lacks it (controlled by LACK_VPRINTF_DEFINE in makefile). Unpleasant, but necessary to make this work with the GNU C library. Mon Jul 17 15:17:48 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * breakpoint.c (breakpoint_1): Change addr-b->address to b->address-addr. Sun Jul 16 16:23:39 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * eval.c (evaluate_subexp): Change error message printed when right operand of '@' is not an integer to English. * infcmd.c (registers_info): Fix call to print_spaces_filtered to specify right # of arguments. * gdb.texinfo (Command Editing): Document info editing command. * coffread.c (read_file_hdr): Add MC68MAGIC. * source.c (select_source_symtab): Change MAX to max. Fri Jul 14 21:19:11 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) * infcmd.c (registers_info): Clean up display to look good with long register names, to say "register" instead of "reg", and to put the "relative to selected stack frame" bit at the top. Fri Jul 14 18:23:09 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * dbxread.c (record_misc_function): Put parens around | to force correct evaluation. Wed Jul 12 12:25:53 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * m-newsos3, m-news, infrun.c, Makefile, config.gdb, news-dep.c: Merge in Hikichi's changes for Sony/News-OS 3 support. Tue Jul 11 21:41:32 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) * utils.c (fputs_filtered): Don't do any filtering if output is not to stdout, or if stdout is not a tty. (fprintf_filtered): Rely on fputs_filtered's check for whether to do filtering. Tue Jul 11 00:33:58 1989 Randy Smith (randy at hobbes.ai.mit.edu) * GDB 3.2 Released. * valprint.h: Deleted. * utils.c (fputs_filtered): Don't do any filtering if filtering is disabled (lines_per_page == 0). Mon Jul 10 22:27:53 1989 Randy Smith (roland at hobbes.ai.mit.edu) * expread.y [typebase]: Added "unsigned long int" and "unsigned short int" to specs. Mon Jul 10 21:44:55 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * main.c (main): Make -cd use cd_command to avoid current_directory with non-absolute pathname. Mon Jul 10 00:34:29 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * dbxread.c (symbol_file_command): Catch errors from stat (even though they should never happen). * source.c (openp): If the path is null, use the current directory. * dbxread.c (read_dbx_symtab): Put N_SETV symbols into the misc function vector ... (record_misc_function): ... as data symbols. * utils.c (fprintf_filtered): Return after printing if we aren't going to do filtering. * Makefile: Added several things for make clean to take care of. * expread.y: Lowered "@" in precedence below +,-,*,/,%. * eval.c (evaluate_subexp): Return an error if the rhs of "@" isn't integral. * Makefile: Added removal of core and gdb[0-9] files to clean target. * Makefile: Made a new target "distclean", which cleans things up correctly for making a distribution. Sun Jul 9 23:21:27 1989 Randy Smith (randy at hobbes.ai.mit.edu) * dbxread.c: Surrounded define of gnu symbols with an #ifndef NO_GNU_STABS in case you don't want them on some machines. * m-npl.h, m-pn.h: Defined NO_GNU_STABS. Sun Jul 9 19:25:22 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) * utils.c (fputs_filtered): New function. (fprintf_filtered): Use fputs_filtered. utils.c (print_spaces_filtered), command.c (help_cmd,help_cmd_list), printcmd.c (print_frame_args), stack.c (print_block_frame_locals, print_frame_arg_vars), valprint.c (many functions): Use fputs_filtered instead of fprintf_filtered to avoid arbitrary limit. * utils.c (fprintf_filtered): Fix incorrect comment. Sat Jul 8 18:12:01 1989 Randy Smith (randy at hobbes.ai.mit.edu) * valprint.c (val_print): Changed assignment of pretty to use prettyprint as a conditional rather than rely on values of the enum. * Projects: Cleaned up a little for release. * main.c (initialize_main): Initialize rl_completion_entry_function instead of completion_entry_function. * Makefile: Modified to use the new readline library setup. * breakpoint.c (break_command_1, delete_breakpoint, enable_breakpoint, disable_breakpoint): Put in new printouts for xgdb usage triggered off of xgdb_verbose. * main.c (main): Added check for flag to set xgdb_verbose. * stack.c (frame_command): Set frame_changed when frame command used. Fri Jul 7 16:20:58 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * Remove valprint.h and move contents to value.h (more logical). Fri Jul 7 02:28:06 1989 Randall Smith (randy at rice-chex) * m68k-pinsn.c (print_insn): Included a check for register list; if there is one, make sure to start p after it. * breakpoint.c (break_command_1, delete_breakpoint, enable_breakpoint, disable_breakpoint): #ifdef'd out changes below; they produce unwanted output in gdb mode in gnu-emacs. * gdb.texinfo: Spelled. Also removed index references from command editing section; the relevance/volume ratio was too low. Removed all references to the function index. * ns32k-opcode.h, ns32k-pinsn.c: Backed out changes of June 24th; haven't yet received legal papers. * .gdbinit: Included message telling the user what it is doing. * symmetry-dep.c: Added static decls for i386_get_frame_setup, i386_follow_jump. * values.c (unpack_double): Added a return (double)0 at the end to silence a compiler warning. * printcmd.c (containing_function_bounds, asdump_command): Created to dump the assembly code of a function (support for xgdb and a useful hack). (_initialize_printcmd): Added this to command list. * gdb.texinfo [Memory]: Added documentation for the asdump command. * breakpoint.c (break_command_1, delete_breakpoint, enable_breakpoint, disable_breakpoint): Added extra verbosity for xgdb conditionalized on the new external frame_full_file_name. * source.c (identify_source_line): Increase verbosity of fullname prointout to include pc value. * stack.c: Added a new variable; "frame_changed" to indicate when a frame has been changed so that gdb can print out a frame change message when the frame only changes implicitly. (print_frame_info): Check the new variable in determining when to print out a new message and set it to zero when done. (up_command): Increment it. (down_command): Decrement it. * m68k-pinsn.c (print_insn_arg [lL]): Modified cases for register lists to reset the point to point to after the word from which the list is grabbed *if* that would cause point to point farther than it currently is. Thu Jul 6 14:28:11 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) * valprint.c (val_print, value_print): Add parameter to control prettyprinting. valprint.h: New file containing constants used for passing prettyprinting parameter to val{,ue}_print. expprint.c, infcmd.c, printcmd.c, valprint.c, values.c: Change all calls to val{,ue}_print to use new parameter. Mon Jul 3 22:38:11 1989 Randy Smith (randy at apple-gunkies.ai.mit.edu) * dbxread.c (,process_one_symbol): Moved extern declaration for index out of function to beginning of file. Mon Jul 3 18:40:14 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) * gdb.texinfo (Registers): Add "ps" to list of standard registers. Sun Jul 2 23:13:03 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) * printcmd.c (enable_display): Change d->next to d = d->next so that "enable display" without args works. Fri Jun 30 23:42:04 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) * source.c (list_command): Made error message given when no symtab is loaded clearer. * valops.c (value_assign): Make it so that when assigning to an internal variable, the type of the assignment exp is the type of the value being assigned. Fri Jun 30 12:12:43 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * main.c (verbose_info): Created. (initialize_main): Put "info verbose" into command list. * utils.c (screensize_info): Created. (_initialize_utils): Defined "info screensize" as a normal command. * valprint.c (format_info): Added information about maximum number of array elements to function. * blockframe.c (find_pc_partial_function): Again. * blockframe.c (find_pc_partial_function): Replaced a "shouldn't happen" (which does) with a zero return. * main.c (dont_repeat): Moved ahead of first use. Thu Jun 29 19:15:08 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * vax-opcode.h: Made minor modifications (moved an instruction and removed a typo) to bring this into accord with gas' table; also changed copyright to reflect it being part of both gdb and gas. * m68k-opcode.h: Added whole scads and bunches of new stuff for the m68851 and changed the coptyrightto recognize that the file was shared between gdb and gas. * main.c (stop_sig): Use "dont_repeat ()" instead of *line = 0; * core.c (read_memory): Don't do anything if length is 0. * Makefile: Added readline.c to the list of files screwed by having the ansi ioctl.h compilation with gcc. * config.gdb: Added sun4os3 & sun4-os3 as availible options. Wed Jun 28 02:01:26 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) * command.c (lookup_cmd): Add ignore_help_classes argument. (lookup_cmd_1): Add ignore_help_classes argument. command.c, main.c: Change callers of lookup_cmd{,_1} to supply value for ignore_help_classes. Tue Jun 27 18:01:31 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * utils.c (print_spaces_filtered): Made more efficient. * defs.h: Declaration. * valprint.c (val_print): Used in a couple of new places. Mon Jun 26 18:27:28 1989 Randall Smith (randy at gluteus.ai.mit.edu) * m68k-pinsn.c (print_insn_arg ['#', '^']): Combined them into one case which always gets the argument from the word immediately following the instruction. (print_insn_arg ["[lL]w"]): Make sure to always get the register mask from the word immediately following the instruction. Sun Jun 25 19:14:56 1989 Randall Smith (randy at galapas.ai.mit.edu) * Makefile: Added hp-include back in as something to distribute. * stack.c (print_block_frame_locals): Return value changed from void to int; return 1 if values printed. Use _filtered. (print_frame_local_vars): Use return value from print_block_frame_locals to mention if nothing printed; mention lack of symbol table, use _filtered. (print_frame_arg_vars): Tell the user if no symbol table or no values printed. Use fprintf_filtered instead of fprintf. * blockframe.c (get_prev_frame_info): Check for no inferior or core file before crashing. * inflow.c (inferior_died): Set current frame to zero to keep from looking like we're in start. Sat Jun 24 15:50:53 1989 Randall Smith (randy at gluteus.ai.mit.edu) * stack.c (frame_command): Added a check to make sure that there was an inferior or a core file. * expread.y (yylex): Allow floating point numbers of the form ".5" to be parsed. Changes by David Taylor at TMC: * ns32k-pinsn.c: Added define for ?floating point coprocessor? and tables for register names to be used for each of the possibilities. (list_search): Created; searches a list of options for a specific value. (print_insn_arg): Added 'Q', 'b', 'M', 'P', 'g', and 'G' options to the value location switch. * ns32k-opcode.h: Added several new location flags. [addr, enter, exit, ext[bwd], exts[bwd], lmr, lpr[bwd], restore, rett, spr[bwd], smr]: Improved insn format output. * symtab.c (list_symbols): Rearrange printing to produce readable output for "info types". * eval.c (evaluate_subexp_for_address): Fixed typo. * dbxread.c (read_type): Don't output an error message when there isn't a ',' after a cross-reference. * dbxread.c (read_dbx_symtab): #if'd out N_FN case in read_dbx_symtab if it has the EXT bit set (otherwise multiple cases with the same value). Fri Jun 23 13:12:08 1989 Randall Smith (randy at plantaris.ai.mit.edu) * symmisc.c: Changed decl of print_spaces from static to extern (since it's defined in utils.c). * remote.c (remote_open): Close remote_desc if it's already been opened. * Remote_Makefile, remote_gutils.c, remote_inflow.c, remote_server.c, remote_utils.c: Combined into remote-multi.shar. * remote-multi.shar: Created (Vikram Koka's remote stub). * remote-sa.m68k.shar: Created (Glenn Engel's remcom.c). * README: Updated to reflect new organization of remote stubs. * dbxread.c (read_dbx_symtab): Put an N_FN in with N_FN | N_EXT to account for those machines which don't use the external bit here. Sigh. * m-symmetry.h: Defined NO_SIGINTERRUPT. Thu Jun 22 12:51:37 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * printcmd.c (decode_format): Make sure characters are printed using a byte size. * utils.c (error): Added a terminal_ours here. * stack.c (locals_info): Added check for selected frame. * dbxread.c (read_type): Checked to make sure that a "," was actually found in the symbol to end a cross reference. Wed Jun 21 10:30:01 1989 Randy Smith (randy at tartarus.uchicago.edu) * expread.y (parse_number, [exp]): Allowed for the return of a number marked as unsigned; this will allow inclusion of unsigned constants. * symtab.h: Put in default definitions for BUILTIN_TYPE_LONGEST and BUILTIN_TYPE_UNSIGNED_LONGEST. * expread.y (parse_number): Will now accept integers suffixed with a 'u' (though does nothing special with it). * valarith.c (value_binop): Added cases to deal with unsigned arithmetic correctly. Tue Jun 20 14:25:54 1989 Randy Smith (randy at tartarus.uchicago.edu) * dbxread.c (psymtab_to_symtab_1): Changed reading in info message to go through printf_filtered. * symtab.c (list_symbols): Placed header message after all calls to psymtab_to_symtab. * symtab.c (smash_to_{function, reference, pointer}_type): Carried attribute of permanence for the type being smashed over the bzero and allowed any type to point at this one if it is permanent. * symtab.c (smash_to_{function, reference, pointer}_type): Fix typo: check flags of to_type instead of type. * m-hp9k320.h: Changed check on __GNU__ predefine to __GNUC__. * Makefile: Made MUNCH_DEFINE seperate and based on SYSV_DEFINE; they aren't the same on hp's. Mon Jun 19 17:10:16 1989 Randy Smith (randy at tartarus.uchicago.edu) * Makefile: Fixed typo. * valops.c (call_function): Error if the inferior has not been started. * ns32k-opcode.h [check[wc], cmpm[bwd], movm[bwd], skpsb]: Fixed typos. Fri Jun 9 16:23:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * m-news.h [NO_SIGINTERRUPT]: Defined. * dbxread.c (read_type): Start copy of undefined structure name past [sue] defining type of cross ref. * dbxread.c (process_one_symbol): Changed strchr to index. * ns32k-opcode.h, ns32k-pinsn.c: More changes to number of operands, addition of all of the set condition opcodes, addition of several flag letters, all patterned after the gas code. * ns32k-opcode.h [mov{su,us}[bwd], or[bwd]]: Changed number of operands from 1 to 2. Wed Jun 7 15:04:24 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * symseg.h [TYPE_FLAG_STUB]: Created. * dbxread.c (read_type): Set flag bit if type is stub. (cleanup_undefined_types): Don't mark it as a stub if it's been defined since we first learned about it. * valprint.c (val_print): Print out a message to that effect if this type is encountered. * symseg.h, symtab.h: Moved the definition of TYPE_FLAG_PERM over to symseg.h so that all such definitions would be in the same place. * valprint.c (val_print): Print out <No data fields> for a structure if there aren't any. * dbxread.c (read_type): Set type name of a cross reference type to "struct whatever" or something. Tue Jun 6 19:40:52 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * breakpoint.c (breakpoint_1): Print out symbolic location of breakpoints for which there are no debugging symbols. Mon Jun 5 15:14:51 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * command.c (help_cmd_list): Made line_size static. Sat Jun 3 17:33:45 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * Makefile: Don't include the binutils hp-include directory in the distribution anymore; refer the users to the binutils distribution. Thu Jun 1 16:33:07 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * printcmd.c (disable_display_command): Fixed loop iteration for no arg case. * printcmd.c (disable_display_command): Added from_tty parameter to function. * valops.c (value_of_variable): Call read_var_value with 0 cast to FRAME instead of CORE_ADDR. * eval.c (evaluate_subexp): Corrected number of args passed to value_subscript (to 2). * infrun.c (wait_for_inferior), symtab.c (decode_line_1), m-convex.h: Changed name of FIRSTLINE_DEBUG_BROKEN to PROLOGUE_FIRSTLINE_OVERLAP. * m-merlin.h: Fixed typo. * ns32k-opcode.h: Added ns32381 opcodes and "cinv" insn, and fixed errors in movm[wd], rett, and sfsr. * eval.c (evaluate_subexp, evaluate_subexp_for_address), valops.c (value_zero): Change value_zero over to taking two arguments instead of three. * eval.c (evaluate_subexp) [OP_VAR_VALUE]: Get correct lval type for AVOID_SIDE_EFFECTS for all types of symbols. [BINOP_DIV]: Don't divide if avoiding side effects; just return an object of the correct type. [BINOP_REPEAT]: Don't call value_repeat, just allocate a repeated value. (evaluete_subexp_for_address) [OP_VAR_VALUE]: Just return a thing of the right type (after checking to make sure that we are allowed to take the address of whatever variable has been passed). Mon May 29 11:01:02 1989 Randall Smith (randy at galapas.ai.mit.edu) * breakpoint.c (until_break_command): Set the breakpoint with a frame specification so that it won't trip in inferior calls to the function. Also set things up so that it works based on selected frame, not current one. Sun May 28 15:05:33 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * eval.c (evalue_subexp): Change subscript case to use value_zero in EVAL_AVOID_SIDE_EFFECTS case. Fri May 26 12:03:56 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * dbxread.c (read_addl_syms, psymtab_to_symtab): Removed cleanup_undefined_types; this needs to be done on a symtab basis. (end_symtab): Called cleanup_undefined_types from here. (cleanup_undefined_types): No longer uses lookup_symbol (brain dead idea; oh, well), now it searches through file_symbols. Wed May 24 15:52:43 1989 Randall Smith (randy at galapas) * source.c (select_source_symtab): Only run through partial_symtab_list if it exists. * coffread.c (read_coff_symtab): Don't unrecord a misc function when a function symbol is seen for it. * expread.y [variable]: Make sure to write a type for memvals if you don't get a mft you recognize. Tue May 23 12:15:57 1989 Randall Smith (randy at plantaris.ai.mit.edu) * dbxread.c (read_ofile_symtab, psymtab_to_symtab): Moved cleanup of undefined types to psymtab_to_symtab. That way it will be called once for all readins (which will, among other things, help reduce infinite loops). * symtab.h [misc_function_type]: Forced mf_unknown to 0. * dbxread.c (record_misc_function): Cast enum to unsigned char (to fit). * expread.y [variable]: Cast unsigned char back to enum to test. Mon May 22 13:08:25 1989 Randall Smith (randy at gluteus.ai.mit.edu) Patches by John Gilmore for dealing well with floating point: * findvar.c (value_from_register, locate_var_value): Used BYTES_BIG_ENDIAN instead of an inline test. * m-sparc.h [IEEE_FLOAT]: Created to indicate that the sparc is IEEE compatible. * printcmd.c (print_scalar_formatted): Use BYTES_BIG_ENDIAN and the stream argument for printing; also modify default type for 'f'. Change handling of invalid floats; changed call syntax for is_nan. (print_command): Don't print out anything indicating that something was recorded on the history list if it wasn't. * valprint.c (val_print): Fixed to deal properley with new format of is_nan and unpacking doubles without errors occuring. (is_nan): Changed argument list and how it figures big endianness (uses macros). * values.c (record_latest_value): Return -1 and don't record if it's an invalid float. (value_as_double): Changed to use new unpack_double calling convention. (unpack_double): Changed not to call error if the float was invalid; simply to set invp and return. Changed calling syntax. (unpack_field_as_long, modify_field): Changed to use BITS_BIG_ENDIAN to determine correct action. * m-hp9k320.h [HP_OS_BUG]: Created; deals with problem where a trap happens after a continue. * infrun.c (wait_for_inferior): Used. * m-convex.h [FIRSTLINE_DEBUG_BROKEN]: Defined a flag to indicate that the debugging symbols output by the compiler for the first line of a function were broken. * infrun.c (wait_for_inferior), symtab.c (decode_line_1): Used. * gdb.texinfo [Data, Memory]: Minor cleanups of phrasing. Fri May 19 00:16:59 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * dbxread.c (add_undefined_type, cleanup_undefined_types): Created to keep a list of cross references to as yet undefined types. (read_type): Call add_undefined_type when we run into such a case. (read_addl_syms, read_ofile_symtab): Call cleanup_undefined_types when we're done. * dbxread.c (psymtab_to_symtab, psymtab_to_symtab_1): Broke psymtab_to_symtab out into two routines; made sure the string table was only readin once and the globals were only scanned once, for any number of dependencies. Thu May 18 19:59:18 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * m-*.h: Defined (or not, as appropriate per machine) BITS_BIG_ENDIAN, BYTES_BIG_ENDIAN, and WORDS_BIG_ENDIAN. Wed May 17 13:37:45 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * main.c (symbol_completion_function): Always complete on result command list, even if exact match found. If it's really an exact match, it'll find it again; if there's something longer than it, it'll get the right result. * symtab.c (make_symbol_completion_function): Fixed typo; strcmp ==> strncmp. * dbxread.c (read_dbx_symtab): Change 'G' case to mark symbols as LOC_EXTERNAL. * expread.y [variables]: Changed default type of text symbols to function returning int so that one can use, eg. strcmp. * infrun.c (wait_for_inferior): Include a special flag indicating that one shouldn't insert the breakpoints on the next step for returning from a sigtramp and forcing at least one move forward. * infrun.c (wait_for_inferior): Change test for nexting into a function to check for current stack pointer inner than previous stack pointer. * infrun.c (wait_for_inferior): Check for step resume break address before dealing with normal breakpoints. * infrun.c (wait_for_inferior): Added a case to deal with taking and passing along a signal when single stepping past breakpoints before inserting breakpoints. * infrun.c (wait_for_inferior): Inserted special case to keep going after taking a signal we are supposed to be taking. Tue May 16 12:49:55 1989 Randall Smith (randy at gluteus.ai.mit.edu) * inflow.c (terminal_ours_1): Cast result of signal to (int (*)()). * gdb.texinfo: Made sure that references to the program were in upper case. Modify description of the "set prompt" command. [Running]: Cleaned up introduction. [Attach]: Cleaned up. [Stepping]: Change "Proceed" to "Continue running" or "Execute". Minor cleanup. [Source Path]: Cleaned up intro. Cleared up distinction between the executable search path and the source path. Restated effect of the "directory" command with no arguments. [Data]: Fixed typos and trivial details. [Stepping]: Fixed up explanation of "until". * source.c (print_source_lines): Print through filter. * printcmd.c (x_command): If the format with which to print is "i", use the address of anything that isn't a pointer instead of the value. This is for, eg. "x/10i main". * gdb.texinfo: Updated last modification date on manual. Mon May 15 12:11:33 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * symtab.c (lookup_symtab): Fixed typo (name ==> copy) in call to lookup_symtab_1. * gdb.texinfo: Added documentation for "break [+-]n" and for new actions of "directory" command (taking multiple directory names at the same time). * m68k-opcode.h: Replaced the version in gdb with an up-to-date version from the assembler directory. * m68k-pinsn.c (print_insn_arg): Added cases 'l' & 'L' to switch to print register lists for movem instructions. * dbxread.c, m-convex.h: Moved convex dependent include files over from dbxread.c to m-convex.h. * printcmd.c (disable_display, disable_display_command): Changed name of first to second, and created first which takes an int as arg rather than a char pointer. Changed second to use first. (_initialize_printcmd): Changed to use second as command to call. (delete_current_display, disable_current_display): Changed name of first to second, and changed functionality to match. * infrun.c (normal_stop), main.c (return_to_top_level): Changed to call disable_current_display. * dbxread.c (process_one_symbol, read_dbx_symtab): Changed N_FN to be N_FN | N_EXT to deal with new Berkeley define; this works with either the old or the new. * Remote_Makefile, remote_gutils.c, remote_inflow.c, remote_server.c, remote_utils.c: Created. * Makefile: Included in tag and tar files. * README: Included a note about them. * printcmd.c (print_address): Use find_pc_partial_function to remove need to readin symtabs for symbolic addresses. * source.c (directory_command): Replaced function with new one that can accept lists of directories seperated by spaces or :'s. * inflow.c (new_tty): Replaced calls to dup2 with calls to dup. Sun May 14 12:33:16 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * stack.c (args_info): Make sure that you have an inferior or core file before taking action. * ns32k-opcode.h [deiw, deid]: Fixed machine code values for these opcodes. * dbxread.c (scan_file_globals): Modified to use misc function vector instead of file itself. Killed all arguments to the funciton; no longer needed. (psymtab_to_symtab): Changed call for above to reflect new (void) argument list. * dbxread.c (read_dbx_symtab, ): Moved HASH_OFFSET define out of read_dbx_symtab. * expread.y [variable]: Changed default type of misc function in text space to be (void ()). * Makefile: Modified for proper number of s/r conflicts (order is confusing; the mod that necessitated this change was on May 12th, not today). * expread.y (yylex): Added SIGNED, LONG, SHORT, and INT keywords. [typename]: Created. [typebase]: Added rules for LONG, LONG INT, SHORT, SHORT INT, SIGNED name, and UNSIGNED name (a good approximation of ansi standard). * Makefile: Included .c.o rule to avoid sun's make from throwing any curves at us. * blockframe.c: Included <obstack.h> * command.c (lookup_cmd): Clear out trailing whitespace. * command.c (lookup_cmd_1): Changed malloc to alloca. Fri May 12 12:13:12 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * printcmd.c (print_frame_args): Only print nameless args when you know how many args there are supposed to be and when you've printed fewer than them. Don't print nameless args between printed args. * symtab.c (make_symbol_completion_function): Fixed typo (= ==> ==). * remote.c (remote_open): ifdef'd out siginterrupt call by #ifndef NO_SIGINTERRUPT. * m-umax.h: Defined NO_SIGINTERRUPT. * expread.y [ptype, array_mod, func_mod, direct_abs_decl, abs_decl]: Added rules for parsing and creating arbitrarily strange types for casts and sizeofs. * symtab.c, symtab.h (create_array_type): Created. Some minor misfeatures; see comments for details (main one being that you might end up creating two arrays when you only needed one). Thu May 11 13:11:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * valops.c (value_zero): Add an argument for type of lval. * eval.c (evaluate_subexp_for_address): Take address properly in the avoid side affects case (ie. keep track of whether we have an lval in memory and we can take the address). (evaluate_subexp): Set the lval type of expressions created with value_zero properley. * valops.c, value.h (value_zero): Created--will return a value of any type with contents filled with zero. * symtab.c, symtab.h (lookup_struct_elt_type): Created. * eval.c (evaluate_subexp): Modified to not read memory when called with EVAL_AVOID_SIDE_EFFECTS. * Makefile: Moved dbxread.c ahead of coffread.c in the list of source files. Wed May 10 11:29:19 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * munch: Make sure that sysv version substitutes for the whole line. * symtab.h: Created an enum misc_function_type to hold the type of the misc function being recorded. * dbxread.c (record_misc_function): Branched on dbx symbols to decide which type to assign to a misc function. * coffread.c (record_misc_function): Always assign type unknown. * expread.y [variable]: Now tests based on new values. Tue May 9 13:03:54 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * symtab.c: Changed inclusion of <strings.h> (doesn't work on SYSV) to declaration of index. * Makefile: Changed last couple of READLINE_FLAGS SYSV_DEFINE * source.c ({forward, reverse}_search_command): Made a default search file similar to for the list command. Mon May 8 18:07:51 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * printcmd.c (print_frame_args): If we don't know how many arguments there are to this function, don't print the nameless arguments. We don't know enough to find them. * printcmd.c (print_frame_args): Call print_frame_nameless_args with proper arguments (start & end as offsets from addr). * dbxread.c (read_addl_syms): Removed cases to deal with global symbols; this should all be done in scan_global_symbols. Sun May 7 11:36:23 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * Makefile: Added copying.awk to ${OTHERS}. Fri May 5 16:49:01 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * valprint.c (type_print_varspec_prefix): Don't pass passed_a_pointer onto children. * valprint.c (type_print_varspec_suffix): Print "array of" with whatever the "of" is after tha array brackets. * valprint.c (type_print_varspec_{prefix,suffix}): Arrange to parenthesisze pointers to arrays as well as pointers to other objects. * valprint.c (type_print_varspec_suffix): Make sure to print subscripts of multi-dimensional arrays in the right order. * infcmd.c (run_command): Fixed improper usages of variables within remote debugging branch. * Makefile: Added Convex.notes to the list of extra files to carry around. * dbxread.c (symbol_file_command): Made use of alloca or malloc dependent on macro define. Thu May 4 15:47:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * Makefile: Changed READLINE_FLAGS to SYSV_DEFINE and called munch with it also. * munch: Check first argument for -DSYSV and be looser about picking up init routines if you find it. * coffread.c: Made fclose be of type int. * breakpoint.c (_initialize_breakpoint): Put "unset" into class alias. Wed May 3 14:09:12 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * m-sparc.h [STACK_END_ADDR]: Parameterized off of machine/vmparam.h (as per John Gilmore's suggestion). * blockframe.c (get_prev_frame_info): Changed this function back to checking frameless invocation first before checking frame chain. This means that a backtrace up from start will produce the wrong value, but that a backtrace from a frameless function called in main will show up correctly. * breakpoint.c (_initialize_breakpoint): Added entry in help for delete that indicates that unset is an alias for it. * main.c (symbol_completion_function): Modified recognition of being within a single command. Tue May 2 15:13:45 1989 Randy Smith (randy at gnu) * expread.y [variable]: Add some parens to get checking of the misc function vector right. Mon May 1 13:07:03 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * default-dep.c (core_file_command): Made reg_offset unsigned. * default-dep.c (core_file_command): Improved error messages for reading in registers. * expread.y: Allowed a BLOCKNAME to be ok for a variable name (as per C syntax). * dbxread.c (psymtab_to_symtab): Flushed stdout after printing starting message about reading in symbols. * printcmd.c (print_frame_args): Switched starting place for printing of frameless args to be sizeof int above last real arg printed. * printcmd.c (print_frame_args): Modified final call to print_nameless_args to not use frame slots used array if none had been used. * infrun.c (wait_for_inferior): Take FUNCTION_START_OFFSET into account when dealing with comparison of pc values to function addresses. * Makefile: Added note about compiling gdb on a Vax running 4.3. Sun Apr 30 12:59:46 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * command.c (lookup_cmd): Got correct error message on bad command. * m-sun3.h [ABOUT_TO_RETURN]: Modified to allow any of the return instructions, including trapv and return from interupt. * command.c (lookup_cmd): If a command is found, use it's values for error reporting and determination of needed subcommands. * command.c (lookup_cmd): Use null string for error if cmdtype is null; pass *line to error instead of **. * command.c (lookup_cmd_1): End of command marked by anything but alpha numeric or '-'. Included ctype.h. Fri Apr 28 18:30:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * source.c (select_source_symtab): Kept line number from ever being less than 1 in main decode. Wed Apr 26 13:03:20 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * default-dep.c (core_file_command): Fixed typo. * utils.c (fprintf_filtered): Don't use return value from numchars. * main.c, command.c (complete_on_cmdlist): Moved function to command.c. * command.c (lookup_cmd): Modified to use my new routine. Old version is still there, ifdef'd out. * command.c, command.h (lookup_cmd_1): Added a routine to do all of the work of lookup_cmd with no error reporting and full return of information garnered in search. Tue Apr 25 12:37:54 1989 Randall Smith (randy at gluteus.ai.mit.edu) * breakpoint.c (_initialize_breakpoint): Change "delete breakpionts" to be in class alias and not have the abbrev flag set. * main.c (symbol_completion_function): Fix to correctly complete things that correspond to multiword aliases. * main.c (complete_on_cmdlist): Don't complete on something if it isn't a command or prefix (ie. if it's just a help topic). * main.c (symbol_completion_function): Set list index to be 0 if creating a list with just one element. * main.c (complete_on_cmdlist): Don't allow things with abbrev_flag set to be completion values. (symbol_completion_function): Don't accept an exact match if the abbrev flag is set. * dbxread.c (read_type): Fixed typo in comparision to check if type number existed. * dbxread.c (read_type): Made sure to only call dbx_lookup_type on typenums if typenums were not -1. Mon Apr 24 17:52:12 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * symtab.c: Added strings.h as an include file. Fri Apr 21 15:28:38 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * symtab.c (lookup_partial_symtab): Changed to only return a match if the name match is exact (which is what I want in all cases in which this is currently used. Thu Apr 20 11:12:34 1989 Randall Smith (randy at gluteus.ai.mit.edu) * m-isi.h [REGISTER_U_ADDR]: Installed new version from net. * default-dep.c: Deleted inclusion of fcntl.h; apparently not necessary. * Makefile: Added comment about compiling on isi under 4.3. * breakpoint.c (break_command_1): Only give decode_line_1 the default_breakpoint_defaults if there's nothing better (ie. make the default be off of the current_source notes if at all possible). * blockframe.c (get_prev_frame_info): Clean up comments and delete code ifdefed out around FRAMELESS_FUNCTION_INVOCATION test. * remote.c: Added a "?" message to protocol. (remote_open): Used at startup. (putpkt): Read whatever garbage comes over the line until we see a '+' (ie. don't treat garbage as a timeout). * valops.c (call_function): Eliminated no longer appropriate comment. * infrun.c (wait_for_inferior): Changed several convex conditional compilations to be conditional on CANNOT_EXECUTE_STACK. Wed Apr 19 10:18:17 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * printcmd.c (print_frame_args): Added code to attempt to deal with arguments that are bigger than an int. Continuation of Convex/Fortran changes: * printcmd.c (print_scalar_formatted): Added leading zeros to printing of large integers. (address_info, print_frame_args): Added code to deal with LOC_REF_ARG. (print_nameless_args): Allow param file to specify a routine with which to print typeless integers. (printf_command): Deal with long long values well. * stack.c (print_frame_arg_vars): Change to deal with LOC_REF_ARG. * symmisc.c (print_symbol): Change to deal with LOC_REF_ARG. * symseg.h: Added LOC_REF_ARG to enum address_class. * symtab.c (lookup_block_symbol): Changed to deal with LOC_REF_ARG. * valarith.c (value_subscripted_rvalue): Created. (value_subscript): Used above when app. (value_less, value_equal): Change to cast to (char *) before doing comparison, for machines where that casting does something. * valops.c (call_function): Setup to deal with machines where you cannot execute code on the stack segment. * valprint.c (val_print): Make sure that array element size isn't zero before printing. Set address of default array to address of first element. Put in a couple of int cast. Removed some convex specific code. Added check for endianness of machine in case of a packed structure. Added code for printing typeless integers and for LONG LONG's. (set_maximum_command): Change to use parse_and_eval_address to get argument (so can use expressions there). * values.c (value_of_internalvar, set_internalvar_component, set_internalvar, convenience_info): Add in hooks for trapped internal vars. (unpack_long): Deal with LONG_LONG. (value_field): Remove LONGEST cast. (using_struct_return): Fixed typo ENUM ==> UNION. * xgdb.c (_initialize_xgdb): Make sure that specify_exec_file_hook is not called unless we are setting up a windowing environ. Tue Apr 18 13:43:37 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) Various changes involved in 1) getting gdb to work on the convex, and 2) Getting gdb to work with fortran (due to convex!csmith): * convex-dep.c, convex-opcode.h, m-convex.h, convex-pinsn.c: Created (or replaced with new files). * Makefile: Add convex dependent files. Changed default flags to gnu malloc to be CFLAGS. * config.gdb: Added convex to list of machines. * core.c (files_info): Added a FILES_INFO_HOOK to be used if defined. (xfer_core_file): Conditionalized compilation of xfer_core_file on the macro XFER_CORE_FILE. * coffread.c (record_misc_function): Made sure it zerod type field (which is now being used; see next). * dbxread.c: Included some convex dependent include files. (copy_pending, fix_common_blocks): Created. [STAB_REG_REGNUM, BELIEVE_PCC_PROMOTION]: Created default values; may be overridden in m-*.h. Included data structures for keeping track of common blocks. (dbx_alloc_type): Modified; if called with negative 1's will create a type without putting it into the type vector. (read_dbx_symtab, read_addl_syms): Modified calls to record_misc_function to include the new information. (symbol_file_command, psymtab_to_symtab, add_file_command): Modified reading in of string table to adapt to machines which *don't* store the size of the string table in the first four bytes of the string table. (read_dbx_symtab, scan_file_globals, read_ofile_symtab, read_addl_syms): Modified assignment of namestring to accept null index into symtab as ok. (read_addl_syms): Modified readin of a new object file to fiddle with common blocks correctly. (process_one_symbol): Fixed incorrect comment about convex. Get symbols local to a lexical context from correct spot on a per machine basis. Catch a bug in pcc which occaisionally puts an SO where there should be an SOL. Seperate sections for N_BCOMM & N_ECOMM. (define_symbol): Ignore symbols with no ":". Use STAB_REG_TO_REGNUM. Added support for function args calling by reference. (read_type): Only read type number if one is there. Remove old (#if 0'd out) array code. (read_array_type): Added code for dealing with adjustable (by parameter) arrays half-heartedly. (read_enum_type): Allow a ',' to end a list of values. (read_range_type): Added code to check for long long. * expread.y: Modified to use LONGEST instead of long where necessary. Modified to use a default type of int for objects that weren't in text space. * findvar.c (locate_var_value, read_var_value): Modified to deal with args passed by reference. * inflow.c (create_inferior): Used CREATE_INFERIOR_HOOK if it exists. * infrun.c (attach_program): Run terminal inferior when attaching. (wait_for_inferior): Removed several convex dependencies. * main.c (float_handler): Created. Made whatever signal indicates a stop configurable (via macro STOP_SIGNAL). (main): Setup use of above as a signal handler. Added check for "-nw" in args already processed. (command_line_input): SIGTSTP ==>STOP_SIGNAL. * expread.y: Added token BLOCKNAME to remove reduce/reduce conflict. * Makefile: Change message to reflect new grammar. Mon Apr 17 13:24:59 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * printcmd.c (compare_ints): Created. (print_frame_args): Modified to always print arguments in the order in which they were found in the symbol table. Figure out what apots are missing on the fly. * stack.c (up_command): Error if no inferior or core file. * m-i386.h, m-symmetry.h [FRAMELESS_FUNCTION_INVOCATION]: Created; same as m68k. * dbxread.c (define_symbol): Changed "desc==0" test to "processing_gcc_compilation", which is the correct way to do it. Sat Apr 15 17:18:38 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * expread.y: Added precedence rules for arglists, ?:, and sizeof to eliminate some shift-reduce conflicts. * Makefile: Modified "Expect" message to conform to new results. Thu Apr 13 12:29:26 1989 Randall Smith (randy at plantaris.ai.mit.edu) * inflow.c (terminal_init_inferior): Fixed typo in recent diff installation; TIOGETC ==> TIOCGETC. * m-vax.h, m-sun2.h, m-sun3.h, m-sparc.h, m-hp*.h, m-isi.h, m-news.h [FRAMELESS_FUNCTION_INVOCATION]: Created macro with appropriate definition. Wed Apr 12 15:30:29 1989 Randall Smith (randy at plantaris.ai.mit.edu) * blockframe.c (get_prev_frame_info): Added in a macro to specify when a "frame" is called without a frame pointer being setup. * Makefile [clean]: Made sure to delete gnu malloc if it was being used. Mon Apr 10 12:43:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * dbxread.c (process_one_symbol): Reset within_function to 0 after last RBRAC of a function. * dbxread.c (read_struct_type): Changed check for filling in of TYPE_MAIN_VARIANT of type. * inflow.c (create_inferior): Conditionalized fork so that it would be used if USG was defined and HAVE_VFORK was not defined. * defs.h: Added comment about enum command_class element class_alias. * dbxread.c (process_one_symbol): Fixed a typo with interesting implications for associative processing in the brain (':' ==> 'c'). * sparc-dep.c (isabranch): Changed name to isannulled, modified to deal with coprocessor branches, and improved comment. (single_step): Changed to trap at npc + 4 instead of pc +8 on annulled branches. Changed name in call to isabranch as above. * m-sun4os4.h (STACK_END_ADDRESS): Changed it to 0xf8000000 under os 4.0. Sat Apr 8 17:04:07 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * dbxread.c (process_one_symbol): In the case N_FUN or N_FNAME the value being refered to is sometimes just a text segment variable. Catch this case. * infrun.c (wait_for_inferior), breakpoint.c (breakpoint_stop_status): Move the selection of the frame to inside breakpoint_stop_status so that the frame only gets selected (and the symbols potentially read in) if the symbols are needed. * symtab.c (find_pc_psymbol): Fixed minor misthough (pc >= fucntion start, not >). * breakpoint.c (_initialize_breakpoint): Change "delete" internal help entry to simply refer to it being a prefix command (since the list of subcommands is right there on a "help delete"). Fri Apr 7 15:22:18 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * blockframe.c (find_pc_partial_function): Created; figures out what function pc is in (name and address) without reading in any new symbols. * symtab.h: Added decl for above. * infrun.c (wait_for_inferior): Used instead of find_pc_function_start. * stack.c (print_frame_info): Used instead of hand coding for same thing. * dbxread.c (psymtab_to_symtab): No longer patch readin pst's out of the partial_symtab_list; need them there for some checks. * blockframe.c (block_for_pc), source.c (select_source_symtab), symtab.c (lookup_symbol, find_pc_symtab, list_symbols): Made extra sure not to call psymtab_to_symtab with ->readin == 1, since these psymtab now stay on the list. * symtab.c (sources_info): Now distinguishes between psymtabs with readin set and those with it not set. * symtab.c (lookup_symtab): Added check through partial symtabs for name with .c appended. * source.c (select_source_symtab): Changed semantics a little so that the argument means something. * source.c (list_command), symtab.c (decode_line_1): Changed call to select_source_symtab to match new conventions. * dbxread.c (add_file_command): This command no longer selects a symbol table to list from. * infrun.c (wait_for_inferior): Only call find_pc_function (to find out if we have debugging symbols for a function and hence if we should step over or into it) if we are doing a "step". Thu Apr 6 12:42:28 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * main.c (command_line_input): Added a local buffer and only copied information into the global main.c buffer when it is appropriate for it to be saved (and repeated). (dont_repeat): Only nail line when we are reading from stdin (otherwise null lines won't repeat and what's in line needs to be saved). (read_command_lines): Fixed typo; you don't what to repeat when reading command lines from the input stream unless it's standard input. John Gilmore's (gnu@toad.com) mods for USG gdb: * inflow.c: Removed inclusion of sys/user.h; no longer necessary. (, terminal_init_inferior, terminal_inferior, terminal_ours_1, term_status_command, _initialize_inflow) Seperated out declaration and usage of terminal mode structures based on the existence of the individual ioctls. * utils.c (request_quit): Restore signal handler under USG. If running under USG initialize sys_siglist at run time (too much variation between systems). Wed Apr 5 13:47:24 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) John Gilmore's (gnu@toad.com) mods for USG gdb: * default-dep.c: Moved include of sys/user.h to after include of a.out.h. (store_inferior_registers): Fixed error message. (core_file_command): Improved error messages from reading in of u area in core file. Changed calculation of offset of registers to account for some machines putting it in as an offset rather than an absolute address. Changed error messages for reading of registers from core file. * coffread.c (read_file_hdr): Added final check for BADMAG macro to use if couldn't recognize magic number. * Makefile: Added explicit directions for alloca addition. Included alloca.c in list of possible library files. Cleaned up possible library usage. Included additional information on gcc and include files. * source.c, remote.c, inflow.c, dbxread.c, core.c, coffread.c: Changed include of sys/fcntl.h to an include of fcntl.h (as per posix; presumably this will break fewer machines. I hopw). * README: Added a pointer to comments at top of Makefile. * Makefile: Added a comment about machines which need fcntl.h in sys. Tue Apr 4 11:29:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * valprint.c (set_prettyprint_command, set_unionprint_command, format_info): Created. (_initialize_valprint): Added to lists of commands. * gdb.texinfo [Backtrace]: Added a section describing the format if symbols have not yet been read in. * valprint.c (val_print): Added code to prettyprint structures if "prettyprint" is set and only to print unions below the top level if "unionprint" is set. * infcmd.c (registers_info), valprint.c (value_print, val_print): Added argument to call to val_print indicating deptch of recursion. * symtab.[ch] (find_pc_psymbol): Created; finds static function psymbol with value nearest to but under value passed. * stack.c (print_frame_info): Used above to make sure I have best fit to pc value. * symseg.h (struct partial_symbol): Added value field. * dbxread.c (read_dbx_symtab): Set value field for partial symbols saved (so that we can lookup static symbols). * symtab.[ch] (find_pc_symtab): Changed to external. * stack.c (select_frame): Call above to make sure that symbols for a selected frame is readin. Mon Apr 3 12:48:16 1989 Randall Smith (randy at plantaris.ai.mit.edu) * stack.c (print_frame_info): Modified to only print out full stack frame info on symbols whose tables have been read in. * symtab.c, symtab.h (find_pc_psymtab): Made function external; above needed it. * main.c (,set_verbose_command, initialize_main): Created a variable "info_verbose" which says to talk it up in various and sundry places. Added command to set this variable. * gdb.texinfo (GDB Output): Added documentation on "set verbose" and changed the name of the "Screen Output" section to "GDB Output". * dbxread.c (psymtab_to_symtab): Added information message about symbol readin. Conditionalized on above. * dbxread.c (define_symbol): Made an "i" constant be of class LOC_CONST and an "r" constant be of class LOC_CONST_BYTES. * README: Made a note about modifications which may be necessary to the manual for this version of gdb. * blockframe.c (get_prev_frame_info): Now we get saved address and check for validity before we check for leafism. This means that we will catch the fact that we are in start, but we will miss any fns that start calls without an fp. This should be fine. * m-*.h (FRAME_CHAIN): Modified to return 0 if we are in start. This is usually a test for within the first object file. * m-sparc.h (FRAME_CHAIN): The test here is simply if the fp saved off the the start sp is 0. * blockframe.c (get_prev_frame_info): Removed check to see if we were in start. Screws up sparc. * m-sparc.h (FRAME_FIND_SAVED_REGISTERS): Changed test for dummy frame to not need frame to be innermost. * gdb.texinfo: Added section on frameless invocations of functions and when gdb can and can't deal with this. * stack.c (frame_info): Disallowed call if no inferior or core file; fails gracefully if truely bad stack specfication has been given (ie. parse_frame_specification returns 0). Fri Mar 31 13:59:33 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * infrun.c (normal_stop): Changed references to "unset-env" to "delete env". * infcmd.c (_initialize_infcmd): Change reference to set-args in help run to "set args". * remote.c (getpkt): Allow immediate quit when reading from device; it could be hung. * coffread.c (process_coff_symbol): Modify handling of REG parameter symbols. Thu Mar 30 15:27:23 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * dbxread.c (symbol_file_command): Use malloc to allocate the space for the string table in symbol_file_command (and setup a cleanup for this). This allows a more graceful error failure if there isn't any memory availible (and probably allows more memory to be avail, depending on the machine). Additional mods for handling GNU C++ (from Tiemann): * dbxread.c (read_type): Added case for '#' type (method type, I believe). (read_struct_type): If type code is undefined, make the main variant for the type be itself. Allow recognition of bad format in reading of structure fields. * eval.c (evaluate_subexp): Modify evaluation of a member of a structure and pointer to same to make sure that the syntax is being used correctly and that the member is being accessed correctly. * symseg.h: Added TYPE_CODE_METHOD to enum type_code. Add a pointer to an array of argument types to the type structure. * symtab.c (lookout_method_type, smash_to_method_type): Created. * symtab.h (TYPE_ARG_TYPES): Created. * valops.c (call_function): Modified handling of methods to be the same as handling of functions; no longer check for members. * valprint.c (val_print, type_print_varspec_{prefix,suffix}, type_print_base): Added code to print method args correctly. * values.c (value_virtual_fn_field): Modify access to virtual function table. Wed Mar 29 13:19:34 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * findvar.c: Special cases for REGISTER_WINDOWS: 1) Return 0 if we are the innermost frame, and 2) return the next frame in's value if the SP is being looked for. * blockframe.c (get_next_frame): Created; returns the next (inner) frame of the called frame. * frame.h: Extern delcaration for above. * main.c (command_line_input): Stick null at end before doing history expansion. Tue Mar 28 17:35:50 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * dbxread.c (read_dbx_symtab): Added namestring assignment to N_DATA/BSS/ABS case. Sigh. Sat Mar 25 17:49:07 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * expread.y: Defined YYDEBUG. Fri Mar 24 20:46:55 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * symtab.c (make_symbol_completion_list): Completely rewrote to never call psymtab_to_symtab, to do a correct search (no duplicates) through the visible symbols, and to include structure and union fields in the things that it can match. Thu Mar 23 15:27:44 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * dbxread.c (dbx_create_type): Created; allocates and inits space for a type without putting it on the type vector lists. (dbx_alloc_type): Uses above. * Makefile: xgdb.o now produced by default rules for .o.c. Fri Mar 17 14:27:50 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * infrun.c: Fixed up inclusion of aouthdr.h on UMAX_PTRACE. * Makefile, config.gdb: Added hp300bsd to potential configurations. * hp300bsd-dep.c, m-hp300bsd.h: Created. * infrun.c (wait_for_inferior): Rewrote to do no access to inferior until we make sure it's still there. * inflow.c (inferior_died): Added a select to force the selected frame to null when inferior dies. * dbxread.c (symbol_file_command): free and zero symfile when discarding symbols. * core.c (xfer_core_file): Extended and cleaned up logic in interpeting memory address. * core.c (xfer_core_file): Extended opening comment. Thu Mar 16 15:39:42 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * coffread.c (symbol_file_command): Free symfile name when freeing contents. * blockframe.c (get_prev_frame_info): Added to fatal error message to indicate that it should never happen. * stack.c (frame_info): Printed out value of "saved" sp seperately to call attention to the fact that it isn't stored in memory anywhere; the actual previous frames address is printed. * m-sparc.h (FRAME_FIND_SAVED_REGS): Set address of sp saved in frame to value of fp (rather than value of sp in current frame). * expread.y: Allow "unsigned" as a type itself, as well as a type modifier. * coffread.c: Added declaration for fclose Fri Mar 10 17:22:31 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * main.c (command_line_input): Checked for -1 return from readline; indicates EOF. Fri Mar 3 00:31:27 1989 Randall Smith (randy at gluteus.ai.mit.edu) * remote.c (remote_open): Cast return from signal to (void (*)) to avoid problems on machines where the return type of signal is (int (*)). * Makefile: Removed deletion of version control from it (users will need it for their changes). Thu Mar 2 15:32:21 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * symmetry-dep.c (print_1167_regs): Print out effective doubles on even number regs. (fetch_inferior_registers): Get the floating point regs also. * xgdb.c (do_command): Copied command before calling execute command (so that execute_command wouldn't write into text space). * copying.awk: Created (will produce copying.c as output when given COPYING as input). * Makefile: Used above to create copying.c. * main.c: Took out info_warranty and info_copying. * *.*: Changed copyright notice to use new GNU General Public License (includes necessary changes to manual). * xgdb.c (create_text_widget): Created text_widget before I create the source and sink. (print_prompt): Added fflush (stdout). * Makefile: Added -lXmu to the compilation line for xgdb. Left the old one there incase people still had R2. * README: Added note about -gg format. * remote.c (getpkt): Fixed typo; && ==> &. * Makefile: Added new variable READLINE_FLAGS so that I could force compilation of readline.c and history.c with -DSYSV on system V machines. Mentioned in Makefile comments at top. Wed Mar 1 17:01:01 1989 Randall Smith (randy at gluteus.ai.mit.edu) * hp9k320-dep.c (store_inferior_registers): Fixed typo. Fri Feb 24 14:58:45 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * hp9k320-dep.c (store_inferior_registers, fetch_inferior_registers): Added support for remote debugging. * remote.c (remote_timer): Created. (remote_open, readchar): Setup to timeout reads if they take longer than "timeout". This allows one to debug how long such things take. (putpkt): Modified to print a debugging message (if such things are enabled) each time it resends a packet. (getpkt): Modified to make the variable CSUM unsigned and read it CSUM with an & 0xff (presumably to deal with poor sign extension on some machines). Also made c1 and c2 unsigned. (remote_wait): Changed buffer to unsigned status. (remote_store_registers, remote_write_bytes): Puts a null byte at the end of the control string. * infcmd.c (attach_command, detach_command, _initialize_infcmd): Made attach_command and detach_command always availible, but modified them to only allow device file attaches if ATTACH_DETACH is not defined. * gdb.texinfo: Added cross reference from attach command to remote debugging. Thu Feb 23 12:37:59 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * remote.c (remote_close): Created to close the remote connection and set the remote_debugging flag to 0. * infcmd.c (detach_command): Now calls the above when appropriate. * gdb.texinfo: Removed references to the ``Distribution'' section in the copyright. * main.c, utils.c (ISATTY): Created default defintions of this macro which use isatty and fileno. * utils.c (fprintf_filtered, print_spaces_filtered), main.c (command_loop, command_line_input): Used this macro. * m-news.h: Created a definition to override this one. * utils.c (fprintf_filtered): Made line_size static (clueless). * utils.c (fprintf_filtered): Changed max length of line printed to be 255 chars or twice the format length. * symmetry-dep.c, m-symmetry: Fixed typo (^L ==> ). * printcmd.c (do_examine): Fixed typo (\n ==> \t). Wed Feb 22 16:00:33 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) Contributed by Jay Vosburgh (jay@mentor.cc.purdue.edu) * m-symmetry.h, symmetry-dep.c: Created. * Makefile: Added above in appropriate lists. * config.gdb: Added "symmetry" target. * utils.c (prompt_for_continue): Zero'd chars_printed also. * utils.c (fprintf_filtered): Call prompt for continue instead of doing it yourself. * dbxread.c (read_dbx_symtab): Added code to conditionalize what symbol type holds to "x.o" or "-lx" symbol that indicates the beginning of a new file. Tue Feb 21 16:22:13 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * gdb.texinfo: Deleted @ignore block at end of file. * findvar.c, stack.c: Changed comments that refered to "frame address" to "frame id". * findvar.c (locate_var_value): Modified so that taking the address of an array generates an object whose type is a pointer to the elements of the array. Sat Feb 18 16:35:14 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * gdb.texinfo: Removed reference to "!" as a shell escape character. Added a section on controling screen output (pagination); changing "Input" section to "User Interface" section. Changed many inappropriate subsubsection nodes into subsections nodes (in the readline and history expansion sections). Fri Feb 17 11:10:54 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * utils.c (set_screensize_command): Created. (_initialize_utils): Added above to setlist. * main.c (main): Added check to see if ~/.gdbinit and .gdbinit were the same file; only one gets read if so. Had to include sys/stat.h for this. * valprint.c (type_print_base): Changed calls to print_spaces to print_spaces_filtered. * main.c (command_line_input): Chaned test for command line editing to check for stdin and isatty. * main.c (command_loop): Call reinitialize_more_filter before each command (if reading from stdin and it's a tty). utils.c (initialize_more_filter): Changed name to reinitialize_more_filter; killed arguments. utils.c (_initialize_utils): Created; initialized lines_per_page and chars_per_line here. * utils.c (fprintf_filtered): Removed printing of "\\\n" after printing linesize - 1 chars; assume that the screen display will take care of that. Still watching that overflow. * main.c: Created the global variables linesize and pagesize to describe the number of chars per line and lines per page. Thu Feb 16 17:27:43 1989 Randall Smith (randy at gluteus.ai.mit.edu) * printcmd.c (do_examine, print_scalar_formatted, print_address, whatis_command, do_one_display, ptype_command), valprint.c (value_print, val_print, type_print_method_args, type_print_1, type_print_derivation_info, type_print_varspec_suffix, type_print_base), breakpoint.c (breakpoints_info, breakpoint_1), values.c (history_info), main.c (editing_info, warranty_info, copying_info), infcmd.c (registers_info), inflow.c (term_status_command), infrun.c (signals_info), stack.c (backtrace_command, print_frame_info), symtab.c (list_symbols, output_source_filename), command.c (help_cmd, help_list, help_command_list): Replaced calls to printf, fprintf, and putc with calls to [f]printf_filtered to handle more processing. Killed local more emulations where I noticed them. Wed Feb 15 15:27:36 1989 Randall Smith (randy at gluteus.ai.mit.edu) * defs.h, utils.c (initialize_more_filter, fprintf_filtered, printf_filtered): Created a printf that will also act as a more filter, prompting the user for a <return> whenever the page length is overflowed. * symtab.c (list_symbols): Elminated some code inside of an #if 0. Tue Feb 14 11:11:24 1989 Randall Smith (randy at gluteus.ai.mit.edu) * Makefile: Turned off backup versions for this file; it changes too often. * command.c (lookup_cmd, _initialize_command): Changed '!' so that it was no longer a shell escape. "sh" must be used. * main.c (command_line_input, set_history_expansion, initialize_main): Turned history expansion on, made it the default, and only execute it if the first character in the line is a '!'. * version.c, gdb.texinfo: Moved version to 3.2 (as usual, jumping the gun some time before release). * gdb.texinfo: Added sections (adapted from Brian's notes) on command line editing and history expansion. * main.c (set_command_editing, initialize_main): Modified name to set_editing and modified command to "set editing". * Makefile: Put in dependencies for READLINEOBJS. * main.c (history_info, command_info): Combined into new command info; deleted history_info. (initialize_main): Deleted "info history" command; it was interfering with the value history. * coffread.c (enter_linenos): Modified to do bit copy instead of pointer dereference, since the clipper machine can't handle having longs on short boundaries. (read_file_hdr): Added code to get number of syms for clipper. * stack.c (return_command): Fixed method for checking when all of the necessary frames had been popped. * dbxread.c (read_dbx_symtab (ADD_PSYMBOL_TO_LIST)): Fixed typo in allocation length. Mon Feb 13 10:03:27 1989 Randall Smith (randy at gluteus.ai.mit.edu) * dbxread.c (read_dbx_symtab): Split assignment to namestring into several different assignments (so that it wouldn't be done except when it had to be). Shortened switches and duplicated code to produce the lowest possible execution time. Commented (at top of switch) which code I duplicated. * dbxread.c (read_dbx_symtab): Modified which variables were register and deleted several variables which weren't used. Also eliminated 'F' choice from subswitch, broke out strcmp's, reversed compare on line 1986, and elminated test for !namestring[0]; it is caught by following test for null index of ':'. Sun Feb 12 12:57:56 1989 Randall Smith (randy at plantaris.ai.mit.edu) * main.c (gdb_completer_word_break_characters): Turned \~ into ~. Sat Feb 11 15:39:06 1989 Randall Smith (randy at plantaris.ai.mit.edu) * symtab.c (find_pc_psymtab): Created; checks all psymtab's till it finds pc. (find_pc_symtab): Used; fatal error if psymtab found is readin (should have been caught in symtab loop). (lookup_symbol): Added check before scan through partial symtab list for symbol name to be on the misc function vector (only if in VAR_NAMESPACE). Also made sure that psymtab's weren't fooled with if they had already been read in. (list_symbols): Checked through misc_function_vector for matching names if we were looking for functions. (make_symbol_completion_list): Checked through misc_function_vector for matching names. * dbxread.c (read_dbx_symtab): Don't bother to do processing on global function types; this will be taken care of by the misc_function hack. * symtab.h: Modified comment on misc_function structure. Fri Feb 10 18:09:33 1989 Randall Smith (randy at plantaris.ai.mit.edu) * symseg.h, dbxread.c (read_dbx_symtab, init_psymbol_list, start_psymtab, end_psymtab), coffread.c (_initialize_coff), symtab.c (lookup_partial_symbol, list_symbols, make_symbol_completion_list): Changed separate variables for description of partial symbol allocation into a specific kind of structure. (read_dbx_symtab, process_symbol_for_psymtab): Moved most of process_symbol_for_psymtab up into read_dbx_symtab, moved a couple of symbol types down to the ingore section, streamlined (I hope) code some, modularized access to psymbol lists. Thu Feb 9 13:21:19 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * main.c (command_line_input): Made sure that it could recognize newlines as indications to repeat the last line. * symtab.c (_initialize_symtab): Changed size of builtin_type_void to be 1 for compatibility with gcc. * main.c (initialize_main): Made history_expansion the default when gdb is compiled with HISTORY_EXPANSION. * readline.c, readline.h, history.c, history.h, general.h, emacs_keymap.c, vi_keymap.c, keymaps.c, funmap.c: Made all of these links to /gp/gnu/bash/* to keep them updated. * main.c (initialize_main): Made default be command editing on. Wed Feb 8 13:32:04 1989 & Smith (randy at hobbes) * dbxread.c (read_dbx_symtab): Ignore N_BSLINE on first readthrough. * Makefile: Removed convex-dep.c from list of distribution files. Tue Feb 7 14:06:25 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * main.c: Added command lists sethistlist and unsethistlist to accesible command lists. (parse_binary_operation): Created to parse a on/1/yes vs. off/0/no spec. (set_command_edit, set_history, set_history_expansion, set_history_write, set_history_size, set_history_filename, command_info, history_info): Created to allow users to control various aspects of command line editing. * main.c (symbol_creation_function): Created. (command_line_input, initialize_main): Added rest of stuff necessary for calling bfox' command editing routines under run-time control. * Makefile: Included readline and history source files for command editing; also made arrangements to make sure that the termcap library was available. * symtab.c (make_symbol_completion_list): Created. Mon Feb 6 16:25:25 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * main.c: Invented variables to control command editing. command_editing_p, history_expansion_p, history_size, write_history_p, history_filename. Initialized them to default values in initialize_main. * infcmd.c (registers_info), infrun.c (signals_info), * main.c (gdb_read_line): Changed name to command_line_input. (readline): Changed name to gdb_readline; added second argument indicating that the read value shouldn't be saved (via malloc). * infcmd.c (registers_info), infrun.c (signals_info), main.c (copying_info), symtab.c (output_source_filename, MORE, list_symbols): Converted to use gdb_readline in place of gdb_read_line. Sun Feb 5 17:34:38 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * blockframe.c (get_frame_saved_regs): Removed macro expansion that had accidentally been left in the code. Sat Feb 4 17:54:14 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * main.c (gdb_read_line, readline): Added function readline and converted gdb_read_line to use it. This was a conversion to the line at a time style of input, in preparation for full command editing. Fri Feb 3 12:39:03 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * dbxread.c (read_dbx_symtab): Call end_psymtab at the end of read_dbx_symtab if any psymtab still needs to be completed. * config.gdb, sun3-dep.c: Brought these into accord with the actual sun2 status (no floating point period; sun3-dep.c unless has os > 3.0). * m-sun2os2.h: Deleted; not needed. * config.gdb: Added a couple of aliases for machines in the script. * infrun.c: Added inclusion of aouthdr.h inside of #ifdef UMAX because ptrace needs to know about the a.out header. * Makefile: Made dep.o depend on dep.c and config.status only. * expread.y: Added declarations of all of the new write_exp_elt functions at the include section in the top. * Makefile: Added a YACC definition so that people can use bison if they wish. * Makefile: Added rms' XGDB-README to the distribution. * Makefile: Added removal of init.o on a "make clean". Thu Feb 2 16:27:06 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * *-dep.c: Deleted definition of COFF_FORMAT if AOUTHDR was defined since 1) We *may* (recent mail message) want to define AOUTHDR under a basically BSD system, and 2) AOUTHDR is sometimes a typedef in coff encapsulation setups. Also removed #define's of AOUTHDR if AOUTHDR is already defined (inside of coff format). * core.c, dbxread.c: Removed #define's of AOUTHDR if AOUTHDR is already defined (inside of coff format). Tue Jan 31 12:56:01 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * GDB 3.1 released. * values.c (modify_field): Changed test for endianness to assign to integer and reference character (so that all bits would be defined). Mon Jan 30 11:41:21 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * news-dep.c: Deleted inclusion of fcntl.h; just duplicates stuff found in sys/file.h. * i386-dep.c: Included default definition of N_SET_MAGIC for COFF_FORMAT. * config.gdb: Added checks for several different operating systems. * coffread.c (read_struct_type): Put in a flag variable so that one could tell when you got to the end of a structure. * sun3-dep.c (core_file_command): Changed #ifdef based on SUNOS4 to ifdef based on FPU. * infrun.c (restore_inferior_status): Changed error message to "unable to restore previously selected frame". * dbxread.c (read_dbx_symtab): Used intermediate variable in error message reporting a bad symbol type. (scan_file_globals, read_ofile_symtab, read_addl_syms): Data type of "type" changed to unsigned char (which is what it is). * i386-dep.c: Removed define of COFF_FORMAT if AOUTHDR is defined. Removed define of a_magic to magic (taken care of by N_MAGIC). (core_file_command): Zero'd core_aouthdr instead of setting magic to zero. * i386-pinsn.c: Changed jcxz == jCcxz in jump table. (putop): Added a case for 'C'. (OP_J): Added code to handle possible masking of PC value on certain kinds of data. m-i386gas.h: Moved COFF_ENCAPSULATE to before inclusion of m-i386.h and defined NAMES_HAVE_UNDERSCORE. * coffread.c (unrecrod_misc_function, read_coff_symtab): Added symbol number on which error occured to error output. Fri Jan 27 11:55:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * Makefile: Removed init.c in make clean. Removed it without -f and with leading - in make ?gdb. Thu Jan 26 15:08:03 1989 Randall Smith (randy at gluteus.ai.mit.edu) Changes to get it to work on gould NP1. * dbxread.c (read_dbx_symtab): Included cases for N_NBDATA and N_NBBSS. (psymtab_to_symtab): Changed declaration of hdr to DECLARE_FILE_HEADERS. Changed access to use STRING_TABLE_SIZE and SYMBOL_TABLE_SIZE. * gld-pinsn.c (findframe): Added declaration of framechain() as FRAME_ADDR. * coffread.c (read_coff_symtab): Avoided treating typedefs as external symbol definitions. Wed Jan 25 14:45:43 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * Makefile: Removed reference to alloca.c. If they need it, they can pull alloca.o from the gnu-emacs directory. * version.c, gdb.texinfo: Updated version to 3.1 (jumping the gun a bit so that I won't forget when I release). * m-sun2.h, m-sun2os2.h, m-sun3os4.h, config.gdb: Modified code so that default includes new sun core, ptrace, and attach-detach. Added defaults for sun 2 os 2. Modifications to reset stack limit back to what it used to be just before exec. All mods inside of #ifdef SET_STACK_LIMIT_HUGE. * main.c: Added global variable original_stack_limit. (main): Set original_stack_limit to original stack limit. * inflow.c: Added inclusion of necessary files and external reference to original_stack_limit. (create_inferior): Reset stack limit to original_stack_limit. * dbxread.c (read_dbx_symtab): Killed PROFILE_SYMBOLS ifdef. * sparc-dep.c (isabranch): Multiplied offset by 4 before adding it to addr to get target. * Makefile: Added definition of SHELL to Makefile. * m-sun2os4.h: Added code to define NEW_SUN_PTRACE, NEW_SUN_CORE, and ATTACH_DETACH. * sun3-dep.c: Added code to avoid fp regs if we are on a sun2. Tue Jan 24 17:59:14 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * dbxread.c (read_array_type): Added function. (read_type): Added call to above instead of inline code. * Makefile: Added ${GNU_MALLOC} to the list of dependencies for the executables. Mon Jan 23 15:08:51 1989 Randall Smith (randy at plantaris.ai.mit.edu) * gdb.texinfo: Added paragraph to summary describing languages with which gdb can be run. Also added descriptions of the "info-methods" and "add-file" commands. * symseg.h: Commented a range type as having TYPE_TARGET_TYPE pointing at the containing type for the range (often int). * dbxread.c (read_range_type): Added code to do actual range types if they are defined. Assumed that the length of a range type is the length of the target type; this is a lie, but will do until somebody gets back to me as to what these silly dbx symbols mean. * dbxread.c (read_range_type): Added code to be more picky about recognizing builtins as range types, to treat types defined as subranges of themselves to be subranges of int, and to recognize the char type idiom from dbx as a special case. Sun Jan 22 01:00:13 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * m-vax.h: Removed definition of FUNCTION_HAS_FRAME_POINTER. * blockframe.c (get_prev_frame_info): Removed default definition and use of above. Instead conditionalized checking for leaf nodes on FUNCTION_START_OFFSET (see comment in code). Sat Jan 21 16:59:19 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * dbxread.c (read_range_type): Fixed assumption that integer was always type 1. * gdb.texinfo: Fixed spelling mistake and added a note in the running section making it clear that users may invoke subroutines directly from gdb. * blockframe.c: Setup a default definition for the macro FUNCTION_HAS_FRAME_POINTER. (get_prev_frame_info): Used this macro instead of checking SKIP_PROLOGUE directly. * m-vax.h: Overroad definition; all functions on the vax have frame pointers. Fri Jan 20 12:25:35 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * core.c: Added default definition of N_MAGIC for COFF_FORMAT. * xgdb.c: Installed a fix to keep the thing from dying when there isn't any frame selected. * core.c: Made a change for the UMAX system; needs a different file included if using that core format. * Makefile: Deleted duplicate obstack.h in dbxread.c dependency. * munch: Modified (much simpler) to cover (I hope) all cases. * utils.c (save_cleanups, restore_cleanups): Added functions to allow you to push and pop the chain of cleanups to be done. * defs.h: Declared the new functions. * main.c (catch_errors): Made sure that the only cleanups which would be done were the ones put on the chain *after* the current location. * m-*.h (FRAME_CHAIN_VALID): Removed check on pc in the current frame being valid. * blockframe.c (get_prev_frame_info): Made the assumption that if a frame's pc value was within the first object file (presumed to be /lib/crt0.o), that we shouldn't go any higher. * infrun.c (wait_for_inferior): Do *not* execute check for stop pc at step_resume_break if we are proceeding over a breakpoint (ie. if trap_expected != 0). * Makefile: Added -g to LDFLAGS. * m-news.h (POP_FRAME) Fixed typo. * printcmd.c (print_frame_args): Modified to print out register params in order by .stabs entry, not by register number. * sparc-opcode.h: Changed declaration of (struct arith_imm_fmt).simm to be signed (as per architecture manual). * sparc-pinsn.c (fprint_addr1, print_insn): Forced a cast to an int, so that we really would get signed behaivior (default for sun cc is unsigned). * i386-dep.c (i386_get_frame_setup): Replace function with new function provided by pace to fix bug in recognizing prologue. Thu Jan 19 11:01:22 1989 Randall Smith (randy at plantaris.ai.mit.edu) * infcmd.c (run_command): Changed error message to "Program not restarted." * value.h: Changed "frame" field in value structure to be a FRAME_ADDR (actually CORE_ADDR) so that it could survive across calls. * m-sun.h (FRAME_FIND_SAVED_REGS): Fixed a typo. * value.h: Added lval: "lval_reg_frame_relative" to indicate a register that must be interpeted relative to a frame. Added single entry to value structure: "frame", used to indicate which frame a relative regnum is relative to. * findvar.c (value_from_register): Modified to correctly setup these fields when needed. Deleted section to fiddle with last register copied on little endian machine; multi register structures will always occupy an integral number of registers. (find_saved_register): Made extern. * values.c (allocate_value, allocate_repeat_value): Zero frame field on creation. * valops.c (value_assign): Added case for lval_reg_frame_relative; copy value out, modify it, and copy it back. Desclared find_saved_register as being external. * value.h: Removed addition of kludgy structure; thoroughly commented file. * values.c (free_value, free_all_values, clear_value_history, set_internalvar, clear_internavars): Killed free_value. Wed Jan 18 20:09:39 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * value.h: Deleted struct partial_storage; left over from yesterday. * findvar.c (value_from_register): Added code to create a value of type lval_reg_partsaved if a value is in seperate registers and saved in different places. Tue Jan 17 13:50:18 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * value.h: Added lval_reg_partsaved to enum lval_type and commented enum lval_type. Commented value structure. Added "struct partial_register_saved" to value struct; added macros to deal with structure to value.h. * values.c (free_value): Created; special cases lval_reg_partsaved (which has a pointer to an array which also needs to be free). (free_all_values, clear_value_history, set_internalvar, clear_internalvars): Modified to use free_values. * m-sunos4.h: Changed name to sun3os4.h. * m-sun2os4.h, m-sun4os4.h: Created. * config.gdb: Added configuration entries for each of the above. * Makefile: Added into correct lists. * Makefile: Added dependencies on a.out.encap.h. Made a.out.encap.h dependent on a.out.gnu.h and dbxread.c dependent on stab.gnu.h. * infrun.c, remote.c: Removed inclusion of any a.out.h files in these files; they aren't needed. * README: Added comment about bug reporting and comment about xgdb. * Makefile: Added note to HPUX dependent section warning about problems if compiled with gcc and mentioning the need to add -Ihp-include to CFLAGS if you compile on those systems. Added a note about needing the GNU nm with compilers *of gdb* that use the coff encapsulate feature also. * hp-include: Made symbolic link over to /gp/gnu/binutils. * Makefile: Added TSOBS NTSOBS OBSTACK and REGEX to list of things to delete in "make clean". Also changed "squeakyclean" target as "realclean". * findvar.c (value_from_register): Added assignment of VALUE_LVAL to be lval_memory when that is appropriate (original code didn't bother because it assumed that it was working with a pre lval memoried value). * expread.y (yylex): Changed to only return type THIS if the symbol "$this" is defined in some block superior or equal to the current expression context block. Mon Jan 16 13:56:44 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * m-*.h (FRAME_CHAIN_VALID): On machines which check the relation of FRAME_SAVED_PC (thisframe) to first_object_file_end (all except gould), make sure that the pc of the current frame also passes (in case someone stops in _start). * findvar.c (value_of_register): Changed error message in case of no inferior or core file. * infcmd.c (registers_info): Added a check for inferior or core file; error message if not. * main.c (gdb_read_line): Modified to take prompt as argument and output it to stdout. * infcmd.c (registers_info, signals_info), main.c (command_loop, read_command_lines, copying_info), symtab.c (decode_line_2, output_source_filename, MORE, list_symbols): Changed calling convention used to call gdb_read_line. * infcmd.c, infrun.c, main.c, symtab.c: Changed the name of the function "read_line" to "gdb_read_line". * breakpoint.c: Deleted external referenced to function "read_line" (not needed by code). Fri Jan 13 12:22:05 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * i386-dep.c: Include a.out.encap.h if COFF_ENCAPSULATE. (N_SET_MAGIC): Defined if not defined by include file. (core_file_command): Used N_SET_MAGIC instead of assignment to a_magic. (exec_file_command): Stuck in a HEADER_SEEK_FD. * config.gdb: Added i386-dep.c as depfile for i386gas choice. * munch: Added -I. to cc to pick up things included by the param file. * stab.gnu.def: Changed name to stab.def (stab.gnu.h needs this name). * Makefile: Changed name here also. * dbxread.c: Changed name of gnu-stab.h to stab.gnu.h. * gnu-stab.h: Changed name to stab.gnu.h. * stab.gnu.def: Added as link to binutils. * Makefile: Put both in in the distribution. Thu Jan 12 11:33:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * dbxread.c: Made which stab.h is included dependent on COFF_ENCAPSULATE; either <stab.h> or "gnu-stab.h". * Makefile: Included gnu-stab.h in the list of files to include in the distribution. * gnu-stab.h: Made a link to /gp/gnu/binutils/stab.h * Makefile: Included a.out.gnu.h and m-i386gas.h in list of distribution files. * m-i386gas.h: Changed to include m-i386.h and fiddle with it instead of being a whole new file. * a.out.gnu.h: Made a link to /gp/gnu/binutils/a.out.gnu.h. Chris Hanson's changes to gdb for hp Unix. * Makefile: Modified comments on hpux. * hp9k320-dep.c: #define'd WOPR & moved inclusion of signal.h * inflow.c: Moved around declaratiosn of <sys/fcntl.h> and <sys/ioctl.h> inside of USG depends and deleted all SYSV ifdef's (use USG instead). * munch: Modified to accept any number of spaces between the T and the symbol name. Pace's changes to gdb to work with COFF_ENCAPSULATE (robotussin): * config.gdb: Added i386gas to targets. * default-dep.c: Include a.out.encap.h if COFF_ENCAPSULATE. (N_SET_MAGIC): Defined if not defined by include file. (core_file_command): Used N_SET_MAGIC instead of assignment to a_magic. (exec_file_command): Stuck in a HEADER_SEEK_FD. * infrun.c, remote.c: Added an include of a.out.encap.h if COFF_ENCAPSULATE defined. This is commented out in these two files, I presume because the definitions aren't used. * m-i386gas.h: Created. * dbxread.c: Included defintions for USG. (READ_FILE_HEADERS): Now uses HEADER_SEEK_FD if it exists. (symbol_file_command): Deleted use of HEADER_SEEK_FD. * core.c: Deleted extra definition of COFF_FORMAT. (N_MAGIC): Defined to be a_magic if not already defined. (validate_files): USed N_MAGIC instead of reading a_magic. Wed Jan 11 12:51:00 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * remote.c: Upped PBUFSIZ. (getpkt): Added zeroing of c inside loop in case of error retry. * dbxread.c (read_dbx_symtab, process_symbol_for_psymtab): Removed code to not put stuff with debugging symbols in the misc function list. Had been ifdef'd out. * gdb.texinfo: Added the fact that the return value for a function is printed if you use return. * infrun.c (wait_for_inferior): Removed test in "Have we hit step_resume_breakpoint" for sp values in proper orientation. Was in there for recursive calls in functions without frame pointers and it was screwing up calls to alloca. * dbxread.c: Added #ifdef COFF_ENCAPSULATE to include a.out.encap.h. (symbol_file_command): Do HEADER_SEEK_FD when defined. * dbxread.c, core.c: Deleted #ifdef ROBOTUSSIN stuff. * robotussin.h: Deleted local copy (was symlink). * a.out.encap.h: Created symlink to /gp/gnu/binutils/a.out.encap.h. * Makefile: Removed robotussin.h and included a.out.encap.h in list of files. * valprint.c (val_print, print_scalar_formatted): Changed default precision of printing float value; now 6 for a float and 16 for a double. * findvar.c (value_from_register): Added code to deal with the case where a value is spread over several registers. Still don't deal with the case when some registers are saved in memory and some aren't. Tue Jan 10 17:04:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * xgdb.c (xgdb_create_window): Removed third arg (XtDepth) to frameArgs. * infrun.c (handle_command): Error if signal number is less or equal to 0 or greater or equal to NSIG or a signal number is not provided. * command.c (lookup_cmd): Modified to not convert command section of command line to lower case in place (in case it isn't a subcommand, but an argument to a command). Fri Jan 6 17:57:34 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * dbxread.c: Changed "text area" to "data area" in comments on N_SETV. Wed Jan 4 12:29:54 1989 Randall Smith (randy at gluteus.ai.mit.edu) * dbxread.c: Added definitions of gnu symbol types after inclusion of a.out.h and stab.h. Mon Jan 2 20:38:31 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * eval.c (evaluate_subexp): Binary logical operations needed to know type to determine whether second value should be evaluated. Modified to discover type before binup_user_defined_p branch. Also commented "enum noside". * Makefile: Changed invocations of munch to be "./munch". * gdb.texinfo: Updated to refer to current version of gdb with January 1989 last update. * coffread.c (end_symtab): Zero context stack when finishing lexical contexts. (read_coff_symtab): error if context stack 0 in ".ef" else case. * m-*.h (FRAME_SAVED_PC): Changed name of argument from "frame" to "FRAME" to avoid problems with replacement of "->frame" part of macro. * i386-dep.c (i386_get_frame_setup): Added codestream_get() to move codestream pointer up to the correct location in "subl $X, %esp" case. Sun Jan 1 14:24:35 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * valprint.c (val_print): Rewrote routine to print string pointed to by char pointer; was producing incorrect results when print_max was 0. Fri Dec 30 12:13:35 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) * dbxread.c (read_dbx_symtab, process_symbol_for_psymtab): Put everything on the misc function list. * Checkpointed distribution. * Makefile: Added expread.tab.c to the list of things slated for distribution. Thu Dec 29 10:06:41 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) * stack.c (set_backtrace_limit_command, backtrace_limit_info, bactrace_command, _initialize_stack): Removed modifications for limit on backtrace. Piping the backtrace through an interuptable "more" emulation is a better way to do it. Wed Dec 28 11:43:09 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) * stack.c (set_backtrace_limit_command): Added command to set a limit to the number of frames for a backtrace to print by default. (backtrace_limit_info): To print the current limit. (backtrace_command): To use the limit. (_initialize_stack): To initialize the limit to its default value (30), and add the set and info commands onto the appropriate command lists. * gdb.texinfo: Documented changes to "backtrace" and "commands" commands. * stack.c (backtrace_command): Altered so that a negative argument would show the last few frames on the stack instead of the first few. (_initialize_stack): Modified help documentation. * breakpoint.c (commands_command): Altered so that "commands" with no argument would refer to the last breakpoint set. (_initialize_breakpoint): Modified help documentation. * infrun.c (wait_for_inferior): Removed ifdef on Sun4; now you can single step through compiler generated sub calls and will die if you next off of the end of a function. * sparc-dep.c (single_step): Fixed typo; "break_insn" ==> "sizeof break_insn". * m-sparc.h (INIT_EXTRA_FRAME_INFO): Set the bottom of a stack frame to be the bottom of the stack frame inner from this, if that inner one is a leaf node. * dbxread.c (read_dbx_symtab): Check to make sure we don't add a psymtab to it's own dependency list. * dbxread.c (read_dbx_symtab): Modified check for duplicate dependencies to catch them correctly. Tue Dec 27 17:02:09 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) * m-*.h (FRAME_SAVED_PC): Modified macro to take frame info pointer as argument. * stack.c (frame_info), blockframe.c (get_prev_frame_info), gld-pinsn.c (findframe), m-*.h (SAVED_PC_AFTER_CALL, FRAME_CHAIN_VALID, FRAME_NUM_ARGS): Changed usage of macros to conform to above. * m-sparc.h (FRAME_SAVED_PC), sparc-dep.c (frame_saved_pc): Changed frame_saved_pc to have a frame info pointer as an argument. * m-vax.h, m-umax.h, m-npl.h, infrun.c (wait_for_inferior), blockframe.c (get_prev_frame_info): Modified SAVED_PC_AFTER_CALL to take a frame info pointer as an argument. * blockframe.c (get_prev_frame_info): Altered the use of the macros FRAME_CHAIN, FRAME_CHAIN_VALID, and FRAME_CHAIN_COMBINE to use frame info pointers as arguments instead of frame addresses. * m-vax.h, m-umax.h, m-sun3.h, m-sun3.h, m-sparc.h, m-pn.h, m-npl.h, m-news.h, m-merlin.h, m-isi.h, m-hp9k320.h, m-i386.h: Modified definitions of the above macros to suit. * m-pn.h, m-npl.h, gould-dep.c (findframe): Modified findframe to use a frame info argument; also fixed internals (wouldn't work before). * m-sparc.h: Cosmetic changes; reordered some macros and made sure that nothing went over 80 lines. Thu Dec 22 11:49:15 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) * Version 3.0 released. * README: Deleted note about changing -lobstack to obstack.o. Wed Dec 21 11:12:47 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) * m-vax.h (SKIP_PROLOGUE): Now recognizes gcc prologue also. * blockframe.c (get_prev_frame_info): Added FUNCTION_START_OFFSET to result of get_pc_function_start. * infrun.c (wait_for_inferior): Same. * gdb.texinfo: Documented new "step" and "next" behavior in functions without line number information. Tue Dec 20 18:00:45 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) * infcmd.c (step_1): Changed behavior of "step" or "next" in a function witout line number information. It now sets the step range around the function (to single step out of it) using the misc function vector, warns the user, and continues. * symtab.c (find_pc_line): Zero "end" subsection of returned symtab_and_line if no symtab found. Mon Dec 19 17:44:35 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) * i386-pinsn.c (OP_REG): Added code from pace to streamline disassembly and corrected types. * i386-dep.c (i386_follow_jump): Code added to follow byte and word offset branches. (i386_get_frame_setup): Expanded to deal with more wide ranging function prologue. (i386_frame_find_saved_regs, i386_skip_prologue): Changed to use i386_get_frame_setup. Sun Dec 18 11:15:03 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) * m-sparc.h: Deleted definition of SUN4_COMPILER_BUG; was designed to avoid something that I consider a bug in our code, not theirs, and which I fixed earlier. Also deleted definition of CANNOT_USE_ARBITRARY_FRAME; no longer used anywhere. FRAME_SPECIFICATION_DYADIC used instead. * infrun.c (wait_for_inferior): On the sun 4, if a function doesn't have a prologue, a next over it single steps into it. This gets around the problem of a "call .stret4" at the end of functions returning structures. * m-sparc.h: Defined SUN4_COMPILER_FEATURE. * main.c (copying_info): Seperated the last printf into two printfs. The 386 compiler will now handle it. * i386-pinsn.c, i386-dep.c: Moved print_387_control_word, print_387_status_word, print_387_status, and i386_float_info to dep.c Also included reg.h in dep.c. Sat Dec 17 15:31:38 1988 Randall Smith (randy at gluteus.ai.mit.edu) * main.c (source_command): Don't close instream if it's null (indicating execution of a user-defined command). (execute_command): Set instream to null before executing commands and setup clean stuff to put it back on error. * inflow.c (terminal_inferior): Went back to not checking the ioctl returns; there are some systems when this will simply fail. It seems that, on most of these systems, nothing bad will happen by that failure. * values.c (value_static_field): Fixed dereferencing of null pointer. * i386-dep.c (i386_follow_jump): Modified to deal with unconditional byte offsets also. * dbxread.c (read_type): Fixed typo in function type case of switch. * infcmd.c (run_command): Does not prompt to restart if command is not from a tty. Fri Dec 16 15:21:58 1988 Randy Smith (randy at calvin) * gdb.texinfo: Added a third option under the "Cannot Insert Breakpoints" workarounds. * printcmd.c (display_command): Don't do the display unless there is an active inferior; only set it. * findvar.c (value_of_register): Added an error check for calling this when the inferior isn't active and a core file isn't being read. * config.gdb: Added reminder about modifying REGEX in the makefile for the 386. * i386-pinsn.c, i386-dep.c: Moved m-i386.h helper functions over to i386-dep.c.b Thu Dec 15 14:04:25 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) * README: Added a couple of notes about compiling gdb with itself. * breakpoint.c (set_momentary_breakpoint): Only takes FRAME_FP of frame if frame is non-zero. * printcmd.c (print_scalar_formatted): Implemented /g size for hexadecimal format on machines without an 8 byte integer type. It seems to be non-trivial to implement /g for other formats. (decode_format): Allowed hexadecimal format to make it through /g fileter. Wed Dec 14 13:27:04 1988 Randall Smith (randy at gluteus.ai.mit.edu) * expread.y: Converted all calls to write_exp_elt from the parser to calls to one of write_exp_elt_{opcode, sym, longcst, dblcst, char, type, intern}. Created all of these routines. This gets around possible problems in passing one of these things in one ear and getting something different out the other. Eliminated SUN4_COMPILER_BUG ifdef's; they are now superfluous. * symmisc.c (free_all_psymtabs): Reinited partial_symtab_list to 0. (_initialize_symmisc): Initialized both symtab_list and partial_symtab_list. * dbxread.c (start_psymtab): Didn't allocate anything on dependency list. (end_psymtab): Allocate dependency list on psymbol obstack from local list. (add_psymtab_dependency): Deleted. (read_dbx_symtab): Put dependency on local list if it isn't on it already. * symtab.c: Added definition of psymbol_obstack. * symtab.h: Added declaration of psymbol_obstack. * symmisc.c (free_all_psymtabs): Added freeing and reinitionaliztion of psymbol_obstack. * dbxread.c (free_all_psymbols): Deleted. (start_psymtab, end_psymtab, process_symbol_for_psymtab): Changed most allocation of partial symbol stuff to be off of psymbol_obstack. * symmisc.c (free_psymtab, free_all_psymtabs): Deleted free_psymtab subroutine. * symtab.h: Removed num_includes and includes from partial_symtab structure; no longer needed now that all include files have their own psymtab. * dbxread.c (start_psymtab): Eliminated initialization of above. (end_psymtab): Eliminated finalization of above; get includes from seperate list. (read_dbx_symtab): Moved includes from psymtab list to their own list; included in call to end_psymtab. * symmisc.c (free_psymtab): Don't free includes. Tue Dec 13 14:48:14 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) * i386-pinsn.c: Reformatted entire file to correspond to gnu software indentation conventions. * sparc-dep.c (skip_prologue): Added capability of recognizign stores of input register parameters into stack slots. * sparc-dep.c: Added an include of sparc-opcode.h. * sparc-pinsn.c, sparc-opcode.h: Moved insn_fmt structures and unions from pinsn.c to opcode.h. * sparc-pinsn.c, sparc-dep.c (isabranch, skip_prologue): Moved this function from pinsn.c to dep.c. * Makefile: Put in warnings about compiling with gcc (non-ansi include files) and compiling with shared libs on Sunos 4.0 (can't debug something that's been compiled that way). * sparc-pinsn.c: Put in a completely new file (provided by Tiemann) to handle floating point disassembly, load and store instructions, and etc. better. Made the modifications this file (ChangeLog) list for sparc-pinsn.c again. * symtab.c (output_source_filename): Included "more" emulation hack. * symtab.c (output_source_filename): Initialized COLUMN to 0. (sources_info): Modified to not print out a line for all of the include files within a partial symtab (since they have pst's of their own now). Also modified to make a distinction between those pst's read in and those not. * infrun.c: Included void declaration of single_step() if it's going to be used. * sparc-dep.c (single_step): Moved function previous to use of it. * Makefile: Took removal of expread.tab.c out of make clean entry and put it into a new "squeakyclean" entry. Mon Dec 12 13:21:02 1988 Randall Smith (randy at gluteus.ai.mit.edu) * sparc-pinsn.c (skip_prologue): Changed a struct insn_fmt to a union insn_fmt. * inflow.c (terminal_inferior): Checked *all* return codes from ioctl's and fcntl's in routine. * inflow.c (terminal_inferior): Added check for sucess of TIOCSPGRP ioctl call. Just notifies if bad. * dbxread.c (symbol_file_command): Close was getting called twice; once directly and once through cleanup. Killed the direct call. Sun Dec 11 19:40:40 1988 & Smith (randy at hobbes.ai.mit.edu) * valprint.c (val_print): Deleted spurious printing of "=" from TYPE_CODE_REF case. Sat Dec 10 16:41:07 1988 Randall Smith (randy at gluteus.ai.mit.edu) * dbxread.c: Changed allocation of psymbols from using malloc and realloc to using obstacks. This means they aren't realloc'd out from under the pointers to them. Fri Dec 9 10:33:24 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) * sparc-dep.c inflow.c core.c expread.y command.c infrun.c infcmd.c dbxread.c symmisc.c symtab.c printcmd.c valprint.c values.c source.c stack.c findvar.c breakpoint.c blockframe.c main.c: Various cleanups inspired by "gcc -Wall" (without checking for implicit declarations). * Makefile: Cleaned up some more. * valops.c, m-*.h (FIX_CALL_DUMMY): Modified to take 5 arguments as per what sparc needs (programming for a superset of needed args). * dbxread.c (process_symbol_for_psymtab): Modified to be slightly more picky about what it puts on the list of things *not* to be put on the misc function list. When/if I shift everything over to being placed on the misc_function_list, this will go away. * inferior.h, infrun.c: Added fields to save in inferior_status structure. * maketarfile: Deleted; functionality is in Makefile now. * infrun.c (wait_for_inferior): Modified algorithm for determining whether or not a single-step was through a subroutine call. See comments at top of file. * dbxread.c (read_dbx_symtab): Made sure that the IGNORE_SYMBOL macro would be checked during initial readin. * dbxread.c (read_ofile_symtab): Added macro GCC_COMPILED_FLAG_SYMBOL into dbxread.c to indicate what string in a local text symbol will indicate a file compiled with gcc. Defaults to "gcc_compiled.". Thu Dec 8 11:46:22 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) * m-sparc.h (FRAME_FIND_SAVED_REGS): Cleaned up a little to take advantage of the new frame cache system. * inferior.h, infrun.c, valops.c, valops.c, infcmd.c: Changed mechanism to save inferior status over calls to inferior (eg. call_function); implemented save_inferior_info and restore_inferior_info. * blockframe.c (get_prev_frame): Simplified this by a direct call to get_prev_frame_info. * frame.h, stack.c, printcmd.c, m-sparc.h, sparc-dep.c: Removed all uses of frame_id_from_addr. There are short routines like it still in frame_saved_pc (m-sparc.h) and parse_frame_spec (stack.c). Eventually the one in frame_saved_pc will go away. * infcmd.c, sparc-dep.c: Implemented a new mechanism for re-selecting the selected frame on return from a call. * blockframe.c, stack.c, findvar.c, printcmd.c, m-*.h: Changed all routines and macros that took a "struct frame_info" as an argument to take a "struct frame_info *". Routines: findarg, framechain, print_frame_args, FRAME_ARGS_ADDRESS, FRAME_STRUCT_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS, FRAME_NUM_ARGS, FRAME_FIND_SAVED_REGS. * frame.h, stack.c, printcmd.c, infcmd.c, findvar.c, breakpoint.c, blockframe.c, xgdb.c, i386-pinsn.c, gld-pinsn.c, m-umax.h, m-sun2.h, m-sun3.h, m-sparc.h, m-pn.h, m-npl.h, m-news.h, m-merlin.h, m-isi.h, m-i386.h, m-hp9k320.h: Changed routines to use "struct frame_info *" internally. Wed Dec 7 12:07:54 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) * frame.h, blockframe.c, m-sparc.h, sparc-dep.c: Changed all calls to get_[prev_]frame_cache_item to get_[prev_]frame_info. * blockframe.c: Elminated get_frame_cache_item and get_prev_frame_cache_item; functionality now taken care of by get_frame_info and get_prev_frame_info. * blockframe.c: Put allocation on an obstack and eliminated fancy reallocation routines, several variables, and various nasty things. * frame.h, stack.c, infrun.c, blockframe.c, sparc-dep.c: Changed type FRAME to be a typedef to "struct frame_info *". Had to also change routines that returned frame id's to return the pointer instead of the cache index. * infcmd.c (finish_command): Used proper method of getting from function symbol to start of function. Was treating a symbol as a value. * blockframe.c, breakpoint.c, findvar.c, infcmd.c, stack.c, xgdb.c, i386-pinsn.c, frame.h, m-hp9k320.h, m-i386.h, m-isi.h, m-merlin.h, m-news.h, m-npl.h, m-pn.h, m-sparc.h, m-sun2.h, m-sun3.h, m-umax.h: Changed get_frame_info and get_prev_frame_info to return pointers instead of structures. * blockframe.c (get_pc_function_start): Modified to go to misc function table instead of bombing if pc was in a block without a containing function. * coffread.c: Dup'd descriptor passed to read_coff_symtab and fdopen'd it so that there wouldn't be multiple closes on the same fd. Also put (fclose, stream) on the cleanup list. * printcmd.c, stack.c: Changed print_frame_args to take a frame_info struct as argument instead of the address of the args to the frame. * m-i386.h (STORE_STRUCT_RETURN): Decremented sp by sizeof object to store (an address) rather than 1. * dbxread.c (read_dbx_symtab): Set first_object_file_end in read_dbx_symtab (oops). * coffread.c (fill_in_vptr_fieldno): Rewrote TYPE_BASECLASS as necessary. Tue Dec 6 13:03:43 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) * coffread.c: Added fake support for partial_symtabs to allow compilation and execution without there use. * inflow.c: Added a couple of minor USG mods. * munch: Put in appropriate conditionals so that it would work on USG systems. * Makefile: Made regex.* handled same as obstack.*; made sure tar file included everything I wanted it to include (including malloc.c). * dbxread.c (end_psymtab): Create an entry in the partial_symtab_list for each subfile of the .o file just read in. This allows a "list expread.y:10" to work when we haven't read in expread.o's symbol stuff yet. * symtab.h, dbxread.c (psymtab_to_symtab): Recognize pst->ldsymlen == 0 as indicating a dummy psymtab, only in existence to cause the dependency list to be read in. * dbxread.c (sort_symtab_syms): Elminated reversal of symbols to make sure that register debug symbol decls always come before parameter symbols. After mod below, this is not needed. * symtab.c (lookup_block_symbol): Take parameter type symbols (LOC_ARG or LOC_REGPARM) after any other symbols which match. * dbxread.c (read_type): When defining a type in terms of some other type and the other type is supposed to have a pointer back to this specific kind of type (pointer, reference, or function), check to see if *that* type has been created yet. If it has, use it and fill in the appropriate slot with a pointer to it. Mon Dec 5 11:25:04 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) * symmisc.c: Eliminated existence of free_inclink_symtabs and init_free_inclink_symtabs; they aren't called from anywhere, and if they were they could disrupt gdb's data structure badly (elimination of struct type's which values that stick around past elimination of inclink symtabs). * dbxread.c (symbol_file_command): Fixed a return pathway out of the routine to do_cleanups before it left. * infcmd.c (set_environment_command), gdb.texinfo: Added capability to set environmental variable values to null. * gdb.texinfo: Modified doc on "break" without args slightly. Sun Dec 4 17:03:16 1988 Randall Smith (randy at gluteus.ai.mit.edu) * dbxread.c (symbol_file_command): Added check; if there weren't any debugging symbols in the file just read, the user is warned. * infcmd.c: Commented set_environment_command (a little). * createtags: Cleaned up and commented. * Makefile: Updated depen_memory and write_inferior_memory in that errno is checked after each ptrace and returned to the caller. Used in value_at to detect references to addresses which are out of bounds. Also core.c (xfer_core_file): return 1 if invalid address, 0 otherwise. * inflow.c, <machine>-infdep.c: removed all calls to ptrace from inflo, m-sun3.h: Cleaned up dealings with functions returning structu0 19:19:36 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) * symmisc.c: (read_symsegs) Accept only format number 2. Since the size of the type structure changed when C++ support was added, format 1 can no longer be used. * core.c, m-sunos4.h: (core_file_command) support for SunOS 4.0. Slight change in the core structure. #ifdef SUNOS4. New file m-sunos4.h. May want to change config.gdb also. Fri Jul 8 19:59:49 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) * breakpoint.c: (break_command_1) Allow `break if condition' rather than parsing `if' as a function name and returning an error. Thu Jul 7 22:22:47 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) * C++: valops.c, valprint.c, value.h, values.c: merged code to deal with C++ expressions. Wed Jul 6 03:28:18 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) * C++: dbxread.c: (read_dbx_symtab, condense_misc_bunches, add_file_command) Merged code to read symbol information from an incrementally linked file. symmisc.c: (init_free_inclink_symtabs, free_inclink_symtabs) Cleanup routines. Tue Jul 5 02:50:41 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) * C++: symtab.c, breakpoint.c, source.c: Merged code to deal with ambiguous line specifications. In C++ one can have overloaded function names, so that `list classname::overloadedfuncname' refers to several different lines, possibly sure currently configured machine dependent files come first in e at corn-chex.ai.mit.edu) * C++: symtab.c: replaced lookup_symtab_1 and lookup_symtab_2 with a modified lookup_symbol which checks for fields of the current implied argument `this'. printcmd.c, source.c, symtab.c, valops.c: Need to change callers once callers are installed. Wed Jun 29 01:26:56 1988 Peter TerMaat (pete at frosted-flakes.ai.mit.edu) * C++: eval.c, expprint.c, expread.y, expression.h, valarith.c, Merged code to deal with evaluation of user-defined operators, member functions, and virtual functions. binop_must_be_user_defined tests for user-defined binops, value_x_binop calls the appropriate operator function. Tue Jun 28 02:56:42 1988 Peter TerMaat (pete at frosted-flakes.ai.mit.edu) * C++: Makefile: changed the echo: expect 101 shift/reduce conflicts and 1 reduce/reduce conflict. Local Variables: mode: indented-text eval: (auto-fill-mode 1) left-margin: 8 fill-column: 74 version-control: never End: