aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-05-26 01:20:54 +0200
committerJelmer Vernooij <jelmer@samba.org>2006-05-26 01:20:54 +0200
commit574af7e01a0cc738b4bbe7e903572943a85b9691 (patch)
tree5cb2e5c58d7b0c8e77c4768d93063a14355661dc
parent5d9b79251c54a73a8a79b2b2aa185e8516d0b402 (diff)
Require GLib 2
-rwxr-xr-xconfigure35
-rw-r--r--doc/README2
-rw-r--r--irc.c4
-rw-r--r--util.c26
4 files changed, 15 insertions, 52 deletions
diff --git a/configure b/configure
index 63047303..ac7ff3b6 100755
--- a/configure
+++ b/configure
@@ -162,38 +162,16 @@ if [ -z "$PKG_CONFIG" ]; then
PKG_CONFIG=pkg-config
fi
-GLIB=0
-
if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG glib-2.0; then
cat<<EOF>>Makefile.settings
EFLAGS+=`$PKG_CONFIG --libs glib-2.0 gmodule-2.0`
CFLAGS+=`$PKG_CONFIG --cflags glib-2.0 gmodule-2.0`
EOF
- echo '#define GLIB2' >> config.h
- GLIB=2
-elif type glib-config > /dev/null 2> /dev/null; then
- cat<<EOF>>Makefile.settings
-EFLAGS+=`glib-config --libs`
-CFLAGS+=`glib-config --cflags`
-EOF
- echo '#define GLIB1' >> config.h
- GLIB=1
else
- echo 'Cannot find glib development libraries, aborting. (Install libglib-dev?)'
+ echo 'Cannot find glib2 development libraries, aborting. (Install libglib2-dev?)'
exit 1;
fi
-if [ GLIB = 1 -o -r /usr/include/iconv.h ]; then
- :;
-elif [ -r /usr/local/include/iconv.h ]; then
- echo CFLAGS+=-I/usr/local/include >> Makefile.settings;
-else
- echo
- echo 'Warning: Could not find iconv.h, you might have to install it and/or modify'
- echo 'Makefile.settings to tell where this file is.';
-fi
-
-
detect_gnutls()
{
if libgnutls-config --version > /dev/null 2> /dev/null; then
@@ -389,18 +367,15 @@ Linux )
GNU/* )
;;
*BSD )
- echo 'EFLAGS+=-liconv' >> Makefile.settings;
-;;
-SunOS )
- echo 'EFLAGS+=-lresolv -lnsl -lsocket' >> Makefile.settings
- echo 'STRIP=\# skip strip' >> Makefile.settings
- echo 'EFLAGS+=-liconv' >> Makefile.settings;
;;
Darwin )
- echo 'EFLAGS+=-liconv' >> Makefile.settings;
;;
IRIX )
;;
+SunOS )
+ echo 'EFLAGS+=-lresolv -lnsl -lsocket' >> Makefile.settings
+ echo 'STRIP=\# skip strip' >> Makefile.settings
+;;
CYGWIN* )
echo 'Cygwin is not officially supported.'
;;
diff --git a/doc/README b/doc/README
index 12c21c51..c82c9aeb 100644
--- a/doc/README
+++ b/doc/README
@@ -46,7 +46,7 @@ DEPENDENCIES
============
BitlBee's only real dependency is GLib. This is available on virtually every
-platform. Any recent version of GLib (including 1.x versions) will work.
+platform. Any recent version of GLib (2.0 or higher) will work.
These days, MSN Messenger clients have to connect to the MS Passport servers
through HTTPS. BitlBee can use several SSL libraries for this: GnuTLS, NSS
diff --git a/irc.c b/irc.c
index fb85de62..db9f7aad 100644
--- a/irc.c
+++ b/irc.c
@@ -54,13 +54,9 @@ irc_t *irc_new( int fd )
irc->fd = fd;
irc->io_channel = g_io_channel_unix_new( fd );
-#ifdef GLIB2
g_io_channel_set_encoding (irc->io_channel, NULL, NULL);
g_io_channel_set_buffered (irc->io_channel, FALSE);
g_io_channel_set_flags( irc->io_channel, G_IO_FLAG_NONBLOCK, NULL );
-#else
- fcntl( irc->fd, F_SETFL, O_NONBLOCK);
-#endif
irc->r_watch_source_id = g_io_add_watch( irc->io_channel, G_IO_IN | G_IO_ERR | G_IO_HUP, bitlbee_io_current_client_read, irc );
irc->status = USTATUS_OFFLINE;
diff --git a/util.c b/util.c
index 8f8ec7b3..dfa0906b 100644
--- a/util.c
+++ b/util.c
@@ -38,14 +38,6 @@
#include <ctype.h>
#include <glib.h>
#include <time.h>
-#ifdef GLIB2
-#define iconv_t GIConv
-#define iconv_open g_iconv_open
-#define iconv_close g_iconv_close
-#define iconv g_iconv
-#else
-#include <iconv.h>
-#endif
void strip_linefeed(gchar *text)
{
@@ -464,21 +456,21 @@ char *ipv6_unwrap( char *src )
*/
signed int do_iconv( char *from_cs, char *to_cs, char *src, char *dst, size_t size, size_t maxbuf )
{
- iconv_t cd;
+ GIConv cd;
size_t res;
size_t inbytesleft, outbytesleft;
char *inbuf = src;
char *outbuf = dst;
- cd = iconv_open( to_cs, from_cs );
- if( cd == (iconv_t) -1 )
+ cd = g_iconv_open( to_cs, from_cs );
+ if( cd == (GIConv) -1 )
return( -1 );
inbytesleft = size ? size : strlen( src );
outbytesleft = maxbuf - 1;
- res = iconv( cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft );
+ res = g_iconv( cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft );
*outbuf = '\0';
- iconv_close( cd );
+ g_iconv_close( cd );
if( res == (size_t) -1 )
return( -1 );
@@ -488,15 +480,15 @@ signed int do_iconv( char *from_cs, char *to_cs, char *src, char *dst, size_t si
char *set_eval_charset( irc_t *irc, set_t *set, char *value )
{
- iconv_t cd;
+ GIConv cd;
if ( g_strncasecmp( value, "none", 4 ) == 0 )
return( value );
- cd = iconv_open( "UTF-8", value );
- if( cd == (iconv_t) -1 )
+ cd = g_iconv_open( "UTF-8", value );
+ if( cd == (GIConv) -1 )
return( NULL );
- iconv_close( cd );
+ g_iconv_close( cd );
return( value );
}