Fix configure dirs
authorJose A. Lopes <jabolopes@google.com>
Thu, 16 Jan 2014 18:33:53 +0000 (19:33 +0100)
committerJose A. Lopes <jabolopes@google.com>
Fri, 17 Jan 2014 10:29:50 +0000 (11:29 +0100)
commitae6a0a7c5a7cfacff72f307236d236ce965fe4e7
tree196b5eba59bda87d27ff84a8156176debe54c94f
parent4f6b32cad5879ef60b13ddf169a0aa4833bd70cb
Fix configure dirs

Fix overridable configure directories, namely, --bindir, --sbindir,
and --mandir.

Variables 'bindir', 'sbindir', and 'mandir' are exported from
'configure.ac' to 'Makefile.am'. At first, it would seem to be
possible to do the following:

  MANDIR := $(mandir)
  ...
  mandir = $(versionedsharedir)$(datarootdir)/$(MANDIR)

However, this does not work in the output of 'configure' (i.e., the
'Makefile'), these variables will be reordered:

  mandir = $(versionedsharedir)$(datarootdir)/$(MANDIR)
  ...
  MANDIR := $(mandir)

As a result, 'MANDIR' will capture not the exported value from
'configure.ac' but the 'mandir' defined in the 'Makefile'.

The solution is explicitly export these variables from 'configure.ac'
with different names, namely, 'BINDIR', 'SBINDIR', and 'MANDIR':

  AC_SUBST([BINDIR], $bindir)
  AC_SUBST([SBINDIR], $sbindir)
  AC_SUBST([MANDIR], $mandir)

The rest is just fixing the paths and the symlinks in the 'Makefile'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Makefile.am
configure.ac