diff --git a/cov_build.sh b/cov_build.sh index 727b18425..36db250b7 100644 --- a/cov_build.sh +++ b/cov_build.sh @@ -2,6 +2,32 @@ WORKDIR=`pwd` export ROOT=/usr export INSTALL_DIR=${ROOT}/local mkdir -p $INSTALL_DIR + +# Detect architecture for multi-platform Linux support (x86_64 and aarch64/arm64) +ARCH=$(uname -m) +case $ARCH in + x86_64) + ARCH_LIB_PATH="/usr/lib/x86_64-linux-gnu" + ARCH_LIB_PATH_ALT="/lib/x86_64-linux-gnu" + ;; + aarch64|arm64) + ARCH_LIB_PATH="/usr/lib/aarch64-linux-gnu" + ARCH_LIB_PATH_ALT="/lib/aarch64-linux-gnu" + ;; + *) + echo "Warning: Unsupported architecture $ARCH, defaulting to x86_64 paths" + ARCH_LIB_PATH="/usr/lib/x86_64-linux-gnu" + ARCH_LIB_PATH_ALT="/lib/x86_64-linux-gnu" + ;; +esac + +# Set up library path for both architectures (aligned with L2-tests.yml) +if [ -n "${LD_LIBRARY_PATH:-}" ]; then + export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${ARCH_LIB_PATH}:${ARCH_LIB_PATH_ALT}:/usr/local/lib" +else + export LD_LIBRARY_PATH="${ARCH_LIB_PATH}:${ARCH_LIB_PATH_ALT}:/usr/local/lib" +fi + apt-get update && apt-get install -y libsoup-3.0 #Build rfc @@ -79,7 +105,7 @@ make \ echo "Building IARMBus stubs" cd $WORKDIR cd ./src/unittest/stubs -g++ -fPIC -shared -o libIARMBus.so iarm_stubs.cpp -I$WORKDIR/src/hostif/parodusClient/pal -I$WORKDIR/src/unittest/stubs -I$WORKDIR/src/hostif/parodusClient/waldb -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I$WORKDIR/src/hostif/include -I$WORKDIR/src/hostif/profiles/DeviceInfo -I$WORKDIR/src/hostif/parodusClient/pal -fpermissive +g++ -fPIC -shared -o libIARMBus.so iarm_stubs.cpp -I$WORKDIR/src/hostif/parodusClient/pal -I$WORKDIR/src/unittest/stubs -I$WORKDIR/src/hostif/parodusClient/waldb -I/usr/include/glib-2.0 -I$ARCH_LIB_PATH/glib-2.0/include -I$WORKDIR/src/hostif/include -I$WORKDIR/src/hostif/profiles/DeviceInfo -I$WORKDIR/src/hostif/parodusClient/pal -fpermissive g++ -fPIC -shared -o libWPEFrameworkPowerController.so powerctrl_stubs.cpp -I$WORKDIR/src/unittest/stubs -fpermissive cp libIARMBus.so /usr/local/lib cp libIBus.h /usr/local/include @@ -94,8 +120,9 @@ sed -i '/PKG_CHECK_MODULES(\[PROCPS\], \[libproc >= 3.2.8\])/s/^/#/' ./configure autoreconf -i ./configure --enable-IPv6=yes + make AM_CXXFLAGS="-I$WORKDIR/src/unittest/stubs -I$WORKDIR/src/hostif/include -I/usr/include/cjson -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I$WORKDIR/src/hostif/handlers/include -I$WORKDIR/src/hostif/parodusClient/waldb -I$WORKDIR/src/hostif/profiles/DeviceInfo -I/usr/include/cjson -I$WORKDIR/src/hostif/profiles/Time -I$WORKDIR/src/hostif/profiles/Device -I/usr/include/libsoup-3.0 -I/usr/include/yajl -I$WORKDIR/src/hostif/profiles/STBService -I$WORKDIR/src/unittest/stubs/ds -I/usr/devicesettings/ds -I/usr/local/include -I$WORKDIR/src/hostif/profiles/IP -I$WORKDIR/src/hostif/profiles/Ethernet -I/usr/local/include/rbus -I$WORKDIR/src/hostif/parodusClient/pal -I/usr/rdk-halif-device_settings/include -I/usr/local/include/libparodus -I/usr/local/include -I/usr/rdkvhal-devicesettings-raspberrypi4 -I/usr/local/include/ -I/usr/include/yajl -I/usr/tinyxml2 -I/usr/devicesettings/ds -I/$WORKDIR/src/hostif/httpserver/include -I/usr/remote_debugger/src/ -DIPV6_SUPPORT" \ -AM_LDFLAGS="-L/usr/local/lib -lrbus -lsecure_wrapper -lcurl -lrfcapi -lrdkloggers -llibparodus -lglib-2.0 -lnanomsg -lIARMBus -lWPEFrameworkPowerController -lds -ldshalcli -ldshalsrv -lwrp-c -lwdmp-c -lprocps -ltrower-base64 -lcimplog -lsoup-3.0 -L/usr/lib/x86_64-linux-gnu -lyajl -L/usr/local/lib/x86_64-linux-gnu -ltinyxml2" CXXFLAGS="-fpermissive -DPARODUS_ENABLE -DUSE_REMOTE_DEBUGGER" \ +AM_LDFLAGS="-L/usr/local/lib -lrbus -lsecure_wrapper -lcurl -lrfcapi -lrdkloggers -llibparodus -lglib-2.0 -lnanomsg -lIARMBus -lWPEFrameworkPowerController -lds -ldshalcli -ldshalsrv -lwrp-c -lwdmp-c -lprocps -ltrower-base64 -lcimplog -lsoup-3.0 -L$ARCH_LIB_PATH -lyajl -L/usr/local/lib -ltinyxml2" CXXFLAGS="-fpermissive -DPARODUS_ENABLE -DUSE_REMOTE_DEBUGGER" \ install cd ./src/hostif/parodusClient/pal/mock-parodus/ diff --git a/src/hostif/parodusClient/pal/mock-parodus/Makefile.am b/src/hostif/parodusClient/pal/mock-parodus/Makefile.am index 1e789bd95..1227931fd 100644 --- a/src/hostif/parodusClient/pal/mock-parodus/Makefile.am +++ b/src/hostif/parodusClient/pal/mock-parodus/Makefile.am @@ -69,7 +69,9 @@ parodus_SOURCES = \ ../../../handlers/src/hostIf_XrdkCentralT2_ReqHandler.cpp \ ../../../handlers/src/hostIf_rbus_Dml_Provider.cpp -parodus_CPPFLAGS = -I../ -I../../../../unittest/stubs/ -I/usr/local/include/wrp-c/ -I../../waldb/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/local/include/wdmp-c/ -I/usr/local/include/rbus -I../../../include/ -I../../../../unittest/stubs/ -I../../../handlers/src/ -I/usr/local/include/cjson/ -I/usr/local/include/libparodus/ -I./ -I../../waldb/ -I../../../handlers/include/ -I../../../profiles/Time/ -I../../../profiles/DeviceInfo/ -I../../../profiles/Device -I../../../handlers/include/ -I../../../../unittest/stubs/ds -I../../../profiles/Ethernet/ -I../../../include/ -I../../../profiles/IP/ -I../../../profiles/STBService/ -I/usr/rdk-halif-device_settings/include/ -I/usr/rdkvhal-devicesettings-raspberrypi4/ -DUSE_REMOTE_DEBUGGER -I/usr/remote_debugger/src/ +MOCK_PARODUS_GLIB_CFLAGS = $(if $(strip $(GLIB_CFLAGS)),$(GLIB_CFLAGS),$(shell pkg-config --cflags glib-2.0 2>/dev/null)) + +parodus_CPPFLAGS = -I../ -I../../../../unittest/stubs/ -I/usr/local/include/wrp-c/ -I../../waldb/ $(MOCK_PARODUS_GLIB_CFLAGS) -I/usr/local/include/wdmp-c/ -I/usr/local/include/rbus -I../../../include/ -I../../../../unittest/stubs/ -I../../../handlers/src/ -I/usr/local/include/cjson/ -I/usr/local/include/libparodus/ -I./ -I../../waldb/ -I../../../handlers/include/ -I../../../profiles/Time/ -I../../../profiles/DeviceInfo/ -I../../../profiles/Device -I../../../handlers/include/ -I../../../../unittest/stubs/ds -I../../../profiles/Ethernet/ -I../../../include/ -I../../../profiles/IP/ -I../../../profiles/STBService/ -I/usr/rdk-halif-device_settings/include/ -I/usr/rdkvhal-devicesettings-raspberrypi4/ -DUSE_REMOTE_DEBUGGER -I/usr/remote_debugger/src/ parodus_LDADD = -llibparodus -lrdkloggers -lwdmp-c -lwrp-c -lmsgpackc -lprocps -ltrower-base64 -lcimplog -lsoup-3.0 -lcjson -lpthread -lglib-2.0 -lnanomsg -lrbus -lIARMBus -lyajl -lds -ldshalcli -ldbus-1 -lsecure_wrapper -lcurl -L../../waldb/.libs/ -l:libwaldb.a -L../../../profiles/Time/.libs/ -l:libhostIfTime.a -ltinyxml2 -lIARMBus diff --git a/src/hostif/parodusClient/pal/mock-parodus/mock_parodus_build.sh b/src/hostif/parodusClient/pal/mock-parodus/mock_parodus_build.sh index b018aec1d..202f5054a 100644 --- a/src/hostif/parodusClient/pal/mock-parodus/mock_parodus_build.sh +++ b/src/hostif/parodusClient/pal/mock-parodus/mock_parodus_build.sh @@ -1,3 +1,4 @@ sed -i '/getCurrentTime/,/^ *}/d' ../../../src/hostIf_utils.cpp + autoreconf --install && \ ./configure --prefix=/usr/local && make && make install