![Michael Jerris](/assets/img/avatar_default.png)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1392 d0543943-73ff-0310-b7d9-9358b9ac24b2
27 lines
1.1 KiB
Text
27 lines
1.1 KiB
Text
AC_DEFUN([AX_CHECK_COMPILER_FLAGS],
|
|
[AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX
|
|
AC_MSG_CHECKING([whether _AC_LANG compiler accepts $1])
|
|
dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
|
|
AS_LITERAL_IF([$1],
|
|
[AC_CACHE_VAL(AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1), [
|
|
ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
|
|
_AC_LANG_PREFIX[]FLAGS="$1"
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
|
|
AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=yes,
|
|
AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=no)
|
|
_AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])],
|
|
[ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
|
|
_AC_LANG_PREFIX[]FLAGS="$1"
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
|
|
eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=yes,
|
|
eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=no)
|
|
_AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])
|
|
eval ax_check_compiler_flags=$AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)
|
|
AC_MSG_RESULT($ax_check_compiler_flags)
|
|
if test "x$ax_check_compiler_flags" = xyes; then
|
|
m4_default([$2], :)
|
|
else
|
|
m4_default([$3], :)
|
|
fi
|
|
])dnl AX_CHECK_COMPILER_FLAG
|