我在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/local
的config.site
時,網站默認值的Autoconf manual有點讓我感到困惑。它說:
[中
/usr
版confg.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
看起來像什麼?
這是/usr
的config.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
我開始就這個問題寫一個答案,但我認爲這會浪費時間。如果明確地指定'--libdir'選項不會導致您的庫到達您想要的位置,那麼添加或修改站點默認設置似乎也不太可能實現。默認點主要是爲了避免你必須手動指定安裝位置,但你已經過去了。 –
我建議查看Makefile.am(假設Automake正在發揮作用),它指導相關庫的構建。修改它以遵守您指定的libdir應該不會太難。但是,不管怎麼說,它是否有目的性還沒有做到。 –
謝謝@約翰。我收集了更多信息。這是一個程序的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