Skip to content

Commit 2508250

Browse files
committed
configure.ac: Fix create_timer solaris test for cross compiling
A runtime test was added for create_timer however this meant cross compiling would no longer work. Allow a cache value to be specified to allow cross compiling again. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
1 parent d61efa5 commit 2508250

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

src/configure.ac

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3807,7 +3807,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
38073807
dnl Check for timer_create. It probably requires the 'rt' library.
38083808
dnl Run the program to find out if timer_create(CLOCK_MONOTONIC) actually
38093809
dnl works, on Solaris timer_create() exists but fails at runtime.
3810-
AC_MSG_CHECKING([for timer_create])
3810+
AC_CACHE_CHECK([for timer_create], [vim_cv_timer_create],
38113811
save_LIBS="$LIBS"
38123812
LIBS="$LIBS -lrt"
38133813
AC_RUN_IFELSE([AC_LANG_PROGRAM([
@@ -3824,7 +3824,7 @@ static void set_flag(union sigval sv) {}
38243824
if (timer_create(CLOCK_MONOTONIC, &action, &timer_id) < 0)
38253825
exit(1); // cannot create a monotonic timer
38263826
])],
3827-
AC_MSG_RESULT(yes; with -lrt); AC_DEFINE(HAVE_TIMER_CREATE),
3827+
AC_MSG_NOTICE(timer_create with -lrt); vim_cv_timer_create=yes,
38283828
LIBS="$save_LIBS"
38293829
AC_RUN_IFELSE([AC_LANG_PROGRAM([
38303830
#include<signal.h>
@@ -3840,8 +3840,16 @@ static void set_flag(union sigval sv) {}
38403840
if (timer_create(CLOCK_MONOTONIC, &action, &timer_id) < 0)
38413841
exit(1); // cannot create a monotonic timer
38423842
])],
3843-
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_TIMER_CREATE),
3844-
AC_MSG_RESULT(no)))
3843+
vim_cv_timer_create=yes,
3844+
vim_cv_timer_create=no),
3845+
AC_MSG_ERROR(cross-compiling: please set 'vim_cv_timer_create')
3846+
)
3847+
)
3848+
3849+
if test "x$vim_cv_timer_create" = "xyes" ; then
3850+
AC_DEFINE(HAVE_TIMER_CREATE)
3851+
fi
3852+
38453853

38463854
AC_CACHE_CHECK([whether stat() ignores a trailing slash], [vim_cv_stat_ignores_slash],
38473855
[

0 commit comments

Comments
 (0)