I already spoke to datallah about helping us with this. Really no need
to worry about it at all.
Don.
On 23:59 Thu 20 Jan , Zilo wrote:
> After reading gaim.sf.net/win32/build.php all is easier :)
>=20
> Anyway, I wrote the Makefile.mingw for our src directory, using the =20
> gaim's ones as examples, and finally build a working libbnet.dll :)
>=20
> The only thingh to change in sources is the send(), that we can't find =
=20
> in mingw header files, we should use write() instead (like the others =20
> plugins do)...
>=20
> But... there's a 'but' :)
>=20
> The write() function always returns an error, EBADF (bad file =20
> descriptor)... I still don't understand why :P
>=20
> I attach the small patch and the Makefile.mingw... if you want to try =20
> by yourself.
>=20
> cya
>=20
> #
> # Makefile.mingw
> #
> # Description: Makefile for win32 (mingw) version of libjabber
> #
>=20
> #
> # PATHS
> #
>=20
> INCLUDE_DIR :=3D .
> GTK_TOP :=3D ../../../../win32-dev/gtk_2_0
> GAIM_TOP :=3D ../../..
> BNET_ROOT :=3D .
> GAIM_INSTALL_DIR :=3D $(GAIM_TOP)/win32-install-dir
>=20
> ##
> ## VARIABLE DEFINITIONS
> ##
>=20
> TARGET =3D libbnet
>=20
> # Compiler Options
>=20
> CC =3D gcc.exe
>=20
> CFLAGS =3D -O2 -Wall -mno-cygwin -mms-bitfields
>=20
> DEFINES =3D -DHAVE_CONFIG_H -DLOCALEDIR=3D\"$(GAIM_INSTALL_DIR)/locale\"
>=20
> DLL_INSTALL_DIR =3D $(GAIM_INSTALL_DIR)/plugins
>=20
> DLL_LD_FLAGS =3D -Wl,--enable-auto-image-base
>=20
> ##
> ## INCLUDE PATHS
> ##
>=20
> INCLUDE_PATHS +=3D -I$(BNET_ROOT) \
> -I$(BNET_ROOT)/win32 \
> -I$(GTK_TOP)/include \
> -I$(GTK_TOP)/include/gtk-2.0 \
> -I$(GTK_TOP)/include/glib-2.0 \
> -I$(GTK_TOP)/include/pango-1.0 \
> -I$(GTK_TOP)/include/atk-1.0 \
> -I$(GTK_TOP)/lib/glib-2.0/include \
> -I$(GTK_TOP)/lib/gtk-2.0/include \
> -I$(GAIM_TOP)/src \
> -I$(GAIM_TOP)/src/win32 \
> -I$(GAIM_TOP)
>=20
>=20
> LIB_PATHS =3D -L$(GTK_TOP)/lib \
> -L$(GAIM_TOP)/src
>=20
>=20
> ##
> ## SOURCES, OBJECTS
> ##
>=20
> C_SRC =3D bnet.c \
> buddy.c \
> chat.c \
> conn.c \
> proto.c
>=20
>=20
> OBJECTS =3D $(C_SRC:%.c=3D%.o)
>=20
>=20
> ##
> ## LIBRARIES
> ##
>=20
> LIBS =3D -lgtk-win32-2.0 \
> -lglib-2.0 \
> -lgdk-win32-2.0 \
> -lgmodule-2.0 \
> -lgobject-2.0 \
> -lws2_32 \
> -lintl \
> -lgaim
>=20
> ##
> ## RULES
> ##
>=20
> # How to make a C file
>=20
> %.o: %.c
> $(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
>=20
> ##
> ## TARGET DEFINITIONS
> ##
>=20
> .PHONY: all clean
>=20
> all: $(TARGET).dll
>=20
> install:
> cp $(JABBER_ROOT)/$(TARGET).dll $(DLL_INSTALL_DIR)
>=20
>=20
> ##
> ## BUILD Dependencies
> ##
>=20
> $(GAIM_TOP)/src/gaim.lib:
> $(MAKE) -C $(GAIM_TOP)/src -f Makefile.mingw gaim.lib
>=20
> ##
> ## BUILD DLL
> ##
>=20
> $(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
> $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-=
implib,$(TARGET).lib -o $(TARGET).dll
>=20
> ##
> ## CLEAN RULES
> ##
>=20
> clean:
> rm -rf *.o
> rm -rf ./win32/*.o
> rm -rf $(TARGET).dll
> rm -rf $(TARGET).lib
>=20
> Index: bnet.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> RCS file: /cvsroot/gaim-bnet/gaim-bnet/src/bnet.h,v
> retrieving revision 1.9
> diff -u -p -r1.9 bnet.h
> --- bnet.h 8 Jan 2005 11:24:00 -0000 1.9
> +++ bnet.h 20 Jan 2005 23:40:03 -0000
> @@ -34,8 +34,6 @@
> =20
> #include <glib.h>
> #include <string.h>
> -#include <sys/socket.h>
> -#include <sys/types.h>
> #include <unistd.h>
> =20
> #include <plugin.h>
> Index: conn.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> RCS file: /cvsroot/gaim-bnet/gaim-bnet/src/conn.c,v
> retrieving revision 1.8
> diff -u -p -r1.8 conn.c
> --- conn.c 17 Jan 2005 01:56:50 -0000 1.8
> +++ conn.c 20 Jan 2005 23:40:03 -0000
> @@ -65,10 +65,16 @@ bnet_conn_out_queue_check(BNetConn *conn
> =20
> queue =3D conn->out_queue;
> =20
> - while (queue && conn->flood_sent + strlen(cur =3D queue->data) < BNET_F=
LOOD_MAX) {
> - ret =3D send(conn->fd, cur, strlen(cur), 0);
> - if (ret > 0)
> - conn->flood_sent +=3D ret;
> + while (queue && (cur =3D queue->data, !conn->flood_sent ||
> + conn->flood_sent + strlen(cur) < BNET_FLOOD_MAX)) {
> + ret =3D write(conn->fd, cur, strlen(cur));
> + if (ret < 0) {
> + gaim_connection_error(gaim_account_get_connection(conn->account),
> + _("Write error"));
> + return;
> + }
> +
> + conn->flood_sent +=3D ret;
> =20
> g_free(cur);
> queue =3D g_list_remove_link(queue, queue);
>=20
--=20
Don Seiler
do...@se...
Public Key: http://pgp.mit.edu:11371/pks/lookup?op=3Dget&search=3D0xFC87F041
Fingerprint: 0B56 50D5 E91E 4D4C 83B7 207C 76AC 5DA2 FC87 F041
|