1 ?RCS: $Id: usethreads.U,v $
3 ?RCS: Copyright (c) 1998-2000 Andy Dougherty
5 ?RCS: You may distribute under the terms of either the GNU General Public
6 ?RCS: License or the Artistic License, as specified in the README file.
8 ?RCS: $Log: usethreads.U,v $
10 ?MAKE:usethreads useithreads d_oldpthreads usereentrant: \
11 Myread Oldconfig Setvar test cat
12 ?MAKE: -pick add $@ %<
15 ?S: This variable conditionally defines the USE_THREADS symbol,
16 ?S: and indicates that Perl should be built to use threads.
19 ?S: This variable conditionally defines the USE_ITHREADS symbol,
20 ?S: and indicates that Perl should be built to use the interpreter-based
21 ?S: threading implementation.
23 ?X: I'm putting old_pthreads in this unit because it might eventually
24 ?X: be part of an automatic determination to see if we can use threads
27 ?S: This variable conditionally defines the OLD_PTHREADS_API symbol,
28 ?S: and indicates that Perl should be built to use the old
29 ?S: draft POSIX threads API. This is only potentially meaningful if
30 ?S: usethreads is set.
33 ?S: This variable conditionally defines the USE_REENTRANT_API symbol,
34 ?S: which indicates that the thread code may try to use the various
35 ?S: _r versions of library functions. This is only potentially
36 ?S: meaningful if usethreads is set and is very experimental, it is
37 ?S: not even prompted for.
40 ?C: This symbol, if defined, indicates that Perl should be built to
41 ?C: use the interpreter-based threading implementation.
44 ?C: This symbol, if defined, indicates that Perl should
45 ?C: be built to use threads. At present, it is a synonym for
46 ?C: and USE_ITHREADS, but eventually the source ought to be
47 ?C: changed to use this to mean _any_ threading implementation.
50 ?C: This symbol, if defined, indicates that Perl should
51 ?C: be built to use the old draft POSIX threads API.
54 ?C: This symbol, if defined, indicates that Perl should
55 ?C: try to use the various _r versions of library functions.
56 ?C: This is extremely experimental.
58 ?H:#$useithreads USE_ITHREADS /**/
59 ?H:#$usethreads USE_THREADS /**/
60 ?H:#$d_oldpthreads OLD_PTHREADS_API /**/
61 ?H:#$usereentrant USE_REENTRANT_API /**/
63 ?LINT:set usethreads d_oldpthreads
64 ?INIT:: set usethreads on the Configure command line to enable threads.
65 ?INIT:usereentrant='undef'
67 : Do we want threads support and if so, what type
68 ?X: We should really have some explanatory text here, and some
69 ?X: automatic setting of sensible defaults.
71 $define|true|[yY]*) dflt='y';;
72 *) # Catch case where user specified ithreads but
73 # forgot -Dusethreads (A.D. 4/2002)
74 case "$useithreads" in
82 Perl can be built to offer a form of threading support on some systems
83 To do so, Configure can be run with -Dusethreads.
85 Note that Perl built with threading support runs slightly slower
86 and uses slightly more memory than plain Perl.
88 If this doesn't make any sense to you, just accept the default '$dflt'.
90 rp='Build a threading Perl?'
99 useithreads="$usethreads"
101 ?X: Check out what kind of threads API we have
102 case "$d_oldpthreads" in
103 '') : Configure tests would be welcome here. For now, assume undef.
105 *) val="$d_oldpthreads" ;;
110 ?X: In general, -lpthread needs to come before -lc but after other
111 ?X: libraries such as -lgdbm and such like. We assume here that -lc
112 ?X: is present in libswanted. If that fails to be true, then this
113 ?X: can be changed to add pthread to the very end of libswanted.
115 : Look for a hint-file generated 'call-back-unit'. If the
116 : user has specified that a threading perl is to be built,
117 : we may need to set or change some other defaults.
118 if $test -f usethreads.cbu; then
119 echo "Your platform has some specific hints regarding threaded builds, using them..."
122 case "$usethreads" in
123 "$define"|true|[yY]*)
125 (Your platform does not have any specific hints for threaded builds.
126 Assuming POSIX threads, then.)