X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=hints%2Ffreebsd.sh;h=937df2a85a0069f28ee33b7cf8da4c5ba038209d;hb=69ca0fd0bef57ce8f6e0725124a9bd19455d9e2f;hp=0ba6b6190e1442891a78a60d6d67f5482da93cb5;hpb=7f2de2d2ad713e777c0e8d552b0e59a636cc6282;p=p5sagit%2Fp5-mst-13.2.git diff --git a/hints/freebsd.sh b/hints/freebsd.sh index 0ba6b61..937df2a 100644 --- a/hints/freebsd.sh +++ b/hints/freebsd.sh @@ -20,7 +20,7 @@ # # Modified to ensure we replace -lc with -lc_r, and # to put in place-holders for various specific hints. -# Andy Dougherty +# Andy Dougherty # Date: Tue Mar 10 16:07:00 EST 1998 # # Support for FreeBSD/ELF @@ -67,7 +67,10 @@ case "$osvers" in # 2.0.5*|2.0-built*|2.1*) usevfork='true' - usemymalloc='n' + case "$usemymalloc" in + "") usemymalloc='n' + ;; + esac d_setregid='define' d_setreuid='define' d_setegid='undef' @@ -79,22 +82,21 @@ case "$osvers" in # don't use -lmalloc (maybe there's an old one from 1.1.5.1 floating around) 2.2*) usevfork='true' - usemymalloc='n' + case "$usemymalloc" in + "") usemymalloc='n' + ;; + esac libswanted=`echo $libswanted | sed 's/ malloc / /'` d_setregid='define' d_setreuid='define' d_setegid='undef' d_seteuid='undef' ;; -3.*) - usevfork='true' - usemymalloc='n' - libswanted=`echo $libswanted | sed 's/ malloc / /'` - ;; -# -# Guesses at what will be needed after 3.* *) usevfork='true' - usemymalloc='n' + case "$usemymalloc" in + "") usemymalloc='n' + ;; + esac libswanted=`echo $libswanted | sed 's/ malloc / /'` ;; esac @@ -130,6 +132,7 @@ case "$osvers" in 0*|1*|2*|3*) ;; *) + ccflags="${ccflags} -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H" if /usr/bin/file -L /usr/lib/libc.so | /usr/bin/grep -vq "not stripped" ; then usenm=false fi @@ -179,7 +182,7 @@ esac cat > UU/usethreads.cbu <<'EOCBU' case "$usethreads" in $define|true|[yY]*) - lc_r=`/sbin/ldconfig -r|grep ':-lc_r'|awk '{print $NF}'|tail -1` + lc_r=`/sbin/ldconfig -r|grep ':-lc_r'|awk '{print $NF}'|sed -n '$p'` case "$osvers" in 0*|1*|2.0*|2.1*) cat <&4 I did not know that FreeBSD $osvers supports POSIX threads. @@ -194,7 +197,8 @@ EOM POSIX threads are not supported well by FreeBSD $osvers. Please consider upgrading to at least FreeBSD 2.2.8, -or preferably to 3.something. +or preferably to the most recent -RELEASE or -STABLE +version (see http://www.freebsd.org/releases/). (While 2.2.7 does have pthreads, it has some problems with the combination of threads and pipes and therefore @@ -215,6 +219,14 @@ EOM exit 1 fi ldflags="-pthread $ldflags" + case "$osvers" in + 4.*|5.0-release*) + # 4.x and 5.0-release have gethostbyaddr_r but it is + # "Temporary function, not threadsafe"... + d_gethostbyaddr_r="undef" + d_gethostbyaddr_r_proto="0" + ;; + esac ;; esac @@ -235,5 +247,11 @@ EOM esac unset lc_r + + # Even with the malloc mutexes the Perl malloc does not + # seem to be threadsafe in FreeBSD? + usemymalloc=n + esac EOCBU +