summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 46afc49319c98ffb7b533ff038b582ef9971e421 (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
dnl
dnl Configure.ac for xine
dnl

AC_INIT
AC_CONFIG_SRCDIR([src/xine-engine/xine.c])

dnl
dnl Require autoconf version 2.53
dnl
AC_PREREQ(2.53)

dnl Making releases:
dnl   XINE_SUB += 1; continue with LT_* values below
dnl
XINE_MAJOR=1
XINE_MINOR=0
XINE_SUB=0


dnl The libtool version numbers (LT_*); Don't even think about faking this!
dnl 
dnl immediately before every release do:
dnl ===================================
dnl if (the interface is totally unchanged from previous release)
dnl    LT_REVISION ++;
dnl else { /* interfaces have been added, removed or changed */
dnl    LT_REVISION = 0;
dnl    LT_CURRENT ++;
dnl    if (any interfaces have been _added_ since last release)
dnl       AGE ++;
dnl    if (any interfaces have been _removed_ or _incompatibly changed_)
dnl       AGE = 0;
dnl }

LT_CURRENT=9
LT_REVISION=1
LT_AGE=8

dnl for a release tarball do "rm .cvsversion" before "make dist"
if test -f .cvsversion; then
  XINE_PRE="cvs"
else
  XINE_PRE="rc4"
fi

AC_SUBST(XINE_MAJOR)
AC_SUBST(XINE_MINOR)
AC_SUBST(XINE_SUB)
AC_SUBST(XINE_IFACE_AGE)
AC_SUBST(XINE_BIN_AGE)

AC_DEFINE_UNQUOTED(XINE_MAJOR, $XINE_MAJOR,[xine major version number])
AC_DEFINE_UNQUOTED(XINE_MINOR, $XINE_MINOR,[xine minor version number])
AC_DEFINE_UNQUOTED(XINE_SUB, $XINE_SUB, [xine sub version number])

AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)

dnl TAR_NAME="xine-lib-"$XINE_MAJOR.$XINE_MINOR.$XINE_SUB$XINE_PRE
dnl SPEC_VERSION=$XINE_MAJOR.$XINE_MINOR.$XINE_SUB$XINE_PRE
TAR_NAME="xine-lib-"$XINE_MAJOR-$XINE_PRE
SPEC_VERSION=${XINE_MAJOR}_$XINE_PRE

AC_SUBST(TAR_NAME)
AC_SUBST(SPEC_VERSION)

LIBNAME=libxine$XINE_MAJOR
AC_SUBST(LIBNAME)

dnl
AC_CANONICAL_TARGET

dnl
dnl AM_INIT_AUTOMAKE("xine-lib", $XINE_MAJOR.$XINE_MINOR.$XINE_SUB$XINE_PRE)
AM_INIT_AUTOMAKE("xine-lib", $XINE_MAJOR-$XINE_PRE)


dnl ---------------------------------------------
dnl Made possible to build for another arch.
dnl ---------------------------------------------

if test x$XINE_BUILD != "x"; then
  AC_MSG_RESULT([*** build forced to $XINE_BUILD ***])
  build=$XINE_BUILD
  host=$XINE_BUILD
else
  check_athlon=yes
fi

AM_CONFIG_HEADER(config.h)


dnl ---------------------------------------------
dnl Check for programs.
dnl ---------------------------------------------

dnl Save CFLAGS, AC_ISC_POSIX set some unwanted default CFLAGS
saved_CFLAGS="$CFLAGS"
AC_ISC_POSIX
CFLAGS="$saved_CFLAGS"
AC_PROG_CC
AC_HEADER_STDC
AC_PROG_MAKE_SET
dnl AC_PROG_EGREP  needs autoconf 2.54, just hardcode for "egrep"
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
AC_C_INLINE


dnl ---------------------------------------------
dnl Check for assembler (ffmpeg need it), don't call this before LIBTOOL
dnl ---------------------------------------------

AM_PROG_AS_MOD


dnl ---------------------------------------------
dnl Libtool
dnl ---------------------------------------------

AC_LIBTOOL_DLOPEN
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
AC_PROG_LIBTOOL_SANITYCHECK
AC_SUBST(LIBTOOL_DEPS)
if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then
  STATIC="-static"
else
  STATIC=
fi
AC_SUBST(STATIC)


dnl ---------------------------------------------
dnl NLS Support
dnl ---------------------------------------------

dnl ALL_LINGUAS="cs da de el en@quot en@boldquot es et fr gl id it ja ko nl nn no pl pt pt_BR ru sl sv tr zh"
ALL_LINGUAS="fr pt_BR de sk es pl cs it"
AM_GNU_GETTEXT(use-libtool, need-ngettext)
AC_PROG_GMSGFMT_PLURAL
AC_CONFIG_LINKS($nls_cv_header_libgt, $nls_cv_header_intl)
AM_CONDITIONAL(INCLUDED_INTL, test x$USE_INCLUDED_LIBINTL = "xyes")
if test x"$USE_INCLUDED_LIBINTL" = x"yes"; then
   INTLDIR="-I\$(top_builddir)/intl -I\$(top_srcdir)/intl"
fi
dnl AC_SUBST(INTLDIR)


dnl ---------------------------------------------
dnl Checks for typedefs, structures, and compiler characteristics.
dnl ---------------------------------------------

AC_C_BIGENDIAN
dnl AC_C_BIGENDIAN triggers an AC_TRY_RUN warning; we can't cross compile
dnl xine (oh, well)
AC_C_CONST
AC_C_ALWAYS_INLINE
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
dnl AC_CHECK_TYPES([ptrdiff_t])
AC_CHECK_GENERATE_INTTYPES([include])


dnl ---------------------------------------------
dnl debug cflags
dnl ---------------------------------------------

AC_SUBST(DEBUG_CFLAGS)
DEBUG_CFLAGS="-g -DDEBUG $CFLAGS"

dnl dummy
ASFLAGS="$ASFLAGS"
AC_SUBST(ASFLAGS)


dnl ---------------------------------------------
dnl threads
dnl ---------------------------------------------

case "$host" in
  *-*-freebsd*)
    THREAD_LIBS="-L/usr/local/lib -pthread"
    THREAD_CFLAGS="-I/usr/local/include -D_THREAD_SAFE"

    CFLAGS="$THREAD_CFLAGS $CFLAGS"
    DEBUG_CFLAGS="$DEBUG_CFLAGS"

    ;;

  *-*-hpux11*)
    THREAD_LIBS=" -lpthread"
    THREAD_CFLAGS="-D_REENTRANT"
    CFLAGS="$THREAD_CFLAGS $CFLAGS"

    ;;

  *)
    AC_CHECK_LIB(pthread, pthread_create,
  	     [THREAD_LIBS="-lpthread"],
 	     [AC_MSG_ERROR(pthread needed)])
    ;;
esac
AC_SUBST(THREAD_LIBS)
dnl needed for xine-config
AC_SUBST(THREAD_CFLAGS)


dnl ---------------------------------------------
dnl dynamic linker
dnl ---------------------------------------------

AC_CHECK_LIB(c, dlopen,
	     DYNAMIC_LD_LIBS="",
	     AC_CHECK_LIB(dl, dlopen,
             	          DYNAMIC_LD_LIBS="-ldl",
	                  AC_MSG_ERROR(dynamic linker needed)))
AC_SUBST(DYNAMIC_LD_LIBS)


dnl ---------------------------------------------
dnl determine libdir name
dnl ---------------------------------------------

AC_MSG_CHECKING([libdir name])
case $host in
*-*-linux*)
 # Test if the compiler is 64bit
 echo 'int i;' > conftest.$ac_ext
 xine_cv_cc_64bit_output=no
 if AC_TRY_EVAL(ac_compile); then
 case `/usr/bin/file conftest.$ac_objext` in
 *"ELF 64"*)
   xine_cv_cc_64bit_output=yes
   ;;
 esac
 fi
 rm -rf conftest*
 ;;
esac

case $host_cpu:$xine_cv_cc_64bit_output in
powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
 XINE_LIBNAME="lib64"
 ;;
*:*)
 XINE_LIBNAME="lib"
 ;;
esac
AC_MSG_RESULT([$XINE_LIBNAME])


dnl ---------------------------------------------
dnl mpeg2lib and ffmpeg stuff
dnl ---------------------------------------------

AC_SUBST(LIBMPEG2_CFLAGS)
AC_SUBST(LIBFFMPEG_CFLAGS)

LIBMPEG2_CFLAGS=""
LIBFFMPEG_CFLAGS="-DSIMPLE_IDCT -DHAVE_AV_CONFIG_H -DRUNTIME_CPUDETECT -DUSE_FASTMEMCPY -DCONFIG_RISKY -DCONFIG_DECODERS -DXINE_MPEG_ENCODER -DCONFIG_ZLIB"

AC_CHECK_DECL(lrintf,[AC_DEFINE(HAVE_LRINTF,1,[Define this if the 'lrintf' function is declared in math.h])],,[
#define _ISOC9X_SOURCE
#include "math.h"
])

AC_CHECK_TYPES(int_fast8_t, [], [LIBFFMPEG_CFLAGS="$LIBFFMPEG_CFLAGS -DEMULATE_FAST_INT"])

AC_ARG_ENABLE(altivec,
	AC_HELP_STRING([--disable-altivec], [do not use assembly codes for Motorola 74xx CPUs]),
		enable_altivec=$enableval,
		enable_altivec=yes)

AC_ARG_ENABLE(vis,
	AC_HELP_STRING([--disable-vis], [do not use assembly codes for Sun UltraSPARC CPUs]),
         	enable_vis=$enableval,
		enable_vis=yes)

AC_ARG_ENABLE(mlib,
	AC_HELP_STRING([--disable-mlib], [do not build Sun mediaLib support]),
		enable_mlib=$enableval,
		enable_mlib=yes)

AC_ARG_ENABLE(mlib-lazyload,
	AC_HELP_STRING([--enable-mlib-lazyload], [check for Sun mediaLib at runtime]),
		enable_mlib_lazyload=$enableval,
		enable_mlib_lazyload=no)

if test x$enable_mlib = xyes; then
    if test x"$MLIBHOME" = x; then
	mlibhome=/opt/SUNWmlib
    else
	mlibhome="$MLIBHOME"
    fi

    AC_CHECK_LIB(mlib, mlib_VideoAddBlock_U8_S16,
	[ saved_CPPFLAGS="$CPPFLAGS"
	  CPPFLAGS="$CPPFLAGS -I$mlibhome/include"
	  AC_CHECK_HEADER(mlib_video.h,
	       [ if test x$enable_mlib_lazyload = xyes; then
		     if test "$GCC" = yes; then
			 MLIB_LIBS="-L$mlibhome/lib -Wl,-z,lazyload,-lmlib,-z,nolazyload"
		     else
			 MLIB_LIBS="-L$mlibhome/lib -z lazyload -lmlib -z nolazyload"
		     fi
		     AC_DEFINE(MLIB_LAZYLOAD,1,[Define this if you want to load mlib lazily])
		 else
		     MLIB_LIBS="-L$mlibhome/lib -lmlib"
		 fi
		 MLIB_CFLAGS="-I$mlibhome/include"
		 LIBMPEG2_CFLAGS="$LIBMPEG2_CFLAGS $MLIB_CFLAGS" 
		 LIBFFMPEG_CFLAGS="$LIBFFMPEG_CFLAGS $MLIB_CFLAGS"
		 AC_DEFINE(HAVE_MLIB,1,[Define this if you have mlib installed])
		 AC_DEFINE(LIBMPEG2_MLIB,1,[Define this if you have mlib installed])
		 ac_have_mlib=yes
	       ],)
	  CPPFLAGS="$saved_CPPFLAGS"
	], , -L$mlibhome/lib)
fi
AM_CONDITIONAL(HAVE_MLIB, test x$ac_have_mlib = "xyes")
AC_SUBST(MLIB_LIBS)
AC_SUBST(MLIB_CFLAGS)


dnl ---------------------------------------------
dnl Checks for X11
dnl ---------------------------------------------

AC_PATH_XTRA
if test x"$no_x" != "xyes"; then
    AC_DEFINE(HAVE_X11,1,[Define this if you have X11R6 installed])
fi
AM_CONDITIONAL(HAVE_X11, [test x"$no_x" != "xyes"])


