📄 misc.m4
字号:
[ AC_TRY_LINK([ #include <signal.h> RETSIGTYPE foo() { }], [ int mask = sigmask(SIGINT); sigset(SIGINT, foo); sigrelse(SIGINT); sighold(SIGINT); sigpause(SIGINT); ], mysql_cv_signal_vintage=svr3, mysql_cv_signal_vintage=v7 )] )])])AC_MSG_RESULT($mysql_cv_signal_vintage)if test "$mysql_cv_signal_vintage" = posix; thenAC_DEFINE(HAVE_POSIX_SIGNALS, [1], [Signal handling is POSIX (sigset/sighold, etc)])elif test "$mysql_cv_signal_vintage" = "4.2bsd"; thenAC_DEFINE([HAVE_BSD_SIGNALS], [1], [BSD style signals])elif test "$mysql_cv_signal_vintage" = svr3; thenAC_DEFINE(HAVE_USG_SIGHOLD, [1], [sighold() is present and usable])fi])AC_DEFUN([MYSQL_CHECK_GETPW_FUNCS],[AC_MSG_CHECKING(whether programs are able to redeclare getpw functions)AC_CACHE_VAL(mysql_cv_can_redecl_getpw,[AC_TRY_COMPILE([#include <sys/types.h>#include <pwd.h>extern struct passwd *getpwent();], [struct passwd *z; z = getpwent();], mysql_cv_can_redecl_getpw=yes,mysql_cv_can_redecl_getpw=no)])AC_MSG_RESULT($mysql_cv_can_redecl_getpw)if test "$mysql_cv_can_redecl_getpw" = "no"; thenAC_DEFINE(HAVE_GETPW_DECLS, [1], [getpwent() declaration present])fi])AC_DEFUN([MYSQL_HAVE_TIOCGWINSZ],[AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h)AC_CACHE_VAL(mysql_cv_tiocgwinsz_in_ioctl,[AC_TRY_COMPILE([#include <sys/types.h>#include <sys/ioctl.h>], [int x = TIOCGWINSZ;], mysql_cv_tiocgwinsz_in_ioctl=yes,mysql_cv_tiocgwinsz_in_ioctl=no)])AC_MSG_RESULT($mysql_cv_tiocgwinsz_in_ioctl)if test "$mysql_cv_tiocgwinsz_in_ioctl" = "yes"; then AC_DEFINE([GWINSZ_IN_SYS_IOCTL], [1], [READLINE: your system defines TIOCGWINSZ in sys/ioctl.h.])fi])AC_DEFUN([MYSQL_HAVE_FIONREAD],[AC_MSG_CHECKING(for FIONREAD in sys/ioctl.h)AC_CACHE_VAL(mysql_cv_fionread_in_ioctl,[AC_TRY_COMPILE([#include <sys/types.h>#include <sys/ioctl.h>], [int x = FIONREAD;], mysql_cv_fionread_in_ioctl=yes,mysql_cv_fionread_in_ioctl=no)])AC_MSG_RESULT($mysql_cv_fionread_in_ioctl)if test "$mysql_cv_fionread_in_ioctl" = "yes"; then AC_DEFINE([FIONREAD_IN_SYS_IOCTL], [1], [Do we have FIONREAD])fi])AC_DEFUN([MYSQL_HAVE_TIOCSTAT],[AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h)AC_CACHE_VAL(mysql_cv_tiocstat_in_ioctl,[AC_TRY_COMPILE([#include <sys/types.h>#include <sys/ioctl.h>], [int x = TIOCSTAT;], mysql_cv_tiocstat_in_ioctl=yes,mysql_cv_tiocstat_in_ioctl=no)])AC_MSG_RESULT($mysql_cv_tiocstat_in_ioctl)if test "$mysql_cv_tiocstat_in_ioctl" = "yes"; then AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL, [1], [declaration of TIOCSTAT in sys/ioctl.h])fi])AC_DEFUN([MYSQL_STRUCT_DIRENT_D_INO],[AC_REQUIRE([AC_HEADER_DIRENT])AC_MSG_CHECKING(if struct dirent has a d_ino member)AC_CACHE_VAL(mysql_cv_dirent_has_dino,[AC_TRY_COMPILE([#include <stdio.h>#include <sys/types.h>#ifdef HAVE_UNISTD_H# include <unistd.h>#endif /* HAVE_UNISTD_H */#if defined(HAVE_DIRENT_H)# include <dirent.h>#else# define dirent direct# ifdef HAVE_SYS_NDIR_H# include <sys/ndir.h># endif /* SYSNDIR */# ifdef HAVE_SYS_DIR_H# include <sys/dir.h># endif /* SYSDIR */# ifdef HAVE_NDIR_H# include <ndir.h># endif#endif /* HAVE_DIRENT_H */],[struct dirent d; int z; z = d.d_ino;], mysql_cv_dirent_has_dino=yes, mysql_cv_dirent_has_dino=no)])AC_MSG_RESULT($mysql_cv_dirent_has_dino)if test "$mysql_cv_dirent_has_dino" = "yes"; thenAC_DEFINE(STRUCT_DIRENT_HAS_D_INO, [1], [d_ino member present in struct dirent])fi])AC_DEFUN([MYSQL_STRUCT_DIRENT_D_NAMLEN],[AC_REQUIRE([AC_HEADER_DIRENT])AC_MSG_CHECKING(if struct dirent has a d_namlen member)AC_CACHE_VAL(mysql_cv_dirent_has_dnamlen,[AC_TRY_COMPILE([#include <stdio.h>#include <sys/types.h>#ifdef HAVE_UNISTD_H# include <unistd.h>#endif /* HAVE_UNISTD_H */#if defined(HAVE_DIRENT_H)# include <dirent.h>#else# define dirent direct# ifdef HAVE_SYS_NDIR_H# include <sys/ndir.h># endif /* SYSNDIR */# ifdef HAVE_SYS_DIR_H# include <sys/dir.h># endif /* SYSDIR */# ifdef HAVE_NDIR_H# include <ndir.h># endif#endif /* HAVE_DIRENT_H */],[struct dirent d; int z; z = (int)d.d_namlen;], mysql_cv_dirent_has_dnamlen=yes, mysql_cv_dirent_has_dnamlen=no)])AC_MSG_RESULT($mysql_cv_dirent_has_dnamlen)if test "$mysql_cv_dirent_has_dnamlen" = "yes"; thenAC_DEFINE(STRUCT_DIRENT_HAS_D_NAMLEN, [1], [d_namlen member present in struct dirent])fi])AC_DEFUN([MYSQL_TYPE_SIGHANDLER],[AC_MSG_CHECKING([whether signal handlers are of type void])AC_CACHE_VAL(mysql_cv_void_sighandler,[AC_TRY_COMPILE([#include <sys/types.h>#include <signal.h>#ifdef signal#undef signal#endif#ifdef __cplusplusextern "C"#endifvoid (*signal ()) ();],[int i;], mysql_cv_void_sighandler=yes, mysql_cv_void_sighandler=no)])dnlAC_MSG_RESULT($mysql_cv_void_sighandler)if test "$mysql_cv_void_sighandler" = "yes"; thenAC_DEFINE(VOID_SIGHANDLER, [1], [sighandler type is void (*signal ()) ();])fi])AC_DEFUN([MYSQL_CXX_BOOL],[AC_REQUIRE([AC_PROG_CXX])AC_MSG_CHECKING(if ${CXX} supports bool types)AC_CACHE_VAL(mysql_cv_have_bool,[AC_LANG_SAVEAC_LANG_CPLUSPLUSAC_TRY_COMPILE(,[bool b = true;],mysql_cv_have_bool=yes,mysql_cv_have_bool=no)AC_LANG_RESTORE])AC_MSG_RESULT($mysql_cv_have_bool)if test "$mysql_cv_have_bool" = yes; thenAC_DEFINE([HAVE_BOOL], [1], [bool is not defined by all C++ compilators])fi])dnlAC_DEFUN([MYSQL_STACK_DIRECTION], [AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction, [AC_TRY_RUN([#include <stdlib.h> int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { exit (find_stack_direction() < 0); }], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1, ac_cv_c_stack_direction=0)]) AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)])dnlAC_DEFUN([MYSQL_CHECK_LONGLONG_TO_FLOAT],[AC_MSG_CHECKING(if conversion of longlong to float works)AC_CACHE_VAL(ac_cv_conv_longlong_to_float,[AC_TRY_RUN([#include <stdio.h>typedef long long longlong;main(){ longlong ll=1; float f; FILE *file=fopen("conftestval", "w"); f = (float) ll; fprintf(file,"%g\n",f); fclose(file); exit (0);}], ac_cv_conv_longlong_to_float=`cat conftestval`, ac_cv_conv_longlong_to_float=0, ifelse([$2], , , ac_cv_conv_longlong_to_float=$2))])dnlif test "$ac_cv_conv_longlong_to_float" = "1" -o "$ac_cv_conv_longlong_to_float" = "yes"then ac_cv_conv_longlong_to_float=yeselse ac_cv_conv_longlong_to_float=nofiAC_MSG_RESULT($ac_cv_conv_longlong_to_float)])AC_DEFUN([MYSQL_CHECK_VIO], [dnldnl we always use vio: no need for special defines dnl AC_DEFINE([HAVE_VIO_READ_BUFF], [1], [Define to enable buffered read. This works only if syscalls read/recv return as soon as there is some data in the kernel buffer, no matter how big the given buffer is.])])# Local version of _AC_PROG_CXX_EXIT_DECLARATION that does not# include #stdlib.h as default as this breaks things on Solaris# (Conflicts with pthreads and big file handling)m4_define([_AC_PROG_CXX_EXIT_DECLARATION],[for ac_declaration in \ ''\ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' \ '#include <stdlib.h>'do _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration@%:@include <stdlib.h>], [exit (42);])], [], [continue]) _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration], [exit (42);])], [break])donerm -f conftest*if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.hfi])# _AC_PROG_CXX_EXIT_DECLARATIONdnl ---------------------------------------------------------------------------dnl ---------------------------------------------------------------------------dnl Macro: MYSQL_CHECK_BIG_TABLESdnl Sets BIG_TABLES if --with-big-tables is useddnl ---------------------------------------------------------------------------AC_DEFUN([MYSQL_CHECK_BIG_TABLES], [ AC_ARG_WITH([big-tables], [ --with-big-tables Support tables with more than 4 G rows even on 32 bit platforms], [bigtables="$withval"], [bigtables=no]) AC_MSG_CHECKING([for big tables support]) case "$bigtables" in yes ) AC_DEFINE([BIG_TABLES], [1], [Support big tables]) AC_MSG_RESULT([yes]) ;; * ) AC_MSG_RESULT([no]) ;; esac])dnl ---------------------------------------------------------------------------dnl END OF MYSQL_CHECK_BIG_TABLES SECTIONdnl ---------------------------------------------------------------------------dnl ---------------------------------------------------------------------------dnl Macro: MYSQL_CHECK_MAX_INDEXESdnl Sets MAX_INDEXESdnl ---------------------------------------------------------------------------AC_DEFUN([MYSQL_CHECK_MAX_INDEXES], [ AC_ARG_WITH([max-indexes], [ --with-max-indexes=\# Sets the maximum number of indexes per table, default 64], [max_indexes="$withval"], [max_indexes=64]) AC_MSG_CHECKING([max indexes per table]) AC_DEFINE_UNQUOTED([MAX_INDEXES], [$max_indexes], [Maximum number of indexes per table]) AC_MSG_RESULT([$max_indexes])])dnl ---------------------------------------------------------------------------dnl END OF MYSQL_CHECK_MAX_INDEXES SECTIONdnl ---------------------------------------------------------------------------dnl MYSQL_NEEDS_MYSYS_NEWAC_DEFUN([MYSQL_NEEDS_MYSYS_NEW],[AC_CACHE_CHECK([needs mysys_new helpers], mysql_use_mysys_new,[AC_LANG_PUSH(C++)AC_TRY_LINK([], [class A { public: int b; }; A *a=new A; a->b=10; delete a;], mysql_use_mysys_new=no, mysql_use_mysys_new=yes)AC_LANG_POP(C++)])if test "$mysql_use_mysys_new" = "yes"then AC_DEFINE([USE_MYSYS_NEW], [1], [Needs to use mysys_new helpers])fi])AC_DEFUN([MYSQL_CHECK_CXX_VERSION], [case $SYSTEM_TYPE in *netware*) CXX_VERSION=`$CXX -version | grep -i version` ;; *) CXX_VERSION=`$CXX --version | sed 1q` if test $? -ne "0" -o -z "$CXX_VERSION" then CXX_VERSION=`$CXX -V 2>&1|sed 1q` # trying harder for Sun and SGI fi if test $? -ne "0" -o -z "$CXX_VERSION" then CXX_VERSION=`$CXX -v 2>&1|sed 1q` # even harder for Alpha fi if test $? -ne "0" -o -z "$CXX_VERSION" then CXX_VERSION="" fiesacif test "$CXX_VERSION"then AC_MSG_CHECKING("C++ compiler version"); AC_MSG_RESULT("$CXX $CXX_VERSION")fiAC_SUBST(CXX_VERSION)])AC_DEFUN([MYSQL_PROG_AR], [AC_REQUIRE([MYSQL_CHECK_CXX_VERSION])case $CXX_VERSION in MIPSpro*) AR=$CXX ARFLAGS="-ar -o" ;; *Forte*) AR=$CXX ARFLAGS="-xar -o" ;; *) if test -z "$AR" then AC_CHECK_PROG([AR], [ar], [ar]) fi if test -z "$AR" then AC_MSG_ERROR([You need ar to build the library]) fi if test -z "$ARFLAGS" then ARFLAGS="cru" fiesacAC_SUBST(AR)AC_SUBST(ARFLAGS)])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -