# HG changeset patch # User jwe # Date 993841102 0 # Node ID 07b99a1889cbde8286657ed1e80bccde7cd02809 # Parent bbe74a066592ee2aeda65d1724129461ba9acc44 [project @ 2001-06-29 18:58:21 by jwe] diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-06-29 Mumit Khan + + * aclocal.m4 (OCTAVE_CXX_ABI): New macro. + (OCTAVE_CXX_PREPENDS_UNDERSCORE): Add missing return value. + * configure.in: Use. + * acconfig.h (CXX_ABI): New macro. + 2001-05-23 John W. Eaton * configure.in: Quote the call to AC_CHECK_FUNC inside the diff --git a/acconfig.h b/acconfig.h --- a/acconfig.h +++ b/acconfig.h @@ -14,6 +14,9 @@ internal array and matrix classes. */ #undef BOUNDS_CHECKING +/* Define to the C++ ABI your compiler uses. */ +#undef CXX_ABI + /* Define if your C++ runtime library is ISO compliant. */ #undef CXX_ISO_COMPLIANT_LIBRARY diff --git a/aclocal.m4 b/aclocal.m4 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -913,7 +913,7 @@ AC_LANG_SAVE AC_LANG_CPLUSPLUS cat > conftest.$ac_ext <= 3.0). +dnl Set to "unknown" is when we don't know enough about the ABI, which +dnl will happen when using an unsupported C++ compiler. +dnl +dnl OCTAVE_CXX_ABI +AC_DEFUN(OCTAVE_CXX_ABI, +[AC_MSG_CHECKING([C++ ABI version used by ${CXX}]) + AC_CACHE_VAL(octave_cv_cxx_abi, + [octave_cv_cxx_abi='unknown' + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + cat > conftest.$ac_ext <&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC + fi + AC_LANG_RESTORE + ]) + AC_MSG_RESULT($octave_cv_cxx_abi) + AC_DEFINE_UNQUOTED(CXX_ABI, $octave_cv_cxx_abi) +]) + diff --git a/configure.in b/configure.in --- a/configure.in +++ b/configure.in @@ -21,7 +21,7 @@ ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA ### 02111-1307, USA. -AC_REVISION($Revision: 1.348 $) +AC_REVISION($Revision: 1.349 $) AC_PREREQ(2.9) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) @@ -194,6 +194,11 @@ OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL OCTAVE_CXX_ISO_COMPLIANT_LIBRARY +# Determine the ABI used the C++ compiler, needed by the dynamic loading +# code. Currently supported ABIs are GNU v2, GNU v3 and Sun Workshop. + +OCTAVE_CXX_ABI + ### See which C compiler to use (we expect to find gcc). EXTERN_CFLAGS="$CFLAGS" diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2001-06-29 Mumit Khan + + * defun-int.h (DEFINE_FUN_INSTALLER_FUN{2,3}): New macros. + (DEFINE_FUN_INSTALLER_FUN): Use. + * dynamic-ld.cc ({STRINGIFY, STRINGIFY1}): New macros. + (octave_dynamic_loader::mangle_name): Support dynamic linking + for GNU v3 and Sun C++ ABI. + 2001-06-26 Mumit Khan * c-file-ptr-stream.h (c_file_ptr_buf::c_file_ptr_buf): Add GCC3 diff --git a/src/defun-int.h b/src/defun-int.h --- a/src/defun-int.h +++ b/src/defun-int.h @@ -76,14 +76,22 @@ typedef bool (*octave_dld_fcn_installer) (const octave_shlib&); #define DEFINE_FUN_INSTALLER_FUN(name, doc) \ + DEFINE_FUN_INSTALLER_FUN2(name, doc, CXX_ABI) + +#define DEFINE_FUN_INSTALLER_FUN2(name, doc, cxx_abi) \ + DEFINE_FUN_INSTALLER_FUN3(name, doc, cxx_abi) + +#define DEFINE_FUN_INSTALLER_FUN3(name, doc, cxx_abi) \ + extern "C" \ bool \ - FS ## name (const octave_shlib& shl) \ + FS ## name ## _ ## cxx_abi (const octave_shlib& shl) \ { \ check_version (OCTAVE_VERSION, #name); \ install_dld_function (F ## name, #name, shl, doc); \ return error_state ? false : true; \ } + // MAKE_BUILTINS is defined to extract function names and related // information and create the *.df files that are eventually used to // create the builtins.cc file. diff --git a/src/dynamic-ld.cc b/src/dynamic-ld.cc --- a/src/dynamic-ld.cc +++ b/src/dynamic-ld.cc @@ -308,6 +308,9 @@ return (instance_ok ()) ? instance->do_remove (fcn_name, shl) : false; } +#define STRINGIFY(s) STRINGIFY1(s) +#define STRINGIFY1(s) #s + std::string octave_dynamic_loader::mangle_name (const std::string& name) { @@ -317,7 +320,8 @@ std::string retval ("FS"); #endif retval.append (name); - retval.append ("__FRC12octave_shlib"); + retval.append ("_"); + retval.append (STRINGIFY (CXX_ABI)); return retval; }