commit-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grub2 ChangeLog THANKS config.h.in configure co...


From: Yoshinori K. Okuji
Subject: grub2 ChangeLog THANKS config.h.in configure co...
Date: Tue, 13 Jun 2006 22:50:01 +0000

CVSROOT:        /cvsroot/grub
Module name:    grub2
Changes by:     Yoshinori K. Okuji <okuji>      06/06/13 22:50:01

Modified files:
        .              : ChangeLog THANKS config.h.in configure 
                         configure.ac 
        include/grub/util: misc.h 
        util           : grub-emu.c misc.c 

Log message:
        2006-06-14  Yoshinori K. Okuji  <address@hidden>
        
                * util/misc.c: Include config.h.
                [!HAVE_MEMALIGN]: Do not include malloc.h.
                (grub_memalign): Use posix_memalign, if present. Then, use
                memalign, if present. Otherwise, emit an error.
        
                * util/grub-emu.c: Do not include malloc.h.
        
                * include/grub/util/misc.h: Include unistd.h. This is required 
for
                FreeBSD, because off_t is defined in unistd.h. Reported by 
Harley
                D. Eades III <address@hidden>.
        
                * configure.ac (AC_GNU_SOURCE): Added.
                (AC_CHECK_FUNCS): Check posix_memalign and memalign for the host
                type.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/grub2/ChangeLog?cvsroot=grub&r1=1.283&r2=1.284
http://cvs.savannah.gnu.org/viewcvs/grub2/THANKS?cvsroot=grub&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/grub2/config.h.in?cvsroot=grub&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/grub2/configure?cvsroot=grub&r1=1.40&r2=1.41
http://cvs.savannah.gnu.org/viewcvs/grub2/configure.ac?cvsroot=grub&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/grub2/include/grub/util/misc.h?cvsroot=grub&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/grub2/util/grub-emu.c?cvsroot=grub&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/grub2/util/misc.c?cvsroot=grub&r1=1.14&r2=1.15

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/grub/grub2/ChangeLog,v
retrieving revision 1.283
retrieving revision 1.284
diff -u -b -r1.283 -r1.284
--- ChangeLog   8 Jun 2006 22:30:25 -0000       1.283
+++ ChangeLog   13 Jun 2006 22:50:00 -0000      1.284
@@ -1,3 +1,20 @@
+2006-06-14  Yoshinori K. Okuji  <address@hidden>
+
+       * util/misc.c: Include config.h.
+       [!HAVE_MEMALIGN]: Do not include malloc.h.
+       (grub_memalign): Use posix_memalign, if present. Then, use
+       memalign, if present. Otherwise, emit an error.
+
+       * util/grub-emu.c: Do not include malloc.h.
+
+       * include/grub/util/misc.h: Include unistd.h. This is required for
+       FreeBSD, because off_t is defined in unistd.h. Reported by Harley
+       D. Eades III <address@hidden>.
+
+       * configure.ac (AC_GNU_SOURCE): Added.
+       (AC_CHECK_FUNCS): Check posix_memalign and memalign for the host
+       type.
+
 2006-06-09  Yoshinori K. Okuji  <address@hidden>
 
        * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Make sure that

Index: THANKS
===================================================================
RCS file: /cvsroot/grub/grub2/THANKS,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- THANKS      8 May 2006 19:29:10 -0000       1.12
+++ THANKS      13 Jun 2006 22:50:00 -0000      1.13
@@ -7,9 +7,10 @@
 generally assist in the GRUB 2 maintainership process:
 
 Guillem Jover <address@hidden>
+Harley D. Eades III <address@hidden>
+Hollis Blanchard <address@hidden>
 Jeroen Dekkers <address@hidden>
 Johan Rydberg <address@hidden>
-Hollis Blanchard <address@hidden>
 Marco Gerards <address@hidden>
 NIIBE Yutaka <address@hidden>
 Omniflux <address@hidden>

Index: config.h.in
===================================================================
RCS file: /cvsroot/grub/grub2/config.h.in,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- config.h.in 4 Jun 2006 12:59:19 -0000       1.10
+++ config.h.in 13 Jun 2006 22:50:00 -0000      1.11
@@ -31,6 +31,9 @@
 /* Define to 1 if you have the <lzo/lzo1x.h> header file. */
 #undef HAVE_LZO_LZO1X_H
 
+/* Define to 1 if you have the `memalign' function. */
+#undef HAVE_MEMALIGN
+
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
@@ -40,6 +43,9 @@
 /* Define to 1 if you have the <ncurses.h> header file. */
 #undef HAVE_NCURSES_H
 
