Difference between revisions of "Tutorial:Compiling & Installing SWORD on Windows"

From CrossWire Bible Society
Jump to: navigation, search
(Compilation of Clucene)
(Compilation of Clucene: improved wiki formating)
Line 47: Line 47:
 
clucene 0.9.21b source
 
clucene 0.9.21b source
  
The scripts for compiling sword and clucene in xiphos/win32/suse are
+
The scripts for compiling sword and clucene in xiphos/win32/suse are meant to be used from  ~/source/ with the clucene and sword directories directly under that. I would suggest reading the scripts. They aren't complicated, and I'm sure that I made assumptions about my environment (which is basically the *sole* reason for the warning that they aren't ready, I never meant they couldn't be used). You can go ahead and try to use them to cross-compile clucene. It will probably fail. If at that point, you send me config.log, that will help me remember what to do to fix it.
meant to be used from  ~/source/ with the clucene and sword
 
directories directly under that. I would suggest reading the scripts.
 
They aren't complicated, and I'm sure that I made assumptions about my
 
environment (which is basically the *sole* reason for the warning that
 
they aren't ready, I never meant they couldn't be used). You can go
 
ahead and try to use them to cross-compile clucene. It will probably
 
fail. If at that point, you send me config.log, that will help me
 
remember what to do to fix it.
 
  
 
--------------------------------
 
--------------------------------
Line 61: Line 53:
 
edit m4/dps_static_const_type.m4, the last AC_DEFINE line. Change from:
 
edit m4/dps_static_const_type.m4, the last AC_DEFINE line. Change from:
  
AC_MSG_ERROR([Cannot figure out how to write static consts in classes.
+
AC_MSG_ERROR([Cannot figure out how to write static consts in classes. Check the m4 script or upgrade your compiler])
Check the m4 script or upgrade your compiler])
 
  
 
to:
 
to:
  
  AC_DEFINE([LUCENE_STATIC_CONSTANT_SYNTAX], 1, [How to define a static
+
  AC_DEFINE([LUCENE_STATIC_CONSTANT_SYNTAX], 1, [How to define a static const in a class])
const in a class])
 
  
eg, the same as the first AC_DEFINE. I have no idea if it's correct,
+
eg, the same as the first AC_DEFINE. I have no idea if it's correct, actually, but it seems to work ;)
actually, but it seems to work ;)
 
  
Next, edit src/Makefile.am, line 6. Add -no-undefined at the end, like so:
+
Next, edit src/Makefile.am, line 6. Add <tt>-no-undefined</tt> at the end, like so:
  
libclucene_la_LDFLAGS  = --version-info $(CLLIB_VERSION) --release
+
libclucene_la_LDFLAGS  = --version-info $(CLLIB_VERSION) --release
$(PACKAGE_VERSION) -no-undefined
+
$(PACKAGE_VERSION) -no-undefined
  
 
------------------------
 
------------------------
Line 82: Line 71:
 
At the top of that file, after the #include directives, I just added this:
 
At the top of that file, after the #include directives, I just added this:
  
#define _mkdir mkdir
+
#define _mkdir mkdir
  
  
After changing these, you'll have to run autogen.sh and then
+
After changing these, you'll have to run autogen.sh and then re-configure using my script. It *should* build after this, at which point run sudo make install. Check to be sure it created a dll rather than just a static library (which will end in .la). It should be located in /usr/i686-w64-mingw32/sys-root/mingw/bin
re-configure using my script. It *should* build after this, at which
 
point run sudo make install. Check to be sure it created a dll rather
 
than just a static library (which will end in .la). It should be located
 
in /usr/i686-w64-mingw32/sys-root/mingw/bin
 
  
 
After this Clucene compiles without errors and creates a working dll.
 
After this Clucene compiles without errors and creates a working dll.

Revision as of 16:32, 2 October 2011

For compiling on Linux, see Tutorial:Compiling & Installing SWORD.

Compiling The SWORD Project using MS Visual Studio 2008

  1. Create a build directory, hereafter referred to as $dir$. Much of the Sword build process expects that various downloads be unpacked to the same directory.

Compiling cURL

  1. Download the latest release of cURL
  2. Extract the ZIP to $dir$
  3. Rename the cURL directory to "curl" (with no version number)
  4. Open $dir$\curl\vc6curl.dsw
  5. Allow Visual Studio to update the project files
  6. Build all (Click Build | Batch Build... | Select All | Build)

Compiling icu-sword

  1. Download the latest release of icu-sword
  2. Extract the tarball to $dir$
  3. Open $dir$\icu-sword\source\allinone\allinone.sln
  4. Build all (Click Build | Batch Build... | Select All | Build)

Compiling libsword

  1. Download the latest release of The SWORD Project
  2. Extract the tarball to $dir$
    If you are building utilities or diatheke, the following steps are not necessary:
  3. Open $dir$\sword-$version$\lib\vcppmake\vc8\libsword.vcproj
  4. Build all (Click Build | Batch Build... | Select All | Build)

Compiling utilities

  1. Open $dir$\sword-$version$\utilities\vcppmake\utilities.sln
  2. Build all (Click Build | Batch Build... | Select All | Build)

Compiling diatheke

  1. Open $dir$\sword-$version$\utilities\diatheke\diatheke.vcproj
  2. Build all (Click Build | Batch Build... | Select All | Build)

Cross Compiling Sword for MS Windows on Suse Linux with MingW

Suse with MingW

Installation of all necessary dependencies of Sword, but for CLucene - libcurl, ICU, libgnurx etc -

Compilation of Clucene

clucene 0.9.21b source

The scripts for compiling sword and clucene in xiphos/win32/suse are meant to be used from ~/source/ with the clucene and sword directories directly under that. I would suggest reading the scripts. They aren't complicated, and I'm sure that I made assumptions about my environment (which is basically the *sole* reason for the warning that they aren't ready, I never meant they couldn't be used). You can go ahead and try to use them to cross-compile clucene. It will probably fail. If at that point, you send me config.log, that will help me remember what to do to fix it.


edit m4/dps_static_const_type.m4, the last AC_DEFINE line. Change from:

AC_MSG_ERROR([Cannot figure out how to write static consts in classes. Check the m4 script or upgrade your compiler])

to:

AC_DEFINE([LUCENE_STATIC_CONSTANT_SYNTAX], 1, [How to define a static const in a class])

eg, the same as the first AC_DEFINE. I have no idea if it's correct, actually, but it seems to work ;)

Next, edit src/Makefile.am, line 6. Add -no-undefined at the end, like so:

libclucene_la_LDFLAGS  = --version-info $(CLLIB_VERSION) --release
$(PACKAGE_VERSION) -no-undefined

src/CLucene/store/FSDirectory.cpp

At the top of that file, after the #include directives, I just added this:

#define _mkdir mkdir


After changing these, you'll have to run autogen.sh and then re-configure using my script. It *should* build after this, at which point run sudo make install. Check to be sure it created a dll rather than just a static library (which will end in .la). It should be located in /usr/i686-w64-mingw32/sys-root/mingw/bin

After this Clucene compiles without errors and creates a working dll.

Compilation of Sword

Application of 2 patches:

patch1 patch2