perl - 如何在 FreeBSD 7.1 下编译具有线程支持的 Perl 5.10?

标签 perl multithreading compilation freebsd

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

...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,这如何解决我的问题?

最佳答案

要在 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 .

关于perl - 如何在 FreeBSD 7.1 下编译具有线程支持的 Perl 5.10?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/814285/

相关文章:

apache - 如何在apache服务器上运行cgi脚本

json - 祝福对象转换为 JSON

java - 从 Win7 64 位编译 32 位

c++ - ESP8266 错误 : macro "min" passed 3 arguments, 但只需要 2

algorithm - "The Social Network"编程难题

xml - Perl:从 XML 输出填充数组(通过 Eutils 的 PubMed UID)

java - java 子线程数组访问

c# - Action 延迟扩展方法不起作用

c - gcc 编译器中是否有用于 pthread 代码的标志以最小化执行时间?

compilation - 如何在 OpenShift 上编译和安装源代码?