summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorAlain Magloire <alainm@rcsm.ee.mcgill.ca>1999-08-17 19:08:31 +0000
committerAlain Magloire <alainm@rcsm.ee.mcgill.ca>1999-08-17 19:08:31 +0000
commitaf6099c2bd6f927a56d5624f87c5ecb7640a776b (patch)
tree477156cb6b2f5c072bc02c492e79f47e94c6d824 /m4
parentee6d5e12230df022ad4454650a7c7fee1adb827f (diff)
downloadgrep-af6099c2bd6f927a56d5624f87c5ecb7640a776b.tar.gz
add support for largefiles
add support for largefiles Upgrade large-file support to the version used in tar and textutils. * Makefile.am (ACLOCAL_AMFLAGS): Define to be empty. (M4DIR, ACINCLUDE_INPUTS): New macros. ($(srcdir)/acinclude.m4): New rule. * configure.in (AC_CANONICAL_HOST, AM_C_PROTOTYPES): Add. (AC_SYS_LARGEFILE): Renamed from AC_LFS, for compatibility with what should appear in the next autoconf release. * m4/largefile.m4: Renamed from m4/lfs.m4. * src/ansi2knr.1, src/ansi2knr.c, config.guess, config.sub: New files. config.guess and config.sub ar needed by the new AC_SYS_LARGEFILE. ansi2knr is needed by AM_C_PROTOTYPES, which in turn is needed by the new AC_SYS_LARGEFILE.
Diffstat (limited to 'm4')
-rw-r--r--m4/Makefile.am2
-rw-r--r--m4/largefile.m4115
-rw-r--r--m4/lfs.m444
3 files changed, 116 insertions, 45 deletions
diff --git a/m4/Makefile.am b/m4/Makefile.am
index e27eba19..3be5753c 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -11,7 +11,7 @@ EXTRA_DIST = djgpp.m4 \
install.m4 \
isc-posix.m4 \
lcmessage.m4 \
- lfs.m4 \
+ largefile.m4 \
missing.m4 \
progtest.m4 \
regex.m4 \
diff --git a/m4/largefile.m4 b/m4/largefile.m4
new file mode 100644
index 00000000..8f7d525a
--- /dev/null
+++ b/m4/largefile.m4
@@ -0,0 +1,115 @@
+#serial 4
+
+dnl By default, many hosts won't let programs access large files;
+dnl one must use special compiler options to get large-file access to work.
+dnl For more details about this brain damage please see:
+dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
+
+dnl Written by Paul Eggert <eggert@twinsun.com>.
+
+dnl Internal subroutine of AC_SYS_LARGEFILE.
+dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME)
+AC_DEFUN(AC_SYS_LARGEFILE_FLAGS,
+ [AC_CACHE_CHECK([for $1 value to request large file support],
+ ac_cv_sys_largefile_$1,
+ [ac_cv_sys_largefile_$1=`($GETCONF LFS_$1) 2>/dev/null` || {
+ ac_cv_sys_largefile_$1=no
+ ifelse($1, CFLAGS,
+ [case "$host_os" in
+ # IRIX 6.2 and later require cc -n32.
+changequote(, )dnl
+ irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*)
+changequote([, ])dnl
+ if test "$GCC" != yes; then
+ ac_cv_sys_largefile_CFLAGS=-n32
+ fi
+ ac_save_CC="$CC"
+ CC="$CC $ac_cv_sys_largefile_CFLAGS"
+ AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no)
+ CC="$ac_save_CC"
+ esac])
+ }])])
+
+dnl Internal subroutine of AC_SYS_LARGEFILE.
+dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL)
+AC_DEFUN(AC_SYS_LARGEFILE_SPACE_APPEND,
+ [case $2 in
+ no) ;;
+ ?*)
+ case "[$]$1" in
+ '') $1=$2 ;;
+ *) $1=[$]$1' '$2 ;;
+ esac ;;
+ esac])
+
+dnl Internal subroutine of AC_SYS_LARGEFILE.
+dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT)
+AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
+ [AC_CACHE_CHECK([for $1], $2,
+ [$2=no
+changequote(, )dnl
+ $4
+ for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
+ case "$ac_flag" in
+ -D$1)
+ $2=1 ;;
+ -D$1=*)
+ $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;;
+ esac
+ done
+changequote([, ])dnl
+ ])
+ if test "[$]$2" != no; then
+ AC_DEFINE_UNQUOTED([$1], [$]$2, [$3])
+ fi])
+
+AC_DEFUN(AC_SYS_LARGEFILE,
+ [AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_ARG_ENABLE(largefile,
+ [ --disable-largefile omit support for large files])
+ if test "$enable_largefile" != no; then
+ AC_CHECK_TOOL(GETCONF, getconf)
+ AC_SYS_LARGEFILE_FLAGS(CFLAGS)
+ AC_SYS_LARGEFILE_FLAGS(LDFLAGS)
+ AC_SYS_LARGEFILE_FLAGS(LIBS)
+
+ for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
+ case "$ac_flag" in
+ no) ;;
+ -D_FILE_OFFSET_BITS=*) ;;
+ -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;;
+ -D_LARGE_FILES | -D_LARGE_FILES=*) ;;
+ -D?* | -I?*)
+ AC_SYS_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;;
+ *)
+ AC_SYS_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;;
+ esac
+ done
+ AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS")
+ AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS")
+ AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS,
+ ac_cv_sys_file_offset_bits,
+ [Number of bits in a file offset, on hosts where this is settable.],
+ [case "$host_os" in
+ # HP-UX 10.20 and later
+ hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
+ ac_cv_sys_file_offset_bits=64 ;;
+ esac])
+ AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE,
+ ac_cv_sys_largefile_source,
+ [Define to make fseeko etc. visible, on some hosts.],
+ [case "$host_os" in
+ # HP-UX 10.20 and later
+ hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
+ ac_cv_sys_largefile_source=1 ;;
+ esac])
+ AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES,
+ ac_cv_sys_large_files,
+ [Define for large files, on AIX-style hosts.],
+ [case "$host_os" in
+ # AIX 4.2 and later
+ aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)
+ ac_cv_sys_large_files=1 ;;
+ esac])
+ fi
+ ])
diff --git a/m4/lfs.m4 b/m4/lfs.m4
deleted file mode 100644
index 8de343b2..00000000
--- a/m4/lfs.m4
+++ /dev/null
@@ -1,44 +0,0 @@
-#serial 1
-
-dnl The problem is that the default compilation flags in Solaris 2.6 won't
-dnl let programs access large files; you need to tell the compiler that
-dnl you actually want your programs to work on large files. For more
-dnl details about this brain damage please see:
-dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
-
-dnl Written by Paul Eggert <eggert@twinsun.com>.
-
-AC_DEFUN(AC_LFS,
-[dnl
- # If available, prefer support for large files unless the user specified
- # one of the CPPFLAGS, LDFLAGS, or LIBS variables.
- AC_MSG_CHECKING(whether large file support needs explicit enabling)
- ac_getconfs=''
- ac_result=yes
- ac_set=''
- ac_shellvars='CPPFLAGS LDFLAGS LIBS'
- for ac_shellvar in $ac_shellvars; do
- case $ac_shellvar in
- CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;;
- *) ac_lfsvar=LFS_$ac_shellvar ;;
- esac
- eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar
- (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; }
- ac_getconf=`getconf $ac_lfsvar`
- ac_getconfs=$ac_getconfs$ac_getconf
- eval ac_test_$ac_shellvar=\$ac_getconf
- done
- case "$ac_result$ac_getconfs" in
- yes) ac_result=no ;;
- esac
- case "$ac_result$ac_set" in
- yes?*) ac_result="yes, but $ac_set is already set, so use its settings"
- esac
- AC_MSG_RESULT($ac_result)
- case $ac_result in
- yes)
- for ac_shellvar in $ac_shellvars; do
- eval $ac_shellvar=\$ac_test_$ac_shellvar
- done ;;
- esac
-])