<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/17993">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">configure.ac: Fix HAVE_CLOCK_GETTIME undef when func in -lrt<br><br>AC_SEARCH_LIBS was finding the function correctly, but later on<br>AC_CHECK_FUNCS was not including the found LIBRARY_RT so the function<br>was not found, and hence HAVE_CLOCK_GETTIME ended up undefined (which in<br>turns disables support for osmo_clock_gettime() API).<br>This happened in systems like the soekris where the clock_gettime sybmol<br>is available in external lib -lrt.<br><br>Let's avoid double-checking for the function twice, and simply define<br>HAVE_CLOCK_GETTIME when AC_SEARCH_LIBS succeeds (the success action is<br>guaranteed to be called even if there's no extra lib required).<br><br>Change-Id: Iced1e0542cee6beb9f08f5299aad49fab142cfb4<br>---<br>M configure.ac<br>1 file changed, 4 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/93/17993/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/configure.ac b/configure.ac</span><br><span>index 352648b..cba0a41 100644</span><br><span>--- a/configure.ac</span><br><span>+++ b/configure.ac</span><br><span>@@ -77,7 +77,9 @@</span><br><span> AX_PTHREAD</span><br><span> </span><br><span> # check for old glibc < 2.17 to get clock_gettime</span><br><span style="color: hsl(0, 100%, 40%);">-AC_SEARCH_LIBS([clock_gettime], [rt posix4], [LIBRARY_RT="$LIBS";LIBS=""])</span><br><span style="color: hsl(120, 100%, 40%);">+AC_SEARCH_LIBS([clock_gettime], [rt posix4],</span><br><span style="color: hsl(120, 100%, 40%);">+         [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if clock_gettime is available])</span><br><span style="color: hsl(120, 100%, 40%);">+              LIBRARY_RT="$LIBS";LIBS="";])</span><br><span> AC_SUBST(LIBRARY_RT)</span><br><span> </span><br><span> AC_ARG_ENABLE(doxygen,</span><br><span>@@ -103,7 +105,7 @@</span><br><span> CFLAGS="$saved_CFLAGS"</span><br><span> AC_SUBST(SYMBOL_VISIBILITY)</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-AC_CHECK_FUNCS(clock_gettime localtime_r)</span><br><span style="color: hsl(120, 100%, 40%);">+AC_CHECK_FUNCS(localtime_r)</span><br><span> </span><br><span> AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [</span><br><span>   AC_CACHE_CHECK(</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/17993">change 17993</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmocore/+/17993"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Iced1e0542cee6beb9f08f5299aad49fab142cfb4 </div>
<div style="display:none"> Gerrit-Change-Number: 17993 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>