aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-09-17 11:58:55 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-09-17 11:58:55 +0300
commitcc1d7c61ae1a284e353082697637782ed69f105c (patch)
treede281e196b73a3c4a4ff7e3f28502f82938b8120 /configure.ac
parentacc4cc29ed74e9d63088e6a7df9bb8ad5938043c (diff)
downloadlibmicrohttpd-cc1d7c61ae1a284e353082697637782ed69f105c.tar.gz
libmicrohttpd-cc1d7c61ae1a284e353082697637782ed69f105c.zip
configure: added detection of used run-time lib (type of C lib)
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac58
1 files changed, 51 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 0ac7b6b7..23d5a900 100644
--- a/configure.ac
+++ b/configure.ac
@@ -384,13 +384,14 @@ AS_CASE(["$host_os"],
384 AC_MSG_RESULT([[$mhd_host_os]])], 384 AC_MSG_RESULT([[$mhd_host_os]])],
385 [*cygwin*], 385 [*cygwin*],
386 [AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system]) 386 [AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system])
387 mhd_host_os='Windows (Cygwin)' 387 mhd_host_os='Windows/Cygwin'
388 AC_MSG_RESULT([[$mhd_host_os]]) 388 AC_MSG_RESULT([[$mhd_host_os]])
389 os_is_windows=yes], 389 os_is_windows=yes],
390 [*mingw*], 390 [*mingw*],
391 [AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system]) 391 [
392 AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system]) 392 AC_DEFINE([MINGW],[1],[This is a MinGW system])
393 mhd_host_os='Windows (MinGW)' 393 AC_DEFINE([WINDOWS],[1],[This is a Windows system])
394 mhd_host_os='Windows/MinGW'
394 AC_MSG_RESULT([[$mhd_host_os]]) 395 AC_MSG_RESULT([[$mhd_host_os]])
395 LIBS="$LIBS -lws2_32" 396 LIBS="$LIBS -lws2_32"
396 AC_CHECK_HEADERS([winsock2.h ws2tcpip.h], [], [AC_MSG_ERROR([[Winsock2 headers are required for W32]])], [AC_INCLUDES_DEFAULT]) 397 AC_CHECK_HEADERS([winsock2.h ws2tcpip.h], [], [AC_MSG_ERROR([[Winsock2 headers are required for W32]])], [AC_INCLUDES_DEFAULT])
@@ -416,8 +417,8 @@ AS_CASE(["$host_os"],
416 AC_MSG_RESULT([[$mhd_host_os]]) 417 AC_MSG_RESULT([[$mhd_host_os]])
417 ], 418 ],
418 [ 419 [
419 mhd_host_os='unrecognised OS' 420 AC_MSG_RESULT([unrecognised OS])
420 AC_MSG_RESULT([[$mhd_host_os]]) 421 mhd_host_os="${host_os}"
421 AC_MSG_WARN([Unrecognised OS $host_os]) 422 AC_MSG_WARN([Unrecognised OS $host_os])
422 AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS]) 423 AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
423 ]) 424 ])
@@ -591,6 +592,49 @@ choke me now;
591 ] 592 ]
592) 593)
593 594
595AS_IF([test "x${os_is_windows}" = "xyes" && test "x${os_is_native_w32}" = "xyes"],
596 [
597 AC_CACHE_CHECK([W32 run-time library type], [mhd_cv_wctr_type],
598 [
599 AC_EGREP_CPP([MHDMARKER: UCRT run-time library in use!], [
600#include <stdio.h>
601#if defined(_UCRT)
602#define CRT_STR "MHDMARKER: UCRT run-time library in use!"
603#endif
604#if defined(__MSVCRT_VERSION__)
605#if (__MSVCRT_VERSION__ >= 0xE00) && (__MSVCRT_VERSION__ < 0x1000)
606#define CRT_STR "MHDMARKER: UCRT run-time library in use!"
607#endif
608#if (__MSVCRT_VERSION__ > 0x1400)
609#define CRT_STR "MHDMARKER: UCRT run-time library in use!"
610#endif
611#endif
612
613#ifndef CRT_STR
614#define CRT_STR "MHDMARKER: MSVCRT run-time library in use!"
615#endif
616
617int main(void)
618{
619 printf ("%\n", CRT_STR);
620 return 0;
621}
622 ],
623 [mhd_cv_wctr_type="ucrt"], [mhd_cv_wctr_type="msvcrt"])
624 ]
625 )
626 mhd_host_os="${mhd_host_os}-${mhd_cv_wctr_type}"
627 AS_VAR_IF([mhd_cv_wctr_type], ["msvcrt"],
628 [
629 AX_APPEND_COMPILE_FLAGS([-D__USE_MINGW_ANSI_STDIO=0], [CPPFLAGS])
630 AC_SUBST([W32CRT], [MSVCRT])
631 ], [AC_SUBST([W32CRT], [UCRT])]
632 )
633 ]
634)
635
636
637
594AC_ARG_WITH([threads], 638AC_ARG_WITH([threads],
595 [AS_HELP_STRING([--with-threads=LIB],[choose threading library (posix, w32, auto, none) [auto]])], 639 [AS_HELP_STRING([--with-threads=LIB],[choose threading library (posix, w32, auto, none) [auto]])],
596 [], [with_threads='auto']) 640 [], [with_threads='auto'])
@@ -2811,7 +2855,7 @@ AS_VAR_IF([os_is_windows], ["yes"],
2811AC_MSG_NOTICE([GNU libmicrohttpd ${PACKAGE_VERSION} Configuration Summary: 2855AC_MSG_NOTICE([GNU libmicrohttpd ${PACKAGE_VERSION} Configuration Summary:
2812 Target directory: ${prefix} 2856 Target directory: ${prefix}
2813 Cross-compiling: ${cross_compiling} 2857 Cross-compiling: ${cross_compiling}
2814 Operating System: ${host_os}${os_ver_msg} 2858 Operating System: ${mhd_host_os}${os_ver_msg}
2815 Shutdown of listening socket triggers select: ${mhd_cv_host_shtdwn_trgr_select} 2859 Shutdown of listening socket triggers select: ${mhd_cv_host_shtdwn_trgr_select}
2816 Inter-thread comm: ${use_itc} 2860 Inter-thread comm: ${use_itc}
2817 poll support: ${enable_poll=no} 2861 poll support: ${enable_poll=no}