Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port check for --default-symver to autoconf #666

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ AC_TYPE_UINT16_T
AC_TYPE_UINT8_T
AC_TYPE_LONG_LONG_INT

jansson_soversion="4"
AC_SUBST([jansson_soversion])

AC_C_INLINE
case $ac_cv_c_inline in
yes) json_inline=inline;;
Expand Down Expand Up @@ -138,8 +141,12 @@ AS_IF([test "x$with_Bsymbolic" = "xyes"], [JSON_BSYMBOLIC_LDFLAGS=-Wl[,]-Bsymbol
AC_SUBST(JSON_BSYMBOLIC_LDFLAGS)

# Enable symbol versioning on GNU libc
m4_pattern_forbid([^AX_CHECK_LINK_FLAG$])
JSON_SYMVER_LDFLAGS=
AC_CHECK_DECL([__GLIBC__], [JSON_SYMVER_LDFLAGS=-Wl,--default-symver])
AC_CHECK_DECL([__GLIBC__],
[AX_CHECK_LINK_FLAG([-Wl,--default-symver],
[JSON_SYMVER_LDFLAGS=-Wl,--default-symver],
[JSON_SYMVER_LDFLAGS=-Wl,--version-script,$ac_abs_confdir/jansson.sym])])
AC_SUBST([JSON_SYMVER_LDFLAGS])

AC_ARG_ENABLE([ossfuzzers],
Expand Down Expand Up @@ -168,6 +175,7 @@ AC_SUBST([AM_CFLAGS])

AC_CONFIG_FILES([
jansson.pc
jansson.sym
Makefile
doc/Makefile
src/Makefile
Expand Down
5 changes: 5 additions & 0 deletions jansson.sym.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
JANSSON_@jansson_soversion@ {
global:
*;
};