Commit 8fdcad7a authored by Kenton Varda's avatar Kenton Varda

Calculate SO_VERSION in configure for compatibility with BSD make.

BSD Make does not support `$(shell ...)`. It does support an alternative, `!=` assignments (which, confusingly, don't mean "not equal" but rather "evaluate the right in the shell before assignment"). GNU Make also supports `!=` as of version 4.0, released in 2013. Unfortunately, f***ing Apple ships GNU Make version 3.81, from 2006, with MacOS/XCode.
parent 99d308ff
......@@ -235,10 +235,6 @@ else
lib_LTLIBRARIES = libkj.la libkj-test.la libkj-async.la libkj-http.la $(MAYBE_KJ_TLS_LA) libcapnp.la libcapnp-rpc.la libcapnp-json.la libcapnpc.la
endif
# Don't include security release in soname -- we want to replace old binaries
# in this case.
SO_VERSION = $(shell echo $(VERSION) | sed -e 's/^\([0-9]*[.][0-9]*[.][0-9]*\)\([.][0-9]*\)*\(-.*\)*$$/\1\3/g')
libkj_la_LIBADD = $(PTHREAD_LIBS)
libkj_la_LDFLAGS = -release $(SO_VERSION) -no-undefined
libkj_la_SOURCES= \
......
......@@ -129,6 +129,11 @@ AC_DEFUN([CAPNP_CMAKE_CONFIG_FILES], [ \
AC_SUBST([CAPNP_PKG_CONFIG_FILES])
AC_SUBST([CAPNP_CMAKE_CONFIG_FILES])
# Don't include security release in soname -- we want to replace old binaries
# in this case.
SO_VERSION=$(echo $VERSION | sed -e 's/^\([0-9]*[.][0-9]*[.][0-9]*\)\([.][0-9]*\)*\(-.*\)*$/\1\3/g')
AC_SUBST([SO_VERSION])
# CapnProtoConfig.cmake.in needs these PACKAGE_* output variables.
PACKAGE_INIT="set([CAPNP_PKG_CONFIG_FILES] CAPNP_PKG_CONFIG_FILES)"
PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR="\${CMAKE_CURRENT_LIST_DIR}/../../../include"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment