Building without libsignal-protocol-c from submodules
Cleberw3b opened this issue · 6 comments
I was not able to make
the project.
cc -fPIC -I./lib/libsignal-protocol-c/src -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -std=c11 -g -Wall -Wextra -Wpedantic -Wstrict-overflow -fno-strict-aliasing -funsigned-char -fno-builtin-memset -D_XOPEN_SOURCE=700 -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE -c src/axc.c -o build/axc.o
src/axc.c:13:29: fatal error: signal_protocol.h: No such file or directory
compilation terminated.
Makefile:59: recipe for target 'build/axc.o' failed
make: *** [build/axc.o] Error 1
I see that libsignal-protocal is referenced as submodule, my project has it as dependency and it is built separated.
Is there anyway to just build your files without need to reference the libsignal-protocol in your Makefile?
Could you provide a simple step by step if possible?
Thx
Line 46 in the Makefile looks like the following:
LDFLAGS += -pthread -ldl $(PKGCFG_L) $(AX_PATH) -lm
(Notice the +=
!)
make inherits environment variables as variables inside the makefile, so this should mean that you can provide your additional linker flag in the LDFLAGS
environment variable, and make will just add the rest to it.
Similarly, you should be able to provide the location of the libsignal-protocol-c dev headers using the CFLAGS
variable.
Yep, setting CFLAGS=$(pkg-config --cflags signal-protocol-c)
and LDFLAGS=$(pkg-config --libs signal-protocol-c)
works.
But there's another problem: when trying to build without the in-tree libsignal-protocol-c library, the Makefile fails because lib/libsignal-protocol-c
doesn't exists. Also, the cmake
build-dependency is only pulled in by Makefile commands related to that.
Would you mind adding a compile-time option to not build the in-tree libsignal-protocol-c library?
But there's another problem: when trying to build without the in-tree libsignal-protocol-c library, the Makefile fails because lib/libsignal-protocol-c doesn't exists. Also, the cmake build-dependency is only pulled in by Makefile commands related to that.
Would you mind adding a compile-time option to not build the in-tree libsignal-protocol-c library?
If I'm correct, then the only line that needs to be changed is target test
which includes $(AX_PATH)
per default:
test: $(AX_PATH) test_store test_client
Sorry, I kinda lost track of this for some reason.
Would you mind adding a compile-time option to not build the in-tree libsignal-protocol-c library?
No, of course not.
For some reason the test
target is the only one where it's referenced, so I don't think it would be wrong to just remove it. As you said, the rest should work, but I'm going to try it first before pushin anything. If you have tried it already and have a working Makefile, you can open a pull request too, if you'd like.
Some docs on how to do this probably wouldn't hurt, too.
It will be nice.