Win32

From Swishewiki

Jump to: navigation, search

Information specific to Swish-e on the 32-bit Windows platform.

Contents

Differences from other 32-bit Windows applications

Filenames

Swish-e will accept either / or \ as the directory separator in a file name. C:\swish-e is equivalent to C:/swish-e. Swish-e internally translates all directory separators to /. This makes it easier for Swish-e and scripts to transform filenames into URLs.

Note: When you are passing a filename to Windows you must always use \. You will need to do this in Filefilter and Prog_method parameters.

Differences from Swish-e on UNIX Systems

The shell, the shell, the shell. It's wacky, poorly documented, and inconsistent in various versions of windows. Or that's what reports indicate.

FileFilter Programs

There are differences. Someone care to elaborate?

Building

Cross-compiling for Windows on Debian or Ubuntu

Required Tools

Install a native Windows cross-compiler such as Mingw32 in addition to your normal build tools:

sudo apt-get install mingw32 mingw32-binutils mingw32-runtime subversion make

If you want to generate the pretty wizard-like installation program then install Sysutils and NSIS (From Debian main or Ubuntu universe):

sudo apt-get install sysutils nsis

If you intend to compile the Perl SWISH::API module then install XVFB (X Virtual Framebuffer):

sudo apt-get install xvfb

Dependencies

Build libxml2, pcre, and zlib libraries. You will also need catdoc and xpdf if you plan to build the NSIS installation wizard. You may use the prebuilt dependencies (libraries and filters) for Swish-e.

wget http://webaugur.com/wares/files/swish-e/swish-build-2008-03-09.tar.gz

Extract the build environment

tar xzf swish-build-2008-03-09.tar.gz

Change to the work directory

cd swish-build

Configuring Perl (optional)

I have included a copy of ActivePerl 5.8 in the swish-build archive. You probably will need to run reloc_perl.bat. Make sure wine is installed and works properly. Run the following commands:

 pushd perl/bin
 wine cmd

Now you will find yourself in Wine's NT command interpreter with the working directory set to perl/bin. Look at everything before bin. That's what you'll want to set for your topath. Here is how I would run that command (leave off the .bat file extension):

 reloc_perl -a -i Z:\home\kg9ae\Projects\SWISHE\swish-build\perl

Once that is complete and, hopefully, completes without any errors close the NT command shell:

 exit

Now switch back to your swish-build work directory:

 popd

Building Swish-e for Windows

Grab the latest Swish-e revision from SVN

svn co http://svn.swish-e.org/swish-e/trunk swish-e

Run the build.sh script to generate the Swish-e executable and libswish-e libraries

pushd swish-e
sh ./src/win32/build.sh

Note

You may see make: *** [API.c] Error 127 when it tries to build SWISH::API Perl module. This means you haven't built the SWISH::API module. You can safely ignore this unless you intended to build the perl module. If you did want the perl module then make sure you following the instructions in the previous section (Configuring Perl).

Packaging Swish-e for Installation on Windows

If you have not built SWISH::API you may do the following to appease NSIS

mkdir -p perl/blib/arch/auto
touch perl/blib/arch/auto/dummy

Now all you need to do is run dist.sh to build your NSIS installation wizard

sh ./src/win32/dist.sh

Now you should have a Windows installer named ./src/win32/swishsetup.exe

$ ls -lah src/win32/swishsetup.exe
-rw-r--r--  1 augur augur 2.9M 2005-09-05 03:29 src/win32/swishsetup.exe

Compiling on Windows using Mingw

Most of the above instructions for cross-compiling Swish-e for Windows on Debian should apply. Some of the build scripts may assume they are running on Linux. So you may need to edit some scripts to make them work under Windows. You will need mtools and mingw available from the Mingw website.

Compiling on Windows using Cygwin

Some have reported success building swish-e from source under recent versions of cygwin. In particular, Sman was tested under cygwin without libxml2 -- and worked!

Cygwin is not needed since Swish-e builds natively on Windows. There are macros which have problems under Cygwin. You may notice directory separator problems and the like.

(feel free to elaborate here if you have input!)

Compiling on Windows using Visual Studio

You can use Visual C++ on Windows if you want. There is a .dsw workspace file for Visual Studio 5 or 6 (and can be imported into 7) in the src/win32 directory. The MSVC projects haven't been maintained very well for a few years. So they may not work without some changes.

Personal tools