build: Use "vkd3d" prefix for autoconf variables.

This commit is contained in:
Józef Kucia 2016-09-28 11:29:11 +02:00
parent 5f91e2ded9
commit 9eb2d6bafc
2 changed files with 17 additions and 17 deletions

View File

@ -1,11 +1,11 @@
dnl VKD3D_CHECK_CFLAGS(flags)
AC_DEFUN([VKD3D_CHECK_CFLAGS],
[AS_VAR_PUSHDEF([ac_var], ac_cv_cflags_[[$1]])dnl
AC_CACHE_CHECK([whether the compiler supports $1], ac_var,
[ac_vkd3d_check_cflags_saved=$CFLAGS
[AS_VAR_PUSHDEF([vkd3d_cflags], vkd3d_cv_cflags_[[$1]])dnl
AC_CACHE_CHECK([whether the compiler supports $1], vkd3d_cflags,
[vkd3d_cflags_saved=$CFLAGS
CFLAGS="$CFLAGS $1 -Werror"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(int argc, char **argv) { return 0; }]])],
[AS_VAR_SET(ac_var, yes)], [AS_VAR_SET(ac_var, no)])
CFLAGS=$ac_vkd3d_check_cflags_saved])
AS_VAR_IF([ac_var], [yes], [VKD3D_CFLAGS="$VKD3D_CFLAGS $1"])dnl
AS_VAR_POPDEF([ac_var])])
[AS_VAR_SET(vkd3d_cflags, yes)], [AS_VAR_SET(vkd3d_cflags, no)])
CFLAGS=$vkd3d_cflags_saved])
AS_VAR_IF([vkd3d_cflags], [yes], [VKD3D_CFLAGS="$VKD3D_CFLAGS $1"])dnl
AS_VAR_POPDEF([vkd3d_cflags])])

View File

@ -2,13 +2,13 @@ dnl VKD3D_CHECK_MINGW32_PROG(variable, crosstarget-variable, [value-if-not-found
AC_DEFUN([VKD3D_CHECK_MINGW32_PROG],
[
AC_SUBST([$2], [$3])dnl
ac_prefix_list="m4_foreach([ac_vkd3d_prefix], [w64-mingw32, pc-mingw32, mingw32msvc, mingw32],
m4_foreach([ac_vkd3d_cpu], [i686, i586, i486, i386], [ac_vkd3d_cpu-ac_vkd3d_prefix-gcc ]))
vkd3d_mingw_list="m4_foreach([vkd3d_mingw_prefix], [w64-mingw32, pc-mingw32, mingw32, mingw32msvc],
m4_foreach([vkd3d_cpu], [i686, i586, i486, i386], [vkd3d_cpu-vkd3d_mingw_prefix-gcc ]))
mingw32-gcc"
AC_CHECK_PROGS([$1], [$ac_prefix_list], [$3], [$4])
AC_CHECK_PROGS([$1], [$vkd3d_mingw_list], [$3], [$4])
if test "x[$]$1" != x$3
then
ac_vkd3d_save_CC="$CC"
vkd3d_cc_saved="$CC"
CC="[$]$1"
AC_MSG_CHECKING([whether $CC works])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
@ -23,7 +23,7 @@ then
shift
done],
[AC_MSG_RESULT([no])])
CC="$ac_vkd3d_save_CC"
CC="$vkd3d_cc_saved"
fi
])
@ -31,12 +31,12 @@ dnl VKD3D_CHECK_MINGW64_PROG(variable, crosstarget-variable, [value-if-not-found
AC_DEFUN([VKD3D_CHECK_MINGW64_PROG],
[
AC_SUBST([$2], [$3])dnl
ac_prefix_list="m4_foreach([ac_vkd3d_prefix], [pc-mingw32, w64-mingw32, mingw32msvc],
m4_foreach([ac_vkd3d_cpu], [x86_64, amd64], [ac_vkd3d_cpu-ac_vkd3d_prefix-gcc ]))"
AC_CHECK_PROGS([$1], [$ac_prefix_list], [$3], [$4])
vkd3d_mingw_list="m4_foreach([vkd3d_mingw_prefix], [pc-mingw32, w64-mingw32, mingw32msvc],
m4_foreach([vkd3d_cpu], [x86_64, amd64], [vkd3d_cpu-vkd3d_mingw_prefix-gcc ]))"
AC_CHECK_PROGS([$1], [$vkd3d_mingw_list], [$3], [$4])
if test "x[$]$1" != x$3
then
ac_vkd3d_save_CC="$CC"
vkd3d_cc_saved="$CC"
CC="[$]$1"
AC_MSG_CHECKING([whether $CC works])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
@ -51,6 +51,6 @@ then
shift
done],
[AC_MSG_RESULT([no])])
CC="$ac_vkd3d_save_CC"
CC="$vkd3d_cc_saved"
fi
])