我正在尝试在FreeBSD 7.1(BSD)服务器上编译Perl 5.10,但是当我运行Configure脚本并回答问题时,我收到以下错误:

...POSTIX threads should be supported by FreeBSD 7.1 ... but your system is missing the shared libc_r.

谷歌搜索得到了安装gethostnamadr.c的答案,除了两件事情之外没什么问题:

  1. 我不知道在哪里放这个文件和
  2. 如果Configure想要查看libc_r?
  3. ,这如何解决我的问题
有帮助吗?

解决方案

在FreeBSD 7上启用Perl 5.10线程。*您所要做的就是使用 patch 应用以下补丁。然后,您可以使用-Dusethreads构建perl或回答 Configure 文件问题以启用线程,并且您很高兴。我还没有做过任何重要的测试或比较,但是包括线程库在内的一切编译都很好,我的所有Perl程序都运行正常。

--- hints/freebsd.sh 2008/10/20 04:59:30 1.1
+++ hints/freebsd.sh 2008/10/20 22:49:29
@@ -211,6 +211,14 @@
exit 1
;;

+ 7.*)
+ # 7.x doesn't install libc_r by default, and Configure
+ # would fail in the code following
+ #
+ # gethostbyaddr_r() appears to have been implemented in 6.x+
+ ldflags="-pthread $ldflags"
+ ;;
+
*)
if [ ! -r "$lc_r" ]; then
cat <<EOM >&4 
编辑:我忘记了我的参考;点击此处查看更多信息: http:// www。 gossamer-threads.com/lists/perl/porters/232518?nohighlight=1#232518

其他提示

与Spolsky说“perl几乎被遗忘”相反...... perl非常活跃。

你还没有说明你安装了哪个版本的FreeBSD ......但是假设你已经安装了一分钟的FreeBSD 7.1,那么你就无法安装线程库,或者线程库不在库路径中。

注意libc是一个通用的'c'库,而libc_r是该文件的线程安全版本。 2005年的一些谷歌搜索结果显示libc_r已被弃用。

考虑到这一点,您可能正处于“修订版冲突”的中间。遗憾的是,FreeBSD本身没有提供perl的线程安全版本,但是,他们打包perl 5.10以及后来的几个版本。我发现此链接很有用:

http://www.nabble.com/How---where-to-get-a-Perl-that-has-threads--td22270858.html

您可能还想尝试安装FreeBSD附带的p5-fork库

http://www.nabble.com/How---where-to-get-a-Perl-that-has-threads--td22270858.html

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top