2009-01-01 Yves Blusseau <yves.blusseau@zetam.org>

* configure.ac: check external intl library
	* Makefile.in: add compiler and linker flags to properly compile with
	intl library
	* include/grub/i18n.h: add a check to disable NLS
	* util/misc.c (grub_util_init_nls): new function
	* include/grub/util/misc.h: likewise
	* util/elf/grub-mkimage.c: use the new function below to initialize NLS
	* util/grub-editenv.c: likewise
	* util/grub-emu.c: likewise
	* util/grub-fstest.c: likewise
	* util/grub-mkdevicemap.c: likewise
	* util/grub-mkfont.c: likewise
	* util/grub-mkrelpath.c: likewise
	* util/grub-probe.c: likewise
	* util/i386/pc/grub-mkimage.c: likewise
	* util/i386/pc/grub-setup.c: likewise
	* util/sparc64/ieee1275/grub-mkimage.c: likewise
	* util/sparc64/ieee1275/grub-ofpathname.c: likewise
	* util/sparc64/ieee1275/grub-setup.c: likewise
	* util/mkisofs/mkisofs.h: add a check to disable NLS
	* util/mkisofs/mkisofs.c: likewise
This commit is contained in:
Yves Blusseau 2010-01-01 21:32:30 +01:00
parent cec573c894
commit 2f1a3acf75
20 changed files with 115 additions and 70 deletions

View file

@ -1,6 +1,6 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
* Copyright (C) 2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -361,9 +361,8 @@ main (int argc, char *argv[])
int chrp = 0;
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
grub_util_init_nls ();
while (1)
{

View file

@ -1,7 +1,7 @@
/* grub-editenv.c - tool to edit environment block. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2008,2009 Free Software Foundation, Inc.
* Copyright (C) 2008,2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -256,9 +256,8 @@ main (int argc, char *argv[])
char *command;
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
grub_util_init_nls ();
/* Check for options. */
while (1)

View file

@ -1,6 +1,6 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
* Copyright (C) 2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -159,9 +159,8 @@ main (int argc, char *argv[])
int opt;
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
grub_util_init_nls ();
while ((opt = getopt_long (argc, argv, "r:d:m:vH:hV", options, 0)) != -1)
switch (opt)

View file

@ -1,7 +1,7 @@
/* grub-fstest.c - debug tool for filesystem driver */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2008,2009 Free Software Foundation, Inc.
* Copyright (C) 2008,2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -384,9 +384,8 @@ main (int argc, char *argv[])
int i, cmd, num_opts, image_index, num_disks = 1;
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
grub_util_init_nls ();
/* Find the first non option entry. */
for (num_opts = 1; num_opts < argc; num_opts++)

View file

@ -1,7 +1,7 @@
/* grub-mkdevicemap.c - make a device map file automatically */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc.
* Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -112,9 +112,8 @@ main (int argc, char *argv[])
int floppy_disks = 1;
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
grub_util_init_nls ();
/* Check for options. */
while (1)

View file

@ -1,6 +1,6 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2009 Free Software Foundation, Inc.
* Copyright (C) 2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -476,9 +476,8 @@ main (int argc, char *argv[])
memset (&font_info, 0, sizeof (font_info));
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
grub_util_init_nls ();
/* Check for options. */
while (1)

View file

@ -1,7 +1,7 @@
/* grub-mkrelpath.c - make a system path relative to its root */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2009 Free Software Foundation, Inc.
* Copyright (C) 2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -56,9 +56,8 @@ main (int argc, char *argv[])
char *argument, *relpath;
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
grub_util_init_nls ();
/* Check for options. */
while (1)

View file

@ -1,7 +1,7 @@
/* grub-probe.c - probe device information for a given path */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc.
* Copyright (C) 2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -338,9 +338,8 @@ main (int argc, char *argv[])
char *argument;
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
grub_util_init_nls ();
/* Check for options. */
while (1)

View file

@ -1,7 +1,7 @@
/* grub-mkimage.c - make a bootable image */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
* Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -351,9 +351,8 @@ main (int argc, char *argv[])
FILE *fp = stdout;
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
grub_util_init_nls ();
while (1)
{

View file

@ -1,7 +1,7 @@
/* grub-setup.c - make GRUB usable */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
* Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -641,9 +641,8 @@ main (int argc, char *argv[])
int must_embed = 0, force = 0, fs_probe = 1;
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
grub_util_init_nls ();
/* Check for options. */
while (1)

View file

@ -1,6 +1,6 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
* Copyright (C) 2002,2003,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -38,6 +38,7 @@
#include <grub/mm.h>
#include <grub/term.h>
#include <grub/time.h>
#include <grub/i18n.h>
#include "progname.h"
@ -566,3 +567,13 @@ make_system_path_relative_to_its_root (const char *path)
return buf3;
}
void
grub_util_init_nls (void)
{
#if ENABLE_NLS
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#endif /* ENABLE_NLS */
}

View file

@ -6,7 +6,7 @@
Copyright 1993 Yggdrasil Computing, Incorporated
Copyright (C) 2009 Free Software Foundation, Inc.
Copyright (C) 2009,2010 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -645,9 +645,11 @@ int FDECL2(main, int, argc, char **, argv){
char *log_file = 0;
set_program_name (argv[0]);
#if ENABLE_NLS
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#endif /* ENABLE_NLS */
if (argc < 2)
usage();

View file

@ -5,7 +5,7 @@
Copyright 1993 Yggdrasil Computing, Incorporated
Copyright (C) 2009 Free Software Foundation, Inc.
Copyright (C) 2009,2010 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -30,8 +30,21 @@
#include <prototyp.h>
#include <sys/stat.h>
#include <locale.h>
#include <libintl.h>
#if ENABLE_NLS
# include <locale.h>
# include <libintl.h>
#else /* ! ENABLE_NLS */
/* Disabled NLS.
The casts to 'const char *' serve the purpose of producing warnings
for invalid uses of the value returned from these functions.
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 */
#define _(str) gettext(str)
#define N_(str) str

View file

@ -1,7 +1,7 @@
/* grub-mkimage.c - make a bootable image */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2008,2009 Free Software Foundation, Inc.
* Copyright (C) 2008,2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -222,9 +222,8 @@ main (int argc, char *argv[])
FILE *fp = stdout;
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
grub_util_init_ls ();
while (1)
{

View file

@ -1,7 +1,7 @@
/* grub-ofpathname.c - Find OpenBOOT path for a given device */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2009 Free Software Foundation, Inc.
* Copyright (C) 2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -29,9 +29,8 @@ int main(int argc, char **argv)
char *of_path;
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
grub_util_init_nls ();
if (argc != 2)
{

View file

@ -1,7 +1,7 @@
/* grub-setup.c - make GRUB usable */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
* Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -620,9 +620,8 @@ main (int argc, char *argv[])
struct grub_setup_info ginfo;
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
grub_util_init_nls ();
init_info (&ginfo);
if (!parse_options (&ginfo, argc, argv))