summaryrefslogtreecommitdiff
path: root/legacy/ecore/configure.ac
blob: b0a05fc30b9053bc4aabc8ff01c5082ed23b10fe (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
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_define([v_maj], [1])
m4_define([v_min], [6])
m4_define([v_mic], [99])
m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v '\(export\|Unversioned directory\)' || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n' | sed 's/Unversioneddirectory/0/' | tr -d '\n']))
m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
##--   When released, remove the dnl on the below line
dnl m4_undefine([v_rev])
##--   When doing snapshots - change soname. remove dnl on below line
dnl m4_define([relname], [ver-pre-svn-07])
dnl m4_define([v_rel], [-release relname])
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])], [m4_define([v_ver], [v_maj.v_min.v_mic])])
m4_define([lt_cur], m4_eval(v_maj + v_min))
m4_define([lt_rev], v_mic)
m4_define([lt_age], v_min)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##

AC_INIT([ecore], [v_ver], [enlightenment-devel@lists.sourceforge.net])
AC_PREREQ([2.52])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])

AC_CONFIG_HEADERS([config.h])
AH_TOP([
#ifndef EFL_CONFIG_H__
#define EFL_CONFIG_H__
])
AH_BOTTOM([
#endif /* EFL_CONFIG_H__ */
])

AM_INIT_AUTOMAKE([1.6 dist-bzip2])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AC_GNU_SOURCE

AC_LIBTOOL_WIN32_DLL
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
AC_PROG_LIBTOOL

##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
m4_ifdef([v_rel], , [m4_define([v_rel], [])])
AC_DEFINE_UNQUOTED(VERS_MAJ, [v_maj], [Major version])
AC_DEFINE_UNQUOTED(VERS_MIN, [v_min], [Minor version])
AC_DEFINE_UNQUOTED(VERS_MIC, [v_mic], [Micro version])
AC_DEFINE_UNQUOTED(VERS_REV, [v_rev], [Revison])
version_info="lt_cur:lt_rev:lt_age"
release_info="v_rel"
AC_SUBST(version_info)
AC_SUBST(release_info)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
VMAJ=v_maj
AC_SUBST(VMAJ)

AM_GNU_GETTEXT_VERSION(0.17)

m4_ifdef([AM_GNU_GETTEXT], [
AM_GNU_GETTEXT([external])
po_makefile_in=po/Makefile.in
have_po="yes"
],[
have_po="no"
])
AC_SUBST(LTLIBINTL)

if test "x${POSUB}" = "x" ; then
   have_po="no"
fi

AM_CONDITIONAL([HAVE_PO], [test "x${have_po}" = "xyes"])

with_max_log_level="<unset>"
AC_ARG_WITH(internal-maximum-log-level,
   [AC_HELP_STRING([--with-internal-maximum-log-level=NUMBER],
                   [limit ecore internal log level to the given number, any call to EINA_LOG() with values greater than this will be compiled out, ignoring runtime settings, but saving function calls.])],
   [
    if test "x${withval}" != "xno"; then
       if echo "${withval}" | grep -E '^[[0-9]]+$' >/dev/null 2>/dev/null; then
          AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${withval}])
          AC_DEFINE_UNQUOTED(EINA_LOG_LEVEL_MAXIMUM, ${withval}, [if set, logging is limited to this amount.])
          with_max_log_level="${withval}"
       else
          AC_MSG_ERROR([--with-internal-maximum-log-level takes a decimal number, got "${withval}" instead.])
       fi
    fi
    ], [:])


### Default options with respect to host

AC_CANONICAL_BUILD
AC_CANONICAL_HOST

# dependencies and options
want_curl="no"
want_local_sockets="yes"
want_abstract_sockets="no"
want_gnutls="no"
want_openssl="no"
want_cares="no"
want_cipher="no"
want_signature="no"
want_poll="yes"
want_inotify="no"
want_notify_win32="no"
want_tslib="no"
want_glib="no"

# core modules
want_ecore_con="yes"
want_ecore_ipc="yes"
want_ecore_file="yes"
#want_ecore_config="no"
want_ecore_imf="no"
want_ecore_input="yes"

# graphic system modules
want_evas_simple_x11="no"
want_ecore_x_xcb="no"
want_ecore_x="no"
want_ecore_win32="no"
want_ecore_cocoa="no"
want_ecore_sdl="no"
want_ecore_psl1ght="no"
want_ecore_fb="no"
want_ecore_directfb="no"
want_ecore_wince="no"
want_ecore_wayland="no"

# ecore_x options (both xlib and xcb)
want_ecore_x_composite="yes"
want_ecore_x_damage="yes"
want_ecore_x_dpms="yes"
want_ecore_x_randr="yes"
want_ecore_x_render="yes"
want_ecore_x_screensaver="yes"
want_ecore_x_shape="yes"
want_ecore_x_gesture="no"
want_ecore_x_sync="yes"
want_ecore_x_xfixes="yes"
want_ecore_x_xinerama="yes"
want_ecore_x_xprint="yes"
want_ecore_x_xtest="yes"
want_ecore_x_cursor="yes"
want_ecore_x_input="yes"
want_ecore_x_dri="yes"

# ecore_evas modules
want_ecore_evas="yes"
want_ecore_evas_software_buffer="yes"
want_ecore_evas_software_x11="no"
want_ecore_evas_opengl_x11="no"
want_ecore_evas_software_16_x11="no"
want_ecore_evas_software_8_x11="no"
want_ecore_evas_software_xcb="no"
want_ecore_evas_software_gdi="no"
want_ecore_evas_software_ddraw="no"
want_ecore_evas_direct3d="no"
want_ecore_evas_opengl_glew="no"
want_ecore_evas_software_16_ddraw="no"
want_ecore_evas_software_sdl="no"
want_ecore_evas_gl_sdl="no"
want_ecore_evas_gl_cocoa="no"
want_ecore_evas_psl1ght="no"
want_ecore_evas_directfb="no"
want_ecore_evas_fb="no"
want_ecore_evas_software_16_wince="no"
want_ecore_evas_ews="yes"
want_ecore_evas_extn="yes"
want_ecore_evas_wayland_shm="no"
want_ecore_evas_wayland_egl="no"

# ecore_imf modules
want_ecore_imf_xim="no"
want_ecore_imf_scim="no"
want_ecore_imf_ibus="no"

case "$host_os" in
   mingw32ce*)
      want_ecore_con="no"
      want_ecore_ipc="no"
      want_ecore_wince="yes"
      want_ecore_evas_software_16_wince="yes"
      want_ecore_evas_extn="no"
      ;;
   mingw*)
      want_notify_win32="yes"
      want_curl="yes"
      want_glib="auto"
      want_gnutls="auto"
      want_openssl="auto"
      want_ecore_imf="yes"
      want_ecore_win32="yes"
      want_ecore_evas_software_gdi="yes"
      want_ecore_evas_software_ddraw="yes"
      want_ecore_evas_direct3d="yes"
      want_ecore_evas_opengl_glew="yes"
      want_ecore_evas_software_16_ddraw="auto"
      want_ecore_evas_software_sdl="yes"
      want_ecore_evas_gl_sdl="yes"
      ;;
   darwin*)
      want_curl="yes"
      want_glib="auto"
      want_gnutls="auto"
      want_openssl="auto"
      want_ecore_imf="yes"
      want_ecore_cocoa="yes"
      want_ecore_evas_software_sdl="yes"
      want_ecore_evas_gl_sdl="yes"
      want_ecore_evas_gl_cocoa="yes"
      ;;
   *)
      want_curl="yes"
      want_glib="auto"
      want_abstract_sockets="yes"
      want_gnutls="auto"
      want_openssl="auto"
      want_cipher="yes"
      want_signature="yes"
      want_inotify="yes"
      want_tslib="yes"
      want_ecore_fb="yes"
      want_ecore_imf="yes"
      want_ecore_x="yes"
      want_ecore_wayland="yes"
      want_ecore_evas_software_x11="yes"
      want_ecore_evas_opengl_x11="yes"
      want_ecore_evas_software_16_x11="yes"
      want_ecore_evas_software_8_x11="yes"
      want_ecore_evas_software_xcb="no"
      want_ecore_evas_software_sdl="yes"
      want_ecore_evas_gl_sdl="yes"
      want_ecore_evas_gl_cocoa="no"
      want_ecore_evas_directfb="yes"
      want_ecore_evas_fb="yes"
      want_ecore_evas_wayland_shm="yes"
      want_ecore_evas_wayland_egl="yes"
      want_ecore_imf_xim="yes"
      want_ecore_imf_scim="yes"
      want_ecore_imf_ibus="yes"
      ;;
esac

case "$host_vendor" in
  ps3*)
      want_local_sockets="no"
      ;;
esac
requirements_ecore=""
requirements_ecore_con=""
#requirements_ecore_config=""
requirements_ecore_directfb=""
requirements_ecore_evas=""
requirements_ecore_fb=""
requirements_ecore_file=""
requirements_ecore_imf=""
requirements_ecore_imf_evas=""
requirements_ecore_input=""
requirements_ecore_input_evas=""
requirements_ecore_ipc=""
requirements_ecore_cocoa=""
requirements_ecore_sdl=""
requirements_ecore_psl1ght=""
requirements_ecore_x=""
requirements_ecore_win32=""
requirements_ecore_wince=""
requirements_ecore_imf_xim=""
requirements_ecore_imf_scim=""
requirements_ecore_imf_ibus=""
requirements_ecore_wayland=""

### Additional options to configure

want_glib_integration_always=no
AC_ARG_ENABLE(glib-integration-always,
  AC_HELP_STRING([--enable-glib-integration-always], [enable glib integration when ecore_init() is called always]),
  [want_glib_integration_always=$enableval])

if test "x${want_glib_integration_always}" = "xyes" ; then
  AC_DEFINE([GLIB_INTEGRATION_ALWAYS], [1], [Always integrate glib if support compiled])
  want_glib=yes
fi

want_g_main_loop=no
AC_ARG_ENABLE(g-main-loop,
  AC_HELP_STRING([--enable-g-main-loop], [ecore_main_loop based on g_main_loop]),
  [want_g_main_loop=$enableval])

if test "x${want_g_main_loop}" = "xyes" ; then
  AC_DEFINE([USE_G_MAIN_LOOP], [1], [Use g_main_loop in ecore])
  want_glib=yes
fi

if test "x${want_glib_integration_always}" = "xyes" -a "x${want_g_main_loop}" = "xyes"; then
  AC_MSG_ERROR([--enable-glib-integration-always and --enable-glib-main-loop are mutually exclusive])
fi

# local sockets (ecore_con.c)
AC_ARG_ENABLE([local-sockets],
   [AC_HELP_STRING([--disable-local-sockets], [disable local sockets.])],
   [
    if test "x${enableval}" = "xyes" ; then
       want_ecore_con_local_sockets="yes"
    else
       want_ecore_con_local_sockets="no"
    fi
   ],
   [want_ecore_con_local_sockets=${want_local_sockets}])

if test "x${want_ecore_con_local_sockets}" = "xyes" ; then
   AC_DEFINE([HAVE_LOCAL_SOCKETS], [1], [Have local sockets support])
fi

# abstract sockets (ecore_con.c)
AC_ARG_ENABLE([abstract-sockets],
   [AC_HELP_STRING([--disable-abstract-sockets], [disable abstract sockets.])],
   [
    if test "x${enableval}" = "xyes" ; then
       want_ecore_con_abstract_sockets="yes"
    else
       want_ecore_con_abstract_sockets="no"
    fi
   ],
   [want_ecore_con_abstract_sockets=${want_abstract_sockets}])

