added ENSC_C99COMPILER
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Tue, 3 Feb 2004 12:55:10 +0000 (12:55 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Tue, 3 Feb 2004 12:55:10 +0000 (12:55 +0000)
added warning-messages

git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@755 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/m4/ensc_cxxcompiler.m4

index cf493bc..ac92dbc 100644 (file)
@@ -32,4 +32,35 @@ AC_DEFUN([ENSC_CXXCOMPILER],
 
        AM_CONDITIONAL(ENSC_HAVE_CXX_COMPILER,
                        [test x"$ensc_cv_cxx_cxxcompiler" = xyes])
+
+       if test x"$ensc_cv_cxx_cxxcompiler" = xno; then
+               AC_MSG_WARN([*** some programs will not be built because a C++ compiler is lacking])
+       fi
+])
+
+AC_DEFUN([ENSC_C99COMPILER],
+[
+       AC_REQUIRE([AC_PROG_CC])
+
+       AC_CACHE_CHECK([whether $CC is a C99 compiler], [ensc_cv_c99_c99compiler],
+        [
+               AC_LANG_PUSH(C)
+               AC_COMPILE_IFELSE([
+int main(int argc, char *argv[]) {
+  struct { int x; }   a = { .x = argc };
+  if (0) return 0;
+  int b;
+}
+                ],
+                [ensc_cv_c99_c99compiler=yes],
+                [ensc_cv_c99_c99compiler=no])
+               AC_LANG_POP(C)
+        ])
+
+       AM_CONDITIONAL(ENSC_HAVE_C99_COMPILER,
+                       [test x"$ensc_cv_c99_c99compiler" = xyes])
+
+       if test x"$ensc_cv_c99_c99compiler" = xno; then
+               AC_MSG_WARN([*** some programs will not be built because a C99 compiler is lacking])
+       fi
 ])