Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 116 additions & 26 deletions doc/installation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ulink url="&url.debian;">Debian GNU/Linux</ulink>,
<ulink url="&url.ubuntu;">Ubuntu Linux</ulink>,
<ulink url="&url.macosx;">MAC OSX</ulink>,
Windows 7.
Windows.
</para>

<para>
Expand Down Expand Up @@ -285,13 +285,61 @@
<para>
&zebra; is shipped with "makefiles" for the NMAKE tool that comes
with <ulink url="&url.vstudio;">Microsoft Visual C++</ulink>.
Version 2013 has been tested.
Visual Studio 2022 Build Tools has been tested.
</para>
<para>
Start a command prompt and switch the sub directory
<filename>WIN</filename> where the file <filename>makefile</filename>
is located. Customize the installation by editing the
<filename>makefile</filename> file (for example by using notepad).
Open a Visual Studio developer command prompt for the target
architecture, for example the x64 Native Tools Command Prompt.
Use the same architecture for &yaz;, &zebra;, and their dependencies.
The makefiles select <literal>BARCH</literal> from the Visual Studio
environment variable <literal>VSCMD_ARG_TGT_ARCH</literal>, falling
back to <literal>x64</literal> if it is not set. You can override
this with <literal>nmake BARCH=x86</literal> or
<literal>nmake BARCH=x64</literal>; the compiler environment must
match the selected architecture.
</para>
<para>
Install libxml2, libxslt, ICU, Expat, libiconv, and bzip2 with vcpkg.
For an x64 build with vcpkg installed in <filename>c:\vcpkg</filename>,
run:
<screen>
c:\vcpkg\vcpkg install libxml2:x64-windows libxslt:x64-windows icu:x64-windows expat:x64-windows libiconv:x64-windows bzip2:x64-windows
</screen>
For an x86 build, use <literal>x86-windows</literal> instead.
The makefiles use the DLL-based vcpkg triplets and expect headers,
import libraries, and DLLs under
<filename>c:\vcpkg\installed\$(BARCH)-windows</filename>.
If vcpkg is installed elsewhere, adjust the dependency paths in
both makefiles.
</para>
<para>
When building from Git, initialize the submodules in both source
repositories before compiling:
<screen>
git submodule update --init --recursive
</screen>
In particular, the <filename>m4</filename> submodule supplies the
Tcl script that generates version information. Ensure that
<command>tclsh</command> is on your PATH, or set
<literal>TCL</literal> in the makefiles to its location. The default
&yaz; build also uses <command>win_bison</command> to generate its
CQL parser.
</para>
<para>
Place the &yaz; and &zebra; source directories next to each other,
named <filename>yaz</filename> and <filename>idzebra</filename>.
Build &yaz; first, then &zebra;, from their respective
<filename>win</filename> directories:
<screen>
cd yaz\win
nmake
cd ..\..\idzebra\win
nmake
</screen>
</para>
<para>
Customize the build by editing <filename>win\makefile</filename>
or overriding settings on the NMAKE command line.

The following summarizes the most important settings in that file:

Expand All @@ -306,13 +354,24 @@
</para></listitem>
</varlistentry>

<varlistentry><term><literal>BARCH</literal></term>
<listitem><para>
Target architecture, <literal>x86</literal> or
<literal>x64</literal>. This also selects the vcpkg installation
directory, as described above.
</para></listitem>
</varlistentry>

<varlistentry>
<term><literal>YAZDIR</literal></term>
<listitem><para>
Directory of &yaz; source. &zebra;'s makefile expects to find
YAZ<filename>.lib</filename>, YAZ<filename>.dll</filename>
in <replaceable>yazdir</replaceable><literal>/lib</literal> and
<replaceable>yazdir</replaceable><literal>/bin</literal> respectively.
Directory of &yaz; source, defaulting to the sibling
<filename>yaz</filename> directory. &zebra;'s makefile expects
headers under <filename>src</filename>, import libraries such
as <filename>yaz5.lib</filename> and <filename>yaz_icu5.lib</filename>
under <filename>lib</filename>, and DLLs under
<filename>bin</filename>. Debug builds use the corresponding
names with a <literal>d</literal> suffix.
</para>
</listitem>
</varlistentry>
Expand All @@ -323,21 +382,47 @@
<listitem><para>
If <literal>HAVE_EXPAT</literal> is set to 1, &zebra; is compiled
with <ulink url="&url.expat;">Expat</ulink> support.
In this configuration, set
<literal>ZEBRA_DIR</literal> to the Expat source directory.
Windows version of Expat can be downloaded from
<ulink url="&url.expat;">SourceForge</ulink>.
<literal>EXPAT_DIR</literal> defaults to
<filename>c:\vcpkg\installed\$(BARCH)-windows</filename>, with
headers in <filename>include</filename>,
<filename>libexpat.lib</filename> in <filename>lib</filename>,
and <filename>libexpat.dll</filename> in <filename>bin</filename>.
</para></listitem>
</varlistentry>

<varlistentry>
<term><literal>HAVE_LIBXML2</literal>, <literal>LIBXML2_DIR</literal>,
<literal>HAVE_LIBXSLT</literal>, <literal>LIBXSLT_DIR</literal></term>
<listitem><para>
Enable libxml2 and libxslt support, including the DOM XML and
ALVIS filters. Both are enabled by default, and both directories
default to <filename>c:\vcpkg\installed\$(BARCH)-windows</filename>.
</para></listitem>
</varlistentry>

<varlistentry>
<term><literal>HAVE_ICU</literal>, <literal>ICU_BASE</literal>,
<literal>ICU_VER</literal></term>
<listitem><para>
Enable ICU support through &yaz;. ICU is enabled by default,
with <literal>ICU_BASE</literal> set to
<filename>c:\vcpkg\installed\$(BARCH)-windows</filename>.
Set <literal>ICU_VER</literal> to the major version installed
by vcpkg so the makefile copies the correct versioned DLLs.
Keep this setting consistent with the &yaz; makefile.
</para></listitem>
</varlistentry>

<varlistentry>
<term><literal>BZIP2INCLUDE</literal>,
<literal>BZIP2LIB</literal>,
<literal>BZIP2DEF</literal>
</term>
<term><literal>HAVE_BZIP2</literal>, <literal>BZIP2_DIR</literal></term>
<listitem><para>
Define these symbols if &zebra; is to be compiled with
<ulink url="&url.bzip2;">BZIP2</ulink> record compression support.
<ulink url="&url.bzip2;">BZIP2</ulink> record compression support
is enabled by default. <literal>BZIP2_DIR</literal> defaults to
<filename>c:\vcpkg\installed\$(BARCH)-windows</filename>, with
<filename>bzlib.h</filename> in <filename>include</filename>,
<filename>bz2.lib</filename> in <filename>lib</filename>, and
<filename>bz2.dll</filename> in <filename>bin</filename>.
Set <literal>HAVE_BZIP2=0</literal> to disable this support.
</para></listitem>
</varlistentry>

Expand All @@ -348,7 +433,7 @@
The <literal>DEBUG</literal> setting in the makefile for &zebra; must
be set to the same value as <literal>DEBUG</literal> setting in the
makefile for &yaz;.
If not, the &zebra; server/indexer will crash.
The default is <literal>DEBUG=0</literal> in both makefiles.
</para>
</warning>
<para>
Expand All @@ -360,11 +445,9 @@
<note>
<para>
If the <filename>nmake</filename> command is not found on your system
you probably haven't defined the environment variables required to
use that tool. To fix that, find and run the batch file
<filename>vcvars32.bat</filename>. You need to run it from within
the command prompt or set the environment variables "globally";
otherwise it doesn't work.
open a Visual Studio developer command prompt with the C++ build
tools installed. This sets the compiler, linker, and Windows SDK
environment for the selected target architecture.
</para>
</note>
<para>
Expand Down Expand Up @@ -392,6 +475,13 @@
</variablelist>

</para>
<para>
These paths are relative to the &zebra; source directory. The build
also copies the &yaz; and vcpkg runtime DLLs into
<filename>bin</filename>, including the libxml2 dependencies zlib
and libiconv. Keep these DLLs alongside the executables when
running or copying them to another directory.
</para>
</section>