if test "x${want_ecore_con_abstract_sockets}" = "xyes" ; then
   AC_DEFINE([HAVE_ABSTRACT_SOCKETS], [1], [Have abstract sockets namespace])
fi

# Simple X11 build/link

AC_ARG_ENABLE(simple-x11,
  AC_HELP_STRING([--enable-simple-x11], [enable simple x11 linking]),
  [want_evas_simple_x11=$enableval])

# XIM
AC_ARG_ENABLE([xim],
   [AC_HELP_STRING([--disable-xim], [disable X Input Method.])],
   [
    if test "x${enableval}" = "xyes" ; then
       want_xim="yes"
    else
       want_xim="no"
    fi
   ],
   [want_xim="yes"])

if test "x${want_xim}" = "xyes" ; then
   AC_DEFINE([ENABLE_XIM], [1], [Enable X Input Method])
fi

### Checks for programs

m4_ifdef([AC_PROG_OBJC],
   [
    AC_PROG_OBJC
    _AM_DEPENDENCIES(OBJC)
   ],
   [
    AC_CHECK_TOOL([OBJC], [gcc])
    AC_SUBST([OBJC])
    AC_SUBST([OBJCFLAGS])
   ])
m4_ifndef([am__fastdepOBJC], [
    AM_CONDITIONAL([am__fastdepOBJC], [false])
])

AC_PROG_CXX
AC_PROG_CC_C99
if test "x${ac_cv_prog_cc_c99}" = "xno" ; then
   AC_MSG_ERROR([ecore requires a c99-capable compiler])
fi

have_gnu_objc=${ac_cv_objc_compiler_gnu}

# doxygen program for documentation building

EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])

m4_ifdef([v_mic],
   [
    EFL_COMPILER_FLAG([-Wall])
    EFL_COMPILER_FLAG([-W])
   ])

# The first call to PKG_CHECK_MODULES is done conditionally,
# so we should include this here:
PKG_PROG_PKG_CONFIG

# Check whether pkg-config supports Requires.private
if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
   pkgconfig_requires_private="Requires.private"
else
   pkgconfig_requires_private="Requires"
fi
AC_SUBST(pkgconfig_requires_private)

### Checks for some build time option
have_backtrace="no"
AC_CHECK_FUNCS([backtrace], [have_backtrace="yes"], [])

want_ecore_timer_dump="no"

AC_ARG_ENABLE([ecore-timer-dump],
   [AC_HELP_STRING([--disable-ecore-timer-dump], [disable tracking of timer allocation. @<:@default=enable@:>@])],
   [want_ecore_timer_dump=$enableval], [])

if test "x$want_ecore_timer_dump" = "xyes" -a "x$have_backtrace" = "xyes"; then
   AC_DEFINE(WANT_ECORE_TIMER_DUMP, [1], [Want Ecore_Timer dump infrastructure])
fi

### Checks for libraries

# Evil library for compilation on Windows

case "$host_os" in
   mingw*)
      PKG_CHECK_MODULES([EVIL], [evil >= 1.6.99])
      AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed])
      requirements_ecore="evil ${requirements_ecore}"
      requirements_ecore_evas="evil ${requirements_ecore_evas}"
      requirements_ecore_file="evil ${requirements_ecore_file}"
      requirements_ecore_imf="evil ${requirements_ecore_imf}"
      requirements_ecore_imf_evas="evil ${requirements_ecore_imf_evas}"
      EFL_ECORE_BUILD="-DEFL_ECORE_BUILD"
      EFL_ECORE_CON_BUILD="-DEFL_ECORE_CON_BUILD"
      EFL_ECORE_EVAS_BUILD="-DEFL_ECORE_EVAS_BUILD"
      EFL_ECORE_FILE_BUILD="-DEFL_ECORE_FILE_BUILD"
      EFL_ECORE_IMF_BUILD="-DEFL_ECORE_IMF_BUILD"
      EFL_ECORE_IMF_EVAS_BUILD="-DEFL_ECORE_IMF_EVAS_BUILD"
      EFL_ECORE_INPUT_BUILD="-DEFL_ECORE_INPUT_BUILD"
      EFL_ECORE_INPUT_EVAS_BUILD="-DEFL_ECORE_INPUT_EVAS_BUILD"
      EFL_ECORE_IPC_BUILD="-DEFL_ECORE_IPC_BUILD"
      ;;
esac

have_win32=""
have_wince=""
case "$host_os" in
   mingw32ce* | cegcc*)
      EFL_ECORE_WINCE_BUILD="-DEFL_ECORE_WINCE_BUILD"
      requirements_ecore_wince="evil ${requirements_ecore_wince}"
      have_wince="yes"
      ;;
   mingw*)
      EFL_ECORE_WIN32_BUILD="-DEFL_ECORE_WIN32_BUILD"
      EFL_ECORE_SDL_BUILD="-DEFL_ECORE_SDL_BUILD"
      requirements_ecore_win32="evil ${requirements_ecore_win32}"
      requirements_ecore_sdl="evil ${requirements_ecore_sdl}"
      have_win32="yes"
      ;;
esac

have_ps3=""
case "$host_vendor" in
  ps3*)
      have_ps3="yes"
      PKG_CHECK_MODULES([ESCAPE], [escape])
      CFLAGS="$CFLAGS $ESCAPE_CFLAGS"
      AC_DEFINE(HAVE_ESCAPE, 1, [Set to 1 if Escape library is installed])
      EFL_ECORE_PSL1GHT_BUILD="-DEFL_ECORE_PSL1GHT_BUILD"
      requirements_ecore="escape ${requirements_ecore}"
      requirements_ecore_evas="escape ${requirements_ecore_evas}"
      requirements_ecore_file="escape ${requirements_ecore_file}"
      requirements_ecore_imf="escape ${requirements_ecore_imf}"
      requirements_ecore_imf_evas="escape ${requirements_ecore_imf_evas}"
      requirements_ecore_sdl="escape ${requirements_ecore_sdl}"
      want_ecore_psl1ght="yes"
      want_ecore_evas_psl1ght="yes"
      ;;
esac


### Checks for portability layer

PKG_CHECK_MODULES([EXOTIC],
   [exotic],
   [enable_exotic="yes"],
   [enable_exotic="no"])

if test "x${enable_exotic}" = "xyes"; then
    requirements_ecore="exotic ${requirements_ecore}"

    AC_DEFINE([HAVE_EXOTIC], [1], [Define to 1 if you have Exotic.])
fi
AM_CONDITIONAL([ECORE_HAVE_EXOTIC], [test "x${enable_exotic}" = "xyes"])

AC_SUBST(EFL_ECORE_BUILD)
AC_SUBST(EFL_ECORE_CON_BUILD)
AC_SUBST(EFL_ECORE_EVAS_BUILD)
AC_SUBST(EFL_ECORE_FILE_BUILD)
AC_SUBST(EFL_ECORE_IMF_BUILD)
AC_SUBST(EFL_ECORE_IMF_EVAS_BUILD)
AC_SUBST(EFL_ECORE_INPUT_BUILD)
AC_SUBST(EFL_ECORE_INPUT_EVAS_BUILD)
AC_SUBST(EFL_ECORE_IPC_BUILD)
AC_SUBST(EFL_ECORE_WINCE_BUILD)
AC_SUBST(EFL_ECORE_WIN32_BUILD)
AC_SUBST(EFL_ECORE_SDL_BUILD)
AC_SUBST(EFL_ECORE_PSL1GHT_BUILD)

AM_CONDITIONAL(ECORE_HAVE_WINCE, test "x${have_wince}" = "xyes")
AM_CONDITIONAL(ECORE_HAVE_WIN32, test "x${have_win32}" = "xyes")
AM_CONDITIONAL(ECORE_HAVE_PS3, test "x${have_ps3}" = "xyes")

WIN32_LIBS=""
case "$host_os" in
   mingw32ce* | cegcc*)
      WIN32_LIBS="-lws2"
      dlopen_libs="-ldl"
      ;;
   mingw*)
      WIN32_LIBS="-lws2_32"
      dlopen_libs="-ldl"
      ;;
   *)
      AC_CHECK_LIB([c], [dlopen],
         [],
         [AC_CHECK_LIB([dl], [dlopen],
             [dlopen_libs=-ldl])
         ])
      AC_CHECK_LIB([c], [clock_gettime],
         [AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [Have clock_gettime()])],
         [AC_CHECK_LIB([rt], [clock_gettime],
             [
              rt_libs=-lrt
              AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [Have clock_gettime()])
             ])
         ])
      ;;
esac
AC_SUBST(WIN32_LIBS)
AC_SUBST(dlopen_libs)
AC_SUBST(rt_libs)

# Eina library

PKG_CHECK_MODULES(EINA, [eina >= 1.6.99])
#FIXME check all the requirements when the eina move will be finished
requirements_ecore="eina >= 1.6.99 ${requirements_ecore}"
requirements_ecore_con="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_con}"
#requirements_ecore_config="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_config}"
requirements_ecore_directfb="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_directfb}"
requirements_ecore_evas="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_evas}"
requirements_ecore_fb="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_fb}"
requirements_ecore_file="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_file}"
requirements_ecore_imf="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_imf}"
requirements_ecore_imf_evas="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_imf_evas}"
requirements_ecore_input="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_input}"
requirements_ecore_input_evas="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_input_evas}"
requirements_ecore_ipc="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_ipc}"
requirements_ecore_cocoa="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_cocoa}"
requirements_ecore_sdl="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_sdl}"
requirements_ecore_psl1ght="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_sdl}"
requirements_ecore_win32="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_win32}"
requirements_ecore_wince="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_wince}"
requirements_ecore_x="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_x}"


# glib support (main loop integration)
AC_ARG_ENABLE([glib],
   [AC_HELP_STRING([--disable-glib], [disable glib support. @<:@default=detect@:>@])],
   [want_glib=$enableval], [])

if test "x$want_glib" != "xno"; then
   PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib="yes"], [have_glib="no"])
else
   have_glib="no"
fi
if test "x$want_glib" = "xyes" -a "x$have_glib" = "xno"; then
   AC_MSG_ERROR([GLib support requested, but no GLib found by pkg-config.])
elif test "x$have_glib" = "xyes"; then
   AC_DEFINE(HAVE_GLIB, [1], [Have GLib])
   requirements_ecore="glib-2.0 ${requirements_ecore}"
fi


# SDL library (ecore_sdl)

have_sdl="no"
PKG_CHECK_MODULES([SDL], [sdl >= 1.2.0], [have_sdl="yes"], [have_sdl="no"])
if test "x${have_sdl}" != "xyes" ; then
   SDL_CONFIG="sdl-config"
   AC_ARG_WITH([sdl-config],
      [AC_HELP_STRING([--with-sdl-config=PATH], [use sdl-config specified])],
      [
       SDL_CONFIG=$withval
       AC_MSG_NOTICE([using ${SDL_CONFIG} for sdl-config])
      ])

   AC_PATH_PROG([SDL_CONFIG], ["sdl-config"], [""], [$PATH])

   if test -n "$SDL_CONFIG" ; then
      SDL_CFLAGS=`$SDL_CONFIG --cflags`
      SDL_LIBS=`$SDL_CONFIG --libs`
      AC_SUBST(SDL_CFLAGS)
      AC_SUBST(SDL_LIBS)
      have_sdl="yes"
   fi
fi

if test "x${have_sdl}" = "xyes" ; then
   PKG_CHECK_EXISTS([sdl >= 1.3.0],
      [AC_DEFINE(BUILD_ECORE_EVAS_SDL_130, 1, [Support for SVN SDL])])
fi


# DirectFB library (ecore_directfb)

PKG_CHECK_MODULES([DIRECTFB],
   [directfb >= 0.9.16],
   [have_directfb="yes"],
   [have_directfb="no"])


