You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by David Reid <da...@jetnet.co.uk> on 2004/02/20 01:15:59 UTC

[PATCH] improve berkeley detection on FreeBSD

This improves the detection of the BerkeleyDB on FreeBSD. It basically
correct what's looks like some copy/paste oversights (looking for db4 when
in a db4.2 block for instance) and adds the ability of the apu_hints.m4 to
pass in a platform_places to look for the directory. This is added to the
user_places prior to checking any user supplied dirs.

The patch also adds the APRUTIL_LIBS and _LDFLAGS to the link line for the
final lib as otherwise it craps out when we try and use the lib during the
httpd build :(

david

Index: Makefile.in
===================================================================
RCS file: /home/cvs/apr-util/Makefile.in,v
retrieving revision 1.83
diff -u -r1.83 Makefile.in
--- Makefile.in 17 Feb 2004 08:13:40 -0000      1.83
+++ Makefile.in 20 Feb 2004 00:13:33 -0000
@@ -69,7 +69,7 @@
        chmod 755 $(DESTDIR)$(bindir)/apu-config

 $(TARGET_LIB): $(OBJECTS)
-       $(LINK) @lib_target@ $(ALL_LIBS)
+       $(LINK) @lib_target@ $(ALL_LIBS) $(APRUTIL_LDFLAGS) $(APRUTIL_LIBS)

 exports.c: $(HEADERS)
        $(AWK) -f @APR_SOURCE_DIR@/build/make_exports.awk $(HEADERS) > $@
Index: build/apu-hints.m4
===================================================================
RCS file: /home/cvs/apr-util/build/apu-hints.m4,v
retrieving revision 1.4
diff -u -r1.4 apu-hints.m4
--- build/apu-hints.m4  22 Dec 2003 23:02:33 -0000      1.4
+++ build/apu-hints.m4  19 Feb 2004 23:52:11 -0000
@@ -37,6 +37,9 @@
     *-sco3.2v5*)
        APR_SETIFNULL(apu_db_xtra_libs, [-lsocket])
        ;;
+    *-freebsd*)
+        APR_ADDTO(platform_places, "/usr/local")
+        ;;
     esac

 fi
Index: build/dbm.m4
===================================================================
RCS file: /home/cvs/apr-util/build/dbm.m4,v
retrieving revision 1.8
diff -u -r1.8 dbm.m4
--- build/dbm.m4        5 Jan 2004 12:21:46 -0000       1.8
+++ build/dbm.m4        19 Feb 2004 23:52:11 -0000
@@ -382,8 +382,8 @@
   fi
   APU_CHECK_BERKELEY_DB("4", "1", "-1",
     "$places",
-    "db4/db.h db.h",
-    "db-4.1 db4 db"
+    "db41/db.h db.h",
+    "db-4.1 db41 db"
   )
   if test "$apu_have_db" = "1"; then
     apu_db_version=4
@@ -403,8 +403,8 @@
   fi
   APU_CHECK_BERKELEY_DB("4", "2", "-1",
     "$places",
-    "db4/db.h db.h",
-    "db-4.2 db4 db"
+    "db42/db.h db.h",
+    "db-4.2 db42 db"
   )
   if test "$apu_have_db" = "1"; then
     apu_db_version=4
@@ -639,12 +639,12 @@
   ], [
     if test "$withval" = "yes"; then
       apu_want_db=1
-      user_places=""
+      user_places="$platform_places"
     elif test "$withval" = "no"; then
       apu_want_db=0
     else
       apu_want_db=1
-      user_places="$withval"
+      user_places="$platform_places $withval"
     fi

     if test "$apu_want_db" != "0"; then
@@ -654,7 +654,7 @@
       fi
     fi
   ],[
-    APU_CHECK_DB($requested, "")
+    APU_CHECK_DB($requested, $platform_places)
   ])

   if test -n "$apu_db_xtra_libs"; then


Re: [PATCH] improve berkeley detection on FreeBSD

Posted by David Reid <da...@jetnet.co.uk>.
> On Fri, Feb 20, 2004 at 12:15:59AM -0000, David Reid wrote:
> > This improves the detection of the BerkeleyDB on FreeBSD. It basically
> > correct what's looks like some copy/paste oversights (looking for db4
when
> > in a db4.2 block for instance) and adds the ability of the apu_hints.m4
to
> > pass in a platform_places to look for the directory. This is added to
the
> > user_places prior to checking any user supplied dirs.
>
> /usr/local is not FreeBSD specific: you should configure using
> --with-berkeley-db=/usr/local.  wrt to the db4 vs db4.2 this is
> deliberate to cope with the various ways BDB is packaged.  Is that
> actually breaking for you, if so how?

Well as far as it goes , fair enough. BUT the configure script is supposed
to be able to deal with this sort of nonsense isn't it? Otherwise what's the
point?

On a "plain vanilla" FreeBSD 4.9 system, with BDB 4.1 from ports, apr was
failing to find the libs... The patch was intended to fix it. This seems
like a common enough situation that it should be addressed.

Sander pointed out some problems with the patch and so it needs a little bit
of work as it fails on Linux systems... I also have some ideas about other
small tweaks so I'll resubmit the patch (maybe later tonight).

> > The patch also adds the APRUTIL_LIBS and _LDFLAGS to the link line for
the
> > final lib as otherwise it craps out when we try and use the lib during
the
> > httpd build :(
>
> This looks good but will this break the build with libtool 1.3 (since it
> means that libaprutil*.la may get linked against other .la files)?  That
> needs to be checked.

Yep, this doesn't seem to work as well as it might. Something needs to be
done to get the correct link line though as without the change it won't
allow us to build using it. I'll investigate. If you have ideas come see me
on irc :)

> (Fixing this means the EXTRA_OS_LINK hack in configure can be removed
> too)

Removing hacks is always a good plan...

david


Re: [PATCH] improve berkeley detection on FreeBSD

Posted by Joe Orton <jo...@manyfish.co.uk>.
On Fri, Feb 20, 2004 at 12:15:59AM -0000, David Reid wrote:
> This improves the detection of the BerkeleyDB on FreeBSD. It basically
> correct what's looks like some copy/paste oversights (looking for db4 when
> in a db4.2 block for instance) and adds the ability of the apu_hints.m4 to
> pass in a platform_places to look for the directory. This is added to the
> user_places prior to checking any user supplied dirs.

/usr/local is not FreeBSD specific: you should configure using
--with-berkeley-db=/usr/local.  wrt to the db4 vs db4.2 this is
deliberate to cope with the various ways BDB is packaged.  Is that
actually breaking for you, if so how?

> The patch also adds the APRUTIL_LIBS and _LDFLAGS to the link line for the
> final lib as otherwise it craps out when we try and use the lib during the
> httpd build :(

This looks good but will this break the build with libtool 1.3 (since it 
means that libaprutil*.la may get linked against other .la files)?  That 
needs to be checked.

(Fixing this means the EXTRA_OS_LINK hack in configure can be removed
too)

joe