summaryrefslogtreecommitdiff
path: root/debian/patches/04_xutils-dev-debian.diff
blob: f387c4f16cc0c900661ba7914a9ef6e563987bc8 (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
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
Index: xutils-dev/xorg-cf-files/bsdLib.rules
===================================================================
--- xutils-dev.orig/xorg-cf-files/bsdLib.rules
+++ xutils-dev/xorg-cf-files/bsdLib.rules
@@ -13,6 +13,12 @@
 #define UseElfFormat NO
 #endif
 
+#if NetBSDDistribution == NetBSDDebian
+# ifndef SharedOldX
+#  define SharedOldX NO
+# endif
+#endif /* Debian */
+
 #if !UseElfFormat
 /* a.out shared libs */
 #ifndef HasSharedLibraries
@@ -91,6 +97,34 @@
 
 #endif /* SharedDepLibraryTarget */
 
+/*
+ * SharedDepCplusplusLibraryTarget - generate rules to create a shared library.
+ */
+#ifndef SharedDepCplusplusLibraryTarget
+#define SharedDepCplusplusLibraryTarget(libname,rev,deplist,solist,down,up)	@@\
+AllTarget(Concat(lib,libname.so.rev))					@@\
+									@@\
+Concat(lib,libname.so.rev):  deplist					@@\
+	$(RM) $@~							@@\
+	@SONAME=`echo $@ | sed 's/\.[^\.]*$$//'`; set -x; \		@@\
+		(cd down; $(CXX) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
+		$(RM) $$SONAME; $(LN) $@ $$SONAME; \			@@\
+		LinkBuildSonameLibrary($$SONAME)			@@\
+	$(RM) $@							@@\
+	$(MV) $@~ $@							@@\
+	$(RM) Concat(lib,libname.so)					@@\
+	$(LN) $@ Concat(lib,libname.so)					@@\
+	LinkBuildLibrary($@)						@@\
+	LinkBuildLibrary(Concat(lib,libname.so))			@@\
+									@@\
+clean::									@@\
+	@SONAME=`echo Concat(lib,libname.so.rev) | sed 's/\.[^\.]*$$//'`; \ @@\
+	set -x; $(RM) $$SONAME						@@\
+	$(RM) Concat(lib,libname.so)					@@\
+	$(RM) Concat(lib,libname.so.rev)
+
+#endif /* SharedDepCplusplusLibraryTarget */
+
 #ifndef SharedDepModuleTarget
 #define SharedDepModuleTarget(name,deps,solist)				@@\
 AllTarget(name)								@@\
Index: xutils-dev/xorg-cf-files/gnu.cf
===================================================================
--- xutils-dev.orig/xorg-cf-files/gnu.cf
+++ xutils-dev/xorg-cf-files/gnu.cf
@@ -17,16 +17,231 @@
 #ifndef OSTeenyVersion
 #define OSTeenyVersion		DefaultOSTeenyVersion
 #endif
-XCOMM operating system:  OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)
 
-#define GNUSourceDefines      -D_POSIX_C_SOURCE=199309L \
-                              -D_POSIX_SOURCE -D_XOPEN_SOURCE \
-                              -D_BSD_SOURCE -D_SVID_SOURCE
+#ifndef HasGhostScript
+# define HasGhostScript YES
+#endif
+#ifndef BuildPDFdocs
+# define BuildPDFdocs NO
+#endif
+
+#ifndef GnuBinUtilsMajorVersion
+# define GnuBinUtilsMajorVersion	DefaultGnuBinUtilsMajorVersion
+#endif
 
-XCOMM XXXMB: What about _GNU_SOURCE, see Linux/UseInstalled?
+XCOMM operating system:  OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)
+XCOMM libc:	(GnuCLibMajorVersion./**/GnuCLibMinorVersion./**/GnuCLibTeenyVersion)
+XCOMM binutils:	(GnuBinUtilsMajorVersion)
 
-#define XawI18nDefines        -DHAS_WCHAR_H -DHAS_WCTYPE_H -DNO_WIDEC_H
+#define HasDevRandom		NO
+#define PollDevRandom		NO
 
+/* Path setup. */
+# ifndef NothingOutsideProjectRoot
+#  define NothingOutsideProjectRoot	NO
+# endif
+# if !defined(NothingOutsideProjectRoot) || !NothingOutsideProjectRoot
+#  define SystemManDirectory	/usr/share/man
+# endif
+
+/* Default GCC options. */
+# ifndef DefaultGcc2OptimizeOpt
+#  define DefaultGcc2OptimizeOpt	-O2
+# endif
+
+# define HasPam			YES
+
+# if !defined(NothingOutsideProjectRoot) || !NothingOutsideProjectRoot
+#  define XAppLoadDir		EtcX11Directory/app-defaults
+# define XFileSearchPathDefault	Concat4(EtcX11Directory/%L/%T/%N%C,%S:EtcX11Directory/%l/%T/%N%C,%S:EtcX11Directory/%T/%N%C,%S:EtcX11Directory/%L/%T/%N%S:EtcX11Directory/%l/%T/%N%S:EtcX11Directory/%T/%N%S):Concat4($(LIBDIR)/%L/%T/%N%C,%S:$(LIBDIR)/%l/%T/%N%C,%S:$(LIBDIR)/%T/%N%C,%S:$(LIBDIR)/%L/%T/%N%S:$(LIBDIR)/%l/%T/%N%S:$(LIBDIR)/%T/%N%S)
+/* the relative symlink created by this rule causes problems for us */
+# define InstallAppDefFiles	YES
+# ifdef InstallAppDefFiles
+#  if InstallAppDefFiles
+#   define InstallAppDefaultsLong(file,class)				@@\
+InstallNamedTarget(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class)
+#  else
+#   define InstallAppDefaultsLong(file,class)				@@\
+InstallNamedTargetNoClobber(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class)
+#  endif
+# endif /* InstallAppDefFiles */
+# endif /* !defined(NothingOutsideProjectRoot) || !NothingOutsideProjectRoot */
+
+# define SharedLibXdmGreet	NO
+# define LinkGLToUsrInclude	NO
+# define LinkGLToUsrLib		NO
+# define FSUseSyslog		YES
+
+# define DriverManSuffix       4x
+# define DriverManDir          $(MANSOURCEPATH)4
+
+# define MiscManSuffix         7x
+# define MiscManDir            $(MANSOURCEPATH)7
+
+# define ProjectManSuffix	x
+
+# define DebianMaintainer      YES
+
+# ifdef DebianMaintainer
+
+#  ifndef XorgCustomVersion
+#   define XorgCustomVersion		"Debian"
+#  endif
+#  ifndef BuilderEMailAddr
+#   define BuilderEMailAddr		"debian-x@lists.debian.org"
+#  endif
+
+#  define XFree86Devel			YES
+#  define InstallXinitConfig		YES
+#  define InstallXdmConfig		YES
+#  define InstallFSConfig		YES
+#  define DebuggableLibraries		YES
+#  define ForceNormalLib		YES
+#  define SharedLibFont			NO
+#  define SharedLibGlu			YES
+#  define NormalLibGlu			YES
+#  define BuildFontCache		YES
+
+#  define BuildAllSpecsDocs		NO
+#  ifndef BuildSpecsDocs
+#   define BuildSpecsDocs		YES
+#  endif
+#  define SpecsDocDirs			BDF CTEXT FSProtocol GL ICCCM ICE PM \
+					Render SM X11 XDMCP XIM XLFD XProtocol \
+					Xaw Xext Xi Xmu Xserver Xt Xv XvMC \
+					i18n rstart xfs xterm xtrans
+#  define XkbServerDefines		-DNOISY
+#  define BuildHtmlManPages		NO
+
+#  define DontPreprocessManPages	NO
+
+/* We have a local patch that defines PicLibraryTarget(), instead of upstream's
+ * method. */
+#  define StaticNeedsPicForShared	NO
+
+/* Some libraries changed compilation method from static to shared and they do not
+ * ship header files.
+ * Temporary revert the build to static until all the changes will be investigated
+ * properly
+ */
+#  define SharedLibXau                  YES
+#  define SharedLibXdmcp                YES
+#  define NormalOldX                    NO
+#  define DebugOldX                     NO
+#  define SharedOldX                    NO
+#  define SharedLibDmx                  YES
+#  define SharedLibGLw                  NO
+#  define SharedLibFont                 NO
+#  define SharedLibFontEnc              NO
+#  define SharedLibXfontcache           NO
+#  define BuildFreetypeDlModule         NO
+
+#  define KernelVersionInBanner		YES
+
+/* We don't want XRX. */
+#  define BuildPlugin			NO
+
+/* The TT/Meltho fonts are all under non-free licences, except for BitStream
+ * Vera, which is provided by an external package anyway. */
+#  define BuildTrueTypeFonts		NO
+#  define BuildBethMarduthoFonts	NO
+
+#  define MakeDllModules		YES
+
+/* All the following are fulfilled by Build-Depends. */
+#  define BuildRman			NO
+#  define RmanCmd			/usr/bin/rman
+#  define RmanOptions			/**/
+#  define HasTk				YES
+#  define TkLibDir			/usr/lib
+#  define TkIncDir			/usr/include
+#  define TkLibName			tk8.4
+#  define XF86SetupUsesStaticTk		NO
+#  define HasTcl			YES
+#  define TclLibDir			/usr/lib
+#  define TclIncDir			/usr/include
+#  define TclLibName			tcl8.4
+#  define XF86SetupUsesStaticTcl	NO
+#  define BuildExpatLibrary		NO
+#  define HasExpat			YES
+#  define ExpatIncDirStandard		YES
+#  define BuildFontconfigLibrary	NO
+#  define HasFontconfig			YES
+#  define UseFontconfig			YES
+#  define BuildRenderLibrary		NO
+#  define HasRenderLibrary		YES
+#  define BuildXcursorLibrary		NO
+#  define HasXcursorLibrary		YES
+/* Xlib needs to know the available version of Xcursor. */
+#  define SharedXcursorRev		1
+#  define BuildXftLibrary		NO
+#  define HasXftLibrary			YES
+#  define BuildFreetype2Library		NO
+#  define HasFreetype2			YES
+#  define FontLibSharedFreeType		NO
+#  define HasLatex			YES
+#  define HasGroffHtml			YES
+
+/*
+ * The XFree86 Debian package no longer builds the Xprt server, in favor
+ * of a separate xprint package.  We do still build the library,
+ * but only when we're not building servers only, so it gets built in the
+ * normal build, but not -dbg (as it requires libXt headers).
+ */
+#  define XprtServer			NO
+#  define BuildXprintLib		!BuildServersOnly
+
+#  ifdef UseInstalled
+#   define RenderLibraryDir		/usr
+#   define XftLibraryDir		/usr
+#   define XcursorLibraryDir		/usr
+#  else /* We have a special hack to find these. */
+#   define RenderLibraryDir		$(TOP)/../../imports
+#   define XftLibraryDir		$(TOP)/../../imports
+#   define XcursorLibraryDir		$(TOP)/../../imports
+#  endif
+
+/* Wraphelp.c magic is supplied via a custom patch. */
+#  define HasXdmAuth			YES
+
+#  define HasGlide2			NO
+#  define HasGlide3			NO
+
+/* Enable extended instruction set support. */
+#  ifdef i386Architecture
+#   define HasX86Support		YES
+#   define HasMMXSupport		YES
+#   define Has3DNowSupport		YES
+#   define HasSSESupport		YES
+#  endif /* i386Architecture */
+# endif /* DebianMaintainer */
+
+#ifndef BinUtilsMajorVersion
+# define BinUtilsMajorVersion	GnuBinUtilsMajorVersion
+#endif
+
+#ifndef GnuLocaleDefines
+# define GnuLocaleDefines	/**/
+#endif
+
+#ifndef  GnuAdditionalIncludes
+# define GnuAdditionalIncludes	/**/
+#endif
+
+#ifndef GnuGnuSourceDefines
+# ifdef UseInstalled
+#  define GnuGnuSourceDefines	/**/
+# else
+#  define GnuGnuSourceDefines	-D_GNU_SOURCE
+# endif
+#endif
+
+# define GnuSourceDefines	-D_POSIX_C_SOURCE=199309L \
+				-D_POSIX_SOURCE -D_XOPEN_SOURCE \
+				-D_BSD_SOURCE -D_SVID_SOURCE \
+				GnuAdditionalIncludes GnuGnuSourceDefines \
+				GnuLocaleDefines
+# define XawI18nDefines		-DHAS_WCHAR_H -DHAS_WCTYPE_H -DNO_WIDEC_H
 #define HasPosixThreads         YES
 #define ThreadedX               YES
 #define HasThreadSafeAPI        YES
@@ -36,35 +251,132 @@
 #ifndef HasLibCrypt
 #define HasLibCrypt             YES
 #endif
+/* netscape wraps select but not poll as of communicator 4.72 */
+# ifndef HasPoll
+#  define HasPoll		NO
+# endif
+
+#ifndef InstallXloadSetGID
+#define InstallXloadSetGID	NO
+#endif
+
+#ifndef BuildIPv6
+#define BuildIPv6		NO
+#endif
+
+#ifndef HasLinuxInput
+# define HasLinuxInput NO
+#endif
+
+#ifndef JoystickSupport
+# define JoystickSupport	NO
+#endif
+#ifndef HasLinuxJoystick
+# define HasLinuxJoystick	NO
+#endif
+
+#define LibtoolMinorVersions	YES
+
+#ifndef HasMTRRSupport
+# define HasMTRRSupport	NO
+#endif
+
+#ifndef XF86INT10_BUILD
+# define XF86INT10_BUILD	X86EMU_GENERIC
+#endif
+
+#ifndef BuildXF86DRI
+#  define BuildXF86DRI	NO
+#endif
+
+#ifndef HasAgpGart
+# define HasAgpGart	NO
+#endif
+
+#ifndef HasSSESupport
+#  if defined(i386Architecture)
+#    define HasSSESupport		YES
+#  endif
+#endif
+
+#ifndef HasMMXSupport
+#  if defined(i386Architecture)
+#    define HasMMXSupport		YES
+#  endif
+#endif
+
+#ifndef Has3DNowSupport
+#  if defined(i386Architecture)
+#    define Has3DNowSupport		YES
+#  endif
+#endif
 
 #ifndef BuildXF86RushExt
 # define BuildXF86RushExt	YES
 #endif
 
