make/install-lib-macos.sh

Fri, 07 Nov 2025 19:23:21 +0100

author
Mike Becker <universe@uap-core.de>
date
Fri, 07 Nov 2025 19:23:21 +0100
changeset 1478
bba2e5efdca0
parent 1473
944f02992369
permissions
-rwxr-xr-x

add warning, not to pass the same pointer multiple times to the clone functions

#!/bin/sh

if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] || [ -z "$4" ] ; then
  echo "Usage: $0 <src> <libdir> <version> <major_version>"
  exit 1
fi


NAME=$(basename $1)
LIBNAME=${NAME/.dylib/.$4.dylib}

SRC="$1"
DST="$2/$LIBNAME"
LN_DST="$2/$NAME"

cp -f "$SRC" "$DST"

install_name_tool -id "$DST" "$DST"

rm -f "$LN_DST"
ln -s "$LIBNAME" "$LN_DST"

mercurial