diff --git a/Makefile b/Makefile index ba6ec08f..11cc9a88 100644 --- a/Makefile +++ b/Makefile @@ -55,8 +55,8 @@ else # `make test' when libtcc.dylib is used (configure --disable-static), so # we bake a relative path into the binary. $libdir is used after install. LINK_LIBTCC += -Wl,-rpath,"@executable_path/$(TOP)" -Wl,-rpath,"$(libdir)" - DYLIBVER += -current_version $(VERSION) - DYLIBVER += -compatibility_version $(VERSION) + DYLIBVER += -current_version $(MACOS_DYLIB_VERSION) + DYLIBVER += -compatibility_version $(MACOS_DYLIB_VERSION) endif endif endif diff --git a/configure b/configure index a407200b..27005fe3 100755 --- a/configure +++ b/configure @@ -602,6 +602,12 @@ echo "VERSION = $version" >> config.mak echo "#define TCC_VERSION \"$version\"" >> $TMPH echo "@set VERSION $version" > config.texi +if test "$targetos" = "Darwin"; then + # On macOS, -current_version and -compatibility_version must not contain letters. + macos_dylib_version=`echo $version | sed 's/[^0-9.]//g'` + echo "MACOS_DYLIB_VERSION = $macos_dylib_version" >> config.mak +fi + if test "$source_path_used" = "yes" ; then case $source_path in /*) echo "TOPSRC=$source_path";;