
我正在運行 CentOS 6.3 64 位元和 DirectAdmin 控制面板。目前我已經安裝了 Apache Subversion 1.6.19,沒有任何問題。
我已經使用 yum 安裝了 expat、expat-devel 和 neon-devel。
安裝 Apache Subversion 1.6.19 時,此設定指令可以正常運作:
./configure --prefix=/usr --with-ssl --with-apxs=/usr/sbin/apxs --with-apr=/usr/bin/apr-config
但是,當使用與上面相同的設定指令安裝 Apache Subversion 1.7.7 時,在執行指令「make」後出現此錯誤:
/etc/httpd/lib/libaprutil-1.so: undefined reference to `XML_StopParser'
collect2: ld returned 1 exit status
make: *** [subversion/svnadmin/svnadmin] Error 1
但是我發現可以透過將其添加到配置命令中來解決該問題:
--with-expat=includes:lib_search_dirs:libs
所以它看起來像這樣:
./configure --prefix=/usr --with-ssl --with-expat=includes:lib_search_dirs:libs --with-apxs=/usr/sbin/apxs --with-apr=/usr/bin/apr-config
但是,該配置命令隨後會發出此警告:
configure: WARNING: Expat found amongst libraries used by APR-Util, but Subversion libraries might be needlessly linked against additional unused libraries. It can be avoided by specifying exact location of Expat in argument of --with-expat option.
所以我想解決這個問題。我進行了很多實驗,但無法弄清楚如何在配置命令中“指定 Expat 的確切位置”,以及如何找出該位置應該是什麼?
然而經過大量搜索後我發現了這一點:http://subversion.tigris.org/issues/show_bug.cgi?id=3997- 一位 FreeBSD 用戶這樣說:
Building Subversion 1.7.x on FreeBSD currently requires a configure flag:
--with-expat=/usr/local/include:/usr/local/lib:expat
As that is the default location of expat on that platform, it would be nice if configure detected it automatically.
不過我沒有使用 FreeBSD,我運行的是 CentOS 6.3 64 位元。還記得我說過我已經使用 yum 安裝了 expat 和 expat-devel 和 neon-devel。
不過,我嘗試使用 FreeBSD 用戶發布的 expat/command 路徑,它似乎有效,在運行配置命令時不會給出錯誤,並且在運行“make”時不會給出錯誤。這是我當時用的:
./configure --prefix=/usr --with-ssl --with-expat=/usr/local/include:/usr/local/lib:expat --with-apxs=/usr/sbin/apxs --with-apr=/usr/bin/apr-config
但是這個伺服器是一個生產伺服器,因此我需要你的幫助來建議這是否也可以在 CentOS 伺服器上運行? CentOS 上 expat 指令中的以下路徑是否正確?
--with-expat=/usr/local/include:/usr/local/lib:expat
如果不是,請建議應該改成什麼。預先感謝您對此的任何確認或幫助!
我錯了,FreeBSD 的 expat 位置在 CentOS 上不起作用。這:
./configure --prefix=/usr --with-ssl --with-expat=/usr/local/include:/usr/local/lib:expat --with-apxs=/usr/sbin/apxs --with-apr=/usr/bin/apr-config
執行“make”後出現此錯誤:
/etc/httpd/lib/libaprutil-1.so: undefined reference to `XML_StopParser'
collect2: ld returned 1 exit status
make: *** [subversion/svnadmin/svnadmin] Error 1
我放棄。我在互聯網上的任何地方都沒有找到關於如何在上述命令中為 CentOS 指定 expat 位置的任何答案(在解決方案後已經搜索了一個多星期),並且已在多個地方發布尋求幫助。
答案1
你有安裝了這個expat-devel
包,對嗎?