File size: 126,224 Bytes
910a777 |
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 |
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <[email protected]>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
#***************************************************************************
# File version for 'aclocal' use. Keep it a single number.
# serial 73
dnl CURL_INCLUDES_ARPA_INET
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when arpa/inet.h is to be included.
AC_DEFUN([CURL_INCLUDES_ARPA_INET], [
curl_includes_arpa_inet="\
/* includes start */
#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
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#endif
/* includes end */"
AC_CHECK_HEADERS(
sys/types.h sys/socket.h netinet/in.h arpa/inet.h,
[], [], [$curl_includes_arpa_inet])
])
dnl CURL_INCLUDES_FCNTL
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when fcntl.h is to be included.
AC_DEFUN([CURL_INCLUDES_FCNTL], [
curl_includes_fcntl="\
/* includes start */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif
/* includes end */"
AC_CHECK_HEADERS(
sys/types.h unistd.h fcntl.h,
[], [], [$curl_includes_fcntl])
])
dnl CURL_INCLUDES_IFADDRS
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when ifaddrs.h is to be included.
AC_DEFUN([CURL_INCLUDES_IFADDRS], [
curl_includes_ifaddrs="\
/* includes start */
#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_IFADDRS_H
# include <ifaddrs.h>
#endif
/* includes end */"
AC_CHECK_HEADERS(
sys/types.h sys/socket.h netinet/in.h ifaddrs.h,
[], [], [$curl_includes_ifaddrs])
])
dnl CURL_INCLUDES_LIBGEN
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when libgen.h is to be included.
AC_DEFUN([CURL_INCLUDES_LIBGEN], [
curl_includes_libgen="\
/* includes start */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_LIBGEN_H
# include <libgen.h>
#endif
/* includes end */"
AC_CHECK_HEADERS(
sys/types.h libgen.h,
[], [], [$curl_includes_libgen])
])
dnl CURL_INCLUDES_NETDB
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when netdb.h is to be included.
AC_DEFUN([CURL_INCLUDES_NETDB], [
curl_includes_netdb="\
/* includes start */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_NETDB_H
# include <netdb.h>
#endif
/* includes end */"
AC_CHECK_HEADERS(
sys/types.h netdb.h,
[], [], [$curl_includes_netdb])
])
dnl CURL_INCLUDES_SETJMP
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when setjmp.h is to be included.
AC_DEFUN([CURL_INCLUDES_SETJMP], [
curl_includes_setjmp="\
/* includes start */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#include <setjmp.h>
/* includes end */"
AC_CHECK_HEADERS(
sys/types.h,
[], [], [$curl_includes_setjmp])
])
dnl CURL_INCLUDES_SIGNAL
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when signal.h is to be included.
AC_DEFUN([CURL_INCLUDES_SIGNAL], [
curl_includes_signal="\
/* includes start */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#include <signal.h>
/* includes end */"
AC_CHECK_HEADERS(
sys/types.h,
[], [], [$curl_includes_signal])
])
dnl CURL_INCLUDES_STDLIB
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when stdlib.h is to be included.
AC_DEFUN([CURL_INCLUDES_STDLIB], [
curl_includes_stdlib="\
/* includes start */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#include <stdlib.h>
/* includes end */"
AC_CHECK_HEADERS(
sys/types.h,
[], [], [$curl_includes_stdlib])
])
dnl CURL_INCLUDES_STRING
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when string(s).h is to be included.
AC_DEFUN([CURL_INCLUDES_STRING], [
curl_includes_string="\
/* includes start */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#include <string.h>
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
/* includes end */"
AC_CHECK_HEADERS(
sys/types.h strings.h,
[], [], [$curl_includes_string])
])
dnl CURL_INCLUDES_STROPTS
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when stropts.h is to be included.
AC_DEFUN([CURL_INCLUDES_STROPTS], [
curl_includes_stropts="\
/* includes start */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
#ifdef HAVE_STROPTS_H
# include <stropts.h>
#endif
/* includes end */"
AC_CHECK_HEADERS(
sys/types.h unistd.h sys/socket.h sys/ioctl.h stropts.h,
[], [], [$curl_includes_stropts])
])
dnl CURL_INCLUDES_SYS_SOCKET
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when sys/socket.h is to be included.
AC_DEFUN([CURL_INCLUDES_SYS_SOCKET], [
curl_includes_sys_socket="\
/* includes start */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
/* includes end */"
AC_CHECK_HEADERS(
sys/types.h sys/socket.h,
[], [], [$curl_includes_sys_socket])
])
dnl CURL_INCLUDES_SYS_TYPES
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when sys/types.h is to be included.
AC_DEFUN([CURL_INCLUDES_SYS_TYPES], [
curl_includes_sys_types="\
/* includes start */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
/* includes end */"
AC_CHECK_HEADERS(
sys/types.h,
[], [], [$curl_includes_sys_types])
])
dnl CURL_INCLUDES_SYS_XATTR
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when sys/xattr.h is to be included.
AC_DEFUN([CURL_INCLUDES_SYS_XATTR], [
curl_includes_sys_xattr="\
/* includes start */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_XATTR_H
# include <sys/xattr.h>
#endif
/* includes end */"
AC_CHECK_HEADERS(
sys/types.h sys/xattr.h,
[], [], [$curl_includes_sys_xattr])
])
dnl CURL_INCLUDES_TIME
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when time.h is to be included.
AC_DEFUN([CURL_INCLUDES_TIME], [
curl_includes_time="\
/* includes start */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#include <time.h>
/* includes end */"
AC_CHECK_HEADERS(
sys/types.h sys/time.h,
[], [], [$curl_includes_time])
])
dnl CURL_INCLUDES_UNISTD
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when unistd.h is to be included.
AC_DEFUN([CURL_INCLUDES_UNISTD], [
curl_includes_unistd="\
/* includes start */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
/* includes end */"
AC_CHECK_HEADERS(
sys/types.h unistd.h,
[], [], [$curl_includes_unistd])
])
dnl CURL_INCLUDES_WINSOCK2
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when winsock2.h is to be included.
AC_DEFUN([CURL_INCLUDES_WINSOCK2], [
curl_includes_winsock2="\
/* includes start */
#ifdef _WIN32
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <winsock2.h>
#endif
/* includes end */"
CURL_CHECK_NATIVE_WINDOWS
])
dnl CURL_INCLUDES_WS2TCPIP
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when ws2tcpip.h is to be included.
AC_DEFUN([CURL_INCLUDES_WS2TCPIP], [
curl_includes_ws2tcpip="\
/* includes start */
#ifdef _WIN32
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <winsock2.h>
# include <ws2tcpip.h>
#endif
/* includes end */"
CURL_CHECK_NATIVE_WINDOWS
])
dnl CURL_INCLUDES_BSDSOCKET
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when bsdsocket.h is to be included.
AC_DEFUN([CURL_INCLUDES_BSDSOCKET], [
curl_includes_bsdsocket="\
/* includes start */
#if defined(HAVE_PROTO_BSDSOCKET_H)
# define __NO_NET_API
# define __USE_INLINE__
# include <proto/bsdsocket.h>
# ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
# endif
# ifdef __amigaos4__
struct SocketIFace *ISocket = NULL;
# else
struct Library *SocketBase = NULL;
# endif
# define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
#endif
/* includes end */"
AC_CHECK_HEADERS(
proto/bsdsocket.h,
[], [], [$curl_includes_bsdsocket])
])
dnl CURL_INCLUDES_NETIF
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when net/if.h is to be included.
AC_DEFUN([CURL_INCLUDES_NETIF], [
curl_includes_netif="\
/* includes start */
#ifdef HAVE_NET_IF_H
# include <net/if.h>
#endif
/* includes end */"
AC_CHECK_HEADERS(
net/if.h,
[], [], [$curl_includes_netif])
])
dnl CURL_PREPROCESS_CALLCONV
dnl -------------------------------------------------
dnl Set up variable with a preprocessor block which
dnl defines function calling convention.
AC_DEFUN([CURL_PREPROCESS_CALLCONV], [
curl_preprocess_callconv="\
/* preprocess start */
#ifdef _WIN32
# define FUNCALLCONV __stdcall
#else
# define FUNCALLCONV
#endif
/* preprocess end */"
])
dnl CURL_CHECK_FUNC_ALARM
dnl -------------------------------------------------
dnl Verify if alarm is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_alarm, then
dnl HAVE_ALARM will be defined.
AC_DEFUN([CURL_CHECK_FUNC_ALARM], [
AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
#
tst_links_alarm="unknown"
tst_proto_alarm="unknown"
tst_compi_alarm="unknown"
tst_allow_alarm="unknown"
#
AC_MSG_CHECKING([if alarm can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([alarm])
],[
AC_MSG_RESULT([yes])
tst_links_alarm="yes"
],[
AC_MSG_RESULT([no])
tst_links_alarm="no"
])
#
if test "$tst_links_alarm" = "yes"; then
AC_MSG_CHECKING([if alarm is prototyped])
AC_EGREP_CPP([alarm],[
$curl_includes_unistd
],[
AC_MSG_RESULT([yes])
tst_proto_alarm="yes"
],[
AC_MSG_RESULT([no])
tst_proto_alarm="no"
])
fi
#
if test "$tst_proto_alarm" = "yes"; then
AC_MSG_CHECKING([if alarm is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_unistd
]],[[
if(0 != alarm(0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_alarm="yes"
],[
AC_MSG_RESULT([no])
tst_compi_alarm="no"
])
fi
#
if test "$tst_compi_alarm" = "yes"; then
AC_MSG_CHECKING([if alarm usage allowed])
if test "x$curl_disallow_alarm" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_alarm="yes"
else
AC_MSG_RESULT([no])
tst_allow_alarm="no"
fi
fi
#
AC_MSG_CHECKING([if alarm might be used])
if test "$tst_links_alarm" = "yes" &&
test "$tst_proto_alarm" = "yes" &&
test "$tst_compi_alarm" = "yes" &&
test "$tst_allow_alarm" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_ALARM, 1,
[Define to 1 if you have the alarm function.])
curl_cv_func_alarm="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_alarm="no"
fi
])
dnl CURL_CHECK_FUNC_BASENAME
dnl -------------------------------------------------
dnl Verify if basename is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_basename, then
dnl HAVE_BASENAME will be defined.
AC_DEFUN([CURL_CHECK_FUNC_BASENAME], [
AC_REQUIRE([CURL_INCLUDES_STRING])dnl
AC_REQUIRE([CURL_INCLUDES_LIBGEN])dnl
AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
#
tst_links_basename="unknown"
tst_proto_basename="unknown"
tst_compi_basename="unknown"
tst_allow_basename="unknown"
#
AC_MSG_CHECKING([if basename can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([basename])
],[
AC_MSG_RESULT([yes])
tst_links_basename="yes"
],[
AC_MSG_RESULT([no])
tst_links_basename="no"
])
#
if test "$tst_links_basename" = "yes"; then
AC_MSG_CHECKING([if basename is prototyped])
AC_EGREP_CPP([basename],[
$curl_includes_string
$curl_includes_libgen
$curl_includes_unistd
],[
AC_MSG_RESULT([yes])
tst_proto_basename="yes"
],[
AC_MSG_RESULT([no])
tst_proto_basename="no"
])
fi
#
if test "$tst_proto_basename" = "yes"; then
AC_MSG_CHECKING([if basename is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_string
$curl_includes_libgen
$curl_includes_unistd
]],[[
if(0 != basename(0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_basename="yes"
],[
AC_MSG_RESULT([no])
tst_compi_basename="no"
])
fi
#
if test "$tst_compi_basename" = "yes"; then
AC_MSG_CHECKING([if basename usage allowed])
if test "x$curl_disallow_basename" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_basename="yes"
else
AC_MSG_RESULT([no])
tst_allow_basename="no"
fi
fi
#
AC_MSG_CHECKING([if basename might be used])
if test "$tst_links_basename" = "yes" &&
test "$tst_proto_basename" = "yes" &&
test "$tst_compi_basename" = "yes" &&
test "$tst_allow_basename" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_BASENAME, 1,
[Define to 1 if you have the basename function.])
curl_cv_func_basename="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_basename="no"
fi
])
dnl CURL_CHECK_FUNC_CLOSESOCKET
dnl -------------------------------------------------
dnl Verify if closesocket is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_closesocket, then
dnl HAVE_CLOSESOCKET will be defined.
AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET], [
AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
#
tst_links_closesocket="unknown"
tst_proto_closesocket="unknown"
tst_compi_closesocket="unknown"
tst_allow_closesocket="unknown"
#
AC_MSG_CHECKING([if closesocket can be linked])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_winsock2
]],[[
if(0 != closesocket(0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_links_closesocket="yes"
],[
AC_MSG_RESULT([no])
tst_links_closesocket="no"
])
#
if test "$tst_links_closesocket" = "yes"; then
AC_MSG_CHECKING([if closesocket is prototyped])
AC_EGREP_CPP([closesocket],[
$curl_includes_winsock2
],[
AC_MSG_RESULT([yes])
tst_proto_closesocket="yes"
],[
AC_MSG_RESULT([no])
tst_proto_closesocket="no"
])
fi
#
if test "$tst_proto_closesocket" = "yes"; then
AC_MSG_CHECKING([if closesocket is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_winsock2
]],[[
if(0 != closesocket(0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_closesocket="yes"
],[
AC_MSG_RESULT([no])
tst_compi_closesocket="no"
])
fi
#
if test "$tst_compi_closesocket" = "yes"; then
AC_MSG_CHECKING([if closesocket usage allowed])
if test "x$curl_disallow_closesocket" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_closesocket="yes"
else
AC_MSG_RESULT([no])
tst_allow_closesocket="no"
fi
fi
#
AC_MSG_CHECKING([if closesocket might be used])
if test "$tst_links_closesocket" = "yes" &&
test "$tst_proto_closesocket" = "yes" &&
test "$tst_compi_closesocket" = "yes" &&
test "$tst_allow_closesocket" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_CLOSESOCKET, 1,
[Define to 1 if you have the closesocket function.])
curl_cv_func_closesocket="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_closesocket="no"
fi
])
dnl CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
dnl -------------------------------------------------
dnl Verify if CloseSocket is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_closesocket_camel,
dnl then HAVE_CLOSESOCKET_CAMEL will be defined.
AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET_CAMEL], [
AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
#
tst_links_closesocket_camel="unknown"
tst_proto_closesocket_camel="unknown"
tst_compi_closesocket_camel="unknown"
tst_allow_closesocket_camel="unknown"
#
AC_MSG_CHECKING([if CloseSocket can be linked])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_bsdsocket
$curl_includes_sys_socket
]],[[
if(0 != CloseSocket(0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_links_closesocket_camel="yes"
],[
AC_MSG_RESULT([no])
tst_links_closesocket_camel="no"
])
#
if test "$tst_links_closesocket_camel" = "yes"; then
AC_MSG_CHECKING([if CloseSocket is prototyped])
AC_EGREP_CPP([CloseSocket],[
$curl_includes_bsdsocket
$curl_includes_sys_socket
],[
AC_MSG_RESULT([yes])
tst_proto_closesocket_camel="yes"
],[
AC_MSG_RESULT([no])
tst_proto_closesocket_camel="no"
])
fi
#
if test "$tst_proto_closesocket_camel" = "yes"; then
AC_MSG_CHECKING([if CloseSocket is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_bsdsocket
$curl_includes_sys_socket
]],[[
if(0 != CloseSocket(0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_closesocket_camel="yes"
],[
AC_MSG_RESULT([no])
tst_compi_closesocket_camel="no"
])
fi
#
if test "$tst_compi_closesocket_camel" = "yes"; then
AC_MSG_CHECKING([if CloseSocket usage allowed])
if test "x$curl_disallow_closesocket_camel" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_closesocket_camel="yes"
else
AC_MSG_RESULT([no])
tst_allow_closesocket_camel="no"
fi
fi
#
AC_MSG_CHECKING([if CloseSocket might be used])
if test "$tst_links_closesocket_camel" = "yes" &&
test "$tst_proto_closesocket_camel" = "yes" &&
test "$tst_compi_closesocket_camel" = "yes" &&
test "$tst_allow_closesocket_camel" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_CLOSESOCKET_CAMEL, 1,
[Define to 1 if you have the CloseSocket camel case function.])
curl_cv_func_closesocket_camel="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_closesocket_camel="no"
fi
])
dnl CURL_CHECK_FUNC_FCNTL
dnl -------------------------------------------------
dnl Verify if fcntl is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_fcntl, then
dnl HAVE_FCNTL will be defined.
AC_DEFUN([CURL_CHECK_FUNC_FCNTL], [
AC_REQUIRE([CURL_INCLUDES_FCNTL])dnl
#
tst_links_fcntl="unknown"
tst_proto_fcntl="unknown"
tst_compi_fcntl="unknown"
tst_allow_fcntl="unknown"
#
AC_MSG_CHECKING([if fcntl can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([fcntl])
],[
AC_MSG_RESULT([yes])
tst_links_fcntl="yes"
],[
AC_MSG_RESULT([no])
tst_links_fcntl="no"
])
#
if test "$tst_links_fcntl" = "yes"; then
AC_MSG_CHECKING([if fcntl is prototyped])
AC_EGREP_CPP([fcntl],[
$curl_includes_fcntl
],[
AC_MSG_RESULT([yes])
tst_proto_fcntl="yes"
],[
AC_MSG_RESULT([no])
tst_proto_fcntl="no"
])
fi
#
if test "$tst_proto_fcntl" = "yes"; then
AC_MSG_CHECKING([if fcntl is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_fcntl
]],[[
if(0 != fcntl(0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_fcntl="yes"
],[
AC_MSG_RESULT([no])
tst_compi_fcntl="no"
])
fi
#
if test "$tst_compi_fcntl" = "yes"; then
AC_MSG_CHECKING([if fcntl usage allowed])
if test "x$curl_disallow_fcntl" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_fcntl="yes"
else
AC_MSG_RESULT([no])
tst_allow_fcntl="no"
fi
fi
#
AC_MSG_CHECKING([if fcntl might be used])
if test "$tst_links_fcntl" = "yes" &&
test "$tst_proto_fcntl" = "yes" &&
test "$tst_compi_fcntl" = "yes" &&
test "$tst_allow_fcntl" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_FCNTL, 1,
[Define to 1 if you have the fcntl function.])
curl_cv_func_fcntl="yes"
CURL_CHECK_FUNC_FCNTL_O_NONBLOCK
else
AC_MSG_RESULT([no])
curl_cv_func_fcntl="no"
fi
])
dnl CURL_CHECK_FUNC_FCNTL_O_NONBLOCK
dnl -------------------------------------------------
dnl Verify if fcntl with status flag O_NONBLOCK is
dnl available, can be compiled, and seems to work. If
dnl all of these are true, then HAVE_FCNTL_O_NONBLOCK
dnl will be defined.
AC_DEFUN([CURL_CHECK_FUNC_FCNTL_O_NONBLOCK], [
#
tst_compi_fcntl_o_nonblock="unknown"
tst_allow_fcntl_o_nonblock="unknown"
#
case $host_os in
sunos4* | aix3*)
dnl O_NONBLOCK does not work on these platforms
curl_disallow_fcntl_o_nonblock="yes"
;;
esac
#
if test "$curl_cv_func_fcntl" = "yes"; then
AC_MSG_CHECKING([if fcntl O_NONBLOCK is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_fcntl
]],[[
int flags = 0;
if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_fcntl_o_nonblock="yes"
],[
AC_MSG_RESULT([no])
tst_compi_fcntl_o_nonblock="no"
])
fi
#
if test "$tst_compi_fcntl_o_nonblock" = "yes"; then
AC_MSG_CHECKING([if fcntl O_NONBLOCK usage allowed])
if test "x$curl_disallow_fcntl_o_nonblock" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_fcntl_o_nonblock="yes"
else
AC_MSG_RESULT([no])
tst_allow_fcntl_o_nonblock="no"
fi
fi
#
AC_MSG_CHECKING([if fcntl O_NONBLOCK might be used])
if test "$tst_compi_fcntl_o_nonblock" = "yes" &&
test "$tst_allow_fcntl_o_nonblock" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_FCNTL_O_NONBLOCK, 1,
[Define to 1 if you have a working fcntl O_NONBLOCK function.])
curl_cv_func_fcntl_o_nonblock="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_fcntl_o_nonblock="no"
fi
])
dnl CURL_CHECK_FUNC_FREEADDRINFO
dnl -------------------------------------------------
dnl Verify if freeaddrinfo is available, prototyped,
dnl and can be compiled. If all of these are true,
dnl and usage has not been previously disallowed with
dnl shell variable curl_disallow_freeaddrinfo, then
dnl HAVE_FREEADDRINFO will be defined.
AC_DEFUN([CURL_CHECK_FUNC_FREEADDRINFO], [
AC_REQUIRE([CURL_INCLUDES_WS2TCPIP])dnl
AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
#
tst_links_freeaddrinfo="unknown"
tst_proto_freeaddrinfo="unknown"
tst_compi_freeaddrinfo="unknown"
tst_allow_freeaddrinfo="unknown"
#
AC_MSG_CHECKING([if freeaddrinfo can be linked])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_ws2tcpip
$curl_includes_sys_socket
$curl_includes_netdb
]],[[
freeaddrinfo(0);
]])
],[
AC_MSG_RESULT([yes])
tst_links_freeaddrinfo="yes"
],[
AC_MSG_RESULT([no])
tst_links_freeaddrinfo="no"
])
#
if test "$tst_links_freeaddrinfo" = "yes"; then
AC_MSG_CHECKING([if freeaddrinfo is prototyped])
AC_EGREP_CPP([freeaddrinfo],[
$curl_includes_ws2tcpip
$curl_includes_sys_socket
$curl_includes_netdb
],[
AC_MSG_RESULT([yes])
tst_proto_freeaddrinfo="yes"
],[
AC_MSG_RESULT([no])
tst_proto_freeaddrinfo="no"
])
fi
#
if test "$tst_proto_freeaddrinfo" = "yes"; then
AC_MSG_CHECKING([if freeaddrinfo is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_ws2tcpip
$curl_includes_sys_socket
$curl_includes_netdb
]],[[
freeaddrinfo(0);
]])
],[
AC_MSG_RESULT([yes])
tst_compi_freeaddrinfo="yes"
],[
AC_MSG_RESULT([no])
tst_compi_freeaddrinfo="no"
])
fi
#
if test "$tst_compi_freeaddrinfo" = "yes"; then
AC_MSG_CHECKING([if freeaddrinfo usage allowed])
if test "x$curl_disallow_freeaddrinfo" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_freeaddrinfo="yes"
else
AC_MSG_RESULT([no])
tst_allow_freeaddrinfo="no"
fi
fi
#
AC_MSG_CHECKING([if freeaddrinfo might be used])
if test "$tst_links_freeaddrinfo" = "yes" &&
test "$tst_proto_freeaddrinfo" = "yes" &&
test "$tst_compi_freeaddrinfo" = "yes" &&
test "$tst_allow_freeaddrinfo" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_FREEADDRINFO, 1,
[Define to 1 if you have the freeaddrinfo function.])
curl_cv_func_freeaddrinfo="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_freeaddrinfo="no"
fi
])
dnl CURL_CHECK_FUNC_FSETXATTR
dnl -------------------------------------------------
dnl Verify if fsetxattr is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_fsetxattr, then
dnl HAVE_FSETXATTR will be defined.
AC_DEFUN([CURL_CHECK_FUNC_FSETXATTR], [
AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
#
tst_links_fsetxattr="unknown"
tst_proto_fsetxattr="unknown"
tst_compi_fsetxattr="unknown"
tst_allow_fsetxattr="unknown"
tst_nargs_fsetxattr="unknown"
#
AC_MSG_CHECKING([if fsetxattr can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([fsetxattr])
],[
AC_MSG_RESULT([yes])
tst_links_fsetxattr="yes"
],[
AC_MSG_RESULT([no])
tst_links_fsetxattr="no"
])
#
if test "$tst_links_fsetxattr" = "yes"; then
AC_MSG_CHECKING([if fsetxattr is prototyped])
AC_EGREP_CPP([fsetxattr],[
$curl_includes_sys_xattr
],[
AC_MSG_RESULT([yes])
tst_proto_fsetxattr="yes"
],[
AC_MSG_RESULT([no])
tst_proto_fsetxattr="no"
])
fi
#
if test "$tst_proto_fsetxattr" = "yes"; then
if test "$tst_nargs_fsetxattr" = "unknown"; then
AC_MSG_CHECKING([if fsetxattr takes 5 args.])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_sys_xattr
]],[[
if(0 != fsetxattr(0, 0, 0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_fsetxattr="yes"
tst_nargs_fsetxattr="5"
],[
AC_MSG_RESULT([no])
tst_compi_fsetxattr="no"
])
fi
if test "$tst_nargs_fsetxattr" = "unknown"; then
AC_MSG_CHECKING([if fsetxattr takes 6 args.])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_sys_xattr
]],[[
if(0 != fsetxattr(0, 0, 0, 0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_fsetxattr="yes"
tst_nargs_fsetxattr="6"
],[
AC_MSG_RESULT([no])
tst_compi_fsetxattr="no"
])
fi
AC_MSG_CHECKING([if fsetxattr is compilable])
if test "$tst_compi_fsetxattr" = "yes"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
#
if test "$tst_compi_fsetxattr" = "yes"; then
AC_MSG_CHECKING([if fsetxattr usage allowed])
if test "x$curl_disallow_fsetxattr" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_fsetxattr="yes"
else
AC_MSG_RESULT([no])
tst_allow_fsetxattr="no"
fi
fi
#
AC_MSG_CHECKING([if fsetxattr might be used])
if test "$tst_links_fsetxattr" = "yes" &&
test "$tst_proto_fsetxattr" = "yes" &&
test "$tst_compi_fsetxattr" = "yes" &&
test "$tst_allow_fsetxattr" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_FSETXATTR, 1,
[Define to 1 if you have the fsetxattr function.])
dnl AC_DEFINE_UNQUOTED(FSETXATTR_ARGS, $tst_nargs_fsetxattr,
dnl [Specifies the number of arguments to fsetxattr])
#
if test "$tst_nargs_fsetxattr" -eq "5"; then
AC_DEFINE(HAVE_FSETXATTR_5, 1, [fsetxattr() takes 5 args])
elif test "$tst_nargs_fsetxattr" -eq "6"; then
AC_DEFINE(HAVE_FSETXATTR_6, 1, [fsetxattr() takes 6 args])
fi
#
curl_cv_func_fsetxattr="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_fsetxattr="no"
fi
])
dnl CURL_CHECK_FUNC_FTRUNCATE
dnl -------------------------------------------------
dnl Verify if ftruncate is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_ftruncate, then
dnl HAVE_FTRUNCATE will be defined.
AC_DEFUN([CURL_CHECK_FUNC_FTRUNCATE], [
AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
#
tst_links_ftruncate="unknown"
tst_proto_ftruncate="unknown"
tst_compi_ftruncate="unknown"
tst_allow_ftruncate="unknown"
#
AC_MSG_CHECKING([if ftruncate can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([ftruncate])
],[
AC_MSG_RESULT([yes])
tst_links_ftruncate="yes"
],[
AC_MSG_RESULT([no])
tst_links_ftruncate="no"
])
#
if test "$tst_links_ftruncate" = "yes"; then
AC_MSG_CHECKING([if ftruncate is prototyped])
AC_EGREP_CPP([ftruncate],[
$curl_includes_unistd
],[
AC_MSG_RESULT([yes])
tst_proto_ftruncate="yes"
],[
AC_MSG_RESULT([no])
tst_proto_ftruncate="no"
])
fi
#
if test "$tst_proto_ftruncate" = "yes"; then
AC_MSG_CHECKING([if ftruncate is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_unistd
]],[[
if(0 != ftruncate(0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_ftruncate="yes"
],[
AC_MSG_RESULT([no])
tst_compi_ftruncate="no"
])
fi
#
if test "$tst_compi_ftruncate" = "yes"; then
AC_MSG_CHECKING([if ftruncate usage allowed])
if test "x$curl_disallow_ftruncate" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_ftruncate="yes"
else
AC_MSG_RESULT([no])
tst_allow_ftruncate="no"
fi
fi
#
AC_MSG_CHECKING([if ftruncate might be used])
if test "$tst_links_ftruncate" = "yes" &&
test "$tst_proto_ftruncate" = "yes" &&
test "$tst_compi_ftruncate" = "yes" &&
test "$tst_allow_ftruncate" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_FTRUNCATE, 1,
[Define to 1 if you have the ftruncate function.])
curl_cv_func_ftruncate="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_ftruncate="no"
fi
])
dnl CURL_CHECK_FUNC_GETADDRINFO
dnl -------------------------------------------------
dnl Verify if getaddrinfo is available, prototyped, can
dnl be compiled and seems to work. If all of these are
dnl true, and usage has not been previously disallowed
dnl with shell variable curl_disallow_getaddrinfo, then
dnl HAVE_GETADDRINFO will be defined. Additionally when
dnl HAVE_GETADDRINFO gets defined this will also attempt
dnl to find out if getaddrinfo happens to be threadsafe,
dnl defining HAVE_GETADDRINFO_THREADSAFE when true.
AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [
AC_REQUIRE([CURL_INCLUDES_WS2TCPIP])dnl
AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
AC_REQUIRE([CURL_INCLUDES_STRING])dnl
AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
#
tst_links_getaddrinfo="unknown"
tst_proto_getaddrinfo="unknown"
tst_compi_getaddrinfo="unknown"
tst_works_getaddrinfo="unknown"
tst_allow_getaddrinfo="unknown"
tst_tsafe_getaddrinfo="unknown"
#
AC_MSG_CHECKING([if getaddrinfo can be linked])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_ws2tcpip
$curl_includes_sys_socket
$curl_includes_netdb
]],[[
if(0 != getaddrinfo(0, 0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_links_getaddrinfo="yes"
],[
AC_MSG_RESULT([no])
tst_links_getaddrinfo="no"
])
#
if test "$tst_links_getaddrinfo" = "yes"; then
AC_MSG_CHECKING([if getaddrinfo is prototyped])
AC_EGREP_CPP([getaddrinfo],[
$curl_includes_ws2tcpip
$curl_includes_sys_socket
$curl_includes_netdb
],[
AC_MSG_RESULT([yes])
tst_proto_getaddrinfo="yes"
],[
AC_MSG_RESULT([no])
tst_proto_getaddrinfo="no"
])
fi
#
if test "$tst_proto_getaddrinfo" = "yes"; then
AC_MSG_CHECKING([if getaddrinfo is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_ws2tcpip
$curl_includes_sys_socket
$curl_includes_netdb
]],[[
if(0 != getaddrinfo(0, 0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_getaddrinfo="yes"
],[
AC_MSG_RESULT([no])
tst_compi_getaddrinfo="no"
])
fi
#
dnl only do runtime verification when not cross-compiling
if test "x$cross_compiling" != "xyes" &&
test "$tst_compi_getaddrinfo" = "yes"; then
AC_MSG_CHECKING([if getaddrinfo seems to work])
CURL_RUN_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_ws2tcpip
$curl_includes_stdlib
$curl_includes_string
$curl_includes_sys_socket
$curl_includes_netdb
]],[[
struct addrinfo hints;
struct addrinfo *ai = 0;
int error;
#ifdef _WIN32
WSADATA wsa;
if(WSAStartup(MAKEWORD(2, 2), &wsa))
exit(2);
#endif
memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_NUMERICHOST;
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
error = getaddrinfo("127.0.0.1", 0, &hints, &ai);
if(error || !ai)
exit(1); /* fail */
else
exit(0);
]])
],[
AC_MSG_RESULT([yes])
tst_works_getaddrinfo="yes"
],[
AC_MSG_RESULT([no])
tst_works_getaddrinfo="no"
])
fi
#
if test "$tst_compi_getaddrinfo" = "yes" &&
test "$tst_works_getaddrinfo" != "no"; then
AC_MSG_CHECKING([if getaddrinfo usage allowed])
if test "x$curl_disallow_getaddrinfo" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_getaddrinfo="yes"
else
AC_MSG_RESULT([no])
tst_allow_getaddrinfo="no"
fi
fi
#
AC_MSG_CHECKING([if getaddrinfo might be used])
if test "$tst_links_getaddrinfo" = "yes" &&
test "$tst_proto_getaddrinfo" = "yes" &&
test "$tst_compi_getaddrinfo" = "yes" &&
test "$tst_allow_getaddrinfo" = "yes" &&
test "$tst_works_getaddrinfo" != "no"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_GETADDRINFO, 1,
[Define to 1 if you have a working getaddrinfo function.])
curl_cv_func_getaddrinfo="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_getaddrinfo="no"
curl_cv_func_getaddrinfo_threadsafe="no"
fi
#
if test "$curl_cv_func_getaddrinfo" = "yes"; then
AC_MSG_CHECKING([if getaddrinfo is threadsafe])
case $host in
*-apple-*)
dnl Darwin 6.0 and macOS 10.2.X and newer
tst_tsafe_getaddrinfo="yes"
esac
case $host_os in
aix[[1234]].* | aix5.[[01]].*)
dnl AIX 5.1 and older
tst_tsafe_getaddrinfo="no"
;;
aix*)
dnl AIX 5.2 and newer
tst_tsafe_getaddrinfo="yes"
;;
darwin[[12345]].*)
dnl Darwin 5.0 and macOS 10.1.X and older
tst_tsafe_getaddrinfo="no"
;;
freebsd[[1234]].* | freebsd5.[[1234]]*)
dnl FreeBSD 5.4 and older
tst_tsafe_getaddrinfo="no"
;;
freebsd*)
dnl FreeBSD 5.5 and newer
tst_tsafe_getaddrinfo="yes"
;;
hpux[[123456789]].* | hpux10.* | hpux11.0* | hpux11.10*)
dnl HP-UX 11.10 and older
tst_tsafe_getaddrinfo="no"
;;
hpux*)
dnl HP-UX 11.11 and newer
tst_tsafe_getaddrinfo="yes"
;;
midnightbsd*)
dnl all MidnightBSD versions
tst_tsafe_getaddrinfo="yes"
;;
netbsd[[123]].*)
dnl NetBSD 3.X and older
tst_tsafe_getaddrinfo="no"
;;
netbsd*)
dnl NetBSD 4.X and newer
tst_tsafe_getaddrinfo="yes"
;;
*bsd*)
dnl All other BSD's
tst_tsafe_getaddrinfo="no"
;;
solaris2*)
dnl Solaris which have it
tst_tsafe_getaddrinfo="yes"
;;
esac
if test "$tst_tsafe_getaddrinfo" = "unknown" &&
test "$curl_cv_native_windows" = "yes"; then
tst_tsafe_getaddrinfo="yes"
fi
if test "$tst_tsafe_getaddrinfo" = "unknown"; then
tst_tsafe_getaddrinfo="yes"
fi
AC_MSG_RESULT([$tst_tsafe_getaddrinfo])
if test "$tst_tsafe_getaddrinfo" = "yes"; then
AC_DEFINE_UNQUOTED(HAVE_GETADDRINFO_THREADSAFE, 1,
[Define to 1 if the getaddrinfo function is threadsafe.])
curl_cv_func_getaddrinfo_threadsafe="yes"
else
curl_cv_func_getaddrinfo_threadsafe="no"
fi
fi
])
dnl CURL_CHECK_FUNC_GETHOSTBYNAME
dnl -------------------------------------------------
dnl Verify if gethostbyname is available, prototyped,
dnl and can be compiled. If all of these are true,
dnl and usage has not been previously disallowed with
dnl shell variable curl_disallow_gethostbyname, then
dnl HAVE_GETHOSTBYNAME will be defined.
AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYNAME], [
AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
#
tst_links_gethostbyname="unknown"
tst_proto_gethostbyname="unknown"
tst_compi_gethostbyname="unknown"
tst_allow_gethostbyname="unknown"
#
AC_MSG_CHECKING([if gethostbyname can be linked])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_winsock2
$curl_includes_bsdsocket
$curl_includes_netdb
]],[[
if(0 != gethostbyname(0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_links_gethostbyname="yes"
],[
AC_MSG_RESULT([no])
tst_links_gethostbyname="no"
])
#
if test "$tst_links_gethostbyname" = "yes"; then
AC_MSG_CHECKING([if gethostbyname is prototyped])
AC_EGREP_CPP([gethostbyname],[
$curl_includes_winsock2
$curl_includes_bsdsocket
$curl_includes_netdb
],[
AC_MSG_RESULT([yes])
tst_proto_gethostbyname="yes"
],[
AC_MSG_RESULT([no])
tst_proto_gethostbyname="no"
])
fi
#
if test "$tst_proto_gethostbyname" = "yes"; then
AC_MSG_CHECKING([if gethostbyname is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_winsock2
$curl_includes_bsdsocket
$curl_includes_netdb
]],[[
if(0 != gethostbyname(0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_gethostbyname="yes"
],[
AC_MSG_RESULT([no])
tst_compi_gethostbyname="no"
])
fi
#
if test "$tst_compi_gethostbyname" = "yes"; then
AC_MSG_CHECKING([if gethostbyname usage allowed])
if test "x$curl_disallow_gethostbyname" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_gethostbyname="yes"
else
AC_MSG_RESULT([no])
tst_allow_gethostbyname="no"
fi
fi
#
AC_MSG_CHECKING([if gethostbyname might be used])
if test "$tst_links_gethostbyname" = "yes" &&
test "$tst_proto_gethostbyname" = "yes" &&
test "$tst_compi_gethostbyname" = "yes" &&
test "$tst_allow_gethostbyname" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYNAME, 1,
[Define to 1 if you have the gethostbyname function.])
curl_cv_func_gethostbyname="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_gethostbyname="no"
fi
])
dnl CURL_CHECK_FUNC_GETHOSTBYNAME_R
dnl -------------------------------------------------
dnl Verify if gethostbyname_r is available, prototyped,
dnl and can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_gethostbyname_r, then
dnl HAVE_GETHOSTBYNAME_R will be defined.
AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYNAME_R], [
AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
#
tst_links_gethostbyname_r="unknown"
tst_proto_gethostbyname_r="unknown"
tst_compi_gethostbyname_r="unknown"
tst_allow_gethostbyname_r="unknown"
tst_nargs_gethostbyname_r="unknown"
#
AC_MSG_CHECKING([if gethostbyname_r can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([gethostbyname_r])
],[
AC_MSG_RESULT([yes])
tst_links_gethostbyname_r="yes"
],[
AC_MSG_RESULT([no])
tst_links_gethostbyname_r="no"
])
#
if test "$tst_links_gethostbyname_r" = "yes"; then
AC_MSG_CHECKING([if gethostbyname_r is prototyped])
AC_EGREP_CPP([gethostbyname_r],[
$curl_includes_netdb
],[
AC_MSG_RESULT([yes])
tst_proto_gethostbyname_r="yes"
],[
AC_MSG_RESULT([no])
tst_proto_gethostbyname_r="no"
])
fi
#
if test "$tst_proto_gethostbyname_r" = "yes"; then
if test "$tst_nargs_gethostbyname_r" = "unknown"; then
AC_MSG_CHECKING([if gethostbyname_r takes 3 args.])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_netdb
$curl_includes_bsdsocket
]],[[
if(0 != gethostbyname_r(0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_gethostbyname_r="yes"
tst_nargs_gethostbyname_r="3"
],[
AC_MSG_RESULT([no])
tst_compi_gethostbyname_r="no"
])
fi
if test "$tst_nargs_gethostbyname_r" = "unknown"; then
AC_MSG_CHECKING([if gethostbyname_r takes 5 args.])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_netdb
$curl_includes_bsdsocket
]],[[
if(0 != gethostbyname_r(0, 0, 0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_gethostbyname_r="yes"
tst_nargs_gethostbyname_r="5"
],[
AC_MSG_RESULT([no])
tst_compi_gethostbyname_r="no"
])
fi
if test "$tst_nargs_gethostbyname_r" = "unknown"; then
AC_MSG_CHECKING([if gethostbyname_r takes 6 args.])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_netdb
$curl_includes_bsdsocket
]],[[
if(0 != gethostbyname_r(0, 0, 0, 0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_gethostbyname_r="yes"
tst_nargs_gethostbyname_r="6"
],[
AC_MSG_RESULT([no])
tst_compi_gethostbyname_r="no"
])
fi
AC_MSG_CHECKING([if gethostbyname_r is compilable])
if test "$tst_compi_gethostbyname_r" = "yes"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
#
if test "$tst_compi_gethostbyname_r" = "yes"; then
AC_MSG_CHECKING([if gethostbyname_r usage allowed])
if test "x$curl_disallow_gethostbyname_r" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_gethostbyname_r="yes"
else
AC_MSG_RESULT([no])
tst_allow_gethostbyname_r="no"
fi
fi
#
AC_MSG_CHECKING([if gethostbyname_r might be used])
if test "$tst_links_gethostbyname_r" = "yes" &&
test "$tst_proto_gethostbyname_r" = "yes" &&
test "$tst_compi_gethostbyname_r" = "yes" &&
test "$tst_allow_gethostbyname_r" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYNAME_R, 1,
[Define to 1 if you have the gethostbyname_r function.])
dnl AC_DEFINE_UNQUOTED(GETHOSTBYNAME_R_ARGS, $tst_nargs_gethostbyname_r,
dnl [Specifies the number of arguments to gethostbyname_r])
#
if test "$tst_nargs_gethostbyname_r" -eq "3"; then
AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, [gethostbyname_r() takes 3 args])
elif test "$tst_nargs_gethostbyname_r" -eq "5"; then
AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1, [gethostbyname_r() takes 5 args])
elif test "$tst_nargs_gethostbyname_r" -eq "6"; then
AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1, [gethostbyname_r() takes 6 args])
fi
#
curl_cv_func_gethostbyname_r="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_gethostbyname_r="no"
fi
])
dnl CURL_CHECK_FUNC_GETHOSTNAME
dnl -------------------------------------------------
dnl Verify if gethostname is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_gethostname, then
dnl HAVE_GETHOSTNAME will be defined.
AC_DEFUN([CURL_CHECK_FUNC_GETHOSTNAME], [
AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
AC_REQUIRE([CURL_PREPROCESS_CALLCONV])dnl
#
tst_links_gethostname="unknown"
tst_proto_gethostname="unknown"
tst_compi_gethostname="unknown"
tst_allow_gethostname="unknown"
#
AC_MSG_CHECKING([if gethostname can be linked])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_winsock2
$curl_includes_unistd
$curl_includes_bsdsocket
]],[[
if(0 != gethostname(0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_links_gethostname="yes"
],[
AC_MSG_RESULT([no])
tst_links_gethostname="no"
])
#
if test "$tst_links_gethostname" = "yes"; then
AC_MSG_CHECKING([if gethostname is prototyped])
AC_EGREP_CPP([gethostname],[
$curl_includes_winsock2
$curl_includes_unistd
$curl_includes_bsdsocket
],[
AC_MSG_RESULT([yes])
tst_proto_gethostname="yes"
],[
AC_MSG_RESULT([no])
tst_proto_gethostname="no"
])
fi
#
if test "$tst_proto_gethostname" = "yes"; then
AC_MSG_CHECKING([if gethostname is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_winsock2
$curl_includes_unistd
$curl_includes_bsdsocket
]],[[
if(0 != gethostname(0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_gethostname="yes"
],[
AC_MSG_RESULT([no])
tst_compi_gethostname="no"
])
fi
#
if test "$tst_compi_gethostname" = "yes"; then
AC_MSG_CHECKING([for gethostname arg 2 data type])
tst_gethostname_type_arg2="unknown"
for tst_arg1 in 'char *' 'unsigned char *' 'void *'; do
for tst_arg2 in 'int' 'unsigned int' 'size_t'; do
if test "$tst_gethostname_type_arg2" = "unknown"; then
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_winsock2
$curl_includes_unistd
$curl_includes_bsdsocket
$curl_preprocess_callconv
extern int FUNCALLCONV gethostname($tst_arg1, $tst_arg2);
]],[[
if(0 != gethostname(0, 0))
return 1;
]])
],[
tst_gethostname_type_arg2="$tst_arg2"
])
fi
done
done
AC_MSG_RESULT([$tst_gethostname_type_arg2])
if test "$tst_gethostname_type_arg2" != "unknown"; then
AC_DEFINE_UNQUOTED(GETHOSTNAME_TYPE_ARG2, $tst_gethostname_type_arg2,
[Define to the type of arg 2 for gethostname.])
fi
fi
#
if test "$tst_compi_gethostname" = "yes"; then
AC_MSG_CHECKING([if gethostname usage allowed])
if test "x$curl_disallow_gethostname" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_gethostname="yes"
else
AC_MSG_RESULT([no])
tst_allow_gethostname="no"
fi
fi
#
AC_MSG_CHECKING([if gethostname might be used])
if test "$tst_links_gethostname" = "yes" &&
test "$tst_proto_gethostname" = "yes" &&
test "$tst_compi_gethostname" = "yes" &&
test "$tst_allow_gethostname" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_GETHOSTNAME, 1,
[Define to 1 if you have the gethostname function.])
curl_cv_func_gethostname="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_gethostname="no"
fi
])
dnl CURL_CHECK_FUNC_GETPEERNAME
dnl -------------------------------------------------
dnl Verify if getpeername is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_getpeername, then
dnl HAVE_GETPEERNAME will be defined.
AC_DEFUN([CURL_CHECK_FUNC_GETPEERNAME], [
AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
AC_REQUIRE([CURL_PREPROCESS_CALLCONV])dnl
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
#
tst_links_getpeername="unknown"
tst_proto_getpeername="unknown"
tst_compi_getpeername="unknown"
tst_allow_getpeername="unknown"
#
AC_MSG_CHECKING([if getpeername can be linked])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_winsock2
$curl_includes_bsdsocket
$curl_includes_sys_socket
]],[[
if(0 != getpeername(0, (void *)0, (void *)0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_links_getpeername="yes"
],[
AC_MSG_RESULT([no])
tst_links_getpeername="no"
])
#
if test "$tst_links_getpeername" = "yes"; then
AC_MSG_CHECKING([if getpeername is prototyped])
AC_EGREP_CPP([getpeername],[
$curl_includes_winsock2
$curl_includes_bsdsocket
$curl_includes_sys_socket
],[
AC_MSG_RESULT([yes])
tst_proto_getpeername="yes"
],[
AC_MSG_RESULT([no])
tst_proto_getpeername="no"
])
fi
#
if test "$tst_proto_getpeername" = "yes"; then
AC_MSG_CHECKING([if getpeername is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_winsock2
$curl_includes_bsdsocket
$curl_includes_sys_socket
]],[[
if(0 != getpeername(0, (void *)0, (void *)0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_getpeername="yes"
],[
AC_MSG_RESULT([no])
tst_compi_getpeername="no"
])
fi
#
if test "$tst_compi_getpeername" = "yes"; then
AC_MSG_CHECKING([if getpeername usage allowed])
if test "x$curl_disallow_getpeername" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_getpeername="yes"
else
AC_MSG_RESULT([no])
tst_allow_getpeername="no"
fi
fi
#
AC_MSG_CHECKING([if getpeername might be used])
if test "$tst_links_getpeername" = "yes" &&
test "$tst_proto_getpeername" = "yes" &&
test "$tst_compi_getpeername" = "yes" &&
test "$tst_allow_getpeername" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_GETPEERNAME, 1,
[Define to 1 if you have the getpeername function.])
curl_cv_func_getpeername="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_getpeername="no"
fi
])
dnl CURL_CHECK_FUNC_GETSOCKNAME
dnl -------------------------------------------------
dnl Verify if getsockname is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_getsockname, then
dnl HAVE_GETSOCKNAME will be defined.
AC_DEFUN([CURL_CHECK_FUNC_GETSOCKNAME], [
AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
AC_REQUIRE([CURL_PREPROCESS_CALLCONV])dnl
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
#
tst_links_getsockname="unknown"
tst_proto_getsockname="unknown"
tst_compi_getsockname="unknown"
tst_allow_getsockname="unknown"
#
AC_MSG_CHECKING([if getsockname can be linked])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_winsock2
$curl_includes_bsdsocket
$curl_includes_sys_socket
]],[[
if(0 != getsockname(0, (void *)0, (void *)0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_links_getsockname="yes"
],[
AC_MSG_RESULT([no])
tst_links_getsockname="no"
])
#
if test "$tst_links_getsockname" = "yes"; then
AC_MSG_CHECKING([if getsockname is prototyped])
AC_EGREP_CPP([getsockname],[
$curl_includes_winsock2
$curl_includes_bsdsocket
$curl_includes_sys_socket
],[
AC_MSG_RESULT([yes])
tst_proto_getsockname="yes"
],[
AC_MSG_RESULT([no])
tst_proto_getsockname="no"
])
fi
#
if test "$tst_proto_getsockname" = "yes"; then
AC_MSG_CHECKING([if getsockname is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_winsock2
$curl_includes_bsdsocket
$curl_includes_sys_socket
]],[[
if(0 != getsockname(0, (void *)0, (void *)0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_getsockname="yes"
],[
AC_MSG_RESULT([no])
tst_compi_getsockname="no"
])
fi
#
if test "$tst_compi_getsockname" = "yes"; then
AC_MSG_CHECKING([if getsockname usage allowed])
if test "x$curl_disallow_getsockname" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_getsockname="yes"
else
AC_MSG_RESULT([no])
tst_allow_getsockname="no"
fi
fi
#
AC_MSG_CHECKING([if getsockname might be used])
if test "$tst_links_getsockname" = "yes" &&
test "$tst_proto_getsockname" = "yes" &&
test "$tst_compi_getsockname" = "yes" &&
test "$tst_allow_getsockname" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_GETSOCKNAME, 1,
[Define to 1 if you have the getsockname function.])
curl_cv_func_getsockname="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_getsockname="no"
fi
])
dnl CURL_CHECK_FUNC_GETIFADDRS
dnl -------------------------------------------------
dnl Verify if getifaddrs is available, prototyped, can
dnl be compiled and seems to work. If all of these are
dnl true, and usage has not been previously disallowed
dnl with shell variable curl_disallow_getifaddrs, then
dnl HAVE_GETIFADDRS will be defined.
AC_DEFUN([CURL_CHECK_FUNC_GETIFADDRS], [
AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
AC_REQUIRE([CURL_INCLUDES_IFADDRS])dnl
#
tst_links_getifaddrs="unknown"
tst_proto_getifaddrs="unknown"
tst_compi_getifaddrs="unknown"
tst_works_getifaddrs="unknown"
tst_allow_getifaddrs="unknown"
#
AC_MSG_CHECKING([if getifaddrs can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([getifaddrs])
],[
AC_MSG_RESULT([yes])
tst_links_getifaddrs="yes"
],[
AC_MSG_RESULT([no])
tst_links_getifaddrs="no"
])
#
if test "$tst_links_getifaddrs" = "yes"; then
AC_MSG_CHECKING([if getifaddrs is prototyped])
AC_EGREP_CPP([getifaddrs],[
$curl_includes_ifaddrs
],[
AC_MSG_RESULT([yes])
tst_proto_getifaddrs="yes"
],[
AC_MSG_RESULT([no])
tst_proto_getifaddrs="no"
])
fi
#
if test "$tst_proto_getifaddrs" = "yes"; then
AC_MSG_CHECKING([if getifaddrs is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_ifaddrs
]],[[
if(0 != getifaddrs(0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_getifaddrs="yes"
],[
AC_MSG_RESULT([no])
tst_compi_getifaddrs="no"
])
fi
#
dnl only do runtime verification when not cross-compiling
if test "x$cross_compiling" != "xyes" &&
test "$tst_compi_getifaddrs" = "yes"; then
AC_MSG_CHECKING([if getifaddrs seems to work])
CURL_RUN_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_stdlib
$curl_includes_ifaddrs
]],[[
struct ifaddrs *ifa = 0;
int error;
error = getifaddrs(&ifa);
if(error || !ifa)
exit(1); /* fail */
else
exit(0);
]])
],[
AC_MSG_RESULT([yes])
tst_works_getifaddrs="yes"
],[
AC_MSG_RESULT([no])
tst_works_getifaddrs="no"
])
fi
#
if test "$tst_compi_getifaddrs" = "yes" &&
test "$tst_works_getifaddrs" != "no"; then
AC_MSG_CHECKING([if getifaddrs usage allowed])
if test "x$curl_disallow_getifaddrs" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_getifaddrs="yes"
else
AC_MSG_RESULT([no])
tst_allow_getifaddrs="no"
fi
fi
#
AC_MSG_CHECKING([if getifaddrs might be used])
if test "$tst_links_getifaddrs" = "yes" &&
test "$tst_proto_getifaddrs" = "yes" &&
test "$tst_compi_getifaddrs" = "yes" &&
test "$tst_allow_getifaddrs" = "yes" &&
test "$tst_works_getifaddrs" != "no"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_GETIFADDRS, 1,
[Define to 1 if you have a working getifaddrs function.])
curl_cv_func_getifaddrs="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_getifaddrs="no"
fi
])
dnl CURL_CHECK_FUNC_GMTIME_R
dnl -------------------------------------------------
dnl Verify if gmtime_r is available, prototyped, can
dnl be compiled and seems to work. If all of these are
dnl true, and usage has not been previously disallowed
dnl with shell variable curl_disallow_gmtime_r, then
dnl HAVE_GMTIME_R will be defined.
AC_DEFUN([CURL_CHECK_FUNC_GMTIME_R], [
AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
AC_REQUIRE([CURL_INCLUDES_TIME])dnl
#
tst_links_gmtime_r="unknown"
tst_proto_gmtime_r="unknown"
tst_compi_gmtime_r="unknown"
tst_works_gmtime_r="unknown"
tst_allow_gmtime_r="unknown"
#
AC_MSG_CHECKING([if gmtime_r can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([gmtime_r])
],[
AC_MSG_RESULT([yes])
tst_links_gmtime_r="yes"
],[
AC_MSG_RESULT([no])
tst_links_gmtime_r="no"
])
#
if test "$tst_links_gmtime_r" = "yes"; then
AC_MSG_CHECKING([if gmtime_r is prototyped])
AC_EGREP_CPP([gmtime_r],[
$curl_includes_time
],[
AC_MSG_RESULT([yes])
tst_proto_gmtime_r="yes"
],[
AC_MSG_RESULT([no])
tst_proto_gmtime_r="no"
])
fi
#
if test "$tst_proto_gmtime_r" = "yes"; then
AC_MSG_CHECKING([if gmtime_r is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_time
]],[[
if(0 != gmtime_r(0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_gmtime_r="yes"
],[
AC_MSG_RESULT([no])
tst_compi_gmtime_r="no"
])
fi
#
dnl only do runtime verification when not cross-compiling
if test "x$cross_compiling" != "xyes" &&
test "$tst_compi_gmtime_r" = "yes"; then
AC_MSG_CHECKING([if gmtime_r seems to work])
CURL_RUN_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_stdlib
$curl_includes_time
]],[[
time_t local = 1170352587;
struct tm *gmt = 0;
struct tm result;
gmt = gmtime_r(&local, &result);
if(gmt)
exit(0);
else
exit(1);
]])
],[
AC_MSG_RESULT([yes])
tst_works_gmtime_r="yes"
],[
AC_MSG_RESULT([no])
tst_works_gmtime_r="no"
])
fi
#
if test "$tst_compi_gmtime_r" = "yes" &&
test "$tst_works_gmtime_r" != "no"; then
AC_MSG_CHECKING([if gmtime_r usage allowed])
if test "x$curl_disallow_gmtime_r" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_gmtime_r="yes"
else
AC_MSG_RESULT([no])
tst_allow_gmtime_r="no"
fi
fi
#
AC_MSG_CHECKING([if gmtime_r might be used])
if test "$tst_links_gmtime_r" = "yes" &&
test "$tst_proto_gmtime_r" = "yes" &&
test "$tst_compi_gmtime_r" = "yes" &&
test "$tst_allow_gmtime_r" = "yes" &&
test "$tst_works_gmtime_r" != "no"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_GMTIME_R, 1,
[Define to 1 if you have a working gmtime_r function.])
curl_cv_func_gmtime_r="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_gmtime_r="no"
fi
])
dnl CURL_CHECK_FUNC_INET_NTOP
dnl -------------------------------------------------
dnl Verify if inet_ntop is available, prototyped, can
dnl be compiled and seems to work. If all of these are
dnl true, and usage has not been previously disallowed
dnl with shell variable curl_disallow_inet_ntop, then
dnl HAVE_INET_NTOP will be defined.
AC_DEFUN([CURL_CHECK_FUNC_INET_NTOP], [
AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
AC_REQUIRE([CURL_INCLUDES_ARPA_INET])dnl
AC_REQUIRE([CURL_INCLUDES_STRING])dnl
#
tst_links_inet_ntop="unknown"
tst_proto_inet_ntop="unknown"
tst_compi_inet_ntop="unknown"
tst_works_inet_ntop="unknown"
tst_allow_inet_ntop="unknown"
#
AC_MSG_CHECKING([if inet_ntop can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([inet_ntop])
],[
AC_MSG_RESULT([yes])
tst_links_inet_ntop="yes"
],[
AC_MSG_RESULT([no])
tst_links_inet_ntop="no"
])
#
if test "$tst_links_inet_ntop" = "yes"; then
AC_MSG_CHECKING([if inet_ntop is prototyped])
AC_EGREP_CPP([inet_ntop],[
$curl_includes_arpa_inet
],[
AC_MSG_RESULT([yes])
tst_proto_inet_ntop="yes"
],[
AC_MSG_RESULT([no])
tst_proto_inet_ntop="no"
])
fi
#
if test "$tst_proto_inet_ntop" = "yes"; then
AC_MSG_CHECKING([if inet_ntop is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_arpa_inet
]],[[
if(0 != inet_ntop(0, 0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_inet_ntop="yes"
],[
AC_MSG_RESULT([no])
tst_compi_inet_ntop="no"
])
fi
#
dnl only do runtime verification when not cross-compiling
if test "x$cross_compiling" != "xyes" &&
test "$tst_compi_inet_ntop" = "yes"; then
AC_MSG_CHECKING([if inet_ntop seems to work])
CURL_RUN_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_stdlib
$curl_includes_arpa_inet
$curl_includes_string
]],[[
char ipv6res[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
char ipv4res[sizeof "255.255.255.255"];
unsigned char ipv6a[26];
unsigned char ipv4a[5];
char *ipv6ptr = 0;
char *ipv4ptr = 0;
/* - */
ipv4res[0] = '\0';
ipv4a[0] = 0xc0;
ipv4a[1] = 0xa8;
ipv4a[2] = 0x64;
ipv4a[3] = 0x01;
ipv4a[4] = 0x01;
/* - */
ipv4ptr = inet_ntop(AF_INET, ipv4a, ipv4res, sizeof(ipv4res));
if(!ipv4ptr)
exit(1); /* fail */
if(ipv4ptr != ipv4res)
exit(1); /* fail */
if(!ipv4ptr[0])
exit(1); /* fail */
if(memcmp(ipv4res, "192.168.100.1", 13) != 0)
exit(1); /* fail */
/* - */
ipv6res[0] = '\0';
memset(ipv6a, 0, sizeof(ipv6a));
ipv6a[0] = 0xfe;
ipv6a[1] = 0x80;
ipv6a[8] = 0x02;
ipv6a[9] = 0x14;
ipv6a[10] = 0x4f;
ipv6a[11] = 0xff;
ipv6a[12] = 0xfe;
ipv6a[13] = 0x0b;
ipv6a[14] = 0x76;
ipv6a[15] = 0xc8;
ipv6a[25] = 0x01;
/* - */
ipv6ptr = inet_ntop(AF_INET6, ipv6a, ipv6res, sizeof(ipv6res));
if(!ipv6ptr)
exit(1); /* fail */
if(ipv6ptr != ipv6res)
exit(1); /* fail */
if(!ipv6ptr[0])
exit(1); /* fail */
if(memcmp(ipv6res, "fe80::214:4fff:fe0b:76c8", 24) != 0)
exit(1); /* fail */
/* - */
exit(0);
]])
],[
AC_MSG_RESULT([yes])
tst_works_inet_ntop="yes"
],[
AC_MSG_RESULT([no])
tst_works_inet_ntop="no"
])
fi
#
if test "$tst_compi_inet_ntop" = "yes" &&
test "$tst_works_inet_ntop" != "no"; then
AC_MSG_CHECKING([if inet_ntop usage allowed])
if test "x$curl_disallow_inet_ntop" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_inet_ntop="yes"
else
AC_MSG_RESULT([no])
tst_allow_inet_ntop="no"
fi
fi
#
AC_MSG_CHECKING([if inet_ntop might be used])
if test "$tst_links_inet_ntop" = "yes" &&
test "$tst_proto_inet_ntop" = "yes" &&
test "$tst_compi_inet_ntop" = "yes" &&
test "$tst_allow_inet_ntop" = "yes" &&
test "$tst_works_inet_ntop" != "no"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_INET_NTOP, 1,
[Define to 1 if you have a IPv6 capable working inet_ntop function.])
curl_cv_func_inet_ntop="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_inet_ntop="no"
fi
])
dnl CURL_CHECK_FUNC_INET_PTON
dnl -------------------------------------------------
dnl Verify if inet_pton is available, prototyped, can
dnl be compiled and seems to work. If all of these are
dnl true, and usage has not been previously disallowed
dnl with shell variable curl_disallow_inet_pton, then
dnl HAVE_INET_PTON will be defined.
AC_DEFUN([CURL_CHECK_FUNC_INET_PTON], [
AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
AC_REQUIRE([CURL_INCLUDES_ARPA_INET])dnl
AC_REQUIRE([CURL_INCLUDES_STRING])dnl
#
tst_links_inet_pton="unknown"
tst_proto_inet_pton="unknown"
tst_compi_inet_pton="unknown"
tst_works_inet_pton="unknown"
tst_allow_inet_pton="unknown"
#
AC_MSG_CHECKING([if inet_pton can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([inet_pton])
],[
AC_MSG_RESULT([yes])
tst_links_inet_pton="yes"
],[
AC_MSG_RESULT([no])
tst_links_inet_pton="no"
])
#
if test "$tst_links_inet_pton" = "yes"; then
AC_MSG_CHECKING([if inet_pton is prototyped])
AC_EGREP_CPP([inet_pton],[
$curl_includes_arpa_inet
],[
AC_MSG_RESULT([yes])
tst_proto_inet_pton="yes"
],[
AC_MSG_RESULT([no])
tst_proto_inet_pton="no"
])
fi
#
if test "$tst_proto_inet_pton" = "yes"; then
AC_MSG_CHECKING([if inet_pton is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_arpa_inet
]],[[
if(0 != inet_pton(0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_inet_pton="yes"
],[
AC_MSG_RESULT([no])
tst_compi_inet_pton="no"
])
fi
#
dnl only do runtime verification when not cross-compiling
if test "x$cross_compiling" != "xyes" &&
test "$tst_compi_inet_pton" = "yes"; then
AC_MSG_CHECKING([if inet_pton seems to work])
CURL_RUN_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_stdlib
$curl_includes_arpa_inet
$curl_includes_string
]],[[
unsigned char ipv6a[16+1];
unsigned char ipv4a[4+1];
const char *ipv6src = "fe80::214:4fff:fe0b:76c8";
const char *ipv4src = "192.168.100.1";
/* - */
memset(ipv4a, 1, sizeof(ipv4a));
if(1 != inet_pton(AF_INET, ipv4src, ipv4a))
exit(1); /* fail */
/* - */
if( (ipv4a[0] != 0xc0) ||
(ipv4a[1] != 0xa8) ||
(ipv4a[2] != 0x64) ||
(ipv4a[3] != 0x01) ||
(ipv4a[4] != 0x01) )
exit(1); /* fail */
/* - */
memset(ipv6a, 1, sizeof(ipv6a));
if(1 != inet_pton(AF_INET6, ipv6src, ipv6a))
exit(1); /* fail */
/* - */
if( (ipv6a[0] != 0xfe) ||
(ipv6a[1] != 0x80) ||
(ipv6a[8] != 0x02) ||
(ipv6a[9] != 0x14) ||
(ipv6a[10] != 0x4f) ||
(ipv6a[11] != 0xff) ||
(ipv6a[12] != 0xfe) ||
(ipv6a[13] != 0x0b) ||
(ipv6a[14] != 0x76) ||
(ipv6a[15] != 0xc8) ||
(ipv6a[16] != 0x01) )
exit(1); /* fail */
/* - */
if( (ipv6a[2] != 0x0) ||
(ipv6a[3] != 0x0) ||
(ipv6a[4] != 0x0) ||
(ipv6a[5] != 0x0) ||
(ipv6a[6] != 0x0) ||
(ipv6a[7] != 0x0) )
exit(1); /* fail */
/* - */
exit(0);
]])
],[
AC_MSG_RESULT([yes])
tst_works_inet_pton="yes"
],[
AC_MSG_RESULT([no])
tst_works_inet_pton="no"
])
fi
#
if test "$tst_compi_inet_pton" = "yes" &&
test "$tst_works_inet_pton" != "no"; then
AC_MSG_CHECKING([if inet_pton usage allowed])
if test "x$curl_disallow_inet_pton" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_inet_pton="yes"
else
AC_MSG_RESULT([no])
tst_allow_inet_pton="no"
fi
fi
#
AC_MSG_CHECKING([if inet_pton might be used])
if test "$tst_links_inet_pton" = "yes" &&
test "$tst_proto_inet_pton" = "yes" &&
test "$tst_compi_inet_pton" = "yes" &&
test "$tst_allow_inet_pton" = "yes" &&
test "$tst_works_inet_pton" != "no"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_INET_PTON, 1,
[Define to 1 if you have a IPv6 capable working inet_pton function.])
curl_cv_func_inet_pton="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_inet_pton="no"
fi
])
dnl CURL_CHECK_FUNC_IOCTL
dnl -------------------------------------------------
dnl Verify if ioctl is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_ioctl, then
dnl HAVE_IOCTL will be defined.
AC_DEFUN([CURL_CHECK_FUNC_IOCTL], [
AC_REQUIRE([CURL_INCLUDES_STROPTS])dnl
#
tst_links_ioctl="unknown"
tst_proto_ioctl="unknown"
tst_compi_ioctl="unknown"
tst_allow_ioctl="unknown"
#
AC_MSG_CHECKING([if ioctl can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([ioctl])
],[
AC_MSG_RESULT([yes])
tst_links_ioctl="yes"
],[
AC_MSG_RESULT([no])
tst_links_ioctl="no"
])
#
if test "$tst_links_ioctl" = "yes"; then
AC_MSG_CHECKING([if ioctl is prototyped])
AC_EGREP_CPP([ioctl],[
$curl_includes_stropts
],[
AC_MSG_RESULT([yes])
tst_proto_ioctl="yes"
],[
AC_MSG_RESULT([no])
tst_proto_ioctl="no"
])
fi
#
if test "$tst_proto_ioctl" = "yes"; then
AC_MSG_CHECKING([if ioctl is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_stropts
]],[[
if(0 != ioctl(0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_ioctl="yes"
],[
AC_MSG_RESULT([no])
tst_compi_ioctl="no"
])
fi
#
if test "$tst_compi_ioctl" = "yes"; then
AC_MSG_CHECKING([if ioctl usage allowed])
if test "x$curl_disallow_ioctl" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_ioctl="yes"
else
AC_MSG_RESULT([no])
tst_allow_ioctl="no"
fi
fi
#
AC_MSG_CHECKING([if ioctl might be used])
if test "$tst_links_ioctl" = "yes" &&
test "$tst_proto_ioctl" = "yes" &&
test "$tst_compi_ioctl" = "yes" &&
test "$tst_allow_ioctl" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_IOCTL, 1,
[Define to 1 if you have the ioctl function.])
curl_cv_func_ioctl="yes"
CURL_CHECK_FUNC_IOCTL_FIONBIO
CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR
else
AC_MSG_RESULT([no])
curl_cv_func_ioctl="no"
fi
])
dnl CURL_CHECK_FUNC_IOCTL_FIONBIO
dnl -------------------------------------------------
dnl Verify if ioctl with the FIONBIO command is
dnl available, can be compiled, and seems to work. If
dnl all of these are true, then HAVE_IOCTL_FIONBIO
dnl will be defined.
AC_DEFUN([CURL_CHECK_FUNC_IOCTL_FIONBIO], [
#
tst_compi_ioctl_fionbio="unknown"
tst_allow_ioctl_fionbio="unknown"
#
if test "$curl_cv_func_ioctl" = "yes"; then
AC_MSG_CHECKING([if ioctl FIONBIO is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_stropts
]],[[
int flags = 0;
if(0 != ioctl(0, FIONBIO, &flags))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_ioctl_fionbio="yes"
],[
AC_MSG_RESULT([no])
tst_compi_ioctl_fionbio="no"
])
fi
#
if test "$tst_compi_ioctl_fionbio" = "yes"; then
AC_MSG_CHECKING([if ioctl FIONBIO usage allowed])
if test "x$curl_disallow_ioctl_fionbio" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_ioctl_fionbio="yes"
else
AC_MSG_RESULT([no])
tst_allow_ioctl_fionbio="no"
fi
fi
#
AC_MSG_CHECKING([if ioctl FIONBIO might be used])
if test "$tst_compi_ioctl_fionbio" = "yes" &&
test "$tst_allow_ioctl_fionbio" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_IOCTL_FIONBIO, 1,
[Define to 1 if you have a working ioctl FIONBIO function.])
curl_cv_func_ioctl_fionbio="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_ioctl_fionbio="no"
fi
])
dnl CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR
dnl -------------------------------------------------
dnl Verify if ioctl with the SIOCGIFADDR command is available,
dnl struct ifreq is defined, they can be compiled, and seem to
dnl work. If all of these are true, then HAVE_IOCTL_SIOCGIFADDR
dnl will be defined.
AC_DEFUN([CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR], [
#
tst_compi_ioctl_siocgifaddr="unknown"
tst_allow_ioctl_siocgifaddr="unknown"
#
if test "$curl_cv_func_ioctl" = "yes"; then
AC_MSG_CHECKING([if ioctl SIOCGIFADDR is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_stropts
#include <net/if.h>
]],[[
struct ifreq ifr;
if(0 != ioctl(0, SIOCGIFADDR, &ifr))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_ioctl_siocgifaddr="yes"
],[
AC_MSG_RESULT([no])
tst_compi_ioctl_siocgifaddr="no"
])
fi
#
if test "$tst_compi_ioctl_siocgifaddr" = "yes"; then
AC_MSG_CHECKING([if ioctl SIOCGIFADDR usage allowed])
if test "x$curl_disallow_ioctl_siocgifaddr" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_ioctl_siocgifaddr="yes"
else
AC_MSG_RESULT([no])
tst_allow_ioctl_siocgifaddr="no"
fi
fi
#
AC_MSG_CHECKING([if ioctl SIOCGIFADDR might be used])
if test "$tst_compi_ioctl_siocgifaddr" = "yes" &&
test "$tst_allow_ioctl_siocgifaddr" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_IOCTL_SIOCGIFADDR, 1,
[Define to 1 if you have a working ioctl SIOCGIFADDR function.])
curl_cv_func_ioctl_siocgifaddr="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_ioctl_siocgifaddr="no"
fi
])
dnl CURL_CHECK_FUNC_IOCTLSOCKET
dnl -------------------------------------------------
dnl Verify if ioctlsocket is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_ioctlsocket, then
dnl HAVE_IOCTLSOCKET will be defined.
AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET], [
AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
#
tst_links_ioctlsocket="unknown"
tst_proto_ioctlsocket="unknown"
tst_compi_ioctlsocket="unknown"
tst_allow_ioctlsocket="unknown"
#
AC_MSG_CHECKING([if ioctlsocket can be linked])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_winsock2
]],[[
if(0 != ioctlsocket(0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_links_ioctlsocket="yes"
],[
AC_MSG_RESULT([no])
tst_links_ioctlsocket="no"
])
#
if test "$tst_links_ioctlsocket" = "yes"; then
AC_MSG_CHECKING([if ioctlsocket is prototyped])
AC_EGREP_CPP([ioctlsocket],[
$curl_includes_winsock2
],[
AC_MSG_RESULT([yes])
tst_proto_ioctlsocket="yes"
],[
AC_MSG_RESULT([no])
tst_proto_ioctlsocket="no"
])
fi
#
if test "$tst_proto_ioctlsocket" = "yes"; then
AC_MSG_CHECKING([if ioctlsocket is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_winsock2
]],[[
if(0 != ioctlsocket(0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_ioctlsocket="yes"
],[
AC_MSG_RESULT([no])
tst_compi_ioctlsocket="no"
])
fi
#
if test "$tst_compi_ioctlsocket" = "yes"; then
AC_MSG_CHECKING([if ioctlsocket usage allowed])
if test "x$curl_disallow_ioctlsocket" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_ioctlsocket="yes"
else
AC_MSG_RESULT([no])
tst_allow_ioctlsocket="no"
fi
fi
#
AC_MSG_CHECKING([if ioctlsocket might be used])
if test "$tst_links_ioctlsocket" = "yes" &&
test "$tst_proto_ioctlsocket" = "yes" &&
test "$tst_compi_ioctlsocket" = "yes" &&
test "$tst_allow_ioctlsocket" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET, 1,
[Define to 1 if you have the ioctlsocket function.])
curl_cv_func_ioctlsocket="yes"
CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO
else
AC_MSG_RESULT([no])
curl_cv_func_ioctlsocket="no"
fi
])
dnl CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO
dnl -------------------------------------------------
dnl Verify if ioctlsocket with the FIONBIO command is
dnl available, can be compiled, and seems to work. If
dnl all of these are true, then HAVE_IOCTLSOCKET_FIONBIO
dnl will be defined.
AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO], [
#
tst_compi_ioctlsocket_fionbio="unknown"
tst_allow_ioctlsocket_fionbio="unknown"
#
if test "$curl_cv_func_ioctlsocket" = "yes"; then
AC_MSG_CHECKING([if ioctlsocket FIONBIO is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_winsock2
]],[[
unsigned long flags = 0;
if(0 != ioctlsocket(0, FIONBIO, &flags))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_ioctlsocket_fionbio="yes"
],[
AC_MSG_RESULT([no])
tst_compi_ioctlsocket_fionbio="no"
])
fi
#
if test "$tst_compi_ioctlsocket_fionbio" = "yes"; then
AC_MSG_CHECKING([if ioctlsocket FIONBIO usage allowed])
if test "x$curl_disallow_ioctlsocket_fionbio" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_ioctlsocket_fionbio="yes"
else
AC_MSG_RESULT([no])
tst_allow_ioctlsocket_fionbio="no"
fi
fi
#
AC_MSG_CHECKING([if ioctlsocket FIONBIO might be used])
if test "$tst_compi_ioctlsocket_fionbio" = "yes" &&
test "$tst_allow_ioctlsocket_fionbio" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_FIONBIO, 1,
[Define to 1 if you have a working ioctlsocket FIONBIO function.])
curl_cv_func_ioctlsocket_fionbio="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_ioctlsocket_fionbio="no"
fi
])
dnl CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
dnl -------------------------------------------------
dnl Verify if IoctlSocket is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_ioctlsocket_camel,
dnl then HAVE_IOCTLSOCKET_CAMEL will be defined.
AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL], [
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
#
tst_links_ioctlsocket_camel="unknown"
tst_proto_ioctlsocket_camel="unknown"
tst_compi_ioctlsocket_camel="unknown"
tst_allow_ioctlsocket_camel="unknown"
#
AC_MSG_CHECKING([if IoctlSocket can be linked])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_bsdsocket
]],[[
IoctlSocket(0, 0, 0);
]])
],[
AC_MSG_RESULT([yes])
tst_links_ioctlsocket_camel="yes"
],[
AC_MSG_RESULT([no])
tst_links_ioctlsocket_camel="no"
])
#
if test "$tst_links_ioctlsocket_camel" = "yes"; then
AC_MSG_CHECKING([if IoctlSocket is prototyped])
AC_EGREP_CPP([IoctlSocket],[
$curl_includes_bsdsocket
],[
AC_MSG_RESULT([yes])
tst_proto_ioctlsocket_camel="yes"
],[
AC_MSG_RESULT([no])
tst_proto_ioctlsocket_camel="no"
])
fi
#
if test "$tst_proto_ioctlsocket_camel" = "yes"; then
AC_MSG_CHECKING([if IoctlSocket is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_bsdsocket
]],[[
if(0 != IoctlSocket(0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_ioctlsocket_camel="yes"
],[
AC_MSG_RESULT([no])
tst_compi_ioctlsocket_camel="no"
])
fi
#
if test "$tst_compi_ioctlsocket_camel" = "yes"; then
AC_MSG_CHECKING([if IoctlSocket usage allowed])
if test "x$curl_disallow_ioctlsocket_camel" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_ioctlsocket_camel="yes"
else
AC_MSG_RESULT([no])
tst_allow_ioctlsocket_camel="no"
fi
fi
#
AC_MSG_CHECKING([if IoctlSocket might be used])
if test "$tst_links_ioctlsocket_camel" = "yes" &&
test "$tst_proto_ioctlsocket_camel" = "yes" &&
test "$tst_compi_ioctlsocket_camel" = "yes" &&
test "$tst_allow_ioctlsocket_camel" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_CAMEL, 1,
[Define to 1 if you have the IoctlSocket camel case function.])
curl_cv_func_ioctlsocket_camel="yes"
CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO
else
AC_MSG_RESULT([no])
curl_cv_func_ioctlsocket_camel="no"
fi
])
dnl CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO
dnl -------------------------------------------------
dnl Verify if IoctlSocket with FIONBIO command is available,
dnl can be compiled, and seems to work. If all of these are
dnl true, then HAVE_IOCTLSOCKET_CAMEL_FIONBIO will be defined.
AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO], [
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
#
tst_compi_ioctlsocket_camel_fionbio="unknown"
tst_allow_ioctlsocket_camel_fionbio="unknown"
#
if test "$curl_cv_func_ioctlsocket_camel" = "yes"; then
AC_MSG_CHECKING([if IoctlSocket FIONBIO is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_bsdsocket
]],[[
long flags = 0;
if(0 != IoctlSocket(0, FIONBIO, &flags))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_ioctlsocket_camel_fionbio="yes"
],[
AC_MSG_RESULT([no])
tst_compi_ioctlsocket_camel_fionbio="no"
])
fi
#
if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes"; then
AC_MSG_CHECKING([if IoctlSocket FIONBIO usage allowed])
if test "x$curl_disallow_ioctlsocket_camel_fionbio" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_ioctlsocket_camel_fionbio="yes"
else
AC_MSG_RESULT([no])
tst_allow_ioctlsocket_camel_fionbio="no"
fi
fi
#
AC_MSG_CHECKING([if IoctlSocket FIONBIO might be used])
if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes" &&
test "$tst_allow_ioctlsocket_camel_fionbio" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_CAMEL_FIONBIO, 1,
[Define to 1 if you have a working IoctlSocket camel case FIONBIO function.])
curl_cv_func_ioctlsocket_camel_fionbio="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_ioctlsocket_camel_fionbio="no"
fi
])
dnl CURL_CHECK_FUNC_MEMRCHR
dnl -------------------------------------------------
dnl Verify if memrchr is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_memrchr, then
dnl HAVE_MEMRCHR will be defined.
AC_DEFUN([CURL_CHECK_FUNC_MEMRCHR], [
AC_REQUIRE([CURL_INCLUDES_STRING])dnl
#
tst_links_memrchr="unknown"
tst_macro_memrchr="unknown"
tst_proto_memrchr="unknown"
tst_compi_memrchr="unknown"
tst_allow_memrchr="unknown"
#
AC_MSG_CHECKING([if memrchr can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([memrchr])
],[
AC_MSG_RESULT([yes])
tst_links_memrchr="yes"
],[
AC_MSG_RESULT([no])
tst_links_memrchr="no"
])
#
if test "$tst_links_memrchr" = "no"; then
AC_MSG_CHECKING([if memrchr seems a macro])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_string
]],[[
if(0 != memrchr(0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_macro_memrchr="yes"
],[
AC_MSG_RESULT([no])
tst_macro_memrchr="no"
])
fi
#
if test "$tst_links_memrchr" = "yes"; then
AC_MSG_CHECKING([if memrchr is prototyped])
AC_EGREP_CPP([memrchr],[
$curl_includes_string
],[
AC_MSG_RESULT([yes])
tst_proto_memrchr="yes"
],[
AC_MSG_RESULT([no])
tst_proto_memrchr="no"
])
fi
#
if test "$tst_proto_memrchr" = "yes" ||
test "$tst_macro_memrchr" = "yes"; then
AC_MSG_CHECKING([if memrchr is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_string
]],[[
if(0 != memrchr(0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_memrchr="yes"
],[
AC_MSG_RESULT([no])
tst_compi_memrchr="no"
])
fi
#
if test "$tst_compi_memrchr" = "yes"; then
AC_MSG_CHECKING([if memrchr usage allowed])
if test "x$curl_disallow_memrchr" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_memrchr="yes"
else
AC_MSG_RESULT([no])
tst_allow_memrchr="no"
fi
fi
#
AC_MSG_CHECKING([if memrchr might be used])
if (test "$tst_proto_memrchr" = "yes" ||
test "$tst_macro_memrchr" = "yes") &&
test "$tst_compi_memrchr" = "yes" &&
test "$tst_allow_memrchr" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_MEMRCHR, 1,
[Define to 1 if you have the memrchr function or macro.])
curl_cv_func_memrchr="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_memrchr="no"
fi
])
dnl CURL_CHECK_FUNC_SIGACTION
dnl -------------------------------------------------
dnl Verify if sigaction is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_sigaction, then
dnl HAVE_SIGACTION will be defined.
AC_DEFUN([CURL_CHECK_FUNC_SIGACTION], [
AC_REQUIRE([CURL_INCLUDES_SIGNAL])dnl
#
tst_links_sigaction="unknown"
tst_proto_sigaction="unknown"
tst_compi_sigaction="unknown"
tst_allow_sigaction="unknown"
#
AC_MSG_CHECKING([if sigaction can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([sigaction])
],[
AC_MSG_RESULT([yes])
tst_links_sigaction="yes"
],[
AC_MSG_RESULT([no])
tst_links_sigaction="no"
])
#
if test "$tst_links_sigaction" = "yes"; then
AC_MSG_CHECKING([if sigaction is prototyped])
AC_EGREP_CPP([sigaction],[
$curl_includes_signal
],[
AC_MSG_RESULT([yes])
tst_proto_sigaction="yes"
],[
AC_MSG_RESULT([no])
tst_proto_sigaction="no"
])
fi
#
if test "$tst_proto_sigaction" = "yes"; then
AC_MSG_CHECKING([if sigaction is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_signal
]],[[
if(0 != sigaction(0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_sigaction="yes"
],[
AC_MSG_RESULT([no])
tst_compi_sigaction="no"
])
fi
#
if test "$tst_compi_sigaction" = "yes"; then
AC_MSG_CHECKING([if sigaction usage allowed])
if test "x$curl_disallow_sigaction" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_sigaction="yes"
else
AC_MSG_RESULT([no])
tst_allow_sigaction="no"
fi
fi
#
AC_MSG_CHECKING([if sigaction might be used])
if test "$tst_links_sigaction" = "yes" &&
test "$tst_proto_sigaction" = "yes" &&
test "$tst_compi_sigaction" = "yes" &&
test "$tst_allow_sigaction" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_SIGACTION, 1,
[Define to 1 if you have the sigaction function.])
curl_cv_func_sigaction="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_sigaction="no"
fi
])
dnl CURL_CHECK_FUNC_SIGINTERRUPT
dnl -------------------------------------------------
dnl Verify if siginterrupt is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_siginterrupt, then
dnl HAVE_SIGINTERRUPT will be defined.
AC_DEFUN([CURL_CHECK_FUNC_SIGINTERRUPT], [
AC_REQUIRE([CURL_INCLUDES_SIGNAL])dnl
#
tst_links_siginterrupt="unknown"
tst_proto_siginterrupt="unknown"
tst_compi_siginterrupt="unknown"
tst_allow_siginterrupt="unknown"
#
AC_MSG_CHECKING([if siginterrupt can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([siginterrupt])
],[
AC_MSG_RESULT([yes])
tst_links_siginterrupt="yes"
],[
AC_MSG_RESULT([no])
tst_links_siginterrupt="no"
])
#
if test "$tst_links_siginterrupt" = "yes"; then
AC_MSG_CHECKING([if siginterrupt is prototyped])
AC_EGREP_CPP([siginterrupt],[
$curl_includes_signal
],[
AC_MSG_RESULT([yes])
tst_proto_siginterrupt="yes"
],[
AC_MSG_RESULT([no])
tst_proto_siginterrupt="no"
])
fi
#
if test "$tst_proto_siginterrupt" = "yes"; then
AC_MSG_CHECKING([if siginterrupt is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_signal
]],[[
if(0 != siginterrupt(0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_siginterrupt="yes"
],[
AC_MSG_RESULT([no])
tst_compi_siginterrupt="no"
])
fi
#
if test "$tst_compi_siginterrupt" = "yes"; then
AC_MSG_CHECKING([if siginterrupt usage allowed])
if test "x$curl_disallow_siginterrupt" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_siginterrupt="yes"
else
AC_MSG_RESULT([no])
tst_allow_siginterrupt="no"
fi
fi
#
AC_MSG_CHECKING([if siginterrupt might be used])
if test "$tst_links_siginterrupt" = "yes" &&
test "$tst_proto_siginterrupt" = "yes" &&
test "$tst_compi_siginterrupt" = "yes" &&
test "$tst_allow_siginterrupt" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_SIGINTERRUPT, 1,
[Define to 1 if you have the siginterrupt function.])
curl_cv_func_siginterrupt="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_siginterrupt="no"
fi
])
dnl CURL_CHECK_FUNC_SIGNAL
dnl -------------------------------------------------
dnl Verify if signal is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_signal, then
dnl HAVE_SIGNAL will be defined.
AC_DEFUN([CURL_CHECK_FUNC_SIGNAL], [
AC_REQUIRE([CURL_INCLUDES_SIGNAL])dnl
#
tst_links_signal="unknown"
tst_proto_signal="unknown"
tst_compi_signal="unknown"
tst_allow_signal="unknown"
#
AC_MSG_CHECKING([if signal can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([signal])
],[
AC_MSG_RESULT([yes])
tst_links_signal="yes"
],[
AC_MSG_RESULT([no])
tst_links_signal="no"
])
#
if test "$tst_links_signal" = "yes"; then
AC_MSG_CHECKING([if signal is prototyped])
AC_EGREP_CPP([signal],[
$curl_includes_signal
],[
AC_MSG_RESULT([yes])
tst_proto_signal="yes"
],[
AC_MSG_RESULT([no])
tst_proto_signal="no"
])
fi
#
if test "$tst_proto_signal" = "yes"; then
AC_MSG_CHECKING([if signal is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_signal
]],[[
if(0 != signal(0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_signal="yes"
],[
AC_MSG_RESULT([no])
tst_compi_signal="no"
])
fi
#
if test "$tst_compi_signal" = "yes"; then
AC_MSG_CHECKING([if signal usage allowed])
if test "x$curl_disallow_signal" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_signal="yes"
else
AC_MSG_RESULT([no])
tst_allow_signal="no"
fi
fi
#
AC_MSG_CHECKING([if signal might be used])
if test "$tst_links_signal" = "yes" &&
test "$tst_proto_signal" = "yes" &&
test "$tst_compi_signal" = "yes" &&
test "$tst_allow_signal" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_SIGNAL, 1,
[Define to 1 if you have the signal function.])
curl_cv_func_signal="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_signal="no"
fi
])
dnl CURL_CHECK_FUNC_SIGSETJMP
dnl -------------------------------------------------
dnl Verify if sigsetjmp is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_sigsetjmp, then
dnl HAVE_SIGSETJMP will be defined.
AC_DEFUN([CURL_CHECK_FUNC_SIGSETJMP], [
AC_REQUIRE([CURL_INCLUDES_SETJMP])dnl
#
tst_links_sigsetjmp="unknown"
tst_macro_sigsetjmp="unknown"
tst_proto_sigsetjmp="unknown"
tst_compi_sigsetjmp="unknown"
tst_allow_sigsetjmp="unknown"
#
AC_MSG_CHECKING([if sigsetjmp can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([sigsetjmp])
],[
AC_MSG_RESULT([yes])
tst_links_sigsetjmp="yes"
],[
AC_MSG_RESULT([no])
tst_links_sigsetjmp="no"
])
#
if test "$tst_links_sigsetjmp" = "no"; then
AC_MSG_CHECKING([if sigsetjmp seems a macro])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_setjmp
]],[[
sigjmp_buf env;
if(0 != sigsetjmp(env, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_macro_sigsetjmp="yes"
],[
AC_MSG_RESULT([no])
tst_macro_sigsetjmp="no"
])
fi
#
if test "$tst_links_sigsetjmp" = "yes"; then
AC_MSG_CHECKING([if sigsetjmp is prototyped])
AC_EGREP_CPP([sigsetjmp],[
$curl_includes_setjmp
],[
AC_MSG_RESULT([yes])
tst_proto_sigsetjmp="yes"
],[
AC_MSG_RESULT([no])
tst_proto_sigsetjmp="no"
])
fi
#
if test "$tst_proto_sigsetjmp" = "yes" ||
test "$tst_macro_sigsetjmp" = "yes"; then
AC_MSG_CHECKING([if sigsetjmp is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_setjmp
]],[[
sigjmp_buf env;
if(0 != sigsetjmp(env, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_sigsetjmp="yes"
],[
AC_MSG_RESULT([no])
tst_compi_sigsetjmp="no"
])
fi
#
if test "$tst_compi_sigsetjmp" = "yes"; then
AC_MSG_CHECKING([if sigsetjmp usage allowed])
if test "x$curl_disallow_sigsetjmp" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_sigsetjmp="yes"
else
AC_MSG_RESULT([no])
tst_allow_sigsetjmp="no"
fi
fi
#
AC_MSG_CHECKING([if sigsetjmp might be used])
if (test "$tst_proto_sigsetjmp" = "yes" ||
test "$tst_macro_sigsetjmp" = "yes") &&
test "$tst_compi_sigsetjmp" = "yes" &&
test "$tst_allow_sigsetjmp" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_SIGSETJMP, 1,
[Define to 1 if you have the sigsetjmp function or macro.])
curl_cv_func_sigsetjmp="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_sigsetjmp="no"
fi
])
dnl CURL_CHECK_FUNC_SOCKET
dnl -------------------------------------------------
dnl Verify if socket is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_socket, then
dnl HAVE_SOCKET will be defined.
AC_DEFUN([CURL_CHECK_FUNC_SOCKET], [
AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
#
tst_links_socket="unknown"
tst_proto_socket="unknown"
tst_compi_socket="unknown"
tst_allow_socket="unknown"
#
AC_MSG_CHECKING([if socket can be linked])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_winsock2
$curl_includes_bsdsocket
$curl_includes_sys_socket
]],[[
if(0 != socket(0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_links_socket="yes"
],[
AC_MSG_RESULT([no])
tst_links_socket="no"
])
#
if test "$tst_links_socket" = "yes"; then
AC_MSG_CHECKING([if socket is prototyped])
AC_EGREP_CPP([socket],[
$curl_includes_winsock2
$curl_includes_bsdsocket
$curl_includes_sys_socket
],[
AC_MSG_RESULT([yes])
tst_proto_socket="yes"
],[
AC_MSG_RESULT([no])
tst_proto_socket="no"
])
fi
#
if test "$tst_proto_socket" = "yes"; then
AC_MSG_CHECKING([if socket is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_winsock2
$curl_includes_bsdsocket
$curl_includes_sys_socket
]],[[
if(0 != socket(0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_socket="yes"
],[
AC_MSG_RESULT([no])
tst_compi_socket="no"
])
fi
#
if test "$tst_compi_socket" = "yes"; then
AC_MSG_CHECKING([if socket usage allowed])
if test "x$curl_disallow_socket" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_socket="yes"
else
AC_MSG_RESULT([no])
tst_allow_socket="no"
fi
fi
#
AC_MSG_CHECKING([if socket might be used])
if test "$tst_links_socket" = "yes" &&
test "$tst_proto_socket" = "yes" &&
test "$tst_compi_socket" = "yes" &&
test "$tst_allow_socket" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_SOCKET, 1,
[Define to 1 if you have the socket function.])
curl_cv_func_socket="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_socket="no"
fi
])
dnl CURL_CHECK_FUNC_SOCKETPAIR
dnl -------------------------------------------------
dnl Verify if socketpair is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_socketpair, then
dnl HAVE_SOCKETPAIR will be defined.
AC_DEFUN([CURL_CHECK_FUNC_SOCKETPAIR], [
AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
#
tst_links_socketpair="unknown"
tst_proto_socketpair="unknown"
tst_compi_socketpair="unknown"
tst_allow_socketpair="unknown"
#
AC_MSG_CHECKING([if socketpair can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([socketpair])
],[
AC_MSG_RESULT([yes])
tst_links_socketpair="yes"
],[
AC_MSG_RESULT([no])
tst_links_socketpair="no"
])
#
if test "$tst_links_socketpair" = "yes"; then
AC_MSG_CHECKING([if socketpair is prototyped])
AC_EGREP_CPP([socketpair],[
$curl_includes_sys_socket
],[
AC_MSG_RESULT([yes])
tst_proto_socketpair="yes"
],[
AC_MSG_RESULT([no])
tst_proto_socketpair="no"
])
fi
#
if test "$tst_proto_socketpair" = "yes"; then
AC_MSG_CHECKING([if socketpair is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_sys_socket
]],[[
int sv[2];
if(0 != socketpair(0, 0, 0, sv))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_socketpair="yes"
],[
AC_MSG_RESULT([no])
tst_compi_socketpair="no"
])
fi
#
if test "$tst_compi_socketpair" = "yes"; then
AC_MSG_CHECKING([if socketpair usage allowed])
if test "x$curl_disallow_socketpair" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_socketpair="yes"
else
AC_MSG_RESULT([no])
tst_allow_socketpair="no"
fi
fi
#
AC_MSG_CHECKING([if socketpair might be used])
if test "$tst_links_socketpair" = "yes" &&
test "$tst_proto_socketpair" = "yes" &&
test "$tst_compi_socketpair" = "yes" &&
test "$tst_allow_socketpair" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_SOCKETPAIR, 1,
[Define to 1 if you have the socketpair function.])
curl_cv_func_socketpair="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_socketpair="no"
fi
])
dnl CURL_CHECK_FUNC_STRCASECMP
dnl -------------------------------------------------
dnl Verify if strcasecmp is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_strcasecmp, then
dnl HAVE_STRCASECMP will be defined.
AC_DEFUN([CURL_CHECK_FUNC_STRCASECMP], [
AC_REQUIRE([CURL_INCLUDES_STRING])dnl
#
tst_links_strcasecmp="unknown"
tst_proto_strcasecmp="unknown"
tst_compi_strcasecmp="unknown"
tst_allow_strcasecmp="unknown"
#
AC_MSG_CHECKING([if strcasecmp can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([strcasecmp])
],[
AC_MSG_RESULT([yes])
tst_links_strcasecmp="yes"
],[
AC_MSG_RESULT([no])
tst_links_strcasecmp="no"
])
#
if test "$tst_links_strcasecmp" = "yes"; then
AC_MSG_CHECKING([if strcasecmp is prototyped])
AC_EGREP_CPP([strcasecmp],[
$curl_includes_string
],[
AC_MSG_RESULT([yes])
tst_proto_strcasecmp="yes"
],[
AC_MSG_RESULT([no])
tst_proto_strcasecmp="no"
])
fi
#
if test "$tst_proto_strcasecmp" = "yes"; then
AC_MSG_CHECKING([if strcasecmp is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_string
]],[[
if(0 != strcasecmp(0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_strcasecmp="yes"
],[
AC_MSG_RESULT([no])
tst_compi_strcasecmp="no"
])
fi
#
if test "$tst_compi_strcasecmp" = "yes"; then
AC_MSG_CHECKING([if strcasecmp usage allowed])
if test "x$curl_disallow_strcasecmp" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_strcasecmp="yes"
else
AC_MSG_RESULT([no])
tst_allow_strcasecmp="no"
fi
fi
#
AC_MSG_CHECKING([if strcasecmp might be used])
if test "$tst_links_strcasecmp" = "yes" &&
test "$tst_proto_strcasecmp" = "yes" &&
test "$tst_compi_strcasecmp" = "yes" &&
test "$tst_allow_strcasecmp" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_STRCASECMP, 1,
[Define to 1 if you have the strcasecmp function.])
curl_cv_func_strcasecmp="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_strcasecmp="no"
fi
])
dnl CURL_CHECK_FUNC_STRCMPI
dnl -------------------------------------------------
dnl Verify if strcmpi is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_strcmpi, then
dnl HAVE_STRCMPI will be defined.
AC_DEFUN([CURL_CHECK_FUNC_STRCMPI], [
AC_REQUIRE([CURL_INCLUDES_STRING])dnl
#
tst_links_strcmpi="unknown"
tst_proto_strcmpi="unknown"
tst_compi_strcmpi="unknown"
tst_allow_strcmpi="unknown"
#
AC_MSG_CHECKING([if strcmpi can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([strcmpi])
],[
AC_MSG_RESULT([yes])
tst_links_strcmpi="yes"
],[
AC_MSG_RESULT([no])
tst_links_strcmpi="no"
])
#
if test "$tst_links_strcmpi" = "yes"; then
AC_MSG_CHECKING([if strcmpi is prototyped])
AC_EGREP_CPP([strcmpi],[
$curl_includes_string
],[
AC_MSG_RESULT([yes])
tst_proto_strcmpi="yes"
],[
AC_MSG_RESULT([no])
tst_proto_strcmpi="no"
])
fi
#
if test "$tst_proto_strcmpi" = "yes"; then
AC_MSG_CHECKING([if strcmpi is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_string
]],[[
if(0 != strcmpi(0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_strcmpi="yes"
],[
AC_MSG_RESULT([no])
tst_compi_strcmpi="no"
])
fi
#
if test "$tst_compi_strcmpi" = "yes"; then
AC_MSG_CHECKING([if strcmpi usage allowed])
if test "x$curl_disallow_strcmpi" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_strcmpi="yes"
else
AC_MSG_RESULT([no])
tst_allow_strcmpi="no"
fi
fi
#
AC_MSG_CHECKING([if strcmpi might be used])
if test "$tst_links_strcmpi" = "yes" &&
test "$tst_proto_strcmpi" = "yes" &&
test "$tst_compi_strcmpi" = "yes" &&
test "$tst_allow_strcmpi" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_STRCMPI, 1,
[Define to 1 if you have the strcmpi function.])
curl_cv_func_strcmpi="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_strcmpi="no"
fi
])
dnl CURL_CHECK_FUNC_STRDUP
dnl -------------------------------------------------
dnl Verify if strdup is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_strdup, then
dnl HAVE_STRDUP will be defined.
AC_DEFUN([CURL_CHECK_FUNC_STRDUP], [
AC_REQUIRE([CURL_INCLUDES_STRING])dnl
#
tst_links_strdup="unknown"
tst_proto_strdup="unknown"
tst_compi_strdup="unknown"
tst_allow_strdup="unknown"
#
AC_MSG_CHECKING([if strdup can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([strdup])
],[
AC_MSG_RESULT([yes])
tst_links_strdup="yes"
],[
AC_MSG_RESULT([no])
tst_links_strdup="no"
])
#
if test "$tst_links_strdup" = "yes"; then
AC_MSG_CHECKING([if strdup is prototyped])
AC_EGREP_CPP([strdup],[
$curl_includes_string
],[
AC_MSG_RESULT([yes])
tst_proto_strdup="yes"
],[
AC_MSG_RESULT([no])
tst_proto_strdup="no"
])
fi
#
if test "$tst_proto_strdup" = "yes"; then
AC_MSG_CHECKING([if strdup is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_string
]],[[
if(0 != strdup(0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_strdup="yes"
],[
AC_MSG_RESULT([no])
tst_compi_strdup="no"
])
fi
#
if test "$tst_compi_strdup" = "yes"; then
AC_MSG_CHECKING([if strdup usage allowed])
if test "x$curl_disallow_strdup" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_strdup="yes"
else
AC_MSG_RESULT([no])
tst_allow_strdup="no"
fi
fi
#
AC_MSG_CHECKING([if strdup might be used])
if test "$tst_links_strdup" = "yes" &&
test "$tst_proto_strdup" = "yes" &&
test "$tst_compi_strdup" = "yes" &&
test "$tst_allow_strdup" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_STRDUP, 1,
[Define to 1 if you have the strdup function.])
curl_cv_func_strdup="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_strdup="no"
fi
])
dnl CURL_CHECK_FUNC_STRERROR_R
dnl -------------------------------------------------
dnl Verify if strerror_r is available, prototyped, can be compiled and
dnl seems to work. If all of these are true, and usage has not been
dnl previously disallowed with shell variable curl_disallow_strerror_r,
dnl then HAVE_STRERROR_R will be defined, as well as one of
dnl HAVE_GLIBC_STRERROR_R or HAVE_POSIX_STRERROR_R.
dnl
dnl glibc-style strerror_r:
dnl
dnl char *strerror_r(int errnum, char *workbuf, size_t bufsize);
dnl
dnl glibc-style strerror_r returns a pointer to the error string,
dnl and might use the provided workbuf as a scratch area if needed. A
dnl quick test on a few systems shows that it's usually not used at all.
dnl
dnl POSIX-style strerror_r:
dnl
dnl int strerror_r(int errnum, char *resultbuf, size_t bufsize);
dnl
dnl POSIX-style strerror_r returns 0 upon successful completion and the
dnl error string in the provided resultbuf.
dnl
AC_DEFUN([CURL_CHECK_FUNC_STRERROR_R], [
AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
AC_REQUIRE([CURL_INCLUDES_STRING])dnl
#
tst_links_strerror_r="unknown"
tst_proto_strerror_r="unknown"
tst_compi_strerror_r="unknown"
tst_glibc_strerror_r="unknown"
tst_posix_strerror_r="unknown"
tst_allow_strerror_r="unknown"
tst_works_glibc_strerror_r="unknown"
tst_works_posix_strerror_r="unknown"
tst_glibc_strerror_r_type_arg3="unknown"
tst_posix_strerror_r_type_arg3="unknown"
#
AC_MSG_CHECKING([if strerror_r can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([strerror_r])
],[
AC_MSG_RESULT([yes])
tst_links_strerror_r="yes"
],[
AC_MSG_RESULT([no])
tst_links_strerror_r="no"
])
#
if test "$tst_links_strerror_r" = "yes"; then
AC_MSG_CHECKING([if strerror_r is prototyped])
AC_EGREP_CPP([strerror_r],[
$curl_includes_string
],[
AC_MSG_RESULT([yes])
tst_proto_strerror_r="yes"
],[
AC_MSG_RESULT([no])
tst_proto_strerror_r="no"
])
fi
#
if test "$tst_proto_strerror_r" = "yes"; then
AC_MSG_CHECKING([if strerror_r is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_string
]],[[
if(0 != strerror_r(0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_strerror_r="yes"
],[
AC_MSG_RESULT([no])
tst_compi_strerror_r="no"
])
fi
#
if test "$tst_compi_strerror_r" = "yes"; then
AC_MSG_CHECKING([if strerror_r is glibc like])
tst_glibc_strerror_r_type_arg3="unknown"
for arg3 in 'size_t' 'int' 'unsigned int'; do
if test "$tst_glibc_strerror_r_type_arg3" = "unknown"; then
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_string
char *strerror_r(int errnum, char *workbuf, $arg3 bufsize);
]],[[
if(0 != strerror_r(0, 0, 0))
return 1;
]])
],[
tst_glibc_strerror_r_type_arg3="$arg3"
])
fi
done
case "$tst_glibc_strerror_r_type_arg3" in
unknown)
AC_MSG_RESULT([no])
tst_glibc_strerror_r="no"
;;
*)
AC_MSG_RESULT([yes])
tst_glibc_strerror_r="yes"
;;
esac
fi
#
dnl only do runtime verification when not cross-compiling
if test "x$cross_compiling" != "xyes" &&
test "$tst_glibc_strerror_r" = "yes"; then
AC_MSG_CHECKING([if strerror_r seems to work])
CURL_RUN_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_stdlib
$curl_includes_string
# include <errno.h>
]],[[
char buffer[1024];
char *string = 0;
buffer[0] = '\0';
string = strerror_r(EACCES, buffer, sizeof(buffer));
if(!string)
exit(1); /* fail */
if(!string[0])
exit(1); /* fail */
else
exit(0);
]])
],[
AC_MSG_RESULT([yes])
tst_works_glibc_strerror_r="yes"
],[
AC_MSG_RESULT([no])
tst_works_glibc_strerror_r="no"
])
fi
#
if test "$tst_compi_strerror_r" = "yes" &&
test "$tst_works_glibc_strerror_r" != "yes"; then
AC_MSG_CHECKING([if strerror_r is POSIX like])
tst_posix_strerror_r_type_arg3="unknown"
for arg3 in 'size_t' 'int' 'unsigned int'; do
if test "$tst_posix_strerror_r_type_arg3" = "unknown"; then
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_string
int strerror_r(int errnum, char *resultbuf, $arg3 bufsize);
]],[[
if(0 != strerror_r(0, 0, 0))
return 1;
]])
],[
tst_posix_strerror_r_type_arg3="$arg3"
])
fi
done
case "$tst_posix_strerror_r_type_arg3" in
unknown)
AC_MSG_RESULT([no])
tst_posix_strerror_r="no"
;;
*)
AC_MSG_RESULT([yes])
tst_posix_strerror_r="yes"
;;
esac
fi
#
dnl only do runtime verification when not cross-compiling
if test "x$cross_compiling" != "xyes" &&
test "$tst_posix_strerror_r" = "yes"; then
AC_MSG_CHECKING([if strerror_r seems to work])
CURL_RUN_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_stdlib
$curl_includes_string
# include <errno.h>
]],[[
char buffer[1024];
int error = 1;
buffer[0] = '\0';
error = strerror_r(EACCES, buffer, sizeof(buffer));
if(error)
exit(1); /* fail */
if(buffer[0] == '\0')
exit(1); /* fail */
else
exit(0);
]])
],[
AC_MSG_RESULT([yes])
tst_works_posix_strerror_r="yes"
],[
AC_MSG_RESULT([no])
tst_works_posix_strerror_r="no"
])
fi
#
if test "$tst_works_glibc_strerror_r" = "yes"; then
tst_posix_strerror_r="no"
fi
if test "$tst_works_posix_strerror_r" = "yes"; then
tst_glibc_strerror_r="no"
fi
if test "$tst_glibc_strerror_r" = "yes" &&
test "$tst_works_glibc_strerror_r" != "no" &&
test "$tst_posix_strerror_r" != "yes"; then
tst_allow_strerror_r="check"
fi
if test "$tst_posix_strerror_r" = "yes" &&
test "$tst_works_posix_strerror_r" != "no" &&
test "$tst_glibc_strerror_r" != "yes"; then
tst_allow_strerror_r="check"
fi
if test "$tst_allow_strerror_r" = "check"; then
AC_MSG_CHECKING([if strerror_r usage allowed])
if test "x$curl_disallow_strerror_r" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_strerror_r="yes"
else
AC_MSG_RESULT([no])
tst_allow_strerror_r="no"
fi
fi
#
AC_MSG_CHECKING([if strerror_r might be used])
if test "$tst_links_strerror_r" = "yes" &&
test "$tst_proto_strerror_r" = "yes" &&
test "$tst_compi_strerror_r" = "yes" &&
test "$tst_allow_strerror_r" = "yes"; then
AC_MSG_RESULT([yes])
if test "$tst_glibc_strerror_r" = "yes"; then
AC_DEFINE_UNQUOTED(HAVE_STRERROR_R, 1,
[Define to 1 if you have the strerror_r function.])
AC_DEFINE_UNQUOTED(HAVE_GLIBC_STRERROR_R, 1,
[Define to 1 if you have a working glibc-style strerror_r function.])
fi
if test "$tst_posix_strerror_r" = "yes"; then
AC_DEFINE_UNQUOTED(HAVE_STRERROR_R, 1,
[Define to 1 if you have the strerror_r function.])
AC_DEFINE_UNQUOTED(HAVE_POSIX_STRERROR_R, 1,
[Define to 1 if you have a working POSIX-style strerror_r function.])
fi
curl_cv_func_strerror_r="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_strerror_r="no"
fi
#
if test "$tst_compi_strerror_r" = "yes" &&
test "$tst_allow_strerror_r" = "unknown"; then
AC_MSG_WARN([cannot determine strerror_r() style: edit lib/curl_config.h manually.])
fi
#
])
dnl CURL_CHECK_FUNC_STRICMP
dnl -------------------------------------------------
dnl Verify if stricmp is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_stricmp, then
dnl HAVE_STRICMP will be defined.
AC_DEFUN([CURL_CHECK_FUNC_STRICMP], [
AC_REQUIRE([CURL_INCLUDES_STRING])dnl
#
tst_links_stricmp="unknown"
tst_proto_stricmp="unknown"
tst_compi_stricmp="unknown"
tst_allow_stricmp="unknown"
#
AC_MSG_CHECKING([if stricmp can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([stricmp])
],[
AC_MSG_RESULT([yes])
tst_links_stricmp="yes"
],[
AC_MSG_RESULT([no])
tst_links_stricmp="no"
])
#
if test "$tst_links_stricmp" = "yes"; then
AC_MSG_CHECKING([if stricmp is prototyped])
AC_EGREP_CPP([stricmp],[
$curl_includes_string
],[
AC_MSG_RESULT([yes])
tst_proto_stricmp="yes"
],[
AC_MSG_RESULT([no])
tst_proto_stricmp="no"
])
fi
#
if test "$tst_proto_stricmp" = "yes"; then
AC_MSG_CHECKING([if stricmp is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_string
]],[[
if(0 != stricmp(0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_stricmp="yes"
],[
AC_MSG_RESULT([no])
tst_compi_stricmp="no"
])
fi
#
if test "$tst_compi_stricmp" = "yes"; then
AC_MSG_CHECKING([if stricmp usage allowed])
if test "x$curl_disallow_stricmp" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_stricmp="yes"
else
AC_MSG_RESULT([no])
tst_allow_stricmp="no"
fi
fi
#
AC_MSG_CHECKING([if stricmp might be used])
if test "$tst_links_stricmp" = "yes" &&
test "$tst_proto_stricmp" = "yes" &&
test "$tst_compi_stricmp" = "yes" &&
test "$tst_allow_stricmp" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_STRICMP, 1,
[Define to 1 if you have the stricmp function.])
curl_cv_func_stricmp="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_stricmp="no"
fi
])
dnl CURL_CHECK_FUNC_STRTOK_R
dnl -------------------------------------------------
dnl Verify if strtok_r is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_strtok_r, then
dnl HAVE_STRTOK_R will be defined.
AC_DEFUN([CURL_CHECK_FUNC_STRTOK_R], [
AC_REQUIRE([CURL_INCLUDES_STRING])dnl
#
tst_links_strtok_r="unknown"
tst_proto_strtok_r="unknown"
tst_compi_strtok_r="unknown"
tst_allow_strtok_r="unknown"
#
AC_MSG_CHECKING([if strtok_r can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([strtok_r])
],[
AC_MSG_RESULT([yes])
tst_links_strtok_r="yes"
],[
AC_MSG_RESULT([no])
tst_links_strtok_r="no"
])
#
if test "$tst_links_strtok_r" = "yes"; then
AC_MSG_CHECKING([if strtok_r is prototyped])
AC_EGREP_CPP([strtok_r],[
$curl_includes_string
],[
AC_MSG_RESULT([yes])
tst_proto_strtok_r="yes"
],[
AC_MSG_RESULT([no])
tst_proto_strtok_r="no"
])
fi
#
if test "$tst_proto_strtok_r" = "yes"; then
AC_MSG_CHECKING([if strtok_r is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_string
]],[[
if(0 != strtok_r(0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_strtok_r="yes"
],[
AC_MSG_RESULT([no])
tst_compi_strtok_r="no"
])
fi
#
if test "$tst_compi_strtok_r" = "yes"; then
AC_MSG_CHECKING([if strtok_r usage allowed])
if test "x$curl_disallow_strtok_r" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_strtok_r="yes"
else
AC_MSG_RESULT([no])
tst_allow_strtok_r="no"
fi
fi
#
AC_MSG_CHECKING([if strtok_r might be used])
if test "$tst_links_strtok_r" = "yes" &&
test "$tst_proto_strtok_r" = "yes" &&
test "$tst_compi_strtok_r" = "yes" &&
test "$tst_allow_strtok_r" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_STRTOK_R, 1,
[Define to 1 if you have the strtok_r function.])
curl_cv_func_strtok_r="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_strtok_r="no"
fi
])
dnl CURL_CHECK_FUNC_STRTOLL
dnl -------------------------------------------------
dnl Verify if strtoll is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_strtoll, then
dnl HAVE_STRTOLL will be defined.
AC_DEFUN([CURL_CHECK_FUNC_STRTOLL], [
AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
#
tst_links_strtoll="unknown"
tst_proto_strtoll="unknown"
tst_compi_strtoll="unknown"
tst_allow_strtoll="unknown"
#
AC_MSG_CHECKING([if strtoll can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([strtoll])
],[
AC_MSG_RESULT([yes])
tst_links_strtoll="yes"
],[
AC_MSG_RESULT([no])
tst_links_strtoll="no"
])
#
if test "$tst_links_strtoll" = "yes"; then
AC_MSG_CHECKING([if strtoll is prototyped])
AC_EGREP_CPP([strtoll],[
$curl_includes_stdlib
],[
AC_MSG_RESULT([yes])
tst_proto_strtoll="yes"
],[
AC_MSG_RESULT([no])
tst_proto_strtoll="no"
])
fi
#
if test "$tst_proto_strtoll" = "yes"; then
AC_MSG_CHECKING([if strtoll is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_stdlib
]],[[
if(0 != strtoll(0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_strtoll="yes"
],[
AC_MSG_RESULT([no])
tst_compi_strtoll="no"
])
fi
#
if test "$tst_compi_strtoll" = "yes"; then
AC_MSG_CHECKING([if strtoll usage allowed])
if test "x$curl_disallow_strtoll" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_strtoll="yes"
else
AC_MSG_RESULT([no])
tst_allow_strtoll="no"
fi
fi
#
AC_MSG_CHECKING([if strtoll might be used])
if test "$tst_links_strtoll" = "yes" &&
test "$tst_proto_strtoll" = "yes" &&
test "$tst_compi_strtoll" = "yes" &&
test "$tst_allow_strtoll" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_STRTOLL, 1,
[Define to 1 if you have the strtoll function.])
curl_cv_func_strtoll="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_strtoll="no"
fi
])
dnl CURL_RUN_IFELSE
dnl -------------------------------------------------
dnl Wrapper macro to use instead of AC_RUN_IFELSE. It
dnl sets LD_LIBRARY_PATH locally for this run only, from the
dnl CURL_LIBRARY_PATH variable. It keeps the LD_LIBRARY_PATH
dnl changes contained within this macro.
AC_DEFUN([CURL_RUN_IFELSE], [
case $host in
*-apple-*)
AC_RUN_IFELSE([AC_LANG_SOURCE([$1])], $2, $3, $4)
;;
*)
oldcc=$CC
old=$LD_LIBRARY_PATH
CC="sh ./run-compiler"
LD_LIBRARY_PATH=$CURL_LIBRARY_PATH:$old
export LD_LIBRARY_PATH
AC_RUN_IFELSE([AC_LANG_SOURCE([$1])], $2, $3, $4)
LD_LIBRARY_PATH=$old # restore
CC=$oldcc
;;
esac
])
dnl CURL_COVERAGE
dnl --------------------------------------------------
dnl Switch on options and libs to build with gcc's code coverage.
dnl
AC_DEFUN([CURL_COVERAGE],[
AC_REQUIRE([AC_PROG_SED])
AC_REQUIRE([AC_ARG_ENABLE])
AC_MSG_CHECKING([for code coverage support])
coverage="no"
curl_coverage_msg="disabled"
dnl check if enabled by argument
AC_ARG_ENABLE(code-coverage,
AS_HELP_STRING([--enable-code-coverage], [Provide code coverage]),
coverage="$enableval")
dnl if not gcc switch off again
AS_IF([ test "$GCC" != "yes" ], coverage="no" )
AC_MSG_RESULT($coverage)
if test "x$coverage" = "xyes"; then
curl_coverage_msg="enabled"
AC_CHECK_TOOL([GCOV], [gcov], [gcov])
if test -z "$GCOV"; then
AC_MSG_ERROR([needs gcov for code coverage])
fi
AC_CHECK_PROG([LCOV], [lcov], [lcov])
if test -z "$LCOV"; then
AC_MSG_ERROR([needs lcov for code coverage])
fi
CPPFLAGS="$CPPFLAGS -DNDEBUG"
CFLAGS="$CFLAGS -O0 -g -fprofile-arcs -ftest-coverage"
LIBS="$LIBS -lgcov"
fi
])
dnl CURL_ATOMIC
dnl -------------------------------------------------------------
dnl Check if _Atomic works. But only check if stdatomic.h exists.
dnl
AC_DEFUN([CURL_ATOMIC],[
AC_CHECK_HEADERS(stdatomic.h, [
AC_MSG_CHECKING([if _Atomic is available])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_unistd
]],[[
_Atomic int i = 0;
i = 4; // Force an atomic-write operation.
]])
],[
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_ATOMIC, 1,
[Define to 1 if you have _Atomic support.])
tst_atomic="yes"
],[
AC_MSG_RESULT([no])
tst_atomic="no"
])
])
])
# Rewrite inspired by the functionality once provided by
# AX_COMPILE_CHECK_SIZEOF. Uses the switch() "trick" to find the size of the
# given type.
#
# This code fails to compile:
#
# switch() { case 0: case 0: }
#
# By making the second case number a boolean check, it fails to compile the
# test code when the boolean is false and thus creating a zero, making it a
# duplicated case label. If the boolean equals true, it becomes a one, the
# code compiles and we know it was a match.
#
# The check iterates over all possible sizes and stops as soon it compiles
# error-free.
#
# Usage:
#
# CURL_SIZEOF(TYPE, [HEADERS])
#
AC_DEFUN([CURL_SIZEOF], [
dnl The #define name to make autoheader put the name in curl_config.h.in
define(TYPE, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
AC_MSG_CHECKING(size of $1)
r=0
dnl Check the sizes in a reasonable order
for typesize in 8 4 2 16 1; do
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
$2
]],
[switch(0) {
case 0:
case (sizeof($1) == $typesize):;
}
]) ],
[
r=$typesize],
[
r=0])
dnl get out of the loop once matched
if test $r -gt 0; then
break;
fi
done
if test $r -eq 0; then
AC_MSG_ERROR([Failed to find size of $1])
fi
AC_MSG_RESULT($r)
dnl lowercase and underscore instead of space
tname=`echo "ac_cv_sizeof_$1" | tr A-Z a-z | tr " " "_"`
eval "$tname=$r"
AC_DEFINE_UNQUOTED(TYPE, [$r], [Size of $1 in number of bytes])
])
|