Update the copy of ax_prog_cc_for_build.m4 embedded in aclocal.m4
This correctly generates the EXEEXT variable when cross-compiling and using autoconf 2.70+ (issue #1301).
This commit is contained in:
parent
4dfac864ce
commit
14a25bfe92
|
|
@ -285,7 +285,7 @@ echo "timestamp for $_config_header" > `AS_DIRNAME(["$_config_header"])`/[]$_sta
|
|||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 18
|
||||
#serial 26
|
||||
|
||||
AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD])
|
||||
AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl
|
||||
|
|
@ -296,14 +296,16 @@ AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
|||
dnl Use the standard macros, but make them use other variable names
|
||||
dnl
|
||||
pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl
|
||||
pushdef([ac_cv_prog_cc_c89], ac_cv_build_prog_cc_c89)dnl
|
||||
pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl
|
||||
pushdef([ac_cv_prog_cc_c89], ac_cv_build_prog_cc_c89)dnl
|
||||
pushdef([ac_cv_prog_cc_c99], ac_cv_build_prog_cc_c99)dnl
|
||||
pushdef([ac_cv_prog_cc_c11], ac_cv_build_prog_cc_c11)dnl
|
||||
pushdef([ac_cv_prog_cc_c23], ac_cv_build_prog_cc_c23)dnl
|
||||
pushdef([ac_cv_prog_cc_stdc], ac_cv_build_prog_cc_stdc)dnl
|
||||
pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl
|
||||
pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl
|
||||
pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl
|
||||
pushdef([ac_cv_c_compiler_gnu], ac_cv_build_c_compiler_gnu)dnl
|
||||
pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl
|
||||
pushdef([ac_cv_objext], ac_cv_build_objext)dnl
|
||||
pushdef([ac_prog_cc_stdc], ac_build_prog_cc_stdc)dnl
|
||||
pushdef([ac_exeext], ac_build_exeext)dnl
|
||||
pushdef([ac_objext], ac_build_objext)dnl
|
||||
pushdef([CC], CC_FOR_BUILD)dnl
|
||||
|
|
@ -311,9 +313,7 @@ pushdef([CPP], CPP_FOR_BUILD)dnl
|
|||
pushdef([GCC], GCC_FOR_BUILD)dnl
|
||||
pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl
|
||||
pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl
|
||||
pushdef([EXEEXT], BUILD_EXEEXT)dnl
|
||||
pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl
|
||||
pushdef([OBJEXT], BUILD_OBJEXT)dnl
|
||||
pushdef([host], build)dnl
|
||||
pushdef([host_alias], build_alias)dnl
|
||||
pushdef([host_cpu], build_cpu)dnl
|
||||
|
|
@ -328,6 +328,32 @@ pushdef([ac_tool_prefix], ac_build_tool_prefix)dnl
|
|||
pushdef([am_cv_CC_dependencies_compiler_type], am_cv_build_CC_dependencies_compiler_type)dnl
|
||||
pushdef([am_cv_prog_cc_c_o], am_cv_build_prog_cc_c_o)dnl
|
||||
pushdef([cross_compiling], cross_compiling_build)dnl
|
||||
dnl
|
||||
dnl These variables are problematic to rename by M4 macros, so we save
|
||||
dnl their values in alternative names, and restore the values later.
|
||||
dnl
|
||||
dnl _AC_COMPILER_EXEEXT and _AC_COMPILER_OBJEXT internally call
|
||||
dnl AC_SUBST which prevents the renaming of EXEEXT and OBJEXT
|
||||
dnl variables. It's not a good idea to rename ac_cv_exeext and
|
||||
dnl ac_cv_objext either as they're related.
|
||||
dnl Renaming ac_exeext and ac_objext is safe though.
|
||||
dnl
|
||||
ac_cv_host_exeext=$ac_cv_exeext
|
||||
AS_VAR_SET_IF([ac_cv_build_exeext],
|
||||
[ac_cv_exeext=$ac_cv_build_exeext],
|
||||
[AS_UNSET([ac_cv_exeext])])
|
||||
ac_cv_host_objext=$ac_cv_objext
|
||||
AS_VAR_SET_IF([ac_cv_build_objext],
|
||||
[ac_cv_objext=$ac_cv_build_objext],
|
||||
[AS_UNSET([ac_cv_objext])])
|
||||
dnl
|
||||
dnl ac_cv_c_compiler_gnu is used in _AC_LANG_COMPILER_GNU (called by
|
||||
dnl AC_PROG_CC) indirectly.
|
||||
dnl
|
||||
ac_cv_host_c_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
AS_VAR_SET_IF([ac_cv_build_c_compiler_gnu],
|
||||
[ac_cv_c_compiler_gnu=$ac_cv_build_c_compiler_gnu],
|
||||
[AS_UNSET([ac_cv_c_compiler_gnu])])
|
||||
|
||||
cross_compiling_build=no
|
||||
|
||||
|
|
@ -341,6 +367,9 @@ _AC_COMPILER_EXEEXT
|
|||
_AC_COMPILER_OBJEXT
|
||||
AC_PROG_CPP
|
||||
|
||||
BUILD_EXEEXT=$ac_cv_exeext
|
||||
BUILD_OBJEXT=$ac_cv_objext
|
||||
|
||||
dnl Restore the old definitions
|
||||
dnl
|
||||
popdef([cross_compiling])dnl
|
||||
|
|
@ -357,9 +386,7 @@ popdef([host_vendor])dnl
|
|||
popdef([host_cpu])dnl
|
||||
popdef([host_alias])dnl
|
||||
popdef([host])dnl
|
||||
popdef([OBJEXT])dnl
|
||||
popdef([LDFLAGS])dnl
|
||||
popdef([EXEEXT])dnl
|
||||
popdef([CPPFLAGS])dnl
|
||||
popdef([CFLAGS])dnl
|
||||
popdef([GCC])dnl
|
||||
|
|
@ -367,25 +394,34 @@ popdef([CPP])dnl
|
|||
popdef([CC])dnl
|
||||
popdef([ac_objext])dnl
|
||||
popdef([ac_exeext])dnl
|
||||
popdef([ac_cv_objext])dnl
|
||||
popdef([ac_cv_exeext])dnl
|
||||
popdef([ac_cv_c_compiler_gnu])dnl
|
||||
popdef([ac_prog_cc_stdc])dnl
|
||||
popdef([ac_cv_prog_cc_g])dnl
|
||||
popdef([ac_cv_prog_cc_cross])dnl
|
||||
popdef([ac_cv_prog_cc_works])dnl
|
||||
popdef([ac_cv_prog_cc_stdc])dnl
|
||||
popdef([ac_cv_prog_cc_c23])dnl
|
||||
popdef([ac_cv_prog_cc_c11])dnl
|
||||
popdef([ac_cv_prog_cc_c99])dnl
|
||||
popdef([ac_cv_prog_cc_c89])dnl
|
||||
popdef([ac_cv_prog_gcc])dnl
|
||||
popdef([ac_cv_prog_CPP])dnl
|
||||
dnl
|
||||
ac_cv_exeext=$ac_cv_host_exeext
|
||||
EXEEXT=$ac_cv_host_exeext
|
||||
ac_cv_objext=$ac_cv_host_objext
|
||||
OBJEXT=$ac_cv_host_objext
|
||||
ac_cv_c_compiler_gnu=$ac_cv_host_c_compiler_gnu
|
||||
ac_compiler_gnu=$ac_cv_host_c_compiler_gnu
|
||||
|
||||
dnl restore global variables ac_ext, ac_cpp, ac_compile,
|
||||
dnl ac_link, ac_compiler_gnu (dependant on the current
|
||||
dnl ac_link, ac_compiler_gnu (dependent on the current
|
||||
dnl language after popping):
|
||||
AC_LANG_POP([C])
|
||||
|
||||
dnl Finally, set Makefile variables
|
||||
dnl
|
||||
AC_SUBST(BUILD_EXEEXT)dnl
|
||||
AC_SUBST(BUILD_OBJEXT)dnl
|
||||
AC_SUBST([BUILD_EXEEXT])dnl
|
||||
AC_SUBST([BUILD_OBJEXT])dnl
|
||||
AC_SUBST([CFLAGS_FOR_BUILD])dnl
|
||||
AC_SUBST([CPPFLAGS_FOR_BUILD])dnl
|
||||
AC_SUBST([LDFLAGS_FOR_BUILD])dnl
|
||||
|
|
|
|||
Loading…
Reference in New Issue