Abi Word ported to Winelib!

Dimitrie O. Paun dpaun at rogers.com
Fri Apr 9 19:19:37 CDT 2004


Hi folks,

In the past couple days I've entertained myself with porting
Abi Word to Winelib. This was possible because now Abi Word
has a nice MinGW build system. A total of 5 trivial patches 
were indeed needed for Wine:
    http://www.winehq.org/hypermail/wine-patches/2004/04/0122.html
    http://www.winehq.org/hypermail/wine-patches/2004/04/0123.html
    http://www.winehq.org/hypermail/wine-patches/2004/04/0124.html
    http://www.winehq.org/hypermail/wine-patches/2004/04/0147.html
    http://www.winehq.org/hypermail/wine-patches/2004/04/0155.html

Notice how little we had to fix! To encourage others to port
stuff to Winelib, I'll inline the hacks I did to port Abi Word.
These we'll need to be cleaned up for integration into the
Abi Word tree, but again, please note how little we had to change.
(I've also attached a screeshot of the resulting Abi Word in action).

diff -ru abiword-2.0.6/abi/src/config/platforms/mingw32.mk abiword-2.0.6-dimi/abi/src/config/platforms/mingw32.mk
--- abiword-2.0.6/abi/src/config/platforms/mingw32.mk   2003-04-22 12:03:54.000000000 -0400
+++ abiword-2.0.6-dimi/abi/src/config/platforms/mingw32.mk      2004-04-09 19:50:33.000000000 -0400
@@ -28,7 +28,7 @@
 ##
 PLATFORM_FLAGS =
 PORT_FLAGS             =
-OS_CFLAGS               = -mwindows -DDM_SPECVERSION=0x0320
+OS_CFLAGS               = -mno-cygwin -mwindows -DDM_SPECVERSION=0x0320
 # Earnie Boyd has added DM_SPECVERSION macro (of this value) to MinGW
 # CVS tree on 04/14/03 so this is only for versions 2.0.0-3 and earlier
 ##
@@ -49,8 +49,8 @@
 IA64_ARCH_FLAGS                =

 # Define tools
-CC             = gcc
-CCC            = g++
+CC             = winegcc
+CCC            = wineg++
 RANLIB         = ranlib

 # Suffixes
@@ -155,10 +155,10 @@
 ABI_REQUIRE_PEER_ICONV = 1

 # Define tools - resource compiler
-RC             = windres
+RC             = wrc

 # Suffixes
-EXE_SUFFIX = .exe
+#EXE_SUFFIX = .exe

 # Compiler flags
 # requires the commctrl.dll from ie4.0 or greater
diff -ru abiword-2.0.6/abi/src/wp/ap/win/ap_Win32App.cpp abiword-2.0.6-dimi/abi/src/wp/ap/win/ap_Win32App.cpp
--- abiword-2.0.6/abi/src/wp/ap/win/ap_Win32App.cpp     2004-01-17 07:33:11.000000000 -0500
+++ abiword-2.0.6-dimi/abi/src/wp/ap/win/ap_Win32App.cpp        2004-04-09 20:55:03.000000000 -0400
@@ -35,7 +35,6 @@
 #include <string.h>
 #include <io.h>
 #include <fcntl.h>
-#include <iostream.h>
 #include <ole2.h>

 #include "ut_debugmsg.h"
@@ -1296,7 +1295,7 @@
 //


-#if  !defined(__MINGW32__)  && !defined(DEBUG)
+#if defined(WIN32) && !defined(__MWERKS__) && !defined(__WINE__)
 __try
 #endif
 {
@@ -1364,7 +1363,7 @@
 // If an exception happens, with "catch" the block
 // and then the save it into disk
 //
-#if  !defined(__MINGW32__)  && !defined(DEBUG)
+#if defined(WIN32) && !defined(__MWERKS__) && !defined(__WINE__)
 __except (1)
 {
        AP_Win32App *pApp = (AP_Win32App *) XAP_App::getApp();
diff -ru abiword-2.0.6/abi/src/wp/main/win/Makefile abiword-2.0.6-dimi/abi/src/wp/main/win/Makefile
--- abiword-2.0.6/abi/src/wp/main/win/Makefile  2003-07-23 23:31:36.000000000 -0400
+++ abiword-2.0.6-dimi/abi/src/wp/main/win/Makefile     2004-04-09 18:18:39.000000000 -0400
@@ -91,10 +91,10 @@
 ifeq ($(OS_NAME), MINGW32)
 $(PROGRAM): $(OBJS) $(EXTRA_LIBDEP)
        @$(MAKE_OBJDIR)
-       @echo Linking dynamic $(PROGRAM)
-       $(CCC) -o $(BINDIR)/libAbiWord.dll $(SHARED_LDFLAGS) $(CFLAGS) $(OBJDIR)/dummy.o  $(LDFLAGS) $(EXTRA_LIBS) $(OS_LIBS) $(XLDFLAGS)
-       @mv libAbiWord.dll.a $(LIBDIR)
-       $(CCC) -o $@ $(CFLAGS) $(OBJDIR)/Win32Main.o $(OBJDIR)/Win32Mainrc.o $(LDFLAGS) -L$(LIBDIR) -lAbiWord.dll $(OS_LIBS) $(XLDFLAGS)
+       #@echo Linking dynamic $(PROGRAM)
+       #$(CCC) -o $(BINDIR)/libAbiWord.dll $(SHARED_LDFLAGS) $(CFLAGS) $(OBJDIR)/dummy.o  $(LDFLAGS) $(EXTRA_LIBS) $(OS_LIBS) $(XLDFLAGS)
+       #@mv libAbiWord.dll.a $(LIBDIR)
+       $(CCC) -o $@ $(CFLAGS) $(OBJDIR)/Win32Main.o $(OBJDIR)/Win32Mainrc.o $(LDFLAGS) $(OBJDIR)/dummy.o $(EXTRA_LIBS) $(OS_LIBS) $(XLDFLAGS)
 else
 $(PROGRAM): $(OBJS) $(EXTRA_LIBDEP)
        @$(MAKE_OBJDIR)
diff -ru abiword-2.0.6/wv/config.h.in abiword-2.0.6-dimi/wv/config.h.in
--- abiword-2.0.6/wv/config.h.in        2003-06-21 11:58:55.000000000 -0400
+++ abiword-2.0.6-dimi/wv/config.h.in   2004-04-08 00:25:53.000000000 -0400
@@ -164,7 +164,7 @@
 #endif

 /* redefs of things that are either in glibc or we have to include them ourselves */
-#if defined(WIN32) && !defined(__MWERKS__)
+#if defined(WIN32) && !defined(__MWERKS__) && !defined(__WINE__)
 #define strcasecmp(s1,s2) stricmp(s1,s2)
 #else
 #if !defined(__GLIBC__) || (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2)
diff -ru abiword-2.0.6/wv/config.h.msvc abiword-2.0.6-dimi/wv/config.h.msvc
--- abiword-2.0.6/wv/config.h.msvc      2002-11-10 21:00:49.000000000 -0500
+++ abiword-2.0.6-dimi/wv/config.h.msvc 2004-04-08 00:23:58.000000000 -0400
@@ -169,7 +169,7 @@
 #endif

 /* redefs of things that are either in glibc or we have to include them ourselves */
-#if defined(WIN32) && !defined(__MWERKS__)
+#if defined(WIN32) && !defined(__MWERKS__) && !defined(__WINE__)
 #define strcasecmp(s1,s2) stricmp(s1,s2)
 #else
 #if !defined(__GLIBC__) || (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2)
diff -ru abiword-2.0.6/wv/configure.ac abiword-2.0.6-dimi/wv/configure.ac
--- abiword-2.0.6/wv/configure.ac       2003-09-15 06:03:44.000000000 -0400
+++ abiword-2.0.6-dimi/wv/configure.ac  2004-04-08 00:21:32.000000000 -0400
@@ -701,7 +701,7 @@
 #endif


-- 
Dimi.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: abiword-winelib.png
Type: image/png
Size: 42867 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20040409/329c1bfe/abiword-winelib.png


More information about the wine-devel mailing list