mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 23:03:04 +00:00
package: make bison a relocatable package
Suggested by David Barto https://lists.gnu.org/archive/html/help-bison/2015-02/msg00004.html and Victor Zverovich. https://lists.gnu.org/archive/html/bison-patches/2018-10/msg00121.html This is very easy to do, thanks to work by Bruno Haible in gnulib. See "Supporting Relocation" in gnulib's documentation. * bootstrap.conf: We need relocatable-prog and relocatable-script (for yacc). * src/yacc.in: New. * configure.ac, src/local.mk: Instantiate it. * src/main.c, src/output.c (main, pkgdatadir): Use relocatable2. * doc/bison.texi (FAQ): Document it.
This commit is contained in:
11
src/main.c
11
src/main.c
@@ -26,6 +26,7 @@
|
||||
#include <configmake.h>
|
||||
#include <progname.h>
|
||||
#include <quotearg.h>
|
||||
#include <relocatable.h> /* relocate2 */
|
||||
#include <timevar.h>
|
||||
|
||||
#include "LR0.h"
|
||||
@@ -58,10 +59,16 @@
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
#define DEPENDS_ON_LIBINTL 1
|
||||
set_program_name (argv[0]);
|
||||
setlocale (LC_ALL, "");
|
||||
(void) bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
(void) bindtextdomain ("bison-runtime", LOCALEDIR);
|
||||
{
|
||||
char *cp = NULL;
|
||||
char const *localedir = relocate2 (LOCALEDIR, &cp);
|
||||
(void) bindtextdomain (PACKAGE, localedir);
|
||||
(void) bindtextdomain ("bison-runtime", localedir);
|
||||
free (cp);
|
||||
}
|
||||
(void) textdomain (PACKAGE);
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user