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: | |
f062a9c5 JH |
8 | ?MAKE:uselargefiles: Myread Oldconfig Setvar test lseeksize fpossize \ |
9 | fpostype Compile echo n c cat lseektype rm | |
70674189 JH |
10 | ?MAKE: -pick add $@ %< |
11 | ?Y:TOP | |
313cb6b3 | 12 | ?S:uselargefiles: |
70674189 JH |
13 | ?S: This variable conditionally defines the USE_LARGE_FILES symbol, |
14 | ?S: and indicates that large file interfaces should be used when | |
08220ae0 | 15 | ?S: available. |
70674189 JH |
16 | ?S:. |
17 | ?C:USE_LARGE_FILES: | |
18 | ?C: This symbol, if defined, indicates that large file support | |
08220ae0 | 19 | ?C: should be used when available. |
70674189 | 20 | ?C:. |
a38738d1 JH |
21 | ?H:?%<:#ifndef USE_LARGE_FILES |
22 | ?H:?%<:#$uselargefiles USE_LARGE_FILES /**/ | |
23 | ?H:?%<:#endif | |
70674189 | 24 | ?H:. |
f062a9c5 JH |
25 | ?F:!uselfs.cbu !try |
26 | ?T:yyy zzz | |
313cb6b3 | 27 | ?LINT:set uselargefiles |
70674189 JH |
28 | ?LINT:extern use64bits |
29 | ?LINT:change use64bits | |
f062a9c5 JH |
30 | ?LINT:change lseeksize |
31 | ?LINT:change fpossize | |
70674189 | 32 | |
33b2427b JH |
33 | # Backward compatibility (uselfs is deprecated). |
34 | case "$uselfs" in | |
35 | "$define"|true|[yY]*) | |
36 | cat <<EOM >&4 | |
37 | ||
38 | *** Configure -Duselfs is deprecated, using -Duselargefiles instead. | |
33b2427b JH |
39 | EOM |
40 | uselargefiles="$define" | |
41 | ;; | |
42 | esac | |
43 | ||
f062a9c5 JH |
44 | case "$lseeksize:$fpossize" in |
45 | 8:8) cat <<EOM | |
46 | ||
47 | You can have files larger than 2 gigabytes. | |
48 | EOM | |
49 | val="$define" ;; | |
635fdf3e JH |
50 | *) case "$uselargefiles" in |
51 | "$undef"|false|[nN]*) dflt='n' ;; | |
52 | *) dflt='y' ;; | |
53 | esac | |
54 | cat <<EOM | |
bbe95cfb JH |
55 | |
56 | Perl can be built to understand large files (files larger than 2 gigabytes) | |
635fdf3e | 57 | on some systems. To do so, Configure can be run with -Duselargefiles. |
bbe95cfb | 58 | |
635fdf3e | 59 | If this doesn't make any sense to you, just accept the default '$dflt'. |
bbe95cfb | 60 | EOM |
f062a9c5 JH |
61 | rp='Try to understand large files, if available?' |
62 | . ./myread | |
63 | case "$ans" in | |
64 | y|Y) val="$define" ;; | |
65 | *) val="$undef" ;; | |
66 | esac | |
67 | ;; | |
bbe95cfb | 68 | esac |
313cb6b3 | 69 | set uselargefiles |
bbe95cfb | 70 | eval $setvar |
313cb6b3 | 71 | case "$uselargefiles" in |
f062a9c5 JH |
72 | "$define") |
73 | : Look for a hint-file generated 'call-back-unit'. If the | |
74 | : user has specified that a large files perl is to be built, | |
75 | : we may need to set or change some other defaults. | |
76 | if $test -f uselfs.cbu; then | |
77 | echo "Your platform has some specific hints for large file builds, using them..." | |
78 | . ./uselfs.cbu | |
79 | echo " " | |
0fdea05a | 80 | echo "Rechecking to see how big your file offsets are..." >&4 |
f062a9c5 JH |
81 | $cat >try.c <<EOCP |
82 | #include <sys/types.h> | |
83 | #include <stdio.h> | |
84 | int main() | |
85 | { | |
86 | printf("%d\n", (int)sizeof($lseektype)); | |
87 | return(0); | |
88 | } | |
89 | EOCP | |
90 | set try | |
91 | if eval $compile_ok; then | |
92 | lseeksize=`./try` | |
0fdea05a | 93 | $echo "Your file offsets are now $lseeksize bytes long." |
f062a9c5 JH |
94 | else |
95 | dflt="$lseeksize" | |
96 | echo " " | |
97 | echo "(I can't seem to compile the test program. Guessing...)" | |
98 | rp="What is the size of your file offsets (in bytes)?" | |
99 | . ./myread | |
100 | lseeksize="$ans" | |
101 | fi | |
102 | case "$fpostype" in | |
103 | *_t) zzz="$fpostype" ;; | |
104 | *) zzz="fpos_t" ;; | |
105 | esac | |
106 | $echo $n "Rechecking the size of $zzz...$c" >&4 | |
107 | $cat > try.c <<EOCP | |
108 | #include <sys/types.h> | |
109 | #include <stdio.h> | |
110 | int main() { | |
111 | printf("%d\n", (int)sizeof($fpostype)); | |
112 | exit(0); | |
113 | } | |
114 | EOCP | |
115 | set try | |
116 | if eval $compile_ok; then | |
117 | yyy=`./try` | |
118 | dflt="$lseeksize" | |
119 | case "$yyy" in | |
120 | '') echo " " | |
121 | echo "(I can't execute the test program--guessing $fpossize.)" >&4 | |
122 | ;; | |
123 | *) fpossize=$yyy | |
0fdea05a | 124 | echo " $fpossize bytes." >&4 |
f062a9c5 JH |
125 | ;; |
126 | esac | |
127 | else | |
128 | dflt="$fpossize" | |
129 | echo " " | |
130 | echo "(I can't compile the test program. Guessing...)" >&4 | |
131 | rp="What is the size of your file positions (in bytes)?" | |
132 | . ./myread | |
133 | fpossize="$ans" | |
134 | fi | |
135 | $rm -f try.c try | |
136 | fi | |
137 | ;; | |
70674189 JH |
138 | esac |
139 |