Commit 69436866 authored by Alan Coopersmith's avatar Alan Coopersmith Committed by Akira TAGOH
Browse files

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's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
parent 4d739d13
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment