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

gvk*_*vkv 5 perl multithreading freebsd compilation

我正在尝试在我的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.
Run Code Online (Sandbox Code Playgroud)

谷歌寻找答案出现了安装gethostnamadr.c这是好的,除了两件事:

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

gvk*_*vkv 4

要在 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 
Run Code Online (Sandbox Code Playgroud)

编辑:我忘记了我的参考资料;请在此处查看更多信息:http://www.gossamer-threads.com/lists/perl/porters/232518 ?nohighlight=1#232518 。