Opened 10 years ago

Closed 10 years ago

#3482 closed defect (fixed)

util-linux ignores prefix to install bash completions

Reported by: Tiago Koji Castro Shibata Owned by: lfs-book@…
Priority: high Milestone: 7.5
Component: Book Version: SVN
Severity: normal Keywords:
Cc:

Description

When installing util-linux in step 5.33, the prefix is ignored for bash completion files. Configure outputs the following:

	util-linux  2.24.1

	prefix:            /tools
	exec prefix:       ${prefix}

        localstatedir:     ${prefix}/var
	bindir:	           ${exec_prefix}/bin
	sbindir:           ${exec_prefix}/sbin
	libdir:            ${exec_prefix}/lib
	includedir:        ${prefix}/include
        usrbin_execdir:    ${exec_prefix}/bin
        usrsbin_execdir:   ${exec_prefix}/sbin
        usrlib_execdir:    ${exec_prefix}/lib

	compiler:          gcc -std=gnu99
	cflags:            -g -O2
	suid cflags:       
	ldflags:           
	suid ldflags:      

	Python:            
	Python version:    
	Python libs:       

	Bash completions:  /usr/share/bash-completion/completions

	warnings:

 -fno-common -Wall -Werror=sequence-point -Wextra -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wno-missing-field-initializers -Wredundant-decls -Wsign-compare -Wtype-limits -Wuninitialized -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-parameter -Wunused-result -Wunused-variable -Wnested-externs -Wpointer-arith -Wstrict-prototypes

Notice that the completion files are installed to /usr/share/bash-completion/completions instead of /tools. "make install" will fail if the user is lfs. A workaround can be done with a substitution after configuration:

cp Makefile{,.orig}

sed 's|bashcompletiondir = /usr|bashcompletiondir = /tools|' -i Makefile

PS: I'm not sure if SVN bugs should be posted here, please let me know if I should post in the mailing lists/somewhere else instead.

Change History (8)

comment:1 by bdubbs@…, 10 years ago

My reference build shows:

Bash completions: ${datarootdir}/bash-completion/completions

It doesn't say what ${datarootdir} is, but I do have /tools/share/bash-completion/completions/.

Creating a ticket is OK, but discussing in lfs-dev is appropriate too.

comment:2 by Tiago Koji Castro Shibata, 10 years ago

Strange... I used the build flags and the packages indicated in the book, using SVN 20140125. Is your build from SVN, too?

comment:3 by bdubbs@…, 10 years ago

LOL. I use jhalfs to automate the extraction of the commands from the book. The build is automated.

comment:4 by Tiago Koji Castro Shibata, 10 years ago

From ./configure, line 22803:

# Check whether --with-bashcompletiondir was given.
if test "${with_bashcompletiondir+set}" = set; then :
  withval=$with_bashcompletiondir;
else
  if `$PKG_CONFIG --exists bash-completion`; then :

    with_bashcompletiondir=`$PKG_CONFIG --variable=completionsdir bash-completion`

else

    with_bashcompletiondir=${datadir}/bash-completion/completions

fi

fi

bashcompletiondir=$with_bashcompletiondir

My pkg-config has bash-completion, so the path is taken from host's pkg-config. Using --with-bashcompletiondir=DIR explicitly sets the path.

comment:5 by bdubbs@…, 10 years ago

Lovely. What distro?

What we need in Chapter 5 is --with-bashcompletiondir=/dev/null

comment:6 by Pierre Labastie, 10 years ago

Sorry, sent inadvertently to the mail list LFS-book instead of replying here. Just giving the short story: You need to add "PKG_CONFIG=", to configure's invocation. Otherwise, it uses host's pkg-config, and finds host's libraries instead of those in /tools, resulting in false positive (for example, it finds TINFO on my distro, which is debian sid with libtinfo-dev installed, while of course libtinfo is not in /tools/lib).

Another possibility is to use PKG_CONFIG_LIBDIR=/tools/lib. Dunno what the best solution is. Adding those also solves the bashcompletiondir problem.

Last edited 10 years ago by Pierre Labastie (previous) (diff)

comment:7 by bdubbs@…, 10 years ago

Revision 10452 should fix this issue.

comment:8 by bdubbs@…, 10 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.