You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

142 lines
4.4 KiB

Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 mysqld hasn't been built on AIX with ndb-everything in quite a while. this allowed a variety of changes to be added that broke the AIX build for both the GNU and IBM compilers (but the IBM suite in particular). Changeset lets build to complete on AIX 5.2 for users of the GNU and the IBM suite both. Tudo bem? config/ac-macros/large_file.m4: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (2) we no longer declare anything large-file on AIX. the GNU C++ compiler declares _LARGE_FILE_API all of its own, and either way we're now pulling in <standards.h> when on AIX, which defines _LARGE_FILE_API (if not already defined). configure.in: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (1) build NDB binaries as static on AIX. because that actually *works*. when building dynamic, with the IBM compiler (xlC_r), and the build breaks on AIX due to missing symbols (__vec__delete2 et al.), try adding -lhC to the Makefile. include/mysql.h: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (2) we're now pulling in <standards.h> when on AIX, which defines _LARGE_FILE_API (if not already defined). ndb/src/common/util/File.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (3) do not de-scope the standards, for they may be funky macros ndb/src/mgmclient/Makefile.am: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (4) make IBM C++ compiler happy on AIX ndb/src/mgmsrv/Makefile.am: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (5) GNU compiler has no sense of humour about this ndb/test/ndbapi/benchronja.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (6) MAXTHREADS collides with a #define from <sys/thread.h> on AIX (IBM compiler). Call it NDB_MAXTHREADS instead. Also explicitly #undef it here lest someone use it by habit and get really funny results. (K&R says we may #undef non-existent symbols.) ndb/test/ndbapi/flexAsynch.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (6) MAXTHREADS collides with a #define from <sys/thread.h> on AIX (IBM compiler). Call it NDB_MAXTHREADS instead. Also explicitly #undef it here lest someone use it by habit and get really funny results. (K&R says we may #undef non-existent symbols.) ndb/test/ndbapi/flexHammer.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (6) MAXTHREADS collides with a #define from <sys/thread.h> on AIX (IBM compiler). Call it NDB_MAXTHREADS instead. Also explicitly #undef it here lest someone use it by habit and get really funny results. (K&R says we may #undef non-existent symbols.) ndb/test/ndbapi/flexScan.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (6) MAXTHREADS collides with a #define from <sys/thread.h> on AIX (IBM compiler). Call it NDB_MAXTHREADS instead. Also explicitly #undef it here lest someone use it by habit and get really funny results. (K&R says we may #undef non-existent symbols.) ndb/test/ndbapi/flexTT.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (6) MAXTHREADS collides with a #define from <sys/thread.h> on AIX (IBM compiler). Call it NDB_MAXTHREADS instead. Also explicitly #undef it here lest someone use it by habit and get really funny results. (K&R says we may #undef non-existent symbols.) ndb/test/ndbapi/flexTimedAsynch.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (6) MAXTHREADS collides with a #define from <sys/thread.h> on AIX (IBM compiler). Call it NDB_MAXTHREADS instead. Also explicitly #undef it here lest someone use it by habit and get really funny results. (K&R says we may #undef non-existent symbols.) ndb/test/ndbapi/initronja.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (6) MAXTHREADS collides with a #define from <sys/thread.h> on AIX (IBM compiler). Call it NDB_MAXTHREADS instead. Also explicitly #undef it here lest someone use it by habit and get really funny results. (K&R says we may #undef non-existent symbols.) ndb/test/ndbapi/testOperations.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (7) IBM C compiler on AIX is not happy with the re-def. ndb/test/ndbapi/testScanFilter.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (8) The IBM C++ compiler on AIX doesn't like initializing from pow(). This works, but breaks a VAL (bool res_cal[TUPLE_NUM] ...) later on. ndb/test/odbc/SQL99_test/SQL99_test.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (6) MAXTHREADS collides with a #define from <sys/thread.h> on AIX (IBM compiler). Call it NDB_MAXTHREADS instead. Also explicitly #undef it here lest someone use it by habit and get really funny results. (K&R says we may #undef non-existent symbols.)
19 years ago
  1. dnl By default, many hosts won't let programs access large files;
  2. dnl one must use special compiler options to get large-file access to work.
  3. dnl For more details about this brain damage please see:
  4. dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
  5. dnl Written by Paul Eggert <eggert@twinsun.com>.
  6. dnl Internal subroutine of AC_SYS_LARGEFILE.
  7. dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME)
  8. AC_DEFUN([AC_SYS_LARGEFILE_FLAGS],
  9. [AC_CACHE_CHECK([for $1 value to request large file support],
  10. ac_cv_sys_largefile_$1,
  11. [if ($GETCONF LFS_$1) >conftest.1 2>conftest.2 && test ! -s conftest.2
  12. then
  13. ac_cv_sys_largefile_$1=`cat conftest.1`
  14. else
  15. ac_cv_sys_largefile_$1=no
  16. ifelse($1, CFLAGS,
  17. [case "$host_os" in
  18. # HP-UX 10.20 requires -D__STDC_EXT__ with gcc 2.95.1.
  19. changequote(, )dnl
  20. hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
  21. changequote([, ])dnl
  22. if test "$GCC" = yes; then
  23. case `$CC --version 2>/dev/null` in
  24. 2.95.*) ac_cv_sys_largefile_CFLAGS=-D__STDC_EXT__ ;;
  25. esac
  26. fi
  27. ;;
  28. # IRIX 6.2 and later require cc -n32.
  29. changequote(, )dnl
  30. irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*)
  31. changequote([, ])dnl
  32. if test "$GCC" != yes; then
  33. ac_cv_sys_largefile_CFLAGS=-n32
  34. fi
  35. esac
  36. if test "$ac_cv_sys_largefile_CFLAGS" != no; then
  37. ac_save_CC="$CC"
  38. CC="$CC $ac_cv_sys_largefile_CFLAGS"
  39. AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no)
  40. CC="$ac_save_CC"
  41. fi])
  42. fi
  43. rm -f conftest*])])
  44. dnl Internal subroutine of AC_SYS_LARGEFILE.
  45. dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL)
  46. AC_DEFUN([AC_SYS_LARGEFILE_SPACE_APPEND],
  47. [case $2 in
  48. no) ;;
  49. ?*)
  50. case "[$]$1" in
  51. '') $1=$2 ;;
  52. *) $1=[$]$1' '$2 ;;
  53. esac ;;
  54. esac])
  55. dnl Internal subroutine of AC_SYS_LARGEFILE.
  56. dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT)
  57. AC_DEFUN([AC_SYS_LARGEFILE_MACRO_VALUE],
  58. [AC_CACHE_CHECK([for $1], $2,
  59. [$2=no
  60. changequote(, )dnl
  61. for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
  62. case "$ac_flag" in
  63. -D$1)
  64. $2=1 ;;
  65. -D$1=*)
  66. $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;;
  67. esac
  68. done
  69. $4
  70. changequote([, ])dnl
  71. ])
  72. if test "[$]$2" != no; then
  73. AC_DEFINE_UNQUOTED([$1], [$]$2, [$3])
  74. fi])
  75. AC_DEFUN([MYSQL_SYS_LARGEFILE],
  76. [AC_REQUIRE([AC_CANONICAL_HOST])
  77. AC_ARG_ENABLE(largefile,
  78. [ --disable-largefile Omit support for large files])
  79. if test "$enable_largefile" != no; then
  80. AC_CHECK_TOOL(GETCONF, getconf)
  81. AC_SYS_LARGEFILE_FLAGS(CFLAGS)
  82. AC_SYS_LARGEFILE_FLAGS(LDFLAGS)
  83. AC_SYS_LARGEFILE_FLAGS(LIBS)
  84. for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
  85. case "$ac_flag" in
  86. no) ;;
  87. -D_FILE_OFFSET_BITS=*) ;;
  88. -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;;
  89. -D_LARGE_FILES | -D_LARGE_FILES=*) ;;
  90. -D?* | -I?*)
  91. AC_SYS_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;;
  92. *)
  93. AC_SYS_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;;
  94. esac
  95. done
  96. AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS")
  97. AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS")
  98. AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS,
  99. ac_cv_sys_file_offset_bits,
  100. [Number of bits in a file offset, on hosts where this is settable.],
  101. [case "$host_os" in
  102. # HP-UX 10.20 and later
  103. hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
  104. ac_cv_sys_file_offset_bits=64 ;;
  105. # We can't declare _FILE_OFFSET_BITS here as this will cause
  106. # compile errors as AC_PROG_CC adds include files in confdefs.h
  107. # We solve this (until autoconf is fixed) by instead declaring it
  108. # as define instead
  109. solaris2.[8,9])
  110. CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
  111. CXXFLAGS="$CXXFLAGS -D_FILE_OFFSET_BITS=64"
  112. ac_cv_sys_file_offset_bits=no ;;
  113. esac])
  114. AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE,
  115. ac_cv_sys_largefile_source,
  116. [makes fseeko etc. visible, on some hosts.],
  117. [case "$host_os" in
  118. # HP-UX 10.20 and later
  119. hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
  120. ac_cv_sys_largefile_source=1 ;;
  121. esac])
  122. AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES,
  123. ac_cv_sys_large_files,
  124. [Large files support on AIX-style hosts.],
  125. [case "$host_os" in
  126. # Large file support on AIX is available starting from version 4.2
  127. # Tested only on 5.2 and up
  128. aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)
  129. ac_cv_sys_large_files=1 ;;
  130. esac])
  131. fi
  132. ])