Browse code

modules_k/purple: Updated to compile on Fedora 16

- Updated Makefile to use pkg-config so that it selects the correct
libraries/versions.
- Added missing include for glib.h to a few files. Not sure why this is
needed now when it wasn't before - but a quick search has shown it should
continue to work with older glib versions too.

Peter Dunkley authored on 06/05/2012 17:40:35
Showing 4 changed files
... ...
@@ -1,12 +1,20 @@
1 1
 include ../../Makefile.defs
2 2
 auto_gen=
3 3
 NAME=purple.so
4
-LIBS= 
4
+BUILDER = $(shell which pkg-config)
5 5
 
6
-DEFS+=-I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0 \
6
+ifeq ($(BUILDER),)
7
+	DEFS+= -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0 \
7 8
 		-I/usr/include/libxml2
8
-LIBS+=-lglib-2.0 -lpurple -lxml2
9
-
9
+	LIBS= -lglib-2.0 -lpurple -lxml2
10
+else
11
+	DEFS+= $(shell pkg-config --cflags glib-2.0)
12
+	LIBS=  $(shell pkg-config --libs glib-2.0)
13
+	DEFS+= $(shell pkg-config --cflags purple)
14
+	LIBS+= $(shell pkg-config --libs purple)
15
+	DEFS+= $(shell pkg-config --cflags libxml-2.0)
16
+	LIBS+= $(shell pkg-config --libs libxml-2.0)
17
+endif
10 18
 
11 19
 DEFS+=-DOPENSER_MOD_INTERFACE
12 20
 
... ...
@@ -20,6 +20,7 @@
20 20
 #ifndef _PURPLE_H
21 21
 #define _PURPLE_H
22 22
 
23
+#include <glib.h>
23 24
 #include <libpurple/status.h>
24 25
 
25 26
 enum purple_cmd_type {
... ...
@@ -21,6 +21,7 @@
21 21
 #define _PURPLEPIPE_H
22 22
 
23 23
 #include <stdlib.h>
24
+#include <glib.h>
24 25
 #include <libpurple/savedstatuses.h>
25 26
 #include <libpurple/status.h>
26 27
 
... ...
@@ -21,7 +21,7 @@
21 21
 #define _UTILS_H
22 22
 
23 23
 #include <stdlib.h>
24
-
24
+#include <glib.h>
25 25
 #include <libpurple/savedstatuses.h>
26 26
 #include <libpurple/status.h>
27 27