Skip to content

Commit 509695c

Browse files
rpurdiebrammool
authored andcommitted
patch 9.0.0065: cross-compiling doesn't work because of timer_create check
Problem: Cross-compiling doesn't work because of timer_create check. Solution: Use AC_CACHE_CHECK(). (Richard Purdie, closes #10777)
1 parent c963ec3 commit 509695c

File tree

3 files changed

+34
-17
lines changed

3 files changed

+34
-17
lines changed

src/auto/configure

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13039,13 +13039,14 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1303913039

1304013040
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for timer_create" >&5
1304113041
$as_echo_n "checking for timer_create... " >&6; }
13042-
save_LIBS="$LIBS"
13042+
if ${vim_cv_timer_create+:} false; then :
13043+
$as_echo_n "(cached) " >&6
13044+
else
13045+
save_LIBS="$LIBS"
1304313046
LIBS="$LIBS -lrt"
1304413047
if test "$cross_compiling" = yes; then :
13045-
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13046-
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13047-
as_fn_error $? "cannot run test program while cross compiling
13048-
See \`config.log' for more details" "$LINENO" 5; }
13048+
as_fn_error $? "cross-compiling: please set 'vim_cv_timer_create'" "$LINENO" 5
13049+
1304913050
else
1305013051
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1305113052
/* end confdefs.h. */
@@ -13072,9 +13073,8 @@ main ()
1307213073
}
1307313074
_ACEOF
1307413075
if ac_fn_c_try_run "$LINENO"; then :
13075-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; with -lrt" >&5
13076-
$as_echo "yes; with -lrt" >&6; }; $as_echo "#define HAVE_TIMER_CREATE 1" >>confdefs.h
13077-
13076+
{ $as_echo "$as_me:${as_lineno-$LINENO}: timer_create with -lrt" >&5
13077+
$as_echo "$as_me: timer_create with -lrt" >&6;}; vim_cv_timer_create=yes
1307813078
else
1307913079
LIBS="$save_LIBS"
1308013080
if test "$cross_compiling" = yes; then :
@@ -13108,12 +13108,9 @@ main ()
1310813108
}
1310913109
_ACEOF
1311013110
if ac_fn_c_try_run "$LINENO"; then :
13111-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13112-
$as_echo "yes" >&6; }; $as_echo "#define HAVE_TIMER_CREATE 1" >>confdefs.h
13113-
13111+
vim_cv_timer_create=yes
1311413112
else
13115-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13116-
$as_echo "no" >&6; }
13113+
vim_cv_timer_create=no
1311713114
fi
1311813115
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1311913116
conftest.$ac_objext conftest.beam conftest.$ac_ext
@@ -13125,6 +13122,16 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1312513122
fi
1312613123

1312713124

13125+
fi
13126+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_timer_create" >&5
13127+
$as_echo "$vim_cv_timer_create" >&6; }
13128+
13129+
if test "x$vim_cv_timer_create" = "xyes" ; then
13130+
$as_echo "#define HAVE_TIMER_CREATE 1" >>confdefs.h
13131+
13132+
fi
13133+
13134+
1312813135
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat() ignores a trailing slash" >&5
1312913136
$as_echo_n "checking whether stat() ignores a trailing slash... " >&6; }
1313013137
if ${vim_cv_stat_ignores_slash+:} false; then :

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
[

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,8 @@ static char *(features[]) =
735735

736736
static int included_patches[] =
737737
{ /* Add new patch number below this line */
738+
/**/
739+
65,
738740
/**/
739741
64,
740742
/**/

0 commit comments

Comments
 (0)