From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XVjXN-0004LM-ME for mharc-grub-devel@gnu.org; Sun, 21 Sep 2014 11:58:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVjXH-0004KS-Fz for grub-devel@gnu.org; Sun, 21 Sep 2014 11:58:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XVjXB-00048z-HE for grub-devel@gnu.org; Sun, 21 Sep 2014 11:58:51 -0400 Received: from mail-we0-x22c.google.com ([2a00:1450:400c:c03::22c]:60414) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVjXB-000484-63 for grub-devel@gnu.org; Sun, 21 Sep 2014 11:58:45 -0400 Received: by mail-we0-f172.google.com with SMTP id p10so1358463wes.3 for ; Sun, 21 Sep 2014 08:58:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=QFs7/tu8NfknFyPA4aR0VjKC3wHmXE/Ws+g6YPMBCwA=; b=vMZ3zrMfb0EOJj3z3zPje5tMlPTo5hJi8Tx6MXAlKcvjdnSTjZQ/1zeNzE7dbXNB+q tys74O4tMcSyL+d5PLaTSLNiFI44OJ9oDzWC8G5FKN88mrFteOhSk8Qirlcmz5G1p3J1 JngCV2/IXDAgWSmSnTtjIiqEInsXEPXKNUcJ2i1N6K62ULsfMZH1VyodHSLVxo7O+xLM 4Q7n2BfVdlTOoMK6GUhxGR6UD/j/pm/TIp7xuEqNn93XcbkCJiuc1SPkwkIfetuSAZcp fYsrIPw1Q7zW7NyTswWv58tzYviKLSc+xdkHlSNh8Dy9FyO3dybXBe+13jDFVBUNRiRz e/uQ== X-Received: by 10.180.72.211 with SMTP id f19mr3512980wiv.39.1411315119303; Sun, 21 Sep 2014 08:58:39 -0700 (PDT) Received: from [192.168.42.4] (160-228.197-178.cust.bluewin.ch. [178.197.228.160]) by mx.google.com with ESMTPSA id hk8sm5355186wib.18.2014.09.21.08.58.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Sep 2014 08:58:38 -0700 (PDT) Message-ID: <541EF5AC.7090905@gmail.com> Date: Sun, 21 Sep 2014 17:58:36 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH] Add a new "none" platform that only builds utilities References: <20140908012205.GE5681@riva.ucam.org> In-Reply-To: <20140908012205.GE5681@riva.ucam.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="foUXuwbD8s7VIG1KGaWHStSHpHPv2WMxS" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c03::22c X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 15:58:56 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --foUXuwbD8s7VIG1KGaWHStSHpHPv2WMxS Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Go ahead. On 08.09.2014 03:22, Colin Watson wrote: > This makes it possible to build generally-useful utilities such as > grub-mount even if the rest of GRUB has not been ported to the target > CPU. >=20 > * configure.ac: Add "none" platform. Default to it for unsupported > CPUs rather than stopping with a fatal error. Don't downgrade > x86_64-none to i386. Define COND_real_platform Automake conditional > if the platform is anything other than "none". Don't do any include > directory linking for "none". > * Makefile.am: Skip building grub-core and all bootcheck targets if > !COND_real_platform. > * include/grub/time.h: Don't include if GRUB_UTIL > is defined. > --- > ChangeLog | 14 ++++++++++++++ > Makefile.am | 14 +++++++++++--- > configure.ac | 46 +++++++++++++++++++++++++++++----------------= - > include/grub/time.h | 2 +- > 4 files changed, 55 insertions(+), 21 deletions(-) >=20 > diff --git a/ChangeLog b/ChangeLog > index 572ee50..8d86b3f 100644 > --- a/ChangeLog > +++ b/ChangeLog > @@ -1,3 +1,17 @@ > +2014-09-08 Colin Watson > + > + Add a new "none" platform that only builds utilities > + > + * configure.ac: Add "none" platform. Default to it for unsupported > + CPUs rather than stopping with a fatal error. Don't downgrade > + x86_64-none to i386. Define COND_real_platform Automake conditional > + if the platform is anything other than "none". Don't do any include > + directory linking for "none". > + * Makefile.am: Skip building grub-core and all bootcheck targets if > + !COND_real_platform. > + * include/grub/time.h: Don't include if GRUB_UTIL > + is defined. > + > 2014-09-07 Colin Watson > =20 > Support grub-emu on x32 (ILP32 but with x86-64 instruction set) > diff --git a/Makefile.am b/Makefile.am > index f02ae0a..cc537a2 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -1,7 +1,11 @@ > AUTOMAKE_OPTIONS =3D subdir-objects -Wno-portability > =20 > DEPDIR =3D .deps-util > -SUBDIRS =3D grub-core/gnulib . grub-core po docs util/bash-completion.= d > +SUBDIRS =3D grub-core/gnulib . > +if COND_real_platform > +SUBDIRS +=3D grub-core > +endif > +SUBDIRS +=3D po docs util/bash-completion.d > =20 > include $(top_srcdir)/conf/Makefile.common > include $(top_srcdir)/conf/Makefile.extra-dist > @@ -132,6 +136,8 @@ nodist_platform_HEADERS =3D config.h > pkgdata_DATA +=3D grub-mkconfig_lib > =20 > =20 > +if COND_real_platform > + > if COND_i386_coreboot > QEMU32=3Dqemu-system-i386 > endif > @@ -383,8 +389,6 @@ if COND_powerpc_ieee1275 > BOOTCHECKS =3D bootcheck-linux-ppc > endif > =20 > -EXTRA_DIST +=3D grub-core/tests/boot/kbsd.init-i386.S grub-core/tests/= boot/kbsd.init-x86_64.S grub-core/tests/boot/kbsd.spec.txt grub-core/test= s/boot/kernel-8086.S grub-core/tests/boot/kernel-i386.S grub-core/tests/b= oot/kfreebsd-aout.cfg grub-core/tests/boot/kfreebsd.cfg grub-core/tests/b= oot/kfreebsd.init-i386.S grub-core/tests/boot/kfreebsd.init-x86_64.S grub= -core/tests/boot/knetbsd.cfg grub-core/tests/boot/kopenbsd.cfg grub-core/= tests/boot/kopenbsdlabel.txt grub-core/tests/boot/linux16.cfg grub-core/t= ests/boot/linux.cfg grub-core/tests/boot/linux.init-i386.S grub-core/test= s/boot/linux.init-mips.S grub-core/tests/boot/linux.init-ppc.S grub-core/= tests/boot/linux.init-x86_64.S grub-core/tests/boot/linux-ppc.cfg grub-co= re/tests/boot/multiboot2.cfg grub-core/tests/boot/multiboot.cfg grub-core= /tests/boot/ntldr.cfg grub-core/tests/boot/pc-chainloader.cfg grub-core/t= ests/boot/qemu-shutdown-x86.S > - > .PHONY: bootcheck-linux-i386 bootcheck-linux-x86_64 \ > bootcheck-kfreebsd-i386 bootcheck-kfreebsd-x86_64 \ > bootcheck-knetbsd-i386 bootcheck-knetbsd-x86_64 \ > @@ -402,6 +406,10 @@ default_payload.elf: grub-mkstandalone grub-mkimag= e > pkgdatadir=3D. ./grub-mkstandalone --grub-mkimage=3D./grub-mkimage -O= i386-coreboot -o $@ --modules=3D'ahci pata ehci uhci ohci usb_keyboard u= sbms part_msdos xfs ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs= ' --install-modules=3D'ls linux search configfile normal cbtime cbls memr= w iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsa= cpi chain test serial multiboot cbmemc linux16 gzio echo help' --fonts=3D= --themes=3D --locales=3D -d grub-core/ /boot/grub/grub.cfg=3D$(srcdir)/c= oreboot.cfg > endif > =20 > +endif > + > +EXTRA_DIST +=3D grub-core/tests/boot/kbsd.init-i386.S grub-core/tests/= boot/kbsd.init-x86_64.S grub-core/tests/boot/kbsd.spec.txt grub-core/test= s/boot/kernel-8086.S grub-core/tests/boot/kernel-i386.S grub-core/tests/b= oot/kfreebsd-aout.cfg grub-core/tests/boot/kfreebsd.cfg grub-core/tests/b= oot/kfreebsd.init-i386.S grub-core/tests/boot/kfreebsd.init-x86_64.S grub= -core/tests/boot/knetbsd.cfg grub-core/tests/boot/kopenbsd.cfg grub-core/= tests/boot/kopenbsdlabel.txt grub-core/tests/boot/linux16.cfg grub-core/t= ests/boot/linux.cfg grub-core/tests/boot/linux.init-i386.S grub-core/test= s/boot/linux.init-mips.S grub-core/tests/boot/linux.init-ppc.S grub-core/= tests/boot/linux.init-x86_64.S grub-core/tests/boot/linux-ppc.cfg grub-co= re/tests/boot/multiboot2.cfg grub-core/tests/boot/multiboot.cfg grub-core= /tests/boot/ntldr.cfg grub-core/tests/boot/pc-chainloader.cfg grub-core/t= ests/boot/qemu-shutdown-x86.S > + > windowsdir=3D$(top_builddir)/$(PACKAGE)-$(VERSION)-for-windows > windowsdir: $(PROGRAMS) $(starfield_DATA) $(platform_DATA) > test -d $(windowsdir) && rm -rf $(windowsdir) || true > diff --git a/configure.ac b/configure.ac > index 8662bac..fdf0fdc 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -125,7 +125,10 @@ if test "x$with_platform" =3D x; then > ia64-*) platform=3Defi ;; > arm-*) platform=3Duboot ;; > arm64-*) platform=3Defi ;; > - *) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;; > + *) > + AC_MSG_WARN([unsupported CPU: "$target_cpu" - only building util= ities]) > + platform=3Dnone > + ;; > esac > else > platform=3D"$with_platform" > @@ -135,6 +138,7 @@ case "$target_cpu"-"$platform" in > x86_64-efi) ;; > x86_64-emu) ;; > x86_64-xen) ;; > + x86_64-none) ;; > x86_64-*) target_cpu=3Di386 ;; > powerpc64-ieee1275) target_cpu=3Dpowerpc ;; > esac > @@ -167,6 +171,7 @@ case "$target_cpu"-"$platform" in > arm-efi) ;; > arm64-efi) ;; > *-emu) ;; > + *-none) ;; > *) AC_MSG_ERROR([platform "$platform" is not supported for target CP= U "$target_cpu"]) ;; > esac > =20 > @@ -1653,6 +1658,7 @@ AC_SUBST(BUILD_LIBM) > # Automake conditionals > # > =20 > +AM_CONDITIONAL([COND_real_platform], [test x$platform !=3D xnone]) > AM_CONDITIONAL([COND_emu], [test x$platform =3D xemu]) > AM_CONDITIONAL([COND_clang], [test x$grub_cv_cc_target_clang =3D xyes]= ) > AM_CONDITIONAL([COND_i386_pc], [test x$target_cpu =3D xi386 -a x$platf= orm =3D xpc]) > @@ -1726,24 +1732,30 @@ AC_DEFINE_UNQUOTED(GRUB_SYSCONFDIR, "$grub_sysc= onfdir", [Configuration dir]) > =20 > =20 > # Output files. > -cpudir=3D"${target_cpu}" > -if test x${cpudir} =3D xmipsel; then > - cpudir=3Dmips; > -fi > -grub_CHECK_LINK_DIR > -if test x"$link_dir" =3D xyes ; then > - AC_CONFIG_LINKS([include/grub/cpu:include/grub/$cpudir]) > - if test "$platform" !=3D emu ; then > - AC_CONFIG_LINKS([include/grub/machine:include/grub/$cpudir/$platfo= rm]) > +if test "$platform" !=3D none; then > + cpudir=3D"${target_cpu}" > + if test x${cpudir} =3D xmipsel; then > + cpudir=3Dmips; > fi > -else > - mkdir -p include/grub 2>/dev/null > - rm -rf include/grub/cpu > - cp -rp $srcdir/include/grub/$cpudir include/grub/cpu 2>/dev/null > - if test "$platform" !=3D emu ; then > - rm -rf include/grub/machine > - cp -rp $srcdir/include/grub/$cpudir/$platform include/grub/machine= 2>/dev/null > + grub_CHECK_LINK_DIR > + if test x"$link_dir" =3D xyes ; then > + AC_CONFIG_LINKS([include/grub/cpu:include/grub/$cpudir]) > + if test "$platform" !=3D emu ; then > + AC_CONFIG_LINKS([include/grub/machine:include/grub/$cpudir/$plat= form]) > + fi > + else > + mkdir -p include/grub 2>/dev/null > + rm -rf include/grub/cpu > + cp -rp $srcdir/include/grub/$cpudir include/grub/cpu 2>/dev/null > + if test "$platform" !=3D emu ; then > + rm -rf include/grub/machine > + cp -rp $srcdir/include/grub/$cpudir/$platform include/grub/machi= ne 2>/dev/null > + fi > fi > +else > + # Just enough to stop the compiler failing with -I$(srcdir)/include.= > + mkdir -p include 2>/dev/null > + rm -rf include/grub > fi > =20 > AC_CONFIG_FILES([Makefile]) > diff --git a/include/grub/time.h b/include/grub/time.h > index 64ac99a..c919c1f 100644 > --- a/include/grub/time.h > +++ b/include/grub/time.h > @@ -21,7 +21,7 @@ > =20 > #include > #include > -#ifndef GRUB_MACHINE_EMU > +#if !defined(GRUB_MACHINE_EMU) && !defined(GRUB_UTIL) > #include > #else > static inline void >=20 --foUXuwbD8s7VIG1KGaWHStSHpHPv2WMxS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iF4EAREKAAYFAlQe9awACgkQmBXlbbo5nOu/8gD/WApifBMDYNStoOlt2XhKhtfv 2ZVos2VmZb7V1w5EfbkA/iFv1B2444harM0FzJ798FDdYgaJRqBY5aDWFGB+A5MK =hdep -----END PGP SIGNATURE----- --foUXuwbD8s7VIG1KGaWHStSHpHPv2WMxS--