+#ifndef LinuxFBDevSupport
+# define LinuxFBDevSupport	NO
+#endif
+
+#define SourceDefines		GnuSourceDefines
+
 #define BuildLibPathVar		LD_LIBRARY_PATH
 #define GccUsesGas		YES
 #define UseGas			YES
 #define GnuCpp			YES
+#ifndef HasDlopen
 #define HasDlopen		YES
+#endif
+#define HasWeakSymbols		YES
 #ifndef HasShadowPasswd
 #  define HasShadowPasswd	YES
 #endif
 #define HasPutenv		YES
-
-XCOMM Not implemented and will always fail.
 #ifndef HasShm
-# define HasShm			YES
+#define HasShm			YES
+#endif
+
+#ifndef HasSecureRPC
+# define HasSecureRPC		YES
 #endif
 
 #define HasBSD44Sockets		YES
 #define HasSockets		YES
+#ifndef HasSnprintf
 #define HasSnprintf		YES
+#endif
 #define HasMkstemp		YES
+#ifndef HasGetresuid
+#define HasGetresuid		YES
+#endif
+#ifndef HasUsableFileMmap
 #define HasUsableFileMmap	YES
+#endif
 #ifndef HasNCurses
 #define HasNCurses		YES
 #endif
 
+#ifndef HasGroff
+#define HasGroff		YES
+#endif
+
+#ifndef HasZlib
+#define HasZlib			YES
+#endif
+
+#ifndef HasLibpng
+#define HasLibpng		YES
+#endif
+
+#ifndef HasExpat
+# define HasExpat		YES
+#endif
+
+#ifndef HasFreetype2
+# define HasFreetype2		YES
+#endif
+
 #define AvoidNullMakeCommand	YES
 #ifndef DebuggableLibraries
 #define DebuggableLibraries	NO
@@ -84,32 +396,64 @@
 #define UseStaticTermcapLib	NO
 #endif
 
+#ifndef HasCookieMaker
+#define HasCookieMaker		YES
+#define MkCookieCmd		mcookie
+#endif
+
+#ifndef BourneShell
+/*
+ * This will cause builds/installs to terminate on errors, as on other
+ * platforms.
+ */
+#define BourneShell		/bin/sh -e
+#endif
+
 #define MkdirHierCmd		mkdir -p
+
+#ifndef DoLoadableServer
+# define DoLoadableServer	YES
+#endif
+
+
 #ifndef CcCmd
 #define CcCmd			gcc
+#   define CplusplusCmd		c++
 #endif
 #ifndef AsCmd
-#define AsCmd			as
+#   define AsCmd		CcCmd -c -x assembler
 #endif
+#  define AsmDefines		-D__ELF__
 #ifndef LdCmd
-#define LdCmd			ld
+#   define LdCmd		CcCmd -nostdlib
+#  endif
+#  ifndef GnuUsesNcurses
+#    define GnuUsesNcurses	YES
 #endif
-
-#define AsmDefines		-D__ELF__
-#define CplusplusCmd		c++
 #ifndef TermcapLibrary
 #if UseStaticTermcapLib
+#    if GnuUsesNcurses
 #define TermcapLibrary		StaticLibrary(/usr/lib,ncurses)
 #else
+#     define TermcapLibrary	StaticLibrary(/usr/lib/termcap,termcap)
+#    endif
+#   else
+#    if GnuUsesNcurses
 #define TermcapLibrary		-lncurses
+#    else
+#     define TermcapLibrary	-ltermcap
 #endif
 #endif
-#ifndef DoLoadableServer
-#define DoLoadableServer	YES
 #endif
+
+/*
+ * Some older distros still need /lib/cpp.  There's probably a better
+ * test, but this handles the older Red Hat releases at least.
+ */
 #ifndef CppCmd
-#define CppCmd			/lib/cpp
+# define CppCmd		cpp
 #endif
+
 #define YaccCmd			bison -y
 #define LexCmd			flex -l
 #define HasFlex			YES
@@ -125,50 +469,68 @@
 #define StandardCppDefines	StandardDefines
 
 #define HasVarRun		YES
+#ifndef VarDbDirectory
 #define VarDbDirectory		$(VARDIR)/lib
+#endif
+
+#ifndef OSXInputDrivers
+# define OSXInputDrivers1	/**/
+# define OSXInputDrivers2	/**/
+# define OSXInputDrivers	OSXInputDrivers1 OSXInputDrivers2
+#endif
 
-XCOMM i386Architecture
-#define OptimizedCDebugFlags	DefaultGcc2i386Opt
-#define GNUMachineDefines	-D__i386__
+#define HasPlugin			YES
+#define VendorHasX11R6_3libXext	YES	/* XC or XFree86 >= 3.3.1 */
+
+#ifdef i386Architecture
+# ifndef OptimizedCDebugFlags
+#  define OptimizedCDebugFlags	DefaultGcc2DebugOpt DefaultGcc2OptimizeOpt GccAliasingArgs
+# endif
+# define GnuMachineDefines	-D__i386__
 #define ServerOSDefines		XFree86ServerOSDefines -DDDXTIME
 #define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines
-#define HasPlugin		YES
-#define VendorHasX11R6_3libXext	YES
+#endif /* i386Architecture */
 
 #ifndef StandardDefines
-#define StandardDefines		GNUMachineDefines GNUSourceDefines
+# define StandardDefines	-DGnu GnuMachineDefines GnuSourceDefines
 #endif
 
+#ifndef DlLibrary
 #define DlLibrary		-rdynamic -ldl
+#endif
 
 #define ServerExtraSysLibs	/**/
 
-#define ConnectionFlags		-DUNIXCONN -DTCPCONN
-
-/* Some of these man page defaults are overriden in the above OS sections */
-#ifndef ManSuffix
-# define ManSuffix	1x
+#ifndef PamLibraries
+#define PamLibraries		-lpam DlLibrary
 #endif
-#ifndef ManDir
-# define ManDir		$(MANSOURCEPATH)1
-#endif
-#ifndef LibManSuffix
-# define LibManSuffix	3x
-#endif
-#ifndef LibmanDir
-# define LibmanDir	$(MANSOURCEPATH)3
+
+#ifndef PamMiscLibraries
+#define PamMiscLibraries	-lpam_misc
 #endif
-#ifndef FileManSuffix
-# define FileManSuffix	5x
+
+#ifndef HasDECnet
+#define HasDECnet		NO
 #endif
-#ifndef FileManDir
-# define FileManDir	$(MANSOURCEPATH)5
+#if HasDECnet
+# define ConnectionFlags	-DUNIXCONN -DTCPCONN -DDNETCONN
+# define ExtraLibraries		-ldnet
+#else
+#define ConnectionFlags		-DUNIXCONN -DTCPCONN
 #endif
 
 #ifndef StaticLibrary
 #define StaticLibrary(libpath,libname) -Wl,-Bstatic Concat(-L,libpath) Concat(-l,libname) -Wl,-Bdynamic
 #endif
 
+#ifndef LinkGLToUsrLib
+# define LinkGLToUsrLib		YES
+#endif
+# ifndef LinkGLToUsrInclude
+# define LinkGLToUsrInclude	YES
+#endif
+
+
 #define HasGnuMake	YES
 
 #define MakeNamedTargetSubdir(dir,flags,subname)\
@@ -176,12 +538,16 @@
 
 #define ArchitectureDefines	-DGNU_ARCHITECTURE
 
-#define XserverNeedsSetUID	YES
+#define TtClientLibs $(TTLIB) $(XTOOLLIB) $(XLIB)
+#define TtClientDepLibs $(DEPTTLIB) $(DEPXTOOLLIB) $(DEPXLIB)
 
-#include <gnuLib.rules>
-
-XCOMM XXX Might need this if they are not careful with slashes.
-XCOMM #define DirFailPrefix -
+#ifndef BuildDmx
+#define BuildDmx	YES
+#endif
 
+#include <gnuLib.rules>
 #include <xorg.cf>
 
+#ifndef XFree86ServerOSDefines
+# define XFree86ServerOSDefines
+#endif
Index: xutils-dev/xorg-cf-files/gnuLib.rules
===================================================================
--- xutils-dev.orig/xorg-cf-files/gnuLib.rules
+++ xutils-dev/xorg-cf-files/gnuLib.rules
@@ -17,7 +17,6 @@
 #define ForceNormalLib NO
 #endif
 
-XCOMM XXX To rpath or not to rpath...
 #ifndef UseRpath
 #define UseRpath NO
 #endif
@@ -26,10 +25,13 @@
 #define SharedOldX NO
 #endif
 
-#undef SpecialMalloc
+#ifndef SpecialMalloc
 #define SpecialMalloc NO
+#endif
 
+# ifndef BaseShLibReqs
 #define BaseShLibReqs   -lc
+# endif
 
 #ifndef SharedDataSeparation
 #define SharedDataSeparation NO
@@ -45,7 +47,7 @@
 #endif
 #ifndef RpathLoadFlags
 #if UseRpath
-#define RpathLoadFlags -Wl,-rpath=$(USRLIBDIRPATH)
+#define RpathLoadFlags -Wl,-rpath,$(USRLIBDIRPATH)
 #else
 #define RpathLoadFlags /**/
 #endif
@@ -54,7 +56,7 @@
 #define LibraryRpathLoadFlags RpathLoadFlags
 #endif
 #ifndef SharedLibraryLoadFlags
-#define SharedLibraryLoadFlags -shared LibraryRpathLoadFlags
+#  define SharedLibraryLoadFlags -shared
 #endif
 #ifndef PositionIndependentCFlags
 #define PositionIndependentCFlags -fPIC
@@ -63,12 +65,13 @@
 #define PositionIndependentCplusplusFlags -fPIC
 #endif
 #ifndef ExtraLoadFlags
-#ifdef UseInstalled
-XCOMM XXX Maybe superfluous.
-#define ExtraLoadFlags RpathLoadFlags -Wl,-rpath-link=$(USRLIBDIRPATH)
-#else
-#define ExtraLoadFlags RpathLoadFlags -Wl,-rpath-link=$(BUILDLIBDIR)
+#  define ExtraLoadFlags RpathLoadFlags
+# endif
+# ifndef HardCodeLibdirFlag
+#  define HardCodeLibdirFlag RpathLoadFlags
 #endif
+# if !defined(ShlibGlobalsFlags)
+#  define ShlibGlobalsFlags -Wl,-Bsymbolic
 #endif
 
 /*
@@ -87,6 +90,26 @@
 	  $(LN) Concat(lib,libname.so.rev) Concat($(DESTDIR)dest/lib,libname.so)); fi
 #endif /* InstallSharedLibrary */
 
+# ifndef InstallSharedLibtoolLibrary
+
+#  define SetRevisions(rev) V=`expr rev : '\([^:]*\)'`; \		@@\
+		R=`expr rev : '.*:\([^:]*\):'`; \			@@\
+		A=`expr rev : '.*:\([^:]*\)'`; \			@@\
+		MAJ=`expr $$V - $$A`; \					@@\
+		MIN=$$A.$$R
+
+#  define	InstallSharedLibtoolLibrary(libname,rev,dest)		@@\
+install:: Concat(lib,libname.so) 					@@\
+	MakeDir($(DESTDIR)dest)						@@\
+	@set +e; SetRevisions(rev); \					@@\
+		set -xe; \						@@\
+		$(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) Concat(lib,libname.so.$$MAJ.$$MIN) $(DESTDIR)dest; \ @@\
+		$(RM) Concat($(DESTDIR)dest/lib,libname.so.$$MAJ); \	@@\
+		$(LN) Concat(lib,libname.so.$$MAJ.$$MIN) Concat($(DESTDIR)dest/lib,libname.so.$$MAJ); \ @@\
+		$(RM) Concat($(DESTDIR)dest/lib,libname.so); \		@@\
+		$(LN) Concat(lib,libname.so.$$MAJ.$$MIN) Concat($(DESTDIR)dest/lib,libname.so)
+# endif /* InstallSharedLibrary */
+
 /*
  * InstallSharedLibraryData - generate rules to install the shared library data
  */
@@ -106,9 +129,9 @@
 									@@\
 Concat(lib,libname.so.rev):  solist $(EXTRALIBRARYDEPS)			@@\
 	$(RM) $@~							@@\
-	@SONAME=`echo $@ | sed 's/\(lib[^\.]*\.so\.[0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; set -x; \		@@\
-		(cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
-		$(RM) $$SONAME; $(LN) $@ $$SONAME; \			@@\
+	@SONAME=`echo $@ | sed 's/\(lib[^\.]*\.so\.[0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; (set -x; \	@@\
+		cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs) || exit 1; \ @@\
+		(set -x; $(RM) $$SONAME; $(LN) $@ $$SONAME); \		@@\
 		LinkBuildSonameLibrary($$SONAME)			@@\
 	$(RM) $@							@@\
 	$(MV) $@~ $@							@@\
@@ -125,6 +148,38 @@
 
 #endif /* SharedLibraryTarget */
 
