Skip to content

Commit d7ce92c

Browse files
committed
Port exec plugin to Windows.
1 parent 601f72b commit d7ce92c

File tree

4 files changed

+358
-34
lines changed

4 files changed

+358
-34
lines changed

Makefile.am

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,11 @@ pkglib_LTLIBRARIES += exec.la
920920
exec_la_SOURCES = src/exec.c
921921
exec_la_LDFLAGS = $(PLUGIN_LDFLAGS)
922922
exec_la_LIBADD = libcmds.la
923+
if BUILD_WIN32
924+
exec_la_LDFLAGS += -L.
925+
exec_la_LIBADD += -loleaut32 -lole32 -luuid libcollectd.la
926+
exec_la_DEPENDENCES = libuuid.dll
927+
endif
923928
endif
924929

925930
if BUILD_PLUGIN_ETHSTAT

build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ build_windows ()
8080
: ${LOCALSTATEDIR:="${INSTALL_DIR}"}
8181
: ${DATAROOTDIR:="${INSTALL_DIR}"}
8282
: ${DATADIR:="${INSTALL_DIR}"}
83-
83+
8484
echo "Installing collectd to ${INSTALL_DIR}."
8585
TOP_SRCDIR=$(pwd)
8686
MINGW_ROOT="/usr/x86_64-w64-mingw32/sys-root/mingw"
@@ -123,7 +123,7 @@ build_windows ()
123123

124124
cd ${TOP_SRCDIR}/_build_aux/_gnulib
125125
./configure --host="mingw32" LIBS="-lws2_32 -lpthread"
126-
make
126+
make
127127
cd gllib
128128

129129
# We have to rebuild libgnu.a to get the list of *.o files to build a dll later
@@ -154,6 +154,7 @@ build_windows ()
154154
--enable-logfile \
155155
--enable-disk \
156156
--enable-eventlog \
157+
--enable-exec \
157158
--enable-interface \
158159
--enable-match_regex \
159160
--enable-network \
@@ -185,4 +186,3 @@ if test "${OSTYPE}" = "cygwin"; then
185186
else
186187
build_linux
187188
fi
188-

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6249,6 +6249,7 @@ fi
62496249
if test "x$ac_system" = "xWindows"; then
62506250
plugin_disk="yes"
62516251
plugin_eventlog="yes"
6252+
plugin_exec="yes"
62526253
plugin_interface="yes"
62536254
plugin_wmi="yes"
62546255
fi
@@ -7131,4 +7132,3 @@ if test "x$dependency_warning" = "xyes"; then
71317132
fi
71327133
71337134
# vim: set fdm=marker sw=2 sts=2 ts=2 et :
7134-

0 commit comments

Comments
 (0)