Cannot build on Fedora
K0HAX opened this issue · comments
I get the following error on Fedora.
mkdir -p build
gcc -std=c11 -Wall -g -Wstrict-overflow -D_XOPEN_SOURCE=700 -D_BSD_SOURCE -I/usr/include/libpurple -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libxml2 -I./headers/jabber -fPIC -c ./src/carbons.c -o ./build/carbons.o
In file included from /usr/include/limits.h:25:0,
from /usr/lib/gcc/x86_64-redhat-linux/6.3.1/include/limits.h:168,
from /usr/lib/gcc/x86_64-redhat-linux/6.3.1/include/syslimits.h:7,
from /usr/lib/gcc/x86_64-redhat-linux/6.3.1/include/limits.h:34,
from /usr/lib64/glib-2.0/include/glibconfig.h:11,
from /usr/include/glib-2.0/glib/gtypes.h:32,
from /usr/include/glib-2.0/glib/galloca.h:32,
from /usr/include/glib-2.0/glib.h:30,
from ./src/carbons.c:3:
/usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
^~~~~~~
gcc -fPIC -shared -std=c11 -Wall -g -Wstrict-overflow -D_XOPEN_SOURCE=700 -D_BSD_SOURCE -I/usr/include/libpurple -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libxml2 -I./headers/jabber ./build/carbons.o -o build/carbons.so -ldl -lm -lpurple -lglib-2.0 -lxml2 -lz -lm -ldl -L/usr/lib64/purple-2 -ljabber
/usr/bin/ld: cannot find -ljabber
collect2: error: ld returned 1 exit status
makefile:25: recipe for target 'build/carbons.so' failed
make: *** [build/carbons.so] Error 1
Sorry, I forgot I only pushed the change to the README to the debug branch.
For some reason on Fedora the lib is called libxmpp, not libjabber, so you have to replace -ljabber
with -lxmpp
.
I'll try to find out how to do that automatically with just make.
Edit: lsb_release -is
might work for detecting the distro, but I didn't quite understand if it actually works on all distros or the interface is different for each. I'll try it once I get to my Fedora machine.
Here's the output of lsb-release -is:
[menglehorn@menglehorn-lt carbons]$ lsb_release -is
Fedora
[menglehorn@menglehorn-lt carbons]$
My patch can be modified to use that instead of just looking for /etc/redhat-release. I have a suspicion that all RHEL based operating systems will have the same bug.