dnl ---------------------------------------------
dnl socket library
dnl ---------------------------------------------

dnl Test for socket and network support library
NET_LIBS=""
AC_CHECK_LIB(socket, socket, NET_LIBS="-lsocket $NET_LIBS",)
AC_CHECK_LIB(nsl, gethostbyname, NET_LIBS="-lnsl $NET_LIBS",)
AC_SUBST(NET_LIBS)


dnl ---------------------------------------------
dnl IPv6
dnl ---------------------------------------------

AC_ARG_ENABLE(ipv6,
	AC_HELP_STRING([--enable-ipv6], [enable use of IPv6]),
		enable_ipv6=$enableval,
		enable_ipv6=no)

echo -n "IPv6 is "
if test x$enable_ipv6 = xyes; then
    CFLAGS="-DENABLE_IPV6 $CFLAGS"
    echo "enabled"
else
    echo "disabled"
fi


dnl ---------------------------------------------
dnl zlib
dnl ---------------------------------------------

dnl Test for libz
AC_CHECK_LIB(z, gzsetparams,
	[ AC_CHECK_HEADER(zlib.h,
	  have_zlib=yes
	  ZLIB_LIBS="-lz",)], AC_MSG_ERROR(zlib needed))
AC_SUBST(ZLIB_LIBS)


dnl ---------------------------------------------
dnl Check for OpenGL & [GLut | GLU]
dnl ---------------------------------------------

AC_CHECK_LIB(GL, glBegin,
	[AC_CHECK_HEADER(GL/gl.h,
             [ ac_have_opengl="yes"
               OPENGL_LIBS="-lGL" 
	       AC_CHECK_LIB(glut, glutInit, dnl check for glut
	                    [ ac_have_glut="yes"
                              GLUT_LIBS="-lglut"
	                      AC_DEFINE(HAVE_GLUT,1,[Define this if you have GLut support available])
			      AC_DEFINE(HAVE_OPENGL,1,[Define this if you have OpenGL support available]) ],
	                    [ ac_have_glut="no" dnl fallback, check for GLU
	                      AC_CHECK_LIB(GLU, gluPerspective,
		                           [ ac_have_glu="yes"
                                             GLU_LIBS="-lGLU -lm" 
		                             AC_DEFINE(HAVE_GLU,1,[Define this if you have GLU support available])
					     AC_DEFINE(HAVE_OPENGL,1,[Define this if you have OpenGL support available]) ],
	                                   [ ac_have_glu="no" ], 
                                           [$X_LIBS $X_PRE_LIBS $OPENGL_LIBS -lGLU -lm $X_EXTRA_LIBS])], 
	                    [$X_LIBS $X_PRE_LIBS -lglut $X_EXTRA_LIBS])
             ],
	[])],
   [],
   [$X_LIBS $X_PRE_LIBS -lGL $X_EXTRA_LIBS])
AC_SUBST(OPENGL_LIBS)
AC_SUBST(GLUT_LIBS)
AC_SUBST(GLU_LIBS)
AM_CONDITIONAL(HAVE_OPENGL, [ test x$ac_have_opengl = "xyes" -a x$ac_have_glut="xyes" -o x$ac_have_opengl = "xyes" -a x$ac_have_glu="xyes" ] )


dnl ---------------------------------------------
dnl Check for platform which supports syncfb
dnl ---------------------------------------------

case "$host_or_hostalias" in
  *linux* )
    have_syncfb="yes"
    ;;
  *)
    have_syncfb="no"
    ;;
esac
AM_CONDITIONAL(HAVE_SYNCFB, test x"$have_syncfb" = "xyes")


dnl ----------------------------------------------
dnl Check for usable video-for-linux (v4l) support
dnl ----------------------------------------------

AC_CHECK_HEADER(linux/videodev.h, have_v4l=yes,)
AM_CONDITIONAL(HAVE_V4L, [test x"$have_v4l" = "xyes"])


dnl ----------------------------------------------
dnl Check for Xv and XvMC support (iconv is also tested here?)
dnl ----------------------------------------------

dnl static linking is preferred!
dnl but only dynamic linking is possible when using libtool < 1.4.0

AC_PREREQ_LIBTOOL(1.4.0, xv_lib="libXv.a", xv_lib="libXv.so")
AC_PREREQ_LIBTOOL(1.4.0, xvmc_lib="libXvMC.a", xvmc_lib="libXvMC.so")
AC_PREREQ_LIBTOOL(1.4.0, xvmc_lib_nv="libXvMCNVIDIA.a", xv_lib_nv="libXvMCNVIDIA_dynamic.so.1")

host_or_hostalias="$host"
if test "$host_or_hostalias" = ""; then
    dnl user has called ./configure with a host parameter unknown to
    dnl config.sub; the canonical "$host" is empty
    dnl
    dnl Try the following switch with user's original host_alias 
    dnl input instead.
    dnl
    host_or_hostalias="$host_alias"
fi

case "$host_or_hostalias" in
  hppa*)
	if test "$xv_lib" = "libXv.a"; then
	  echo "warning: hppa linker - disabling static libXv"
	  xv_lib="libXv.so"
	fi
	if test "$xvmc_lib" = "libXvMC.a"; then
	  echo "warning: hppa linker - disabling static libXvMC"
	  xvmc_lib="libXvMC.so"
	fi
	if test "$xvmc_lib_nv" = "libXvMCNVIDIA.a"; then
	  echo "warning: hppa linker - disabling static libXvMCNVIDIA"
	  xvmc_lib_nv="libXvMCNVIDIA_dynamic.so.1"
	fi
	;;

  i386-*-freebsd*)
	AC_CHECK_HEADER(/usr/local/include/iconv.h,
			CFLAGS="-I/usr/local/include $CFLAGS"
			LDFLAGS="-L/usr/local/lib $LDFLAGS"
	                LIBICONV="-liconv"
                        [ echo
                          echo "****************************************************************"
		          echo "* You need to install a recent version of the port 'libiconv'  *"
			  echo "* (in /usr/ports/converters/libiconv).                         *"
			  echo "* The library in this port is needed to successfully compile   *"
			  echo "* libsputext plugin.                                           *"
                          echo "****************************************************************"
	                  echo 
                        ],)
        ;;

  ppc-*-linux* | powerpc-*)
        ppc_arch="yes"
        ;;

  *)
        ;;
esac
AM_CONDITIONAL(PPC_ARCH, test x$ppc_arch = "xyes")


AC_ARG_WITH(xv-path, AC_HELP_STRING([--with-xv-path=path], [where libXv is installed]),
            xv_path="$withval", xv_path="/usr/X11R6/$XINE_LIBNAME")

AC_CHECK_LIB(Xv, XvShmCreateImage, 
             [ AC_MSG_CHECKING(for $xv_lib location)
               if test -f "$xv_path/$xv_lib"; then
                 AC_MSG_RESULT(found in $xv_path)
                 XV_LIB="-L$xv_path -lXv"
	         AC_DEFINE(HAVE_XV,1,[Define this if you have libXv installed])
	         ac_have_xv="yes"
		 if test x$xv_lib = "xlibXv.a" ; then
		   AC_DEFINE(HAVE_XV_STATIC,1,[Define this if you have libXv.a])
		 fi
               else
                 AC_MSG_RESULT(not found in $xv_path)
	         echo
                 echo "****************************************************************"
		 echo "* if you don't have a libXv.so on your system, use:            *"
		 echo "* ld --whole-archive -shared -o libXv.so.1 libXv.a             *"
		 echo "* then: ln -s libXv.so.1 libXv.so                              *"
	         echo "* to create it or try to use --with-xv-path to set the         *"
                 echo "* location of libXv.so                                         *"
                 echo "****************************************************************"
	         echo
               fi ],, [$X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS])
AM_CONDITIONAL(HAVE_XV, test x$ac_have_xv = "xyes")
dnl AM_CONDITIONAL(HAVE_XV_STATIC, test x$ac_have_xv = "xyes" -a x$xv_lib = "xlibXv.a")
dnl
dnl xine_check use Xv functions API.
dnl
if test x$ac_have_xv = "xyes"; then
  EXTRA_X_LIBS="-L$xv_path $XV_LIB -lXext"
  EXTRA_X_CFLAGS=""
fi
AC_SUBST(XV_LIB)
AC_SUBST(EXTRA_X_LIBS)
AC_SUBST(EXTRA_X_CFLAGS)

AC_ARG_WITH(xvmc-path, AC_HELP_STRING([--with-xvmc-path=path], [where libXvMC is installed]),
            xvmc_path="$withval", xvmc_path="/usr/X11R6/lib")

AC_CHECK_LIB(XvMC, XvMCQueryExtension, 
             [ AC_MSG_CHECKING(for $xvmc_lib location)
               if test -f "$xvmc_path/$xvmc_lib_nv"; then
               if test -f "$xvmc_path/$xvmc_lib"; then
                 AC_MSG_RESULT(found in $xvmc_path)
                 XVMC_LIB="-L$xvmc_path -lXvMC -lXvMCNVIDIA"
	         AC_DEFINE(HAVE_XVMC,1,[Define this if you have libXvMC installed])
	         ac_have_xvmc="yes"
		 if test x$xvmc_lib = "xlibXvMC.a" ; then
		   AC_DEFINE(HAVE_XVMC_STATIC,1,[Define this if you have libXvMC.a])
		 fi
               else
                 AC_MSG_RESULT(not found in $xvmc_path)
	         echo
                 echo "****************************************************************"
		 echo "* if you don't have a libXvMC.so on your system, use:          *"
		 echo "* ld --whole-archive -shared -o libXvMC.so.1 libXvMC.a         *"
		 echo "* then: ln -s libXvMC.so.1 libXvMC.so                          *"
	         echo "* to create it or try to use --with-xvmc-path to set the       *"
                 echo "* location of libXvMC.so                                       *"
                 echo "****************************************************************"
	         echo
		 fi
               fi ],, [$X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS])
	   
AM_CONDITIONAL(HAVE_XVMC, test x$ac_have_xvmc = "xyes")
dnl AM_CONDITIONAL(HAVE_XVMC_STATIC, test x$ac_have_xvmc = "xyes" -a x$xvmc_lib = "xlibXvMC.a")
dnl
dnl xine_check use XvMC functions API.
dnl
if test x$ac_have_xvmc = "xyes"; then
  EXTRA_X_LIBS="-L$xvmc_path $XVMC_LIBS -lXext"
  EXTRA_X_CFLAGS=""
fi
AC_SUBST(XVMC_LIB)


dnl ---------------------------------------------
dnl Checks for Xinerama extension
dnl ---------------------------------------------

AC_CHECK_LIB(Xinerama, XineramaQueryExtension, 
             [X_LIBS="$X_LIBS -lXinerama"
              AC_DEFINE(HAVE_XINERAMA,1,[Define this if you have libXinerama installed])
              ac_have_xinerama="yes"],,
             [$X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS])
dnl AM_CONDITIONAL(HAVE_XINERAMA, test x$ac_have_xinerama = "xyes")

 
dnl ---------------------------------------------
dnl Checks for Ascii-Art library
dnl ---------------------------------------------

AM_PATH_AALIB(1.4,, AC_MSG_RESULT([*** All of AALIB dependent parts will be disabled ***]))
AM_CONDITIONAL(HAVE_AA, test x$no_aalib != "xyes")


dnl ---------------------------------------------
dnl Checks for Color AsCii Art library
dnl ---------------------------------------------

AM_PATH_CACA(0.3,, AC_MSG_RESULT([*** All CACA-dependent parts will be disabled ***]))
AM_CONDITIONAL(HAVE_CACA, test x$no_caca != "xyes")


dnl ---------------------------------------------
dnl Check solaris framebuffer device support
dnl ---------------------------------------------

AC_CHECK_HEADER(sys/fbio.h, ac_have_sunfb=yes,)
AM_CONDITIONAL(HAVE_SUNFB, [test x"$ac_have_sunfb" = "xyes"])


dnl ---------------------------------------------
dnl Check for Sun DGA
dnl ---------------------------------------------

saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I/usr/openwin/include"
AC_CHECK_LIB(dga, XDgaGrabDrawable, [
	AC_CHECK_HEADER(dga/dga.h, [
	        SUNDGA_CFLAGS="-I/usr/openwin/include"
		SUNDGA_LIBS="-L/usr/openwin/lib -ldga"
		ac_have_sundga=yes
	], )
], , "-L/usr/openwin/lib")
CPPFLAGS="$saved_CFLAGS"
AM_CONDITIONAL(HAVE_SUNDGA, [test x"$ac_have_sundga" = "xyes"])
AC_SUBST(SUNDGA_CFLAGS)
AC_SUBST(SUNDGA_LIBS)