+
+# ifndef SharedLibtoolLibraryTarget
+#  define SharedLibtoolLibraryTarget(libname,rev,solist,down,up)	@@\
+AllTarget(Concat(lib,libname.so))					@@\
+									@@\
+Concat(lib,libname.so):  solist $(EXTRALIBRARYDEPS)			@@\
+	$(RM) $@~							@@\
+	@set +e; SetRevisions(rev); set -e; \				@@\
+		SONAME=$@.$$MAJ; \					@@\
+		(set -x; \						@@\
+		$(RM) $@.$$MAJ.$$MIN~; \				@@\
+		cd down; $(CC) -o up/$@.$$MAJ.$$MIN~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs) || exit 1; \ @@\
+		(set -x; \						@@\
+		$(RM) $$SONAME; $(LN) $@.$$MAJ.$$MIN $$SONAME); \	@@\
+		LinkBuildSonameLibrary($$SONAME); \			@@\
+		(set -x; \						@@\
+		$(RM) $@.$$MAJ.$$MIN; \					@@\
+		$(MV) $@.$$MAJ.$$MIN~ $@.$$MAJ.$$MIN; \			@@\
+	  	$(RM) $@; \						@@\
+	  	$(LN) $@.$$MAJ.$$MIN $@); \				@@\
+		LinkBuildLibraryInline($@.$$MAJ.$$MIN); \		@@\
+		LinkBuildLibraryInline($@)				@@\
+									@@\
+clean::									@@\
+	@set +e; SetRevisions(rev); \					@@\
+		set -xe; \						@@\
+		$(RM) Concat(lib,libname.so.$$MAJ); \			@@\
+		$(RM) Concat(lib,libname.so.$$MAJ.$$MIN)		@@\
+	$(RM) Concat(lib,libname.so)
+
+# endif /* SharedLibtoolLibraryTarget */
+
 /*
  * SharedDepLibraryTarget - generate rules to create a shared library.
  */
@@ -153,6 +208,34 @@
 
 #endif /* SharedDepLibraryTarget */
 
+/*
+ * SharedDepCplusplusLibraryTarget - generate rules to create a shared library.
+ */
+#ifndef SharedDepCplusplusLibraryTarget
+#define SharedDepCplusplusLibraryTarget(libname,rev,deplist,solist,down,up) @@\
+AllTarget(Concat(lib,libname.so.rev))					@@\
+									@@\
+Concat(lib,libname.so.rev):  deplist $(EXTRALIBRARYDEPS)		@@\
+	$(RM) $@~							@@\
+	@SONAME=`echo $@ | sed 's/\(lib[^\.]*\.so\.[0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; set -x; \		@@\
+		(cd down; $(CXX) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
+		$(RM) $$SONAME; $(LN) $@ $$SONAME; \			@@\
+		LinkBuildSonameLibrary($$SONAME)			@@\
+	$(RM) $@ 							@@\
+	$(MV) $@~ $@							@@\
+	@if $(SOSYMLINK); then (set -x; \				@@\
+	  $(RM) Concat(lib,libname.so); \				@@\
+	  $(LN) $@ Concat(lib,libname.so)); fi				@@\
+	LinkBuildLibrary($@)						@@\
+	LinkBuildLibraryMaybe(Concat(lib,libname.so),$(SOSYMLINK))	@@\
+									@@\
+clean::									@@\
+	@MAJREV=`echo rev | sed 's/\([0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; \	@@\
+	set -x; $(RM) Concat(lib,libname.so.$$MAJREV)			@@\
+	$(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
+
+#endif /* SharedDepCplusplusLibraryTarget */
+
 #ifndef SharedDepModuleTarget
 #define SharedDepModuleTarget(name,deps,solist)				@@\
 AllTarget(name)								@@\
@@ -168,6 +251,23 @@
 
 #endif /* SharedDepModuleTarget */
 
+# ifndef SharedDriModuleTarget
+#  define SharedDriModuleTarget(name,deps,solist)			@@\
+AllTarget(name)								@@\
+									@@\
+name: deps								@@\
+	$(RM) $@~ $@.map						@@\
+	@(echo 'DRI_MODULE { global: __dri*; local: *; };' > $@.map)	@@\
+	$(CC) -o $@~ -Wl,--version-script=$@.map $(SHLIBLDFLAGS) solist $(REQUIREDLIBS) BaseShLibReqs @@\
+	$(RM) $@ $@.map							@@\
+	$(MV) $@~ $@							@@\
+									@@\
+clean::									@@\
+	$(RM) name							@@\
+	$(RM) name.map
+
+# endif /* SharedDriModuleTarget */
+
 /*
  * SharedLibraryDataTarget - generate rules to create shlib data file;
  */
Index: xutils-dev/xorg-cf-files/gnuLib.tmpl
===================================================================
--- xutils-dev.orig/xorg-cf-files/gnuLib.tmpl
+++ xutils-dev/xorg-cf-files/gnuLib.tmpl
@@ -1,8 +1,9 @@
-XCOMM
-XCOMM  GNU Hurd shared library template
-XCOMM
-XCOMM $XFree86: xc/config/cf/gnuLib.tmpl,v 1.5 2003/05/29 21:56:57 herrb Exp $
-XCOMM
+XCOMM $Xorg: lnxLib.tmpl,v 1.3 2000/08/17 19:41:47 cpqbld Exp $
+XCOMM $XFree86: xc/config/cf/lnxLib.tmpl,v 3.19 2003/10/15 22:47:48 herrb Exp $
+
+/*
+ * GNU/Hurd shared library template
+ */
 
 #ifndef FixupLibReferences
 #define FixupLibReferences()						@@\
@@ -14,15 +15,71 @@
 #define XawClientLibs $(XAWLIB) $(XMULIBONLY) $(XTOOLLIB) $(XPMLIB) $(EXTRAXAWCLIENTLIBS) $(XLIB)
 #endif
 
-#define SharedX11Reqs
+#if ThreadedX
+# ifndef SharedThreadReqs
+#   define SharedThreadReqs -lpthread
+# endif
+#else
+# ifndef SharedThreadReqs
+#   define SharedThreadReqs
+# endif
+#endif
+
+#define SharedX11Reqs	  SharedThreadReqs
 #define SharedXlibi18nReqs $(LDPRELIB) $(XONLYLIB)
 #define SharedOldXReqs	$(LDPRELIB) $(XONLYLIB)
-#define SharedXtReqs	$(LDPRELIB) $(XONLYLIB) $(SMLIB) $(ICELIB)
+#define SharedXtReqs	  $(LDPRELIB) $(XONLYLIB) $(SMLIB) $(ICELIB) SharedThreadReqs
 #define SharedXaw6Reqs	$(LDPRELIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
 #define SharedXaw7Reqs	$(LDPRELIB) $(XMULIB) $(XTOOLLIB) $(XPMLIB) $(XLIB)
 #define SharedXawReqs	$(LDPRELIB) $(XMULIB) $(XTOOLLIB) $(XPMLIB) $(EXTRAXAWREQS) $(XLIB)
 #define SharedXmuReqs	$(LDPRELIB) $(XTOOLLIB) $(XLIB)
+#define SharedXmuuReqs	  $(LDPRELIB) $(XONLYLIB)
 #define SharedXextReqs	$(LDPRELIB) $(XONLYLIB)
 #define SharedXiReqs	$(LDPRELIB) $(XLIB)
+#define SharedXpReqs	  $(LDPRELIB) $(XLIB)
+#define SharedXpmReqs	  $(LDPRELIB) $(XLIB)
+#define SharedXrandrReqs  $(LDPRELIB) $(XRENDERLIB) $(XLIB)
+#define SharedXrenderReqs $(LDPRELIB) $(XLIB)
 #define SharedXtstReqs	$(LDPRELIB) $(XLIB)
+#define SharedXvReqs	  $(LDPRELIB) $(XLIB)
 #define SharedSMReqs	$(LDPRELIB) $(ICELIB)
+#define SharedXcursorReqs $(LDPRELIB) $(XRENDERLIB) $(XLIB)
+#define SharedFontencReqs $(LDPRELIB) GzipLibrary
+
+#if GlxUseBuiltInDRIDriver
+#define ExtraSharedGLReqs /**/
+#else
+#define ExtraSharedGLReqs -ldl
+#endif
+#define SharedGLReqs	  $(LDPRELIB) $(XLIB) ExtraSharedGLReqs
+#ifndef SharedGLUReqs
+#define SharedGLUReqs	  $(LDPRELIB) $(XLIB) $(GLXLIB)
+#endif
+#define SharedDPSReqs	  $(LDPRELIB) $(SMLIB) $(ICELIB) $(XTOOLLIB) $(XLIB)
+#define SharedDPSTKReqs	  $(LDPRELIB) $(SMLIB) $(ICELIB) $(XTOOLLIB) $(DPSLIB) $(XLIB)
+#define SharedpsresReqs	  $(LDPRELIB) $(SMLIB) $(ICELIB) $(XTOOLLIB) $(XLIB)
+
+#define SharedXResReqs	  $(LDPRELIB) $(XLIB)
+#define SharedXfontcacheReqs	$(LDPRELIB) $(XLIB)
+#define SharedXineramaReqs	$(LDPRELIB) $(XLIB)
+#define SharedXssReqs	$(LDPRELIB) $(XLIB)
+#define SharedXvMCReqs	$(LDPRELIB) $(XLIB)
+#define SharedXxf86dgaReqs	$(LDPRELIB) $(XLIB)
+#define SharedXxf86miscReqs	$(LDPRELIB) $(XLIB)
+#define SharedXxf86vmReqs	$(LDPRELIB) $(XLIB)
+#define SharedxkbfileReqs	$(LDPRELIB) $(XONLYLIB)
+#define SharedxkbuiReqs $(LDPRELIB) $(XKBFILELIB) $(XONLYLIB)
+
+#ifndef SharedXReqs
+# define SharedXReqs $(XTOOLLIB) $(XPLIB) $(XLIB) $(LDPOSTLIBS) SharedThreadReqs
+#endif
+
+#ifndef SharedXmReqs
+# define SharedXmReqs $(LDPRELIBS) SharedXReqs -lc
+#endif
+
+#ifndef SharedTtReqs
+# define SharedTtReqs $(LDPRELIBS) SharedXReqs $(CXXLIB) SharedThreadReqs
+#endif
+
+#define NoMessageCatalog
Index: xutils-dev/xorg-cf-files/Imake.rules
===================================================================
--- xutils-dev.orig/xorg-cf-files/Imake.rules
+++ xutils-dev/xorg-cf-files/Imake.rules
@@ -2722,6 +2722,20 @@
 
 
 /*
+ * Rule to build libXXX_pic.a from PIC objects for a library
+ */
+#ifndef PicLibraryTarget
+#define	PicLibraryTarget(libname,objlist)				@@\
+AllTarget(LibraryTargetNameSuffix(libname,_pic))			@@\
+									@@\
+LibraryTargetNameSuffix(libname,_pic): objlist $(EXTRALIBRARYDEPS)	@@\
+	RemoveFile($@)							@@\
+	MakeLibrary($@,objlist)						@@\
+	RanLibrary($@)							@@\
+	_LinkBuildLibrary($@)
+#endif /* PicLibraryTarget */
+
+/*
  * SubdirLibraryRule -
  */
 #ifndef SubdirLibraryRule
Index: xutils-dev/xorg-cf-files/Imake.tmpl
===================================================================
--- xutils-dev.orig/xorg-cf-files/Imake.tmpl
+++ xutils-dev/xorg-cf-files/Imake.tmpl
@@ -902,37 +902,82 @@
 #define ManSourcePath $(MANPATH)/man
 #endif
 #ifndef ManDir
-#define ManDir $(MANSOURCEPATH)$(MANSUFFIX)
+#define ManDir $(MANSOURCEPATH)$(MANSECT)
 #endif
-#ifndef LibmanDir
-#define LibmanDir $(MANSOURCEPATH)$(LIBMANSUFFIX)
+#ifndef ManSuffix
+#define ManSuffix $(MANSECT)$(PROJECTMANSUFFIX)
+#endif
+#ifndef SyscallManDir
+#define SyscallManDir $(MANSOURCEPATH)$(SYSCALLMANSECT)
+#endif
+#ifndef SyscallManSuffix
+#define SyscallManSuffix $(SYSCALLMANSECT)$(PROJECTMANSUFFIX)
+#endif
+#ifndef LibManDir
+#define LibManDir $(MANSOURCEPATH)$(LIBMANSECT)
+#endif
+#ifndef LibManSuffix
+#define LibManSuffix $(LIBMANSECT)$(PROJECTMANSUFFIX)
+#endif
+#ifndef DriverManDir
+#define DriverManDir $(MANSOURCEPATH)$(DRIVERMANSECT)
+#endif
+#ifndef DriverManSuffix
+#define DriverManSuffix $(DRIVERMANSECT)$(PROJECTMANSUFFIX)
 #endif
 #ifndef FileManDir
-#define FileManDir $(MANSOURCEPATH)$(FILEMANSUFFIX)
+#define FileManDir $(MANSOURCEPATH)$(FILEMANSECT)
+#endif
+#ifndef FileManSuffix
+#define FileManSuffix $(FILEMANSECT)$(PROJECTMANSUFFIX)
+#endif
+#ifndef GameManDir
+#define GameManDir $(MANSOURCEPATH)$(GAMEMANSECT)
+#endif
+#ifndef GameManSuffix
+#define GameManSuffix $(GAMEMANSECT)$(PROJECTMANSUFFIX)
 #endif
 #ifndef MiscManDir
-#define MiscManDir $(MANSOURCEPATH)$(MISCMANSUFFIX)
+#define MiscManDir $(MANSOURCEPATH)$(MISCMANSECT)
 #endif
-#ifndef DriverManDir
-#define DriverManDir $(MANSOURCEPATH)$(DRIVERMANSUFFIX)
+#ifndef MiscManSuffix
+#define MiscManSuffix $(MISCMANSECT)$(PROJECTMANSUFFIX)
 #endif
