Skip to content

Commit

Permalink
build: don't fail if linker version scripts are not supported
Browse files Browse the repository at this point in the history
Some platforms (such as OSX) do not support version scripts. In these
platforms the symbols will not be versioned, but it is OK to omit them.

#24
  • Loading branch information
bluetech committed Jul 17, 2015
1 parent 8e1fed6 commit 257e38c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ libxkbcommon_la_SOURCES = \
src/utf8.h \
src/utils.c \
src/utils.h
if HAVE_VERSION_SCRIPT
libxkbcommon_la_LDFLAGS = -Wl,--version-script=${srcdir}/xkbcommon.map
endif HAVE_VERSION_SCRIPT

if ENABLE_X11
pkgconfig_DATA += xkbcommon-x11.pc
Expand All @@ -111,7 +113,9 @@ lib_LTLIBRARIES += libxkbcommon-x11.la
libxkbcommon_x11_la_CFLAGS = $(AM_CFLAGS) $(XCB_XKB_CFLAGS)
libxkbcommon_x11_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/x11
libxkbcommon_x11_la_LIBADD = libxkbcommon.la $(XCB_XKB_LIBS)
if HAVE_VERSION_SCRIPT
libxkbcommon_x11_la_LDFLAGS = -Wl,--version-script=${srcdir}/xkbcommon-x11.map
endif HAVE_VERSION_SCRIPT

libxkbcommon_x11_la_SOURCES = \
src/x11/keymap.c \
Expand Down
4 changes: 3 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,11 @@ openbsd*)
*)
XORG_CHECK_LINKER_FLAGS([-Wl,--no-undefined], [have_no_undefined=yes]) ;;
esac

AM_CONDITIONAL([HAVE_NO_UNDEFINED], [test "x$have_no_undefined" = xyes])

XORG_CHECK_LINKER_FLAGS([-Wl,--version-script="$srcdir/xkbcommon.map"], [have_version_script=yes])
AM_CONDITIONAL([HAVE_VERSION_SCRIPT], [test "x$have_version_script" = xyes])

AC_CHECK_LIB(rt, clock_gettime,
[AC_SUBST(RT_LIBS, "-lrt")],
[AC_SUBST(RT_LIBS, "")],
Expand Down

0 comments on commit 257e38c

Please sign in to comment.