dnl ---------------------------------------------
dnl Check linux framebuffer device support
dnl ---------------------------------------------

AC_CHECK_HEADER(linux/fb.h,
                [AC_DEFINE(HAVE_FB,1,[Define this if you have linux framebuffer support])
                 have_fb=yes],)
AC_ARG_ENABLE(fb, AC_HELP_STRING([--disable-fb], [do not build linux framebuffer support]),
	      have_fb=$enableval)
AM_CONDITIONAL(HAVE_FB, [test x"$have_fb" = "xyes"])


dnl ---------------------------------------------
dnl Find pkg-config
dnl ---------------------------------------------

AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test x$PKG_CONFIG = xno ; then
  echo "*** pkg-config not found. See http://pkgconfig.sourceforge.net"
  echo "*** All of DIRECTFB dependent parts will be disabled"
else


dnl ---------------------------------------------
dnl Check for DirectFB
dnl ---------------------------------------------
AC_ARG_ENABLE(directfb,
	AC_HELP_STRING([--enable-directfb], [enable use of DirectFB]),
		enable_directfb=$enableval,
		enable_directfb=no)

  DIRECTFB_REQUIRED_VERSION=0.9.9
if test x$enable_directfb = "xyes"; then
  AC_MSG_CHECKING(for DirectFB)
  if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb ; then
        AC_MSG_RESULT(found)
        DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
        DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
        have_directfb="yes"
  else
    AC_MSG_RESULT([*** All of DIRECTFB dependent parts will be disabled ***])
  fi
fi
fi

AC_SUBST(DIRECTFB_CFLAGS)
AC_SUBST(DIRECTFB_LIBS)
AM_CONDITIONAL(HAVE_DIRECTFB, test x$have_directfb = "xyes" )


dnl ---------------------------------------------
dnl check for SDL
dnl ---------------------------------------------

AM_PATH_SDL(1.1.5, 
	AC_DEFINE(HAVE_SDL,1,[Define this if you have SDL library installed]),
	[])
AM_CONDITIONAL(HAVE_SDL, [test x"$no_sdl" != x"yes"])


dnl ---------------------------------------------
dnl check for Libstk
dnl ---------------------------------------------

AC_MSG_CHECKING(for Libstk)
dnl do some actual testing here
if test x$PKG_CONFIG = xno ; then
  AC_MSG_RESULT(no)
  echo "*** pkg-config not found. See http://pkgconfig.sourceforge.net"
  echo "*** All of LIBSTK dependent parts will be disabled"
else
    LIBSTK_REQUIRED_VERSION=0.2.0
    if $PKG_CONFIG --atleast-version $LIBSTK_REQUIRED_VERSION libstk ; then
        LIBSTK_CFLAGS=`$PKG_CONFIG --cflags libstk`
        LIBSTK_LIBS=`$PKG_CONFIG --libs libstk`
        have_stk="yes"
        AC_MSG_RESULT(yes)
    else
        AC_MSG_RESULT(no)
        AC_MSG_RESULT([*** All of Libstk dependent parts will be disabled ***])
    fi
fi
AC_SUBST(LIBSTK_CFLAGS)
AC_SUBST(LIBSTK_LIBS)
AM_CONDITIONAL(HAVE_STK, [test x"$have_stk" = x"yes"])


dnl ---------------------------------------------
dnl check for DirectX
dnl ---------------------------------------------
AC_MSG_CHECKING(for DirectX)
DIRECTX_VIDEO_LIBS="$DIRECTX_LIBS -lgdi32 -lddraw"
DIRECTX_AUDIO_LIBS="$DIRECTX_LIBS -ldsound"
AC_LANG_SAVE()
AC_LANG_C()
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
LIBS="$LIBS  $DIRECTX_VIDEO_LIBS $DIRECTX_AUDIO_LIBS"
AC_COMPILE_IFELSE(
  [
#include <stddef.h>

#include <windows.h>
#include <ddraw.h>
#include <dsound.h>

int main() {
  DirectDrawCreate(0, NULL, 0);
  DirectsoundCreate(0, NULL, 0);
  
  return 0;
}
  ],
  [have_directx=yes
   AC_DEFINE(HAVE_DIRECTX,1,[Define this if you have DirectX])],,)
CFLAGS=$ac_save_CFLAGS
LIBS=$ac_save_LIBS
AC_LANG_RESTORE()

if test x$have_directx = xyes ; then
  AC_MSG_RESULT(yes)
else
  AC_MSG_RESULT(no)
  AC_MSG_RESULT(*** All DirectX dependent parts will be disabled ***)
fi

AC_SUBST(DIRECTX_CFLAGS)
AC_SUBST(DIRECTX_AUDIO_LIBS)
AC_SUBST(DIRECTX_VIDEO_LIBS)
AM_CONDITIONAL(HAVE_DIRECTX, test x$have_directx = "xyes" )


dnl ---------------------------------------------
dnl dxr3 / hollywood plus card
dnl ---------------------------------------------

case "$host_or_hostalias" in
  *-linux*)
    AC_CHECK_DXR3()
    if test x"$have_libfame" = "xyes" ; then
      AC_DEFINE_UNQUOTED(HAVE_LIBFAME,1,[Define this if you have libfame mpeg encoder installed (fame.sf.net)])
      AM_PATH_LIBFAME(0.8.10, 
        AC_DEFINE(HAVE_NEW_LIBFAME,1,[Define this if you have libfame 0.8.10 or above]))
    fi
    if test x"$have_librte" = "xyes" ; then
      AC_DEFINE_UNQUOTED(HAVE_LIBRTE,1,[Define this if you have librte mpeg encoder installed (zapping.sf.net)])
    fi
    ;;
  *)
    have_dxr3="no"
    have_libfame="no"
    have_librte="no"
    have_encoder="no"
    ;;
esac
AM_CONDITIONAL(HAVE_DXR3, test x"$have_dxr3" = "xyes")
AM_CONDITIONAL(HAVE_LIBFAME, test x"$have_libfame" = "xyes")
AM_CONDITIONAL(HAVE_LIBRTE, test x"$have_librte" = "xyes")


dnl ---------------------------------------------
dnl Vidix/libdha
dnl ---------------------------------------------

AC_LINUX_PATH(/usr/src/linux)
AC_SUBST([LINUX_INCLUDE])

AC_ARG_ENABLE(vidix, AC_HELP_STRING([--disable-vidix], [do not build vidix support]),
	      check_vidix=$enableval, check_vidix=yes)
AC_ARG_ENABLE(dha-kmod, AC_HELP_STRING([--enable-dha-kmod], [build DHA kernel module]),
	      enable_dha_kmod=$enableval,enable_dha_kmod=no)

enable_vidix="no"

AC_MSG_CHECKING(for vidix support)
if test x"$check_vidix" = "xyes" -a x"$ac_cv_prog_AWK" != "xno"; then
  if test x"$no_x" != "xyes" -o x"$have_fb" = "xyes"; then
    case "$host_or_hostalias" in
      i?86-*-linux* | k?-*-linux* | athlon-*-linux*)
        enable_vidix="yes"
        enable_linux="yes"
        ;;
      i386-*-freebsd*)
        enable_vidix="yes"
        enable_dha_kmod="no"
        ;;
      *)
        enable_dha_kmod="no"
        enable_vidix="no"
        ;;
    esac
  fi
fi
AC_MSG_RESULT($enable_vidix)

AC_MSG_CHECKING(for DHA linux kernel module build)
if test x"$enable_dha_kmod" = "xyes"; then
  AC_MSG_RESULT(yes)
else
  AC_MSG_RESULT(no)
fi

AM_CONDITIONAL(HAVE_VIDIX, test x"$enable_vidix" = "xyes")
AM_CONDITIONAL(HAVE_LINUX, test x"$enable_linux" = "xyes")
AM_CONDITIONAL(BUILD_DHA_KMOD, test x"$enable_dha_kmod" = "xyes")
AC_CHECK_PROG(MKNOD, mknod, mknod, no)
AC_CHECK_PROG(DEPMOD, depmod, depmod, no, $PATH:/sbin)


dnl ---------------------------------------------
dnl Ogg/Vorbis libs.
dnl ---------------------------------------------

AM_PATH_OGG(
           [ AM_PATH_VORBIS([], 
	                    AC_MSG_RESULT([*** All OGG/VORBIS dependent parts will be disabled ***])) 
	   ], 
           AC_MSG_RESULT([*** All of OGG/VORBIS dependent parts will be disabled ***]))
AM_CONDITIONAL(HAVE_VORBIS, [test x"$no_ogg" != "xyes" -a x"$no_vorbis" != "xyes"])


dnl ---------------------------------------------
dnl Ogg/Theora libs.
dnl ---------------------------------------------

AM_PATH_OGG(
           [ AM_PATH_THEORA(AC_DEFINE(HAVE_THEORA,1,[Define this if you have theora]),
                           AC_MSG_RESULT([*** All OGG/THEORA dependent parts will be disabled ***]))
          ],
           AC_MSG_RESULT([*** All of OGG/Theora dependent parts will be disabled ***]))
AM_CONDITIONAL(HAVE_THEORA, [test x"$no_ogg" != "xyes" -a x"$no_theora" != "xyes"])


dnl ---------------------------------------------
dnl Ogg/Speex libs.
dnl ---------------------------------------------

AM_PATH_OGG(
           [ AM_PATH_SPEEX(AC_DEFINE(HAVE_SPEEX,1,[Define this if you have speex]),
                           AC_MSG_RESULT([*** All OGG/SPEEX dependent parts will be disabled ***]))
          ],
           AC_MSG_RESULT([*** All of OGG/Speex dependent parts will be disabled ***]))
AM_CONDITIONAL(HAVE_SPEEX, [test x"$no_ogg" != "xyes" -a x"$no_speex" != "xyes"])


dnl ---------------------------------------------
dnl check for libFLAC
dnl ---------------------------------------------

AM_PATH_LIBFLAC([],
	AC_MSG_RESULT([*** All FLAC dependent parts will be disabled ***]))
AM_CONDITIONAL(HAVE_FLAC, [test x"$no_libFLAC" != "xyes"])


dnl ---------------------------------------------
dnl MNG libs.
dnl ---------------------------------------------

AC_CHECK_LIB(mng, mng_initialize,
	[ AC_CHECK_HEADER(libmng.h,
		[ have_libmng=yes
		  MNG_LIBS="-lmng" ], 
		AC_MSG_RESULT([*** All libmng dependent parts will be disabled ***]))],
	AC_MSG_RESULT([*** All libmng dependent parts will be disabled ***]))
AM_CONDITIONAL(HAVE_LIBMNG, test x"$have_libmng" = "xyes")
AC_SUBST(MNG_LIBS)


dnl ---------------------------------------------
dnl PNG lib.
dnl ---------------------------------------------

AC_PATH_PROG(LIBPNG_CONFIG, libpng-config, no)
if test "$LIBPNG_CONFIG" = "no" ; then
  AC_CHECK_LIB(png, png_create_read_struct,
		  have_libpng=yes
		  PNG_LIBS="-lpng",
  AC_MSG_RESULT([*** All libpng dependent parts will be disabled ***]))
else
  PNG_CFLAGS=`$LIBPNG_CONFIG --cflags`
  PNG_LIBS=`$LIBPNG_CONFIG --libs`
  have_libpng="yes"
  AC_DEFINE(HAVE_LIBPNG,1,[Define this if you have png library])
fi

AM_CONDITIONAL(HAVE_LIBPNG, test x"$have_libpng" = "xyes" )
AC_SUBST(PNG_CFLAGS)
AC_SUBST(PNG_LIBS)


dnl ---------------------------------------------
dnl freetype2 lib.
dnl ---------------------------------------------

AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
if test "$FREETYPE_CONFIG" = "no" ; then
  AC_MSG_RESULT([*** freetype-config not found, freetype2 support disabled ***])
else
  FT2_CFLAGS=`$FREETYPE_CONFIG --cflags`
  FT2_LIBS=`$FREETYPE_CONFIG --libs`
  have_ft2="yes"
  AC_DEFINE(HAVE_FT2,1,[Define this if you have freetype2 library])