-#ifndef AppLoadDefs
-#define AppLoadDefs -D__apploaddir__=$(XAPPLOADDIR)
+#ifndef AdmManDir
+#define AdmManDir $(MANSOURCEPATH)$(ADMMANSECT)
+#endif
+#ifndef AdmManSuffix
+#define AdmManSuffix $(ADMMANSECT)$(PROJECTMANSUFFIX)
 #endif
 #ifndef AppManDefs
-#define AppManDefs -D__appmansuffix__=$(MANSUFFIX)
+#define AppManDefs -D__appmansuffix__=$(MANSECT)$(PROJECTMANSUFFIX)
+#endif
+#ifndef ManDefs
+#define ManDefs -D__mansuffix__=$(MANSECT)$(PROJECTMANSUFFIX) -D__osmansuffix__=$(MANSECT)
+#endif
+#ifndef SyscallManDefs
+#define SyscallManDefs -D__syscallmansuffix__=$(SYSCALLMANSECT)$(PROJECTMANSUFFIX) -D__ossysmansuffix__=$(SYSCALLMANSECT)
 #endif
 #ifndef LibManDefs
-#define LibManDefs -D__libmansuffix__=$(LIBMANSUFFIX)
+#define LibManDefs -D__libmansuffix__=$(LIBMANSECT)$(PROJECTMANSUFFIX) -D__oslibmansuffix__=$(LIBMANSECT)
+#endif
+#ifndef DriverManDefs
+#define DriverManDefs -D__drivermansuffix__=$(DRIVERMANSECT)$(PROJECTMANSUFFIX) -D__osdrivermansuffix__=$(DRIVERMANSECT)
 #endif
 #ifndef FileManDefs
-#define FileManDefs -D__filemansuffix__=$(FILEMANSUFFIX)
+#define FileManDefs -D__filemansuffix__=$(FILEMANSECT)$(PROJECTMANSUFFIX) -D__osfilemansuffix__=$(FILEMANSECT)
+#endif
+#ifndef GameManDefs
+#define GameManDefs -D__gamemansuffix__=$(GAMEMANSECT)$(PROJECTMANSUFFIX) -D__osgamemansuffix__=$(GAMEMANSECT)
 #endif
 #ifndef MiscManDefs
-#define MiscManDefs -D__miscmansuffix__=$(MISCMANSUFFIX)
+#define MiscManDefs -D__miscmansuffix__=$(MISCMANSECT)$(PROJECTMANSUFFIX) -D__osmiscmansuffix__=$(MISCMANSECT)
 #endif
-#ifndef DriverManDefs
-#define DriverManDefs -D__drivermansuffix__=$(DRIVERMANSUFFIX)
+#ifndef AdmManDefs
+#define AdmManDefs -D__admmansuffix__=$(ADMMANSECT)$(PROJECTMANSUFFIX) -D__osadmmansuffix__=$(ADMMANSECT)
+#endif
+#ifndef AppLoadDefs
+#define AppLoadDefs -D__apploaddir__=$(XAPPLOADDIR)
 #endif
 #ifndef AdminManDefs
 #define AdminManDefs -D__adminmansuffix__=$(ADMINMANSUFFIX)
@@ -963,6 +1008,21 @@
 #endif
 #endif
 
+#ifndef IconDir
+# if !NothingOutsideProjectRoot
+#  define IconDir       "/usr/share/icons"
+#  ifndef XcursorPath
+#   define XcursorPath  "~/.icons:/usr/share/icons:/usr/share/pixmaps"
+#  endif
+# else
+#  define IconDir       Concat(ProjectRoot,/lib/X11/icons)
+# endif
+#endif
+
+#ifndef XcursorPath
+# define XcursorPath    Concat(~/.icons:/usr/share/icons:/usr/share/pixmaps:,IconDir)
+#endif
+
 #ifndef LogDirectory
 #if HasVarDirectory
 #define LogDirectory $(VARDIR)/log
@@ -1609,32 +1669,50 @@
 #ifndef SHsuf
 #define SHsuf sh
 #endif
-#ifndef ManSuffix
-#define ManSuffix	n		/* use just one tab or cpp will die */
+#ifndef ManSection
+#define ManSection	1		/* use just one tab or cpp will die */
 #endif
-#ifndef LibManSuffix
-#define LibManSuffix	3		/* use just one tab or cpp will die */
+#ifndef SyscallManSection
+#define SyscallManSection	2	/* use just one tab or cpp will die */
 #endif
-#ifndef FileManSuffix
+#ifndef LibManSection
+#define LibManSection	3		/* use just one tab or cpp will die */
+#endif
+#ifndef DriverManSection
 #if SystemV || SystemV4 || defined(OSF1Architecture)
-#define FileManSuffix	4		/* use just one tab or cpp will die */
+#define DriverManSection	7	/* use just one tab or cpp will die */
 #else
-#define FileManSuffix	5		/* use just one tab or cpp will die */
+#define DriverManSection	4	/* use just one tab or cpp will die */
 #endif
 #endif
-#ifndef MiscManSuffix
+#ifndef FileManSection
 #if SystemV || SystemV4 || defined(OSF1Architecture)
-#define MiscManSuffix	5		/* use just one tab or cpp will die */
+#define FileManSection	4		/* use just one tab or cpp will die */
 #else
-#define MiscManSuffix	7		/* use just one tab or cpp will die */
+#define FileManSection	5		/* use just one tab or cpp will die */
 #endif
 #endif
-#ifndef DriverManSuffix
+#ifndef GameManSection
+#define GameManSection	6		/* use just one tab or cpp will die */
+#endif
+#ifndef MiscManSection
 #if SystemV || SystemV4 || defined(OSF1Architecture)
-#define DriverManSuffix	7		/* use just one tab or cpp will die */
+#define MiscManSection	5		/* use just one tab or cpp will die */
 #else
-#define DriverManSuffix	4		/* use just one tab or cpp will die */
+#define MiscManSection	7		/* use just one tab or cpp will die */
+#endif
+#endif
+#ifndef AdmManSection
+#define AdmManSection	8		/* use just one tab or cpp will die */
 #endif
+#ifndef ManSrcSection
+#define ManSrcSection	s		/* use just one tab or cpp will die */
+#endif
+#ifndef ManNewSection
+#define ManNewSection	n		/* use just one tab or cpp will die */
+#endif
+#ifndef ProjectManSuffix
+#define ProjectManSuffix	X11	/* use just one tab or cpp will die */
 #endif
 #ifndef AdminManSuffix
 #if SystemV || SystemV4
@@ -1763,9 +1841,15 @@
           MANPATH = ManPath		/* top of manual page tree */
     MANSOURCEPATH = ManSourcePath	/* prefix for man page sources */
            MANDIR = ManDir		/* man pages for commands */
-        LIBMANDIR = LibmanDir		/* man pages for library routines */
+    SYSCALLMANDIR = SyscallManDir   	/* man pages for system calls */
+        LIBMANDIR = LibManDir		/* man pages for library routines */
+     DRIVERMANDIR = DriverManDir	/* man pages for drivers */
        FILEMANDIR = FileManDir		/* man pages for config files */
+       GAMEMANDIR = GameManDir		/* man pages for game commands */
        MISCMANDIR = MiscManDir		/* man pages for miscellaneous files */
+        ADMMANDIR = AdmManDir		/* man pages for administrative commands */
+	  ICONDIR = IconDir		/* Xcursor cursors/icon directory */
+      XCURSORPATH = XcursorPath		/* Xcursor cursors path */
      DRIVERMANDIR = DriverManDir	/* man pages for drivers */
      LOGDIRECTORY = LogDirectory	/* OS location of log files */
 #ifdef VarRunDirectory
@@ -1872,15 +1956,30 @@
              PERL = PerlCmd
          PERLOPTS = PerlOptions
      PERLENVSETUP = PerlEnvSetup
+
+          MANSECT = ManSection		/* section for command man pages */
+   SYSCALLMANSECT = SyscallManSection	/* section for system call man pages */
+       LIBMANSECT = LibManSection	/* section for library man pages */
+    DRIVERMANSECT = DriverManSection	/* section for driver man pages */
+      FILEMANSECT = FileManSection	/* section for file format man pages */
+      GAMEMANSECT = GameManSection	/* section for game command man pages */
+      MISCMANSECT = MiscManSection	/* section for misc man pages */
+       ADMMANSECT = AdmManSection	/* section for administrative command man pages */
+       MANSRCSECT = ManSrcSection	/* section for man page source */
+       MANNEWSECT = ManNewSection	/* section for preprocessed man source */
+ PROJECTMANSUFFIX = ProjectManSuffix	/* man page suffix for the X11 distribution */
         MANSUFFIX = ManSuffix		/* suffix for command man pages */
+ SYSCALLMANSUFFIX = SyscallManSuffix	/* suffix for system call man pages */
      LIBMANSUFFIX = LibManSuffix	/* suffix for library man pages */
+  DRIVERMANSUFFIX = DriverManSuffix	/* suffix for driver man pages */
     FILEMANSUFFIX = FileManSuffix	/* suffix for file format man pages */
+    GAMEMANSUFFIX = GameManSuffix	/* suffix for game command man pages */
     MISCMANSUFFIX = MiscManSuffix	/* suffix for misc man pages */
-  DRIVERMANSUFFIX = DriverManSuffix	/* suffix for driver man pages */
+     ADMMANSUFFIX = AdmManSuffix	/* suffix for administrative command man pages */
    ADMINMANSUFFIX = AdminManSuffix	/* suffix for admin command man pages */
      MANSRCSUFFIX = ManSrcSuffix	/* suffix for man page source */
      MANNEWSUFFIX = ManNewSuffix	/* suffix for preprocessed man source */
-          MANDEFS = AppLoadDefs AppManDefs FileManDefs LibManDefs MiscManDefs DriverManDefs AdminManDefs ProjectManDefs XConfigFileManDefs XConfigDirManDefs XLogFileManDefs XServerManDefs $(XORGMANDEFS) $(VENDORMANDEFS)
+          MANDEFS = AppLoadDefs FileManDefs LibManDefs ManDefs SyscallManDefs GameManDefs MiscManDefs AdmManDefs MiscManDefs DriverManDefs AdminManDefs ProjectManDefs XConfigFileManDefs XConfigDirManDefs XLogFileManDefs XServerManDefs AppManDefs $(XORGMANDEFS) $(VENDORMANDEFS)
 
    COMPRESSMANCMD = CompressManCmd
 
Index: xutils-dev/xorg-cf-files/Library.tmpl
===================================================================
--- xutils-dev.orig/xorg-cf-files/Library.tmpl
+++ xutils-dev/xorg-cf-files/Library.tmpl
@@ -37,6 +37,14 @@
 #define DoExtraLib NO
 #endif
 
+#ifndef DoPicLib
+# if DoNormalLib && !DoSharedLib && !StaticNeedsPicForShared
+#  define DoPicLib YES
+# else
+#  define DoPicLib NO
+# endif
+#endif
+
 #ifndef HasSharedData
 #define HasSharedData NO
 #endif
@@ -53,7 +61,7 @@
 #endif
 
 #ifndef LibraryCplusplusOptions
-# if DoSharedLib && defined(SharedLibraryCplusplusOptions)
+# if (DoSharedLib || DoPicLib) && defined(SharedLibraryCplusplusOptions)
 #  define LibraryCplusplusOptions SharedLibraryCplusplusOptions
 # else
 #  define LibraryCplusplusOptions DefaultCplusplusOptions
@@ -85,14 +93,14 @@
 
 #ifndef CplusplusSource
 # ifndef LibraryCcCmd
-#  if DoSharedLib && defined(SharedLibraryCcCmd)
+#  if (DoSharedLib || DoPicLib) && defined(SharedLibraryCcCmd)
 #   define LibraryCcCmd SharedLibraryCcCmd
 #  else
 #   define LibraryCcCmd CcCmd
 #  endif
 # endif
 # ifndef LibraryCCOptions
-#  if DoSharedLib && defined(SharedLibraryCCOptions)
+#  if (DoSharedLib || DoPicLib) && defined(SharedLibraryCCOptions)
 #   define LibraryCCOptions SharedLibraryCCOptions
 #  else
 #   define LibraryCCOptions DefaultCCOptions
@@ -121,7 +129,7 @@
 #else
 # ifndef CrossCompileDir
 #  ifndef LibraryCplusplusCmd
-#   if DoSharedLib && defined(SharedLibraryCplusplusCmd)
+#   if (DoSharedLib || DoPicLib) && defined(SharedLibraryCplusplusCmd)
 #    define LibraryCplusplusCmd SharedLibraryCplusplusCmd
 #   else
 #    define LibraryCplusplusCmd CplusplusCmd
@@ -129,7 +137,7 @@
 #  endif
 # else
 #  ifndef CrossLibraryCplusplusCmd
-#   if DoSharedLib && defined(SharedLibraryCplusplusCmd)
+#   if (DoSharedLib || DoPicLib) && defined(SharedLibraryCplusplusCmd)
 #    define CrossLibraryCplusplusCmd Concat3(CrossCompileDir,/,StripPath(SharedLibraryCplusplusCmd))
 #   else
 #    define CrossLibraryCplusplusCmd Concat3(CrossCompileDir,/,StripPath(CplusplusCmd))
@@ -138,7 +146,7 @@
 # endif
 
 # ifndef LibraryCplusplusOptions
-#  if DoSharedLib && defined(SharedLibraryCplusplusOptions)
+#  if (DoSharedLib || DoPicLib) && defined(SharedLibraryCplusplusOptions)
 #   define LibraryCplusplusOptions SharedLibraryCplusplusOptions
 #  else
 #   define LibraryCplusplusOptions DefaultCplusplusOptions
@@ -204,14 +212,14 @@
 # define _NormalObjCplusplusCompile(options) $(_NULLCMD_)
 # define _NormalCleanDir() $(_NULLCMD_)
 #else
