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 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881
|
#############################################################################
# $Id: configure.ac 352856 2012-02-09 19:03:13Z rafanovi $
# Derived from configure.in version 1.173.
# ==========================================================================
#
# PUBLIC DOMAIN NOTICE
# National Center for Biotechnology Information
#
# This software/database is a "United States Government Work" under the
# terms of the United States Copyright Act. It was written as part of
# the author's official duties as a United States Government employee and
# thus cannot be copyrighted. This software/database is freely available
# to the public for use. The National Library of Medicine and the U.S.
# Government have not placed any restriction on its use or reproduction.
#
# Although all reasonable efforts have been taken to ensure the accuracy
# and reliability of the software and data, the NLM and the U.S.
# Government do not and cannot warrant the performance or results that
# may be obtained by using this software or data. The NLM and the U.S.
# Government disclaim all warranties, express or implied, including
# warranties of performance, merchantability or fitness for any particular
# purpose.
#
# Please cite the author in any work or product based on this material.
#
# ==========================================================================
#
# Authors: Denis Vakatov, Aaron Ucko
#
# File Description:
# Setup NCBI C++ Toolkit build tree - tuned for your platform, compiler, etc.
# USAGE:
# 1) Process this file with "autoconf" to produce a "configure" script.
# 2) Run the resultant "configure" script to produce:
# a) "<builddir>/inc/ncbiconf_unix.h"
# b) "<builddir>/build/Makefile.mk"
# c) other Makefile's and scripts in "<builddir>/build" and below
#
#############################################################################
AC_PREREQ(2.59)
dnl Early setup, most crucially for locking. The diversion magic lets
dnl this occur before AC_INIT, which already interferes with other
dnl configure processes.
AC_DIVERT_PUSH(INIT_PREPARE)
# Check --with-3psw=.../--without-3psw early because a lot hinges on it
orig_NCBI=$NCBI
case "$with_3psw" in
'' | yes | [[\$/][Nn]*:[SsLl]*] | [[Nn]*:[SsLl]*] )
ncbi_favor_std_packages=no
;;
[[SsLl]]*:* )
ncbi_favor_std_packages=yes
;;
[[SsLl]]* )
AS_UNSET(NCBI)
;;
no )
if test "${with_ncbi_c-no}" != "no"; then
AC_MSG_ERROR([incompatible options: --with-ncbi-c but --without-3psw])
else
with_ncbi_c=no
fi
m4_foreach(X, [sss, sssutils, sssdb, z, bz2, lzo, pcre, gnutls, openssl,
sybase, ftds, mysql, fltk, opengl, mesa, glut, glew,
wxwidgets, freetype, fastcgi, bdb, sp, orbacus, odbc,
python, jni, boost, sqlite3, icu, expat,
sablot, libxml, libxslt, xerces, xalan, oechem, sge,
muparser, hdf5, gif, jpeg, png, tiff, xpm, magic, curl],
[if test "${[with_]X-no}" != "no"; then
AC_MSG_ERROR([incompatible options: --with-]X[ but --without-3psw])
else
[with_]X=no
fi
])
AS_UNSET(NCBI)
;;
* )
AC_MSG_ERROR([Unsupported option --with-3psw=$with_3psw])
;;
esac
if $srcdir/scripts/common/impl/get_lock.sh configure $$; then
ac_clean_files=configure.lock
else
exit 1
fi
# reconfigure.sh expects config.cache to exist; unconditionally clobber
# any command-line setting.
cache_file=config.cache
if test -z "$CONFIG_SITE" -a -r $srcdir/src/build-system/config.site; then
CONFIG_SITE=$srcdir/src/build-system/config.site
fi
AC_DIVERT_POP
AC_INIT([ncbi-tools++],[0.0],[cpp-core@ncbi.nlm.nih.gov])
AC_CONFIG_SRCDIR(src/build-system/Makefile.mk.in)
#############################################################################
#### Describe all "--with-*" arguments -- for the usage printout on "--help"
## Title
AC_ARG_WITH(title0,
[===============================================================================])
AC_ARG_WITH(title1,
[=============== NCBI C++ Toolkit specific configuration flags =================])
AC_ARG_WITH(title2,
[===============================================================================])
## Code generation
AC_ARG_WITH(debug,
[ --without-debug build non-debug versions of libs and apps])
AC_ARG_WITH(symbols,
[ --with-symbols retain debugging symbols in non-debug mode])
AC_ARG_WITH(optimization,
[ --without-optimization turn off optimization flags in non-debug mode])
AC_ARG_WITH(profiling,
[ --with-profiling build profiled versions of libs and apps])
AC_ARG_WITH(tcheck,
[ --with-tcheck(=DIR) build for Intel Thread Checker (in DIR)])
AC_ARG_WITH(dll,
[ --with-dll build all libraries as DLLs])
AC_ARG_WITH(static,
[ --with-static build all libraries statically even if --with-dll])
AC_ARG_WITH(static-exe,
[ --with-static-exe build all executables as statically as possible])
AC_ARG_WITH(plugin-auto-load,
[ --with-plugin-auto-load always enable the plugin manager by default])
AC_ARG_WITH(bundles,
[ --with-bundles build bundles in addition to dylibs on Mac OS X])
AC_ARG_WITH(bin-release,
[ --with-bin-release build executables suitable for public release])
AC_ARG_WITH(mt,
[ --with-mt compile in a MultiThread-safe manner])
AC_ARG_WITH(64,
[ --with-64 compile to 64-bit code])
AC_ARG_WITH(universal,
[ --with-universal build universal binaries on Mac OS X])
AC_ARG_WITH(universal2,
[ --with-universal=CPUs build universal binaries targeting the given CPUs])
AC_ARG_WITH(exe,
[ --without-exe do not build executables])
AC_ARG_WITH(runpath,
[ --with-runpath=PATH specify the usual runtime path to DLLs])
AC_ARG_WITH(relative-runpath,
[ --with-relative-runpath=P specify an executable-relative DLL search path])
AC_ARG_WITH(hard-runpath,
[ --with-hard-runpath hard-code runtime path, ignoring LD_LIBRARY_PATH])
AC_ARG_WITH(lfs,
[ --with-lfs enable large file support to the extent possible])
## Scripts, make features, and directory naming
AC_ARG_WITH(extra-action,
[ --with-extra-action= script to call after the configuration is complete])
AC_ARG_WITH(autodep,
[ --with-autodep automatic generation of dependencies (GNU make)])
AC_ARG_WITH(build-root,
[ --with-build-root=DIR specify a non-default build directory name])
AC_ARG_WITH(fake-root,
[ --with-fake-root=DIR appear to have been built under DIR])
AC_ARG_WITH(suffix,
[ --without-suffix no Release/Debug, MT or DLL sfx in the build dir name])
AC_ARG_WITH(hostspec,
[ --with-hostspec add full host specs to the build dir name])
AC_ARG_WITH(version,
[ --without-version don't always include the cplr ver in the bd name])
AC_ARG_WITH(build-root-sfx,
[ --with-build-root-sfx=X add a user-specified suffix to the build dir name])
AC_ARG_WITH(execopy,
[ --without-execopy do not copy built executables to the BIN area])
AC_ARG_WITH(bincopy,
[ --with-bincopy populate lib and bin with copies, not hard links])
AC_ARG_WITH(lib-rebuilds,
[ --with-lib-rebuilds ensure that apps use up-to-date libraries])
AC_ARG_WITH(lib-rebuilds2,
[ --with-lib-rebuilds=ask ask whether to update each app's libraries])dnl'
AC_ARG_WITH(deactivation,
[ --without-deactivation keep old copies of libraries that no longer build])
AC_ARG_WITH(makefile-auto-update,
[ --without-makefile-auto-update do not auto-update generated makefiles])
AC_ARG_WITH(projects,
[ --with-projects=FILE build projects listed in FILE by default])
AC_ARG_WITH(flat-makefile,
[ --without-flat-makefile do not generate an all-encompassing flat makefile])
AC_ARG_WITH(configure-dialog,
[ --with-configure-dialog allow interactive flat makefile project selection])
AC_ARG_WITH(saved-settings,
[ --with-saved-settings=F load configuration settings from the file F])
AC_ARG_WITH(check,
[ --with-check run test suite after the build])
AC_ARG_WITH(check-tools,
[ --with-check-tools=... use the specified tools for testing])
AC_ARG_WITH(ncbi-public,
[ --with-ncbi-public ensure compatibility for all in-house platforms])
AC_ARG_WITH(strip,
[ --with-strip strip binaries at build time])
AC_ARG_WITH(pch,
[ --with-pch use precompiled headers if possible])
AC_ARG_WITH(caution,
[ --with-caution cancel configuration unconditionally when in doubt])
AC_ARG_WITH(caution2,
[ --without-caution proceed without asking when in doubt])
AC_ARG_WITH(ccache,
[ --without-ccache do not automatically use ccache if available])
AC_ARG_WITH(distcc,
[ --without-distcc do not automatically use distcc if available])
## NCBI packages
AC_ARG_WITH(ncbi-c,
[ --without-ncbi-c do not use NCBI C Toolkit])
AC_ARG_WITH(sss,
[ --without-sss do not use NCBI SSS libraries])
AC_ARG_WITH(sssutils,
[ --without-utils do not use NCBI SSS UTIL library])
AC_ARG_WITH(sssdb,
[ --without-sssdb do not use NCBI SSS DB library])
AC_ARG_WITH(included-sss,
[ --with-included-sss use the in-tree copy of SSS])
## Third-party and system packages
AC_ARG_WITH(z,
[ --with-z=DIR use zlib installation in DIR])
AC_ARG_WITH(z2,
[ --without-z use internal copy of zlib])
AC_ARG_WITH(bz2,
[ --with-bz2=DIR use bzlib installation in DIR])
AC_ARG_WITH(bz2b,
[ --without-bz2 use internal copy of bzlib])
AC_ARG_WITH(lzo,
[ --with-lzo=DIR use LZO installation in DIR (requires 2.x or up)])
AC_ARG_WITH(lzo_,
[ --without-lzo do not use LZO])
AC_ARG_WITH(pcre,
[ --with-pcre=DIR use PCRE installation in DIR])
AC_ARG_WITH(pcre2,
[ --without-pcre use internal copy of PCRE])
AC_ARG_WITH(gnutls,
[ --with-gnutls=DIR use GNUTLS installation in DIR])
AC_ARG_WITH(gnutls2,
[ --without-gnutls do not use GNUTLS])
AC_ARG_WITH(openssl,
[ --with-openssl=DIR use OpenSSL installation in DIR])
AC_ARG_WITH(openssl2,
[ --without-openssl do not use OpenSSL])
AC_ARG_WITH(sybase,
[ --without-sybase do not use SYBASE libraries])
AC_ARG_WITH(sybase-local,
[ --with-sybase-local=DIR use local SYBASE install (DIR is optional)])
AC_ARG_WITH(sybase-new,
[ --with-sybase-new use newer SYBASE install (12.5 rather than 12.0)])
AC_ARG_WITH(ftds,
[ --without-ftds do not use FreeTDS libraries])
AC_ARG_WITH(ftds2,
[ --with-ftds=DIR use FreeTDS installation in DIR])
AC_ARG_WITH(ftds-renamed,
[ --without-ftds-renamed do not rename Sybase DBLIB symbols in built-in FTDS])
AC_ARG_WITH(mysql,
[ --without-mysql do not use MySQL])
AC_ARG_WITH(mysql2,
[ --with-mysql=DIR use MySQL installation in DIR])
AC_ARG_WITH(fltk,
[ --without-fltk do not use FLTK])
AC_ARG_WITH(fltk2,
[ --with-fltk=DIR use FLTK installation in DIR])
AC_ARG_WITH(opengl,
[ --without-opengl do not use OpenGL])
AC_ARG_WITH(opengl2,
[ --with-opengl=DIR use OpenGL installation in DIR])
AC_ARG_WITH(mesa,
[ --without-mesa do not use MESA off-screen OpenGL])
AC_ARG_WITH(mesa2,
[ --with-mesa=DIR use MESA installation in DIR])
AC_ARG_WITH(glut,
[ --without-glut do not use GLUT])
AC_ARG_WITH(glut2,
[ --with-glut=DIR use GLUT installation in DIR])
AC_ARG_WITH(glew,
[ --without-glew do not use GLEW])
AC_ARG_WITH(glew2,
[ --with-glew=DIR use GLEW installation in DIR])
AC_ARG_WITH(glew-mx,
[ --with-glew-mx insist on a multi-context-ready GLEW installation])
AC_ARG_WITH(wxwidgets,
[ --without-wxwidgets do not use wxWidgets (2.6+)])
AC_ARG_WITH(wxwidgets2,
[ --with-wxwidgets=DIR use wxWidgets installation in DIR])
AC_ARG_WITH(wxwidgets-ucs,
[ --with-wxwidgets-ucs use Unicode builds of wxWidgets])
AC_ARG_WITH(wxwidgets-ucs2,
[ --without-wxwidgets-ucs do not use Unicode builds of wxWidgets])
AC_ARG_WITH(freetype,
[ --without-freetype do not use FreeType])
AC_ARG_WITH(freetype_,
[ --with-freetype=DIR use FreeType installation in DIR])
AC_ARG_WITH(fastcgi,
[ --without-fastcgi do not use Fast-CGI library])
AC_ARG_WITH(fastcgi2,
[ --with-fastcgi=VERSION use Fast-CGI installation in \$NCBI/fcgi-VERSION])
AC_ARG_WITH(fastcgi3,
[ --with-fastcgi=DIR use Fast-CGI installation in DIR])
AC_ARG_WITH(bdb,
[ --without-bdb do not use Berkeley DB library])
AC_ARG_WITH(bdb,
[ --with-bdb=VERSION use DB installation in \$NCBI/BerkeleyDB-VERSION])
AC_ARG_WITH(bdb,
[ --with-bdb=DIR use Berkeley DB installation in DIR])
AC_ARG_WITH(sp,
[ --without-sp do not use SP libraries])
AC_ARG_WITH(orbacus,
[ --without-orbacus do not use ORBacus CORBA libraries])
AC_ARG_WITH(orbacus2,
[ --with-orbacus=DIR use ORBacus installation in DIR])
AC_ARG_WITH(odbc,
[ --with-odbc=DIR use ODBC installation in DIR])
AC_ARG_WITH(python,
[ --with-python=DIR use Python installation in DIR])
AC_ARG_WITH(python2,
[ --without-python do not use Python])
AC_ARG_WITH(jni,
[ --with-jni(=JDK-DIR) build Java bindings (against the JDK in JDK-DIR)])
AC_ARG_WITH(boost,
[ --with-boost=DIR use Boost installation in DIR])
AC_ARG_WITH(boost2,
[ --without-boost do not use Boost])
AC_ARG_WITH(boost-tag,
[ --with-boost-tag=TAG use TAG as the tag appended to Boost library names])
AC_ARG_WITH(boost-tag2,
[ --without-boost-tag use untagged Boost library names])
AC_ARG_WITH(sqlite3,
[ --with-sqlite3=DIR use SQLite 3.x installation in DIR])
AC_ARG_WITH(sqlite3b,
[ --without-sqlite3, do not use SQLite 3.x])
AC_ARG_WITH(icu,
[ --with-icu=DIR use ICU installation in DIR])
AC_ARG_WITH(icu2,
[ --without-icu, do not use ICU])
AC_ARG_WITH(expat,
[ --with-expat=DIR use Expat installation in DIR])
AC_ARG_WITH(expat2,
[ --without-expat, do not use Expat])
AC_ARG_WITH(sablot,
[ --with-sablot=DIR use Sablotron installation in DIR])
AC_ARG_WITH(sablot2,
[ --without-sablot, do not use Sablotron])
AC_ARG_WITH(libxml,
[ --with-libxml=DIR use libxml2 installation in DIR])
AC_ARG_WITH(libxml_,
[ --without-libxml do not use libxml2])
AC_ARG_WITH(libxslt,
[ --with-libxslt=DIR use libxslt installation in DIR])
AC_ARG_WITH(libxslt2,
[ --without-libxslt do not use libxstl])
AC_ARG_WITH(xerces,
[ --with-xerces=DIR use Xerces-C++ installation in DIR])
AC_ARG_WITH(xerces2,
[ --without-xerces, do not use Xerces-C++])
AC_ARG_WITH(xalan,
[ --with-xalan=DIR use Xalan-C++ installation in DIR])
AC_ARG_WITH(xalan2,
[ --without-xalan, do not use Xalan-C++])
AC_ARG_WITH(oechem,
[ --with-oechem=DIR use OpenEye OEChem installation in DIR])
AC_ARG_WITH(oechem2,
[ --without-oechem do not use OEChem])
AC_ARG_WITH(sge,
[ --with-sge=DIR use Sun Grid Engine installation in DIR])
AC_ARG_WITH(sge2,
[ --without-sge do not use Sun Grid Engine])
AC_ARG_WITH(muparser,
[ --with-muparser=DIR use muParser installation in DIR])
AC_ARG_WITH(muparser2,
[ --without-muparser do not use muParser])
AC_ARG_WITH(hdf5,
[ --with-hdf5=DIR use HDF5 installation in DIR])
AC_ARG_WITH(hdf5b,
[ --without-hdf5 do not use HDF5])
AC_ARG_WITH(gif,
[ --with-gif=DIR use lib(un)gif installation in DIR])
AC_ARG_WITH(gif2,
[ --without-gif do not use lib(un)gif])
AC_ARG_WITH(jpeg,
[ --with-jpeg=DIR use libjpeg installation in DIR])
AC_ARG_WITH(jpeg2,
[ --without-jpeg do not use libjpeg])
AC_ARG_WITH(png,
[ --with-png=DIR use libpng installation in DIR])
AC_ARG_WITH(png2,
[ --without-png do not use libpng])
AC_ARG_WITH(tiff,
[ --with-tiff=DIR use libtiff installation in DIR])
AC_ARG_WITH(tiff2,
[ --without-tiff do not use libtiff])
AC_ARG_WITH(xpm,
[ --with-xpm=DIR use libXpm installation in DIR])
AC_ARG_WITH(xpm2,
[ --without-xpm do not use libXpm])
AC_ARG_WITH(magic,
[ --with-magic=DIR use libmagic installation in DIR])
AC_ARG_WITH(magic2,
[ --without-magic do not use libmagic])
AC_ARG_WITH(curl,
[ --with-curl=DIR use libcurl installation in DIR])
AC_ARG_WITH(curl2,
[ --without-curl do not use libcurl])
AC_ARG_WITH(3psw,
[ --with-3psw=std:netopt favor standard (system) builds of the above pkgs.])
AC_ARG_WITH(3psw2,
[ --without-3psw do not use any of the above packages])
## Optional projects
AC_ARG_WITH(local-lbsm,
[ --without-local-lbsm turn off support for IPC with locally running LBSMD])
AC_ARG_WITH(ncbi-crypt,
[ --without-ncbi-crypt use a dummy stubbed-out version of ncbi_crypt])
AC_ARG_WITH(connext,
[ --without-connext do not build non-public CONNECT library extensions])
AC_ARG_WITH(serial,
[ --without-serial do not build the serialization library and tools])
AC_ARG_WITH(objects,
[ --without-objects do not generate/build serializeable objects from ASNs])
AC_ARG_WITH(dbapi,
[ --without-dbapi do not build database connectivity libraries])
AC_ARG_WITH(app,
[ --without-app do not build standalone applications like ID1_FETCH])
AC_ARG_WITH(ctools,
[ --without-ctools do not build NCBI C Toolkit based projects])
AC_ARG_WITH(gui,
[ --without-gui do not build most graphical projects])
AC_ARG_WITH(algo,
[ --without-algo do not build CPU-intensive algorithms])
AC_ARG_WITH(internal,
[ --without-internal do not build internal projects])
AC_ARG_WITH(gbench,
[ --with-gbench ensure that Genome Workbench can be built])
AC_ARG_WITH(gbench2,
[ --without-gbench do not build Genome Workbench])
## Manuals
AC_ARG_WITH(manuals,
[***** See also HTML documentation in ./doc/index.html *****])
#### Check the passed arguments against the list of available ones
x_with_list="\
debug symbols optimization profiling tcheck dll static static-exe bundles \
plugin-auto-load bin-release mt 64 universal exe runpath hard-runpath lfs \
autodep suffix hostspec version execopy bincopy lib-rebuilds lib-rebuilds=ask \
deactivation makefile-auto-update projects flat-makefile configure-dialog \
check ncbi-public strip pch caution ccache distcc \
ncbi-c wxwidgets wxwidgets-ucs fastcgi sss sssdb sssutils included-sss \
geo included-geo \
z bz2 lzo pcre gnutls openssl sybase sybase-local sybase-new \
ftds mysql orbacus freetype fltk opengl mesa glut glew glew-mx \
bdb python jni sqlite3 icu boost boost-tag \
sp expat sablot libxml libxslt xerces xalan oechem sge muparser hdf5 \
gif jpeg tiff png xpm magic curl 3psw \
local-lbsm ncbi-crypt connext \
serial objects dbapi app ctools gui algo internal gbench"
changequote(, )dnl
x_with_list=`echo "$x_with_list" | sed 's/\([^ ][^ ]*\)/--with-\1 --without-\1/g'`
changequote([, ])dnl
for x_arg in "$@" ; do
if test -z "$x_arg" ; then
continue
fi
x_okay=
for x_desc in $x_with_list ; do
if test "$x_arg" = "$x_desc" ; then
x_okay="okay"
break
fi
done
if test "$x_okay" = "okay" ; then
continue
fi
case "$x_arg" in
--with-extra-action= | --exec-prefix= | --with-projects= | --srcdir= \
| --cache-file= | --build= | --host= | --target= | --with-runpath= \
| --with-relative-runpath= | --x-includes= | --x-libraries= )
AC_MSG_ERROR([$x_arg: requires value; use --help to show usage])
;;
--with-extra-action=* | --with-build-root=* | --with-build-root-sfx=* \
| --with-fake-root=* | --with-saved-settings=* \
| --with-projects=* | --with-check=* | --with-check-tools=* \
| --with-universal=* | --with-tcheck=* \
| --cache-file=* | --build=* | --host=* | --prefix=* | --exec-prefix=* \
| --libdir=* | --bindir=* | --includedir=* | --srcdir=* \
| [[A-Z]*=*] \
| --with-z=* | --with-bz2=* | --with-lzo=* \
| --with-pcre=* \
| --with-gnutls=* | --with-openssl=* | --with-curl=* \
| --with-sybase-local=* | --with-wxwidgets=* \
| --with-ftds=* | --with-mysql=* | --with-fltk=* | --with-fastcgi=* \
| --with-sqlite3=* | --with-expat=* | --with-sablot=* \
| --with-icu=* | --with-xerces=* | --with-xalan=* \
| --with-libxml=* | --with-libxslt=* \
| --with-bdb=* | --with-odbc | --with-odbc=* \
| --with-python=* | --with-freetype=* | --with-gif=* | --with-jpeg=* \
| --with-png=* | --with-tiff=* | --with-xpm=* | --with-opengl=* \
| --with-mesa=* | --with-glut=* | --with-glew=* | --with-oechem=* \
| --with-boost=* | --with-boost-tag=* | --with-orbacus=* | --with-sge=* \
| --with-muparser=* | --with-hdf5=* | --with-jni=* | --with-magic=* \
| --x-includes=* | --x-libraries=* | --with-3psw=* \
| --target=* | --with-runpath=* | --with-relative-runpath=* \
| --no-create | --no-recursion)
;;
* )
AC_MSG_ERROR([$x_arg: unknown option; use --help to show usage])
;;
esac
done
if test "$with_gbench" = "yes" ; then
m4_foreach(OPT, [dll,mt,gui,exe,serial,objects,algo,glew_mx],
[if test "$[with_]OPT" = "no"; then
AC_MSG_ERROR([incompatible options: --without-]OPT[ but --with-gbench])
else
[with_]OPT=yes
fi
])
: ${with_projects=scripts/projects/ncbi_gbench.lst}
elif test "$with_jni" = "yes" ; then
m4_foreach(OPT, [dll,mt],
[if test "$[with_]OPT" = "no"; then
AC_MSG_ERROR([incompatible options: --without-]OPT[ but --with-jni])
else
[with_]OPT=yes
fi
])
: ${with_exe=no}
fi
if test "$with_bin_release" = "yes" ; then
# Default some other options accordingly
: ${with_ncbi_public=yes}
: ${with_dll=no}
: ${with_local_lbsm=no}
: ${with_ncbi_crypt=no}
: ${with_connext=no}
AC_DEFINE(NCBI_BIN_RELEASE, 1,
[Define to 1 when building binaries for public release.])
fi
if test "$with_debug" = no; then
: ${with_symbols=no}
: ${with_optimization=yes}
else
: ${with_symbols=yes}
: ${with_optimization=no}
fi
#### Check for special options
if test "$with_extra_action" = "yes" ; then
AC_MSG_ERROR([--with-extra-action must have a value after =])
fi
if test "$with_extra_action" = "no" ; then
AC_MSG_ERROR([--without-extra-action is not allowed])
fi
case "$with_projects" in
"") if test -r projects; then
AC_MSG_NOTICE([using default projects file "projects".])
with_projects=projects
AC_SUBST(PROJECTS, "\$(top_srcdir)/projects")
else
AC_SUBST(PROJECTS, "")
if test -f projects; then
AC_MSG_WARN([default projects file "projects" is unreadable.])
elif test -h projects; then
AC_MSG_WARN([default projects file "projects" is a dangling link.])
fi
fi
;;
no) with_projects="" ; AC_SUBST(PROJECTS, "") ;;
/*) AC_SUBST(PROJECTS, $with_projects) ;;
* ) AC_SUBST(PROJECTS, "\$(top_srcdir)/$with_projects") ;;
esac
#### Always define this
AC_DEFINE(NCBI_CXX_TOOLKIT, 1, [This is the NCBI C++ Toolkit.])
#### Get the running host's properties
AC_CONFIG_AUX_DIR(src/build-system)
AC_CANONICAL_HOST
AC_DEFINE_UNQUOTED(HOST, "$host", [Full GNU-style system type])
AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu", [CPU type only])
AC_DEFINE_UNQUOTED(HOST_VENDOR, "$host_vendor", [System vendor only])
AC_DEFINE_UNQUOTED(HOST_OS, "$host_os", [System OS only])
#### Make some provisions for traditional operation
AC_PROG_INSTALL
#### C and C++ compilers
AC_LANG(C++)
AC_PROG_CC
AC_PROG_CXX
#### Detect Insure++, and attempt to find the real compiler.
case "$CXX" in
insure* | */insure*)
psrcdump=`echo "$CXX" | sed -e 's/insure.*/psrcdump/'`
real_CXX=`$psrcdump -t insure++ | sed -ne 's/^Compiler \(.*\)/\1/p'`
real_dir=`$psrcdump -t insure++ | sed -ne 's/^Compilerinstalldir \(.*\)/\1/p'`
test -n "$real_dir" && test -x "$real_dir/$real_CXX" && \
real_CXX="$real_dir/$real_CXX"
case "$real_CXX" in
*gcc* ) LIBS="$LIBS -lstdc++"
esac
;;
*)
real_CXX=$CXX
;;
esac
#### Detect KCC compiler
if test "$GCC" != "yes" ; then
touch kcc_test.cpp
kcc_ver="`$real_CXX -V -c kcc_test.cpp 2>&1 | grep '^KAI '`"
kcc_license="`$real_CXX -V -c kcc_test.cpp 2>&1 | grep -v '^KAI '`"
rm -f kcc_test.cpp kcc_test.o
case "$kcc_ver" in
KAI* ) KCC="yes" ;;
esac
fi
#### Detect ICC compiler (newer versions of which configure can mis-ID as GCC)
if test "$KCC" != "yes"; then
icc_ver="`$real_CXX -V 2>&1 | grep '^Intel(R) C'`"
icc_license="`$real_CXX -c 2>&1 | grep '^icc: NOTE: The evaluation period for this product ends on '`"
case "$icc_ver" in
Intel*C*Compiler* ) ICC="yes"; GCC="no" ;;
esac
fi
#### Detect IBM VisualAge compiler
if test "$GCC" != "yes" -a "$KCC" != "yes" -a "$ICC" != "yes"; then
vac_ver="`$real_CXX -qversion 2>&1`"
case "$vac_ver" in
*AIX* ) VAC="yes" ;;
esac
fi
#### Detect Compaq compiler
if test "$GCC" != "yes" -a "$KCC" != "yes" -a "$ICC" != "yes" \
-a "$VAC" != "yes"; then
ccc_ver="`$real_CXX -V 2>&1 | grep '^Compaq C++ V'`"
case "$ccc_ver" in
*Compaq* ) CCC="yes" ;;
esac
fi
#### Detect supported compilers
compiler=
compiler_ver=
ncbi_compiler="UNKNOWN"
ncbi_compiler_ver="0"
if test "$GCC" = "yes" ; then
compiler_ver="`$real_CXX -dumpversion 2>&1`"
case "$compiler_ver" in
2.95* | 2.96* | 3.* | 4.* )
compiler="GCC"
ncbi_compiler="GCC"
ncbi_compiler_ver="$compiler_ver"
NCBI_FEATURE(GCC)
;;
esac
elif test "$KCC" = "yes" ; then
compiler_ver="$kcc_ver"
compiler="KCC"
ncbi_compiler="KCC"
ncbi_compiler_ver="`echo $kcc_ver | sed 's%^KAI .*C[[+]][[+]] \([[0-9.]]*\).*%\1%'`"
NCBI_FEATURE(KCC)
elif test "$ICC" = "yes" ; then
compiler_ver="$icc_ver"
compiler="ICC"
ncbi_compiler="ICC"
ncbi_compiler_ver="`echo $icc_ver | sed 's%.*Version \([[0-9.]]*\).*%\1%'`"
NCBI_FEATURE(ICC)
elif test "$VAC" = "yes" ; then
compiler_ver="$vac_ver"
compiler="VisualAge"
ncbi_compiler="VISUALAGE"
ncbi_compiler_ver="`echo $vac_ver | sed 's%.*[[Vv]]ersion:* 0*\([[0-9.]]*\).*%\1%'`"
NCBI_FEATURE(VisualAge)
elif test "$CCC" = "yes" ; then
compiler_ver="$ccc_ver"
compiler=Compaq
ncbi_compiler="COMPAQ"
ncbi_compiler_ver="`echo $ccc_ver | sed 's%.*C[[+]][[+]] V\([[0-9.]]*\).*%\1%'`"
NCBI_FEATURE(CompaqCompiler)
else
case "$host_os" in
solaris* )
compiler_ver="`$real_CXX -V 2>&1`"
case "$compiler_ver" in
*WorkShop*Compilers*5\.0 )
compiler="WorkShop5"
ncbi_compiler="WORKSHOP"
ncbi_compiler_ver="5.0" ;;
*Sun*WorkShop*6*5\.1* )
compiler="WorkShop51"
ncbi_compiler="WORKSHOP"
ncbi_compiler_ver="5.1" ;;
*Sun*WorkShop*6*5\.2* )
compiler="WorkShop52"
ncbi_compiler="WORKSHOP"
ncbi_compiler_ver="5.2" ;;
*Sun*WorkShop*6*5\.3* )
compiler="WorkShop53"
ncbi_compiler="WORKSHOP"
ncbi_compiler_ver="5.3" ;;
*Forte*7*5\.4* )
compiler="WorkShop54"
ncbi_compiler="WORKSHOP"
ncbi_compiler_ver="5.4" ;;
*Sun*C*5\.5* )
compiler="WorkShop55"
ncbi_compiler="WORKSHOP"
ncbi_compiler_ver="5.5" ;;
*Sun*C*5\.8* )
compiler="WorkShop58"
ncbi_compiler="WORKSHOP"
ncbi_compiler_ver="5.8" ;;
*Sun*C*5\.9* )
compiler="WorkShop59"
ncbi_compiler="WORKSHOP"
ncbi_compiler_ver="5.9" ;;
*Sun*C*5\.10* )
compiler="WorkShop510"
ncbi_compiler="WORKSHOP"
ncbi_compiler_ver="5.10" ;;
*Sun*C*5\.11* )
compiler="WorkShop511"
ncbi_compiler="WORKSHOP"
ncbi_compiler_ver="5.11" ;;
esac
NCBI_FEATURE(WorkShop)
;;
irix* )
compiler_ver="`$real_CXX -version 2>&1`"
case "$compiler_ver" in
MIPSpro*Compilers:*Version*7\.3* )
compiler="MIPSpro73"
ncbi_compiler="MIPSPRO"
ncbi_compiler_ver="7.3"
NCBI_FEATURE(MIPSpro)
;;
esac
;;
cygwin* )
case "$real_CXX" in
*cl\.exe* | cl)
compiler="MSVC"
ncbi_compiler="MSVC"
ncbi_compiler_ver="6.0"
NCBI_FEATURE(MSVC)
;;
esac
;;
esac
fi
changequote(, )dnl
#ncbi_compiler_ver="`echo $ncbi_compiler_ver | sed 's%\([0-9]\)\.\([0-9]\)\.\([0-9]\).*%\1\2\3%; s%\([0-9]\)\.\([0-9][0-9]*\).*%\1\2%; s%^\([0-9][0-9]\)$%\10%; s%^\([0-9]\)$%\100%'`"
case "$compiler:$ncbi_compiler_ver" in
WorkShop*:?.?? ) ncbi_compiler_sed='s/\([0-9]\)\.\([0-9][0-9]\)/\1\20/' ;;
WorkShop*:[6-9].?) ncbi_compiler_sed='s/\([0-9]\)\.\([0-9\)/\10\20/' ;;
ICC:??.? ) ncbi_compiler_sed='s/\([0-9][0-9]\)\.\([0-9]\)/\1\20/' ;;
*:?.?.?) ncbi_compiler_sed='s/\([0-9]\)\.\([0-9]\)\.\([0-9]\)/\1\2\3/' ;;
*:?.??*) ncbi_compiler_sed='s/\([0-9]\)\.\([0-9][0-9]\).*/\1\2/' ;;
*:?.?) ncbi_compiler_sed='s/\([0-9]\).\([0-9]\)/\1\20/' ;;
*:?) ncbi_compiler_sed='s/\([0-9]\)/\100/' ;;
esac
changequote([, ])dnl
ncbi_compiler_ver=`echo $ncbi_compiler_ver | sed "$ncbi_compiler_sed"`
compiler_version=$ncbi_compiler_ver
# Possible values of NCBI_COMPILER_$ncbi_compiler, since acconfig.h is obsolete
if false; then
AC_DEFINE(NCBI_COMPILER_GCC, 1, [Compiler name])
AC_DEFINE(NCBI_COMPILER_KCC, 1, [Compiler name])
AC_DEFINE(NCBI_COMPILER_ICC, 1, [Compiler name])
AC_DEFINE(NCBI_COMPILER_WORKSHOP, 1, [Compiler name])
AC_DEFINE(NCBI_COMPILER_MIPSPRO, 1, [Compiler name])
AC_DEFINE(NCBI_COMPILER_VISUALAGE, 1, [Compiler name])
AC_DEFINE(NCBI_COMPILER_COMPAQ, 1, [Compiler name])
AC_DEFINE(NCBI_COMPILER_MSVC, 1, [Compiler name])
AC_DEFINE(NCBI_COMPILER_UNKNOWN, 1, [Compiler name])
fi
AC_DEFINE_UNQUOTED(NCBI_COMPILER, "$ncbi_compiler", [Compiler name])
AC_DEFINE_UNQUOTED(NCBI_COMPILER_$ncbi_compiler, 1, [Compiler name])
AC_DEFINE_UNQUOTED(NCBI_COMPILER_VERSION, $ncbi_compiler_ver,
[Compiler version as three-digit integer])
#### Additional check for pre-defined compilers
case "$compiler:$compiler_version" in
MSVC:* )
if test -z "$NCBI_COMPILER" ; then
echo
echo "Compiler \"${compiler}\" requires a special tuning, so you"
echo "better use a special shell script located in \"compilers/*.sh\"!"
NCBI_CAUTION([Do you still want to proceed (at your own risk)?])
echo
fi ;;
esac
#### Use full path to the compiler, if possible
changequote(, )dnl
set $CC
x_CC="`type $1 | sed 's/.* \([^ ]*\)$/\1/'`"
if test ! -x "$x_CC" ; then
x_CC="`which $1 2>/dev/null`"
fi
if test -x "$x_CC" ; then
shift
CC="$x_CC $*"
echo "adjusted C compiler: $CC"
fi
CC_PATH="`dirname $x_CC`"
x_CC=
set $CXX
x_CXX="`type $1 | sed 's/.* \([^ ]*\)$/\1/'`"
if test ! -x "$x_CXX" ; then
x_CXX="`which $1 2>/dev/null`"
fi
if test -x "$x_CXX" ; then
shift
CXX="$x_CXX $*"
echo "adjusted C++ compiler: $CXX"
fi
CXX_PATH="`dirname $x_CXX`"
x_CXX=
if test "$with_static_exe" = "yes"; then
C_LINK='$(top_srcdir)/scripts/common/impl/favor-static $(CC)'
LINK='$(top_srcdir)/scripts/common/impl/favor-static $(CXX)'
else
C_LINK='$(CC)'
LINK='$(CXX)'
fi
### Which of these is better?
#compiler_root=`dirname CXX_PATH`
compiler_root=`echo $CXX | sed -ne 's:\(.*\)[/\\]bin[/\\].*:\1:p'`
changequote([, ])dnl
#### Multi-Thread safety
with_mt=${with_mt:="no"}
if test "$with_mt" = "yes" ; then
case "$host_os:$compiler" in
darwin* | irix* | cygwin*) ;;
solaris*:WorkShop* ) : ${MT_FLAG:="-mt"} ;;
solaris*:GCC ) : ${MT_FLAG:="-pthreads"} ;;
*:KCC ) : ${MT_FLAG:="--thread_safe"} ;;
*:Compaq | *:GCC | *:ICC ) : ${MT_FLAG:="-pthread"} ;;
*:VisualAge ) : ${MT_FLAG:="-qthreaded"} ;;
* ) AC_MSG_ERROR([Do not know how to build MT-safe with compiler $CXX $compiler_ver]) ;;
esac
CPPFLAGS="$CPPFLAGS -D_MT -D_REENTRANT -D_THREAD_SAFE"
case "$host_os:$compiler" in
solaris2.10:GCC ) : ${THREAD_LIBS:="-lposix4"} ;;
solaris* ) : ${THREAD_LIBS:="-lpthread -lposix4"} ;;
freebsd* ) ;; # -pthread already substitutes libc_r for libc
* ) : ${THREAD_LIBS:="-lpthread"} ;;
esac
LIBS="$LIBS $THREAD_LIBS"
case "$host_os:$compiler" in
solaris2.??:* | solaris*:GCC | *:Compaq | irix* | aix* | darwin* | cygwin*)
NCBIATOMIC_LIB=
;;
*:GCC | *:ICC | linux*:KCC )
case "$host_cpu" in
i?86 | powerpc* | ppc* | x86_64 | sparc* ) NCBIATOMIC_LIB= ;;
* ) NCBIATOMIC_LIB=xncbi ;;
esac
;;
*:WorkShop* | solaris*:KCC )
NCBIATOMIC_LIB=xncbi
ncbicntr="ncbicntr_workshop ncbiatomic_workshop"
;;
* ) NCBIATOMIC_LIB=xncbi ;;
esac
mt_sfx="MT"
NCBI_FEATURE(MT)
else
CPPFLAGS="$CPPFLAGS -DNCBI_WITHOUT_MT"
MT_FLAG=
THREAD_LIBS=
NCBIATOMIC_LIB=
mt_sfx=""
fi
MT_SFX="${mt_sfx}"
AC_SUBST(MT_SFX)
CFLAGS="$MT_FLAG $CFLAGS"
CXXFLAGS="$MT_FLAG $CXXFLAGS"
LDFLAGS="$MT_FLAG $LDFLAGS"
APP_LDFLAGS=
DLL_LDFLAGS=
case "$host_os:$compiler" in
darwin*:GCC )
AC_CACHE_CHECK([whether $CC supports -Wl,-rpath],
ncbi_cv_prog_cc_wl_rpath,
[orig_LDFLAGS=$LDFLAGS
LDFLAGS="-Wl,-rpath,. $LDFLAGS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
[ncbi_cv_prog_cc_wl_rpath=yes], [ncbi_cv_prog_cc_wl_rpath=no])
LDFLAGS=$orig_LDFLAGS])
;;
*:GCC | *:ICC )
AC_CACHE_CHECK([whether $CC supports -Wl,-E], ncbi_cv_prog_cc_wl_e,
[orig_LDFLAGS=$LDFLAGS
LDFLAGS="-Wl,-E $LDFLAGS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
[ncbi_cv_prog_cc_wl_e=yes], [ncbi_cv_prog_cc_wl_e=no])
LDFLAGS=$orig_LDFLAGS])
test "$ncbi_cv_prog_cc_wl_e" = no || APP_LDFLAGS="-Wl,-E $APP_LDFLAGS"
AC_CACHE_CHECK([whether $CC supports -Wl,--{en,dis}able-new-dtags],
ncbi_cv_prog_cc_new_dtags,
[orig_LDFLAGS=$LDFLAGS
LDFLAGS="-Wl,--enable-new-dtags $LDFLAGS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
[ncbi_cv_prog_cc_new_dtags=yes], [ncbi_cv_prog_cc_new_dtags=no])
LDFLAGS=$orig_LDFLAGS])
if test "$ncbi_cv_prog_cc_new_dtags" = yes; then
if test "$with_hard_runpath" = yes; then
LDFLAGS="-Wl,--disable-new-dtags $LDFLAGS"
else
LDFLAGS="-Wl,--enable-new-dtags $LDFLAGS"
fi
fi
;;
esac
#### Provide default environment setup for known platforms/compilers
DEPFLAGS="-M"
DEPFLAGS_POST="" # Needed for VisualAge
OBJCXX_CXXFLAGS=
OBJCXX_LIBS=
case "$host_os:$compiler" in
solaris2\.6:GCC )
echo "GCC compiler is not supported for: $host"
compiler=
;;
solaris*:GCC )
CPPFLAGS="-D_XOPEN_SOURCE=500 $CPPFLAGS"
STRIP="@:"
;;
linux*:ICC )
# "incomplete type is not allowed" should be an error, not a warning!
CFLAGS="-we70 $CFLAGS"
CXXFLAGS="-we70 $CXXFLAGS"
;;
irix*:GCC )
if test "$with_debug" != "no" ; then
LDFLAGS="-LD_LAYOUT:lgot_buffer=32 $LDFLAGS"
fi
;;
solaris*:WorkShop* )
CPPFLAGS="-D__EXTENSIONS__ $CPPFLAGS"
CXXFLAGS="+w +w2 $CXXFLAGS"
DEPFLAGS="-xM1"
LDFLAGS="-xildoff $LDFLAGS"
AR=${AR:="$CXX $MT_FLAG -xar -o"}
STRIP="@:"
if test "$with_symbols" = "no" -a "$with_profiling" != "yes" \
-a "$with_strip" = "yes" ; then
LDFLAGS="-s $LDFLAGS"
fi
# Recent versions default to DWARF, yielding much larger executables in
# debug configurations; insist on STABS when the choice exists, even for
# versions that already default to it.
case "$with_symbols:$compiler" in
no:* | *:WorkShop5[[0-4]] ) ;;
* )
CFLAGS="-xdebugformat=stabs $CFLAGS"
CXXFLAGS="-xdebugformat=stabs $CXXFLAGS"
;;
esac
CXX_FILTER="2>&1 | \$(top_srcdir)/compilers/unix/cxx_filter.WorkShop.sh"
LINK_FILTER="$CXX_FILTER"
AR_FILTER="$CXX_FILTER"
serial_ws50_rtti_kludge="rtti"
;;
irix*:MIPSpro73 )
COMMON_FLAGS="-fullwarn -brief_diagnostics -use_readonly_const -G0 -rdata_shared"
# Warnings we disable (messages courtesy of "gettxt cc.cat.m:N")
# 1107: A signed bit field has a length of 1 bit.
# 1169: External/internal linkage conflicts with a previous declaration.
# 1209: The controlling expression is constant. [while (0) et al.]
# 1424: The %n1 is not used in declaring the argument types of %n2.
# 1429: The type "long long" is nonstandard.
# 1460: Function %n is redeclared "inline" after being called.
# 1521: A nonstandard preprocessing directive is used.
CFLAGS="$COMMON_FLAGS -woff 1209 $CFLAGS"
CXXFLAGS="$COMMON_FLAGS -ansiW -ptused -FE:eliminate_duplicate_inline_copies -FE:template_in_elf_section -no_auto_include -LANG:std -LANG:ansi-for-init-scope -woff 1460,1521,1429,1169,1209,1107,1424 $CXXFLAGS"
: ${CXXCPP:="$CXX -E -LANG:std"}
LDFLAGS="-LANG:std -G0 -FE:eliminate_duplicate_inline_copies -FE:template_in_elf_section $LDFLAGS"
CPPFLAGS="-D__LONGLONG $CPPFLAGS"
CXX_FILTER="2>&1 | \$(top_srcdir)/compilers/unix/cxx_filter.$compiler.sh"
;;
cygwin*:GCC )
with_dll="no"
: ${NETWORK_LIBS:="-lws2_32"}
CONF_exe_ext=".exe"
;;
cygwin*:MSVC )
with_dll="no"
CFLAGS="/W4 /Od /Zi /DEBUG /D_DEBUG"
CXXFLAGS="/W4 /Od /Zi /DEBUG /D_DEBUG"
CPPFLAGS="/nologo $CPPFLAGS"
LDFLAGS="/DEBUG"
AR="lib.exe"
RANLIB=":"
STRIP="@:"
CONF_obj_ext=".obj"
CONF_lib_ext=".lib"
CONF_dll_ext=".dll"
CONF_lib_l_ext=".lib"
CONF_lib_pre=" "
CONF_lib_l_pre=" "
CONF_exe_ext=".exe"
CONF_f_compile="/c "
CONF_f_outobj="/Fo"
CONF_f_outlib="/OUT:"
CONF_f_libpath="/LIBPATH:"
CONF_f_outexe="/OUT:"
script_shell=""
make_shell=""
;;
*:VisualAge)
# 1506-1108 (I) The use of keyword '__attribute__' is non-portable.
CFLAGS="-qlanglvl=extc99 -qsuppress=1506-1108 $CFLAGS"
# 1540-1663 (W) Incorrect assignment of a restrict qualified pointer.
CXXFLAGS="-qrtti=all -qsuppress=1540-1663 $CXXFLAGS"
DEPFLAGS="-E -M"
DEPFLAGS_POST='>/dev/null 2>&1; (cat $*.u; rm -f $*.u)'
;;
*:Compaq)
CPPFLAGS="-D__USE_STD_IOSTREAM $CPPFLAGS"
CXXFLAGS="-tweak -nocompress -distinguish_nested_enums $CXXFLAGS"
DEPFLAGS="$DEPFLAGS -distinguish_nested_enums"
case "$host_os" in
osf*)
# Suppress link warnings; otherwise, we get "weak symbol multiply
# defined" all over the place.
LDFLAGS="-Wl,-S $LDFLAGS"
# The linker sometimes needs a LOT of memory.
LINK="ulimit -d \`ulimit -H -d\` && $LINK"
;;
esac
;;
darwin*:GCC)
# Per <http://fink.sourceforge.net/doc/porting/shared.php>, it was
# historically necessary to build plugins as Mach-O bundles rather than
# dynamic libraries. That's not such a big deal on modern Mac OS X
# versions, so the Toolkit now defaults to building only the latter.
CONF_dll_ext=".dylib"
if test "$with_bundles" = yes; then
CONF_loadable_ext=".so"
else
CONF_loadable_ext=".dylib"
fi
if $CXX -v 2>&1 | grep -q Apple; then
CFLAGS="-fpascal-strings $CFLAGS"
CXXFLAGS="-fno-permissive -fpascal-strings $CXXFLAGS"
# -flat_namespace is necessary for proper handling of shared libraries
# that don't themselves link against all their dependencies.
LDFLAGS="-flat_namespace $LDFLAGS"
if test "$with_ncbi_public" = yes; then
TARGET='-mmacosx-version-min=10.5'
if test -d /Developer/SDKs/MacOSX10.5.sdk; then
TARGET="-isysroot /Developer/SDKs/MacOSX10.5.sdk $TARGET"
fi
CC="$CC $TARGET"
CXX="$CXX $TARGET"
fi
else
LDFLAGS="-Wl,-flat_namespace $LDFLAGS"
fi
if test -f /usr/include/dlfcn.h; then
# may be able to do without /sw, so ignore it by default
:
elif test -f /sw/include/dlfcn.h; then
CPPFLAGS="-I/sw/include $CPPFLAGS"
LDFLAGS="-L/sw/lib $LDFLAGS"
else
AC_MSG_WARN([No dlfcn.h in /usr/include or /sw/include.])
fi
case "$CPPFLAGS $LIBS" in
*sw/*) ;;
*)
if test -d "$orig_NCBI/safe-sw"; then
CPPFLAGS="-I$orig_NCBI/safe-sw/include $CPPFLAGS"
LDFLAGS="-L$orig_NCBI/safe-sw/lib $LDFLAGS"
fi
;;
esac
: ${with_x=${with_xpm-no}}
# CPPFLAGS="-F/System/Library/Frameworks/CoreServices.framework/Frameworks $CPPFLAGS"
LIBS="-Wl,-framework,ApplicationServices $LIBS"
OBJCXX_CXXFLAGS='-x objective-c++'
OBJCXX_LIBS='-lobjc'
case `uname -m` in
*64 ) : ${with_64=yes} ;;
* ) : ${with_64=no} ;;
esac
;;
esac
#### Set makefile variables for platform-specific includes
changequote(, )dnl
COMPILER=`echo $ncbi_compiler | tr '[A-Z]' '[a-z]'`
OSTYPE=`echo $host_os | sed -e 's/[0-9.]*$//; s/-gnu[^-]*$//; y/A-Z/a-z/'`
changequote([, ])dnl
#### Check if the compiler matches one of supported compilers on this platform
if test -z "$compiler" ; then
cat <<EOF
Compiler $CXX $compiler_ver is not fully supported.
Consult doc/config.html\#ref_Compilers for the list of
fully supported platforms/compilers.
EOF
NCBI_CAUTION([Do you still want to proceed (at your own risk)?])
echo
compiler="UNKNOWN"
fi
#### Set compiler prefix for non-native compilers
case "$host_os:$compiler" in
*:GCC | *:KCC | *:ICC )
compiler_pfx="${compiler}-"
compiler_vpfx="${compiler}${compiler_version}-"
;;
esac
C_LIBS=$LIBS
ARCH_CPPFLAGS=
#### architecture settings, and extra C++ LIBS
if test "${with_universal-no}" != "no" ; then
bit64_sfx= #"Univ"
case "$host" in
*-*-darwin[[89]].* | *-*-darwin[[1-9]][[0-9]]* )
case "$with_universal" in
yes )
case "$with_64:$host_os" in
yes:darwin8.* )
AC_MSG_ERROR([Unable to build 64-bit universal binaries on $host])
;;
yes:* )
ARCH_CFLAGS="-arch ppc64 -arch x86_64"
ARCH_CPPFLAGS="-m64"
;;
* )
ARCH_CFLAGS="-arch ppc -arch i386"
ARCH_CPPFLAGS="-m32"
;;
esac
;;
* )
ARCH_CFLAGS="-arch `echo $with_universal | sed -e 's/,/ -arch /g'`"
ARCH_CPPFLAGS="-arch `echo $with_universal | sed -e 's/,.*//'`"
;;
esac
case "$host" in
p*pc*-*-darwin8.*)
# Must specify -isysroot ..., but only once; anyway, the preprocessor
# needs to see it, and naturally can't cope with multiple -arch flags.
# The -mmacosx-version-min flag avoids link errors under OS 10.5
# (Darwin 9), which otherwise tries to use crt1.10.5.o despite the
# request for a sysroot lacking that file.
SYSROOT="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4"
#ARCH_CFLAGS="$SYSROOT $ARCH_CFLAGS"
CC="$CC $SYSROOT"
CXX="$CXX $SYSROOT"
;;
esac
;;
* ) AC_MSG_ERROR([Do not know how to build universal binaries on $host]) ;;
esac
AC_DEFINE(NCBI_UNIVERSAL_BUILD, 1,
[Define to 1 if building universal (multi-architecture) binaries.])
with_distcc=no
elif test "$with_64" = "yes" ; then
bit64_sfx="64"
case "$host:$compiler" in
sparc-sun-solaris*:WorkShop5 | sparc-sun-solaris*:KCC )
ARCH_CFLAGS="-xtarget=ultra -xarch=v9"
;;
sparc-sun-solaris*:WorkShop51 )
ARCH_CFLAGS="-xtarget=ultra -xarch=v9"
LIBS="-Bstatic -L$CXX_PATH/../lib -lCstd -lCrun -Bdynamic $LIBS -lc"
;;
*solaris*:WorkShop59 | *solaris*:WorkShop51? )
ARCH_CFLAGS="-m64"
LIBS="-lCstd -lCrun $LIBS -lc"
;;
changequote(, )dnl
*solaris*:WorkShop5* )
ARCH_CFLAGS="-xtarget=generic64"
# Redundant for programs, but necessary for dlopen-able shared libs,
# at least in the x86 ReleaseMT configuration.
LIBS="-lCstd -lCrun $LIBS -lc"
;;
changequote([, ])dnl
mips*:GCC )
ARCH_CFLAGS="-mips64"
;;
*:GCC )
# May not work prior to GCC 3.1.
ARCH_CFLAGS="-m64"
case $host_os in darwin*) ARCH_CPPFLAGS="-m64" ;; esac
;;
mips-sgi-irix*:MIPSpro73 )
ARCH_CFLAGS="-64"
CPPFLAGS="$ARCH_CFLAGS $CPPFLAGS"
AR=${AR:="$CXX $ARCH_CFLAGS -ar -WR,-v -o"}
;;
mips-sgi-irix*:KCC )
ARCH_CFLAGS="-64"
;;
* )
AC_MSG_ERROR([Do not know how to compile 64-bit with compiler $CXX $compiler_ver $host:$compiler])
;;
esac
else
bit64_sfx=
ARCH_CFLAGS=
if test "$with_64" = "no" ; then
case "$host:$compiler" in
*solaris*:WorkShop* | *solaris*:KCC )
ARCH_CFLAGS="-xtarget=generic"
;;
mips*:GCC )
ARCH_CFLAGS="-mipsn32"
;;
*:GCC )
# May not work prior to GCC 3.1.
ARCH_CFLAGS="-m32"
case $host_os in darwin*) ARCH_CPPFLAGS="-m32" ;; esac
;;
mips-sgi-irix*:MIPSpro73 )
ARCH_CFLAGS="-n32"
CPPFLAGS="$ARCH_CFLAGS $CPPFLAGS"
AR=${AR:="$CXX $ARCH_CFLAGS -ar -WR,-v -o"}
;;
mips-sgi-irix*:KCC )
ARCH_CFLAGS="-n32"
;;
* )
# Just a warning, since 32-bit mode is typically the default anyway...
AC_MSG_WARN([Do not know how to compile 32-bit with compiler $CXX $compiler_ver $host:$compiler])
;;
esac
fi
case "$host:$compiler" in
*solaris*:WorkShop5 )
LIBS="-Bstatic -L$CXX_PATH/../SC5.0/lib -lm -Bdynamic $LIBS"
MATH_LIBS=" "
;;
*solaris*:WorkShop51 )
LIBS="-Bstatic -L$CXX_PATH/../lib -lCstd -lCrun -lm -Bdynamic $LIBS -lc"
MATH_LIBS=" "
;;
sparc-sun-solaris*:WorkShop54 )
# Using this (still very conservative) non-generic XARCH flavor allows
# compiler to use the extended instruction set which reportedly speeds
# up the locking of at least some STL classes by allowing them to use
# atomic increment instead of mutex; also seems to fix something that
# caused misterios basic_string<> related crashes in the
# WorkShop54 -xarch=v8 -mt configuration).
ARCH_CFLAGS="-xarch=v8plus"
LIBS="-lCstd $LIBS -lCrun -lc"
;;
changequote(, )dnl
*solaris*:WorkShop5* )
# MATH_LIBS=" "
# Redundant for programs, but necessary for dlopen-able shared libs,
# at least in the x86 ReleaseMT configuration.
LIBS="-lCstd $LIBS -lCrun -lc"
;;
changequote([, ])dnl
*irix*:MIPSpro73 | *irix*:KCC )
ARCH_CFLAGS="-n32"
;;
esac
fi
case "$host_os:$host_cpu" in
linux*:alpha*)
ARCH_CFLAGS="-mieee $ARCH_CFLAGS"
;;
esac
CPPFLAGS="$ARCH_CPPFLAGS $CPPFLAGS"
CFLAGS="$ARCH_CFLAGS $CFLAGS"
CXXFLAGS="$ARCH_CFLAGS $CXXFLAGS"
LDFLAGS="$ARCH_CFLAGS $LDFLAGS"
: ${MATH_LIBS:="-lm"}
### Math lib to be always linked in
LIBS="$MATH_LIBS $LIBS"
C_LIBS="$MATH_LIBS $C_LIBS"
if test -n "$with_64"; then
AC_CACHE_CHECK([whether this system supports --with(out)-64],
ncbi_cv_sys_with64_ok,
[AC_LINK_IFELSE([
AC_LANG_PROGRAM([#include <string>],
[std::string* sp = new std::string("foo");])],
ncbi_cv_sys_with64_ok=yes, ncbi_cv_sys_with64_ok=no)])
if test "$ncbi_cv_sys_with64_ok" = no; then
AC_MSG_ERROR([cannot continue; please try different options])
fi
fi
### large file support (switch to AC_SYS_LARGEFILE?)
case "$host_os:$compiler:$compiler_version" in
*:GCC:3[[4-9]]* | *:GCC:[[4-9]]* | *:ICC:[[91]]* ) : ${with_lfs=yes} ;;
esac
if test "$with_lfs" = "yes" ; then
LFSFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
CPPFLAGS="$LFSFLAGS $CPPFLAGS"
fi
#### Flags to enable (potentially unsafe) extra optimization.
if test -z "$DEF_FAST_FLAGS" -o -z "$FAST_CXXFLAGS" ; then
case "$compiler:$compiler_version" in
GCC:2* | GCC:344 )
# GCC 2.9x sometimes experiences internal errors at high optimization;
# GCC 3.4.4 (at least on FreeBSD) meanwhile generates crashprone code.
DEF_FAST_FLAGS="-O2"
;;
GCC:* )
DEF_FAST_FLAGS="-O9 -finline-functions -fstrict-aliasing"
case "$host_os" in
freebsd* ) ;;
* ) DEF_FAST_FLAGS="$DEF_FAST_FLAGS -ffast-math" ;;
esac
if test "$with_profiling" != "yes"; then
# incompatible with -pg
DEF_FAST_FLAGS="$DEF_FAST_FLAGS -fomit-frame-pointer"
fi
;;
WorkShop5[[89]]* | WorkShop510 )
# Limit optimization to -xO2 (-O now maps to -xO3) due to compiler bugs.
subst='s/[[ ]]-x*O[[1-9]]*//g'
CFLAGS="` echo \" $CFLAGS\" | sed -e \"$subst\"` -xO2"
CXXFLAGS="`echo \" $CXXFLAGS\" | sed -e \"$subst\"` -xO2"
LDFLAGS="` echo \" $LDFLAGS\" | sed -e \"$subst\"` -xO2"
DEF_FAST_FLAGS="-xO2"
;;
WorkShop* )
DEF_FAST_FLAGS="-fast"
case "$with_ncbi_public:$host_cpu" in
yes:sparc* )
DEF_FAST_FLAGS="$DEF_FAST_FLAGS -xtarget=ultra"
;;
*:i?86)
case "$compiler_ver" in
*5.[[0-4]]*)
# Work around a WorkShop standard library bug.
DEF_FAST_FLAGS="$DEF_FAST_FLAGS -D_RWSTD_NO_TEST_AND_SET"
;;
esac
;;
esac
# (Re)include ARCH_CFLAGS here because -fast implies -xtarget=native.
DEF_FAST_FLAGS="$DEF_FAST_FLAGS $ARCH_CFLAGS"
;;
KCC:* )
DEF_FAST_FLAGS="+K3"
case "$host_os" in
solaris* ) DEF_FAST_FLAGS="$DEF_FAST_FLAGS -fast $ARCH_CFLAGS" ;;
esac
;;
ICC:* )
if test "$with_mt" = "yes" -a "$compiler_version" -lt 800; then
DEF_FAST_FLAGS="-O3 -ip"
elif test "$compiler_version" -ge 800 -a "$compiler_version" -lt 900; then
DEF_FAST_FLAGS="-O2"
else
DEF_FAST_FLAGS="-O3 -axW -ip"
fi
;;
MIPSpro* )
# -Ofast would be preferable, but runs into resource limits when
# building libxblast.so. :-/
DEF_FAST_FLAGS="-O2"
;;
Compaq:* )
DEF_FAST_FLAGS="-fast"
;;
* )
DEF_FAST_FLAGS="-O"
;;
esac
else
DEF_FAST_FLAGS="-O"
fi
: ${FAST_CFLAGS="$DEF_FAST_FLAGS"}
: ${FAST_CXXFLAGS="$DEF_FAST_FLAGS"}
: ${FAST_LDFLAGS="$DEF_FAST_FLAGS"}
#### DLLs
# Generate position-independent code (PIC)
if test -z "$CFLAGS_DLL" -a -z "$CXXFLAGS_DLL" ; then
case "$host_os:$compiler" in
darwin*:GCC )
CFLAGS_DLL="-fno-common"
CXXFLAGS_DLL="-fno-common"
;;
*:GCC | linux* )
CFLAGS_DLL="-fPIC"
CXXFLAGS_DLL="-fPIC"
;;
solaris*:WorkShop* | irix*:MIPSpro73 | \
solaris*:KCC | irix*:KCC )
CFLAGS_DLL="-KPIC"
CXXFLAGS_DLL="-KPIC"
;;
esac
fi
# Flag for setting the runtime library search path
if test -z "$CONF_f_runpath" ; then
case "$host_os:$compiler" in
solaris* )
CONF_f_runpath="-R"
;;
linux*:GCC | *bsd*:GCC | cygwin*:GCC | osf*:GCC | gnu*:GCC )
CONF_f_runpath="-Wl,-rpath,"
;;
linux*:ICC )
# trying to use "-Wl,-rpath," here sends "ld" to endless 100% CPU loop
CONF_f_runpath="-Xlinker -rpath -Xlinker "
;;
irix*:* | linux*:KCC | *:Compaq )
CONF_f_runpath="-rpath "
;;
darwin* )
test "$ncbi_cv_prog_cc_wl_rpath" = no || CONF_f_runpath="-Wl,-rpath,"
;;
esac
fi
case "$host_os:$ncbi_cv_prog_cc_wl_rpath" in
linux*|solaris* )
origin="'\$\$ORIGIN'"
RUNPATH_ORIGIN="$CONF_f_runpath$origin"
;;
darwin*:yes )
origin='@executable_path'
RUNPATH_ORIGIN="$CONF_f_runpath$origin"
;;
* )
origin=
RUNPATH_ORIGIN="-DNCBI_RPO_SUFFIX_EATER="
;;
esac
case "$compiler:$compiler_version:$with_bin_release" in
GCC:*:yes )
libstdcxx=`$CXX $LDFLAGS -print-file-name=libstdc++.a`
case "$libstdcxx" in
/*)
LIBS="$libstdcxx $LIBS"
LINK=$C_LINK
;;
*)
AC_MSG_WARN([Unable to find static libstdc++ requested by --with-bin-release.])
;;
esac
;;
GCC:* )
# Need to specify runpath for compiler-provided libraries
case $compiler_version in
30* ) major=3 ;;
31* ) major=4 ;;
3[[23]]*) major=5 ;;
* ) major=6 ;;
esac
found=false
for f in libstdc++.so.$major libgcc_s.so.1 libstdc++.a; do
path=`$CXX $LDFLAGS -print-file-name=$f`
dir=`dirname "$path"`
abs_dir=`cd "$dir" && pwd`
case "$dir:$abs_dir" in
*:/lib | *:/usr/lib | *:/usr/lib32 | *:/usr/lib64 )
# no rpath needed
break
;;
/* )
fgrep -qsx $abs_dir /etc/ld.so.conf.d/* || found=true
break
;;
esac
done
if test "$found" = "true" -a -n "$CONF_f_runpath"; then
LDFLAGS="$CONF_f_runpath$dir $LDFLAGS"
case "$host_os" in
osf*)
# the linker doesn't merge -rpath flags...
CONF_f_runpath="$CONF_f_runpath$dir:"
;;
esac
fi
;;
ICC:6* )
# Seems to use libcxa.so.1 even without -i_dynamic...
LDFLAGS="$CONF_f_runpath$compiler_root/lib $LDFLAGS"
;;
ICC:7* )
# Favor the static version, as libcxa.so.3 isn't exactly common....
# (Undocumented, and unavailable at all in older versions. :-/)
LDFLAGS="-static-libcxa $LDFLAGS"
;;
ICC:8* )
# In principle, these settings should work, and avoid the need to
# depend on Intel's libraries at runtime.
# APP_LDFLAGS="-static-libcxa $APP_LDFLAGS"
# DLL_LDFLAGS="-nodefaultlibs $DLL_LDFLAGS"
# In practice, they can break applications that use plugins. :-/
LDFLAGS="$CONF_f_runpath$compiler_root/lib $LDFLAGS"
;;
ICC:9* )
# -i-static moved from common LDFLAGS to accommodate those few
# DLLs (plugins for external programs such as Python) that need to
# link ICC's libraries dynamically.
APP_LDFLAGS="-i-static $APP_LDFLAGS"
DLL_LDFLAGS="-i-static -nodefaultlibs $DLL_LDFLAGS"
# Running icpc on a bunch of object files doesn't always ensure that
# the C++ standard library is actually linked in, and we shouldn't
# rely on help from wrapper scripts.
LINK="$LINK -Kc++"
;;
ICC:1???:* )
APP_LDFLAGS="-i-static $APP_LDFLAGS"
DLL_LDFLAGS="-i-static -nodefaultlibs $DLL_LDFLAGS"
# Redundant for apps, but necessary for plugins to be adequately
# self-contained, at least on 32-bit Linux.
LIBS="$LIBS -lstdc++"
LINK="$LINK -Kc++"
# Defining _GCC_NEXT_LIMITS_H ensures that <limits.h> chaining doesn't
# stop short, as can otherwise happen. :-/
CPPFLAGS="$CPPFLAGS -D_GCC_NEXT_LIMITS_H"
;;
esac
# DLLs and profiling don't mix on all platforms
if test "$with_profiling" = "yes" ; then
case "$host_os" in
linux*) # any others?
case "$with_dll" in
yes) AC_MSG_ERROR([This platform does not support DLL profiling.])
;;
no) ;;
*) with_dll=no ;;
esac
;;
esac
fi
# Whether to build DLLs or static (and whether by default, or forcibly)
LIB_OR_DLL="lib"
if test "$with_dll" = "yes" ; then
case "$host_os:$compiler" in
linux*:GCC | irix*:* | solaris*:WorkShop* | *:KCC | linux*:ICC \
| solaris*:GCC | osf*:* | darwin*:GCC | freebsd*:GCC )
;;
* )
echo
echo "DLLs may not be buildable by $CXX $compiler_ver on $host!"
NCBI_CAUTION([Do you still want to try build DLLs (at your own risk)?])
echo
;;
esac
fi
case "$with_dll:$with_static" in
yes:yes) LIB_OR_DLL="both"; dll_sfx="DLL+static" ;;
yes:*) LIB_OR_DLL="dll"; dll_sfx="DLL" ;;
*:no) AC_MSG_ERROR([--without-static requires --with-dll]) ;;
*) LIB_OR_DLL="lib"; dll_sfx="" ;;
esac
DLL=
DLL_LIB_SETTING='$(DLL_DLIB)'
IF_WITH_DLL=
UNLESS_WITH_DLL='# '
STATIC="-static"
USUAL_AND_DLL=both
USUAL_AND_LIB=both
case "$LIB_OR_DLL" in
dll)
STATIC=
USUAL_AND_DLL=dll
;;
lib)
DLL=-dll
DLL_LIB_SETTING='$(DLL_LIB)'
IF_WITH_DLL='# '
UNLESS_WITH_DLL=
USUAL_AND_LIB=lib
;;
esac
AC_SUBST(DLL)
AC_SUBST(DLL_LIB_SETTING)
AC_SUBST(IF_WITH_DLL)
AC_SUBST(UNLESS_WITH_DLL)
AC_SUBST(STATIC)
AC_SUBST(USUAL_AND_DLL)
AC_SUBST(USUAL_AND_LIB)
#### GNU compiler:: common flags and definitions
if test "$compiler" = "GCC" ; then
CFLAGS="-Wall -Wno-format-y2k $CFLAGS"
CXXFLAGS="-Wall -Wno-format-y2k $CXXFLAGS"
case "$compiler_version" in
2* ) CXXFLAGS="-ftemplate-depth-32 $CXXFLAGS" ;;
esac
case "$host_os" in
solaris* ) CPPFLAGS="-D__EXTENSIONS__ $CPPFLAGS" ;;
irix* ) CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS" ;;
esac
# orig_CFLAGS=$CFLAGS
# orig_CXXFLAGS=$CXXFLAGS
# flag=-fno-merge-debug-strs
# CFLAGS="$flag $CFLAGS"
# CXXFLAGS="$flag $CXXFLAGS"
# AC_CACHE_CHECK([whether GCC supports $flag], ncbi_cv_prog_gcc_nomerge,
# [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],
# ncbi_cv_prog_gcc_nomerge=yes,
# ncbi_cv_prog_gcc_nomerge=no)])
# if test "$ncbi_cv_prog_gcc_nomerge" = no; then
# CFLAGS=$orig_CFLAGS
# CXXFLAGS=$orig_CXXFLAGS
# fi
fi
#### KAI compiler:: common flags and definitions
if test "$compiler" = "KCC" ; then
AR=${AR:="$CXX $MT_FLAG -o"}
CFLAGS="--display_error_number --c $CFLAGS"
CXXFLAGS="--display_error_number --one_instantiation_per_object $CXXFLAGS"
case "$host_os" in
solaris* ) CPPFLAGS="-D__EXTENSIONS__ -D__STDC__=0 $CPPFLAGS" ;;
esac
fi
#### Intel compiler:: common flags and definitions
if test "$compiler" = "ICC" ; then
if test -n "$icc_license" ; then
icc_CC="$CC"
icc_CXX="$CXX"
CC="./compilers/unix/cxx_filter.ICC.sh $CC"
CXX="./compilers/unix/cxx_filter.ICC.sh $CXX"
fi
fi
#### How to ensure that the compiler will account for potential aliasing
case "$compiler" in
GCC ) NO_STRICT_ALIASING=-fno-strict-aliasing ;;
ICC ) NO_STRICT_ALIASING='-falias -ffnalias' ;;
WorkShop* ) NO_STRICT_ALIASING='-xalias_level=any' ;;
* ) NO_STRICT_ALIASING=
esac
#### Automatic generation of dependencies for/by the "make" utility
case "$host_os" in
solaris* ) KeepStateTarget=".KEEP_STATE:" ;;
esac
if test "$with_autodep" = "yes" ; then
Rules="rules_with_autodep"
elif test "$with_autodep" = "no" ; then
Rules="rules"
elif make --version 2>/dev/null | grep 'GNU Make' >/dev/null ; then
Rules="rules_with_autodep"
else
Rules="rules"
fi
### Support for precompiled headers
GCCPCH="#"
if test "$compiler" = GCC -a "$with_pch" = "yes" \
-a "${with_universal-no}" = "no"; then
AC_CACHE_CHECK([whether $CXX supports precompiled headers], ncbi_cv_cxx_pch,
[echo '#include <iostream>' > conftest.hpp
echo $CXX $CPPFLAGS $CXXFLAGS -xc++-header -c conftest.hpp >&AS_MESSAGE_LOG_FD
if $CXX $CPPFLAGS $CXXFLAGS -xc++-header -c conftest.hpp >&AS_MESSAGE_LOG_FD 2>&1 \
&& test -f conftest.hpp.gch; then
ncbi_cv_cxx_pch=yes
else
ncbi_cv_cxx_pch=no
fi])
if test "$ncbi_cv_cxx_pch" = "yes"; then
if test "$Rules" = "rules"; then
AC_MSG_WARN([Your version of make does not fully support PCH-related dependencies.])
fi
CXXFLAGS="-DNCBI_USE_PCH $CXXFLAGS"
GCCPCH=""
fi
fi
#### Tools
AC_PROG_LN_S
AC_PROG_RANLIB
AC_CHECK_PROG(AR, ar, ar cr, ErrorCannotFind_AR)
if test "x$RANLIB" != "x:"; then
AC_CACHE_CHECK([ranlib's effectiveness], ncbi_cv_prog_ranlib_effect,
[AC_LANG_CONFTEST([AC_LANG_SOURCE([[int libfunc(void) { return 0; }]])])
echo $CXX $CPPFLAGS $CXXFLAGS -c conftest.$ac_ext >&AS_MESSAGE_LOG_FD
$CXX $CPPFLAGS $CXXFLAGS -c conftest.$ac_ext >&AS_MESSAGE_LOG_FD 2>&1
echo $AR conftest.a conftest.o >&AS_MESSAGE_LOG_FD
$AR conftest.a conftest.o >&AS_MESSAGE_LOG_FD 2>&1
save_LIBS=$LIBS
LIBS="conftest.a $LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern int libfunc(void);]],
[[return libfunc();]])],
[ok_without=true], [ok_without=false])
echo $RANLIB conftest.a >&AS_MESSAGE_LOG_FD
$RANLIB conftest.a >&AS_MESSAGE_LOG_FD
AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern int libfunc(void);]],
[[return libfunc();]])],
[ok_with=true], [ok_with=false])
LIBS=$save_LIBS
case $ok_with:$ok_without in
true:false) ncbi_cv_prog_ranlib_effect=positive ;;
false:true) ncbi_cv_prog_ranlib_effect=negative ;;
true:true) ncbi_cv_prog_ranlib_effect=neutral ;;
false:false) ncbi_cv_prog_ranlib_effect=unknown ;;
esac
])
case "$ncbi_cv_prog_ranlib_effect" in
negative) RANLIB=: ;;
unknown)
AC_MSG_WARN([Failed to make a working library with or without ranlib.])
;;
esac
fi
if test "$with_strip" = yes; then
AC_CHECK_PROG(STRIP, strip, strip, @:)
AC_CACHE_CHECK([whether strip loses runtime type information],
ncbi_cv_strip_loses_rtti,
[if test "$cross_compiling" = yes; then
case "$host_os" in
darwin* ) ncbi_cv_strip_loses_rtti=yes ;;
# No problems observed elsewhere so far.
* ) ncbi_cv_strip_loses_rtti=no ;;
esac
else
AC_LANG_CONFTEST([AC_LANG_PROGRAM(
[[#include <iostream>
#include <typeinfo>
struct SomeStruct { };]],
[[std::cout << typeid(SomeStruct).name();]])])
echo $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o conftest$ac_exeext \
conftest.$ac_ext >&AS_MESSAGE_LOG_FD
$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o conftest$ac_exeext \
conftest.$ac_ext >&AS_MESSAGE_LOG_FD 2>&1
$STRIP conftest$ac_exeext
if (ulimit -c 0; ./conftest$ac_exeext) >/dev/null 2>&1; then
ncbi_cv_strip_loses_rtti=no
else
ncbi_cv_strip_loses_rtti=yes
fi
rm -rf conftest*
fi])
if test "$ncbi_cv_strip_loses_rtti" = "yes"; then
NCBI_CAUTION([Do you still want to proceed (at your own risk)?])
fi
else
STRIP=@:
fi
# When using ccache and distcc together, ccache needs to be primary,
# so look for distcc(.sh) first.
if test -x $orig_NCBI/bin/distcc.sh ; then
: ${DISTCC=$orig_NCBI/bin/distcc.sh}
: ${with_distcc=yes}
fi
if test "$with_distcc" = "yes" ; then
AC_CHECK_PROG(DISTCC, distcc, distcc, [])
if test -n "$DISTCC" ; then
# Test distcc reasonably thoroughly to avoid possible gotchas.
cat > distcctest.c << EOF
#include <stddef.h>
#if !defined(__GNUC__) && !defined(offsetof)
# define offsetof(T, F) ((size_t)((char*) &(((T*) 0)->F) - (char*) 0))
#endif
struct S { int x; };
int f() { return offsetof(struct S, x); }
EOF
DISTCC_FALLBACK=0
export DISTCC_FALLBACK
AC_CACHE_CHECK([whether any distcc servers are available],
ncbi_cv_prog_distcc_servers,
[$DISTCC $CC -c distcctest.c 2>&AS_MESSAGE_LOG_FD
case $? in
# 102: bind failed
# 103: connect failed
# 106: bad hostspec
# 107: I/O error
# 109: protocol error
# 113: access denied
# 116: no hosts defined
102 | 103 | 106 | 107 | 109 | 113 | 116 )
ncbi_cv_prog_distcc_servers=no ;;
* )
ncbi_cv_prog_distcc_servers=yes ;;
esac])
if test "$ncbi_cv_prog_distcc_servers" = no; then
AS_UNSET(DISTCC)
fi
if test -n "$DISTCC" ; then
AC_CACHE_CHECK([whether $DISTCC is compatible with $CC],
ncbi_cv_prog_distcc_vs_cc,
[if $DISTCC $CC -c distcctest.c 2>&AS_MESSAGE_LOG_FD ; then
ncbi_cv_prog_distcc_vs_cc=yes
else
ncbi_cv_prog_distcc_vs_cc=no
fi])
if test "$ncbi_cv_prog_distcc_vs_cc" = yes; then
CC_WRAPPER="$DISTCC $CC_WRAPPER"
else
AS_UNSET(DISTCC)
fi
fi
if test -n "$DISTCC" ; then
AC_CACHE_CHECK([whether $DISTCC is compatible with $CXX],
ncbi_cv_prog_distcc_vs_cxx,
[mv distcctest.c distcctest.cpp
if $DISTCC $CXX -c distcctest.cpp 2>&AS_MESSAGE_LOG_FD ; then
ncbi_cv_prog_distcc_vs_cxx=yes
else
ncbi_cv_prog_distcc_vs_cxx=no
fi])
if test "$ncbi_cv_prog_distcc_vs_cxx" = yes; then
CXX_WRAPPER="$DISTCC $CXX_WRAPPER"
else
AS_UNSET(DISTCC)
fi
fi
rm -f distcctest.*
elif test "$with_distcc" = "yes" ; then
AC_MSG_WARN([distcc explicitly requested, but not found in PATH.])
fi
fi
if test -z "$with_ccache" -a -n "$DISTCC" -a -z "$CCACHE_DIR" ; then
# Using CCACHE together with DISTCC causes problems when the involved DISTCC
# servers share the same home dir, as in that case the caches from
# different servers can mix up rather badly, corrupting each other.
# On the other hand, most NCBI accounts have $CCACHE_DIR automatically set
# to a non-shared, per-machine location (such as "/tmp/.ccache-username").
with_ccache="no"
fi
if test "$with_ccache" != "no"; then
AC_CHECK_PROG(CCACHE, ccache, ccache, [])
if test -n "$CCACHE" ; then
if test -n "$CC_WRAPPER"; then
CC_WRAPPER="CCACHE_PREFIX=$CC_WRAPPER $CCACHE"
else
CC_WRAPPER=$CCACHE
fi
if test -n "$CXX_WRAPPER"; then
CXX_WRAPPER="CCACHE_PREFIX=$CXX_WRAPPER $CCACHE"
else
CXX_WRAPPER=$CCACHE
fi
elif test "$with_ccache" = "yes"; then
AC_MSG_WARN([ccache explicitly requested, but not found in PATH.])
fi
fi
# Note the path, since syntax is version-specific....
AC_PATH_PROG(TAIL, tail)
AC_MSG_CHECKING([whether $TAIL accepts modern syntax (-n N)])
if $TAIL -n 1 config.log >/dev/null 2>&1; then
TAIL_N="$TAIL -n "
AC_MSG_RESULT(yes)
else
TAIL_N="$TAIL -"
AC_MSG_RESULT(no)
fi
AC_PATH_PROG(TOUCH, touch, [], /bin:/usr/bin:$PATH)
AC_PROG_EGREP
AC_MSG_CHECKING([how to run $EGREP quietly])
if test -z "`echo foo | $EGREP -q fo+ 2>>config.log || echo $?`"; then
EGREP_Q="$EGREP -q"
elif test -z "`echo foo | $EGREP -s fo+ 2>>config.log || echo $?`"; then
EGREP_Q="$EGREP -s"
else
EGREP_Q=">/dev/null $EGREP"
fi
AC_MSG_RESULT($EGREP_Q)
AC_CHECK_PROG(VALGRIND_PATH, valgrind, valgrind)
#### Check if "${build_root}" is defined; provide a default one
if test -n "${with_build_root}" ; then
build_root=${with_build_root}
fi
### Possibly add the version to the build directory name, but preseve
### the original default when reconfiguring.
if test -z "${with_version}" -a -n "${ac_cv_header_stdc}"; then
with_version=${ncbi_cv_with_version:-no}
fi
if test -z "${build_root}" ; then
build_root="${srcdir}/${compiler}"
case "$compiler:$with_version" in
*[[0-9]]:* | *:no) ;;
*) build_root=${build_root}${compiler_version} ;;
esac
ncbi_cv_with_version=${with_version:-yes}
else
: ${with_suffix:="no"}
fi
#### Release/Debug
case "${with_debug}:${with_optimization}" in
no:*)
release_debug=Release
DEBUG_SFX=Release
D_SFX=
;;
yes:yes | :yes)
release_debug=DebugOpt
DEBUG_SFX=Debug
D_SFX=d
;;
*)
release_debug=Debug
DEBUG_SFX=Debug
D_SFX=d
;;
esac
#### Profiling; try to turn on both function weight and basic-block counting
if test "$with_profiling" = "yes" ; then
prof_sfx="Prof"
case "$compiler" in
Compaq) PFFLAGS="-pg" ;;
GCC) PFFLAGS="-pg" ;;
ICC) PFFLAGS="-p" ;;
KCC) PFFLAGS="-pg" ;;
MIPSpro73) PFFLAGS="" ;; # pixie(1) adds info at runtime
MSVC) PFFLAGS="/PROFILE" ;;
VisualAge) PFFLAGS="-pg" ;;
WorkShop*) PFFLAGS="-pg -xprofile=tcov" ;;
*) PFFLAGS="-p" ;; # Fairly standard; shouldn't rely on -pg
esac
CFLAGS="$CFLAGS $PFFLAGS"
CXXFLAGS="$CXXFLAGS $PFFLAGS"
LDFLAGS="$LDFLAGS $PFFLAGS"
STRIP="@:" # Stripping may lose profiling info
else
prof_sfx=
fi
### Should go before any test compiler runs
AC_GNU_SOURCE
#### Determine whether this is implicitly a 64-bit platform
AC_TYPE_SIZE_T
if test "${with_universal-no}" = "no"; then
AC_CHECK_SIZEOF(size_t)
ac_cv_sizeof_size_t=`echo "$ac_cv_sizeof_size_t" | tr -d '\r'`
NCBI_PLATFORM_BITS=`expr 8 \* $ac_cv_sizeof_size_t`
AC_DEFINE_UNQUOTED(NCBI_PLATFORM_BITS, $NCBI_PLATFORM_BITS,
[Define to the architecture size.])
if test $NCBI_PLATFORM_BITS -eq 64; then
bit64_sfx=64
fi
fi
### Intel Thread Checker
if test "${with_tcheck=no}" != "no" ; then
if test "${release_debug}${mt_sfx}" != "DebugMT" ; then
AC_MSG_WARN([--with-tcheck is most likely to be effective in DebugMT builds.])
fi
if test "$compiler" = "ICC"; then
case "$bit64_sfx" in
64) tcbin=bin/32e ;;
* ) tcbin=bin/32 ;;
esac
if test "$with_tcheck" != yes; then
TCHECK_BIN=$with_tcheck/$tcbin
fi
AC_PATH_PROG(TCHECK_CL, tcheck_cl, [], $TCHECK_BIN:$PATH:$TCHECK_FALLBACK)
if test -n "$TCHECK_CL"; then
CFLAGS="$CFLAGS -tcheck -O0"
CXXFLAGS="$CXXFLAGS -tcheck -O0"
LDFLAGS="$LDFLAGS -tcheck -O0 -L`dirname $TCHECK_CL`"
fi
fi
CPPFLAGS="$CPPFLAGS -DNCBI_TCHECK"
fi
#### Add "Release"/"Debug", "MT", "DLL", "64", "_p" suffixes to "${build_root}"
if test "$with_suffix" != "no" ; then
build_root="${build_root}-${release_debug}${mt_sfx}${dll_sfx}${bit64_sfx}${prof_sfx}"
fi
#### Add full host specs to "${build_root}"
if test "$with_hostspec" = "yes" ; then
build_root="${build_root}--${host}"
fi
if test -n "$with_build_root_sfx" ; then
build_root=$build_root$with_build_root_sfx
fi
case "$host_os" in
linux*)
kver=`uname -r | sed -e 's/-.*//'`
libcver=`ldd --version | awk 'NR == 1 { print $NF }'`
verbose_host=$host_cpu-$host_vendor-linux$kver-gnu$libcver
;;
*) verbose_host=$host ;;
esac
#### Overall configuration mode summary
signature="${compiler}_${compiler_version}-${release_debug}${mt_sfx}${dll_sfx}${bit64_sfx}${prof_sfx}--${verbose_host}-`(hostname || uname -n) 2>/dev/null | sed 1q`"
AC_DEFINE_UNQUOTED(NCBI_SIGNATURE, "$signature",
[Build signature: compiler-name '_' compiler-version '-' configuration
'--' platform-name '-' hostname])
#### Check if there is "${build_root}" dir
test -d "${build_root}" || mkdir -p "${build_root}"
test -d "${build_root}" || AC_MSG_ERROR([Couldn't create ${build_root}])
#### Try to find a version of pwd that yields /net paths.
AC_PATH_PROG(AMQ, amq, [], $PATH:/usr/sbin:/sbin)
case "$AMQ" in
*/amq)
AC_CACHE_CHECK([whether $AMQ -w works], ncbi_cv_prog_amq_w,
[if $AMQ -w >/dev/null 2>&1; then
ncbi_cv_prog_amq_w=yes
else
ncbi_cv_prog_amq_w=no
fi])
if test "$ncbi_cv_prog_amq_w" = yes; then
smart_pwd="$AMQ -w"
else
smart_pwd=pwd
fi
;;
*)
smart_pwd=pwd
;;
esac
#### Make "build_root" absolute
case "${build_root}" in
/* ) ;;
. )
CDPATH=
if test "${PWD}" != "" && test "`(cd ${PWD} ; sh -c pwd)`" = "`pwd`" ;
then
build_root="$PWD"
else
NCBI_FIX_DIR(build_root)
fi
;;
* ) NCBI_FIX_DIR(build_root) ;;
esac
if test -n "$with_fake_root"; then
build_root=$with_fake_root/`basename $build_root`
fi
#### Set runpath (may depend on build root)
if test -n "$with_relative_runpath"; then
if test "$with_runpath" = "no"; then
AC_MSG_ERROR([incompatible options: --without-runpath and --with-relative-runpath=$with_relative_runpath])
elif test -z "$origin"; then
AC_MSG_ERROR([Do not know how to specify relative runpaths on $host])
else
rp=`echo "$origin/$with_relative_runpath" | \
sed "s,:,:$origin/,g; s,/.:,:,g; s,/.\$,,"`
with_runpath="$rp${with_runpath+:$with_runpath}"
fi
fi
if test -z "$with_runpath"; then
# Don't allow libdir values containing variable expansions,
# including in particular the default "${exec_prefix}/lib"
if test -n "$libdir" && expr "$libdir" : '[[^$]]*$' >/dev/null; then
with_runpath=$libdir
elif test -n "$exec_prefix" -a "$exec_prefix" != "NONE" ; then
with_runpath=$exec_prefix/lib
elif test -n "$prefix" -a "$prefix" != "NONE" ; then
with_runpath=$prefix/lib
fi
fi
if test "$with_runpath" = "no" ; then
runpath=
pure_runpath=
elif test -n "$with_runpath" -a "$with_runpath" != "yes" ; then
root_base=`basename $build_root`
pure_runpath=`echo "${with_runpath}" | sed -e "s/{}/$root_base/g"`
runpath="${CONF_f_runpath}${pure_runpath}"
case "$host_os:$compiler" in
darwin* )
# Needed for a few gui projects, including gbench_plugin_scan;
# harmless elsewhere, since it only affects projects that indirectly
# need one of these libraries. (There seems to be no general
# equivalent of -rpath-link.)
for l in dbapi_driver gui_utils ncbi_xloader_genbank ncbi_xreader \
ncbi_xreader_id1 ncbi_xreader_pubseqos; do
ll=lib$l.dylib
LDFLAGS="$LDFLAGS -dylib_file ${pure_runpath}/$ll:\$(libdir)/$ll"
done
;;
*:GCC )
if `$CXX -print-prog-name=ld` --version 2>&1 | grep GNU >/dev/null; then
runpath="$runpath -Wl,-rpath-link,\$(libdir)"
fi
;;
*:ICC )
runpath="$runpath -Xlinker -rpath-link -Xlinker \$(libdir)"
;;
esac
elif test "$with_runpath" = "yes" -o "$with_dll" != "no" ; then
runpath="${CONF_f_runpath}\$(libdir)"
pure_runpath='${build_root}/lib'
else
runpath=
pure_runpath=
fi
if test -z "$CONF_f_runpath" ; then
# Drop the linker flag (since passing directory names doesn't work
# so well), but keep pure_runpath for other uses.
runpath=
fi
#### Linker command-line to build DLL (may depend on runpath)
has_dll_loadable="@# "
ALLOW_UNDEF=
FORBID_UNDEF=
case "$compiler" in
GCC | ICC )
LINK_DLL="$LINK $ARCH_CFLAGS -shared -o" # possibly overridden below
case "$host_os" in
solaris* )
# See http://realm.progsoc.uts.edu.au/~subtle/solaris28_link.html
LINK_DLL="$LINK $ARCH_CFLAGS -shared -mimpure-text -o"
FORBID_UNDEF="-Wl,-z,defs"
;;
darwin* )
# Per <http://fink.sourceforge.net/doc/porting/shared.php>, it was
# historically necessary to build plugins as Mach-O bundles rather than
# dynamic libraries. That's not such a big deal on modern Mac OS X
# versions, so the Toolkit now defaults to building only the latter.
if test "$with_bundles" = yes; then
has_dll_loadable=""
AC_DEFINE(NCBI_USE_BUNDLES, 1,
[Define to 1 if building plugins as bundles, as Mac OS X
traditionally required.])
fi
if $CXX -v 2>&1 | grep -q Apple; then
LINK_DLL="$LINK $ARCH_CFLAGS -dynamiclib -install_name ${pure_runpath%%:*}/\$(XDLL) -o"
LINK_LOADABLE="$LINK $ARCH_CFLAGS -bundle -o"
ALLOW_UNDEF='-undefined suppress'
FORBID_UNDEF='-undefined error'
else
LINK_DLL="$CC $ARCH_CFLAGS -nostartfiles -Wl,-dynamic -install_name ${pure_runpath%%:*}/\$(XDLL) -o"
LINK_LOADABLE="$CC $ARCH_CFLAGS -nostartfiles -Wl,-dynamic -Wl,-bundle -Wl,-read_only_relocs,warning -lbundle1.o -o"
ALLOW_UNDEF='-Wl,-undefined,suppress'
FORBID_UNDEF='-Wl,-undefined,error'
fi
;;
linux* | *gnu* ) # | *bsd*
case "$compiler:$compiler_version" in
ICC:9* | ICC:1??? )
ncbi_cv_prog_cc_wl_no_asu=no
LIBS="$LIBS -lc"
C_LIBS="$C_LIBS -lc"
;;
ICC:* )
;;
* )
FORBID_UNDEF='-Wl,--no-undefined'
;;
esac
;;
irix* )
FORBID_UNDEF='-Wl,-no_unresolved'
;;
osf* )
ALLOW_UNDEF='-Wl,-expect_unresolved,\*'
FORBID_UNDEF='-Wl,-error_unresolved'
;;
esac
AC_CACHE_CHECK([whether $CC supports -Wl,--no-allow-shlib-undefined],
ncbi_cv_prog_cc_wl_no_asu,
[orig_LDFLAGS=$LDFLAGS
LDFLAGS="$CXXFLAGS_DLL -shared -Wl,--no-allow-shlib-undefined $LDFLAGS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
[ncbi_cv_prog_cc_wl_no_asu=yes], [ncbi_cv_prog_cc_wl_no_asu=no])
LDFLAGS=$orig_LDFLAGS])
if test "$ncbi_cv_prog_cc_wl_no_asu" = yes; then
FORBID_UNDEF="$FORBID_UNDEF -Wl,--no-allow-shlib-undefined"
fi
;;
MIPSpro73 )
LINK_DLL="$LINK $ARCH_CFLAGS -shared -o"
FORBID_UNDEF="-no_unresolved"
;;
Compaq )
LINK_DLL="$LINK $ARCH_CFLAGS -shared -o"
ALLOW_UNDEF='-expect_unresolved \*'
FORBID_UNDEF='-error_unresolved'
;;
WorkShop* )
LINK_DLL="$LINK $ARCH_CFLAGS $MT_FLAG -G -h \$(XDLL) -o"
FORBID_UNDEF="-z defs"
;;
KCC )
LINK_DLL="$LINK $ARCH_CFLAGS $MT_FLAG --soname \$(XDLL) -o"
FORBID_UNDEF="-z defs"
;;
VisualAge )
# NOTE: --without-dll still recommended, as the linker doesn't seem
# to support building shared libraries with undefined symbols.
LINK_DLL="$LINK $ARCH_CFLAGS $MT_FLAG -qmkshrobj -o"
# ALLOW_UNDEF="???"
;;
* )
if test "$with_dll" = "yes" && test -z "$LINK_DLL" ; then
AC_MSG_ERROR([Do not know how to build DLLs with compiler $CXX $compiler_ver])
elif test -z "$LINK_DLL"; then
with_dll=no
fi
;;
esac
if test "$with_dll" = "no"; then # no DLLs whatsoever!
DLL=
FORCE_STATIC_LIB="LIB_OR_DLL = lib"
APP_LIB_SETTING='$(STATIC_LIB)'
APP_LIBS_SETTING='$(STATIC_LIBS)'
else
FORCE_STATIC_LIB=
APP_LIB_SETTING='$(LIB)'
APP_LIBS_SETTING='$(LIBS)'
NCBI_FEATURE(DLL)
# Some shared libraries end up containing static libraries, so make
# sure to use DLL flags for both on platforms where such inclusion
# would otherwise be illegal....
case "$host_os:$host_cpu:$bit64_sfx" in
# linux*:*86:*) ;;
linux* | darwin* | solaris*:64 | *bsd* )
CFLAGS="$CFLAGS $CFLAGS_DLL"
CFLAGS_DLL=
CXXFLAGS="$CXXFLAGS $CXXFLAGS_DLL"
CXXFLAGS_DLL=
;;
esac
AC_DEFINE(NCBI_DLL_SUPPORT, 1,
[Define to 1 if building dynamic libraries at all
(albeit not necessarily by default).])
if test "$with_dll" = "yes"; then
NCBI_FEATURE(DLL_BUILD)
AC_DEFINE(NCBI_DLL_BUILD, 1,
[Define to 1 if building dynamic libraries by default.])
: ${with_plugin_auto_load=yes}
fi
fi
if test "$with_plugin_auto_load" = yes; then
AC_DEFINE(NCBI_PLUGIN_AUTO_LOAD, 1,
[Define to 1 if the plugin manager should load DLLs by default.])
fi
# Make sure we have commands for both C and C++ preprocessors
AC_PROG_CPP
dnl AC_PROG_CXXCPP
#### Make "srcdir" absolute
case "${srcdir}" in
/* ) ;;
. )
CDPATH=
if test "${PWD}" != "" && test "`(cd ${PWD} ; sh -c pwd)`" = "`pwd`" ;
then
srcdir="$PWD"
else
NCBI_FIX_DIR(srcdir)
fi
;;
* ) NCBI_FIX_DIR(srcdir) ;;
esac
real_srcdir=$srcdir
if test -n "$with_fake_root"; then
srcdir=$build_root/..
fi
#### Ensure that all explicitly requested subtrees actually exist
NCBI_CHECK_SUBTREE(algo)
dnl NCBI_CHECK_SUBTREE(app)
if test "$with_app" = "no" ; then
NoConfProjects="$NoConfProjects app"
fi
if test ! -f ${real_srcdir}/src/app/Makefile.in ; then
if test "${with_app-no}" != "no" ; then
AC_MSG_ERROR([--with-app: APP sources are missing])
fi
with_app="no"
fi
dnl NCBI_CHECK_SUBTREE(bdb) # deferred until end, as --with-bdb does double duty
dnl NCBI_CHECK_SUBTREE(cgi) # --without-cgi deliberately unavailable for now
if test -f ${real_srcdir}/src/cgi/Makefile.in -a \
-d ${real_srcdir}/include/cgi; then
NCBI_PROJECT(cgi)
else
AC_MSG_WARN([CGI tree missing; some projects may fail to build.])
fi
NCBI_CHECK_SUBTREE(ctools)
NCBI_CHECK_SUBTREE(dbapi)
NCBI_CHECK_SUBTREE(gui)
NCBI_CHECK_SUBTREE(objects)
NCBI_CHECK_SUBTREE(serial)
#### Source, include, and build directories
ncbiconf="$build_root/inc/ncbiconf_unix.h"
ncbiconf_old="$build_root/inc/ncbiconf.h"
if test -f "$ncbiconf_old" -a ! -f "$ncbiconf"; then
mv "$ncbiconf_old" "$ncbiconf"
fi
if test "$build_root" = "$srcdir" ; then
builddir="$srcdir/src"
else
builddir="$build_root/build"
fi
status_dir="$build_root/status"
#### Create build directories
mkdir -p "$builddir" "$build_root/lib" "$build_root/bin"
#### Check if the target directory already has a configured system in it
if test "$no_create" != "yes" -a -f "${ncbiconf}" ; then
echo
echo "There is already a built \"${ncbiconf}\"!"
NCBI_CAUTION([Do you want to re-configure in \"${builddir}\"?])
echo
fi
#### Use right command shell in scripts and makefiles
script_shell="#! ${CONFIG_SHELL:=/bin/sh}"
make_shell="SHELL=${CONFIG_SHELL:=/bin/sh}"
#### Turn on compilation warnings and adjust
#### some compiler-specific flags and features
if test "$CONF_obj_ext" = " " ; then obj_ext="" ; else obj_ext="${CONF_obj_ext:=.o}" ; fi
if test "$CONF_lib_pre" = " " ; then lib_pre="" ; else lib_pre="${CONF_lib_pre:=lib}" ; fi
if test "$CONF_lib_l_pre" = " " ; then lib_l_pre="" ; else lib_l_pre="${CONF_lib_l_pre:=-l}" ; fi
if test "$CONF_lib_ext" = " " ; then lib_ext="" ; else lib_ext="${CONF_lib_ext:=.a}" ; fi
if test "$CONF_dll_ext" = " " ; then dll_ext="" ; else dll_ext="${CONF_dll_ext:=.so}" ; fi
if test "$CONF_loadable_ext" = " " ; then loadable_ext="" ; else loadable_ext="${CONF_loadable_ext:=.so}" ; fi
if test "$CONF_lib_l_ext" = " " ; then lib_l_ext="" ; else lib_l_ext="${CONF_lib_l_ext}" ; fi
if test "$CONF_exe_ext" = " " ; then exe_ext="" ; else exe_ext="${CONF_exe_ext}" ; fi
if test "$CONF_f_compile" = " " ; then f_compile="" ; else f_compile="${CONF_f_compile:=-c }" ; fi
if test "$CONF_f_outobj" = " " ; then f_outobj="" ; else f_outobj="${CONF_f_outobj:=-o }" ; fi
if test "$CONF_f_outlib" = " " ; then f_outlib="" ; else f_outlib="${CONF_f_outlib}" ; fi
if test "$CONF_f_libpath" = " " ; then f_libpath="" ; else f_libpath="${CONF_f_libpath:=-L}" ; fi
if test "$CONF_f_runpath" = " " ; then f_runpath="" ; else f_runpath="${CONF_f_runpath:=$CONF_f_libpath}" ; fi
if test "$CONF_f_outexe" = " " ; then f_outexe="" ; else f_outexe="${CONF_f_outexe:=-o }" ; fi
BINCOPY="cp -p"
MAC_BINCOPY="/Developer/Tools/CpMac -p"
if test "$with_bincopy" != "yes"; then
AC_CACHE_CHECK([whether cross-directory hard links work],
ncbi_cv_sys_xdir_ln,
[mkdir conftestdir
touch conftestdir/conftestfile
if ln -f conftestdir/conftestfile .; then
ncbi_cv_sys_xdir_ln=yes
else
ncbi_cv_sys_xdir_ln=no
fi
rm -rf conftestdir conftestfile])
if test "$ncbi_cv_sys_xdir_ln" = "yes"; then
BINCOPY="ln -f"
MAC_BINCOPY="\$(top_srcdir)/scripts/common/impl/ln_mac.sh"
fi
fi
ifdiff="${CONFIG_SHELL} \$(top_srcdir)/scripts/common/impl/if_diff.sh"
if test "$OSTYPE" = "darwin" -a -x /Developer/Tools/CpMac; then
BINCOPY="$ifdiff \"$MAC_BINCOPY\""
else
BINCOPY="$ifdiff \"$BINCOPY\""
fi
#### Manage the debug-vs.-optimization flags ("--with(out)-debug",
#### "--with(out)-symbols", "--with(out)-optimization")
changequote(, )dnl
if test "$compiler" != "MSVC" ; then
if test "$with_debug" = "no" -o "$with_tcheck" != "no"; then
CPPFLAGS="-DNDEBUG $CPPFLAGS"
else
CPPFLAGS="-D_DEBUG $CPPFLAGS"
fi
if test "$with_symbols" = "no" ; then
CFLAGS=` echo " $CFLAGS" | sed 's/[ ]-g[0-9]*//g'`
CXXFLAGS=`echo " $CXXFLAGS" | sed 's/[ ]-g[0-9]*//g'`
LDFLAGS=` echo " $LDFLAGS" | sed 's/[ ]-g[0-9]*//g'`
else
if echo " $CFLAGS" |grep -v >/dev/null '[ ]-g[0-9]*' ; then
CFLAGS="$CFLAGS -g" ; fi
if echo " $CXXFLAGS" |grep -v >/dev/null '[ ]-g[0-9]*' ; then
CXXFLAGS="$CXXFLAGS -g" ; fi
if echo " $LDFLAGS" |grep -v >/dev/null '[ ]-g[0-9]*' ;
then LDFLAGS="$LDFLAGS -g" ; fi
STRIP="@:"
fi
NOPT_CFLAGS=` echo " $CFLAGS" | sed 's/[ ]-x*O[0-9]*//g'`
NOPT_CXXFLAGS=`echo " $CXXFLAGS" | sed 's/[ ]-x*O[0-9]*//g'`
NOPT_LDFLAGS=` echo " $LDFLAGS" | sed 's/[ ]-x*O[0-9]*//g'`
if test "${with_tcheck-no}" != "no"; then
# Suppress warnings when building with ICC.
NOPT_CFLAGS="$NOPT_CFLAGS -O0"
NOPT_CXXFLAGS="$NOPT_CXXFLAGS -O0"
NOPT_LDFLAGS="$NOPT_LDFLAGS -O0"
fi
if test "$with_optimization" = "no" ; then
CFLAGS="$NOPT_CFLAGS"
CXXFLAGS="$NOPT_CXXFLAGS"
LDFLAGS="$NOPT_LDFLAGS"
FAST_CFLAGS="$CFLAGS"
FAST_CXXFLAGS="$CXXFLAGS"
FAST_LDFLAGS="$LDFLAGS"
else
if echo " $CFLAGS" |grep -v >/dev/null '[ ]-x*O[0-9]*' ; then
CFLAGS="$CFLAGS -O" ; fi
if echo " $CXXFLAGS" |grep -v >/dev/null '[ ]-x*O[0-9]*' ; then
CXXFLAGS="$CXXFLAGS -O" ; fi
if echo " $LDFLAGS" |grep -v >/dev/null '[ ]-x*O[0-9]*' ; then
LDFLAGS="$LDFLAGS -O" ; fi
FAST_CFLAGS="$NOPT_CFLAGS $FAST_CFLAGS"
FAST_CXXFLAGS="$NOPT_CXXFLAGS $FAST_CXXFLAGS"
FAST_LDFLAGS="$NOPT_LDFLAGS $FAST_LDFLAGS"
fi
fi
changequote([, ])dnl
### ------------------------------------------------------------------
### ------------------------------------------------------------------
### Check for header files.
AC_CHECK_HEADERS(iostream iostream.h)
AC_CHECK_HEADERS(fstream fstream.h)
AC_CHECK_HEADERS(strstream strstream.h strstrea.h)
AC_CHECK_HEADERS(inttypes.h limits)
### Check for the platform (very roughly)
AC_CHECK_HEADERS(unistd.h, x_have_unistd="yes")
AC_CHECK_HEADERS(windows.h, x_have_windows="yes")
if test "$x_have_windows" = "yes" -a "x$host_os" != "xcygwin32" -a "x$host_os" != "xcygwin"; then
AC_DEFINE(NCBI_OS_MSWIN, 1, [Define to 1 on Windows.])
AC_DEFINE(NCBI_OS, "MSWIN", [Operating system name])
NCBI_FEATURE(MSWin)
elif test "$x_have_unistd" = "yes" ; then
AC_DEFINE(NCBI_OS_UNIX, 1, [Define to 1 on Unix.])
AC_DEFINE(NCBI_OS, "UNIX", [Operating system name])
UNIX_SRC='$(UNIX_SRC)'
UNIX_USR_PROJ='$(UNIX_USR_PROJ)'
NCBI_FEATURE(unix)
NCBI_FEATURE(WinMain) # to accommodate a PTB-specific (ab)use of REQUIRES
# Extra defines for variants we care about
case "$OSTYPE" in
aix)
AC_DEFINE(NCBI_OS_AIX, 1, [Define to 1 on AIX.])
NCBI_FEATURE(AIX)
;;
*bsd)
AC_DEFINE(NCBI_OS_BSD, 1, [Define to 1 on *BSD.])
NCBI_FEATURE(BSD)
;;
cygwin)
AC_DEFINE(NCBI_OS_CYGWIN, 1, [Define to 1 on Cygwin.])
NCBI_FEATURE(Cygwin)
if test "$with_mt" = yes; then NCBI_FEATURE(CygwinMT); fi
;;
darwin)
AC_DEFINE(NCBI_OS_DARWIN, 1, [Define to 1 on Mac OS X.])
NCBI_FEATURE(Darwin)
if false; then NCBI_FEATURE(XCODE); fi
;;
irix)
AC_DEFINE(NCBI_OS_IRIX, 1, [Define to 1 on IRIX.])
NCBI_FEATURE(IRIX)
;;
linux)
AC_DEFINE(NCBI_OS_LINUX, 1, [Define to 1 on Linux.])
NCBI_FEATURE(Linux)
;;
osf)
AC_DEFINE(NCBI_OS_OSF1, 1, [Define to 1 on Tru64 Unix.])
NCBI_FEATURE(OSF)
;;
solaris)
AC_DEFINE(NCBI_OS_SOLARIS, 1, [Define to 1 on Solaris.])
NCBI_FEATURE(Solaris)
;;
esac
else
dnl Classic Mac OS, no longer supported; the following line is
dnl commented out to avoid cluttering config.h.in.
dnl AC_DEFINE(NCBI_OS_MAC, 1, [Define to 1 on MacOS.])
AC_DEFINE(NCBI_OS, "MAC", [Operating system name])
NCBI_FEATURE(MacOS)
fi
case "$host_os" in
cygwin* | osf* )
AC_DEFINE(NETDB_REENTRANT, 1,
[Define to 1 if the BSD-style netdb interface is reentrant.])
;;
esac
# AC_CHECK_TYPES is insufficient, as linking may still fail :-/
AC_CACHE_CHECK([for wstring], ac_cv_type_wstring_linkable,
[AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <string>
using std::wstring;]],
[[wstring ws, ws2; ws.find_first_of(ws2);]])],
[ac_cv_type_wstring_linkable=yes], [ac_cv_type_wstring_linkable=no])])
if test "$ac_cv_type_wstring_linkable" = "yes"; then
AC_DEFINE(HAVE_WSTRING, 1,
[Define to 1 if the system has the type `wstring'.])
fi
AC_CHECK_TYPES(socklen_t,,,[#include <sys/types.h>
#include <sys/socket.h>])
AC_CHECK_HEADERS(atomic.h dlfcn.h ieeefp.h poll.h sys/epoll.h sys/mount.h \
sys/sockio.h sys/statvfs.h sys/sysinfo.h sys/vfs.h)
# for FreeTDS 0.6x
AC_CHECK_HEADERS(arpa/inet.h errno.h malloc.h netdb.h \
netinet/in.h netinet/tcp.h paths.h signal.h \
sys/ioctl.h sys/select.h sys/socket.h sys/time.h wchar.h)
AC_HEADER_TIME
## gethostbyname_r() -- 2 different variants: 5-arg (Solaris), 6-arg (Linux).
AC_CACHE_CHECK([for gethostbyname_r], ncbi_cv_func_gethostbyname_r,
[ncbi_cv_func_gethostbyname_r="no"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <netdb.h>]],
[[
void* dummy = (void*) &gethostbyname_r;
char buf[1024];
int err;
struct hostent* hp = 0;
hp = gethostbyname_r("", hp, buf, sizeof(buf), &err);
]])],
[
ncbi_cv_func_gethostbyname_r="5"
]
)
if test "$ncbi_cv_func_gethostbyname_r" = "no" ; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <netdb.h>]],
[[
void* dummy = (void*) &gethostbyname_r;
char buf[1024];
int err;
struct hostent* hp = 0;
err = gethostbyname_r("", hp, buf, sizeof(buf), &hp, &err);
]])],
[
ncbi_cv_func_gethostbyname_r="6"
]
)
fi])
if test "$ncbi_cv_func_gethostbyname_r" != "no" ; then
AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYNAME_R, $ncbi_cv_func_gethostbyname_r,
[If you have the `gethostbyname_r' function, define to the number of
arguments it takes (normally 5 or 6).])
fi
## gethostbyaddr_r() -- 2 different variants: 7-arg (Solaris), 8-arg (Linux).
AC_CACHE_CHECK([for gethostbyaddr_r], ncbi_cv_func_gethostbyaddr_r,
[ncbi_cv_func_gethostbyaddr_r="no"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
]],
[[
void* dummy = (void*) &gethostbyaddr_r;
char buf[1024];
int err;
unsigned int host;
struct hostent* hp = 0;
hp = gethostbyaddr_r((char *) &host, sizeof(host), AF_INET,
hp, buf, sizeof(buf), &err);
]])],
[
ncbi_cv_func_gethostbyaddr_r="7"
]
)
if test "$ncbi_cv_func_gethostbyaddr_r" = "no" ; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
]],
[[
void* dummy = (void*) &gethostbyaddr_r;
char buf[1024];
int err;
unsigned int host;
struct hostent* hp = 0;
int res = gethostbyaddr_r((char *) &host, sizeof(host), AF_INET,
hp, buf, sizeof(buf), &hp, &err);
]])],
[
ncbi_cv_func_gethostbyaddr_r="8"
]
)
fi])
if test "$ncbi_cv_func_gethostbyaddr_r" != "no" ; then
AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYADDR_R, $ncbi_cv_func_gethostbyaddr_r,
[If you have the `gethostbyaddr_r' function, define to the number of
arguments it takes (normally 7 or 8).])
fi
## getservbyname_r() -- 2 different variants: 5-arg (Solaris), 6-arg (Linux).
AC_CACHE_CHECK([for getservbyname_r], ncbi_cv_func_getservbyname_r,
[ncbi_cv_func_getservbyname_r="no"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <netdb.h>]],
[[
void* dummy = (void*) &getservbyname_r;
char buf[1024];
int err;
struct servent* sp = 0;
sp = getservbyname_r("", "", sp, buf, sizeof(buf));
]])],
[
ncbi_cv_func_getservbyname_r="5"
]
)
if test "$ncbi_cv_func_getservbyname_r" = "no" ; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <netdb.h>]],
[[
void* dummy = (void*) &getservbyname_r;
char buf[1024];
int err;
struct servent* sp = 0;
err = getservbyname_r("", "", sp, buf, sizeof(buf), &sp);
]])],
[
ncbi_cv_func_getservbyname_r="6"
]
)
fi])
if test "$ncbi_cv_func_getservbyname_r" != "no" ; then
AC_DEFINE_UNQUOTED(HAVE_GETSERVBYNAME_R, $ncbi_cv_func_getservbyname_r,
[If you have the `getservbyname_r' function, define to the number of
arguments it takes (normally 5 or 6).])
fi
## getpwuid_r() -- 2 major variants: 4-arg, 5-arg (POSIX).
## (Alternate 4-arg interface ignored due to rarity.)
AC_CACHE_CHECK([for getpwuid_r], ncbi_cv_func_getpwuid_r,
[ncbi_cv_func_getpwuid_r="no"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <unistd.h>
#include <pwd.h>]],
[[struct passwd bpw;
char buf[1024];
char *dir = getpwuid_r(getuid(), &bpw, buf, sizeof(buf))->pw_dir;
]])],
[ncbi_cv_func_getpwuid_r=4])
if test "$ncbi_cv_func_getpwuid_r" = "no" ; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <unistd.h>
#include <pwd.h>]],
[[struct passwd *pw, bpw;
char buf[1024];
getpwuid_r(getuid(), &bpw, buf, sizeof(buf), &pw);
]])],
[ncbi_cv_func_getpwuid_r=5])
fi])
if test "$ncbi_cv_func_getpwuid_r" != "no" ; then
AC_DEFINE_UNQUOTED(NCBI_HAVE_GETPWUID_R, $ncbi_cv_func_getpwuid_r,
[If you have the `getpwuid_r' function, define to the number of
arguments it takes (normally 4 or 5).])
fi
# Perform a full-fledged check in C++ to be sure of an actual declaration.
# Accommodate the old Solaris interface that returns char* rather than int. :-/
AC_CACHE_CHECK([for getlogin_r], ncbi_cv_func_getlogin_r,
[ncbi_cv_func_getlogin_r="no"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <unistd.h>]],
[[char buf[64]; /* return */ getlogin_r(buf, 64);]])],
[ncbi_cv_func_getlogin_r=yes], [ncbi_cv_func_getlogin_r=no])])
if test $ncbi_cv_func_getlogin_r = yes; then
AC_DEFINE(HAVE_GETLOGIN_R, 1,
[Define to 1 if you have the `getlogin_r' function])
fi
AC_LANG_PUSH(C)
# some of these can lose in C++ due to the way autoconf works
AC_CHECK_FUNCS(localtime_r pthread_setconcurrency pthread_atfork)
if test "$ac_cv_func_localtime_r" = "yes" ; then
AC_CACHE_CHECK(return type of localtime_r, ac_cv_func_which_localtime_r,
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <unistd.h>
#include <time.h>]],
[[struct tm mytm;
time_t t;
int y = localtime_r(&t, &mytm)->tm_year;]])],
ac_cv_func_which_localtime_r=struct,
ac_cv_func_which_localtime_r=int)])
if test $ac_cv_func_which_localtime_r = struct; then
AC_DEFINE(HAVE_FUNC_LOCALTIME_R_TM, 1,
[Define to 1 if your localtime_r returns a struct tm*.])
else
AC_DEFINE(HAVE_FUNC_LOCALTIME_R_INT, 1,
[Define to 1 if your localtime_r returns a int.])
fi
fi
AC_CACHE_CHECK([whether pthread mutexes are available],
ncbi_cv_func_pthread_mutex,
[AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <pthread.h>
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;]],
[[pthread_mutex_lock(&mutex); pthread_mutex_unlock(&mutex);]])],
[ncbi_cv_func_pthread_mutex=yes], [ncbi_cv_func_pthread_mutex=no])])
if test $ncbi_cv_func_pthread_mutex=yes; then
AC_DEFINE(HAVE_PTHREAD_MUTEX, 1,
[Define to 1 if pthread mutexes are available.])
fi
### Check for other standard library functions
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(euidaccess atoll basename lchown fseeko getpagesize \
getpass getpassphrase getpwuid getrusage gettimeofday \
getuid memrchr readpassphrase readv usleep \
asprintf vasprintf vsnprintf select statfs statvfs \
strcasecmp strlcat strlcpy strdup strndup strtok_r \
sysmp timegm utimes lutimes writev)
AC_LANG_POP(C)
AC_TYPE_SIGNAL
test "$ac_cv_func_select" = yes || ncbi_cv_func_select_updates_timeout=no
AC_CACHE_CHECK([whether select updates the timeout when interrupted],
ncbi_cv_func_select_updates_timeout,
[AC_RUN_IFELSE([AC_LANG_PROGRAM(
[[#include <signal.h>
#include <sys/types.h>
#ifdef HAVE_SYS_SELECT_H
# include <sys/select.h>
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
RETSIGTYPE handler(int sig) { alarm(0); }]],
[[struct timeval timeout = { 5, 0 };
signal(SIGALRM, &handler);
alarm(1);
select(0, NULL, NULL, NULL, &timeout);
return timeout.tv_sec == 5;]])],
[ncbi_cv_func_select_updates_timeout=yes],
[ncbi_cv_func_select_updates_timeout=no],
[case "$host_os" in
linux) ncbi_cv_func_select_updates_timeout=yes ;;
*) ncbi_cv_func_select_updates_timeout=no ;;
esac])])
if test "$ncbi_cv_func_select_updates_timeout" = yes; then
AC_DEFINE(SELECT_UPDATES_TIMEOUT, 1,
[Define to 1 if the `select' function updates its timeout when
interrupted by a signal.])
fi
# We want the program to return 0, which is *false* in C. Also, since
# use of lowercase seems to be customary if not universal, the default
# is yes when cross-compiling; anyone cross-compiling for exceptional
# platforms can set ncbi_cv_func_strcasecmp_lc=no in config.site.
if test "$ac_cv_func_strcasecmp" = yes; then
AC_CACHE_CHECK([whether strcasecmp treats letters as lowercase],
ncbi_cv_func_strcasecmp_lc,
[AC_RUN_IFELSE([AC_LANG_PROGRAM(
[[#include <string.h>]],
[[return strcasecmp("A", "_") <= 0;]])],
[ncbi_cv_func_strcasecmp_lc=yes], [ncbi_cv_func_strcasecmp_lc=no],
[ncbi_cv_func_strcasecmp_lc=yes])])
if test "$ncbi_cv_func_strcasecmp_lc" = yes; then
AC_DEFINE(HAVE_STRCASECMP_LC, 1,
[Define to 1 if strcasecmp treats letters as lowercase.])
fi
fi
AC_CACHE_CHECK([for Linux-like sysinfo with 1 arg], ncbi_cv_func_sysinfo_1,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <sys/sysinfo.h>]],
[[
void* dummy = (void*) &sysinfo;
struct sysinfo* info = 0;
int retval = sysinfo(info);
]])], [ncbi_cv_func_sysinfo_1=yes], [ncbi_cv_func_sysinfo_1=no])])
if test "$ncbi_cv_func_sysinfo_1" = yes; then
AC_DEFINE(HAVE_SYSINFO_1, 1,
[Define to 1 if Linux-like 1-arg sysinfo exists.])
fi
dnl Too much overkill, and now wants getloadavg.c to exist.
dnl AC_FUNC_GETLOADAVG
AC_CHECK_FUNCS(getloadavg)
## readdir_r() -- 2 different variants: 2-arg (trad. Solaris), 3-arg (POSIX).
AC_CACHE_CHECK([for readdir_r], ncbi_cv_func_readdir_r,
[ncbi_cv_func_readdir_r="no"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <dirent.h>]],
[[DIR* dir; struct dirent* entry; readdir_r(dir, entry, &entry);]])],
[ncbi_cv_func_readdir_r=3])
if test "$ncbi_cv_func_readdir_r" = "no" ; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <dirent.h>]],
[[DIR* dir; struct dirent* entry; readdir_r(dir, entry);]])],
[ncbi_cv_func_readdir_r=2])
fi])
if test "$ncbi_cv_func_readdir_r" != "no" ; then
AC_DEFINE_UNQUOTED(NCBI_HAVE_READDIR_R, $ncbi_cv_func_readdir_r,
[If you have the `readdir_r' function, define to the number of
arguments it takes (normally 2 or 3).])
fi
### Check for typedefs, structures, and compiler features.
AC_C_CONST
### Check for C standard types and sizes
if test "${with_universal-no}" = "no"; then
AC_C_BIGENDIAN
AC_C_CHAR_UNSIGNED
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(double)
AC_CHECK_SIZEOF(float)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long double)
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(void*)
AC_CHECK_SIZEOF(__int64)
fi
AC_CHECK_TYPES([intptr_t, uintptr_t])
AC_CHECK_MEMBER(struct sockaddr_in.sin_len,
[AC_DEFINE(HAVE_SIN_LEN, 1,
[Define to 1 if `sin_len' is a member of `struct sockaddr_in'.])],
[], [#include <sys/types.h>
#include <netinet/in.h>])
AC_CHECK_MEMBERS([struct tm.tm_zone, struct tm.__tm_zone], [], [],
[#include <time.h>])
AC_CACHE_CHECK([whether function prototypes can use throw(...)],
ncbi_cv_cxx_throw_spec,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[template <class T> inline int test_throw_spec(const T&) throw() {
return 0;
}]],
[[return test_throw_spec(123);]])],
[ncbi_cv_cxx_throw_spec=yes], [ncbi_cv_cxx_throw_spec=no])])
if test "$ncbi_cv_cxx_throw_spec" = yes; then
AC_DEFINE(NCBI_USE_THROW_SPEC, 1,
[Define to 1 if prototypes can use exception specifications.])
fi
AC_CACHE_CHECK([for obsolete string::compare() syntax],
ncbi_cv_func_string_compare_obsolete,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <string>]],
[[std::string s; int i = 0; i = s.compare("aaa", 0, 2);]])],
[ncbi_cv_func_string_compare_obsolete=yes],
[ncbi_cv_func_string_compare_obsolete=no])])
if test "$ncbi_cv_func_string_compare_obsolete" = yes; then
AC_DEFINE(NCBI_OBSOLETE_STR_COMPARE, 1,
[Define to 1 if `string::compare()' is non-standard.])
fi
AC_CACHE_CHECK([whether the auto_ptr template class works],
ncbi_cv_type_auto_ptr_works,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <memory>]],
[[int *ip = 0; std::auto_ptr<int> ap(ip); *ip = *ap; ap.reset(ip);]])],
[ncbi_cv_type_auto_ptr_works=yes], [ncbi_cv_type_auto_ptr_works=no])])
if test "$ncbi_cv_cxx_auto_ptr_works" = no; then
AC_DEFINE(HAVE_NO_AUTO_PTR, 1,
[Define to 1 if `auto_ptr<T>' is missing or broken.])
fi
AC_CACHE_CHECK([for min/max templates], ncbi_cv_func_min_max,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[
#include <algorithm>
#ifdef min
#undef min
#endif
#ifdef max
#undef max
#endif
]],
[[int a=0, b=1; a = std::min(a, b); b = std::max(a, b);]])],
[ncbi_cv_func_min_max=yes], [ncbi_cv_func_min_max=no])])
if test "$ncbi_cv_func_min_max" = no; then
AC_DEFINE(HAVE_NO_MINMAX_TEMPLATE, 1,
[Define to 1 if `min'/`max' templates are not implemented.])
fi
AC_CACHE_CHECK([whether new C++ streams have ios_base::],
ncbi_cv_type_ios_base,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <iostream>]],
[[(void)(std::ios_base::out != std::ios_base::beg);]])],
[ncbi_cv_type_ios_base=yes], [ncbi_cv_type_ios_base=no])])
if test "$ncbi_cv_type_ios_base" = no; then
AC_DEFINE(HAVE_NO_IOS_BASE, 1,
[Define to 1 if new C++ streams lack `ios_base::'.])
fi
AC_CACHE_CHECK([for ios(_base)::register_callback],
ncbi_cv_func_ios_register_callback,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <iostream>]],
[[std::cout.register_callback(0, std::ios::erase_event);]])],
[ncbi_cv_func_ios_register_callback=yes],
[ncbi_cv_func_ios_register_callback=no])])
if test "$ncbi_cv_func_ios_register_callback" = yes; then
AC_DEFINE(HAVE_IOS_REGISTER_CALLBACK, 1,
[Define to 1 if you have `ios(_base)::register_callback'.])
fi
AC_CACHE_CHECK([for std::char_traits::], ncbi_cv_type_char_traits,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <iostream>]],
[[using namespace std;
char_traits<char>::int_type i = char_traits<char>::eof();
i = char_traits<char>::not_eof(i);
char_traits<char>::char_type c = '\0';
char_traits<char>::pos_type p = 0;
char_traits<char>::off_type o = 1;
]])],
[ncbi_cv_type_char_traits=yes], [ncbi_cv_type_char_traits=no])])
if test "$ncbi_cv_type_char_traits" = no; then
AC_DEFINE(HAVE_NO_CHAR_TRAITS, 1,
[Define to 1 if `std::char_traits' is missing.])
fi
AC_CACHE_CHECK([for std::is_sorted<> in <algorithm>], ncbi_cv_func_is_sorted,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <algorithm>]],
[[int a[2]; return std::is_sorted(a, a+2) ? 0 : 1;]])],
[ncbi_cv_func_is_sorted=yes], [ncbi_cv_func_is_sorted=no])])
if test "$ncbi_cv_func_is_sorted" = yes; then
AC_DEFINE(HAVE_IS_SORTED, 1,
[Define to 1 if <algorithm> supplies `std::is_sorted<>'.])
fi
AC_CACHE_CHECK([for SysV semaphores], ncbi_cv_sys_semaphores,
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
#include <sys/sem.h>],
[struct sembuf buf; int id = semget(0x1234, 0, IPC_CREAT);
buf.sem_op = SEM_UNDO;])],
[ncbi_cv_sys_semaphores=yes], [ncbi_cv_sys_semaphores=no]))
if test "$ncbi_cv_sys_semaphores" = yes; then
AC_DEFINE(HAVE_SYSV_SEMAPHORES, 1,
[Define to 1 if you have SysV semaphores.])
fi
AC_CHECK_TYPE([union semun],
AC_DEFINE(HAVE_SEMUN, 1, [Define to 1 if you have `union semun'.]),
[], [#include <sys/types.h>
#include <sys/sem.h>])
AC_CACHE_CHECK([which way the stack grows], ncbi_cv_sys_stack_dir,
[AC_RUN_IFELSE([AC_LANG_PROGRAM(
[[ int f(int* p) { int i; return (&i < p) ? 1 : 0; } ]],
[[ int p; return f(&p); ]])],
[ncbi_cv_sys_stack_dir=up], [ncbi_cv_sys_stack_dir=down],
[ncbi_cv_sys_stack_dir="unknown (cross-compiling)"])])
case "$ncbi_cv_sys_stack_dir" in
up) AC_DEFINE(STACK_GROWS_UP, 1, [Define to 1 if the stack grows up.]) ;;
down) AC_DEFINE(STACK_GROWS_DOWN, 1, [Define to 1 if the stack grows down.]);;
esac
AC_LANG_PUSH(C)
AC_CACHE_CHECK([whether the preprocessor supports C99-style variadic macros],
ncbi_cv_cpp_std_varargs,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#define foo(...) 1
#if foo(x,y,z) != 1
#error failed
#endif]], [])],
[ncbi_cv_cpp_std_varargs=yes], [ncbi_cv_cpp_std_varargs=no])])
if test "$ncbi_cv_cpp_std_varargs" = yes; then
AC_DEFINE(HAVE_CPP_STD_VARARGS, 1,
[Define to 1 if the preprocessor supports C99-style variadic macros.])
fi
AC_CACHE_CHECK([whether the preprocessor supports GNU-style variadic macros],
ncbi_cv_cpp_gnu_varargs,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#define foo(args...) 1
#if foo(x,y,z) != 1
#error failed
#endif]], [])],
[ncbi_cv_cpp_gnu_varargs=yes], [ncbi_cv_cpp_gnu_varargs=no])])
if test "$ncbi_cv_cpp_gnu_varargs" = yes; then
AC_DEFINE(HAVE_CPP_GNU_VARARGS, 1,
[Define to 1 if the preprocessor supports GNU-style variadic macros.])
fi
AC_LANG_POP(C)
# Avoid using unsupported (and noisily ignored) attributes.
case "$compiler:$compiler_version" in
GCC:2* | GCC:3[[01]]* )
ncbi_cv_c_deprecation_syntax=none
ncbi_cv_c_forceinline=inline
;;
VisualAge:* )
ncbi_cv_c_forceinline=inline
;;
WorkShop* )
ncbi_cv_c_deprecation_syntax=none
ncbi_cv_c_forceinline=inline
ncbi_cv_c_noreturn=none
;;
esac
AC_CACHE_CHECK([syntax for marking deprecated functions],
ncbi_cv_c_deprecation_syntax,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[void f(void) __attribute__((__deprecated__)); void f(void) { }]],
[[f();]])],
[ncbi_cv_c_deprecation_syntax='__attribute__((__deprecated__))'],
[ncbi_cv_c_deprecation_syntax=none])])
depr=$ncbi_cv_c_deprecation_syntax
test "$depr" = "none" && depr=""
AC_DEFINE_UNQUOTED(NCBI_DEPRECATED, $depr,
[Define to whatever syntax, if any, your compiler supports for marking
functions as deprecated.])
AC_LANG_PUSH(C)
AC_CACHE_CHECK([how to force inlining],
ncbi_cv_c_forceinline,
[ncbi_cv_c_forceinline=no
for fi in forceinline __forceinline__ __forceinline __always_inline \
"inline __attribute__((always_inline))" inline __inline__; do
test "$ncbi_cv_c_forceinline" = "no" || break
AC_COMPILE_IFELSE([AC_LANG_SOURCE([$fi int f(void) { return 0; }])],
[ncbi_cv_c_forceinline=$fi], [])
done])
forceinline=$ncbi_cv_c_forceinline
test "$forceinline" = "no" && forceinline=""
AC_DEFINE_UNQUOTED(NCBI_FORCEINLINE, $forceinline,
[Define to whatever syntax your compiler supports for marking functions
as to be inlined even if they might not otherwise be.])
AC_CACHE_CHECK([whether the C compiler supports __attribute__((destructor))],
ncbi_cv_c_attribute_destructor,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[void f(void) __attribute__((destructor)); void f(void) { }]],
[[f();]])],
[ncbi_cv_c_attribute_destructor=yes],
[ncbi_cv_c_attribute_destructor=no])])
if test $ncbi_cv_c_attribute_destructor = yes; then
AC_DEFINE(HAVE_ATTRIBUTE_DESTRUCTOR, 1,
[Define to 1 if your C compiler supports __attribute__((destructor))])
fi
case "$compiler:$compiler_version $CFLAGS $CXXFLAGS" in
GCC:[[4-9]]??\ *\ -fvisibility*|ICC:*\ -fvisibility* ) ;;
* ) ncbi_cv_c_attribute_visibility_default=unnecessary ;;
esac
AC_CACHE_CHECK([whether $CC supports __attribute__((visibility("default")))],
ncbi_cv_c_attribute_visibility_default,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[__attribute__((visibility("default"))) void f(void); void f(void) {}]],
[[f();]])],
[ncbi_cv_c_attribute_visibility_default=yes],
[ncbi_cv_c_attribute_visibility_default=no])])
if test $ncbi_cv_c_attribute_visibility_default = yes; then
AC_DEFINE(HAVE_ATTRIBUTE_VISIBILITY_DEFAULT, 1,
[Define to 1 if your compiler supports __attribute__((visibility("default")))])
fi
AC_CACHE_CHECK([whether the C compiler supports C99 restrict],
ncbi_cv_c_restrict,
[ncbi_cv_c_restrict=no
for restrict in restrict __restrict__ __restrict; do
test "$ncbi_cv_c_restrict" = "no" || break
AC_COMPILE_IFELSE([AC_LANG_SOURCE([void f(int * $restrict p);])],
[ncbi_cv_c_restrict=$restrict], [])
done])
restrict=$ncbi_cv_c_restrict
test "$restrict" = "no" && restrict=""
AC_DEFINE_UNQUOTED(NCBI_RESTRICT_C, $restrict,
[Define to whatever syntax, if any, your C compiler supports for marking
pointers as restricted in the C99 sense.])
if test -n "$restrict"; then
AC_DEFINE(HAVE_RESTRICT_C, 1,
[Define to 1 if your C compiler supports some variant of the C99
`restrict' keyword.])
fi
AC_LANG_POP(C)
AC_CACHE_CHECK([whether the C++ compiler supports C99 restrict],
ncbi_cv_cxx_restrict,
[ncbi_cv_cxx_restrict=no
for restrict in restrict __restrict__ __restrict; do
test "$ncbi_cv_cxx_restrict" = "no" || break
AC_COMPILE_IFELSE([AC_LANG_SOURCE([void f(int * $restrict p);])],
[ncbi_cv_cxx_restrict=$restrict], [])
done])
restrict=$ncbi_cv_cxx_restrict
test "$restrict" = "no" && restrict=""
AC_DEFINE_UNQUOTED(NCBI_RESTRICT_CXX, $restrict,
[Define to whatever syntax, if any, your C++ compiler supports for marking
pointers as restricted in the C99 sense.])
if test -n "$restrict"; then
AC_DEFINE(HAVE_RESTRICT_CXX, 1,
[Define to 1 if your C++ compiler supports some variant of the C99
`restrict' keyword.])
fi
AC_CACHE_CHECK([syntax for marking functions that never return],
ncbi_cv_c_noreturn,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[void f(void) __attribute__((__noreturn__)); void f(void) { }]],
[[f();]])],
[ncbi_cv_c_noreturn='__attribute__((__noreturn__))'],
[ncbi_cv_c_noreturn=none])])
noret=$ncbi_cv_c_noreturn
test "$noret" = "none" && noret=""
AC_DEFINE_UNQUOTED(NCBI_NORETURN, $noret,
[Define to whatever syntax, if any, your compiler supports for marking
functions that never return.])
# for FreeTDS
AC_CACHE_CHECK([whether FIONBIO requires BSD_COMP to be defined],
ncbi_cv_decl_fionbio_needs_bsd_comp,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[ #include <sys/types.h>
#include <sys/ioctl.h> ]],
[[ int request = FIONBIO; ]])],
[ncbi_cv_decl_fionbio_needs_bsd_comp=no],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[ #define BSD_COMP 1
#include <sys/types.h>
#include <sys/ioctl.h> ]],
[[ int request = FIONBIO; ]])],
[ncbi_cv_decl_fionbio_needs_bsd_comp=yes],
[ncbi_cv_decl_fionbio_needs_bsd_comp="never defined at all"])])])
if test "$ncbi_cv_decl_fionbio_needs_bsd_comp" = yes; then
AC_DEFINE(BSD_COMP, 1,
[Define to 1 if necessary to get FIONBIO (e.g., on Solaris)])
fi
AC_CACHE_CHECK([whether INADDR_NONE is defined], ncbi_cv_decl_inaddr_none,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
]],
[[ unsigned long addr = INADDR_NONE; ]])],
[ncbi_cv_decl_inaddr_none=yes], [ncbi_cv_decl_inaddr_none=no])])
if test "$ncbi_cv_decl_inaddr_none" != yes; then
AC_DEFINE(INADDR_NONE, 0xffffffff,
[Define to 0xffffffff if your operating system doesn't.])
fi
AC_CACHE_CHECK([whether unaligned reads are permissible],
ncbi_cv_sys_unaligned_reads,
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]],
[[ unsigned int a[2] = { 0x01234567, 0x89abcdef };
fprintf(stderr, "%x\n", *(unsigned int*)((char*)a + 1)); ]])],
[ncbi_cv_sys_unaligned_reads=yes],
[ncbi_cv_sys_unaligned_reads=no],
[case "$host_cpu" in
i?86|x86_64|powerpc*|ppc*) ncbi_cv_sys_unaligned_reads=yes ;;
*) ncbi_cv_sys_unaligned_reads=no ;;
esac])])
if test "$ncbi_cv_sys_unaligned_reads" = yes; then
AC_DEFINE(HAVE_UNALIGNED_READS, 1,
[Define to 1 if your system permits reading integers from
unaligned addresses.])
fi
AC_CACHE_CHECK([whether $CXX supports C++0x nullptr], ncbi_cv_cxx_nullptr,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[void * p = nullptr;]])],
[ncbi_cv_cxx_nullptr=yes], [ncbi_cv_cxx_nullptr=no])])
if test "$ncbi_cv_cxx_nullptr" = yes; then
AC_DEFINE(HAVE_NULLPTR, 1,
[Define to 1 if your C++ compiler supports the C++0x `nullptr' keyword.])
fi
### Check for the availability of other packages
### --------------------------------------------
AC_MSG_CHECKING([whether in-house NCBI resources are available])
if test -n "$orig_NCBI" -a -f "$orig_NCBI/.ncbirc" \
-a -d /am/coremake_builds/test_data; \
then
NCBI_FEATURE(in-house-resources)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
### Common-use system and miscellaneous libs
if test -z "${NETWORK_LIBS+set}"; then
AC_CHECK_LIB(nsl, gethostbyname, [libnsl=-lnsl], [libnsl=])
AC_CHECK_LIB(socket, connect, [NETWORK_LIBS="-lsocket $libnsl"],
[NETWORK_LIBS=$libnsl])
fi
AC_CACHE_CHECK([for res_search in -lresolv], ac_cv_lib_resolv_res_search,
[orig_LIBS=$LIBS
LIBS="-lresolv $NETWORK_LIBS $orig_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <resolv.h>]],
[[unsigned char ans[256];
int st = res_search("foo.bar", 1, 1, ans, sizeof(ans));]])],
[ac_cv_lib_resolv_res_search=yes], [ac_cv_lib_resolv_res_search=no])
LIBS=$orig_LIBS])
if test "$ac_cv_lib_resolv_res_search" = "yes"; then
RESOLVER_LIBS=-lresolv
else
RESOLVER_LIBS=
fi
orig_LIBS=$LIBS
LIBS="$NETWORK_LIBS $orig_LIBS"
AC_CHECK_FUNCS(inet_ntoa_r)
if test "$with_ncbi_public" = "yes" -a "$OSTYPE" = "solaris"; then
AC_MSG_NOTICE([Skipping checks for network functions new to Solaris 8.])
else
AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
[AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <netdb.h>]],
[[struct addrinfo *p; getaddrinfo("foo", "bar", p, &p);]])],
[ac_cv_func_getaddrinfo=yes], [ac_cv_func_getaddrinfo=no])])
test "$ac_cv_func_getaddrinfo" = "yes" && \
AC_DEFINE(HAVE_GETADDRINFO, 1,
[Define to 1 if you have the `getaddrinfo' function.])
AC_CACHE_CHECK([for getnameinfo], ac_cv_func_getnameinfo,
[AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>]],
[[struct sockaddr p; char buf[256], buf2[256];
getnameinfo(&p, sizeof(p), buf, 256, buf2, 256, 0);]])],
[ac_cv_func_getnameinfo=yes], [ac_cv_func_getnameinfo=no])])
test "$ac_cv_func_getnameinfo" = "yes" && \
AC_DEFINE(HAVE_GETNAMEINFO, 1,
[Define to 1 if you have the `getnameinfo' function.])
AC_CHECK_FUNCS(freehostent gethostent_r getipnodebyaddr getipnodebyname \
inet_ntop)
fi
LIBS=$orig_LIBS
### Save original compiler/linker flags
orig_CPPFLAGS="$CPPFLAGS"
orig_LDFLAGS="$LDFLAGS"
orig_LIBS="$LIBS"
### Check for math functions that aren't always available
AC_CHECK_FUNCS(erf)
NCBI_CHECK_LIBS(KSTAT, kstat, kstat_open)
NCBI_CHECK_LIBS(RPCSVC, rpcsvc, rstat)
AC_LANG_PUSH(C)
# Force C for this test because Sun WorkShop otherwise complains about
# multiple extern "C" declarations of setkey.
NCBI_CHECK_LIBS(CRYPT, crypt crypt_i, setkey)
AC_LANG_POP(C)
case "$host_os:$compiler" in
solaris*:GCC ) ac_cv_search_dlopen="-ldl" ;;
darwin* ) ac_cv_search_iconv="-liconv" ;;
esac
NCBI_CHECK_LIBS(DL, dl, dlopen)
# libc's stubs aren't always sufficient...
case "$host_os:$libnsl" in
solaris2.[[89]]:* ) orig_LIBS="$DL_LIBS $orig_LIBS" ;;
solaris*:-lnsl ) NETWORK_LIBS="$NETWORK_LIBS $DL_LIBS" ;;
esac
dnl NCBI_CHECK_LIBS(UUID, uuid, uuid_generate)
AC_SEARCH_LIBS(uuid_generate, uuid,
[NCBI_PACKAGE(UUID)
test "x$ac_cv_search_uuid_generate" = "xnone required" || \
UUID_LIBS=$ac_cv_search_uuid_generate])
LIBS=$orig_LIBS
dnl NCBI_CHECK_LIBS(FUSE, fuse, fuse_loop)
AC_SEARCH_LIBS(fuse_loop, fuse, [NCBI_PACKAGE(FUSE)])
LIBS=$orig_LIBS
NCBI_CHECK_LIBS(RT, rt posix4, clock_gettime)
NCBI_CHECK_LIBS(DEMANGLE, demangle, cplus_demangle)
# Add to (orig_)LIBS if present for the sake of corelib and the
# following call to AC_CHECK_FUNCS.
if test -n "$DEMANGLE_LIBS$RT_LIBS"; then
LIBS="$DEMANGLE_LIBS $RT_LIBS $LIBS"
orig_LIBS="$DEMANGLE_LIBS $RT_LIBS $orig_LIBS"
fi
AC_CHECK_FUNCS([nanosleep sched_yield])
dnl NCBI_CHECK_LIBS(ICONV, iconv, iconv)
# We need to include <iconv.h>, since some implementations rename the symbols.
# This logic adapted from Bruno Haible's iconv.m4.
AC_CACHE_CHECK(for library containing iconv, ac_cv_search_iconv, [
ac_cv_search_iconv=no
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <stdlib.h>
#include <iconv.h>]],
[[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);]])],
[ac_cv_search_iconv="none required"])
if test "$ac_cv_search_iconv" != "none required"; then
for l in iconv; do
LIBS="-l$l $orig_LIBS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <stdlib.h>
#include <iconv.h>]],
[[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);]])],
[ac_cv_search_iconv=-l$l])
LIBS="$orig_LIBS"
done
fi])
if test "x$ac_cv_search_iconv" != xno; then
AC_DEFINE(HAVE_LIBICONV, 1,
[Define to 1 if ICONV is available, either in its own library or as part
of the standard libraries.])
AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL(am_cv_proto_iconv, [
AC_COMPILE_IFELSE([[
#include <stdlib.h>
#include <iconv.h>
extern
#ifdef __cplusplus
"C"
#endif
#if defined(__STDC__) || defined(__cplusplus)
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
#else
size_t iconv();
#endif
]], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
AC_MSG_RESULT([$]{ac_t:-
}[$]am_cv_proto_iconv)
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
[Define as const if the declaration of iconv() needs const.])
if test "x$ac_cv_search_iconv" != "xnone required"; then
ICONV_LIBS=$ac_cv_search_iconv
fi
fi
### Third-party libraries
usr_lib=['[/usr]*/lib/*[amdsprcv]*[23469]*']
no_usr_lib="s,-L$usr_lib ,,g;"
NCBI_CHECK_THIRD_PARTY_LIB(z,
[[AC_LANG_PROGRAM([#include <zlib.h>],
[[gzFile fp; char buf[1024]; int n = gzread(fp, buf, sizeof(buf))]])]])
if test -z "$Z_LIBS"; then
zlocal=util/compress/zlib
AC_MSG_NOTICE([using local zlib copy in $zlocal])
Z_PATH="<$zlocal>"
Z_INCLUDE="-I\$(includedir)/$zlocal -I\$(includedir0)/$zlocal"
# Z_LIBS="-lz"
Z_LIB="z"
# AC_DEFINE(USE_LOCAL_ZLIB, 1, [Define to 1 if using a local copy of zlib.])
NCBI_PACKAGE(Z)
NCBI_PACKAGE(LocalZ)
fi
NCBI_CHECK_THIRD_PARTY_LIB(bz2,
[[AC_LANG_PROGRAM([#include <bzlib.h>],
[[BZFILE* fp; char buf[1024]; int err;
int n = BZ2_bzRead(&err, fp, buf, sizeof(buf))]])]])
if test -z "$BZ2_LIBS"; then
bzlocal=util/compress/bzip2
AC_MSG_NOTICE([using local bzlib copy in $bzlocal])
BZ2_PATH="<$bzlocal>"
BZ2_INCLUDE="-I\$(includedir)/$bzlocal -I\$(includedir0)/$bzlocal"
# BZ2_LIBS="-lbz2"
BZ2_LIB="bz2"
AC_DEFINE(USE_LOCAL_BZLIB, 1, [Define to 1 if using a local copy of bzlib.])
NCBI_PACKAGE(BZ2)
NCBI_PACKAGE(LocalBZ2)
fi
: ${LZO_PATH=$NCBI/lzo2}
if test -d "$LZO_PATH"; then
NCBI_FIX_DIR(LZO_PATH)
fi
NCBI_CHECK_THIRD_PARTY_LIB_EX(lzo, LZO, lzo2,
[[AC_LANG_PROGRAM([#include <lzo/lzo1x.h>],
[[lzo_uint32 c = lzo_crc32(0, (const unsigned char*)"foo", 3);]])]])
if test -z "$PCRE_PATH" && pcre-config --version >/dev/null 2>&1; then
p=`pcre-config --prefix`
test "x$p" = "x/usr" || PCRE_PATH=$p
fi
NCBI_CHECK_THIRD_PARTY_LIB(pcre,
[[AC_LANG_PROGRAM([#include <pcre.h>],
[[const char*s[]={"x"}; pcre* p; pcre_extra* x = pcre_study(p, 1, s);]])]])
if test -z "$PCRE_LIBS"; then
pcrelocal=util/regexp
AC_MSG_NOTICE([using local PCRE copy in $pcrelocal])
PCRE_PATH="<$pcrelocal>"
PCRE_INCLUDE="-I\$(includedir)/$pcrelocal -I\$(includedir0)/$pcrelocal"
# PCRE_LIBS="-lregexp"
# PCREPOSIX_LIBS="-lregexp"
PCRE_LIB="regexp"
AC_DEFINE(USE_LOCAL_PCRE, 1, [Define to 1 if using a local copy of PCRE.])
NCBI_PACKAGE(PCRE)
NCBI_PACKAGE(LocalPCRE)
else
PCREPOSIX_LIBS=`echo "$PCRE_LIBS" | sed -e 's/-lpcre/-lpcreposix -lpcre/'`
fi
## SSL/TLS libraries
case "$with_gnutls" in
no ) ac_cv_path_LIBGNUTLS_CONFIG=no ;;
yes | '' ) : ${GNUTLS_PATH=$NCBI/gnutls} ;;
* ) GNUTLS_PATH=$with_gnutls ;;
esac
if test -d "$GNUTLS_PATH"; then
NCBI_FIX_DIR(GNUTLS_PATH)
fi
AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, [], [${GNUTLS_BIN-$GNUTLS_PATH/${compiler_vpfx}${DEBUG_SFX}${mt_sfx}${bit64_sfx}/bin}:$GNUTLS_PATH/bin${bit64_sfx}:$GNUTLS_PATH/bin:$PATH])
if test "x$with_gnutls" != xno; then
if test -x "$LIBGNUTLS_CONFIG"; then
if test -z "$GNUTLS_PATH"; then
p=`libgnutls-config --prefix`
test "x$p" = "x/usr" || GNUTLS_PATH=$p
fi
else
LIBGNUTLS_CONFIG="eval PKG_CONFIG_PATH=\"$GNUTLS_PATH/lib/pkgconfig\" pkg-config gnutls"
$LIBGNUTLS_CONFIG --exists >/dev/null 2>&1 || LIBGNUTLS_CONFIG=no
fi
case "$LIBGNUTLS_CONFIG" in
eval\ *)
NCBI_RPATHIFY_OUTPUT(GNUTLS_LIBPATH,
[$LIBGNUTLS_CONFIG --libs-only-L])
;;
no)
;;
*)
NCBI_RPATHIFY_OUTPUT(GNUTLS_LIBPATH,
[$LIBGNUTLS_CONFIG --exec-prefix], [s,^,-L,; s,$,/lib,;])
;;
esac
if test "x$LIBGNUTLS_CONFIG" != xno; then
GNUTLS_INCLUDE=`$LIBGNUTLS_CONFIG --cflags`
GNUTLS_CONFIG_LIBS="`$LIBGNUTLS_CONFIG --libs` $Z_LIBS"
fi
else
AS_UNSET(GNUTLS_CONFIG_LIBS)
fi
NCBI_CHECK_THIRD_PARTY_LIB(gnutls,
[[AC_LANG_PROGRAM([[#include <gnutls/gnutls.h>
#if defined(_MT) && !defined(NCBI_WITHOUT_MT)
# include <gcrypt.h>
# include <pthread.h>
# include <errno.h>
GCRY_THREAD_OPTION_PTHREAD_IMPL;
#endif]],
[[#if defined(_MT) && !defined(NCBI_WITHOUT_MT)
gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
#endif
gnutls_session_t s; gnutls_init(&s, GNUTLS_CLIENT);]])]],
$GNUTLS_CONFIG_LIBS)
if test -n "$GNUTLS_CONFIG_LIBS"; then
NCBI_RPATHIFY_OUTPUT(GNUTLS_LIBS, [echo $GNUTLS_CONFIG_LIBS], [$no_usr_lib])
fi
NCBI_CHECK_THIRD_PARTY_LIB_EX(openssl, OPENSSL, ssl,
[[AC_LANG_PROGRAM([[#include <openssl/ssl.h>]],
[[SSL_library_init();]])]],
-lcrypto)
OPENSSL_STATIC_LIBS=$OPENSSL_LIBS
for d in `echo " $OPENSSL_LIBS" | fmt -w 1 | sed -ne 's/^ *-L//p'` \
/usr/local/lib${bit64_sfx} /usr/local/lib /usr/lib${bit64_sfx} /usr/lib; do
if test -f $d/libssl.a -a -f $d/libcrypto.a; then
OPENSSL_STATIC_LIBS="$d/libssl.a $d/libcrypto.a"
break
elif test -f $d/libssl.so -o -f $d/libssl.dylib; then
break
fi
done
if test -n "$GNUTLS_LIBS"; then
TLS_INCLUDE=$GNUTLS_INCLUDE
TLS_LIBS=$GNUTLS_LIBS
else
TLS_INCLUDE=$OPENSSL_INCLUDE
TLS_LIBS=$OPENSSL_LIBS
fi
## SYBASE libraries
NETWORK_PURE_LIBS="$NETWORK_LIBS"
ncbi_xreader_pubseqos=
UNLESS_PUBSEQOS=
if test "$with_sybase" != "no" ; then
sybase_lib=lib$bit64_sfx
resolve_sybase=true
default_pointer=default-${NCBI_PLATFORM_BITS}bit
: ${with_sybase_new:="no"}
case "$host_os" in
linux* )
: ${with_sybase_local:=yes}
;;
* )
if test -d "$net_sybase_root" ; then
: ${with_sybase_local:=no}
else
: ${with_sybase_local:=yes}
fi
;;
esac
if test "$with_sybase_local" != "no" ; then
if test "$with_sybase_local" = "yes" ; then
if test -n "$SYBASE_PATH" ; then
with_sybase_local=$SYBASE_PATH
else
if test "$with_sybase_new" = "yes" ; then
with_sybase_local=$local_sybase_root/new
elif test -f "$local_sybase_root/$default_pointer" ; then
with_sybase_local=`cat $local_sybase_root/$default_pointer`
resolve_sybase=false
else
with_sybase_local=$local_sybase_root/current
fi
if test -d "$with_sybase_local$NCBI_PLATFORM_BITS" ; then
with_sybase_local=$with_sybase_local$NCBI_PLATFORM_BITS
fi
fi # default paths
fi # no command-line path
if test -d "$with_sybase_local" ; then
SYBASE_PATH=$with_sybase_local
SYBASE_LCL_PATH=
else
with_sybase_local=no
fi
fi
if test "$with_sybase_local" = "no" ; then
if test "$with_sybase_new" = "yes" ; then
if test -d "$net_sybase_root/new$NCBI_PLATFORM_BITS" ; then
SYBASE_LCL_PATH=$local_sybase_root/new$NCBI_PLATFORM_BITS
SYBASE_PATH=$net_sybase_root/new$NCBI_PLATFORM_BITS
elif test -d "$net_sybase_root/new" ; then
SYBASE_LCL_PATH=$local_sybase_root/new
SYBASE_PATH=$net_sybase_root/new
else
with_sybase_new=no
fi
fi
if test -z "$SYBASE_PATH" ; then
if test -f "$net_sybase_root/$default_pointer" ; then
SYBASE_LCL_PATH=
SYBASE_PATH=`cat $local_sybase_root/$default_pointer`
resolve_sybase=false
elif test -d "$net_sybase_root/current$NCBI_PLATFORM_BITS" ; then
SYBASE_LCL_PATH=$local_sybase_root/current$NCBI_PLATFORM_BITS
SYBASE_PATH=$net_sybase_root/current$NCBI_PLATFORM_BITS
elif test -d "$net_sybase_root/current" ; then
SYBASE_LCL_PATH=$local_sybase_root/current
SYBASE_PATH=$net_sybase_root/current
else
SYBASE_LCL_PATH=
SYBASE_PATH=$SYBASE
fi
fi
fi
# Lock in the version we found, ignoring symlinks further up
case "$SYBASE_PATH" in
*/[[1-9]]* ) resolve_sybase=false ;;
esac
if test -d "$SYBASE_PATH" && $resolve_sybase; then
# SYBASE_PATH_=`cd $SYBASE_PATH && /bin/pwd`
SYBASE_PATH_=`ls -ld $SYBASE_PATH | sed -ne 's/.* -> //p'`
case "$SYBASE_PATH_" in
'' ) ;;
/* )
SYBASE_VERSION=`basename $SYBASE_PATH_`
SYBASE_PATH=`dirname $SYBASE_PATH`/$SYBASE_VERSION
test -d "$SYBASE_PATH" || SYBASE_PATH=$SYBASE_PATH_
;;
* )
orig_parent=`dirname $SYBASE_PATH`
SYBASE_VERSION=`basename $SYBASE_PATH_`
SYBASE_PATH=$orig_parent/$SYBASE_VERSION
test -d "$SYBASE_PATH" || SYBASE_PATH=$orig_parent/$SYBASE_PATH_
;;
esac
fi
if test -d "$SYBASE_LCL_PATH" && $resolve_sybase ; then
# SYBASE_LCL_PATH_=`cd $SYBASE_LCL_PATH && /bin/pwd`
SYBASE_LCL_PATH_=`ls -ld $SYBASE_LCL_PATH | sed -ne 's/.* -> //p'`
case "$SYBASE_LCL_PATH_" in
'' ) ;;
/* )
SYBASE_LCL_VERSION=`basename $SYBASE_LCL_PATH_`
SYBASE_LCL_PATH=`dirname $SYBASE_LCL_PATH`/$SYBASE_LCL_VERSION
test -d "$SYBASE_LCL_PATH" || SYBASE_LCL_PATH=$SYBASE_LCL_PATH_
;;
* )
orig_parent=`dirname $SYBASE_LCL_PATH`
SYBASE_LCL_VERSION=`basename $SYBASE_LCL_PATH_`
SYBASE_LCL_PATH=$orig_parent/$SYBASE_LCL_VERSION
test -d "$SYBASE_LCL_PATH" || \
SYBASE_LCL_PATH=$orig_parent/$SYBASE_LCL_PATH_
;;
esac
elif test -n "$SYBASE_LCL_PATH" ; then
SYBASE_LCL_PATH=`dirname $SYBASE_LCL_PATH`/$SYBASE_VERSION
fi
if test -n "$SYBASE_VERSION" -a -n "$SYBASE_LCL_VERSION" \
-a "$SYBASE_VERSION" != "$SYBASE_LCL_VERSION" ; then
AC_MSG_WARN([ignoring inconsistent local Sybase symlink: $SYBASE_LCL_VERSION vs. $SYBASE_VERSION])
SYBASE_LCL_PATH=`dirname $SYBASE_LCL_PATH`/$SYBASE_VERSION
fi
if test -n "$SYBASE" ; then
if test -d "$net_sybase_root" -o -d "$local_sybase_root" ; then
case $SYBASE in
$net_sybase_root/* | $local_sybase_root/* ) ;;
* ) AC_MSG_WARN([ignoring non-standard SYBASE setting: $SYBASE]) ;;
# Ignored regardless, but standard values are not so concerning.
esac
fi
fi
SYBASE_LIBPATH="$SYBASE_PATH/${sybase_lib}"
syb_sfx=$bit64_sfx
if test "$with_mt" = "yes" ; then
AC_CACHE_CHECK([for reentrant Sybase libraries], ncbi_cv_lib_sybase_r,
[if test -f "$SYBASE_LIBPATH/libct_r$bit64_sfx.so"; then
ncbi_cv_lib_sybase_r=yes
else
ncbi_cv_lib_sybase_r=no
fi])
if test $ncbi_cv_lib_sybase_r = yes; then
syb_sfx=_r$bit64_sfx
fi
fi
case "$host_os" in
linux*) sybtcl=-lsybtcl$syb_sfx; sybtli="" ;;
*) sybtcl=-ltcl$syb_sfx; sybtli=-ltli$syb_sfx ;;
esac
test -f "$SYBASE_LIBPATH/libtli.so" || sybtli=
# quick-patch for the bad "tli" lib (Solaris8/Intel specific)
case "$host_os:$host_vendor" in
solaris*:pc ) : ${sybase_sol8pc_patch:="yes"} ;;
esac
if test "$sybase_sol8pc_patch" = "yes" ; then
sybtli="-ltli_orig$syb_sfx -ltli$syb_sfx"
SYBASE_NETWORK_LIBS="-ltli$syb_sfx $NETWORK_LIBS"
else
SYBASE_NETWORK_LIBS="$NETWORK_LIBS"
fi
test -n "$bit64_sfx" && SYBASE_INCLUDE="-DSYB_LP64"
SYBASE_LIBLIST="-lblk$syb_sfx -lct$syb_sfx -lcs$syb_sfx $sybtcl"
SYBASE_LIBLIST="$SYBASE_LIBLIST -lcomn$syb_sfx -lintl$syb_sfx"
SYBASE_DLLLIST="$sybtli"
# deduce conf.macro: SYBASE_INCLUDE, SYBASE_LIBS, SYBASE_DLLS, SYBASE_DBLIBS
SYBASE_INCLUDE="-I$SYBASE_PATH/include $SYBASE_INCLUDE"
if test -z "$SYBASE_LCL_PATH" ; then
NCBI_RPATHIFY(SYBASE_LPATH, $SYBASE_LIBPATH)
else
SYBASE_LCL_LIBPATH="$SYBASE_LCL_PATH/${sybase_lib}"
NCBI_RPATHIFY(SYBASE_LPATH, $SYBASE_LCL_LIBPATH $SYBASE_LIBPATH)
SYBASE_INCLUDE="-I$SYBASE_LCL_PATH/include $SYBASE_INCLUDE"
fi
SYBASE_LIBS="$SYBASE_LPATH $SYBASE_LIBLIST"
SYBASE_DBLIBS="$SYBASE_LPATH $SYBASE_DBLIBS"
SYBASE_DLLS="$SYBASE_DLLLIST"
AC_CACHE_CHECK([for Sybase in $SYBASE_PATH], ncbi_cv_lib_sybase,
[CPPFLAGS="$SYBASE_INCLUDE $orig_CPPFLAGS"
LIBS="$SYBASE_LIBS $SYBASE_DLLS $SYBASE_NETWORK_LIBS $DL_LIBS $orig_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <ctpublic.h>]],
[[CS_RETCODE i = ct_init(0,0); i = cs_ctx_global(0,0); ]])],
[ncbi_cv_lib_sybase=yes], [ncbi_cv_lib_sybase=no])])
if test "$ncbi_cv_lib_sybase" = yes; then
NCBI_PACKAGE(Sybase)
AC_DEFINE(HAVE_LIBSYBASE, 1,
[Define to 1 if SYBASE libraries are available.])
if test "$with_mt" = "yes" -a "$ncbi_cv_lib_sybase_r" = "yes"; then
AC_DEFINE(HAVE_SYBASE_REENTRANT, 1,
[Define to 1 if SYBASE has reentrant libraries.])
fi
if test "$with_dbapi" != no -a -f ${real_srcdir}/src/objtools/data_loaders/genbank/pubseq/Makefile.ncbi_xreader_pubseqos.lib ; then
AC_CACHE_CHECK([for PubSeq service availability], ncbi_cv_db_pubseq,
[if grep PUBSEQ_OS $SYBASE_PATH/interfaces >/dev/null; then
ncbi_cv_db_pubseq=yes
else
ncbi_cv_db_pubseq=no
fi])
if test "$ncbi_cv_db_pubseq" = yes; then
AC_DEFINE(HAVE_PUBSEQ_OS, 1,
[Define to 1 if the PUBSEQ service is available.])
NCBI_FEATURE(PubSeqOS)
ncbi_xreader_pubseqos=ncbi_xreader_pubseqos
ncbi_xreader_pubseqos2=ncbi_xreader_pubseqos2
UNLESS_PUBSEQOS=\#
fi
fi
SYBASE_DBLIBS="$SYBASE_LPATH -lsybdb${bit64_sfx}"
AC_CACHE_CHECK([for Sybase DBLib], ncbi_cv_lib_sybdb,
[CPPFLAGS="$SYBASE_INCLUDE $orig_CPPFLAGS"
LIBS="$SYBASE_DBLIBS $SYBASE_LIBS $SYBASE_DLLS $SYBASE_NETWORK_LIBS $DL_LIBS $orig_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[
#include <sybfront.h>
#include <sybdb.h>
]],
[[
LOGINREC* x_login = 0;
DBPROCESS* x_dbproc = dbopen(x_login, (char*) "SRV_NAME");
]])],
[ncbi_cv_lib_sybdb=yes], [ncbi_cv_lib_sybdb=no])])
if test "$ncbi_cv_lib_sybdb" = yes; then
NCBI_PACKAGE(DBLib)
AC_DEFINE(HAVE_LIBSYBDB, 1,
[Define to 1 if SYBASE DBLib is available.])
else
SYBASE_DBLIBS=
fi
# apply the Sybase patch to $NETWORK_LIBS
if test "$sybase_sol8pc_patch" = "yes" ; then
NETWORK_LIBS="$SYBASE_LPATH $SYBASE_NETWORK_LIBS"
fi
else
NCBI_MISSING_PACKAGE(sybase)
fi
fi # with_sybase != no?
if test "$with_sybase" = no; then
SYBASE_PATH="No_Sybase"
SYBASE_INCLUDE=
SYBASE_LIBS=
SYBASE_DLLS=
SYBASE_DBLIBS=
fi
SYBASE_LPATH=
SYBASE_LCL_LIBPATH=
SYBASE_LIBLIST=
SYBASE_DLLLIST=
SYBASE_LIBPATH=
## FreeTDS libraries
freetds=
if test "$with_ftds" != "no" ; then
ftds64=ftds64
try_local=yes
case "$with_ftds" in
64 | yes | '' )
ftds_ver=64
ftds64=ftds
;;
* )
FTDS_PATH=$with_ftds
try_local=no
;;
esac
: ${FTDS_CTLIBS:="-lct -ltds"}
NCBI_RPATHIFY(FTDS_CTLIBS, $FTDS_PATH/lib, [ ]$FTDS_CTLIBS)
FTDS_INCLUDE="-I$FTDS_PATH/include"
NCBI_LOCAL_FTDS(64)
if test -n "$freetds" ; then
FTDS_LIB="\$(FTDS${ftds_ver}_LIB)"
FTDS_LIBS="\$(FTDS${ftds_ver}_LIBS)"
FTDS_INCLUDE="\$(FTDS${ftds_ver}_INCLUDE)"
if test "$with_ftds_renamed" != "no" ; then
AC_DEFINE(NCBI_FTDS_RENAME_SYBDB, 1,
[Rename DBLIB symbols in FTDS to avoid name clash with Sybase DBLIB.])
fi
AC_MSG_NOTICE([Using bundled FreeTDS (version $ftds_ver) from $FTDS_PATH])
else
FTDS_LIBS="$FTDS_CTLIBS"
AC_CACHE_CHECK([for FreeTDS in $FTDS_PATH], ncbi_cv_lib_freetds,
[CPPFLAGS="$FTDS_INCLUDE $orig_CPPFLAGS"
LIBS="$FTDS_LIBS $NETWORK_LIBS $orig_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[
#include <sybdb.h>
#include <tds.h>
]],
[[
LOGINREC* x_login = 0;
DBPROCESS* x_dbproc = dbopen(x_login, (char*) "SRV_NAME");
TDSLOGIN* x_tds_login = 0;
/* TDSSOCKET* x_sock = tds_connect(x_tds_login); */
tds_set_timeouts(x_tds_login, 0, 0, 0);
]])],
[ncbi_cv_lib_freetds=yes], [ncbi_cv_lib_freetds=no])])
if test "$ncbi_cv_lib_freetds" = "no"; then
# Don't panic when using partial trees lacking dbapi/driver/ftdsN.
NCBI_MISSING_PACKAGE(ftds)
fi
fi
fi
if test "$with_ftds" = "no" ; then
FTDS_PATH=
FTDS_INCLUDE=
FTDS_LIBS=
FTDS_LIB=
FTDS64_INCLUDE=
FTDS64_LIBS=
FTDS64_LIB=
FTDS64_CTLIB_INCLUDE=
FTDS64_CTLIB_LIBS=
FTDS64_CTLIB_LIB=
freetds=
else
AC_DEFINE(HAVE_LIBFTDS, 1,
[Define to 1 if FreeTDS libraries are available.])
NCBI_PACKAGE(FreeTDS)
fi
AC_SUBST(FTDS64_INCLUDE)
AC_SUBST(FTDS64_LIBS)
AC_SUBST(FTDS64_LIB)
AC_SUBST(FTDS64_CTLIB_INCLUDE)
AC_SUBST(FTDS64_CTLIB_LIBS)
AC_SUBST(FTDS64_CTLIB_LIB)
AC_SUBST(FTDS_INCLUDE)
AC_SUBST(FTDS_LIBS)
AC_SUBST(FTDS_LIB)
AC_SUBST(freetds)
AC_SUBST(ftds64)
## MySQL
if test "$with_mysql" != "no" ; then
case "$with_mysql" in
yes | "" ) ;;
* ) MYSQL_PATH=$with_mysql ;;
esac
: ${MYSQL_BINPATH=$MYSQL_PATH/bin}
AC_PATH_PROG(mysql_config, mysql_config, [], [$MYSQL_BINPATH:$PATH])
if test -n "$mysql_config" ; then
: ${MYSQL_BINPATH=`dirname $mysql_config`}
# Kill off single quotes, due to later requoting
: ${MYSQL_INCLUDE=`$mysql_config --include | tr -d \'`}
NCBI_RPATHIFY_OUTPUT_COND(MYSQL_LIBS, $mysql_config --libs${mt_sfx:+_r},
[s/'//g; ])
AC_CACHE_CHECK([whether MySQL works], ncbi_cv_lib_mysql,
[CPPFLAGS="$MYSQL_INCLUDE $orig_CPPFLAGS"
LIBS="$MYSQL_LIBS $orig_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <mysql.h>]],
[[MYSQL *p; p = mysql_init(p);]])],
[ncbi_cv_lib_mysql=yes], [ncbi_cv_lib_mysql=no])])
if test "$ncbi_cv_lib_mysql" = no; then
NCBI_MISSING_PACKAGE(mysql)
fi
else
NCBI_MISSING_PACKAGE(mysql)
fi
fi
if test "$with_mysql" = "no" ; then
MYSQL_PATH="No_MYSQL"
MYSQL_INCLUDE=
MYSQL_LIBS=
else
NCBI_PACKAGE(MySQL)
AC_DEFINE(HAVE_MYSQL, 1, [Define to 1 if MySQL is available.])
fi
## Berkeley DB library
if test "$with_bdb" != "no" ; then
case "$with_bdb" in
yes | "" )
: ${BERKELEYDB_PATH:="$NCBI/BerkeleyDB"}
;;
*/*)
BERKELEYDB_PATH=$with_bdb
AS_UNSET(BERKELEYDB_INCLUDE)
AS_UNSET(BERKELEYDB_LIBPATH)
AS_UNSET(BERKELEYDB_LIBS)
;;
*)
BERKELEYDB_PATH=$NCBI/BerkeleyDB-${with_bdb}
AS_UNSET(BERKELEYDB_INCLUDE)
AS_UNSET(BERKELEYDB_LIBPATH)
AS_UNSET(BERKELEYDB_LIBS)
;;
esac
if test -d "$BERKELEYDB_PATH"; then
NCBI_FIX_DIR(BERKELEYDB_PATH)
: ${BERKELEYDB_INCLUDE:="-I$BERKELEYDB_PATH/include"}
fi
if test -z "${BERKELEYDB_LIBPATH}"; then
for d in "${compiler_vpfx}${DEBUG_SFX}" "${compiler_pfx}${DEBUG_SFX}" \
"${DEBUG_SFX}" lib; do
for sfx in "$mt_sfx$bit64_sfx" "$bit64_sfx$mt_sfx" "$bit64_sfx" \
"$mt_sfx" ""; do
BERKELEYDB_LIBPATH=${BERKELEYDB_PATH}/$d$sfx
test -d "${BERKELEYDB_LIBPATH}" && break
done
test -d "${BERKELEYDB_LIBPATH}" && break
done
fi
if test -d "$BERKELEYDB_LIBPATH"; then
NCBI_FIX_DIR(BERKELEYDB_LIBPATH)
NCBI_RPATHIFY_COND(BERKELEYDB_LIBS:, ${BERKELEYDB_LIBPATH}, [ -ldb])
else
: ${BERKELEYDB_LIBS:="-ldb"}
fi
if test -f "${BERKELEYDB_LIBPATH}/libdb-static.a"; then
BERKELEYDB_STATIC_LIBS="-L${BERKELEYDB_LIBPATH} -ldb-static"
else
BERKELEYDB_STATIC_LIBS=${BERKELEYDB_LIBS}
fi
AC_CACHE_CHECK([for Berkeley DB libraries in $BERKELEYDB_PATH],
ncbi_cv_lib_berkeley_db,
[CPPFLAGS="$BERKELEYDB_INCLUDE $orig_CPPFLAGS"
LIBS="$BERKELEYDB_LIBS $orig_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <db.h>]],
[[ DB* dbp; db_create(&dbp, NULL, 0); dbp->app_private = 0; ]])],
[ncbi_cv_lib_berkeley_db=yes], [ncbi_cv_lib_berkeley_db=no])])
if test "$ncbi_cv_lib_berkeley_db" = "no"; then
NCBI_MISSING_PACKAGE(bdb)
else
AC_CACHE_CHECK([Berkeley DB version (4.3 or newer required)],
ncbi_cv_lib_berkeley_db_version,
[AC_LANG_CONFTEST([AC_LANG_SOURCE([[
#include <db.h>
ncbi_cv_lib_berkeley_db_version=DB_VERSION_MAJOR.DB_VERSION_MINOR.DB_VERSION_PATCH
]])])
eval "$ac_cpp $BERKELEYDB_INCLUDE conftest.$ac_ext" \
2>&AS_MESSAGE_LOG_FD | grep '^ncbi_cv_' | tr -d ' ' > conftest.sh
. ./conftest.sh
rm -f contest*
])
case "$ncbi_cv_lib_berkeley_db_version" in
1.* | 2.* | 3.* | 4.[[0-2]].* )
AC_MSG_WARN(
[Your Berkeley DB version is too old to use. (Needed >= 4.3.)])
if test -n "$with_bdb"; then
AC_MSG_ERROR([--with-bdb: Berkeley DB library is too old])
fi
with_bdb=no
;;
4.[[3-6]].* ) ;;
* )
AC_MSG_WARN(
[Untested Berkeley DB version; may prove incompatible.])
AC_MSG_WARN(
[If so, please re-run this script with the flag --without-bdb.])
;;
esac
fi
fi
if test "$with_bdb" = "no" ; then
BERKELEYDB_PATH="No_BerkeleyDB"
BERKELEYDB_INCLUDE=
BERKELEYDB_LIBS=
BERKELEYDB_STATIC_LIBS=
BERKELEYDB_CXX_LIBS=
BERKELEYDB_CXX_STATIC_LIBS=
else
NCBI_PACKAGE(BerkeleyDB)
AC_DEFINE(HAVE_BERKELEY_DB, 1,
[Define to 1 if Berkeley DB libraries are available.])
if test -d "$BERKELEYDB_LIBPATH"; then
NCBI_RPATHIFY_COND(BERKELEYDB_CXX_LIBS:, ${BERKELEYDB_LIBPATH},
[ -ldb_cxx -ldb])
else
: ${BERKELEYDB_CXX_LIBS:="-ldb_cxx -ldb"}
fi
if test -f "${BERKELEYDB_LIBPATH}/libdb_cxx-static.a"; then
BERKELEYDB_CXX_STATIC_LIBS="-L${BERKELEYDB_LIBPATH} -ldb_cxx-static -ldb-static"
else
BERKELEYDB_CXX_STATIC_LIBS=${BERKELEYDB_CXX_LIBS}
fi
AC_CACHE_CHECK([for native Berkeley DB C++ wrappers (optional)],
ncbi_cv_lib_berkeley_db_cxx,
[CPPFLAGS="$BERKELEYDB_INCLUDE $orig_CPPFLAGS"
LIBS="$BERKELEYDB_CXX_LIBS $orig_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <db_cxx.h>]],
[[DbEnv env(0); Db db(&env, 0); db.set_app_private(NULL);]])],
[ncbi_cv_lib_berkeley_db_cxx=yes],
[ncbi_cv_lib_berkeley_db_cxx=no])])
if test "$ncbi_cv_lib_berkeley_db_cxx" = "yes"; then
NCBI_PACKAGE(BerkeleyDB++)
AC_DEFINE(HAVE_BERKELEY_DB_CXX, 1,
[Define to 1 if the Berkeley `db_cxx' library is available.])
else
BERKELEYDB_CXX_LIBS=
BERKELEYDB_CXX_STATIC_LIBS=
fi
fi
## ODBC
case "$with_odbc" in
yes | "" ) : ${ODBC_PATH:=dbapi/driver/odbc/unix_odbc} ;;
internal | no ) ODBC_PATH=dbapi/driver/odbc/unix_odbc ;;
* ) ODBC_PATH=$with_odbc ;;
esac
case "$ODBC_PATH" in
dbapi/* ) ;;
*)
ODBC_INCLUDE="-I$ODBC_PATH/include"
ODBC_LIBPATH="${ODBC_PATH}/lib"
NCBI_RPATHIFY(ODBC_LIBS, ${ODBC_LIBPATH}, [ -lodbc -lodbcinst])
CPPFLAGS="$ODBC_INCLUDE $orig_CPPFLAGS"
LIBS="$ODBC_LIBS $orig_LIBS"
AC_CACHE_CHECK([for ODBC libraries in $ODBC_PATH], ncbi_cv_lib_odbc,
[AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <sql.h>]],
[[SQLHDBC hdbc; SQLCHAR* cp = (SQLCHAR*) "x";
SQLRETURN x = SQLConnect(hdbc, cp, 1, cp, 2, cp, 3);]])],
[ncbi_cv_lib_odbc=yes], [ncbi_cv_lib_odbc=no])])
if test "$ncbi_cv_lib_odbc" = "no"; then
dnl ODBC_PATH=dbapi/driver/odbc/unix_odbc
dnl AC_MSG_WARN([Falling back to internal FreeTDS-specific ODBC implementation.])
NCBI_MISSING_PACKAGE(odbc)
else
# odbcss.h isn't self-contained :-/
AC_CHECK_HEADERS(odbcss.h, [], [], [#include <sql.h>])
AC_CHECK_FUNCS(SQLGetPrivateProfileString)
AC_CHECK_TYPES(SQLLEN,,,[#include <sqltypes.h>])
AC_CACHE_CHECK([whether SQLColAttribute's last argument is an SQLLEN *],
ncbi_cv_func_sqlcolattribute_sqllen,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <sql.h>>
SQLRETURN SQL_API SQLColAttribute
(SQLHSTMT sh, SQLUSMALLINT cn, SQLUSMALLINT fi, SQLPOINTER ca,
SQLSMALLINT bl, SQLSMALLINT *sl, SQLLEN *na);]],
[[]])],
ncbi_cv_func_sqlcolattribute_sqllen=yes,
ncbi_cv_func_sqlcolattribute_sqllen=no)])
if test $ncbi_cv_func_sqlcolattribute_sqllen = yes; then
AC_DEFINE(NCBI_SQLCOLATTRIBUTE_SQLLEN, 1,
[Define to 1 if SQLColAttribute's last argument is an SQLLEN *])
fi
fi
;;
esac
case "$ODBC_PATH" in
dbapi/*)
# ODBC_PATH="No_ODBC"
# Point to a local copy of unixODBC's headers, required by FreeTDS 0.64+.
ODBC_INCLUDE="-I\$(includedir)/$ODBC_PATH -I\$(includedir0)/$ODBC_PATH"
ODBC_LIBS=
dnl AC_DEFINE(HAVE_SQLGETPRIVATEPROFILESTRING, 1)
AC_DEFINE(HAVE_SQLLEN, 1)
;;
*)
NCBI_PACKAGE(ODBC)
AC_DEFINE(HAVE_ODBC, 1, [Define to 1 if ODBC libraries are available.])
;;
esac
## Python
if test "$with_python" != "no" ; then
case "$with_python" in
yes | "" ) ;;
*/* ) PYTHON_PATH=$with_python ;;
esac
NCBI_CHECK_PYTHON()
NCBI_CHECK_PYTHON(2.3)
: ${PYTHON_PATH:="/usr/local/python-2.4.4"}
NCBI_CHECK_PYTHON(2.4)
NCBI_CHECK_PYTHON(2.5)
if test "$ncbi_cv_lib_python" = "no"; then
# Favor python 2.4 as the only version configure historically
# recognized, but otherwise prefer newer versions.
if test "$ncbi_cv_lib_python24" = "yes"; then
PYTHON_INCLUDE=$PYTHON24_INCLUDE
PYTHON_LIBS=$PYTHON24_LIBS
elif test "$ncbi_cv_lib_python25" = "yes"; then
PYTHON_INCLUDE=$PYTHON25_INCLUDE
PYTHON_LIBS=$PYTHON25_LIBS
elif test "$ncbi_cv_lib_python23" = "yes"; then
PYTHON_INCLUDE=$PYTHON23_INCLUDE
PYTHON_LIBS=$PYTHON23_LIBS
fi
if test -n "$PYTHON_LIBS"; then
NCBI_PACKAGE(PYTHON)
AC_DEFINE(HAVE_PYTHON, 1)
else
NCBI_MISSING_PACKAGE(python)
fi
fi
fi
## Java
if test "${with_jni-no}" != "no"; then
case "$with_jni:${JAVAC+set}" in
yes: | : )
if test -d "$JAVA_HOME"; then
JAVAC=$JAVA_HOME/bin/javac
else
JAVAC=javac
fi
;;
* )
JAVAC=$with_jni/bin/javac
;;
esac
AX_JNI_INCLUDE_DIR
JDK_INCLUDE=''
sep=''
for x in $JNI_INCLUDE_DIRS; do
JDK_INCLUDE=$JDK_INCLUDE$sep-I$x
sep=' '
done
AC_MSG_NOTICE([setting JDK_INCLUDE = $JDK_INCLUDE])
CPPFLAGS="$JDK_INCLUDE $orig_CPPFLAGS"
AC_CHECK_HEADER(jni.h,
[AC_DEFINE(NCBI_JNI, 1,
[Define to 1 if building Java Native Interface bindings.])
NCBI_FEATURE([JDK Ncbi-JNI])
JDK_PATH=$_JTOPDIR
ncbi_java=ncbi_java],
[JDK_INCLUDE=''
JDK_PATH=''
ncbi_java=''])
fi
## Boost
if test "$with_boost" != "no"; then
if test "${with_boost-yes}" = yes; then
: ${BOOST_PATH=$NCBI/boost}
else
BOOST_PATH=$with_boost
fi
if test -d "$BOOST_PATH"; then
NCBI_FIX_DIR(BOOST_PATH)
: ${BOOST_INCLUDE=-I$BOOST_PATH/include}
fi
BOOST_LIBPATH_=$BOOST_PATH/lib
NCBI_RPATHIFY_COND(BOOST_LIBPATH, $BOOST_LIBPATH_)
test -d "$BOOST_PATH" || BOOST_LIBPATH_=/usr/lib
boost_path_digits=`basename $BOOST_PATH | sed -e 's/.0$//' | tr -cd 0123456789`
if test -n "$boost_path_digits"; then
boost_version_digits=`echo $ncbi_cv_lib_boost_version | sed -e 's/.0$//' | tr -cd 0123456789`
if test $boost_path_digits != "$boost_version_digits"; then
# presumably stale, particularly if boost_version WASN'T cached;
# uncache all relevant settings
AS_UNSET(ncbi_cv_lib_boost_version)
AS_UNSET(ncbi_cv_lib_boost_regex)
AS_UNSET(ncbi_cv_lib_boost_spirit)
AS_UNSET(ncbi_cv_lib_boost_test)
AS_UNSET(ncbi_cv_lib_boost_thread)
fi
fi
AC_CACHE_CHECK([Boost version],
ncbi_cv_lib_boost_version,
[AC_LANG_CONFTEST([AC_LANG_SOURCE([[
#include <boost/version.hpp>
ncbi_cv_lib_boost_version=BOOST_LIB_VERSION
]])])
eval "$ac_cpp $BOOST_INCLUDE conftest.$ac_ext" \
2>&AS_MESSAGE_LOG_FD | grep '^ncbi_cv_' | tr -d ' ' > conftest.sh
. ./conftest.sh
rm -f contest*
])
if test -d `echo $BOOST_INCLUDE | sed -e 's/^-I//'`/boost-${ncbi_cv_lib_boost_version}/boost; then
BOOST_INCLUDE=$BOOST_INCLUDE/boost-${ncbi_cv_lib_boost_version}
fi
case "$ncbi_compiler" in
MIPSPRO)
BOOST_INCLUDE="$BOOST_INCLUDE $BOOST_INCLUDE/boost/compatibility/cpp_c_headers"
;;
WORKSHOP)
# Boost.Test's macros yield a *lot* of spurious "should not initialize
# a non-const reference with a temporary" warnings, to the point of
# overwhelming the compiler in some cases; turn them off altogether
# when using Boost at all.
BOOST_INCLUDE="$BOOST_INCLUDE -erroff=reftotemp"
;;
esac
case "$ncbi_cv_lib_boost_version" in
0_* | 1_[[0-9]] | 1_[[0-9]]_* | 1_[[0-2]][[0-9]] | 1_[[0-2]][[0-9]]_* ) ;;
1_3[[0-4]] | 1_3[[0-4]]_* )
AC_MSG_WARN(
[Your Boost version is too old to use. (Needed >= 1.35.)])
if test -n "$with_boost"; then
AC_MSG_ERROR([--with-boost: Boost library is too old])
fi
with_boost=no
;;
1_3[[5-9]] | 1_3[[5-9]]_* | 1_4[[0-5]] | 1_4[[0-5]]_* ) ;;
* )
AC_MSG_WARN(
[Untested Boost version; may prove incompatible.])
AC_MSG_WARN(
[If so, please re-run this script with the flag --without-boost.])
;;
esac
AC_MSG_CHECKING([for Boost library name tag])
case "$with_boost_tag" in
yes | "" )
case "$host_os:$ncbi_compiler" in
darwin*:GCC) BOOST_TAG="" ;;
*:GCC) BOOST_TAG="-gcc" ;;
*:KCC) BOOST_TAG="-kcc" ;;
linux*:ICC) BOOST_TAG="-il" ;;
*:WORKSHOP) BOOST_TAG="-sw" ;;
*:MIPSPRO) BOOST_TAG="-mp" ;;
*:VISUALAGE) BOOST_TAG="-xlc" ;;
*:COMPAQ) BOOST_TAG="-tru" ;;
*:MSVC) BOOST_TAG="-vc" ;;
esac
case "$BOOST_TAG" in
-gcc|-il ) boost_comp_vers=`echo $compiler_version | cut -c1-2` ;;
* ) boost_comp_vers='' ;;
esac
test "$with_mt" = "yes" && BOOST_MT=-mt
test "$with_debug" = "yes" && BOOST_D=-d
test "$bit64_sfx" = "64" && BOOST_64=-64
found=no
for base in "$BOOST_TAG$boost_comp_vers" "$BOOST_TAG" ''; do
for bvers in "-$ncbi_cv_lib_boost_version" ''; do
for b64 in $BOOST_64 ''; do
for bmt in "$BOOST_MT" '-mt' ''; do
for bd in "$BOOST_D" '' '-d'; do
bsfx=$cvers$bmt$bd$bvers$b64
if ls $BOOST_LIBPATH_/libboost*$base$bsfx.* >/dev/null 2>&1;
then
found=yes
break
fi
done
test "$found" = yes && break
done
test "$found" = yes && break
done
test "$found" = yes && break
done
test "$found" = yes && break
done
if test "$found" = no; then
base=$BOOST_TAG
cvers=$boost_comp_vers
bvers=-$ncbi_cv_lib_boost_version
b64=$BOOST_64
bmt=$BOOST_MT
bd=$BOOST_D
bsfx=$cvers$bmt$bd$bvers$b64
fi
BOOST_TAG=$base$bsfx
AC_MSG_RESULT([$BOOST_TAG (autodetected)])
;;
no )
BOOST_TAG=""
AC_MSG_RESULT([none (by explicit request)])
;;
*)
BOOST_TAG=$with_boost_tag
AC_MSG_RESULT([$BOOST_TAG (by explicit request)])
;;
esac
test "$with_mt" = yes || \
BOOST_INCLUDE="$BOOST_INCLUDE -DBOOST_DISABLE_THREADS"
BOOST_REGEX_LIBS=-lboost_regex${BOOST_TAG}
if test -f "$BOOST_LIBPATH_/libboost_regex${BOOST_TAG}-static.a"; then
BOOST_REGEX_STATIC_LIBS=-lboost_regex${BOOST_TAG}-static
else
BOOST_REGEX_STATIC_LIBS=$BOOST_REGEX_LIBS
fi
AC_CACHE_CHECK([for Boost.Regex in $BOOST_PATH], ncbi_cv_lib_boost_regex,
CPPFLAGS="$BOOST_INCLUDE $orig_CPPFLAGS"
LIBS="$BOOST_LIBPATH $BOOST_REGEX_LIBS $RT_LIBS $orig_LIBS"
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <boost/regex.hpp>]],
[[throw boost::regex_error(boost::regex_constants::error_stack);]])],
[ncbi_cv_lib_boost_regex=yes], [ncbi_cv_lib_boost_regex=no])])
AC_CACHE_CHECK([for Boost.Spirit in $BOOST_PATH], ncbi_cv_lib_boost_spirit,
CPPFLAGS="$BOOST_INCLUDE $orig_CPPFLAGS"
LIBS="$RT_LIBS $orig_LIBS"
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <boost/spirit.hpp>]],
[[boost::spirit::parse("123", boost::spirit::int_p);]])],
[ncbi_cv_lib_boost_spirit=yes], [ncbi_cv_lib_boost_spirit=no])])
BOOST_TEST_PEM_LIBS=-lboost_prg_exec_monitor${BOOST_TAG}
if test -f "$BOOST_LIBPATH_/libboost_prg_exec_monitor${BOOST_TAG}-static.a"; then
BOOST_TEST_PEM_STATIC_LIBS=-lboost_prg_exec_monitor${BOOST_TAG}-static
else
BOOST_TEST_PEM_STATIC_LIBS=$BOOST_TEST_PEM_LIBS
fi
BOOST_TEST_TEM_LIBS=-lboost_test_exec_monitor${BOOST_TAG}
if test -f "$BOOST_LIBPATH_/libboost_test_exec_monitor${BOOST_TAG}-static.a"; then
BOOST_TEST_TEM_STATIC_LIBS=-lboost_test_exec_monitor${BOOST_TAG}-static
else
BOOST_TEST_TEM_STATIC_LIBS=$BOOST_TEST_TEM_LIBS
fi
BOOST_TEST_UTF_LIBS=-lboost_unit_test_framework${BOOST_TAG}
if test -f "$BOOST_LIBPATH_/libboost_unit_test_framework${BOOST_TAG}-static.a"; then
BOOST_TEST_UTF_STATIC_LIBS=-lboost_unit_test_framework${BOOST_TAG}-static
else
BOOST_TEST_UTF_STATIC_LIBS=$BOOST_TEST_UTF_LIBS
dnl AC_DEFINE([NCBI_BOOST_TEST_DLL], 1,
dnl [Define to 1 if unable to locate an appropriate
dnl libboost_unit_test_framework${BOOST_TAG}-static.a.])
fi
BOOST_TEST_PEM_LIBS=$BOOST_TEST_PEM_STATIC_LIBS
BOOST_TEST_TEM_LIBS=$BOOST_TEST_TEM_STATIC_LIBS
BOOST_TEST_UTF_LIBS=$BOOST_TEST_UTF_STATIC_LIBS
AC_CACHE_CHECK([for Boost.Test in $BOOST_PATH], ncbi_cv_lib_boost_test,
CPPFLAGS="$BOOST_INCLUDE $orig_CPPFLAGS"
LIBS="$RT_LIBS $orig_LIBS"
found=
for mode in included external; do
if test "$mode" = external; then
CPPFLAGS="-DNCBI_BOOST_NOT_INCLUDED $CPPFLAGS"
LIBS="$BOOST_LIBPATH $BOOST_TEST_UTF_LIBS $LIBS"
fi
[AC_LINK_IFELSE(
[AC_LANG_SOURCE(
[[#ifdef NCBI_BOOST_NOT_INCLUDED
# include <boost/test/unit_test.hpp>
#else
# include <boost/test/included/unit_test.hpp>
#endif
using boost::unit_test::test_suite;
static void s_Test1(void) { BOOST_CHECK(1 == 1); }
test_suite* init_unit_test_suite(int, char*[])
{
test_suite* test = BOOST_TEST_SUITE("foo");
test->add(BOOST_TEST_CASE(&s_Test1), 0);
return test;
}]])],
[found="$found:$mode"])]
done
[case "$found" in
:included:external ) ncbi_cv_lib_boost_test=yes ;;
:included ) ncbi_cv_lib_boost_test=included-only ;;
:external ) ncbi_cv_lib_boost_test=external-only ;;
'' ) ncbi_cv_lib_boost_test=no ;;
esac])
BOOST_THREAD_LIBS=-lboost_thread${BOOST_TAG}
if test -f "$BOOST_LIBPATH_/libboost_thread${BOOST_TAG}-static.a"; then
BOOST_THREAD_STATIC_LIBS=-lboost_thread${BOOST_TAG}-static
else
BOOST_THREAD_STATIC_LIBS=$BOOST_THREAD_LIBS
fi
AC_CACHE_CHECK([for Boost.Threads in $BOOST_PATH], ncbi_cv_lib_boost_thread,
CPPFLAGS="$BOOST_INCLUDE $orig_CPPFLAGS"
LIBS="$BOOST_LIBPATH $BOOST_THREAD_LIBS $RT_LIBS $orig_LIBS"
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <boost/thread.hpp>]],
[[boost::mutex m; boost::mutex::scoped_lock l(m);]])],
[ncbi_cv_lib_boost_thread=yes], [ncbi_cv_lib_boost_thread=no])])
else
BOOST_INCLUDE=
BOOST_LIBPATH=
BOOST_TAG=
ncbi_cv_lib_boost_regex=no
ncbi_cv_lib_boost_spirit=no
ncbi_cv_lib_boost_test=no
ncbi_cv_lib_boost_thread=no
fi
if test "$ncbi_cv_lib_boost_regex" != "no"; then
AC_DEFINE(HAVE_BOOST_REGEX, 1,
[Define to 1 if the `Boost.Regex' library is available.])
NCBI_PACKAGE(Boost.Regex)
else
BOOST_REGEX_LIBS=
BOOST_REGEX_STATIC_LIBS=
fi
if test "$ncbi_cv_lib_boost_spirit" != "no"; then
AC_DEFINE(HAVE_BOOST_SPIRIT, 1,
[Define to 1 if the `Boost.Spirit' headers are available.])
NCBI_PACKAGE(Boost.Spirit)
fi
if test "$ncbi_cv_lib_boost_test" != "no"; then
AC_DEFINE(HAVE_BOOST_TEST, 1,
[Define to 1 if the `Boost.Test' libraries are available.])
if test "$ncbi_cv_lib_boost_test" != "included-only"; then
NCBI_PACKAGE(Boost.Test)
fi
if test "$ncbi_cv_lib_boost_test" != "external-only"; then
NCBI_PACKAGE(Boost.Test.Included)
fi
else
BOOST_TEST_PEM_LIBS=
BOOST_TEST_PEM_STATIC_LIBS=
BOOST_TEST_TEM_LIBS=
BOOST_TEST_TEM_STATIC_LIBS=
BOOST_TEST_UTF_LIBS=
BOOST_TEST_UTF_STATIC_LIBS=
fi
if test "$ncbi_cv_lib_boost_thread" != "no"; then
AC_DEFINE(HAVE_BOOST_THREAD, 1,
[Define to 1 if the `Boost.Threads' library is available.])
NCBI_PACKAGE(Boost.Threads)
else
BOOST_THREAD_LIBS=
BOOST_THREAD_STATIC_LIBS=
fi
case "$with_boost:$ncbi_cv_lib_boost_test" in
:* | no:* | *:yes | *:included-only ) ;; # no problem
* ) AC_MSG_ERROR([Boost explicitly requested, but Boost.Test.Included unavailable.]) ;;
esac
## NCBI C Toolkit
if test "$with_ncbi_c" != "no" ; then
NCBI_C_PATH=${NCBI_C_PATH:="$NCBI"}
if test "$ncbi_compiler" = ICC -a -d "$NCBI_C_PATH/ncbi_icc"; then
NCBI_C_PATH=$NCBI_C_PATH/ncbi_icc
fi
NCBI_C_INCLUDE="-I$NCBI_C_PATH/include${bit64_sfx}"
if test "$with_debug" = "no" ; then
NCBI_C_LIBPATH="$NCBI_C_PATH/lib${bit64_sfx}"
else
NCBI_C_LIBPATH="$NCBI_C_PATH/altlib${bit64_sfx}"
fi
if test "$with_mt" = "yes" ; then
NCBI_C_LIBPATH="$NCBI_C_LIBPATH $NCBI_C_LIBPATH/ncbithr.o"
fi
if test -n "$NCBI_C_ncbi" ; then
:
elif test "$OSTYPE" = "darwin" ; then
NCBI_C_ncbi="-lncbi -Wl,-framework,AppKit"
else
NCBI_C_ncbi="-lncbi"
fi
NCBI_C_LIBPATH="-L$NCBI_C_LIBPATH"
AC_CACHE_CHECK([for the NCBI C toolkit in $NCBI_C_PATH], ncbi_cv_lib_ctools,
[CPPFLAGS="$NCBI_C_INCLUDE $orig_CPPFLAGS"
LIBS="$NCBI_C_LIBPATH $NCBI_C_ncbi $NETWORK_LIBS $orig_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <ncbi.h>]],
[[ Nlm_Boolean b = Nlm_GetArgs("fake", -1, 0); ]])],
[ncbi_cv_lib_ctools=yes], [ncbi_cv_lib_ctools=no])])
if test "$ncbi_cv_lib_ctools" = no; then
NCBI_MISSING_PACKAGE(ncbi-c)
fi
fi
if test "$with_ncbi_c" = "no" ; then
if test "$with_ctools" = "yes"; then
AC_MSG_ERROR([--with-ctools: NCBI C Toolkit is missing])
fi
NCBI_C_PATH="No_NCBI_CToolkit"
NCBI_C_INCLUDE=
NCBI_C_LIBPATH=
NCBI_C_ncbi=
else
NCBI_PACKAGE(C-Toolkit)
AC_DEFINE(HAVE_NCBI_C, 1, [Define to 1 if the NCBI C toolkit is available.])
fi
# X11
LIBS="$orig_LIBS"
CPPFLAGS="$orig_CPPFLAGS"
# Look in /usr/X11R6/lib64 if necessary
xlib=`ls -d /usr/X11R6/lib$bit64_sfx/libX11.* 2>/dev/null | sed -ne 1p`
if test -f "$xlib" -a "${x_libraries-NONE}" = NONE \
-a "${x_includes-NONE}" = NONE; then
base=`basename $xlib`
cmp -s /usr/X11R6/lib/$base $xlib || \
cmp -s /usr/lib/$base $xlib || \
cmp -s /usr/lib$bit64_sfx/$base $xlib || \
x_libraries=/usr/X11R6/lib$bit64_sfx x_includes=/usr/X11R6/include
fi
AC_PATH_XTRA
x_libraries=`echo "$x_libraries" | sed -e "s,^$usr_lib\$,,"`
X_LIBS=`echo "$X_LIBS " | sed -e "$no_usr_lib"`
AC_CHECK_LIB(Xext, XextCreateExtension, Xext="-lXext", Xext=,
[$X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
AC_CHECK_LIB(Xt, XtMainLoop, Xt="-lXt", Xt=,
[$Xext $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
AC_CHECK_LIB(Xmu, XmuMakeAtom, Xmu="-lXmu", Xmu=,
[$Xt $Xext $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
LDFLAGS=$orig_LDFLAGS
X_ALL_LIBS="$Xmu $Xt $Xext $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
## OpenGL
if test "$with_opengl" != "no"; then
if test "${with_opengl-yes}" = yes; then
if test -d $NCBI/MesaGL; then
: ${OPENGL_PATH=$NCBI/MesaGL}
fi
else
OPENGL_PATH=$with_opengl
fi
if test -d "$OPENGL_PATH"; then
NCBI_FIX_DIR(OPENGL_PATH)
fi
case "$OSTYPE" in
darwin) # Use native interface
OPENGL_LIBS="-framework AGL -framework OpenGL"
;;
# cygwin) ... ;;
*) # Default -- assume X-based
LIBS="$orig_LIBS"
CPPFLAGS="$orig_CPPFLAGS"
LDFLAGS="$orig_LDFLAGS $X_LIBS"
if test -d "$OPENGL_PATH/include/GL"; then
OPENGL_INCLUDE="-I$OPENGL_PATH/include $X_CFLAGS"
else
OPENGL_INCLUDE=$X_CFLAGS
fi
if test -n "$OPENGL_PATH" -a -d "$OPENGL_PATH/lib${bit64_sfx}"; then
NCBI_RPATHIFY(OPENGL_LIBPATH, $OPENGL_PATH/lib${bit64_sfx},
[ ]$X_LIBS)
elif test -f /usr/lib/mesa/libGL.so; then
NCBI_RPATHIFY(OPENGL_LIBPATH, /usr/lib/mesa, [ ]$X_LIBS)
else
OPENGL_LIBPATH=$X_LIBS
fi
OPENGL_LIBS="$OPENGL_LIBPATH -lGLU -lGL $X_ALL_LIBS"
;;
esac
case "${OPENGL_PATH}" in
*/*) where=" in $OPENGL_PATH" ;;
* ) where= ;;
esac
AC_CACHE_CHECK([for OpenGL$where], ncbi_cv_lib_opengl,
[CPPFLAGS="$orig_CPPFLAGS $OPENGL_INCLUDE"
LIBS="$OPENGL_LIBS $orig_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[
#ifdef NCBI_OS_DARWIN
# include <OpenGL/gl.h>
#else
# include <GL/gl.h>
#endif
]],
[[glBegin(0);]])],
[ncbi_cv_lib_opengl=yes], [ncbi_cv_lib_opengl=no])])
fi
if test "$with_opengl" = "no" -o "$ncbi_cv_lib_opengl" = "no"; then
OPENGL_INCLUDE=
OPENGL_LIBS=
OPENGL_STATIC_LIBS=
OSMESA_INCLUDE=
OSMESA_LIBS=
OSMESA_STATIC_LIBS=
GLUT_INCLUDE=
GLUT_LIBS=
GLEW_INCLUDE=
GLEW_LIBS=
GLEW_STATIC_LIBS=
NCBI_MISSING_PACKAGE(opengl)
else
NCBI_PACKAGE(OpenGL)
AC_DEFINE(HAVE_OPENGL, 1, [Define to 1 if you have OpenGL (-lGL).])
if test -f "$OPENGL_PATH/lib${bit64_sfx}/libGLU-static.a"; then
OPENGL_STATIC_LIBS="$OPENGL_LIBPATH -lGLU-static -lGL-static $X_ALL_LIBS"
else
OPENGL_STATIC_LIBS=$OPENGL_LIBS
fi
: ${OSMESA_PATH=$OPENGL_PATH}
if test "$with_mesa" != "no"; then
if test "${with_mesa-yes}" != "yes"; then
OSMESA_PATH=$with_mesa
fi
if test -d "$OSMESA_PATH"; then
OSMESA_INCLUDE=-I$OSMESA_PATH/include
if test "$OSMESA_PATH" != "$OPENGL_PATH"; then
NCBI_RPATHIFY(OSMESA_LDFLAGS, $OSMESA_PATH/lib${bit64_sfx})
fi
fi
LDFLAGS="$orig_LDFLAGS $OSMESA_LDFLAGS $OPENGL_LIBPATH"
AC_CHECK_LIB(OSMesa, OSMesaCreateContext,
[NCBI_PACKAGE(MESA);
OSMESA_LIBS="$OSMESA_LDFLAGS $OPENGL_LIBPATH -lOSMesa -lGLU -lGL $X_ALL_LIBS"
AC_DEFINE(HAVE_LIBOSMESA, 1, [Define to 1 if you have libOSMesa.])],
[OSMESA_LIBS=],
$OPENGL_LIBS)
fi
if test -z "$OSMESA_LIBS"; then
NCBI_MISSING_PACKAGE(mesa)
elif test -f "$OSMESA_PATH/lib${bit64_sfx}/libOSMesa-static.a"; then
OSMESA_STATIC_LIBS="$OSMESA_LDFLAGS $OPENGL_LIBPATH -lOSMesa-static -lGLU-static -lGL-static $X_ALL_LIBS"
else
OSMESA_STATIC_LIBS=$OSMESA_LIBS
fi
: ${GLUT_PATH=$NCBI/glut}
if test "$with_glut" != "no"; then
if test "${with_glut-yes}" != "yes"; then
GLUT_PATH=$with_glut
fi
if test -d "GLUT_PATH"; then
GLUT_INCLUDE=-I$GLUT_PATH/include
NCBI_RPATHIFY(GLUT_LDFLAGS, $GLUT_PATH/lib${bit64_sfx})
fi
LDFLAGS="$orig_LDFLAGS $GLUT_LDFLAGS $OPENGL_LIBPATH"
AC_CHECK_LIB(glut, glutInit,
[NCBI_PACKAGE(GLUT);
GLUT_LIBS="$GLUT_LDFLAGS $OPENGL_LIBPATH -lglut -lGLU -lGL $X_ALL_LIBS"
AC_DEFINE(HAVE_LIBGLUT, 1, [Define to 1 if you have libglut.])],
[GLUT_LIBS=],
$OPENGL_LIBS)
if test -z "$GLUT_LIBS"; then
NCBI_MISSING_PACKAGE(glut)
fi
fi
: ${GLEW_PATH=$NCBI/glew}
if test "$with_glew" != "no"; then
if test "${with_glew-yes}" != "yes"; then
GLEW_PATH=$with_glew
fi
if test -d "$GLEW_PATH"; then
if test -d "$GLEW_PATH/$compiler_vpfx$DEBUG_SFX$bit64_sfx"; then
GLEW_PATH=$GLEW_PATH/$compiler_vpfx$DEBUG_SFX$bit64_sfx
elif test -d "$GLEW_PATH/$compiler_pfx$DEBUG_SFX$bit64_sfx"; then
GLEW_PATH=$GLEW_PATH/$compiler_pfx$DEBUG_SFX$bit64_sfx
elif test -d "$GLEW_PATH/$DEBUG_SFX$bit64_sfx"; then
GLEW_PATH=$GLEW_PATH/$DEBUG_SFX$bit64_sfx
fi
NCBI_FIX_DIR(GLEW_PATH)
GLEW_LIBDIR=$GLEW_PATH/lib
if test -n "$bit64_sfx" -a -d $GLEW_LIBDIR$bit64_sfx; then
if test -d $GLEW_LIBDIR; then
for x in $GLEW_LIBDIR/libGLEW*; do
if cmp -s "$x" "$GLEW_LIBDIR$bit64_sfx/`basename \"$x\"`"; then
:
else
GLEW_LIBDIR=$GLEW_LIBDIR$bit64_sfx
break
fi
done
else
GLEW_LIBDIR=$GLEW_LIBDIR$bit64_sfx
fi
fi
glew_config="eval PKG_CONFIG_PATH=\"$GLEW_LIBDIR/pkgconfig\" pkg-config"
else
glew_config=pkg-config
fi
if pkg-config --version >/dev/null 2>&1; then
if $glew_config glewmx --exists >/dev/null 2>&1 \
&& test -n "`$glew_config glewmx --libs 2>/dev/null`"; then
glew_config="$glew_config glewmx"
elif $glew_config glew --exists >/dev/null 2>&1 \
&& test -n "`$glew_config glew --libs 2>/dev/null`"; then
glew_config="$glew_config glew"
else
glew_config=
fi
if test -n "$glew_config"; then
GLEW_INCLUDE=`$glew_config --cflags | sed 's:/GL *$::'`
GLEW_LDFLAGS=`$glew_config --libs-only-L`
glew_libname=`$glew_config --libs-only-l | sed -e 's/-l//'`
fi
fi
if test -z "$glew_libname" -a -d "$GLEW_PATH"; then
GLEW_INCLUDE=-I$GLEW_PATH/include
GLEW_LDFLAGS=-L$GLEW_LIBDIR
fi
LDFLAGS="$orig_LDFLAGS $GLEW_LDFLAGS"
LIBS="$OPENGL_LIBS $DL_LIBS $orig_LIBS"
NCBI_CHECK_LIBS(GLEW, [$glew_libname GLEWmx GLEW], glewGetExtension)
if test "$ac_cv_search_glewGetExtension" = no; then
GLEW_INCLUDE=
GLEW_LIBS=
NCBI_MISSING_PACKAGE(glew)
NCBI_MISSING_PACKAGE(glew-mx)
else
NCBI_RPATHIFY_OUTPUT_COND(tmp_LIBS, [echo $GLEW_LDFLAGS $GLEW_LIBS])
GLEW_LIBS=$tmp_LIBS
NCBI_PACKAGE(GLEW)
CPPFLAGS="$orig_CPPFLAGS $GLEW_INCLUDE $OPENGL_INCLUDE"
LIBS="$GLEW_LIBS $OPENGL_LIBS $DL_LIBS $orig_LIBS"
AC_CACHE_CHECK([for GLEW multi-context (MX) support (recommended)],
ncbi_cv_lib_glew_mx,
[AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#define GLEW_MX 1
#include <GL/glew.h>]],
[[glewContextInit(NULL);]])],
[ncbi_cv_lib_glew_mx=yes], [ncbi_cv_lib_glew_mx=no])])
if test $ncbi_cv_lib_glew_mx = yes; then
GLEW_INCLUDE="$GLEW_INCLUDE -DGLEW_MX"
else
NCBI_MISSING_PACKAGE(glew-mx)
fi
: ${GLEW_STATIC_LIBS=$GLEW_LIBDIR/libGLEW-static.a}
test -f "$GLEW_STATIC_LIBS" || GLEW_STATIC_LIBS=$GLEW_LIBS
fi
fi
fi
LDFLAGS=$orig_LDFLAGS
## FLTK
if test "$with_fltk" != "no"; then
case "$with_fltk" in
yes | "" ) : ${FLTK_PATH=$NCBI/fltk} ;;
* ) FLTK_PATH=$with_fltk ;;
esac
if test -d "$FLTK_PATH/${compiler_vpfx}${DEBUG_SFX}${mt_sfx}${bit64_sfx}/lib" \
-a -z "$FLTK_ARCH_PATH"; then
FLTK_ARCH_PATH="$FLTK_PATH/${compiler_vpfx}${DEBUG_SFX}${mt_sfx}${bit64_sfx}"
elif test -d "$FLTK_PATH/${compiler_pfx}${DEBUG_SFX}${mt_sfx}${bit64_sfx}/lib" \
-a -z "$FLTK_ARCH_PATH"; then
FLTK_ARCH_PATH="$FLTK_PATH/${compiler_pfx}${DEBUG_SFX}${mt_sfx}${bit64_sfx}"
else
FLTK_ARCH_PATH="$FLTK_PATH"
fi
FLTK_BINPATH=${FLTK_BINPATH:="$FLTK_ARCH_PATH/bin"}
FLTK_LIBPATH=${FLTK_LIBPATH:="$FLTK_ARCH_PATH/lib"}
FLTK_INCLUDE=
case "$host_os:$compiler" in
solaris2.10:GCC ) extrased='s/-lpthread//g; ' ;;
* ) extrased= ;;
esac
AC_CACHE_CHECK([for FLTK in $FLTK_ARCH_PATH], ncbi_cv_lib_fltk,
[if test -x "$FLTK_BINPATH/fltk-config" ; then
FLTK_INCLUDE=`$FLTK_BINPATH/fltk-config --cxxflags --use-gl`
NCBI_RPATHIFY_OUTPUT(FLTK_LIBS, $FLTK_BINPATH/fltk-config --ldflags,
$extrased)
CPPFLAGS="$FLTK_INCLUDE $orig_CPPFLAGS"
LIBS="$FLTK_LIBS $orig_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <FL/Fl.H>]],
[[ Fl::run(); ]])],
[ncbi_cv_lib_fltk=yes], [ncbi_cv_lib_fltk=no])
else
ncbi_cv_lib_fltk=no
fi])
if test "$ncbi_cv_lib_fltk" = "no"; then
NCBI_MISSING_PACKAGE(fltk)
fi
fi
if test "$with_fltk" = "no" ; then
FLTK_LIBPATH="No_FLTK"
FLTK_INCLUDE=
FLTK_LIBS=
FLTK_LIBS_GL=
else
NCBI_PACKAGE(FLTK)
FLTK_CONFIG="$FLTK_BINPATH/fltk-config"
# The "yes" may have been cached; get the actual settings again if needed
if test -z "$FLTK_INCLUDE"; then
FLTK_INCLUDE=`$FLTK_CONFIG --cxxflags --use-gl`
NCBI_RPATHIFY_OUTPUT(FLTK_LIBS, $FLTK_BINPATH/fltk-config --ldflags,
$extrased)
fi
NCBI_RPATHIFY_OUTPUT(FLTK_LIBS_GL,
$FLTK_BINPATH/fltk-config --ldflags --use-gl, $extrased)
NCBI_RPATHIFY_OUTPUT(FLTK_LIBS_IMAGES,
$FLTK_BINPATH/fltk-config --ldflags --use-images, $extrased)
NCBI_RPATHIFY_OUTPUT(FLTK_LIBS_ALL,
$FLTK_BINPATH/fltk-config --ldflags --use-gl --use-images, $extrased)
# Also supply static versions for use in CGIs to be deployed to servers
# without access to the shared libraries.
NCBI_RPATHIFY_OUTPUT(FLTK_STATIC_LIBS,
$FLTK_BINPATH/fltk-config --ldstaticflags, $extrased)
NCBI_RPATHIFY_OUTPUT(FLTK_STATIC_LIBS_GL,
$FLTK_BINPATH/fltk-config --ldstaticflags --use-gl, $extrased)
NCBI_RPATHIFY_OUTPUT(FLTK_STATIC_LIBS_IMAGES,
$FLTK_BINPATH/fltk-config --ldstaticflags --use-images, $extrased)
NCBI_RPATHIFY_OUTPUT(FLTK_STATIC_LIBS_ALL,
$FLTK_BINPATH/fltk-config --ldstaticflags --use-gl --use-images,
$extrased)
AC_DEFINE(HAVE_FLTK, 1, [Define to 1 if FLTK is available.])
fi
## wxWidgets
# Insist on single-byte builds by default, per various projects' expectations.
: ${with_wxwidgets_ucs=no}
if test "$with_wxwidgets" != "no" ; then
case "$with_wxwidgets" in
yes | "" ) : ${WXWIDGETS_PATH=$NCBI/wxwidgets} ;;
* ) WXWIDGETS_PATH=$with_wxwidgets ;;
esac
if test -d "$WXWIDGETS_PATH/${compiler_vpfx}${DEBUG_SFX}${mt_sfx}${bit64_sfx}/lib" \
-a -z "$WXWIDGETS_ARCH_PATH"; then
WXWIDGETS_ARCH_PATH="$WXWIDGETS_PATH/${compiler_vpfx}${DEBUG_SFX}${mt_sfx}${bit64_sfx}"
elif test -d "$WXWIDGETS_PATH/${compiler_pfx}${DEBUG_SFX}${mt_sfx}${bit64_sfx}/lib" \
-a -z "$WXWIDGETS_ARCH_PATH"; then
WXWIDGETS_ARCH_PATH="$WXWIDGETS_PATH/${compiler_pfx}${DEBUG_SFX}${mt_sfx}${bit64_sfx}"
else
WXWIDGETS_ARCH_PATH="$WXWIDGETS_PATH"
fi
WXWIDGETS_BINPATH=${WXWIDGETS_BINPATH:="$WXWIDGETS_ARCH_PATH/bin"}
WXWIDGETS_LIBPATH=${WXWIDGETS_LIBPATH:="$WXWIDGETS_ARCH_PATH/lib"}
WXWIDGETS_INCLUDE=
AS_UNSET(wxconf)
AC_PATH_PROG(wxconf, wx-config, [], $WXWIDGETS_BINPATH:$PATH)
if test -x "$wxconf"; then
WXWIDGETS_ARCH_PATH=`$wxconf --exec-prefix`
if test -n "$with_wxwidgets_ucs"; then
wxcfflags=--unicode=$with_wxwidgets_ucs
else
wxcfflags=
fi
for x in `"$wxconf" $wxcfflags --libs --static 2>&AS_MESSAGE_LOG_FD`; do
case "$x" in
-L*)
d=`echo $x | sed -e 's/^-L//'`
pcd=$d/pkgconfig
if test -d "$pcd"; then
PKG_CONFIG_PATH="${PKG_CONFIG_PATH+$PKG_CONFIG_PATH:}$pcd"
fi
;;
esac
done
export PKG_CONFIG_PATH
else
AS_UNSET(wxconf)
fi
if test -x "$wxconf" \
&& "$wxconf" $wxcfflags --list 2>/dev/null \
| grep 'Default config is gtk2' >/dev/null; then
gtkconf="pkg-config gtk+-2.0"
elif test -x "$WXWIDGETS_BINPATH/gtk-config"; then
gtkconf=$WXWIDGETS_BINPATH/gtk-config
elif gtk-config --version >/dev/null 2>&1; then
gtkconf=gtk-config
else
# May work without gtk-config (e.g., on Mac OS X)
gtkconf=:
fi
case "$host_os" in
darwin* )
baseflags=""
basesed='s/-isysroot [[^ ]]*//g; s/-arch [[^ ]]*//g'
if test -n "$SYSROOT"; then
deps=`"$wxconf" $wxcfflags --libs --static 2>/dev/null \
| sed -e 's/.*\.a//'`
libsed="$basesed; s/\$/ $deps/"
else
libsed=$basesed
fi
;;
* )
baseflags=`$gtkconf --cflags 2>/dev/null`
basesed=$no_usr_lib
libsed=$basesed
;;
esac
AC_CACHE_CHECK([for wxWidgets in $WXWIDGETS_ARCH_PATH],
ncbi_cv_lib_wxwidgets,
[if test -x "$wxconf" ; then
WXWIDGETS_INCLUDE="$baseflags `"$wxconf" $wxcfflags --cflags`"
NCBI_RPATHIFY_OUTPUT(WXWIDGETS_LIBS, ["$wxconf" $wxcfflags --libs],
[$libsed; ])
CPPFLAGS="$WXWIDGETS_INCLUDE $orig_CPPFLAGS"
LIBS="$WXWIDGETS_LIBS $orig_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <wx/wx.h>]],
[[ wxExit(); ]])],
[ncbi_cv_lib_wxwidgets=yes], [ncbi_cv_lib_wxwidgets=no])
else
ncbi_cv_lib_wxwidgets=no
fi])
if test "$ncbi_cv_lib_wxwidgets" = "no"; then
NCBI_MISSING_PACKAGE(wxwidgets)
fi
fi
if test "$with_wxwidgets" = "no" ; then
WXWIDGETS_LIBPATH="No_wxWidgets"
WXWIDGETS_INCLUDE=
WXWIDGETS_LIBS=
WXWIDGETS_STATIC_LIBS=
WXWIDGETS_GL_LIBS=
WXWIDGETS_GL_STATIC_LIBS=
WXWIDGETS_POST_LINK=:
else
NCBI_PACKAGE(wxWidgets)
case "`"$wxconf" $wxcfflags --version`" in
2.[[89]].* | 2.[[0-9]][[0-9]]* )
NCBI_PACKAGE(wx2.8)
wxlibs=std,richtext,aui
;;
*)
wxlibs=std
;;
esac
# The "yes" may have been cached; get the actual settings again if needed
if test -z "$WXWIDGETS_INCLUDE"; then
WXWIDGETS_INCLUDE="$baseflags `"$wxconf" $wxcfflags --cflags`"
fi
NCBI_RPATHIFY_OUTPUT(WXWIDGETS_LIBS, [$wxconf $wxcfflags --libs $wxlibs],
[$libsed; ])
WXWIDGETS_STATIC_LIBS=`"$wxconf" $wxcfflags --libs --static $wxlibs \
2>/dev/null | sed -e "$basesed"`
if test -n "$WXWIDGETS_STATIC_LIBS"; then
# Allow direct use of underlying libraries with strict linkers
WXWIDGETS_LIBS="$WXWIDGETS_LIBS `echo $WXWIDGETS_STATIC_LIBS | sed -e 's/.*\.a *//'`"
else
WXWIDGETS_STATIC_LIBS=$WXWIDGETS_LIBS
fi
WXWIDGETS_GL_LIBS=`"$wxconf" $wxcfflags --libs gl | sed -e "$basesed"`
WXWIDGETS_GL_STATIC_LIBS=`"$wxconf" $wxcfflags --libs gl --static \
2>/dev/null | sed -e "$basesed; s|-lGLU* -lGLU*|$OPENGL_STATIC_LIBS|"`
: ${WXWIDGETS_GL_STATIC_LIBS:=$WXWIDGETS_GL_LIBS}
WXWIDGETS_POST_LINK=`"$wxconf" $wxcfflags --rezflags 2>/dev/null`
test -n "$WXWIDGETS_POST_LINK" || WXWIDGETS_POST_LINK=:
AC_DEFINE(HAVE_WXWIDGETS, 1, [Define to 1 if wxWidgets is available.])
fi
## In-house Fast-CGI library
if test "$with_fastcgi" != "no" ; then
case "$with_fastcgi" in
yes | "" ) : ${FASTCGI_PATH:="$NCBI/fcgi-current"} ;;
*/* ) FASTCGI_PATH=$with_fastcgi ;;
* ) FASTCGI_PATH=$NCBI/fcgi-${with_fastcgi} ;;
esac
if test -d "$FASTCGI_PATH"; then
NCBI_FIX_DIR(FASTCGI_PATH)
fi
FASTCGI_INCLUDE="-I$FASTCGI_PATH/include${bit64_sfx}"
if test "$with_debug" = "no" ; then
FASTCGI_LIBDIR="$FASTCGI_PATH/lib${bit64_sfx}"
else
FASTCGI_LIBDIR="$FASTCGI_PATH/altlib${bit64_sfx}"
fi
NCBI_RPATHIFY(FASTCGI_LIBS, $FASTCGI_LIBDIR, [ -lfcgi $NETWORK_LIBS])
FASTCGI_OBJS="fcgibuf"
LIBS="$FASTCGI_LIBS $orig_LIBS"
AC_CACHE_CHECK([for FastCGI libraries in $FASTCGI_PATH], ncbi_cv_lib_fcgi,
[CPPFLAGS="$FASTCGI_INCLUDE $orig_CPPFLAGS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <fcgiapp.h>]],
[[ (void) FCGX_IsCGI(); ]])],
[ncbi_cv_lib_fcgi=yes], [ncbi_cv_lib_fcgi=no])])
if test "$ncbi_cv_lib_fcgi" = "no"; then
NCBI_MISSING_PACKAGE(fastcgi)
fi
AC_CHECK_FUNCS(FCGX_Accept_r)
fi
if test "$with_fastcgi" = "no" ; then
FASTCGI_PATH="No_FastCgi"
FASTCGI_INCLUDE=
FASTCGI_LIBS=
FASTCGI_OBJS=
else
NCBI_PACKAGE(Fast-CGI)
AC_DEFINE(HAVE_LIBFASTCGI, 1,
[Define to 1 if FastCGI libraries are available.])
fi
## NCBI SSS libraries
if test "$with_sybase" = "no" ; then
NCBI_MISSING_PACKAGE(sssdb)
fi
case "$host_os:$compiler:$compiler_version" in
linux*:GCC:*)
: ${with_included_sss=yes}
;;
esac
if test "$with_sss" != "no" ; then
local_sss=${real_srcdir}/src/internal/sss
if test "${with_included_sss-no}" = "yes" \
-a -f "$local_sss/utils/sssdebug.hpp" \
-a -f "${local_sss}srv/cli/sssconnection.cpp"; then
with_included_sss=yes
NCBI_SSS_PATH=$local_sss
NCBI_SSS_INCLUDE="\$(incdir)/sss"
NCBI_SSS_LIBPATH="\$(libdir)"
NCBI_PACKAGE(LocalSSS)
if test -f "$local_sss/../msgmail2/asn/msgmail.asn"; then
NCBI_PACKAGE(LocalMSGMAIL2)
fi
else
with_included_sss=no
fi
NCBI_SSS_PATH=${NCBI_SSS_PATH:="$NCBI/sss/BUILD"}
NCBI_SSS_INCLUDE=${NCBI_SSS_INCLUDE:="$NCBI_SSS_PATH/include"}
if test -z "$NCBI_SSS_LIBPATH" ; then
NCBI_SSS_LIBPATH="${NCBI_SSS_PATH}/lib/${compiler_vpfx}${DEBUG_SFX}${bit64_sfx}"
if test "$with_mt" = "yes" ; then
NCBI_SSS_LIBPATH="${NCBI_SSS_LIBPATH}mt"
fi
fi
AC_MSG_CHECKING([for NCBI SSS directories in $NCBI_SSS_PATH])
if test "$with_included_sss" = "yes"; then
AC_MSG_RESULT([yes]) # duh
elif test ! -d "${NCBI_SSS_LIBPATH}" -o ! -d "${NCBI_SSS_INCLUDE}" ; then
AC_MSG_RESULT([no])
NCBI_MISSING_PACKAGE(sss)
else
AC_MSG_RESULT([yes])
fi
fi
if test "$with_sss" = "no" ; then
NCBI_MISSING_PACKAGE(sssutils)
NCBI_MISSING_PACKAGE(sssdb)
NCBI_SSS_INCLUDE=
NCBI_SSS_LIBPATH=
LIBSSSUTILS=
LIBSSSDB=
else
if test "$with_included_sss" = "yes"; then
NCBI_SSS_LIBPATH= # Not needed
ncbi_cv_lib_sssutils=yes
ncbi_cv_lib_sssdb=yes
sssutils=sssutils
else
NCBI_SSS_LIBPATH="-L${NCBI_SSS_LIBPATH}"
fi
NCBI_SSS_INCLUDE="-I${NCBI_SSS_INCLUDE}"
# SSS UTILS
if test "$with_sssutils" != "no" ; then
LIBSSSUTILS="-lsssutils"
AC_CACHE_CHECK([for the NCBI SSS UTILS library], ncbi_cv_lib_sssutils,
[CPPFLAGS="$NCBI_SSS_INCLUDE $SYBASE_INCLUDE $orig_CPPFLAGS"
LIBS="$NCBI_SSS_LIBPATH $LIBSSSUTILS $SYBASE_LIBS $NETWORK_LIBS $DL_LIBS $orig_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <hashtab.hpp>]],
[[ (new C_HashTab(123))->Clear(); ]])],
[ncbi_cv_lib_sssutils=yes], [ncbi_cv_lib_sssutils=no])])
if test "$ncbi_cv_lib_sssutils" = yes; then
AC_DEFINE(HAVE_LIBSSSUTILS, 1,
[Define to 1 if the NCBI SSS UTILS library is available.])
NCBI_PACKAGE(SSSUTILS)
if test -f "$local_sss/../ncbils2/asn/login.asn"; then
if test "$with_included_sss" = yes || \
grep vformat $NCBI_SSS_INCLUDE/String.hpp >/dev/null 2>&1; then
NCBI_PACKAGE(LocalNCBILS) # temporary compatibility measure
NCBI_PACKAGE(NCBILS2)
fi
fi
else
NCBI_MISSING_PACKAGE(sssutils)
NCBI_MISSING_PACKAGE(sss)
LIBSSSUTILS=""
fi
fi
# SSS DB
if test "$with_sssdb" != "no" ; then
if test "$with_mt" = "yes" ; then
LIBSSSDB="-lsssdb -lssssys"
else
LIBSSSDB="-lsssdb"
fi
AC_CACHE_CHECK([for the NCBI SSS DB library], ncbi_cv_lib_sssdb,
[CPPFLAGS="$NCBI_SSS_INCLUDE $SYBASE_INCLUDE $orig_CPPFLAGS"
LIBS="$NCBI_SSS_LIBPATH $LIBSSSDB $SYBASE_LIBS $NETWORK_LIBS $DL_LIBS $orig_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <cslink.hpp>]],
[[ (new CSLink)->connect2server("srv", "user", "pwd", "db"); ]])],
[ncbi_cv_lib_sssdb=yes], [ncbi_cv_lib_sssdb=no])])
if test "$ncbi_cv_lib_sssdb" = "yes"; then
AC_DEFINE(HAVE_LIBSSSDB, 1,
[Define to 1 if the NCBI SSS DB library is available.])
NCBI_PACKAGE(SSSDB)
else
NCBI_MISSING_PACKAGE(sssdb)
NCBI_MISSING_PACKAGE(sss)
LIBSSSDB=""
fi
fi
fi
# SP
if test "$with_sp" != "no" ; then
SP_PATH=${SP_PATH:="$NCBI/SP"}
if test -n "$SP_INCLUDE"; then
SP_GENERIC="$SP_INCLUDE/../generic"
else
SP_INCLUDE="$SP_PATH/include"
SP_GENERIC="$SP_PATH/generic"
fi
if test -z "$SP_LIBPATH" ; then
SP_LIBPATH="${SP_PATH}/${compiler_vpfx}${DEBUG_SFX}${mt_sfx}${bit64_sfx}"
fi
AC_MSG_CHECKING([for SP directories in $SP_PATH])
if test ! -d "${SP_LIBPATH}" -o ! -d "${SP_INCLUDE}" ; then
AC_MSG_RESULT([no])
NCBI_MISSING_PACKAGE(sp)
else
AC_MSG_RESULT([yes])
fi
fi
if test "$with_sp" != "no" ; then
if test -d "$SP_GENERIC"; then
SP_INCLUDE="-I${SP_INCLUDE} -I${SP_GENERIC}"
else
SP_INCLUDE="-I${SP_INCLUDE}"
fi
SP_LIBS="-L$SP_LIBPATH -lsp"
AC_CACHE_CHECK([for the SP SGML library], ncbi_cv_lib_sp,
[CPPFLAGS="$SP_INCLUDE $orig_CPPFLAGS"
LIBS="$SP_LIBS $orig_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <SGMLApplication.h>]],
[[ SP_API::SGMLApplication app; ]])],
[ncbi_cv_lib_sp=yes], [ncbi_cv_lib_sp=no])])
if test "$ncbi_cv_lib_sp" = "no"; then
NCBI_MISSING_PACKAGE(sp)
fi
fi
if test "$with_sp" = "no" ; then
SP_INCLUDE=
SP_LIBS=
else
NCBI_PACKAGE(SP)
AC_DEFINE(HAVE_LIBSP, 1, [Define to 1 if the SP SGML library is available.])
fi
## ORBacus CORBA
if test "${with_orbacus:-yes}" = yes; then
if test -d $NCBI/corba/${compiler_vpfx}Release${bit64_sfx}MT; then
: ${ORBACUS_PATH=$NCBI/corba/${compiler_vpfx}Release${bit64_sfx}MT}
else
: ${ORBACUS_PATH=$NCBI/corba/OB-4.0.1}
fi
elif test "$with_orbacus" != no; then
ORBACUS_PATH=$with_orbacus
fi
if test -d "$ORBACUS_PATH"; then
NCBI_FIX_DIR(ORBACUS_PATH)
fi
if test "$with_orbacus" != no; then
fullpath=${ORBACUS_PATH}/${DEBUG_SFX}${mt_sfx}${bit64_sfx}
if test -f ${fullpath}/inc/OB/Config.h ; then
: ${ORBACUS_INCLUDE="-I$ORBACUS_PATH/include -I$fullpath/inc"}
NCBI_RPATHIFY_COND(ORBACUS_LIBPATH, $fullpath/lib)
elif test -f ${ORBACUS_PATH}/include/OB/Config.h ; then
: ${ORBACUS_INCLUDE="-I$ORBACUS_PATH/include"}
NCBI_RPATHIFY_COND(ORBACUS_LIBPATH, $ORBACUS_PATH/lib)
fi
case "$host_os:$with_mt" in
linux*:no) LIBJTC="-lJTC -pthread" ;;
*) LIBJTC="-lJTC" ;;
esac
case "$with_mt:$ORBACUS_LIBPATH" in
yes:* | *:-L*MT/lib* )
LIBOB="-lOB $LIBJTC"
LIBIMR="-lIMR"
;;
* )
LIBOB="-lOB"
LIBIMR=
;;
esac
AC_CACHE_CHECK([for ORBacus in $ORBACUS_PATH], ncbi_cv_lib_orbacus,
[CPPFLAGS="$ORBACUS_INCLUDE $orig_CPPFLAGS"
LIBS="$ORBACUS_LIBPATH $LIBOB $NETWORK_LIBS $DL_LIBS $orig_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <OB/CORBA.h>]],
[[
int c = 0;
char* v[] = { NULL };
CORBA::ORB_var orb = CORBA::ORB_init(c, v);
if (!CORBA::is_nil(orb)) orb->destroy();
]])],
[ncbi_cv_lib_orbacus=yes], [ncbi_cv_lib_orbacus=no])])
if test "$ncbi_cv_lib_orbacus" = "no"; then
NCBI_MISSING_PACKAGE(orbacus)
fi
fi
if test "$with_orbacus" = no; then
ORBACUS_PATH=No_ORBacus
ORBACUS_INCLUDE=
ORBACUS_LIBPATH=
LIBOB=
LIBIMR=
else
NCBI_PACKAGE(ORBacus)
AC_DEFINE(HAVE_ORBACUS, 1,
[Define to 1 if the ORBacus CORBA package is available.])
fi
# Sigh... without this, the linker pulls in the contents of the cache
# and then gripes about missing JTC stuff.
test -d SunWS_cache && rm -r SunWS_cache
## International Components for Unicode (ICU)
if test -z "$ICU_PATH" && icu-config --version >/dev/null 2>&1; then
ICU_PATH=`icu-config --prefix`
fi
if test "$with_icu" != "no" ; then
case "$with_icu" in
yes | "" ) : ${ICU_PATH=$NCBI/icu} ;;
* ) ICU_PATH=$with_icu ;;
esac
if test -d "$ICU_PATH/${compiler_vpfx}${DEBUG_SFX}${bit64_sfx}${mt_sfx}/lib" \
-a -z "$ICU_ARCH_PATH"; then
ICU_ARCH_PATH="$ICU_PATH/${compiler_vpfx}${DEBUG_SFX}${bit64_sfx}${mt_sfx}"
elif test -d "$ICU_PATH/${compiler_pfx}${DEBUG_SFX}${bit64_sfx}${mt_sfx}/lib" \
-a -z "$ICU_ARCH_PATH"; then
ICU_ARCH_PATH="$ICU_PATH/${compiler_pfx}${DEBUG_SFX}${bit64_sfx}${mt_sfx}"
else
ICU_ARCH_PATH="$ICU_PATH"
fi
ICU_BINPATH=${ICU_BINPATH:="$ICU_ARCH_PATH/bin"}
ICU_LIBPATH=${ICU_LIBPATH:="$ICU_ARCH_PATH/lib"}
ICU_INCLUDE=
AC_CACHE_CHECK([for ICU in $ICU_ARCH_PATH], ncbi_cv_lib_icu,
[ICU_CONFIG=`$ICU_BINPATH/icu-config --bindir 2>/dev/null`/icu-config
if test -x "$ICU_CONFIG" ; then
ICU_INCLUDE=`$ICU_CONFIG --cppflags-searchpath`
NCBI_RPATHIFY_OUTPUT(ICU_LIBS, $ICU_CONFIG --ldflags)
CPPFLAGS="$ICU_INCLUDE $orig_CPPFLAGS"
LIBS="$ICU_LIBS $orig_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <unicode/unistr.h>]],
[[int32_t i = UNICODE_STRING_SIMPLE("foo").indexOf('f');]])],
[ncbi_cv_lib_icu=yes], [ncbi_cv_lib_icu=no])
else
ncbi_cv_lib_icu=no
fi])
if test "$ncbi_cv_lib_icu" = "no"; then
NCBI_MISSING_PACKAGE(icu)
fi
fi
if test "$with_icu" = "no" ; then
ICU_PATH="No_ICU"
ICU_INCLUDE=
ICU_LIBS=
ICU_STATIC_LIBS=
else
NCBI_PACKAGE(ICU)
ICU_CONFIG="`$ICU_BINPATH/icu-config --bindir`/icu-config"
# The "yes" may have been cached; get the actual settings again if needed
if test -z "$ICU_INCLUDE"; then
ICU_INCLUDE=`$ICU_CONFIG --cppflags-searchpath`
NCBI_RPATHIFY_OUTPUT(ICU_LIBS, $ICU_CONFIG --ldflags)
fi
ICU_STATIC_LIBS=`$ICU_CONFIG --ldflags | sed -e 's/-licu/-lsicu/g'`
AC_DEFINE(HAVE_ICU, 1, [Define to 1 if ICU libraries are available.])
fi
### XML/XSL libraries
if test -d "$NCBI/expat/include"; then
: ${EXPAT_PATH=$NCBI/expat}
fi
NCBI_CHECK_THIRD_PARTY_LIB(expat,
AC_LANG_PROGRAM([#include <expat.h>],
[XML_Parser parser = XML_ParserCreate("utf-8");]))
if test -f "${EXPAT_PATH}/lib${bit64_sfx}/libexpat-static.a"; then
EXPAT_STATIC_LIBS="-L${EXPAT_PATH}/lib${bit64_sfx} -lexpat-static"
else
EXPAT_STATIC_LIBS=${EXPAT_LIBS}
fi
: ${SABLOT_PATH=$NCBI/Sablot}
vpath="$SABLOT_PATH/${compiler_vpfx}build"
test -d "$vpath" && SABLOT_PATH=$vpath
if test -d "$SABLOT_PATH"; then
NCBI_FIX_DIR(SABLOT_PATH)
fi
NCBI_CHECK_THIRD_PARTY_LIB(sablot,
AC_LANG_PROGRAM([#include <sablot.h>],
[SDOM_Document* D; int x = SablotParse(NULL, "file:/dev/null", D);]),
$EXPAT_LIBS)
test -d SunWS_cache && rm -r SunWS_cache
if test -f "${SABLOT_PATH}/lib${bit64_sfx}/libsablot-static.a"; then
SABLOT_STATIC_LIBS="-L${SABLOT_PATH}/lib${bit64_sfx} -lsablot-static $EXPAT_STATIC_LIBS"
else
SABLOT_STATIC_LIBS=${SABLOT_LIBS}
fi
: ${LIBXML_PATH=$NCBI/libxml}
# test -d "$LIBXML_PATH" || LIBXML_PATH=`xml2-config --prefix 2>/dev/null`
if test "$with_libxml" != "no"; then
case "$with_libxml" in
yes | "" ) ;;
* ) LIBXML_PATH=$with_libxml ;;
esac
for pfx in "$compiler_vpfx" "$compiler_pfx" "" ; do
vpath=$LIBXML_PATH/$pfx${DEBUG_SFX}${mt_sfx}${bit64_sfx}
if test -d "$vpath" ; then
LIBXML_PATH=$vpath
break
fi
done
if test -d "$LIBXML_PATH"; then
NCBI_FIX_DIR(LIBXML_PATH)
in_path=" in $LIBXML_PATH"
if test -n "$LIBXML_INCLUDE"; then
:
elif test -d "$LIBXML_PATH/include/libxml2/libxml"; then
LIBXML_INCLUDE="-I$LIBXML_PATH/include/libxml2 -I$LIBXML_PATH/include"
elif test -d "$LIBXML_PATH/include/libxml"; then
LIBXML_INCLUDE="-I$LIBXML_PATH/include";
fi
if test -d "$LIBXML_PATH/lib${bit64_sfx}"; then
LIBXML_LIBPATH_="$LIBXML_PATH/lib${bit64_sfx}"
elif test -d "$LIBXML_PATH/lib"; then
LIBXML_LIBPATH_="$LIBXML_PATH/lib"
fi
NCBI_RPATHIFY_COND(LIBXML_LIBPATH, $LIBXML_LIBPATH_)
LIBXML_LIBS="$LIBXML_LIBPATH -lxml2"
else
LIBXML_INCLUDE="-I/usr/include/libxml2"
LIBXML_LIBS="-lxml2"
in_path=
fi
LIBXML_LIBS="$LIBXML_LIBS $ICONV_LIBS"
AC_CACHE_CHECK([for libxml2$in_path], ncbi_cv_lib_libxml,
CPPFLAGS="$LIBXML_INCLUDE $orig_CPPFLAGS"
LIBS="$LIBXML_LIBS $orig_LIBS"
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[#include <libxml/parser.h>],
[xmlDocPtr doc = xmlParseFile("foo.xml");])],
[ncbi_cv_lib_libxml=yes], [ncbi_cv_lib_libxml=no])])
if test "$ncbi_cv_lib_libxml" = "no"; then
NCBI_MISSING_PACKAGE(libxml)
fi
fi
if test "$with_libxml" = "no"; then
LIBXML_PATH="No_LIBXML"
LIBXML_INCLUDE=
LIBXML_LIBPATH_=
LIBXML_LIBS=
else
NCBI_PACKAGE(LIBXML)
LIBXML_INCLUDE="$LIBXML_INCLUDE"
AC_DEFINE(HAVE_LIBXML, 1, [Define to 1 if libxml2 is available.])
fi
AC_SUBST(LIBXML_INCLUDE)
AC_SUBST(LIBXML_LIBS)
if test -f "${LIBXML_LIBPATH_}/libxml2-static.a"; then
LIBXML_STATIC_LIBS="-L${LIBXML_LIBPATH_} -lxml2-static"
else
LIBXML_STATIC_LIBS=${LIBXML_LIBS}
fi
: ${LIBXSLT_PATH=$LIBXML_PATH}
NCBI_CHECK_THIRD_PARTY_LIB_EX(libxslt, LIBXSLT, xslt,
[AC_LANG_PROGRAM([#include <libxslt/xslt.h>], [xsltInit()])],
[], [$LIBXML_LIBS $Z_LIBS], [$LIBXML_INCLUDE])
# XXX - they might be in different directories in some setups
if test -f "${LIBXML_LIBPATH_}/libxslt-static.a"; then
LIBXSLT_STATIC_LIBS="-L${LIBXML_LIBPATH_} -lxslt-static"
else
LIBXSLT_STATIC_LIBS=${LIBXSLT_LIBS}
fi
AC_PATH_PROG(XSLTPROC, xsltproc, :,
[$LIBXSLT_PATH/bin:`dirname $LIBXML_LIBPATH_ 2>/dev/null`/bin:$PATH])
: ${XERCES_PATH=$NCBI/xerces}
if test "$with_xerces" != no; then
if test "${with_xerces-yes}" != yes; then
XERCES_PATH=$with_xerces
fi
if test -d "$XERCES_PATH"; then
NCBI_FIX_DIR(XERCES_PATH)
fi
vpath="$XERCES_PATH/${compiler_vpfx}${DEBUG_SFX}${bit64_sfx}${mt_sfx}"
if test -d "$vpath/lib"; then
XERCES_PATH=$vpath
NCBI_FIX_DIR(XERCES_PATH)
elif test -d "$vpath"; then
: ${XERCES_LIBPATH=$vpath}
NCBI_FIX_DIR(XERCES_LIBPATH)
else
vpath="$XERCES_PATH/${compiler_pfx}${DEBUG_SFX}${bit64_sfx}${mt_sfx}"
if test -d "$vpath/lib"; then
XERCES_PATH=$vpath
NCBI_FIX_DIR(XERCES_PATH)
elif test -d "$vpath"; then
XERCES_LIBPATH=$vpath
NCBI_FIX_DIR(XERCES_LIBPATH)
fi
fi
if test -d $XERCES_PATH; then
in_path=" in $XERCES_PATH"
: ${XERCES_INCLUDE=-I$XERCES_PATH/include}
: ${XERCES_LIBPATH=$XERCES_PATH/lib}
else
in_path=''
fi
NCBI_RPATHIFY(XERCES_LIBPATH_, $XERCES_LIBPATH)
XERCES_LIBS="$XERCES_LIBPATH_ -lxerces-c"
AC_CACHE_CHECK([for Xerces-C++$in_path], ncbi_cv_lib_xerces_c,
[CPPFLAGS="$XERCES_INCLUDE $orig_CPPFLAGS"
LIBS="$XERCES_LIBS $ICU_LIBS $orig_LIBS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <xercesc/dom/DOM.hpp>]],
[[xercesc::DOMImplementation* impl
= xercesc::DOMImplementationRegistry::getDOMImplementation
(xercesc::XMLString::transcode("XML 1.0"));]])],
ncbi_cv_lib_xerces_c=yes, ncbi_cv_lib_xerces_c=no)])
if test $ncbi_cv_lib_xerces_c = yes; then
if test -f "$XERCES_LIBPATH/libxerces-c-static.a"; then
XERCES_STATIC_LIBS="-L$XERCES_LIBPATH -lxerces-c-static"
else
XERCES_STATIC_LIBS=$XERCES_LIBS
fi
else
NCBI_MISSING_PACKAGE(xerces)
fi
fi
if test "$with_xerces" != no; then
NCBI_PACKAGE(Xerces)
AC_DEFINE(HAVE_XERCES, 1, [Define to 1 if Xerces-C++ is available.])
else
XERCES_INCLUDE=
XERCES_LIBS=
XERCES_STATIC_LIBS=
fi
: ${XALAN_PATH=$NCBI/xalan}
if test "$with_xalan" != no; then
if test "${with_xalan-yes}" != yes; then
XALAN_PATH=$with_xalan
fi
if test -d "$XALAN_PATH"; then
NCBI_FIX_DIR(XALAN_PATH)
fi
vpath="$XALAN_PATH/${compiler_vpfx}${DEBUG_SFX}${bit64_sfx}${mt_sfx}"
if test -d "$vpath/lib"; then
XALAN_PATH=$vpath
NCBI_FIX_DIR(XALAN_PATH)
elif test -d "$vpath"; then
: ${XALAN_LIBPATH=$vpath}
NCBI_FIX_DIR(XALAN_LIBPATH)
else
vpath="$XALAN_PATH/${compiler_pfx}${DEBUG_SFX}${bit64_sfx}${mt_sfx}"
if test -d "$vpath/lib"; then
XALAN_PATH=$vpath
NCBI_FIX_DIR(XALAN_PATH)
elif test -d "$vpath"; then
XALAN_LIBPATH=$vpath
NCBI_FIX_DIR(XALAN_LIBPATH)
fi
fi
if test -d $XALAN_PATH; then
in_path=" in $XALAN_PATH"
: ${XALAN_INCLUDE=-I$XALAN_PATH/include}
: ${XALAN_LIBPATH=$XALAN_PATH/lib}
else
in_path=''
fi
NCBI_RPATHIFY(XALAN_LIBPATH_, $XALAN_LIBPATH)
XALAN_LIBS="$XALAN_LIBPATH_ -lxalan-c -lxalanMsg"
AC_CACHE_CHECK([for Xalan-C++$in_path], ncbi_cv_lib_xalan_c,
[CPPFLAGS="$XALAN_INCLUDE $XERCES_INCLUDE $orig_CPPFLAGS"
LIBS="$XALAN_LIBS $XERCES_LIBS $ICU_LIBS $orig_LIBS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <xalanc/XalanEXSLT/XalanEXSLTMath.hpp>]],
[[xalanc::XalanEXSLTMathFunctionsInstaller::installGlobal();]])],
ncbi_cv_lib_xalan_c=yes, ncbi_cv_lib_xalan_c=no)])
if test $ncbi_cv_lib_xalan_c = yes; then
if test -f "$XALAN_LIBPATH/libxalan-c-static.a"; then
XALAN_STATIC_LIBS="-L$XALAN_LIBPATH -lxalan-c-static -lxalanMsg-static"
else
XALAN_STATIC_LIBS=$XALAN_LIBS
fi
else
NCBI_MISSING_PACKAGE(xalan)
fi
fi
if test "$with_xalan" != no; then
NCBI_PACKAGE(Xalan)
AC_DEFINE(HAVE_XALAN, 1, [Define to 1 if Xalan-C++ is available.])
else
XALAN_INCLUDE=
XALAN_LIBS=
XALAN_STATIC_LIBS=
fi
test -d SunWS_cache && rm -r SunWS_cache
### SQLite
case "$with_sqlite3" in
yes | '' ) : ${SQLITE3_PATH=$NCBI/sqlite3} ;;
* ) SQLITE3_PATH=$with_sqlite3 ;;
esac
if test -d "$SQLITE3_PATH"; then
NCBI_FIX_DIR(SQLITE3_PATH)
fi
if test -d "$SQLITE3_PATH/${compiler_pfx}${DEBUG_SFX}${MT_SFX}${bit64_sfx}/lib"; then
SQLITE3_LIBDIR=$SQLITE3_PATH/${compiler_pfx}${DEBUG_SFX}${MT_SFX}${bit64_sfx}/lib
elif test -d $SQLITE3_PATH/lib${bit64_sfx}; then
SQLITE3_LIBDIR=$SQLITE3_PATH/lib${bit64_sfx}
else
SQLITE3_LIBDIR=$SQLITE3_PATH/lib
fi
NCBI_RPATHIFY(SQLITE3_LIBPATH, $SQLITE3_LIBDIR)
NCBI_CHECK_THIRD_PARTY_LIB(sqlite3,
AC_LANG_PROGRAM([#include <sqlite3.h>],
[sqlite3_pcache_methods m;
int status = sqlite3_config(SQLITE_CONFIG_GETPCACHE, &m);]))
if test -n "$SQLITE3_LIBS"; then
CPPFLAGS="$SQLITE3_INCLUDE $orig_CPPFLAGS"
AC_CHECK_HEADER(sqlite3async.h,
[AC_DEFINE(HAVE_SQLITE3ASYNC_H, 1,
[Define to 1 if you have the <sqlite3async.h> header file.])
NCBI_PACKAGE(SQLITE3ASYNC)])
LIBS="$SQLITE3_LIBS $orig_LIBS"
AC_CHECK_FUNCS(sqlite3_unlock_notify)
fi
if test -n "$SQLITE3_LIBS" -a -f "$SQLITE3_LIBDIR/libsqlite3-static.a"; then
SQLITE3_STATIC_LIBS="-L$SQLITE3_LIBDIR -lsqlite3-static"
else
SQLITE3_STATIC_LIBS=$SQLITE3_LIBS
fi
### OEChem
# somewhat kludgish, as we now wanto to add in oeiupac and oedepict,
# which depend on oechem....
: ${OECHEM_PATH=$NCBI/oechem}
NCBI_CHECK_THIRD_PARTY_LIB(oechem,
AC_LANG_PROGRAM([#include <oechem.h>],
[OEChem::OEMol mol; OEChem::OEConfBase* c = mol.GetActive();]),
-loeiupac -loedepict -loechem -loesystem -loeplatform -lz, $NETWORK_LIBS)
if test -n "$OECHEM_LIBS"; then
OECHEM_LIBS=`echo $OECHEM_LIBS | sed -e 's/-loechem \(.*-loechem .*\)/\1/'`
fi
test -d SunWS_cache && rm -r SunWS_cache
### Sun Grid Engine
case "$with_sge" in
yes | "" ) ;;
* ) SGE_PATH=$with_sge ;;
esac
if test -d "$SGE_PATH" -a -z "$SGE_LIBPATH"; then
case "$host:$NCBI_PLATFORM_BITS" in
i?86-*-darwin* ) SGE_LIBPATH=$SGE_PATH/lib/darwin-x86 ;;
i?86-*-linux* ) SGE_LIBPATH=$SGE_PATH/lib/lx24-x86 ;;
i?86-*-solaris*:32 ) SGE_LIBPATH=$SGE_PATH/lib/sol-x86 ;;
i?86-*-solaris*:64 ) SGE_LIBPATH=$SGE_PATH/lib/sol-amd64 ;;
powerpc-*-darwin* ) SGE_LIBPATH=$SGE_PATH/lib/darwin-ppc ;;
sparc-*-solaris*:32 ) SGE_LIBPATH=$SGE_PATH/lib/sol-sparc ;;
sparc-*-solaris*:64 ) SGE_LIBPATH=$SGE_PATH/lib/sol-sparc64 ;;
x86_64-*-linux* ) SGE_LIBPATH=$SGE_PATH/lib/lx24-amd64 ;;
esac
NCBI_RPATHIFY(SGE_LIBPATH, $SGE_LIBPATH)
fi
NCBI_CHECK_THIRD_PARTY_LIB_EX(sge, SGE, drmaa,
[[AC_LANG_PROGRAM([[#include <sys/types.h>
#include <drmaa.h>]],
[[char buf[1024]; drmaa_init("SGE", buf, sizeof(buf));]])]])
### muParser
case "$with_muparser" in
yes | '' ) : ${MUPARSER_PATH=$NCBI/muParser} ;;
* ) MUPARSER_PATH=$with_muparser ;;
esac
if test -d "$MUPARSER_PATH"; then
NCBI_FIX_DIR(MUPARSER_PATH)
fi
if test -d "$MUPARSER_PATH/${compiler_vpfx}${DEBUG_SFX}${bit64_sfx}/lib"; then
MUPARSER_LIBPATH=-L$MUPARSER_PATH/${compiler_vpfx}${DEBUG_SFX}${bit64_sfx}/lib
elif test -d "$MUPARSER_PATH/${compiler_pfx}${DEBUG_SFX}${bit64_sfx}/lib"; then
MUPARSER_LIBPATH=-L$MUPARSER_PATH/${compiler_pfx}${DEBUG_SFX}${bit64_sfx}/lib
fi
NCBI_CHECK_THIRD_PARTY_LIB(muparser,
[[AC_LANG_PROGRAM([[#include <muParser.h>]],
[[mu::Parser parser;]])]])
### hdf5
case "$with_hdf5" in
yes | '' ) : ${HDF5_PATH=$NCBI/hdf5} ;;
* ) HDF5_PATH=$with_hdf5 ;;
esac
if test -d "$HDF5_PATH/${compiler_vpfx}${DEBUG_SFX}${bit64_sfx}"; then
HDF5_PATH=$HDF5_PATH/${compiler_vpfx}${DEBUG_SFX}${bit64_sfx}
elif test -d "$HDF5_PATH/${compiler_pfx}${DEBUG_SFX}${bit64_sfx}"; then
HDF5_PATH=$HDF5_PATH/${compiler_pfx}${DEBUG_SFX}${bit64_sfx}
fi
if test -d "$HDF5_PATH"; then
NCBI_FIX_DIR(HDF5_PATH)
fi
NCBI_CHECK_THIRD_PARTY_LIB_EX(hdf5, HDF5, hdf5_cpp,
[[AC_LANG_PROGRAM([[#include <H5Cpp.h>]],
[[H5::H5Library::open();]])]],
[-lhdf5])
### Image libraries
# : ${JPEG_PATH=/usr/sfw}
# Grr... jpeglib.h isn't especially well-behaved.
NCBI_CHECK_THIRD_PARTY_LIB(jpeg,
AC_LANG_PROGRAM([#include <sys/types.h>
#include <stdio.h>
extern "C" {
#include <jpeglib.h>
}],
[struct jpeg_decompress_struct cinfo;
struct jpeg_error_mgr jerr;
cinfo.err = jpeg_std_error(&jerr);
]))
# : ${PNG_PATH=/usr/sfw}
NCBI_CHECK_THIRD_PARTY_LIB(png,
AC_LANG_PROGRAM([#include <png.h>],
[png_structp png_ptr
= png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
]), $Z_LIBS, [], $Z_INCLUDE)
# : ${TIFF_PATH=/usr/sfw}
NCBI_CHECK_THIRD_PARTY_LIB(tiff,
AC_LANG_PROGRAM([#include <tiffio.h>],
[TIFF* tiff = TIFFOpen("foo", "r");]), $Z_LIBS, $JPEG_LIBS)
## etc.
# Paths?
with_ungif=$with_gif
NCBI_CHECK_THIRD_PARTY_LIB(ungif,
AC_LANG_PROGRAM([extern "C" {
#include <gif_lib.h>
}],
[GifFileType* fp = DGifOpenFileName("foo");]), $X_LIBS -lX11)
if test "$with_ungif" = "no"; then
NCBI_CHECK_THIRD_PARTY_LIB(gif,
AC_LANG_PROGRAM([extern "C" {
#include <gif_lib.h>
}],
[GifFileType* fp = DGifOpenFileName("foo");]), $X_LIBS -lX11)
else
AC_DEFINE(HAVE_LIBGIF, 1, [Define to 1 if libgif is available.])
GIF_INCLUDE=$UNGIF_INCLUDE
GIF_LIBS=$UNGIF_LIBS
fi
test -n "$x_libraries" && : ${XPM_PATH=`dirname "$x_libraries"`}
NCBI_CHECK_THIRD_PARTY_LIB(Xpm,
AC_LANG_PROGRAM([#include <X11/xpm.h>],
[XpmImage image; XpmInfo info;
XpmReadFileToXpmImage("foo", &image, &info);]), $X_LIBS -lX11, [],
$X_CFLAGS)
# The use of X_CFLAGS is probably redundant, but shouldn't hurt.
## FreeType
if test "$with_freetype" != "no" ; then
: ${FREETYPE_BINPATH=$FREETYPE_PATH/bin}
AC_PATH_PROG(freetype_config, freetype-config, [],
[$FREETYPE_BINPATH:$PATH])
if test -n "$freetype_config" ; then
: ${FREETYPE_BINPATH=`dirname $freetype_config`}
: ${FREETYPE_INCLUDE=`$freetype_config --cflags`}
NCBI_RPATHIFY_OUTPUT_COND(FREETYPE_LIBS, $freetype_config --libs,
[$no_usr_lib])
AC_CACHE_CHECK([whether FREETYPE_INCLUDE needs doctoring],
ncbi_cv_lib_freetype_fix_include,
[CPPFLAGS="$FREETYPE_INCLUDE $orig_CPPFLAGS"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <ft2build.h>]], [])],
[ncbi_cv_lib_freetype_fix_include=no],
[ncbi_cv_lib_freetype_fix_include=yes])])
if test "$ncbi_cv_lib_freetype_fix_include" = yes; then
FREETYPE_INCLUDE=`echo "$FREETYPE_INCLUDE" |\
sed -e 's:\(-I[[^ ]]*\)\(/freetype2\):\1 \1\2:g'`
fi
AC_CACHE_CHECK([whether FreeType works], ncbi_cv_lib_freetype,
[CPPFLAGS="$FREETYPE_INCLUDE $orig_CPPFLAGS"
LIBS="$FREETYPE_LIBS $orig_LIBS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <ft2build.h>
#include FT_FREETYPE_H]],
[[FT_Select_Charmap(NULL, ft_encoding_unicode);]])],
[ncbi_cv_lib_freetype=yes], [ncbi_cv_lib_freetype=no])])
if test "$ncbi_cv_lib_freetype" = no; then
NCBI_MISSING_PACKAGE(freetype)
fi
else
NCBI_MISSING_PACKAGE(freetype)
fi
fi
if test "$with_freetype" = "no" ; then
FREETYPE_PATH="No_FREETYPE"
FREETYPE_INCLUDE=
FREETYPE_LIBS=
else
NCBI_PACKAGE(FreeType)
AC_DEFINE(HAVE_FREETYPE, 1, [Define to 1 if FreeType is available.])
fi
NCBI_CHECK_THIRD_PARTY_LIB(magic,
[AC_LANG_PROGRAM([#include <magic.h>],
[magic_t m = magic_open(17);])])
NCBI_CHECK_THIRD_PARTY_LIB(curl,
[AC_LANG_PROGRAM([#include <curl/curl.h>],
[char* v = curl_version();])])
### Restore original compiler/linker flags
LIBS="$orig_LIBS"
CPPFLAGS="$orig_CPPFLAGS"
### Optional projects
### --------------------------------------------
## `local_lbsm' support
local_lbsm="ncbi_lbsm ncbi_lbsm_ipc ncbi_lbsmd"
## requires semaphores (lacking on older versions of Cygwin and Darwin)
if test $ncbi_cv_sys_semaphores = no; then
NCBI_MISSING_PACKAGE(local-lbsm)
fi
## disable by default even on newer Cygwin, as its semaphores don't
## actually work very well
test $OSTYPE = cygwin && : ${with_local_lbsm=no}
for fff in $local_lbsm ; do
if test ! -f ${real_srcdir}/src/connect/${fff}.c ; then
if test "$with_local_lbsm" = "yes" ; then
AC_MSG_ERROR([--with-local-lbsm: src/connect/${fff}.c is missing])
fi
with_local_lbsm="no"
break
fi
done
if test "$with_local_lbsm" = "no" ; then
local_lbsm="ncbi_lbsmd_stub"
else
NCBI_PROJECT(local_lbsm)
AC_DEFINE(HAVE_LOCAL_LBSM, 1,
[Define to 1 if local LBSM support is available.])
fi
## `connext' support
connext="ncbi_dblb ncbi_ifconf ncbi_localnet"
for fff in $connext ; do
if test ! -f ${real_srcdir}/src/connect/ext/${fff}.c ; then
if test "$with_connext" = "yes" ; then
AC_MSG_ERROR([--with-connext: src/connect/ext/${fff}.c is missing])
fi
with_connext="no"
break
fi
done
if test "$with_connext" = "no"; then
if test "$with_ncbi_crypt" = "yes" ; then
AC_MSG_ERROR([--with-ncbi-crypt specified, but CONNECT extensions are unavailable])
fi
with_ncbi_crypt=no
fi
if test "$with_connext" = "no" ; then
CONNEXT=
XCONNEXT=
else
NCBI_PROJECT(connext)
CONNEXT=connext
XCONNEXT=xconnext
AC_DEFINE(HAVE_LIBCONNEXT, 1,
[Define to 1 if non-public CONNECT extensions are available.])
fi
## `ncbi_crypt' support
ncbi_crypt="ncbi_crypt"
for fff in $ncbi_crypt ; do
if test ! -f ${real_srcdir}/src/connect/ext/${fff}.c ; then
if test "$with_ncbi_crypt" = "yes" ; then
AC_MSG_ERROR([--with-ncbi-crypt: src/connect/ext/${fff}.c is missing])
fi
with_ncbi_crypt="no"
break
fi
done
if test "$with_ncbi_crypt" = "no" ; then
ncbi_crypt="ncbi_crypt_stub"
else
NCBI_PROJECT(ncbi_crypt)
AC_DEFINE(HAVE_NCBI_CRYPT, 1,
[Define to 1 if the real version of ncbi_crypt support is available.])
fi
## `serial' projects
if test "$with_serial" = "no" ; then
serial=
else
NCBI_PROJECT(serial)
serial="serial"
fi
## `objects' projects
if test "$with_objects" = "no" -o -z "$serial" ; then
objects=
else
NCBI_PROJECT(objects)
objects="objects"
fi
## `bdb' projects
dnl NCBI_CHECK_SUBTREE(bdb)
if test "$with_bdb" = "no" ; then
NoConfProjects="$NoConfProjects bdb"
fi
if test ! -f ${real_srcdir}/src/db/bdb/Makefile.in -o \
! -d ${real_srcdir}/include/db/bdb ; then
if test "${with_bdb-no}" != "no" ; then
AC_MSG_ERROR([--with-]bdb[: ]BDB[ sources are missing])
fi
with_bdb="no"
fi
if test "$with_bdb" = "no" ; then
bdb=
BDB_LIB=
BDB_CACHE_LIB=
else
NCBI_PROJECT(bdb)
bdb="bdb"
BDB_LIB="bdb"
AC_DEFINE(HAVE_BDB, 1,
[Define to 1 if NCBI C++ API for BerkeleyDB is available.])
bdb_cache="ncbi_xcache_bdb"
BDB_CACHE_LIB="ncbi_xcache_bdb"
AC_DEFINE(HAVE_BDB_CACHE, 1,
[Define to 1 if NCBI C++ API for BerkeleyDB based data cache is available.])
fi
## `dbapi' projects
DBAPI_DRIVER=
DBAPI_CTLIB=
DBAPI_DBLIB=
DBAPI_MYSQL=
DBAPI_ODBC=
if test "$with_dbapi" = "no" ; then
dbapi=
else
NCBI_PROJECT(dbapi)
dbapi="dbapi"
DBAPI_DRIVER=dbapi_driver
test -n "$SYBASE_LIBS" && DBAPI_CTLIB=ncbi_xdbapi_ctlib
test -n "$SYBASE_DBLIBS" && DBAPI_DBLIB=ncbi_xdbapi_dblib
test -n "$MYSQL_LIBS" && DBAPI_MYSQL=ncbi_xdbapi_mysql
test -n "$ODBC_LIBS" && DBAPI_ODBC=ncbi_xdbapi_odbc
fi
## `app' projects
if test "$with_app" = "no" ; then
app=
else
NCBI_PROJECT(app)
app="app"
fi
## `ctools' project cluster
if test "$with_ctools" != "no" ; then
NCBI_PROJECT(ctools)
fi
## `gui' projects
if test "$with_gui" = "no" ; then
gui=
else
NCBI_PROJECT(gui)
gui="gui"
fi
## `algo' projects
if test "$with_algo" = "no" -o -z "$objects" ; then
algo=
else
NCBI_PROJECT(algo)
algo="algo"
fi
## Sequence Read Archive SDK, which may be attached on either the
## public or the internal side
if test -f "${real_srcdir}/src/sra/sdk/Makefile.sra_macros.mk"; then
sra=sra
else
sra=
fi
## `internal' project cluster
if test "$with_internal" = "no" \
-o ! -f "${real_srcdir}/src/internal/Makefile.in"; then
NoConfProjects="$NoConfProjects internal"
internal=
else
reason=""
sep=
if test ! -d "${real_srcdir}/include/internal"; then
reason="$reason${sep}headers"
sep=", "
fi
if test "$with_sybase" = "no"; then
reason="$reason${sep}Sybase"
sep=", "
fi
if test "$with_ncbi_c" = "no"; then
reason="$reason${sep}C-Toolkit"
sep=", "
fi
if test "$with_sss" = "no"; then
reason="$reason${sep}SSS"
sep=", "
fi
if test -n "$reason" -a "$with_internal" = "yes"; then
if test -z "$with_projects" -o "$with_projects" = "no"; then
AC_MSG_ERROR([--with-internal: Cannot build INTERNAL projects: missing $reason])
else
AC_MSG_WARN([--with-internal: Cannot build all INTERNAL projects: missing $reason])
OPT_GROUPS="$OPT_GROUPS internal"
internal="internal"
fi
elif test -n "$reason"; then
NoConfProjects="$NoConfProjects internal"
internal=
else
OPT_GROUPS="$OPT_GROUPS internal"
internal="internal"
fi
fi
## Genome Workbench
if test "$with_gbench" != "no" -a -d "$real_srcdir/src/app/gbench"; then
reason=""
sep=
if test "$with_wxwidgets" = "no"; then
reason="$reason${sep}wxWidgets"
sep=", "
fi
if test ! -d "$real_srcdir/src/gui/packages"; then
reason="$reason${sep}internal packages"
sep=", "
fi
if test "$with_opengl" = "no"; then
reason="$reason${sep}OpenGL"
sep=", "
fi
if test "$with_sqlite3" = "no"; then
reason="$reason${sep}SQLite 3.x"
sep=", "
fi
if test "$with_bdb" = "no"; then
reason="$reason${sep}Berkeley DB"
sep=", "
fi
if test "$with_mt" = "no"; then
reason="$reason${sep}multithreading"
sep=", "
fi
if test "$with_dll" != "yes"; then
reason="$reason${sep}full-DLL setup"
sep=", "
fi
if test "$with_algo" = "no"; then
reason="$reason${sep}other required subtrees"
sep=","
fi
# Anything else?
if test -n "$reason" -a "$with_gbench" = "yes"; then
AC_MSG_ERROR([--with-gbench: Cannot build Genome Workbench: missing $reason])
elif test -z "$reason"; then
NCBI_PROJECT(gbench)
fi
fi
### Miscellanea
### --------------------------------------------
if test "$with_execopy" = "no" ; then
APP_NOCOPY="BINCOPY=@:"
else
APP_NOCOPY=
fi
if test "$with_exe" = "no" ; then
APP_OR_NULL=null
else
APP_OR_NULL=app
fi
IF_REBUILDING_LIBS="#"
IF_REBUILDING_CONDITIONALLY="#"
case "$with_lib_rebuilds" in
yes) IF_REBUILDING_LIBS="" ;;
ask) IF_REBUILDING_CONDITIONALLY="" ;;
esac
case "$with_deactivation" in
no) IF_DEACTIVATING="#" ;;
* ) IF_DEACTIVATING="" ;;
esac
case "$with_makefile_auto_update" in
no) configurables_mfname=configurables.null ;;
* ) configurables_mfname=configurables ;;
esac
# Run the test suite after the build?
if test -n "$with_check" -a "$with_check" != "no" ; then
check="check"
if test "$with_check" != "yes" ; then
CHECK_ARG=`echo "$with_check" | sed 's/%/ /g'`
fi
NCBI_FEATURE(check)
fi
CHECK_TOOLS=$with_check_tools
case "$CHECK_TOOLS" in
[*[Vv][Aa][Ll][Gg][Rr][Ii][Nn][Dd]*] ) NCBI_FEATURE(Valgrind) ;;
esac
CHECK_OS_NAME=
: ${CHECK_TIMEOUT_MULT=1}
case "$host_os" in
linux* )
if test -x /usr/bin/lsb_release; then
CHECK_OS_NAME=`lsb_release -is | tr A-Z a-z`
elif test -r /etc/SuSE-release; then
CHECK_OS_NAME=suse
elif test -r /etc/redhat-release; then
CHECK_OS_NAME=`cut -d' ' -f1 /etc/redhat-release | tr A-Z a-z`
elif test -d /usr/share/doc/ubuntu-keyring; then
CHECK_OS_NAME=ubuntu
fi
;;
esac
FEATURES="$WithFeatures $WithPackages $WithProjects"
### Compute Without{Features,Packages,Projects}. Takes quadratic time,
### but that's life.
m4_foreach(CATEGORY, [Features,Packages,Projects],
[for x in m4_indir([NCBI_ALL_]CATEGORY); do
case " [$With]CATEGORY " in
*" $x "*) ;;
*) [Without]CATEGORY="[$Without]CATEGORY[$Without]CATEGORY[Sep$x]"
[Without]CATEGORY[Sep]=" "
FEATURES="$FEATURES -$x"
;;
esac
done
])
### Cleanup
### ---------------------------------
case "$compiler" in
WorkShop* )
test -d SunWS_cache && rm -r SunWS_cache
;;
MIPSpro73 )
test -d ii_files && rm -r ii_files
;;
KCC )
test -d ti_files && rm -r ti_files
;;
esac
### Get rid of the KCC "anti-license-warning" filter
if test "$KCC" = "yes" -a -n "$kcc_license" ; then
CC="$kcc_CC"
CXXCPP="$kcc_CXX -E"
CXX="$kcc_CXX"
fi
### Get rid of the ICC "anti-license-warning" filter
if test "$ICC" = "yes" -a -n "$icc_license" ; then
CC="$icc_CC"
CXXCPP="$icc_CXX -E"
CXX="$icc_CXX"
fi
### Adjust paths to wrapper.*.sh
case "$CC" in compilers/*) CC="\$(top_srcdir)/$CC" ;; esac
case "$CXX" in compilers/*) CXX="\$(top_srcdir)/$CXX" ;; esac
case "$CXXCPP" in compilers/*) CXXCPP="\$(top_srcdir)/$CXXCPP" ;; esac
case "$AR" in compilers/*) AR="\$(top_srcdir)/$AR" ;; esac
### Get Insure++ to honor the Toolkit's psrc file
case "$CC" in
*/insure*)
CC="$CC -Zop \$(top_srcdir)/compilers/unix/psrc -D__INSURE__"
CXX="$CXX -Zop \$(top_srcdir)/compilers/unix/psrc -D__INSURE__"
CXXCPP="$CXXCPP -Zop \$(top_srcdir)/compilers/unix/psrc -D__INSURE__"
LINK_DLL=`echo "$LINK_DLL" | sed -e 's:insure:& -Zop \$(top_srcdir)/compilers/unix/psrc:'`
;;
esac
#############################################################################
### Compose a list of configurables("*.in" -- makefiles, shell scripts, etc.)
### in subdirs to configure
### Compose their target counterparts
### Configure
AC_MSG_NOTICE([looking for configurables below $real_srcdir...])
tmp_sed="`pwd`/config.tmp.$$"
for x in $NoConfProjects dll; do
echo "/^\\.\\/$x/d"
done > $tmp_sed
cat >>$tmp_sed <<EOF
s%^.\\(/build-system.*/Makefile*\\)\\.in\$%$builddir\\1:./src\\1\\.in%
s%^.\\(/build-system\\)\\(/.*\\)\\.in\$%$builddir\\2:./src\\1\\2\\.in%
s%^.\\(/[[^:]]*\\)\\.in\$%$builddir\\1:./src\\1\\.in%
EOF
cat $tmp_sed >&AS_MESSAGE_LOG_FD
configurables=`cd "${real_srcdir}/src" && find . -name '.svn' -prune -o -name '*.in' -print | sed -f $tmp_sed`
rm $tmp_sed
if test -z "$configurables" ; then
AC_MSG_ERROR([cannot find any configurables below "${real_srcdir}"!])
else
AC_MSG_NOTICE([...done])
fi
ncbi_runpath=`eval echo "$pure_runpath"`
dnl AC_DEFINE_UNQUOTED(NCBI_RUNPATH, "$ncbi_runpath", [NCBI runpath])
c_ncbi_runpath=`echo "$ncbi_runpath" | sed -e 's:\\$\\$:\\$:g'`
### Template substitutions
AC_SUBST(signature)
AC_SUBST(build_root)
AC_SUBST(top_srcdir)
AC_SUBST(srcdir)
#AC_SUBST(real_srcdir)
AC_SUBST(includedir)
AC_SUBST(status_dir)
AC_SUBST(builddir)
AC_SUBST(runpath)
AC_SUBST(ncbi_runpath)
AC_SUBST(c_ncbi_runpath)
AC_SUBST(CC)
AC_SUBST(CPP)
AC_SUBST(CXX)
AC_SUBST(AR)
AC_SUBST(RANLIB)
AC_SUBST(STRIP)
AC_SUBST(LINK)
AC_SUBST(C_LINK)
AC_SUBST(TAIL_N)
AC_SUBST(EGREP_Q)
AC_SUBST(CFLAGS)
AC_SUBST(FAST_CFLAGS)
AC_SUBST(CXXFLAGS)
AC_SUBST(FAST_CXXFLAGS)
AC_SUBST(OBJCXX_CXXFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(DEPFLAGS)
AC_SUBST(DEPFLAGS_POST)
AC_SUBST(LDFLAGS)
AC_SUBST(FAST_LDFLAGS)
AC_SUBST(APP_LDFLAGS)
AC_SUBST(DLL_LDFLAGS)
AC_SUBST(LIBS)
AC_SUBST(C_LIBS)
AC_SUBST(OBJCXX_LIBS)
AC_SUBST(GCCPCH)
AC_SUBST(RUNPATH_ORIGIN)
AC_SUBST(NO_STRICT_ALIASING)
AC_SUBST(D_SFX)
AC_SUBST(DEBUG_SFX)
AC_SUBST(LIB_OR_DLL)
AC_SUBST(FORCE_STATIC_LIB)
AC_SUBST(APP_LIB_SETTING)
AC_SUBST(APP_LIBS_SETTING)
AC_SUBST(LINK_DLL)
AC_SUBST(has_dll_loadable)
AC_SUBST(LINK_LOADABLE)
AC_SUBST(CFLAGS_DLL)
AC_SUBST(CXXFLAGS_DLL)
AC_SUBST(ALLOW_UNDEF)
AC_SUBST(FORBID_UNDEF)
AC_SUBST(OPT_GROUPS)
AC_SUBST(local_lbsm)
AC_SUBST(ncbi_crypt)
AC_SUBST(CONNEXT)
AC_SUBST(XCONNEXT)
AC_SUBST(serial)
AC_SUBST(bdb)
AC_SUBST(dbapi)
AC_SUBST(objects)
AC_SUBST(gui)
AC_SUBST(algo)
AC_SUBST(app)
AC_SUBST(internal)
AC_SUBST(sra)
AC_SUBST(check)
AC_SUBST(CHECK_ARG)
AC_SUBST(CHECK_TOOLS)
AC_SUBST(CHECK_TIMEOUT_MULT)
AC_SUBST(CHECK_OS_NAME)
AC_SUBST(FEATURES)
AC_SUBST(script_shell)
AC_SUBST(make_shell)
AC_SUBST(obj_ext)
AC_SUBST(lib_pre)
AC_SUBST(lib_l_pre)
AC_SUBST(lib_ext)
AC_SUBST(dll_ext)
AC_SUBST(loadable_ext)
AC_SUBST(lib_l_ext)
AC_SUBST(exe_ext)
AC_SUBST(f_compile)
AC_SUBST(f_outobj)
AC_SUBST(f_outlib)
AC_SUBST(f_libpath)
AC_SUBST(f_runpath)
AC_SUBST(f_outexe)
AC_SUBST(BDB_LIB)
AC_SUBST(BDB_CACHE_LIB)
AC_SUBST(DBAPI_DRIVER)
AC_SUBST(DBAPI_CTLIB)
AC_SUBST(DBAPI_DBLIB)
AC_SUBST(DBAPI_MYSQL)
AC_SUBST(DBAPI_ODBC)
AC_SUBST(THREAD_LIBS)
AC_SUBST(NCBIATOMIC_LIB)
AC_SUBST(NETWORK_LIBS)
AC_SUBST(NETWORK_PURE_LIBS)
AC_SUBST(RESOLVER_LIBS)
AC_SUBST(MATH_LIBS)
AC_SUBST(KSTAT_LIBS)
AC_SUBST(RPCSVC_LIBS)
AC_SUBST(CRYPT_LIBS)
AC_SUBST(DL_LIBS)
AC_SUBST(RT_LIBS)
AC_SUBST(UUID_LIBS)
AC_SUBST(DEMANGLE_LIBS)
AC_SUBST(ICONV_LIBS)
AC_SUBST(Z_LIB)
AC_SUBST(BZ2_LIB)
AC_SUBST(PCREPOSIX_LIBS)
AC_SUBST(PCRE_LIB)
AC_SUBST(OPENSSL_STATIC_LIBS)
AC_SUBST(TLS_INCLUDE)
AC_SUBST(TLS_LIBS)
AC_SUBST(SYBASE_PATH)
AC_SUBST(SYBASE_LCL_PATH)
AC_SUBST(SYBASE_INCLUDE)
AC_SUBST(SYBASE_LIBS)
AC_SUBST(SYBASE_DLLS)
AC_SUBST(SYBASE_DBLIBS)
AC_SUBST(MYSQL_INCLUDE)
AC_SUBST(MYSQL_LIBS)
AC_SUBST(BERKELEYDB_INCLUDE)
AC_SUBST(BERKELEYDB_LIBS)
AC_SUBST(BERKELEYDB_STATIC_LIBS)
AC_SUBST(BERKELEYDB_CXX_LIBS)
AC_SUBST(BERKELEYDB_CXX_STATIC_LIBS)
AC_SUBST(ODBC_INCLUDE)
AC_SUBST(ODBC_LIBS)
AC_SUBST(BOOST_INCLUDE)
AC_SUBST(BOOST_LIBPATH)
AC_SUBST(BOOST_TAG)
AC_SUBST(BOOST_REGEX_LIBS)
AC_SUBST(BOOST_REGEX_STATIC_LIBS)
AC_SUBST(BOOST_TEST_PEM_LIBS)
AC_SUBST(BOOST_TEST_PEM_STATIC_LIBS)
AC_SUBST(BOOST_TEST_TEM_LIBS)
AC_SUBST(BOOST_TEST_TEM_STATIC_LIBS)
AC_SUBST(BOOST_TEST_UTF_LIBS)
AC_SUBST(BOOST_TEST_UTF_STATIC_LIBS)
AC_SUBST(BOOST_THREAD_LIBS)
AC_SUBST(BOOST_THREAD_STATIC_LIBS)
AC_SUBST(NCBI_C_INCLUDE)
AC_SUBST(NCBI_C_LIBPATH)
AC_SUBST(OPENGL_INCLUDE)
AC_SUBST(OPENGL_LIBS)
AC_SUBST(OPENGL_STATIC_LIBS)
AC_SUBST(OSMESA_INCLUDE)
AC_SUBST(OSMESA_LIBS)
AC_SUBST(OSMESA_STATIC_LIBS)
AC_SUBST(GLUT_INCLUDE)
AC_SUBST(GLUT_LIBS)
AC_SUBST(GLEW_INCLUDE)
AC_SUBST(GLEW_LIBS)
AC_SUBST(GLEW_STATIC_LIBS)
AC_SUBST(FLTK_INCLUDE)
AC_SUBST(FLTK_LIBS)
AC_SUBST(FLTK_LIBS_GL)
AC_SUBST(FLTK_LIBS_IMAGES)
AC_SUBST(FLTK_LIBS_ALL)
AC_SUBST(FLTK_STATIC_LIBS)
AC_SUBST(FLTK_STATIC_LIBS_GL)
AC_SUBST(FLTK_STATIC_LIBS_IMAGES)
AC_SUBST(FLTK_STATIC_LIBS_ALL)
AC_SUBST(FLTK_CONFIG)
AC_SUBST(WXWIDGETS_INCLUDE)
AC_SUBST(WXWIDGETS_LIBS)
AC_SUBST(WXWIDGETS_STATIC_LIBS)
AC_SUBST(WXWIDGETS_GL_LIBS)
AC_SUBST(WXWIDGETS_GL_STATIC_LIBS)
AC_SUBST(WXWIDGETS_POST_LINK)
AC_SUBST(FASTCGI_INCLUDE)
AC_SUBST(FASTCGI_LIBS)
AC_SUBST(FASTCGI_OBJS)
AC_SUBST(NCBI_SSS_INCLUDE)
AC_SUBST(NCBI_SSS_LIBPATH)
AC_SUBST(LIBSSSUTILS)
AC_SUBST(LIBSSSDB)
AC_SUBST(sssutils)
AC_SUBST(SP_INCLUDE)
AC_SUBST(SP_LIBS)
AC_SUBST(ORBACUS_INCLUDE)
AC_SUBST(ORBACUS_LIBPATH)
AC_SUBST(LIBOB)
AC_SUBST(LIBIMR)
AC_SUBST(ICU_CONFIG)
AC_SUBST(ICU_INCLUDE)
AC_SUBST(ICU_LIBS)
AC_SUBST(ICU_STATIC_LIBS)
AC_SUBST(EXPAT_STATIC_LIBS)
AC_SUBST(SABLOT_STATIC_LIBS)
AC_SUBST(LIBXML_STATIC_LIBS)
AC_SUBST(LIBXSLT_STATIC_LIBS)
AC_SUBST(XERCES_INCLUDE)
AC_SUBST(XERCES_LIBS)
AC_SUBST(XERCES_STATIC_LIBS)
AC_SUBST(XALAN_INCLUDE)
AC_SUBST(XALAN_LIBS)
AC_SUBST(XALAN_STATIC_LIBS)
AC_SUBST(SQLITE3_STATIC_LIBS)
AC_SUBST(FREETYPE_INCLUDE)
AC_SUBST(FREETYPE_LIBS)
AC_SUBST(ncbi_xreader_pubseqos)
AC_SUBST(ncbi_xreader_pubseqos2)
AC_SUBST(UNLESS_PUBSEQOS)
AC_SUBST(JDK_PATH)
AC_SUBST(JDK_INCLUDE)
AC_SUBST(ncbi_java)
AC_SUBST(NCBI_C_ncbi)
AC_SUBST(BINCOPY)
AC_SUBST(APP_NOCOPY)
AC_SUBST(APP_OR_NULL)
AC_SUBST(IF_REBUILDING_LIBS)
AC_SUBST(IF_REBUILDING_CONDITIONALLY)
AC_SUBST(IF_DEACTIVATING)
AC_SUBST(configurables_mfname)
AC_SUBST(CC_FILTER)
AC_SUBST(CXX_FILTER)
AC_SUBST(AR_FILTER)
AC_SUBST(LINK_FILTER)
AC_SUBST(CC_WRAPPER)
AC_SUBST(CXX_WRAPPER)
AC_SUBST(AR_WRAPPER)
AC_SUBST(LINK_WRAPPER)
AC_SUBST(KeepStateTarget)
AC_SUBST(Rules)
AC_SUBST(serial_ws50_rtti_kludge)
AC_SUBST(ncbicntr)
AC_SUBST(UNIX_SRC)
AC_SUBST(UNIX_USR_PROJ)
AC_SUBST(compiler)
AC_SUBST(compiler_root)
AC_SUBST(compiler_version)
AC_SUBST(COMPILER)
AC_SUBST(OSTYPE)
AC_SUBST(NCBI_PLATFORM_BITS)
#############################################################################
### Create output files and do some post-configuration
## Compose a list of target files
changequote(<<, >>)dnl
x_configurables=`echo "$configurables" | sed 's/:[^:][^:]*\.in//g'`
changequote([, ])dnl
## Deploy the target directory tree
echo "$x_configurables" | while read x_file ; do
x_dir=`dirname $x_file`
test -d "$x_dir" || mkdir -p "$x_dir"
done
## Create ncbicfg.c.last if necessary
ncbicfg="$builddir/corelib/ncbicfg.c"
test -f "$ncbicfg" -a ! -f "$ncbicfg.last" && cp -p "$ncbicfg" "$ncbicfg.last"
test -d "$status_dir" || mkdir -p "$status_dir"
CONFIG_STATUS=$status_dir/config.status
## Configure the compiler/flag-dependent header
AC_CONFIG_HEADER(${ncbiconf}:src/build-system/config.h.in)
##
## Configure makefiles, shell scripts, etc.
##
AC_CONFIG_FILES($configurables $srcdir/./Makefile:src/build-system/Makefile.in.top)
AC_CONFIG_COMMANDS([default], [
dnl make all shell scripts *.sh be executable
find "$build_root/." -name '*.sh' -print | while read x_file ; do
chmod a+x "$x_file"
done
dnl save cache and log files to the build tree dir "status/"
dnl (alongside config.status, which is now directly created there to
dnl avoid possible trouble; for that matter, it can be at least as
dnl important to avoid having config.log still open for writing during
dnl the move).
if test -f config.cache -a -f config.log ; then
test -d "$status_dir" || mkdir -p "$status_dir"
exec AS_MESSAGE_LOG_FD>/dev/null
mv config.cache config.log "$status_dir"/
exec AS_MESSAGE_LOG_FD>>"$status_dir/config.log"
fi
dnl Update list of enabled packages
rm -f "$status_dir"/*.enabled
for p in $WithPackages $WithProjects $WithFeatures ; do
touch "$status_dir"/$p.enabled
done
for p in $WithoutPackages $WithoutProjects $WithoutFeatures ; do
touch "$status_dir"/-$p.enabled
done
dnl Create dummy .dep files for system installations of (b)zlib.
dnl This is a stopgap measure, and fails for installations in non-system dirs.
# test -f "$status_dir"/LocalZ.enabled || \
# touch -t 197001010000 $status_dir/.z.dep
# test -f "$status_dir"/LocalBZ2.enabled || \
# touch -t 197001010000 $status_dir/.bz2.dep
dnl Incorporate any Makefile.*.mk and ncbiconf.*.h files found in the tree.
find "$srcdir"/src/* -name .svn -prune -o -name 'Makefile.*.mk' -print \
| while read x; do
echo
echo "### Extra macro definitions from $x"
echo
echo "#line 1 \"$x\""
cat "$x"
done >> "$builddir/Makefile.mk"
$srcdir/scripts/common/impl/report_duplicates.awk \
src="$srcdir/src/build-system/Makefile.mk.in" "$builddir/Makefile.mk"
find "$srcdir"/src/* -name .svn -prune -o -name 'ncbiconf.*.h' -print \
| while read x; do
echo
echo "/*** Extra macro definitions from $x ***/"
echo
echo "#line 1 \"$x\""
cat "$x"
done > "$build_root/inc/ncbiconf_extra.h"
if test -s "$build_root/inc/ncbiconf_extra.h"; then
ncbiconf=$build_root/inc/ncbiconf_unix.h
newconf=$ncbiconf.extra.new
savedconf=$ncbiconf.extra.prev
cat "$ncbiconf" "$build_root/inc/ncbiconf_extra.h" > "$newconf"
$srcdir/scripts/common/impl/report_duplicates.awk \
src="$srcdir/src/build-system/config.h.in" "$newconf"
if test -f "$savedconf" && cmp "$newconf" "$savedconf" >/dev/null; then
echo "$ncbiconf is unchanged"
else
cp -pf "$newconf" "$savedconf"
fi
cp -pf "$savedconf" "$ncbiconf"
else
rm -f "$build_root/inc/ncbiconf_extra.h"
fi
dnl Avoid gratuitous relinking
ncbicfg="$builddir/corelib/ncbicfg.c"
if test -f "$ncbicfg.last" && cmp -s "$ncbicfg.last" "$ncbicfg"; then
echo "$ncbicfg" is unchanged
touch -r "$ncbicfg.last" "$ncbicfg"
elif test -f "$ncbicfg"; then
echo "$ncbicfg" is updated
rm -f "$ncbicfg.last"
cp -p "$ncbicfg" "$ncbicfg.last"
else
echo "$ncbicfg" is not present
fi
dnl Create Makefile.flat if requested
if test "$with_configure_dialog" = yes; then
if test "$with_flat_makefile" = no; then
AC_MSG_ERROR([incompatible options: --without-flat-makefile but --with-configure-dialog.])
fi
with_flat_makefile=yes
elif test "${with_saved_settings:-no}" != no; then
if test "$with_flat_makefile" = no; then
AC_MSG_ERROR([incompatible options: --without-flat-makefile but --with-saved-settings.])
fi
with_flat_makefile=yes
fi
if test "$with_flat_makefile" != "no"; then
if test "$with_flat_makefile" = yes; then
cfm_flags=''
else
cfm_flags='-remoteptb'
fi
case "$with_projects" in
yes ) cfm_flags="$cfm_flags -p projects" ;;
no | '' ) ;;
* ) cfm_flags="$cfm_flags -p $with_projects" ;;
esac
if test "$with_configure_dialog" = yes; then
cfm_flags="$cfm_flags -cfg"
fi
if test "${with_saved_settings-no}" != no; then
cfm_flags="$cfm_flags -saved $with_saved_settings"
fi
if $real_srcdir/scripts/common/impl/create_flat_makefile.sh "$build_root" \
-s "$real_srcdir" $cfm_flags && test -f "$builddir/Makefile.flat"; then
build_flat="Alternatively, cd $builddir && make -f Makefile.flat"
elif test -f "$builddir/Flat.configuration_log"; then
grep 'already defined' "$builddir/Flat.configuration_log"
AC_MSG_ERROR([flat makefile generation failed.])
fi
fi
dnl execute extra-action
if test -n "$with_extra_action" ; then
with_extra_action=`echo "$with_extra_action" | sed "s%{}%$build_root%g"`
echo
echo "executing: $with_extra_action..."
eval $with_extra_action
exit_code="$?"
if test $exit_code -ne 0 ; then
AC_MSG_WARN([non-zero exit code ($exit_code): $with_extra_action])
fi
echo
fi
dnl print out additional configuration options
case "$LIB_OR_DLL" in
both) DLL_USAGE="LIBRARIES: build both static and dynamic by default" ;;
dll) DLL_USAGE="LIBRARIES: build as dynamic by default" ;;
lib)
if test "$with_dll" = "no" ; then
DLL_USAGE="LIBRARIES: build as static only"
else
DLL_USAGE="LIBRARIES: build as static by default"
fi
;;
esac
if test -n "$with_projects"; then
build_proj="To build selected projects: cd $builddir && make all_p"
fi
cat << EOCONF
===============================================================================
NCBI C++ Toolkit documentation: doc/index.html, doc/config.html#ref_Running
For the available configuration flags run: ./configure --help
CFLAGS = $CFLAGS
CXXFLAGS = $CXXFLAGS
CPPFLAGS = $CPPFLAGS
LDFLAGS = $LDFLAGS
$DLL_USAGE
FEATURES: $WithFeatures
PACKAGES:
enabled: $WithPackages
disabled: $WithoutPackages
PROJECTS:
enabled: $WithProjects
disabled: $WithoutProjects
Tools / flags / paths: $builddir/Makefile.mk
Configuration header: $ncbiconf
To build everything: cd $builddir && make all_r
or simply run make in the current directory
$build_proj
$build_flat
******* CONFIGURATION SUCCESSFUL *******
EOCONF
], [
status_dir='$status_dir'
builddir='$builddir'
build_root='$build_root'
x_configurables='$x_configurables'
ncbiconf='$ncbiconf'
CFLAGS='$CFLAGS'
CXXFLAGS='$CXXFLAGS'
CPPFLAGS='$CPPFLAGS'
LDFLAGS='$LDFLAGS'
LIB_OR_DLL='$LIB_OR_DLL'
with_dll='$with_dll'
WithFeatures='$WithFeatures'
WithoutFeatures='$WithoutFeatures'
WithPackages='$WithPackages'
WithoutPackages='$WithoutPackages'
WithProjects='$WithProjects $OPT_GROUPS'
WithoutProjects='$WithoutProjects'
with_extra_action='$with_extra_action'
with_projects='$with_projects'
with_flat_makefile='$with_flat_makefile'
with_configure_dialog='$with_configure_dialog'
with_saved_settings='$with_saved_settings'
smart_pwd='$smart_pwd'
real_srcdir='$real_srcdir'
])
AC_WARNING([*** Please don't forget to update .../src/build-system/NEWS if appropriate! ***])dnl
AC_OUTPUT
|