aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-08-24 10:30:57 +0000
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-08-24 10:30:57 +0000
commitc3cd3a1c4660e96208fc5987056fc76d0a7e09e0 (patch)
treed5359df4b4a06d6508f013e3f3b62c101cd483b9
parentf588bc469e24d8634908e78c3dd84dfbc2c839d3 (diff)
downloadlibmicrohttpd-c3cd3a1c4660e96208fc5987056fc76d0a7e09e0.tar.gz
libmicrohttpd-c3cd3a1c4660e96208fc5987056fc76d0a7e09e0.zip
configure.ac: improved compatibility with various precompilers.
Precompiler directives must start from first character in line.
-rw-r--r--configure.ac89
1 files changed, 46 insertions, 43 deletions
diff --git a/configure.ac b/configure.ac
index 8414a710..6b62694d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -94,9 +94,9 @@ AC_CHECK_TYPE([_Bool],
94 [ AC_DEFINE([_MHD_bool],[bool]) ], 94 [ AC_DEFINE([_MHD_bool],[bool]) ],
95 [ AC_DEFINE([_MHD_bool],[int]) ], 95 [ AC_DEFINE([_MHD_bool],[int]) ],
96 [[ 96 [[
97 #ifdef HAVE_STDBOOL_H 97#ifdef HAVE_STDBOOL_H
98 #include <stdbool.h> 98#include <stdbool.h>
99 #endif 99#endif
100 ]]) 100 ]])
101 ]) 101 ])
102 102
@@ -111,12 +111,13 @@ for inln_prfx_chk in "inline __attribute__((always_inline))" __forceinline inlin
111 [ 111 [
112 AC_LANG_PROGRAM( 112 AC_LANG_PROGRAM(
113 [[ 113 [[
114 #ifdef __cplusplus 114#ifdef __cplusplus
115 choke me 115#error This test is only for C.
116 #endif 116choke me
117 #ifdef HAVE_STDBOOL_H 117#endif
118 #include <stdbool.h> 118#ifdef HAVE_STDBOOL_H
119 #endif 119#include <stdbool.h>
120#endif
120 static $inln_prfx_chk _MHD_bool cmpfn(int x, int y) 121 static $inln_prfx_chk _MHD_bool cmpfn(int x, int y)
121 { return x > y; } 122 { return x > y; }
122 static $inln_prfx_chk int sumfn(int x, int y) 123 static $inln_prfx_chk int sumfn(int x, int y)
@@ -559,15 +560,15 @@ AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
559 ], 560 ],
560 [], 561 [],
561 [ 562 [
562 #ifdef HAVE_SYS_TYPES_H 563#ifdef HAVE_SYS_TYPES_H
563 #include <sys/types.h> 564#include <sys/types.h>
564 #endif 565#endif
565 #ifdef HAVE_SYS_SOCKET_H 566#ifdef HAVE_SYS_SOCKET_H
566 #include <sys/socket.h> 567#include <sys/socket.h>
567 #endif 568#endif
568 #ifdef HAVE_NETINET_IN_H 569#ifdef HAVE_NETINET_IN_H
569 #include <netinet/in.h> 570#include <netinet/in.h>
570 #endif 571#endif
571 ]) 572 ])
572 573
573 574
@@ -585,12 +586,12 @@ AS_IF(
585 [ AC_MSG_RESULT([[yes, forced on W32]]) ], 586 [ AC_MSG_RESULT([[yes, forced on W32]]) ],
586 [ AC_LINK_IFELSE( 587 [ AC_LINK_IFELSE(
587 [ AC_LANG_PROGRAM([[ 588 [ AC_LANG_PROGRAM([[
588 #ifdef HAVE_SYS_TYPES_H 589#ifdef HAVE_SYS_TYPES_H
589 #include <sys/types.h> 590#include <sys/types.h>
590 #endif 591#endif
591 #ifdef HAVE_SYS_SOCKET_H 592#ifdef HAVE_SYS_SOCKET_H
592 #include <sys/socket.h> 593#include <sys/socket.h>
593 #endif 594#endif
594 ]],[[ 595 ]],[[
595 int sv[2]; 596 int sv[2];
596 if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv) != 0) return 1 597 if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv) != 0) return 1
@@ -619,11 +620,12 @@ AC_CHECK_DECL([gmtime_s],
619 AC_MSG_CHECKING([[whether gmtime_s is in C11 form]]) 620 AC_MSG_CHECKING([[whether gmtime_s is in C11 form]])
620 AC_LINK_IFELSE( 621 AC_LINK_IFELSE(
621 [ AC_LANG_PROGRAM( 622 [ AC_LANG_PROGRAM(
622 [[ #define __STDC_WANT_LIB_EXT1__ 1 623 [[
623 #include <time.h> 624#define __STDC_WANT_LIB_EXT1__ 1
624 #ifdef __cplusplus 625#include <time.h>
625 extern "C" 626#ifdef __cplusplus
626 #endif 627extern "C"
628#endif
627 struct tm* gmtime_s(const time_t* time, struct tm* result); 629 struct tm* gmtime_s(const time_t* time, struct tm* result);
628 ]], [[ 630 ]], [[
629 struct tm res; 631 struct tm res;
@@ -640,11 +642,12 @@ AC_CHECK_DECL([gmtime_s],
640 AC_MSG_CHECKING([[whether gmtime_s is in W32 form]]) 642 AC_MSG_CHECKING([[whether gmtime_s is in W32 form]])
641 AC_LINK_IFELSE( 643 AC_LINK_IFELSE(
642 [ AC_LANG_PROGRAM( 644 [ AC_LANG_PROGRAM(
643 [[ #include <time.h> 645 [[
644 #ifdef __cplusplus 646#include <time.h>
645 extern "C" 647#ifdef __cplusplus
646 #endif 648extern "C"
647 errno_t gmtime_s(struct tm* _tm, const time_t* time); 649#endif
650errno_t gmtime_s(struct tm* _tm, const time_t* time);
648 ]], [[ 651 ]], [[
649 struct tm res; 652 struct tm res;
650 time_t t; 653 time_t t;
@@ -660,19 +663,19 @@ AC_CHECK_DECL([gmtime_s],
660 ]) 663 ])
661 ], [], 664 ], [],
662 [[#define __STDC_WANT_LIB_EXT1__ 1 665 [[#define __STDC_WANT_LIB_EXT1__ 1
663 #include<time.h>]]) 666#include <time.h>]])
664 667
665 668
666AC_CHECK_DECLS([SOCK_NONBLOCK], [AC_DEFINE([HAVE_SOCK_NONBLOCK], [1], [SOCK_NONBLOCK is defined in a socket header])], [], 669AC_CHECK_DECLS([SOCK_NONBLOCK], [AC_DEFINE([HAVE_SOCK_NONBLOCK], [1], [SOCK_NONBLOCK is defined in a socket header])], [],
667 [ 670 [
668 #if defined HAVE_SYS_TYPES_H 671#if defined(HAVE_SYS_TYPES_H)
669 # include <sys/types.h> 672# include <sys/types.h>
670 #endif 673#endif
671 #if defined HAVE_SYS_SOCKET_H 674#if defined(HAVE_SYS_SOCKET_H)
672 # include <sys/socket.h> 675# include <sys/socket.h>
673 #elif defined HAVE_WINSOCK2_H 676#elif defined(HAVE_WINSOCK2_H)
674 # include <winsock2.h> 677# include <winsock2.h>
675 #endif 678#endif
676 ]) 679 ])
677 680
678 681