]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - aclocal.m4
ncurses 6.3 - patch 20220924
[ncurses.git] / aclocal.m4
index 15631bb425b4a27497a6218fcaedcf8756902767..7363779658a9dd75070af66e5bbf5676044c8f82 100644 (file)
@@ -29,7 +29,7 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey 1995-on
 dnl
-dnl $Id: aclocal.m4,v 1.1011 2022/09/10 19:23:45 tom Exp $
+dnl $Id: aclocal.m4,v 1.1012 2022/09/24 20:41:12 tom Exp $
 dnl Macros used in NCURSES auto-configuration script.
 dnl
 dnl These macros are maintained separately from NCURSES.  The copyright on
@@ -739,7 +739,7 @@ if test "$cf_cv_type_of_bool" = unknown ; then
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_BUILD_CC version: 9 updated: 2021/01/02 09:31:20
+dnl CF_BUILD_CC version: 10 updated: 2022/09/24 16:36:41
 dnl -----------
 dnl If we're cross-compiling, allow the user to override the tools and their
 dnl options.  The configure script is oriented toward identifying the host
@@ -805,7 +805,30 @@ if test "$cross_compiling" = yes ; then
 
        : ${BUILD_CC:='${CC}'}
 
-       if { test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}'; } ; then
+       AC_MSG_CHECKING(if the build-compiler "$BUILD_CC" works)
+
+       cf_save_crossed=$cross_compiling
+       cf_save_ac_link=$ac_link
+       cross_compiling=no
+       ac_link='$BUILD_CC -o "conftest$ac_exeext" $BUILD_CFLAGS $BUILD_CPPFLAGS $BUILD_LDFLAGS "conftest.$ac_ext" $BUILD_LIBS >&AS_MESSAGE_LOG_FD'
+
+       AC_TRY_RUN([#include <stdio.h>
+               int main(int argc, char *argv[])
+               {
+                       ${cf_cv_main_return:-return}(argc < 0 || argv == 0 || argv[0] == 0);
+               }
+       ],
+               cf_ok_build_cc=yes,
+               cf_ok_build_cc=no,
+               cf_ok_build_cc=unknown)
+
+       cross_compiling=$cf_save_crossed
+       ac_link=$cf_save_ac_link
+
+       AC_MSG_RESULT($cf_ok_build_cc)
+
+       if test "$cf_ok_build_cc" != yes
+       then
                AC_MSG_ERROR([Cross-build requires two compilers.
 Use --with-build-cc to specify the native compiler.])
        fi