Configuring install path: prefix=[PREFIX] not fully understood

会有一股神秘感。 提交于 2020-01-11 09:23:25

问题


I think this is simply a general c++ question:

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

or

--prefix=[/usr/local]

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

etc. or whether the first --prefix value is enough?

What is the above configuration syntax trying to show me?


回答1:


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.

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.

Incidentally, if you install into your home folder you won't need root privileges.




回答2:


In my situation, ./configure end up with warning/error, so --prefix= works with the default location (/usr/local). After I sorted out the warning/error, it worked as expected.



来源:https://stackoverflow.com/questions/36998572/configuring-install-path-prefix-prefix-not-fully-understood

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!