sm00th / bitlbee-discord

Bitlbee plugin for Discord (http://discordapp.com)
GNU General Public License v2.0
291 stars 27 forks source link

Using CFLAGS and LDFLAGS on command line to find bitlbee includes and libs #221

Closed ikwyl6 closed 3 years ago

ikwyl6 commented 3 years ago

On arch Linux alarm 4.4.238-1-ARCH #1 PREEMPT Sat Oct 3 05:39:18 UTC 2020 armv5tel GNU/Linux I've installed bitlbee using pacman with version:

$ bitlbee -V
BitlBee 3.6
API version 030600
Configure args: --prefix=/usr --etcdir=/etc/bitlbee --sbindir=/usr/bin --pidfile=/run/bitlbee/bitlbee.pid --ipcsocket=/run/bitlbee/bitlbee.sock --systemdsystemunitdir=/usr/lib/systemd/system --ssl=gnutls --otr=plugin

I cannot find a bitlbee-dev pkg under pacman but there are include and libs under these directories from the bitlbee installation:

$ ls /usr/include/bitlbee/
account.h  base64.h   canohost.h  config.h  ft.h      http_client.h  irc.h        log.h   nick.h    oauth2.h  query.h  sock.h        url.h
arc.h      bee.h      commands.h  dcc.h     ftutil.h  ini.h          json.h       md5.h   nogaim.h  otr.h     set.h    ssl_client.h  xmltree.h
auth.h     bitlbee.h  conf.h      events.h  help.h    ipc.h          json_util.h  misc.h  oauth.h   proxy.h   sha1.h   storage.h
$ ls /usr/lib/bitlbee/
otr.so

when I run ./configure in the bitlbee-discord directory, the script ends with:

./configure: line 12538: syntax error near unexpected token `BITLBEE,'                                                                                                                     
./configure: line 12538: `PKG_CHECK_MODULES(BITLBEE, bitlbee >= 3.5)'

which tells me it can't find the bitlbee header files (.h) or the libraries. When I pass:

$ CLFAGS=-I/usr/include/bitlbee/ LDFLAGS=-I/usr/lib/bitlbee/ ./configure I get the same error above (line 12538).

Is there a way to pass these directories to the configure script so it finds these headers and libraries?

Alcaro commented 3 years ago

Does it work better if you pass CFLAGS= instead of CLFAGS=?

sm00th commented 3 years ago

./configure shouldn't have syntax errors so maybe it got corrupted or wasn't built properly in the first place. Try rebuilding it with ./autogen.sh and make sure there are no errors on that step.

ikwyl6 commented 3 years ago

@Alcaro oops.. I thought you were joking but you weren't. my bad! And I did have a typo in there like you pointed out but I did change it on command line so it says CFLAGS (doh!) and it still gives the same error (the two lines that reference line 12538). @sm00th I get the same error if I use your git repo and run the steps or the arch linux AUR PKGBUILD so I'm at a loss. I did an ./autogen.sh and this is output (no errors): https://pastebin.com/ALpfjxWK I re-ran ./configure after re-running autogen.sh and I get the same output (line 12538): https://pastebin.com/gLBR2A1V and running it with the CFLAGS and LDFLAGS gives same result. I will try downloading the v3.6 version of bitlbee and compiling the libraries from that and linking to that directory to see if it works.. unless there are some other ideas...

sm00th commented 3 years ago

Make sure you have pkgconfig installed and that it installed the following file: /usr/share/aclocal/pkg.m4. And after that is sorted re-do autogen (or start the aur-build from scratch).

ikwyl6 commented 3 years ago

looks like I needed pkg-config installed. Re-ran ./autogen.sh, ./configure and make, sudo make install and it compiled fine. thanks for the help!

ikwyl6 commented 1 month ago

just for future.. I don't think bitlbee is still offered by pacman so I had to compile it myself and then had to do the following for bitlbee-discord to get it to compile:

BITLBEE_CFLAGS=-I/home/alarm/dev/bitlbee-aur/bitlbee-3.6 -I/home/alarm/dev/bitlbee-aur/bitlbee-3.6/protocols -I/home/alarm/dev/bitlbee-aur/bitlbee-3.6/lib BITLBEE_LIBS=-L/home/alarm/dev/bitlbee-aur/bitlbee-3.6 ./configure --with-plugindir=/var/lib/bitlbee

Had to use absolute directories for BITLBEE_CFLAGS and BITLBEE_LIBS and not relative and where --with-plugindir was the plugindir that I had used for bitlbee compile time.