On Nov 7, 2007, at 9:10 AM, Bob Delaney wrote:

> With Xcode I've created a Universal plugin (Decimal Plugin) using
> PowerPC and i386 libraries for GMP. Is there anyway I can have Xcode
> make a Windows plugin with the i386 library?
>
> Bob
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>

I have successfully made a Windows DLL for my Decimal Plugin. I  
installed MinGW and MSYS on my Parallels Windows XP virtual machine.  
This brought a UNIX like environment to Windows. I then was able to  
make the gmp-4.1.4 libraries for Windows i386. I did not use the  
latest gmp-4.2.2 release because that makes unusable libraries on my  
Intel iMac. So I've used 4.1.4 because a package exists for Ubuntu  
Linux and the Intel iMac, and I wanted consistency.

Once I had the gmp static libraries, I used the same source files  
that successfully made a Linux shared library using Ubuntu. I edited  
the makefile so as to use the new paths for the libraries. For  
simplicity, I dropped gmp.h and gmpxx.h into my source folder and  
changed the includes to #include "gmpxx.h" and #include "gmp.h". Also  
I edited the Plugins SDK files to comment out QT references, since  
mine is a purely mathematical plugin. In particular, I had to comment  
out all the conditional #if X_Window ... #endif, since they gave  
errors in the make. Here is my actual makefile (Note that /c is the  
C: drive in MSYS):

# makefile
#
# Usage:
#       make all
#
#       This is the makefile for the Decimal plugin.
#       The first part, suitably edited, is from Plugins SDK Box Control

CC = g++
BASEDIR = /c
PLUGINSDKDIR = $(BASEDIR)/RBplugins
SDKGLUECODEDIR = $(PLUGINSDKDIR)/Glue\ Code
SDKINCLUDEDIR = $(PLUGINSDKDIR)/Includes

GTKPREFIXDIR = /usr/include
GTKLIBPREFIXDIR = /usr/lib

GTKINCLUDEDIR = $(GTKPREFIXDIR)/gtk-2.0
GLIBINCLUDEDIR = $(GTKPREFIXDIR)/glib-2.0
PANGOINCLUDEDIR = $(GTKPREFIXDIR)/pango-1.0
ATKINCLUDEDIR = $(GTKPREFIXDIR)/atk-1.0
ATK2INCLUDEDIR = $(ATKINCLUDEDIR)/atk
GDKINCLUDEDIR = $(GTKINCLUDEDIR)/gdk

GLIBCONFIGDIR = $(GTKLIBPREFIXDIR)/glib-2.0/include
GDKCONFIGDIR = $(GTKLIBPREFIXDIR)/gtk-2.0/include

INCLUDE =       -I$(SDKINCLUDEDIR) \
                        -I./ \
                        -I$(GTKINCLUDEDIR) \
                        -I$(GLIBINCLUDEDIR) \
                        -I$(PANGOINCLUDEDIR) \
                        -I$(ATKINCLUDEDIR) \
                        -I$(ATK2INCLUDEDIR) \
                        -I$(GDKINCLUDEDIR)


ADDITIONALINCLUDES = -I$(GDKCONFIGDIR) -I$(GLIBCONFIGDIR)



PERMISSIVEFLAG = -w -fpermissive
CFLAGS = -s -O2 -D__INTEL__ -D__GCC__ -DX_WINDOW=1 $(INCLUDE) $ 
(ADDITIONALINCLUDES)
PREFIXHEADER = WinHeader++.h

OBJS =   DecimalPlugin.o decMath.o myTransFuncs.o PluginMain.o

all: $(OBJS)
        $(CC) $(CFLAGS) -shared -o libDecimal.DLL $(OBJS) /c/gmp_install/lib/ 
libgmp.a /c/gmp_install/lib/libgmpxx.a

DecimalPlugin.o: DecimalPlugin.cpp
        $(CC) $(CFLAGS) -include $(PREFIXHEADER) DecimalPlugin.cpp -c

decMath.o: decMath.cpp
        $(CC) decMath.cpp -c


myTransFuncs.o: myTransFuncs.cpp
        $(CC) myTransFuncs.cpp -c


PluginMain.o: $(SDKGLUECODEDIR)/PluginMain.cpp
        $(CC) $(PERMISSIVEFLAG) $(CFLAGS) -include $(PREFIXHEADER) $ 
(SDKGLUECODEDIR)/PluginMain.cpp -c


CLEAN:
        rm $(OBJS)


Sometime after the creation of the DLL and exiting MSYS, Parallels  
itself crashed. I don't know if this was due to MinGW and MSYS, or if  
was the result of Parallels Build 5160 running under Leopard on my  
Intel iMac. There is a Parallels beta out now, which I haven't tried.  
Anyway I reinstalled Parallels and everything now seems to be OK.

Bob

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to