1 ?RCS: $Id: Extensions.U,v$
3 ?RCS: Copyright (c) 1996-1998, 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: Extensions.U,v $
10 ?MAKE:known_extensions extensions dynamic_ext static_ext nonxs_ext \
11 useposix useopcode : \
12 Myread hint usedl d_sem d_socket i_db i_dbm i_rpcsvcdbm i_gdbm \
13 i_ndbm usethreads package test cat rsrc d_msg d_shm
14 ?MAKE: -pick add $@ %<
17 ?S: This variable holds a list of all XS extensions included in
21 ?S: This variable holds a list of XS extension files we want to
22 ?S: link dynamically into the package. It is used by Makefile.
25 ?S: This variable holds a list of XS extension files we want to
26 ?S: link statically into the package. It is used by Makefile.
29 ?S: This variable holds a list of all non-xs extensions included
30 ?S: in the package. All of them will be built.
33 ?S: This variable holds a list of all extension files (both XS and
34 ?S: non-xs linked into the package. It is propagated to Config.pm
35 ?S: and is typically used to test whether a particular extesion
39 ?S: This variable holds either 'true' or 'false' to indicate
40 ?S: whether the POSIX extension should be used. The sole
41 ?S: use for this currently is to allow an easy mechanism
42 ?S: for hints files to indicate that POSIX will not compile
43 ?S: on a particular system.
46 ?S: This variable holds either 'true' or 'false' to indicate
47 ?S: whether the Opcode extension should be used. The sole
48 ?S: use for this currently is to allow an easy mechanism
49 ?S: for users to skip the Opcode extension from the Configure
52 ?T:xxx avail_ext tdir nonxs_extensions find_extensions
53 ?INIT:: set useposix=false in your hint file to disable the POSIX extension.
55 ?INIT:: set useopcode=false in your hint file to disable the Opcode extension.
58 echo "Looking for extensions..." >&4
59 : If we are using the old config.sh, known_extensions may contain
60 : old or inaccurate or duplicate values.
63 : We do not use find because it might not be available.
64 : We do not just use MANIFEST because the user may have dropped
65 : some additional extensions into the source tree and expect them
68 : Function to recursively find available extensions, ignoring DynaLoader
69 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
73 DynaLoader|dynaload) ;;
75 if $test -f $xxx/$xxx.xs; then
76 known_extensions="$known_extensions $1$xxx";
77 elif $test -f $xxx/Makefile.PL; then
78 nonxs_extensions="$nonxs_extensions $1$xxx";
80 if $test -d $xxx -a $# -lt 10; then
83 eval $find_extensions;
96 set X $nonxs_extensions
99 set X $known_extensions
101 known_extensions="$*"
104 : Now see which are supported on this system.
105 ?X: avail_ext lists available XS extensions.
107 for xxx in $known_extensions ; do
109 ?X: Handle possible DOS 8.3 filename and case alterations
112 $define) avail_ext="$avail_ext $xxx" ;;
117 $define) avail_ext="$avail_ext $xxx" ;;
122 $define) avail_ext="$avail_ext $xxx" ;;
126 case "${i_dbm}${i_rpcsvcdbm}" in
127 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
132 true|define|y) avail_ext="$avail_ext $xxx" ;;
137 true|define|y) avail_ext="$avail_ext $xxx" ;;
142 true|$define|y) avail_ext="$avail_ext $xxx" ;;
146 case "$usethreads" in
147 true|$define|y) avail_ext="$avail_ext $xxx" ;;
151 : XXX Do we need a useipcsysv variable here
152 case "${d_msg}${d_sem}${d_shm}" in
153 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
156 *) avail_ext="$avail_ext $xxx"
165 : Now see which nonxs extensions are supported on this system.
166 : For now assume all are.
168 for xxx in $nonxs_extensions ; do
170 *) nonxs_ext="$nonxs_ext $xxx"
182 A number of extensions are supplied with $package. You may choose to
183 compile these extensions for dynamic loading (the default), compile
184 them into the $package executable (static loading), or not include
185 them at all. Answer "none" to include no extensions.
186 Note that DynaLoader is always built and need not be mentioned here.
189 case "$dynamic_ext" in
190 '') dflt="$avail_ext" ;;
191 *) dflt="$dynamic_ext"
192 # Perhaps we are reusing an old out-of-date config.sh.
195 if test X"$dynamic_ext" != X"$avail_ext"; then
197 NOTICE: Your previous config.sh list may be incorrect.
198 The extensions now available to you are
200 but the default list from your previous config.sh is
212 rp="What extensions do you wish to load dynamically?"
215 ?X: Use ' ' so a subsequent Configure will preserve that value.
216 none) dynamic_ext=' ' ;;
217 *) dynamic_ext="$ans" ;;
220 case "$static_ext" in
222 : Exclude those already listed in dynamic linking
224 for xxx in $avail_ext; do
225 case " $dynamic_ext " in
227 *) dflt="$dflt $xxx" ;;
234 *) dflt="$static_ext"
241 rp="What extensions do you wish to load statically?"
244 ?X: Use ' ' so a subsequent Configure will preserve that value.
245 none) static_ext=' ' ;;
246 *) static_ext="$ans" ;;
251 A number of extensions are supplied with $package. Answer "none"
252 to include no extensions.
253 Note that DynaLoader is always built and need not be mentioned here.
256 case "$static_ext" in
257 '') dflt="$avail_ext" ;;
258 *) dflt="$static_ext"
259 # Perhaps we are reusing an old out-of-date config.sh.
262 if test X"$static_ext" != X"$avail_ext"; then
264 NOTICE: Your previous config.sh list may be incorrect.
265 The extensions now available to you are
267 but the default list from your previous config.sh is
276 : Exclude those that are not xs extensions
280 rp="What extensions do you wish to include?"
283 ?X: Use ' ' so a subsequent Configure will preserve that value.
284 none) static_ext=' ' ;;
285 *) static_ext="$ans" ;;
290 set X $dynamic_ext $static_ext $nonxs_ext