Commit 8a323f83 authored by Yang Tse's avatar Yang Tse
Browse files

Another step towards detecting if _REENTRANT is already defined or actually

needed, and being able to define it if appropriate for further configure tests
as well as for the generated config file.

Introduced reentrant.m4 intended for our reentrant related autotools/m4 macros.
parent a7abd5bf
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@
# $Id$
###########################################################################

ACLOCAL_AMFLAGS = -I .

AUTOMAKE_OPTIONS = foreign

EXTRA_DIST = CHANGES COPYING maketgz reconf Makefile.dist curl-config.in \
+0 −34
Original line number Diff line number Diff line
@@ -110,31 +110,6 @@ 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 
@@ -2628,7 +2603,6 @@ AC_DEFUN([CURL_CHECK_LOCALTIME_R],
#undef _REENTRANT
#define _REENTRANT
#include <time.h>],[
        AC_DEFINE(NEED_REENTRANT, 1, [need REENTRANT defined])
        AC_MSG_RESULT(yes)],
        AC_MSG_RESULT(no))])])
])
@@ -2670,7 +2644,6 @@ AC_DEFUN([CURL_CHECK_STRERROR_R],
#undef _REENTRANT
#define _REENTRANT
#include <string.h>],[
        AC_DEFINE(NEED_REENTRANT, 1, [need REENTRANT defined])
        AC_MSG_RESULT(yes)],
        AC_MSG_RESULT(no)
        AC_DEFINE(HAVE_NO_STRERROR_R_DECL, 1, [we have no strerror_r() proto])
@@ -2761,7 +2734,6 @@ AC_DEFUN([CURL_CHECK_INET_NTOA_R],
#define _REENTRANT
#include <arpa/inet.h>],[
        AC_DEFINE(HAVE_INET_NTOA_R_DECL, 1, [inet_ntoa_r() is declared])
        AC_DEFINE(NEED_REENTRANT, 1, [need REENTRANT defined])
        AC_MSG_RESULT(yes)],
        AC_MSG_RESULT(no))])])
])
@@ -2848,7 +2820,6 @@ AC_DEFUN([CURL_CHECK_GETHOSTBYADDR_R], [
      ],[
        AC_MSG_RESULT([yes])
        AC_DEFINE(HAVE_GETHOSTBYADDR_R_5, 1, [gethostbyaddr_r() takes 5 args])
        AC_DEFINE(NEED_REENTRANT, 1, [need REENTRANT])
        ac_cv_gethostbyaddr_r_args="5"
      ],[
        AC_MSG_RESULT([no])
@@ -2904,7 +2875,6 @@ AC_DEFUN([CURL_CHECK_GETHOSTBYADDR_R], [
      ],[
        AC_MSG_RESULT([yes])
        AC_DEFINE(HAVE_GETHOSTBYADDR_R_7, 1, [gethostbyaddr_r() takes 7 args])
        AC_DEFINE(NEED_REENTRANT, 1, [need REENTRANT])
        ac_cv_gethostbyaddr_r_args="7"
      ],[
        AC_MSG_RESULT([no])
@@ -2962,7 +2932,6 @@ AC_DEFUN([CURL_CHECK_GETHOSTBYADDR_R], [
      ],[
        AC_MSG_RESULT([yes])
        AC_DEFINE(HAVE_GETHOSTBYADDR_R_8, 1, [gethostbyaddr_r() takes 8 args])
        AC_DEFINE(NEED_REENTRANT, 1, [need REENTRANT])
        ac_cv_gethostbyaddr_r_args="8"
      ],[
        AC_MSG_RESULT([no])
@@ -3068,7 +3037,6 @@ AC_DEFUN([CURL_CHECK_GETHOSTBYNAME_R], [
      ],[
        AC_MSG_RESULT([yes])
        AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, [gethostbyname_r() takes 3 args])
        AC_DEFINE(NEED_REENTRANT, 1, [need REENTRANT])
        ac_cv_gethostbyname_r_args="3"
      ],[
        AC_MSG_RESULT([no])
@@ -3118,7 +3086,6 @@ AC_DEFUN([CURL_CHECK_GETHOSTBYNAME_R], [
      ],[
        AC_MSG_RESULT([yes])
        AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1, [gethostbyname_r() takes 5 args])
        AC_DEFINE(NEED_REENTRANT, 1, [need REENTRANT])
        ac_cv_gethostbyname_r_args="5"
      ],[
        AC_MSG_RESULT([no])
@@ -3168,7 +3135,6 @@ AC_DEFUN([CURL_CHECK_GETHOSTBYNAME_R], [
      ],[
        AC_MSG_RESULT([yes])
        AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1, [gethostbyname_r() takes 6 args])
        AC_DEFINE(NEED_REENTRANT, 1, [need REENTRANT])
        ac_cv_gethostbyname_r_args="6"
      ],[
        AC_MSG_RESULT([no])
+2 −0
Original line number Diff line number Diff line
ACLOCAL_AMFLAGS = -I .

AUTOMAKE_OPTIONS = foreign

lib_LTLIBRARIES = libcares.la
+0 −25
Original line number Diff line number Diff line
@@ -88,31 +88,6 @@ 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 
+1 −0
Original line number Diff line number Diff line
#!/bin/sh

${LIBTOOLIZE:-libtoolize} --copy --automake --force
ACLOCAL_FLAGS="-I . $ACLOCAL_FLAGS"
${ACLOCAL:-aclocal} $ACLOCAL_FLAGS
${AUTOHEADER:-autoheader}
${AUTOCONF:-autoconf}
Loading