mirror of
https://github.com/json-c/json-c.git
synced 2026-04-09 07:19:06 +08:00
Add an autoconf test to test whether the .section .gnu<warning>
works with the linker on the system, and define _warn_references to nothing if not.
This commit is contained in:
18
configure.in
18
configure.in
@@ -37,6 +37,24 @@ AC_FUNC_MALLOC
|
||||
AC_FUNC_REALLOC
|
||||
AC_CHECK_FUNCS(strcasecmp strdup strndup strerror snprintf vsnprintf vasprintf open vsyslog strncasecmp)
|
||||
|
||||
#check if .section.gnu.warning accepts long strings (for __warn_references)
|
||||
AC_LANG_PUSH([C])
|
||||
|
||||
AC_MSG_CHECKING([if .gnu.warning accepts long strings])
|
||||
AC_LINK_IFELSE([[
|
||||
extern void json_object_get();
|
||||
__asm__(".section .gnu.json_object_get,\n\t.ascii \"Please link against libjson-c instead of libjson\"\n\t.text");
|
||||
|
||||
int main(int c,char* v) {return 0;}
|
||||
]], [
|
||||
AC_DEFINE(HAS_GNU_WARNING_LONG, 1, [Define if .gnu.warning accepts long strings.])
|
||||
AC_MSG_RESULT(yes)
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
AC_LANG_POP([C])
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
|
||||
Reference in New Issue
Block a user