-# if DoSharedLib && SeparateSharedCompile
+# if (DoSharedLib || DoPicLib) && SeparateSharedCompile
 #  define _NormalLibMkdir() _LibMkdir(unshared)
 #  define _NormalObjCompile(options) UnsharedLibObjCompile(options)
 #  define _NormalObjCplusplusCompile(options) UnsharedLibObjCplusplusCompile(options)
 #  define _NormalCleanDir() LibCleanDir(unshared)
 # else
 #  define _NormalLibMkdir() $(_NULLCMD_)
-#  if !DoSharedLib &&  defined(IncludeSharedObjectInNormalLib)
+#  if (!DoSharedLib && !DoPicLib) &&  defined(IncludeSharedObjectInNormalLib)
 #   define _NormalObjCompile(options) NormalRelocLibObjCompile(options)
 #  else
 #   define _NormalObjCompile(options) NormalLibObjCompile(options)
@@ -221,7 +229,7 @@
 # endif
 #endif
 
-#if !DoSharedLib || (DoNormalLib && !SeparateSharedCompile)
+#if !DoSharedLib && !DoPicLib || (DoNormalLib && !SeparateSharedCompile)
 # define _SharedObjCompile(options) $(_NULLCMD_)
 # define _SharedObjCplusplusCompile(options) $(_NULLCMD_)
 #else
@@ -517,6 +525,12 @@
 InstallLibrary($(LIBNAME)_d,$(USRLIBDIR))
 #   endif
 #  endif
+#  if DoPicLib
+PicLibraryTarget($(LIBNAME),$(OBJS))
+#   if !defined(LibInstall) || LibInstall
+InstallLibrary($(LIBNAME)_pic,$(USRLIBDIR))
+#   endif
+#  endif
 #  if DoExtraLib && defined(ExtraLibRules)
 ExtraLibraryTarget($(LIBNAME),$(SoRev),$(OBJS) $(EXTRAUNSHAREDOBJS))
 #   if !defined(LibInstall) || LibInstall
Index: xutils-dev/xorg-cf-files/linux.cf
===================================================================
--- xutils-dev.orig/xorg-cf-files/linux.cf
+++ xutils-dev/xorg-cf-files/linux.cf
@@ -107,31 +107,48 @@
 XCOMM libc:	(LinuxCLibMajorVersion./**/LinuxCLibMinorVersion./**/LinuxCLibTeenyVersion)
 XCOMM binutils:	(LinuxBinUtilsMajorVersion)
 
+/* Linux >= 2.0 supports /dev/random, which is poll()able */
+#if OSMajorVersion >= 2
+# define HasDevRandom		YES
+# define PollDevRandom		YES
+#endif
+
 #if LinuxDistribution == LinuxDebian
+
+/* Path setup. */
+# ifndef NothingOutsideProjectRoot
+#  define NothingOutsideProjectRoot	NO
+# endif
 # if !defined(NothingOutsideProjectRoot) || !NothingOutsideProjectRoot
 #  define SystemManDirectory	/usr/share/man
 # endif
+
+/* Default GCC options. */
+# ifndef DefaultGcc2OptimizeOpt
+#  define DefaultGcc2OptimizeOpt	-O2
+# endif
+
 # define HasPam			YES
-/* un-comment this when it is un-broken */
-/* # define JoystickSupport YES */
+
 # if !defined(NothingOutsideProjectRoot) || !NothingOutsideProjectRoot
 #  define XAppLoadDir		EtcX11Directory/app-defaults
 # define XFileSearchPathDefault	Concat4(EtcX11Directory/%L/%T/%N%C,%S:EtcX11Directory/%l/%T/%N%C,%S:EtcX11Directory/%T/%N%C,%S:EtcX11Directory/%L/%T/%N%S:EtcX11Directory/%l/%T/%N%S:EtcX11Directory/%T/%N%S):Concat4($(LIBDIR)/%L/%T/%N%C,%S:$(LIBDIR)/%l/%T/%N%C,%S:$(LIBDIR)/%T/%N%C,%S:$(LIBDIR)/%L/%T/%N%S:$(LIBDIR)/%l/%T/%N%S:$(LIBDIR)/%T/%N%S)
 /* the relative symlink created by this rule causes problems for us */
-# if defined(InstallAppDefFiles) && InstallAppDefFiles
-#  define InstallAppDefaultsLong(file,class)				@@\
+# define InstallAppDefFiles	YES
+# ifdef InstallAppDefFiles
+#  if InstallAppDefFiles
+#   define InstallAppDefaultsLong(file,class)				@@\
 InstallNamedTarget(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class)
-# else
-#  define InstallAppDefaultsLong(file,class)				@@\
+#  else
+#   define InstallAppDefaultsLong(file,class)				@@\
 InstallNamedTargetNoClobber(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class)
+#  endif
 # endif /* InstallAppDefFiles */
 # endif /* !defined(NothingOutsideProjectRoot) || !NothingOutsideProjectRoot */
+
 # define SharedLibXdmGreet	NO
 # define LinkGLToUsrInclude	NO
 # define LinkGLToUsrLib		NO
-# define SharedLibFont		NO
-# define SharedLibGlu		YES
-# define NormalLibGlu		YES
 # define FSUseSyslog		YES
 
 # define BuildLibGlxWithoutPIC  NO
@@ -142,15 +159,12 @@
 # define MiscManSuffix         7x
 # define MiscManDir            $(MANSOURCEPATH)7
 
-/*
- *
- *
+# define ProjectManSuffix	x
+
 # define DebianMaintainer	YES
- *
- *
- */
 
 # ifdef DebianMaintainer
+
 #  ifndef XorgCustomVersion
 #   define XorgCustomVersion		"Debian"
 #  endif
@@ -158,47 +172,138 @@
 #   define BuilderEMailAddr		"debian-x@lists.debian.org"
 #  endif
 #  define XFree86Devel			YES
-#  define BuildAllSpecsDocs		YES
 #  define InstallXinitConfig		YES
 #  define InstallXdmConfig		YES
 #  define InstallFSConfig		YES
 #  define DebuggableLibraries		YES
 #  define ForceNormalLib		YES
-#  define BuildSpecsDocs		YES
-#  define SpecsDocDirs			CTEXT GL ICCCM X11 Xext Xv i18n xterm
-#  define BuildRman			NO
+#  define SharedLibFont			NO
+#  define SharedLibGlu			YES
+#  define NormalLibGlu			YES
+#  define BuildFontCache		YES
+
+#  define BuildAllSpecsDocs		NO
+#  ifndef BuildSpecsDocs
+#   define BuildSpecsDocs		YES
+#  endif
+#  define SpecsDocDirs			BDF CTEXT FSProtocol GL ICCCM ICE PM \
+				Render SM X11 XDMCP XIM XLFD XProtocol \
+				Xaw Xext Xi Xmu Xserver Xt Xv XvMC \
+				i18n rstart xfs xterm xtrans
+#  define XkbServerDefines		-DNOISY
 #  define BuildHtmlManPages		NO
+#  define DontPreprocessManPages	NO
 
-/* we build-depend on libfreetype6-dev (FreeType 2.x) */
-#   define BuildFreetype2Library	NO
-#   define HasFreetype2			YES
-/* m68k has no 2.4 kernel yet */
-#   ifndef Mc68020Architecture
-#    define HasLinuxInput		YES
-#   endif
-#   define HasXdmAuth			YES
-#   define HasLatex			YES
-/* at present, glide2 only works on i386 */
-#   if defined(__linux__) && defined(i386Architecture)
-#    define HasGlide2			YES
-#    define Glide2IncDir		/usr/include/glide
-#   endif /* __linux__ && i386Architecture */
-/* at present, glide3 only works on alpha, amd64, i386 and ia64 */
-#   if defined(__linux__) && (defined(i386Architecture) || \
-       defined(AlphaArchitecture) || defined(ia64Architecture) || \
-       defined(AMD64Architecture))
-#    define HasGlide3			YES
-#    define Glide3IncDir		/usr/include/glide3
-#   endif /* __linux__ && (i386Architecture || AlphaArchitecture || \
-             ia64Architecture || AMD64Architecture) */
-/* extended instruction set support */
-#   ifdef i386Architecture
+/* We have a local patch that defines PicLibraryTarget(), instead of
+ * upstream's method. */
+#  define StaticNeedsPicForShared	NO
+
+/* Some libraries changed compilation method from static to shared and they do not
+ * ship header files.
+ * Temporary revert the build to static until all the changes will be investigated
+ * properly
+ */
+#  define SharedLibXau			YES
+#  define SharedLibXdmcp		YES
+#  define NormalOldX			NO
+#  define DebugOldX			NO
+#  define SharedOldX			NO
+#  define SharedLibDmx			YES
+#  define SharedLibGLw			NO
+#  define SharedLibFont			NO
+#  define SharedLibFontEnc		NO
+#  define SharedLibXfontcache		NO
+#  define BuildFreetypeDlModule		NO
+
+#  define KernelVersionInBanner		YES
+
+/* We don't want XRX. */
+#  define BuildPlugin		NO
+
+/* The TT/Meltho fonts are all under non-free licences, except for BitStream
+ * Vera, which is provided by an external package anyway. */
+#  define BuildTrueTypeFonts		NO
+#  define BuildBethMarduthoFonts	NO
+
+#  define MakeDllModules		YES
+
+/* All the following are fulfilled by Build-Depends. */
+#  define BuildRman			NO
+#  define RmanCmd			/usr/bin/rman
+#  define RmanOptions			/**/
+#  define HasTk				YES
+#  define TkLibDir			/usr/lib
+#  define TkIncDir			/usr/include
+#  define TkLibName			tk8.4
+#  define XF86SetupUsesStaticTk		NO
+#  define HasTcl			YES
+#  define TclLibDir			/usr/lib
+#  define TclIncDir			/usr/include
+#  define TclLibName			tcl8.4
+#  define XF86SetupUsesStaticTcl	NO
+#  define BuildExpatLibrary		NO
+#  define HasExpat			YES
+#  define ExpatIncDirStandard		YES
+#  define BuildFontconfigLibrary	NO
+#  define HasFontconfig			YES
+#  define UseFontconfig			YES
+#  define BuildRenderLibrary		NO
+#  define HasRenderLibrary		YES
+#  define BuildXcursorLibrary		NO
+#  define HasXcursorLibrary		YES
+/* Xlib needs to know the available version of Xcursor. */
+#  define SharedXcursorRev		1
+#  define BuildXftLibrary		NO
+#  define HasXftLibrary			YES
+#  define BuildFreetype2Library		NO
+#  define HasFreetype2			YES
+#  define FontLibSharedFreeType		NO
+#  define HasLatex			YES
+
+/*
+ * The XFree86 Debian package no longer builds the Xprt server, in favor
+ * of a separate xprint package.  We do still build the library,
+ * but only when we're not building servers only, so it gets built in the
+ * normal build, but not -dbg (as it requires libXt headers).
+ */
+#  define XprtServer			NO
+#  define BuildXprintLib		!BuildServersOnly
+
+#  ifdef UseInstalled
+#   define RenderLibraryDir		/usr
+#   define XftLibraryDir		/usr
+#   define XcursorLibraryDir		/usr
+#  else /* We have a special hack to find these. */
+#   define RenderLibraryDir		$(TOP)/../../imports
+#   define XftLibraryDir		$(TOP)/../../imports
+#   define XcursorLibraryDir		$(TOP)/../../imports
+#  endif
+
+/* Wraphelp.c magic is supplied via a custom patch. */
+#  define HasXdmAuth			YES
+
+#  ifdef LinuxArchitecture
+/* Glide2 only works on i386. */
+#  ifdef i386Architecture
+#   define HasGlide2			YES
+#   define Glide2IncDir		/usr/include/glide
+#  endif /* i386Architecture */
+/* Glide3 only works on alpha, amd64, i386 and ia64. */
+#  if defined(i386Architecture) || defined(AlphaArchitecture) || \
+      defined(ia64Architecture) || defined(AMD64Architecture)
+#   define HasGlide3			YES
+#   define Glide3IncDir		/usr/include/glide3
+#  endif /* i386Architecture || AlphaArchitecture || ia64Architecture ||
+            AMD64Architecture */
+#  endif /* LinuxArchitecture */
+
+/* Enable extended instruction set support. */
+#  ifdef i386Architecture
 #   define HasX86Support		YES
-#    define HasMMXSupport		YES
-#    define Has3DNowSupport		YES
-/* 2.4 is not yet the official (or predominant) kernel in unstable */
-#    define HasSSESupport		NO
-#   endif /* i386Architecture */
+#   define HasMMXSupport       YES
+#   define Has3DNowSupport     YES
+#   define HasSSESupport       YES
+#  endif /* i386Architecture */
 # endif /* DebianMaintainer */
 #endif /* LinuxDebian */
 
@@ -591,7 +696,7 @@
 #define MkdirHierCmd		mkdir -p
 
 #ifndef HaveLib64
-# if defined (AMD64Architecture) || defined (s390xArchitecture) || defined (Ppc64Architecture)
+# if defined (s390xArchitecture)
 #  define HaveLib64	YES
 # else
 #  define HaveLib64	NO
@@ -725,10 +830,10 @@
 # if UseElfFormat
 #  ifdef AlphaArchitecture
 #   define CcCmd		gcc -b alpha-linux
+#   define CplusplusCmd		c++ -b alpha-linux
 #   define AsCmd		CcCmd -c -x assembler
 #   define LdCmd		CcCmd -nostdlib -Wl,"-m elf64alpha"
 #   define AsmDefines		-D__ELF__
-#   define CplusplusCmd		c++ -b alpha-linux
 #  endif /* AlphaArchitecture */
 #  ifdef HPArchitecture
 #   define CcCmd		gcc
@@ -740,10 +845,10 @@
 #  endif /* HPArchitecture */
 #  ifdef i386Architecture
 #   define CcCmd		gcc -b i486-linux
