3 dnl CURL_CHECK_HEADER_WINDOWS
4 dnl -------------------------------------------------
5 dnl Check for compilable and valid windows.h header
7 AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [
8 AC_CACHE_CHECK([for windows.h], [ac_cv_header_windows_h], [
12 #ifndef WIN32_LEAN_AND_MEAN
13 #define WIN32_LEAN_AND_MEAN
20 ac_cv_header_windows_h="yes"
22 ac_cv_header_windows_h="no"
25 if test "x$ac_cv_header_windows_h" = "xyes"; then
26 AC_DEFINE_UNQUOTED(HAVE_WINDOWS_H, 1,
27 [Define to 1 if you have the windows.h header file.])
28 AC_DEFINE_UNQUOTED(WIN32_LEAN_AND_MEAN, 1,
29 [Define to avoid automatic inclusion of winsock.h])
34 dnl CURL_CHECK_HEADER_WINSOCK
35 dnl -------------------------------------------------
36 dnl Check for compilable and valid winsock.h header
38 AC_DEFUN([CURL_CHECK_HEADER_WINSOCK], [
39 AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
40 AC_CACHE_CHECK([for winsock.h], [ac_cv_header_winsock_h], [
44 #ifndef WIN32_LEAN_AND_MEAN
45 #define WIN32_LEAN_AND_MEAN
50 int dummy=WSACleanup();
53 ac_cv_header_winsock_h="yes"
55 ac_cv_header_winsock_h="no"
58 if test "x$ac_cv_header_winsock_h" = "xyes"; then
59 AC_DEFINE_UNQUOTED(HAVE_WINSOCK_H, 1,
60 [Define to 1 if you have the winsock.h header file.])
65 dnl CURL_CHECK_HEADER_WINSOCK2
66 dnl -------------------------------------------------
67 dnl Check for compilable and valid winsock2.h header
69 AC_DEFUN([CURL_CHECK_HEADER_WINSOCK2], [
70 AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
71 AC_CACHE_CHECK([for winsock2.h], [ac_cv_header_winsock2_h], [
75 #ifndef WIN32_LEAN_AND_MEAN
76 #define WIN32_LEAN_AND_MEAN
81 int dummy=2*IPPROTO_ESP;
84 ac_cv_header_winsock2_h="yes"
86 ac_cv_header_winsock2_h="no"
89 if test "x$ac_cv_header_winsock2_h" = "xyes"; then
90 AC_DEFINE_UNQUOTED(HAVE_WINSOCK2_H, 1,
91 [Define to 1 if you have the winsock2.h header file.])
96 dnl CURL_CHECK_HEADER_WS2TCPIP
97 dnl -------------------------------------------------
98 dnl Check for compilable and valid ws2tcpip.h header
100 AC_DEFUN([CURL_CHECK_HEADER_WS2TCPIP], [
101 AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
102 AC_CACHE_CHECK([for ws2tcpip.h], [ac_cv_header_ws2tcpip_h], [
106 #ifndef WIN32_LEAN_AND_MEAN
107 #define WIN32_LEAN_AND_MEAN
110 #include <winsock2.h>
111 #include <ws2tcpip.h>
113 int dummy=2*IP_PKTINFO;
116 ac_cv_header_ws2tcpip_h="yes"
118 ac_cv_header_ws2tcpip_h="no"
121 if test "x$ac_cv_header_ws2tcpip_h" = "xyes"; then
122 AC_DEFINE_UNQUOTED(HAVE_WS2TCPIP_H, 1,
123 [Define to 1 if you have the ws2tcpip.h header file.])
128 dnl CURL_CHECK_TYPE_SOCKLEN_T
129 dnl -------------------------------------------------
130 dnl Check for existing socklen_t type, and provide
131 dnl an equivalent type if socklen_t not available
133 AC_DEFUN([CURL_CHECK_TYPE_SOCKLEN_T], [
134 AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl
135 AC_CHECK_TYPE([socklen_t], ,[
136 AC_CACHE_CHECK([for socklen_t equivalent],
137 [curl_cv_socklen_t_equiv], [
138 curl_cv_socklen_t_equiv="unknown"
139 for arg2 in "struct sockaddr" void; do
140 for t in int size_t unsigned long "unsigned long"; do
144 #ifdef HAVE_WINDOWS_H
145 #ifndef WIN32_LEAN_AND_MEAN
146 #define WIN32_LEAN_AND_MEAN
149 #ifdef HAVE_WINSOCK2_H
150 #include <winsock2.h>
152 #ifdef HAVE_WINSOCK_H
157 #ifdef HAVE_SYS_TYPES_H
158 #include <sys/types.h>
160 #ifdef HAVE_SYS_SOCKET_H
161 #include <sys/socket.h>
164 int getpeername (int, $arg2 *, $t *);
167 getpeername(0,0,&len);
170 curl_cv_socklen_t_equiv="$t"
176 if test "$curl_cv_socklen_t_equiv" = "unknown"; then
177 AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
179 AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv,
180 [type to use in place of socklen_t if not defined])
184 #ifdef HAVE_WINDOWS_H
185 #ifndef WIN32_LEAN_AND_MEAN
186 #define WIN32_LEAN_AND_MEAN
189 #ifdef HAVE_WINSOCK2_H
190 #include <winsock2.h>
191 #ifdef HAVE_WS2TCPIP_H
192 #include <ws2tcpip.h>
196 #ifdef HAVE_SYS_TYPES_H
197 #include <sys/types.h>
199 #ifdef HAVE_SYS_SOCKET_H
200 #include <sys/socket.h>
207 dnl CURL_CHECK_FUNC_GETNAMEINFO
208 dnl -------------------------------------------------
209 dnl Test if the getnameinfo function is available,
210 dnl and check the types of five of its arguments.
211 dnl If the function succeeds HAVE_GETNAMEINFO will be
212 dnl defined, defining the types of the arguments in
213 dnl GETNAMEINFO_TYPE_ARG1, GETNAMEINFO_TYPE_ARG2,
214 dnl GETNAMEINFO_TYPE_ARG46 and GETNAMEINFO_TYPE_ARG7,
215 dnl and also defining the type qualifier of first
216 dnl argument in GETNAMEINFO_QUAL_ARG1.
218 AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [
219 AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl
220 AC_REQUIRE([CURL_CHECK_TYPE_SOCKLEN_T])dnl
221 AC_CHECK_HEADERS(sys/types.h sys/socket.h netdb.h)
223 AC_MSG_CHECKING([for getnameinfo])
225 AC_LANG_FUNC_LINK_TRY([getnameinfo])
228 curl_cv_getnameinfo="yes"
231 curl_cv_getnameinfo="no"
234 if test "$curl_cv_getnameinfo" != "yes"; then
235 AC_MSG_CHECKING([deeper for getnameinfo])
241 curl_cv_getnameinfo="yes"
243 AC_MSG_RESULT([but still no])
244 curl_cv_getnameinfo="no"
248 if test "$curl_cv_getnameinfo" != "yes"; then
249 AC_MSG_CHECKING([deeper and deeper for getnameinfo])
252 #ifdef HAVE_WINDOWS_H
253 #ifndef WIN32_LEAN_AND_MEAN
254 #define WIN32_LEAN_AND_MEAN
257 #ifdef HAVE_WINSOCK2_H
258 #include <winsock2.h>
259 #ifdef HAVE_WS2TCPIP_H
260 #include <ws2tcpip.h>
264 #ifdef HAVE_SYS_TYPES_H
265 #include <sys/types.h>
267 #ifdef HAVE_SYS_SOCKET_H
268 #include <sys/socket.h>
275 getnameinfo(0, 0, 0, 0, 0, 0, 0);
278 curl_cv_getnameinfo="yes"
280 AC_MSG_RESULT([but still no])
281 curl_cv_getnameinfo="no"
285 if test "$curl_cv_getnameinfo" = "yes"; then
286 AC_CACHE_CHECK([types of arguments for getnameinfo],
287 [curl_cv_func_getnameinfo_args], [
288 curl_cv_func_getnameinfo_args="unknown"
289 for gni_arg1 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
290 for gni_arg2 in 'socklen_t' 'size_t' 'int'; do
291 for gni_arg46 in 'size_t' 'int' 'socklen_t' 'unsigned int' 'DWORD'; do
292 for gni_arg7 in 'int' 'unsigned int'; do
296 #ifdef HAVE_WINDOWS_H
297 #ifndef WIN32_LEAN_AND_MEAN
298 #define WIN32_LEAN_AND_MEAN
300 #if (!defined(_WIN32_WINNT)) || (_WIN32_WINNT < 0x0501)
302 #define _WIN32_WINNT 0x0501
305 #ifdef HAVE_WINSOCK2_H
306 #include <winsock2.h>
307 #ifdef HAVE_WS2TCPIP_H
308 #include <ws2tcpip.h>
311 #define GNICALLCONV WSAAPI
313 #ifdef HAVE_SYS_TYPES_H
314 #include <sys/types.h>
316 #ifdef HAVE_SYS_SOCKET_H
317 #include <sys/socket.h>
324 extern int GNICALLCONV getnameinfo($gni_arg1, $gni_arg2,
330 $gni_arg46 hostlen=0;
331 $gni_arg46 servlen=0;
333 int res = getnameinfo(0, salen, 0, hostlen, 0, servlen, flags);
336 curl_cv_func_getnameinfo_args="$gni_arg1,$gni_arg2,$gni_arg46,$gni_arg7"
344 if test "$curl_cv_func_getnameinfo_args" = "unknown"; then
345 AC_MSG_WARN([Cannot find proper types to use for getnameinfo args])
346 AC_MSG_WARN([HAVE_GETNAMEINFO will not be defined])
348 gni_prev_IFS=$IFS; IFS=','
349 set dummy `echo "$curl_cv_func_getnameinfo_args" | sed 's/\*/\*/g'`
353 gni_qual_type_arg1=$[1]
355 AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG2, $[2],
356 [Define to the type of arg 2 for getnameinfo.])
357 AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG46, $[3],
358 [Define to the type of args 4 and 6 for getnameinfo.])
359 AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG7, $[4],
360 [Define to the type of arg 7 for getnameinfo.])
373 case "$gni_qual_type_arg1" in
376 gni_type_arg1=`echo $gni_qual_type_arg1 | sed 's/^const //'`
380 gni_type_arg1=$gni_qual_type_arg1
384 AC_DEFINE_UNQUOTED(GETNAMEINFO_QUAL_ARG1, $gni_qual_arg1,
385 [Define to the type qualifier of arg 1 for getnameinfo.])
386 AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG1, $gni_type_arg1,
387 [Define to the type of arg 1 for getnameinfo.])
398 AC_DEFINE_UNQUOTED(HAVE_GETNAMEINFO, 1,
399 [Define to 1 if you have the getnameinfo function.])
400 ac_cv_func_getnameinfo="yes"
406 dnl CURL_CHECK_NONBLOCKING_SOCKET
407 dnl -------------------------------------------------
408 dnl Check for how to set a socket to non-blocking state. There seems to exist
409 dnl four known different ways, with the one used almost everywhere being POSIX
410 dnl and XPG3, while the other different ways for different systems (old BSD,
411 dnl Windows and Amiga).
413 dnl There are two known platforms (AIX 3.x and SunOS 4.1.x) where the
414 dnl O_NONBLOCK define is found but does not work. This condition is attempted
415 dnl to get caught in this script by using an excessive number of #ifdefs...
417 AC_DEFUN([CURL_CHECK_NONBLOCKING_SOCKET],
419 AC_MSG_CHECKING([non-blocking sockets style])
422 /* headers for O_NONBLOCK test */
423 #include <sys/types.h>
427 /* try to compile O_NONBLOCK */
429 #if defined(sun) || defined(__sun__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
430 # if defined(__SVR4) || defined(__srv4__)
431 # define PLATFORM_SOLARIS
433 # define PLATFORM_SUNOS4
436 #if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX4)
437 # define PLATFORM_AIX_V3
440 #if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) || defined(__BEOS__)
441 #error "O_NONBLOCK does not work on this platform"
444 int flags = fcntl(socket, F_SETFL, flags | O_NONBLOCK);
446 dnl the O_NONBLOCK test was fine
447 nonblock="O_NONBLOCK"
448 AC_DEFINE(HAVE_O_NONBLOCK, 1, [use O_NONBLOCK for non-blocking sockets])
450 dnl the code was bad, try a different program now, test 2
453 /* headers for FIONBIO test */
457 /* FIONBIO source test (old-style unix) */
459 int flags = ioctl(socket, FIONBIO, &flags);
461 dnl FIONBIO test was good
463 AC_DEFINE(HAVE_FIONBIO, 1, [use FIONBIO for non-blocking sockets])
465 dnl FIONBIO test was also bad
466 dnl the code was bad, try a different program now, test 3
469 /* headers for ioctlsocket test (Windows) */
471 #ifdef HAVE_WINDOWS_H
472 #ifndef WIN32_LEAN_AND_MEAN
473 #define WIN32_LEAN_AND_MEAN
476 #ifdef HAVE_WINSOCK2_H
477 #include <winsock2.h>
479 #ifdef HAVE_WINSOCK_H
485 /* ioctlsocket source code */
487 unsigned long flags = 0;
488 sd = socket(0, 0, 0);
489 ioctlsocket(sd, FIONBIO, &flags);
491 dnl ioctlsocket test was good
492 nonblock="ioctlsocket"
493 AC_DEFINE(HAVE_IOCTLSOCKET, 1, [use ioctlsocket() for non-blocking sockets])
495 dnl ioctlsocket didnt compile!, go to test 4
498 /* headers for IoctlSocket test (Amiga?) */
499 #include <sys/ioctl.h>
501 /* IoctlSocket source code */
503 int flags = IoctlSocket(socket, FIONBIO, (long)1);
505 dnl ioctlsocket test was good
506 nonblock="IoctlSocket"
507 AC_DEFINE(HAVE_IOCTLSOCKET_CASE, 1, [use Ioctlsocket() for non-blocking sockets])
509 dnl Ioctlsocket didnt compile, do test 5!
511 /* headers for SO_NONBLOCK test (BeOS) */
514 /* SO_NONBLOCK source code */
517 int flags = setsockopt(socket, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b));
519 dnl the SO_NONBLOCK test was good
520 nonblock="SO_NONBLOCK"
521 AC_DEFINE(HAVE_SO_NONBLOCK, 1, [use SO_NONBLOCK for non-blocking sockets])
523 dnl test 5 didnt compile!
525 AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1, [disabled non-blocking sockets])
527 dnl end of fifth test
530 dnl end of forth test
533 dnl end of third test
536 dnl end of second test
539 dnl end of non-blocking try-compile test
540 AC_MSG_RESULT($nonblock)
542 if test "$nonblock" = "nada"; then
543 AC_MSG_WARN([non-block sockets disabled])
548 dnl TYPE_SOCKADDR_STORAGE
549 dnl -------------------------------------------------
550 dnl Check for struct sockaddr_storage. Most IPv6-enabled hosts have it, but
551 dnl AIX 4.3 is one known exception.
552 AC_DEFUN([TYPE_SOCKADDR_STORAGE],
554 AC_CHECK_TYPE([struct sockaddr_storage],
555 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1,
556 [if struct sockaddr_storage is defined]), ,
559 #ifdef HAVE_WINDOWS_H
560 #ifndef WIN32_LEAN_AND_MEAN
561 #define WIN32_LEAN_AND_MEAN
564 #ifdef HAVE_WINSOCK2_H
565 #include <winsock2.h>
568 #ifdef HAVE_SYS_TYPES_H
569 #include <sys/types.h>
571 #ifdef HAVE_SYS_SOCKET_H
572 #include <sys/socket.h>
574 #ifdef HAVE_NETINET_IN_H
575 #include <netinet/in.h>
577 #ifdef HAVE_ARPA_INET_H
578 #include <arpa/inet.h>
586 dnl -------------------------------------------------
587 dnl Check for in_addr_t: it is used to receive the return code of inet_addr()
588 dnl and a few other things.
589 AC_DEFUN([TYPE_IN_ADDR_T],
591 AC_CHECK_TYPE([in_addr_t], ,[
592 AC_MSG_CHECKING([for in_addr_t equivalent])
593 AC_CACHE_VAL([curl_cv_in_addr_t_equiv],
595 curl_cv_in_addr_t_equiv=
596 for t in "unsigned long" int size_t unsigned long; do
599 #ifdef HAVE_WINDOWS_H
600 #ifndef WIN32_LEAN_AND_MEAN
601 #define WIN32_LEAN_AND_MEAN
604 #ifdef HAVE_WINSOCK2_H
605 #include <winsock2.h>
607 #ifdef HAVE_WINSOCK_H
612 #ifdef HAVE_SYS_TYPES_H
613 #include <sys/types.h>
615 #ifdef HAVE_SYS_SOCKET_H
616 #include <sys/socket.h>
618 #ifdef HAVE_NETINET_IN_H
619 #include <netinet/in.h>
621 #ifdef HAVE_ARPA_INET_H
622 #include <arpa/inet.h>
626 $t data = inet_addr ("1.2.3.4");
628 curl_cv_in_addr_t_equiv="$t"
633 if test "x$curl_cv_in_addr_t_equiv" = x; then
634 AC_MSG_ERROR([Cannot find a type to use in place of in_addr_t])
637 AC_MSG_RESULT($curl_cv_in_addr_t_equiv)
638 AC_DEFINE_UNQUOTED(in_addr_t, $curl_cv_in_addr_t_equiv,
639 [type to use in place of in_addr_t if not defined])],
642 #ifdef HAVE_WINDOWS_H
643 #ifndef WIN32_LEAN_AND_MEAN
644 #define WIN32_LEAN_AND_MEAN
647 #ifdef HAVE_WINSOCK2_H
648 #include <winsock2.h>
650 #ifdef HAVE_WINSOCK_H
655 #ifdef HAVE_SYS_TYPES_H
656 #include <sys/types.h>
658 #ifdef HAVE_SYS_SOCKET_H
659 #include <sys/socket.h>
661 #ifdef HAVE_NETINET_IN_H
662 #include <netinet/in.h>
664 #ifdef HAVE_ARPA_INET_H
665 #include <arpa/inet.h>
673 dnl We create a function for detecting which compiler we use and then set as
674 dnl pendantic compiler options as possible for that particular compiler. The
675 dnl options are only used for debug-builds.
677 dnl This is a copy of the original found in curl's configure script. Don't
678 dnl modify this one, edit the one in curl and copy it back here when that one
681 AC_DEFUN([CURL_CC_DEBUG_OPTS],
683 if test "$GCC" = "yes"; then
685 dnl figure out gcc version!
686 AC_MSG_CHECKING([gcc version])
687 gccver=`$CC -dumpversion`
688 num1=`echo $gccver | cut -d . -f1`
689 num2=`echo $gccver | cut -d . -f2`
690 gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
691 AC_MSG_RESULT($gccver)
693 AC_MSG_CHECKING([if this is icc in disguise])
694 AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
695 dnl action if the text is found, this it has not been replaced by the
699 dnl the text was not found, it was replaced by the cpp
704 if test "$ICC" = "yes"; then
705 dnl this is icc, not gcc.
707 dnl ICC warnings we ignore:
708 dnl * 279 warns on static conditions in while expressions
709 dnl * 269 warns on our "%Od" printf formatters for curl_off_t output:
710 dnl "invalid format string conversion"
714 if test "$gccnum" -gt "600"; then
715 dnl icc 6.0 and older doesn't have the -Wall flag
720 WARN="-W -Wall -Wwrite-strings -pedantic -Wno-long-long -Wundef -Wpointer-arith -Wnested-externs -Winline -Wmissing-declarations -Wmissing-prototypes -Wsign-compare"
722 dnl -Wcast-align is a bit too annoying ;-)
724 if test "$gccnum" -ge "296"; then
725 dnl gcc 2.96 or later
726 WARN="$WARN -Wfloat-equal"
728 if test "$gccnum" -gt "296"; then
729 dnl this option does not exist in 2.96
730 WARN="$WARN -Wno-format-nonliteral"
733 dnl -Wunreachable-code seems totally unreliable on my gcc 3.3.2 on
734 dnl on i686-Linux as it gives us heaps with false positives
735 if test "$gccnum" -ge "303"; then
736 dnl gcc 3.3 and later
737 WARN="$WARN -Wendif-labels -Wstrict-prototypes"
741 for flag in $CPPFLAGS; do
745 add=`echo $flag | sed 's/^-I/-isystem /g'`
753 CFLAGS="$CFLAGS $WARN"
757 dnl strip off optimizer flags
759 for flag in $CFLAGS; do
762 dnl echo "cut off $flag"
765 NEWFLAGS="$NEWFLAGS $flag"
771 ]) dnl end of AC_DEFUN()
774 dnl This macro determines if the specified struct exists in the specified file
776 dnl CARES_CHECK_STRUCT(headers, struct name, if found, [if not found])
778 AC_DEFUN([CARES_CHECK_STRUCT], [
779 AC_MSG_CHECKING([for struct $2])
782 struct $2 struct_instance;
783 ], ac_struct="yes", ac_found="no")
784 if test "$ac_struct" = "yes" ; then
793 dnl This macro determines if the specified constant exists in the specified file
795 dnl CARES_CHECK_CONSTANT(headers, constant name, if found, [if not found])
797 AC_DEFUN([CARES_CHECK_CONSTANT], [
798 AC_MSG_CHECKING([for $2])
799 AC_EGREP_CPP(VARIABLEWASDEFINED,
808 ], ac_constant="yes", ac_constant="no"
810 if test "$ac_constant" = "yes" ; then
820 dnl This macro determines how many parameters getservbyport_r takes
821 AC_DEFUN([CARES_CHECK_GETSERVBYPORT_R], [
822 AC_MSG_CHECKING([how many arguments getservbyport_r takes])
824 [#include <netdb.h>],
828 struct servent *p3, *p6;
829 getservbyport_r(p1, p2, p3, p4, p5, &p6);
830 ], ac_func_getservbyport_r=6,
832 [#include <netdb.h>],
837 getservbyport_r(p1, p2, p3, p4, p5);
838 ], ac_func_getservbyport_r=5,
840 [#include <netdb.h>],
845 struct servent_data p4;
846 getservbyport_r(p1, p2, p3, &p4);
847 ], ac_func_getservbyport_r=4, ac_func_getservbyport_r=0
851 if test $ac_func_getservbyport_r != "0" ; then
852 AC_MSG_RESULT($ac_func_getservbyport_r)
853 AC_DEFINE(HAVE_GETSERVBYPORT_R, 1, [Specifies whether getservbyport_r is present])
854 AC_DEFINE_UNQUOTED(GETSERVBYPORT_R_ARGS, $ac_func_getservbyport_r, [Specifies the number of arguments to
856 if test $ac_func_getservbyport_r = "4" ; then
857 AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, sizeof(struct servent_data), [Specifies the size of the buffer to pass to
860 AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, 4096, [Specifies the size of the buffer to pass to getservbyport_r])
863 AC_MSG_RESULT([not found])
867 # Prevent libtool for checking how to run C++ compiler and check for other
868 # tools we don't want to use. We do this by m4-defining the _LT_AC_TAGCONFIG
869 # variable to the code to run, as by default it uses a much more complicated
870 # approach. The code below that is actually added seems to be used for cases
871 # where configure has trouble figuring out what C compiler to use but where
872 # the installed libtool has an idea.
874 # This function is a re-implemented version of the Paolo Bonzini fix posted to
875 # the c-ares mailing list by Bram Matthys on May 6 2006. My version removes
876 # redundant code but also adds the LTCFLAGS check that wasn't in that patch.
878 # Some code in this function was extracted from the generated configure script.
880 # CARES_CLEAR_LIBTOOL_TAGS
881 AC_DEFUN([CARES_CLEAR_LIBTOOL_TAGS],
882 [m4_define([_LT_AC_TAGCONFIG], [
883 if test -f "$ltmain"; then
884 if test ! -f "${ofile}"; then
885 AC_MSG_WARN([output file `$ofile' does not exist])
888 if test -z "$LTCC"; then
889 eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
890 if test -z "$LTCC"; then
891 AC_MSG_WARN([output file `$ofile' does not look like a libtool
894 AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
897 if test -z "$LTCFLAGS"; then
898 eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"