?RCS: $Id: Largefile.U 7243 2004-11-03 07:25:41Z rmanfredi $ ?RCS: ?RCS: @COPYRIGHT@ ?RCS: ?MAKE:Largefile: cat cc ccflags ldflags i_unistd ?MAKE: -pick add $@ %< ?T:flags large ?F:!try.c !try ?W:%<:off_t ?LINT:change ccflags : determine how to compile for large 64-bit file support echo " " echo "Checking whether we need flags for large file support..." >&4 $cat >try.c <<'EOC' #include #ifdef I_UNISTD #include #endif int main(void) { switch (0) { case 0: case (sizeof(off_t) >= 8): break; } return 0; } EOC flags='' large='-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64' case "$i_unistd" in "$define") flags='-DI_UNISTD';; esac if $cc $ccflags $flags $ldflags -o try try.c >/dev/null 2>&1; then echo "Selected C flags already provide 64-bit file support." else echo "You're not natively compiling for large file, fixing..." >&4 if $cc $ccflags $flags $large $ldflags -o try try.c >/dev/null 2>&1 then echo "(Adding $large)"; ccflags="$ccflags $large" else echo "(Could not compile the test program, using 32-bit files)" >&4 fi fi