1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

m4/compiler_flag_chk.m4: fix bug related to not testing the actual flag

This commit is contained in:
Jon Trulson 2021-12-09 15:48:20 -07:00
parent a9e028f7c6
commit b29bd77a2f

View file

@ -5,17 +5,17 @@ AC_DEFUN([CXX_FLAG_CHECK],
[dnl [dnl
AC_MSG_CHECKING([if $CXX supports $1]) AC_MSG_CHECKING([if $CXX supports $1])
AC_LANG_PUSH([C++]) AC_LANG_PUSH([C++])
ac_saved_cxxflags="$CXX_COMPILER_FLAGS" ac_saved_cxxflags="$CXXFLAGS"
CXX_COMPILER_FLAGS="-Werror $1" CXXFLAGS="-Werror $1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[cxx_flag_check=yes], [cxx_flag_check=yes],
[cxx_flag_check=no] [cxx_flag_check=no]
) )
AC_MSG_RESULT([$cxx_flag_check]) AC_MSG_RESULT([$cxx_flag_check])
CXX_COMPILER_FLAGS="$ac_saved_cxxflags" CXXFLAGS="$ac_saved_cxxflags"
if test "$cxx_flag_check" = yes if test "$cxx_flag_check" = yes
then then
CXX_COMPILER_FLAGS="$CXX_COMPILER_FLAGS $1" CXX_COMPILER_FLAGS="$1 $CXX_COMPILER_FLAGS "
fi fi
AC_LANG_POP([C++]) AC_LANG_POP([C++])
]) ])
@ -24,17 +24,17 @@ AC_DEFUN([C_FLAG_CHECK],
[dnl [dnl
AC_MSG_CHECKING([if $CC supports $1]) AC_MSG_CHECKING([if $CC supports $1])
AC_LANG_PUSH([C]) AC_LANG_PUSH([C])
ac_saved_ccflags="$C_COMPILER_FLAGS" ac_saved_ccflags="$CFLAGS"
C_COMPILER_FLAGS="-Werror $1" CFLAGS="-Werror $1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[cc_flag_check=yes], [cc_flag_check=yes],
[cc_flag_check=no] [cc_flag_check=no]
) )
AC_MSG_RESULT([$cc_flag_check]) AC_MSG_RESULT([$cc_flag_check])
C_COMPILER_FLAGS="$ac_saved_ccflags" CFLAGS="$ac_saved_ccflags"
if test "$cc_flag_check" = yes if test "$cc_flag_check" = yes
then then
C_COMPILER_FLAGS="$C_COMPILER_FLAGS $1" C_COMPILER_FLAGS="$1 $C_COMPILER_FLAGS "
fi fi
AC_LANG_POP([C]) AC_LANG_POP([C])
]) ])