Files
bison/src/yacc.in
Akim Demaille a4ede8f85b 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.
2018-12-25 10:05:36 +01:00

23 lines
487 B
Bash

#! /bin/sh
@relocatable_sh@
if test "@RELOCATABLE@" = yes; then
exec_prefix="@exec_prefix@"
bindir="@bindir@"
orig_installdir="$bindir" # see Makefile.am's *_SCRIPTS variables
func_find_curr_installdir # determine curr_installdir
func_find_prefixes
relocate () {
echo "$1/" \
| sed -e "s%^${orig_installprefix}/%${curr_installprefix}/%" \
| sed -e 's,/$,,'
}
else
relocate () {
echo "$1"
}
fi
bindir=`relocate "@bindir@"`
exec "$bindir/bison" -y "$@"