We're trying to include Unbound into MXE, a cross-platform toolkit for
Windows, http://mxe.cc
Just like the KDE folks, we see this as a good way to roll out our
software to that platform.
The documentation online on how to compile Unbound for Windows is
limited, so we're a bit
confused how to do this. Basically, MXE is an environment with a gcc
cross-compiler and
lots of prebuilt crossover libraries. Usually we override variables
like CC, AR, LD to
get things built.
But Unbound is difficult, and appears to have lots of Windows-specifics
built in. Can you
perhaps give some guidance on mapping the software?
# are we on MinGW?
if uname -s 2>&1 | grep MINGW32 >/dev/null; then on_mingw="yes"
else
if echo $target | grep mingw32 >/dev/null; then on_mingw="yes"
else on_mingw="no"; fi
fi
...have been...
# are we on MinGW?
if uname -s 2>&1 | grep MINGW32 >/dev/null; then on_mingw="yes"
else
if echo $host | grep mingw32 >/dev/null; then on_mingw="yes"
else on_mingw="no"; fi
fi
...since you are not building a cross-compiler?
That's according to
--host: In which system the generated program will run.
--build: In which system the program will be built.
--target: this option is only used to build a cross-compiling toolchain.
When the tool chain generates executable program, in which target system
the program will run.
Could you give us the command sequence that you use for cross-compiling
Unbound for Windows?
We're reverse engineering it from autoconfig stuff now, and that's not a
lot of fun.
The build code:
$ mingw32-configure --enable-debug --enable-static-exe --disable-flto
... more configure options
$ make
$ zip myunbound.zip unbound.exe unbound-anchor.exe LICENSE ...
You can also compile without the static executables, this is for example
done by the build scripts in dnssec-trigger; (without
--enable-static-exe, but you'll need stuff like openssl.dll).