# Eet library (ecore_config)

#PKG_CHECK_MODULES([EET],
#   [eet >= 1.6.99],
#   [have_eet="yes"],
#   [have_eet="no"])


# Xlib and XCB (ecore_x)

AC_CHECK_DECL([MAXHOSTNAMELEN], [FOUND_MAXHOSTNAMELEN=yes])

if test "x${FOUND_MAXHOSTNAMELEN}" != "xyes" ; then
   AC_MSG_CHECKING([for header that defines MAXHOSTNAMELEN])
   FOUND_MAXHOSTNAMELEN="not found"

   AC_COMPILE_IFELSE(
      [
       AC_LANG_PROGRAM(
          [[
#include <sys/param.h>
          ]],
          [[
int h = MAXHOSTNAMELEN;
          ]])
      ],
      [
       FOUND_MAXHOSTNAMELEN="sys/param.h"
       AC_DEFINE([NEED_SYS_PARAM_H], [1], [Define to 1 if you need <sys/param.h> to define MAXHOSTNAMELEN])
      ])

   AC_COMPILE_IFELSE(
      [
       AC_LANG_PROGRAM(
          [[
#include <netdb.h>
          ]],
          [[
int h = MAXHOSTNAMELEN;
          ]])
      ],
      [
       FOUND_MAXHOSTNAMELEN="netdb.h"
       AC_DEFINE([NEED_NETDB_H], [1], [Define to 1 if you need <netdb.h> to define MAXHOSTNAMELEN])
      ])

   AC_MSG_RESULT([$FOUND_MAXHOSTNAMELEN])
fi

have_x="no"
have_ecore_x="no"
have_ecore_x_xlib="no"
have_ecore_x_xcb="no"

x_dir="";
x_includes="";
x_cflags="";
x_libs="";

ecore_x_libs_private=""

AC_ARG_ENABLE(ecore-x-composite,
   [AC_HELP_STRING([--disable-ecore-x-composite],
       [disable the ecore_x support for Xcomposite extension.
        @<:@default=detect@:>@])],
   [want_ecore_x_composite=$enableval])

AC_ARG_ENABLE(ecore-x-damage,
   [AC_HELP_STRING([--disable-ecore-x-damage],
       [disable the ecore_x support for Xdamage extension.
        @<:@default=detect@:>@])],
   [want_ecore_x_damage=$enableval])

AC_ARG_ENABLE(ecore-x-dpms,
   [AC_HELP_STRING([--disable-ecore-x-dpms],
       [disable the ecore_x support for Xdpms extension.
        @<:@default=detect@:>@])],
   [want_ecore_x_dpms=$enableval])

AC_ARG_ENABLE(ecore-x-randr,
   [AC_HELP_STRING([--disable-ecore-x-randr],
       [disable the ecore_x support for Xrandr extension.
        @<:@default=detect@:>@])],
   [want_ecore_x_randr=$enableval])

AC_ARG_ENABLE(ecore-x-render,
   [AC_HELP_STRING([--disable-ecore-x-render],
       [disable the ecore_x support for Xrender extension.
        @<:@default=detect@:>@])],
   [want_ecore_x_render=$enableval])

AC_ARG_ENABLE(ecore-x-screensaver,
   [AC_HELP_STRING([--disable-ecore-x-screensaver],
       [disable the ecore_x support for Xscreensaver extension.
        @<:@default=detect@:>@])],
   [want_ecore_x_screensaver=$enableval])

AC_ARG_ENABLE(ecore-x-shape,
   [AC_HELP_STRING([--disable-ecore-x-shape],
       [disable the ecore_x support for Xshape extension.
        @<:@default=detect@:>@])],
   [want_ecore_x_shape=$enableval])

AC_ARG_ENABLE(ecore-x-gesture,
   [AC_HELP_STRING([--enable-ecore-x-gesture],
       [enable the ecore_x support for Xgesture extension.
        @<:@default=detect@:>@])],
   [want_ecore_x_gesture=$enableval])

AC_ARG_ENABLE(ecore-x-sync,
   [AC_HELP_STRING([--disable-ecore-x-sync],
       [disable the ecore_x support for Xsync extension.
        @<:@default=detect@:>@])],
   [want_ecore_x_sync=$enableval])

AC_ARG_ENABLE(ecore-x-xfixes,
   [AC_HELP_STRING([--disable-ecore-x-xfixes],
       [disable the ecore_x support for Xfixes extension.
        @<:@default=detect@:>@])],
   [want_ecore_x_xfixes=$enableval])

AC_ARG_ENABLE(ecore-x-xinerama,
   [AC_HELP_STRING([--disable-ecore-x-xinerama],
       [disable the ecore_x support for Xinerama extension.
        @<:@default=detect@:>@])],
   [want_ecore_x_xinerama=$enableval])

AC_ARG_ENABLE(ecore-x-xprint,
   [AC_HELP_STRING([--disable-ecore-x-xprint],
       [disable the ecore_x support for Xprint extension.
        @<:@default=detect@:>@])],
   [want_ecore_x_xprint=$enableval])

AC_ARG_ENABLE(ecore-x-xtest,
   [AC_HELP_STRING([--disable-ecore-x-xtest],
       [disable the ecore_x support for Xtest extension.
        @<:@default=detect@:>@])],
   [want_ecore_x_xtest=$enableval])

AC_ARG_ENABLE(ecore-x-cursor,
   [AC_HELP_STRING([--disable-ecore-x-cursor],
       [disable the ecore_x support for Xcursor extension.
        @<:@default=detect@:>@])],
   [want_ecore_x_cursor=$enableval])

AC_ARG_ENABLE(ecore-x-input,
   [AC_HELP_STRING([--disable-ecore-x-input],
       [disable the ecore_x support for Xinput/Xinput2 extension.
        @<:@default=detect@:>@])],
   [want_ecore_x_input=$enableval])

AC_ARG_ENABLE(ecore-x-dri,
   [AC_HELP_STRING([--disable-ecore-x-dri],
       [disable the ecore_x support for DRI extension.
        @<:@default=detect@:>@])],
   [want_ecore_x_dri=$enableval])

AC_ARG_ENABLE(ecore-x-xcb,
   [AC_HELP_STRING([--enable-ecore-x-xcb],
       [enable the ecore_x module with XCB backend. @<:@default=disabled@:>@])],
   [want_ecore_x_xcb=$enableval])

AC_MSG_CHECKING(whether ecore_x with XCB backend is to be built)
AC_MSG_RESULT($want_ecore_x_xcb)

