Sunday, March 25, 2018

Building GNU automake 1.16.1

I start with the same considerations from the post Building autoconf 2.69. The GNU automake library is sometimes used on GNU buildings so I add it to my crazy list of GNU software to manually build.

NOTE
On this post I'm using the lastest GNU automake verion at the time of this writing. But sometimes one particular version simply doesn't work. For instance, version 1.16 fails building, but version 1.16.1 succeeds.

The basic building strategy and general assumptions have been detailed on a previous post: Staged Building, so I'll (hopefully) get more straight to the point:

$ pwd
/stage/build

$ ./gnu-build-preparation ../source/.../automake-1.16.1.tar.xz
...

$ cd automake/automake-1.16.1-64

$ source ../setenv 64

CONFIG_SHELL=/usr/bin/bash

CC=/usr/bin/gcc CFLAGS=-m64 -march=core2 -std=gnu89

CXX=/usr/bin/g++ CXXFLAGS=-m64 -march=core2 -std=gnu++03

LD=/usr/bin/ld LDFLAGS=-m64 -march=core2

PATH=/opt/gnu/bin:/usr/gnu/bin:/usr/bin:/usr/sbin

PKG_CONFIG_PATH=

Suggested build sequence:

Fine-tune/fix config.h.in, Makefile.in and others...

$ ./configure \
  --build=x86_64-pc-solaris2.11 \
  --prefix=/opt/... \
  ...

$ gmake -j3

For IPS package:


$ sudo gmake DESTDIR=/stage/prototype/automake/1.16.1/64 install

For immediate use:

$ sudo gmake install
$ sudo snapshot -r .../opt/...@automake-1.16.1


$ ./configure \ 
    --build=x86_64-pc-solaris2.11 \
    --prefix=/opt/gnu
