db_4.1.25.bb 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Version 4 of the Berkeley DB from Sleepycat
  2. #
  3. # At present this package only installs the DB code
  4. # itself (shared libraries, .a in the dev package),
  5. # documentation and headers.
  6. #
  7. # The headers have the same names as those as v3
  8. # of the DB, only one version can be used *for dev*
  9. # at once - DB3 and DB4 can both be installed on the
  10. # same system at the same time if really necessary.
  11. SECTION = "libs"
  12. DESCRIPTION = "Berkeley DB v4."
  13. HOMEPAGE = "http://www.sleepycat.com"
  14. LICENSE = "BSD Sleepycat"
  15. PR = "r2"
  16. SRC_URI = "http://download.oracle.com/berkeley-db/${P}.tar.gz"
  17. inherit autotools
  18. # At present virtual/db is only in the db4 file, but it
  19. # should probably be in the other candidates (db3, gdbm)
  20. # because it doesn't make any sense to have multiple
  21. # relational databases on an embedded machine...
  22. PROVIDES += " db4 virtual/db"
  23. # bitbake isn't quite clever enough to deal with sleepycat,
  24. # the distribution sits in the expected directory, but all
  25. # the builds must occur from a sub-directory. The following
  26. # persuades bitbake to go to the right place
  27. S = "${WORKDIR}/${P}/build_unix"
  28. # The executables go in a separate package - typically there
  29. # is no need to install these unless doing real database
  30. # management on the system.
  31. PACKAGES += " ${PN}-bin"
  32. # Package contents
  33. FILES_${PN} = "${libdir}/libdb*so*"
  34. FILES_${PN}-bin = "${bindir}/*"
  35. # The dev package has the .so link (as in db3) and the .a's -
  36. # it is therefore incompatible (cannot be installed at the
  37. # same time) as the db3 package
  38. FILES_${PN}-dev = "${includedir} ${libdir}/*"
  39. #configuration - set in local.conf to override
  40. DB4_CONFIG ?= "--enable-o_direct --enable-smallbuild"
  41. # Override the MUTEX setting here, the POSIX library is
  42. # the default - "POSIX/pthreads/library".
  43. # Don't ignore the nice SWP instruction on the ARM:
  44. EXTRA_OECONF = "${DB4_CONFIG}"
  45. # These enable the ARM assembler mutex code, this won't
  46. # work with thumb compilation...
  47. ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
  48. ARM_MUTEX_thumb = ""
  49. # NOTE: only tested on nslu2, should probably be _armeb
  50. EXTRA_OECONF_nslu2 = "${DB4_CONFIG} ${ARM_MUTEX}"
  51. # Cancel the site stuff - it's set for db3 and destroys the
  52. # configure.
  53. CONFIG_SITE = ""
  54. do_configure() {
  55. echo '#!/bin/sh' >${S}/configure
  56. echo 'rm ${S}/configure' >>${S}/configure
  57. echo 'exec ../dist/configure "$@"' >>${S}/configure
  58. chmod a+x ${S}/configure
  59. oe_runconf
  60. }
  61. do_stage() {
  62. oe_runmake DESTDIR="${STAGING_DIR}/${BUILD_SYS}" includedir="${STAGING_INCDIR}" install_include
  63. oe_libinstall -so -C .libs libdb-4.1 ${STAGING_LIBDIR}
  64. ln -s ${STAGING_LIBDIR}/libdb-4.1.so ${STAGING_LIBDIR}/libdb-4.so
  65. ln -s ${STAGING_LIBDIR}/libdb-4.so ${STAGING_LIBDIR}/libdb.so
  66. }
  67. do_install() {
  68. oe_runmake includedir="${D}${includedir}" libdir="${D}${libdir}" bindir="${D}${bindir}" docdir="${D}${docdir}" install
  69. # The docs end up in /usr/docs - not right.
  70. if test -d "${D}/${prefix}/docs"
  71. then
  72. mkdir -p "${D}/${datadir}"
  73. test ! -d "${D}/${docdir}" || rmdir "${D}/${docdir}"
  74. mv "${D}/${prefix}/docs" "${D}/${docdir}"
  75. fi
  76. }