if test "x$want_ecore_x_xcb" = "xyes" ; then

  AC_MSG_CHECKING([keysym definitions])
  KEYSYMDEFDIR=`$PKG_CONFIG --variable=includedir xproto`/X11
  FILES="keysymdef.h XF86keysym.h Sunkeysym.h DECkeysym.h HPkeysym.h"
  for i in $FILES; do
      if test -f "$KEYSYMDEFDIR/$i"; then
        KEYSYMDEFS="$KEYSYMDEFS $KEYSYMDEFDIR/$i"
      elif test "x$i" = "xkeysymdef.h"; then
        AC_MSG_ERROR([Cannot find keysymdef.h])
      fi
  done
  AC_MSG_RESULT([$KEYSYMDEFS])
  AC_SUBST(KEYSYMDEFS)

  have_iconv="no"
  AC_ARG_WITH([iconv-link],
    AC_HELP_STRING([--with-iconv-link=ICONV_LINK], [explicitly specify an iconv link option]),
      [
        LIBS="$withval $LIBS"
        have_iconv="yes"
      ])

  AC_MSG_CHECKING(for explicit iconv link options)
  if test "x${iconv_libs}" = "x" ; then
    AC_MSG_RESULT([no explicit iconv link option])
  else
    AC_MSG_RESULT([$iconv_libs])
  fi

  if test "x${have_iconv}" = "xno" ; then
    AC_CHECK_HEADERS([iconv.h], [have_iconv="yes"])

    if test "x${have_iconv}" = "xyes" ; then
      AC_MSG_CHECKING([whether iconv() is in libc])

      AC_LINK_IFELSE(
        [AC_LANG_PROGRAM(
        [[
          #include <stdlib.h>
          #include <iconv.h>
        ]],
        [[
          iconv_t ic;
          size_t count = iconv(ic, NULL, NULL, NULL, NULL);
        ]])],
        [have_iconv="yes"],
        [have_iconv="no"])

      AC_MSG_RESULT([${have_iconv}])
    fi

    if test "x${have_iconv}" = "xno" ; then
      AC_MSG_CHECKING([whether iconv() is in libiconv.a])

      LIBS_save="${LIBS}"
      LIBS="-liconv $LIBS"
      AC_LINK_IFELSE(
      [AC_LANG_PROGRAM(
        [[
          #include <stdlib.h>
          #include <iconv.h>
        ]],
        [[
          iconv_t ic;
          size_t count;
          count = iconv(ic, NULL, NULL, NULL, NULL);
        ]])],
        [have_iconv="yes"],
        [
          have_iconv="no"
          LIBS=${LIBS_save}
        ])

      AC_MSG_RESULT([${have_iconv}])
    fi

    if test "x${have_iconv}" = "xno" ; then
      AC_MSG_CHECKING([whether iconv() is in libiconv_plug.a])

      LIBS_save="${LIBS}"
      LIBS="-liconv_plug $LIBS"
      AC_LINK_IFELSE(
      [AC_LANG_PROGRAM(
      [[
        #include <stdlib.h>
        #include <iconv.h>
      ]],
      [[
        iconv_t ic;
        size_t count = iconv(ic, NULL, NULL, NULL, NULL);
      ]])],
      [have_iconv="yes"],
      [
        have_iconv="no"
        LIBS=${LIBS_save}
      ])

      AC_MSG_RESULT([${have_iconv}])
    fi

    if test "x${have_iconv}" = "xyes" ; then
      AC_DEFINE([HAVE_ICONV], [1], [Set to 1 if iconv library is installed])
    fi
  fi

  PKG_CHECK_MODULES(ECORE_XCB, x11-xcb xcb xcb-shm xcb-event xcb-icccm >= 0.3.8 xcb-util >= 0.3.8 xcb-image xcb-keysyms >= 0.3.8,
    [ have_ecore_x_xcb="yes"
      requirements_ecore_x="x11-xcb xcb xcb-shm xcb-event xcb-icccm xcb-util xcb-image xcb-keysyms ${requirements_ecore_x}"
    ],
    [ 
	PKG_CHECK_MODULES(ECORE_XCB, x11-xcb xcb xcb-event xcb-shm xcb-icccm xcb-image xcb-keysyms, 
	  [ have_ecore_x_xcb="yes"
	    AC_DEFINE(OLD_XCB_VERSION, 1, [xcb version])
	    requirements_ecore_x="x11-xcb xcb xcb-event xcb-shm xcb-icccm xcb-image xcb-keysyms ${requirements_ecore_x}" ],
	  [ have_ecore_x_xcb="no" ])
    ], 
    [have_ecore_x_xcb="no" ])

  if test "x$have_ecore_x_xcb" = "xyes" ; then

   PKG_CHECK_MODULES([PIXMAN],
      [pixman-1],
      [
       have_pixman="yes"
       AC_DEFINE(HAVE_PIXMAN, 1, [have pixman for rendering])
       requirements_ecore_x="pixman-1 ${requirements_ecore_x}"
      ],
      [
       if test "x${want_pixman}" = "xyes" -a "x${use_strict}" = "xyes" ; then
          AC_MSG_ERROR([Pixman not found (strict dependencies checking)])
       fi
      ])

    if test "x$want_ecore_x_composite" != "xno"; then
      PKG_CHECK_MODULES(XCB_COMPOSITE, xcb-composite,
        [ have_ecore_x_xcb_composite="yes"
          requirements_ecore_x="xcb-composite ${requirements_ecore_x}"
          AC_DEFINE(ECORE_XCB_COMPOSITE, 1, [Build support for XCB composite]) ],
        [ have_ecore_x_xcb_composite="no" ])
    else
      have_ecore_x_xcb_composite="no"
      AC_MSG_NOTICE("composite extension explicitly disabled")
    fi

    if test "x$want_ecore_x_damage" != "xno"; then
      PKG_CHECK_MODULES(XCB_DAMAGE, xcb-damage,
        [ have_ecore_x_xcb_damage="yes"
          requirements_ecore_x="xcb-damage ${requirements_ecore_x}"
          AC_DEFINE(ECORE_XCB_DAMAGE, 1, [Build support for XCB damage]) ],
        [ have_ecore_x_xcb_damage="no" ])
    else
      have_ecore_x_xcb_damage="no"
      AC_MSG_NOTICE("damage extension explicitly disabled")
    fi

    if test "x$want_ecore_x_dpms" != "xno"; then
      PKG_CHECK_MODULES(XCB_DPMS, xcb-dpms,
        [ have_ecore_x_xcb_dpms="yes"
          requirements_ecore_x="xcb-dpms ${requirements_ecore_x}"
          AC_DEFINE(ECORE_XCB_DPMS, 1, [Build support for XCB dpms]) ],
        [ have_ecore_x_xcb_dpms="no" ])
    else
      have_ecore_x_xcb_dpms="no"
      AC_MSG_NOTICE("dpms extension explicitly disabled")
    fi

    if test "x$want_ecore_x_randr" != "xno"; then
      PKG_CHECK_MODULES(XCB_RANDR, xcb-randr,
        [ have_ecore_x_xcb_randr="yes"
          requirements_ecore_x="xcb-randr ${requirements_ecore_x}"
          AC_DEFINE(ECORE_XCB_RANDR, 1, [Build support for XCB randr]) ],
        [ have_ecore_x_xcb_randr="no" ])
    else
      have_ecore_x_xcb_randr="no"
      AC_MSG_NOTICE("randr extension explicitly disabled")
    fi

    if test "x$want_ecore_x_render" != "xno"; then
      PKG_CHECK_MODULES(XCB_RENDER, xcb-render xcb-renderutil,
        [ have_ecore_x_xcb_render="yes"
          requirements_ecore_x="xcb-render xcb-renderutil ${requirements_ecore_x}"
          AC_DEFINE(ECORE_XCB_RENDER, 1, [Build support for XCB render]) ],
        [ have_ecore_x_xcb_render="no" ])
    else
      have_ecore_x_xcb_render="no"
      AC_MSG_NOTICE("render extension explicitly disabled")
    fi

    if test "x$want_ecore_x_screensaver" != "xno"; then
      PKG_CHECK_MODULES(XCB_SCREENSAVER, xcb-screensaver,
        [ have_ecore_x_xcb_screensaver="yes"
          requirements_ecore_x="xcb-screensaver ${requirements_ecore_x}"
          AC_DEFINE(ECORE_XCB_SCREENSAVER, 1, [Build support for XCB screensaver]) ],
        [ have_ecore_x_xcb_screensaver="no" ])
    else
      have_ecore_x_xcb_screensaver="no"
      AC_MSG_NOTICE("screensaver extension explicitly disabled")
    fi

    if test "x$want_ecore_x_shape" != "xno"; then
      PKG_CHECK_MODULES(XCB_SHAPE, xcb-shape,
        [ have_ecore_x_xcb_shape="yes"
          requirements_ecore_x="xcb-shape ${requirements_ecore_x}"
          AC_DEFINE(ECORE_XCB_SHAPE, 1, [Build support for XCB shape]) ],
        [ have_ecore_x_xcb_shape="no" ])
    else
      have_ecore_x_xcb_shape="no"
      AC_MSG_NOTICE("shape extension explicitly disabled")
    fi

    if test "x$want_ecore_x_gesture" != "xno"; then
      PKG_CHECK_MODULES(XCB_XGESTURE, xcb-gesture,
        [ have_ecore_x_xcb_gesture="yes"
          requirements_ecore_x="xcb-gesture ${requirements_ecore_x}"
          AC_DEFINE(ECORE_XCB_XGESTURE, 1, [Build support for XCB gesture]) ],
        [ have_ecore_x_xcb_gesture="no" ])
    else
      have_ecore_x_xcb_gesture="no"
      AC_MSG_NOTICE("gesture extension explicitly disabled")
    fi

    if test "x$want_ecore_x_sync" != "xno"; then
      PKG_CHECK_MODULES(XCB_SYNC, xcb-sync,
        [ have_ecore_x_xcb_sync="yes"
          requirements_ecore_x="xcb-sync ${requirements_ecore_x}"
          AC_DEFINE(ECORE_XCB_SYNC, 1, [Build support for XCB sync]) ],
        [ have_ecore_x_xcb_sync="no" ])
    else
      have_ecore_x_xcb_sync="no"
      AC_MSG_NOTICE("sync extension explicitly disabled")
    fi

    if test "x$want_ecore_x_xfixes" != "xno"; then
      PKG_CHECK_MODULES(XCB_XFIXES, xcb-xfixes,
        [ have_ecore_x_xcb_xfixes="yes"
          requirements_ecore_x="xcb-xfixes ${requirements_ecore_x}"
          AC_DEFINE(ECORE_XCB_XFIXES, 1, [Build support for XCB xfixes]) ],
        [ have_ecore_x_xcb_xfixes="no" ])
    else
      have_ecore_x_xcb_xfixes="no"
      AC_MSG_NOTICE("xfixes extension explicitly disabled")
    fi

    if test "x$want_ecore_x_xinerama" != "xno"; then
      PKG_CHECK_MODULES(XCB_XINERAMA, xcb-xinerama,
        [ have_ecore_x_xcb_xinerama="yes"
          requirements_ecore_x="xcb-xinerama ${requirements_ecore_x}"
          AC_DEFINE(ECORE_XCB_XINERAMA, 1, [Build support for XCB xinerama]) ],
        [ have_ecore_x_xcb_xinerama="no" ])
    else
      have_ecore_x_xcb_xinerama="no"
      AC_MSG_NOTICE("xinerama extension explicitly disabled")
    fi

    if test "x$want_ecore_x_xprint" != "xno"; then
      PKG_CHECK_MODULES(XCB_XPRINT, xcb-xprint,
        [ have_ecore_x_xcb_xprint="yes"
          requirements_ecore_x="xcb-xprint ${requirements_ecore_x}"
          AC_DEFINE(ECORE_XCB_XPRINT, 1, [Build support for XCB xprint]) ],
        [ have_ecore_x_xcb_xprint="no" ])
    else
      have_ecore_x_xcb_xprint="no"
      AC_MSG_NOTICE("xprint extension explicitly disabled")
    fi

    if test "x$want_ecore_x_xtest" != "xno"; then
      PKG_CHECK_MODULES(XCB_XTEST, xcb-xtest,
        [ have_ecore_x_xcb_xtest="yes"
          requirements_ecore_x="xcb-xtest ${requirements_ecore_x}"
          AC_DEFINE(ECORE_XCB_XTEST, 1, [Build support for XCB xtest]) ],
        [ have_ecore_x_xcb_xtest="no" ])
    else
      have_ecore_x_xcb_xtest="no"
      AC_MSG_NOTICE("xtest extension explicitly disabled")
    fi

# input extension disabled currently in xcb as xcb-input has some issues
    want_ecore_x_input="no"
    if test "x$want_ecore_x_input" != "xno"; then
      PKG_CHECK_MODULES(XCB_XINPUT, xcb-xinput,
        [ have_ecore_x_xcb_xinput="yes"
          requirements_ecore_x="xcb-xinput ${requirements_ecore_x}"
          AC_DEFINE(ECORE_XCB_XINPUT, 1, [Build support for XCB xinput]) ],
        [ have_ecore_x_xcb_xinput="no" ])
    else
      have_ecore_x_xcb_xinput="no"
      AC_MSG_NOTICE("xinput extension explicitly disabled")
    fi

    if test "x$want_ecore_x_cursor" != "xno"; then
      PKG_CHECK_MODULES(XCB_CURSOR, xcb-render xcb-renderutil,
        [ have_ecore_x_xcb_cursor="yes"
          requirements_ecore_x="xcb-render xcb-renderutil ${requirements_ecore_x}"
          AC_DEFINE(ECORE_XCB_CURSOR, 1, [Build support for XCB cursor]) ],
        [ have_ecore_x_xcb_cursor="no" ])
    else
      have_ecore_x_xcb_cursor="no"
      AC_MSG_NOTICE("cursor extension explicitly disabled")
    fi

#    if test "x$want_ecore_x_dri" != "xno"; then
#      PKG_CHECK_MODULES(XCB_DRI, xcb-dri2,
#        [ have_ecore_x_xcb_dri="yes"
#          requirements_ecore_x="xcb-dri2 ${requirements_ecore_x}"
#          AC_DEFINE(ECORE_XCB_DRI, 1, [Build support for XCB dri/dri2]) ],
#        [ have_ecore_x_xcb_dri="no" ])
#    else
#      have_ecore_x_xcb_dri="no"
#      AC_MSG_NOTICE("dri extension explicitly disabled")
#    fi

    AC_DEFINE(HAVE_ECORE_X_XCB, 1, [Defined to 1 if XCB is enabled.])

    x_cflags=$ECORE_XCB_CFLAGS
    x_libs=$ECORE_XCB_LIBS
    have_x="yes"

    have_ecore_x_xcb_define="-DHAVE_ECORE_X_XCB"
    AC_SUBST(have_ecore_x_xcb_define)
  fi
fi

