2017-10-20 114 views
1

我在Fedora 26,x86_64上構建一些基於Autotool的庫時遇到問題。 64位Fedora將第三方和供應商庫放在/usr/local/lib64中。 Ubuntu 17使用/usr/local/lib,所以相同的項目構建好。Fedora x86_64上供應商庫的config.site

我一直在使用--libdir=/usr/local/lib64但三個庫抵制它。 /usr/local我缺少config.site,所以我想添加一個。在討論usr/localconfig.site時,網站默認值的Autoconf manual有點讓我感到困惑。它說:

[中/usrconfg.site討論] ...

同樣,在其中64位庫默認情況下,建平臺, 然後安裝在/ usr /本地/ lib64的,而不是的/ usr /本地/ lib下,它是 適當安裝/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' 

我遇到的問題是,是變形例以上附加到/usr/local版本config.site?或者它取代現有的代碼塊?或者我可以在沒有修改的情況下將其複製到其所屬的位

或者,也許貓/usr/local/share/config.site看起來像什麼?


這是/usrconfig.site。我不清楚它是否需要修改或如何修改它。

$ 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 
+2

我開始就這個問題寫一個答案,但我認爲這會浪費時間。如果明確地指定'--libdir'選項不會導致您的庫到達您想要的位置,那麼添加或修改站點默認設置似乎也不太可能實現。默認點主要是爲了避免你必須手動指定安裝位置,但你已經過去了。 –

+0

我建議查看Makefile.am(假設Automake正在發揮作用),它指導相關庫的構建。修改它以遵守您指定的libdir應該不會太難。但是,不管怎麼說,它是否有目的性還沒有做到。 –

+0

謝謝@約翰。我收集了更多信息。這是一個程序的Fedora spec文件。請注意''gnutls.spec'](http://pkgs.fedoraproject.org/cgit/rpms/gnutls.git/tree/gnutls.spec)中使用'sed'修補'%{_ libdir}'。我想我的下一個問題是,GnuTLS首先通過設置「sys_lib_dlsearch_path_spec」來做正確的事情?看起來Autotools/Autoconf應該推動整個過程。也就是說,'sys_lib_dlsearch_path_spec'擺弄不應該出現,並且應該始終使用'%{libdir}'。 – jww

回答

0

config.site的供應商庫在Fedora x86_64的

這回答了什麼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 "[email protected]@" in *.pc file,已被關閉爲非BUG