aboutsummaryrefslogtreecommitdiff
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
commit1bc490077a804d6ebccbf0276e20a2e14323c69f (patch)
tree757fc3d98f21bf3dc6493f19e506126b59dcdd21
parent7d773abe509fc5e9e4d84ba4bb12e0480acdaa28 (diff)
Make sure that configure process tests are done with the same _REENTRANT
setting as the one actually used when finally building the library.
-rw-r--r--acinclude.m425
-rw-r--r--ares/acinclude.m425
-rw-r--r--ares/configure.ac3
-rw-r--r--configure.ac3
4 files changed, 56 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index e42de229d..30b22b256 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -110,6 +110,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
diff --git a/ares/acinclude.m4 b/ares/acinclude.m4
index 9eb8d0c07..10de92717 100644
--- a/ares/acinclude.m4
+++ b/ares/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
diff --git a/ares/configure.ac b/ares/configure.ac
index 66f44f45a..2266b1480 100644
--- a/ares/configure.ac
+++ b/ares/configure.ac
@@ -75,6 +75,9 @@ AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
+dnl Our configure and build reentrant settings
+CONFIGURE_WITH_REENTRANT
+
dnl check for how to do large files
AC_SYS_LARGEFILE
diff --git a/configure.ac b/configure.ac
index 25e747d95..a2a1fe290 100644
--- a/configure.ac
+++ b/configure.ac
@@ -141,6 +141,9 @@ AC_AIX
dnl Checks for programs.
AC_PROG_CC
+dnl Our configure and build reentrant settings
+CONFIGURE_WITH_REENTRANT
+
dnl check for how to do large files
AC_SYS_LARGEFILE