add AC_TRY_RUN_STRICT support for Sun Studio compiler
authorBjörn Jacke <bj@sernet.de>
Wed, 9 Apr 2008 14:27:20 +0000 (16:27 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 16 Apr 2008 14:40:44 +0000 (16:40 +0200)
source/configure.in

index 98ce92c56e37d24f8e763d34afa048a49de2e0d5..07e5bbe1d88590f52fc7aa0cf7ffe3858ba5f8d8 100644 (file)
@@ -307,6 +307,18 @@ AC_CACHE_CHECK([that the C compiler understands -w2],samba_cv_HAVE_w2, [
   samba_cv_HAVE_w2=yes,samba_cv_HAVE_w2=no,samba_cv_HAVE_w2=cross)])
 if test x"$samba_cv_HAVE_w2" = x"yes"; then
    Werror_FLAGS="-w2"
+else
+dnl Check if the C compiler understands -errwarn
+AC_CACHE_CHECK([that the C compiler understands -errwarn],samba_cv_HAVE_errwarn, [
+  AC_TRY_RUN_STRICT([
+   int main(void)
+   {
+       return 0;
+   }],[-errwarn=%all],[$CPPFLAGS],[$LDFLAGS],
+   samba_cv_HAVE_errwarn=yes,samba_cv_HAVE_errwarn=no,samba_cv_HAVE_errwarn=cross)])
+if test x"$samba_cv_HAVE_errwarn" = x"yes"; then
+   Werror_FLAGS="-errwarn=%all"
+fi
 fi
 fi