From 38e55e905886e905f0a7d966e0a61cb50c86909f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Sutre?= Date: Sun, 18 Apr 2010 19:57:50 +0200 Subject: [PATCH] TARGET_IMG_LDFLAGS_AC now always expects a number appended to it. Fixed grub_prefix in grub-mkconfig for NetBSD and OpenBSD. --- ChangeLog | 9 +++++++++ acinclude.m4 | 2 +- configure.ac | 4 ++-- util/grub-mkconfig.in | 18 +++++++++++++++--- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6f39713a2..796d5614d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-04-18 Grégoire Sutre + + * util/grub-mkconfig.in: Corrected two == equality tests. + Set grub_prefix as in grub-install for NetBSD and OpenBSD. + * configure.ac: All definitions and uses of TARGET_IMG_LDFLAGS_AC now + expect a number appended to it. + * acinclude.m4 (grub_PROG_OBJCOPY_ABSOLUTE): ${TARGET_IMG_LDFLAGS_AC} + expects a number appended to it. + 2010-04-18 Vladimir Serbinenko * po/POTFILES: Renamed multiboot_loader.c to multiboot.c diff --git a/acinclude.m4 b/acinclude.m4 index 692404e20..72483b5d0 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -93,7 +93,7 @@ else fi grub_cv_prog_objcopy_absolute=yes for link_addr in 0x2000 0x8000 0x7C00; do - if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -nostdlib ${TARGET_IMG_LDFLAGS_AC} -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then : + if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -nostdlib ${TARGET_IMG_LDFLAGS_AC}$link_addr conftest.o -o conftest.exec]); then : else AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr]) fi diff --git a/configure.ac b/configure.ac index 3116d6584..5b959fb01 100644 --- a/configure.ac +++ b/configure.ac @@ -360,7 +360,7 @@ else if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT} -Wl,-Ttext," - TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" + TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc -Wl,-Ttext," else TARGET_IMG_LDSCRIPT= TARGET_IMG_LDFLAGS='-Wl,-N -Wl,-Ttext,' @@ -515,7 +515,7 @@ grub_PROG_LD_BUILD_ID_NONE if test "x$target_cpu" = xi386; then if test ! -z "$TARGET_IMG_LDSCRIPT"; then # Check symbols provided by linker script. - CFLAGS="$TARGET_CFLAGS -nostdlib $TARGET_IMG_LDFLAGS_AC -Wl,-Ttext,8000,--defsym,___main=0x8100" + CFLAGS="$TARGET_CFLAGS -nostdlib ${TARGET_IMG_LDFLAGS_AC}8000,--defsym,___main=0x8100" fi if test "x$TARGET_APPLE_CC" != x1 ; then grub_CHECK_BSS_START_SYMBOL diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index b98bbc993..4e476ae06 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -24,10 +24,10 @@ sbindir=@sbindir@ libdir=@libdir@ sysconfdir=@sysconfdir@ package_version=@PACKAGE_VERSION@ +host_os=@host_os@ datarootdir=@datarootdir@ datadir=@datadir@ pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"` -grub_prefix=`echo /boot/grub | sed ${transform}` grub_cfg="" grub_mkconfig_dir=${sysconfdir}/grub.d @@ -75,6 +75,18 @@ done . ${libdir}/grub/grub-mkconfig_lib +case "$host_os" in +netbsd* | openbsd*) + # Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub + # instead of /boot/grub. + grub_prefix=`echo /grub | sed ${transform}` + ;; +*) + # Use /boot/grub by default. + grub_prefix=`echo /boot/grub | sed ${transform}` + ;; +esac + if [ "x$EUID" = "x" ] ; then EUID=`id -u` fi @@ -141,13 +153,13 @@ if [ "x${GRUB_TERMINAL}" != "x" ] ; then fi termoutdefault=0 -if [ "x${GRUB_TERMINAL_OUTPUT}" == x ]; then +if [ "x${GRUB_TERMINAL_OUTPUT}" = "x" ]; then GRUB_TERMINAL_OUTPUT=gfxterm; termoutdefault=1; fi for x in ${GRUB_TERMINAL_OUTPUT}; do - if [ x${x} == xgfxterm ]; then + if [ "x${x}" = "xgfxterm" ]; then # If this platform supports gfxterm, try to use it. if ! test -e ${grub_prefix}/gfxterm.mod ; then if [ "x$termoutdefault" != "x1" ]; then