Commit 1dc749f9 authored by Maxime Joubert's avatar Maxime Joubert

build: bison: build nolimips with bison

In order to avoid conflicts between the LRDE bison version needed to
build nolimips and the last bison version installed on the host machine,
this commit gets bison from the LRDE tarball, builds it and uses it.

This commit fixes also some ugly tabulations and trailing whitespaces.

* .gitignore,
* bootstrap,
* build-aux/bin/bison++.in,
* build-aux/gitlog-to-changelog,
* configure.ac: here.
parent 3a936754
Pipeline #3140 passed with stage
in 5 minutes and 24 seconds
...@@ -14,3 +14,7 @@ Makefile ...@@ -14,3 +14,7 @@ Makefile
/configure /configure
/gnulib /gnulib
/m4 /m4
/build-aux/bin/bison
/build-aux/bin/yacc
/build-aux/lib
/build-aux/share
...@@ -30,7 +30,7 @@ export LC_ALL ...@@ -30,7 +30,7 @@ export LC_ALL
usage() { usage() {
cat <<EOF cat <<EOF
\`bootstrap' bootstraps Nolimips, getting or creating files needed by \`bootstrap' bootstraps Nolimips, getting or creating files needed by
autotools. autotools.
Usage: $0 [--gnulib-srcdir=DIR][--cvs-auth=AUTH-METHOD] Usage: $0 [--gnulib-srcdir=DIR][--cvs-auth=AUTH-METHOD]
...@@ -48,7 +48,7 @@ Options are: ...@@ -48,7 +48,7 @@ Options are:
repository). repository).
--cvs-user=USERNAME Set the CVS username to be used when accessing --cvs-user=USERNAME Set the CVS username to be used when accessing
the gnulib repository. the gnulib repository.
If the file \`.bootstrap' exists in the current working directory, its If the file \`.bootstrap' exists in the current working directory, its
contents is read, comments and empty lines removed, shell variables expanded contents is read, comments and empty lines removed, shell variables expanded
and the result is prepended to the command line options. and the result is prepended to the command line options.
...@@ -73,17 +73,17 @@ for option ...@@ -73,17 +73,17 @@ for option
do do
case $option in case $option in
--help) --help)
usage usage
exit;; exit;;
--gnulib-srcdir=*) --gnulib-srcdir=*)
GNULIB_SRCDIR=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;; GNULIB_SRCDIR=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;;
--cvs-auth=*) --cvs-auth=*)
CVS_AUTH=`expr "$option" : '--cvs-auth=\(.*\)'`;; CVS_AUTH=`expr "$option" : '--cvs-auth=\(.*\)'`;;
--cvs-user=*) --cvs-user=*)
CVS_USER=`expr "$option" : '--cvs-user=\(.*\)'`;; CVS_USER=`expr "$option" : '--cvs-user=\(.*\)'`;;
*) *)
echo >&2 "$0: $option: unknown option" echo >&2 "$0: $option: unknown option"
exit 1;; exit 1;;
esac esac
done done
...@@ -116,12 +116,12 @@ cvs_checkout() { ...@@ -116,12 +116,12 @@ cvs_checkout() {
pserver) build_cvs_prefix pserver ${CVS_USER:-anonymous} pserver) build_cvs_prefix pserver ${CVS_USER:-anonymous}
;; ;;
gserver|server) gserver|server)
build_cvs_prefix $CVS_AUTH ${CVS_USER--} build_cvs_prefix $CVS_AUTH ${CVS_USER--}
;; ;;
ext) build_cvs_prefix $CVS_AUTH ${CVS_USER--} ext) build_cvs_prefix $CVS_AUTH ${CVS_USER--}
;; ;;
*) echo "$0: Unknown CVS access method" >&2 *) echo "$0: Unknown CVS access method" >&2
exit 1;; exit 1;;
esac esac
cvs -q -d ${CVS_PREFIX}cvs.sv.gnu.org:/cvsroot/$1 co $1 || exit cvs -q -d ${CVS_PREFIX}cvs.sv.gnu.org:/cvsroot/$1 co $1 || exit
...@@ -147,7 +147,7 @@ newline=' ...@@ -147,7 +147,7 @@ newline='
' '
get_modules() { get_modules() {
new_gnulib_modules=`sed '/^[ ]*#/d; /^[ ]*$/d' $*` new_gnulib_modules=`sed '/^[ ]*#/d; /^[ ]*$/d' $*`
case $gnulib_modules,$new_gnulib_modules in case $gnulib_modules,$new_gnulib_modules in
?*,?*) new_gnulib_modules=$newline$new_gnulib_modules;; ?*,?*) new_gnulib_modules=$newline$new_gnulib_modules;;
esac esac
...@@ -194,18 +194,18 @@ for gnulib_file in $gnulib_files; do ...@@ -194,18 +194,18 @@ for gnulib_file in $gnulib_files; do
dest=$gnulib_file dest=$gnulib_file
case $gnulib_file in case $gnulib_file in
m4/codeset.m4) continue;; m4/codeset.m4) continue;;
m4/intdiv0.m4) continue;; m4/intdiv0.m4) continue;;
m4/inttypes-pri.m4) continue;; m4/inttypes-pri.m4) continue;;
m4/isc-posix.m4) continue;; m4/isc-posix.m4) continue;;
m4/lcmessage.m4) continue;; m4/lcmessage.m4) continue;;
m4/onceonly_2_57.m4) dest=m4/onceonly.m4;; m4/onceonly_2_57.m4) dest=m4/onceonly.m4;;
# These will be overwritten by autopoint, which still uses # These will be overwritten by autopoint, which still uses
# old jm_.* macro names, so we have to keep both copies. # old jm_.* macro names, so we have to keep both copies.
m4/gettext.m4 | m4/glibc21.m4 | m4/inttypes_h.m4 | m4/lib-ld.m4 | \ m4/gettext.m4 | m4/glibc21.m4 | m4/inttypes_h.m4 | m4/lib-ld.m4 | \
m4/lib-prefix.m4 | m4/po.m4 | m4/stdint_h.m4 | m4/uintmax_t.m4 | \ m4/lib-prefix.m4 | m4/po.m4 | m4/stdint_h.m4 | m4/uintmax_t.m4 | \
m4/ulonglong.m4) m4/ulonglong.m4)
dest=`expr $gnulib_file : '\(.*\).m4'`_gl.m4;; dest=`expr $gnulib_file : '\(.*\).m4'`_gl.m4;;
esac esac
rm -f $dest && rm -f $dest &&
...@@ -218,9 +218,9 @@ echo "$0: Creating m4/gnulib.m4" ...@@ -218,9 +218,9 @@ echo "$0: Creating m4/gnulib.m4"
echo "#" echo "#"
echo "AC_DEFUN([nolimips_GNULIB],[" echo "AC_DEFUN([nolimips_GNULIB],["
for gnulib_module in $gnulib_modules; do for gnulib_module in $gnulib_modules; do
echo "# $gnulib_module" echo "# $gnulib_module"
$GNULIB_SRCDIR/gnulib-tool \ $GNULIB_SRCDIR/gnulib-tool \
--aux-dir=build-aux --extract-autoconf-snippet $gnulib_module --aux-dir=build-aux --extract-autoconf-snippet $gnulib_module
done | sed '/AM_GNU_GETTEXT/d' done | sed '/AM_GNU_GETTEXT/d'
echo "])") > ./m4/gnulib.m4 echo "])") > ./m4/gnulib.m4
...@@ -259,6 +259,32 @@ do ...@@ -259,6 +259,32 @@ do
done done
export LIBTOOLIZE=$libtoolize export LIBTOOLIZE=$libtoolize
TIGER_WEBSITE="https://www.lrde.epita.fr/~tiger/download"
BISON="bison-3.0.4.19-fbaf"
BISON_TARBALL="$BISON.tar.xz"
BISON_PREFIX_DIR="$(pwd)/build-aux"
BISON_BIN="$BISON_PREFIX_DIR/bin/bison"
# Getting LRDE bison
if [ ! -f "$BISON_BIN" ]; then
echo "$0: wget $TIGER_WEBSITE/$BISON_TARBALL"
wget -q $TIGER_WEBSITE/$BISON_TARBALL
echo "$0: tar -xvf $BISON_TARBALL"
tar -xvf $BISON_TARBALL
echo "$0: rm $BISON_TARBALL"
rm $BISON_TARBALL
# Building bison
echo "$0: mkdir $BISON/build"
mkdir $BISON/build
echo "$0: cd $BISON/build && ../configure && make"
cd $BISON/build
../configure --prefix=$BISON_PREFIX_DIR
make install
cd ../..
rm -r $BISON
fi
# Reconfigure, getting other files. # Reconfigure, getting other files.
......
...@@ -52,11 +52,11 @@ get_options () ...@@ -52,11 +52,11 @@ get_options ()
# Handle --option=value by splitting apart and putting back on argv. # Handle --option=value by splitting apart and putting back on argv.
case $1 in case $1 in
(--*=*) (--*=*)
opt=$(echo "$1" | sed -e 's/=.*//') opt=$(echo "$1" | sed -e 's/=.*//')
val=$(echo "$1" | sed -e 's/[^=]*=//') val=$(echo "$1" | sed -e 's/[^=]*=//')
shift shift
set dummy "$opt" "$val" ${1+"$@"}; shift set dummy "$opt" "$val" ${1+"$@"}; shift
;; ;;
esac esac
case $1 in case $1 in
...@@ -205,7 +205,7 @@ install () ...@@ -205,7 +205,7 @@ install ()
# Exit status. # Exit status.
status=0 status=0
: ${BISON='@BISON@'} : ${BISON='@abs_top_srcdir@/@BISON@'}
me=$(basename $0) me=$(basename $0)
fuse_switch='@abs_srcdir@/fuse-switch' fuse_switch='@abs_srcdir@/fuse-switch'
...@@ -251,43 +251,43 @@ do ...@@ -251,43 +251,43 @@ do
base=$(basename $file) base=$(basename $file)
case $status:$base in case $status:$base in
(*:$input_base) (*:$input_base)
# Leave it here. # Leave it here.
;; ;;
# Success or not, install it. # Success or not, install it.
(*:*.xml) (*:*.xml)
# Computing the HTML is slow. Do it when the XML changed. # Computing the HTML is slow. Do it when the XML changed.
fix_bison_output "$file" fix_bison_output "$file"
compile_xml_file "$file" "xml2xhtml" "html" compile_xml_file "$file" "xml2xhtml" "html"
# Compiling the dot output is quite long, it would be better # Compiling the dot output is quite long, it would be better
# to do that from the Makefile, so that -j applies. # to do that from the Makefile, so that -j applies.
# compile_xml_file "$file" "xml2dot" "dot" # compile_xml_file "$file" "xml2dot" "dot"
install "$file" install "$file"
;; ;;
(0:*.hh) (0:*.hh)
fix_bison_output "$file" fix_bison_output "$file"
# To save cycles, if the file differs only on sync lines, # To save cycles, if the file differs only on sync lines,
# update it (to be right), but keep the original timestamps. # update it (to be right), but keep the original timestamps.
if test -r "$(out "$file")" && if test -r "$(out "$file")" &&
diff -I '^#line' -I '/\* Line .* of .* \*/' -q \ diff -I '^#line' -I '/\* Line .* of .* \*/' -q \
"$file" "$(out "$file")" "$file" "$(out "$file")"
then then
touch -r "$(out "$file")" "$file" touch -r "$(out "$file")" "$file"
cp "$(out "$file")" "$(out "$file").bak" cp "$(out "$file")" "$(out "$file").bak"
verbose "kept the stamps of $file" verbose "kept the stamps of $file"
fi fi
install "$file" install "$file"
;; ;;
(*:*.output) (*:*.output)
install "$file" install "$file"
;; ;;
(0:*) (0:*)
fix_bison_output "$file" fix_bison_output "$file"
install "$file" install "$file"
;; ;;
esac esac
done done
......
...@@ -3,13 +3,13 @@ eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"' ...@@ -3,13 +3,13 @@ eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"'
if 0; if 0;
# Convert git log output to ChangeLog format. # Convert git log output to ChangeLog format.
my $VERSION = '2016-03-22 21:49'; # UTC my $VERSION = '2018-03-07 03:47'; # UTC
# The definition above must lie within the first 8 lines in order # The definition above must lie within the first 8 lines in order
# for the Emacs time-stamp write hook (at end) to update it. # for the Emacs time-stamp write hook (at end) to update it.
# If you change this file with Emacs, please let the write hook # If you change this file with Emacs, please let the write hook
# do its job. Otherwise, update this string manually. # do its job. Otherwise, update this string manually.
# Copyright (C) 2008-2016 Free Software Foundation, Inc. # Copyright (C) 2008-2018 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -22,7 +22,7 @@ my $VERSION = '2016-03-22 21:49'; # UTC ...@@ -22,7 +22,7 @@ my $VERSION = '2016-03-22 21:49'; # UTC
# GNU General Public License for more details. # GNU General Public License for more details.
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
# Written by Jim Meyering # Written by Jim Meyering
...@@ -33,7 +33,7 @@ use POSIX qw(strftime); ...@@ -33,7 +33,7 @@ use POSIX qw(strftime);
(my $ME = $0) =~ s|.*/||; (my $ME = $0) =~ s|.*/||;
# use File::Coda; # http://meyering.net/code/Coda/ # use File::Coda; # https://meyering.net/code/Coda/
END { END {
defined fileno STDOUT or return; defined fileno STDOUT or return;
close STDOUT and return; close STDOUT and return;
...@@ -491,7 +491,7 @@ sub git_dir_option($) ...@@ -491,7 +491,7 @@ sub git_dir_option($)
# Local Variables: # Local Variables:
# mode: perl # mode: perl
# indent-tabs-mode: nil # indent-tabs-mode: nil
# eval: (add-hook 'write-file-hooks 'time-stamp) # eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "my $VERSION = '" # time-stamp-start: "my $VERSION = '"
# time-stamp-format: "%:y-%02m-%02d %02H:%02M" # time-stamp-format: "%:y-%02m-%02d %02H:%02M"
# time-stamp-time-zone: "UTC0" # time-stamp-time-zone: "UTC0"
......
...@@ -19,8 +19,8 @@ AM_SILENT_RULES([yes]) ...@@ -19,8 +19,8 @@ AM_SILENT_RULES([yes])
## Development tools ------------------- ## Development tools -------------------
# Look for a lex-like program. # Look for a lex-like program.
AC_PROG_LEX AC_PROG_LEX
# Look for bison. # Set the path to the lrde version of bison.
AC_CHECK_PROGS([BISON], [bison]) AC_SUBST([BISON], [build-aux/bin/bison])
# Look for a C++ compiler. # Look for a C++ compiler.
AC_LANG([C++]) AC_LANG([C++])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment