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