1
0
Fork 0

Fix macOS .dylib build when VERSION contains letters.

macOS builds with --disable-static fail to link if the version number
contains letters because of the -current_version and
-compatibility_version arguments (current version is 0.9.28rc).

This commit adds a new MACOS_DYLIB_VERSION variable to config.mak for
builds that target macOS. It has no impact on other targets.
This commit is contained in:
Ben C 2023-10-25 22:17:35 -04:00
parent f44060f8fc
commit 6b967b1285
2 changed files with 8 additions and 2 deletions

View File

@ -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

6
configure vendored
View File

@ -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";;