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