if ! test "x$have_ecore_x_xcb" = "xyes" ; then
  AC_PATH_XTRA
  AC_CHECK_HEADER(X11/X.h,
    [
     if test "x$want_evas_simple_x11" = "xyes"; then
       x_libs="${x_libs} -lX11 -lXext"
     else
       x_dir=${x_dir:-/usr/X11R6}
       x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}}
       x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext"
     fi
     have_ecore_x_xlib="yes"
    ]
  )

  if test "x$have_ecore_x_xlib" = "xyes"; then
    Xcursor_libs=""
    Xcursor_cflags=""
    use_Xcursor="no"
    PCFLAGS=$CFLAGS
    CFLAGS="$x_cflags $x_includes"

    if test "x$want_ecore_x_cursor" = "xyes"; then
      AC_CHECK_HEADER(X11/Xcursor/Xcursor.h,
        [
          AC_CHECK_LIB(Xcursor, XcursorImageLoadCursor,
            [
              AC_DEFINE(ECORE_XCURSOR, 1, [Build support for Xcursor])
              Xcursor_cflags=""
              Xcursor_libs="-lXcursor"
              use_Xcursor="yes"
            ], [
              Xcursor_cflags=""
              Xcursor_libs=""
              use_Xcursor="no"
            ], [
              $x_libs -lXrender
            ]
          )
        ], [
          Xcursor_cflags=""
          Xcursor_libs=""
          use_Xcursor="no"
        ], [
          #include <X11/Xlib.h>
        ]
      )
      CFLAGS=$PCFLAGS
    else
      Xcursor_cflags=""
      Xcursor_libs=""
      use_Xcursor="no"
      AC_MSG_NOTICE("Xcursor explicitly disabled")
    fi

    AC_SUBST(Xcursor_cflags)
    AC_SUBST(Xcursor_libs)

    ECORE_CHECK_X_EXTENSION([Xkb], [XKB.h], [X11], [XkbSetDetectableAutoRepeat], [$want_ecore_x_xkb])
    ECORE_CHECK_X_EXTENSION([Xcomposite], [Xcomposite.h], [Xcomposite], [XCompositeQueryExtension], [$want_ecore_x_composite])
    ECORE_CHECK_X_EXTENSION([Xdamage], [Xdamage.h], [Xdamage], [XDamageSubtract], [$want_ecore_x_damage])
    ECORE_CHECK_X_EXTENSION([Xdpms], [dpms.h], [Xdpms], [DPMSQueryExtension], [$want_ecore_x_dpms])
    if test "x$use_xdpms" = "xno" ; then
      ECORE_CHECK_X_EXTENSION([Xdpms], [dpms.h], [Xext], [DPMSQueryExtension], [$want_ecore_x_dpms])
    fi
    ECORE_CHECK_X_EXTENSION([Xfixes], [Xfixes.h], [Xfixes], [XFixesExpandRegion], [$want_ecore_x_xfixes])
    ECORE_CHECK_X_EXTENSION([Xinerama], [Xinerama.h], [Xinerama], [XineramaQueryScreens], [$want_ecore_x_xinerama])
    ECORE_CHECK_X_EXTENSION([Xprint], [Print.h], [Xp], [XpQueryScreens], [$want_ecore_x_xprint])
    ECORE_CHECK_X_EXTENSION([Xrandr], [Xrandr.h], [Xrandr], [XRRGetScreenResourcesCurrent], [$want_ecore_x_randr])
    ECORE_CHECK_X_EXTENSION([Xgesture], [gesture.h], [Xgesture], [XGestureQueryExtension], [$want_ecore_x_gesture])
    ECORE_CHECK_X_EXTENSION([Xrender], [Xrender.h], [Xrender], [XRenderFindVisualFormat], [$want_ecore_x_render])
    ECORE_CHECK_X_EXTENSION([Xtest], [XTest.h], [Xtst], [XTestFakeKeyEvent], [$want_ecore_x_xtest])
    ECORE_CHECK_X_EXTENSION([Xss], [scrnsaver.h], [Xss], [XScreenSaverSelectInput], [$want_ecore_x_screensaver])
    ECORE_CHECK_X_EXTENSION([Xi2], [XInput2.h], [Xi], [XIQueryDevice], [$want_ecore_x_input])

    ecore_x_libs_private="${Xcursor_libs} ${XKB_LIBS} ${XCOMPOSITE_LIBS} ${XGESTURE_LIBS} ${XDAMAGE_LIBS} ${XDPMS_LIBS} ${XFIXES_LIBS} ${XINERAMA_LIBS} ${XPRINT_LIBS} ${XRANDR_LIBS} ${XRENDER_LIBS} ${XTEST_LIBS} ${XSS_LIBS} ${XI2_LIBS}"

    AC_DEFINE(HAVE_ECORE_X_XLIB, 1, [Defined to 1 if Xlib is enabled.])
    have_x="yes"

    have_ecore_x_xlib="yes"
  fi
fi

AC_SUBST(x_cflags)
AC_SUBST(x_includes)
AC_SUBST(x_libs)
AC_SUBST(ecore_x_libs_private)

AM_CONDITIONAL(BUILD_ECORE_X_XLIB, test $have_ecore_x_xlib = yes)
AM_CONDITIONAL(BUILD_ECORE_X_XCB, test $have_ecore_x_xcb = yes)


# Evas library (ecore_config, ecore_input_evas, ecore_imf_evas and ecore_evas)

PKG_CHECK_MODULES([EVAS], [evas >= 1.6.99],
   [have_evas="yes"],
   [have_evas="no"])


### Checks for header files

AC_CHECK_HEADERS([sys/select.h sys/prctl.h])

EFL_CHECK_PATH_MAX

AC_HEADER_SYS_WAIT
AC_SYS_LARGEFILE

have_addrinfo="no"
case "$host_os" in
   mingw* | cegcc*)
      AC_DEFINE(HAVE_DLFCN_H, 1, [Define to 1 if you have the <dlfcn.h> header file.])
      AC_DEFINE(HAVE_SYS_MMAN_H, 1, [Define to 1 if you have the <sys/mman.h> header file.])
      AC_DEFINE(HAVE_SYS_TIME_H, 1, [Define to 1 if you have the <sys/time.h> header file.])
      have_addrinfo="yes"
      ;;
   *)
      AC_CHECK_HEADERS([dlfcn.h features.h langinfo.h locale.h sys/time.h sys/mman.h signal.h sys/resource.h])
      ;;
esac

# ecore_con

AC_CHECK_HEADERS([sys/socket.h])
AC_CHECK_HEADERS([net/if.h], [], [],
[
#include <stdio.h>
#ifdef STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
# ifdef HAVE_STDLIB_H
#  include <stdlib.h>
# endif
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
])
AC_CHECK_HEADERS([sys/un.h arpa/inet.h arpa/nameser.h netinet/tcp.h netinet/in.h ws2tcpip.h netdb.h errno.h])

if test "x${ac_cv_header_netdb_h}" = "xyes" ; then
   have_addrinfo="yes"
fi

# Framebuffer (ecore_fb)
have_fb="no"
AC_CHECK_HEADER([linux/fb.h],
   [AC_CHECK_HEADER([linux/input.h], [have_fb="yes"])])

# Cocoa header files (ecore_cocoa)

if test "x${want_ecore_cocoa}" = "xyes" ; then
   cocoa_ldflags=""
   have_cocoa="no"
   m4_ifdef([AC_PROG_OBJC],
      [
       if test "x${have_gnu_objc}" = "xyes" ; then
          AC_LANG_PUSH([Objective C])
          LIBS_save="$LIBS"
          LIBS="$LIBS -framework Cocoa"
          AC_LINK_IFELSE(
             [AC_LANG_PROGRAM(
                 [[
#include <Cocoa/Cocoa.h>
                 ]],
                 [[
NSWindow *window;
window = [[NSWindow alloc]
           initWithContentRect:NSMakeRect(0, 0, 1, 1)
           styleMask:(NSTitledWindowMask)
           backing:NSBackingStoreBuffered
           defer:NO
           screen:nil
         ];
                 ]])],
             [
              have_cocoa="yes"
              cocoa_ldflags="-framework Cocoa"
             ],
             [have_cocoa="no"])
          LIBS="$LIBS_save"
          AC_MSG_CHECKING([whether Cocoa framework is supported])
          AC_MSG_RESULT([${have_cocoa}])
          AC_LANG_POP([Objective C])
       fi
   ])
fi
AC_SUBST(cocoa_ldflags)

want_epoll=yes
AC_ARG_ENABLE(epoll,
  AC_HELP_STRING([--enable-epoll], [enable or disable epoll support]),
  [want_epoll=$enableval])

if test "x${want_epoll}" = "xyes" ; then
  # check for epoll support
  AC_CHECK_HEADERS([sys/epoll.h])
fi

# timerfd_create
AC_CHECK_HEADERS([sys/timerfd.h])
AC_CHECK_FUNCS(timerfd_create)

# thread support

EFL_CHECK_THREADS(
   [
    if test "x${_efl_have_posix_threads}" = "xyes" ; then
       have_threads="POSIX"
    else
       if test "x${_efl_have_win32_threads}" = "xyes" ; then
          have_threads="Win32"
       else
          have_threads="no"
       fi
    fi
   ],
   [have_threads="no"])

### enable thread safety if we have threads, unless specifically asked not to
if test "x${have_threads}" = "xno"
then
  want_thread_safety="no"
else
  want_thread_safety="no"  # to be changed to yes when ready
  AC_ARG_ENABLE(thread-safety,
    AC_HELP_STRING([--enable-thread-safety], [enable or disable thread safety]),
    [want_thread_safety=$enableval])
fi

if test "x${want_thread_safety}" = "xyes"
then
   AC_DEFINE([HAVE_THREAD_SAFETY], [1], [Define to enable thread safety])
fi

### Checks for types
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)


### Checks for structures


### Checks for compiler characteristics
AC_PROG_CC_STDC
AC_C_CONST
AC_C_BIGENDIAN
AC_HEADER_STDC
AC_C___ATTRIBUTE__

WIN32_CPPFLAGS=""
WIN32_CFLAGS=""
case "$host_os" in
   mingw32ce*)
      WIN32_CPPFLAGS="-D_WIN32_WCE=0x0420"
      ;;
   cegcc*)
      WIN32_CPPFLAGS="-D_WIN32_WCE=0x0420"
      WIN32_CFLAGS="-mwin32"
      ;;
   mingw*)
      WIN32_CPPFLAGS="-D_WIN32_WINNT=0x0501"
      ;;
esac
AC_SUBST(WIN32_CPPFLAGS)
AC_SUBST(WIN32_CFLAGS)


### Checks for linker characteristics

# use --enable-auto-import on Windows

lt_enable_auto_import=""
case "$host_os" in
   mingw* | cegcc*)
      lt_enable_auto_import="-Wl,--enable-auto-import"
      ;;
esac
AC_SUBST(lt_enable_auto_import)

### Checks for library functions
AC_ISC_POSIX
AC_FUNC_ALLOCA
AC_CHECK_FUNCS([gettimeofday strlcpy execvp])

