Skip to content
  • Jose A. Lopes's avatar
    Fix configure dirs · ae6a0a7c
    Jose A. Lopes authored
    
    
    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: default avatarJose A. Lopes <jabolopes@google.com>
    Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
    ae6a0a7c