summaryrefslogtreecommitdiffhomepage
path: root/aux/slibtool.sh
blob: 0bde87d4929929f60186927156dd59fafc6a9481 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh

#####################################################################
##  slibtool: a strong libtool implementation, written in C        ##
##  Copyright (C) 2016--2024  SysDeer Technologies, LLC            ##
##  Released under the Standard MIT License; see COPYING.SLIBTOOL. ##
#####################################################################

#####################################################################
## slibtool.sh: a backward compatible slibtool wrapper script      ##
## ----------------------------------------------------------      ##
## This script only exists to satisfy build-time requirements in   ##
## projects that directly invoke the generated libtool script at   ##
## configure time (bad practice to beging with, should never be    ##
## necessary in the first place).                                  ##
##                                                                 ##
## By default, slibtool.sh is _NOT_ copied to a project's build    ##
## directory. If found by configure, however (either as a symlink  ##
## to the system installed slibtool.sh or as a physical copy of    ##
## the above, configure shall create ``libtool'' as a symlink to   ##
## this script.                                                    ##
#####################################################################

set -eu

mb_escaped_arg=
mb_escaped_args=
mb_escaped_space=

for arg ; do
	mb_escaped_arg=\'$(printf '%s\n' "$arg" | sed -e "s/'/'\\\\''/g")\'
	mb_escaped_arg="$mb_escaped_space$mb_escaped_arg"
	mb_escaped_args="$mb_escaped_args$mb_escaped_arg"
	mb_escaped_space=' '
done

eval ${SLIBTOOL:-slibtool} "$mb_escaped_args"