AC_COMPILE_IFELSE(
   [AC_LANG_PROGRAM(
       [[
#include <math.h>
       ]],
       [[
int i = isfinite(0);
       ]])],
   [
    AC_DEFINE(HAVE_ISFINITE, 1, [Define to 1 if you have `isfinite', as a function or macro.])
    have_isfinite="yes"
   ],
   [have_isfinite="no"])

AC_MSG_CHECKING([for isfinite])
AC_MSG_RESULT([${have_isfinite}])

have_atfile_source=auto
AC_ARG_ENABLE([atfile-source],
   [AC_HELP_STRING([--disable-atfile-source],
       [disable use of atfile source functions as openat and mkdirat @<:@default=detect@:>@])],
   [
    if test "x${enableval}" = "xyes" ; then
       have_atfile_source="yes"
    else
       have_atfile_source="no"
    fi],
   [have_atfile_source=auto])

if ! test "x${have_atfile_source}" = "xno" ; then
   AC_CHECK_FUNCS(mkdirat,
      [
       have_atfile_source="yes"
       AC_DEFINE(HAVE_ATFILE_SOURCE, 1, [mkdirat exists])
      ],
      [
       if test "x${have_atfile_source}" = "xyes" ; then
          AC_MSG_ERROR([required atfile-source but no mkdirat()])
       fi
       have_atfile_source="no"
      ])
fi

# shm_open
EFL_CHECK_SHM_OPEN([have_shm_open="yes"], [have_shm_open="no"])

### Checks for optionnal feature
AC_CHECK_FUNC([mallinfo],
   [
    have_mallinfo="yes"
    AC_DEFINE(HAVE_MALLINFO, 1, [Gather memory statistic])
   ],
   [have_mallinfo="no"])

### Ecore modules

## Core modules

# ecore_con
ECORE_CHECK_MODULE([con], [${want_ecore_con}], [Con], [${have_addrinfo}])

have_curl="no"
have_gnutls="no"
have_openssl="no"
have_cares="no"
want_ipv6="yes"
have_ipv6="no"

AC_ARG_ENABLE([ipv6],
   [AC_HELP_STRING([--disable-ipv6],
       [disable ipv6 functionality @<:@default=detect@:>@])],
   [
    if test "x${enableval}" = "xyes" ; then
       want_ipv6="yes"
    else
       want_ipv6="no"
    fi],
   [want_ipv6="auto"])

if test "x${have_ecore_con}" = "xyes" ; then

   # Verify IPV6 availability in headers
   if test "x${want_ipv6}" != "xno" ; then
      AC_CHECK_TYPES([struct ipv6_mreq],
         [have_ipv6="yes"],
         [have_ipv6="no"],
         [[
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_WS2TCPIP_H
# include <ws2tcpip.h>
#endif
         ]])
   fi

   if test "x${have_ipv6}" = "xyes" ; then
      AC_DEFINE(HAVE_IPV6, 1, [Define if IPV6 is supported])
   fi
   AM_CONDITIONAL([HAVE_IPV6], [test "x${have_ipv6}" = "xyes"])

   ECORE_CHECK_CURL([${want_curl}],
      [
       have_curl="yes"
       requirements_ecore_con="libcurl ${requirements_ecore_con}"
      ],
      [have_curl="no"])

   ECORE_CHECK_GNUTLS([${want_gnutls}],
      [have_gnutls="yes"],
      [have_gnutls="no"])

   ECORE_CHECK_OPENSSL([${want_openssl}],
      [have_openssl="yes"],
      [have_openssl="no"])

   if test "x${have_gnutls}" = "xyes" ; then
      requirements_ecore_con="gnutls ${requirements_ecore_con}"
      # no need to add it to req_ecore_ipc, since they
      # depends on ecore_con anyway.
   else
      if test "x${have_openssl}" = "xyes" ; then
         requirements_ecore_con="openssl ${requirements_ecore_con}"
         # no need to add it to req_ecore_ipc, since they
         # depends on ecore_con anyway.
      fi
   fi

   ECORE_CHECK_CARES([${want_cares}],
      [
       have_cares="yes"
       requirements_ecore_con="libcares ${requirements_ecore_con}"
      ],
      [have_cares="no"])

fi

EFL_CHECK_COMPILER_FLAGS([ECORE_CON], [-Wno-override-init -Wno-initializer-overrides])

AM_CONDITIONAL([HAVE_CARES], [test "x${have_cares}" = "xyes"])

# ecore_ipc
ECORE_CHECK_MODULE([ipc], [${want_ecore_ipc}], [Ipc], [${have_ecore_con}],
   [
     requirements_ecore_ipc="ecore-con >= 1.6.99 ${requirements_ecore_ipc}"
     requirements_ecore_evas="ecore-ipc >= 1.6.99 ${requirements_ecore_evas}"
   ])

# ecore_file
ECORE_CHECK_MODULE([file], [${want_ecore_file}], [File])

have_poll="no"
have_inotify="no"
have_notify_win32="no"
if test "x${have_ecore_file}" = "xyes" ; then
   ECORE_CHECK_POLL([${want_poll}], [have_poll="yes"], [have_poll="no"])
   ECORE_CHECK_INOTIFY([${want_inotify}], [have_inotify="yes"], [have_inotify="no"])
   ECORE_CHECK_NOTIFY_WIN32([${want_notify_win32}], [have_notify_win32="yes"], [have_notify_win32="no"])

   if test "x${have_ecore_con}" = "xyes" ; then
      requirements_ecore_file="ecore-con >= 1.6.99 ${requirements_ecore_file}"
   else
      ECORE_CHECK_CURL([${want_curl}],
         [
          have_curl="yes"
          requirements_ecore_file="libcurl ${requirements_ecore_file}"
         ],
         [have_curl="no"])
   fi

fi

# ecore_config
#ecore_config_deps="no"
#if test "x${have_eet}" = "xyes" -a "x${have_evas}"  -a "x${have_ecore_ipc}" ; then
#   ecore_config_deps="yes"
#fi

#ECORE_CHECK_MODULE([config], [${want_ecore_config}], [Config], [${ecore_config_deps}],
#   [requirements_ecore_config="ecore-ipc >= 1.6.99 evas >= 1.6.99 eet >= 1.6.99 ${requirements_ecore_config}"])

AM_CONDITIONAL(BUILD_ECORE_CONFIG, false)

# ecore_imf

ECORE_CHECK_MODULE([imf], [${want_ecore_imf}], [Imf])

# ecore_imf_evas

ecore_imf_evas_deps="no"
if test "x${have_ecore_imf}" = "xyes" -a "x${have_evas}" = "xyes" ; then
   ecore_imf_evas_deps="yes"
fi

ECORE_CHECK_MODULE([imf-evas], [${want_ecore_imf}], [Imf_Evas], [${ecore_imf_evas_deps}],
   [requirements_ecore_imf_evas="ecore-imf >= 1.6.99 evas >= 1.6.99 ${requirements_ecore_imf_evas}"])

# ecore_input{_evas}
ECORE_CHECK_MODULE([input], [${want_ecore_input}], [Input])
ECORE_CHECK_MODULE([input-evas], [${want_ecore_input}], [Input_Evas], [${have_evas}],
   [requirements_ecore_input_evas="ecore-input >= 1.6.99 evas >= 1.6.99 ${requirements_ecore_input}"])

# ecore_imf_xim
AM_CONDITIONAL(BUILD_ECORE_IMF_XIM, false)
ecore_imf_xim_deps="no"
echo "have_ecore_x_xlib: ${have_ecore_x_xlib}"
if test    "x${have_ecore_imf}" = "xyes" \
        -a "x${have_ecore_x_xlib}" = "xyes" \
        -a "x${have_ecore_input}" = "xyes" ; then
   ecore_imf_xim_deps="yes"
   AC_DEFINE(BUILD_ECORE_IMF_XIM, 1, [Ecore Imf XIM Support])
fi

ECORE_CHECK_MODULE([imf-xim], [${want_ecore_imf}], [Imf_XIM], [${ecore_imf_xim_deps}],
   [requirements_ecore_imf_xim="ecore-imf >= 1.6.99 ecore-x >= 1.6.99 ecore-input >= 1.6.99 ${requirements_ecore_imf_xim}"])

# ecore_imf_scim
PKG_CHECK_MODULES([SCIM], [scim], [have_scim="yes"], [have_scim="no"])

AM_CONDITIONAL(BUILD_ECORE_IMF_SCIM, false)
ecore_imf_scim_deps="no"
echo "have_ecore_x_xlib: ${have_ecore_x_xlib}"
if test    "x${have_ecore_imf}" = "xyes" \
        -a "x${have_scim}" =  "xyes" \
        -a "x${have_ecore_input}" = "xyes" ; then
   ecore_imf_scim_deps="yes"
   AC_DEFINE(BUILD_ECORE_IMF_SCIM, 1, [Ecore Imf SCIM Support])
fi

ECORE_CHECK_MODULE([imf-scim], [${want_ecore_imf}], [Imf_SCIM], [${ecore_imf_scim_deps}],
   [requirements_ecore_imf_scim="ecore-imf >= 1.6.99 ecore-x >= 1.6.99 ecore-input >= 1.6.99 ${requirements_ecore_imf_scim}"])

# ecore_imf_ibus
PKG_CHECK_MODULES([IBUS], [ibus-1.0 >= 1.4], [have_ibus="yes"], [have_ibus="no"])

AM_CONDITIONAL(BUILD_ECORE_IMF_IBUS, false)
ecore_imf_ibus_deps="no"
echo "have_ecore_x_xlib: ${have_ecore_x_xlib}"
if test    "x${have_ecore_imf}" = "xyes" \
        -a "x${have_glib}" =  "xyes" \
        -a "x${have_ibus}" =  "xyes" \
        -a "x${have_ecore_input}" = "xyes" ; then
   ecore_imf_ibus_deps="yes"
   AC_DEFINE(BUILD_ECORE_IMF_IBUS, 1, [Ecore Imf IBUS Support])
fi

ECORE_CHECK_MODULE([imf-ibus], [${want_ecore_imf}], [Imf_IBUS], [${ecore_imf_ibus_deps}],
   [requirements_ecore_imf_ibus="ecore-imf >= 1.6.99 ecore-x >= 1.6.99 ecore-input >= 1.6.99 ${requirements_ecore_imf_ibus}"])

## Graphic systems

# ecore_x{cb}

ecore_x_deps="no"
if test "x${have_x}" = "xyes" -a \
        "x${have_ecore_input}" = "xyes" ; then
   ecore_x_deps="yes"
fi

ECORE_CHECK_MODULE([x], [${want_ecore_x}], [X], [${ecore_x_deps}],
  [
   ecore_x_libs="$ecore_x_libs $x_libs"
   requirements_ecore_x="ecore-input >= 1.6.99 ${requirements_ecore_x}"
  ])

# ecore_win32

ECORE_CHECK_MODULE([win32], [${want_ecore_win32}], [Win32], [${have_ecore_input}],
   [
    ecore_win32_libs="-lole32 -lgdi32"
    requirements_ecore_win32="ecore-input >= 1.6.99 ${requirements_ecore_win32}"
   ])
AC_SUBST(ecore_win32_libs)

# ecore_cocoa

ecore_cocoa_deps="no"
if test "x${have_ecore_input}" = "xyes" -a "x${have_cocoa}" = "xyes" ; then
   ecore_cocoa_deps="yes"
fi

ECORE_CHECK_MODULE([cocoa], [${want_ecore_cocoa}], [Cocoa], [${ecore_cocoa_deps}],
   [requirements_ecore_cocoa="ecore-input >= 1.6.99 ${requirements_ecore_cocoa}"])

# ecore_sdl

ecore_sdl_deps="no"
if test "x${have_sdl}" = "xyes" -a "x${have_ecore_input}" = "xyes" ; then
   ecore_sdl_deps="yes"
fi

ECORE_CHECK_MODULE([sdl], [${want_ecore_sdl}], [Sdl], [${ecore_sdl_deps}],
   [requirements_ecore_sdl="ecore-input >= 1.6.99 ${requirements_ecore_sdl}"])

ECORE_CHECK_MODULE([psl1ght], [${want_ecore_psl1ght}], [psl1ght], [${ecore_psl1ght_deps}],
   [requirements_ecore_psl1ght="ecore-input >= 1.6.99 ${requirements_ecore_psl1ght}"])

# ecore_fb
ECORE_CHECK_MODULE([fb], [${want_ecore_fb}], [FB], [$have_fb])

if test "x${have_ecore_fb}" = "xyes" ; then
   ECORE_CHECK_TSLIB([${want_tslib}],
      [
       have_tslib="yes"
       requirements_ecore_fb="${_tslib_requirement} ${requirements_ecore_fb}"
      ],
      [have_tslib="no"])
fi

# ecore_directfb

ECORE_CHECK_MODULE([directfb], [${want_ecore_directfb}], [DirectFB], [${have_directfb}],
   [requirements_ecore_directfb="directfb ${requirements_ecore_directfb}"])

# ecore_wince

ECORE_CHECK_MODULE([wince], [${want_ecore_wince}], [WinCE], [${have_ecore_input}],
   [requirements_ecore_win32="ecore-input >= 1.6.99 ${requirements_ecore_win32}"])

## Ecore Evas

# ecore_evas

ecore_evas_deps="no"
if test "x${have_evas}" = "xyes" && test "x${have_ecore_input}" = "xyes" && test "x${have_ecore_input_evas}" = "xyes" ; then
   ecore_evas_deps="yes"
fi

ECORE_CHECK_MODULE([evas], [${want_ecore_evas}], [Evas], [${ecore_evas_deps}],
  [requirements_ecore_evas="ecore-input >= 1.6.99 ecore-input-evas >= 1.6.99 evas >= 1.6.99 ${requirements_ecore_evas}"])

# ecore_evas_buffer

ECORE_EVAS_CHECK_MODULE([software-buffer],
   [${want_ecore_evas_software_buffer}],
   [Software Buffer],
   [yes])

# ecore_evas_x11

# ecore_evas_software_x11

ECORE_EVAS_CHECK_MODULE([software-x11],
   [${want_ecore_evas_software_x11}],
   [Software X11],
   [${have_ecore_x}])

have_ecore_evas_software_xlib="no"
have_ecore_evas_software_xcb="no"
if test "x$have_ecore_evas_software_x11" = "xyes" ; then
   have_ecore_evas_software_xlib=`${PKG_CONFIG} --variable=Xlib evas-software-x11`
   if test "x${have_ecore_evas_software_xlib}" = "xstatic"; then
      have_ecore_evas_software_xlib="yes"
   fi
   if test "x${have_ecore_evas_software_xlib}" = "xyes" -a "x${have_ecore_x_xlib}" = "xyes" ; then
      AC_DEFINE(BUILD_ECORE_EVAS_SOFTWARE_XLIB, 1, [Evas Software Xlib Engine Support])
   fi
   have_ecore_evas_software_xcb=`${PKG_CONFIG} --variable=XCB evas-software-x11`
   if test "x$have_ecore_evas_software_xcb" = "xstatic"; then
      have_ecore_evas_software_xcb="yes"
   fi
   if test "x$have_ecore_evas_software_xcb" = "xyes" -a "x${have_ecore_x_xcb}" = "xyes" ; then
      AC_DEFINE(BUILD_ECORE_EVAS_SOFTWARE_XCB, 1, [Evas Software XCB Engine Support])
   fi
fi

# ecore_evas_opengl_x11

ECORE_EVAS_CHECK_MODULE([opengl-x11],
   [${want_ecore_evas_opengl_x11}],
   [OpenGL Xlib],
   [${have_ecore_x}])

have_ecore_evas_opengl_xlib="no"
have_ecore_evas_opengl_xcb="no"
if test "x${have_ecore_evas_opengl_x11}" = "xyes" -o "x${have_ecore_evas_opengl_x11}" = "xstatic" ; then
   have_ecore_evas_opengl_xlib=`${PKG_CONFIG} --variable=Xlib evas-opengl-x11`
   if test "x${have_ecore_evas_opengl_xlib}" = "xyes" ; then
      AC_DEFINE(BUILD_ECORE_EVAS_OPENGL_XLIB, 1, [OpenGL Xlib rendering backend])
   fi

# opengl does not work with xcb (yet)
   have_ecore_evas_opengl_xcb=`${PKG_CONFIG} --variable=XCB evas-opengl-x11`
   if test "x${have_ecore_evas_opengl_xcb}" = "xstatic"; then
      have_ecore_evas_opengl_xcb="yes"
   fi
   if test "x${have_ecore_evas_opengl_xcb}" = "xyes" -a "x${have_ecore_x_xcb}" = "xyes" ; then
      PKG_CHECK_MODULES(XCB_X11, x11-xcb,
        [ have_ecore_x_opengl_xcb="yes"
          requirements_ecore_x="x11-xcb ${requirements_ecore_x}"
          AC_DEFINE(BUILD_ECORE_X_OPENGL_XCB, 1, [Build support for XCB-based OpenGL])
          AC_DEFINE(BUILD_ECORE_EVAS_OPENGL_XCB, 1, [OpenGL XCB rendering backend])
        ],
        [ have_ecore_x_opengl_xcb="no" ])
    else
      have_ecore_x_opengl_xcb="no"
      AC_MSG_NOTICE("XCB-based OpenGL explicitly disabled")
    fi
fi

# ecore_evas_software_x11 16 bits

ECORE_EVAS_CHECK_MODULE([software-16-x11],
   [${want_ecore_evas_software_16_x11}],
   [Software Xlib 16 bits],
   [${have_ecore_x_xlib}])

ECORE_EVAS_CHECK_MODULE([software-8-x11],
    [$want_ecore_evas_software_8_x11],
    [Software 8bit X11],
    $have_ecore_x_xcb)


if test "x$have_ecore_evas_software_x11" = "xyes" -o \
        "x$have_ecore_evas_opengl_x11" = "xyes" -o \
        "x$have_ecore_evas_software_8_x11" = "xyes" -o \
        "x$have_ecore_evas_software_16_x11" = "xyes" -o \
        "x$have_ecore_evas_software_xcb" = "xyes"; then
   AC_DEFINE(BUILD_ECORE_EVAS_X11, 1, [Support for X Window Engines in Ecore_Evas])
   requirements_ecore_evas="ecore-x >= 1.6.99 ${requirements_ecore_evas}"
fi

# ecore_evas_win32

ECORE_EVAS_CHECK_MODULE([software-gdi],
   [${want_ecore_evas_software_gdi}],
   [Software GDI],
   [${have_ecore_win32}])

ECORE_EVAS_CHECK_MODULE([software-ddraw],
   [${want_ecore_evas_software_ddraw}],
   [Software DirectDraw],
   [${have_ecore_win32}])

ECORE_EVAS_CHECK_MODULE([direct3d],
   [${want_ecore_evas_direct3d}],
   [Direct3d],
   [${have_ecore_win32}])

ECORE_EVAS_CHECK_MODULE([opengl-glew],
   [${want_ecore_evas_opengl_glew}],
   [Glew OpenGL],
   [${have_ecore_win32}])

ECORE_EVAS_CHECK_MODULE([software-16-ddraw],
   [${want_ecore_evas_software_16_ddraw}],
   [16 bpp Software DirectDraw],
   [${have_ecore_win32}])

if test "x${have_ecore_evas_software_gdi}" = "xyes" -o \
        "x${have_ecore_evas_software_ddraw}" = "xyes" -o \
        "x${have_ecore_evas_direct3d}" = "xyes" -o \
        "x${have_ecore_evas_opengl_glew}" = "xyes" -o \
        "x${have_ecore_evas_software_16_ddraw}" = "xyes" ; then
   AC_DEFINE(BUILD_ECORE_EVAS_WIN32, 1, [Support for Win32 Engine in Ecore_Evas])
   requirements_ecore_evas="ecore-win32 >= 1.6.99 ${requirements_ecore_evas}"
fi

# ecore_evas_software_sdl

have_ecore_evas_software_sdl="no"
if test "x${have_ecore_sdl}" = "xyes"; then
   requirements_ecore_evas="ecore-sdl >= 1.6.99 ${requirements_ecore_evas}"
   have_ecore_evas_software_sdl="yes"
   AC_DEFINE(BUILD_ECORE_EVAS_SOFTWARE_SDL, 1, [Support for Software SDL Engine in Ecore_Evas])
   requirements_ecore_evas="ecore-sdl >= 1.6.99 ${requirements_ecore_evas}"
fi

# ecore_evas_gl_sdl

ECORE_EVAS_CHECK_MODULE([opengl-sdl],
   [${want_ecore_evas_gl_sdl}],
   [OpenGL SDL],
   [${have_ecore_sdl}],
   [requirements_ecore_evas="ecore-sdl >= 1.6.99 ${requirements_ecore_evas}"])

# ecore_evas_cocoa

ECORE_EVAS_CHECK_MODULE([opengl-cocoa],
   [${want_ecore_evas_gl_cocoa}],
   [OpenGL Cocoa],
   [${have_ecore_cocoa}],
   [requirements_ecore_evas="ecore-cocoa >= 1.6.99 ${requirements_ecore_evas}"])

# ecore_evas_directfb

ECORE_EVAS_CHECK_MODULE([directfb],
   [${want_ecore_evas_directfb}],
   [DirectFB],
   [${have_ecore_directfb}],
   [requirements_ecore_evas="ecore-directfb >= 1.6.99 ${requirements_ecore_evas}"])

# ecore_evas_fb

ECORE_EVAS_CHECK_MODULE([fb],
   [${want_ecore_evas_fb}],
   [Linux Framebuffer],
   [${have_ecore_fb}],
   [requirements_ecore_evas="ecore-fb >= 1.6.99 ${requirements_ecore_evas}"])

# ecore_evas_wince

ECORE_EVAS_CHECK_MODULE([software-16-wince],
   [${want_ecore_evas_software_16_wince}],
   [16 bpp Software Windows CE],
   [${have_ecore_wince}],
   [requirements_ecore_evas="ecore-wince >= 1.6.99 ${requirements_ecore_evas}"])

# ecore_evas_ews

ECORE_EVAS_CHECK_MODULE_FULL([ews], [software-buffer],
   [${want_ecore_evas_ews}],
   [Ecore Evas Single Process Windowing System],
   [yes], [])

# ecore_evas_extn

have_extn="yes"
if test "x${have_ecore_ipc}" = "xno" || \
   test "x${have_ecore_evas_software_buffer}" = "xno" || \
   test "x${have_shm_open}" = "xno" ; then
   have_extn="no"
fi

dnl THIS IS SPECIAL - dont use normal ECORE_EVAS_CHECK_MODULE
have_ecore_evas_extn="no"
if test "x${want_ecore_evas_extn}" = "xyes" && \
   test "x${have_extn}" = "xyes" && \
   test "x${have_ecore_evas}" = "xyes"; then
   AC_DEFINE([BUILD_ECORE_EVAS_EXTN], [1], [Support for Extn Engine in Ecore_Evas])
   have_ecore_evas_extn="yes"
fi

# ecore_evas_psl1ght

ECORE_EVAS_CHECK_MODULE([psl1ght],
   [${want_ecore_evas_psl1ght}],
   [PSL1GHT],
   [${have_ecore_psl1ght}],
   [requirements_ecore_evas="ecore-psl1ght >= 1.6.99 ${requirements_ecore_evas}"])

### WAYLAND

ecore_wayland_deps="no"
have_wayland="no"
if test "x${want_ecore_wayland}" = "xyes" ; then
  PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-cursor xkbcommon], [have_wayland="yes"], [have_wayland="no"])
fi
if test "x${have_ecore_input}" = "xyes" -a "x${have_wayland}" = "xyes" ; then
  ecore_wayland_deps="yes"
fi

ECORE_CHECK_MODULE([wayland], [${want_ecore_wayland}], [Wayland], [${ecore_wayland_deps}])
if test "x${have_ecore_wayland}" = "xyes" ; then
  requirements_ecore_wayland="ecore-input >= 1.6.99 wayland-client wayland-cursor xkbcommon ${requirements_ecore_wayland}"
fi

ECORE_EVAS_CHECK_MODULE_FULL([wayland-shm], [wayland-shm], 
   [${want_ecore_evas_wayland_shm}],
   [Wayland Shm],
   [${have_ecore_wayland}],
   [requirements_ecore_evas="${requirements_ecore_wayland} ${requirements_ecore_evas}"])

ECORE_EVAS_CHECK_MODULE_FULL([wayland-egl], [wayland-egl egl >= 7.10], 
   [${want_ecore_evas_wayland_egl}],
   [Wayland Egl],
   [${have_ecore_wayland}],
   [
      PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [have_wayland_egl="yes"], [have_wayland_egl="no"])
      if test "x${have_wayland_egl}" = "xyes" ; then
         requirements_ecore_evas="wayland-egl egl >= 7.10 ${requirements_ecore_wayland} ${requirements_ecore_evas}"
      fi
   ])

### Unit tests and coverage

EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])

EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
CFLAGS="${CFLAGS} ${EFL_COVERAGE_CFLAGS}"
ECORE_LIBS="${ECORE_LIBS} ${EFL_COVERAGE_LIBS}"
if test "x$enable_coverage" = "xyes" ; then
   CFLAGS="${CFLAGS} ${EFL_DEBUG_CFLAGS}"
fi

### install and build examples

EFL_CHECK_BUILD_EXAMPLES([enable_build_examples="yes"], [enable_build_examples="no"])
EFL_CHECK_INSTALL_EXAMPLES([enable_install_examples="yes"], [enable_install_examples="no"])

### requirements

AC_SUBST(requirements_ecore)
AC_SUBST(requirements_ecore_con)
#AC_SUBST(requirements_ecore_config)
AC_SUBST(requirements_ecore_directfb)
AC_SUBST(requirements_ecore_evas)
AC_SUBST(requirements_ecore_fb)
AC_SUBST(requirements_ecore_file)
AC_SUBST(requirements_ecore_imf)
AC_SUBST(requirements_ecore_imf_evas)
AC_SUBST(requirements_ecore_input)
AC_SUBST(requirements_ecore_input_evas)
AC_SUBST(requirements_ecore_ipc)
AC_SUBST(requirements_ecore_cocoa)
AC_SUBST(requirements_ecore_sdl)
AC_SUBST(requirements_ecore_psl1ght)
AC_SUBST(requirements_ecore_x)
AC_SUBST(requirements_ecore_win32)
AC_SUBST(requirements_ecore_wince)
AC_SUBST(requirements_ecore_imf_xim)
AC_SUBST(requirements_ecore_imf_scim)
AC_SUBST(requirements_ecore_imf_ibus)
AC_SUBST(requirements_ecore_wayland)

AC_CONFIG_FILES([
Makefile
ecore-con.pc
ecore-config.pc
ecore-directfb.pc
ecore-evas.pc
ecore-fb.pc
ecore-file.pc
ecore-imf.pc
ecore-imf-evas.pc
ecore-ipc.pc
ecore-x.pc
ecore-input.pc
ecore-input-evas.pc
ecore-win32.pc
ecore-sdl.pc
ecore-cocoa.pc
ecore-psl1ght.pc
ecore-wince.pc
ecore-wayland.pc
ecore.pc
doc/ecore.dox
doc/Makefile
doc/Doxyfile
src/Makefile
src/util/Makefile
src/bin/Makefile
src/lib/Makefile
src/lib/ecore/Makefile
src/lib/ecore_con/Makefile
src/lib/ecore_config/Makefile
src/lib/ecore_directfb/Makefile
src/lib/ecore_evas/Makefile
src/lib/ecore_fb/Makefile
src/lib/ecore_file/Makefile
src/lib/ecore_cocoa/Makefile
src/lib/ecore_sdl/Makefile
src/lib/ecore_psl1ght/Makefile
src/lib/ecore_imf/Makefile
src/lib/ecore_imf_evas/Makefile
src/lib/ecore_input/Makefile
src/lib/ecore_input_evas/Makefile
src/lib/ecore_ipc/Makefile
src/lib/ecore_win32/Makefile
src/lib/ecore_wince/Makefile
src/lib/ecore_x/Makefile
src/lib/ecore_x/xlib/Makefile
src/lib/ecore_x/xcb/Makefile
src/lib/ecore_wayland/Makefile
src/examples/Makefile
src/tests/Makefile
src/modules/Makefile
src/modules/immodules/Makefile
src/modules/immodules/xim/Makefile
src/modules/immodules/scim/Makefile
src/modules/immodules/ibus/Makefile
ecore.spec
$po_makefile_in
])

AC_OUTPUT

echo
echo "$PACKAGE $VERSION"
echo
echo "Optional Modules:"
echo
echo " Core:"
echo
echo "  Ecore........................: always"
echo "    Thread support.............: $have_threads"
echo "    Thread safety..............: $want_thread_safety"
echo "    GLib support...............: $have_glib"
echo "    Always integrate GLib......: $want_glib_integration_always"
echo "    Use g_main_loop............: $want_g_main_loop"
echo "    Gathering memory statistic.: $have_mallinfo"
echo "    Gathering timer allocation.: $want_ecore_timer_dump"
echo "  Ecore_Con....................: $have_ecore_con"
if test "x$have_ecore_con" = "xyes" ; then
  echo $ECHO_N "    OpenSSL....................: $have_openssl $ECHO_C"
if test "x$have_gnutls" = "xyes" ; then
  echo " (disabled)"
else
  echo
fi
  echo "    IPv6.......................: $have_ipv6"
  echo "    GnuTLS.....................: $have_gnutls"
  echo "    CURL.......................: $have_curl"
  echo "    Local Sockets..............: $want_ecore_con_local_sockets"
if test "x$want_ecore_con_local_sockets" = "xyes" ; then
  echo "      Abstract Sockets.........: $want_ecore_con_abstract_sockets"
fi
if test "x$have_cares" = "xyes" ; then
  echo "    Resolver...................: c-ares"
elif test "x$have_ipv6" = "xyes" ; then
  echo "    Resolver...................: dns.c"
else
  echo "    Resolver...................: fork"
fi
fi
echo "  Ecore_Ipc....................: $have_ecore_ipc"
if test "x$have_ecore_ipc" = "xyes" ; then
  echo $ECHO_N "    OpenSSL....................: $have_openssl $ECHO_C"
if test "x$have_gnutls" = "xyes" ; then
  echo " (disabled)"
else
  echo
fi
  echo "    GnuTLS.....................: $have_gnutls"
fi
echo "  Ecore_File...................: $have_ecore_file"
if test "x$have_ecore_file" = "xyes" ; then
  echo "    Inotify....................: $have_inotify"
  echo "    Windows notification.......: $have_notify_win32"
  echo "    Poll.......................: $have_poll"
  echo "    CURL.......................: $have_curl"
fi
#echo "  Ecore_Config.................: $have_ecore_config (deprecated)"
echo "  Ecore_IMF....................: $have_ecore_imf"
echo "    XIM........................: $have_ecore_imf_xim"
echo "    SCIM.......................: $have_ecore_imf_scim"
echo "    IBUS.......................: $have_ecore_imf_ibus"
echo "  Ecore_IMF_Evas...............: $have_ecore_imf_evas"
echo "  Ecore_Input..................: $have_ecore_input"
echo "  Ecore_Input_Evas.............: $have_ecore_input_evas"

echo
echo " Graphic systems:"
echo

if test "x$have_ecore_x" = "xyes" ; then
  if test "x$have_ecore_x_xcb" = "xyes" ; then
    echo "  Ecore_X (XCB backend)........: $have_ecore_x_xcb"
    echo "    Xprint.....................: $have_ecore_x_xcb_xprint"
    echo "    Xinerama...................: $have_ecore_x_xcb_xinerama"
    echo "    Xrandr.....................: $have_ecore_x_xcb_randr"
    echo "    Xscreensaver...............: $have_ecore_x_xcb_screensaver"
    echo "    Xshape.....................: $have_ecore_x_xcb_shape"
    echo "    Xgesture...................: $have_ecore_x_xcb_gesture"
    echo "    Xsync......................: $have_ecore_x_xcb_sync"
    echo "    Xrender....................: $have_ecore_x_xcb_render"
    echo "    Xcomposite.................: $have_ecore_x_xcb_composite"
    echo "    Xfixes.....................: $have_ecore_x_xcb_xfixes"
    echo "    Xdamage....................: $have_ecore_x_xcb_damage"
    echo "    Xdpms......................: $have_ecore_x_xcb_dpms"
    echo "    Xtest......................: $have_ecore_x_xcb_xtest"
  else
    echo "  Ecore_X (Xlib backend).......: $have_ecore_x"
    echo "    Xcursor....................: $use_Xcursor"
    echo "    Xkb........................: $use_xkb"
    echo "    Xprint.....................: $use_xprint"
    echo "    Xinerama...................: $use_xinerama"
    echo "    Xrandr.....................: $use_xrandr"
    echo "    Xgesture...................: $use_xgesture"
    echo "    Xscreensaver...............: $use_xss"
    echo "    Xrender....................: $use_xrender"
    echo "    Xcomposite.................: $use_xcomposite"
    echo "    Xfixes.....................: $use_xfixes"
    echo "    Xdamage....................: $use_xdamage"
    echo "    Xdpms......................: $use_xdpms"
    echo "    Xtest......................: $use_xtest"
    echo "    XIM........................: $want_xim"
    echo "    Xi2........................: $use_xi2"
  fi
else
  echo "  Ecore_X......................: $have_ecore_x"
fi
echo "  Ecore_Win32..................: $have_ecore_win32"
echo "  Ecore_Cocoa..................: $have_ecore_cocoa"
echo "  Ecore_SDL....................: $have_ecore_sdl"
echo "  Ecore_FB.....................: $have_ecore_fb"
if test "x${have_ecore_fb}" = "xyes" ; then
  echo "    Touchscreen................: $have_tslib"
fi
echo "  Ecore_DirectFB...............: $have_ecore_directfb"
echo "  Ecore_WinCE..................: $have_ecore_wince"
echo "  Ecore_PSL1GHT................: $have_ecore_psl1ght"
echo "  Ecore_Wayland................: $have_ecore_wayland"

echo
echo " Ecore Evas:"
echo

echo "  Ecore_Evas...................: $have_ecore_evas"
if test "x${have_ecore_evas}" = "xyes" ; then
  echo "    Software Memory Buffer.....: $have_ecore_evas_software_buffer"
  if test "x${have_ecore_evas_software_x11}" = "xyes" ; then
    echo "    Software X11...............: $have_ecore_evas_software_x11 (Xlib=${have_ecore_evas_software_xlib}) (XCB=${have_ecore_evas_software_xcb})"
  else
    echo "    Software X11...............: $have_ecore_evas_software_x11"
  fi
  if test "x${have_ecore_evas_opengl_x11}" = "xyes" ; then
    echo "    OpenGL X11.................: $have_ecore_evas_opengl_x11 (Xlib=${have_ecore_evas_opengl_xlib}) (XCB=${have_ecore_evas_opengl_xcb})"
  else
    echo "    OpenGL X11.................: $have_ecore_evas_opengl_x11"
  fi
  echo "    Software GDI...............: $have_ecore_evas_software_gdi"
  echo "    Software DirectDraw........: $have_ecore_evas_software_ddraw"
  echo "    Direct3D...................: $have_ecore_evas_direct3d"
  echo "    OpenGL Glew................: $have_ecore_evas_opengl_glew"
  echo "    Software SDL...............: $have_ecore_evas_software_sdl"
  echo "    OpenGL SDL.................: $have_ecore_evas_opengl_sdl"
  echo "    OpenGL Cocoa...............: $have_ecore_evas_opengl_cocoa"
  echo "    DirectFB...................: $have_ecore_evas_directfb"
  echo "    PSL1GHT....................: $have_ecore_evas_psl1ght"
  echo "    Software Framebuffer.......: $have_ecore_evas_fb"
  echo "    Software 8bit grayscale XCB: $have_ecore_evas_software_8_x11"
  echo "    Software 16bit X11.........: $have_ecore_evas_software_16_x11"
  echo "    Software 16bit DirectDraw..: $have_ecore_evas_software_16_ddraw"
  echo "    Software 16bit WinCE.......: $have_ecore_evas_software_16_wince"
  echo "    Sing.Proc. Windowing System: $have_ecore_evas_ews"
  echo "    Wayland Shm................: $have_ecore_evas_wayland_shm"
  echo "    Wayland Egl................: $have_ecore_evas_wayland_egl"
  echo "    Extn (Plug/socket Extn)....: $have_ecore_evas_extn"
fi
echo
echo "  Tests................: ${enable_tests}"
echo "  Coverage.............: ${enable_coverage}"
echo "  Maximum log level....: ${with_max_log_level}"
echo "Documentation..........: ${build_doc}"
echo "Examples...............: ${enable_build_examples}"
echo "Examples installed.....: ${enable_install_examples}"
echo
echo "Compilation............: make (or gmake)"
echo "  CPPFLAGS.............: $CPPFLAGS"
echo "  CFLAGS...............: $CFLAGS"
echo "  CXXFLAGS.............: $CXXFLAGS"
echo "  LDFLAGS..............: $LDFLAGS"
echo
echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
echo "  prefix...............: $prefix"
echo