+#   define CplusplusCmd		c++ -b i486-linux
 #   define AsCmd		CcCmd -c -x assembler
 #   define LdCmd		CcCmd -nosdlib -Wl,"-m elf_i386"
 #   define AsmDefines		-D__ELF__
-#   define CplusplusCmd		c++ -b i486-linux
 #  endif /* i386Architecture */
 #  ifdef ia64Architecture
 #   define CcCmd		gcc
@@ -754,10 +859,10 @@
 #  endif /* ia64Architecture */
 #  ifdef Mc68020Architecture
 #   define CcCmd		gcc -b m68k-linux
+#   define CplusplusCmd		c++ -b m68k-linux
 #   define AsCmd		CcCmd -c -x assembler
 #   define LdCmd		CcCmd -nostdlib -W,l"-m m68kelf"
 #   define AsmDefines		-D__ELF__
-#   define CplusplusCmd		c++ -b m68k-linux
 #  endif /* Mc68020Architecture */
 #  ifdef AMD64Architecture
 #   define CcCmd                 gcc
@@ -770,7 +875,7 @@
 #  define CcCmd			gcc
 #  define AsCmd			CcCmd -c -x assembler
 #  define LdCmd			CcCmd -nostdlib
-#  define AsmDefines		-DUSE_GAS
+#  define AsmDefines		-DUSE_GAS -D__ELF__
 # endif
 #endif
 
@@ -837,7 +942,7 @@
 
 #ifdef AlphaArchitecture
 # ifndef OptimizedCDebugFlags
-#  define OptimizedCDebugFlags	DefaultGcc2AxpOpt
+#  define OptimizedCDebugFlags	DefaultGcc2DebugOpt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 # define LinuxMachineDefines	-D__alpha__
 # define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
@@ -850,7 +955,7 @@
 #ifdef Arm32Architecture
 # define DefaultCCOptions
 # ifndef OptimizedCDebugFlags
-#  define OptimizedCDebugFlags	-O3
+#  define OptimizedCDebugFlags	DefaultGcc2DebugOpt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 # define LinuxMachineDefines	-D__arm__ -D__arm32__ -U__arm -Uarm
 # define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
@@ -858,7 +963,9 @@
 #endif /* Arm32Achitecture */
 
 #ifdef HPArchitecture
-# define OptimizedCDebugFlags	-O2  GccAliasingArgs
+# ifndef OptimizedCDebugFlags
+#  define OptimizedCDebugFlags	DefaultGcc2DebugOpt DefaultGcc2OptimizeOpt GccAliasingArgs
+# endif
 # define LinuxMachineDefines	-D__hppa__
 # define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
 # define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines
@@ -866,7 +973,7 @@
 
 #ifdef i386Architecture
 # ifndef OptimizedCDebugFlags
-#  define OptimizedCDebugFlags	DefaultGcc2i386Opt
+#  define OptimizedCDebugFlags	DefaultGcc2DebugOpt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 # define LinuxMachineDefines	-D__i386__
 # define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
@@ -875,7 +982,7 @@
 
 #ifdef ia64Architecture
 # ifndef OptimizedCDebugFlags
-#  define OptimizedCDebugFlags	-O2  GccAliasingArgs
+#  define OptimizedCDebugFlags	DefaultGcc2DebugOpt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 # define LinuxMachineDefines	-D__ia64__
 # define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
@@ -884,7 +991,7 @@
 
 #ifdef Mc68020Architecture
 # ifndef OptimizedCDebugFlags
-#  define OptimizedCDebugFlags	-O2  GccAliasingArgs
+#  define OptimizedCDebugFlags	DefaultGcc2DebugOpt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 # define LinuxMachineDefines	-D__mc68000__
 # define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
@@ -903,7 +1010,7 @@
 #ifdef Ppc64Architecture
 # define DefaultCCOptions	-mminimal-toc
 # ifndef OptimizedCDebugFlags
-#  define OptimizedCDebugFlags	DefaultGcc2Ppc64Opt
+#  define OptimizedCDebugFlags	DefaultGcc2Ppc64Opt GccAliasingArgs
 # endif
 # define LinuxMachineDefines	-D__powerpc64__ -D__powerpc__
 # define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME -DPART_NET
@@ -913,7 +1020,7 @@
 #ifdef PpcArchitecture
 # define DefaultCCOptions	
 # ifndef OptimizedCDebugFlags
-#  define OptimizedCDebugFlags	DefaultGcc2PpcOpt
+#  define OptimizedCDebugFlags DefaultGcc2DebugOpt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 # define LinuxMachineDefines	-D__powerpc__
 # define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
@@ -922,7 +1029,7 @@
 
 #ifdef s390Architecture
 # ifndef OptimizedCDebugFlags
-#  define OptimizedCDebugFlags	-O2 -fomit-frame-pointer GccAliasingArgs
+#  define OptimizedCDebugFlags DefaultGcc2DebugOpt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 # define LinuxMachineDefines	-D__s390__
 # define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
@@ -930,16 +1037,17 @@
 #endif /* s390Architecture */
 
 #ifdef s390xArchitecture
-/*#define DefaultCCOptions	-fsigned-char */
-#define OptimizedCDebugFlags	-O3 -fomit-frame-pointer
+# ifndef OptimizedCDebugFlags
+#  define OptimizedCDebugFlags DefaultGcc2DebugOpt DefaultGcc2OptimizeOpt GccAliasingArgs
+# endif
 #define LinuxMachineDefines	-D__s390x__
-#define ServerOSDefines		XFree86ServerOSDefines -DDDXTIME
+#define ServerOSDefines		XFree86ServerOSDefines -DDDXTIME -DPART_NET
 #define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
 #endif /* s390xArchitecture */
 
 #ifdef SparcArchitecture
 # ifndef OptimizedCDebugFlags
-#  define OptimizedCDebugFlags	-O2  GccAliasingArgs
+#  define OptimizedCDebugFlags	DefaultGcc2DebugOpt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 # define LinuxMachineDefines	-D__sparc__
 # define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
@@ -970,7 +1078,7 @@
 #  endif
 # endif
 # ifndef OptimizedCDebugFlags
-#  define OptimizedCDebugFlags	-O2 SuperHArchOptFlags SuperHEndianFlags  GccAliasingArgs
+#  define OptimizedCDebugFlags	DefaultGcc2DebugOpt DefaultGcc2OptimizeOpt SuperHArchOptFlags SuperHEndianFlags GccAliasingArgs
 # endif
 # define LinuxMachineDefines	-D__sh__
 # define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
@@ -982,7 +1090,7 @@
 
 #ifdef AMD64Architecture
 # ifndef OptimizedCDebugFlags
-#  define OptimizedCDebugFlags	DefaultGcc2AMD64Opt
+#  define OptimizedCDebugFlags	DefaultGcc2DebugOpt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 # define LinuxMachineDefines   -D__amd64__
 # define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
@@ -1023,26 +1131,6 @@
 # define ConnectionFlags	-DUNIXCONN -DTCPCONN
 #endif
 
-/* Some of these man page defaults are overriden in the above OS sections */
-#ifndef ManSuffix
-# define ManSuffix	1x
-#endif
-#ifndef ManDir
-# define ManDir		$(MANSOURCEPATH)1
-#endif
-#ifndef LibManSuffix
-# define LibManSuffix	3x
-#endif
-#ifndef LibmanDir
-# define LibmanDir	$(MANSOURCEPATH)3
-#endif
-#ifndef FileManSuffix
-# define FileManSuffix	5x
-#endif
-#ifndef FileManDir
-# define FileManDir	$(MANSOURCEPATH)5
-#endif
-
 #ifndef StaticLibrary
 # define StaticLibrary(libpath,libname) -Wl,-Bstatic Concat(-L,libpath) Concat(-l,libname) -Wl,-Bdynamic
 #endif
@@ -1087,3 +1175,59 @@
 #ifndef XFree86ServerOSDefines
 # define XFree86ServerOSDefines
 #endif
+
+/*
+ *     SELinux support
+ */
+#if defined(__linux__)
+# ifndef HasSELinux
+#  define HasSELinux YES
+# endif
+#endif
+
+#ifndef SELinuxDefines
+# if HasSELinux
+#  define SELinuxDefines -DHAVE_SELINUX
+# else
+#  define SELinuxDefines /**/
+# endif
+#endif
+
+#ifndef SELinuxIncludeFlags
+# if HasSELinux
+#   define SELinuxIncludeFlags -I/usr/include/selinux
+# else
+#   define SELinuxIncludeFlags /**/
+# endif
+#endif
+
+#ifndef SELinuxCompileFlags
+# define SELinuxCompileFlags /**/
+#endif
+
+#ifndef SELinuxLoadFlags
+# define SELinuxLoadFlags SELinuxCompileFlags
+#endif
+
+#ifndef SELinuxLibraries
+# if HasSELinux
+#  define SELinuxLibraries -lselinux
+# else
+#  define SELinuxLibraries /**/
+# endif
+#endif
+
+#if HasSELinux
+# ifndef SELINUX_LDFLAGS
+   SELINUX_LDFLAGS = SELinuxLoadFlags
+# endif
+# ifndef SELINUX_INCLUDES
+   SELINUX_INCLUDES = SELinuxIncludeFlags
+# endif
+# ifndef SELINUX_CFLAGS
+   SELINUX_CFLAGS = SELinuxCompileFlags SELinuxDefines
+# endif
+# ifndef SELINUX_LIBS
+   SELINUX_LIBS = SELinuxLibraries
+# endif
+#endif
Index: xutils-dev/xorg-cf-files/NetBSD.cf
===================================================================
--- xutils-dev.orig/xorg-cf-files/NetBSD.cf
+++ xutils-dev/xorg-cf-files/NetBSD.cf
@@ -18,12 +18,178 @@
 #define OSTeenyVersion		DefaultOSTeenyVersion
 #endif
 
+#ifndef NetBSDDistribution
+#define NetBSDDistribution	DefaultNetBSDDistribution
+/*
+  Add "#define NetBSDDistribution NetBSD<mumble>" to your site.def or host.def.
+  Currently only NetBSDDebian will be autodetected.
+  Valid values are:
+    NetBSDUnknown    (0)
+    NetBSDNative     (1)
+    NetBSDDebian     (2)
+*/
+#endif
+
+#ifndef NetBSDDistName
+# define NetBSDDistName		DefaultNetBSDDistName
+#endif
 
 #ifndef OSVendor
-#define	OSVendor		The NetBSD Foundation, Inc.
+#define OSVendor		The NetBSD Foundation, Inc.
 #endif
+
+#ifndef NetBSDBinUtilsMajorVersion
+# define NetBSDBinUtilsMajorVersion	DefaultNetBSDBinUtilsMajorVersion
+#endif
+
 XCOMM operating system:  OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)
 
