largefile.m4 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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.
  5. AC_DEFUN([ACX_LARGEFILE],[dnl
  6. # The tests for host and target for $enable_largefile require
  7. # canonical names.
  8. AC_REQUIRE([AC_CANONICAL_HOST])
  9. AC_REQUIRE([AC_CANONICAL_TARGET])
  10. # As the $enable_largefile decision depends on --enable-plugins we must set it
  11. # even in directories otherwise not depending on the $plugins option.
  12. AC_PLUGINS
  13. case "${host}" in
  14. sparc-*-solaris*|i?86-*-solaris*)
  15. # On native 32-bit Solaris/SPARC and x86, large-file and procfs support
  16. # were mutually exclusive until Solaris 11.3. Without procfs support,
  17. # the bfd/ elf module cannot provide certain routines such as
  18. # elfcore_write_prpsinfo or elfcore_write_prstatus. So unless the user
  19. # explicitly requested large-file support through the
  20. # --enable-largefile switch, disable large-file support in favor of
  21. # procfs support.
  22. #
  23. # Check if <sys/procfs.h> is incompatible with large-file support.
  24. AC_TRY_COMPILE([#define _FILE_OFFSET_BITS 64
  25. #define _STRUCTURED_PROC 1
  26. #include <sys/procfs.h>], , acx_cv_procfs_lfs=yes, acx_cv_procfs_lfs=no)
  27. #
  28. # Forcefully disable large-file support only if necessary, gdb is in
  29. # tree and enabled.
  30. if test "${target}" = "${host}" -a "$acx_cv_procfs_lfs" = no \
  31. -a -d $srcdir/../gdb -a "$enable_gdb" != no; then
  32. : ${enable_largefile="no"}
  33. if test "$plugins" = yes; then
  34. AC_MSG_WARN([
  35. plugin support disabled; require large-file support which is incompatible with GDB.])
  36. plugins=no
  37. fi
  38. fi
  39. #
  40. # Explicitly undef _FILE_OFFSET_BITS if enable_largefile=no for the
  41. # benefit of g++ 9+ which predefines it on Solaris.
  42. if test "$enable_largefile" = no; then
  43. LARGEFILE_CPPFLAGS="-U_FILE_OFFSET_BITS"
  44. AC_SUBST(LARGEFILE_CPPFLAGS)
  45. fi
  46. ;;
  47. esac
  48. AC_SYS_LARGEFILE
  49. ])