xref: /PHP-7.2/ext/dba/install_cdb.sh (revision 902d39a3)
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#
11# $Id: install_cdb.sh,v 1.2 2002-11-04 17:53:04 helly Exp $
12
13if test -r "cdb.a" && test -r "auto-str.c" && test -r "byte.a"; then
14  :
15else
16  echo "Please execute this script in the cdb-0.75 source directory after 'make'"
17  exit 1
18fi
19
20prefix=$1
21
22if test -z "$prefix"; then
23  prefix=/usr/local
24fi
25
26echo "Using prefix $prefix"
27
28if mkdir -p "$prefix/include" "$prefix/lib"; then
29  :
30else
31  echo "Creating directories failed. Please become superuser."
32  exit 1
33fi
34
35mkdir -p tmp || exit 1
36cd tmp
37ar x ../cdb.a
38ar x ../byte.a
39ar x ../unix.a
40ar x ../byte.a
41ar x ../buffer.a
42cp ../error.o .
43
44# not really portable
45ar r "$prefix/lib/libcdb.a" *
46ranlib "$prefix/lib/libcdb.a"
47cd ..
48
49rm -rf tmp
50
51cp cdb.h uint32.h "$prefix/include"
52
53echo "done"
54