xref: /PHP-8.0/ext/dba/install_cdb.sh (revision 37c329d7)
1#! /bin/sh
2
3# You can use this script if you want to use an external cdb lib. If you
4# compile php using --with-cdb the internal functions will be used and no
5# external library is used so that this script is not necessary.
6#
7# cdb-0.75 lacks support for installing header files and creating a
8# library which programs can link against.  This shell script fills
9# the gap.
10
11if test -r "cdb.a" && test -r "auto-str.c" && test -r "byte.a"; then
12  :
13else
14  echo "Please execute this script in the cdb-0.75 source directory after 'make'"
15  exit 1
16fi
17
18prefix=$1
19
20if test -z "$prefix"; then
21  prefix=/usr/local
22fi
23
24echo "Using prefix $prefix"
25
26if mkdir -p "$prefix/include" "$prefix/lib"; then
27  :
28else
29  echo "Creating directories failed. Please become superuser."
30  exit 1
31fi
32
33mkdir -p tmp || exit 1
34cd tmp
35ar x ../cdb.a
36ar x ../byte.a
37ar x ../unix.a
38ar x ../byte.a
39ar x ../buffer.a
40cp ../error.o .
41
42# not really portable
43ar r "$prefix/lib/libcdb.a" *
44ranlib "$prefix/lib/libcdb.a"
45cd ..
46
47rm -rf tmp
48
49cp cdb.h uint32.h "$prefix/include"
50
51echo "done"
52