[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
|
Re: [mosquitto-dev] 2.1.0rc1 available for testing
|
"c@xxxxxxxx" <c@xxxxxxxx> writes:
> - I couldn=E2=80=99t get apps/mosquitto_ctrl to compile because Xcode =
> has readline 0x0402 installed
> (urrent readline version is 0x0803!) and overriding EDITLINE_DIR =
> wasn=E2=80=99t successful (I am not a cmake expert):
> ```
> [ 26%] Building C object =
> apps/mosquitto_ctrl/CMakeFiles/ctrl_shell.dir/ctrl_shell.c.o
> In file included from =
> /Users/ckrey/mosquitto/apps/mosquitto_ctrl/ctrl_shell.c:40:
> /Users/ckrey/mosquitto/apps/mosquitto_ctrl/ctrl_shell_internal.h:38:2: =
> error: unknown type name 'rl_vcpfunc_t'
> 38 | rl_vcpfunc_t *line_callback;
> | ^
> ```
editline is a library that first appeared in 4.4BSD, written by
now-NetBSD-contributor Christos Zoulas. It has similar functionality to
readline and can now (mostly) emulate readline. GNU Readline is GPL3,
while editline is under a BSD license. The NetBSD version of editline
is available as portable code:
https://www.thrysoee.dk/editline/
and this is wrapped in pkgsrc as devel/editline. (Also, pkgsrc has GNU
readline 8.3.)
Reading mosquitto sources, while editline is included, the code is
written to the readline API.
While you could link with readline, that would make your binaries
subject to both EPL and GPL. I don't know if they are compatibl, and if
you are intending to distribute binaries.
I declared editline to be a dependency, and that brought in a pc file,
but cmake failed to find it. Reading cmake/Findedit.cmake, it doesn't
try to use pkg-config, and that seems suboptimal and perhaps a bug.
I then added EDITLINE_DIR=/usr, but still not found
With EDITLINE_INCLUDE_DIR=/usr/include, it was found.
But then, mosquitto_ctrl.c failed to build because
24 | #include <editline/readline.h>
On my system
$ find /usr/include -name \*readline\*
/usr/include/readline
/usr/include/readline/readline.h
$ find /usr/include -name \*edit\*
/usr/include/histedit.h
The NetBSD editline man page documents histedit.h for the editline
functions.
Changing <editline/readline.h> to <readline/readline.h> resolves this
(and gets me to a missing-stdarg).
For now, I'd suggest you add WITH_EDITLINE=no.
> - linking test/lib/c and test/lib/cpp with ssl needs adaptation of the =
> CMakelist.txt files
> ```
> - target_link_libraries(${BINARY} PRIVATE common-options libmosquitto =
> ssl crypto)
> + target_link_libraries(${BINARY} PRIVATE common-options libmosquitto =
> OpenSSL::SSL)
> ```
Do you think that is a correct portable fix? That looks like perl :-)
but I'm guessing it's the SSL libs set from the OpenSSL cmake object.
> - gmock: I ran into the same problem, but have no idea how to fix this
> e.g.:
> ```
> [ 0%] Building CXX object =
> test/mock/CMakeFiles/editline_mock.dir/editline_mock.cpp.o
> In file included from =
> /Users/ckrey/mosquitto/test/mock/editline_mock.cpp:1:
> /Users/ckrey/mosquitto/test/mock/editline_mock.hpp:3:10: fatal error: =
> 'gmock/gmock.h' file not found
> 3 | #include <gmock/gmock.h>
> | ^~~~~~~~~~~~~~~
> 1 error generated.
> ```
I don't understand how you are building and where your prereqs come from.
If you were using pkgsrc, you'd have /opt/pkg/include/gmock/gmock.h and
you would somehow instruct cmake that /opt/pkg was a place that things
could be found. CMakeFile uses
/usr/pkg/share/cmake-4.2/Modules/FindGTest.cmake
and I don't know why that isn't adding an -I to your installed headers.
How did you install GTest?