Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows cross build documentation #2736

Closed
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
54 changes: 40 additions & 14 deletions scripts/Windows/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ NOTE: Instructions below use `sudo` to specify operations you may need to run
with privilege elevation (assuming installation into a `PREFIX=/usr/$ARCH`);
the majority of operations can be done (recommended) as an unprivileged user.

NOTE: The instrunctions reported below can be saved as shell sctipts and execued
with the following command (otherwise the change directory commands are not permanent):
`. ./scriptname.sh`

pthread library
^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -222,9 +226,12 @@ presumed inconsequential. You can try a not-"inlined" build instead.

Finally, install the resulting files into locations under `PREFIX`:

:; sudo cp *.dll ${PREFIX}/pthreads/lib/
:; sudo cp *.a ${PREFIX}/lib/
:; sudo cp pthread.h sched.h semaphore.h ${PREFIX}/pthreads/include
:; sudo mkdir -p $PREFIX/pthreads/lib/
:; sudo cp *.dll $PREFIX/pthreads/lib/
:; sudo mkdir -p $PREFIX/lib/
:; sudo cp *.a $PREFIX/lib/
:; sudo mkdir -p $PREFIX/pthreads/include/
:; sudo cp pthread.h sched.h semaphore.h $PREFIX/pthreads/include


MinGW regex library
Expand Down Expand Up @@ -272,11 +279,23 @@ libusb
:; cd "$WSDIR"
:; unzip "$DLDIR"/libusb-compat-0.1-master.zip
:; cd libusb-compat-0.1-master
:; export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
:; export PATH=$PREFIX/bin/:$PATH
:; ./bootstrap.sh
:; ./configure --prefix="$PREFIX" $HOST_FLAG
:; make
:; sudo make install

[NOTE]
======
If it complains about
`syntax error near unexpected toket 'LIBUSB_1_0,'
'PKG_CHECK_MODULES(LIBUSB_1_0, libusb-1.0 >= 0.9.1)'`
please install pkgconf:

:; sudo apt-get install pkgconf

======

zlib
^^^^
Expand Down Expand Up @@ -375,6 +394,10 @@ Needed for libneon.
:; cd "$WSDIR"
:; tar xzf "$DLDIR"/libxml2-v2.9.14.tar.gz
:; cd libxml2-v2.9.14
:; libtoolize
:; aclocal
:; autoheader
:; autoupdate
:; ./autogen.sh --prefix="$PREFIX" $HOST_FLAG --without-python
:; make
:; sudo make install
Expand Down Expand Up @@ -424,6 +447,10 @@ and/or of the system antivirus interaction?..
:; make
:; sudo make install

[NOTE]
======
If the build is failing on Virtual Box VM please make sure to have installed the Virtual Box Guest Additions.
======

/////////////////////////////////////////////////////////////////////////////
WIP - fontconfig not usable yet due to ICU failing to cross-build
Expand Down Expand Up @@ -505,6 +532,7 @@ such context, this must be something about STDCALL and/or "extern C"...
:; cd "$WSDIR"
:; tar xzf "$DLDIR"/libgd-2.3.3.tar.gz
:; cd libgd-2.3.3
:; export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
:; ./configure --prefix="$PREFIX" $HOST_FLAG \
--with-png --with-freetype \
--without-tiff --without-jpeg --without-xpm \
Expand Down Expand Up @@ -581,16 +609,14 @@ the Makefiles for current `install` target definition to run its job without
`install-docs` part (example posted below).

#:; ( cd "$DLDIR" && git clone -b fix-mingw-cross https://github.com/jimklimov/neon neon-git )
:; ( cd "$DLDIR" && git clone https://github.com/notroj/neon neon-git )
:; ( cd "$DLDIR/neon-git" && ./autogen.sh )
:; cd "$WSDIR"
:; rm -rf neon-git ; mkdir neon-git
:; cd neon-git
:; "$DLDIR"/neon-git/configure --prefix="$PREFIX" $HOST_FLAG \
--enable-shared --with-ssl=openssl
:; git clone https://github.com/notroj/neon
:; cd "$WSDIR/neon"
:; export PATH=$PREFIX/bin:$PATH
:; ./autogen.sh
:; ./configure --prefix="$PREFIX" $HOST_FLAG --enable-shared --with-ssl=openssl
:; make all docs
:; sudo make install \
|| sudo make install-lib install-headers install-config install-nls ###install-docs
:; sudo make install || sudo make install-lib install-headers install-config install-nls ###install-docs


/////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -744,11 +770,11 @@ or, depending on the build environment(s) you have prepared,
This is also automated for common NUT CI build script, calling it like this:
------
# Try to guess bitness based on ARCH or CFLAGS:
BUILD_TYPE=cross-windows-mingw ./ci_build.sh
BUILD_TYPE=cross-windows-mingw ./ci_build.sh --prefix=$PREFIX $HOST_FLAG

# Or specifically:
BUILD_TYPE=cross-windows-mingw-32 ./ci_build.sh
BUILD_TYPE=cross-windows-mingw-64 ./ci_build.sh
BUILD_TYPE=cross-windows-mingw-32 ./ci_build.sh --prefix=$PREFIX $HOST_FLAG
BUILD_TYPE=cross-windows-mingw-64 ./ci_build.sh --prefix=$PREFIX $HOST_FLAG
------
======

Expand Down
Loading