apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r668315 - /apr/apr/trunk/build/apr_network.m4
Date Mon, 16 Jun 2008 21:15:25 GMT
Author: bojan
Date: Mon Jun 16 14:15:24 2008
New Revision: 668315

URL: http://svn.apache.org/viewvc?rev=668315&view=rev
Log:
Fix getservbyname_r() detection.
Patch by rpluem.

Modified:
    apr/apr/trunk/build/apr_network.m4

Modified: apr/apr/trunk/build/apr_network.m4
URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/apr_network.m4?rev=668315&r1=668314&r2=668315&view=diff
==============================================================================
--- apr/apr/trunk/build/apr_network.m4 (original)
+++ apr/apr/trunk/build/apr_network.m4 Mon Jun 16 14:15:24 2008
@@ -292,7 +292,7 @@
 
 dnl Try and compile a glibc2 getservbyname_r piece of code, and set the
 dnl style of the routines to glibc2 on success
-AC_CACHE_CHECK([style of getservbyname_r routine], ac_cv_getservbyname_r_style,
+AC_CACHE_CHECK([style of getservbyname_r routine], ac_cv_getservbyname_r_style, [
 APR_TRY_COMPILE_NO_WARNING([
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -315,59 +315,62 @@
                           (struct servent **) 0);
 /* use tmp to suppress the warning */
 tmp=0;
-], ac_cv_getservbyname_r_style=glibc2, [
+], ac_cv_getservbyname_r_style=glibc2, ac_cv_getservbyname_r_style=none)
 
-dnl Try and compile a Solaris getservbyname_r piece of code, and set the
-dnl style of the routines to solaris on success
-AC_CACHE_VAL(ac_cv_getservbyname_r_style,
-APR_TRY_COMPILE_NO_WARNING([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-],[
-struct servent tmp = getservbyname_r((const char *) 0, (const char *) 0,
-                                     (struct servent *) 0, (char *) 0, 0);
-/* use tmp to suppress the warning */
-tmp=NULL;
-], ac_cv_getservbyname_r_style=solaris, [
-
-dnl Try and compile a OSF/1 getservbyname_r piece of code, and set the
-dnl style of the routines to osf1 on success
-AC_CACHE_VAL( ac_cv_getservbyname_r_style,
-APR_TRY_COMPILE_NO_WARNING([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-],[
-int tmp = getservbyname_r((const char *) 0, (const char *) 0,
-                          (struct servent *) 0, (struct servent_data *) 0);
-/* use tmp to suppress the warning */
-tmp=0;
-], ac_cv_getservbyname_r_style=osf1, ac_cv_getservbyname_r_style=none))]))]))
+if test "$ac_cv_getservbyname_r_style" = "none"; then
+    dnl Try and compile a Solaris getservbyname_r piece of code, and set the
+    dnl style of the routines to solaris on success
+    APR_TRY_COMPILE_NO_WARNING([
+    #ifdef HAVE_SYS_TYPES_H
+    #include <sys/types.h>
+    #endif
+    #ifdef HAVE_NETINET_IN_H
+    #include <netinet/in.h>
+    #endif
+    #ifdef HAVE_ARPA_INET_H
+    #include <arpa/inet.h>
+    #endif
+    #ifdef HAVE_NETDB_H
+    #include <netdb.h>
+    #endif
+    #ifdef HAVE_STDLIB_H
+    #include <stdlib.h>
+    #endif
+    ],[
+    struct servent *tmp = getservbyname_r((const char *) 0, (const char *) 0,
+                                          (struct servent *) 0, (char *) 0, 0);
+    /* use tmp to suppress the warning */
+    tmp=NULL;
+    ], ac_cv_getservbyname_r_style=solaris, ac_cv_getservbyname_r_style=none)
+fi
+
+if test "$ac_cv_getservbyname_r_style" = "none"; then
+    dnl Try and compile a OSF/1 getservbyname_r piece of code, and set the
+    dnl style of the routines to osf1 on success
+    APR_TRY_COMPILE_NO_WARNING([
+    #ifdef HAVE_SYS_TYPES_H
+    #include <sys/types.h>
+    #endif
+    #ifdef HAVE_NETINET_IN_H
+    #include <netinet/in.h>
+    #endif
+    #ifdef HAVE_ARPA_INET_H
+    #include <arpa/inet.h>
+    #endif
+    #ifdef HAVE_NETDB_H
+    #include <netdb.h>
+    #endif
+    #ifdef HAVE_STDLIB_H
+    #include <stdlib.h>
+    #endif
+    ],[
+    int tmp = getservbyname_r((const char *) 0, (const char *) 0,
+                              (struct servent *) 0, (struct servent_data *) 0);
+    /* use tmp to suppress the warning */
+    tmp=0;
+    ], ac_cv_getservbyname_r_style=osf1, ac_cv_getservbyname_r_style=none)
+fi
+])
 
 if test "$ac_cv_getservbyname_r_style" = "glibc2"; then
     AC_DEFINE(GETSERVBYNAME_R_GLIBC2, 1, [Define if getservbyname_r has the glibc style])



Mime
View raw message