配置安装路径:prefix = [PREFIX]尚未完全了解 [英] Configuring install path: prefix=[PREFIX] not fully understood
问题描述
我认为这只是一个通用的c ++问题:
I think this is simply a general c++ question:
我正在尝试使用gnu c ++编译器在Linux Fedora上编译ffmpeg的本地版本.我在下面的一堆文件夹中有源代码:
I'm attempting to compile a local version of ffmpeg on Linux Fedora using the gnu c++ compiler. I have source code in a bunch of folders under:
~/<username>/Downloads/Code/ffmpeg_sources/
这是我尝试设置配置标志的位置,以将构建版本安装到不在此树下的目标中,而是安装在具有本地共享库的根目录下:
which is where I'm attempting to set the config flags to install the build to a target not under this tree but at a root level directory with local shared libraries:
/usr/local/
配置文件开头附近有以下部分:
There is this following section near the beginning of the configuration file:
Standard options:
--prefix=PREFIX install in PREFIX []
--bindir=DIR install binaries in DIR [PREFIX/bin]
--datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]
--docdir=DIR install documentation in DIR [PREFIX/share/doc/ffmpeg]
--libdir=DIR install libs in DIR [PREFIX/lib]
--shlibdir=DIR install shared libs in DIR [PREFIX/lib]
--incdir=DIR install includes in DIR [PREFIX/include]
--mandir=DIR install man page in DIR [PREFIX/share/man]
--enable-rpath use rpath to allow installing libraries in paths
not part of the dynamic linker search path
我可能完全误解了这一点,但我认为将值设置为
I may have completely misunderstood this, but I thought that setting a value like
--prefix=/usr/local
或
--prefix=[/usr/local]
可能会工作,但似乎无法完成,因为./config中的make& make安装完成后,它已经完成了很多工作,但目标没有安装任何东西.在源目录中构建了很多新的可执行文件,因此大概可以构建,但是我只是错误地指定了路径?相同问题的一部分在于,一旦设置了
might work, but it appears not to, as once the ./config, make&&make install is complete, it has done a bunch of stuff but there's nothing installed at the target. There are a LOT of new executable files built in the source directory, so presumably the build is working but I'm simply specifying the paths incorrectly? A part of the same problem is that it's unclear whether, once I've set the
--prefix=[PREFIX]
正确,我需要再设置所有
correctly, I need to set all of the further
--datadir, --libdir
等还是第一个--prefix值足够?
etc. or whether the first --prefix value is enough?
上面的配置语法试图告诉我什么?
What is the above configuration syntax trying to show me?
推荐答案
它应该是第一个--prefix=/usr/local
,但是要在该位置安装文件,您需要 root 权限.因此,如果您是sudo user
又名sudo make install
,则需要更改为 root 帐户su
或使用sudo
.仅在 install 阶段这样做,不要那样构建.
It should be the first one --prefix=/usr/local
but to install files in that location you need root privileges. So you need to either change to the root account su
or use sudo
if you are a sudo user
aka sudo make install
. Only do that for the install phase, don't build like that.
此外,/usr/local
通常是默认的安装位置,因此通常不需要指定该位置.通常,您只使用--prefix
安装到其他位置,例如--prefix=/opt
或 home 文件夹:--prefix=$HOME/3rdparty
.
Also /usr/local
is usually the default install location so you don't usually need to specify that. Normally you only use --prefix
to install into a different location like --prefix=/opt
or your home folders: --prefix=$HOME/3rdparty
.
顺便说一句,如果安装到 home 文件夹中,则不需要 root 特权.
Incidentally, if you install into your home folder you won't need root privileges.
这篇关于配置安装路径:prefix = [PREFIX]尚未完全了解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!