mirror of
https://github.com/json-c/json-c.git
synced 2026-04-05 13:29:06 +08:00
Issue #396: check for toolchain compatibilty with _REENTRANT before adding it to CFLAGS.
This commit is contained in:
23
configure.ac
23
configure.ac
@@ -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([-Wall -Werror -Wcast-qual -Wno-error=deprecated-declarations])
|
||||||
AX_APPEND_COMPILE_FLAGS([-Wextra -Wwrite-string -Wno-unused-parameter])
|
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(int)
|
||||||
AX_COMPILE_CHECK_SIZEOF(long)
|
AX_COMPILE_CHECK_SIZEOF(long)
|
||||||
|
|||||||
Reference in New Issue
Block a user