Patch 9.0.0023

4 views
Skip to first unread message

Bram Moolenaar

unread,
Jul 2, 2022, 6:41:17 AM7/2/22
to vim...@googlegroups.com

Patch 9.0.0023
Problem: On Solaris timer_create() exists but does not work.
Solution: Adjust the configure check to run the test program.
(closes #10647)
Files: src/configure.ac, src/auto/configure


*** ../vim-9.0.0022/src/configure.ac 2022-06-19 17:59:27.000000000 +0100
--- src/configure.ac 2022-07-02 11:33:46.716365757 +0100
***************
*** 3805,3814 ****
AC_MSG_RESULT(no))

dnl Check for timer_create. It probably requires the 'rt' library.
AC_MSG_CHECKING([for timer_create])
save_LIBS="$LIBS"
LIBS="$LIBS -lrt"
! AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include<signal.h>
#include<time.h>
static void set_flag(union sigval sv) {}
--- 3805,3816 ----
AC_MSG_RESULT(no))

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([
#include<signal.h>
#include<time.h>
static void set_flag(union sigval sv) {}
***************
*** 3819,3829 ****

action.sigev_notify = SIGEV_THREAD;
action.sigev_notify_function = set_flag;
! timer_create(CLOCK_REALTIME, &action, &timer_id);
])],
AC_MSG_RESULT(yes; with -lrt); AC_DEFINE(HAVE_TIMER_CREATE),
LIBS="$save_LIBS"
! AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include<signal.h>
#include<time.h>
static void set_flag(union sigval sv) {}
--- 3821,3832 ----

action.sigev_notify = SIGEV_THREAD;
action.sigev_notify_function = set_flag;
! 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<signal.h>
#include<time.h>
static void set_flag(union sigval sv) {}
***************
*** 3834,3840 ****

action.sigev_notify = SIGEV_THREAD;
action.sigev_notify_function = set_flag;
! timer_create(CLOCK_REALTIME, &action, &timer_id);
])],
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_TIMER_CREATE),
AC_MSG_RESULT(no)))
--- 3837,3844 ----

action.sigev_notify = SIGEV_THREAD;
action.sigev_notify_function = set_flag;
! 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)))
*** ../vim-9.0.0022/src/auto/configure 2022-06-20 13:28:00.000000000 +0100
--- src/auto/configure 2022-07-02 11:33:49.760356455 +0100
***************
*** 13041,13047 ****
$as_echo_n "checking for timer_create... " >&6; }
save_LIBS="$LIBS"
LIBS="$LIBS -lrt"
! cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#include<signal.h>
--- 13041,13053 ----
$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. */

#include<signal.h>
***************
*** 13058,13075 ****

action.sigev_notify = SIGEV_THREAD;
action.sigev_notify_function = set_flag;
! timer_create(CLOCK_REALTIME, &action, &timer_id);

;
return 0;
}
_ACEOF
! if ac_fn_c_try_link "$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"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

--- 13064,13088 ----

action.sigev_notify = SIGEV_THREAD;
action.sigev_notify_function = set_flag;
! if (timer_create(CLOCK_MONOTONIC, &action, &timer_id) < 0)
! exit(1); // cannot create a monotonic timer

;
return 0;
}
_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 :
+ { { $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. */

***************
*** 13087,13099 ****

action.sigev_notify = SIGEV_THREAD;
action.sigev_notify_function = set_flag;
! timer_create(CLOCK_REALTIME, &action, &timer_id);

;
return 0;
}
_ACEOF
! if ac_fn_c_try_link "$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

--- 13100,13113 ----

action.sigev_notify = SIGEV_THREAD;
action.sigev_notify_function = set_flag;
! if (timer_create(CLOCK_MONOTONIC, &action, &timer_id) < 0)
! exit(1); // cannot create a monotonic timer

;
return 0;
}
_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

***************
*** 13101,13111 ****
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
! rm -f core conftest.err conftest.$ac_objext \
! conftest$ac_exeext conftest.$ac_ext
fi
! rm -f core conftest.err conftest.$ac_objext \
! conftest$ac_exeext conftest.$ac_ext

{ $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; }
--- 13115,13129 ----
{ $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
fi
!
! fi
! rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
! conftest.$ac_objext conftest.beam conftest.$ac_ext
! 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; }
*** ../vim-9.0.0022/src/version.c 2022-07-01 22:44:16.650379326 +0100
--- src/version.c 2022-07-02 11:37:07.099835422 +0100
***************
*** 737,738 ****
--- 737,740 ----
{ /* Add new patch number below this line */
+ /**/
+ 23,
/**/

--
Everyone has a photographic memory. Some don't have film.

/// Bram Moolenaar -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages