diff options
author | unknown <jimw@mysql.com> | 2005-04-25 18:02:03 -0700 |
---|---|---|
committer | unknown <jimw@mysql.com> | 2005-04-25 18:02:03 -0700 |
commit | c4a4be84f5da3f3f471f013bf0798a991c56c02b (patch) | |
tree | fdecbdeab11a89911350e47d2e36f4b984d21161 /acinclude.m4 | |
parent | 3d85639028c8c378525fd3c70045ab887a8b4960 (diff) | |
download | mariadb-git-c4a4be84f5da3f3f471f013bf0798a991c56c02b.tar.gz |
Fix compile issues in Intel C/C++ compiler (Bug #9063)
acinclude.m4:
Use AC_LANG_PUSH/POP instead of _SAVE/RESTORE
Add test to get type of 'struct rlimit'
Switch order of including stdlib.h and declaration being tested to
match how it will be used in regular code.
configure.in:
Call MYSQL_TYPE_STRUCT_RLIMIT macro
sql/mysqld.cc:
Use STRUCT_RLIMIT for getting type of struct rlimit.
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 74426bc2061..904493a2e09 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -97,10 +97,10 @@ undefine([AC_CV_NAME])dnl AC_DEFUN([MYSQL_TYPE_ACCEPT], [ac_save_CXXFLAGS="$CXXFLAGS" AC_CACHE_CHECK([base type of last arg to accept], mysql_cv_btype_last_arg_accept, -AC_LANG_SAVE -AC_LANG_CPLUSPLUS +AC_LANG_PUSH(C++) if test "$ac_cv_prog_gxx" = "yes" then + # Add -Werror, remove -fbranch-probabilities (Bug #268) CXXFLAGS=`echo $CXXFLAGS -Werror | sed 's/-fbranch-probabilities//'` fi mysql_cv_btype_last_arg_accept=none @@ -127,7 +127,7 @@ fi if test "$mysql_cv_btype_last_arg_accept" = "none"; then mysql_cv_btype_last_arg_accept=int fi) -AC_LANG_RESTORE +AC_LANG_POP(C++) AC_DEFINE_UNQUOTED([SOCKET_SIZE_TYPE], [$mysql_cv_btype_last_arg_accept], [The base type of the last arg to accept]) CXXFLAGS="$ac_save_CXXFLAGS" @@ -153,6 +153,35 @@ then fi ]) +#---START: Figure out whether to use 'struct rlimit' or 'struct rlimit64' +AC_DEFUN([MYSQL_TYPE_STRUCT_RLIMIT], +[ac_save_CXXFLAGS="$CXXFLAGS" +AC_CACHE_CHECK([struct type to use with setrlimit], mysql_cv_btype_struct_rlimit, +AC_LANG_PUSH(C++) +if test "$ac_cv_prog_gxx" = "yes" +then + # Add -Werror, remove -fbranch-probabilities (Bug #268) + CXXFLAGS=`echo $CXXFLAGS -Werror | sed 's/-fbranch-probabilities//'` +fi +mysql_cv_btype_struct_rlimit=none +[AC_TRY_COMPILE([#if defined(inline) +#undef inline +#endif +#include <stdlib.h> +#include <sys/resources.h> +], +[struct rlimit64 rl; setrlimit(RLIMIT_CORE, &rl);], +mysql_cv_btype_struct_rlimit="struct rlimit64")] +if test "$mysql_cv_btype_struct_rlimit" = "none"; then +mysql_cv_btype_struct_rlimit="struct rlimit" +fi) +AC_LANG_POP(C++) +AC_DEFINE_UNQUOTED([STRUCT_RLIMIT], [$mysql_cv_btype_struct_rlimit], + [The struct rlimit type to use with setrlimit]) +CXXFLAGS="$ac_save_CXXFLAGS" +]) +#---END: + AC_DEFUN([MYSQL_TIMESPEC_TS], [AC_CACHE_CHECK([if struct timespec has a ts_sec member], mysql_cv_timespec_ts, [AC_TRY_COMPILE([#include <pthread.h> @@ -1940,8 +1969,8 @@ m4_define([_AC_PROG_CXX_EXIT_DECLARATION], 'void exit (int);' \ '#include <stdlib.h>' do - _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@include <stdlib.h> -$ac_declaration], + _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration +@%:@include <stdlib.h>], [exit (42);])], [], [continue]) |