1 # This macro wraps AC_SYS_LARGEFILE with one exception for Solaris.
2 # PR binutils/9992: We have to replicate everywhere the behaviour of
3 # bfd's configure script so that all the directories agree on the size
4 # of structures used to describe files.
6 AC_DEFUN([ACX_LARGEFILE],[dnl
8 # The tests for host and target for $enable_largefile require
10 AC_REQUIRE([AC_CANONICAL_HOST])
11 AC_REQUIRE([AC_CANONICAL_TARGET])
13 # As the $enable_largefile decision depends on --enable-plugins we must set it
14 # even in directories otherwise not depending on the $plugins option.
19 sparc-*-solaris*|i?86-*-solaris*)
20 # On native 32-bit Solaris/SPARC and x86, large-file and procfs support
21 # were mutually exclusive until Solaris 11.3. Without procfs support,
22 # the bfd/ elf module cannot provide certain routines such as
23 # elfcore_write_prpsinfo or elfcore_write_prstatus. So unless the user
24 # explicitly requested large-file support through the
25 # --enable-largefile switch, disable large-file support in favor of
28 # Check if <sys/procfs.h> is incompatible with large-file support.
29 AC_TRY_COMPILE([#define _FILE_OFFSET_BITS 64
30 #define _STRUCTURED_PROC 1
31 #include <sys/procfs.h>], , acx_cv_procfs_lfs=yes, acx_cv_procfs_lfs=no)
33 # Forcefully disable large-file support only if necessary, gdb is in
35 if test "${target}" = "${host}" -a "$acx_cv_procfs_lfs" = no \
36 -a -d $srcdir/../gdb -a "$enable_gdb" != no; then
37 : ${enable_largefile="no"}
38 if test "$plugins" = yes; then
40 plugin support disabled; require large-file support which is incompatible with GDB.])
45 # Explicitly undef _FILE_OFFSET_BITS if enable_largefile=no for the
46 # benefit of g++ 9+ which predefines it on Solaris.
47 if test "$enable_largefile" = no; then
48 LARGEFILE_CPPFLAGS="-U_FILE_OFFSET_BITS"
49 AC_SUBST(LARGEFILE_CPPFLAGS)