httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: Deja vu
Date Fri, 29 Dec 2000 19:04:10 GMT
rbb@covalent.net wrote:
> 
> > -lcrypt
> > srclib/apr/libapr.a(homedir.o): In function `apr_get_home_directory':
> > /usr/home/ben/work/httpd-2.0/srclib/apr/user/unix/homedir.c(.text+0x28):
> > undefined reference to `getpwnam_r'
> > *** Error code 1
> >
> > I'm sure we fixed this a year ago, but I've forgotten how - does anyone
> > remember?
> 
> Please make sure that you are actually linking in the library that you
> need.  If not, we need to add a library to the EXTRA_LIBS variable in
> APR.  I don't have access to a 3.2 machine myself, but 2.0 is compiling
> fine on 4.1 and 4.2 right now, so that tells me that it is basically just
> a missing library for a function that has moved.

Nope, the function doesn't exist. So, it seems to me that I need to test
for it in configure. Which leads me to further confusion... in
apr/configure.in, I see (for example):

AC_CHECK_FUNCS(strcasecmp stricmp setsid nl_langinfo)

but also:

AC_CHECK_FUNCS(stricmp, have_stricmp="1", have_stricmp="0")

so what's the score there, then? And I notice things like:

AC_CHECK_FUNCS(fork, [ fork="1" ], [ fork="0" ])

which end up defining HAS_FORK instead of HAVE_FORK. What's that all
about?

Anyway, my inclination is to do this:

Index: srclib/apr/configure.in
===================================================================
RCS file: /home/cvs/apr/configure.in,v
retrieving revision 1.196
diff -u -r1.196 configure.in
--- srclib/apr/configure.in     2000/12/28 23:14:06     1.196
+++ srclib/apr/configure.in     2000/12/29 19:00:44
@@ -476,6 +476,11 @@
 AC_SUBST(have_strdup)
 AC_SUBST(have_strstr)
 
+dnl #----------------------------- Checking for missing POSIX thread
functions
+AC_CHECK_FUNCS(getpwnam_r, have_getpwnam_r="1", have_getpwnam_r="0")
+
+AC_SUBST(have_getpwnam_r)
+
 dnl #----------------------------- Checking for DSO support
 echo $ac_n "${nl}Checking for DSO...${nl}"
 AC_ARG_ENABLE(dso,

Index: srclib/apr/include/apr.h.in
===================================================================
RCS file: /home/cvs/apr/include/apr.h.in,v
retrieving revision 1.60
diff -u -r1.60 apr.h.in
--- srclib/apr/include/apr.h.in 2000/12/22 16:54:50     1.60
+++ srclib/apr/include/apr.h.in 2000/12/29 19:00:51
@@ -86,6 +86,7 @@
 #define APR_HAVE_MEMMOVE        @have_memmove@
 #define APR_HAVE_BZERO          @have_bzero@
 #define APR_HAVE_IPV6           @have_ipv6@
+#define APR_HAVE_GETPWNAM_R    @have_getpwnam_r@
 
 
 #if APR_HAVE_SYS_TYPES_H

Index: srclib/apr/user/unix/homedir.c
===================================================================
RCS file: /home/cvs/apr/user/unix/homedir.c,v
retrieving revision 1.1
diff -u -r1.1 homedir.c
--- srclib/apr/user/unix/homedir.c      2000/11/13 03:18:18     1.1
+++ srclib/apr/user/unix/homedir.c      2000/12/29 19:01:03
@@ -71,7 +71,7 @@
     char pwbuf[512];
 #endif
 
-#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
+#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) &&
HAVE_GETPWNAM_R
     if (!getpwnam_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw)) {
 #else
     if ((pw = getpwnam(userid)) != NULL) {

Should I? Shouldn't I? (OK, possibly the last one should become simply
"#if HAVE_GETPWNAM_R").

Cheers,

Ben.

--
http://www.apache-ssl.org/ben.html

"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff

Mime
View raw message