Squelch a warning when building against the MacOSX10.4u.sdk
[blocksruntime.git] / installlib
blobcabacc7be568b8a0acf7d7ba162a8b617febbbba
1 #!/bin/sh
3 : ${prefix:=/usr/local}
4 : ${includedir:=$prefix/include}
5 : ${libdir:=$prefix/lib}
7 HEADER=BlocksRuntime/Block.h
8 LIB=libBlocksRuntime.a
10 docmd()
12 echo "$*"
13 if [ -z "$dryrun" ]; then eval "$*"; fi
16 if ! myid="$(id -u)"; then
17 echo "Cannot run id, aborting!"
18 exit 1
20 if [ ! -r $HEADER ]; then
21 echo "Cannot find $HEADER, aborting!"
22 exit 1
24 if [ ! -r $LIB ]; then
25 echo "Cannot find $LIB, did you run buildlib?"
26 exit 1
28 dryrun=
29 if [ "$1" = '-n' ] || [ "$1" = '--dry-run' ]; then
30 dryrun=1
31 shift
33 if [ "$#" != 0 ]; then
34 echo "Usage: [prefix=prefixdir] $0 [-n | --dry-run]"
35 exit 1
38 echo "Install Prefix(\$prefix): $prefix (default is /usr/local)"
39 echo "Include Directory(\$includedir): $includedir (default is \$prefix/include)"
40 echo "Library Directory(\$libdir): $libdir (default is \$prefix/lib)"
41 echo "(use prefix=prefixdir $0 [or similar] to change)"
42 echo ''
44 if [ -z "$dryrun" -a "$myid" != 0 ]; then
45 echo "Must be root to install, use sudo $0"
46 echo "(Or try using the --dry-run option)"
47 exit 1
49 docmd "install -d $includedir $libdir"
50 docmd "install -m 644 $HEADER $includedir/"
51 docmd "install -m 644 $LIB $libdir/"