From a9acc8e634db4a461ed39ef89a834147f0857af5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Sep 2002 22:24:30 +0200 Subject: - backported gcc 3.0 linking fix from 4.0 - some cosmetical fixups (typos, comments) client/mysqlbinlog.cc: - fix for gcc 3.0 configure.in: - fix for gcc 3.0 - some cosmetic modifications (typos, comments) include/global.h: - fix for gcc 3.0 - some cosmetical fixes (typos, comments) sql/mysqld.cc: - fix for gcc 3.0 --- client/mysqlbinlog.cc | 2 ++ configure.in | 19 +++++++++-------- include/global.h | 59 ++++++++++++++++++++++++++++++++++----------------- sql/mysqld.cc | 2 ++ 4 files changed, 54 insertions(+), 28 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index ac2f3e4efda..e05fd63e344 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -470,3 +470,5 @@ int main(int argc, char** argv) #else #include "log_event.cc" #endif + +FIX_GCC_LINKING_PROBLEM diff --git a/configure.in b/configure.in index 1feca507489..7051db63e5c 100644 --- a/configure.in +++ b/configure.in @@ -319,7 +319,7 @@ then # mysqld doesn't use run-time-type-checking, so we disable it. CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti" - # If you are using 'gcc' 3.0 (not g++) to compile C++ programs, + # If you are using 'gcc' 3.0 (not g++) to compile C++ programs on Linux, # we will gets some problems when linking static programs. # The following code is used to fix this problem. @@ -327,8 +327,7 @@ then then if $CXX -v 2>&1 | grep 'version 3' > /dev/null 2>&1 then - CXXFLAGS="$CXXFLAGS -DUSE_MYSYS_NEW" - CXXLDFLAGS="$CXXLDFLAGS -Wl,--defsym -Wl,__cxa_pure_virtual=0" + CXXFLAGS="$CXXFLAGS -DUSE_MYSYS_NEW -DDEFINE_CXA_PURE_VIRTUAL" fi fi fi @@ -368,6 +367,7 @@ AC_PATH_PROG(HOSTNAME, hostname, hostname) # Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and # fall back to 'tar' otherwise and hope that it's a GNU tar as well AC_CHECK_PROGS(TAR, gnutar gtar tar) + dnl We use a path for perl so the script startup works dnl We make sure to use perl, not perl5, in hopes that the RPMs will dnl not depend on the perl5 binary being installed (probably a bug in RPM) @@ -654,15 +654,13 @@ AC_ARG_WITH(mysqld-user, ) AC_SUBST(MYSQLD_USER) -# If we should allove LOAD DATA LOCAL +# If we should allow LOAD DATA LOCAL AC_MSG_CHECKING(if we should should enable LOAD DATA LOCAL by default) AC_ARG_ENABLE(local-infile, - [ --enable-local-infile - Enable LOAD DATA LOCAL INFILE (default: disabled)], + [ --enable-local-infile Enable LOAD DATA LOCAL INFILE (default: disabled)], [ ENABLED_LOCAL_INFILE=$enableval ], [ ENABLED_LOCAL_INFILE=no ] ) - if test "$ENABLED_LOCAL_INFILE" = "yes" then AC_MSG_RESULT([yes]) @@ -724,7 +722,7 @@ MYSQL_CHECK_ZLIB_WITH_COMPRESS($with_named_zlib) #-------------------------------------------------------------------- AC_ARG_WITH(libwrap, -[ --with-libwrap[=DIR] Compile in libwrap (tcp_wrappers) support],[ +[ --with-libwrap[=DIR] Compile in libwrap (tcp_wrappers) support],[ case "$with_libwrap" in no) : ;; yes|*) @@ -1346,6 +1344,7 @@ else DEBUG_OPTIMIZE_CXX="" OPTIMIZE_CXXFLAGS="-O" fi + AC_ARG_WITH(debug, [ --without-debug Build a production version without debugging code], [with_debug=$withval], @@ -1578,13 +1577,15 @@ ac_save_CXXFLAGS="$CXXFLAGS" AC_CACHE_CHECK([style of gethost* routines], mysql_cv_gethost_style, AC_LANG_SAVE AC_LANG_CPLUSPLUS -# Do not treat warnings as errors if we are linking agaist other libc + +# Do not treat warnings as errors if we are linking against other libc # this is to work around gcc not being permissive on non-system includes # with respect to ANSI C++ if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no" then CXXFLAGS="$CXXFLAGS -Werror" fi + AC_TRY_COMPILE( [#undef inline #if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT) diff --git a/include/global.h b/include/global.h index 8067fe5f38b..1525a7c6e06 100644 --- a/include/global.h +++ b/include/global.h @@ -135,6 +135,13 @@ double my_ulonglong2double(unsigned long long A); #define __LONG_MAX__ 2147483647 #endif +/* Fix problem when linking c++ programs with gcc 3.x */ +#ifdef DEFINE_CXA_PURE_VIRTUAL +#define FIX_GCC_LINKING_PROBLEM extern "C" { int __cxa_pure_virtual() {return 0;} } +#else +#define FIX_GCC_LINKING_PROBLEM +#endif + /* egcs 1.1.2 has a problem with memcpy on Alpha */ #if defined(__GNUC__) && defined(__alpha__) && ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) #define BAD_MEMCPY @@ -270,7 +277,7 @@ int __void__; #define LINT_INIT(var) #endif -/* Define som useful general macros */ +/* Define some useful general macros */ #if defined(__cplusplus) && defined(__GNUC__) #define max(a, b) ((a) >? (b)) #define min(a, b) ((a) ; template class I_List_iterator; template class I_List; template class I_List; + +FIX_GCC_LINKING_PROBLEM #endif -- cgit v1.2.1