+/* Defines for Debian GNU/NetBSD */
+
+#if NetBSDDistribution == NetBSDDebian
+# ifndef DefaultGcc2OptimizeOpt
+#  define DefaultGcc2OptimizeOpt	-O2
+# endif
+# define DefaultGcc2AxpOpt	DefaultGcc2OptimizeOpt GccAliasingArgs
+# define DefaultGcc2i386Opt	DefaultGcc2OptimizeOpt GccAliasingArgs
+# define DefaultGcc2PpcOpt	DefaultGcc2OptimizeOpt GccAliasingArgs
+# define SystemManDirectory	/usr/share/man
+# define HasPam			YES
+# define HasTk			YES
+# define TkLibDir		/usr/lib
+# define TkIncDir		/usr/include
+# define TkLibName		tk8.4
+# define XF86SetupUsesStaticTk	NO
+# define HasTcl			YES
+# define TclLibDir		/usr/lib
+# define TclIncDir		/usr/include
+# define TclLibName		tcl8.4
+# define XF86SetupUsesStaticTcl	NO
+/* un-comment this when it is un-broken */
+/* # define JoystickSupport YES */
+# define XAppLoadDir		EtcX11Directory/app-defaults
+# define XFileSearchPathDefault	Concat4(EtcX11Directory/%L/%T/%N%C,%S:EtcX11Directory/%l/%T/%N%C,%S:EtcX11Directory/%T/%N%C,%S:EtcX11Directory/%L/%T/%N%S:EtcX11Directory/%l/%T/%N%S:EtcX11Directory/%T/%N%S):Concat4($(LIBDIR)/%L/%T/%N%C,%S:$(LIBDIR)/%l/%T/%N%C,%S:$(LIBDIR)/%T/%N%C,%S:$(LIBDIR)/%L/%T/%N%S:$(LIBDIR)/%l/%T/%N%S:$(LIBDIR)/%T/%N%S)
+# define InstallAppDefFiles	YES
+/* the relative symlink created by this rule causes problems for us */
+# ifdef InstallAppDefFiles
+#  if InstallAppDefFiles
+#   define InstallAppDefaultsLong(file,class)				@@\
+InstallNamedTarget(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class)
+#  else
+#   define InstallAppDefaultsLong(file,class)				@@\
+InstallNamedTargetNoClobber(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class)
+#  endif
+# endif /* InstallAppDefFiles */
+# define SharedLibXdmGreet	NO
+# define LinkGLToUsrInclude	NO
+# define LinkGLToUsrLib		NO
+# define SharedLibFont		NO
+# define HasZlib		YES
+# define SharedLibGlu		YES
+# define NormalLibGlu		YES
+# define FSUseSyslog		YES
+
+# define DebianMaintainer	YES
+
+# ifdef DebianMaintainer
+#  ifndef XFree86CustomVersion
+#    define XFree86CustomVersion	"Debian"
+#  endif
+#  ifndef BuilderEMailAddr
+#    define BuilderEMailAddr		"debian-x@lists.debian.org"
+#  endif
+#  define XFree86Devel			YES
+#  define InstallXinitConfig		YES
+#  define InstallXdmConfig		YES
+#  define InstallFSConfig		YES
+#  define DebuggableLibraries		YES
+#  define ForceNormalLib		YES
+#  define BuildRman			NO
+#  define BuildHtmlManPages		NO
+/*
+ * Debian doesn't use certain parts of the tree when doing
+ * architecture-specific package builds.
+ */
+#  ifndef BuildFonts
+#   define BuildFonts			YES
+#  endif
+#  ifndef BuildSpecsDocs
+#   define BuildSpecsDocs		YES
+#  endif
+#  if BuildSpecsDocs
+#   define BuildAllSpecsDocs		YES
+#  endif
+/*
+ * The XFree86 Debian package uses a local patch that defines a
+ * PicLibraryTarget() Imake rule, instead of using upstream's method.
+ */
+#  define StaticNeedsPicForShared	NO
+#  define KernelVersionInBanner		YES
+#  define ProjectManSuffix		x
+/* The TT/Meltho fonts are all under non-free licenses. */
+#  define BuildTrueTypeFonts		NO
+#  define BuildBethMarduthoFonts	NO
+/*
+ * The XFree86 Debian package build-depends on external Expat, Fontconfig,
+ * Freetype, Render, Xcursor, and Xft libraries.
+ */
+#  define BuildExpatLibrary		NO
+#  define HasExpat			YES
+#  define ExpatIncDirStandard		YES
+#  define BuildFontconfigLibrary	NO
+#  define HasFontconfig			YES
+#  define UseFontconfig			YES
+#  define FontconfigIncDir		/usr/include/fontconfig
+#  define BuildFreetype2Library		NO
+#  define HasFreetype2			YES
+#  define BuildRenderLibrary		NO
+#  define HasRenderLibrary		YES
+#  define BuildXcursorLibrary		NO
+#  define HasXcursorLibrary		YES
+/* Xlib needs to know the available version of Xcursor. */
+#  define SharedXcursorRev		1
+#  define BuildXftLibrary		NO
+#  define HasXftLibrary			YES
+
+#  ifdef UseInstalled
+#    define RenderLibraryDir		/usr
+#    define XftLibraryDir		/usr
+#    define XcursorLibraryDir		/usr
+#  else
+/* The XFree86 Debian package uses a special hack to find these libraries. */
+#    define RenderLibraryDir		$(TOP)/../../imports
+#    define XftLibraryDir		$(TOP)/../../imports
+#    define XcursorLibraryDir		$(TOP)/../../imports
+#  endif
+
+/*
+ * We want to be sure that the normal XFree86 X server and the debugging X
+ * server use the same FreeType2 library.  We'd *like* it if we could
+ * achieve this by both packages dynamically linking against the system's
+ * FreeType2 library; however, the normal X server package
+ * (xserver-xorg) *cannot* be built dynamically linked against the
+ * FreeType2 library when the module loader is enabled because of
+ * code/design issues.  Therefore, we encapsulate XFree86's internal "fork"
+ * of the FreeType2 library into *both* xserver-xorg and
+ * xserver-xorg-dbg.  When it becomes possible to build the
+ * module-loading server against an external FreeType2 shared library, we
+ * can drop this define:
+ */
+#   define FontLibSharedFreeType	NO
+
+#   define HasLinuxInput		YES
+#   define HasXdmAuth			YES
+#   define HasLatex			YES
+/* Enable extended instruction set support. */
+#   ifdef i386Architecture
+#    define HasX86Support		YES
+#    define HasMMXSupport		YES
+#    define Has3DNowSupport		YES
+#    define HasSSESupport		YES
+#   endif /* i386Architecture */
+# endif /* DebianMaintainer */
+#endif /* NetBSDDebian */
+
 /*
  * C library features
  */
@@ -93,8 +259,12 @@
 
 #define HasUsableFileMmap	YES
 
-#define HasVarRun		YES
+#if NetBSDDistribution == NetBSDDebian
+#define VarDbDirectory		$(VARDIR)/lib
+#else /* Debian */
 #define HasVarDb		YES
+#endif /* Debian */
+#define HasVarRun		YES
 
 #define HasShadowPasswd		NO
 
@@ -207,6 +377,8 @@
 
 #if UseElfFormat
 #define DlLibrary		-rdynamic /* no -ldl yet */
+#define HasPlugin		YES
+#define VendorHasX11R6_3libXext	YES
 #else
 #define DlLibrary		/**/
 #endif
@@ -336,7 +508,11 @@
 /* NetBSD doesn't have gperf in the base install */
 #define DontRebuildGperfOutput	YES
 
-/* 
+#if NetBSDDistribution == NetBSDDebian
+#define HasPerl			YES
+#endif
+
+/*
  * NetBSD doesn't have perl in default system
  * you may override this in host.def if you installed perl from the packages
  */
@@ -355,7 +531,13 @@
 /*
  * Make & install Features
  */
+
+#if NetBSDDistribution == NetBSDDebian
+#define HasBsdMake		NO
+#else
 #define HasBsdMake		YES
+#endif
+
 #define CompressAllFonts	YES
 #define GzipFontCompression	YES
 #define DefaultUserPath		/bin:/usr/bin:/usr/pkg/bin:/usr/local/bin:$(BINDIR)
@@ -463,6 +645,8 @@
 									@@\
 .EXEC:
 
+#if NetBSDDistribution != NetBSDDebian /* Debian uses ProjectManSuffix */
+
 /*
  * Man pages need to be formatted when installed, so override the default
  * imake rules.
@@ -552,6 +736,8 @@
 									@@\
 InstallManPageAliasesBase(file,destdir,aliases)
 
+#endif /* NetBSDDistribution != NetBSDDebian */
+
 /*
  * Shared libraries supported starting in 1.0 on a.out platforms,
  * and on all ELF platforms.
Index: xutils-dev/xorg-cf-files/sco5.cf
===================================================================
--- xutils-dev.orig/xorg-cf-files/sco5.cf
+++ xutils-dev/xorg-cf-files/sco5.cf
@@ -69,7 +69,7 @@
 #endif
 
 #ifndef UseExportLists
-# define UseExportLists		YES
+# define UseExportLists		NO
 #endif
 
 #define StandardDefines		-DSYSV -Di386 -DSCO325 -D__SCO__
Index: xutils-dev/xorg-cf-files/usl.cf
===================================================================
--- xutils-dev.orig/xorg-cf-files/usl.cf
+++ xutils-dev/xorg-cf-files/usl.cf
@@ -159,7 +159,7 @@
 #endif
 
 #ifndef UseExportLists
-# define UseExportLists		YES
+# define UseExportLists		NO
 #endif
 
 #define GencatFlags		-m
Index: xutils-dev/xorg-cf-files/X11.tmpl
===================================================================
--- xutils-dev.orig/xorg-cf-files/X11.tmpl
+++ xutils-dev/xorg-cf-files/X11.tmpl
@@ -45,7 +45,7 @@
 # if defined XorgVersionString
 #   define XOrgReleaseString	Release XorgVersionString
 # else
-#   define XOrgReleaseString	Release 6.8
+#   define XOrgReleaseString	Release 6.9
 # endif
 #endif
 
@@ -614,23 +614,29 @@
 #ifndef BuildRender
 #define BuildRender		YES
 #endif
+#ifndef HasRenderLibrary
+#define HasRenderLibrary	NO
+#endif
 #ifndef BuildRenderLibrary
-#define BuildRenderLibrary	(XdmxServer || !BuildServersOnly)
+#define BuildRenderLibrary	(XdmxServer || (!HasRenderLibrary && BuildLibraries))
+#endif
+#ifndef HasXftLibrary
+#define HasXftLibrary		NO
 #endif
 #ifndef BuildXftLibrary
-#define BuildXftLibrary		BuildRenderLibrary
+#define BuildXftLibrary		((BuildRenderLibrary || HasRenderLibrary) && BuildLibraries)
 #endif
 #ifndef BuildXft1Library
 #define BuildXft1Library	BuildRenderLibrary
 #endif
 #ifndef UseFontconfig
-#define UseFontconfig		BuildXftLibrary
+#define UseFontconfig		(BuildXftLibrary || HasXftLibrary)
 #endif
 #ifndef BuildFontconfigLibrary
 #define BuildFontconfigLibrary	(UseFontconfig && !HasFontconfig)
 #endif
 #ifndef UseFreetype2
-#define UseFreetype2		(BuildXftLibrary || BuildXft1Library || \
+#define UseFreetype2		(BuildXftLibrary || HasXftLibrary || BuildXft1Library || \
 				 UseFontconfig || BuildFreeType)
 #endif
 #ifndef InstallFontconfigLibrary
@@ -700,8 +706,12 @@
 #define BuildXkbcomp		BuildClients
 #endif
 
+#ifndef HasXcursorLibrary
+#define HasXcursorLibrary	NO
+#endif
+
 #ifndef BuildXcursorLibrary
-#define BuildXcursorLibrary	BuildRenderLibrary
+#define BuildXcursorLibrary	((BuildRenderLibrary || HasRenderLibrary) && !HasXcursorLibrary && BuildLibraries)
 #endif
 
 #ifndef BuildXcursorgen
@@ -1170,7 +1180,7 @@
 #endif
 
 #ifndef RenderDefines
-#if BuildRender
+#if BuildRender || HasRenderLibrary
 #define RenderDefines -DRENDER
 #else
 #define RenderDefines /**/
@@ -2668,6 +2678,7 @@
 ProjectUnsharedLibReferences(GLW,GLw,$(GLWIDGETSRC),XBuildLibDir)
 #endif
 
+#if BuildRenderLibrary
     XRENDERLIBSRC = $(LIBSRC)/Xrender
 #if SharedLibXrender
 #ifndef SharedXrenderRev
@@ -2678,6 +2689,42 @@
 ProjectUnsharedLibReferences(XRENDER,Xrender,$(XRENDERLIBSRC),XBuildLibDir)
 #endif
 
+#ifdef UseInstalled
+XRENDERINCDIR=$(INCDIR)
+#else
+XRENDERINCDIR=$(BUILDINCDIR)
+#endif
+
+XRENDERINCLUDES = -I$(XRENDERINCDIR)
+
+#else /* BuildRenderLibrary */
+
+#if HasRenderLibrary
+
+#ifndef RenderLibraryDir
+#define RenderLibraryDir /usr/X11R6
+#endif
+
+#ifndef RenderLibraryLibDir
+#define RenderLibraryLibDir RenderLibraryDir/LibDirName
+#endif
+
+#ifndef RenderLibraryIncDir
+#define RenderLibraryIncDir RenderLibraryDir/include
+#endif
+
+XRENDERDIR = RenderLibraryDir
+XRENDERLIBDIR = RenderLibraryLibDir
+XRENDERINCDIR = RenderLibraryIncDir
+XRENDERLIB = -L$(XRENDERLIBDIR) -lXrender
+DEPXRENDERLIB =
+
+XRENDERINCLUDES = -I$(XRENDERINCDIR)
+
+#endif /* HasRenderLibrary */
+
+#endif /* else BuildRenderLibrary */
+
     XRANDRLIBSRC = $(LIBSRC)/Xrandr
 #if SharedLibXrandr
 #ifndef SharedXrandrRev
@@ -2728,6 +2775,7 @@
 ProjectUnsharedLibReferences(XEVIE,Xevie,$(XEVIELIBSRC),XBuildLibDir)
 #endif
 
+#if BuildXcursorLibrary
    XCURSORLIBSRC = $(LIBSRC)/Xcursor
 #if SharedLibXcursor
 #ifndef SharedXcursorRev
@@ -2738,6 +2786,41 @@
 ProjectUnsharedLibReferences(XCURSOR,Xcursor,$(XCURSORLIBSRC),XBuildLibDir)
 #endif
 
+#ifdef UseInstalled
+XCURSORINCDIR=$(INCDIR)
+#else
+XCURSORINCDIR=$(BUILDINCDIR)
+#endif
+
+XCURSORINCLUDES=-I$(XCURSORINCDIR) $(XRENDERINCLUDES)
+
+#else /* BuildXcursorLibrary */
+
+#if HasXcursorLibrary
+
+#ifndef XcursorLibraryDir
+#define XcursorLibraryDir /usr/X11R6
+#endif
+
+#ifndef XcursorLibraryLibDir
+#define XcursorLibraryLibDir XcursorLibraryDir/LibDirName
+#endif
+
+#ifndef XcursorLibraryIncDir
+#define XcursorLibraryIncDir XcursorLibraryDir/include
+#endif
+
+XCURSORDIR = XcursorLibraryDir
+XCURSORLIBDIR = XcursorLibraryLibDir
+XCURSORINCDIR = XcursorLibraryIncDir
+XCURSORLIB = -L$(XCURSORLIBDIR) -lXcursor
+
+XCURSORINCLUDES=-I$(XCURSORINCDIR) $(XRENDERINCLUDES)
+
+#endif /* HasXcursorLibrary */
+
+#endif /* else BuildXcursorLibrary */
+
    APPLEWMLIBSRC = $(LIBSRC)/apple
 #if SharedLibAppleWM
 #ifndef SharedAppleWMRev
@@ -3543,6 +3626,7 @@
 
 #endif /* UseExpat */
 
+#if BuildXftLibrary
 #ifndef SharedLibXft1
 #define SharedLibXft1 HasSharedLibraries
 #endif
@@ -3555,6 +3639,18 @@
 #ifndef ProfileLibXft1
 #define ProfileLibXft1		NO
 #endif
+#else
+#undef  SharedLibXft
+#define SharedLibXft		NO
+#undef  NormalLibXft
+#define NormalLibXft		NO
+#undef  DebugLibXft
+#define DebugLibXft		NO
+#undef  ProfileLibXft
+#define ProfileLibXft		NO
+#endif
+
+#if BuildXftLibrary
           XFT1LIBSRC = $(LIBSRC)/Xft1
 #if SharedLibXft1
 #ifndef SharedXft1Rev
