install_cdb.sh 1.1 KB

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