ensc_cxxcompiler.m4 (2003B)
1 dnl $Id$ 2 3 dnl Copyright (C) 2002, 2003, 2004, 2005, 2009 4 dnl Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 5 dnl 6 dnl This program is free software; you can redistribute it and/or modify 7 dnl it under the terms of the GNU General Public License as published by 8 dnl the Free Software Foundation; version 2 and/or 3 of the License. 9 dnl 10 dnl This program is distributed in the hope that it will be useful, 11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of 12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 dnl GNU General Public License for more details. 14 dnl 15 dnl You should have received a copy of the GNU General Public License 16 dnl along with this program; if not, write to the Free Software 17 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 19 AC_DEFUN([ENSC_CXXCOMPILER], 20 [ 21 AC_REQUIRE([AC_PROG_CXX]) 22 23 AC_CACHE_CHECK([whether $CXX is a C++ compiler], [ensc_cv_cxx_cxxcompiler], 24 [ 25 AC_LANG_PUSH(C++) 26 AC_COMPILE_IFELSE([AC_LANG_SOURCE([ 27 #include <ostream> 28 ])], 29 [ensc_cv_cxx_cxxcompiler=yes], 30 [ensc_cv_cxx_cxxcompiler=no]) 31 AC_LANG_POP(C++) 32 ]) 33 34 AM_CONDITIONAL(ENSC_HAVE_CXX_COMPILER, 35 [test x"$ensc_cv_cxx_cxxcompiler" = xyes]) 36 37 if test x"$ensc_cv_cxx_cxxcompiler" = xno; then 38 AC_MSG_WARN([*** some programs will not be built because a C++ compiler is lacking]) 39 fi 40 ]) 41 42 AC_DEFUN([ENSC_C99COMPILER], 43 [ 44 AC_REQUIRE([AC_PROG_CC]) 45 46 AC_CACHE_CHECK([whether $CC is a C99 compiler], [ensc_cv_c99_c99compiler], 47 [ 48 AC_LANG_PUSH(C) 49 AC_COMPILE_IFELSE([AC_LANG_SOURCE([ 50 int main(int argc, char *argv[]) { 51 struct { int x; } a = { .x = argc }; 52 if (0) return 0; 53 int b; 54 } 55 ])], 56 [ensc_cv_c99_c99compiler=yes], 57 [ensc_cv_c99_c99compiler=no]) 58 AC_LANG_POP(C) 59 ]) 60 61 AM_CONDITIONAL(ENSC_HAVE_C99_COMPILER, 62 [test x"$ensc_cv_c99_c99compiler" = xyes]) 63 64 if test x"$ensc_cv_c99_c99compiler" = xno; then 65 AC_MSG_WARN([*** some programs will not be built because system is lacking a C99 compiler]) 66 fi 67 ])