Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,8 @@
# $Id$
###########################################################################
ACLOCAL_AMFLAGS = -I .
AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = CHANGES COPYING maketgz reconf Makefile.dist curl-config.in \
......
......@@ -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])
......
ACLOCAL_AMFLAGS = -I .
AUTOMAKE_OPTIONS = foreign
lib_LTLIBRARIES = libcares.la
......
......@@ -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
......
#!/bin/sh
${LIBTOOLIZE:-libtoolize} --copy --automake --force
ACLOCAL_FLAGS="-I . $ACLOCAL_FLAGS"
${ACLOCAL:-aclocal} $ACLOCAL_FLAGS
${AUTOHEADER:-autoheader}
${AUTOCONF:-autoconf}
......
......@@ -76,7 +76,7 @@ AM_PROG_CC_C_O
AC_PROG_INSTALL
dnl Our configure and build reentrant settings
CONFIGURE_WITH_REENTRANT
CONFIGURE_REENTRANT
dnl check for how to do large files
AC_SYS_LARGEFILE
......
This diff is collapsed.
......@@ -209,6 +209,7 @@ PERL=`findtool ${PERL:-perl}`
echo "buildconf: running libtoolize"
$libtoolize --copy --automake --force || die "The libtoolize command failed"
echo "buildconf: running aclocal"
ACLOCAL_FLAGS="-I . $ACLOCAL_FLAGS"
${ACLOCAL:-aclocal} $ACLOCAL_FLAGS || die "The aclocal command line failed"
if test -n "$PERL"; then
echo "buildconf: running aclocal hack to convert all mv to mv -f"
......
......@@ -142,7 +142,7 @@ dnl Checks for programs.
AC_PROG_CC
dnl Our configure and build reentrant settings
CONFIGURE_WITH_REENTRANT
CONFIGURE_REENTRANT
dnl check for how to do large files
AC_SYS_LARGEFILE
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment