Skip to content

Commit

Permalink
Issue #396: check for toolchain compatibilty with _REENTRANT before a…
Browse files Browse the repository at this point in the history
…dding it to CFLAGS.
  • Loading branch information
hawicz committed Mar 5, 2018
1 parent 1e301d9 commit 2fd9584
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion configure.ac
Expand Up @@ -167,7 +167,28 @@ AC_SUBST(JSON_BSYMBOLIC_LDFLAGS)

AX_APPEND_COMPILE_FLAGS([-Wall -Werror -Wcast-qual -Wno-error=deprecated-declarations])
AX_APPEND_COMPILE_FLAGS([-Wextra -Wwrite-string -Wno-unused-parameter])
AX_APPEND_COMPILE_FLAGS([-D_GNU_SOURCE -D_REENTRANT])
AX_APPEND_COMPILE_FLAGS([-D_GNU_SOURCE])

AC_LANG_PUSH([C])
AC_MSG_CHECKING([for compatibility with _REENTRANT and toolchain headers])
AC_LINK_IFELSE(
[
AC_LANG_SOURCE([[
/* uClibc toolchains without threading barf when _REENTRANT is defined */
#define _REENTRANT 1
#include <sys/types.h>
int main ()
{
return 0;
}
]])], [
AC_MSG_RESULT(yes)
AX_APPEND_COMPILE_FLAGS([-D_REENTRANT])
], [
AC_MSG_RESULT(no)
])
AC_LANG_POP([C])


AX_COMPILE_CHECK_SIZEOF(int)
AX_COMPILE_CHECK_SIZEOF(long)
Expand Down

0 comments on commit 2fd9584

Please sign in to comment.