sm: fix rebuild errors
[pti/rtp.git] / meta-stx / recipes-core / stx-ha / sm-db.inc
1 #
2 ## Copyright (C) 2019 Wind River Systems, Inc.
3 #
4 #  Licensed under the Apache License, Version 2.0 (the "License");
5 #  you may not use this file except in compliance with the License.
6 #  You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #  Unless required by applicable law or agreed to in writing, software
11 #  distributed under the License is distributed on an "AS IS" BASIS,
12 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #  See the License for the specific language governing permissions and
14 #  limitations under the License.
15
16 PACKAGES += " sm-db"
17
18 DEPENDS =+ "sqlite3-native"
19
20 do_configure_append () {
21         cd ${S}/service-mgmt/sm-db
22         oe_runmake clean
23         rm -rf database/sm.db database/sm.hb.db
24
25
26 do_compile_append () {
27         cd ${S}/service-mgmt/sm-db
28         sqlite3 database/sm.db < database/create_sm_db.sql
29         sqlite3 database/sm.hb.db < database/create_sm_hb_db.sql
30
31         oe_runmake -e VER=0 VER_MJR=1 \
32                 INCLUDES="-I. -I${S}/service-mgmt/sm-common/src " \
33                 CCFLAGS="${CXXFLAGS} -fPIC" \
34                 LDFLAGS="${LDFLAGS} -shared -rdynamic -L${S}/service-mgmt/sm-common/src " \
35                 EXTRACCFLAGS="-D_TEST__AA__BB ${LDFLAGS} -L${S}/service-mgmt/sm-common/src "
36 }
37
38 do_install_append () {
39         cd ${S}/service-mgmt/sm-db
40         oe_runmake -e DEST_DIR=${D} BIN_DIR=${bindir} UNIT_DIR=${systemd_system_unitdir} \
41                         LIB_DIR=${libdir} INC_DIR=${includedir} VER=0 VER_MJR=1 install
42 }
43
44 FILES_sm-db = " \
45         ${bindir}/sm_db_build \
46         ${libdir}/libsm_db.so.1 \
47         ${libdir}/libsm_db.so.0 \
48         ${localstatedir}/lib/sm \
49         "