Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ PKG_CHECK_MODULES([DBUS], [dbus-1])

AC_CHECK_LIB(gthread-2.0, g_thread_init)

# Thunder COM-RPC plugin support
AC_ARG_ENABLE([thunder-plugin],
AS_HELP_STRING([--enable-thunder-plugin], [Enable Thunder COM-RPC plugin support (default: no)]),
[enable_thunder_plugin=$enableval],
[enable_thunder_plugin=no])

AM_CONDITIONAL([USE_THUNDER_PLUGIN], [test "x$enable_thunder_plugin" = "xyes"])

AS_IF([test "x$enable_thunder_plugin" = "xyes"],
[AC_DEFINE([USE_WPE_THUNDER_PLUGIN], [1], [Define to 1 to enable Thunder COM-RPC plugin support])
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a mismatch in the conditional compilation flag names. The configure.ac defines AC_DEFINE([USE_WPE_THUNDER_PLUGIN], [1], ...) at line 62, but the Makefile.am at line 33 checks for "USE_THUNDER_PLUGIN" (without the WPE_ prefix). This mismatch means the Makefile.am conditional will never be true when configured with --enable-thunder-plugin. The AM_CONDITIONAL at line 59 of configure.ac should use USE_WPE_THUNDER_PLUGIN to match the preprocessor define, or vice versa.

Suggested change
[AC_DEFINE([USE_WPE_THUNDER_PLUGIN], [1], [Define to 1 to enable Thunder COM-RPC plugin support])
[AC_DEFINE([USE_THUNDER_PLUGIN], [1], [Define to 1 to enable Thunder COM-RPC plugin support])

Copilot uses AI. Check for mistakes.
AC_MSG_NOTICE([Thunder COM-RPC plugin support enabled])],
[AC_MSG_NOTICE([Thunder COM-RPC plugin support disabled])])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_PID_T
AC_TYPE_SIZE_T
Expand Down
4 changes: 3 additions & 1 deletion cov_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ cd ${RDK_SOURCE_PATH}
export STANDALONE_BUILD_ENABLED=y
export DS_MGRS=$WORKDIR

export USE_WPE_THUNDER_PLUGIN=y
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cov_build.sh sets USE_WPE_THUNDER_PLUGIN=y and exports it as an environment variable. The Makefile at line 26 uses 'ifdef USE_WPE_THUNDER_PLUGIN' which checks if the variable is defined (not if it equals 'y'). While this should work (the variable will be defined as 'y'), it would be more conventional to either use 'ifeq ($(USE_WPE_THUNDER_PLUGIN),y)' or just export it as USE_WPE_THUNDER_PLUGIN=1. The current approach works but may be confusing.

Suggested change
export USE_WPE_THUNDER_PLUGIN=y
export USE_WPE_THUNDER_PLUGIN=1

Copilot uses AI. Check for mistakes.

find $WORKDIR -iname "*.o" -exec rm -v {} \;
find $WORKDIR -iname "*.so*" -exec rm -v {} \;

echo "##### Triggering make"
make CFLAGS+='-fPIC -DDSMGR_LOGGER_ENABLED=ON -DRDK_DSHAL_NAME=\"libdshal.so\" -I${DS_IF_PATH}/include -I${DS_HAL_PATH} -I${DS_MGRS}/stubs -I${IARMBUS_PATH}/core -I${IARMBUS_PATH}/core/include -I${IARM_MGRS}/sysmgr/include -I${DS_MGRS}/ds/include -I${DS_MGRS}/rpc/include -I${POWER_IF_PATH}/include/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I${IARM_MGRS}/mfr/include/ -I${IARM_MGRS}/mfr/common -I${DEEPSLEEP_IF_PATH}/include -I${IARM_MGRS}/hal/include -I${IARM_MGRS}/power -I${IARM_MGRS}/power/include' LDFLAGS="-L/usr/lib/x86_64-linux-gnu/ -L/usr/local/include -lglib-2.0 -lIARMBus -lWPEFrameworkPowerController -ldshal"
make CFLAGS+='-fPIC -DDSMGR_LOGGER_ENABLED=ON -DRDK_DSHAL_NAME=\"libdshal.so\" -I${DS_IF_PATH}/include -I${DS_HAL_PATH} -I${DS_MGRS}/stubs -I${IARMBUS_PATH}/core -I${IARMBUS_PATH}/core/include -I${IARM_MGRS}/sysmgr/include -I${DS_MGRS}/ds/include -I${DS_MGRS}/rpc/include -I${POWER_IF_PATH}/include/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I${IARM_MGRS}/mfr/include/ -I${IARM_MGRS}/mfr/common -I${DEEPSLEEP_IF_PATH}/include -I${IARM_MGRS}/hal/include -I${IARM_MGRS}/power -I${IARM_MGRS}/power/include' LDFLAGS="-L/usr/lib/x86_64-linux-gnu/ -L/usr/local/include -lglib-2.0 -lIARMBus -lWPEFrameworkPowerController -ldshal"
24 changes: 21 additions & 3 deletions rpc/cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,20 @@ CFLAGS += -g -fPIC -D_REENTRANT -Wall
LIBNAME := dshalcli
LIBNAMEFULL := lib$(LIBNAME).so
INSTALL := $(PWD)/install
OBJS := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
OBJS += $(patsubst %.c,%.o,$(wildcard *.c))

# Conditional compilation: Thunder vs IARM
ifdef USE_WPE_THUNDER_PLUGIN
# Thunder mode - use dsFPD-com.cpp, exclude dsFPD.c
OBJS := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
OBJS += $(patsubst %.c,%.o,$(filter-out dsFPD.c,$(wildcard *.c)))
else
# IARM mode - use dsFPD.c, exclude dsFPD-com.cpp
OBJS := $(patsubst %.cpp,%.o,$(filter-out dsFPD-com.cpp,$(wildcard *.cpp)))
OBJS += $(patsubst %.c,%.o,$(wildcard *.c))
endif
Comment on lines +26 to +34
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Makefile conditionally includes/excludes files based on USE_WPE_THUNDER_PLUGIN but doesn't add -DUSE_WPE_THUNDER_PLUGIN to CFLAGS. The dsFPD-com.cpp file guards all its code with #ifdef USE_WPE_THUNDER_PLUGIN, which won't be defined during compilation. Add '-DUSE_WPE_THUNDER_PLUGIN' to CFLAGS when this mode is enabled, similar to how LDLIBS is conditionally set.

Copilot uses AI. Check for mistakes.

#OBJS := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
#OBJS += $(patsubst %.c,%.o,$(wildcard *.c))
Comment on lines +36 to +37
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These commented-out lines should be removed. They represent the old implementation that has been replaced by the conditional logic above. Keeping dead code in comments reduces code clarity and maintainability.

Suggested change
#OBJS := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
#OBJS += $(patsubst %.c,%.o,$(wildcard *.c))

Copilot uses AI. Check for mistakes.
INCLUDE := -I$(PWD) \
-I$(PWD)/hal/include \
-I$(PWD)/rpc/include
Expand All @@ -31,13 +43,19 @@ INCLUDE += $(HAL_INCLUDE)

CFLAGS += $(INCLUDE)

# Conditional linking flags
ifdef USE_WPE_THUNDER_PLUGIN
LDLIBS := -lWPEFrameworkCore -lWPEFrameworkCOM
else
LDLIBS := -lIARMBus
endif

all: install
@echo "Build Finished...."

library: $(OBJS)
@echo "Building $(LIBNAMEFULL) ...."
$(CXX) $(OBJS) $(CFLAGS) -lIARMBus -shared -o $(LIBNAMEFULL)
$(CXX) $(OBJS) $(CFLAGS) $(LDLIBS) -shared -o $(LIBNAMEFULL)

%.o: %.cpp
@echo "Building $@ ...."
Expand Down
13 changes: 12 additions & 1 deletion rpc/cli/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,15 @@ INCLUDE_FILES = -I=$(includedir)/rdk/halif/ds-hal \
lib_LTLIBRARIES = libdshalcli.la
libdshalcli_la_CPPFLAGS = $(INCLUDE_FILES)
libdshalcli_la_CFLAGS = -g -fPIC -D_REENTRANT -Wall
libdshalcli_la_SOURCES = dsAudio.c dsclientlogger.c dsDisplay.c dsFPD.c dsHost.cpp dsVideoDevice.c dsVideoPort.c

# Conditional compilation for Thunder COM-RPC
if USE_THUNDER_PLUGIN
FPD_SOURCE = dsFPD-com.cpp
THUNDER_LIBS = -lWPEFrameworkCore -lWPEFrameworkCOM
else
FPD_SOURCE = dsFPD.c
THUNDER_LIBS =
endif
Comment on lines +33 to +39
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Makefile.am conditionally sets FPD_SOURCE and THUNDER_LIBS based on USE_THUNDER_PLUGIN, but there's no corresponding conditional compilation flag (like -DUSE_WPE_THUNDER_PLUGIN) being passed to CPPFLAGS. The dsFPD-com.cpp file uses #ifdef USE_WPE_THUNDER_PLUGIN to guard its content, but this preprocessor define won't be set by the build system. You need to add this define to the CPPFLAGS when USE_THUNDER_PLUGIN is enabled.

Copilot uses AI. Check for mistakes.

libdshalcli_la_SOURCES = dsAudio.c dsclientlogger.c dsDisplay.c $(FPD_SOURCE) dsHost.cpp dsVideoDevice.c dsVideoPort.c
libdshalcli_la_LIBADD = $(THUNDER_LIBS)
Loading
Loading