问题描述
我在 Fedora 26、x86_64 上构建一些基于 Autotool 的库时遇到问题.64 位 Fedora 将第三方和供应商库放在 /usr/local/lib64
中.Ubuntu 17 使用 /usr/local/lib
因此相同的项目可以正常构建.
I'm having trouble building a few Autotool-based libraries on Fedora 26, x86_64. The 64-bit Fedora puts third party and vendor libraries in /usr/local/lib64
. Ubuntu 17 uses /usr/local/lib
so the same projects build OK.
我一直在使用 --libdir=/usr/local/lib64
但有三个库抵制它.我缺少 /usr/local
的 config.site
所以我想添加一个.关于站点默认设置的 Autoconf 手册当它讨论 usr/local
的 config.site
时,我有点困惑.它说:
I've been using --libdir=/usr/local/lib64
but three libraries resist it. I lack a config.site
for /usr/local
so I am trying to add one. The Autoconf manual on Site Defaults is a tad bit confusing to me when it discusses usr/local
's config.site
. It says:
[讨论/usr
版本的confg.site
] ...
同样,在默认构建 64 位库的平台上,然后安装在/usr/local/lib64而不是/usr/local/lib中,它是适合安装/usr/local/share/config.site:
Likewise, on platforms where 64-bit libraries are built by default, then installed in /usr/local/lib64 instead of /usr/local/lib, it is appropriate to install /usr/local/share/config.site:
# /usr/local/share/config.site for platforms that prefer
# the directory /usr/local/lib64 over /usr/local/lib.
test "$libdir" = '${exec_prefix}/lib' && libdir='${exec_prefix}/lib64'
我遇到的问题是,上面的修改是否附加到了 config.site
的 /usr/local
版本?或者它是否替换了现有的代码块?或者我可以直接将它复制到它所属的地方而不做修改吗?
The problem I am having is, is the modification above appended to the /usr/local
version of config.site
? Or does it replace an existing block of code? Or can I just copy it where it belongs without modification?
或者,/usr/local/share/config.site
的猫是什么样子的?
Or maybe, what does a cat of /usr/local/share/config.site
look like?
这是 /usr
的 config.site
.我不清楚是否需要修改或如何修改.
Here is the config.site
for /usr
. Its not clear to me if it needs modification or how to modify it.
$ cat /usr/share/config.site
# This is the config.site file to satisfy FHS defaults when installing below
# /usr.
#
# You may override this file by your config.site using the CONFIG_SITE env
# variable.
#
# Note: This file includes also RHEL/Fedora fix for installing libraries into
# "/lib/lib64" on 64bit systems.
if test -n "$host"; then
# skip when cross-compiling
return 0
fi
if test "$prefix" = /usr
|| { test "$prefix" = NONE && test "$ac_default_prefix" = /usr ; }
then
test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc
test "$sharedstatedir" = '${prefix}/com' && sharedstatedir=/var
test "$localstatedir" = '${prefix}/var' && localstatedir=/var
ARCH=`uname -m`
for i in x86_64 ppc64 s390x aarch64; do
if test $ARCH = $i; then
test "$libdir" = '${exec_prefix}/lib' && libdir='${exec_prefix}/lib64'
break
fi
done
fi
推荐答案
这回答了关于 /usr/local/share/config.site
的 config.site
是什么样子的问题.正如@John Bollinger 在评论中指出的那样,它没有回答为什么 --libdir=/usr/local/lib64
无法设置目录的问题.
This answers the question of what config.site
looks like for /usr/local/share/config.site
. It does not answer the question of why --libdir=/usr/local/lib64
fails to set the directory, as @John Bollinger pointed out in the comments.
/usr/local/share/config.site
是错误的.虽然它是从 Fedora 的 config.site
复制并放置在 /usr/local/share
中,但前缀目录是错误的.前缀测试应该使用 /usr/local
而不是 /usr
.
The /usr/local/share/config.site
is wrong. Though it was copied from Fedora's config.site
and placed in /usr/local/share
, the prefix directories are wrong. The prefix test should use /usr/local
and not /usr
.
以下是更正的.
$ cat /usr/local/share/config.site
...
if test -n "$host"; then
# skip when cross-compiling
return 0
fi
if test "$prefix" = /usr/local
|| { test "$prefix" = NONE && test "$ac_default_prefix" = /usr/local ; }
then
test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc
test "$sharedstatedir" = '${prefix}/com' && sharedstatedir=/var
test "$localstatedir" = '${prefix}/var' && localstatedir=/var
ARCH=`uname -m`
for i in x86_64 ppc64 s390x aarch64; do
if test $ARCH = $i; then
test "$libdir" = '${exec_prefix}/lib' && libdir='${exec_prefix}/lib64'
break
fi
done
fi
不过,我不确定这些是否正确.它们没有被修改.
I'm not sure if these are correct, however. They were not modified.
test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc
test "$sharedstatedir" = '${prefix}/com' && sharedstatedir=/var
test "$localstatedir" = '${prefix}/var' && localstatedir=/var
现在,下一个问题是,为什么 Fedora 的 /usr/share/config.site
没有正确处理 prefix=/usr/local
.这是 问题 1510073 中的一个悬而未决的问题:Autoconf 不支持 config.site 中的 libdir 为libdir"=@libdir@" 在 *.pc 文件中,该文件已作为 NOT A BUG 关闭.
Now, the next question is, why Fedora's /usr/share/config.site
is not handling prefix=/usr/local
properly. That's an open question at Issue 1510073 : Autoconf does not honor libdir in config.site for "libdir=@libdir@" in *.pc file, which has been closed as NOT A BUG.
这篇关于Fedora x86_64 上供应商库的 config.site的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!