Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1FpoNz-00006S-KH for mharc-grub-devel@gnu.org; Mon, 12 Jun 2006 11:31:27 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FpoNy-0008WA-9k for grub-devel@gnu.org; Mon, 12 Jun 2006 11:31:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FpoNx-0008Un-GB for grub-devel@gnu.org; Mon, 12 Jun 2006 11:31:25 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FpoNx-0008Uf-Cf for grub-devel@gnu.org; Mon, 12 Jun 2006 11:31:25 -0400 Received: from [207.152.70.127] (helo=baz.foobar-qux.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FpoWh-0001Kw-EA for grub-devel@gnu.org; Mon, 12 Jun 2006 11:40:27 -0400 Received: from baz.foobar-qux.org (localhost.foobar-qux.org [127.0.0.1]) by baz.foobar-qux.org (8.13.3/8.13.3) with ESMTP id k5CFVMw0043419 for ; Mon, 12 Jun 2006 10:31:22 -0500 (CDT) (envelope-from hde@foobar-qux.org) Received: (from hde@localhost) by baz.foobar-qux.org (8.13.3/8.13.3/Submit) id k5CFVJCY043416; Mon, 12 Jun 2006 10:31:19 -0500 (CDT) (envelope-from hde@foobar-qux.org) X-Authentication-Warning: baz.foobar-qux.org: hde set sender to hde@foobar-qux.org using -f Sender: hde@baz.foobar-qux.org Mail-Copies-To: hde@gnu.org To: grub-devel@gnu.org From: hde@foobar-qux.org (Harley D. Eades III) Date: 12 Jun 2006 10:31:18 -0500 In-Reply-To: <86hd2rtrw5.fsf@baz.foobar-qux.org> Message-ID: <868xo2tmpl.fsf@baz.foobar-qux.org> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: Patch for successful compilation on FreeBSD Release-6.1 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jun 2006 15:31:26 -0000 hde@foobar-qux.org (Harley D. Eades III) writes: > Jeroen Dekkers writes: > > > On Sun, Jun 11, 2006 at 10:28:44AM -0500, Harley D. Eades III wrote: > > > Hello, I managed to work up a small patch for grub2. She makes it > > > possible to build grub2 on FreeBSD Release-6.1. There is one thing > > > I am not sure on. In configure.ac I had to move the lines which > > > restore the compiler flags above the checks for _start etc..see the > > > patch. I would like as much feedback as possible. Thanks. :) > > > > The problem with the compiler flags should have been fixed with this > > change: > > > > 2006-05-31 Jeroen Dekkers > > > > * configure.ac: Don't set host_m32 for x86_64. Also reset LIBS > > for the target-specific tests. Make sure that we also have the > > up-to-date target variables for those tests. > > > > > > If I read your patch correctly you haven't updated to recent CVS > > yet. Can you try whether this fix also works for you? > > > Sure thing. :) Thanks for the reply. Your patch does fix that issue. Here is my updated patch. :) Cheers Harley diff --exclude=CVS --exclude=configure --exclude=config.log --exclude=config.h.in -ru grub2/ChangeLog grub2Hacked/ChangeLog --- grub2/ChangeLog Mon Jun 12 10:11:10 2006 +++ grub2Hacked/ChangeLog Mon Jun 12 10:25:28 2006 @@ -1,3 +1,12 @@ +2006-06-10 Harley D. Eades III + + * configure.ac: Check for . Check for memalign(). + * include/grub/util/misc.h: Include . + * util/grub-emu.c [HAVE_MALLOC_H]: Include . + * util/misc.c: Likewise. + (grub_memalign) [!HAVE_MEMALIGN]: Don't call memalign, but + generate an error instead. + 2006-06-09 Yoshinori K. Okuji * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Make sure that @@ -335,7 +344,6 @@ for the target-specific tests. Make sure that we also have the up-to-date target variables for those tests. ->>>>>>> 1.283 2006-05-31 Yoshinori K. Okuji * genmk.rb (Image::rule): Prefix CFLAGS or ASFLAGS with TARGET_. diff --exclude=CVS --exclude=configure --exclude=config.log --exclude=config.h.in -ru grub2/configure.ac grub2Hacked/configure.ac --- grub2/configure.ac Sun Jun 11 17:49:23 2006 +++ grub2Hacked/configure.ac Sun Jun 11 17:55:34 2006 @@ -121,6 +121,15 @@ AC_CHECK_SIZEOF(void *) AC_CHECK_SIZEOF(long) +# BSD checks. +AC_CHECK_HEADER([malloc.h], + [AC_DEFINE(HAVE_MALLOC_H, [], + [Define to 1 if you have the malloc.h header file.])], ,) + +AC_CHECK_FUNC([memalign], + [AC_DEFINE(HAVE_MEMALIGN, [], + [Define to 1 if you have the memalign function.])], ,) + if test "x$host_m32" = x1; then # Force 32-bit mode. CFLAGS="$CFLAGS -m32" diff --exclude=CVS --exclude=configure --exclude=config.log --exclude=config.h.in -ru grub2/include/grub/util/misc.h grub2Hacked/include/grub/util/misc.h --- grub2/include/grub/util/misc.h Mon Feb 14 18:07:01 2005 +++ grub2Hacked/include/grub/util/misc.h Mon Jun 5 15:25:38 2006 @@ -23,6 +23,7 @@ #include #include #include +#include extern char *progname; extern int verbosity; diff --exclude=CVS --exclude=configure --exclude=config.log --exclude=config.h.in -ru grub2/util/grub-emu.c grub2Hacked/util/grub-emu.c --- grub2/util/grub-emu.c Wed Apr 26 16:58:36 2006 +++ grub2Hacked/util/grub-emu.c Mon Jun 5 15:26:30 2006 @@ -18,7 +18,11 @@ */ #include + +#ifdef HAVE_MALLOC_H #include +#endif + #include #include #include diff --exclude=CVS --exclude=configure --exclude=config.log --exclude=config.h.in -ru grub2/util/misc.c grub2Hacked/util/misc.c --- grub2/util/misc.c Sun Apr 23 08:37:36 2006 +++ grub2Hacked/util/misc.c Mon Jun 5 15:28:12 2006 @@ -24,7 +24,11 @@ #include #include #include + +#ifdef HAVE_MALLOC_H #include +#endif + #include #include @@ -228,8 +232,13 @@ grub_memalign (grub_size_t align, grub_size_t size) { void *p; - + +#ifdef HAVE_MEMALIGN p = memalign (align, size); +#else + grub_util_error ("memalign not available"); +#endif + if (! p) grub_util_error ("out of memory");