build: make strerror() override-able
If we want to override `strerror()` in libjson-c to make tests consistent across platforms, we need to do it build-wide as configure/build option. Apple linkers make it really hard to override functions at link-time, and this seems to be locked down on travis-ci.org [ for security reasons I assume ]. While I got it to work locally, it did not work when running on travis. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
This commit is contained in:
16
configure.ac
16
configure.ac
@@ -23,6 +23,22 @@ else
|
||||
AC_MSG_RESULT([RDRAND Hardware RNG Hash Seed disabled. Use --enable-rdrand to enable])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(strerror-override,
|
||||
AS_HELP_STRING([--enable-strerror-override],
|
||||
[Override strerror() function with internal version.]),
|
||||
[if test x$enableval = xyes; then
|
||||
enable_strerror_override=yes
|
||||
AC_DEFINE(ENABLE_STRERROR_OVERRIDE, 1, [Override strerror() with internal version])
|
||||
fi])
|
||||
|
||||
AM_CONDITIONAL([ENABLE_STRERROR_OVERRIDE], [test "x$enable_strerror_override" = "xyes"])
|
||||
|
||||
if test "x$enable_strerror_override" = "xyes"; then
|
||||
AC_MSG_RESULT([Overriding `strerror()` function with internal version])
|
||||
else
|
||||
AC_MSG_RESULT([Using libc's `strerror()` function])
|
||||
fi
|
||||
|
||||
# enable silent build by default
|
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user