Expand Down
80 changes: 61 additions & 19 deletions win/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@
###########################################################

DEBUG=0 # 0 for release, 1 for debug
BARCH = 32

# Target architecture: x86 or x64
!IFNDEF BARCH
!IFDEF VSCMD_ARG_TGT_ARCH
BARCH = $(VSCMD_ARG_TGT_ARCH)
!ELSE
BARCH = x64
!ENDIF
!ENDIF

USE_MANIFEST = 0

# TCL is optional - ONLY needed for source straight from Git
Expand All @@ -19,24 +28,29 @@ ICONV_DIR=c:\iconv-1.9.2.win32

# EXPAT is optional. It's required for grs.xml-filters.
HAVE_EXPAT=1
EXPAT_DIR=c:\Program files (x86)\Expat 2.5.0
EXPAT_DIR=c:\vcpkg\installed\$(BARCH)-windows

# ICU support
HAVE_ICU=1
ICU_VER=68
ICU_BASE=c:\icu4c-$(ICU_VER)_2-Win$(BARCH)-MSVC2019
ICU_VER=78
ICU_BASE=c:\vcpkg\installed\$(BARCH)-windows
ICU_BIN=$(ICU_BASE)\bin
ICU_INCLUDE=$(ICU_BASE)\include

# libxslt. For mod_dom and mod_alvis
HAVE_LIBXSLT=1
LIBXSLT_DIR=c:\libxslt-1.1.28.win$(BARCH)
LIBXSLT_DIR=c:\vcpkg\installed\$(BARCH)-windows

# libxml2. Used by libxslt
HAVE_LIBXML2=1
LIBXML2_DIR=c:\libxml2-2.9.2.win$(BARCH)
LIBXML2_DIR=c:\vcpkg\installed\$(BARCH)-windows

# BZIP2 record compression support
HAVE_BZIP2=1
BZIP2_DIR=c:\vcpkg\installed\$(BARCH)-windows

default: all
all: dirs generate expat iconv yaz dll zserver zebraidx tstflock
all: dirs generate expat iconv icu libxml2 libxslt bzip2 yaz dll zserver zebraidx tstflock

# Directories
# The current directory is supposed to be something like
Expand All @@ -63,13 +77,6 @@ YAZ_DLL_SOURCE="$(YAZBINDIR)\yaz5.dll"
YAZ_DLL_TARGET="$(BINDIR)\yaz5.dll"
!endif

# BZIP2 settings. Uncomment and specify if you wish to use LIBBZIP2.
# (C) 1996-1999 Julian Seward <jseward@acm.org> http://www.bzip2.org

#BZIP2INCLUDE=/I"$(ROOTDIR)\..\bzip2-0.9.5d"
#BZIP2LIB=$(ROOTDIR)\..\bzip2-0.9.5d\libbz2.lib
#BZIP2DEF=/D"HAVE_BZLIB_H=1"

# ZEBRA Include files, libraries, programs, etc.
INCLDIR=$(ROOTDIR)\include # our includes
LIBDIR=$(ROOTDIR)\lib # We produce .lib, .exp etc there
Expand Down Expand Up @@ -111,7 +118,7 @@ dist: version.nsi
nmake nsis

nsis: version.nsi
$(NSIS) /DVSARCH=x86 zebra.nsi
$(NSIS) /DVSARCH=$(BARCH) zebra.nsi

version.nsi: $(ROOTDIR)/IDMETA
$(TCL) $(M4DIR)/mk_version.tcl $(ROOTDIR)/IDMETA version.nsi
Expand All @@ -138,9 +145,24 @@ dll: $(DLL)

# External libs and modules (enabled or disabled)

!if $(HAVE_BZIP2)
BZIP2INCLUDE=/I"$(BZIP2_DIR)\include"
BZIP2LIB="$(BZIP2_DIR)\lib\bz2.lib"
BZIP2DEF=/D HAVE_BZLIB_H=1
bzip2: $(BINDIR)\bz2.dll

