blob: f1b4874561d690fefabf23f2e7bb6ed2e651e075 (
plain) (
blame)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#!/bin/sh
# This wraps over the actual libtool script (given as first argument)
# and tries to remove any .la files that libtool script creates.
# The expected call is
# libtool [options] --mode=install [options] <library files> <directory>
# The script runs libtool with /bin/sh (assuming it's compatible to whatever
# we have there) and then tries to clean up after it.
set -e
# Run the full libtool command.
"$@"
# Assumption: file list comes after --mode=install.
# Let's ingore anything before that.
installing=false
for arg in "$@"
do
case "$arg" in
--mode=install)
installing=true
shift
;;
-*)
shift
;;
*)
if $installing; then
break;
fi
;;
esac
done
if $installing; then
for dir in "$@"; do :; done;
echo "$(basename $0): Cleaning up after libtool: no .la files, please."
for f in "$@"
do
case "$f" in
*.la)
rm -vf "$dir/$(basename "$f")"
;;
esac
done
fi
|