<div dir="ltr"><div>ISSUE:</div><div><br></div>On Ubuntu 12.04 LTS, arc4random is provided by libbsd.so, which is a transitive dependency of libedit.  If a system had libedit on it that was implemented in terms of libbsd.so, then the arc4random test, previously implemented as a linker test, would succeed with -ledit.  However, on Ubuntu this would also require a #include <bsd/stdlib.h>.  This caused a build breakage on configure-based Ubuntu 12.04 with libedit installed.<div>
<br></div><div>FIX:</div><div><br></div><div>This fix changes configure to test for arc4random by searching for it in the standard header files.  On Ubuntu 12.04, this test now properly fails to find arc4random as it is not defined in the default header locations.  It also tweaks the #define names to match the output of the header check command, which is slightly different than the linker function check #defines.</div>
<div><br></div><div>I tested the following scenarios:</div><div><br></div><div>(1) Ubuntu 12.04 without the libedit package [did not find arc4random, as expected]</div><div><br></div><div>(2) Ubuntu 12.04 with libedit package [properly did not find arc4random, as expected]</div>
<div><br></div><div>(3) Ubuntu 12.04 with most recent libedit, custom built, and not dependent on libbsd.so [properly did not find arc4random, as expected].</div><div><br></div><div>(4) FreeBSD 10.0B1 [properly found arc4random, as expected]</div>
<div><div><br></div><div>Let me know what you think.  Thanks!</div>-- <br><div dir="ltr"><table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small">
<td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</div></div>