File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / dba / install_cdb.sh
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:54 2012 UTC (12 years, 8 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

#! /bin/sh

# You can use this script if you want to use an external cdb lib. If you
# compile php using --with-cdb the internal functions will be used and no 
# external library is used so that this script is not necessary.
#
# cdb-0.75 lacks support for installing header files and creating a 
# library which programs can link against.  This shell script fills
# the gap.
#
# $Id: install_cdb.sh,v 1.1.1.1 2012/02/21 23:47:54 misho Exp $

if test -r "cdb.a" && test -r "auto-str.c" && test -r "byte.a"; then
  :
else
  echo "Please execute this script in the cdb-0.75 source directory after 'make'"
  exit 1
fi

prefix=$1

if test -z "$prefix"; then
  prefix=/usr/local
fi

echo "Using prefix $prefix"

if mkdir -p "$prefix/include" "$prefix/lib"; then
  :
else
  echo "Creating directories failed. Please become superuser."
  exit 1
fi

mkdir -p tmp || exit 1
cd tmp
ar x ../cdb.a
ar x ../byte.a
ar x ../unix.a
ar x ../byte.a
ar x ../buffer.a
cp ../error.o .

# not really portable
ar r "$prefix/lib/libcdb.a" *
ranlib "$prefix/lib/libcdb.a"
cd ..

rm -rf tmp

cp cdb.h uint32.h "$prefix/include"

echo "done"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>