Subject: | Modifications needed for launching server on Win2008R2 with Strawberry Perl |
Hello,
I've managed to launch a server via Net::Z3950::SimpleServer (NZS) on Windows
with Strawberry Perl!!
I hope you find any of the following information useful and consider it for
inclusion in next releases of NZS.
First things first. I guess I must supply some context here. I'm sure I'll
tell you some things you already know but please, bear with me, it's just for procedure's
clarity sake.
* Strawberry Perl (http://strawberryperl.com/) is our distribution of
choice. The following was done on 5.12.1.0.
* Among other things, Strawberry Perl includes MinGW GCC C/C++ compiler and
Dmake "make" tool
(http://win32.perl.org/wiki/index.php?title=Strawberry_Perl#Description).
* But, unfortunately, that is not enough to have NZS compiled with a clean
"perl Makefile.PL; make; make test; make install".
* This is primarily because YAZ distribution does not include an "import
library" in the format GCC expects it; it certainly includes a ".lib"
library, but not a ".a".
* But also some minor changes are needed in some NZS files to.
So, off my two cents go...
I. On having a libyaz.a usable with MinGW:
1. Install YAZ. Binaries and development are needed. Let's say they are
installed on <YAZPATH>.
[ Note: The following has been proved to work only on 4.2.6 for win64.
but I guess it'll be the same on next releases. ]
and
2. From a DOS command line, enter <YAZPATH>\bin and do:
pexports yaz4.dll >yaz4.def
[ Also a note here. This could of course be done on a PowerShell
command line, but I've found that the resulting yaz4.def is encoded in
UTF-16 and it then can't be used by "dlltool" in the next step without
being decoded. ]
and then do:
dlltool.exe --input-def yaz4.def --dllname yaz4.dll --output-lib
../lib/libyaz.a
It is essential that this two commands run without any error.
3. ** IMPORTANT ** In order to run any program linked against libyaz.a,
<YAZPATH>\bin must be included in the PATH.
[
- Sidebar -
I guess it is possible to compile all of the YAZ suite "a la UNIX" with
MinGW. For example, I've tested recompiling and launching the server
included in "yaz-ztest.exe". Compilation went like this, with a command
line in <YAZPATH>/ztest (for this it's necessary to install also YAZ
source):
gcc -c ztest.c -I ../include
gcc -c read-marc.c -I ../include
gcc -c dummy-opac.c -I ../include
gcc -c read-grs.c -I ../include
gcc -o yaz-ztest_mingw.exe ztest.o read-marc.o dummy-opac.o read-grs.o
-L../lib -lyaz
]
II. On having NZS usable with Strawberry Perl:
1. Download NZS from CPAN and enter the temporary folder containing it's
source files:
Show quoted text
cpan> get Net::Z3950::SimpleServer
cpan> look Net::Z3950::SimpleServer
2. Edit Makefile.PL to set $yazinc and $yazlibs.
[ Note: I'm attaching a modified Makefile.PL and a patch for your
consideration. ]
3. Edit SimpleServer.xs so the correction needed to deal with "the
PerlLIO_open issue" is done *before* the inclusion of yaz headers.
[ Note: I'm also attaching a modified xs and a patch for it. ]
3.5 ;-) same as I.3 above...
4. Now compilation and installation can proceed as usual.
perl Makefile.PL
dmake
dmake test
dmake install
[ Note: Testing phase on Windows will succeed with a modified version of
test.pl. I'm attaching it and it's corresponding patch for your
consideration as well. During that phase some info is required from the
user. ]
Thanks for reading up to here. I hope I've made myself (and my English)
clear.
Please let me know if you have any questions or comments.
Regards,
Julián Esteves
<julian.esteves@janium.com>
Subject: | files_and_patches.zip |
Message body not shown because it is not plain text.