aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile20
-rw-r--r--bitlbee.h2
-rwxr-xr-xconfigure19
-rw-r--r--doc/example_plugin.c3
4 files changed, 40 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 295fe69e..57c76558 100644
--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,7 @@
# Program variables
objects = account.o bitlbee.o conf.o crypting.o help.o ini.o ipc.o irc.o irc_commands.o log.o nick.o query.o root_commands.o set.o storage.o storage_text.o unix.o url.o user.o util.o
+headers = account.h bitlbee.h commands.h conf.h config.h crypting.h help.h ini.h ipc.h irc.h log.h nick.h query.h set.h sock.h storage.h url.h user.h protocols/http_client.h protocols/md5.h protocols/nogaim.h protocols/proxy.h protocols/sha.h protocols/ssl_client.h
subdirs = protocols
# Expansion of variables
@@ -19,10 +20,10 @@ CFLAGS += -Wall
all: $(OUTFILE)
$(MAKE) -C doc
-uninstall: uninstall-bin uninstall-doc
+uninstall: uninstall-bin uninstall-doc uninstall-header uninstall-pc
@echo -e '\nmake uninstall does not remove files in '$(DESTDIR)$(ETCDIR)', you can use make uninstall-etc to do that.\n'
-install: install-bin install-doc
+install: install-bin install-doc install-header install-pc
@if ! [ -d $(DESTDIR)$(CONFIG) ]; then echo -e '\nThe configuration directory $(DESTDIR)$(CONFIG) does not exist yet, don'\''t forget to create it!'; fi
@if ! [ -e $(DESTDIR)$(ETCDIR)/bitlbee.conf ]; then echo -e '\nNo files are installed in '$(DESTDIR)$(ETCDIR)' by make install. Run make install-etc to do that.'; fi
@echo
@@ -56,6 +57,21 @@ install-bin:
uninstall-bin:
rm -f $(DESTDIR)$(BINDIR)/$(OUTFILE)
+install-header:
+ mkdir -p $(DESTDIR)$(INCLUDEDIR)
+ install -m 0644 $(headers) $(DESTDIR)$(INCLUDEDIR)
+
+uninstall-header:
+ rm -f $(foreach hdr,$(headers),$(DESTDIR)$(INCLUDEDIR)/$(hdr))
+ -rmdir $(DESTDIR)$(INCLUDEDIR)
+
+install-pc:
+ mkdir -p $(DESTDIR)$(PCDIR)
+ install -m 0644 bitlbee.pc $(DESTDIR)$(PCDIR)
+
+uninstall-pc:
+ rm -f $(DESTDIR)$(PCDIR)/bitlbee.pc
+
install-etc:
mkdir -p $(DESTDIR)$(ETCDIR)
install -m 0644 motd.txt $(DESTDIR)$(ETCDIR)/motd.txt
diff --git a/bitlbee.h b/bitlbee.h
index b43159d0..4efdddd9 100644
--- a/bitlbee.h
+++ b/bitlbee.h
@@ -101,7 +101,7 @@ extern char *CONF_FILE;
#include "irc.h"
#include "storage.h"
#include "set.h"
-#include "protocols/nogaim.h"
+#include "nogaim.h"
#include "commands.h"
#include "account.h"
#include "conf.h"
diff --git a/configure b/configure
index 751e5b32..ff79bb49 100755
--- a/configure
+++ b/configure
@@ -16,6 +16,8 @@ config='/var/lib/bitlbee/'
pidfile='/var/run/bitlbee.pid'
ipcsocket='/var/run/bitlbee'
plugindir='$prefix/lib/bitlbee'
+pcdir='$prefix/lib/pkgconfig'
+includedir='$prefix/include/bitlbee'
msn=1
jabber=1
@@ -79,6 +81,8 @@ config=`eval echo "$config/" | sed 's/\/\{1,\}/\//g'`
plugindir=`eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g'`
pidfile=`eval echo "$pidfile" | sed 's/\/\{1,\}/\//g'`
ipcsocket=`eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g'`
+includedir=`eval echo "$includedir" | sed 's/\/\{1,\}/\//g'`
+pcdir=`eval echo "$pcdir" | sed 's/\/\{1,\}/\//g'`
cat<<EOF>Makefile.settings
## BitlBee settings, generated by configure
@@ -90,6 +94,8 @@ DATADIR=$datadir
PLUGINDIR=$plugindir
CONFIG=$config
IPCSOCKET=$ipcsocket
+INCLUDEDIR=$includedir
+PCDIR=$pcdir
ARCH=$arch
CPU=$cpu
@@ -310,6 +316,19 @@ if [ -n "$BITLBEE_VERSION" ]; then
echo
fi
+cat <<EOF>bitlbee.pc
+prefix=$prefix
+includedir=$includedir
+
+Name: bitlbee
+Description: IRC to IM gateway
+Requires: glib-2.0
+Version: $BITLBEE_VERSION
+Libs:
+Cflags: -I\${includedir}
+
+EOF
+
protocols=''
protoobjs=''
diff --git a/doc/example_plugin.c b/doc/example_plugin.c
index 38d02260..a33907a8 100644
--- a/doc/example_plugin.c
+++ b/doc/example_plugin.c
@@ -2,10 +2,11 @@
* This is the most simple possible BitlBee plugin. To use, compile it as
* a shared library and place it in the plugin directory:
*
- * gcc -o example.so -shared example.c
+ * gcc -o example.so -shared example.c `pkg-config --cflags bitlbee`
* cp example.so /usr/local/lib/bitlbee
*/
#include <stdio.h>
+#include <bitlbee.h>
void init_plugin(void)
{