TEMU build failures with "`pwd`"

24 views
Skip to first unread message

Stephen McCamant

unread,
Apr 6, 2012, 6:04:45 PM4/6/12
to bitblaz...@googlegroups.com
I've seen more than one person recently run into problems with the
installation step of the TEMU build process, with errors that look
like:

install -m 755 -s qemu "pwd/install/bin"
install: cannot create regular file `pwd/install/bin': No such file or
directory

Juan had explained the reason this happens in one thread in March, but
I thought I'd repeat that answer and expand on it a bit here for
future reference.

Since we're imagining most people are using TEMU for research
purposes, our standard instructions don't have you install it
system-wide, just compile it in a local directory. But QEMU likes to
have an installation directory in which to find data like keymaps and
BIOS images. So our instructions have you "install" it in a
subdirectory of the source code named install. To get an absolute path
to this directory, we use the Unix command pwd (for "print (current)
working directory). Here's how that command works when you run it on
its own:

% pwd
/home/smcc/bitblaze/temu

To get the absolute path of the install directory, we want to insert
the output of the pwd command into the --prefix argument to
./configure. You can see the same thing with the command "echo" that
just prints its arguments:

% echo `pwd`/install
/home/smcc/bitblaze/temu/install

Notice the backward-pointing quotation marks around pwd in that
command. These are often called "backticks", and they the special
syntax that tells the shell to insert the result of the pwd command, a
feature that's called "command substitution". (If you have a US-style
keyboard, the key for that symbol is usually in the upper-left of the
keyboard, on the same key as "~".) You won't get the same effect if
you use other kinds of quote marks:

% echo 'pwd'/install
pwd/install
% echo "pwd"/install
pwd/install

If you use different or no quote marks in the TEMU configuration
command, you'll get the build failures with the "install" command of
the sort that several people have reported. There's no rule that says
you can't have an installation directory named "pwd", but "make
install" doesn't work correctly if the installation prefix is a
relative path, because different parts of the installation happen in
different directories.

A more modern synonym for the backticks syntax that uses fewer
visually ambiguous characters is $(pwd). For instance for the TEMU 1.0
configuration command you can use:

(cd temu-1.0 && ./configure --target-list=i386-softmmu --proj-name=tracecap \
--cc=gcc-3.4 --prefix=$(pwd)/install)

I've made this change to the online version of the instructions as
well. (However you'll still need to use the backticks syntax if you're
using a csh-family shell.)

Hope this helps,

-- Stephen

Reply all
Reply to author
Forward
0 new messages