Commit | Line | Data |
---|---|---|
70674189 JH |
1 | ?RCS: $Id$ |
2 | ?RCS: | |
3 | ?RCS: Copyright (c) 1999 Jarkko Hietaniemi | |
4 | ?RCS: | |
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. | |
7 | ?RCS: | |
36011360 LC |
8 | ?MAKE:uselargefiles \ |
9 | ccflags_uselargefiles \ | |
10 | ldflags_uselargefiles \ | |
11 | libswanted_uselargefiles: \ | |
12 | Myread Oldconfig Setvar test lseeksize fpossize \ | |
2cb64bf6 | 13 | fpostype Compile echo n c cat lseektype rm_try run \ |
1273bb5e | 14 | use64bitint use64bitall i_stdlib |
70674189 JH |
15 | ?MAKE: -pick add $@ %< |
16 | ?Y:TOP | |
313cb6b3 | 17 | ?S:uselargefiles: |
70674189 JH |
18 | ?S: This variable conditionally defines the USE_LARGE_FILES symbol, |
19 | ?S: and indicates that large file interfaces should be used when | |
08220ae0 | 20 | ?S: available. |
70674189 | 21 | ?S:. |
36011360 LC |
22 | ?S:ccflags_uselargefiles: |
23 | ?S: This variable contains the compiler flags needed by large file builds | |
24 | ?S: and added to ccflags by hints files. | |
25 | ?S:. | |
26 | ?S:ldflags_uselargefiles: | |
27 | ?S: This variable contains the loader flags needed by large file builds | |
28 | ?S: and added to ldflags by hints files. | |
29 | ?S:. | |
30 | ?S:libswanted_uselargefiles: | |
31 | ?S: This variable contains the libraries needed by large file builds | |
32 | ?S: and added to ldflags by hints files. It is a space separated list | |
33 | ?S: of the library names without the "lib" prefix or any suffix, just | |
34 | ?S: like libswanted.. | |
35 | ?S:. | |
70674189 JH |
36 | ?C:USE_LARGE_FILES: |
37 | ?C: This symbol, if defined, indicates that large file support | |
08220ae0 | 38 | ?C: should be used when available. |
70674189 | 39 | ?C:. |
a38738d1 JH |
40 | ?H:?%<:#ifndef USE_LARGE_FILES |
41 | ?H:?%<:#$uselargefiles USE_LARGE_FILES /**/ | |
42 | ?H:?%<:#endif | |
70674189 | 43 | ?H:. |
36011360 LC |
44 | ?INIT:ccflags_uselargefiles='' |
45 | ?INIT:ldflags_uselargefiles='' | |
46 | ?INIT:libswanted_uselargefiles='' | |
f062a9c5 | 47 | ?T:yyy zzz |
0065f4af | 48 | ?F:!uselargefiles.cbu !try |
f062a9c5 JH |
49 | ?LINT:change lseeksize |
50 | ?LINT:change fpossize | |
ef22c3d9 | 51 | ?LINT:extern uselfs |
32cc9c07 JH |
52 | ?LINT:use use64bitint |
53 | ?LINT:use use64bitall | |
0065f4af | 54 | : Check for large file support |
33b2427b JH |
55 | # Backward compatibility (uselfs is deprecated). |
56 | case "$uselfs" in | |
57 | "$define"|true|[yY]*) | |
58 | cat <<EOM >&4 | |
59 | ||
60 | *** Configure -Duselfs is deprecated, using -Duselargefiles instead. | |
33b2427b JH |
61 | EOM |
62 | uselargefiles="$define" | |
63 | ;; | |
2cb64bf6 | 64 | esac |
33b2427b | 65 | |
f062a9c5 JH |
66 | case "$lseeksize:$fpossize" in |
67 | 8:8) cat <<EOM | |
68 | ||
69 | You can have files larger than 2 gigabytes. | |
70 | EOM | |
71 | val="$define" ;; | |
635fdf3e JH |
72 | *) case "$uselargefiles" in |
73 | "$undef"|false|[nN]*) dflt='n' ;; | |
74 | *) dflt='y' ;; | |
75 | esac | |
76 | cat <<EOM | |
bbe95cfb JH |
77 | |
78 | Perl can be built to understand large files (files larger than 2 gigabytes) | |
635fdf3e | 79 | on some systems. To do so, Configure can be run with -Duselargefiles. |
bbe95cfb | 80 | |
635fdf3e | 81 | If this doesn't make any sense to you, just accept the default '$dflt'. |
bbe95cfb | 82 | EOM |
f062a9c5 JH |
83 | rp='Try to understand large files, if available?' |
84 | . ./myread | |
85 | case "$ans" in | |
ed194ea0 MBT |
86 | y|Y) val="$define" ;; |
87 | *) val="$undef" ;; | |
f062a9c5 JH |
88 | esac |
89 | ;; | |
bbe95cfb | 90 | esac |
313cb6b3 | 91 | set uselargefiles |
bbe95cfb | 92 | eval $setvar |
f062a9c5 JH |
93 | : Look for a hint-file generated 'call-back-unit'. If the |
94 | : user has specified that a large files perl is to be built, | |
95 | : we may need to set or change some other defaults. | |
88c24fda MB |
96 | if $test -f uselargefiles.cbu; then |
97 | echo "Your platform has some specific hints regarding large file builds, using them..." | |
98 | . ./uselargefiles.cbu | |
99 | fi | |
100 | case "$uselargefiles" in | |
101 | "$define") | |
cc1e5a00 | 102 | if $test -f uselargefiles.cbu; then |
f062a9c5 | 103 | echo " " |
0fdea05a | 104 | echo "Rechecking to see how big your file offsets are..." >&4 |
f062a9c5 JH |
105 | $cat >try.c <<EOCP |
106 | #include <sys/types.h> | |
107 | #include <stdio.h> | |
108 | int main() | |
109 | { | |
110 | printf("%d\n", (int)sizeof($lseektype)); | |
2cb64bf6 | 111 | return(0); |
f062a9c5 JH |
112 | } |
113 | EOCP | |
114 | set try | |
115 | if eval $compile_ok; then | |
0f00356b | 116 | lseeksize=`$run ./try` |
0fdea05a | 117 | $echo "Your file offsets are now $lseeksize bytes long." |
f062a9c5 JH |
118 | else |
119 | dflt="$lseeksize" | |
120 | echo " " | |
121 | echo "(I can't seem to compile the test program. Guessing...)" | |
122 | rp="What is the size of your file offsets (in bytes)?" | |
123 | . ./myread | |
124 | lseeksize="$ans" | |
125 | fi | |
126 | case "$fpostype" in | |
127 | *_t) zzz="$fpostype" ;; | |
128 | *) zzz="fpos_t" ;; | |
129 | esac | |
2cb64bf6 | 130 | $echo $n "Rechecking the size of $zzz...$c" >&4 |
f062a9c5 JH |
131 | $cat > try.c <<EOCP |
132 | #include <sys/types.h> | |
133 | #include <stdio.h> | |
1273bb5e JH |
134 | #$i_stdlib I_STDLIB |
135 | #ifdef I_STDLIB | |
136 | #include <stdlib.h> | |
137 | #endif | |
f062a9c5 JH |
138 | int main() { |
139 | printf("%d\n", (int)sizeof($fpostype)); | |
a4ad2925 | 140 | return(0); |
f062a9c5 JH |
141 | } |
142 | EOCP | |
143 | set try | |
144 | if eval $compile_ok; then | |
0f00356b | 145 | yyy=`$run ./try` |
f062a9c5 JH |
146 | dflt="$lseeksize" |
147 | case "$yyy" in | |
148 | '') echo " " | |
149 | echo "(I can't execute the test program--guessing $fpossize.)" >&4 | |
150 | ;; | |
151 | *) fpossize=$yyy | |
0fdea05a | 152 | echo " $fpossize bytes." >&4 |
f062a9c5 JH |
153 | ;; |
154 | esac | |
155 | else | |
156 | dflt="$fpossize" | |
157 | echo " " | |
158 | echo "(I can't compile the test program. Guessing...)" >&4 | |
159 | rp="What is the size of your file positions (in bytes)?" | |
160 | . ./myread | |
161 | fpossize="$ans" | |
162 | fi | |
2cb64bf6 | 163 | $rm_try |
f062a9c5 JH |
164 | fi |
165 | ;; | |
70674189 JH |
166 | esac |
167 |