Commit | Line | Data |
5f51ce50 |
1 | ?RCS: $Id: Extensions.U,v$ |
2 | ?RCS: |
3 | ?RCS: You may redistribute only under the terms of the Artistic Licence, |
4 | ?RCS: as specified in the README file that comes with the distribution. |
5 | ?RCS: You may reuse parts of this distribution only within the terms of |
6 | ?RCS: that same Artistic Licence; a copy of which may be found at the root |
7 | ?RCS: of the source tree for dist 3.0. |
8 | ?RCS: |
9 | ?RCS: $Log: Extensions.U,v $ |
10 | ?RCS: |
11 | ?MAKE:known_extensions extensions dynamic_ext static_ext useposix : \ |
12 | Myread usedl d_socket i_db i_dbm i_ndbm i_gdbm package test cat |
13 | ?MAKE: -pick add $@ %< |
14 | ?S:known_extensions: |
15 | ?S: This variable holds a list of all extensions included in |
16 | ?S: the package. |
17 | ?S:. |
18 | ?S:dynamic_ext: |
19 | ?S: This variable holds a list of extension files we want to |
20 | ?S: link dynamically into the package. It is used by Makefile. |
21 | ?S:. |
22 | ?S:static_ext: |
23 | ?S: This variable holds a list of extension files we want to |
24 | ?S: link statically into the package. It is used by Makefile. |
25 | ?S:. |
26 | ?S:extensions: |
27 | ?S: This variable holds a list of all extension files |
28 | ?S: linked into the package. It is propagated to Config.pm |
29 | ?S: and is typically used to test whether a particular extesion |
30 | ?S: is available. |
31 | ?S:. |
32 | ?S:useposix: |
33 | ?S: This variable holds either 'true' or 'false' to indicate |
34 | ?S: whether the POSIX extension should be used. The sole |
35 | ?S: use for this currently is to allow an easy mechanism |
36 | ?S: for hints files to indicate that POSIX will not compile |
37 | ?S: on a particular system. |
38 | ?S:. |
39 | ?T:xxx avail_ext |
40 | ?INIT:: set useposix=false in your hint file to disable the POSIX extension. |
41 | ?INIT:useposix=true |
42 | echo " " |
43 | echo "Looking for extensions..." >&4 |
44 | cd ../ext |
45 | ?X: If we're using the old config.sh, known_extensions may contain |
46 | ?X: old or inaccurate (or duplicate) values. |
47 | known_extensions='' |
48 | for xxx in * ; do |
49 | if $test -f $xxx/$xxx.xs; then |
50 | known_extensions="$known_extensions $xxx" |
51 | fi |
52 | done |
53 | set X $known_extensions |
54 | shift |
55 | known_extensions="$*" |
56 | cd ../UU |
57 | |
58 | : Now see which are supported on this system. |
59 | avail_ext='' |
60 | for xxx in $known_extensions ; do |
61 | case "$xxx" in |
62 | DB_File) case "$i_db" in |
63 | $define) avail_ext="$avail_ext $xxx" ;; |
64 | esac |
65 | ;; |
66 | GDBM_File) case "$i_gdbm" in |
67 | $define) avail_ext="$avail_ext $xxx" ;; |
68 | esac |
69 | ;; |
70 | NDBM_File) case "$i_ndbm" in |
71 | $define) avail_ext="$avail_ext $xxx" ;; |
72 | esac |
73 | ;; |
74 | ODBM_File) case "$i_dbm" in |
75 | $define) avail_ext="$avail_ext $xxx" ;; |
76 | esac |
77 | ;; |
78 | POSIX) case "$useposix" in |
79 | true|define|y) avail_ext="$avail_ext $xxx" ;; |
80 | esac |
81 | ;; |
82 | Socket) case "$d_socket" in |
83 | $define) avail_ext="$avail_ext $xxx" ;; |
84 | esac |
85 | ;; |
86 | *) avail_ext="$avail_ext $xxx" |
87 | ;; |
88 | esac |
89 | done |
90 | |
91 | set X $avail_ext |
92 | shift |
93 | avail_ext="$*" |
94 | |
95 | case $usedl in |
96 | $define) |
97 | $cat <<EOM |
98 | A number of extensions are supplied with $package. You may choose to |
99 | compile these extensions for dynamic loading (the default), compile |
100 | them into the $package executable (static loading), or not include |
101 | them at all. Answer "none" to include no extensions. |
102 | |
103 | EOM |
104 | case "$dynamic_ext" in |
105 | ''|' ') dflt="$avail_ext" ;; |
106 | *) dflt="$dynamic_ext" ;; |
107 | esac |
108 | case "$dflt" in |
109 | '') dflt=none;; |
110 | esac |
111 | rp="What extensions do you wish to load dynamically?" |
112 | . ./myread |
113 | case "$ans" in |
114 | none) dynamic_ext='' ;; |
115 | *) dynamic_ext="$ans" ;; |
116 | esac |
117 | |
118 | case "$static_ext" in |
119 | ''|' ') |
120 | : Exclude those already listed in dynamic linking |
121 | dflt='' |
122 | for xxx in $avail_ext; do |
123 | case " $dynamic_ext " in |
124 | *" $xxx "*) ;; |
125 | *) dflt="$dflt $xxx" ;; |
126 | esac |
127 | done |
128 | set X $dflt |
129 | shift |
130 | dflt="$*" |
131 | ;; |
132 | *) dflt="$static_ext" |
133 | ;; |
134 | esac |
135 | |
136 | case "$dflt" in |
137 | '') dflt=none;; |
138 | esac |
139 | rp="What extensions do you wish to load statically?" |
140 | . ./myread |
141 | case "$ans" in |
142 | none) static_ext='' ;; |
143 | *) static_ext="$ans" ;; |
144 | esac |
145 | ;; |
146 | *) |
147 | $cat <<EOM |
148 | A number of extensions are supplied with $package. Answer "none" |
149 | to include no extensions. |
150 | |
151 | EOM |
152 | case "$static_ext" in |
153 | ''|' ') dflt="$avail_ext" ;; |
154 | *) dflt="$static_ext" ;; |
155 | esac |
156 | |
157 | case "$dflt" in |
158 | '') dflt=none;; |
159 | esac |
160 | rp="What extensions do you wish to include?" |
161 | . ./myread |
162 | case "$ans" in |
163 | none) static_ext='' ;; |
164 | *) static_ext="$ans" ;; |
165 | esac |
166 | ;; |
167 | esac |
168 | |
169 | set X $dynamic_ext $static_ext |
170 | shift |
171 | extensions="$*" |
172 | |