summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2015-01-16 09:35:22 -0800
committerAkira TAGOH <akira@tagoh.org>2015-01-19 13:47:47 +0900
commit694368667a15341ea30b37a36e9540e6b1492680 (patch)
tree345c27bcb799dd3098133d1237f31f1eb52f7249
parent4d739d13f4f58e11c62006e4f70776a945094ea4 (diff)
Fix configure to work with Solaris Studio compilers
Passing -Werror in the scandir() checks caused Studio cc to report "Unrecognized option errors", confusing configure into thinking that scandir() was not available. Use Studio equivalent flags instead. Leaves -Werror as the default for all other compilers, including unknown ones, to flag to them that they need to update their flags as well if -Werror is not correct for them. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--configure.ac13
1 files changed, 12 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 457dc2c..9011f37 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,11 +103,22 @@ if test "$os_win32" = "yes"; then
fi
AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
+AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
WARN_CFLAGS=""
+WERROR_CFLAGS="-Werror"
+WARNING_CPP_DIRECTIVE="no"
if test "x$GCC" = "xyes"; then
WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \
-Wmissing-prototypes -Wmissing-declarations \
-Wnested-externs -fno-strict-aliasing"
+ WARNING_CPP_DIRECTIVE="yes"
+elif test "x$SUNCC" = "xyes"; then
+ WARN_CFLAGS="-v -fd"
+ WERROR_CFLAGS="-errtags \
+ -errwarn=%all,no%E_OLD_STYLE_FUNC_DEF,no%E_STATEMENT_NOT_REACHED"
+ WARNING_CPP_DIRECTIVE="yes"
+fi
+if test "x$WARNING_CPP_DIRECTIVE" = "xyes"; then
AC_DEFINE_UNQUOTED(HAVE_WARNING_CPP_DIRECTIVE,1,
[Can use #warning in C files])
fi
@@ -159,7 +170,7 @@ AC_DEFINE_UNQUOTED([HAVE_POSIX_FADVISE], [$fc_func_posix_fadvise], [Define to 1
if test "$os_win32" = "no"; then
AC_MSG_CHECKING([for scandir])
fc_saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $WARN_CFLAGS -Werror"
+ CFLAGS="$CFLAGS $WARN_CFLAGS $WERROR_CFLAGS"
AC_TRY_COMPILE([
#include <dirent.h>
int main(void);