summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/hints/solaris_2.sh
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/hints/solaris_2.sh')
-rw-r--r--gnu/usr.bin/perl/hints/solaris_2.sh31
1 files changed, 29 insertions, 2 deletions
diff --git a/gnu/usr.bin/perl/hints/solaris_2.sh b/gnu/usr.bin/perl/hints/solaris_2.sh
index 7ffc53c6efe..ce36480b181 100644
--- a/gnu/usr.bin/perl/hints/solaris_2.sh
+++ b/gnu/usr.bin/perl/hints/solaris_2.sh
@@ -32,6 +32,11 @@ mistrustnm=${mistrustnm:-run}
# http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-01/msg00465.html
usemymalloc=${usemymalloc:-false}
+# malloc wrap works
+case "$usemallocwrap" in
+'') usemallocwrap='define' ;;
+esac
+
# Avoid all libraries in /usr/ucblib.
# /lib is just a symlink to /usr/lib
set `echo $glibpth | sed -e 's@/usr/ucblib@@' -e 's@ /lib @ @'`
@@ -238,9 +243,13 @@ END
# Hmm. gcc doesn't call /usr/ccs/bin/ld directly, but it
# does appear to be using it eventually. egcs-1.0.3's ld
# wrapper does this.
- # All Solaris versions of ld I've seen contain the magic
+ # Most Solaris versions of ld I've seen contain the magic
# string used in the grep.
:
+ elif echo "$verbose" | grep "Solaris Link Editors" >/dev/null 2>&1; then
+ # However some Solaris 8 versions prior to ld 5.8-1.286 contain
+ # this string instead.
+ :
else
# No evidence yet of /usr/ccs/bin/ld. Some versions
# of egcs's ld wrapper call /usr/ccs/bin/ld in turn but
@@ -260,6 +269,10 @@ END
grep "ld: Software Generation Utilities" >/dev/null 2>&1; then
# Ok, /usr/ccs/bin/ld eventually does get called.
:
+ elif ${myld:-ld} -V 2>&1 |
+ grep "Solaris Link Editors" >/dev/null 2>&1; then
+ # Ok, /usr/ccs/bin/ld eventually does get called.
+ :
else
echo "Found GNU ld='$myld'" >&4
cat <<END >&2
@@ -345,11 +358,25 @@ case "$usethreads" in
$define|true|[yY]*)
ccflags="-D_REENTRANT $ccflags"
- sched_yield='yield'
+ # -lpthread overrides some lib C functions, so put it before c.
set `echo X "$libswanted "| sed -e "s/ c / pthread c /"`
shift
libswanted="$*"
+ # sched_yield is available in the -lrt library. However,
+ # we can also pick up the equivalent yield() function in the
+ # normal C library. To avoid pulling in unnecessary
+ # libraries, we'll normally avoid sched_yield()/-lrt and
+ # just use yield(). However, we'll honor a command-line
+ # override : "-Dsched_yield=sched_yield".
+ # If we end up using sched_yield, we're going to need -lrt.
+ sched_yield=${sched_yield:-yield}
+ if test "$sched_yield" = "sched_yield"; then
+ set `echo X "$libswanted "| sed -e "s/ pthread / rt pthread /"`
+ shift
+ libswanted="$*"
+ fi
+
# On Solaris 2.6 x86 there is a bug with sigsetjmp() and siglongjmp()
# when linked with the threads library, such that whatever positive
# value you pass to siglongjmp(), sigsetjmp() returns 1.