1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496
|
# Copyright (C) 2003-2024 GraphicsMagick Group
# Copyright (C) 2002 ImageMagick Studio
# Copyright (C) 1998, 1999 E. I. du Pont de Nemours and Company
#
# This program is covered by multiple licenses, which are described in
# Copyright.txt. You should have received a copy of Copyright.txt with this
# package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.
#
# GraphicsMagick Configure Script
#
# Written by Bob Friesenhahn <bfriesen@GraphicsMagick.org>
#
AC_PREREQ([2.69])
AC_INIT
AC_CONFIG_SRCDIR([magick/magick.h])
# Specify directory where m4 macros may be found.
AC_CONFIG_MACRO_DIR([m4])
# Directory where autotools helper scripts lives.
AC_CONFIG_AUX_DIR([config])
# Include the TAP driver
AC_REQUIRE_AUX_FILE([tap-driver.sh])
#
# Save initial user-tunable values
#
#printf "LIBS=${LIBS}\n"
LIBS_USER=$LIBS
for var in CC CFLAGS CPPFLAGS CXX CXXCPP LDFLAGS LIBS ; do
eval isset=\${$var+set}
if test "$isset" = 'set' ; then
eval val=$`echo $var`
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS}'${var}=${val}' "
fi
done
AC_SUBST(DISTCHECK_CONFIG_FLAGS)
# Source file containing package/library versioning information.
. ${srcdir}/version.sh
echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}"
dnl Compute the canonical host (run-time) system type variable
AC_CANONICAL_HOST
MAGICK_TARGET_CPU=$host_cpu
AC_SUBST([MAGICK_TARGET_CPU])
AC_DEFINE_UNQUOTED([MAGICK_TARGET_CPU],[$MAGICK_TARGET_CPU],[Target Host CPU])
MAGICK_TARGET_VENDOR=$host_vendor
AC_SUBST([MAGICK_TARGET_VENDOR])
AC_DEFINE_UNQUOTED([MAGICK_TARGET_VENDOR],[$MAGICK_TARGET_VENDOR],[Target Host Vendor])
MAGICK_TARGET_OS=$host_os
AC_SUBST([MAGICK_TARGET_OS])
AC_DEFINE_UNQUOTED([MAGICK_TARGET_OS],[$MAGICK_TARGET_OS],[Target Host OS])
# Compute newest and oldest interface numbers.
MAGICK_LIB_INTERFACE_NEWEST=$MAGICK_LIBRARY_CURRENT
MAGICK_LIB_INTERFACE_OLDEST=`expr ${MAGICK_LIBRARY_CURRENT} - ${MAGICK_LIBRARY_AGE}`
# Substitute Magick library versioning
AC_SUBST([MAGICK_LIBRARY_CURRENT])dnl
AC_SUBST([MAGICK_LIBRARY_REVISION])dnl
AC_SUBST([MAGICK_LIBRARY_AGE])dnl
AC_SUBST([MAGICK_LIB_INTERFACE_NEWEST])
AC_SUBST([MAGICK_LIB_INTERFACE_OLDEST])
# Substitute Magick++ library versioning
AC_SUBST([MAGICK_PLUS_PLUS_LIBRARY_CURRENT])
AC_SUBST([MAGICK_PLUS_PLUS_LIBRARY_REVISION])
AC_SUBST([MAGICK_PLUS_PLUS_LIBRARY_AGE])
# Substitute Magick Wand library versioning
AC_SUBST([MAGICK_WAND_LIBRARY_CURRENT])
AC_SUBST([MAGICK_WAND_LIBRARY_REVISION])
AC_SUBST([MAGICK_WAND_LIBRARY_AGE])
AC_SUBST([PACKAGE_NAME])dnl
AC_SUBST([PACKAGE_VERSION])dnl
AC_SUBST([PACKAGE_VERSION_ADDENDUM])dnl
AC_SUBST([PACKAGE_CHANGE_DATE])dnl
AC_SUBST([PACKAGE_RELEASE_DATE])dnl
# Substitute Mercurial branch tag
AC_SUBST([HG_BRANCH_TAG])dnl
# Definition used to define MagickLibVersion in version.h
MAGICK_LIB_VERSION="0x"
if test ${MAGICK_LIBRARY_CURRENT} -lt 10 ; then
MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
fi
MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_CURRENT}
if test ${MAGICK_LIBRARY_AGE} -lt 10 ; then
MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
fi
MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_AGE}
if test ${MAGICK_LIBRARY_REVISION} -lt 10 ; then
MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
fi
MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_REVISION}
AC_SUBST([MAGICK_LIB_VERSION])
# Definition used to define MagickLibVersionText in version.h
MAGICK_LIB_VERSION_TEXT="${PACKAGE_VERSION}"
AC_SUBST([MAGICK_LIB_VERSION_TEXT])
# Definition used to define MagickLibVersionNumber in version.h
MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
AC_SUBST([MAGICK_LIB_VERSION_NUMBER])
# Ensure that make can run correctly
AM_SANITY_CHECK
# Generate configure header.
AC_CONFIG_HEADERS([magick/magick_config.h magick/magick_config_api.h])
AM_INIT_AUTOMAKE([$PACKAGE_NAME],["${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}"],[' '])
# Enable support for silent build rules
AM_SILENT_RULES
# Regenerate config.status if ChangeLog or version.sh is updated.
AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/ChangeLog $(top_srcdir)/version.sh'])
PERLMAINCC=$CC
MAGICK_API_CFLAGS=''
MAGICK_API_CPPFLAGS=''
MAGICK_API_PC_CPPFLAGS=''
MAGICK_API_LDFLAGS=''
MAGICK_API_LIBS=''
#
# Standards compliance definitions
#
#AC_DEFINE(_XOPEN_SOURCE,500,[Required X Open interface level (500)])
#AC_DEFINE(_POSIX_C_SOURCE,199506L,[Required POSIX interface level (199506L)])
#AC_DEFINE(_ISOC99_SOURCE,1,[Code may make use of ISO C '99 features])
#AC_DEFINE(__EXTENSIONS__,1,[Enable all API extensions (for Solaris)])
#AC_DEFINE(_GNU_SOURCE,1,[Enable all API extensions (for GNU Linux libc)])
#AC_DEFINE(_NETBSD_SOURCE,1,[Enable all API extensions (for NetBSD)])
AC_USE_SYSTEM_EXTENSIONS
#
# Evaluate shell variable equivalents to Makefile directory variables
#
if test "x$prefix" = xNONE
then
prefix=$ac_default_prefix
fi
# Let make expand exec_prefix.
if test "x$exec_prefix" = xNONE
then
exec_prefix='${prefix}'
fi
#
eval "eval PREFIX_DIR=${prefix}"
AC_SUBST([PREFIX_DIR])
eval "eval EXEC_PREFIX_DIR=${exec_prefix}"
AC_SUBST([EXEC_PREFIX_DIR])
eval "eval BIN_DIR=$bindir"
AC_SUBST([BIN_DIR])
eval "eval SBIN_DIR=$sbindir"
AC_SUBST([SBIN_DIR])
eval "eval LIBEXEC_DIR=$libexecdir"
AC_SUBST([LIBEXEC_DIR])
eval "eval DATA_DIR=$datadir"
AC_SUBST([DATA_DIR])
eval "eval DOC_DIR=$docdir"
AC_SUBST([DOC_DIR])
eval "eval HTML_DIR=$htmldir"
AC_SUBST([HTML_DIR])
eval "eval SYSCONF_DIR=$sysconfdir"
AC_SUBST([SYSCONF_DIR])
eval "eval SHAREDSTATE_DIR=$sharedstatedir"
AC_SUBST([SHAREDSTATE_DIR])
eval "eval LOCALSTATE_DIR=$localstatedir"
AC_SUBST([LOCALSTATE_DIR])
eval "eval LIB_DIR=$libdir"
AC_SUBST([LIB_DIR])
eval "eval INCLUDE_DIR=$includedir"
AC_SUBST([INCLUDE_DIR])
eval "eval OLDINCLUDE_DIR=$oldincludedir"
AC_SUBST([OLDINCLUDE_DIR])
eval "eval INFO_DIR=$infodir"
AC_SUBST([INFO_DIR])
eval "eval MAN_DIR=$mandir"
AC_SUBST([MAN_DIR])
# Get full paths to source and build directories
srcdirfull="`cd $srcdir && pwd`"
builddir="`pwd`"
WinPathScript="${srcdirfull}/winpath.sh"
AC_SUBST([WinPathScript])
#
# Compute variables useful for running uninstalled software
#
MAGICK_CODER_MODULE_PATH="${builddir}/coders"
MAGICK_CONFIGURE_SRC_PATH="${srcdirfull}/config"
MAGICK_CONFIGURE_BUILD_PATH="${builddir}/config"
MAGICK_FILTER_MODULE_PATH="${builddir}/filters"
top_srcdir_native=${srcdirfull}
DIRSEP=':'
case "${build_os}" in
mingw* )
MAGICK_CODER_MODULE_PATH=`$WinPathScript "${MAGICK_CODER_MODULE_PATH}" 0`
MAGICK_CONFIGURE_SRC_PATH=`$WinPathScript "${MAGICK_CONFIGURE_SRC_PATH}" 0`
MAGICK_CONFIGURE_BUILD_PATH=`$WinPathScript "${MAGICK_CONFIGURE_BUILD_PATH}" 0`
MAGICK_FILTER_MODULE_PATH=`$WinPathScript "${MAGICK_FILTER_MODULE_PATH}" 0`
top_srcdir_native=`$WinPathScript "${srcdirfull}"`
;;
esac
case "${host_os}" in
mingw* )
DIRSEP=';'
;;
esac
AC_SUBST([MAGICK_CODER_MODULE_PATH])
AC_SUBST([MAGICK_CONFIGURE_SRC_PATH])
AC_SUBST([MAGICK_CONFIGURE_BUILD_PATH])
AC_SUBST([MAGICK_FILTER_MODULE_PATH])
AC_SUBST([DIRSEP])
AC_SUBST([top_srcdir_native])
# Check for programs
AC_PROG_CC
AC_PROG_CPP
LT_PATH_LD
AC_SUBST([LD])
AM_PROG_CC_C_O # Necessary if objects are placed in subdirectories.
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LN_S
AC_PROG_AWK
#
# Tests for Windows
#
AC_EXEEXT
AC_OBJEXT
native_win32_build='no'
cygwin_build='no'
case "${host_os}" in
cygwin* )
cygwin_build='yes'
;;
mingw* )
native_win32_build='yes'
;;
esac
AM_CONDITIONAL([WIN32_NATIVE_BUILD],[test "${native_win32_build}" = 'yes'])
AM_CONDITIONAL([CYGWIN_BUILD],[test "${cygwin_build}" = 'yes'])
WinPathScript="${srcdirfull}/winpath.sh"
AC_SUBST([WinPathScript])
#
# Compiler flags tweaks
#
if test "${GCC}" != "yes"
then
case "${host}" in
*-*-hpux* )
# aCC: HP ANSI C++ B3910B A.03.34
CFLAGS="${CFLAGS} -Wp,-H30000"
if test -n "${CXXFLAGS}"
then
CXXFLAGS='-AA'
else
CXXFLAGS="${CXXFLAGS} -AA"
fi
;;
*-dec-osf5.* )
# Compaq alphaev68-dec-osf5.1 compiler
if test -n "${CXXFLAGS}"
then
CXXFLAGS='-std strict_ansi -noimplicit_include'
else
CXXFLAGS="${CXXFLAGS} -std strict_ansi -noimplicit_include"
fi
;;
*-*-solaris2.* )
# Solaris 2 or a derivative thereof
;;
esac
else
CFLAGS="${CFLAGS} -Wall"
fi
#
# Determine POSIX threads settings
#
# Enable support for POSIX thread APIs
AC_ARG_WITH([threads],
AS_HELP_STRING([--without-threads],
[disable POSIX threads API support]),
[with_threads=$withval],
[with_threads='yes'])
have_threads=no
if test "$with_threads" != 'no'
then
ACX_PTHREAD()
if test "$acx_pthread_ok" = yes
then
have_threads=yes
DEF_THREAD="$PTHREAD_CFLAGS"
CFLAGS="$CFLAGS $DEF_THREAD"
CXXFLAGS="$CXXFLAGS $DEF_THREAD"
if test "$CC" != "$PTHREAD_CC"
then
AC_MSG_WARN([Replacing compiler $CC with compiler $PTHREAD_CC to support pthreads.])
CC="$PTHREAD_CC"
fi
if test "$CXX" != "$PTHREAD_CXX"
then
AC_MSG_WARN([Replacing compiler $CXX with compiler $PTHREAD_CXX to support pthreads.])
CXX="$PTHREAD_CXX"
fi
fi
fi
# Search for the pkg-config tool and set the PKG_CONFIG variable to first found in the path.
PKG_PROG_PKG_CONFIG()
#
# Determine options necessary to enable OpenMP support
#
# Sets Set the OPENMP_CFLAGS / OPENMP_CXXFLAGS / OPENMP_FFLAGS
# variable to these options.
#
# https://clang.llvm.org/docs/UsersManual.html#openmp-features
# https://clang.llvm.org/docs/OpenMPSupport.html
#
# Clang needs -fopenmp=libomp "Intel OpenMP" or CFLAGS=-fopenmp "GNU OpenMP".
# FIXME: AC_OPENMP() does not set OPENMP_CFLAGS for Clang 13 on Linux!
AC_OPENMP([C])
CFLAGS="$OPENMP_CFLAGS $CFLAGS"
#CXXFLAGS="$OPENMP_CXXFLAGS $CXXFLAGS"
#LDFLAGS="$LDFLAGS $OPENMP_CFLAGS"
AC_SUBST([OPENMP_CFLAGS])
AC_CHECK_DECL([_OPENMP],[OPENMP_ENABLED='yes'],[OPENMP_ENABLED='no'],[])
# Allow the user to disable use of OpenMP where algorithms sometimes run slower.
AC_ARG_ENABLE([openmp-slow],
AS_HELP_STRING([--enable-openmp-slow],
[enable OpenMP for algorithms which
sometimes run slower]),
[with_openmp_slow=$enableval],
[with_openmp_slow='no'])
if test "$with_openmp_slow" = 'no'
then
AC_DEFINE([DisableSlowOpenMP],[1],[Disable OpenMP for algorithms which sometimes run slower])
fi
# Disable reading/writing gzip/bzip compressed files
AC_ARG_ENABLE([compressed-files],
AS_HELP_STRING([--disable-compressed-files],
[disable reading and writing of gzip/bzip files]),
[with_compressed_files=$enableval],
[with_compressed_files='yes'])
if test "$with_compressed_files" != 'yes'; then
AC_DEFINE([DISABLE_COMPRESSED_FILES],[1],[Disable reading and writing of gzip/bzip files])
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-compressed-files=$with_compressed_files "
fi
########
#
# Check for large file support
#
# According to the X/Open LFS standard, setting _FILE_OFFSET_BITS to 64
# remaps standard functions to their 64-bit equivalents.
#
# The LFS_CPPFLAGS substition is used to support building PerlMagick.
#
#
########
AC_SYS_LARGEFILE
# If the `fseeko' function is available, define `HAVE_FSEEKO'. Define
# `_LARGEFILE_SOURCE' if necessary.
AC_FUNC_FSEEKO
LFS_CPPFLAGS=''
if test "$enable_largefile" != no
then
if test "$ac_cv_sys_file_offset_bits" != 'no' && test -n "$ac_cv_sys_file_offset_bits"
then
LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
fi
if test "$ac_cv_sys_large_files" != 'no'
then
LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGE_FILES=1"
fi
if test "$ac_cv_sys_largefile_source" != 'no'
then
LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGEFILE_SOURCE=1"
fi
fi
AC_SUBST([LFS_CPPFLAGS])
#
# Decide if setjmp/longjmp is thread safe based on host OS
#
case "${host_os}" in
solaris2* )
# Documented not to be MT safe
;;
*)
AC_DEFINE([SETJMP_IS_THREAD_SAFE],[1],[Setjmp/longjmp are thread safe])
;;
esac
#
# Configure libtool
#
# Configure libtool
LT_INIT([disable-shared win32-dll dlopen])
LT_LANG([C++])
AC_SUBST(LIBTOOL_DEPS)
# Check to see if building shared libraries
libtool_build_shared_libs='no'
if test "$enable_shared" = 'yes'
then
libtool_build_shared_libs='yes'
fi
# Check to see if building static libraries
libtool_build_static_libs='no'
if test "$enable_static" = 'yes'
then
libtool_build_static_libs='yes'
fi
AM_CONDITIONAL([WITH_SHARED_LIBS],[test "${libtool_build_shared_libs}" = 'yes'])
#
# Enable support for building loadable modules
#
build_modules='no'
AC_ARG_WITH([modules],
AS_HELP_STRING([--with-modules],
[enable building dynamically loadable
modules]),
[with_modules=$withval],
[with_modules='no'])
# Only allow building loadable modules if we are building shared libraries
if test "$with_modules" != 'no' ; then
if test "$libtool_build_shared_libs" = 'no' ; then
AC_MSG_WARN([Modules may only be built if building shared libraries is enabled.])
build_modules='no'
else
build_modules='yes'
fi
fi
if test "$build_modules" != 'no' ; then
AC_DEFINE([BuildMagickModules],[1],[Define if coders and filters are to be built as modules.])
fi
AM_CONDITIONAL([WITH_MODULES],[test "$build_modules" != 'no'])
# Build a version of GraphicsMagick which operates uninstalled.
# Used to build distributions located via MAGICK_HOME / executable path
AC_ARG_ENABLE([installed],
AS_HELP_STRING([--disable-installed],
[disable building an installed GraphicsMagick]),
[with_installed=$enableval],
[with_installed='yes'])
if test "$with_installed" = 'yes'
then
AC_DEFINE([UseInstalledMagick],[1],[GraphicsMagick is formally installed under prefix])
else
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed "
fi
# Enable broken/dangerous coders
# EnableBrokenCoders CPP define and ENABLE_BROKEN_CODERS Automake conditional)
AC_ARG_ENABLE([broken-coders],
AS_HELP_STRING([--enable-broken-coders],
[enable broken/dangerous file formats support]),
[with_broken_coders=$enableval],
[with_broken_coders='no'])
if test "$with_broken_coders" = 'yes'
then
AC_DEFINE([EnableBrokenCoders],[1],[Enable broken/dangerous file formats support])
fi
AM_CONDITIONAL([ENABLE_BROKEN_CODERS],[test "$with_broken_coders" != 'no'])
# Add configure option --enable-maintainer-mode which enables dependency
# checking and generation useful to package maintainers. This is made an
# option to avoid confusing end users.
#
# Defines shell/Automake variable 'MAINT' to '' when enabled or '#' when not
# Also sets MAINTAINER_MODE_FALSE / MAINTAINER_MODE_TRUE with similar values.
AM_MAINTAINER_MODE
# Enable prof-based profiling support
AC_ARG_ENABLE([prof],
AS_HELP_STRING([--enable-prof],
[enable 'prof' profiling support]),
[with_prof=$enableval],
[with_prof='no'])
# Enable gprof-based profiling support
AC_ARG_ENABLE([gprof],
AS_HELP_STRING([--enable-gprof],
[enable 'gprof' profiling support]),
[with_gprof=$enableval],
[with_gprof='no'])
# Enable gcov-based profiling support
AC_ARG_ENABLE([gcov],
AS_HELP_STRING([--enable-gcov],
[enable 'gcov' profiling support]),
[with_gcov=$enableval],
[with_gcov='no'])
with_profiling='no'
if test "$with_prof" = 'yes' || test "$with_gprof" = 'yes' || test "$with_gcov" = 'yes'
then
with_profiling='yes'
if test "$libtool_build_shared_libs" = 'yes'
then
echo "Warning: Can not profile code using shared libraries"
fi
fi
# Enable prefixing library symbols with a common string
AC_ARG_ENABLE([symbol-prefix],
AS_HELP_STRING([--enable-symbol-prefix],
[enable prefixing library symbols with "Gm"]),
[with_symbol_prefix=$enableval],
[with_symbol_prefix='no'])
if test "$with_symbol_prefix" != 'no'
then
AC_DEFINE([PREFIX_MAGICK_SYMBOLS],[1],[Prefix Magick library symbols with a common string.])
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --enable-symbol-prefix "
fi
# Enable ImageMagick utilities compatibility shortcuts (default no)
AC_ARG_ENABLE([magick-compat],
AS_HELP_STRING([--enable-magick-compat],
[install ImageMagick utility shortcuts]),
[with_magick_compat=$enableval],
[with_magick_compat='no'])
AM_CONDITIONAL([MAGICK_COMPAT],[test "$with_magick_compat" != 'no'])
# Number of bits in a Quantum
AC_ARG_WITH([quantum-depth],
AS_HELP_STRING([--with-quantum-depth],
[number of bits in a pixel quantum (default 8)]),
[with_quantum_depth=$withval],
[with_quantum_depth=8])
if test "$with_quantum_depth" != '8' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-quantum-depth=$with_quantum_depth "
fi
case "${with_quantum_depth}" in
8 ) ;;
16 ) ;;
32 ) ;;
* ) AC_MSG_ERROR([Pixel quantum depth must have value of 8, 16, or 32]) ;;
esac
QuantumDepth="$with_quantum_depth"
AC_DEFINE_UNQUOTED([QuantumDepth],[$QuantumDepth],[Number of bits in a pixel Quantum (8/16/32)])
AC_SUBST([QuantumDepth])dnl
# Enable QuantumDepth in shared library names
AC_ARG_ENABLE([quantum-library-names],
AS_HELP_STRING([--enable-quantum-library-names],
[shared library name includes quantum
depth to allow shared libraries with
different quantum depths to co-exist in
same directory (only one can be used for
development)]),
[with_quantum_library_names=$enableval],
[with_quantum_library_names='no'])
MAGICK_LT_RELEASE_OPTS=
if test "$with_quantum_library_names" != 'no'
then
MAGICK_LT_RELEASE_OPTS="-release Q${QuantumDepth}"
fi
AC_SUBST([MAGICK_LT_RELEASE_OPTS])
# Disable/Enable support for full delegate paths in delegates.mgk
AC_ARG_WITH([frozenpaths],
AS_HELP_STRING([--with-frozenpaths],
[enable frozen delegate paths]),
[with_frozenpaths=$withval],
[with_frozenpaths='no'])
# Enable build/install of Magick++
AC_ARG_WITH([magick-plus-plus],
AS_HELP_STRING([--without-magick-plus-plus],
[disable build/install of Magick++]),
[with_magick_plus_plus=$withval],
[with_magick_plus_plus='yes'])
# Enable build/install of PerlMagick.
AC_ARG_WITH([perl],
AS_HELP_STRING([--with-perl@<:@=PERL@:>@],
[enable build/install of PerlMagick and optionally specify perl to use]),
[with_perl=$withval],
[with_perl='no'])
# Options to pass when configuring PerlMagick
AC_ARG_WITH([perl-options],
AS_HELP_STRING([--with-perl-options=OPTIONS],
[options to pass on command-line when
generating PerlMagick's Makefile from Makefile.PL]),
[PERL_MAKE_OPTIONS=$withval])
AC_SUBST([PERL_MAKE_OPTIONS])
# Disable BZLIB (bzip2 library)
AC_ARG_WITH([bzlib],
AS_HELP_STRING([--without-bzlib],
[disable BZLIB support]),
[with_bzlib=$withval],
[with_bzlib='yes'])
if test "$with_bzlib" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-bzlib=$with_bzlib "
fi
# Enable FlashPIX.
AC_ARG_WITH([fpx],
AS_HELP_STRING([--with-fpx],
[enable FlashPIX support]),
[with_fpx=$withval],
[with_fpx='no'])
if test "$with_fpx" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fpx=$with_fpx "
fi
# Enable Windows gdi32/user32 libraries
AC_ARG_WITH([gdi32],
AS_HELP_STRING([--without-gdi32],
[disable Windows gdi32/user32 (clipboard) support]),
[with_gdi32=$withval],
[with_gdi32='yes'])
if test "$with_gdi32" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gdi32=$with_gdi32 "
fi
# Disable Ghostscript support.
AC_ARG_WITH([gs],
AS_HELP_STRING([--without-gs],
[disable Ghostscript support]),
[with_gs=$withval],
[with_gs='yes'])
if test "$with_gs" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs=$with_gs "
fi
if test "$with_gs" = 'yes' ; then
AC_DEFINE([HasGS],[1],[Enable use of Ghostscript])
fi
AM_CONDITIONAL([HasGS],[test "$with_gs" = 'yes'])
# Disable JBIG.
AC_ARG_WITH([jbig],
AS_HELP_STRING([--without-jbig],
[disable JBIG support]),
[with_jbig=$withval],
[with_jbig='yes'])
if test "$with_jbig" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jbig=$with_jbig "
fi
# Disable WEBP.
AC_ARG_WITH([webp],
AS_HELP_STRING([--without-webp],
[disable WEBP support]),
[with_webp=$withval],
[with_webp='yes'])
if test "$with_webp" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-webp=$with_webp "
fi
# Disable HEIF.
AC_ARG_WITH([heif],
AS_HELP_STRING([--without-heif],
[disable HEIF support]),
[with_heif=$withval],
[with_heif='yes'])
if test "$with_heif" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-heif=$with_heif "
fi
# Disable JPEG.
AC_ARG_WITH([jpeg],
AS_HELP_STRING([--without-jpeg],
[disable JPEG support]),
[with_jpeg=$withval],
[with_jpeg='yes'])
if test "$with_jpeg" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jpeg=$with_jpeg "
fi
# Disable JPEG Version 2.
AC_ARG_WITH([jp2],
AS_HELP_STRING([--without-jp2],
[disable JPEG v2 support]),
[with_jp2=$withval],
[with_jp2='yes'])
if test "$with_jp2" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jp2=$with_jp2 "
fi
# Disable JXL
AC_ARG_WITH([jxl],
AS_HELP_STRING([--without-jxl],
[disable JPEG-XL support]),
[with_jxl=$withval],
[with_jxl='yes'])
if test "$with_jxl" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jxl=$with_jxl "
fi
# Disable LCMS2.
AC_ARG_WITH([lcms2],
AS_HELP_STRING([--without-lcms2],
[disable lcms (v2.X) support]),
[with_lcms2=$withval],
[with_lcms2='yes'])
if test "$with_lcms2" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms2=$with_lcms2 "
fi
# Disable LZMA (lzma library)
AC_ARG_WITH([lzma],
AS_HELP_STRING([--without-lzma],
[disable LZMA support]),
[with_lzma=$withval],
[with_lzma='yes'])
if test "$with_lzma" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lzma=$with_lzma "
fi
# # Disable MPEG.
# AC_ARG_WITH([mpeg2],
# AS_HELP_STRING([--without-mpeg2],
# [disable MPEG support]),
# [with_mpeg2=$withval],
# [with_mpeg2='yes'])
# Disable PNG.
AC_ARG_WITH([png],
AS_HELP_STRING([--without-png],
[disable PNG support]),
[with_png=$withval],
[with_png='yes'])
if test "$with_png" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-png=$with_png "
fi
# Disable TIFF.
AC_ARG_WITH([tiff],
AS_HELP_STRING([--without-tiff],
[disable TIFF support]),
[with_tiff=$withval],
[with_tiff='yes'])
if test "$with_tiff" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tiff=$with_tiff "
fi
# Enable TRIO.
AC_ARG_WITH([trio],
AS_HELP_STRING([--with-trio],
[enable TRIO support]),
[with_trio=$withval],
[with_trio='no'])
if test "$with_trio" != 'no' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-trio=$with_trio "
fi
# Disable TTF.
AC_ARG_WITH([ttf],
AS_HELP_STRING([--without-ttf],
[disable TrueType support]),
[with_ttf=$withval],
[with_ttf='yes'])
if test "$with_ttf" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-ttf=$with_ttf "
fi
# Disable LIBZIP.
AC_ARG_WITH([libzip],
AS_HELP_STRING([--without-libzip],
[disable libzip support]),
[with_libzip=$withval],
[with_libzip='yes'])
if test "$with_libzip" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-libzip=$with_libzip "
fi
# Enable use of Google tcmalloc library.
AC_ARG_WITH([tcmalloc],
AS_HELP_STRING([--with-tcmalloc],
[enable Google perftools tcmalloc (minimal) memory allocation library support]),
[with_tcmalloc=$withval],
[with_tcmalloc='no'])
if test "$with_tcmalloc" != 'no' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tcmalloc=$with_tcmalloc "
fi
# Enable use of Solaris mtmalloc library.
AC_ARG_WITH([mtmalloc],
AS_HELP_STRING([--with-mtmalloc],
[enable Solaris mtmalloc memory allocation library support]),
[with_mtmalloc=$withval],
[with_mtmalloc='no'])
if test "$with_mtmalloc" != 'no' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-mtmalloc=$with_mtmalloc "
fi
# Enable use of Solaris libumem (object-caching memory allocation library).
# Available as a SourceForge project http://sourceforge.net/projects/umem/ or
# https://labs.omniti.com/trac/portableumem/.
AC_ARG_WITH([umem],
AS_HELP_STRING([--with-umem],
[enable Solaris umem memory allocation library support]),
[with_umem=$withval],
[with_umem='no'])
if test "$with_umem" != 'no' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-umem=$with_umem "
fi
# Disable WMF.
AC_ARG_WITH([wmf],
AS_HELP_STRING([--without-wmf],
[disable WMF support]),
[with_wmf=$withval],
[with_wmf='yes'])
if test "$with_wmf" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-wmf=$with_wmf "
fi
# Set default font search path
AC_ARG_WITH([fontpath],
AS_HELP_STRING([--with-fontpath=DIR],
[prepend to default font search path]),
[with_fontpath=$withval],
[with_fontpath=''])
if test "$with_fontpath" != "yes" && test -z "$with_fontpath"
then
with_fontpath=''
else
AC_DEFINE_UNQUOTED([MAGICK_FONT_PATH],["$with_fontpath"],[Define to prepend to default font search path.])
fi
if test "$with_fontpath=" != '' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontpath=$with_fontpath "
fi
# Set Ghostscript font directory
AC_ARG_WITH([gs-font-dir],
AS_HELP_STRING([--with-gs-font-dir=DIR],
[directory containing Ghostscript fonts]),
[with_gs_font_dir=$withval],
[with_gs_font_dir='default'])
if test "$with_gs_font_dir" != 'default' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs-font-dir=$with_gs_font_dir "
fi
# Set Artifex URW Base35 OTF font directory
AC_ARG_WITH([urwbase35otf-font-dir],
AS_HELP_STRING([--with-urwbase35otf-font-dir=DIR],
[directory containing Artifex URW Base35 OTF fonts]),
[with_urwbase35otf_font_dir=$withval],
[with_urwbase35otf_font_dir='default'])
if test "$with_urwbase35otf_font_dir" != 'default' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-urwbase35otf-font-dir=$with_urwbase35otf_font_dir "
fi
# Set Windows font directory
AC_ARG_WITH([windows-font-dir],
AS_HELP_STRING([--with-windows-font-dir=DIR],
[directory containing MS-Windows fonts]),
[with_windows_font_dir=$withval],
[with_windows_font_dir=''])
if test "$with_windows_font_dir" != '' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-windows-font-dir=$with_windows_font_dir "
fi
# Disable XML.
AC_ARG_WITH([xml],
AS_HELP_STRING([--without-xml],
[disable XML support]),
[with_xml=$withval],
[with_xml='yes'])
if test "$with_xml" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-xml=$with_xml "
fi
AC_ARG_WITH([zlib],
AS_HELP_STRING([--without-zlib],
[disable ZLIB support]),
[with_zlib=$withval],
[with_zlib='yes'])
if test "$with_zlib" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zlib=$with_zlib "
fi
# Disable Zstd (zstd library)
AC_ARG_WITH([zstd],
AS_HELP_STRING([--without-zstd],
[disable Zstd support]),
[with_zstd=$withval],
[with_zstd='yes'])
if test "$with_zstd" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zstd=$with_zstd "
fi
#
# Specify path to shared libstdc++ if not in normal location
#
AC_ARG_WITH([libstdc],
AS_HELP_STRING([--with-libstdc=DIR],
[use libstdc++ in DIR (for GNU C++)]),
[if test "$withval" != no && test "$withval" != yes; then
if test -d "$withval"; then
LIBSTDCLDFLAGS="-L$withval"
fi
fi])
AC_SUBST([LIBSTDCLDFLAGS])
# Does gcc required -traditional?
AC_PROG_GCC_TRADITIONAL
########
#
# Set defines required to build DLLs and modules using MinGW
#
########
# These options are set for multi-thread DLL module build
# libMagick: _DLL _MAGICKMOD_ _MAGICKLIB_
# module: _DLL
# executable/Magick++: _DLL _MAGICKMOD_
MODULE_EXTRA_CPPFLAGS=''
LIBRARY_EXTRA_CPPFLAGS=''
if test "${native_win32_build}" = 'yes'
then
if test "${libtool_build_shared_libs}" = 'yes'
then
CPPFLAGS="$CPPFLAGS -D_DLL"
MAGICK_API_CPPFLAGS="$MAGICK_API_CPPFLAGS -D_DLL"
MAGICK_API_PC_CPPFLAGS="$MAGICK_API_PC_CPPFLAGS -D_DLL"
LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKLIB_"
if test "$build_modules" = 'yes'
then
LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKMOD_"
else
MODULE_EXTRA_CPPFLAGS="$MODULE_EXTRA_CPPFLAGS -D_MAGICKLIB_"
fi
else
CPPFLAGS="$CPPFLAGS -D_LIB"
MAGICK_API_CPPFLAGS="$MAGICK_API_CPPFLAGS -D_LIB"
MAGICK_API_PC_CPPFLAGS="$MAGICK_API_PC_CPPFLAGS -D_LIB"
fi
if test "$with_threads" = 'yes'
then
CPPFLAGS="$CPPFLAGS -D_MT"
MAGICK_API_CPPFLAGS="$MAGICK_API_CPPFLAGS -D_MT"
MAGICK_API_PC_CPPFLAGS="$MAGICK_API_PC_CPPFLAGS -D_MT"
fi
fi
AC_SUBST([MODULE_EXTRA_CPPFLAGS])
AC_SUBST([LIBRARY_EXTRA_CPPFLAGS])
# Check standard headers
AC_HEADER_DIRENT
# Check additional headers
AC_CHECK_HEADERS([inttypes.h machine/param.h mach-o/dyld.h process.h stdint.h sun_prefetch.h sys/mman.h sys/resource.h sys/times.h sys/types.h])
AC_CHECK_HEADERS([wincrypt.h],[],[],[#include <windows.h>])
case "${host_os}" in
linux* )
AC_CHECK_FUNCS([mallopt])
# Linux mallopt() needs <malloc.h>
AC_CHECK_HEADERS([malloc.h])
;;
esac
########
#
# Checks for typedefs, structures, and compiler characteristics.
#
########
# If the C compiler does not fully support the ANSI C qualifier const,
# define const to be empty.
AC_C_CONST
# If the C compiler supports the keyword restrict, do
# nothing. Otherwise define restrict to __restrict__ or __restrict if
# it accepts one of those, otherwise define restrict to be empty.
AC_C_RESTRICT
# If the C compiler supports the keyword inline, do nothing. Otherwise
# define inline to __inline__ or __inline if it accepts one of those,
# otherwise define inline to be empty.
AC_C_INLINE
# If words are stored with the most significant byte first (like
# Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'.
AC_C_BIGENDIAN
# Define mode_t to a suitable type, if standard headers do not define it.
AC_TYPE_MODE_T
# Define off_t to a suitable type, if standard headers do not define it.
AC_TYPE_OFF_T
# Define pid_t to a suitable type, if standard headers do not define it.
AC_TYPE_PID_T
# Define size_t to a suitable type, if standard headers do not define it.
AC_TYPE_SIZE_T
# Define ssize_t to a suitable type, if standard headers do not define it.
AC_TYPE_SSIZE_T
# If C compiler supports a working long double type with more range
# or precision than the double type then define HAVE_LONG_DOUBLE_WIDER.
AC_TYPE_LONG_DOUBLE_WIDER
# If the C type char is unsigned, define __CHAR_UNSIGNED__, unless the
# C compiler predefines it.
AC_C_CHAR_UNSIGNED
# Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT
AC_CHECK_SIZEOF([signed short])
# Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT
AC_CHECK_SIZEOF([unsigned short])
# Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
AC_CHECK_SIZEOF([signed int])
# Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT
AC_CHECK_SIZEOF([unsigned int])
# Obtain size of a 'signed long' and define as SIZEOF_SIGNED_LONG
AC_CHECK_SIZEOF([signed long])
# Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG
AC_CHECK_SIZEOF([unsigned long])
# Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG. If
# 'signed long long' is not supported then the value defined is zero.
AC_CHECK_SIZEOF([signed long long])
# Obtain size of a 'unsigned long long' and define as
# SIZEOF_UNSIGNED_LONG_LONG. If 'unsigned long long' is not
# supported then the value defined is zero.
AC_CHECK_SIZEOF([unsigned long long])
# Obtain size of off_t and define as SIZEOF_OFF_T
AC_CHECK_SIZEOF([off_t])
# Obtain size of size_t and define as SIZEOF_SIZE_T
AC_CHECK_SIZEOF([size_t])
# Obtain size of an unsigned int pointer and define as SIZEOF_UNSIGNED_INTP
AC_CHECK_SIZEOF([unsigned int*])
# Test for C compiler __func__ support
if test "$ac_cv_have_C__func__" != 'yes' ; then
AC_CACHE_CHECK([for C compiler __func__ support], ac_cv_have_C__func__,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
[[const char *func=__func__;
return (func != 0 ? 0 : 1);
]])],
[ac_cv_have_C__func__='yes'],
[ac_cv_have_C__func__='no'])])
if test "$ac_cv_have_C__func__" = 'yes' ; then
AC_DEFINE([HAS_C__func__],[1],[Define if C compiler supports __func__])
fi
fi
#
# Compute sized types for current CPU and compiler options.
#
# The reason why we don't use autoconf's recent built-in support for
# stdint.h types is because doing it ourself seems easier for dealing
# with Windows builds which don't use configure.
#
# int8_t
AC_MSG_CHECKING([for signed 8-bit type])
INT8_T='signed char'
AC_MSG_RESULT([$INT8_T])
AC_SUBST([INT8_T])
# uint8_t
AC_MSG_CHECKING([for unsigned 8-bit type])
UINT8_T='unsigned char'
AC_MSG_RESULT([$UINT8_T])
AC_SUBST([UINT8_T])
# int16_t
AC_MSG_CHECKING([for signed 16-bit type])
INT16_T='signed short'
AC_MSG_RESULT([$INT16_T])
AC_SUBST([INT16_T])
# uint16_t
AC_MSG_CHECKING([for unsigned 16-bit type])
UINT16_T='unsigned short'
AC_MSG_RESULT([$UINT16_T])
AC_SUBST([UINT16_T])
# int32_t
AC_MSG_CHECKING([for signed 32-bit type])
INT32_T='none'
INT32_F='none'
if test $ac_cv_sizeof_signed_int -eq 4
then
INT32_T='signed int'
INT32_F='""'
elif test $ac_cv_sizeof_signed_long -eq 4
then
INT32_T='signed long'
INT32_F='"l"'
fi
AC_MSG_RESULT([$INT32_T])
AC_SUBST([INT32_T])
AC_SUBST([INT32_F])
# uint32_t
AC_MSG_CHECKING([for unsigned 32-bit type])
UINT32_T='none'
UINT32_F='none'
if test $ac_cv_sizeof_unsigned_int -eq 4
then
UINT32_T='unsigned int'
UINT32_F='""'
elif test $ac_cv_sizeof_unsigned_long -eq 4
then
UINT32_T='unsigned long'
UINT32_F='"l"'
fi
AC_MSG_RESULT([$UINT32_T])
AC_SUBST([UINT32_T])
AC_SUBST([UINT32_F])
# int64_t
AC_MSG_CHECKING([for signed 64-bit type])
INT64_T='none'
INT64_F='none'
if test $ac_cv_sizeof_signed_long -eq 8
then
INT64_T='signed long'
INT64_F='"l"'
elif test $ac_cv_sizeof_signed_long_long -eq 8
then
INT64_T='signed long long'
INT64_F='"ll"'
fi
case "${host_os}" in
mingw* )
# Note that config.guess sets vendor to 'pc' but mingw-w64
# config.site overrides it and sets host_vendor to 'w64'.
case "${host_vendor}" in
'pc' ) # Original MinGW, use Microsoft syntax
INT64_F='"I64"'
;;
esac
esac
AC_MSG_RESULT([$INT64_T])
AC_SUBST([INT64_T])
AC_SUBST([INT64_F])
# uint64_t
AC_MSG_CHECKING([for unsigned 64-bit type])
UINT64_T='none'
UINT64_F='none'
if test $ac_cv_sizeof_unsigned_long -eq 8
then
UINT64_T='unsigned long'
UINT64_F='"l"'
elif test $ac_cv_sizeof_unsigned_long_long -eq 8
then
UINT64_T='unsigned long long'
UINT64_F='"ll"'
fi
case "${host_os}" in
mingw* )
case "${host_vendor}" in
'pc' ) # Original MinGW, use Microsoft syntax
UINT64_F='"I64"'
;;
esac
esac
AC_MSG_RESULT([$UINT64_T])
AC_SUBST([UINT64_T])
AC_SUBST([UINT64_F])
# uintmax_t
AC_MSG_CHECKING([for unsigned maximum type])
UINTMAX_T='none'
UINTMAX_F='none'
if test "$UINT64_T" != 'none'
then
UINTMAX_T=$UINT64_T
UINTMAX_F=$UINT64_F
elif test "$UINT32_T" != 'none'
then
UINTMAX_T=$UINT32_T
UINTMAX_F=$UINT32_F
fi
AC_MSG_RESULT([$UINTMAX_T])
AC_SUBST([UINTMAX_T])
AC_SUBST([UINTMAX_F])
# uintptr_t
AC_MSG_CHECKING([for unsigned pointer storage type])
UINTPTR_T='none'
UINTPTR_F='none'
if test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_unsigned_intp
then
UINTPTR_T='unsigned long'
UINTPTR_F='"l"'
elif test $ac_cv_sizeof_unsigned_long_long -eq $ac_cv_sizeof_unsigned_intp
then
UINTPTR_T='unsigned long long'
UINTPTR_F='"ll"'
fi
AC_MSG_RESULT([$UINTPTR_T])
AC_SUBST([UINTPTR_T])
AC_SUBST([UINTPTR_F])
# ptrdiff_t
AC_MSG_CHECKING([for signed pointer difference type])
PTRDIFF_T='none'
PTRDDIFF_F='none'
if test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_unsigned_intp
then
PTRDIFF_T='signed long'
PTRDIFF_F='"l"'
elif test $ac_cv_sizeof_unsigned_long_long -eq $ac_cv_sizeof_unsigned_intp
then
PTRDIFF_T='long long'
PTRDIFF_F='"ll"'
fi
AC_MSG_RESULT([$PTRDIFF_T])
AC_SUBST([PTRDIFF_T])
AC_SUBST([PTRDIFF_F])
MAGICK_SIZE_T='none'
MAGICK_SIZE_T_F='none'
MAGICK_SSIZE_T='none'
MAGICK_SSIZE_T_F='none'
AC_MSG_CHECKING([for size_t format specification])
if test $ac_cv_sizeof_size_t -eq $ac_cv_sizeof_unsigned_long
then
# Normal case for LP32 and LP64
MAGICK_SIZE_T='unsigned long'
MAGICK_SIZE_T_F='"l"'
MAGICK_SSIZE_T='signed long'
MAGICK_SSIZE_T_F='"l"'
elif test $ac_cv_sizeof_size_t -eq $ac_cv_sizeof_unsigned_long_long
then
# Maybe a LLP64 architecture like WIN64
MAGICK_SIZE_T='unsigned long long'
MAGICK_SIZE_T_F='"ll"'
MAGICK_SSIZE_T='signed long long'
MAGICK_SSIZE_T_F='"ll"'
case "${host_os}" in
mingw* )
case "${host_vendor}" in
'pc' ) # Original MinGW, use Microsoft syntax
MAGICK_SIZE_T_F='"I64"'
MAGICK_SSIZE_T_F='"I64"'
;;
esac
;;
esac
fi
AC_MSG_RESULT([$MAGICK_SIZE_T_F])
AC_SUBST([MAGICK_SIZE_T])
AC_SUBST([MAGICK_SIZE_T_F])
AC_SUBST([MAGICK_SSIZE_T])
AC_SUBST([MAGICK_SSIZE_T_F])
########
#
# Check for function prototypes
#
########
AC_CHECK_DECLS([pread, pwrite],[],[],[
#include <unistd.h>])
AC_CHECK_DECLS([strlcpy],[],[],[
#include <strings.h>])
AC_CHECK_DECLS([vsnprintf],[],[],[
#include <stdio.h>
#include <stdarg.h>])
#######
#
# Check for /dev/urandom device
#
#######
AC_CACHE_CHECK([for /dev/urandom],gm_cv_dev_urandom,
[ gm_cv_dev_urandom=no
if test -c /dev/urandom
then
gm_cv_dev_urandom=yes
fi])
if test "${gm_cv_dev_urandom}" = yes
then
AC_DEFINE([HAVE_DEV_URANDOM],[1],[Have a /dev/urandom device for producing random bytes])
fi
########
#
# Try to find a command which reports usable physical memory
#
########
MAGICK_PHYSICAL_MEMORY_COMMAND=''
case "${host}" in
*-*-freebsd* | *-apple-darwin*)
AC_PATH_PROG([SysCtlDelegate],[sysctl],[])
if test "${SysCtlDelegate}X" != 'X'
then
# "sysctl -n hw.physmem" became available in FreeBSD 2.0
# Apple's Darwin is based on FreeBSD and supports sysctl
MAGICK_PHYSICAL_MEMORY_COMMAND="${SysCtlDelegate} -n hw.physmem"
fi
;;
esac
if test "${MAGICK_PHYSICAL_MEMORY_COMMAND}X" != 'X'
then
AC_DEFINE_UNQUOTED([MAGICK_PHYSICAL_MEMORY_COMMAND],
["${MAGICK_PHYSICAL_MEMORY_COMMAND}"],
[Command which returns total physical memory in bytes])
fi
########
#
# C++ Support Tests (For Magick++)
#
########
have_magick_plus_plus='no'
if test "$with_magick_plus_plus" = 'yes'
then
OLIBS="$LIBS"
LIBS=''
AC_LANG_PUSH([C++])
# Full set of headers used ...
# algorithm cctype cerrno cmath cstdio cstdlib cstring ctime exception
# functional iomanip iosfwd iostream iterator list string strstream utility
AC_LANG([C++])
AC_PROG_CXX
AC_CXX_BOOL
AC_CXX_CONST_CAST
AC_CXX_DEFAULT_TEMPLATE_PARAMETERS
AC_CXX_EXCEPTIONS
AC_CXX_NAMESPACES
AC_CXX_EXPLICIT
AC_CXX_HAVE_STD
AC_CXX_HAVE_STL
AC_CXX_IOS_BINARY
AC_CXX_MUTABLE
AC_CXX_NEW_FOR_SCOPING
AC_CXX_STATIC_CAST
AC_CXX_TEMPLATES
# Test for C++ compiler __func__ support
if test "$ac_cv_have_CPP__func__" != 'yes' ; then
AC_CACHE_CHECK(for C++ compiler __func__ support, ac_cv_have_CPP__func__,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
[[const char *func=__func__;
return (func != 0 ? 0 : 1);
]])],
[ac_cv_have_CPP__func__='yes'],[ac_cv_have_CPP__func__='no'])])
if test "$ac_cv_have_CPP__func__" = 'yes' ; then
AC_DEFINE([HAS_CPP__func__],[1],[Define if C++ compiler supports __func__])
fi
fi
AC_LANG_POP
AC_MSG_CHECKING([whether C++ compiler is sufficient for Magick++])
if \
test $ac_cv_cxx_bool = 'yes' && \
test $ac_cv_cxx_const_cast = 'yes' &&
test $ac_cv_cxx_default_template_parameters = 'yes' &&
test $ac_cv_cxx_exceptions = 'yes' && \
test $ac_cv_cxx_explicit = 'yes' && \
test $ac_cv_cxx_have_std = 'yes' && \
test $ac_cv_cxx_have_stl = 'yes' && \
test $ac_cv_cxx_mutable = 'yes' && \
test $ac_cv_cxx_namespaces = 'yes' && \
test $ac_cv_cxx_new_for_scoping = 'yes' && \
test $ac_cv_cxx_static_cast = 'yes' && \
test $ac_cv_cxx_templates = 'yes'
then
have_magick_plus_plus='yes'
else
have_magick_plus_plus='no (failed tests)'
fi
AC_MSG_RESULT([$have_magick_plus_plus])
LIBS="$OLIBS"
fi
AM_CONDITIONAL([WITH_MAGICK_PLUS_PLUS],[test "$have_magick_plus_plus" = 'yes'])
# Assume that delegate headers and libraries may reside under same
# directory as GraphicsMagick installation prefix.
#LDFLAGS="$LDFLAGS -L$LIB_DIR"
#CPPFLAGS="$CPPFLAGS -I$INCLUDE_DIR"
MAGICK_API_CPPFLAGS="-I$INCLUDE_DIR/GraphicsMagick $MAGICK_API_CPPFLAGS"
#
# Find the X11 RGB database
#
AC_CACHE_CHECK([for X11 configure files],[gm_cv_x_configure],
[# Look for the header file in a standard set of common directories.
# Check X11 before X11Rn because it is often a symlink to the current release.
for ac_dir in \
/lib/usr/lib/X11 \
/usr/X11/lib \
/usr/X11R4/lib \
/usr/X11R5/lib \
/usr/X11R6/lib \
/usr/X11R7/lib \
/usr/X386/lib \
/usr/XFree86/lib/X11 \
/usr/athena/lib \
/usr/lib \
/usr/lib/X11 \
/usr/lib/X11R4 \
/usr/lib/X11R5 \
/usr/lib/X11R6 \
/usr/lib/X11R7 \
/usr/local/X11/lib \
/usr/local/X11R4/lib \
/usr/local/X11R5/lib \
/usr/local/X11R6/lib \
/usr/local/X11R7/lib \
/usr/local/lib \
/usr/local/lib/X11 \
/usr/local/lib/X11R4 \
/usr/local/lib/X11R5 \
/usr/local/lib/X11R6 \
/usr/local/lib/X11R7 \
/usr/local/x11r5/lib \
/usr/lpp/Xamples/lib \
/usr/openwin/lib \
/usr/openwin/share/lib \
/usr/unsupported/lib \
/usr/x386/lib \
; \
do
if test -f "$ac_dir/X11/rgb.txt"
then
gm_cv_x_configure="$ac_dir/X11/"
break
elif test -f "$ac_dir/rgb.txt"
then
gm_cv_x_configure="$ac_dir/"
break
fi
done])
X11ConfigurePath="$gm_cv_x_configure"
case "${build_os}" in
mingw* )
X11ConfigurePath=`$WinPathScript "$X11ConfigurePath=" 1`
;;
esac
AC_DEFINE_UNQUOTED([X11ConfigurePath],["X11ConfigurePath"],[Location of X11 configure files])
# Shell function to distribute pkg-config derived PKG_FLAGS,
# PKG_CFLAGS to Autoconf standard compilation flags (CPPFLAGS, CFLAGS,
# LDFLAGS) while also deduplicating values. The final result is
# visible via the configuration summary.
#
# pkg_config_to_flags(pkg_name,pkg_libs,pkg_cflags)
pkg_config_to_flags() {
#set -x
pkg_name=$1
pkg_libs=$2
pkg_cflags=$3
#printf "pkg_name=${pkg_name}\n"
#printf "pkg_libs=${pkg_libs}\n"
#printf "pkg_cflags=${pkg_cflags}\n"
for token in $pkg_cflags
do
case $token in
-I* | -D*)
# Add token to CPPFLAGS if not already present
add=yes;
for test_token in $CPPFLAGS
do
if test $token = $test_token
then
add=no
break
fi
done
if test $add = yes
then
CPPFLAGS="$CPPFLAGS ${token}"
fi
;;
*)
# Discard
;;
esac
done
# -L* | -Wl,* | -R*)
for token in $pkg_libs
do
case $token in
-L* | -Wl,* | -R*)
# Add token to LDFLAGS if not already present
add=yes;
for test_token in $LDFLAGS
do
if test $token = $test_token
then
add=no
break
fi
done
if test $add = yes
then
LDFLAGS="$LDFLAGS $token"
fi
;;
*)
;;
esac
done
# -l
reverse_pkg_libs=""
for token in $pkg_libs
do
reverse_pkg_libs="$token $reverse_pkg_libs"
done
for token in $reverse_pkg_libs
do
case $token in
-l*)
# Add token to LIBS if not already present
add=yes;
for test_token in $LIBS
do
if test $token = $test_token
then
add=no
break
fi
done
if test $add = yes
then
LIBS="$token $LIBS"
fi
;;
*)
# Discard
;;
esac
done
#printf "CPPFLAGS=${CPPFLAGS}\n"
#printf "LDFLAGS=${LDFLAGS}\n"
#printf "LIBS=${LIBS}\n\n"
#set +x
return $?
}
#
# Find Posix threads library (no pkg-config support!)
#
LIB_THREAD=''
if test "$with_threads" != 'no' && test "$have_threads" = 'yes'
then
if test "x$PTHREAD_LIBS" = "x"
then
case "${host_cpu}-${host_os}" in
*-freebsd*)
MAGICK_CHECK_PTHREAD_LIB([c_r],[PTHREAD_LIBS=-lc_r]) ;;
esac
fi
for lib in pthread pthreads
do
if test "x$PTHREAD_LIBS" = "x" ; then
MAGICK_CHECK_PTHREAD_LIB([$lib],[PTHREAD_LIBS=-l$lib])
fi
done
LIB_THREAD="$PTHREAD_LIBS"
LIBS="$LIBS $LIB_THREAD"
fi
AC_SUBST([LIB_THREAD])
#
# Check for Google perftools tcmalloc library (no pkg-config support!)
#
have_tcmalloc='no'
LIB_TCMALLOC=''
OLIBS="$LIBS"
if test "$have_threads" = 'yes' -a "$with_tcmalloc" != 'no'
then
AC_MSG_CHECKING([Google perftools tcmalloc (minimal) library support ])
AC_MSG_RESULT([])
failed=0
passed=0
AC_CHECK_LIB([tcmalloc_minimal],[mallinfo],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
if test $passed -gt 0
then
if test $failed -gt 0
then
have_tcmalloc='no (some components failed test)'
else
LIB_TCMALLOC=-ltcmalloc_minimal
LIBS="$LIB_TCMALLOC $LIBS"
CFLAGS="$CFLAGS -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free"
AC_DEFINE([HasTCMALLOC],[1],[Define if you have Google perftools tcmalloc (minimal) library])
have_tcmalloc='yes'
fi
fi
AC_MSG_CHECKING([if Google perftools tcmalloc (minimal) memory allocation library is complete ])
AC_MSG_RESULT([$have_tcmalloc])
fi
AM_CONDITIONAL([HasTCMALLOC], [test "$have_tcmalloc" = 'yes'])
AC_SUBST([LIB_TCMALLOC])
#
# Check for Solaris-derived libumem (no pkg-config support!)
#
have_umem='no'
LIB_UMEM=''
if test "$with_umem" != 'no'
then
AC_MSG_CHECKING([for Solaris umem library support ])
AC_MSG_RESULT()
failed=0
passed=0
AC_CHECK_HEADER([umem.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_LIB([umem],[umem_alloc],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_CHECK_LIB([umem],[umem_free],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
if test $passed -gt 0
then
if test $failed -gt 0
then
have_umem='no (some components failed test)'
else
LIB_UMEM='-lumem'
LIBS="$LIB_UMEM $LIBS"
AC_DEFINE([HasUMEM],[1],[Define if you have umem memory allocation library])
have_umem='yes'
fi
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([if Solaris umem memory allocation library is complete ])
AC_MSG_RESULT([$have_umem])
fi
AM_CONDITIONAL([HasUMEM],[test "$have_umem" = 'yes'])
AC_SUBST([LIB_UMEM])
#
# Check for Solaris-derived mtmalloc library (no pkg-config support!)
#
have_mtmalloc='no'
LIB_MTMALLOC=''
OLIBS="$LIBS"
if test "$have_umem" = 'no' -a "$have_threads" = 'yes' -a "$with_mtmalloc" != 'no'
then
AC_MSG_CHECKING([for Solaris mtmalloc library support ])
AC_MSG_RESULT([])
failed=0
passed=0
AC_CHECK_HEADER([mtmalloc.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
AC_CHECK_LIB([mtmalloc],[mallocctl],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
if test $passed -gt 0
then
if test $failed -gt 0
then
have_mtmalloc='no (some components failed test)'
else
LIB_MTMALLOC=-lmtmalloc
LIBS="$LIB_MTMALLOC $LIBS"
AC_DEFINE([HasMTMALLOC],[1],[Define if you have Solaris mtmalloc library])
have_mtmalloc='yes'
fi
fi
AC_MSG_CHECKING([if Solaris mtmalloc memory allocation library is complete ])
AC_MSG_RESULT([$have_mtmalloc])
fi
AM_CONDITIONAL([HasMTMALLOC], [test "$have_mtmalloc" = 'yes'])
AC_SUBST([LIB_MTMALLOC])
#
# Find OpenMP library (no pkg-config support!)
#
LIB_OMP=''
if test "${OPENMP_ENABLED}" = 'yes'
then
if test "${GCC}" = "yes"
then
# Open64 (passes for GCC but uses different OpenMP implementation)
if test "x$LIB_OMP" = x ; then
if $CC --version 2>&1 | grep Open64 > /dev/null ; then
AC_CHECK_LIB([openmp],[omp_get_num_procs],[LIB_OMP="-lopenmp"],,)
fi
fi
# Clang (passes for GCC but uses different OpenMP implementation)
if test "x$LIB_OMP" = x ; then
if $CC --version 2>&1 | grep clang > /dev/null ; then
AC_CHECK_LIB([omp],[GOMP_parallel_start],[LIB_OMP="-lomp"],,)
fi
fi
# GCC/Clang
if test "x$LIB_OMP" = x ; then
AC_CHECK_LIB([gomp],[GOMP_parallel_start],[LIB_OMP="-lgomp"],,)
fi
else
# Sun CC
if test "x$LIB_OMP" = x ; then
AC_CHECK_LIB([mtsk],[sunw_mp_register_warn],[LIB_OMP="-lmtsk"],,)
fi
# AIX xlc
if test "x$LIB_OMP" = x ; then
AC_CHECK_LIB([xlsmp],[_xlsmpFlush],[LIB_OMP="-lxlsmp"],,)
fi
# SGI IRIX 6.5 MIPSpro C/C++
if test "x$LIB_OMP" = x ; then
AC_CHECK_LIB([mp],[mp_destroy],[LIB_OMP="-lmp"],,)
fi
fi
#LIBS="$LIB_OMP $LIBS"
AC_MSG_CHECKING([for OpenMP library ])
if test "x$LIB_OMP" = x ; then
AC_MSG_RESULT([not found!])
else
AC_MSG_RESULT([${LIB_OMP}])
fi
fi
AC_SUBST([LIB_OMP])
#
# Find math library (no pkg-config support!)
#
LIB_MATH=''
AC_CHECK_LIB([m],[sqrt],[LIB_MATH='-lm'],,)
LIBS="$LIB_MATH $LIBS"
#printf "LIBS=${LIBS}\n"
AC_SUBST([LIB_MATH])
#
# If vsnprintf is missing, look for TRIO
#
have_trio='no'
LIB_TRIO=''
if test "$ac_cv_have_decl_vsnprintf" != 'yes' && test "$with_trio" != 'no'
then
AC_MSG_CHECKING([for TRIO vsnprintf replacement])
AC_CHECK_LIB([trio],[trio_vsnprintf],[have_trio='yes'],,)
if test "$have_trio" = 'yes'
then
LIB_TRIO="-ltrio"
LIBS="$LIB_TRIO $LIBS"
AC_DEFINE([HasTRIO],[1],[Define if you have TRIO vsnprintf replacement library])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
AC_SUBST([LIB_TRIO])
#
# Optionally check for libltdl if using it is still enabled (no pkg-config support!)
#
# Only use/depend on libtdl if we are building modules. This is a
# change from previous releases (prior to 1.3.17) which supported
# loaded modules via libtdl if shared libraries were built. of
# whether modules are built or not.
have_ltdl='no'
LIB_LTDL=''
if test "$build_modules" != 'no'
then
AC_MSG_CHECKING([for libltdl ])
AC_MSG_RESULT()
failed=0
passed=0
AC_CHECK_HEADER([ltdl.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_LIB([ltdl],[lt_dlinit],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_MSG_CHECKING([if libltdl package is complete])
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT([no -- some components failed test])
have_ltdl='no (failed tests)'
else
LIB_LTDL='-lltdl'
LIBS="$LIB_LTDL $LIBS"
AC_DEFINE([HasLTDL],[1],[Define if using libltdl to support dynamically loadable modules])
AC_MSG_RESULT([yes])
have_ltdl='yes'
fi
else
AC_MSG_RESULT([no])
fi
if test "$have_ltdl" != 'yes'
then
AC_MSG_FAILURE([libltdl is required by modules build],[1])
fi
fi
AM_CONDITIONAL([WITH_LTDL],[test "$have_ltdl" != 'no'])
#
# Check for ZLIB
#
have_zlib='no'
LIB_ZLIB=''
dnl PNG requires zlib 'libz' so enable zlib check if PNG is requested
if test "$with_zlib" != 'no' || test "$with_png" != 'no'
then
AC_MSG_CHECKING([for ZLIB support ])
AC_MSG_RESULT()
OLD_CPPFLAGS=$CPPFLAGS
OLD_LDFLAGS=$LDFLAGS
OLD_LIBS=$LIBS
failed=0
passed=0
PKG_CHECK_MODULES([ZLIB], [zlib], [passed=`expr $passed + 1`], [failed=`expr $failed + 1`])
if test $failed -eq 0 ; then
if test -n "$VERBOSE"
then
printf "ZLIB_LIBS=${ZLIB_LIBS}\n"
printf "ZLIB_CFLAGS=${ZLIB_CFLAGS}\n"
fi
pkg_config_to_flags 'zlib' "${ZLIB_LIBS}" "${ZLIB_CFLAGS}"
else
if test -n "${ZLIB_PKG_ERRORS}"
then
printf "${ZLIB_PKG_ERRORS}\n"
fi
failed=0
fi
AC_CHECK_HEADER([zconf.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_HEADER([zlib.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_LIB([z],[compress],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_CHECK_LIB([z],[uncompress],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_CHECK_LIB([z],[deflate],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_CHECK_LIB([z],[inflate],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_CHECK_LIB([z],[gzseek],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_CHECK_LIB([z],[gztell],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_MSG_CHECKING([if ZLIB package is complete])
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT([no -- some components failed test])
have_zlib='no (failed tests)'
ZLIB_LIBS=''
ZLIB_CFLAGS=''
CPPFLAGS=$OLD_CPPFLAGS
LDFLAGS=$OLD_LDFLAGS
LIBS=$OLD_LIBS
else
LIB_ZLIB='-lz'
pkg_config_to_flags 'zlib' "${LIB_ZLIB}" ''
AC_DEFINE([HasZLIB],[1],[Define if you have zlib compression library])
AC_MSG_RESULT([yes])
have_zlib='yes'
#printf "LIBS=${LIBS}\n"
fi
else
AC_MSG_RESULT([no])
fi
fi
AM_CONDITIONAL([HasZLIB],[test "$have_zlib" = 'yes'])
AC_SUBST([LIB_ZLIB])
#
# Check for BZLIB (no pkg-config support!)
#
#
have_bzlib='no'
if test "$with_bzlib" != 'no'
then
LIB_BZLIB=''
AC_MSG_CHECKING([for BZLIB support ])
AC_MSG_RESULT()
failed=0
passed=0
found_libbz=0
AC_CHECK_HEADER([bzlib.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_LIB([bz2],[BZ2_bzDecompress],[found_libbz=`expr $found_libbz + 1`],,)
if test "$native_win32_build" = 'yes'
then
# Under MinGW, libbz2 obfuscates its functions by declaring them
# with DLL interfaces. This would be all better if we could
# somehow include bzlib.h during the test but Autoconf does not
# make that possible. We check for BZ2_decompress since that is
# one of the few functions exported from the DLL (very strange).
AC_CHECK_LIB([bz2],[_imp__BZ2_decompress],[found_libbz=`expr $found_libbz + 1`],,)
fi
if test $found_libbz -gt 0
then
passed=`expr $passed + 1`
else
failed=`expr $failed + 1`
fi
#AC_CHECK_LIB([bz2],[BZ2_bzCompress],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
#AC_CHECK_LIB([bz2],[BZ2_bzDecompress],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
#AC_CHECK_LIB([bz2],[_imp__BZ2_decompress],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_MSG_CHECKING([if BZLIB package is complete])
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT([no -- some components failed test])
have_bzlib='no (failed tests)'
else
LIB_BZLIB='-lbz2'
LIBS="$LIB_BZLIB $LIBS"
AC_DEFINE([HasBZLIB],[1],[Define if you have the bzip2 library])
AC_MSG_RESULT([yes])
have_bzlib='yes'
fi
else
AC_MSG_RESULT([no])
fi
fi
AM_CONDITIONAL([HasBZLIB],[test "$have_bzlib" = 'yes'])
AC_SUBST([LIB_BZLIB])
#
# Check for LZMA
#
have_lzma='no'
LIB_LZMA=''
if test "$with_lzma" != 'no'
then
AC_MSG_CHECKING([for LZMA support ])
AC_MSG_RESULT()
OLD_CPPFLAGS=$CPPFLAGS
OLD_LDFLAGS=$LDFLAGS
OLD_LIBS=$LIBS
failed=0
passed=0
PKG_CHECK_MODULES([LZMA], [liblzma], [passed=`expr $passed + 1`], [failed=`expr $failed + 1`])
if test $failed -eq 0 ; then
if test -n "$VERBOSE"
then
printf "LZMA_LIBS=${LZMA_LIBS}\n"
printf "LZMA_CFLAGS=${LZMA_CFLAGS}\n"
fi
pkg_config_to_flags 'liblzma' "${LZMA_LIBS}" "${LZMA_CFLAGS}"
else
if test -n "${LZMA_PKG_ERRORS}"
then
printf "${LZMA_PKG_ERRORS}\n"
fi
failed=0
fi
AC_CHECK_HEADER([lzma.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_LIB([lzma],[lzma_code],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_MSG_CHECKING([if LZMA package is complete])
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT([no -- some components failed test])
have_lzma='no (failed tests)'
CPPFLAGS=$OLD_CPPFLAGS
LDFLAGS=$OLD_LDFLAGS
LIBS=$OLD_LIBS
else
LIB_LZMA=''
for token in ${LZMA_LIBS}
do
case $token in
-l*)
LIB_LZMA="$LIB_LZMA $token"
;;
esac
done
pkg_config_to_flags 'liblzma' "${LIB_LZMA}" ''
AC_DEFINE([HasLZMA],[1],[Define if you have lzma compression library])
AC_MSG_RESULT([yes])
have_lzma='yes'
fi
else
AC_MSG_RESULT([no])
fi
fi
AM_CONDITIONAL([HasLZMA],[test "$have_lzma" = 'yes'])
AC_SUBST([LIB_LZMA])
#
# Check for Zstd
#
have_zstd='no'
LIB_ZSTD=''
if test "$with_zstd" != 'no'
then
AC_MSG_CHECKING([for Zstd support ])
AC_MSG_RESULT()
failed=0
passed=0
OLD_CPPFLAGS=$CPPFLAGS
OLD_LDFLAGS=$LDFLAGS
OLD_LIBS=$LIBS
PKG_CHECK_MODULES([ZSTD], [libzstd], [passed=`expr $passed + 1`], [failed=`expr $failed + 1`])
if test $failed -eq 0
then
if test -n "$VERBOSE"
then
printf "ZSTD_LIBS=${ZSTD_LIBS}\n"
printf "ZSTD_CFLAGS=${ZSTD_CFLAGS}\n"
fi
pkg_config_to_flags 'libzstd' "${ZSTD_LIBS}" "${ZSTD_CFLAGS}"
else
if test -n "${ZSTD_PKG_ERRORS}"
then
printf "${ZSTD_PKG_ERRORS}\n"
fi
failed=0
fi
AC_CHECK_HEADER([zstd.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_LIB([zstd],[ZSTD_createDStream],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_MSG_CHECKING([if Zstd package is complete])
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT([no -- some components failed test])
have_zstd='no (failed tests)'
CPPFLAGS=$OLD_CPPFLAGS
LDFLAGS=$OLD_LDFLAGS
LIBS=$OLD_LIBS
else
LIB_ZSTD='-lzstd'
pkg_config_to_flags 'libzstd' "${LIB_ZSTD}" ''
#LIBS="$LIB_ZSTD $LIBS"
AC_DEFINE([HasZSTD],[1],[Define if you have zstd compression library])
AC_MSG_RESULT([yes])
have_zstd='yes'
fi
else
AC_MSG_RESULT([no])
fi
fi
AM_CONDITIONAL([HasZSTD],[test "$have_zstd" = 'yes'])
AC_SUBST([LIB_ZSTD])
#
# Check for XML
#
have_xml='no'
LIB_XML=''
LIB_XML_DEPS=''
LIB_XML2_BASE=''
if test "$with_xml" != 'no'
then
AC_MSG_CHECKING([for XML support ])
AC_MSG_RESULT([])
OLD_CPPFLAGS=$CPPFLAGS
OLD_LDFLAGS=$LDFLAGS
OLD_LIBS=$LIBS
failed=0
passed=0
PKG_CHECK_MODULES([XML], [libxml-2.0], [passed=`expr $passed + 1`], [failed=`expr $failed + 1`])
if test $failed -eq 0
then
if test -n "$VERBOSE"
then
printf "XML_LIBS=${XML_LIBS}\n"
printf "XML_CFLAGS=${XML_CFLAGS}\n"
fi
pkg_config_to_flags 'libxml-2.0' "${XML_LIBS}" "${XML_CFLAGS}"
else
if test -n "${XML_PKG_ERRORS}"
then
printf "${XML_PKG_ERRORS}\n"
fi
failed=0
fi
failed=0
passed=0
# libxml2 normally requires pkg-config in order to produce the
# necessary additional include path. For example
# "-I/usr/include/libxml2", but if pkg-config was not available,
# the user could supply that manually using CPPFLAGS.
#
# Incantation tested with libxml2 2.7.8 configured with
# --with-minimum --with-http --with-ftp --with-push --with-zlib --with-sax1
# Note that SAX1 interfaces don't seem to be directly used but parsers fail to work
# as expected without SAX1 support compiled in.
AC_CHECK_HEADER([libxml/xmlversion.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_HEADER([libxml/parser.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_HEADER([libxml/xmlmemory.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_LIB([xml2],[xmlSAXVersion],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[$LIB_XML_DEPS])
# Next two require --with-push to be enabled
AC_CHECK_LIB([xml2],[xmlParseChunk],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[$LIB_XML_DEPS])
AC_CHECK_LIB([xml2],[xmlCreatePushParserCtxt],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[$LIB_XML_DEPS])
AC_MSG_CHECKING([if XML package is complete ])
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT([no -- some components failed test])
have_xml='no (failed tests)'
CPPFLAGS=$OLD_CPPFLAGS
LDFLAGS=$OLD_LDFLAGS
LIBS=$OLD_LIBS
else
LIB_XML="-lxml2"
pkg_config_to_flags 'libxml-2.0' "${LIB_XML}" ''
AC_DEFINE([HasXML],[1],[Define if you have XML library])
AC_MSG_RESULT([yes])
have_xml='yes'
AC_CHECK_FUNCS([xmlNanoHTTPOpen \
xmlNanoFTPNewCtxt])
fi
else
AC_MSG_RESULT([no])
fi
fi
AM_CONDITIONAL([HasXML], [test "$have_xml" = 'yes'])
AC_SUBST([LIB_XML])
AC_SUBST([LIB_XML_DEPS])
#
# Find the X11 include and library directories.
#
LIB_X11=''
LIB_XEXT=''
AC_PATH_XTRA
if test "$no_x" != 'yes'
then
LDFLAGS="$LDFLAGS $X_LIBS"
LIB_X11="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
LIBS="$LIB_X11 $LIBS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
AC_DEFINE([HasX11],[1],[Define if you have X11 library])dnl
#
# Check for X11 shared memory extension
#
# shmctl is required to support the shared memory extension
LIB_IPC=''
AC_CHECK_FUNC([shmctl],[have_shmctl='yes'],[])
if test "$have_shmctl" != 'yes'
then
AC_SEARCH_LIBS([shmctl],[cygipc],[have_shmctl='yes'; LIB_IPC='-lcygipc'],[])
fi
if test "$have_shmctl" = 'yes'
then
AC_CHECK_LIB([Xext],[XShmAttach],[LIB_XEXT='-lXext' ; AC_DEFINE([HasSharedMemory],[1],[X11 server supports shared memory extension])],[],[])
fi
#
# Check for X11 shape extension
#
AC_CHECK_LIB([Xext],[XShapeCombineMask],[LIB_XEXT='-lXext' ; AC_DEFINE([HasShape],[1],[X11 server supports shape extension])],[],[])
LIBS="$LIB_XEXT $LIBS"
fi
if test "$no_x" != 'yes'
then
have_x='yes'
else
have_x='no'
fi
AM_CONDITIONAL([HasX11],[test "$have_x" = 'yes'])
AC_SUBST([LIB_X11])
AC_SUBST([LIB_XEXT])
#
# If profiling, then check for -ldl and dlopen (required for Solaris & gcc)
#
LIB_DL=''
if test "$with_profiling" = 'yes'
then
AC_CHECK_LIB([dl],[dlopen],[LIB_DL='-ldl'],,)
LIBS="$LIB_DL $LIBS"
fi
AC_SUBST([LIB_DL])
#
# Check for FlashPIX
#
have_fpx='no'
LIB_FPX=''
if test "$with_fpx" != 'no'
then
AC_MSG_CHECKING([for FlashPIX components ])
AC_MSG_RESULT()
failed=0
passed=0
AC_LANG_PUSH([C++])
AC_CHECK_HEADER([fpxlib.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_LIB([fpx],[FPX_OpenImageByFilename],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_LANG_POP
AC_MSG_CHECKING([if FlashPIX package is complete])
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT([no -- some components failed test])
have_fpx='no (failed tests)'
else
LIB_FPX='-lfpx'
LIBS="$LIB_FPX $LIBS"
AC_DEFINE([HasFPX],[1],[Define if you have FlashPIX library])
AC_MSG_RESULT([yes])
have_fpx='yes'
PERLMAINCC="$CXX"
fi
else
AC_MSG_RESULT([no])
fi
fi
AM_CONDITIONAL([HasFPX],[test "$have_fpx" = 'yes'])
AC_SUBST([LIB_FPX])
#
# Check for LCMS v2
#
have_lcms2='no'
LIB_LCMS=''
if test "$with_lcms2" != 'no'
then
AC_MSG_CHECKING([for lcms v2 support])
AC_MSG_RESULT()
OLD_CPPFLAGS=$CPPFLAGS
OLD_LDFLAGS=$LDFLAGS
OLD_LIBS=$LIBS
failed=0
passed=0
have_lcms_header='no'
PKG_CHECK_MODULES([LCMS2], [lcms2], [passed=`expr $passed + 1`], [failed=`expr $failed + 1`])
if test $failed -eq 0 ; then
if test -n "$VERBOSE"
then
printf "LCMS2_LIBS=${LCMS2_LIBS}\n"
printf "LCMS2_CFLAGS=${LCMS2_CFLAGS}\n"
fi
pkg_config_to_flags 'lcms2' "${LCMS2_LIBS}" "${LCMS2_CFLAGS}"
else
if test -n "${LCMS2_PKG_ERRORS}"
then
printf "${LCMS2_PKG_ERRORS}\n"
fi
failed=0
fi
# Check for <lcms2.h>
AC_CHECK_HEADER([lcms2.h],[have_lcms_header='yes'],,)
if test "$have_lcms_header" = 'yes'
then
AC_DEFINE([HAVE_LCMS2_H],[1],[Define if you have the <lcms2.h> header file.])
passed=`expr $passed + 1`
fi
# Check for <lcms2/lcms2.h)
if test "$have_lcms_header" != 'yes'
then
AC_CHECK_HEADER([lcms2/lcms2.h],[have_lcms_header='yes'],,)
if test "$have_lcms_header" = 'yes'
then
passed=`expr $passed + 1`
AC_DEFINE([HAVE_LCMS2_LCMS2_H],[1],[Define if you have the <lcms2/lcms2.h> header file.])
fi
fi
# Failed to find lcms header?
if test "$have_lcms_header" != 'yes'
then
failed=`expr $failed + 1`
fi
AC_CHECK_LIB([lcms2],[cmsSetLogErrorHandler],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_MSG_CHECKING([if LCMS v2 package is complete])
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT([no -- some components failed test])
have_lcms2='no (failed tests)'
LCMS2_LIBS=''
LCMS2_CFLAGS=''
CPPFLAGS=$OLD_CPPFLAGS
LDFLAGS=$OLD_LDFLAGS
LIBS=$OLD_LIBS
else
LIB_LCMS='-llcms2'
pkg_config_to_flags 'lcms2' "${LIB_LCMS}" ''
#LIBS="$LIB_LCMS $LIBS"
#AC_DEFINE(HasLCMS2,1,Define if you have LCMS v2 library)
AC_MSG_RESULT([yes])
have_lcms2='yes'
fi
else
AC_MSG_RESULT([no])
fi
fi
AM_CONDITIONAL([HasLCMS],[test "$have_lcms2" = 'yes'])
if test "$have_lcms2" = 'yes'
then
AC_DEFINE([HasLCMS],[1],[Define if you have LCMS (v2.0 or later) library])
fi
AC_SUBST([LIB_LCMS])
have_png='no'
LIB_PNG=''
if test "$have_zlib" = 'yes' -a "$with_png" = 'yes'
then
#
# Check for PNG delegate library.
#
OLD_CPPFLAGS=$CPPFLAGS
OLD_LDFLAGS=$LDFLAGS
OLD_LIBS=$LIBS
failed=0
passed=0
PKG_CHECK_MODULES([PNG], [libpng], [passed=`expr $passed + 1`], [failed=`expr $failed + 1`])
if test $failed -eq 0 ; then
if test -n "$VERBOSE"
then
printf "PNG_LIBS=${PNG_LIBS}\n"
printf "PNG_CFLAGS=${PNG_CFLAGS}\n"
fi
pkg_config_to_flags 'libpng' "${PNG_LIBS}" "${PNG_CFLAGS}"
else
if test -n "${PNG_PKG_ERRORS}"
then
printf "${PNG_PKG_ERRORS}\n"
fi
failed=0
fi
if test "$with_png" != 'yes'; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-png=$with_png "
fi
if test "$with_png" != 'no' ; then
AC_MSG_CHECKING([for PNG support ])
AC_MSG_RESULT()
AC_CHECK_HEADER([png.h],[passed=`expr $passed + 1`],
[failed=`expr $failed + 1`],)
if test $passed -gt 0; then
for var in 7 6 5 4 2 '' ; do
if test "x${var}" = 'x' ; then
pnglib='png'
else
pnglib="png1${var}"
fi
if test "$have_png" = 'no'
then
# Test for compatible LIBPNG library
failed=0
passed=0
if test "$with_png" = 'yes' -o "$with_png" = "libpng1${var}" ; then
if test "${pnglib}" != 'png' ; then
AC_MSG_CHECKING([for LIBPNG1${var} support ])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
#include <stdlib.h>
#include <png.h>
]],
[[#if PNG_LIBPNG_VER_MINOR != ${var}
#error LIBPNG library must be version 1${var}!
Kaboom, Kaboom
#endif
return 0;
]])],[ac_cv_libpng_ok='yes'],[ac_cv_libpng_ok='no'])
if test "$ac_cv_libpng_ok" = 'yes' ; then
passed=`expr $passed + 1`
AC_MSG_RESULT([yes])
else
failed=`expr $failed + 1`
AC_MSG_RESULT([no])
fi
else
passed=`expr $passed + 1`
AC_MSG_RESULT([yes])
fi
fi
if test $passed -gt 0 -a $failed -le 0
then
if test "1${var}" = '15' ; then
AC_CHECK_LIB([png15],[png_get_io_ptr],[passed=`expr $passed + 1`],
[failed=`expr $failed + 1`],)
AC_CHECK_LIB([png15],[png_longjmp],[passed=`expr $passed + 1`],
[failed=`expr $failed + 1`],)
fi
if test "1${var}" = '14' ; then
AC_CHECK_LIB([png14],[png_get_io_ptr],[passed=`expr $passed + 1`],
[failed=`expr $failed + 1`],)
AC_CHECK_LIB([png14],[png_get_io_state],[passed=`expr $passed + 1`],
[failed=`expr $failed + 1`],)
fi
if test "1${var}" = '12' ; then
AC_CHECK_LIB([png12],[png_get_io_ptr],[passed=`expr $passed + 1`],
[failed=`expr $failed + 1`],)
fi
if test "1${var}" = '1' ; then
AC_CHECK_LIB([png],[png_get_io_ptr],[passed=`expr $passed + 1`],
[failed=`expr $failed + 1`],)
fi
if test $passed -gt 0 -a $failed -le 0 ; then
AC_MSG_CHECKING([if ${pnglib} package is complete])
if test $passed -gt 0 ; then
if test $failed -gt 0 ; then
AC_MSG_RESULT([no -- some components failed test])
have_png='no (failed tests)'
CPPFLAGS=$OLD_CPPFLAGS
LDFLAGS=$OLD_LDFLAGS
LIBS=$OLD_LIBS
else
LIB_PNG="-l${pnglib}"
pkg_config_to_flags 'libpng' "${LIB_PNG}" ''
#LIBS="$LIB_PNG $LIBS"
AC_DEFINE([HasPNG],[1],[Define if you have PNG library])
AC_MSG_RESULT([yes])
have_png='yes'
fi
fi
fi
fi
fi
done
fi
fi
else
AC_MSG_RESULT([PNG requires zlib support])
fi
AM_CONDITIONAL([HasPNG],[test "$have_png" = 'yes'])
AC_SUBST([LIB_PNG])
#
# Check for JPEG
#
have_jpeg='no'
LIB_JPEG=''
if test "$with_jpeg" != 'no'
then
AC_MSG_CHECKING([for JPEG support ])
AC_MSG_RESULT()
OLD_CPPFLAGS=$CPPFLAGS
OLD_LDFLAGS=$LDFLAGS
OLD_LIBS=$LIBS
failed=0
passed=0
#PKG_CHECK_MODULES([JPEG], [libturbojpeg, libjpeg], [passed=`expr $passed + 1`], [failed=`expr $failed + 1`])
PKG_CHECK_MODULES([JPEG], [libturbojpeg], [passed=`expr $passed + 1`],
[PKG_CHECK_MODULES([JPEG], [libjpeg], [passed=`expr $passed + 1`],
[failed=`expr $failed + 1`])])
if test $failed -eq 0 ; then
if test -n "$VERBOSE"
then
printf "JPEG_LIBS=${JPEG_LIBS}\n"
printf "JPEG_CFLAGS=${JPEG_CFLAGS}\n"
fi
pkg_config_to_flags 'libjpeg' "${JPEG_LIBS}" "${JPEG_CFLAGS}"
else
if test -n "${JPEG_PKG_ERRORS}"
then
printf "${JPEG_PKG_ERRORS}\n"
fi
failed=0
fi
AC_CHECK_HEADER([jconfig.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_HEADER([jerror.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_HEADER([jmorecfg.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_HEADER([jpeglib.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_LIB([jpeg],[jpeg_read_header],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_MSG_CHECKING([if JPEG package is complete])
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT([no -- some components failed test])
have_jpeg='no (failed tests)'
CPPFLAGS=$OLD_CPPFLAGS
LDFLAGS=$OLD_LDFLAGS
LIBS=$OLD_LIBS
else
LIB_JPEG='-ljpeg'
pkg_config_to_flags 'libjpeg' "${LIB_JPEG}" ''
#LIBS="$LIB_JPEG $LIBS"
AC_DEFINE([HasJPEG],[1],[Define if you have JPEG library])
AC_MSG_RESULT([yes])
have_jpeg='yes'
# Test for interesting libjpeg-turbo 3.0 and libjpeg functions)
AC_CHECK_FUNCS([jpeg_enable_lossless jpeg12_write_scanlines jpeg16_write_scanlines \
jpeg12_read_scanlines jpeg16_read_scanlines \
jpeg_simple_lossless jpeg_enable_lossless])
fi
else
AC_MSG_RESULT([no])
fi
fi
AM_CONDITIONAL([HasJPEG],[test "$have_jpeg" = 'yes'])
AC_SUBST([LIB_JPEG])
# #
# # Check for MPEG2 library
# #
# have_mpeg2='no'
# LIB_MPEG2=''
# if test "$with_mpeg2" != 'no'
# then
# AC_MSG_CHECKING([for MPEG version 2 support ])
# AC_MSG_RESULT()
# failed=0
# passed=0
# AC_CHECK_HEADER([mpeg2dec/mpeg2.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
# AC_CHECK_LIB([mpeg2],[mpeg2_decode_data],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
# AC_MSG_CHECKING([if MPEG version 2 support package is complete])
# if test $passed -gt 0
# then
# if test $failed -gt 0
# then
# AC_MSG_RESULT([no -- some components failed test])
# have_mpeg2='no (failed tests)'
# else
# LIB_MPEG2='-lmpeg2'
# LIBS="$LIB_MPEG2 $LIBS"
# AC_DEFINE([HasMPEG2],[1],[Define if you have MPEG2 library])
# AC_MSG_RESULT([yes])
# have_mpeg2='yes'
# fi
# else
# AC_MSG_RESULT([no])
# fi
# fi
# AM_CONDITIONAL([HasMPEG2],[test "$have_mpeg2" = 'yes'])
# AC_SUBST([LIB_MPEG2])
#
# Check for TTF
#
have_ttf='no'
LIB_TTF=''
if test "$with_ttf" != 'no'
then
AC_MSG_CHECKING([for FreeType 2.0 ])
AC_MSG_RESULT()
failed=0
passed=0
OLD_CPPFLAGS=$CPPFLAGS
OLD_LDFLAGS=$LDFLAGS
OLD_LIBS=$LIBS
# https://autotools.io/pkgconfig/pkg_check_modules.html
# PKG_CHECK_MODULES(prefix, list-of-modules, action-if-found, action-if-not-found)
# % pkg-config --libs freetype2
# -lfreetype
# % pkg-config --cflags freetype2
# -I/usr/include/freetype2 -I/usr/include/libpng12
#
# % grep FREETYPE_ config.status
# S["FREETYPE_LIBS"]="-R/usr/lib -lfreetype "
# S["FREETYPE_CFLAGS"]="-I/usr/include/freetype2
freetype_cflags=''
freeype_libs=''
freetype_config=''
PKG_CHECK_MODULES([FREETYPE], [freetype2], [passed=`expr $passed + 1`], [failed=`expr $failed + 1`])
if test $failed -eq 0 ; then
if test -n "$VERBOSE"
then
printf "FREETYPE_LIBS=${FREETYPE_LIBS}\n"
printf "FREETYPE_CFLAGS=${FREETYPE_CFLAGS}\n"
fi
pkg_config_to_flags 'freetype2' "${FREETYPE_LIBS}" "${FREETYPE_CFLAGS}"
else
if test -n "${FREETYPE_PKG_ERRORS}"
then
printf "${FREETYPE_PKG_ERRORS}\n"
fi
failed=0
fi
dnl First see if there is a library
AC_CHECK_LIB([freetype],[FT_Init_FreeType],[LIB_TTF="-lfreetype"],[LIB_TTF=''],[])
if test "$LIB_TTF" != ''
then
passed=`expr $passed + 1`
else
failed=`expr $failed + 1`
fi
dnl Now test for the headers
# Modern Freetype2 installs require that <ft2build.h> be included
# prior to including any other FreeType2 headers. This header
# produces defines which must be used to include remaining API
# headers.
AC_CHECK_HEADER([ft2build.h],[FT2BUILD_H='#include <ft2build.h>' ; have_freetype_h='yes'],[FT2BUILD_H='' ; have_freetype_h='no'],[])
if test "${FT2BUILD_H}x" = 'x'
then
# Last ditch, test old include style where everything is rooted
# under 'freetype'
AC_CHECK_HEADER([freetype/freetype.h],[have_freetype_h='yes'],[have_freetype_h='no'],)
fi
if test "$have_freetype_h" = 'yes'
then
passed=`expr $passed + 1`
else
failed=`expr $failed + 1`
fi
AC_MSG_CHECKING([if FreeType package is complete])
if test $passed -gt 0
then
if test $failed -gt 0
then
LIB_TTF=''
AC_MSG_RESULT([no -- some components failed test])
have_ttf='no (failed tests)'
FREETYPE_LIBS=''
FREETYPE_CFLAGS=''
CPPFLAGS=$OLD_CPPFLAGS
LDFLAGS=$OLD_LDFLAGS
LIBS=$OLD_LIBS
else
pkg_config_to_flags 'freetype2' "${LIB_TTF}" ''
#LIBS="$LIB_TTF $LIBS"
AC_DEFINE([HasTTF],[1],[Define if you have FreeType (TrueType font) library])
if test "$ac_cv_header_ft2build_h" = 'yes'
then
AC_DEFINE([HAVE_FT2BUILD_H],[1],[Define to 1 if you have the <ft2build.h> header file.])
fi
AC_MSG_RESULT([yes])
have_ttf='yes'
fi
else
AC_MSG_RESULT([no])
fi
fi
AM_CONDITIONAL([HasTTF],[test "$have_ttf" = 'yes'])
AC_SUBST([LIB_TTF])
#
# Check for WEBP
#
have_webp='no'
LIB_WEBP=''
if test "$with_webp" != 'no'
then
AC_MSG_CHECKING([for WEBP support ])
AC_MSG_RESULT()
OLD_CPPFLAGS=$CPPFLAGS
OLD_LDFLAGS=$LDFLAGS
OLD_LIBS=$LIBS
failed=0
passed=0
# libwebpdemux depends on webp
# libwebpmux depends on webp
# libwebp depends on libsharpyuv
# FIXME: For static build to succeed the link order needs to be
# "-lwebp -lwebpmux -lsharpyuv" but "-lsharpyuv -lwebp -lwebpmux"
# is being produced! Order is reversed! Maybe fixed now.
# WEBPMUX_LIBS=-L/work/lib -lwebpmux -lm -lwebp -lm -lsharpyuv -lm
# WEBP_LIBS=-L/work/lib -lwebp -lm -lsharpyuv -lm
# Need to add libsharp libsharpyuv.pc
# libwebp, libwebpmux, libwebpdemux
PKG_CHECK_MODULES([WEBPMUX], [libwebpmux], [passed=`expr $passed + 1`], [failed=`expr $failed + 1`])
if test $failed -eq 0 ; then
if test -n "$VERBOSE"
then
printf "WEBPMUX_LIBS=${WEBPMUX_LIBS}\n"
printf "WEBPMUX_CFLAGS=${WEBPMUX_CFLAGS}\n"
fi
pkg_config_to_flags 'libwebpmux' "${WEBPMUX_LIBS}" "${WEBPMUX_CFLAGS}"
else
if test -n "${WEBPMUX_PKG_ERRORS}"
then
printf "${WEBPMUX_PKG_ERRORS}\n"
fi
failed=0
fi
# We are not currently using libwebpdemux
#PKG_CHECK_MODULES([WEBPDEMUX], [libwebpdemux], [], [])
#if test $failed -eq 0 ; then
# if test -n "$VERBOSE"
# then
# printf "WEBPDMUX_LIBS=${WEBPDMUX_LIBS}\n"
# printf "WEBPDMUX_CFLAGS=${WEBPDMUX_CFLAGS}\n"
# fi
# pkg_config_to_flags 'libwebpdemux' "${WEBPDMUX_LIBS}" "${WEBPDMUX_CFLAGS}"
#else
# failed=0
#fi
# pkg-config libwebp --static --libs
#-L/work/lib -lwebp -lm -lsharpyuv -lm
PKG_CHECK_MODULES([WEBP], [libwebp], [passed=`expr $passed + 1`], [failed=`expr $failed + 1`])
if test $failed -eq 0 ; then
if test -n "$VERBOSE"
then
printf "WEBP_LIBS=${WEBP_LIBS}\n"
printf "WEBP_CFLAGS=${WEBP_CFLAGS}\n"
fi
pkg_config_to_flags 'libwebp' "${WEBP_LIBS}" "${WEBP_CFLAGS}"
else
if test -n "${WEBP_PKG_ERRORS}"
then
printf "${WEBP_PKG_ERRORS}\n"
fi
failed=0
fi
AC_CHECK_HEADER([webp/decode.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
AC_CHECK_HEADER([webp/encode.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
AC_CHECK_LIB([webp],[WebPDecodeRGB],[passed=`expr $passed + 1`; LIB_WEBP='-lwebp'],[failed=`expr $failed + 1`],[])
AC_CHECK_LIB([webpmux],[WebPMuxSetImage],[LIB_WEBP="$LIB_WEBP -lwebpmux"],[],[-lwebp])
AC_CHECK_LIB([sharpyuv],[SharpYuvConvert],[LIB_WEBP="$LIB_WEBP -lsharpyuv"],[],[])
AC_MSG_CHECKING([if WEBP package is complete])
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT([no -- some components failed test])
have_webp='no (failed tests)'
CPPFLAGS=$OLD_CPPFLAGS
LDFLAGS=$OLD_LDFLAGS
LIBS=$OLD_LIBS
else
pkg_config_to_flags 'libwebp' "${LIB_WEBP}" ''
# LIBS="$LIB_WEBP $LIBS"
AC_DEFINE([HasWEBP],[1],[Define if you have WEBP library])
AC_MSG_RESULT([yes])
have_webp='yes'
fi
else
AC_MSG_RESULT([no])
fi
fi
AM_CONDITIONAL([HasWEBP],[test "$have_webp" = 'yes'])
AC_SUBST([LIB_WEBP])
#
# Check for LIBZIP
#
have_libzip='no'
LIB_ZIP=''
if test "$with_libzip" != 'no'
then
AC_MSG_CHECKING([for libzip support ])
AC_MSG_RESULT()
OLD_CPPFLAGS=$CPPFLAGS
OLD_LDFLAGS=$LDFLAGS
OLD_LIBS=$LIBS
failed=0
passed=0
PKG_CHECK_MODULES([LIBZIP], [libzip], [passed=`expr $passed + 1`], [failed=`expr $failed + 1`])
if test $failed -eq 0
then
if test -n "$VERBOSE"
then
printf "LIBZIP_LIBS=${LIBZIP_LIBS}\n"
printf "LIBZIP_CFLAGS=${LIBZIP_CFLAGS}\n"
fi
pkg_config_to_flags 'libzip' "${LIBZIP_LIBS}" "${LIBZIP_CFLAGS}"
else
if test -n "${LIBZIP_PKG_ERRORS}"
then
printf "${LIBZIP_PKG_ERRORS}\n"
fi
failed=0
fi
AC_CHECK_HEADER([zip.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
AC_CHECK_LIB([zip],[zip_open],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_MSG_CHECKING([if libzip package is complete])
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT([no -- some components failed test])
have_libzip='no (failed tests)'
CPPFLAGS=$OLD_CPPFLAGS
LDFLAGS=$OLD_LDFLAGS
LIBS=$OLD_LIBS
else
pkg_config_to_flags 'libzip' "${LIB_ZIP}" ''
LIB_ZIP='-lzip'
LIBS="$LIB_ZIP $LIBS"
AC_DEFINE([HasLIBZIP],[1],[Define if you have libzip library])
AC_MSG_RESULT([yes])
have_libzip='yes'
fi
else
AC_MSG_RESULT([no])
fi
fi
AM_CONDITIONAL([HasLIBZIP],[test "$have_libzip" = 'yes'])
AC_SUBST([LIB_ZIP])
#
# Check for JBIG
#
have_jbig='no'
LIB_JBIG=''
if test "$with_jbig" != 'no'
then
AC_MSG_CHECKING([for JBIG support ])
AC_MSG_RESULT()
failed=0
passed=0
AC_CHECK_HEADER([jbig.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_LIB([jbig],[jbg_dec_init],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_MSG_CHECKING([if JBIG package is complete])
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT([no -- some components failed test])
have_jbig='no (failed tests)'
else
LIB_JBIG='-ljbig'
LIBS="$LIB_JBIG $LIBS"
AC_DEFINE([HasJBIG],[1],[Define if you have JBIG library])
AC_MSG_RESULT([yes])
have_jbig='yes'
fi
else
AC_MSG_RESULT([no])
fi
fi
AM_CONDITIONAL([HasJBIG],[test "$have_jbig" = 'yes'])
AC_SUBST([LIB_JBIG])
#
# Check for TIFF
#
have_tiff='no'
LIB_TIFF=''
if test "$with_tiff" != 'no'
then
AC_MSG_CHECKING([for TIFF support ])
AC_MSG_RESULT()
failed=0
passed=0
# CFLAGS CPPFLAGS CXXFLAGS DEFS LDFLAGS LIBS
OLD_CFLAGS=$CFLAGS
OLD_CPPFLAGS=$CPPFLAGS
OLD_LIBS=$LIBS
PKG_CHECK_MODULES([TIFF], [libtiff-4], [passed=`expr $passed + 1`], [failed=`expr $failed + 1`])
#set -x
if test $failed -eq 0
then
if test -n "$VERBOSE"
then
printf "TIFF_LIBS=${TIFF_LIBS}\n"
printf "TIFF_CFLAGS=${TIFF_CFLAGS}\n"
fi
pkg_config_to_flags 'libtiff-4' "${TIFF_LIBS}" "${TIFF_CFLAGS}"
else
if test -n "${TIFF_PKG_ERRORS}"
then
printf "${TIFF_PKG_ERRORS}\n"
fi
failed=0
fi
#set +x
AC_CHECK_HEADER([tiff.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_HEADER([tiffio.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_LIB([tiff],[TIFFOpen],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_CHECK_LIB([tiff],[TIFFClientOpen],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_CHECK_LIB([tiff],[TIFFIsByteSwapped],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_CHECK_LIB([tiff],[TIFFReadRGBATile],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_CHECK_LIB([tiff],[TIFFReadRGBAStrip],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_MSG_CHECKING([if TIFF package is complete])
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT([no -- some components failed test])
have_tiff='no (failed tests)'
CFLAGS=$OLD_CFLAGS
CPPFLAGS=$OLD_CPPFLAGS
LIBS=$OLD_LIBS
else
LIB_TIFF='-ltiff'
pkg_config_to_flags 'libtiff-4' "${LIB_TIFF}" ''
#LIBS="$LIB_TIFF $LIBS"
AC_DEFINE([HasTIFF],[1],[Define if you have TIFF library])
AC_MSG_RESULT([yes])
have_tiff='yes'
AC_CHECK_HEADERS([tiffconf.h])
AC_CHECK_FUNCS([TIFFIsCODECConfigured \
TIFFMergeFieldInfo \
TIFFSetErrorHandlerExt \
TIFFSetTagExtender \
TIFFSetWarningHandlerExt \
TIFFSwabArrayOfTriples])
fi
else
AC_MSG_RESULT([no])
fi
fi
AM_CONDITIONAL([HasTIFF], [test "$have_tiff" = 'yes'])
AC_SUBST([LIB_TIFF])
#
# Check for JXL
#
have_jxl='no'
LIB_JXL=''
if test "$with_jxl" != 'no'
then
AC_MSG_CHECKING([for JXL support ])
AC_MSG_RESULT()
OLD_CPPFLAGS=$CPPFLAGS
OLD_LDFLAGS=$LDFLAGS
OLD_LIBS=$LIBS
failed=0
passed=0
AC_LANG_PUSH([C++])
# For dynamic linkage, it should not normally be necessary to test for more than libjxl
# libjxl, libjxl_threads, libhwy, libbrotlidec, libbrotlienc, libbrotlicommon
# libjxl needs libhwy to build but it is built as a static library so is not a dynamic dependency
#
# pkg-config --static --libs libjxl
# -L/usr/local/lib -ljxl -lm -lhwy -lbrotlienc -lbrotlidec -lbrotlicommon
# libjxl_threads
PKG_CHECK_MODULES([LIBJXL_THREADS], [libjxl_threads], [passed=`expr $passed + 1`], [failed=`expr $failed + 1`])
if test $failed -eq 0
then
if test -n "$VERBOSE"
then
printf "LIBJXL_THREADS_LIBS=${LIBJXL_THREADS_LIBS}\n"
printf "LIBJXL_THREADS_CFLAGS=${LIBJXL_THREADS_CFLAGS}\n"
fi
pkg_config_to_flags 'libjxl_threads' "${LIBJXL_THREADS_LIBS}" "${LIBJXL_THREADS_CFLAGS}"
else
if test -n "${LIBJXL_THREADS_PKG_ERRORS}"
then
printf "${LIBJXL_THREADS_PKG_ERRORS}\n"
fi
failed=0
fi
# [libjxl
PKG_CHECK_MODULES([LIBJXL], [libjxl], [passed=`expr $passed + 1`], [failed=`expr $failed + 1`])
if test $failed -eq 0
then
if test -n "$VERBOSE"
then
printf "LIBJXL_LIBS=${LIBJXL_LIBS}\n"
printf "LIBJXL_CFLAGS=${LIBJXL_CFLAGS}\n"
fi
pkg_config_to_flags 'libjxl' "${LIBJXL_LIBS}" "${LIBJXL_CFLAGS}"
else
if test -n "${LIBJXL_PKG_ERRORS}"
then
printf "${LIBJXL_PKG_ERRORS}\n"
fi
failed=0
fi
AC_CHECK_HEADER([jxl/decode.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
# jxl always requires hwy/brotli no extra test needed
AC_CHECK_LIB([jxl],[JxlDecoderCreate],[passed=`expr $passed + 1`; LIB_JXL='-ljxl'],[failed=`expr $failed + 1`],[-lhwy -lbrotlidec -lbrotlienc -lbrotlicommon])
AC_CHECK_LIB([jxl_threads],[JxlThreadParallelRunnerCreate],[passed=`expr $passed + 1`; LIB_JXL="${LIB_JXL} -ljxl_threads"],[])
# Testing for decoder should also cover encoder
AC_CHECK_LIB([brotlidec],[BrotliDecoderVersion],[passed=`expr $passed + 1`; LIB_JXL="${LIB_JXL} -lbrotlidec -lbrotlicommon"],[failed=`expr $failed + 1`],[-lbrotlicommon])
AC_LANG_POP
AC_MSG_CHECKING([if JXL package is complete])
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT([no -- some components failed test])
have_jxl='no (failed tests)'
CPPFLAGS=$OLD_CPPFLAGS
LDFLAGS=$OLD_LDFLAGS
LIBS=$OLD_LIBS
else
# JXL is a C++ Lib so it requires linking with stdc++. This
# is handled by inserting a C++ dummy shim file when JXL is
# part of the build.
if test -n "${LIBJXL_LIBS}"
then
# Use pkg-config info
LIB_JXL=''
for token in ${LIBJXL_LIBS} ${LIBJXL_THREADS_LIBS}
do
case $token in
-l*)
LIB_JXL="$LIB_JXL $token"
;;
esac
done
else
# Without pkg-config, use LIB_JXL we built via testing
pkg_config_to_flags 'libjxl' "${LIB_JXL}" ''
fi
#LIBS="$LIB_JXL $LIBS"
AC_DEFINE([HasJXL],[1],[Define if you have JXL library])
AC_MSG_RESULT([yes])
have_jxl='yes'
PERLMAINCC="$CXX"
fi
else
AC_MSG_RESULT([no])
fi
fi
AM_CONDITIONAL([HasJXL],[test "$have_jxl" = 'yes'])
AC_SUBST([LIB_JXL])
#
# Check for WMF (no pkg-config support!)
#
# We require libwmflite and now refuse to use full libwmf. Typical
# dependencies for libwmflite are '-lpthread -lm' (which we already
# usually depend on) whereas full libwmf has a great many
# dependencies.
#
have_wmf='no'
LIB_WMF=''
LIB_WMF_DEPS=''
OLD_LIBS="$LIBS"
if test "$with_wmf" != 'no'
then
AC_MSG_CHECKING([for WMF support ])
AC_MSG_RESULT([])
have_libwmflite='no'
have_libwmf_ipa_h='no'
AC_CHECK_HEADER([libwmf/ipa.h],[have_libwmf_ipa_h='yes'],[],[$FT2BUILD_H])
if test "$have_libwmf_ipa_h" = 'yes'
then
AC_CHECK_LIB([wmflite],[wmf_lite_create],[have_libwmflite='yes'],[],[])
if test "$have_libwmflite" = 'yes'
then
AC_DEFINE([HasWMFlite],[1],[Define if you have wmflite library])
LIB_WMF='-lwmflite'
LIBS="$LIB_WMF $LIBS"
have_wmf='yes'
else
AC_MSG_RESULT([no -- some components failed test])
have_wmf='no (failed tests)'
have_wmflite='no (failed tests)'
LIBS="$OLD_LIBS"
LIB_WMF=''
fi
fi
fi
AC_MSG_CHECKING([if WMF package is complete ])
if test "$have_wmf" = 'yes'
then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL([HasWMF], [test "$have_wmf" = 'yes'])
AC_SUBST([LIB_WMF])
AC_SUBST([LIB_WMF_DEPS])
# Check for HEIF
#
have_heif='no'
LIB_HEIF=''
if test "$with_heif" != 'no'
then
AC_MSG_CHECKING([for HEIF support ])
AC_MSG_RESULT()
OLD_CPPFLAGS=$CPPFLAGS
OLD_LDFLAGS=$LDFLAGS
OLD_LIBS=$LIBS
failed=0
passed=0
# Use pkg-config to handle different optional codec libs
# and if pkg-config is not available fallback to manual search.
#
# pkg-config --libs libheif
# -lheif
# pkg-config --cflags libheif
# nada
PKG_CHECK_MODULES([HEIF], [libheif], [passed=`expr $passed + 1`], [failed=`expr $failed + 1`])
if test $failed -eq 0 ; then
if test -n "$VERBOSE"
then
printf "HEIF_LIBS=${HEIF_LIBS}\n"
printf "HEIF_CFLAGS=${HEIF_CFLAGS}\n"
fi
pkg_config_to_flags 'libheif' "${HEIF_LIBS}" "${HEIF_CFLAGS}"
else
if test -n "${HEIF_PKG_ERRORS}"
then
printf "${HEIF_PKG_ERRORS}\n"
fi
failed=0
fi
AC_CHECK_HEADER([libheif/heif.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_LIB([heif],[heif_context_alloc],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[${HEIF_LIBS}])
AC_CHECK_FUNCS([heif_init heif_deinit heif_context_set_maximum_image_size_limit])
AC_MSG_CHECKING([if HEIF package is complete])
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT([no -- some components failed test])
have_heif='no (failed tests)'
CPPFLAGS=$OLD_CPPFLAGS
LDFLAGS=$OLD_LDFLAGS
LIBS=$OLD_LIBS
LIB_HEIF=''
else
LIB_HEIF='-lheif'
pkg_config_to_flags 'libheif' "${LIB_HEIF}" ''
#LIBS="$LIB_HEIF $LIBS"
AC_DEFINE([HasHEIF],[1],[Define if you have HEIF library])
AC_MSG_RESULT([yes])
have_heif='yes'
fi
else
AC_MSG_RESULT([no])
fi
fi
AM_CONDITIONAL([HasHEIF],[test "$have_heif" = 'yes'])
AC_SUBST([LIB_HEIF])
#
# Check for JPEG Version 2 (Jasper)
#
have_jp2='no'
LIB_JP2=''
if test "$with_jp2" != 'no'
then
AC_MSG_CHECKING([for JPEG version 2 "Jasper" support ])
AC_MSG_RESULT()
OLD_CPPFLAGS=$CPPFLAGS
OLD_LDFLAGS=$LDFLAGS
OLD_LIBS=$LIBS
failed=0
passed=0
PKG_CHECK_MODULES([JASPER], [jasper], [passed=`expr $passed + 1`], [failed=`expr $failed + 1`])
if test $failed -eq 0 ; then
if test -n "$VERBOSE"
then
printf "JASPER_LIBS=${JASPER_LIBS}\n"
printf "JASPER_CFLAGS=${JASPER_CFLAGS}\n"
fi
pkg_config_to_flags 'jasper' "${JASPER_LIBS}" "${JASPER_CFLAGS}"
else
if test -n "${JASPER_PKG_ERRORS}"
then
printf "${JASPER_PKG_ERRORS}\n"
fi
failed=0
fi
AC_CHECK_HEADER([jasper/jasper.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_LIB([jasper],[jas_stream_fopen],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_CHECK_LIB([jasper],[jas_image_strtofmt],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_CHECK_LIB([jasper],[jas_image_decode],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_MSG_CHECKING([if JPEG version 2 support package is complete])
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT([no -- some components failed test])
have_jp2='no (failed tests)'
CPPFLAGS=$OLD_CPPFLAGS
LDFLAGS=$OLD_LDFLAGS
LIBS=$OLD_LIBS
else
LIB_JP2='-ljasper'
pkg_config_to_flags 'jasper' "${LIB_JP2}" ''
#LIBS="$LIB_JP2 $LIBS"
AC_DEFINE([HasJP2],[1],[Define if you have JPEG version 2 "Jasper" library])
AC_MSG_RESULT([yes])
have_jp2='yes'
AC_CHECK_FUNCS([jas_init_library])
fi
else
AC_MSG_RESULT([no])
fi
fi
AM_CONDITIONAL([HasJP2],[test "$have_jp2" = 'yes'])
AC_SUBST([LIB_JP2])
#
# Check for Windows gdi32/user32 libraries (for Windows clipboard support)
#
have_gdi32='no'
if test "$with_gdi32" != 'no'
then
LIB_GDI32=''
AC_MSG_CHECKING([for Windows GDI32 support])
AC_MSG_RESULT()
failed=0
passed=0
#found_libuser32=0
#found_libgdi32=0
AC_CHECK_HEADER([windows.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_HEADER([winuser.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[#include <windows.h>])
AC_CHECK_HEADER([wingdi.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[#include <windows.h>])
# For some reason MSYS2 and Cygwin i686 build fails library tests.
#AC_CHECK_LIB([user32],[OpenClipboard],[found_libuser32=`expr $found_libuser32 + 1`],[],[])
#AC_CHECK_LIB([gdi32],[CreateDIBSection],[found_libgdi32=`expr $found_libgdi32 + 1`],[],[])
#if test $found_libuser32 -gt 0 -a $found_libgdi32 -gt 0
#then
# passed=`expr $passed + 1`
#else
# failed=`expr $failed + 1`
#fi
if test "$cygwin_build" = yes -o "$native_win32_build" = yes
then
passed=`expr $passed + 1`
fi
AC_MSG_CHECKING([if Windows GDI32 support is complete])
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT([no -- some components failed test])
have_gdi32='no (failed tests)'
else
LIB_GDI32='-lgdi32 -luser32'
LIBS="$LIB_GDI32 $LIBS"
AC_DEFINE([HasWINGDI32],[1],[Define to use the Windows GDI32 library])
AC_MSG_RESULT([yes])
have_gdi32='yes'
fi
else
AC_MSG_RESULT([no])
fi
fi
AM_CONDITIONAL([HasWINGDI32], [test "$have_gdi32" = 'yes'])
AC_SUBST([LIB_GDI32])
########
#
# Check for functions
#
########
GM_FUNC_MMAP_FILEIO
AC_CHECK_FUNCS([atoll CryptGenRandom \
clock_getres clock_gettime ctime_r cosf _exit fabsf fcntl fstatvfs ftime getexecname \
getc_unlocked getpagesize getpwnam_r getrlimit getpid lltostr localtime_r logf madvise \
_NSGetExecutablePath _pclose pclose poll _popen popen posix_fadvise \
posix_fallocate posix_madvise posix_memalign posix_spawnp pread pwrite \
putc_unlocked raise rand_r readdir_r readlink realpath select seekdir \
setrlimit sigemptyset sigaction sinf spawnvp strerror strerror_r strlcat strlcpy \
strtoll sqrtf sysconf times telldir ulltostr vsprintf vsnprintf qsort_r])
#
# Substitute compiler name to build/link PerlMagick
#
AC_SUBST([PERLMAINCC])
#
# Configure install Paths
#
# Subdirectory under lib to place GraphicsMagick lib files
MagickLibSubdir="${PACKAGE_NAME}-${PACKAGE_VERSION}"
AC_DEFINE_UNQUOTED([MagickLibSubdir],["$MagickLibSubdir"],[Subdirectory of lib where GraphicsMagick architecture dependent files are installed])
# Path to GraphicsMagick bin directory
MagickBinPath="${BIN_DIR}"
MagickBinPathDefine="${MagickBinPath}/"
case "${build_os}" in
mingw* )
MagickBinPathDefine=`$WinPathScript "$MagickBinPathDefine" 1`
;;
esac
AC_DEFINE_UNQUOTED([MagickBinPath],["$MagickBinPathDefine"],[Directory where executables are installed.])
AC_SUBST([MagickBinPath])
# Path to GraphicsMagick lib
MagickLibPath="${LIB_DIR}/${MagickLibSubdir}"
MagickLibPathDefine="${MagickLibPath}/"
case "${build_os}" in
mingw* )
MagickLibPathDefine=`$WinPathScript "$MagickLibPathDefine" 1`
;;
esac
AC_DEFINE_UNQUOTED([MagickLibPath],["$MagickLibPathDefine"],[Directory where architecture-dependent files live.])
AC_SUBST([MagickLibPath])
# Subdirectory under lib to place GraphicsMagick configuration files
MagickLibConfigSubDir="${MagickLibSubdir}/config"
AC_DEFINE_UNQUOTED([MagickLibConfigSubDir],["$MagickLibConfigSubDir"],[Subdirectory of lib where architecture-dependent configuration files live.])
MagickLibConfigPath="${LIB_DIR}/${MagickLibConfigSubDir}"
MagickLibConfigPathDefine="${MagickLibConfigPath}/"
case "${build_os}" in
mingw* )
MagickLibConfigPathDefine=`$WinPathScript "$MagickLibConfigPathDefine" 1`
;;
esac
AC_DEFINE_UNQUOTED([MagickLibConfigPath],["$MagickLibConfigPathDefine"],[Directory where architecture-dependent configuration files live.])
AC_SUBST([MagickLibConfigPath])
#
# Subdirectory under lib to place GraphicsMagick coder module files
MagickCoderModulesSubdir="${MagickLibSubdir}/modules-Q${QuantumDepth}/coders"
AC_DEFINE_UNQUOTED([MagickCoderModulesSubdir],["$MagickCoderModulesSubdir"],[Subdirectory of lib where coder modules are installed])
MagickCoderModulesPath="${LIB_DIR}/${MagickCoderModulesSubdir}"
MagickCoderModulesPathDefine="${MagickCoderModulesPath}/"
case "${build_os}" in
mingw* )
MagickCoderModulesPathDefine=`$WinPathScript "$MagickCoderModulesPathDefine" 1`
;;
esac
AC_DEFINE_UNQUOTED([MagickCoderModulesPath],["$MagickCoderModulesPathDefine"],[Location of coder modules])
AC_SUBST([MagickCoderModulesPath])
#
# Subdirectory under lib to place GraphicsMagick filter module files
MagickFilterModulesSubdir="${MagickLibSubdir}/modules-Q${QuantumDepth}/filters"
AC_DEFINE_UNQUOTED([MagickFilterModulesSubdir],["$MagickFilterModulesSubdir"],[Subdirectory of lib where filter modules are installed])
MagickFilterModulesPath="${LIB_DIR}/${MagickFilterModulesSubdir}"
MagickFilterModulesPathDefine="${MagickFilterModulesPath}/"
case "${build_os}" in
mingw* )
MagickFilterModulesPathDefine=`$WinPathScript "$MagickFilterModulesPathDefine" 1`
;;
esac
AC_DEFINE_UNQUOTED([MagickFilterModulesPath],["$MagickFilterModulesPathDefine"],[Location of filter modules])
AC_SUBST([MagickFilterModulesPath])
#
# Path to GraphicsMagick share files
MagickShareSubdir="${PACKAGE_NAME}-${PACKAGE_VERSION}"
MagickSharePath="${DATA_DIR}/${MagickShareSubdir}"
MagickSharePathDefine="${MagickSharePath}/"
case "${build_os}" in
mingw* )
MagickSharePathDefine=`$WinPathScript "$MagickSharePathDefine" 1`
;;
esac
AC_DEFINE_UNQUOTED([MagickSharePath],["$MagickSharePathDefine"],[Directory where architecture-independent files live.])
AC_SUBST([MagickSharePath])
# Subdirectory under share to place GraphicsMagick configuration files
MagickShareConfigSubDir="${MagickLibSubdir}/config"
AC_DEFINE_UNQUOTED([MagickShareConfigSubDir],["$MagickShareConfigSubDir"],[Subdirectory of lib where architecture-independent configuration files live.])
MagickShareConfigPath="${DATA_DIR}/${MagickShareConfigSubDir}"
MagickShareConfigPathDefine="${MagickShareConfigPath}/"
case "${build_os}" in
mingw* )
MagickShareConfigPathDefine=`$WinPathScript "$MagickShareConfigPathDefine" 1`
;;
esac
AC_DEFINE_UNQUOTED([MagickShareConfigPath],["$MagickShareConfigPathDefine"],[Directory where architecture-independent configuration files live.])
AC_SUBST([MagickShareConfigPath])
# Extra options to pass to dcraw via delegates.mgk. This substition
# is done directly on delegates.mgk and has no effect on the compiled
# binaries.
DcrawExtraOptions=''
# Request 16-bit output from dcraw if QuantumDepth is > 8
if test $QuantumDepth -gt 8 ; then
DcrawExtraOptions='-6'
fi
# Request TIFF output (including metadata) from dcraw if we can read TIFF
if test "$have_tiff" = 'yes' ; then
DcrawExtraOptions="$DcrawExtraOptions -T"
fi
DcrawExtraOptions=`echo $DcrawExtraOptions | sed -e 's/ */ /g'`
AC_SUBST([DcrawExtraOptions])
#
# program_transform_name is formed for use in a Makefile, so create a
# modified version for use in a shell script.
configure_transform_name=`echo ${program_transform_name} | sed 's,\\$\\$,$,'`
# Default delegate definitions
dnl AutotraceDecodeDelegateDefault='autotrace'
dnl BZIPDelegateDefault='bzip2'
BrowseDelegateDefault='xdg-open'
CGMDecodeDelegateDefault='ralcgm'
dnl CatDelegateDefault='cat'
DCRAWDecodeDelegateDefault='dcraw'
DOTDecodeDelegateDefault='dot'
DVIDecodeDelegateDefault='dvips'
dnl EchoDelegateDefault='echo'
EditorDelegateDefault='xterm'
FIGDecodeDelegateDefault='fig2dev'
GMDelegateDefault=`echo gm | sed ${configure_transform_name}`
dnl GnuplotDecodeDelegateDefault='gnuplot'
HPGLDecodeDelegateDefault='hp2xx'
HTMLDecodeDelegateDefault='html2ps'
ILBMDecodeDelegateDefault='ilbmtoppm'
ILBMEncodeDelegateDefault='ppmtoilbm'
LPDelegateDefault='lp'
LPRDelegateDefault='lpr'
LaunchDelegateDefault='gimp'
dnl MANDelegateDefault='groff'
MPEGDecodeDelegateDefault='mpeg2decode'
MPEGEncodeDelegateDefault='mpeg2encode'
MVDelegateDefault='mv'
dnl PGPDecodeDelegateDefault='pgpv'
dnl POVDelegateDefault='povray'
if test "$with_gs" = 'yes' ; then
if test "$native_win32_build" = 'yes' ; then
PSDelegateDefault='gswin32c'
else
PSDelegateDefault='gs'
fi
else
PSDelegateDefault='false'
fi
dnl RADDecodeDelegateDefault='ra_ppm'
dnl RLEEncodeDelegateDefault='rawtorle'
dnl RMDelegateDefault='rm'
dnl SCANDecodeDelegateDefault='scanimage'
dnl TXTDelegateDefault='enscript'
dnl WMFDecodeDelegateDefault='wmf2eps'
dnl WWWDecodeDelegateDefault='wget'
dnl ZipDelegateDefault='gzip'
# Search for delegates
dnl AC_PATH_PROG(AutotraceDecodeDelegate, "$AutotraceDecodeDelegateDefault", "$AutotraceDecodeDelegateDefault")
dnl AC_PATH_PROG(BZIPDelegate, "$BZIPDelegateDefault", "$BZIPDelegateDefault")
AC_PATH_PROGS([BrowseDelegate], ["$BrowseDelegateDefault" firefox konqueror google-chrome mozilla lynx], ["$BrowseDelegateDefault"])
AC_PATH_PROG([CGMDecodeDelegate], ["$CGMDecodeDelegateDefault"], ["$CGMDecodeDelegateDefault"])
dnl AC_PATH_PROG([CatDelegate], ["$CatDelegateDefault"], ["$CatDelegateDefault"])
AC_PATH_PROG([DCRAWDecodeDelegate], ["$DCRAWDecodeDelegateDefault"], ["$DCRAWDecodeDelegateDefault"])
AC_PATH_PROG([DOTDecodeDelegate], ["$DOTDecodeDelegateDefault"], ["$DOTDecodeDelegateDefault"])
AC_PATH_PROG([DVIDecodeDelegate], ["$DVIDecodeDelegateDefault"], ["$DVIDecodeDelegateDefault"])
dnl AC_PATH_PROG([EchoDelegate], ["$EchoDelegateDefault"], ["$EchoDelegateDefault"])
AC_PATH_PROG([EditorDelegate], ["$EditorDelegateDefault"], ["$EditorDelegateDefault"])
AC_PATH_PROG([FIGDecodeDelegate], ["$FIGDecodeDelegateDefault"], ["$FIGDecodeDelegateDefault"])
AC_PATH_PROG([GMDelegate], ["$GMDelegateDefault"], ["$GMDelegateDefault"])
dnl AC_PATH_PROG([GnuplotDecodeDelegate], [$GnuplotDecodeDelegateDefault"], ["$GnuplotDecodeDelegateDefault"])
AC_PATH_PROG([HPGLDecodeDelegate], ["$HPGLDecodeDelegateDefault"], ["$HPGLDecodeDelegateDefault"])
AC_PATH_PROG([HTMLDecodeDelegate], ["$HTMLDecodeDelegateDefault"], ["$HTMLDecodeDelegateDefault"])
AC_PATH_PROG([ILBMDecodeDelegate], ["$ILBMDecodeDelegateDefault"], ["$ILBMDecodeDelegateDefault"])
AC_PATH_PROG([ILBMEncodeDelegate], ["$ILBMEncodeDelegateDefault"], ["$ILBMEncodeDelegateDefault"])
AC_PATH_PROG([LPDelegate], ["$LPDelegateDefault"], [no])
AC_PATH_PROG([LPRDelegate], ["$LPRDelegateDefault"], [no])
AC_PATH_PROG([LaunchDelegate], ["$LaunchDelegateDefault"], ["$LaunchDelegateDefault"])
dnl AC_PATH_PROG(MANDelegate, "$MANDelegateDefault", "$MANDelegateDefault")
AC_PATH_PROG([MPEGDecodeDelegate], ["$MPEGDecodeDelegateDefault"], ["$MPEGDecodeDelegateDefault"])
AC_PATH_PROG([MPEGEncodeDelegate], ["$MPEGEncodeDelegateDefault"], ["$MPEGEncodeDelegateDefault"])
AC_PATH_PROG([MVDelegate], ["$MVDelegateDefault"], ["$MVDelegateDefault"])
dnl AC_PATH_PROG([PGPDecodeDelegate], ["$PGPDecodeDelegateDefault"], ["$PGPDecodeDelegateDefault"])
dnl AC_PATH_PROG([POVDelegate], ["$POVDelegateDefault"], ["$POVDelegateDefault"])
if test "$with_gs" = 'yes' ; then
AC_PATH_PROG([PSDelegate], ["$PSDelegateDefault"], ["$PSDelegateDefault"])
else
PSDelegate=$PSDelegateDefault
fi
dnl AC_PATH_PROG(RADDecodeDelegate, "$RADDecodeDelegateDefault", "$RADDecodeDelegateDefault")
dnl AC_PATH_PROG(RLEEncodeDelegate, "$RLEEncodeDelegateDefault", "$RLEEncodeDelegateDefault")
dnl AC_PATH_PROG(RMDelegate, "$RMDelegateDefault", "$RMDelegateDefault")
dnl AC_PATH_PROG(SCANDecodeDelegate, "$SCANDecodeDelegateDefault", "$SCANDecodeDelegateDefault")
dnl AC_PATH_PROG(TXTDelegate, "$TXTDelegateDefault", "$TXTDelegateDefault")
dnl AC_PATH_PROG(WMFDecodeDelegate, "$WMFDecodeDelegateDefault", "$WMFDecodeDelegateDefault")
dnl AC_PATH_PROG(WWWDecodeDelegate, "$WWWDecodeDelegateDefault", "$WWWDecodeDelegateDefault")
dnl AC_PATH_PROG(ZipDelegate, "$ZipDelegateDefault", "$ZipDelegateDefault")
# Prefer lpr to lp; lp needs options tacked on.
if test "$LPRDelegate" != no
then
PrintDelegate="$LPRDelegate"
else
PrintDelegate="$LPDelegate -c -s"
fi
AC_SUBST([PrintDelegate])
# Installed GraphicsMagick utiltity paths
GMDelegate="${BIN_DIR}/${GMDelegateDefault}"
# Set delegate booleans
have_fig2dev='no' ; if test "$FIGDecodeDelegate" != "$FIGDecodeDelegateDefault" ; then have_fig2dev='yes' ; fi
have_gs='no' ; if test "$PSDelegate" != "$PSDelegateDefault"; then have_gs='yes' ; fi
have_hp2xx='no' ; if test "$HPGLDecodeDelegate" != "$HPGLDecodeDelegateDefault" ; then have_hp2xx='yes' ; fi
have_ilbmtoppm='no' ; if test "$ILBMDecodeDelegate" != "$ILBMDecodeDelegateDefault" ; then have_ilbmtoppm='yes' ; fi
have_ppmtoilbm='no' ; if test "$ILBMEncodeDelegate" != "$ILBMEncodeDelegateDefault" ; then have_ppmtoilbm='yes' ; fi
have_mpeg2decode='no' ; if test "$MPEGDecodeDelegate" != "$MPEGDecodeDelegateDefault" ; then have_mpeg2decode='yes' ; fi
have_mpeg2encode='no' ; if test "$MPEGEncodeDelegate" != "$MPEGEncodeDelegateDefault" ; then have_mpeg2encode='yes' ; fi
dnl have_ra_ppm='no' ; if test "$RADDecodeDelegate" != "$RADDecodeDelegateDefault" ; then have_ra_ppm='yes' ; fi
have_ralcgm='no' ; if test "$CGMDecodeDelegate" != "$CGMDecodeDelegateDefault" ; then have_ralcgm='yes' ; fi
# Automake conditional to support test suite
AM_CONDITIONAL([HasPSDelegate],[test "$have_gs" = 'yes'])
# Tests for programs only used while in maintainer mode
if test "$MAINT" = '' ; then
# Search for a usable Python
AC_CHECK_PROGS([PYTHON],[python3 python python2])
# Test for optional rst2html.py utility and define automake conditional HasRST2HTML if found.
AC_CHECK_PROGS([RST2HTML],[rst2html.py rst2html])
# Test for optional txt2html utility and define automake conditional HasTXT2HTML if found.
AC_PATH_PROGS([TXT2HTML], [txt2html])
# Test for optional graphicsmagick_snapshot_copy program/script.
# If this script is found, it is used to copy files using the script-provided
# mechanism due to 'snapshot' target.
AC_PATH_PROGS([GRAPHICSMAGICK_SNAPSHOT_COPY], [graphicsmagick_snapshot_copy])
# Search for a GnuPG program
AC_CHECK_PROGS([GPG], [gpg gpg2 gpg1], [false])
else
RST2HTML=''
TXT2HTML=''
GRAPHICSMAGICK_SNAPSHOT_COPY='false'
GPG='false'
fi
AC_SUBST([RST2HTML])
AM_CONDITIONAL([HasRST2HTML],[test "x${RST2HTML}" != 'x'])
AC_SUBST([TXT2HTML])
AM_CONDITIONAL([HasTXT2HTML],[test "x${TXT2HTML}" != 'x'])
AC_SUBST([GRAPHICSMAGICK_SNAPSHOT_COPY])
AM_CONDITIONAL([HasGRAPHICSMAGICK_SNAPSHOT_COPY],[test "x${GRAPHICSMAGICK_SNAPSHOT_COPY}" != 'xfalse'])
AC_SUBST([GPG])
AM_CONDITIONAL([HasGPG],[test "x${GPG}" != 'xfalse'])
#
# Test for font directories
#
type_include_files=''
# Windows fonts.
#
# Windows fonts must be in one directory, unlike typical fontconfig intallation.
# Windows font package for Ubuntu is 'ttf-mscorefonts-installer'
#
AC_MSG_CHECKING([for Windows fonts directory (location of arial.ttf)])
windows_font_dir=''
if test "$with_windows_font_dir" != "yes" && test -n "$with_windows_font_dir"
then
windows_font_dir="${with_windows_font_dir}/"
fi
if test -z "$windows_font_dir"
then
for dir in \
'/usr/X11R6/lib/X11/fonts/truetype/' \
'/usr/share/fonts/microsoft/' \
'/usr/share/fonts/truetype/msttcorefonts/' \
'/usr/share/fonts/msttcore/'
do
if test -f "${dir}arial.ttf"
then
windows_font_dir=${dir}
break 1
fi
done
fi
if test -n "$windows_font_dir"
then
type_include_files="$type_include_files "'<include file="type-windows.mgk" />'
AC_MSG_RESULT([$windows_font_dir])
else
AC_MSG_RESULT([not found!]);
fi
AC_SUBST([windows_font_dir])
# Adobe Postscript fonts on various systems
AC_MSG_CHECKING([for Solaris OpenWindows Type 1 fonts (location of Helvetica.afm)])
openwin_fonts=''
case $host_os in
solaris*)
# Check for OpenWindows Type 1 fonts. Not available under OpenSolaris
if test -f /usr/openwin/lib/X11/fonts/Type1/afm/Helvetica.afm
then
openwin_fonts='/usr/openwin/lib/X11/fonts/Type1/afm/'
type_include_files="$type_include_files "'<include file="type-solaris.mgk" />'
fi
;;
esac
if test -n "$openwin_fonts"
then
AC_MSG_RESULT([$openwin_fonts])
else
AC_MSG_RESULT([not found!]);
fi
# Check for modern Artifex urw-base35-fonts in OpenType format
# (https://github.com/ArtifexSoftware/urw-base35-fonts), which are
# similar to older 'gsfonts' but use descriptive file names and are
# also available in OpenType format.
AC_MSG_CHECKING([for Artifex urw-base35 OTF fonts directory (location of URWGothic-Book.otf)])
urwbase35otf_font_dir=''
if test "${with_urwbase35otf_font_dir}" != 'default'
then
urwbase35otf_font_dir="${with_urwbase35otf_font_dir}/"
else
# On Debian/Ubuntu systems, these are installed under
# /usr/share/fonts/opentype/urw-base35 and
# /usr/share/fonts/type1/urw-base35
#
# Debian/Ubuntu provide a font map at /etc/ghostscript/fontmap.d/10fonts-urw-base35.conf
for font_dir in "${prefix}/share/fonts/opentype/urw-base35/" /usr/share/fonts/opentype/urw-base35/
do
if test -f "${font_dir}URWGothic-Book.otf"
then
urwbase35otf_font_dir="${font_dir}"
break 1
fi
done
fi
if test "${urwbase35otf_font_dir}x" != 'x'
then
type_include_files="${type_include_files} "'<include file="type-urw-base35-otf.mgk" />'
AC_MSG_RESULT([$urwbase35otf_font_dir])
else
AC_MSG_RESULT([not found!]);
fi
AC_SUBST([urwbase35otf_font_dir])
# Ghostscript
AC_MSG_CHECKING([for Ghostscript fonts directory (location of a010013l.pfb)])
ghostscript_font_dir=''
if test "${with_gs_font_dir}" != 'default'
then
ghostscript_font_dir="${with_gs_font_dir}/"
else
if test "${native_win32_build}" = 'yes'
then
# Native Windows Build
#
# Ghostscript may install fonts to several default locations now.
# If the user does not select the default, then he is on his own.
#
# It would be nice to use reg.exe to obtain Ghostscript information
# but unfortunately MSYS seems to transform registry key paths into
# filesystem paths so it does not work. Maybe there is a way to
# prevent that translation?
#
# reg query "HKLM\Software\GPL Ghostscript" /s
#
# This seems to work without translation:
#
# cmd /c "reg query \"HKLM\Software\GPL Ghostscript\" /v GS_LIB /s"
#
for font_dir in "c:\\Program Files\\gs\\fonts\\" "c:\\gs\\fonts\\"
do
if test -f "${font_dir}a010013l.pfb"
then
ghostscript_font_dir="$font_dir"
break 1
fi
done
if test "$with_gs" = 'yes' ; then
if test "${PSDelegate}" != "${PSDelegateDefault}"
then
font_dir=`echo "${PSDelegate}" | sed -e 's:/gs/.*:/gs:;s:^/::;s/./&:/;s:/:\\\\:g'`"\\fonts\\"
if test -f "${font_dir}a010013l.pfb"
then
ghostscript_font_dir="${font_dir}"
fi
fi
fi
else
# Unix Build
#
# Check ${prefix}/share/ghostscript/fonts first
# Red Hat Linux puts Ghostscript fonts in /usr/share/fonts/default/Type1
# Recent Cygwin puts Ghostscript fonts in /usr/share/ghostscript/fonts
# Recent Gentoo Linux puts Ghostscript fonts in /usr/share/fonts/ghostscript
# Debian puts Ghostscript fonts in /usr/share/fonts/type1/gsfonts
#
# Debian/Ubuntu provide a font map at /etc/ghostscript/fontmap.d/10gsfonts.conf
for font_dir in "${prefix}/share/ghostscript/fonts/" '/usr/share/fonts/default/Type1/' '/usr/share/ghostscript/fonts/' '/usr/share/fonts/ghostscript/' '/usr/share/fonts/type1/gsfonts/'
do
if test -f "${font_dir}a010013l.pfb"
then
ghostscript_font_dir="${font_dir}"
break 1
fi
done
# Look for Ghostscript fonts relative to Ghostscript install directory
if test "${ghostscript_font_dir}x" = 'x'
then
if test "$with_gs" = 'yes' ; then
if test "$PSDelegate" != "${PSDelegateDefault}"
then
font_dir=`echo "$PSDelegate" | sed -e 's:/bin/gs:/share/ghostscript/fonts:'`"/"
if test -f "${font_dir}a010013l.pfb"
then
ghostscript_font_dir="${font_dir}"
fi
fi
fi
fi
fi
fi
if test "${ghostscript_font_dir}x" != 'x'
then
# Only include type-ghostscript.mgk when urwbase35otf_font_dir not found
if test "${urwbase35otf_font_dir}x" = 'x'
then
type_include_files="${type_include_files} "'<include file="type-ghostscript.mgk" />'
fi
AC_MSG_RESULT([$ghostscript_font_dir])
else
AC_MSG_RESULT([not found!]);
fi
AC_SUBST([ghostscript_font_dir])
case "${build_os}" in
mingw* )
PSDelegate=`$WinPathScript "$PSDelegate" 1`
;;
esac
AC_SUBST([type_include_files])
#
# Handle case where user doesn't want frozen paths
#
if test "$with_frozenpaths" != 'yes'
then
# Re-set delegate definitions to default (no paths)
dnl AutotraceDecodeDelegate="$AutotraceDecodeDelegateDefault"
dnl BZIPDelegate="$BZIPDelegateDefault"
BrowseDelegate="$BrowseDelegateDefault"
CGMDecodeDelegate="$CGMDecodeDelegateDefault"
dnl CatDelegate="$CatDelegateDefault"
ConvertDelegate="$ConvertDelegateDefault"
DOTDecodeDelegate="$DOTDecodeDelegateDefault"
DVIDecodeDelegate="$DVIDecodeDelegateDefault"
dnl EchoDelegate="$EchoDelegateDefault"
EditorDelegate="$EditorDelegateDefault"
FIGDecodeDelegate="$FIGDecodeDelegateDefault"
GMDelegate="${GMDelegateDefault}"
dnl GnuplotDecodeDelegate="$GnuplotDecodeDelegateDefault"
HPGLDecodeDelegate="$HPGLDecodeDelegateDefault"
HTMLDecodeDelegate="$HTMLDecodeDelegateDefault"
ILBMDecodeDelegate="$ILBMDecodeDelegateDefault"
ILBMEncodeDelegate="$ILBMEncodeDelegateDefault"
LPDelegate="$LPDelegateDefault"
LaunchDelegate="$LaunchDelegateDefault"
dnl MANDelegate="$MANDelegateDefault"
MPEGDecodeDelegate="$MPEGDecodeDelegateDefault"
MPEGEncodeDelegate="$MPEGEncodeDelegateDefault"
dnl MVDelegate="$MVDelegateDefault"
MogrifyDelegate="$MogrifyDelegateDefault"
dnl PGPDecodeDelegate="$PGPDecodeDelegateDefault"
dnl POVDelegate="$POVDelegateDefault"
PSDelegate="$PSDelegateDefault"
dnl RADDecodeDelegate="$RADDecodeDelegateDefault"
dnl RLEEncodeDelegate="$RLEEncodeDelegateDefault"
dnl RMDelegate="$RMDelegateDefault"
dnl SCANDecodeDelegate="$SCANDecodeDelegateDefault"
ShowImageDelegate="$ShowImageDelegateDefault"
dnl TXTDelegate="$TXTDelegateDefault"
WMFDecodeDelegate="$WMFDecodeDelegateDefault"
dnl WWWDecodeDelegate="$WWWDecodeDelegateDefault"
dnl ZipDelegate="$ZipDelegateDefault"
fi
# Delegate substitutions
dnl AC_SUBST([AutotraceDecodeDelegate])
dnl AC_SUBST([BZIPDelegate])
AC_SUBST([BrowseDelegate])
dnl AC_SUBST([CGMDecodeDelegate])
dnl AC_SUBST([CatDelegate])
AC_SUBST([ConvertDelegate])
AC_SUBST([DOTDecodeDelegate])
AC_SUBST([DVIDecodeDelegate])
dnl AC_SUBST([EchoDelegate])
AC_SUBST([EditorDelegate])
AC_SUBST([FIGDecodeDelegate])
dnl AC_SUBST([GnuplotDecodeDelegate])
AC_SUBST([HPGLDecodeDelegate])
AC_SUBST([HTMLDecodeDelegate])
AC_SUBST([ILBMDecodeDelegate])
AC_SUBST([ILBMEncodeDelegate])
AC_SUBST([LPDelegate])
AC_SUBST([LaunchDelegate])
dnl AC_SUBST([MANDelegate])
AC_SUBST([MPEGDecodeDelegate])
AC_SUBST([MPEGEncodeDelegate])
dnl AC_SUBST([MVDelegate])
AC_SUBST([MogrifyDelegate])
dnl AC_SUBST([PGPDecodeDelegate])
dnl AC_SUBST([POVDelegate])
AC_SUBST([PSDelegate])
dnl AC_SUBST([RADDecodeDelegate])
dnl AC_SUBST([RLEEncodeDelegate])
dnl AC_SUBST([RMDelegate])
dnl AC_SUBST([SCANDecodeDelegate])
AC_SUBST([ShowImageDelegate])
dnl AC_SUBST([TXTDelegate])
dnl AC_SUBST([WMFDecodeDelegate])
dnl AC_SUBST([WWWDecodeDelegate])
dnl AC_SUBST([ZipDelegate])
#
# RedHat RPM support (http://rpm5.org/)
#
RPM=''
AC_CHECK_PROGS([RPM],[rpmbuild rpm])
AC_SUBST([RPM])
AM_CONDITIONAL([HAS_RPM],[test "x$RPM" != "x"])
#
# 7ZIP support (http://p7zip.sourceforge.net/)
#
P7ZIP=''
AC_CHECK_PROGS([P7ZIP],[7za])
AC_SUBST(P7ZIP)
AM_CONDITIONAL([HAS_P7ZIP],[test "x$P7ZIP" != "x"])
#
# ZIP support (http://www.info-zip.org/Zip.html)
#
ZIP=''
AC_CHECK_PROGS([ZIP],[zip])
AC_SUBST([ZIP])
AM_CONDITIONAL([HAS_ZIP],[test "x$ZIP" != "x"])
#
# Ghostscript related configuration.
#
GSColorDevice=ppmraw
GSColorAlphaDevice=pngalpha
GSGrayDevice=pgmraw
GSPaletteDevice=pcx256
GSMonoDevice=pbmraw
GSCMYKDevices="pamcmyk32 pam $GSColorDevice"
GSPDFDevice=pdfwrite
GSPSDevice=pswrite
GSEPSDevice=epswrite
GSVersion='unknown'
if test $have_gs = 'yes'
then
AC_MSG_CHECKING([for Ghostscript version])
if GSVersion=`$PSDelegate --version`
then
:
else
GSVersion=`$PSDelegate --help | sed -e '1q' | awk '{ print $3 }'`
fi
AC_MSG_RESULT([$GSVersion])
# GSColorDevice # AS_MESSAGE_LOG_FD
AC_MSG_CHECKING([for gs color device])
if $PSDelegate -q -dBATCH -sDEVICE=pnmraw -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
then
GSColorDevice=pnmraw
else
if $PSDelegate -q -dBATCH -sDEVICE=ppmraw -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
then
GSColorDevice=ppmraw
else
GSColorDevice=ppmraw
fi
fi
AC_MSG_RESULT([$GSColorDevice])
# GSColorAlphaDevice
AC_MSG_CHECKING([for gs color+alpha device])
if $PSDelegate -q -dBATCH -sDEVICE=pngalpha -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
then
GSColorAlphaDevice=pngalpha
else
GSColorAlphaDevice=$GSColorDevice
fi
AC_MSG_RESULT([$GSColorAlphaDevice])
# GSGrayDevice
AC_MSG_CHECKING([for gs gray device])
if $PSDelegate -q -dBATCH -sDEVICE=pgmraw -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
then
GSGrayDevice=pgmraw
else
GSGrayDevice=ppmraw
fi
AC_MSG_RESULT([$GSGrayDevice])
# GSPaletteDevice
AC_MSG_CHECKING([for gs pallet device])
if $PSDelegate -q -dBATCH -sDEVICE=pcx256 -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
then
GSPaletteDevice=pcx256
else
GSPaletteDevice=ppmraw
fi
AC_MSG_RESULT($GSPaletteDevice)
# GSMonoDevice
AC_MSG_CHECKING([for gs mono device])
if $PSDelegate -q -dBATCH -sDEVICE=pbmraw -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
then
GSMonoDevice=pbmraw
else
GSMonoDevice=ppmraw
fi
AC_MSG_RESULT([$GSMonoDevice])
# GSCMYKDevice
AC_MSG_CHECKING([for gs CMYK device])
GSCMYKDevice=$GSColorDevice
for device in $GSCMYKDevices
do
if $PSDelegate -q -dBATCH -sDEVICE=$device -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
then
GSCMYKDevice=$device
break
fi
done
AC_MSG_RESULT([$GSCMYKDevice])
# GSPDFDevice
AC_MSG_CHECKING([for gs PDF writing device])
if $PSDelegate -q -dBATCH -sDEVICE=pdfwrite -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
then
GSPDFDevice=pdfwrite
else
GSPDFDevice=nodevice
fi
AC_MSG_RESULT([$GSPDFDevice])
# GSPSDevice
AC_MSG_CHECKING([for gs PS writing device])
GSPSDevice=nodevice
for device in ps2write pswrite
do
if $PSDelegate -q -dBATCH -sDEVICE=$device -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
then
GSPSDevice=$device
break
fi
done
AC_MSG_RESULT([$GSPSDevice])
# GSEPSDevice
AC_MSG_CHECKING([for gs EPS writing device])
GSEPSDevice=nodevice
for device in eps2write epswrite
do
if $PSDelegate -q -dBATCH -sDEVICE=$device -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
then
GSEPSDevice=$device
break
fi
done
AC_MSG_RESULT([$GSEPSDevice])
fi
AC_SUBST([GSMonoDevice])
AC_SUBST([GSCMYKDevice])
AC_SUBST([GSGrayDevice])
AC_SUBST([GSPaletteDevice])
AC_SUBST([GSColorDevice])
AC_SUBST([GSColorAlphaDevice])
AC_SUBST([GSPDFDevice])
AC_SUBST([GSPSDevice])
AC_SUBST([GSEPSDevice])
AC_SUBST([GSVersion])
#
# PerlMagick-related configuration
#
# Look for PERL if PerlMagick requested
# If name/path of desired PERL interpreter is specified, look for that one first
have_perl='no'
if test "$with_perl" != 'no'
then
if test "$with_perl" != 'yes'
then
AC_CACHE_CHECK([for perl],[ac_cv_path_PERL],[ac_cv_path_PERL="$with_perl"]);
PERL=$ac_cv_path_PERL
AC_SUBST([PERL])dnl
have_perl="$ac_cv_path_PERL"
else
AC_PATH_PROGS([PERL],[perl perl5],)dnl
if test "$ac_cv_path_PERL"
then
have_perl="$ac_cv_path_PERL"
fi
fi
fi
if test "$with_perl" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-perl=$with_perl "
fi
PERL_SUPPORTS_DESTDIR='no'
with_perl_static='no'
with_perl_dynamic='no'
if test "$have_perl" != 'no'
then
# Should we build shared libraries?
if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'no'
then
with_perl_static='yes'
fi
if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'yes'
then
with_perl_dynamic='yes'
fi
# Is PERL's MakeMaker new enough to support DESTDIR?
AC_PROG_PERL_VERSION([5.8.1],[PERL_SUPPORTS_DESTDIR='yes'],[PERL_SUPPORTS_DESTDIR='no'])
fi
AM_CONDITIONAL([WITH_PER]L,[test "$have_perl" != 'no'])
AM_CONDITIONAL([WITH_PERL_STATIC],[test $with_perl_static = 'yes'])
AM_CONDITIONAL([WITH_PERL_DYNAMIC],[test $with_perl_dynamic = 'yes'])
AC_SUBST([PERL_SUPPORTS_DESTDIR])
# Determine path to pick up GraphicsMagick library from for use with building PerlMagick
MAGICKLIBDIR="${LIB_DIR}"
MAGICKLIB="-L${MAGICKLIBDIR} -lGraphicsMagick"
if test $with_perl_static = 'yes'
then
# Find out where libtool hides its uninstalled libraries (as libtool_objdir)
libtool_objdir=$objdir
# Find out what extension is applied to static libraries (as libtool_libext)
#eval `./libtool --config|grep '^libext='|sed -e 's/^libext/libtool_libext/'`
# Find out full form of library name (as libtool_libname_spec)
#eval `./libtool --config|grep '^libname_spec='|sed -e 's/^libname_spec/libtool_libname_spec/'`
#eval 'name=GraphicsMagick '`eval 'echo library_name="${libtool_libname_spec}.${libtool_libext}"'`
# Explicit path to static library (Perl rejects it!)
#MAGICKLIB="${builddir}/magick/${libtool_objdir}/${library_name}"
# Linker search path to library, followed by -lGraphicsMagick
MAGICKLIBDIR="${builddir}/magick/${libtool_objdir}"
MAGICKLIB="-L${MAGICKLIBDIR} -lGraphicsMagick"
fi
AC_SUBST([MAGICKLIB])
AC_SUBST([MAGICKLIBDIR])
# Create a simple string containing format names for all delegate libraries
# DELEGATES is used to select sub-directories in the PerlMagick test suite
# MAGICK_FEATURES is used to declare required features in the test suite
DELEGATES=''
MAGICK_FEATURES=''
if test "$with_broken_coders" = yes; then
# Add the list of broken coders to feature options
MAGICK_FEATURES="$MAGICK_FEATURES PSD"
fi
if test "$have_bzlib" = 'yes' ; then
DELEGATES="$DELEGATES bzlib"
MAGICK_FEATURES="$MAGICK_FEATURES BZLIB"
fi
dnl if test "$have_ralcgm" = 'yes' ; then
dnl DELEGATES="$DELEGATES cgm"
dnl MAGICK_FEATURES="$MAGICK_FEATURES CGM"
dnl fi
if test "$have_fpx" = 'yes' ; then
DELEGATES="$DELEGATES fpx"
MAGICK_FEATURES="$MAGICK_FEATURES FPX"
fi
if test "$have_hp2xx" = 'yes' ; then
DELEGATES="$DELEGATES hpgl"
MAGICK_FEATURES="$MAGICK_FEATURES HPGL"
fi
if test "$have_jbig" = 'yes' ; then
DELEGATES="$DELEGATES jbig"
MAGICK_FEATURES="$MAGICK_FEATURES JBIG"
fi
if test "$have_jxl" = 'yes' ; then
DELEGATES="$DELEGATES jxl"
MAGICK_FEATURES="$MAGICK_FEATURES JXL"
fi
if test "$have_webp" = 'yes' ; then
DELEGATES="$DELEGATES webp"
MAGICK_FEATURES="$MAGICK_FEATURES WEBP"
fi
if test "$have_heif" = 'yes' ; then
DELEGATES="$DELEGATES heif"
MAGICK_FEATURES="$MAGICK_FEATURES HEIF"
fi
if test "$have_png$have_jpeg" = 'yesyes' ; then
DELEGATES="$DELEGATES jng"
MAGICK_FEATURES="$MAGICK_FEATURES JNG"
fi
if test "$have_jp2" = 'yes' ; then
DELEGATES="$DELEGATES jp2"
MAGICK_FEATURES="$MAGICK_FEATURES JP2"
fi
if test "$have_jpeg" = 'yes' ; then
DELEGATES="$DELEGATES jpeg"
MAGICK_FEATURES="$MAGICK_FEATURES JPEG"
fi
if test "$have_lcms2" = 'yes' ; then
DELEGATES="$DELEGATES lcms"
MAGICK_FEATURES="$MAGICK_FEATURES LCMS"
fi
if test "$have_lzma" = 'yes' ; then
DELEGATES="$DELEGATES lzma"
MAGICK_FEATURES="$MAGICK_FEATURES LZMA"
fi
if test "$have_mpeg2" = 'yes' ; then
DELEGATES="$DELEGATES mpeg2"
MAGICK_FEATURES="$MAGICK_FEATURES MPEG2"
fi
if test "$have_mpeg2decode" = 'yes' && test "$have_mpeg2encode" = 'yes' ; then
DELEGATES="$DELEGATES mpeg"
MAGICK_FEATURES="$MAGICK_FEATURES MPEG"
fi
if test "$have_png" = 'yes' ; then
DELEGATES="$DELEGATES png"
MAGICK_FEATURES="$MAGICK_FEATURES PNG"
fi
have_ps='no'
if test "$have_gs" = 'yes' ; then
have_ps='yes'
fi
if test "$have_ps" = 'yes' ; then
DELEGATES="$DELEGATES ps"
MAGICK_FEATURES="$MAGICK_FEATURES PS"
fi
dnl if test "$have_ra_ppm" = 'yes' ; then
dnl DELEGATES="$DELEGATES rad"
dnl MAGICK_FEATURES="$MAGICK_FEATURES RAD"
dnl fi
if test "$have_tiff" = 'yes' ; then
DELEGATES="$DELEGATES tiff"
MAGICK_FEATURES="$MAGICK_FEATURES TIFF"
fi
if test "$have_ttf" = 'yes' ; then
DELEGATES="$DELEGATES ttf"
MAGICK_FEATURES="$MAGICK_FEATURES TTF"
fi
if test "$have_wmf" = 'yes' ; then
DELEGATES="$DELEGATES wmf"
MAGICK_FEATURES="$MAGICK_FEATURES WMF"
fi
if test "$have_x" = 'yes' ; then
DELEGATES="$DELEGATES x"
MAGICK_FEATURES="$MAGICK_FEATURES X"
fi
if test "$have_fig2dev" = 'yes' && test "$have_ps" = 'yes' ; then
DELEGATES="$DELEGATES xfig"
MAGICK_FEATURES="$MAGICK_FEATURES XFIG"
fi
if test "$have_xml" = 'yes' ; then
DELEGATES="$DELEGATES xml"
MAGICK_FEATURES="$MAGICK_FEATURES XML"
fi
if test "$have_zlib" = 'yes' ; then
DELEGATES="$DELEGATES zlib"
MAGICK_FEATURES="$MAGICK_FEATURES ZLIB"
fi
if test "$build_modules" != 'no' ; then
MAGICK_FEATURES="$MAGICK_FEATURES MODULES"
fi
# Remove extraneous spaces from output variables (asthetic)
DELEGATES=`echo $DELEGATES | sed -e 's/ */ /g'`
MAGICK_FEATURES=`echo $MAGICK_FEATURES | sed -e 's/ */ /g'`
AC_SUBST([DELEGATES])
AC_SUBST([MAGICK_FEATURES])
#
# Handle special compiler flags
#
# Add '-p' if prof source profiling support enabled
if test "$with_prof" = 'yes'
then
CFLAGS="-p $CFLAGS"
CXXFLAGS="-p $CXXFLAGS"
LDFLAGS="-p $LDFLAGS"
fi
# Add '-pg' if gprof source profiling support enabled
if test "$with_gprof" = 'yes'
then
CFLAGS="-pg $CFLAGS"
CXXFLAGS="-pg $CXXFLAGS"
LDFLAGS="-pg $LDFLAGS"
fi
# Add '-ftest-coverage -fprofile-arcs' if gcov source profiling support enabled
# This is a gcc-specific feature
if test "$with_gcov" = 'yes'
then
CFLAGS="-ftest-coverage -fprofile-arcs $CFLAGS"
CXXFLAGS="-ftest-coverage -fprofile-arcs $CXXFLAGS"
LDFLAGS="-ftest-coverage -fprofile-arcs $LDFLAGS"
fi
#
# Build library dependency list for libGraphicsMagick
#
# The build_modules variable is set to 'yes' if coders and filters are
# to be built as modules. This requires libltdl ($LIB_LTDL).
# Removed $LIB_OMP and $LIB_THREAD
#printf "LIBS=${LIBS}\n"
if test "$build_modules" != 'no'
then
MAGICK_DEP_LIBS=''
for token in $LIB_FPX $LCMS2_LIBS $FREETYPE_LIBS $LIB_XEXT $LIB_IPC $LIB_X11 $LIB_BZLIB $ZLIB_LIBS $LIB_LTDL $LIB_TRIO $LIB_GDI32 $LIBS_USER $LIB_MATH $LIB_THREAD $LIB_TCMALLOC $LIB_UMEM $LIB_MTMALLOC
do
case $token in
-l*)
# Add token to MAGICK_DEP_LIBS if not already present
add=yes;
for test_token in $MAGICK_DEP_LIBS
do
if test $token = $test_token
then
add=no
break
fi
done
if test $add = yes
then
MAGICK_DEP_LIBS="$MAGICK_DEP_LIBS $token"
fi
;;
*)
# Discard
;;
esac
done
else
MAGICK_DEP_LIBS="$LIBS"
fi
MAGICK_EXTRA_DEP_LIBS="$LIB_OMP" # Extra libraries typically added due to CFLAGS
#printf "MAGICK_DEP_LIBS=${MAGICK_DEP_LIBS}\n"
#printf "MAGICK_EXTRA_DEP_LIBS=${MAGICK_EXTRA_DEP_LIBS}\n"
AC_SUBST([MAGICK_DEP_LIBS])
AC_SUBST([MAGICK_EXTRA_DEP_LIBS])
#
# Remove extraneous spaces from output variables (asthetic)
#
X_CFLAGS=`echo $X_CFLAGS | sed -e 's/ */ /g'`
X_PRE_LIBS=`echo $X_PRE_LIBS | sed -e 's/ */ /g'`
X_LIBS=`echo $X_LIBS | sed -e 's/ */ /g'`
X_EXTRA_LIBS=`echo $X_EXTRA_LIBS | sed -e 's/ */ /g'`
CC=`echo $CC | sed -e 's/ */ /g'`
CFLAGS=`echo $CFLAGS | sed -e 's/ */ /g'`
CPPFLAGS=`echo $CPPFLAGS | sed -e 's/ */ /g'`
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ */ /g'`
LDFLAGS=`echo $LDFLAGS | sed -e 's/ */ /g'`
TESTED_LIBS=`echo $LIBS | sed -e 's/ */ /g'`
MAGICK_DEP_LIBS=`echo $MAGICK_DEP_LIBS | sed -e 's/ */ /g'`
MAGICK_EXTRA_DEP_LIBS=`echo $MAGICK_EXTRA_DEP_LIBS | sed -e 's/ */ /g'`
#LIBS=`echo $LIBS | sed -e 's/ */ /g'`
MAGICK_API_CFLAGS=$CFLAGS
MAGICK_API_CPPFLAGS=`echo $MAGICK_API_CPPFLAGS | sed -e 's/ */ /g'`
MAGICK_API_LDFLAGS="-L$LIB_DIR $LDFLAGS"
MAGICK_API_DEP_LIBS="$MAGICK_DEP_LIBS"
MAGICK_API_LIBS="-lGraphicsMagick $MAGICK_API_DEP_LIBS $MAGICK_EXTRA_DEP_LIBS"
MAGICK_API_DEP_LIBS=`echo $MAGICK_API_DEP_LIBS | sed -e 's/ */ /g'`
MAGICK_API_LIBS=`echo $MAGICK_API_LIBS | sed -e 's/ */ /g'`
# Save configure/build parameters for later reference
AC_DEFINE_UNQUOTED([GM_BUILD_CONFIGURE_ARGS],["$0 ${ac_configure_args}"],[arguments passed to configure])
AC_DEFINE_UNQUOTED([GM_BUILD_HOST],["${host}"],[Host identification triplet])
AC_DEFINE_UNQUOTED([GM_BUILD_CC],["${CC}"],[C compiler used for compilation])
AC_DEFINE_UNQUOTED([GM_BUILD_CXX],["${CXX}"],[C++ compiler used for compilation])
AC_DEFINE_UNQUOTED([GM_BUILD_CFLAGS],["${CFLAGS}"],[CFLAGS used for C compilation])
AC_DEFINE_UNQUOTED([GM_BUILD_CPPFLAGS],["${CPPFLAGS}"],[CPPFLAGS used for preprocessing])
AC_DEFINE_UNQUOTED([GM_BUILD_CXXFLAGS],["${CXXFLAGS}"],[CXXFLAGS used for C++ compilation])
AC_DEFINE_UNQUOTED([GM_BUILD_LDFLAGS],["${LDFLAGS}"],[LDFLAGS used for linking])
AC_DEFINE_UNQUOTED([GM_BUILD_LIBS],["${MAGICK_API_DEP_LIBS}"],[LIBS used for linking])
# Pass only user-provided LIBS as "global" libraries
LIBS=$LIBS_USER
#AC_SUBST([CPPFLAGS])
AC_SUBST([X_CFLAGS])
#AC_SUBST([LDFLAGS])
#AC_SUBST([X_PRE_LIBS])
#AC_SUBST([X_LIBS])
#AC_SUBST([X_EXTRA_LIBS])
AC_SUBST([MAGICK_API_CFLAGS])
AC_SUBST([MAGICK_API_CPPFLAGS])
AC_SUBST([MAGICK_API_PC_CPPFLAGS])
AC_SUBST([MAGICK_API_LDFLAGS])
AC_SUBST([MAGICK_API_LIBS])
AC_SUBST([MAGICK_API_DEP_LIBS])
AC_CONFIG_FILES(\
GraphicsMagick.spec \
Magick++/bin/GraphicsMagick++-config \
Magick++/lib/GraphicsMagick++.pc \
Makefile \
PerlMagick/Magick.pm \
PerlMagick/Makefile.PL \
PerlMagick/PerlMagickCheck.sh \
PerlMagick/t/features.pl \
config/delegates.mgk \
config/type-ghostscript.mgk \
config/type-solaris.mgk \
config/type-urw-base35-otf.mgk \
config/type-windows.mgk \
config/type.mgk \
magick/GraphicsMagick-config \
magick/GraphicsMagick.pc \
magick/magick_types.h \
magick/version.h \
common.shi \
rungm.sh \
wand/GraphicsMagickWand-config \
wand/GraphicsMagickWand.pc )
# Set configured scripts to executable.
AC_CONFIG_COMMANDS([default],[],[])
AC_CONFIG_COMMANDS([GraphicsMagick++-config.in],[chmod +x Magick++/bin/GraphicsMagick++-config])
AC_CONFIG_COMMANDS([GraphicsMagick-config.in],[chmod +x magick/GraphicsMagick-config])
AC_CONFIG_COMMANDS([GraphicsMagickWand-config.in],[chmod +x wand/GraphicsMagickWand-config])
AC_CONFIG_COMMANDS([rungm.sh.in],[chmod +x rungm.sh])
AC_CONFIG_COMMANDS([PerlMagick/PerlMagickCheck.sh.in],[chmod +x PerlMagick/PerlMagickCheck.sh])
AC_OUTPUT
rm -f magick-version
printf "\n"
printf "GraphicsMagick is configured as follows. Please verify that this\n"
printf "configuration matches your expectations.\n"
printf "\n"
printf "Host system type : $host\n"
printf "Build system type : $build\n"
printf "\n"
printf "Option Configure option \tConfigured value\n"
printf -- "-----------------------------------------------------------------\n"
printf "Shared libraries --enable-shared=$enable_shared\t\t$libtool_build_shared_libs\n"
printf "Static libraries --enable-static=$enable_static\t\t$libtool_build_static_libs\n"
printf "GNU ld --with-gnu-ld=$with_gnu_ld \t\t$lt_cv_prog_gnu_ld\n"
printf "Quantum depth --with-quantum-depth=$with_quantum_depth\t$with_quantum_depth\n"
printf "Modules --with-modules=$with_modules \t\t$build_modules\n"
printf "OpenMP --enable-openmp=$enable_openmp\t\t${OPENMP_ENABLED} ${LIB_OMP}\n"
printf "\n"
printf "Delegate Configuration:\n"
printf "BZLIB --with-bzlib=$with_bzlib \t$have_bzlib\n"
printf "FlashPIX --with-fpx=$with_fpx \t$have_fpx\n"
printf "FreeType 2.0 --with-ttf=$with_ttf \t$have_ttf\n"
printf "Ghostscript --with-gs=$with_gs \t$PSDelegate ($GSVersion)\n"
result_ghostscript_font_dir='none'
if test "${ghostscript_font_dir}x" != 'x'
then
result_ghostscript_font_dir="$ghostscript_font_dir"
fi
printf "Ghostscript fonts --with-gs-font-dir=$with_gs_font_dir\t$result_ghostscript_font_dir\n"
result_urwbase35otf_font_dir='none'
if test "${urwbase35otf_font_dir}x" != 'x'
then
result_urwbase35otf_font_dir="$urwbase35otf_font_dir"
fi
printf "URW Base35 fonts --with-base35otf-font-dir=$with_gs_font_dir\t$result_urwbase35otf_font_dir\n"
printf "Windows GDI32 --with-gdi32=$with_gdi32 \t$have_gdi32\n"
printf "JBIG --with-jbig=$with_jbig \t$have_jbig\n"
printf "JPEG v1 --with-jpeg=$with_jpeg \t$have_jpeg\n"
printf "JPEG-2000 --with-jp2=$with_jp2 \t$have_jp2\n"
printf "JPEG-XL --with-jxl=$with_jxl \t$have_jxl\n"
printf "LCMS v2 --with-lcms2=$with_lcms2 \t$have_lcms2\n"
# printf "MPEG v2 --with-mpeg2=$with_mpeg2 \t$have_mpeg2\n"
printf "LIBZIP --with-libzip=$with_libzip \t$have_libzip\n"
printf "LZMA --with-lzma=$with_lzma \t$have_lzma\n"
printf "Magick++ --with-magick-plus-plus=$with_magick_plus_plus\t$have_magick_plus_plus\n"
printf "PERL --with-perl=$with_perl \t$have_perl\n"
if test "${LIB_PNG}x" != 'x'
then
printf "PNG --with-png=$with_png \t$have_png ($LIB_PNG)\n"
else
printf "PNG --with-png=$with_png \t$have_png\n"
fi
printf "Google tcmalloc --with-tcmalloc=$with_tcmalloc\t\t$have_tcmalloc\n"
printf "Solaris mtmalloc --with-mtmalloc=$with_mtmalloc\t\t$have_mtmalloc\n"
printf "Solaris umem --with-umem=$with_umem \t$have_umem\n"
printf "TIFF --with-tiff=$with_tiff \t$have_tiff\n"
printf "TRIO --with-trio=$with_trio \t$have_trio\n"
printf "WEBP --with-webp=$with_webp \t$have_webp\n"
printf "HEIF --with-heif=$with_heif \t$have_heif\n"
result_windows_font_dir='none'
if test "${windows_font_dir}x" != 'x'
then
result_windows_font_dir="${windows_font_dir}"
fi
printf "Windows fonts --with-windows-font-dir=$with_windows_font_dir\t$result_windows_font_dir\n"
printf "WMF --with-wmf=$with_wmf \t$have_wmf\n"
printf "X11 --with-x=$with_x \t$have_x\n"
printf "XML --with-xml=$with_xml \t$have_xml\n"
printf "ZLIB --with-zlib=$with_zlib \t$have_zlib\n"
printf "ZSTD --with-zstd=$with_zstd \t$have_zstd\n"
printf "\n"
printf "X11 Configuration:\n"
if test "$have_x" != 'no'
then
printf " X_CFLAGS = $X_CFLAGS\n"
printf " X_PRE_LIBS = $X_PRE_LIBS\n"
printf " X_LIBS = $X_LIBS\n"
printf " X_EXTRA_LIBS = $X_EXTRA_LIBS\n"
else
printf "\n"
printf " Not using X11.\n"
fi
printf "\n"
printf "Options used to compile and link:\n"
printf " CC = $CC\n"
printf " CFLAGS = $CFLAGS\n"
printf " CPPFLAGS = $CPPFLAGS\n"
printf " CXX = $CXX\n"
printf " CXXFLAGS = $CXXFLAGS\n"
printf " DEFS = $DEFS\n"
printf " LDFLAGS = $LDFLAGS\n"
printf " LIBS = $MAGICK_API_DEP_LIBS $MAGICK_EXTRA_DEP_LIBS\n"
printf "\n"
|