Changeset f5d1b31


Ignore:
Timestamp:
2008-06-29T23:41:39Z (16 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
dfd442b
Parents:
cd63d58 (diff), 913545e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merging changes from Jelmer: It's now possible to cross-compile a Windows
version of BitlBee from Linux. No working SSL support yet though!

Files:
3 added
15 edited

Legend:

Unmodified
Added
Removed
  • .bzrignore

    rcd63d58 rf5d1b31  
    1919coverage
    2020bitlbee.info
     21bitlbee.exe
  • Makefile

    rcd63d58 rf5d1b31  
    1010
    1111# Program variables
    12 objects = account.o bitlbee.o conf.o crypting.o help.o ipc.o irc.o irc_commands.o log.o nick.o query.o root_commands.o set.o storage.o $(STORAGE_OBJS) unix.o user.o
     12objects = account.o bitlbee.o crypting.o help.o ipc.o irc.o irc_commands.o nick.o query.o root_commands.o set.o storage.o $(STORAGE_OBJS) user.o
    1313headers = account.h bitlbee.h commands.h conf.h config.h crypting.h help.h ipc.h irc.h log.h nick.h query.h set.h sock.h storage.h user.h lib/events.h lib/http_client.h lib/ini.h lib/md5.h lib/misc.h lib/proxy.h lib/sha1.h lib/ssl_client.h lib/url.h protocols/nogaim.h
    1414subdirs = lib protocols
     15
     16ifeq ($(TARGET),i586-mingw32msvc)
     17objects += win32.o
     18LFLAGS+=-lws2_32
     19EFLAGS+=-lsecur32
     20OUTFILE=bitlbee.exe
     21else
     22objects += unix.o conf.o log.o
     23OUTFILE=bitlbee
     24endif
    1525
    1626# Expansion of variables
  • bitlbee.c

    rcd63d58 rf5d1b31  
    123123                ipc_master_listen_socket();
    124124       
     125#ifndef _WIN32
    125126        if( ( fp = fopen( global.conf->pidfile, "w" ) ) )
    126127        {
     
    132133                log_message( LOGLVL_WARNING, "Warning: Couldn't write PID to `%s'", global.conf->pidfile );
    133134        }
     135#endif
    134136       
    135137        return( 0 );
     
    140142        if( !irc_new( 0 ) )
    141143                return( 1 );
    142        
    143         log_link( LOGLVL_ERROR, LOGOUTPUT_IRC );
    144         log_link( LOGLVL_WARNING, LOGOUTPUT_IRC );
    145144       
    146145        return( 0 );
     
    254253        struct sockaddr_in conn_info;
    255254        int new_socket = accept( global.listen_socket, (struct sockaddr *) &conn_info, &size );
    256         pid_t client_pid = 0;
    257255       
    258256        if( new_socket == -1 )
     
    262260        }
    263261       
     262#ifndef _WIN32
    264263        if( global.conf->runmode == RUNMODE_FORKDAEMON )
    265264        {
     265                pid_t client_pid = 0;
    266266                int fds[2];
    267267               
     
    320320        }
    321321        else
     322#endif
    322323        {
    323324                log_message( LOGLVL_INFO, "Creating new connection with fd %d.", new_socket );
  • bitlbee.h

    rcd63d58 rf5d1b31  
    2929#define _GNU_SOURCE /* Stupid GNU :-P */
    3030
     31/* Depend on Windows 2000 for now since we need getaddrinfo() */
     32#define _WIN32_WINNT 0x0501
     33
    3134#define PACKAGE "BitlBee"
    3235#define BITLBEE_VERSION "1.2.1"
     
    4851#include <stdio.h>
    4952#include <ctype.h>
     53#include <errno.h>
     54
    5055#ifndef _WIN32
    5156#include <syslog.h>
    52 #include <errno.h>
    5357#endif
    5458
  • configure

    rcd63d58 rf5d1b31  
    2020ipcsocket='/var/run/bitlbee.sock'
    2121pcdir='$prefix/lib/pkgconfig'
     22systemlibdirs="/lib /usr/lib /usr/local/lib"
    2223
    2324msn=1
     
    109110PCDIR=$pcdir
    110111
     112TARGET=$target
    111113ARCH=$arch
    112114CPU=$cpu
    113 OUTFILE=bitlbee
    114115
    115116DESTDIR=
     
    134135EOF
    135136
     137
     138
    136139if [ -n "$target" ]; then
    137         PKG_CONFIG_PATH=/usr/$target/lib/pkgconfig
     140        PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig
     141        export PKG_CONFIG_LIBDIR
    138142        PATH=/usr/$target/bin:$PATH
    139143        CC=$target-cc
    140144        LD=$target-ld
    141 fi
     145        systemlibdirs="/usr/$target/lib"
     146fi
     147
    142148
    143149if [ "$debug" = "1" ]; then
     
    285291elif [ "$ssl" = "nss" ]; then
    286292        detect_nss
     293elif [ "$ssl" = "sspi" ]; then
     294        echo
    287295elif [ "$ssl" = "openssl" ]; then
    288296        echo
     
    341349echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings
    342350
    343 for i in /lib /usr/lib /usr/local/lib; do
     351for i in $systemlibdirs; do
    344352        if [ -f $i/libresolv.a ]; then
    345353                echo '#define HAVE_RESOLV_A' >> config.h
     
    501509        echo 'Cygwin is not officially supported.'
    502510;;
     511Windows )
     512;;
    503513* )
    504514        echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV.'
  • ipc.c

    rcd63d58 rf5d1b31  
    460460}
    461461
     462#ifndef _WIN32
    462463char *ipc_master_save_state()
    463464{
     
    520521}
    521522
    522 #ifndef _WIN32
    523523int ipc_master_listen_socket()
    524524{
     
    557557}
    558558#else
     559int ipc_master_listen_socket()
     560{
    559561        /* FIXME: Open named pipe \\.\BITLBEE */
     562        return 0;
     563}
    560564#endif
    561565
  • irc.c

    rcd63d58 rf5d1b31  
    2626#define BITLBEE_CORE
    2727#include "bitlbee.h"
     28#include "sock.h"
    2829#include "crypting.h"
    2930#include "ipc.h"
  • lib/misc.c

    rcd63d58 rf5d1b31  
    373373void random_bytes( unsigned char *buf, int count )
    374374{
     375#ifndef _WIN32
    375376        static int use_dev = -1;
    376377       
     
    422423       
    423424        if( !use_dev )
     425#endif
    424426        {
    425427                int i;
  • lib/ssl_bogus.c

    rcd63d58 rf5d1b31  
    6161        return GAIM_INPUT_READ;
    6262}
     63
     64int ssl_pending( void *conn )
     65{
     66        return 0;
     67}
  • protocols/yahoo/libyahoo2.c

    rcd63d58 rf5d1b31  
    6969#ifdef __MINGW32__
    7070# include <winsock2.h>
    71 # define write(a,b,c) send(a,b,c,0)
    72 # define read(a,b,c)  recv(a,b,c,0)
    7371#endif
    7472
  • protocols/yahoo/yahoo_httplib.c

    rcd63d58 rf5d1b31  
    5151#ifdef __MINGW32__
    5252# include <winsock2.h>
    53 # define write(a,b,c) send(a,b,c,0)
    54 # define read(a,b,c)  recv(a,b,c,0)
    5553# define snprintf _snprintf
    5654#endif
  • sock.h

    rcd63d58 rf5d1b31  
    1616#else
    1717# include <winsock2.h>
    18 # ifndef _MSC_VER
    19 #  include <ws2tcpip.h>
    20 # endif
     18# include <ws2tcpip.h>
    2119# if !defined(BITLBEE_CORE) && defined(_MSC_VER)
    2220#   pragma comment(lib,"bitlbee.lib")
    2321# endif
    2422# include <io.h>
    25 # define read(a,b,c) recv(a,b,c,0)
    26 # define write(a,b,c) send(a,b,c,0)
    27 # define umask _umask
    28 # define mode_t int
    2923# define sock_make_nonblocking(fd) { int non_block = 1; ioctlsocket(fd, FIONBIO, &non_block); }
    3024# define sock_make_blocking(fd) { int non_block = 0; ioctlsocket(fd, FIONBIO, &non_block); }
  • storage_text.c

    rcd63d58 rf5d1b31  
    2727#include "bitlbee.h"
    2828#include "crypting.h"
     29#ifdef _WIN32
     30# define umask _umask
     31# define mode_t int
     32#endif
     33
     34#ifndef F_OK
     35#define F_OK 0
     36#endif
    2937
    3038static void text_init (void)
  • storage_xml.c

    rcd63d58 rf5d1b31  
    3030#include "md5.h"
    3131#include <glib/gstdio.h>
     32
     33#if !GLIB_CHECK_VERSION(2,8,0)
     34/* GLib < 2.8.0 doesn't have g_access, so just use the system access(). */
     35#define g_access access
     36#endif
    3237
    3338typedef enum
     
    246251        if( ! g_file_test( global.conf->configdir, G_FILE_TEST_EXISTS ) )
    247252                log_message( LOGLVL_WARNING, "The configuration directory `%s' does not exist. Configuration won't be saved.", global.conf->configdir );
    248         else if( ! g_file_test( global.conf->configdir, G_FILE_TEST_EXISTS ) || g_access( global.conf->configdir, W_OK ) != 0 )
     253        else if( ! g_file_test( global.conf->configdir, G_FILE_TEST_EXISTS ) ||
     254                         g_access( global.conf->configdir, W_OK ) != 0 )
    249255                log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to `%s'.", global.conf->configdir );
    250256}
  • unix.c

    rcd63d58 rf5d1b31  
    6060        if( global.conf->runmode == RUNMODE_INETD )
    6161        {
     62                log_link( LOGLVL_ERROR, LOGOUTPUT_IRC );
     63                log_link( LOGLVL_WARNING, LOGOUTPUT_IRC );
     64       
    6265                i = bitlbee_inetd_init();
    6366                log_message( LOGLVL_INFO, "Bitlbee %s starting in inetd mode.", BITLBEE_VERSION );
     
    6669        else if( global.conf->runmode == RUNMODE_DAEMON )
    6770        {
     71                log_link( LOGLVL_ERROR, LOGOUTPUT_SYSLOG );
     72                log_link( LOGLVL_WARNING, LOGOUTPUT_SYSLOG );
     73
    6874                i = bitlbee_daemon_init();
    6975                log_message( LOGLVL_INFO, "Bitlbee %s starting in daemon mode.", BITLBEE_VERSION );
     
    208214        return( (double) time->tv_sec + (double) time->tv_usec / 1000000 );
    209215}
     216
     217
Note: See TracChangeset for help on using the changeset viewer.