Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Message

configure.ac _REENTRANT issue (was: sync.c:local_addr() use)

2005-03-26 by ranko_z

--- In milter-greylist@yahoogroups.com, manu@n... wrote:
> Emmanuel Dreyfus <manu@n...> wrote:
> Hum, the -D_REENTRANT test is already there, but it was buggy. Try this
> patch, run autoconf and rebuild.

Still buggy. 

The following patch (for 2.0b3) fixes the config problem. It removes 
the part that defines twice both HAVE_GETADDRINFO and HAVE_GETNAMEINFO
and that consequently fails few checks that depend on -Werror. In
addition __EXTENSIONS__ and _REENTRANT checks are swapped. This is
needed because __EXTENSIONS__ will define localtime_r and will not
detect the need for _REENTRANT. Also, localtime_r takes two args and
also the second check was including stdio.h instead of time.h.

It should be noted that v1.6 is not suitable for Solaris as there is 
no check for _REENTRANT.

Best regards,

R.

*** a/configure.ac        Sat Mar 19 09:41:09 2005
--- b/configure.ac        Sat Mar 26 21:22:58 2005
***************
*** 210,219 ****
  fi
  if test $ipv6_cv_$1 = yes; then
    AC_DEFINE_UNQUOTED($ac_tr_lib)
-   ifelse([$2], , :, [$2])
  else
    ifelse([$3], , :, [$3])
  fi])

  IPv6_CHECK_FUNC(getaddrinfo,
      AC_DEFINE([HAVE_GETADDRINFO], [],
--- 210,219 ----
  fi
  if test $ipv6_cv_$1 = yes; then
    AC_DEFINE_UNQUOTED($ac_tr_lib)
  else
    ifelse([$3], , :, [$3])
  fi])
+ #  ifelse([$2], , :, [$2])

  IPv6_CHECK_FUNC(getaddrinfo,
      AC_DEFINE([HAVE_GETADDRINFO], [],
***************
*** 253,258 ****
--- 253,280 ----
            [], [<time.h> defines timeradd]) timeradd=no])
  AC_MSG_RESULT([$timeradd])

+ # Check if -D_REENTRANT is needed for localtime_r, gmtime_r
+ SAVEDCFLAGS=$CFLAGS
+ CFLAGS=$CFLAGS" -ansi -Wall -Werror"
+ AC_MSG_CHECKING([if -D_REENTRANT is needed to use localtime_r])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+               #include <time.h>
+       ],[[
+
+               (void)localtime_r(NULL, NULL);
+       ]])], [dreentrant=no],
+               [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+                               #define _REENTRANT
+                               #include <time.h>
+                       ],[[
+                                (void)localtime_r(NULL, NULL);
+                       ]])],
+                       [SAVEDCFLAGS=$SAVEDCFLAGS" -D_REENTRANT";
+                        dreentrant=yes], [dreentrant=no])
+       ])
+ AC_MSG_RESULT([$dreentrant])
+ CFLAGS=$SAVEDCFLAGS
+
  # Check if -D__EXTENSIONS__ is needed for snprintf, getopt, seteuid...
  SAVEDCFLAGS=$CFLAGS
  CFLAGS=$CFLAGS" -ansi -Wall -Werror"
***************
*** 278,305 ****
  AC_MSG_RESULT([$dextensions])
  CFLAGS=$SAVEDCFLAGS

- # Check if -D_REENTRANT is needed for localtime_r, gmtime_r
- SAVEDCFLAGS=$CFLAGS
- CFLAGS=$CFLAGS" -ansi -Wall -Werror"
- AC_MSG_CHECKING([if -D_REENTRANT is needed to use localtime_r])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
-               #include <time.h>
-       ],[[
-
-               (void)localtime(NULL);
-       ]])], [dreentrant=no],
-               [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
-                               #define _REENTRANT
-                               #include <stdio.h>
-                       ],[[
-                                (void)localtime(NULL);
-                       ]])],
-                       [SAVEDCFLAGS=$SAVEDCFLAGS" -D_REENTRANT";
-                        dreentrant=yes], [dreentrant=no])
-       ])
- AC_MSG_RESULT([$dreentrant])
- CFLAGS=$SAVEDCFLAGS
-
  # Check for libpthread. On FreeBSD, the libc_r does the job.
  # On digitalUNIX, libpthreads (with a trailing s) is the library to use
  AC_CHECK_LIB([pthread], [pthread_create],
--- 300,305 ----

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.