Mercurial > hg > octave-lyh
diff aclocal.m4 @ 4109:6e20cac828cd
[project @ 2002-10-17 03:11:30 by jwe]
author | jwe |
---|---|
date | Thu, 17 Oct 2002 03:11:30 +0000 |
parents | 92f4552ea359 |
children | 040314da2fec |
line wrap: on
line diff
--- a/aclocal.m4 +++ b/aclocal.m4 @@ -353,8 +353,18 @@ fi ]) dnl +dnl +dnl +dnl OCTAVE_LANG_PROG_NO_CONFDEFS +AC_DEFUN(OCTAVE_LANG_PROG_NO_CONFDEFS, +[_AC_LANG_DISPATCH([AC_LANG_PROGRAM], _AC_LANG, [$@])]) +dnl dnl Check to see if GNU C++ barfs on #pragma interface/#pragma implementation. dnl +dnl Note that we are using AC_LINK_IFELSE and OCTAVE_LANG_PROG_NO_CONFDEFS +dnl to prevent autoconf from including confdefs.h ahead of the #pragma +dnl interface/implementation line. +dnl dnl OCTAVE_CXX_PRAGMA_INTERFACE_IMPLEMENTATION AC_DEFUN(OCTAVE_CXX_PRAGMA_INTERFACE_IMPLEMENTATION, [ AC_REQUIRE([AC_PROG_CXX]) @@ -364,9 +374,7 @@ rm -f conftest.h cat > conftest.h <<EOB #include <iostream> -#if defined (__GNUG__) #pragma interface -#endif template <class T> class A { public: @@ -381,9 +389,10 @@ B (void) : A<int> () { } }; EOB - AC_TRY_LINK([#include "conftest.h"], [], [ - rm -f conftest.h - cat > conftest.h <<EOB + AC_LINK_IFELSE([OCTAVE_LANG_PROG_NO_CONFDEFS([#include "conftest.h"])], + [octave_pii_test_1=yes], [octave_pii_test_1=no]) + rm -f conftest.h + cat > conftest.h <<EOB #pragma interface class A { @@ -391,13 +400,14 @@ virtual ~A (void) {} }; EOB - AC_TRY_COMPILE([#pragma implementation -#include "confdefs.h"], [], - octave_cv_cxx_pragma_interface_implementation=yes, - octave_cv_cxx_pragma_interface_implementation=no - )], + AC_LINK_IFELSE([OCTAVE_LANG_PROG_NO_CONFDEFS([#pragma implementation +#include "conftest.h"])], + [octave_pii_test_2=yes], [octave_pii_test_2=no]) + if test $octave_pii_test_1 = yes && test $octave_pii_test_1 = yes; then + octave_cv_cxx_pragma_interface_implementation=yes + else octave_cv_cxx_pragma_interface_implementation=no - ) + fi AC_LANG_POP(C++) ]) AC_MSG_RESULT($octave_cv_cxx_pragma_interface_implementation)