blob: 0b51a1d4403b3b564dd847682b9cea0848f89ab7 [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"
19
Patrick Williamsc124f4f2015-09-15 14:41:29 -050020SRC_URI = "http://download.oracle.com/berkeley-db/db-${PV}.tar.gz"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060021SRC_URI += "file://arm-thumb-mutex_db5.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050022 file://fix-parallel-build.patch \
23 "
24
25SRC_URI[md5sum] = "b99454564d5b4479750567031d66fe24"
26SRC_URI[sha256sum] = "e0a992d740709892e81f9d93f06daf305cf73fb81b545afe72478043172c3628"
27
Patrick Williamsc0f7c042017-02-23 20:41:17 -060028LIC_FILES_CHKSUM = "file://LICENSE;md5=ed1158e31437f4f87cdd4ab2b8613955"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050029
30inherit autotools
31
32# Put virtual/db in any appropriate provider of a
33# relational database, use it as a dependency in
34# place of a specific db and use:
35#
36# PREFERRED_PROVIDER_virtual/db
37#
38# to select the correct db in the build (distro) .conf
39PROVIDES += "${VIRTUAL_NAME}"
40
Patrick Williamsc124f4f2015-09-15 14:41:29 -050041# The executables go in a separate package - typically there
42# is no need to install these unless doing real database
43# management on the system.
44inherit lib_package
45
46PACKAGES =+ "${PN}-cxx"
47FILES_${PN}-cxx = "${libdir}/*cxx*so"
48
49
50# The dev package has the .so link (as in db3) and the .a's -
51# it is therefore incompatible (cannot be installed at the
52# same time) as the db3 package
53# sort out the .so since they do version prior to the .so
54SOLIBS = "-5*.so"
55FILES_SOLIBSDEV = "${libdir}/libdb.so ${libdir}/libdb_cxx.so"
56
57#configuration - set in local.conf to override
58# All the --disable-* options replace --enable-smallbuild, which breaks a bunch of stuff (eg. postfix)
59DB5_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disable-replication --disable-verify --disable-compat185 --disable-sql"
60
61EXTRA_OECONF = "${DB5_CONFIG} --enable-shared --enable-cxx --with-sysroot"
62
63# Override the MUTEX setting here, the POSIX library is
64# the default - "POSIX/pthreads/library".
65# Don't ignore the nice SWP instruction on the ARM:
66# These enable the ARM assembler mutex code, this won't
67# work with thumb compilation...
68ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
69MUTEX = ""
70MUTEX_arm = "${ARM_MUTEX}"
71MUTEX_armeb = "${ARM_MUTEX}"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060072EXTRA_OECONF += "${MUTEX} STRIP=true"
73EXTRA_OEMAKE_append_class-target = " LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
74
75AUTOTOOLS_SCRIPT_PATH = "${S}/dist"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050076
77# Cancel the site stuff - it's set for db3 and destroys the
78# configure.
79CONFIG_SITE = ""
80do_configure() {
Patrick Williamsc0f7c042017-02-23 20:41:17 -060081 cd ${B}
82 gnu-configize --force ${AUTOTOOLS_SCRIPT_PATH}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050083 oe_runconf
84}
85
86do_compile_prepend() {
Patrick Williamsc0f7c042017-02-23 20:41:17 -060087 # Stop libtool adding RPATHs
88 sed -i -e 's|hardcode_into_libs=yes|hardcode_into_libs=no|' ${B}/libtool
Patrick Williamsc124f4f2015-09-15 14:41:29 -050089}
90
91do_install_append() {
92 mkdir -p ${D}/${includedir}/db51
93 mv ${D}/${includedir}/db.h ${D}/${includedir}/db51/.
94 mv ${D}/${includedir}/db_cxx.h ${D}/${includedir}/db51/.
95 ln -s db51/db.h ${D}/${includedir}/db.h
96 ln -s db51/db_cxx.h ${D}/${includedir}/db_cxx.h
97
98 # The docs end up in /usr/docs - not right.
99 if test -d "${D}/${prefix}/docs"
100 then
101 mkdir -p "${D}/${datadir}"
102 test ! -d "${D}/${docdir}" || rm -rf "${D}/${docdir}"
103 mv "${D}/${prefix}/docs" "${D}/${docdir}"
104 fi
105
106 chown -R root:root ${D}
107}
108
109INSANE_SKIP_${PN} = "dev-so"
110INSANE_SKIP_${PN}-cxx = "dev-so"
111
112BBCLASSEXTEND = "native nativesdk"