-
Notifications
You must be signed in to change notification settings - Fork 896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
configure: fix usage of libgpg-error with --with-local-libgcrypt
#1472
Conversation
Right now, using external libgcrypt, nDPI is not linked to libgpg-error because configure script never checks for it. ``` ivan@ivan-Latitude-E6540:~/svnrepos/nDPI(dev)$ CC=gcc-11 CXX=g++-11 CFLAGS="-O3 -g -Werror" ./autogen.sh --enable-debug-messages --with-pcre --with-local-libgcrypt && make -s -j [...] checking for numa_available in -lnuma... yes checking for pcap_open_live in -lpcap... yes checking for pthread_setaffinity_np in -lpthread... yes checking for gcry_cipher_checktag in -lgcrypt... yes <------- missing check for libgpg-error checking for pcre_compile in -lpcre... yes checking that generated files are newer than configure... done [...] ivan@ivan-Latitude-E6540:~/svnrepos/nDPI(dev)$ grep HAVE_LIBGPG_ERROR src/include/ndpi_config.h /* #undef HAVE_LIBGPG_ERROR */ ``` Make both libgcrypt and libgpg-error mandatory if `--with-local-libgcrypt` is used. Technically speaking, libgpg-error might be optional, because it is used only for debug messages. However having both libraries mandatory slightly simplified the logic. In most environments, libgpg-error is a dependency of libgcrypt anyway, so having both libraries should be the standard case.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@lnslbrty , could you take a look, please? The patch works, but I don't know if that is the best way to fix the issue. |
Your PR will work fine. |
That's definitely the case here: libgpg-error is used only if I could rework QUIC logs to get rid of But, please note that right now libgpg-error is linked from ndpiReader anyway, probably because on my environment (Ubuntu) libgpg-error is a dependency of libgcrypt, i.e. ndpiReader links a library without using any symbol of it
My original message is a bit confusing, sorry. The issue is not that libgpg-error is not linked; the issue is that libgpg-error functions are not used because |
Ok. |
Right now, using external libgcrypt, nDPI is not linked to libgpg-error
because configure script never checks for it.
Make both libgcrypt and libgpg-error mandatory if
--with-local-libgcrypt
is used.Technically speaking, libgpg-error might be optional, because it is used
only for debug messages. However having both libraries mandatory
slightly simplified the logic.
In most environments, libgpg-error is a dependency of libgcrypt anyway,
so having both libraries should be the standard case.