$(BINDIR)\bz2.dll:
copy "$(BZIP2_DIR)\bin\bz2.dll" $(BINDIR)
!else
BZIP2INCLUDE=
BZIP2LIB=
BZIP2DEF=/D HAVE_BZLIB_H=0
bzip2:
!endif

!if $(HAVE_EXPAT)
EXPAT_DEF= /D HAVE_EXPAT_H=1 /I"$(EXPAT_DIR)\source\lib"
EXPAT_LIB= "$(EXPAT_DIR)\bin\libexpat.lib"
EXPAT_DEF= /D HAVE_EXPAT_H=1 /I"$(EXPAT_DIR)\include"
EXPAT_LIB= "$(EXPAT_DIR)\lib\libexpat.lib"
EXPAT_DLL_SOURCE= "$(EXPAT_DIR)\bin\libexpat.dll"
EXPAT_DLL_TARGET= "$(BINDIR)\libexpat.dll"
expat: $(EXPAT_DLL_TARGET)
Expand Down Expand Up @@ -171,24 +193,45 @@ iconv:
!if $(HAVE_LIBXML2)
LIBXML2_LIB="$(LIBXML2_DIR)\lib\libxml2.lib"
LIBXML2_DEF=/DYAZ_HAVE_XML2=1 /D HAVE_XML2=1 /I"$(LIBXML2_DIR)\include\libxml2"
libxml2: $(BINDIR)\libxml2.dll

$(BINDIR)\libxml2.dll:
copy "$(LIBXML2_DIR)\bin\z.dll" $(BINDIR)
copy "$(LIBXML2_DIR)\bin\iconv-2.dll" $(BINDIR)
copy "$(LIBXML2_DIR)\bin\libxml2.dll" $(BINDIR)
!else
LIBXML2_LIB=
LIBXML2_DEF=/D HAVE_XML2=0
libxml2:
!endif

!if $(HAVE_LIBXSLT)
LIBXSLT_LIB="$(LIBXSLT_DIR)\lib\libxslt.lib"
LIBXSLT_DEF=/D HAVE_XSLT=1 /I"$(LIBXSLT_DIR)\include"
libxslt: $(BINDIR)\libxslt.dll

$(BINDIR)\libxslt.dll:
copy "$(LIBXSLT_DIR)\bin\libxslt.dll" $(BINDIR)
!else
LIBXSLT_LIB=
LIBXSLT_DEF=/D HAVE_XSLT=0
libxslt:

!endif

!if $(HAVE_ICU)
ICU_DEF= /DYAZ_HAVE_ICU=1 /I"$(ICU_INCLUDE)"
icu: $(BINDIR)\icudt$(ICU_VER).dll $(BINDIR)\icuin$(ICU_VER).dll $(BINDIR)\icuuc$(ICU_VER).dll

$(BINDIR)\icudt$(ICU_VER).dll:
copy "$(ICU_BIN)\icudt$(ICU_VER).dll" $(BINDIR)
$(BINDIR)\icuin$(ICU_VER).dll:
copy "$(ICU_BIN)\icuin$(ICU_VER).dll" $(BINDIR)
$(BINDIR)\icuuc$(ICU_VER).dll:
copy "$(ICU_BIN)\icuuc$(ICU_VER).dll" $(BINDIR)
!else
ICU_DEF= /DYAZ_HAVE_ICU=0
icu:
!endif

!if $(HAVE_LIBXSLT)
Expand Down Expand Up @@ -276,7 +319,7 @@ MT=echo
# wsock32.lib advapi32.lib \

LINK_LIBS= kernel32.lib advapi32.lib \
$(ICONV_LIB) $(EXPAT_LIB) $(LIBXML2_LIB) $(LIBXSLT_LIB)
$(ICONV_LIB) $(EXPAT_LIB) $(LIBXML2_LIB) $(LIBXSLT_LIB) $(BZIP2LIB)

COMMON_LNK_OPTIONS= /nologo /subsystem:windows /incremental:no

Expand Down Expand Up @@ -309,7 +352,6 @@ LINK_PROGRAM= $(LINK) \
$(CLIENT_LINK_OPTIONS) \
$(IMPLIB) \
$(YAZLIB) \
$(BZIP2LIB) \
$(LINK_LIBS)


Expand Down
Loading