From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NZLdZ-0002nh-Qp for mharc-grub-devel@gnu.org; Mon, 25 Jan 2010 04:53:37 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZLdY-0002nK-0v for grub-devel@gnu.org; Mon, 25 Jan 2010 04:53:36 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZLdT-0002n8-5h for grub-devel@gnu.org; Mon, 25 Jan 2010 04:53:35 -0500 Received: from [199.232.76.173] (port=47762 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZLdT-0002n5-2O; Mon, 25 Jan 2010 04:53:31 -0500 Received: from mail-bw0-f219.google.com ([209.85.218.219]:40312) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NZLdS-0007Vz-F2; Mon, 25 Jan 2010 04:53:30 -0500 Received: by bwz19 with SMTP id 19so2543745bwz.8 for ; Mon, 25 Jan 2010 01:53:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type; bh=86lw8lmacqys3yY1lWEVrXBArxD/z0+iwT8Zk2PIpqA=; b=wuGTn8wTwrHIaklScruTWbJBt4O9/E/k2J9cpgyJyHD192vq525f2Yx0mg4P1hu6l/ MbhRd9tYpBK9mFRxsLEzyLT5RhI/tnMNQEIVi/bAjC8xHsbzoLU5fwk51648bvQLCh4S CEuiPKz0WyrQhxsHCG0EC7BbyqZzzKhHHPzlg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type; b=RFG81U0S6spnNcG/QAT+4PgnNRt6wLZVTo2IkpFqrruGnHM+vhDapuW6IwwWiLxadq 5z4JRo1oBT58NS6ElQrTCDJH0OmVrpdOFWna2lSJ4E2OIgThqEgzg3HHWFxh9SU4wcBE bJtqFXBe6m8pfDGAwkCFL/1hVFp9cBTelovE0= Received: by 10.204.10.136 with SMTP id p8mr1102565bkp.56.1264413209257; Mon, 25 Jan 2010 01:53:29 -0800 (PST) Received: from ?192.168.1.50? (c2433-1-88-160-112-182.fbx.proxad.net [88.160.112.182]) by mx.google.com with ESMTPS id 13sm2049558bwz.10.2010.01.25.01.53.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 25 Jan 2010 01:53:29 -0800 (PST) Message-ID: <4B5D6A18.2040204@gmail.com> Date: Mon, 25 Jan 2010 10:53:28 +0100 From: =?ISO-8859-1?Q?Gr=E9goire_Sutre?= User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707) MIME-Version: 1.0 To: The development of GNU GRUB Content-Type: multipart/mixed; boundary="------------000109070604040602010208" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: bug-gnulib@gnu.org Subject: [PATCH] Fix use of ENABLE_NLS (which is not always defined) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 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: Mon, 25 Jan 2010 09:53:36 -0000 This is a multi-part message in MIME format. --------------000109070604040602010208 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Hi, This message concerns both gnulib and grub. As discussed on irc and on the list [1], ENABLE_NLS is not used correctly, which leads to a build failure when gettext is not detected (or with configure option --disable-nls). ENABLE_NLS is defined in AM_GNU_GETTEXT and the documentation of this macro [2] does not require ENABLE_NLS to be defined when gettext is not available. However, uses of ENABLE_NLS assume it to be defined, which is not correct. The attached patch fixes the problem for grub. For gnulib, running the following command on the source tree should solve the problem: find . -name '*.[ch]' -exec sed -i -e 's, ENABLE_NLS, (defined(ENABLE_NLS) \&\& ENABLE_NLS),g' '{}' ';' Best regards, Grégoire [1] http://lists.gnu.org/archive/html/grub-devel/2010-01/msg00288.html [2] http://www.gnu.org/software/hello/manual/gettext/AM_005fGNU_005fGETTEXT.html --------------000109070604040602010208 Content-Type: text/x-patch; name="patch-enable-nls.diff" Content-Transfer-Encoding: 8bit Content-Disposition: inline; filename="patch-enable-nls.diff" === modified file 'ChangeLog' --- ChangeLog 2010-01-25 09:06:55 +0000 +++ ChangeLog 2010-01-25 09:24:09 +0000 @@ -1,5 +1,18 @@ 2010-01-25 GrĂ©goire Sutre + Fix a build failure (-Wundef -Werror) when ENABLE_NLS is not defined, + which is the case with --disabled-nls. + + * gnulib/error.c: use (defined(ENABLE_NLS) && ENABLE_NLS) instead of + ENABLE_NLS in all #if preprocessor macros. + * gnulib/gettext.h: likewise. + * include/grub/i18n.h: likewise. + * util/misc.c: likewise. + * util/mkisofs/mkisofs.c: likewise. + * util/mkisofs/mkisofs.h: likewise. + +2010-01-25 GrĂ©goire Sutre + * configure.ac: Check for `limits.h'. * util/misc.c: Include `' (for PATH_MAX). === modified file 'gnulib/error.c' --- gnulib/error.c 2009-11-16 18:49:44 +0000 +++ gnulib/error.c 2010-01-25 09:22:09 +0000 @@ -28,7 +28,7 @@ #include #include -#if !_LIBC && ENABLE_NLS +#if !_LIBC && (defined(ENABLE_NLS) && ENABLE_NLS) # include "gettext.h" # define _(msgid) gettext (msgid) #endif === modified file 'gnulib/gettext.h' --- gnulib/gettext.h 2009-11-09 19:16:09 +0000 +++ gnulib/gettext.h 2010-01-25 09:22:09 +0000 @@ -19,7 +19,7 @@ #define _LIBGETTEXT_H 1 /* NLS can be disabled through the configure --disable-nls option. */ -#if ENABLE_NLS +#if (defined(ENABLE_NLS) && ENABLE_NLS) /* Get declarations of GNU message catalog functions. */ # include === modified file 'include/grub/i18n.h' --- include/grub/i18n.h 2010-01-01 20:32:30 +0000 +++ include/grub/i18n.h 2010-01-25 09:22:08 +0000 @@ -26,7 +26,7 @@ extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s); /* NLS can be disabled through the configure --disable-nls option. */ -#if ENABLE_NLS +#if (defined(ENABLE_NLS) && ENABLE_NLS) # ifdef GRUB_UTIL @@ -35,7 +35,7 @@ # endif /* GRUB_UTIL */ -#else /* ! ENABLE_NLS */ +#else /* ! (defined(ENABLE_NLS) && ENABLE_NLS) */ /* Disabled NLS. The casts to 'const char *' serve the purpose of producing warnings @@ -48,7 +48,7 @@ # define grub_gettext(str) ((const char *) (str)) # endif /* GRUB_UTIL */ -#endif /* ENABLE_NLS */ +#endif /* (defined(ENABLE_NLS) && ENABLE_NLS) */ #ifdef GRUB_UTIL # define _(str) gettext(str) === modified file 'util/misc.c' --- util/misc.c 2010-01-25 09:06:55 +0000 +++ util/misc.c 2010-01-25 09:22:07 +0000 @@ -598,9 +598,9 @@ void grub_util_init_nls (void) { -#if ENABLE_NLS +#if (defined(ENABLE_NLS) && ENABLE_NLS) setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); -#endif /* ENABLE_NLS */ +#endif /* (defined(ENABLE_NLS) && ENABLE_NLS) */ } === modified file 'util/mkisofs/mkisofs.c' --- util/mkisofs/mkisofs.c 2010-01-08 15:22:40 +0000 +++ util/mkisofs/mkisofs.c 2010-01-25 09:22:06 +0000 @@ -640,11 +640,11 @@ char *log_file = 0; set_program_name (argv[0]); -#if ENABLE_NLS +#if (defined(ENABLE_NLS) && ENABLE_NLS) setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); -#endif /* ENABLE_NLS */ +#endif /* (defined(ENABLE_NLS) && ENABLE_NLS) */ if (argc < 2) usage(); === modified file 'util/mkisofs/mkisofs.h' --- util/mkisofs/mkisofs.h 2010-01-01 20:32:30 +0000 +++ util/mkisofs/mkisofs.h 2010-01-25 09:22:06 +0000 @@ -30,12 +30,12 @@ #include #include -#if ENABLE_NLS +#if (defined(ENABLE_NLS) && ENABLE_NLS) # include # include -#else /* ! ENABLE_NLS */ +#else /* ! (defined(ENABLE_NLS) && ENABLE_NLS) */ /* Disabled NLS. The casts to 'const char *' serve the purpose of producing warnings @@ -43,7 +43,7 @@ On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ # define gettext(Msgid) ((const char *) (Msgid)) -#endif /* ENABLE_NLS */ +#endif /* (defined(ENABLE_NLS) && ENABLE_NLS) */ #define _(str) gettext(str) #define N_(str) str --------------000109070604040602010208--