checking whether make supports nested variables... yes
checking build system type... x86_64-pc-solaris2.11
checking host system type... x86_64-pc-solaris2.11
checking for a BSD-compatible install... /usr/gnu/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/gnu/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether ln -s works... yes
checking for perl... /usr/bin/perl
checking for tex... no
checking for yacc... yacc
checking for lex... lex
checking whether autoconf is installed... yes
checking whether autoconf works... yes
checking whether autoconf is recent enough... yes
checking whether ln works... yes
checking for grep that handles long lines and -e... /usr/gnu/bin/grep
checking for egrep... /usr/gnu/bin/grep -E
checking for fgrep... /usr/gnu/bin/grep -F
configure: will now look for a sturdy POSIX shell, for our testsuite
checking for sh... /usr/gnu/bin/sh
checking for sh5... no
checking for dash... no
checking for ash... no
checking for bash... /usr/bin/bash
checking for zsh... /usr/bin/zsh
checking for ksh... /usr/bin/ksh
checking for pdksh... no
checking whether /usr/bin/bash supports $(cmd)... yes
checking whether /usr/bin/bash supports $((expr))... yes
checking whether /usr/bin/bash supports ${#var}... yes
checking whether /usr/bin/bash supports ${var#glob} and ${var%glob}... yes
checking whether /usr/bin/bash preserves exit traps with "set -e"... yes
checking whether /usr/bin/bash can define exit traps in a shell function... yes
checking whether /usr/bin/bash corrupts stderr with "set -x"... no
checking whether /usr/bin/bash can return early from "dot-sourced" files... yes
checking whether /usr/bin/bash supports alias named like shell builtins... yes
checking whether /usr/bin/bash supports "test -e"... yes
configure: shell /usr/bin/bash is good enough, stop looking
configure: will use /usr/bin/bash as the testsuite shell
configure: will now look for generic compilers
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to accept ISO C89... none needed
checking whether /usr/bin/gcc understands -c and -o together... yes
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether /usr/bin/g++ accepts -g... yes
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgfortran... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking for nagfor... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for g95... no
checking for gfortran... gfortran
checking whether the Fortran compiler works... yes
checking for Fortran compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran accepts -g... yes
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for g77... no
checking for gfortran... gfortran
checking whether the Fortran 77 compiler works... yes
checking for Fortran 77 compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether gfortran accepts -g... yes
configure: will now look for GNU compilers
configure: /usr/bin/gcc is already a GNU C compiler
configure: /usr/bin/g++ is already a GNU C++ compiler
configure: gfortran is already a GNU Fortran compiler
configure: gfortran is already a GNU Fortran 77 compiler
checking for gcj... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating pre-inst-env


$ gmake -j3
  GEN      bin/automake
  GEN      bin/aclocal
  GEN      t/ax/shell-no-trail-bslash
  GEN      t/ax/cc-no-c-o
  GEN      runtest
  GEN      doc/aclocal.1
  GEN      doc/automake.1
  GEN      lib/Automake/Config.pm
  GEN      bin/aclocal-1.16
  GEN      t/ax/test-defs.sh
  GEN      bin/automake-1.16
  GEN      doc/automake-1.16.1
  GEN      doc/aclocal-1.16.1


$ gmake check
...
===============================================
Testsuite summary for GNU Automake 1.16.1
===============================================
# TOTAL: 2904
# PASS:  2736
# SKIP:  117
# XFAIL: 39
# FAIL:  12
# XPASS: 0
# ERROR: 0
===============================================
See ./test-suite.log
Please report to bug-automake@gnu.org
===============================================


NOTE
The were a few (12) testing failures:

FAIL: t/amhello-cflags.sh
FAIL: t/fort4.sh
FAIL: t/fort5.sh
FAIL: t/lex-clean-cxx.sh
FAIL: t/lex-depend-cxx.sh
FAIL: t/objc-minidemo.sh
FAIL: t/objc-flags.sh
FAIL: t/objc-deps.sh
FAIL: t/silent-f77.sh
FAIL: t/silent-f90.sh
FAIL: t/silent-many-languages.sh
FAIL: t/subobj-pr13928-more-langs.sh

But, in fact, not really.
For instance:
  1. By inspecting ./t/amhello-cflags.log I saw that part of the test-case was built ignoring the relevant CFLAGS environment variables. Hence, it hard-coded built a 32-bits artifacts to what should be a purely 64-bits test case. As a result the test failed with a well-known internal message: wrong ELF class: ELFCLASS32. In summary, this could be considered a bug in the test-case, thus not a severe failure of the recently built 64-bits artifact itself. The same happened to objc , silent-many-languages and ...-more-langs tests.
     
  2. The Fortran related test-cases are irrelevant here. This includes the fort4.sh, fort5.sh, silent-f77.sh, silent-f90.sh.
     
  3. For the ./t/lex-clean-cxx.sh and ./t/lex-depend-cxx.sh there had been a C++ compilation error which could be due to a bug in the test source-code or due to selecting -std=gnu++03:
    previous declaration of 'int yylex()' with ‘C++’ linkage

$ sudo \
  gmake DESTDIR=/stage/prototype/automake/1.16.1/64 install 
...

$ sudo gmake install
gmake[1]: Entering directory `/stage/build/automake/automake-1.16.1-64'
 /usr/gnu/bin/mkdir -p '/opt/gnu/bin'
 /usr/gnu/bin/install -c bin/automake bin/aclocal '/opt/gnu/bin'
gmake  install-exec-hook
gmake[2]: Entering directory `/stage/build/automake/automake-1.16.1-64'
 ln '/opt/gnu/bin/automake' '/opt/gnu/bin/automake-1.16'
 ln '/opt/gnu/bin/aclocal' '/opt/gnu/bin/aclocal-1.16'
gmake[2]: Leaving directory `/stage/build/automake/automake-1.16.1-64'
 /usr/gnu/bin/mkdir -p '/opt/gnu/share/automake-1.16/am'
 /usr/gnu/bin/install -c -m 644 lib/am/check.am lib/am/check2.am lib/am/clean-hdr.am lib/am/clean.am lib/am/compile.am lib/am/configure.am lib/am/data.am lib/am/dejagnu.am lib/am/depend.am lib/am/depend2.am lib/am/distdir.am lib/am/footer.am lib/am/header-vars.am lib/am/header.am lib/am/install.am lib/am/inst-vars.am lib/am/java.am lib/am/lang-compile.am lib/am/lex.am lib/am/library.am lib/am/libs.am lib/am/libtool.am lib/am/lisp.am lib/am/ltlib.am lib/am/ltlibrary.am lib/am/mans-vars.am lib/am/mans.am lib/am/program.am lib/am/progs.am lib/am/python.am lib/am/remake-hdr.am lib/am/scripts.am lib/am/subdirs.am lib/am/tags.am lib/am/texi-vers.am lib/am/texibuild.am lib/am/texinfos.am lib/am/vala.am lib/am/yacc.am '/opt/gnu/share/automake-1.16/am'
 /usr/gnu/bin/mkdir -p '/opt/gnu/share/aclocal-1.16'
 /usr/gnu/bin/install -c -m 644 m4/amversion.m4 m4/ar-lib.m4 m4/as.m4 m4/auxdir.m4 m4/cond.m4 m4/cond-if.m4 m4/depend.m4 m4/depout.m4 m4/dmalloc.m4 m4/extra-recurs.m4 m4/gcj.m4 m4/init.m4 m4/install-sh.m4 m4/lead-dot.m4 m4/lex.m4 m4/lispdir.m4 m4/maintainer.m4 m4/make.m4 m4/missing.m4 m4/mkdirp.m4 m4/obsolete.m4 m4/options.m4 m4/python.m4 m4/prog-cc-c-o.m4 m4/runlog.m4 m4/sanity.m4 m4/silent.m4 m4/strip.m4 m4/substnot.m4 m4/tar.m4 m4/upc.m4 m4/vala.m4 '/opt/gnu/share/aclocal-1.16'
 /usr/gnu/bin/mkdir -p '/opt/gnu/share/aclocal-1.16/internal'
 /usr/gnu/bin/install -c -m 644 m4/internal/ac-config-macro-dirs.m4 '/opt/gnu/share/aclocal-1.16/internal'
 /usr/gnu/bin/mkdir -p '/opt/gnu/share/doc/automake'
 /usr/gnu/bin/install -c -m 644 ./doc/amhello-1.0.tar.gz '/opt/gnu/share/doc/automake'
 /usr/gnu/bin/mkdir -p '/opt/gnu/share/automake-1.16/Automake'
 /usr/gnu/bin/install -c -m 644 lib/Automake/ChannelDefs.pm lib/Automake/Channels.pm lib/Automake/Condition.pm lib/Automake/Configure_ac.pm lib/Automake/DisjConditions.pm lib/Automake/FileUtils.pm lib/Automake/General.pm lib/Automake/Getopt.pm lib/Automake/Item.pm lib/Automake/ItemDef.pm lib/Automake/Language.pm lib/Automake/Location.pm lib/Automake/Options.pm lib/Automake/Rule.pm lib/Automake/RuleDef.pm lib/Automake/Variable.pm lib/Automake/VarDef.pm lib/Automake/Version.pm lib/Automake/XFile.pm lib/Automake/Wrap.pm '/opt/gnu/share/automake-1.16/Automake'
 /usr/gnu/bin/mkdir -p '/opt/gnu/share/automake-1.16'
 /usr/gnu/bin/install -c -m 644 lib/COPYING lib/INSTALL lib/texinfo.tex '/opt/gnu/share/automake-1.16'
 /usr/gnu/bin/mkdir -p '/opt/gnu/share/automake-1.16'
 /usr/gnu/bin/install -c -m 644 lib/config.guess lib/config.sub lib/install-sh lib/mdate-sh lib/missing lib/mkinstalldirs lib/ylwrap lib/depcomp lib/compile lib/py-compile lib/ar-lib lib/test-driver lib/tap-driver.sh '/opt/gnu/share/automake-1.16'
 /usr/gnu/bin/mkdir -p '/opt/gnu/share/aclocal'
 /usr/gnu/bin/install -c -m 644 m4/acdir/README '/opt/gnu/share/aclocal'
 /usr/gnu/bin/mkdir -p '/opt/gnu/share/info'
 /usr/gnu/bin/install -c -m 644 ./doc/automake.info ./doc/automake.info-1 ./doc/automake.info-2 ./doc/automake-history.info '/opt/gnu/share/info'
 install-info --info-dir='/opt/gnu/share/info' '/opt/gnu/share/info/automake.info'
 install-info --info-dir='/opt/gnu/share/info' '/opt/gnu/share/info/automake-history.info'
install-info: warning: no info dir entry in `/opt/gnu/share/info/automake-history.info'
 /usr/gnu/bin/mkdir -p '/opt/gnu/share/man/man1'
 /usr/gnu/bin/install -c -m 644 doc/aclocal.1 doc/automake.1 doc/aclocal-1.16.1 doc/automake-1.16.1 '/opt/gnu/share/man/man1'
 /usr/gnu/bin/mkdir -p '/opt/gnu/share/automake-1.16/Automake'
 /usr/gnu/bin/install -c -m 644 lib/Automake/Config.pm '/opt/gnu/share/automake-1.16/Automake'
gmake  install-data-hook
gmake[2]: Entering directory `/stage/build/automake/automake-1.16.1-64'
 chmod +x '/opt/gnu/share/automake-1.16/config.guess'
 chmod +x '/opt/gnu/share/automake-1.16/config.sub'
 chmod +x '/opt/gnu/share/automake-1.16/install-sh'
 chmod +x '/opt/gnu/share/automake-1.16/mdate-sh'
 chmod +x '/opt/gnu/share/automake-1.16/missing'
 chmod +x '/opt/gnu/share/automake-1.16/mkinstalldirs'
 chmod +x '/opt/gnu/share/automake-1.16/ylwrap'
 chmod +x '/opt/gnu/share/automake-1.16/depcomp'
 chmod +x '/opt/gnu/share/automake-1.16/compile'
 chmod +x '/opt/gnu/share/automake-1.16/py-compile'
 chmod +x '/opt/gnu/share/automake-1.16/ar-lib'
 chmod +x '/opt/gnu/share/automake-1.16/test-driver'
 chmod +x '/opt/gnu/share/automake-1.16/tap-driver.sh'
gmake[2]: Leaving directory `/stage/build/automake/automake-1.16.1-64'
gmake[1]: Leaving directory `/stage/build/automake/automake-1.16.1-64'


$ sudo zfs snapshot -r .../opt/gnu@automake-1.16.1

  
The building process is virtually the same for 32-bits artifacts.
But I don't perform it because I'm exclusively focusing on 64-bits artifacts.