G'day All,

Not sure if this is the correct list. Can't seem to find a contact for
xml-security-c for xerces-c.

This is just a request the think about supporting Win32 compiles using
Cygwin or MingW32 in the Makefiles. I have been using xml-security-c
with xerces-c now for over 7 years under many environments. Xerces-c
will compile using MingW32 with very little modification, however
xml-security-c has taken the option that if you are using a Makefile,
then you must be using a Linux style OS (like native Cygwin). I found
this comment in one of the xml-security-c Makefiles:

  # Utility files.  Note we don't worry about checking
  # if the UNIX stuff is necessary - we just assume that
  # we are running on a *NIX system because compiling under
  # make.  Cygwin compiles use the UNIX utilities, not windows

This is not quite correct. You can use Cygwin to build native Win32
applications by either using the mingw32-g++ command or by giving the
Cygwin g++ compiler the "-mno-cygwin" switch; and therefore you don't
need to have a VisualStudio compiler for Windows builds.

Anyway, I have managed to compile xml-security-c 1.5.0 for xerces-c
3.0.1 by doing the following modifications to xml-security-c:

1. export CPPFLAGS="-mno-cygwin -I/usr/local/include"
2. export LDFLAGS="-mno-cygwin -L/usr/local/lib"
3. Edit the following files and:
   * Remove -DCYGWIN
   * Replace "-g -O2" with "-O2" (personal preference)
   configure.ac, configure
4. Edit the following files and:
   * Replace "unix" with "win"
   * Replace "Unix" with "Win32"
   include/Makefile.am include/Makefile.in 
   lib/Makefile.am lib/Makefile.in
5. Edit src/utils/winutils/XSECBinHTTPURIInputStream.cpp
   a. Modify compareAndSway() to use: (What's with the embedded
assembler?)
        return InterlockedCompareExchangePointer(toFill,
(void*)newValue, (void*)toCompare);
   b. Added <limits.h> at top of file so that USHRT_MAX is defined.
6. Edit src/framework/XSECW32Config.hpp and comment out "#define
HAVE_WINCAPI 1".
7. ./configure --without-xalan
8. cp -r src/utils/winutils include/xsec/utils; rm -f
include/xsec/utils/winutils/*.cpp
9. make
10. make install

Unfortunately these mods don't make the code frendly to be built under
Linux. This was just a quick hack to get it to work with Cygwin/MingW32.
The original files work fine with Linux.

Have Fun !!

Shane Hill

Shane D. Hill (B.E. Aero. Hons.)
Science Team Leader: Aircraft Flight Dynamics, Modelling & Simulation
Aircraft Vehicles Division
Defence Science & Technology Organisation
506 Lorimer St, Fishermens Bend, Vic. 3207 AUSTRALIA
[email protected]
+61 3 9626 7811
+61 3 9626 7705
http://maps.google.com/maps?q=-37.822904,144.911385+(DSTO+Melbourne)

IMPORTANT: This email remains the property of the Australian Defence 
Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 
1914.  If you have received this email in error, you are requested to contact 
the sender and delete the email.



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to