summaryrefslogtreecommitdiff
path: root/gr-howto-write-a-block/config/lf_cxx.m4
diff options
context:
space:
mode:
authoreb2008-08-21 00:01:21 +0000
committereb2008-08-21 00:01:21 +0000
commit5c02ea03e1226ed706abeede426f0e1727f1ea25 (patch)
tree491f833ec749e2500b4ddc618896c9ae50b6ce09 /gr-howto-write-a-block/config/lf_cxx.m4
parentbb084b53d9f5d1dcf3c4ac2c5605352a2df6551f (diff)
downloadgnuradio-5c02ea03e1226ed706abeede426f0e1727f1ea25.tar.gz
gnuradio-5c02ea03e1226ed706abeede426f0e1727f1ea25.tar.bz2
gnuradio-5c02ea03e1226ed706abeede426f0e1727f1ea25.zip
Updated gr-howto-write-a-block; mostly the .m4 macros and configure.ac.
Also modified pkg.m4 to restore the FOO_INCLUDEDIR functionality and to add the FOO_CPPFLAGS variable for those times when you want only the -I, -D and -U flags from FOO_CFLAGS. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9362 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-howto-write-a-block/config/lf_cxx.m4')
-rw-r--r--gr-howto-write-a-block/config/lf_cxx.m454
1 files changed, 0 insertions, 54 deletions
diff --git a/gr-howto-write-a-block/config/lf_cxx.m4 b/gr-howto-write-a-block/config/lf_cxx.m4
index c581c9b0b..dfc6bfbfe 100644
--- a/gr-howto-write-a-block/config/lf_cxx.m4
+++ b/gr-howto-write-a-block/config/lf_cxx.m4
@@ -37,11 +37,6 @@ AC_DEFUN([LF_CONFIGURE_CXX],[
# -----------------------------------------------------------------------
# This macro tests the C++ compiler for various portability problem.
-# 1. Defines CXX_HAS_NO_BOOL if the compiler does not support the bool
-# data type
-# 2. Defines CXX_HAS_BUGGY_FOR_LOOPS if the compiler has buggy
-# scoping for the for-loop
-# 3. Defines USE_ASSERT if the user wants to use assertions
# -----------------------------------------------------------------------
@@ -56,32 +51,6 @@ AC_DEFUN([LF_CXX_PORTABILITY],[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
- dnl Check whether we have bool
- AC_MSG_CHECKING(whether C++ has bool)
- AC_TRY_RUN([main() { bool b1=true; bool b2=false; }],
- [ AC_MSG_RESULT(yes) ],
- [ AC_MSG_RESULT(no)
- AC_DEFINE(CXX_HAS_NO_BOOL,[],[Define if C++ is missing bool type]) ],
- [ AC_MSG_WARN(Don't cross-compile)]
- )
-
- dnl Test whether C++ has buggy for-loops
- AC_MSG_CHECKING(whether C++ has buggy scoping in for-loops)
- AC_TRY_COMPILE([#include <iostream.h>], [
- for (int i=0;i<10;i++) { }
- for (int i=0;i<10;i++) { }
-], [ AC_MSG_RESULT(no) ],
- [ AC_MSG_RESULT(yes)
- AC_DEFINE(CXX_HAS_BUGGY_FOR_LOOPS,[],[Define if for loop scoping is broken]) ])
-
- dnl Test whether the user wants to enable assertions
- AC_MSG_CHECKING(whether user wants assertions)
- AC_ARG_ENABLE(assert,
- [ --disable-assert don't use cpp.h assert],
- [ AC_DEFINE(NDEBUG,[],[Define to disable asserts (don't doit!)])
- AC_MSG_RESULT(no) ],
- [ AC_MSG_RESULT(yes) ],
- )
dnl Test whether C++ has std::isnan
AC_MSG_CHECKING(whether C++ has std::isnan)
@@ -96,26 +65,3 @@ AC_DEFUN([LF_CXX_PORTABILITY],[
AC_LANG_RESTORE
])
-AH_BOTTOM([// Workaround for compilers with buggy for-loop scoping
-// That's quite a few compilers actually including recent versions of
-// Dec Alpha cxx, HP-UX CC and SGI CC.
-// The trivial "if" statement provides the correct scoping to the
-// for loop
-
-#ifdef CXX_HAS_BUGGY_FOR_LOOPS
-#undef for
-#define for if(1) for
-#endif
-])
-
-AH_BOTTOM([// If the C++ compiler we use doesn't have bool, then
-// the following is a near-perfect work-around.
-// You must make sure your code does not depend on "int" and "bool"
-// being two different types, in overloading for instance.
-
-#ifdef CXX_HAS_NO_BOOL
-#define bool int
-#define true 1
-#define false 0
-#endif
-])