1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498
|
# -*- mode:sh; sh-basic-offset:2; tab-width:2; indent-tabs-mode:t -*-
AC_INIT()
AC_CONFIG_HEADER(common/c_config.h)
AC_CONFIG_AUX_DIR(script)
AC_CANONICAL_HOST
AC_CANONICAL_BUILD
# for CFLAGS="..." ./configure ...
AC_SUBST(CFLAGS)
if test -d ${top_srcdir-$srcdir}/encodefilter -a -d ${top_srcdir-$srcdir}/baselib ; then
CONFIG_SUBDIR_LIBS="internal"
if test "$CONFIG_SUBDIR_LIBS" = "external"; then
SUBDIRS="baselib encodefilter"
fi
MEF_CFLAGS='-I${top_builddir}/encodefilter/include'
POBL_CFLAGS='-I${top_builddir}/baselib/include'
LMEF='${top_builddir}/encodefilter/src/libmef.la'
LPOBL='${top_builddir}/baselib/src/libpobl.la'
elif test -d ${top_srcdir-$srcdir}/../../encodefilter -a -d ${top_srcdir-$srcdir}/../../baselib ; then
# --with-gui=xlib,fb => cd fb ; --with-gui=fb
MEF_CFLAGS='-I${top_builddir}/../../encodefilter/include'
POBL_CFLAGS='-I${top_builddir}/../../baselib/include'
LMEF='${top_builddir}/../../encodefilter/src/libmef.la'
LPOBL='${top_builddir}/../../baselib/src/libpobl.la'
else
LMEF="-lmef"
LPOBL="-lpobl"
fi
AC_SUBST(LMEF)
AC_SUBST(MEF_CFLAGS)
AC_SUBST(LPOBL)
AC_SUBST(POBL_CFLAGS)
AC_CHECK_TOOL(PKG_CONFIG, pkg-config)
AC_ARG_WITH(ios-sdk,
[ --with-ios-sdk@<:@=ARG@:>@ iOS SDK (e.g. iphoneos4.3 iphonesimulator4.3) ],
ios_sdk=$with_ios_sdk)
if test "$ios_sdk" != ""; then
AC_CHECK_PROG(XCRUN, xcrun, xcrun)
if test "$XCRUN" != ""; then
if test "$SDKROOT" = ""; then
SDKROOT=`$XCRUN --sdk $ios_sdk --show-sdk-path`
fi
if test "$CC" = ""; then
# Do 'export' for baselib/configure and encodefilter/configure.
export CC="`$XCRUN --sdk $ios_sdk -f cc` -isysroot $SDKROOT"
simver=`echo $ios_sdk|sed -n 's/^iphonesimulator\(@<:@0-9.@:>@*\)$/\1/p'`
if test "$simver" != ""; then
case "$simver" in
@<:@0-4@:>@.*)
# -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 or something like that
# should be defined as the value of CFLAGS environmental variable
# before ./configure.
;;
*)
CC="$CC -mios-simulator-version-min=$simver"
;;
esac
fi
fi
AC_ARG_WITH(ios-arch,
[ --with-ios-arch@<:@=ARG@:>@ iOS architectures (e.g. arm7v x86_64,i686) ],
ios_arch=$with_ios_arch)
if test "$ios_arch" != ""; then
ios_arch=`echo ${ios_arch} | sed 's/,/ /g'`
for arch in $ios_arch; do
CC="$CC -arch $arch"
done
fi
if test "$CPP" = ""; then
export CPP="$CC -E"
fi
if test "$RANLIB" = ""; then
export RANLIB=`$XCRUN --sdk $ios_sdk -f ranlib`
fi
if test "$LIBTOOL" = ""; then
export LIBTOOL=`$XCRUN --sdk $ios_sdk -f libtool`
fi
if test "$AR" = ""; then
export AR=`$XCRUN --sdk $ios_sdk -f ar`
fi
fi
XCRUN=
fi
AC_PROG_CC
# mlimgloader (gdiplus.cpp) and SCIM
AC_PROG_CXX
AC_PROG_INSTALL
#detect glibc
AC_TRY_COMPILE([#include <features.h>],
[
#ifdef __GLIBC__
#else
#error
int boil\[-1\];
#endif
], [CFLAGS="$CFLAGS -D_GNU_SOURCE"])
AC_C_INLINE
AC_ARG_ENABLE(debug,
[ --enable-debug debug @<:@default=disabled@:>@],
debug=$enable_debug)
if test "$debug" = "yes" ; then
DEB_CFLAGS="-DDEBUG -DBL_DEBUG"
fi
AC_SUBST(DEB_CFLAGS)
AC_LIBTOOL_WIN32_DLL
AC_LIBTOOL_DLOPEN
AC_ARG_WITH(libtool,
[ --with-libtool@<:@=ARG@:>@ libtool path @<:@default=without@:>@],
libtool=$with_libtool)
if test "${libtool}" != "" ; then
LIBTOOL=${libtool}
else
AM_PROG_LIBTOOL
LIBTOOL='${top_builddir}/libtool'
fi
AC_SUBST(LIBTOOL)
AC_CHECK_LIB(socket,connect,SOCK_LIBS=-lsocket)
AC_SUBST(SOCK_LIBS)
AC_PATH_XTRA
if test "$have_x" = "yes"; then
X_CFLAGS_AUX="-DHAVE_XLIB"
X_LIBS="$X_LIBS -lX11"
AC_SUBST(X_CFLAGS_AUX)
fi
MLTERM_FB="mlterm-fb"
AC_ARG_WITH(gui,
[ --with-gui@<:@=ARG@:>@ gui library (xlib|win32|fb|quartz|console|wayland|sdl2|beos)],
gui=$with_gui)
if test `echo $gui | grep ,`; then
gui_list=`echo $gui | sed 's/,/ /g'`
is_first=t
mkdir -p ${top_srcdir-$srcdir}/gui
for g in $gui_list; do
if test $is_first; then
gui=$g
is_first=
else
SUBDIRS="${SUBDIRS} gui/$g"
MAKE_DIRS2="${MAKE_DIRS2} gui/$g"
if test -d ${top_srcdir-$srcdir}/gui/$g ; then
echo ""
echo "** WARNING **"
echo "${top_srcdir-$srcdir}/gui/$g exists, so copy no files for $g."
echo "If there are files which should be copied, copy them manually."
echo ""
else
mkdir -p ${top_srcdir-$srcdir}/gui/$g
# clone source tree to build both mlterm, mlterm-wl, mlterm-fb, mlterm-con and mlterm-sdl2.
for file in ChangeLog Makefile.in common configure etc gtk inputmethod java \
main man vtemu script scrollbar uitoolkit doc libvterm; do
cp -R ${top_srcdir-$srcdir}/$file ${top_srcdir-$srcdir}/gui/$g/
done
mkdir -p ${top_srcdir-$srcdir}/gui/$g/contrib
cp -R ${top_srcdir-$srcdir}/contrib/scrollbar ${top_srcdir-$srcdir}/gui/$g/contrib/
cp -R ${top_srcdir-$srcdir}/contrib/icon ${top_srcdir-$srcdir}/gui/$g/contrib/
fi
fi
done
elif test "$gui" = "subdir"; then
gui=`basename $PWD`
if test "$gui" = "wscons"; then
MLTERM_FB="mlterm-wscons"
elif test "$gui" = "x68kgrf"; then
MLTERM_FB="mlterm-x68kgrf"
elif test "$gui" = "scpc98"; then
MLTERM_FB="mlterm-scpc98"
fi
fi
AC_SUBST(MLTERM_FB)
if test "$gui" = "wscons"; then
gui="fb"
fbtype="wscons"
elif test "$gui" = "x68kgrf"; then
gui="fb"
fbtype="x68kgrf"
elif test "$gui" = "scpc98"; then
gui="fb"
fbtype="pc98"
fi
if test "$gui" = "fb" ; then
MAKE_DIRS2="doc/kbd ${MAKE_DIRS2}"
OUTPUT_FILES="doc/kbd/Makefile ${OUTPUT_FILES}"
fi
ml_cv_is_posix="yes"
case "${host_os}" in
mingw*)
CYGPATHW=echo
WIN32TAG=_win32
if test ! -f "/lib/libmsys-1.0.dll.a" ; then
case "${lt_cv_path_LD}" in
*-msys*)
;;
*)
ml_cv_is_posix="no"
;;
esac
fi
if test "$gui" != "sdl2" -a "$gui" != "win32" ; then
echo "$gui is not supported in ${host_os}. Use win32."
gui="win32"
fi
;;
msys*)
# msys2
AC_CHECK_PROG(CYGPATHW,cygpath,cygpath -w,echo)
WIN32TAG=_win32
# $have_x is defined in AC_PATH_XTRA.
if test "$have_x" = "yes" ; then
if test "$gui" = "" ; then
gui="xlib"
elif test "$gui" != "xlib" -a "$gui" != "win32" -a "$gui" != "console" -a "$gui" != "sdl2"; then
echo "$gui is not supported in ${host_os}. Use win32."
gui="win32"
fi
else
if test "$gui" != "win32" -a "$gui" != "console" -a "$gui" != "sdl2"; then
echo "$gui is not supported in ${host_os}. Use win32."
gui="win32"
fi
fi
;;
cygwin*)
AC_CHECK_PROG(CYGPATHW,cygpath,cygpath -w,echo)
WIN32TAG=_win32
case "${CC} ${CFLAGS}" in
*mno-cygwin* | *-mingw*)
ml_cv_is_posix="no"
;;
*)
;;
esac
# $have_x is defined in AC_PATH_XTRA.
if test "$have_x" = "yes" ; then
if test "$gui" = "" ; then
gui="xlib"
elif test "$gui" != "xlib" -a "$gui" != "win32" -a "$gui" != "console" -a "$gui" != "sdl2"; then
echo "$gui is not supported in ${host_os}. Use win32."
gui="win32"
fi
else
if test "$gui" != "win32" -a "$gui" != "console" -a "$gui" != "sdl2"; then
echo "$gui is not supported in ${host_os}. Use win32."
gui="win32"
fi
fi
;;
*)
CYGPATHW=echo
if test "$gui" != "xlib" -a "$gui" != "fb" -a "$gui" != "console" -a "$gui" != "quartz" -a "$gui" != "wayland" -a "$gui" != "sdl2" -a "$gui" != "beos"; then
if test "$gui" != "" ; then
echo "$gui is not supported in ${host_os}. xlib is used instead."
fi
gui="xlib"
fi
# $have_x is defined in AC_PATH_XTRA.
if test "$gui" = "xlib" -a "$have_x" != "yes" ; then
echo ""
echo "** ERROR **"
echo "Could not find xlib."
echo ""
exit 1
fi
;;
esac
# for java/Makefile.in
AC_SUBST(WIN32TAG)
AC_SUBST(CYGPATHW)
if test "$ml_cv_is_posix" = "yes" -o "$debug" = "yes" ; then
SUBSYSTEM="-Wl,--subsystem,console"
fi
AC_SUBST(SUBSYSTEM)
if test "$with_gnu_ld" = "yes" ; then
DEXPORT="-Wl,--version-script=\$(VPATH)/dexport.map"
elif test "`$LD --version 2>&1 | $GREP Solaris`" != "" ; then
# This option is for SunOS 5.x (Solaris) or later.
DEXPORT="-Wl,-M -Wl,\$(VPATH)/dexport-sun.map -Wl,-z -Wl,nodefs"
fi
AC_SUBST(DEXPORT)
AC_ARG_WITH(gtk,
[ --with-gtk@<:@=ARG@:>@ gtk+ version (2.0|3.0|4.0) @<:@default=3.0@:>@],
gtk_version=$with_gtk)
if test "$gtk_version" = "no" ; then
have_gtk=no
else
if test "$gtk_version" = "4.0" ; then
PKG_CHECK_MODULES(GTK4, gtk4, have_gtk4=yes, have_gtk4=no)
# mlconfig supports gtk4, but mlterm-menu and libvte do not support it
gtk_version=3.0
elif test "$gtk_version" = "" ; then
gtk_version=3.0
fi
PKG_CHECK_MODULES(GTK, gtk+-$gtk_version, have_gtk=yes, have_gtk=no)
if test "$have_gtk" != "yes"; then
if test "$gtk_version" = "3.0"; then
gtk_version=2.0
else
gtk_version=3.0
fi
PKG_CHECK_MODULES(GTK, gtk+-$gtk_version, have_gtk=yes, have_gtk=no)
fi
fi
if test "$ml_cv_is_posix" = "no"; then
GTK_LIBS="$GTK_LIBS -limagehlp"
fi
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0, have_gdk_pixbuf2=yes, have_gdk_pixbuf2=no)
# try to link libgio-2.0 explicitly. (SF topic #6234829)
PKG_CHECK_EXISTS(gdk-pixbuf-2.0 >= 2.14, [ PKG_CHECK_MODULES(GIO, gio-2.0) ])
GDK_PIXBUF_CFLAGS="$GDK_PIXBUF_CFLAGS $GIO_CFLAGS"
GDK_PIXBUF_LIBS="$GDK_PIXBUF_LIBS $GIO_LIBS"
AC_CHECK_PROG(have_gdk_pixbuf1,gdk-pixbuf-config,yes)
if test "$gui" = "xlib" ; then
AC_ARG_WITH(imagelib,
[ --with-imagelib@<:@=ARG@:>@ image library (gdk-pixbuf) @<:@default=no@:>@],
imagelib=$with_imagelib)
else
# Don't link an external image library on win32gdi or framebuffer.
with_imagelib=""
fi
case ${imagelib} in
imlib)
AC_CHECK_PROG(imlib_config,imlib-config,yes,no)
if test "x$imlib_config" = "xno" ; then
echo ""
echo "** ERROR **"
echo "Could not find imlib-config."
echo ""
exit 1
fi
echo ""
echo "** WARNING **"
echo " imlib is no longer supported."
echo ""
IMAGELIB_CFLAGS="`imlib-config --cflags` -DBUILTIN_IMAGELIB"
IMAGELIB_LIBS="`imlib-config --libs`"
;;
imlib2)
AC_CHECK_PROG(imlib2_config,imlib2-config,yes,no)
if test "x$imlib2_config" = "xno" ; then
echo ""
echo "** ERROR **"
echo "Could not find imlib2-config."
echo ""
exit 1
fi
echo ""
echo "** WARNING **"
echo " imlib2 is no longer supported."
echo ""
IMAGELIB_CFLAGS="`imlib2-config --cflags` -DBUILTIN_IMAGELIB"
IMAGELIB_LIBS="`imlib2-config --libs`"
;;
gdk-pixbuf)
if test "$have_gdk_pixbuf2" = "yes" ; then
gdk_pixbuf_version=2
elif test "$have_gdk_pixbuf1" = "yes" ; then
gdk_pixbuf_version=1
else
echo ""
echo "** ERROR **"
echo "Could not find gdk-pixbuf"
echo ""
exit 1
fi
;;
gdk-pixbuf2)
if test "$have_gdk_pixbuf2" = "yes" ; then
gdk_pixbuf_version=2
else
echo ""
echo "** ERROR **"
echo "Could not find gdk-pixbuf2"
echo ""
exit 1
fi
;;
gdk-pixbuf1)
if test "$have_gdk_pixbuf1" = "yes" ; then
gdk_pixbuf_version=1
else
echo ""
echo "** ERROR **"
echo "Could not find gdk-pixbuf1"
echo ""
exit 1
fi
;;
*)
if test "${imagelib}" != "" ; then
echo ""
echo "** ERROR **"
echo "${imagelib} library is NOT supported."
echo ""
exit 1
fi
;;
esac
PKG_CHECK_MODULES(FT, freetype2, have_ft=yes, have_ft=no)
if test "$have_ft" = "no" ; then
PKG_CHECK_MODULES(FT, freetype, have_ft=yes, have_ft=no)
fi
# -DUSE_FREETYPE can be added to FT_CFLAGS later.
FT_CFLAGS_ORIGINAL=$FT_CFLAGS
if test "$gdk_pixbuf_version" != "" ; then
if test "$gdk_pixbuf_version" = "1" ; then
# Override GDK_PIXBUF_XXX variables.
GDK_PIXBUF_CFLAGS="`gdk-pixbuf-config --cflags`"
GDK_PIXBUF_LIBS="`gdk-pixbuf-config --libs`"
echo ""
echo "** WARNING **"
echo " gdk-pixbuf1 is no longer supported."
echo ""
fi
IMAGELIB_CFLAGS="${GDK_PIXBUF_CFLAGS} -DBUILTIN_IMAGELIB"
IMAGELIB_LIBS="${GDK_PIXBUF_LIBS}"
if test "$have_ft" = "yes"; then
IMAGELIB_CFLAGS="$IMAGELIB_CFLAGS -DUSE_FREETYPE_EMOJI $FT_CFLAGS_ORIGINAL"
IMAGELIB_LIBS="$IMAGELIB_LIBS $FT_LIBS"
fi
elif test "$have_gdk_pixbuf2" != "yes" -a "$have_gdk_pixbuf1" = "yes" ; then
GDK_PIXBUF_CFLAGS="`gdk-pixbuf-config --cflags`"
GDK_PIXBUF_LIBS="`gdk-pixbuf-config --libs`"
fi
# Used by mlimgloader.
AC_SUBST(GDK_PIXBUF_CFLAGS)
AC_SUBST(GDK_PIXBUF_LIBS)
AC_SUBST(IMAGELIB_CFLAGS)
AC_SUBST(IMAGELIB_LIBS)
# XXX For pow in libm.so which is used in ui_imagelib.c
# /lib/* ... e.g.) /lib/i386-linux-gnu in ubuntu.
for ml_cv_lib_path in /lib /usr/lib /lib/* `echo $LIBRARY_PATH | tr ":" " "` ; do
libm_files=`ls $ml_cv_lib_path/libm\\.so* $ml_cv_lib_path/libm\\.sl* 2> /dev/null`
for libm_file in $libm_files ; do
if test -n "`$NM -D $libm_file | $GREP pow`" ; then
ml_cv_libm_dir=`dirname $libm_file`
break
fi
done
if test "$ml_cv_libm_dir" != ""; then
break
fi
done
if test -z "$IMAGELIB_LIBS" ; then
if test -n "$ml_cv_libm_dir" ; then
MATH_CFLAGS="-DDLOPEN_LIBM -DLIBMDIR=\\\"$ml_cv_libm_dir\\\""
else
AC_CHECK_LIB(m, pow, MATH_LIBS=-lm)
fi
else
AC_CHECK_LIB(m, pow, MATH_LIBS=-lm)
fi
AC_SUBST(MATH_LIBS)
AC_SUBST(MATH_CFLAGS)
AC_ARG_ENABLE(image,
[ --disable-image show image @<:@default=enabled@:>@],
image=$enable_image, image="yes")
if test "$image" != "yes" ; then
# If sixel.h is not found on gui=console, set IMAGE_CFLAGS="-DNO_IMAGE" forcibly below.
IMAGE_CFLAGS="-DNO_IMAGE"
fi
AC_SUBST(IMAGE_CFLAGS)
if test "$gui" = "win32" ; then
GUI="win32"
GUI_CFLAGS="-DUSE_WIN32GUI"
X_CFLAGS=""
elif test "$gui" = "xlib" ; then
GUI="xlib"
# Li18nux Xlib-I18N defines X_HAVE_UTF8_STRING but has no Xutf8LookupString.
ldflags="$LDFLAGS" cflags="$CFLAGS"
LDFLAGS="$LDFLAGS $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS" CFLAGS="$X_CFLAGS $CFLAGS"
AC_CHECK_LIB(X11,Xutf8LookupString,XUTF8_CFLAGS="-DHAVE_XUTF8_LOOKUP_STRING")
LDFLAGS="$ldflags" CFLAGS="$cflags"
AC_SUBST(XUTF8_CFLAGS)
elif test "$gui" = "quartz" ; then
GUI="quartz"
GUI_CFLAGS="-DUSE_QUARTZ"
if test "$ios_sdk" != ""; then
GUI_CFLAGS="$GUI_CFLAGS -DCOCOA_TOUCH"
COCOAOBJ=cocoatouch.o
COCOA_LIBS="-framework Foundation -framework UIKit -framework CoreGraphics"
else
COCOAOBJ=cocoa.o
COCOA_LIBS="-framework Foundation -framework Cocoa"
fi
AC_SUBST(COCOAOBJ)
AC_SUBST(COCOA_LIBS)
X_CFLAGS=""
VT_NORM_OBJ="vt_normalize.o"
VT_NORM_CFLAGS="-DUSE_NORMALIZE"
AC_SUBST(VT_NORM_OBJ)
AC_SUBST(VT_NORM_CFLAGS)
elif test "$gui" = "console" ; then
GUI="console"
GUI_CFLAGS="-DUSE_CONSOLE"
AC_CHECK_HEADER(sixel.h, SIXEL_CFLAGS="-DUSE_LIBSIXEL")
if test "$SIXEL_CFLAGS" = "-DUSE_LIBSIXEL" ; then
SIXEL_LIBS="-lsixel"
else
IMAGE_CFLAGS="-DNO_IMAGE"
IMAGELIB_CFLAGS=""
IMAGELIB_LIBS=""
fi
AC_SUBST(SIXEL_CFLAGS)
AC_SUBST(SIXEL_LIBS)
elif test "$gui" = "beos" ; then
GUI="beos"
GUI_CFLAGS="-DUSE_BEOS"
elif test "$gui" = "wayland" ; then
PKG_CHECK_MODULES(WAYLAND, [wayland-client wayland-cursor xkbcommon])
GUI="wayland"
GUI_CFLAGS="-DUSE_WAYLAND"
AC_SUBST(WAYLAND_CFLAGS)
AC_SUBST(WAYLAND_LIBS)
elif test "$gui" = "sdl2" ; then
PKG_CHECK_MODULES(SDL2, sdl2, have_sdl2=yes, have_sdl2=no)
if test "$have_sdl2" != "yes" ; then
AC_CHECK_PROG(sdl2_config, sdl2-config, yes)
if test "$sdl2_config" = "yes"; then
SDL2_CFLAGS="`sdl2-config --cflags`"
SDL2_LIBS="`sdl2-config --libs`"
else
echo "sdl2 is not available."
exit 1
fi
fi
if test "$ml_cv_is_posix" != "yes"; then
SDL2GUI="win32"
AC_SUBST(SDL2GUI)
fi
GUI="sdl2"
GUI_CFLAGS="-DUSE_SDL2"
AC_SUBST(SDL2_CFLAGS)
AC_SUBST(SDL2_LIBS)
else
GUI="fb"
if test "$fbtype" = ""; then
if test "`sysctl machdep.ispc98`" = "machdep.ispc98: 1"; then
fbtype="pc98"
else
# for NetBSD/x68k
# <machine/vuid_event.h> is also checked not to enable USE_GRF on NetBSD/macppc.
AC_CHECK_HEADER(machine/grfioctl.h,
AC_CHECK_HEADER(machine/vuid_event.h,
[
fbtype="x68kgrf"
GUI_CFLAGS="-DHAVE_GRFIOCTL_H"
]))
fi
fi
if test "$fbtype" = "x68kgrf"; then
GUI_CFLAGS="${GUI_CFLAGS} -DUSE_GRF"
elif test "$fbtype" = "pc98"; then
GUI_CFLAGS="${GUI_CFLAGS} -DPC98"
fi
GUI_CFLAGS="${GUI_CFLAGS} -DUSE_FRAMEBUFFER"
fi
AC_SUBST(GUI)
AC_SUBST(GUI_CFLAGS)
AC_CHECK_HEADER(regex.h,
[
REGEX_CFLAGS="-DHAVE_REGEX"
AC_CHECK_LIB(regex,regcomp,REGEX_LIBS=-lregex)
])
AC_SUBST(REGEX_CFLAGS)
AC_SUBST(REGEX_LIBS)
AC_ARG_ENABLE(compact-truecolor,
[ --disable-compact-truecolor true color support by reusing 240 palettes @<:@default=enabled@:>@],
compact_truecolor=$enable_compact_truecolor, compact_truecolor="yes")
if test "$compact_truecolor" = "yes" ; then
TRUECOLOR_CFLAGS="-DUSE_COMPACT_TRUECOLOR"
else
TRUECOLOR_TAG="x"
fi
AC_SUBST(TRUECOLOR_CFLAGS)
AC_SUBST(TRUECOLOR_TAG)
AC_ARG_ENABLE(dl-ctl,
[ --disable-dl-ctl dynamic loading ctl library @<:@default=enable@:>@],
dl_ctl=$enable_dl_ctl, dl_ctl="yes")
if test "$enable_shared" = "no" ; then
dl_ctl="no"
fi
if test "$dl_ctl" = "yes" ; then
LMLTERM_CORE=libmlterm${TRUECOLOR_TAG}_core.la
CTL_LOADER_OBJ=vt_ctl_loader.o
else
LMLTERM_CORE=libmlterm${TRUECOLOR_TAG}_core.a
CTL_CFLAGS="-DNO_DYNAMIC_LOAD_CTL"
CTL_LIBS_FOR_VTE="../vtemu/libctl/*.lo"
fi
AC_SUBST(LMLTERM_CORE)
AC_SUBST(CTL_LOADER_OBJ)
AC_ARG_ENABLE(fribidi,
[ --disable-fribidi bidi @<:@default=enabled@:>@],
fribidi=$enable_fribidi, fribidi="yes")
if test "$fribidi" = "yes" ; then
PKG_CHECK_MODULES(FRIBIDI, fribidi, have_fribidi=yes, have_fribidi=no)
if test "$have_fribidi" != "yes" ; then
AC_CHECK_PROG(fribidi_config,fribidi-config,yes,fribidi="no")
if test "$fribidi_config" = "yes" ; then
FRIBIDI_CFLAGS="`fribidi-config --cflags`"
FRIBIDI_LIBS="`fribidi-config --libs`"
have_fribidi="yes"
fi
fi
else
have_fribidi="no"
fi
if test "$have_fribidi" = "yes" ; then
if test "$dl_ctl" = "yes" ; then
CTL_LIBS="libctl${TRUECOLOR_TAG}_bidi.la ${CTL_LIBS}"
else
CTL_CFLAGS="-DUSE_FRIBIDI ${CTL_CFLAGS}"
CTL_LIBS="libctl${TRUECOLOR_TAG}_bidi.a ${CTL_LIBS}"
CTL_LIBS_FOR_PROG="../vtemu/libctl/libctl${TRUECOLOR_TAG}_bidi.a ${FRIBIDI_LIBS} ${CTL_LIBS_FOR_PROG}"
CTL_LIBS_FOR_VTE="${FRIBIDI_LIBS} ${CTL_LIBS_FOR_VTE}"
fi
fi
AC_SUBST(FRIBIDI_CFLAGS)
AC_SUBST(FRIBIDI_LIBS)
AC_SUBST(CTL_CFLAGS)
AC_SUBST(CTL_LIBS_FOR_VTE)
AC_ARG_WITH(pthread,
[ --without-pthread do not use pthread @<:@default=with@:>@])
AC_ARG_ENABLE(dl-type,
[ --disable-dl-type dynamic loading type engine library @<:@default=enable@:>@],
dl_type=$enable_dl_type, dl_type="yes")
if test "$enable_shared" = "no" ; then
dl_type="no"
fi
if test "$dl_type" = "yes" ; then
TYPE_LOADER_OBJ=ui_type_loader.o
if test "$gui" != "xlib" ; then
TYPE_CFLAGS="-DNO_DYNAMIC_LOAD_TYPE"
fi
else
TYPE_CFLAGS="-DNO_DYNAMIC_LOAD_TYPE"
TYPE_LIBS_FOR_VTE="../uitoolkit/libtype/*.lo"
fi
AC_SUBST(TYPE_LOADER_OBJ)
if test "$gui" != "win32" -a "$gui" != "quartz"; then
PKG_CHECK_MODULES(FONTCONFIG, fontconfig, have_fc=yes, have_fc=no)
if test "$have_fc" = "yes"; then
FONTCONFIG_CFLAGS="$FONTCONFIG_CFLAGS -DUSE_FONTCONFIG"
AC_SUBST(FONTCONFIG_CFLAGS)
AC_SUBST(FONTCONFIG_LIBS)
fi
fi
AC_ARG_ENABLE(anti_alias,
[ --disable-anti-alias same as --with-type-engines=xcore on xlib @<:@default=enabled@:>@
do not use truetype fonts on framebuffer @<:@default=enabled@:>@ ],
anti_alias=$enable_anti_alias, anti_alias="auto")
if test "$anti_alias" != "no"; then
if test "$gui" = "fb" -o "$gui" = "wayland" -o "$gui" = "sdl2"; then
if test "$have_ft" = "yes" ; then
FT_CFLAGS="$FT_CFLAGS -DUSE_FREETYPE "
AC_ARG_ENABLE(fontconfig,
[ --disable-fontconfig use fontconfig with freetype on framebuffer or wayland @<:@default=enabled@:>@ ],
fontconfig=$enable_fontconfig, fontconfig="yes")
if test "$fontconfig" != "no" -a "$have_fc" = "yes"; then
FT_CFLAGS="$FT_CFLAGS $FONTCONFIG_CFLAGS"
FT_LIBS="$FT_LIBS $FONTCONFIG_LIBS"
else
fontconfig="no"
fi
AC_SUBST(FT_CFLAGS)
AC_SUBST(FT_LIBS)
fi
fi
fi
AC_ARG_WITH(type_engines,
[ --with-type-engines@<:@=ARG@:>@ type engines (xcore, xft, cairo) @<:@default=xcore,xft,cairo@:>@],
type_engines=$with_type_engines)
if test "$gui" != "xlib" ; then
type_engines="xcore"
elif test "$type_engines" = "" ; then
if test "$anti_alias" = "no" ; then
type_engines="xcore"
else
type_engines="xcore,xft,cairo"
fi
fi
type_engines=`echo ${type_engines} | sed 's/,/ /g'`
for type_engine in ${type_engines} ; do
case ${type_engine} in
xft)
PKG_CHECK_MODULES(XFT, xft, have_xft=yes, have_xft=no)
if test "$have_xft" != "yes" ; then
AC_CHECK_PROG(xft_config,xft-config,yes)
if test "$xft_config" = "yes" ; then
XFT_CFLAGS="`xft-config --cflags`"
XFT_LIBS="`xft-config --libs`"
have_xft=yes
else
AC_CHECK_LIB(Xft,XftDrawCreate,
[
have_xft=yes
# -lfontconfig is necessary because ui_font_ft.c refers FcXXX
# functions directly.
# -lfreetype is necessary because ui_window_xft.c refers FT_XXX
# functions directly.
XFT_LIBS="-lXft -lfontconfig -lfreetype"
])
fi
elif test "$gui" = "xlib" ; then
# In some platforms (e.g. ubuntu 14.04) dependency_libs="" in libXft.la.
# So if --disable-shared is specified or allow_undefined_flags = unsupported,
# compiling fails.
XFT_LIBS="$XFT_LIBS -lfontconfig -lfreetype"
fi
if test "$have_xft" = "yes" ; then
if test "$dl_type" = "yes" ; then
TYPE_LIBS="libtype_xft.la ${TYPE_LIBS}"
else
NODL_OBJ="ui_window_xft.o ${NODL_OBJ}"
TYPE_LIBS_FOR_VTE="${XFT_LIBS} ${TYPE_LIBS_FOR_VTE}"
fi
TYPE_CFLAGS="-DUSE_TYPE_XFT ${TYPE_CFLAGS}"
type_engines_result="$type_engines_result xft"
fi
;;
cairo)
PKG_CHECK_MODULES(CAIRO, cairo, have_cairo=yes, have_cairo=no)
if test "$have_cairo" != "yes" ; then
AC_CHECK_LIB(cairo,cairo_create,
[
have_cairo=yes
# -lfontconfig is necessary because ui_font_ft.c refers FcXXX
# functions directly.
# -lfreetype is necessary because ui_window_cairo.c refers FT_XXX
# functions directly.
CAIRO_LIBS="-lcairo -lfontconfig -lfreetype"
])
elif test "$gui" = "xlib" ; then
# In some platforms (e.g. ubuntu 14.04) dependency_libs="" in libcairo.la.
# So if --disable-shared is specified or allow_undefined_flags = unsupported,
# compiling fails.
CAIRO_LIBS="$CAIRO_LIBS -lfontconfig -lfreetype"
fi
if test "$have_cairo" = "yes" ; then
if test "$dl_type" = "yes" ; then
TYPE_LIBS="libtype_cairo.la ${TYPE_LIBS}"
if test "$with_pthread" != "no" ; then
# NetBSD doesn't allow shared libraries to link
# libpthread without linking it to executables.
case "${host_os}" in
netbsd*)
PTHREAD_LIB="-lpthread"
;;
esac
fi
else
NODL_OBJ="ui_window_cairo.o ${NODL_OBJ}"
TYPE_LIBS_FOR_VTE="${CAIRO_LIBS} ${TYPE_LIBS_FOR_VTE}"
fi
TYPE_CFLAGS="-DUSE_TYPE_CAIRO ${TYPE_CFLAGS}"
type_engines_result="$type_engines_result cairo"
fi
;;
xcore)
TYPE_CFLAGS="-DUSE_TYPE_XCORE ${TYPE_CFLAGS}"
type_engines_result="$type_engines_result xcore"
;;
*)
echo "${type_engine} is unknown type engine."
;;
esac
done
AC_ARG_ENABLE(otl,
[ --disable-otl Open Type layout with the use of harfbuzz or libotf @<:@default=enabled@:>@],
otl=$enable_otl,
otl="yes")
if test "$otl" != "yes" ; then
echo "Open Type layout is disabled"
elif test "$gui" = "xlib" -a "$dl_type" = "no" -a "$type_engines_result" = " xcore"; then
echo "libotf/libharfbuzz is not available."
elif test "$gui" = "fb" -a "$have_ft" != "yes" ; then
echo "libotf/libharfbuzz is not available."
elif test "$gui" = "wayland" -a "$have_ft" != "yes" ; then
echo "libotf/libharfbuzz is not available."
elif test "$gui" = "sdl2" -a "$have_ft" != "yes" ; then
echo "libotf/libharfbuzz is not available."
elif test "$gui" = "console" ; then
echo "libotf/libharfbuzz is not available."
else
PKG_CHECK_MODULES(HB, harfbuzz, have_hb=yes, have_hb=no)
if test "$have_hb" = "yes" ; then
if test "$gui" = "quartz" ; then
CFLAGS_orig=$CFLAGS
CPPFLAGS_orig=$CPPFLAGS
CFLAGS="$CFLAGS $HB_CFLAGS"
CPPFLAGS="$CPPFLAGS $HB_CFLAGS"
AC_CHECK_HEADER(hb-coretext.h, have_hb_coretext_h=yes, have_hb_coretext_h=no)
CFLAGS=$CFLAGS_orig
CPPFLAGS=$CPPFLAGS_orig
if test "$have_hb_coretext_h" != "yes" ; then
echo ""
echo "** ERROR **"
echo "harfbuzz/hb-coretext.h is not found."
echo "Install harfbuzz with --with-coretext=yes in advance."
echo ""
have_hb=no
fi
elif test "$have_ft" = "yes" ; then
CFLAGS_orig=$CFLAGS
CPPFLAGS_orig=$CPPFLAGS
CFLAGS="$CFLAGS $HB_CFLAGS $FT_CFLAGS_ORIGINAL"
CPPFLAGS="$CPPFLAGS $HB_CFLAGS $FT_CFLAGS_ORIGINAL"
AC_CHECK_HEADER(hb-ft.h, have_hb_ft_h=yes, have_hb_ft_h=no)
CFLAGS=$CFLAGS_orig
CPPFLAGS=$CPPFLAGS_orig
if test "$have_hb_ft_h" != "yes" ; then
echo ""
echo "** ERROR **"
echo "harfbuzz/hb-ft.h is not found."
echo "Install harfbuzz with --with-freetype=yes in advance."
echo ""
have_hb=no
fi
fi
fi
if test "$have_hb" = "yes"; then
OT_LAYOUT_CFLAGS="$HB_CFLAGS -DUSE_HARFBUZZ -DUSE_OT_LAYOUT"
OT_LAYOUT_LIBS="$HB_LIBS"
OT_LAYOUT_OBJ=hb.o
if test "$gui" = "win32"; then
OT_LAYOUT_LIBS="$OT_LAYOUT_LIBS -lfreetype"
elif test "$gui" != "quartz" -a "$have_ft" = "yes"; then
OT_LAYOUT_CFLAGS="$OT_LAYOUT_CFLAGS $FT_CFLAGS_ORIGINAL"
fi
elif test "$gui" = "win32" ; then
OT_LAYOUT_CFLAGS="-DUSE_OT_LAYOUT -DUSE_UNISCRIBE"
OT_LAYOUT_OBJ=uniscribe.o
OT_LAYOUT_LIBS="-lusp10"
else
AC_CHECK_PROG(libotf_config,libotf-config,yes)
if test "$libotf_config" = "yes" ; then
OT_LAYOUT_CFLAGS="`libotf-config --cflags` -DUSE_OT_LAYOUT"
OT_LAYOUT_LIBS="`libotf-config --libs`"
OT_LAYOUT_OBJ=otf.o
fi
fi
if test "$OT_LAYOUT_OBJ" != "" -a "$enable_shared" = "no" ; then
OT_LAYOUT_CFLAGS="$OT_LAYOUT_CFLAGS -DNO_DYNAMIC_LOAD_OTL"
OT_LAYOUT_LIBS_FOR_PROG="$OT_LAYOUT_LIBS"
fi
if test "$OT_LAYOUT_OBJ" != "" -a "$LMLTERM_CORE" = "libmlterm${TRUECOLOR_TAG}_core.la" ; then
LMLTERM_CORE="libmlterm${TRUECOLOR_TAG}_coreotl.la"
fi
fi
AC_SUBST(OT_LAYOUT_LIBS)
AC_SUBST(OT_LAYOUT_LIBS_FOR_PROG)
AC_SUBST(OT_LAYOUT_CFLAGS)
AC_SUBST(OT_LAYOUT_OBJ)
if test "$OT_LAYOUT_OBJ" != "" ; then
MAKE_DIRS2="uitoolkit/libotl ${MAKE_DIRS2}"
OUTPUT_FILES="uitoolkit/libotl/Makefile ${OUTPUT_FILES}"
fi
if test "${NODL_OBJ}" != "" ; then
TYPE_LIBS=libtype.a
TYPE_LIBS_FOR_PROG="../uitoolkit/libtype/libtype.a ${CAIRO_LIBS} ${XFT_LIBS} ${OT_LAYOUT_LIBS}"
fi
if test "${TYPE_CFLAGS}" = "" ; then
echo "No type engine is specified."
exit 1
fi
AC_SUBST(XFT_CFLAGS)
AC_SUBST(XFT_LIBS)
AC_SUBST(CAIRO_LIBS)
AC_SUBST(CAIRO_LIBS)
AC_SUBST(TYPE_CFLAGS)
AC_SUBST(TYPE_LIBS)
AC_SUBST(TYPE_LIBS_FOR_PROG)
AC_SUBST(TYPE_LIBS_FOR_VTE)
AC_SUBST(NODL_OBJ)
AC_SUBST(PROG)
AC_ARG_ENABLE(ssh2,
[ --disable-ssh2 libssh2 @<:@default=enabled@:>@],
ssh2=$enable_ssh2, ssh2="yes")
if test "$ssh2" = "yes" ; then
PKG_CHECK_MODULES(SSH2, libssh2,
[
SSH2_CFLAGS="$SSH2_CFLAGS -DUSE_LIBSSH2"
if test "x$allow_undefined_flag" = "xunsupported" ; then
# vt_pty_ssh.c uses CRYPTO_xxx functions.
SSH2_LIBS="-lcrypto $SSH2_LIBS"
fi
], ssh2="no")
fi
if test "$enable_shared" != "no" ; then
AC_ARG_WITH(mosh,
[ --with-mosh@<:@=ARG@:>@ The directory where mosh is built])
if test -d "$with_mosh"; then
PKG_CHECK_MODULES(PROTOBUF, protobuf, MOSH_DIR=$with_mosh, with_mosh="")
if test "$MOSH_DIR" != ""; then
if test -f $MOSH_DIR/src/crypto/ocb.cc; then
# mosh-1.3.2 or before.
MOSH_OCB_OBJ="ocb.o"
# XXX (See terminaldisplayinit.cc)
PROTOBUF_CFLAGS="$PROTOBUF_CFLAGS -DMOSH_VERSION=10302"
else
# mosh-1.4.0 or later.
MOSH_OCB_OBJ="ocb_internal.o"
fi
fi
fi
fi
if test "$ml_cv_is_posix" = "no" ; then
if test "$ssh2" = "yes" ; then
VT_PTY_OBJ="vt_pty_ssh.o vt_pty_mosh.o"
if test -d "$with_mosh"; then
MAKE_DIRS2="${MAKE_DIRS2} vtemu/libptyssh vtemu/libptymosh"
OUTPUT_FILES="${OUTPUT_FILES} vtemu/libptyssh/Makefile vtemu/libptymosh/Makefile"
SSH2_LIBS_FOR_PROG="-lwsock32"
# XXX Hack for wcwidth()
PROTOBUF_LIBS="$PROTOBUF_LIBS \${top_builddir}/encodefilter/src/libmef.la"
else
# Not dlopen
SSH2_CFLAGS="$SSH2_CFLAGS -DNO_DYNAMIC_LOAD_SSH"
SSH2_LIBS_FOR_PROG="$SSH2_LIBS -lwsock32 -lws2_32"
SSH2_LIBS=
fi
SSH2_LIBS_FOR_VTE=$SSH2_LIBS_FOR_PROG
fi
AC_CHECK_FUNC(CreatePseudoConsole,
[
PTY_CFLAGS="-DUSE_CONPTY"
win32pty="conpty pipe"
],
[win32pty=pipe])
AC_SUBST(PTY_CFLAGS)
VT_PTY_OBJ="$VT_PTY_OBJ vt_pty_win32.o"
else
VT_PTY_OBJ="vt_pty_unix.o"
if test "$ssh2" = "yes" ; then
if test "$with_pthread" != "no" ; then
AC_CHECK_HEADER(pthread.h,
[
SSH2_CFLAGS="$SSH2_CFLAGS -DHAVE_PTHREAD"
SSH2_LIBS="$SSH2_LIBS -lpthread"
])
# NetBSD doesn't allow shared libraries to link libpthread
# without linking it to executables.
case "${host_os}" in
netbsd*)
PTHREAD_LIB="-lpthread"
;;
esac
fi
VT_PTY_OBJ="vt_pty_ssh.o vt_pty_mosh.o ${VT_PTY_OBJ}"
if test "$enable_shared" = "no" ; then
SSH2_CFLAGS="$SSH2_CFLAGS -DNO_DYNAMIC_LOAD_SSH"
SSH2_LIBS_FOR_PROG="$SSH2_LIBS"
SSH2_LIBS=
else
# dlopen libptyssh
MAKE_DIRS2="vtemu/libptyssh ${MAKE_DIRS2}"
OUTPUT_FILES="vtemu/libptyssh/Makefile ${OUTPUT_FILES}"
if test -d "$with_mosh"; then
MAKE_DIRS2="${MAKE_DIRS2} vtemu/libptymosh"
OUTPUT_FILES="${OUTPUT_FILES} vtemu/libptymosh/Makefile"
fi
fi
if test "$ios_sdk" != ""; then
# system() is disabled on ios.
SSH2_CFLAGS="$SSH2_CFLAGS -DNO_XAUTH"
fi
fi
fi
AC_SUBST(SSH2_LIBS)
AC_SUBST(SSH2_LIBS_FOR_PROG)
AC_SUBST(SSH2_LIBS_FOR_VTE)
AC_SUBST(SSH2_CFLAGS)
AC_SUBST(VT_PTY_OBJ)
AC_SUBST(MOSH_DIR)
AC_SUBST(MOSH_OCB_OBJ)
AC_SUBST(PROTOBUF_CFLAGS)
AC_SUBST(PROTOBUF_LIBS)
if test "${have_gtk}" = "yes" ; then
if test "${gtk_version}" = "3.0" ; then
PKG_CHECK_MODULES(VTE, vte-2.91, have_vte=yes, have_vte=no)
if test "$have_vte" = "yes" ; then
VTE_ABI=2.91
else
PKG_CHECK_MODULES(VTE, vte-2.90, have_vte=yes, have_vte=no)
if test "$have_vte" = "yes"; then
VTE_ABI=2.90
fi
fi
else
PKG_CHECK_MODULES(VTE, vte, have_vte=yes, have_vte=no)
fi
if test "$have_vte" = "yes" ; then
OUTPUT_FILES="gtk/Makefile ${OUTPUT_FILES}"
AC_SUBST(VTE_ABI)
fi
else
have_vte=no
fi
if test "$image" = "yes"; then
tools="mlclient,mlconfig,mlcc,mlterm-menu,mlimgloader,registobmp,mlfc"
else
tools="mlclient,mlconfig,mlcc,mlterm-menu,mlfc"
fi
AC_ARG_WITH(tools,
[ --with-tools@<:@=ARG@:>@ external tools @<:@default=mlclient,mlconfig,mlcc,mlterm-menu,mlimgloader,registobmp,mlfc@:>@]
(mlimgloader is automatically added unless --disable-image or --with-imagelib is specified),
[
# if given --without-tools
if test "${with_tools}" = "no" ; then
tools=""
else
if test "${with_tools}" != "yes" ; then
tools=${with_tools}
fi
if test -z "$IMAGELIB_CFLAGS" -a "`echo ${tools}|$GREP mlimgloader`" = "" -a "$image" = "yes"; then
# If --with-imagelib option is not specified, mlimgloader is always built.
tools=${tools},mlimgloader
fi
fi
])
tools=`echo ${tools} | sed 's/,/ /g'`
AC_ARG_ENABLE(use-tools,
[ --disable-use-tools do not build and use external tools @<:@default=enabled@:>@])
if test "$enable_use_tools" = "no" ; then
TOOLS_CFLAGS="-DNO_TOOLS"
tools=
fi
AC_SUBST(TOOLS_CFLAGS)
AM_INIT_AUTOMAKE(mlterm,3.9.4)
if test "$gui_list" != ""; then
# Enable all tools by default
gui_for_tool="xlib"
else
gui_for_tool=$gui
fi
for tool in ${tools} ; do
case ${tool} in
mlconfig)
if test "$gui_for_tool" != "fb" -a "$gui_for_tool" != "console" ; then
if test "${have_gtk}" = "yes" -o "${have_gtk4}" = "yes" ; then
AM_GLIB_GNU_GETTEXT
MAKE_DIRS2="tool/mlconfig ${MAKE_DIRS2}"
OUTPUT_FILES="tool/mlconfig/Makefile ${OUTPUT_FILES}"
if test "${MSGFMT}" != "no"; then
OUTPUT_FILES="tool/mlconfig/po/Makefile.in ${OUTPUT_FILES}"
fi
tools_result="$tools_result $tool"
if test "$have_gtk4" = "yes" ; then
GTK_CFLAGS_FOR_MLCONFIG=$GTK4_CFLAGS
GTK_LIBS_FOR_MLCONFIG=$GTK4_LIBS
else
if test "$gtk_version" = "2.0"; then
# for gtkxlfdsel.c
X_LIBS_FOR_MLCONFIG=$X_LIBS
fi
GTK_CFLAGS_FOR_MLCONFIG=$GTK_CFLAGS
GTK_LIBS_FOR_MLCONFIG=$GTK_LIBS
fi
AC_SUBST(X_LIBS_FOR_MLCONFIG)
AC_SUBST(GTK_CFLAGS_FOR_MLCONFIG)
AC_SUBST(GTK_LIBS_FOR_MLCONFIG)
else
echo ""
echo "** WARNING **"
echo " couldn't compile mlconfig since headers/libraries of GTK+ are missing."
echo ""
fi
fi
;;
mlterm-menu)
if test "${have_gtk}" = "yes" -a "$gui_for_tool" != "fb" -a "$gui_for_tool" != "console" ; then
MAKE_DIRS2="contrib/tool/mlterm-menu ${MAKE_DIRS2}"
OUTPUT_FILES="contrib/tool/mlterm-menu/Makefile ${OUTPUT_FILES}"
tools_result="$tools_result $tool"
else
echo ""
echo "** WARNING **"
echo " couldn't compile mlterm-menu since headers/libraries of GTK+-2 are missing."
echo ""
fi
;;
mlclient)
if test "$ml_cv_is_posix" = "yes" -a "$gui_for_tool" != "console" ; then
MAKE_DIRS2="tool/mlclient ${MAKE_DIRS2}"
OUTPUT_FILES="tool/mlclient/Makefile ${OUTPUT_FILES}"
tools_result="$tools_result $tool"
fi
;;
w3mmlconfig)
AC_PATH_PROG(PERL,perl,$PATH)
if test "x$PERL" = x ; then
echo ""
echo "** WARNING **"
echo " couldn't find perl in PATH environment variable."
echo ""
PERL="/usr/local/bin/perl" # should be "/usr/bin/env perl"?
fi
MAKE_DIRS2="tool/w3mmlconfig ${MAKE_DIRS2}"
OUTPUT_FILES="tool/w3mmlconfig/Makefile tool/w3mmlconfig/mlconfig.cgi tool/w3mmlconfig/w3mmlconfig ${OUTPUT_FILES}"
tools_result="$tools_result $tool"
;;
mlcc)
if test "$ml_cv_is_posix" = "yes" ; then
MAKE_DIRS2="contrib/tool/mlcc ${MAKE_DIRS2}"
OUTPUT_FILES="contrib/tool/mlcc/Makefile ${OUTPUT_FILES}"
tools_result="$tools_result $tool"
fi
;;
mlmenu)
if test "$gui_for_tool" = "xlib" ; then
MAKE_DIRS2="tool/mlmenu ${MAKE_DIRS2}"
OUTPUT_FILES="tool/mlmenu/Makefile ${OUTPUT_FILES}"
tools_result="$tools_result $tool"
fi
;;
mlterm-zoom)
if test "$gui_for_tool" = "xlib" ; then
MAKE_DIRS2="contrib/tool/mlterm-zoom ${MAKE_DIRS2}"
OUTPUT_FILES="contrib/tool/mlterm-zoom/Makefile ${OUTPUT_FILES}"
tools_result="$tools_result $tool"
fi
;;
mlimgloader)
if test "$gui_for_tool" != "quartz" ; then
OUTPUT_FILES="tool/mlimgloader/Makefile ${OUTPUT_FILES}"
MAKE_DIRS2="tool/mlimgloader ${MAKE_DIRS2}"
tools_result="$tools_result $tool"
AC_TRY_COMPILE([
#include <windows.h>
#include <gdiplus.h>],,
have_gdiplus=yes,have_gdiplus=no)
if test "$have_gdiplus" = "yes" ; then
MLIMGLOADER_LIB=gdiplus
elif test "$have_gdk_pixbuf2" = "yes" -o "$have_gdk_pixbuf1" = "yes" ; then
MLIMGLOADER_LIB=gdk-pixbuf
else
PKG_CHECK_MODULES(LIBPNG, libpng, MLIMGLOADER_LIB=libpng, MLIMGLOADER_LIB=none)
AC_SUBST(LIBPNG_CFLAGS)
AC_SUBST(LIBPNG_LIBS)
fi
AC_SUBST(MLIMGLOADER_LIB)
if test "$have_ft" = "yes"; then
EMOJI_CFLAGS="-DUSE_FREETYPE_EMOJI $FT_CFLAGS_ORIGINAL"
EMOJI_LIBS="$FT_LIBS"
AC_SUBST(EMOJI_CFLAGS)
AC_SUBST(EMOJI_LIBS)
fi
fi
;;
registobmp)
if test "$have_sdl2" = "yes"; then
SDL_CFLAGS=$SDL2_CFLAGS
SDL_LIBS=$SDL2_LIBS
else
PKG_CHECK_MODULES(SDL, sdl2, have_sdl2=yes, have_sdl2=no)
if test "$have_sdl2" != "yes" ; then
PKG_CHECK_MODULES(SDL, sdl, have_sdl=yes, have_sdl=no)
fi
fi
if test "$have_sdl2" = "yes"; then
PKG_CHECK_MODULES(SDLTTF, SDL2_ttf, have_sdlttf=yes, have_sdlttf=no)
elif test "$have_sdl" = "yes"; then
PKG_CHECK_MODULES(SDLTTF, SDL_ttf, have_sdlttf=yes, have_sdlttf=no)
else
continue
fi
if test "$have_sdlttf" = "yes"; then
SDLTTF_CFLAGS="$SDLTTF_CFLAGS -DUSE_SDLTTF"
fi
SDL_CFLAGS="$SDL_CFLAGS $SDLTTF_CFLAGS"
SDL_LIBS="$SDL_LIBS $SDLTTF_LIBS"
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
OUTPUT_FILES="tool/registobmp/Makefile ${OUTPUT_FILES}"
MAKE_DIRS2="tool/registobmp ${MAKE_DIRS2}"
tools_result="$tools_result $tool"
;;
mlfc)
if test "$gui_for_tool" != "win32" -a "$gui_for_tool" != "quartz" ; then
if test "$have_fc" = "yes" ; then
OUTPUT_FILES="tool/mlfc/Makefile ${OUTPUT_FILES}"
MAKE_DIRS2="tool/mlfc ${MAKE_DIRS2}"
tools_result="$tools_result $tool"
fi
fi
;;
*)
echo "${tool} is unknown tool."
;;
esac
done
if test "$gui" = "win32"; then
OUTPUT_FILES="tool/servman/Makefile ${OUTPUT_FILES}"
MAKE_DIRS2="tool/servman ${MAKE_DIRS2}"
tools_result="$tools_result servman"
fi
#
# --- libltdl ---
#
AC_ARG_WITH(libltdl,
[ --with-libltdl@<:@=PREFIX@:>@ load modules with libltdl @<:@default=without@:>@],,
[with_libltdl=no])
# We don't check here wheter libltdl is installed. (See pobl/src/configure.in)
#
# --- Xdnd ---
#
AC_ARG_ENABLE(dnd,
[ --disable-dnd dnd @<:@default=enabled@:>@],
dnd=$enable_dnd, dnd="yes")
if test "$dnd" = "no" ; then
DND_CFLAGS="-DDISABLE_XDND"
fi
AC_SUBST(DND_CFLAGS)
DL_LIBS_IM=""
#
# --- kbd ---
#
AC_ARG_ENABLE(kbd,
[ --disable-kbd input method for Arabic and Indic @<:@default=enabled@:>@],
kbd=$enable_kbd)
if test "$enable_shared" = "no" ; then
kbd="no"
fi
if test "$kbd" != "no" ; then
MAKE_DIRS2="inputmethod/kbd ${MAKE_DIRS2}"
OUTPUT_FILES="inputmethod/kbd/Makefile ${OUTPUT_FILES}"
if test "x$with_libltdl" != "xno" ; then
DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/kbd/libim-kbd.la ${DL_LIBS_IM}"
fi
input_methods_result="$input_methods_result kbd"
fi
#
# --- uim ---
#
AC_ARG_ENABLE(uim,
[ --disable-uim uim @<:@default=enabled@:>@],
uim=$enable_uim)
if test "$enable_shared" = "no" -o "$gui" = "quartz" ; then
uim="no"
fi
if test "x$uim" != xno ; then
PKG_CHECK_MODULES(UIM, uim >= 1.0.0, have_uim=yes, have_uim=no)
if test "x$have_uim" = xyes ; then
MAKE_DIRS2="inputmethod/uim ${MAKE_DIRS2}"
OUTPUT_FILES="inputmethod/uim/Makefile ${OUTPUT_FILES}"
if test "x$with_libltdl" != xno ; then
DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/uim/libim-uim.la ${DL_LIBS_IM}"
fi
input_methods_result="$input_methods_result uim"
fi
fi
AC_SUBST(UIM_CFLAGS)
AC_SUBST(UIM_LIBS)
#
# --- IIIMF ---
#
AC_ARG_ENABLE(iiimf,
[ --disable-iiimf IIIMF (Experimental) @<:@default=enabled@:>@],
iiimf=$enable_iiimf)
if test "x$iiimf" != xno ; then
PKG_CHECK_MODULES(IIIMCF, iiimf-lib-client, have_iiimcf=yes, have_iiimcf=no)
if test "x$have_iiimcf" = xyes ; then
found_iiimcf=yes
elif test -d /usr/lib/im/lib ; then
LIBS="$LIBS -L/usr/lib/im/lib"
AC_CHECK_LIB(iiimcf, iiimcf_create_context,
[
found_iiimcf=yes
IIIMCF_CFLAGS="-I/usr/lib/im/include"
IIIMCF_LIBS="-L/usr/lib/im/lib -liiimcf"
])
else
AC_CHECK_LIB(iiimcf, iiimcf_create_context,
[
found_iiimcf=yes
IIIMCF_CFLAGS="-I/usr/include/iiim"
IIIMCF_LIBS="-liiimcf"
])
fi
if test "x$found_iiimcf" = xyes ; then
IM_CFLAGS="$IM_CFLAGS -DUSE_IIIMF"
MAKE_DIRS2="inputmethod/iiimf ${MAKE_DIRS2}"
OUTPUT_FILES="inputmethod/iiimf/Makefile ${OUTPUT_FILES}"
if test "x$with_libltdl" != xno ; then
echo ""
echo "** ERROR **"
echo " IIIMF plugin couldn't be used with libltdl."
echo ""
exit 1
else
input_methods_result="$input_methods_result IIIMF"
fi
AC_CHECK_LIB(iiimcf, iiimcf_create_hotkey_notify_event,
[
IIIMCF_CFLAGS="$IIIMCF_CFLAGS -DHAVE_HOTKEY_NOTFY_EVENT"
])
AC_CHECK_LIB(iiimcf, iiimcf_create_aux_getvalues_event,
[
IIIMCF_CFLAGS="$IIIMCF_CFLAGS -DHAVE_AUX_GETVALUES_EVENT"
])
fi
fi
AC_SUBST(IIIMCF_CFLAGS)
AC_SUBST(IIIMCF_LIBS)
#
# --- m17n library ---
#
AC_ARG_ENABLE(m17nlib,
[ --disable-m17nlib m17n library @<:@default=enabled@:>@],
m17nlib=$enable_m17nlib)
if test "$enable_shared" = "no" -o "$gui" = "quartz" ; then
m17nlib="no"
fi
if test "x$m17nlib" != xno ; then
AC_CHECK_PROG(m17n_config, m17n-config, yes, no)
if test "$m17n_config" = "yes"; then
M17NLIB_LIBS=`m17n-config --libs`
M18NLIB_CFLAGS=`m17n-config --cflags`
m17nlib=yes
else
PKG_CHECK_MODULES(M17NLIB, m17n-shell, m17nlib=yes, m17nlib=no)
fi
if test "$m17nlib" = "yes"; then
m17n_saved_libs="$LIBS"
LIBS="$LIBS $M17NLIB_LIBS"
AC_CHECK_LIB(m17n, minput_open_im,
[
MAKE_DIRS2="inputmethod/m17nlib ${MAKE_DIRS2}"
OUTPUT_FILES="inputmethod/m17nlib/Makefile ${OUTPUT_FILES}"
if test "x$with_libltdl" != xno ; then
DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/m17nlib/libim-m17nlib.la ${DL_LIBS_IM}"
fi
input_methods_result="$input_methods_result m17nlib"
])
LIBS="$m17n_saved_libs"
fi
fi
AC_SUBST(M17NLIB_CFLAGS)
AC_SUBST(M17NLIB_LIBS)
#
# --- IBUS ---
#
AC_ARG_ENABLE(ibus,
[ --disable-ibus IBUS @<:@default=enabled@:>@],
ibus=$enable_ibus)
if test "$enable_shared" = "no" -o "$gui" = "quartz" ; then
ibus="no"
fi
if test "x$ibus" != "xno" ; then
PKG_CHECK_MODULES(IBUS, ibus-1.0 >= 1.3.0, has_ibus=yes, has_ibus=no)
if test "x$has_ibus" = xyes ; then
MAKE_DIRS2="inputmethod/ibus ${MAKE_DIRS2}"
OUTPUT_FILES="inputmethod/ibus/Makefile ${OUTPUT_FILES}"
if test "x$with_libltdl" != xno ; then
DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/ibus/libim-ibus.la ${DL_LIBS_IM}"
fi
if test "$with_pthread" != "no" ; then
# NetBSD doesn't allow shared libraries to link libpthread
# without linking it to executables.
case "${host_os}" in
netbsd*)
PTHREAD_LIB="-lpthread"
;;
esac
fi
input_methods_result="$input_methods_result iBus"
fi
fi
AC_SUBST(IBUS_CFLAGS)
AC_SUBST(IBUS_LIBS)
#
# --- FCITX ---
#
AC_ARG_ENABLE(fcitx,
[ --disable-fcitx FCITX @<:@default=enabled@:>@],
fcitx=$enable_fcitx)
if test "$enable_shared" = "no" -o "$gui" = "quartz" ; then
fcitx="no"
fi
if test "x$fcitx" != "xno" ; then
PKG_CHECK_MODULES(FCITX, Fcitx5GClient, has_fcitx=yes, has_fcitx=no)
if test "x$has_fcitx" = xyes ; then
PKG_CHECK_MODULES(FCITXUTILS, Fcitx5Utils, has_fcitx=yes, has_fcitx=no)
fi
fcitx_result="fcitx"
if test "x$has_fcitx" = xno ; then
PKG_CHECK_MODULES(FCITX, fcitx-gclient, has_fcitx=yes, has_fcitx=no)
else
FCITX_CFLAGS="$FCITX_CFLAGS $FCITXUTILS_CFLAGS -DUSE_FCITX5"
# 'pkg-config Fcitx5GClient --libs' doesn't output -lFcitx5GClient
# (fcitx5-gtk-5.0.6 on archlinux)
# fcitx5-gtk-5.0.7 fixed it.
if test "`echo $FCITX_LIBS|grep lFcitx5GClient`" = ""; then
FCITX_LIBS="$FCITX_LIBS -lFcitx5GClient"
fi
fcitx_result="fcitx5"
fi
if test "x$has_fcitx" = xyes ; then
MAKE_DIRS2="inputmethod/fcitx ${MAKE_DIRS2}"
OUTPUT_FILES="inputmethod/fcitx/Makefile ${OUTPUT_FILES}"
if test "x$with_libltdl" != xno ; then
DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/fcitx/libim-fcitx.la ${DL_LIBS_IM}"
fi
if test "$with_pthread" != "no" ; then
# NetBSD doesn't allow shared libraries to link libpthread
# without linking it to executables.
case "${host_os}" in
netbsd*)
PTHREAD_LIB="-lpthread"
;;
esac
fi
input_methods_result="$input_methods_result $fcitx_result"
fi
fi
AC_SUBST(FCITX_CFLAGS)
AC_SUBST(FCITX_LIBS)
#
# --- SCIM ---
#
AC_ARG_ENABLE(scim,
[ --disable-scim SCIM @<:@default=enabled@:>@],
scim=$enable_scim)
if test "$enable_shared" = "no" -o "$gui" = "quartz" ; then
scim="no"
fi
if test "x$scim" != "xno" -a "$gui" != "fb" -a "$gui" != "console" ; then
PKG_CHECK_MODULES(SCIM, scim >= 1.4.0, has_scim=yes , has_scim=no)
if test "x$has_scim" = xyes ; then
MAKE_DIRS2="inputmethod/scim ${MAKE_DIRS2}"
OUTPUT_FILES="inputmethod/scim/Makefile ${OUTPUT_FILES}"
if test "x$with_libltdl" != xno ; then
DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/scim/libim-scim.la ${DL_LIBS_IM}"
fi
input_methods_result="$input_methods_result SCIM"
fi
fi
AC_SUBST(SCIM_CFLAGS)
AC_SUBST(SCIM_LIBS)
#
# --- CANNA ---
#
AC_ARG_ENABLE(canna,
[ --disable-canna CANNA @<:@default=enabled@:>@],
canna=$enable_canna)
if test "$enable_shared" = "no" -o "$ml_cv_is_posix" = "no" ; then
canna="no"
fi
if test "x$canna" != "xno" ; then
AC_CHECK_HEADER(canna/jrkanji.h, has_canna=yes, has_canna=no)
if test "x$has_canna" = xyes ; then
CANNA_LIBS="-lcanna"
MAKE_DIRS2="inputmethod/canna ${MAKE_DIRS2}"
OUTPUT_FILES="inputmethod/canna/Makefile ${OUTPUT_FILES}"
if test "x$with_libltdl" != xno ; then
DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/canna/libim-canna.la ${DL_LIBS_IM}"
fi
input_methods_result="$input_methods_result canna"
fi
fi
AC_SUBST(CANNA_CFLAGS)
AC_SUBST(CANNA_LIBS)
#
# --- WNN ---
#
AC_ARG_ENABLE(wnn,
[ --disable-wnn WNN @<:@default=enabled@:>@],
wnn=$enable_wnn)
if test "$enable_shared" = "no" -o "$ml_cv_is_posix" = "no" ; then
wnn="no"
fi
if test "x$wnn" != "xno" ; then
AC_CHECK_HEADER(wnn/jllib.h, has_wnn=yes, has_wnn=no)
if test "x$has_wnn" = xyes ; then
WNN_LIBS="-ljd"
if test -d /usr/pkg/share/wnn ; then
WNN_CFLAGS="-DWNNLIBDIR=\\\"/usr/pkg/share\\\""
elif test -d /usr/local/share/wnn ; then
WNN_CFLAGS="-DWNNLIBDIR=\\\"/usr/local/share\\\""
elif test -d /usr/local/lib/wnn ; then
WNN_CFLAGS="-DWNNLIBDIR=\\\"/usr/local/lib\\\""
elif test -d /usr/share/wnn ; then
WNN_CFLAGS="-DWNNLIBDIR=\\\"/usr/share\\\""
else
WNN_CFLAGS="-DWNNLIBDIR=\\\"/usr/lib\\\""
fi
MAKE_DIRS2="inputmethod/wnn ${MAKE_DIRS2}"
OUTPUT_FILES="inputmethod/wnn/Makefile ${OUTPUT_FILES}"
if test "x$with_libltdl" != xno ; then
DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/wnn/libim-wnn.la ${DL_LIBS_IM}"
fi
input_methods_result="$input_methods_result wnn"
fi
fi
AC_SUBST(WNN_CFLAGS)
AC_SUBST(WNN_LIBS)
#
# --- SKK ---
#
AC_ARG_ENABLE(skk,
[ --disable-skk SKK @<:@default=enabled@:>@],
skk=$enable_skk)
if test "$enable_shared" != "no" -a "$skk" != "no"; then
MAKE_DIRS2="inputmethod/skk ${MAKE_DIRS2}"
OUTPUT_FILES="inputmethod/skk/Makefile ${OUTPUT_FILES}"
if test "x$with_libltdl" != xno ; then
DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/skk/libim-skk.la ${DL_LIBS_IM}"
fi
if test "$ml_cv_is_posix" = "no" ; then
SKK_LIBS="-lwsock32 -lws2_32"
fi
input_methods_result="$input_methods_result skk"
fi
AC_SUBST(SKK_LIBS)
if test "x$input_methods_result" != x ; then
IM_CFLAGS="-DUSE_IM_PLUGIN"
fi
AC_SUBST(IM_CFLAGS)
AC_SUBST(DL_LIBS_IM)
#
# --- scrollbar plugins ---
#
DL_LIBS_SB=""
SB_CFLAGS=""
scrollbars="sample,extra,pixmap_engine"
AC_ARG_WITH(scrollbars,
[ --with-scrollbars@<:@=ARG@:>@ scrollbar plugins (sample, extra, pixmap_engine) @<:@default=sample,extra,pixmap_engine@:>@],
[
# If given --without-scrollbars or --with-scrollbars with no args.
if test "${with_scrollbars}" = "no" ; then
scrollbars=""
elif test "${with_scrollbars}" != "yes" ; then
scrollbars=${with_scrollbars}
fi
])
if test "$enable_shared" != "no" ; then
scrollbars=`echo ${scrollbars} | sed 's/,/ /g'`
else
scrollbars=
fi
for scrollbar in ${scrollbars} ; do
case ${scrollbar} in
sample)
if test "$gui" = "xlib" -o "$gui" = "win32"; then
MAKE_DIRS2="scrollbar/sample ${MAKE_DIRS2}"
OUTPUT_FILES="scrollbar/sample/Makefile ${OUTPUT_FILES}"
if test "x$with_libltdl" != "xno" ; then
DL_LIBS_SB="-dlopen \$(top_builddir)/scrollbar/sample/libsample.la ${DL_LIBS_SB}"
fi
scrollbars_result="$scrollbars_result $scrollbar"
fi
;;
extra)
if test "$gui" = "xlib" ; then
MAKE_DIRS2="contrib/scrollbar/extra ${MAKE_DIRS2}"
OUTPUT_FILES="contrib/scrollbar/extra/Makefile ${OUTPUT_FILES}"
if test "x$with_libltdl" != "xno" ; then
for name in athena next motif mozmodern ; do
DL_LIBS_SB="-dlopen \$(top_builddir)/contrib/scrollbar/extra/lib$name.la ${DL_LIBS_SB}"
done
fi
scrollbars_result="$scrollbars_result $scrollbar"
fi
;;
pixmap_engine)
if test "x$allow_undefined_flag" = "xunsupported" ; then
echo ""
echo "** ERROR **"
echo "pixmap_engine has undefined symbols. $host_os does NOT allow it."
echo ""
elif test "$gui" = "xlib" -a "$image" != "no"; then
if test "$have_gdk_pixbuf1" = "yes" -o "$have_gdk_pixbuf2" = "yes" ; then
MAKE_DIRS2="contrib/scrollbar/pixmap_engine ${MAKE_DIRS2}"
OUTPUT_FILES="contrib/scrollbar/pixmap_engine/Makefile contrib/scrollbar/pixmap_engine/sample3/Makefile ${OUTPUT_FILES}"
if test "x$with_libltdl" != "xno" ; then
DL_LIBS_SB="-dlopen \$(top_builddir)/contrib/scrollbar/pixmap_engine/libpixmap_engine.la ${DL_LIBS_SB}"
fi
SB_CFLAGS="-DSUPPORT_PIXMAP_ENGINE"
scrollbars_result="$scrollbars_result $scrollbar"
else
echo ""
echo "** ERROR **"
echo "To use pixmap_engine for scrollbar, you need gdk-pixbuf library."
echo ""
fi
fi
;;
*)
echo "${scrollbar} is unknown scrollbar."
;;
esac
done # for scrollbar in ${scrollbars}
AC_SUBST(SB_CFLAGS)
AC_SUBST(DL_LIBS_SB)
#
# --- module related stuffs ---
#
# undefined symbol
AC_MSG_CHECKING([for undefined symbol])
if test "x$allow_undefined_flag" = "xunsupported" ; then
AC_MSG_RESULT([not supported])
NO_UNDEFINED_FLAG="-no-undefined"
else
AC_MSG_RESULT(supported)
NO_UNDEFINED_FLAG=""
fi
AC_SUBST(NO_UNDEFINED_FLAG)
if test "x$with_libltdl" != "xno" ; then
DL_SELF="-dlopen self"
fi
AC_SUBST(DL_SELF)
AC_ARG_ENABLE(vt52,
[ --enable-vt52 enable VT52 emulation @<:@default=disabled@:>@],
vt52=$enable_vt52,
vt52="no")
if test "$vt52" = "yes" ; then
VT52_CFLAGS="-DUSE_VT52"
fi
AC_SUBST(VT52_CFLAGS)
AC_ARG_ENABLE(optimize_redrawing,
[ --enable-optimize-redrawing optimize redrawing a line @<:@default=disabled@:>@],
optimize_redrawing=$enable_optimize_redrawing,
optimize_redrawing="no")
if test "$optimize_redrawing" = "yes" ; then
CFLAGS="$CFLAGS -DOPTIMIZE_REDRAWING"
fi
# XXX(maybe not portable)
if test "${USE_NLS}" = "yes" ; then
AC_CHECK_LIB(intl,gettext,
[
INTL_LIBS="-lintl"
])
fi
AC_SUBST(INTL_LIBS)
# Because pic object files are fat, non-pic ones are linked unless --disable-static
# option is specified.
if test "$enable_static" = "no" ; then
MAIN_OBJ_SUFFIX=":.o=.lo"
fi
AC_SUBST(MAIN_OBJ_SUFFIX)
CHANGE_DATE=`head -n 1 ${top_srcdir-$srcdir}/ChangeLog | sed -n 's/^\(@<:@0-9@:>@*-@<:@0-9@:>@*-@<:@0-9@:>@*\).*$/\1/p'`
AC_SUBST(CHANGE_DATE)
OUTPUT_FILES="main/version.h ${OUTPUT_FILES}"
if test "${SUBDIRS}" != "" ; then
# for baselib and encodefilter
ac_configure_args="${ac_configure_args} --without-funcs-mlterm-unuse"
# for gui
ac_configure_args=`echo ${ac_configure_args} | sed 's/--with-gui=@<:@A-Za-z0-9,@:>@*/--with-gui=subdir/g'`
if test "$dl_ctl" != "no"; then
ac_configure_args="${ac_configure_args} --disable-ind --disable-fribidi"
fi
ac_configure_args="${ac_configure_args} --without-tools"
AC_CONFIG_SUBDIRS(${SUBDIRS})
fi
MAKE_DIRS2="vtemu vtemu/libctl uitoolkit/libtype uitoolkit main man etc ${MAKE_DIRS2}"
OUTPUT_FILES="Makefile vtemu/Makefile vtemu/libctl/Makefile uitoolkit/libtype/Makefile uitoolkit/Makefile main/Makefile man/Makefile etc/Makefile java/Makefile libvterm/Makefile ${OUTPUT_FILES}"
AC_ARG_ENABLE(ind,
[ --disable-ind libind @<:@default=enabled@:>@],
ind=$enable_ind,
ind="yes")
if test "$gui" = "quartz" -o "$gui" = "console"; then
IND_CFLAGS="-DNOT_CONVERT_TO_ISCII"
ind="no"
fi
if test "$ind" = "yes" ; then
IND_CFLAGS='-I${top_builddir}/libind'
IND_LIBS='${top_builddir}/libind/libind.a'
MAKE_DIRS2="libind ${MAKE_DIRS2}"
OUTPUT_FILES="libind/Makefile ${OUTPUT_FILES}"
if test "$dl_ctl" = "yes" ; then
CTL_LIBS="libctl${TRUECOLOR_TAG}_iscii.la ${CTL_LIBS}"
else
CTL_CFLAGS="-DUSE_IND ${CTL_CFLAGS}"
CTL_LIBS="libctl${TRUECOLOR_TAG}_iscii.a ${CTL_LIBS}"
CTL_LIBS_FOR_PROG="../vtemu/libctl/libctl${TRUECOLOR_TAG}_iscii.a ${CTL_LIBS_FOR_PROG}"
fi
fi
AC_SUBST(IND_LIBS)
AC_SUBST(IND_CFLAGS)
AC_SUBST(CTL_LIBS)
AC_SUBST(CTL_LIBS_FOR_PROG)
AC_ARG_ENABLE(brlapi,
[ --enable-brlapi libbrlapi @<:@default=disabled@:>@],
brlapi=$enable_brlapi, brlapi="no")
if test "$brlapi" = "yes" ; then
BRLAPI_CFLAGS='-DUSE_BRLAPI'
BRLAPI_LIBS='-lbrlapi'
if test "$host_os" != "haiku"; then
INSTALL_OPT="-m 4755 -o root"
fi
fi
AC_SUBST(BRLAPI_LIBS)
AC_SUBST(BRLAPI_CFLAGS)
AC_ARG_ENABLE(daemon,
[ --disable-daemon daemon mode @<:@default=enabled@:>@],
daemon=$enable_daemon, daemon="yes")
if test "$daemon" = "no" ; then
DAEMON_CFLAGS="-DNO_DAEMON"
fi
AC_SUBST(DAEMON_CFLAGS)
AC_ARG_ENABLE(split,
[ --disable-split split screen @<:@default=enabled@:>@],
split=$enable_split, split="yes")
if test "$split" = "no" ; then
SPLIT_CFLAGS="-DNO_SPLIT"
fi
AC_SUBST(SPLIT_CFLAGS)
AC_ARG_ENABLE(zmodem,
[ --disable-zmodem zmodem @<:@default=enabled@:>@],
zmodem=$enable_zmodem, zmodem="yes")
if test "$zmodem" = "no" ; then
TRANSFER_CFLAGS="-DNO_ZMODEM"
else
TRANSFER_LIBS="libzmodem.la"
fi
AC_SUBST(TRANSFER_CFLAGS)
AC_SUBST(TRANSFER_LIBS)
AC_SUBST(PTHREAD_LIB)
AC_SUBST(MAKE_DIRS2)
if test "${MAKE_DIRS2}" != "" ; then
mkdir -p ${MAKE_DIRS2}
fi
if test "$CONFIG_SUBDIR_LIBS" = "internal"; then
#
# ====> check for encodefilter <===
#
mef_top_srcdir_suffix="/encodefilter"
mef_top_builddir_suffix="/.."
AC_SUBST(mef_top_srcdir_suffix)
AC_SUBST(mef_top_builddir_suffix)
AC_ARG_WITH(map-table,
[ --without-map-table mapping table @<:@default=with@:>@],
map_table=$with_map_table,map_table="yes")
if test "$map_table" = "no" ; then
TABLE_CFLAGS="${TABLE_CFLAGS} -DREMOVE_MAPPING_TABLE"
fi
AC_ARG_WITH(prop-table,
[ --without-prop-table property table @<:@default=with@:>@],
prop_table=$with_prop_table,prop_table="yes")
if test "$prop_table" = "no" ; then
TABLE_CFLAGS="${TABLE_CFLAGS} -DREMOVE_PROPERTY_TABLE"
fi
AC_ARG_WITH(iconv,
[ --with-iconv use iconv for charset conversion @<:@default=without@:>@],
iconv=$with_iconv,iconv="no")
if test "$iconv" = "yes" ; then
TABLE_CFLAGS="${TABLE_CFLAGS} -DUSE_ICONV"
fi
AC_ARG_ENABLE(dl-table,
[ --disable-dl-table dynamic loading table @<:@default=enable@:>@],
dl_table=$enable_dl_table,
[
if test "$iconv" = "yes"; then
dl_table="no"
else
dl_table="yes"
fi
])
if test "$enable_shared" = "no" ; then
dl_table="no"
fi
if test "$dl_table" = "no" ; then
TABLE_CFLAGS="${TABLE_CFLAGS} -DNO_DYNAMIC_LOAD_TABLE"
MAKE_DIRS="src"
OUTPUT_FILES="${OUTPUT_FILES} encodefilter/Makefile encodefilter/src/Makefile"
else
MAKE_DIRS="src module"
OUTPUT_FILES="${OUTPUT_FILES} encodefilter/Makefile encodefilter/src/Makefile encodefilter/module/Makefile"
fi
AC_SUBST(TABLE_CFLAGS)
AC_SUBST(MAKE_DIRS)
if test "${MAKE_DIRS}" != "" ; then
(cd encodefilter; mkdir -p ${MAKE_DIRS})
fi
#
# ====> check for baselib <===
#
pobl_top_srcdir_suffix="/baselib"
pobl_top_builddir_suffix="/.."
AC_SUBST(pobl_top_srcdir_suffix)
AC_SUBST(pobl_top_builddir_suffix)
AC_CONFIG_HEADER(baselib/src/bl_config.h)
#
# --- Checks for header files ---
#
# NOTE: if --with-libtool is specified, stdc header isn't detected.
AC_HEADER_STDC
AC_CHECK_HEADERS(langinfo.h dlfcn.h dl.h stropts.h sys/stropts.h stdint.h windows.h errno.h stdint.h)
#
# --- Checks for library functions ---
#
AC_CHECK_FUNCS(strsep fgetln basename isastream seteuid setegid geteuid getegid setsid snprintf usleep setenv unsetenv flock getuid getgid getpwuid recvmsg setpgid socketpair killpg gettimeofday)
AC_FUNC_ALLOCA
AC_C_CONST
AC_C_BIGENDIAN
AC_SYS_LARGEFILE
# for OpenServer 6.0.0
AC_CHECK_HEADER(sys/bitypes.h,
[
ac_includes_default="\
$ac_includes_default
#include <sys/bitypes.h>"
HAVE_SYS_BITYPES_H=1
AC_DEFINE(HAVE_SYS_BITYPES_H)
])
AC_CHECK_TYPE(u_char,unsigned char)
AC_CHECK_TYPE(u_short,unsigned short)
AC_CHECK_TYPE(u_int,unsigned int)
AC_CHECK_TYPE(u_long,unsigned long)
AC_CHECK_TYPE(u_int8_t,unsigned char)
AC_CHECK_TYPE(u_int16_t,unsigned short)
AC_CHECK_TYPE(u_int32_t,unsigned int)
AC_CHECK_TYPE(u_int64_t,unsigned long)
AC_CHECK_TYPE(int8_t,char)
AC_CHECK_TYPE(int16_t,short)
AC_CHECK_TYPE(int32_t,int)
AC_CHECK_TYPE(int64_t,long)
AC_CHECK_TYPE(ssize_t,int)
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_TYPE_UID_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_C_TYPEOF
#
# --- Platform dependent stuff ---
#
bl_cv_cygwin=no
bl_cv_mingw=no
bl_cv_win32=no
case "${host_os}" in
cygwin*)
bl_cv_cygwin=yes
case "${CC} ${CFLAGS}" in
*mno-cygwin* | *-mingw*)
bl_cv_win32=yes
AC_DEFINE(USE_WIN32API,,"USE_WIN32API")
;;
*)
;;
esac
;;
mingw*)
bl_cv_mingw=yes
if test ! -f "/lib/libmsys-1.0.dll.a" ; then
case "${lt_cv_path_LD}" in
*-msys*)
;;
*)
bl_cv_win32=yes
AC_DEFINE(USE_WIN32API,,"USE_WIN32API")
;;
esac
fi
;;
*)
;;
esac
#
# --- socklen_t ---
#
# NOTE: #define _BSDTYPES_DEFINED is necessary because AC_TRY_COMPILE defines
# u_char, u_short and so on before #include <ws2tcpip.h> .
#
AC_CACHE_CHECK(for socklen_t, bl_cv_socklen_ident,
[AC_TRY_COMPILE(
[
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>
],
[
socklen_t len ;
], bl_cv_socklen_ident=yes,
[AC_TRY_COMPILE(
[
#define _BSDTYPES_DEFINED
#include <ws2tcpip.h>
],
[
socklen_t len ;
], bl_cv_socklen_ident=yes, bl_cv_socklen_ident=no)])])
if test "${bl_cv_socklen_ident}" = "no" ; then
AC_DEFINE(socklen_t, unsigned int, "socklen_t")
fi
#
# --- Check if concatenation of string literals with __FUNCTION__ is supported. ---
#
AC_CACHE_CHECK(for __FUNCTION__, bl_cv_func_ident,[
AC_TRY_COMPILE(,
[
char * p = "[" __FUNCTION__ "]" ;
] , bl_cv_func_ident=yes,bl_cv_func_ident=no)])
if test "${bl_cv_func_ident}" = "yes" ; then
AC_DEFINE(CONCATABLE_FUNCTION,,"CONCATABLE_FUNCTION")
fi
#
# --- Check for libxpg4 (for FreeBSD) ---
#
AC_CHECK_FUNCS(setlocale)
if test "x$ac_cv_func_setlocale" = xno ; then
AC_CHECK_LIB(xpg4, setlocale, XPG4_LIBS=-lxpg4)
AC_SUBST(XPG4_LIBS)
fi
#
# --- Checks for dynamic linking loader ---
#
DL_LOADER=none
DL_LIBS=
DL_CFLAGS=
# lt_dlopenext in libltdl
AC_ARG_WITH(libltdl,
[ --with-libltdl@<:@=PREFIX@:>@ load modules with libltdl @<:@default=without@:>@],,
[with_libltdl=no])
if test "x$with_libltdl" != "xno" ; then
if test "x$with_libltdl" != "xyes"; then
DL_CFLAGS="-I$with_libltdl/include"
bl_libltdl_libdir="-L$with_libltdl/lib"
fi
bl_ldflags_save="$LDFLAGS"
LDFLAGS="$LDFLAGS $bl_libltdl_libdir"
AC_CHECK_LIB(ltdl, lt_dlopenext,
[
DL_LOADER=ltdl
DL_LIBS="$bl_libltdl_libdir -lltdl"
],[
echo ""
echo "Could not find libltdl"
echo ""
exit 1])
LDFLAGS="$bl_ldflags_save"
fi
# lt_cv_dlopen is set by AC_LIBTOOL_DLOPEN
if test "$DL_LOADER" = none ; then
case "${lt_cv_dlopen}" in
# LoadLibrary (Windows)
LoadLibrary)
DL_LOADER=win32
;;
# shl_load (HP-UX)
shl_load)
DL_LOADER=dld
;;
# dlopen (UNIX98)
dlopen)
DL_LOADER=dl
;;
# What is dld_link? Does anybody know?
dld_link)
DL_LOADER=none
;;
*)
DL_LOADER=none
;;
esac
DL_LIBS="${DL_LIBS} ${lt_cv_dlopen_libs}"
if test "$DL_LOADER" = none ; then
# NSLinkModule (darwin)
AC_CHECK_FUNC(NSLinkModule,
[
DL_LOADER=dyld
DL_LIBS=
], [])
fi
# cygwin hack
# (AC_LIBTOOL_DLOPEN tell lt_cv_dlopen == dlopen but use bl_dlcfn_win32.c.)
# On msys2, use dlopen because bl_dlfcn_win32 doesn't work correctly.
if test "$bl_cv_cygwin" = "yes"; then
DL_LOADER=win32
fi
fi
AC_SUBST(DL_LOADER)
AC_SUBST(DL_LIBS)
AC_SUBST(DL_CFLAGS)
if test "$DL_LOADER" = none ; then
AC_DEFINE(DLFCN_NONE,,"DLFCN_NONE")
fi
#
# --- pty check ---
#
AC_MSG_CHECKING(for pty/tty type)
if test "$bl_cv_win32" = "yes" ; then
bl_cv_pty=none
elif test "$bl_cv_mingw" = "yes" ; then
bl_cv_pty=streams
elif test "$host" = "$build" ; then
AC_CHECK_FUNC(posix_openpt,
[
AC_DEFINE(HAVE_POSIX_OPENPT,,"HAVE_POSIX_OPENPT")
bl_cv_pty=streams
],
[bl_cv_pty=bsd])
if test "$bl_cv_pty" = "bsd" ; then
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([#include <sys/stat.h>
#include <fcntl.h>],
[return open( "/dev/ptmx", O_RDWR | O_NOCTTY, 0) == -1;])],
[bl_cv_pty=streams])
fi
else
# cross compiling
AC_CHECK_FUNC(posix_openpt,
[
AC_DEFINE(HAVE_POSIX_OPENPT,,"HAVE_POSIX_OPENPT")
bl_cv_pty=streams
],
[bl_cv_pty=bsd])
fi
AC_ARG_ENABLE(pty_helper,
[ --enable-pty-helper use pty helper @<:@default=disabled@:>@],
pty_helper=$enable_pty_helper)
if test "$pty_helper" = yes ; then
if test "$bl_cv_pty" = streams ; then
bl_cv_pty=helper
else
echo ""
echo "** WARNING **"
echo " pty helper is not supported in bsd-style pty system."
echo ""
fi
fi
AC_MSG_RESULT($bl_cv_pty)
PTY_NAME="${bl_cv_pty}"
AC_SUBST(PTY_NAME)
#
# --- checks for utmp ---
#
AC_ARG_WITH(utmp,
[ --with-utmp@<:@=ARG@:>@ utmp (utempter,sysv,login,bsd,none)],
utmp_type=$with_utmp)
UTMP_NAME=
UTMP_LIBS=
if test "$bl_cv_pty" = helper -o "$bl_cv_mingw" = yes -o "$bl_cv_cygwin" = yes -o "$host_os" = "msys" -o "$host_os" = "haiku"; then
UTMP_NAME=none
UTMP_LIBS=
fi
# libutempter
if test "$utmp_type" = "" -o "$utmp_type" = "utempter"; then
if test -z "$UTMP_NAME"; then
AC_CHECK_LIB(utempter, utempter_add_record,
[
UTMP_NAME=utmper
UTMP_LIBS="-lutempter"
UTMP_CFLAGS="-DUTEMPTER_NEW_API"
], [])
fi
if test -z "$UTMP_NAME"; then
# FreeBSD
AC_CHECK_LIB(ulog, utempter_add_record,
[
UTMP_NAME=utmper
UTMP_LIBS="-lulog"
UTMP_CFLAGS="-DUTEMPTER_NEW_API"
], [])
fi
if test -z "$UTMP_NAME" ; then
AC_CHECK_LIB(utempter, addToUtmp,
[
UTMP_NAME=utmper
UTMP_LIBS="-lutempter -lutil"
])
fi
fi
# setutxent() (SysV)
if test "$utmp_type" = "" -o "$utmp_type" = "sysv"; then
if test -z "$UTMP_NAME"; then
AC_CHECK_FUNC(setutxent,
[
UTMP_NAME=sysv
UTMP_LIBS=
UTMP_CFLAGS=-DUSE_UTMPX
], [])
fi
# setutent() (SysV)
if test -z "$UTMP_NAME"; then
AC_CHECK_FUNC(setutent,
[
UTMP_NAME=sysv
UTMP_LIBS=
], [])
fi
fi
# libutil
if test "$utmp_type" = "" -o "$utmp_type" = "login"; then
if test -z "$UTMP_NAME" ; then
AC_CHECK_LIB(util, logout,
[
UTMP_NAME=login
UTMP_LIBS=-lutil
], [])
fi
fi
# other (BSD)
if test "$utmp_type" = "" -o "$utmp_type" = "bsd"; then
if test -z "$UTMP_NAME" ; then
UTMP_NAME=bsd
UTMP_LIBS=
fi
fi
if test -z "$UTMP_NAME" ; then
UTMP_NAME=none
UTMP_LIBS=
fi
if test "$UTMP_NAME" != "none"; then
# for vtemu/vt_pty_unix.c
UTMP_CFLAGS="$UTMP_CFLAGS -DUSE_UTMP"
fi
AC_SUBST(UTMP_NAME)
AC_SUBST(UTMP_LIBS)
AC_SUBST(UTMP_CFLAGS)
AC_DEFINE(REMOVE_FUNCS_MLTERM_UNUSE,,"REMOVE_FUNCS_MLTERM_UNUSE")
#
# --- check for malloc ---
#
if test "$host" = "$build"; then
AC_TRY_RUN(
[
#include <stdlib.h>
#include <stddef.h>
int main() {
return calloc(8, ((1 << (sizeof(size_t) * 8 - 1)) + 1)) ? 1 : 0;
}
],
AC_DEFINE(CALLOC_CHECK_OVERFLOW))
fi
OUTPUT_FILES="${OUTPUT_FILES} baselib/Makefile baselib/src/Makefile"
else # CONFIG_SUBDIR_LIBS
# ./configure at subdirs finished.
if test -d baselib; then
utmp_none_obj=`grep bl_utmp_none.o baselib/src/Makefile`
elif test -d ../../baselib; then
utmp_none_obj=`grep bl_utmp_none.o ../../baselib/src/Makefile`
fi
if test "$utmp_none_obj" = ""; then
UTMP_CFLAGS="-DUSE_UTMP"
else
# for following "$UTMP_NAME" != "none"
UTMP_NAME="none"
fi
fi # CONFIG_SUBDIR_LIBS
AC_OUTPUT(${OUTPUT_FILES})
AC_ARG_ENABLE(utmp-suid,
[ --enable-utmp-suid install mlterm with SUID or SGID for utmp @<:@default=disabled@:>@],
utmp_suid=$enable_utmp_suid)
if test "$INSTALL_OPT" = ""; then
# SUID is not set to mlterm on MacOSX/Quartz.
if test "$utmp_suid" = "yes" -a "$UTMP_NAME" != "none" -a "$gui" != "quartz"; then
has_utmp=`grep utmp /etc/group 2>/dev/null`
if test "$has_utmp" ; then
INSTALL_OPT="-m 2755 -g utmp"
else
INSTALL_OPT="-m 4755 -o root"
fi
else
INSTALL_OPT="-m 755"
fi
if test "$gui" = "fb" ; then
INSTALL_OPT="-m 4755 -o root"
fi
fi
cat main/Makefile | sed "s/@INSTALL_OPT@/$INSTALL_OPT/" | sed "s/@UTMP_CFLAGS@/$UTMP_CFLAGS/" > main/Makefile.new
mv main/Makefile.new main/Makefile
cat vtemu/Makefile | sed "s/@UTMP_CFLAGS@/$UTMP_CFLAGS/" > vtemu/Makefile.new
mv vtemu/Makefile.new vtemu/Makefile
# Remove 'as_fn_exit 0'
sed '$d' ${CONFIG_STATUS} > ${CONFIG_STATUS}.new
mv ${CONFIG_STATUS}.new ${CONFIG_STATUS}
chmod 755 ${CONFIG_STATUS}
cat >>$CONFIG_STATUS <<EOF
cat main/Makefile | sed "s/@INSTALL_OPT@/$INSTALL_OPT/" | sed "s/@UTMP_CFLAGS@/$UTMP_CFLAGS/" > main/Makefile.new
mv main/Makefile.new main/Makefile
cat vtemu/Makefile | sed "s/@UTMP_CFLAGS@/$UTMP_CFLAGS/" > vtemu/Makefile.new
mv vtemu/Makefile.new vtemu/Makefile
as_fn_exit 0
EOF
# configuration result
echo
echo
echo "Mlterm was configured as follows"
echo
echo "Installation path prefix : $prefix"
dnl echo "Character mapping table : "
dnl echo "Character property table : "
echo "Build shared libraries : $enable_shared"
echo "Build static libraries : $enable_static"
dnl echo "Optimization for redrawing a line : $optimize_redrawing"
if test "$fbtype" = ""; then
echo "GUI toolkit : $gui"
else
echo "GUI toolkit : $gui ($fbtype)"
fi
echo "BiDi rendering (Fribidi) : $have_fribidi"
echo "Indic rendering : $ind"
if test "$OT_LAYOUT_OBJ" = "hb.o"; then
echo "OpenType Layout : yes (harfbuzz)"
elif test "$OT_LAYOUT_OBJ" = "otf.o"; then
echo "OpenType Layout : yes (libotf)"
elif test "$OT_LAYOUT_OBJ" = "uniscribe.o"; then
echo "OpenType Layout : yes (uniscribe)"
else
echo "OpenType Layout : no"
fi
echo "External tools :$tools_result"
echo "Image processing : $image"
echo "Built-in image library : $with_imagelib"
echo "utmp support : $UTMP_NAME"
if test "$gui" = "fb" -o "$gui" = "wayland" -o "$gui" = "sdl2"; then
if test "$have_ft" = "yes"; then
if test "$fontconfig" = "yes"; then
echo "Supported font formats : pcf ttf(+fontconfig)"
else
echo "Supported font formats : pcf ttf"
fi
else
echo "Supported font formats : pcf"
fi
elif test "$gui" = "xlib"; then
echo "Type engines :$type_engines_result"
fi
echo "DnD : $dnd"
if test "$gui" = "xlib"; then
echo "Input Methods : XIM$input_methods_result"
else
echo "Input Methods :$input_methods_result"
fi
echo "Scrollbars : simple${scrollbars_result}"
echo "libssh2 : $ssh2"
if test "$ml_cv_is_posix" = "no"; then
echo "pty type : $win32pty"
fi
echo "mosh directory : $MOSH_DIR"
if test "$have_gtk" = "yes"; then
if test "$have_gtk4" = "yes"; then
echo "GTK+ : yes ($gtk_version, 4.0)"
else
echo "GTK+ : yes ($gtk_version)"
fi
else
if test "$have_gtk4" = "yes"; then
echo "GTK+ : yes (4.0)"
else
echo "GTK+ : no"
fi
fi
if test "$VTE_ABI" = ""; then
vte_version=""
else
vte_version=" (${VTE_ABI})"
fi
echo "libvte : $have_vte$vte_version"
echo "brlapi : $brlapi"
echo "VT52 : $vt52"
echo "Permission of mlterm binary : $INSTALL_OPT"
echo "Compact true color : $compact_truecolor"
echo
# This should be called at the end of configure.
# If --with-gui=quartz,console is specified, copy uitoolkit/* to gui/console/uitoolkit
# before removing following files.
if test "$gui" = "quartz" ; then
# ui_event_source.c, ui_sb_view_factory.c, ui_scrollbar.c and ui_simple_sb_view.c
# exist in uitoolkit/ and uitoolkit/quartz/.
# Those in uitoolkit/ must be removed to build those in uitoolkit/quartz/.
(cd uitoolkit/quartz/ && \
for file in `ls *.c` ; do if test -f ../$file ; then mv ../$file ../xlib/ ; fi ; done)
fi
|