+/* Define to 1 if you have the `posix_memalign' function. */
+#undef HAVE_POSIX_MEMALIGN
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
@@ -101,5 +107,10 @@
 /* Number of bits in a file offset, on hosts where this is settable. */
 #undef _FILE_OFFSET_BITS
 
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+
 /* Define for large files, on AIX-style hosts. */
 #undef _LARGE_FILES

Index: configure
===================================================================
RCS file: /cvsroot/grub/grub2/configure,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -b -r1.40 -r1.41
--- configure   4 Jun 2006 12:59:19 -0000       1.40
+++ configure   13 Jun 2006 22:50:00 -0000      1.41
@@ -2710,6 +2710,12 @@
    { (exit 1); exit 1; }; }
 
 
+cat >>confdefs.h <<\_ACEOF
+#define _GNU_SOURCE 1
+_ACEOF
+
+
+
 # Check whether --enable-largefile or --disable-largefile was given.
 if test "${enable_largefile+set}" = set; then
   enableval="$enable_largefile"
@@ -5392,6 +5398,111 @@
 done
 
 
+# Check for functions.
+
+
+for ac_func in posix_memalign memalign
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares 
$ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
 #
 # Check for target programs.
 #

Index: configure.ac
===================================================================
RCS file: /cvsroot/grub/grub2/configure.ac,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- configure.ac        4 Jun 2006 12:59:19 -0000       1.31
+++ configure.ac        13 Jun 2006 22:50:00 -0000      1.32
@@ -114,6 +114,7 @@
 # Must be GCC.
 test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
 
+AC_GNU_SOURCE
 AC_SYS_LARGEFILE
 
 # Identify characteristics of the host architecture.
@@ -152,6 +153,9 @@
 # Check for headers.
 AC_CHECK_HEADERS(ncurses/curses.h ncurses.h curses.h)
 
+# Check for functions.
+AC_CHECK_FUNCS(posix_memalign memalign)
+
 #
 # Check for target programs.
 #

Index: include/grub/util/misc.h
===================================================================
RCS file: /cvsroot/grub/grub2/include/grub/util/misc.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- include/grub/util/misc.h    15 Feb 2005 00:07:01 -0000      1.7
+++ include/grub/util/misc.h    13 Jun 2006 22:50:00 -0000      1.8
@@ -1,6 +1,6 @@
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2002,2003,2005  Free Software Foundation, Inc.
+ *  Copyright (C) 2002,2003,2005,2006  Free Software Foundation, Inc.
  *
  *  GRUB is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -23,6 +23,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <setjmp.h>
+#include <unistd.h>
 
 extern char *progname;
 extern int verbosity;

Index: util/grub-emu.c
===================================================================
RCS file: /cvsroot/grub/grub2/util/grub-emu.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- util/grub-emu.c     26 Apr 2006 21:58:36 -0000      1.29
+++ util/grub-emu.c     13 Jun 2006 22:50:01 -0000      1.30
@@ -18,7 +18,6 @@
  */
 
 #include <stdlib.h>
-#include <malloc.h>
 #include <sys/stat.h>
 #include <argp.h>
 #include <string.h>

Index: util/misc.c
===================================================================
RCS file: /cvsroot/grub/grub2/util/misc.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- util/misc.c 23 Apr 2006 13:37:36 -0000      1.14
+++ util/misc.c 13 Jun 2006 22:50:01 -0000      1.15
@@ -1,6 +1,6 @@
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2002,2003,2005  Free Software Foundation, Inc.
+ *  Copyright (C) 2002,2003,2005,2006  Free Software Foundation, Inc.
  *
  *  GRUB is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -17,6 +17,8 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <config.h>
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
@@ -24,7 +26,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/time.h>
-#include <malloc.h>
 #include <unistd.h>
 
 #include <grub/util/misc.h>
@@ -32,6 +33,12 @@
 #include <grub/term.h>
 #include <grub/machine/time.h>
 
+/* Include malloc.h, only if memalign is available. It is known that
+   memalign is declared in malloc.h in all systems, if present.  */
+#ifdef HAVE_MEMALIGN
+# include <malloc.h>
+#endif
+
 char *progname = 0;
 int verbosity = 0;
 
@@ -229,7 +236,15 @@
 {
   void *p;
   
+#if defined(HAVE_POSIX_MEMALIGN)
+  if (posix_memalign (&p, align, size) != 0)
+    p = 0;
+#elif defined(HAVE_MEMALIGN)
   p = memalign (align, size);
+#else
+  grub_util_error ("grub_memalign is not supported");
+#endif
+  
   if (! p)
     grub_util_error ("out of memory");
   




reply via email to

[Prev in Thread] Current Thread [Next in Thread]