Fedora x86_64上供应商库的config.site

时间:2017-10-20 11:12:55

标签: x86-64 fedora autotools autoconf

我在Fedora 26,x86_64上构建一些基于Autotool的库时遇到了麻烦。 64位Fedora将第三方和供应商库放在/usr/local/lib64中。 Ubuntu 17使用/usr/local/lib,因此相同的项目构建正常。

我一直在使用--libdir=/usr/local/lib64,但有三个图书馆抵制它。我config.site缺少/usr/local,所以我想添加一个usr/local。在讨论config.site /usr时,网站默认设置上的Autoconf manual对我来说有点让人困惑。它说:

  

[confg.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' 版本的讨论......

     

同样,在默认情况下构建64位库的平台上,   然后安装在/ usr / local / lib64而不是/ usr / local / lib中   适合安装/usr/local/share/config.site:

/usr/local

我遇到的问题是,上面的修改是否附加在config.site /usr/local/share/config.site版本的config.site上?或者它是否取代现有的代码块?或者我可以将其复制到它所属的位置而不进行修改?

或许,/usr的猫看起来像什么?

以下是$ 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 的{​​{1}}。我不清楚它是否需要修改或如何修改它。

for(var i = 0; i<5; i++){
//create a self executing function 
 (function(iValue){
  //in this scope iValue has the i from the loop
  setTimeout(function() {
   console.log(iValue); //will print the correct i
 })
 })(i); //pass i in it's current context to the function
}

1 个答案:

答案 0 :(得分:0)

  

Fedora x86_64上供应商库的config.site

这回答了config.site /usr/local/share/config.site的问题。它没有回答为什么--libdir=/usr/local/lib64无法设置目录的问题,正如@John Bollinger在评论中指出的那样。

/usr/local/share/config.site错了。虽然它是从Fedora的config.site复制并放在/usr/local/share中,但前缀目录是错误的。前缀测试应使用/usr/local而不是/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
但是,我不确定这些是否正确。他们没有被修改。

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。这是Issue 1510073 : Autoconf does not honor libdir in config.site for "libdir=@libdir@" in *.pc file的一个悬而未决的问题,已被关闭为 NOT A BUG