make install permission denied even with --prefix passed to configure
Asked Answered
C

1

6

I am trying to install gcc (a branch of gcc, not the trunk in the svn), and I configured it with:

./configure --prefix=/home/user/myroot/ --enable-languages=c,c++ \
    --disable-multilib --libexecdir=/usr/lib --without-included-gettext \
    --enable-threads=posix --disable-werror --with-arch-32=i486 \
    --with-tune=generic --enable-checking=release --build=i486-linux-gnu \
    --host=i486-linux-gnu --target=i486-linux-gnu

/home/user/myroot is a directory that exists.

When I run make, it builds gcc fine.

However, when I do make install, this is what I get:

make[1]: Entering directory `/home/user/gcc/gcc-cjung'
/bin/bash ./mkinstalldirs /home/user/myroot /home/user/myroot
make[2]: Entering directory `/home/user/gcc/gcc-cjung/host-i486-linux-gnu/fixincludes'
rm -rf /usr/lib/gcc/i486-linux-gnu/4.5.0/install-tools
/bin/bash ../.././fixincludes/../mkinstalldirs /usr/lib/gcc/i486-linux-gnu/4.5.0/install-tools
mkdir -p -- /usr/lib/gcc/i486-linux-gnu/4.5.0/install-tools
mkdir: cannot create directory `/usr/lib/gcc/i486-linux-gnu/4.5.0': Permission denied
make[2]: *** [install] Error 1
make[2]: Leaving directory `/home/user/gcc/gcc-cjung/host-i486-linux-gnu/fixincludes'
make[1]: *** [install-fixincludes] Error 2
make[1]: Leaving directory `/home/user/gcc/gcc-cjung'
make: *** [install] Error 2

Why does it still want to copy stuff to /usr/lib when I specified the prefix to be /home/user/myroot?

Btw, I am using Ubuntu 9.10 if that matters. I have already installed build-essential, gawk, flex, bison, and libmpfr.

Cyathus answered 11/7, 2010 at 4:44 Comment(0)
P
6

Why did you set the libexecdir to /usr/lib? That means it will have to install things into /usr/lib, a directory to which you cannot write.

You probably want --libexecdir=/home/user/myroot/usr/lib

Profluent answered 11/7, 2010 at 4:55 Comment(1)
Ah, I see my fail there. I just did a copy/paste from somewhere and didn't realize the extra flags. Thanks!Cyathus

© 2022 - 2024 — McMap. All rights reserved.