Re: Patch for GNU/kFreeBSD

Message ID 20160517203454.GA8967@ubuntubsd.org
State New, archived
Headers

Commit Message

Jon Boden May 17, 2016, 8:34 p.m. UTC
  Hi!

On Mon, May 16, 2016 at 02:08:51PM +0100, Yao Qi wrote:
> Jon Boden <jon@ubuntubsd.org> writes:
> 
> > GDB 7.11 needs a tiny fix to build on GNU/kFreeBSD systems. Please can
> > you apply this?
> 
> Hi,
> Thanks for the patch.  Could you describe what is the build problem
> without your patch?

Yes. GDB needs kinfo_getvmmap() on GNU/kFreeBSD systems same as on pure FreeBSD. However on these systems the FreeBSD version of libutil is renamed to libutil-freebsd.

> You also need to regenerate configure file, and
> include the changes in the patch too.  ChangeLog is needed as well.

Done! For ChangeLog:

2016-05-17  Jon Boden  <jon@ubuntubsd.org>

	* configure.ac: Search for libutil-freebsd as alternative to libutil.

Thanks
  

Comments

Yao Qi May 19, 2016, 1:33 p.m. UTC | #1
Jon Boden <jon@ubuntubsd.org> writes:

> Yes. GDB needs kinfo_getvmmap() on GNU/kFreeBSD systems same as on
> pure FreeBSD. However on these systems the FreeBSD version of libutil
> is renamed to libutil-freebsd.

Thanks for the explanation.  Could you write this explanation down in
configure.ac close to your change as a comment?  so people can
understand easily why do we check util and util-freebsd.

>
>> You also need to regenerate configure file, and
>> include the changes in the patch too.  ChangeLog is needed as well.
>
> Done! For ChangeLog:
>
> 2016-05-17  Jon Boden  <jon@ubuntubsd.org>
>
> 	* configure.ac: Search for libutil-freebsd as alternative to libutil.

You also need

	* configure: Re-generated.

otherwise, patch is good to me.  If you don't have the account to push
your patch in, I can do it for you.
  

Patch

diff -ur gdb-7.11.50.20160517.old/gdb/configure gdb-7.11.50.20160517/gdb/configure
--- gdb-7.11.50.20160517.old/gdb/configure	2016-05-16 21:48:40.000000000 -0400
+++ gdb-7.11.50.20160517/gdb/configure	2016-05-17 16:29:07.000000000 -0400
@@ -7074,7 +7074,7 @@ 
   return 0;
 }
 _ACEOF
-for ac_lib in '' util; do
+for ac_lib in '' util util-freebsd; do
   if test -z "$ac_lib"; then
     ac_res="none required"
   else
diff -ur gdb-7.11.50.20160517.old/gdb/configure.ac gdb-7.11.50.20160517/gdb/configure.ac
--- gdb-7.11.50.20160517.old/gdb/configure.ac	2016-05-16 21:48:40.000000000 -0400
+++ gdb-7.11.50.20160517/gdb/configure.ac	2016-05-17 16:29:07.000000000 -0400
@@ -535,7 +535,7 @@ 
 AM_ZLIB
 
 # On FreeBSD we may need libutil for kinfo_getvmmap (used by fbsd-nat.c).
-AC_SEARCH_LIBS(kinfo_getvmmap, util,
+AC_SEARCH_LIBS(kinfo_getvmmap, util util-freebsd,
   [AC_DEFINE(HAVE_KINFO_GETVMMAP, 1,
             [Define to 1 if your system has the kinfo_getvmmap function. ])])