summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-07-22 19:04:16 +0000
committerYang Tse <yangsita@gmail.com>2008-07-22 19:04:16 +0000
commitd105ed6d59df519be5c1877a533f4b058ce3b090 (patch)
treea07acfaf29e7d0d540890410e3448652819ab93a /acinclude.m4
parentdfcd806a8bb43a585c737badda249900c1c4dbd1 (diff)
downloadc-ares-d105ed6d59df519be5c1877a533f4b058ce3b090.tar.gz
c-ares-d105ed6d59df519be5c1877a533f4b058ce3b090.tar.bz2
c-ares-d105ed6d59df519be5c1877a533f4b058ce3b090.zip
Make sure that configure process tests are done with the same _REENTRANT
setting as the one actually used when finally building the library.
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m425
1 files changed, 25 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 9eb8d0c..10de927 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -88,6 +88,31 @@ CURL_DEF_TOKEN $1
])
+dnl CONFIGURE_WITH_REENTRANT
+dnl -------------------------------------------------
+dnl This macro ensures that configuration tests done
+dnl after this will execute with preprocessor symbol
+dnl _REENTRANT defined. This macro also ensures that
+dnl the generated config file will equally define it.
+
+AC_DEFUN([CONFIGURE_WITH_REENTRANT], [
+AC_BEFORE([$0], [AC_PREPROC_IFELSE])dnl
+AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+AC_BEFORE([$0], [AC_LINK_IFELSE])dnl
+AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+AH_VERBATIM([_REENTRANT],
+[/* Define _REENTRANT if not already defined */
+@%:@ifndef _REENTRANT
+@%:@ define _REENTRANT
+@%:@endif])
+cat >>confdefs.h <<_ACEOF
+[@%:@ifndef _REENTRANT
+@%:@ define _REENTRANT
+@%:@endif]
+_ACEOF
+])
+
+
dnl CURL_CHECK_HEADER_WINDOWS
dnl -------------------------------------------------
dnl Check for compilable and valid windows.h header