fi

dnl AM_CONDITIONAL(HAVE_FT2, test x"$have_ft2" = "xyes" )
AC_SUBST(FT2_CFLAGS)
AC_SUBST(FT2_LIBS)


dnl ---------------------------------------------
dnl OSS style audio interface
dnl ---------------------------------------------

AC_MSG_CHECKING(for OSS audio support)
have_ossaudio=no
AC_TRY_COMPILE([
	    #ifdef __NetBSD__
	    #include <soundcard.h>
	    #else
	    #include <sys/soundcard.h>
	    #endif
	],[
	    int arg = SNDCTL_DSP_SETFRAGMENT;
	],[
	    have_ossaudio=yes
	])
AC_MSG_RESULT($have_ossaudio)
AM_CONDITIONAL(HAVE_OSS, test x"$have_ossaudio" = "xyes")


dnl ---------------------------------------------
dnl Alsa support
dnl ---------------------------------------------

AM_PATH_ALSA(0.9.0rc4, 
        [ AC_DEFINE(HAVE_ALSA,1,[Define this if you have Alsa (libasound) installed])
          if test x"$have_alsa09" = "xyes"; then
            AC_DEFINE(HAVE_ALSA09,1,[Define this if you have alsa 0.9.x and more installed])
          fi
        ],
	AC_MSG_RESULT(*** All of ALSA dependent parts will be disabled ***))
AM_CONDITIONAL(HAVE_ALSA, test x"$no_alsa" != "xyes")
AM_CONDITIONAL(HAVE_ALSA09, test x"$have_alsa09" = "xyes")


dnl ---------------------------------------------
dnl ESD support
dnl ---------------------------------------------

AM_PATH_ESD(0.2.8,
        AC_DEFINE(HAVE_ESD,1,[Define this if you have ESD (libesd) installed]),
        AC_MSG_RESULT(*** All of ESD dependent parts will be disabled ***))
AM_CONDITIONAL(HAVE_ESD, test x"$no_esd" != "xyes")


dnl ---------------------------------------------
dnl ARTS support
dnl ---------------------------------------------

AM_PATH_ARTS(0.9.5,
        AC_DEFINE(HAVE_ARTS,1,[Define this if you have ARTS (libartsc) installed]),
        AC_MSG_RESULT(*** All of ARTS dependent parts will be disabled ***))
AM_CONDITIONAL(HAVE_ARTS, test x"$no_arts" != "xyes")


dnl ---------------------------------------------
dnl gnome-vfs support
dnl ---------------------------------------------

PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0,
                no_gnome_vfs=no,
		no_gnome_vfs=yes)
AC_SUBST(GNOME_VFS_CFLAGS)
AC_SUBST(GNOME_VFS_LIBS)
if test x"$no_gnome_vfs" != "xyes"; then
AC_DEFINE(HAVE_GNOME_VFS,1,[Define this if you have gnome-vfs installed])
else
AC_MSG_RESULT(*** All of the gnome-vfs dependent parts will be disabled ***)
fi
AM_CONDITIONAL(HAVE_GNOME_VFS, test x"$no_gnome_vfs" != "xyes")


dnl ---------------------------------------------
dnl SUN style audio interface
dnl ---------------------------------------------

AC_MSG_CHECKING(for Sun audio support)
have_sunaudio=no
AC_TRY_COMPILE([
	    #include <sys/types.h>
	    #include <sys/audioio.h>
	],[
	    audio_info_t audio_info;
	    AUDIO_INITINFO(&audio_info);
	],[
	    have_sunaudio=yes
	])
AC_MSG_RESULT($have_sunaudio)
AM_CONDITIONAL(HAVE_SUNAUDIO, test x"$have_sunaudio" = "xyes")


dnl ---------------------------------------------
dnl IRIX style audio interface
dnl ---------------------------------------------

AM_CHECK_IRIXAL([AC_DEFINE(HAVE_IRIXAL,1,
			[Define this if you have a usable IRIX al interface available])],
	[AC_MSG_RESULT([*** All of IRIX AL dependent parts will be disabled ***])])
AM_CONDITIONAL(HAVE_IRIXAL, [test "x$am_cv_have_irixal" = xyes])


dnl ---------------------------------------------
dnl Solaris kstat kernel statistics
dnl ---------------------------------------------

AC_CHECK_LIB(kstat, kstat_open,
	[KSTAT_LIBS=-lkstat
	 AC_DEFINE(HAVE_KSTAT,1,[Define this if you have kernel statistics available via kstat interface])])
AC_SUBST(KSTAT_LIBS)


dnl ---------------------------------------------
dnl cdrom ioctls
dnl ---------------------------------------------

AC_CHECK_HEADERS(sys/cdio.h linux/cdrom.h)
AM_CHECK_CDROM_IOCTLS(
	[AC_DEFINE(HAVE_CDROM_IOCTLS,1,[Define this if you have CDROM ioctls])],
	[AC_MSG_RESULT([*** DVD and (S)VCD support will be disabled ***])])
AM_CONDITIONAL(HAVE_CDROM_IOCTLS, [test x"$have_cdrom_ioctls" = "xyes"])


dnl ---------------------------------------------
dnl check for a usable version of libdvdnav
dnl ---------------------------------------------

AC_ARG_WITH(external-dvdnav, AC_HELP_STRING([--with-external-dvdnav], [use external dvdnav library (not recommended)]),
            [external_dvdnav="$withval"], [no_dvdnav="yes"; external_dvdnav="no"])

if test x"$external_dvdnav" = "xyes"; then
  AM_PATH_DVDNAV(0.1.9,
	  AC_DEFINE(HAVE_DVDNAV,1,[Define this if you have a suitable version of libdvdnav]),
	  [AC_MSG_RESULT([*** no usable version of libdvdnav found, using internal copy ***])])
else
  AC_MSG_RESULT([Use included DVDNAV support])
fi

AM_CONDITIONAL(HAVE_DVDNAV, [test x"$no_dvdnav" != "xyes"])


dnl ---------------------------------------------
dnl Video CD
dnl ---------------------------------------------

AC_ARG_ENABLE(vcd, AC_HELP_STRING([--disable-vcd], [do not compile VCD plugin]),
              enable_vcd=$enableval, enable_vcd=yes)

dnl Force build of both vcd plugins, for now.
dnl AC_ARG_ENABLE(vcdo, AC_HELP_STRING([--disable-vcdo], [do not compile old VCD plugin]),
dnl               enable_vcdo=$enableval, enable_vcdo=yes)
dnl
enable_vcdo="yes"

AC_ARG_WITH(internal-vcdlibs, AC_HELP_STRING([--with-internal-vcdlibs], [force using internal libcdio/libvcd/libvcdinfo]),
            [internal_vcdnav="$withval"], [internal_vcdnav="no"])

