From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MGNM1-00051I-Eb for mharc-grub-devel@gnu.org; Mon, 15 Jun 2009 21:20:49 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MGNM0-0004zv-6D for grub-devel@gnu.org; Mon, 15 Jun 2009 21:20:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MGNLv-0004vk-Te for grub-devel@gnu.org; Mon, 15 Jun 2009 21:20:47 -0400 Received: from [199.232.76.173] (port=44988 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGNLv-0004vh-Qy for grub-devel@gnu.org; Mon, 15 Jun 2009 21:20:43 -0400 Received: from c60.cesmail.net ([216.154.195.49]:56156) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1MGNLv-0008Jl-DT for grub-devel@gnu.org; Mon, 15 Jun 2009 21:20:43 -0400 Received: from unknown (HELO smtprelay2.cesmail.net) ([192.168.1.112]) by c60.cesmail.net with ESMTP; 15 Jun 2009 21:20:41 -0400 Received: from [192.168.0.22] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay2.cesmail.net (Postfix) with ESMTPSA id 4646A34C6D for ; Mon, 15 Jun 2009 21:25:51 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: References: Content-Type: text/plain Date: Mon, 15 Jun 2009 21:20:40 -0400 Message-Id: <1245115240.27324.26.camel@mj> Mime-Version: 1.0 X-Mailer: Evolution 2.26.2 (2.26.2-1.fc11) Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH 5/18] Check if cc is from apple toolchain 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: Tue, 16 Jun 2009 01:20:48 -0000 On Sat, 2009-05-30 at 16:47 +0200, Vladimir 'phcoder' Serbinenko wrote: > +dnl check if our compiler is apple cc > +dnl because it requires numerous workarounds > +AC_DEFUN(grub_apple_cc, We don't use lowercase names for macros. They could conflict with variable names. > -boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) > -Wl,-Ttext,7C00 > +boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)7C00 This looks like a hack. > +if test x$grub_cv_apple_target_cc == xyes ; then Autoconf uses single "=" in test. I believe old versions of bash would not accept "==". I have applied the fix for that. > +else > + TARGET_APPLE_CC=0 > +# Use linker script if present, otherwise use builtin -N script. > +AC_MSG_CHECKING([for option to link raw image]) The formatting is messed up here. > +AC_MSG_RESULT([$TARGET_IMG_LDFLAGS_AC]) That's out of place. > +if test "x$TARGET_APPLE_CC" != x1 ; then > grub_PROG_OBJCOPY_ABSOLUTE > +fi What's wrong with it? I actually think that we could drop that test entirely and use strip instead of objcopy in i386-pc. > +AC_SUBST(ASFLAGS) Maybe there is a way to detect Apple by the macros i > +ifneq ($(TARGET_APPLE_CC),1) > #{defsym}: #{pre_obj} > $(NM) -g --defined-only -P -p $< | sed 's/^\\([^ ]*\\).*/\\1 > #{mod_name}/' > $@ > +else > +#{defsym}: #{pre_obj} > + $(NM) -g -P -p $< | grep -E '^[a-zA-Z0-9_]* [TDS]' | sed 's/^ > \\([^ ]*\\).*/\\1 #{mod_name}/' > $@ > +endif This goes beyond the "Check if cc is from apple toolchain". It's a separate fix that is not explained. sed can generally do the same things as grep. Is it possible to have an expression that would work for GNU and Apple nm? I thought somebody would review the patches and object, but in this case, nobody looked :-( -- Regards, Pavel Roskin