blob: 26065bbb0bb4d0e44e926b200209f146a90e9e31 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001# Version 5 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 DB5 can both be installed on the
10# same system at the same time if really necessary.
11SECTION = "libs"
12SUMMARY = "Berkeley Database v5"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050013HOMEPAGE = "http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050014LICENSE = "Sleepycat"
15VIRTUAL_NAME ?= "virtual/db"
16RCONFLICTS_${PN} = "db3"
17
Patrick Williamsc0f7c042017-02-23 20:41:17 -060018PR = "r1"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050019PE = "1"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060020
Patrick Williamsc124f4f2015-09-15 14:41:29 -050021SRC_URI = "http://download.oracle.com/berkeley-db/db-${PV}.tar.gz"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060022SRC_URI += "file://arm-thumb-mutex_db5.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050023 file://fix-parallel-build.patch \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050024 file://0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050025 "
26
27SRC_URI[md5sum] = "b99454564d5b4479750567031d66fe24"
28SRC_URI[sha256sum] = "e0a992d740709892e81f9d93f06daf305cf73fb81b545afe72478043172c3628"
29
Patrick Williamsc0f7c042017-02-23 20:41:17 -060030LIC_FILES_CHKSUM = "file://LICENSE;md5=ed1158e31437f4f87cdd4ab2b8613955"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031
Brad Bishop6e60e8b2018-02-01 10:27:11 -050032inherit autotools multilib_header
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033
34# Put virtual/db in any appropriate provider of a
35# relational database, use it as a dependency in
36# place of a specific db and use:
37#
38# PREFERRED_PROVIDER_virtual/db
39#
40# to select the correct db in the build (distro) .conf
41PROVIDES += "${VIRTUAL_NAME}"
42
Patrick Williamsc124f4f2015-09-15 14:41:29 -050043# The executables go in a separate package - typically there
44# is no need to install these unless doing real database
45# management on the system.
46inherit lib_package
47
48PACKAGES =+ "${PN}-cxx"
49FILES_${PN}-cxx = "${libdir}/*cxx*so"
50
51
52# The dev package has the .so link (as in db3) and the .a's -
53# it is therefore incompatible (cannot be installed at the
54# same time) as the db3 package
55# sort out the .so since they do version prior to the .so
56SOLIBS = "-5*.so"
57FILES_SOLIBSDEV = "${libdir}/libdb.so ${libdir}/libdb_cxx.so"
58
59#configuration - set in local.conf to override
60# All the --disable-* options replace --enable-smallbuild, which breaks a bunch of stuff (eg. postfix)
61DB5_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disable-replication --disable-verify --disable-compat185 --disable-sql"
62
63EXTRA_OECONF = "${DB5_CONFIG} --enable-shared --enable-cxx --with-sysroot"
64
65# Override the MUTEX setting here, the POSIX library is
66# the default - "POSIX/pthreads/library".
67# Don't ignore the nice SWP instruction on the ARM:
68# These enable the ARM assembler mutex code, this won't
69# work with thumb compilation...
70ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
71MUTEX = ""
72MUTEX_arm = "${ARM_MUTEX}"
73MUTEX_armeb = "${ARM_MUTEX}"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060074EXTRA_OECONF += "${MUTEX} STRIP=true"
75EXTRA_OEMAKE_append_class-target = " LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
76
77AUTOTOOLS_SCRIPT_PATH = "${S}/dist"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050078
79# Cancel the site stuff - it's set for db3 and destroys the
80# configure.
81CONFIG_SITE = ""
82do_configure() {
Patrick Williamsc0f7c042017-02-23 20:41:17 -060083 cd ${B}
84 gnu-configize --force ${AUTOTOOLS_SCRIPT_PATH}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050085 oe_runconf
86}
87
88do_compile_prepend() {
Patrick Williamsc0f7c042017-02-23 20:41:17 -060089 # Stop libtool adding RPATHs
90 sed -i -e 's|hardcode_into_libs=yes|hardcode_into_libs=no|' ${B}/libtool
Patrick Williamsc124f4f2015-09-15 14:41:29 -050091}
92
93do_install_append() {
94 mkdir -p ${D}/${includedir}/db51
95 mv ${D}/${includedir}/db.h ${D}/${includedir}/db51/.
96 mv ${D}/${includedir}/db_cxx.h ${D}/${includedir}/db51/.
97 ln -s db51/db.h ${D}/${includedir}/db.h
98 ln -s db51/db_cxx.h ${D}/${includedir}/db_cxx.h
99
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500100 oe_multilib_header db51/db.h
101
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500102 # The docs end up in /usr/docs - not right.
103 if test -d "${D}/${prefix}/docs"
104 then
105 mkdir -p "${D}/${datadir}"
106 test ! -d "${D}/${docdir}" || rm -rf "${D}/${docdir}"
107 mv "${D}/${prefix}/docs" "${D}/${docdir}"
108 fi
109
110 chown -R root:root ${D}
111}
112
113INSANE_SKIP_${PN} = "dev-so"
114INSANE_SKIP_${PN}-cxx = "dev-so"
115
116BBCLASSEXTEND = "native nativesdk"