if test x"$enable_vcd" = "xyes"; then
  dnl empty_array_size
  AC_MSG_CHECKING([how to create empty arrays])

  empty_array_size="xxx"
  AC_TRY_COMPILE([],[struct { int foo; int bar[]; } doo;], empty_array_size="")

  if test "x$empty_array_size" = "xxxx";then
   AC_TRY_COMPILE([],[struct { int foo; int bar[0]; } doo;], empty_array_size="0")
  fi

  if test "x$empty_array_size" = "xxxx"
  then
    AC_MSG_ERROR([compiler is unable to creaty empty arrays])
  else
    AC_DEFINE_UNQUOTED(EMPTY_ARRAY_SIZE, $empty_array_size, 
	   [what to put between the brackets for empty arrays])
    changequote(`,')
    msg="[${empty_array_size}]"
    changequote([,])
  AC_MSG_RESULT($msg)
  fi
  dnl empty_array_size

  if test x"$internal_vcdnav" = "xno" && test x"$PKG_CONFIG" != "xno" ; then
    AC_MSG_CHECKING(for libcdio)
    if $PKG_CONFIG --atleast-version 0.64 libcdio; then
      AC_MSG_RESULT(found)
      LIBCDIO_CFLAGS=`$PKG_CONFIG --cflags libcdio`
      LIBCDIO_LIBS=`$PKG_CONFIG --libs libcdio`

      AC_MSG_CHECKING(for libvcdinfo)
      if $PKG_CONFIG --atleast-version 0.7.19-cdio libvcdinfo; then
        AC_MSG_RESULT(found)
        LIBVCDINFO_CFLAGS=`$PKG_CONFIG --cflags libvcdinfo`
        LIBVCDINFO_LIBS=`$PKG_CONFIG --libs libvcdinfo`
	  AC_DEFINE(HAVE_VCDNAV,1,[Define this if you have a suitable version of libcdio/libvcd])
      else
        AC_MSG_RESULT([Use included libcdio/libvcdinfo support])
	internal_vcdnav="yes"
      fi

    else
      AC_MSG_RESULT([Use included libcdio/libvcdinfo support])
      internal_vcdnav="yes"
    fi
  else
    AC_MSG_RESULT([Use included libcdio/libvcdinfo support])
    internal_vcdnav="yes"
  fi

  dnl check twice, fallback is internal copy
  if test x"$internal_vcdnav" = "xyes"; then
    AC_DEFINE_UNQUOTED(HOST_ARCH, "$host_os/$host_cpu", [host os/cpu identifier])
    AC_CHECK_FUNCS(snprintf vsnprintf, , [AC_MSG_ERROR(required function not found)])

    AC_DEFINE(_DEVELOPMENT_, [], enable warnings about being development release)
    AC_DEFINE(_GNU_SOURCE, [], enable GNU libc extension)
    AC_STDC_HEADERS
    AC_CHECK_HEADERS(sys/stat.h stdint.h glob.h inttypes.h stdbool.h)

    if test "x$ac_cv_header_stdint_h" != "xyes" 
     then
       AC_CHECK_SIZEOF(int, 4)
       AC_CHECK_SIZEOF(long, 4)
       AC_CHECK_SIZEOF(long long, 8)
    fi

    dnl ISOC99_PRAGMA
    AC_MSG_CHECKING([whether $CC supports ISOC99 _Pragma()])
    AC_TRY_COMPILE([],[_Pragma("pack(1)")], [
      ISOC99_PRAGMA=yes 
      AC_DEFINE(HAVE_ISOC99_PRAGMA, [], [Supports ISO _Pragma() macro])
    ],ISOC99_PRAGMA=no)
    AC_MSG_RESULT($ISOC99_PRAGMA)

    dnl bitfield order
    AC_MSG_CHECKING(bitfield ordering in structs)
    AC_TRY_RUN([
int
 main() {
  struct { char bit_0:1, bit_12:2, bit_345:3, bit_67:2; }
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
  __attribute__((packed))
#endif
  bf = { 1,1,1,1 };
  if (sizeof (bf) != 1) return 1;
  return *((unsigned char*) &bf) != 0x4b; }
], bf_lsbf=1, AC_TRY_RUN([ 
int
main() {
  struct { char bit_0:1, bit_12:2, bit_345:3, bit_67:2; }
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
  __attribute__((packed))
#endif
  bf = { 1,1,1,1 };
  if (sizeof (bf) != 1) return 1;
  return *((unsigned char*) &bf) != 0xa5; }
], bf_lsbf=0, AC_MSG_ERROR([unsupported bitfield ordering])))
    if test "x$bf_lsbf" = "x1"; then
     AC_MSG_RESULT(LSBF)
     AC_DEFINE(BITFIELD_LSBF, [], [compiler does lsbf in struct bitfields])
    else
     AC_MSG_RESULT(MSBF)
    fi

    AC_HAVE_HEADERS( errno.h fcntl.h \
		     stdbool.h  stdlib.h stdint.h stdio.h string.h \
		     strings.h linux/version.h sys/cdio.h sys/stat.h \
		     sys/types.h )

    LIBCDIO_CFLAGS='-I$(top_srcdir)/src/input/vcd/libcdio'
    LIBCDIO_LIBS='$(top_builddir)/src/input/vcd/libcdio/libcdio.la'
    LIBISO9660_LIBS='$(top_builddir)/src/input/vcd/libcdio/libiso9660.la'
    LIBVCD_CFLAGS='-I$(top_srcdir)/src/input/vcd/libvcd'
    LIBVCD_LIBS='$(top_builddir)/src/input/vcd/libvcd/libvcd.la'
    LIBVCDINFO_LIBS='$(top_builddir)/src/input/vcd/libvcd/libvcdinfo.la'

    case $host_os in
         darwin6*)
           AC_CHECK_HEADERS(IOKit/IOKitLib.h CoreFoundation/CFBase.h, 
                            [have_iokit_h="yes"])
           if test "x$have_iokit_h" = "xyes" ; then 
             AC_DEFINE([HAVE_DARWIN_CDROM], [1],
	          [Define 1 if you have Darwin OS X-type CD-ROM support])
           fi
         ;;
         linux*)
            AC_CHECK_HEADERS(linux/version.h)
            AC_CHECK_HEADERS(linux/cdrom.h, [have_linux_cdrom_h="yes"])
	    if test "x$have_linux_cdrom_h" = "xyes" ; then
	       AC_TRY_COMPILE(,[
#include <linux/cdrom.h>
struct cdrom_generic_command test;
int has_timeout=sizeof(test.timeout);],
                [AC_DEFINE([HAVE_LINUX_CDROM_TIMEOUT], [1], 
                       [Define 1 if timeout is in cdrom_generic_command struct])])
	       AC_DEFINE([HAVE_LINUX_CDROM], [1], 
                       [Define 1 if you have Linux-type CD-ROM support])
	    fi
	 ;;
         bsdi*)
            AC_CHECK_HEADERS(dvd.h, [have_bsdi_dvd_h="yes"])
	    if test "x$have_bsdi_dvd_h" = "xyes" ; then
     	      AC_DEFINE([HAVE_BSDI_CDROM], [1], 
                        [Define 1 if you have BSDI-type CD-ROM support])
	    fi
	 ;;
         sunos*|sun*|solaris*)
            AC_CHECK_HEADERS(sys/cdio.h)
     	    AC_DEFINE([HAVE_SOLARIS_CDROM], [1], 
                      [Define 1 if you have Solaris CD-ROM support])
	 ;;
         cygwin*)
	    AC_DEFINE([CYGWIN], [1], 
                      [Define 1 if you are compiling using cygwin])
     	    AC_DEFINE([HAVE_WIN32_CDROM], [1], 
                      [Define 1 if you have MinGW CD-ROM support])
	    LIBCDIO_LIBS="$LIBCDIO_LIBS -lwinmm"
	    LIBVCD_LIBS="$LIBVCD_LIBS -lwinmm"
	 ;;
         mingw*)
	    AC_DEFINE([MINGW32], [1], 
                      [Define 1 if you are compiling using MinGW])
     	    AC_DEFINE([HAVE_WIN32_CDROM], [1], 
                      [Define 1 if you have MinGW CD-ROM support])
	 ;;
         freebsd4.*)
     	    AC_DEFINE([HAVE_FREEBSD_CDROM], [1], 
                      [Define 1 if you have FreeBSD CD-ROM support])
	 ;;
         *)
	    AC_MSG_WARN(Don't have OS CD-reading support for ${host_os}...)
	    AC_MSG_WARN(Will use generic support.)
	 ;;
    esac
    AC_SUBST(LINUX_CDROM_TIMEOUT)
    AC_SUBST(HAVE_BSDI_CDROM)
    AC_SUBST(HAVE_DARWIN_CDROM)
    AC_SUBST(HAVE_FREEBSD_CDROM)
    AC_SUBST(HAVE_LINUX_CDROM)
    AC_SUBST(HAVE_SOLARIS_CDROM)
    AC_SUBST(HAVE_WIN32_CDROM)
    AC_SUBST(LINUX_CDROM_TIMEOUT)
    AC_SUBST(LIBVCD_SYSDEP)

    AC_CHECK_FUNCS( bzero memcpy )

    AC_CHECK_MEMBER([struct tm.tm_gmtoff],
                    [AC_DEFINE(HAVE_TM_GMTOFF, 1,
                           [Define if struct tm has the tm_gmtoff member.])],
                     ,
                     [#include <time.h>])
  fi
fi

AC_SUBST(LIBCDIO_CFLAGS)
AC_SUBST(LIBCDIO_LIBS)
AC_SUBST(LIBISO9660_LIBS)
AC_SUBST(LIBVCD_CFLAGS)
AC_SUBST(LIBVCD_LIBS)
AC_SUBST(LIBVCDINFO_LIBS)
AM_CONDITIONAL(HAVE_VCDNAV, [test x"$internal_vcdnav" = "xno"])
AM_CONDITIONAL(ENABLE_VCD, [test x"$enable_vcd" = "xyes"])


dnl ---------------------------------------------
dnl ASF build can be optional
dnl ---------------------------------------------

AC_ARG_ENABLE(asf, AC_HELP_STRING([--disable-asf], [do not build ASF demuxer]),
	      enable_asf=$enableval, enable_asf=yes)
AM_CONDITIONAL(BUILD_ASF, test x"$enable_asf" = "xyes")


dnl ---------------------------------------------
dnl FAAD build can be optional
dnl ---------------------------------------------

AC_ARG_ENABLE(faad, AC_HELP_STRING([--disable-faad], [do not build FAAD decoder]),
	      enable_faad=$enableval, enable_faad=yes)
AM_CONDITIONAL(BUILD_FAAD, test x"$enable_faad" = "xyes")


dnl ---------------------------------------------
dnl libmodplug support 
dnl ---------------------------------------------
if test x$PKG_CONFIG = xno ; then
  echo "*** pkg-config not found. See http://pkgconfig.sourceforge.net"
  echo "*** All of MODPLUG dependent parts will be disabled"
else
    LIBMODPLUG_REQUIRED_VERSION=0.7
    if $PKG_CONFIG --atleast-version $LIBMODPLUG_REQUIRED_VERSION libmodplug ; then
        LIBMODPLUG_CFLAGS=`$PKG_CONFIG --cflags libmodplug`
        LIBMODPLUG_LIBS=`$PKG_CONFIG --libs libmodplug`
        AC_DEFINE(HAVE_MODPLUG,1,[define this if you have libmodplug installed])
        have_modplug="yes"
    else
        AC_MSG_RESULT([*** All of MODPLUG dependent parts will be disabled ***])
    fi
fi
AC_SUBST(LIBMODPLUG_CFLAGS)
AC_SUBST(LIBMODPLUG_LIBS)
dnl AM_CONDITIONAL(HAVE_MODPLUG, [test x"$have_modplug" = x"yes"])


dnl ---------------------------------------------
dnl ip_mreqn
dnl ---------------------------------------------

AC_CHECK_IP_MREQN
if test x"$have_ip_mreqn" = "xyes"; then
  AC_DEFINE(HAVE_IP_MREQN,1,[Define this if you have ip_mreqn in netinet/in.h])
fi


dnl ---------------------------------------------
dnl Using or not using -fPIC (override default behavior - system dependent)
dnl ---------------------------------------------

AC_ARG_ENABLE(fpic, AC_HELP_STRING([--disable-fpic], [disable -fPIC on shared libs (default on x86)]),
   enable_fpic=$enableval)


dnl ---------------------------------------------
dnl Build xine plugins with only the "xine_plugin_info" symbol exported
dnl (let the user disable this feature, in case libtool does not offer this
dnl feature on the target platform)
dnl ---------------------------------------------

AC_ARG_ENABLE(min-symtab,
   AC_HELP_STRING([--disable-min-symtab], [export all global symbols from xine plugins]),
   [
     if test "x$enableval" = "xno" ; then
       XINE_PLUGIN_MIN_SYMS=""
     else
       XINE_PLUGIN_MIN_SYMS="-export-symbols-regex xine_plugin_info"
     fi
   ],
   XINE_PLUGIN_MIN_SYMS="-export-symbols-regex xine_plugin_info")

if test "$with_gnu_ld" = yes; then
   dnl
   dnl -export-symbols-regex in libtool 1.4.X is broken, when GNU ld is
   dnl used for linking.  libtool / gnu ld does not touch the dynamic
   dnl symbol table, but removes the unwanted symbols from the
   dnl symbol table => The debug versions of the the xine-lib plugins
   dnl cannot be debugged.
   dnl
   dnl Don't use libtool's -export-symbols-regex on such a platform for now
   dnl
   XINE_PLUGIN_MIN_SYMS=""
fi

AC_SUBST(XINE_PLUGIN_MIN_SYMS)


dnl ---------------------------------------------
dnl Some extra checks.
dnl ---------------------------------------------

AC_CHECK_LIB(posix4, sched_get_priority_min)
AC_CHECK_FUNCS([vsscanf sigaction sigset getpwuid_r nanosleep strsep strpbrk setenv basename])
AC_FUNC_FSEEKO
AC_CHECK_HEADERS(byteswap.h malloc.h execinfo.h ucontext.h sys/mman.h sys/mixer.h libgen.h)


if test "$GCC" = yes; then
    dnl
    dnl check cflags not supported by all gcc versions
    dnl eg: -mpreferred-stack-boundary=2 and 2.91.66,
    dnl and gcc-2.7.2.3 support a bit less options
    dnl
    AC_TRY_CFLAGS("-mpreferred-stack-boundary=2", 
	m_psb="-mpreferred-stack-boundary=2", m_psb="")
    AC_TRY_CFLAGS("-fno-strict-aliasing", f_nsa="-fno-strict-aliasing", f_nsa="")
    AC_TRY_CFLAGS("-fschedule-insns2", f_si="-fschedule-insns2", f_si="")
    AC_TRY_CFLAGS("-mwide-multiply", m_wm="-mwide-multiply", m_wm="")
    dnl
    dnl gcc 3.1 uses the -f version
    dnl
    AC_TRY_CFLAGS("-falign-functions=4", f_af="-falign-functions=4",
        f_af="-malign-functions=4")
    AC_TRY_CFLAGS("-falign-loops=4", f_al="-falign-loops=4",
        f_al="-malign-loops=4")
    AC_TRY_CFLAGS("-falign-jumps=4", f_aj="-falign-jumps=4",
        f_aj="-malign-jumps=4")
    dnl
    dnl Check for some optimization disabling
    dnl needed for win32 code
    dnl
    AC_TRY_CFLAGS("-fno-omit-frame-pointer", W32_NO_OPTIMIZE="$W32_NO_OPTIMIZE -fno-omit-frame-pointer",)
    AC_TRY_CFLAGS("-fno-inline-functions", W32_NO_OPTIMIZE="$W32_NO_OPTIMIZE -fno-inline-functions",)
    AC_TRY_CFLAGS("-fno-rename-registers", W32_NO_OPTIMIZE="$W32_NO_OPTIMIZE -fno-rename-registers",)
    AC_SUBST(W32_NO_OPTIMIZE)
    dnl
    dnl Multipass compilation
    dnl
    AC_TRY_CFLAGS("-fprofile-arcs", PASS1_CFLAGS="-fprofile_arcs $PASS1_CFLAGS",)
    AC_TRY_CFLAGS("-fbranch-probabilities", PASS2_CFLAGS="-fbranch-probabilities $PASS2_CFLAGS",)
    AC_SUBST(PASS1_CFLAGS)
    AC_SUBST(PASS2_CFLAGS)
    dnl
    dnl Warnings
    dnl
    CFLAGS="-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes $CFLAGS"
    CFLAGS="-Wnested-externs -Wcast-align $CFLAGS"
    dnl some combinations of gcc+glibc produce useless warnings on memset
    dnl when compiling with -Wpointer-arith, so we check for this first
    AC_MSG_CHECKING(for sane -Wpointer-arith)
    SAVE_CFLAGS="$CFLAGS"
    CFLAGS="-O2 -Wpointer-arith -Werror $CFLAGS"
    AC_TRY_COMPILE([#include <string.h>],[int a; memset(&a, 0, sizeof(int));],
	[AC_MSG_RESULT(yes); CFLAGS="-Wpointer-arith $SAVE_CFLAGS"],
	[AC_MSG_RESULT(no);  CFLAGS="$SAVE_CFLAGS"]);
fi

dnl Flags not supported by all *cc* variants
AC_TRY_CFLAGS("-Wall", wall="-Wall", wall="")

dnl check for __attribute__ ((aligned ()))
dnl WARNING! Do not move this check behind the $(MULTIPASS_CFLAGS)!
dnl (the alignment test macro does not like variables in the CFLAGS)
AC_C_ATTRIBUTE_ALIGNED

dnl Common cflags for all platforms
CFLAGS="$wall -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE \$(MULTIPASS_CFLAGS) $CFLAGS"
DEBUG_CFLAGS="$wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE $DEBUG_CFLAGS"

enable_w32dll="no"
enable_ffmmx="no"
enable_armv4l="no"

case "$host_or_hostalias" in
  i386-*-freebsd*)
    CFLAGS="-pipe -fomit-frame-pointer $f_af $f_al $f_aj $m_wm $m_psb -fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -finline-functions $CFLAGS"
    DEBUG_CFLAGS="$X_CFLAGS $DEBUG_CFLAGS"
    AC_DEFINE(__i386__,1,[Define this if you're running x86 architecture])
    AC_DEFINE_UNQUOTED(ARCH_X86,,[Define this if you're running x86 architecture])
    AC_DEFINE_UNQUOTED(FPM_INTEL,,[Define to select libmad fixed point arithmetic implementation])

    enable_w32dll="yes"
    enable_ffmmx="yes"
    no_fpic="yes"
    ;;



  i?86-*-linux* | i386-*-solaris* | i?86-* | k?-* | athlon-* | pentium*)
    if test "$GCC" = yes -o "${CC##*/}x" = "iccx" ; then

      if test "$GCC" = yes ; then
	dnl Check for gcc cpu optimization support
	AC_TRY_CFLAGS("-mtune=i386", 
	  sarchopt="-mtune",
  	  AC_TRY_CFLAGS("-mcpu=i386", 
	    sarchopt="-mcpu",
            AC_TRY_CFLAGS("-march=i386", 
	      sarchopt="-march",
	      [ AC_MSG_RESULT(** no cpu optimization supports **)
	        sarchopt=no 
	      ]
            )
          )
        )

	dnl special check for k7 cpu CC support
        AC_TRY_CFLAGS("$sarchopt=athlon", k7cpu="athlon", k7cpu="i686")

	dnl add x86 specific gcc CFLAGS
	CFLAGS="-O3 -pipe -fomit-frame-pointer $f_af $f_al $f_aj $m_wm $m_psb -fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -finline-functions $CFLAGS"

	DEBUG_CFLAGS="-O $DEBUG_CFLAGS"

	if test x"$sarchopt" != "xno"; then
	    [
	    archopt_val=

	    case "$host_or_hostalias" in
	    i386-*) # *BSD return this even on a P III #-))
		archopt_val="i386" ;;
	    i486-*) # oh dear!
		archopt_val="i486" ;;
	    i586-*)
		archopt_val="pentium" 
                ;;
	    pentium-mmx-*)
		archopt_val="pentium-mmx" 
		;;
	    pentiumpro-* | pentium2-* | i686-*)
		archopt_val="pentiumpro"
		if test x"$check_athlon" = "xyes"; then
		    if test -f /proc/cpuinfo; then
			modelname=`cat /proc/cpuinfo | grep "model\ name\	:" | sed -e 's/ //g' | cut -d':' -f2`
			case "$modelname" in
			*Athlon* | *Duron* | *K7*)
			    archopt_val="$k7cpu"
			    ;;
			VIAEzra)
			    archopt_val="c3"
			    ;;
			esac
		    fi 
		fi
		;;
	    k6-2-* | k6-3-*)
		archopt_val="k6-2"
		;;
	    k6-*)
		archopt_val="k6"
		;;
	    pentium3-*)
		archopt_val="pentium3"
		;;
	    pentium4-*)
		archopt_val="pentium4"
		;;
	    athlon-4-* | athlon-xp-* | athlon-mp-*)
		archopt_val="athlon-4"
		;;
	    k7-* | athlon-tbird-* | athlon-*)
		archopt_val="athlon"
		;;
	    
	    esac
	    if test x"$archopt_val" != x; then
		CFLAGS="$sarchopt=$archopt_val $CFLAGS"
		DEBUG_CFLAGS="$sarchopt=$archopt_val $DEBUG_CFLAGS"
	    fi
	    ]
	fi
      else
	dnl we have the Intel compiler
	CFLAGS="-unroll -ipo -ipo_obj -O3 $CFLAGS"
	PASS1_CFLAGS="-prof_genx -prof_dir \$(PWD)/\$(top_builddir)/ $PASS1_CFLAGS"
	PASS2_CFLAGS="-prof_use -prof_dir \$(PWD)/\$(top_builddir)/ $PASS2_CFLAGS"
	AC_SUBST(PASS1_CFLAGS)
	AC_SUBST(PASS2_CFLAGS)
      fi
	
    	dnl enable x86 specific parts of the code
	dnl
	dnl all of this stuff needs gcc/gas; it uses gnu c compiler extensions
	dnl like the extended asm() or __attribute(__cdecl__), or other direct
	dnl mmx/sse/3dnow assembler instructions. 
	dnl
    	AC_DEFINE_UNQUOTED(ARCH_X86,,[Define this if you're running x86 architecture])
	AC_DEFINE(FPM_INTEL,1,[Define to select libmad fixed point arithmetic implementation])
	enable_ffmmx="yes"
	enable_w32dll="yes"

        case "$host_or_hostalias" in
	*-*-cygwin) 
          enable_w32dll="no" 
	  LDFLAGS="-no-undefined @INTLLIBS@ $LDFLAGS"
	  ;;
	esac
    else
	dnl add x86 specific cc CFLAGS
	CFLAGS="-O $CFLAGS"
	DEBUG_CFLAGS="-O $DEBUG_CFLAGS"
    	AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed point arithmetic implementation])
    fi

    no_fpic="yes"
    AC_DEFINE(__i386__,1,[Define this if you're running x86 architecture])
    ;;

  alphaev56-*)
    CFLAGS="-O3 -mcpu=ev56 -mieee $CFLAGS"
    DEBUG_CFLAGS="-O3 -mcpu=ev56 -mieee $DEBUG_CFLAGS"
    AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed point arithmetic implementation])
    ;;

  alpha*)
    CFLAGS="-O3 -mieee $CFLAGS"
    DEBUG_CFLAGS="-O3 -mieee $DEBUG_CFLAGS"
    AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed point arithmetic implementation])
    ;;

  ppc-*-linux* | powerpc-*) 
    CFLAGS="-O3 -pipe -fomit-frame-pointer $m_wm $m_psb -fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -funroll-all-loops -finline-functions $CFLAGS"
    DEBUG_CFLAGS="-O3 $DEBUG_CFLAGS"
    dnl avoid ppc compilation crash
    AS="$CC"
    AC_DEFINE_UNQUOTED(FPM_PPC,,[Define to select libmad fixed point arithmetic implementation])
    AC_DEFINE_UNQUOTED(ARCH_PPC,,[Define this if you're running PowerPC architecture])
    
    if test x$enable_altivec = xyes; then
        AC_DEFINE_UNQUOTED(ENABLE_ALTIVEC,,[Define this if you have a Motorola 74xx CPU])
        CFLAGS="-Wa,-m7400 $CFLAGS"
	DEBUG_CFLAGS="-Wa,-m7400 $DEBUG_CFLAGS"
    fi
    ;;

  sparc*-*-linux*)
    case $host_alias in
    sparc-*)    cpu_cflags="-mcpu=supersparc -mtune=supersparc" ;;
    sparc64-*)
      cpu_cflags="-mcpu=ultrasparc -mtune=ultrasparc"
      if test x$enable_vis = xyes; then
        AC_DEFINE_UNQUOTED(ENABLE_VIS,,[Define this if you have Sun UltraSPARC CPU])
      fi
    ;;
    esac

    CFLAGS="-O3 $cpu_cflags -funroll-loops -funroll-all-loops -finline-functions $CFLAGS"
    DEBUG_CFLAGS="-O $cpu_cflags -funroll-loops -funroll-all-loops -finline-functions $DEBUG_CFLAGS"

    AC_DEFINE_UNQUOTED(FPM_SPARC,,[Define to select libmad fixed point arithmetic implementation])
    AC_DEFINE_UNQUOTED(ARCH_SPARC,,[Define this if you're running SPARC architecture])
    ;;

  sparc-*-solaris*)
    if test "$GCC" = yes; then
	case `uname -m` in
	sun4c) cpu_cflags="-mcpu=v7 -mtune=supersparc" ;;
	sun4m) cpu_cflags="-mcpu=v8 -mtune=supersparc" ;;
	sun4u)
	  case `$CC --version 2>/dev/null` in
	  1.*|2.*)
	    # -mcpu=ultrasparc triggers a GCC 2.95.x compiler bug when
	    # compiling video_out.c:
	    #   gcc: Internal compiler error: program cc1 got fatal signal 11
	    # avoid -mcpu=ultrasparc with gcc 2.*
            cpu_cflags="-mcpu=v8 -mtune=ultrasparc"
	    ;;
          *)
	    # GCC 3 or newer should have no problem with -mcpu=ultrasparc 
            cpu_cflags="-mcpu=ultrasparc -mtune=ultrasparc"
            if test x$enable_vis = xyes; then
	      AC_DEFINE_UNQUOTED(ENABLE_VIS,,[Define this if you have Sun UltraSPARC CPU])
            fi
	    ;;
	  esac
          ;;
	*)     cpu_cflags= ;;
	esac

	cc_optimize_cflags="-O3 $cpu_cflags -funroll-loops -funroll-all-loops -finline-functions"
	cc_debug_cflags="-O $cpu_cflags -funroll-loops -funroll-all-loops -finline-functions"

        AC_DEFINE_UNQUOTED(FPM_SPARC,,[Define to select libmad fixed point arithmetic implementation])		dnl uses gnu c asm extensions
        AC_DEFINE_UNQUOTED(ARCH_SPARC,,[Define this if you're running SPARC architecture])
    else
	case `uname -m` in
	sun4c) cpu_cflags="-xarch=v7 -xchip=ultra2" ;;
	sun4m) cpu_cflags="-xarch=v8 -xchip=ultra2" ;;
	sun4u) cpu_cflags="-xarch=v8plusa -xchip=ultra2" ;;
	esac

	cc_optimize_cflags="-xO5 $cpu_cflags -xCC"
	cc_debug_cflags="-O"
    	AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed point arithmetic implementation])		dnl use portable version with non-gcc
    fi
    CFLAGS="$cc_optimize_cflags $CFLAGS"
    DEBUG_CFLAGS="$cc_debug_cflags $DEBUG_CFLAGS"
    ;;

  mips-*)
    CFLAGS="-O3 $CFLAGS"
    DEBUG_CFLAGS="-O $DEBUG_CFLAGS"
    AC_DEFINE_UNQUOTED(FPM_MIPS,,[Define to select libmad fixed point arithmetic implementation])
    ;;

  m68k-*)
    # used to be -O2, but that makes gcc 2.95.2 segfault
    # see http://bugs.debian.org/146006 for more info
    CFLAGS="-O $CFLAGS"
    DEBUG_CFLAGS="-O $DEBUG_CFLAGS"
    AC_DEFINE_UNQUOTED(FPM_DEFAULT,,[Define to select libmad fixed point arithmetic implementation])
    ;;

  ia64-*)
    CFLAGS="-O3 $CFLAGS"
    DEBUG_CFLAGS="-O3 $DEBUG_CFLAGS"
    AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed pointarithmetic implementation])
  ;;

  hppa-*)
    dnl -O3 seems to trigger gcc internal compiler errors, at least up to gcc 3.2.1
    CFLAGS="-O $CFLAGS"
    DEBUG_CFLAGS="-O $DEBUG_CFLAGS"
    AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed pointarithmetic implementation])
    ;;

  hppa*-hp-*)
    dnl -O3 seems to trigger gcc internal compiler errors, at least up to gcc 3.2.1
    CFLAGS="-O2 $CFLAGS"
    DEBUG_CFLAGS="-O2 $DEBUG_CFLAGS"
    AC_DEFINE_UNQUOTED(FPM_DEFAULT,,[Define to select libmad fixed pointarithmetic implementation])
    ;;

  x86_64-*)
    CFLAGS="-O3 -fomit-frame-pointer $m_wm $m_psb -fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -finline-functions $CFLAGS"
    DEBUG_CFLAGS="-O0 -g $DEBUG_CFLAGS"
    AC_DEFINE_UNQUOTED(ARCH_X86_64,,[Define this if you're running x86 architecture])
    AC_DEFINE(FPM_INTEL,1,[Define to select libmad fixed point arithmetic implementation])
    ;;

  s390-*)
    CFLAGS="-O3 $CFLAGS"
    DEBUG_CFLAGS="-O3 $DEBUG_CFLAGS"
    AC_DEFINE_UNQUOTED(FPM_DEFAULT,,[Define to select libmad fixed point arithmetic implementation])
    ;;

  armv4l-*-linux*)
    CFLAGS="-O2 -fsigned-char -ffast-math -mcpu=strongarm1100 -fomit-frame-pointer -fthread-jumps -fregmove $CFLAGS"
    dnl    CFLAGS="-O1 -fforce-mem -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -finline-functions -fsigned-char -fomit-frame-pointer -march=armv4 -mtune=strongarm $CFLAGS"
    DEBUG_CFLAGS="-O2 $DEBUG_CFLAGS"
    AC_DEFINE_UNQUOTED(FPM_ARM,,[Define to select libmad fixed point arithmetic implementation])
    enable_armv4l="yes"
    ;;

  *)
    echo
    echo "****************************** WARNING ******************************"
    echo
    echo "Host type '$host' ($host_alias) is currently not supported by xine"
    echo
    echo "Assuming that -O3 makes the compiler produce useful code."
    echo
    echo "You might experience problems with this, so please report your"
    echo "architecture and, if possible, known good optimization flags for"
    echo "your compiler to <xine-devel@lists.sf.net>"\!
    echo
    echo "*********************************************************************"
    echo "(sleeping one minute so you can read this...)"
    sleep 60

    CFLAGS="-O3 $CFLAGS"
    DEBUG_CFLAGS="-O $DEBUG_CFLAGS"
    AC_DEFINE_UNQUOTED(FPM_DEFAULT,,[Define to select libmad fixed point arithmetic implementation])
    ;;
esac


AM_CONDITIONAL(HAVE_W32DLL, test x"$enable_w32dll" = "xyes")
if test x"$enable_w32dll" = "xyes"; then
   W32DLL_DEP=""
else 
   W32DLL_DEP="#"
fi
AC_SUBST(W32DLL_DEP)

AM_CONDITIONAL(HAVE_FFMMX, test x"$enable_ffmmx" = "xyes")


dnl ---------------------------------------------
dnl HAVE_ARMV4L is currently used in libavcodec makefile.am
dnl ---------------------------------------------

AM_CONDITIONAL(HAVE_ARMV4L, test x"$enable_armv4l" = "xyes")


dnl ---------------------------------------------
dnl XINE_ROOTDIR does not work if architecture independent files are 
dnl installed to another place than architecture dependent files !!!
dnl ---------------------------------------------

if test "x$prefix" = xNONE; then
   prefix="${ac_default_prefix}"
fi
if test "x$exec_prefix" = xNONE; then
   exec_prefix='${prefix}'
fi
XINE_PLUGINDIR="$libdir/xine/plugins/$XINE_MAJOR.$XINE_MINOR.$XINE_SUB"
eval XINE_PLUGINPATH=`eval echo "$XINE_PLUGINDIR"`
AC_DEFINE_UNQUOTED(XINE_PLUGINDIR,"$XINE_PLUGINPATH",[Define this to plugins directory location])
AC_SUBST(XINE_PLUGINPATH)

XINE_FONTDIR="${datadir}/xine/libxine$XINE_MAJOR/fonts"
eval XINE_FONTPATH="$XINE_FONTDIR"
AC_DEFINE_UNQUOTED(XINE_FONTDIR,"$XINE_FONTPATH",[Define this to osd fonts dir location])
AC_SUBST(XINE_FONTPATH)

XINE_LOCALEDIR="${datadir}/locale"
eval XINE_LOCALEPATH="$XINE_LOCALEDIR"
AC_DEFINE_UNQUOTED(XINE_LOCALEDIR, "$XINE_LOCALEPATH",[Path where catalog files will be.])
AC_SUBST(XINE_LOCALEPATH)

AC_SUBST(XINE_PLUGINDIR)
AC_SUBST(XINE_FONTDIR)
AC_SUBST(XINE_LOCALEDIR)

dnl Where aclocal m4 files should be installed
XINE_ACFLAGS="-I ${datadir}/aclocal"
AC_DEFINE_UNQUOTED(XINE_ACFLAGS, "$XINE_ACFLAGS", [Path where aclocal m4 files will be.])
AC_SUBST(XINE_ACFLAGS)

dnl Where architecture independent data (e.g. logo) will/should be installed
eval XINE_DATADIR="${datadir}/xine"
AC_SUBST(XINE_DATADIR)

dnl Where scripts will/should be installed.
eval XINE_SCRIPTPATH="${datadir}/xine/scripts"
AC_SUBST(XINE_SCRIPTPATH)


dnl ---------------------------------------------
dnl Some informations about xine-lib compilation
dnl ---------------------------------------------

XINE_BUILD_CC="`$CC -v 2>&1 | tail -1`"
XINE_BUILD_OS="`uname -s -r -m`"
XINE_BUILD_DATE="`date \"+%a %d %b %Y %T\"`"
AC_SUBST(XINE_BUILD_CC)
AC_SUBST(XINE_BUILD_OS)
AC_SUBST(XINE_BUILD_DATE)


dnl ---------------------------------------------
dnl For win32 libraries location, needed by libw32dll.
dnl ---------------------------------------------

AC_ARG_WITH(w32-path, AC_HELP_STRING([--with-w32-path=path], [location of WIN32 libraries]),
            w32_path="$withval", w32_path="/usr/lib/win32")
AC_SUBST(w32_path)


dnl ---------------------------------------------
dnl some include paths ( !!! DO NOT REMOVE !!! )
dnl ---------------------------------------------

INCLUDES='-I$(top_srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(top_builddir)/src/xine-engine -I$(top_srcdir)/src/xine-engine -I$(top_srcdir)/src/xine-utils $(INTLDIR) -I$(top_builddir)/src/input -I$(top_srcdir)/src/input'
AC_SUBST(INCLUDES)


dnl ---------------------------------------------
dnl Get where .m4 should be installed.
dnl ---------------------------------------------

dnl if test x"${ACLOCAL_DIR+set}" != xset; then
dnl   case "`id`" in
dnl     uid=0\(* )
dnl       AC_MSG_CHECKING(for aclocal directory)
dnl       if (aclocal --version) < /dev/null > /dev/null 2>&1; then
dnl         ACLOCAL_DIR="`eval $ACLOCAL --print-ac-dir`"
dnl         AC_MSG_RESULT($ACLOCAL_DIR)
dnl       else
dnl         ACLOCAL_DIR="${prefix}/share/aclocal"
dnl         AC_MSG_RESULT(none - will be installed in $ACLOCAL_DIR)
dnl       fi
dnl       escapedprefix="`echo $prefix | sed -e 's/\\//\\\\\//g'`"
dnl       ACLOCAL_DIR="`echo $ACLOCAL_DIR|sed -e 's/^'$escapedprefix/'\${prefix}'/`"
dnl       ;;
dnl   esac
dnl fi
AC_SUBST(ACLOCAL_DIR)
AM_CONDITIONAL([INSTALL_M4],[test x"$ACLOCAL_DIR" != "x"])


dnl ---------------------------------------------
dnl It seems automake 1.5 don't take care about this script
dnl ---------------------------------------------

if test ! -z "$am_depcomp"; then
	DEPCOMP="depcomp"
fi
AC_SUBST(DEPCOMP)


dnl ---------------------------------------------
dnl Check for documentation formatting tool
dnl ---------------------------------------------

AC_CHECK_PROG(SGMLTOOLS, sgmltools, sgmltools, no)
AC_CHECK_PROG(FIG2DEV, fig2dev, fig2dev, no)


dnl ---------------------------------------------
dnl Output configuration files
dnl ---------------------------------------------

AC_CONFIG_FILES([
Makefile
doc/Makefile
doc/man/Makefile
doc/man/en/Makefile
doc/hackersguide/Makefile
doc/faq/Makefile
include/Makefile
include/xine.h
intl/Makefile
m4/Makefile
misc/Makefile
misc/SlackBuild
misc/build_rpms.sh
misc/fonts/Makefile
misc/libxine.pc
misc/relchk.sh
misc/xine-config
misc/xine-lib.spec
po/Makefile.in
src/Makefile
src/audio_out/Makefile
src/demuxers/Makefile
src/dxr3/Makefile
src/input/Makefile
src/input/libdvdnav/Makefile
src/input/dvb/Makefile
src/input/librtsp/Makefile
src/input/libreal/Makefile
src/input/vcd/Makefile
src/input/vcd/libcdio/Makefile
src/input/vcd/libcdio/cdio/Makefile
src/input/vcd/libcdio/MSWindows/Makefile
src/input/vcd/libcdio/image/Makefile
src/input/vcd/libvcd/Makefile
src/input/vcd/libvcd/libvcd/Makefile
src/liba52/Makefile
src/libdts/Makefile
src/libfaad/Makefile
src/libfaad/codebook/Makefile
src/libffmpeg/Makefile
src/libffmpeg/libavcodec/Makefile
src/libffmpeg/libavcodec/armv4l/Makefile
src/libffmpeg/libavcodec/i386/Makefile
src/libffmpeg/libavcodec/mlib/Makefile
src/libffmpeg/libavcodec/alpha/Makefile
src/libffmpeg/libavcodec/ppc/Makefile
src/libffmpeg/libavcodec/sparc/Makefile
src/libffmpeg/libavcodec/libpostproc/Makefile
src/libflac/Makefile
src/liblpcm/Makefile
src/libmad/Makefile
src/libmpeg2/Makefile
src/libspudec/Makefile
src/libspucc/Makefile
src/libsputext/Makefile
src/libvorbis/Makefile
src/libtheora/Makefile
src/libspeex/Makefile
src/libw32dll/Makefile
src/libw32dll/wine/Makefile
src/libw32dll/DirectShow/Makefile
src/libw32dll/dmo/Makefile
src/libw32dll/qtx/Makefile
src/libw32dll/qtx/qtxsdk/Makefile
src/libxinevdec/Makefile
src/libxineadec/Makefile
src/libxineadec/gsm610/Makefile
src/libxineadec/nosefart/Makefile
src/libreal/Makefile
src/post/Makefile
src/post/planar/Makefile
src/post/goom/Makefile
src/post/mosaico/Makefile
src/post/visualizations/Makefile
src/post/deinterlace/Makefile
src/post/deinterlace/plugins/Makefile
src/video_out/Makefile
src/video_out/libdha/Makefile
src/video_out/libdha/bin/Makefile
src/video_out/libdha/kernelhelper/Makefile
src/video_out/libdha/oth/Makefile
src/video_out/libdha/sysdep/Makefile
src/video_out/vidix/Makefile
src/video_out/vidix/drivers/Makefile
src/xine-utils/Makefile
src/xine-engine/Makefile
src/xine-engine/xineintl.h])
AC_CONFIG_COMMANDS([default],[[chmod +x ./misc/SlackBuild ./misc/build_rpms.sh ./misc/relchk.sh]],[[]])
AC_OUTPUT


dnl ---------------------------------------------
dnl Hack the libtool script (if required).
dnl
dnl If user intentionnaly overrided detection, use wish.
dnl ---------------------------------------------

if test x"$enable_fpic" != x; then
   case "${enable_fpic}" in
     yes)
       no_fpic="no"
       ;;
     *)
       no_fpic="yes"
       ;;
   esac