@@ -3609,6 +3705,42 @@
 #define XftClientLibs $(XFTLIB) FontconfigClientLibs $(XRENDERLIB)
 #endif
 
+XFTINCLUDES=$(FONTCONFIGINCLUDES) $(FREETYPE2INCLUDES) $(XRENDERINCLUDES)
+
+#else /* BuildXftLibrary */
+
+#if HasXftLibrary
+
+#ifndef XftLibraryDir
+#define XftLibraryDir /usr/X11R6
+#endif
+
+#ifndef XftLibraryLibDir
+#define XftLibraryLibDir XftLibraryDir/LibDirName
+#endif
+
+#ifndef XftLibraryIncDir
+#define XftLibraryIncDir XftLibraryDir/include
+#endif
+
+XFTDIR = XftLibraryDir
+XFTLIBDIR = XftLibraryLibDir
+XFTINCDIR = XftLibraryIncDir
+XFTLIB = -L$(XFTLIBDIR) -lXft
+
+#ifndef XftClientDepLibs
+#define XftClientDepLibs FontconfigClientDepLibs $(DEPXRENDERLIB)
+#endif
+#ifndef XftClientLibs
+#define XftClientLibs $(XFTLIB) FontconfigClientLibs $(XRENDERLIB)
+#endif
+
+XFTINCLUDES= -I$(XFTINCDIR) $(FONTCONFIGINCLUDES) $(FREETYPE2INCLUDES) $(XRENDERINCLUDES)
+
+#endif /* HasXftLibrary */
+
+#endif /* else BuildXftLibrary */
+
 #if UseFontconfig
 
 #if BuildFontconfigLibrary
@@ -3724,8 +3856,6 @@
 
 #endif /* UseFontconfig */
 
-XFTINCLUDES=$(FONTCONFIGINCLUDES) $(FREETYPE2INCLUDES)
-
 #ifdef HasLibpng
 
 /*
Index: xutils-dev/xorg-cf-files/xfree86.cf
===================================================================
--- xutils-dev.orig/xorg-cf-files/xfree86.cf
+++ xutils-dev/xorg-cf-files/xfree86.cf
@@ -100,6 +100,13 @@
 #define XVendorManNameString XFree86
 #endif
 
+VENDORMANNAME = XVendorManNameString
+VENDORMANVERSION = XVendorManVersionString
+
+#ifndef VendorManDefs
+#define VendorManDefs -D__vendorversion__="\"Version $(VENDORMANVERSION)\" $(VENDORMANNAME)"
+#endif
+
 /*
  * This enables some settings for developers.
  */
@@ -116,6 +123,15 @@
 # endif
 #endif
 
+/*
+ * No XF86Server for the S/390 platform.
+ */
+#ifdef s390Architecture
+# ifndef XF86Server
+#  define XF86Server		NO
+# endif
+#endif
+
 #ifndef BuildDebug
 # define BuildDebug 		YES
 #endif
@@ -233,6 +249,11 @@
 #define GlideDriver /**/
 #endif
 
+/* The tdfx DRI driver can only be built if glide3 is available. */
+#ifndef HasGlide3
+#define HasGlide3 NO
+#endif
+
 /*
  * There are three parameters that determine where and how the Matrox HAL
  * library is used:
@@ -372,15 +393,17 @@
 #  /* Don't build the nsc driver on IA64 */
 #  ifndef ia64Architecture
 #   define NscDriver		nsc
+#   define ViaDriver		via
 #  else
 #   define NscDriver		/**/
+#   define ViaDriver		/**/
 #  endif
 #  define XF86CardDrivers	mga glint nv tga s3 s3virge sis rendition \
 				neomagic i740 tdfx savage \
 				cirrus vmware tseng trident chips apm \
 				GlideDriver i128 NscDriver \
 				ati i810 AgpGartDrivers DevelDrivers ark \
-				cyrix siliconmotion via \
+				cyrix siliconmotion ViaDriver \
 				fbdev vesa vga \
 				dummy XF86OSCardDrivers XF86ExtraCardDrivers
 # endif
@@ -485,8 +508,11 @@
 				vga dummy fbdev vesa
 # endif
 
-/* DRI tdfx driver needs Glide, which is not available for AMD64 */
-# define TdfxDriDriver		/**/
+# if HasGlide3
+#  define TdfxDriDriver		tdfx
+# else
+#  define TdfxDriDriver		/**/
+#endif
 
 # define DevelDRIDrivers	/**/
 
@@ -579,9 +605,9 @@
     * require changes (or even removal) for things like endianness, etc.  Move
     * those known to work into the main XF86CardDrivers #define.
     */
-#   define DevelDrivers		apm ark chips cirrus i128 i740 i810 imstt \
-				neomagic newport nv rendition s3virge savage \
-				siliconmotion tga trident vmware dummy
+#   define DevelDrivers		apm ark chips cirrus i128 i740 imstt \
+				neomagic nv rendition s3virge savage \
+				siliconmotion trident dummy
 #  else
 #   define DevelDrivers		/* */
 #  endif
@@ -872,8 +898,14 @@
 				savage nv cirrus DevelDrivers siliconmotion  \
 				vga XF86OSCardDrivers XF86ExtraCardDrivers
 # endif
+# if HasGlide3
+#  define TdfxDriDriver		tdfx
+# else
+#  define TdfxDriDriver		/**/
+# endif
 # ifndef DriDrivers
-#  define DriDrivers		gamma tdfx mga r128 radeon r200 /*sis*/
+#  define DriDrivers		gamma tdfx mga r128 radeon r200 /*sis*/ \
+				TdfxDriDriver
 # endif
 #endif
 
@@ -968,8 +1000,13 @@
 				DevelDrivers vga \
 				XF86OSCardDrivers XF86ExtraCardDrivers
 # endif
+# if HasGlide3
+#  define TdfxDriDriver		tdfx
+# else
+#  define TdfxDriDriver		/**/
+# endif
 # ifndef DriDrivers
-#  define DriDrivers		gamma tdfx mga r128 radeon r200
+#  define DriDrivers		gamma TdfxDriDriver mga r128 radeon r200
 # endif
 #endif
 
@@ -1066,7 +1103,7 @@
 #  define TdfxDriDriver		/**/
 # endif
 # ifndef DriDrivers
-#  define DriDrivers		gamma tdfx mga r128 radeon r200
+#  define DriDrivers		gamma TdfxDriDriver mga r128 radeon r200
 # endif
 #endif
 
@@ -1745,7 +1782,7 @@
 #endif
 #ifndef BuildScanpci
 # if SystemV || SystemV4 || \
-    (defined(LinuxArchitecture) && !defined(Mc68020Architecture)) || \
+    defined(LinuxArchitecture) || \
     defined(i386BsdArchitecture) || defined(LynxOSArchitecture) || \
     defined(OS2Architecture) || defined(GNUMachArchitecture) || \
     (defined(KFreeBSDArchitecture) && defined(i386Architecture))
@@ -1943,10 +1980,6 @@
 # define UseRgbTxt	YES
 #endif
 
-#ifndef ManSuffix
-# define ManSuffix	1
-#endif
-
 /*
  * GNU Compiler stuff
  */
@@ -2010,33 +2043,39 @@
 # define GccAliasingArgs      /* */
 #endif
 
+#if HasGcc2
+# ifndef DefaultGcc2OptimizeOpt
+#  define DefaultGcc2OptimizeOpt -O2
+# endif
+#endif
+
 #if HasGcc2 && defined(i386Architecture)
 # ifndef DefaultGcc2i386Opt
-#  define DefaultGcc2i386Opt -O2 -fno-strength-reduce GccAliasingArgs
+#  define DefaultGcc2i386Opt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 #endif
 
 #if HasGcc2 && defined(AMD64Architecture)
 # ifndef DefaultGcc2AMD64Opt
-#  define DefaultGcc2AMD64Opt -O2 -fno-strength-reduce GccAliasingArgs
+#  define DefaultGcc2AMD64Opt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 #endif
 
 #if HasGcc2 && defined(AlphaArchitecture)
 # ifndef DefaultGcc2AxpOpt
-#  define DefaultGcc2AxpOpt -O2 GccAliasingArgs
+#  define DefaultGcc2AxpOpt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 #endif
 
 #if HasGcc2 && defined(Ppc64Architecture)
 # ifndef DefaultGcc2Ppc64Opt
-#  define DefaultGcc2Ppc64Opt -O2 GccAliasingArgs
+#  define DefaultGcc2Ppc64Opt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 #endif
 
 #if HasGcc2 && defined(PpcArchitecture)
 # ifndef DefaultGcc2PpcOpt
-#  define DefaultGcc2PpcOpt -O2 GccAliasingArgs
+#  define DefaultGcc2PpcOpt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 #endif
 
Index: xutils-dev/xorg-cf-files/xorg.cf
===================================================================
--- xutils-dev.orig/xorg-cf-files/xorg.cf
+++ xutils-dev/xorg-cf-files/xorg.cf
@@ -262,6 +262,11 @@
 #define GlideDriver /**/
 #endif
 
+/* The tdfx DRI driver can only be built if glide3 is available. */
+#ifndef HasGlide3
+#define HasGlide3 NO
+#endif
+
 /*
  * There are three parameters that determine where and how the Matrox HAL
  * library is used:
@@ -425,7 +430,13 @@
    /* SiS is 64-bit unclean as of this writing. */
 #   define i386DRIDrivers /**/
 #  endif
-#  define DriDrivers		i386DRIDrivers mga r128 radeon r200 tdfx
+#  if HasGlide3
+#   define TdfxDriDriver   tdfx
+#  else
+#   define TdfxDriDriver   /**/
+#  endif
+#  define DriDrivers       i386DRIDrivers mga r128 radeon r200 \
+               TdfxDriDriver
 # endif
 #endif /* i386Architecture || ia64Architecture */
 
@@ -461,8 +472,13 @@
 # endif
 
 /* SiS is 64-bit unclean as of this writing. */
+#  if HasGlide3
+#   define TdfxDriDriver   tdfx
+#  else
+#   define TdfxDriDriver   /**/
+#  endif
 # ifndef DriDrivers
-#  define DriDrivers		i915 mga r128 radeon r200 tdfx
+#  define DriDrivers       i915 mga r128 radeon r200 TdfxDriDriver
 # endif
 #endif /*AMD64Arcitecture*/
 
@@ -602,8 +618,13 @@
  *  Glide is available for Alpha, therefore build tdfx DRM module.
  *  SiS is 64-bit unclean as of this writing. 
  */  
+#  if HasGlide3
+#   define TdfxDriDriver   tdfx
+#  else
+#   define TdfxDriDriver   /**/
+#  endif
 # ifndef DriDrivers
-#  define DriDrivers		tdfx mga r128 radeon r200
+#  define DriDrivers       TdfxDriDriver mga r128 radeon r200
 # endif
 #endif /* AlphaArchitecture */
 
@@ -767,7 +788,7 @@
 # endif
 # define TdfxDriDriver		/**/
 # ifndef DriDrivers
-#  define DriDrivers		r128
+#  define DriDrivers		r128 TdfxDriDriver
 # endif
 #endif /* Ppc64Architecture */
 
@@ -1480,10 +1501,6 @@
 # define UseRgbTxt	YES
 #endif
 
-#ifndef ManSuffix
-# define ManSuffix	1
-#endif
-
 /*
  * GNU Compiler stuff
  */
@@ -1557,37 +1574,37 @@
 
 #if HasGcc2 && defined(i386Architecture)
 # ifndef DefaultGcc2i386Opt
-#  define DefaultGcc2i386Opt -O2 -fno-strength-reduce GccAliasingArgs
+#  define DefaultGcc2i386Opt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 #endif
 
 #if HasGcc2 && defined(AMD64Architecture)
 # ifndef DefaultGcc2AMD64Opt
-#  define DefaultGcc2AMD64Opt -O2 -fno-strength-reduce GccAliasingArgs
+#  define DefaultGcc2AMD64Opt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 #endif
 
 #if HasGcc2 && defined(AlphaArchitecture)
 # ifndef DefaultGcc2AxpOpt
-#  define DefaultGcc2AxpOpt -O2 GccAliasingArgs
+#  define DefaultGcc2AxpOpt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 #endif
 
 #if HasGcc2 && defined(Ppc64Architecture)
 # ifndef DefaultGcc2Ppc64Opt
-#  define DefaultGcc2Ppc64Opt -O2 GccAliasingArgs
+#  define DefaultGcc2Ppc64Opt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 #endif
 
 #if HasGcc2 && defined(MipsArchitecture)
 # ifndef DefaultGcc2MipsOpt
-#  define DefaultGcc2MipsOpt -O2 GccAliasingArgs
+#  define DefaultGcc2MipsOpt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 #endif
 
 #if HasGcc2 && defined(PpcArchitecture)
 # ifndef DefaultGcc2PpcOpt
-#  define DefaultGcc2PpcOpt -O2 GccAliasingArgs
+#  define DefaultGcc2PpcOpt DefaultGcc2OptimizeOpt GccAliasingArgs
 # endif
 #endif
 
Index: xutils-dev/xorg-cf-files/xorgversion.def
===================================================================
--- xutils-dev.orig/xorg-cf-files/xorgversion.def
+++ xutils-dev/xorg-cf-files/xorgversion.def
@@ -1,5 +1,5 @@
 #define XORG_VERSION_MAJOR 6
-#define XORG_VERSION_MINOR 8
-#define XORG_VERSION_PATCH 99
-#define XORG_VERSION_SNAP 903
-#define XORG_DATE "03 December 2005 + cvs"
+#define XORG_VERSION_MINOR 9
+#define XORG_VERSION_PATCH 0
+#define XORG_VERSION_SNAP  0
+#define XORG_DATE "21 December 2005"