Imported Upstream version 3.2.2
[debian/gnuradio] / config / lf_cxx.m4
1 dnl Autoconf support for C++
2 dnl Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
3 dnl  
4 dnl This program is free software; you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation; either version 3 of the License, or
7 dnl (at your option) any later version.
8 dnl 
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl GNU General Public License for more details.
13 dnl 
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program; if not, write to the Free Software 
16 dnl Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301, USA.
17 dnl 
18 dnl As a special exception to the GNU General Public License, if you 
19 dnl distribute this file as part of a program that contains a configuration 
20 dnl script generated by Autoconf, you may include it under the same 
21 dnl distribution terms that you use for the rest of that program.
22
23 # -----------------------------------------------------------------
24 # This macro should be called to configure your C++ compiler.
25 # When called, the macro does the following things:
26 # 1. It finds an appropriate C++ compiler
27 #    If you passed the flag --with-cxx=foo, then it uses that
28 #    particular compiler
29 # 2. Checks whether the compiler accepts the -g 
30 # ------------------------------------------------------------------
31
32 AC_DEFUN([LF_CONFIGURE_CXX],[
33  AC_REQUIRE([AC_PROG_CXX])dnl
34  AC_REQUIRE([AC_PROG_CXXCPP])dnl
35  LF_CXX_PORTABILITY
36 ])
37
38 # -----------------------------------------------------------------------
39 # This macro tests the C++ compiler for various portability problem.
40 # -----------------------------------------------------------------------
41
42
43 AC_DEFUN([LF_CXX_PORTABILITY],[
44
45   dnl
46   dnl Check for common C++ portability problems
47   dnl
48
49   dnl AC_LANG_PUSH
50   dnl AC_LANG_CPLUSPLUS
51   AC_LANG_SAVE
52   AC_LANG_CPLUSPLUS
53
54
55   dnl Test whether C++ has std::isnan
56   AC_MSG_CHECKING(whether C++ has std::isnan)
57   AC_TRY_COMPILE([#include <cmath>], [
58    std::isnan(0);
59 ], [ AC_MSG_RESULT(yes)
60         AC_DEFINE(CXX_HAS_STD_ISNAN,[],[Define if has std::isnan]) ],
61    [ AC_MSG_RESULT(no) ])
62
63   dnl Done with the portability checks
64   dnl AC_LANG_POP([C++])
65   AC_LANG_RESTORE
66 ])
67