我尝试在 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 的结果,除了两件事之外,这很好:
- 我不知道该文件放在哪里
- 如果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/