Browse Source

Issue #396: check for toolchain compatibilty with _REENTRANT before adding it to CFLAGS.

tags/json-c-0.13.1-20180305
Eric Haszlakiewicz 7 years ago
parent
commit
0f814e52dd
1 changed files with 22 additions and 1 deletions
  1. +22
    -1
      configure.ac

+ 22
- 1
configure.ac View File

@@ -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)


Loading…
Cancel
Save