Просмотр исходного кода

mesa/autoconf: attempt to use gnu99 on older gcc compilers

anonymous structs/union don't work with c99 but do work with gnu99
on gcc 4.4.

Signed-off-by: Dave Airlie <airlied@redhat.com>
tags/10.5-branchpoint
Dave Airlie 12 лет назад
Родитель
Сommit
ea9ae5d51a
1 измененных файлов: 11 добавлений и 1 удалений
  1. 11
    1
      configure.ac

+ 11
- 1
configure.ac Просмотреть файл

dnl If we're using GCC, make sure that it is at least version 4.2.0. Older dnl If we're using GCC, make sure that it is at least version 4.2.0. Older
dnl versions are explictly not supported. dnl versions are explictly not supported.
GEN_ASM_OFFSETS=no GEN_ASM_OFFSETS=no
USE_GNU99=no
if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then
AC_MSG_CHECKING([whether gcc version is sufficient]) AC_MSG_CHECKING([whether gcc version is sufficient])
major=0 major=0
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
fi fi


if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 6 ; then
USE_GNU99=yes
fi
if test "x$cross_compiling" = xyes; then if test "x$cross_compiling" = xyes; then
GEN_ASM_OFFSETS=yes GEN_ASM_OFFSETS=yes
fi fi


dnl Add flags for gcc and g++ dnl Add flags for gcc and g++
if test "x$GCC" = xyes; then if test "x$GCC" = xyes; then
CFLAGS="$CFLAGS -Wall -std=c99"
CFLAGS="$CFLAGS -Wall"

if test "x$USE_GNU99" = xyes; then
CFLAGS="$CFLAGS -std=gnu99"
else
CFLAGS="$CFLAGS -std=c99"
fi


# Enable -Werror=implicit-function-declaration and # Enable -Werror=implicit-function-declaration and
# -Werror=missing-prototypes, if available, or otherwise, just # -Werror=missing-prototypes, if available, or otherwise, just

Загрузка…
Отмена
Сохранить