From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1FlF6R-0001sk-76 for mharc-grub-devel@gnu.org; Tue, 30 May 2006 21:02:27 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FlF6P-0001sF-MH for grub-devel@gnu.org; Tue, 30 May 2006 21:02:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FlF6O-0001s3-AY for grub-devel@gnu.org; Tue, 30 May 2006 21:02:24 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FlF6O-0001s0-5H for grub-devel@gnu.org; Tue, 30 May 2006 21:02:24 -0400 Received: from [212.85.152.101] (helo=kotoba.storever.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FlFCI-0004MZ-6h for grub-devel@gnu.org; Tue, 30 May 2006 21:08:30 -0400 Received: from kotoba.oasis.nexedi.com (kotoba.oasis.nexedi.com [212.85.152.101]) by kotoba.storever.com (Postfix) with ESMTP id A60133CACA35A for ; Wed, 31 May 2006 04:36:43 +0200 (CEST) Received: from [??1] (localhost [127.0.0.1]) by kotoba.storever.com (Postfix) with ESMTP id D003A3CACA359 for ; Wed, 31 May 2006 04:36:41 +0200 (CEST) From: "Yoshinori K. Okuji" Organization: enbug.org To: The development of GRUB 2 Date: Wed, 31 May 2006 03:02:20 +0200 User-Agent: KMail/1.8.2 References: <200605262104.55720.okuji@enbug.org> In-Reply-To: <200605262104.55720.okuji@enbug.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200605310302.20147.okuji@enbug.org> X-Bogosity: No, tests=bogofilter, spamicity=0.498098, version=0.17.2 Subject: Re: configure host and target 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: Wed, 31 May 2006 01:02:25 -0000 I describe the new build system a bit here. Maybe this should be written in somewhere else (such as INSTALL) as well... GRUB uses "target" and "host". "build" is not explicitly used. A target represents a native environment where GRUB runs. In reality, the target type affects: - the cpu type - the executable format (for now, must be ELF) The vendor and the operating system in a target type does not really matter, except for the choice of programs and supported executable formats, because you should specify a platform (such as firmware) by --with-platform to configure. A host type specifies an environment where utilities are executed. Unless you are cross-compiling GRUB, you do not have to care very much. The usage of compiler flags is the following: - CC, CFLAGS, CPPFLAGS, ASFLAGS and LDFLAGS are used for the host type. - If you need to specify non-standard locations for header files or libraries, you should specify CPPFLAGS or LDFLAGS. - If you cross-compile GRUB, you can set CC explicitly, but optionally. - You do not need to struggle with CFLAGS or ASFLAGS. This is required only if you intend to debug GRUB, or you want to optimize GRUB differently for an unknown reason. - TARGET_CC, TARGET_CFLAGS, TARGET_CPPFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS are used for the target type. - You might need to specify TARGET_CC explicitly, if you cross-compile GRUB. - You should not touch other TARGET_* variables, unless you understand what you are doing. Besides these flags, GRUB uses target-specific flags (here, "target" means a Makefile target, but not a target type in autoconf). This allows us to apply flags specific to each object. This design is based on automake, since the makefile generator in GRUB was influenced by automake significantly. For example, when compiling normal.mod, normal_mod_CFLAGS, normal_mod_LDFLAGS, etc. are applied as well as TARGET_CFLAGS, TARGET_LDFLAGS, etc. This part is important only for developers, as the user is not supposed to tweak these target-specific flags manually. Okuji