Mercurial > octave-nkf
comparison aclocal.m4 @ 7996:6a7db240b3a3
configure.in: eliminate CXX_ABI and OCTAVE_CXX_PREPEND_UNDERSCORE
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 30 Jul 2008 14:13:45 -0400 |
parents | 80a715c4824d |
children | 4363bc94171a |
comparison
equal
deleted
inserted
replaced
7995:89dd4531b26a | 7996:6a7db240b3a3 |
---|---|
625 AC_MSG_WARN($warn_texi2pdf) | 625 AC_MSG_WARN($warn_texi2pdf) |
626 fi | 626 fi |
627 AC_SUBST(TEXI2PDF) | 627 AC_SUBST(TEXI2PDF) |
628 ]) | 628 ]) |
629 dnl | 629 dnl |
630 dnl Find nm. | |
631 dnl | |
632 dnl OCTAVE_PROG_NM | |
633 AC_DEFUN(OCTAVE_PROG_NM, | |
634 [AC_CHECK_PROG(NM, ${ac_tool_prefix}nm, ${ac_tool_prefix}nm, []) | |
635 AC_SUBST(NM) | |
636 ]) | |
637 dnl | |
638 dnl See if the C++ compiler prepends an underscore to external names. | |
639 dnl | |
640 dnl OCTAVE_CXX_PREPENDS_UNDERSCORE | |
641 AC_DEFUN(OCTAVE_CXX_PREPENDS_UNDERSCORE, [ | |
642 AC_REQUIRE([OCTAVE_PROG_NM]) | |
643 AC_MSG_CHECKING([whether ${CXX-g++} prepends an underscore to external names]) | |
644 AC_CACHE_VAL(octave_cv_cxx_prepends_underscore, | |
645 [octave_cv_cxx_prepends_underscore=no | |
646 AC_LANG_PUSH(C++) | |
647 cat > conftest.$ac_ext <<EOF | |
648 bool FSmy_dld_fcn (void) { return false; } | |
649 EOF | |
650 if (eval "$ac_compile") 2>&AS_MESSAGE_LOG_FD; then | |
651 if test "`${NM-nm} conftest.$ac_objext | grep _FSmy_dld_fcn`" != ""; then | |
652 octave_cv_cxx_prepends_underscore=yes | |
653 fi | |
654 else | |
655 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD | |
656 cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD | |
657 fi | |
658 AC_LANG_POP(C++) | |
659 ### FIXME -- Ignore test result on Windows. Yes it prepends | |
660 ### underscore, but LoadLibrary ignores it automatically. The | |
661 ### correct test is to build the shared library then try to grab the | |
662 ### symbol from it with and without underscore. | |
663 case "$canonical_host_type" in | |
664 *-*-cygwin* | *-*-mingw*) | |
665 octave_cv_cxx_prepends_underscore=no | |
666 ;; | |
667 ### FIXME -- Ignore test result on OS X. Yes it prepends | |
668 ### underscore, but also messes with the name so test fails (incorrectly). | |
669 *-*-darwin*) | |
670 octave_cv_cxx_prepends_underscore=yes | |
671 ;; | |
672 esac | |
673 ]) | |
674 AC_MSG_RESULT($octave_cv_cxx_prepends_underscore) | |
675 if test $octave_cv_cxx_prepends_underscore = yes; then | |
676 AC_DEFINE(CXX_PREPENDS_UNDERSCORE, 1, [Define if your compiler prepends underscores to external names.]) | |
677 fi | |
678 ]) | |
679 dnl | |
680 dnl See if the C++ library is ISO compliant. | 630 dnl See if the C++ library is ISO compliant. |
681 dnl FIXME: This is obviously very simplistic, and trivially fooled. | 631 dnl FIXME: This is obviously very simplistic, and trivially fooled. |
682 dnl | 632 dnl |
683 dnl OCTAVE_CXX_ISO_COMPLIANT_LIBRARY | 633 dnl OCTAVE_CXX_ISO_COMPLIANT_LIBRARY |
684 AC_DEFUN(OCTAVE_CXX_ISO_COMPLIANT_LIBRARY, [ | 634 AC_DEFUN(OCTAVE_CXX_ISO_COMPLIANT_LIBRARY, [ |
735 AC_MSG_WARN([I need GNU Readline 4.2 or later]) | 685 AC_MSG_WARN([I need GNU Readline 4.2 or later]) |
736 AC_MSG_ERROR([this is fatal unless you specify --disable-readline]) | 686 AC_MSG_ERROR([this is fatal unless you specify --disable-readline]) |
737 ]) | 687 ]) |
738 fi | 688 fi |
739 AC_SUBST(LIBREADLINE) | 689 AC_SUBST(LIBREADLINE) |
740 ]) | |
741 dnl | |
742 dnl Determine the C++ compiler ABI. It sets the macro CXX_ABI to the | |
743 dnl name of the ABI, and is used to mangle the C linkage loadable | |
744 dnl functions to avoid ABI mismatch. GNU C++ currently uses gnu_v2 | |
745 dnl (GCC versions <= 2.95.x) dnl or gnu_v3 (GCC versions >= 3.0). | |
746 dnl Set to "unknown" is when we don't know enough about the ABI, which | |
747 dnl will happen when using an unsupported C++ compiler. | |
748 dnl | |
749 dnl OCTAVE_CXX_ABI | |
750 AC_DEFUN(OCTAVE_CXX_ABI, [ | |
751 AC_REQUIRE([OCTAVE_PROG_NM]) | |
752 AC_MSG_CHECKING([C++ ABI version used by ${CXX}]) | |
753 AC_CACHE_VAL(octave_cv_cxx_abi, | |
754 [octave_cv_cxx_abi='unknown' | |
755 AC_LANG_PUSH(C++) | |
756 cat > conftest.$ac_ext <<EOF | |
757 bool FSmy_dld_fcn (void) { return false; } | |
758 EOF | |
759 if (eval "$ac_compile") 2>&AS_MESSAGE_LOG_FD; then | |
760 if test "`${NM-nm} conftest.$ac_objext | grep FSmy_dld_fcn__Fv`" != ""; then | |
761 octave_cv_cxx_abi='gnu_v2' | |
762 fi | |
763 if test "`${NM-nm} conftest.$ac_objext | grep _Z12FSmy_dld_fcnv`" != ""; then | |
764 octave_cv_cxx_abi='gnu_v3' | |
765 fi | |
766 if test "`${NM-nm} conftest.$ac_objext | grep __1cMFSmy_dld_fcn6F_b_`" != ""; then | |
767 octave_cv_cxx_abi='sun_v5' | |
768 fi | |
769 else | |
770 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD | |
771 cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD | |
772 fi | |
773 AC_LANG_POP(C++) | |
774 ]) | |
775 AC_MSG_RESULT($octave_cv_cxx_abi) | |
776 AC_DEFINE_UNQUOTED(CXX_ABI, $octave_cv_cxx_abi, [Define to the C++ ABI your compiler uses.]) | |
777 ]) | 690 ]) |
778 dnl | 691 dnl |
779 dnl Check to see if C++ reintrepret cast works for function pointers. | 692 dnl Check to see if C++ reintrepret cast works for function pointers. |
780 dnl | 693 dnl |
781 dnl OCTAVE_CXX_BROKEN_REINTERPRET_CAST | 694 dnl OCTAVE_CXX_BROKEN_REINTERPRET_CAST |