[sword-devel] compiling with gcc on windows

Daniel Glassey sword-devel@crosswire.org
Thu, 1 Nov 2001 17:48:59 -0000


--Message-Boundary-13044
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body

Attached is a small patch to Makefile, Makefile.cfg, Makefile.post CVS 17:30 GMT that 
allows you compile libsword.dll with the mingw gcc compiler on windoze. (www.mingw.org)
tested on windows though ought to work with the mingw cross compiler as well. please try it 
out if you have it.

hth,
Daniel


--Message-Boundary-13044
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Text from file 'swcvs.diff'

diff -u -w -r1.12 Makefile
--- Makefile	2001/10/18 21:11:10	1.12
+++ Makefile	2001/11/01 17:36:40
@@ -50,7 +50,12 @@
 #	$(CROSS_COMPILE)$(CC) $(LFLAGS) -o $@ $(l)

 buildso:
+	ifneq (${mingw},yes)
 	$(CROSS_COMPILE)$(CC) -fpic -shared -o ${root}/lib/libsword.so ${objdir}/*.so
+	else
+	gcc --shared -o ${root}/lib/libsword.dll -Wl,--out-implib,${root}/lib/libsword.dll.a ${objdir}/*.so -lz.dll -lstdc++
+	endif
+


 # Maintenance targets
diff -u -w -r1.80 Makefile.cfg
--- Makefile.cfg	2001/10/23 14:49:32	1.80
+++ Makefile.cfg	2001/11/01 17:36:40
@@ -1,6 +1,6 @@
 # General defines

-version := 1.5.2
+version := 1.5.3


 # ownership (used by 'make install')
@@ -30,7 +30,12 @@

 buildshare := no

+# if building dll with gcc on windoze (www.mingw.org)
+# note you must set need_local_regex and buildshare to yes

+mingw = no
+
+
 # VCL library- set to yes if you would like to build

 buildvcl := no
@@ -98,7 +103,11 @@

 LFLAGS    = $(OPTIMIZE) $(DEBUG) -L${root}/lib/
 ifneq ($(system),beos)
+ifeq (${mingw},yes)
+LIBS      = -lsword.dll -lstdc++
+else
 LIBS      = -lsword -lstdc++
+endif
 else
 LIBS      = -lsword -lstdc++.r4
 endif
@@ -106,8 +115,12 @@
 ifeq ($(zlib),no)
 CFLAGS += -DEXCLUDEZLIB
 else
+ifeq (${mingw},yes)
+LIBS += -lz.dll
+else
 LIBS += -lz
 endif
+endif

 ifeq ($(icu),yes)
 CFLAGS += -DICU
diff -u -w -r1.5 Makefile.post
--- Makefile.post	2001/09/10 00:16:07	1.5
+++ Makefile.post	2001/11/01 17:36:40
@@ -12,7 +12,9 @@
 ifeq (${buildshare},yes)
 ${root}/lib/libsword.a: $(o)
 	$(CROSS_COMPILE)$(AR) $(arflags) $@ $(o)
+	ifneq (${mingw},yes)
 	$(CROSS_COMPILE)$(CC) -fpic -shared -o ${root}/lib/libsword.so ${objdir}/*.so
+	endif

 else
 ${root}/lib/libsword.a: $(o)

--Message-Boundary-13044--

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com