fi

dnl made libtool define BUILD_BASENAME
dnl cat libtool | sed -e 's/s/command\=\"\$base_compile\ \$srcfile/command\=\"\$base_compile\ \$srcfile\ \-DBUILD_BASENAME\=\`echo\ \$srcfile\ \|\ sed\ \-e\ '\''s\/\\.\[csS\]\/\/g'\''\`/g' > libtool.tmp
dnl cat libtool.tmp > libtool
dnl chmod +x libtool

dnl make libtool-nofpic silent and not installing plugins's .la files
cat libtool | sed -e 's/^.*echo \"---------.*$/exit 0/;s/# Install the pseudo-library.*/continue/' > libtool.tmp

dnl Remove fPIC flag, if necessary
if test x$no_fpic = "xyes"; then
  cat libtool.tmp | sed -e 's/^pic_flag=/#pic_flag=/;s/^ *pic_mode=.*$/pic_mode=no/' > libtool-nofpic
else
  cat libtool.tmp > libtool-nofpic
fi

rm -f libtool.tmp
chmod +x libtool-nofpic


dnl ---------------------------------------------
dnl Some infos:
dnl ---------------------------------------------

echo "xine-lib summary:"
echo "----------------"

dnl Input
echo " * input plugins:"
echo "   - file          - net"
echo "   - stdin_fifo    - rtp"
echo "   - http          - mms"
echo "   - pnm           - rtsp"
echo "   - dvb"
if test x"$have_cdrom_ioctls" = "xyes"; then
  if test x"$external_dvdnav" = "xyes"; then
    echo "   - dvd (external libs)"
  else
    echo "   - dvd (internal libs)"
  fi
  if test x"$enable_vcd" = "xyes"; then
    if test x"$internal_vcdnav" = "xno"; then
      echo "   - vcd (external libs)"
    else
      echo "   - vcd (internal libs)"
    fi
  fi
  echo "   - vcdo"
  echo "   - cdda"
fi
if test x"$no_gnome_vfs" = "xno"; then
  echo "   - gnome-vfs"
fi
if test x"$have_v4l" = "xyes"; then
  echo "   - v4l"
fi
echo ""

dnl Demuxers
echo " * demultiplexer plugins:"
echo "   - avi           - mpeg"
echo "   - mpeg_block    - mpeg_audio"
echo "   - mpeg_elem     - mpeg_pes"
echo "   - mpeg_ts       - qt/mpeg-4"
echo "   - film          - roq"
echo "   - fli           - smjpeg"
echo "   - idcin         - wav"
echo "   - wc3 mve       - voc"
echo "   - vqa           - aiff"
echo "   - cdda          - snd/au"
echo "   - yuv4mpeg2     - real/realaudio"
echo "   - ea wve        - raw dv"
echo "   - interplay mve - psx str"
echo "   - ws aud        - pva"
echo "   - vox           - nsf"
echo "   - nsv           - 4xm"
echo "   - ac3           - aac"
echo "   - iff           - matroska"
echo "   - vmd           - flv"
if test x"$enable_asf" = "xyes"; then
  echo "   - asf"
fi
if test x"$no_vorbis" != "xyes"; then
  echo "   - ogg"
fi
if test x"$have_libmng" = "xyes"; then
  echo "   - mng"
fi
if test x"$have_modplug" = x"yes"; then
  echo "   - mod"
fi
echo ""

dnl video decoders
echo " * video decoder plugins:"
echo "   - MPEG 1,2         - Amiga Bitplane"
echo "   - Raw RGB          - Raw YUV"
echo "   - ffmpeg:"
echo "     - MPEG-4 (ISO, Microsoft, DivX*, XviD)"
echo "     - Creative YUV    - Motion JPEG"
echo "     - Cinepak         - MS Video-1"
echo "     - FLI/FLC         - MS RLE"
echo "     - Id RoQ          - Id Cin"
echo "     - Apple Graphics  - Apple Video"
echo "     - Apple Animation - Interplay Video"
echo "     - Westwood VQA    - Origin Xan"
echo "     - H.263           - Intel Indeo 3"
echo "     - SVQ1            - SVQ3"
echo "     - Real Video 1.0  - Real Video 2.0"
echo "     - 4X Video        - Sierra Video"
echo "     - Asus v1/v2      - HuffYUV"
echo "     - On2 VP3         - DV"
echo "     - 8BPS            - Duck TrueMotion v1"
echo "     - ATI VCR1        - Flash Video"
echo "     - ZLIB            - MSZH"
if test x"$have_dxr3" = "xyes"; then
  echo "   - dxr3_video"
fi
if test x"$enable_w32dll" = "xyes"; then
  echo "   - w32dll"
fi
if test x"$have_libpng" = "xyes"; then
  echo "   - png"
fi
if test x"$no_theora" != "xyes"; then
  echo "   - theora"
fi
echo ""

dnl audio decoders
echo " * audio decoder plugins:"
echo "   - A52/ra-dnet     - DTS"
echo "   - MAD (MPG 1/2/3) - GSM 06.10"
echo "   - linear PCM      - Nosefart (NSF)"
echo "   - ffmpeg:"
echo "     - Windows Media Audio v1/v2"
echo "     - DV            - logarithmic PCM"
echo "     - 14k4          - 28k8"
echo "     - MS ADPCM      - IMA ADPCM"
echo "     - XA ADPCM      - Game DPCM/ADPCM"
echo "     - Mace 3:13     - Mace 6:1"
if test x"$no_vorbis" != "xyes"; then
  echo "   - vorbis"
fi
if test x"$no_speex" != "xyes"; then
  echo "   - speex"
fi
if test x"$enable_w32dll" = "xyes"; then
  echo "   - w32dll"
fi
if test x"$enable_faad" = "xyes"; then
  echo "   - faad"
fi
echo ""

dnl spu decoders
echo " * subtitle decoder plugins:"
echo "   - spu             - spucc"
echo "   - sputext"
if test x"$have_dxr3" = "xyes"; then
  echo "   - dxr3_spu"
fi
echo ""

dnl post plugins
echo " * post effect plugins:"
echo "  * planar video effects:"
echo "   - invert          - expand"
echo "   - eq              - eq2"
echo "   - boxblur         - denoise3d"
echo "   - unsharp         - tvtime"
echo "  * SFX:"
echo "   - goom            - oscope"
echo "   - fftscope        - mosaico"
echo ""

dnl Video plugins
echo " * video driver plugins:"
if test x"$no_x" != "xyes"; then
  echo "   - XShm (X11 shared memory)"
  dnl synfb
  if test x$ac_have_syncfb = "xyes"; then
    echo "   - SyncFB (for Matrox G200/G400 cards)"
  fi
  dnl Xv
  if test x$ac_have_xv = "xyes"; then
    if test x$xv_lib="xlibXv.a"; then
      echo "   - Xv (XVideo *static*)"
    else
      echo "   - Xv (XVideo *shared*)"
    fi
  fi
  dnl XvMC
  if test x$ac_have_xvmc = "xyes"; then
    if test x$xvmc_lib="xlibXvMC.a"; then
      echo "   - XvMC (XVideo *static*)"
    else
      echo "   - XvMC (XVideo *shared*)"
    fi
  fi
  dnl XvMCNVIDIA
  if test x$ac_have_xvmc = "xyes"; then
    if test x$xvmc_lib="xlibXvMCNVIDIA.a"; then
      echo "   - XvMCNVIDIA (XVideo *static*)"
    else
      echo "   - XvMCNVIDIA (XVideo *shared*)"
    fi
  fi
  if test x$ac_have_opengl = "xyes" -a x$ac_have_glut="xyes" -o \
	  x$ac_have_opengl = "xyes" -a x$ac_have_glu="xyes"; then	
    echo "   - OpenGL"
  fi
  if test x$ac_have_sunfb = "xyes"; then
    if test x$ac_have_sundga = "xyes"; then
      echo "   - PGX64 (for Sun PGX64/PGX24 cards)"
      echo "   - PGX32 (for Sun PGX32 cards)"
    fi
  fi
fi
if test x$no_aalib != "xyes"; then
  echo "   - aa (Ascii ART)"
fi
if test x$no_caca != "xyes"; then
  echo "   - caca (Color AsCii Art)"
fi
if test x$have_fb = "xyes"; then
  echo "   - fb (Linux framebuffer device)"
fi
if test x"$no_sdl" != x"yes"; then
  echo "   - sdl (Simple DirectMedia Layer)"
fi
if test x"$have_stk" = "xyes"; then
  echo "   - stk (Libstk Set-top Toolkit)"
fi
if test x"$have_directfb" = "xyes"; then
  echo "   - directfb (DirectFB driver)"
fi
if test x"$have_dxr3" = "xyes"; then
  if test x"$have_encoder" = "xyes"; then
    echo "   - dxr3 (Hollywood+ and Creative dxr3, both mpeg and non-mpeg video)"
  else
    echo "   - dxr3 (Hollywood+ and Creative dxr3, mpeg video only)"
  fi
fi
if test x"$enable_vidix" = "xyes"; then
  echo $ECHO_N "   - vidix ("
  
  if test x"$no_x" != "xyes"; then
    echo $ECHO_N "X11"
    if test x"$have_fb" = "xyes"; then
      echo $ECHO_N " and "
    fi
  fi
    
  if test x"$have_fb" = "xyes"; then
      echo $ECHO_N "framebuffer"
  fi
  
  echo $ECHO_N " support"

  if test x"$enable_dha_kmod" = "xyes"; then
    echo " with dhahelper)"
  else
    echo ")"
  fi
fi
if test x"$have_directx" = "xyes"; then
  echo "   - directx (DirectX video driver)"
fi
echo ""

dnl Audio plugins
echo " * audio driver plugins:"
if test x"$have_ossaudio" = "xyes"; then
  echo "   - oss (Open Sound System)"
fi
if test x"$no_alsa" != "xyes"; then
  if test x"$have_alsa09" = "xyes"; then
    echo "   - alsa (Alsa 0.9.x)"
  fi
fi
if test x"$no_esd" != "xyes"; then
  echo "   - esd (Enlightened Sound Daemon)"
fi
if test x"$no_arts" != "xyes"; then
  echo "   - arts (aRts - KDE soundserver)"
fi
if test x"$have_sunaudio" = "xyes"; then
  echo "   - sun ()"
fi
if test "x$am_cv_have_irixal" = xyes; then
  echo "   - irixal (Irix audio library)"
fi
if test x"$have_directx" = "xyes"; then
  echo "   - directx (DirectX audio driver)"
fi
echo "---"


dnl ---------------------------------------------
dnl some user warnings
dnl ---------------------------------------------

dnl some levels of variable expansion to get final install paths
final_libdir="`eval eval eval eval echo $libdir`"
final_bindir="`eval eval eval eval echo $bindir`"

if test -r /etc/ld.so.conf && ! grep -x "$final_libdir" /etc/ld.so.conf >/dev/null ; then
  if test "$final_libdir" != "/lib" -a "$final_libdir" != "/usr/lib" ; then
    if ! echo $LD_LIBRARY_PATH | egrep "(:|^)$final_libdir(/?:|/?$)" >/dev/null ; then
      echo
      echo "****************************************************************"
      echo "xine-lib will be installed to $final_libdir"
      echo
      echo "This path is not mentioned among the linker search paths in your"
      echo "/etc/ld.so.conf. This means it is possible that xine-lib will"
      echo "not be found when you try to compile or run a program using it."
      echo "If this happens, you should add $final_libdir to"
      echo "the environment variable LD_LIBRARY_PATH like that:"
      echo
      echo "export LD_LIBRARY_PATH=$final_libdir:\$LD_LIBRARY_PATH"
      echo
      echo "Alternatively you can add a line \"$final_libdir\""
      echo "to your /etc/ld.so.conf."
      echo "****************************************************************"
      echo
    fi
  fi
fi

if ! echo $PATH | egrep "(:|^)$final_bindir(/?:|/?$)" >/dev/null ; then
  echo
  echo "****************************************************************"
  echo "xine-config will be installed to $final_bindir"
  echo
  echo "This path is not in your search path. This means it is possible"
  echo "that xine-config will not be found when you try to compile a"
  echo "program using xine-lib. This will result in build failures."
  echo "If this happens, you should add $final_bindir to"
  echo "the environment variable PATH like that:"
  echo
  echo "export PATH=$final_bindir:\$PATH"
  echo
  echo "Note that this is only needed for compilation. It is not needed"
  echo "to have xine-config in your search path at runtime. (Although"
  echo "it will not cause any harm either.)"
  echo "****************************************************************"
  echo
fi

dnl warn if no X11 plugins will be built
if test x"$no_x" = "xyes" ; then
  echo
  echo "****************************************************************"
  echo "WARNING! No X11 output plugins will be built."
  echo
  echo "For some reason, the requirements for building the X11 video"
  echo "output plugins are not met. That means, that you will NOT be"
  echo "able to use the resulting xine-lib to watch videos in a window"
  echo "on any X11-based display (e.g. your desktop)."
  echo
  echo "If this is not what you want, provide the necessary X11 build"
  echo "dependencies (usually done by installing a package called"
  echo "XFree86-devel or similar) and run configure again."
  echo "****************************************************************"
  echo
fi