To: vim_dev@googlegroups.com Subject: Patch 9.0.0065 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0065 Problem: Cross-compiling doesn't work because of timer_create check. Solution: Use AC_CACHE_CHECK(). (Richard Purdie, closes #10777) Files: src/configure.ac, src/auto/configure *** ../vim-9.0.0064/src/configure.ac 2022-07-02 11:40:36.911418191 +0100 --- src/configure.ac 2022-07-24 20:17:24.651058483 +0100 *************** *** 3807,3813 **** dnl Check for timer_create. It probably requires the 'rt' library. dnl Run the program to find out if timer_create(CLOCK_MONOTONIC) actually dnl works, on Solaris timer_create() exists but fails at runtime. ! AC_MSG_CHECKING([for timer_create]) save_LIBS="$LIBS" LIBS="$LIBS -lrt" AC_RUN_IFELSE([AC_LANG_PROGRAM([ --- 3807,3813 ---- dnl Check for timer_create. It probably requires the 'rt' library. dnl Run the program to find out if timer_create(CLOCK_MONOTONIC) actually dnl works, on Solaris timer_create() exists but fails at runtime. ! AC_CACHE_CHECK([for timer_create], [vim_cv_timer_create], save_LIBS="$LIBS" LIBS="$LIBS -lrt" AC_RUN_IFELSE([AC_LANG_PROGRAM([ *************** *** 3824,3830 **** if (timer_create(CLOCK_MONOTONIC, &action, &timer_id) < 0) exit(1); // cannot create a monotonic timer ])], ! AC_MSG_RESULT(yes; with -lrt); AC_DEFINE(HAVE_TIMER_CREATE), LIBS="$save_LIBS" AC_RUN_IFELSE([AC_LANG_PROGRAM([ #include --- 3824,3830 ---- if (timer_create(CLOCK_MONOTONIC, &action, &timer_id) < 0) exit(1); // cannot create a monotonic timer ])], ! AC_MSG_NOTICE(timer_create with -lrt); vim_cv_timer_create=yes, LIBS="$save_LIBS" AC_RUN_IFELSE([AC_LANG_PROGRAM([ #include *************** *** 3840,3847 **** if (timer_create(CLOCK_MONOTONIC, &action, &timer_id) < 0) exit(1); // cannot create a monotonic timer ])], ! AC_MSG_RESULT(yes); AC_DEFINE(HAVE_TIMER_CREATE), ! AC_MSG_RESULT(no))) AC_CACHE_CHECK([whether stat() ignores a trailing slash], [vim_cv_stat_ignores_slash], [ --- 3840,3855 ---- if (timer_create(CLOCK_MONOTONIC, &action, &timer_id) < 0) exit(1); // cannot create a monotonic timer ])], ! vim_cv_timer_create=yes, ! vim_cv_timer_create=no), ! AC_MSG_ERROR(cross-compiling: please set 'vim_cv_timer_create') ! ) ! ) ! ! if test "x$vim_cv_timer_create" = "xyes" ; then ! AC_DEFINE(HAVE_TIMER_CREATE) ! fi ! AC_CACHE_CHECK([whether stat() ignores a trailing slash], [vim_cv_stat_ignores_slash], [ *** ../vim-9.0.0064/src/auto/configure 2022-07-02 11:40:36.911418191 +0100 --- src/auto/configure 2022-07-24 20:18:45.722864456 +0100 *************** *** 13039,13051 **** { $as_echo "$as_me:${as_lineno-$LINENO}: checking for timer_create" >&5 $as_echo_n "checking for timer_create... " >&6; } ! save_LIBS="$LIBS" LIBS="$LIBS -lrt" if test "$cross_compiling" = yes; then : ! { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ! $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ! as_fn_error $? "cannot run test program while cross compiling ! See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ --- 13039,13052 ---- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for timer_create" >&5 $as_echo_n "checking for timer_create... " >&6; } ! if ${vim_cv_timer_create+:} false; then : ! $as_echo_n "(cached) " >&6 ! else ! save_LIBS="$LIBS" LIBS="$LIBS -lrt" if test "$cross_compiling" = yes; then : ! as_fn_error $? "cross-compiling: please set 'vim_cv_timer_create'" "$LINENO" 5 ! else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ *************** *** 13072,13080 **** } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ! { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; with -lrt" >&5 ! $as_echo "yes; with -lrt" >&6; }; $as_echo "#define HAVE_TIMER_CREATE 1" >>confdefs.h ! else LIBS="$save_LIBS" if test "$cross_compiling" = yes; then : --- 13073,13080 ---- } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ! { $as_echo "$as_me:${as_lineno-$LINENO}: timer_create with -lrt" >&5 ! $as_echo "$as_me: timer_create with -lrt" >&6;}; vim_cv_timer_create=yes else LIBS="$save_LIBS" if test "$cross_compiling" = yes; then : *************** *** 13108,13119 **** } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ! { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ! $as_echo "yes" >&6; }; $as_echo "#define HAVE_TIMER_CREATE 1" >>confdefs.h ! else ! { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ! $as_echo "no" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext --- 13108,13116 ---- } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ! vim_cv_timer_create=yes else ! vim_cv_timer_create=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext *************** *** 13125,13130 **** --- 13122,13137 ---- fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_timer_create" >&5 + $as_echo "$vim_cv_timer_create" >&6; } + + if test "x$vim_cv_timer_create" = "xyes" ; then + $as_echo "#define HAVE_TIMER_CREATE 1" >>confdefs.h + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat() ignores a trailing slash" >&5 $as_echo_n "checking whether stat() ignores a trailing slash... " >&6; } if ${vim_cv_stat_ignores_slash+:} false; then : *** ../vim-9.0.0064/src/version.c 2022-07-24 20:07:57.656416981 +0100 --- src/version.c 2022-07-24 20:18:38.182882496 +0100 *************** *** 737,738 **** --- 737,740 ---- { /* Add new patch number below this line */ + /**/ + 65, /**/ -- hundred-and-one symptoms of being an internet addict: 112. You are amazed that anyone uses a phone without data...let alone hear actual voices. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///