|
| 1 | +# Cross-compiling under mingw |
| 2 | + |
| 3 | +Just running `make` in this directory should download |
| 4 | +and build opusfile and its dependencies. Some mingw |
| 5 | +libraries need to be compiled into the final package. |
| 6 | + |
| 7 | +## Generic instructions |
| 8 | + |
| 9 | +To build opusfile under mingw, you need to first build: |
| 10 | + |
| 11 | +- libogg |
| 12 | +- libopus |
| 13 | +- openssl |
| 14 | + |
| 15 | +For 'make check' to work, you may need wine installed. |
| 16 | + |
| 17 | +To build openssl, try: |
| 18 | + |
| 19 | + CROSS_COMPILE="i686-w64-mingw32-" ./Configure mingw no-asm no-shared --prefix=$PWD/mingw && make depend && make -j8 && make install |
| 20 | + |
| 21 | +To build opusfile, try: |
| 22 | + |
| 23 | + CC=i686-w64-mingw32-gcc PKG_CONFIG_PATH=$PWD/lib/pkgconfig RANLIB=i686-w64-mingw32-ranlib make -f ../unix/Makefile |
| 24 | + |
| 25 | +## Building the release package |
| 26 | + |
| 27 | +Running `make package` should produce a binary package. |
| 28 | + |
| 29 | +The steps are something like |
| 30 | + |
| 31 | +- Compile dynamic opusfile with: |
| 32 | + - ./configure --host=i686-w64-mingw32 --prefix=/path/to/builddir/mingw \ |
| 33 | + PKG_CONFIG_PATH=/path/to/builddir/mingw/lib/pkgconfig |
| 34 | + - make && make check && make -C doc/latex |
| 35 | + - If Doxygen fails because of unescaped '#' characters in URLs |
| 36 | + Update to at least Doxygen 1.8.15. Doxygen 1.8.3 also works. |
| 37 | +- mkdir opusfile-${version}-win32 |
| 38 | +- Copy AUTHORS COPYING README.md include/opusfile.h to the release dir. |
| 39 | + - Don't put opusfile.h in an opusfile-${version}-win32/include directory, |
| 40 | + just put it straight in the release dir. |
| 41 | +- Merge changes between README.md and the version in the last |
| 42 | + binary release. E.g. it's good to include versions of the dependencies, |
| 43 | + release notes, etc. |
| 44 | +- Convert README.md to DOS line endings. |
| 45 | +- Copy .libs/libopusfile-0.dll to the release dir. |
| 46 | +- Copy .libs/libopusfile.a to the release dir. |
| 47 | +- Copy .libs/libopusfile.dll.a to the release dir. (May not be needed?) |
| 48 | +- Copy .libs/libopusurl-0.dll to the release dir. |
| 49 | +- Copy .libs/libopusurl.a to the release dir. |
| 50 | +- Copy .libs/libopusurl.dll.a to the release dir. (May not be needed?) |
| 51 | +- Copy mingw/bin/*.dll to the release dir for dependencies. |
| 52 | +- Copy any other dependent dlls, e.g. on Fedora 23 I needed to copy |
| 53 | + /usr/i686-w64-mingw32/sys-root/mingw/bin/libgcc_s_sjlj-1.dll |
| 54 | + /usr/i686-w64-mingw32/sys-root/mingw/bin/libwinpthread-1.dll |
| 55 | + On Gentoo I needed to copy |
| 56 | + /usr/lib64/gcc/i686-w64-mingw32/7.3.0/libgcc_s_sjlj-1.dll |
| 57 | + TODO: It may be possible to avoid this with CFLAGS="-static-libgcc" |
| 58 | +- Copy doc/latex/refman.pdf to opusfile-${version}-win32/opusfile-${version}.pdf |
| 59 | +- Copy examples/.libs/*.exe to the release dir. |
| 60 | +- Run "i686-w64-ming32-strip *.dll *.a *.exe" in the release dir. |
| 61 | +- In the release dir, run: |
| 62 | + sha256sum * > SHA256SUMS.txt |
| 63 | + gpg --detach-sign --armor SHA256SUMS.txt |
| 64 | +- In the parent directory, create the archive: |
| 65 | + zip -r opusfile-${version}-win32.zip opusfile-${version}-win32/* |
| 66 | +- Copy the archive to a clean system and verify the examples work |
| 67 | + to make sure you've included all the necessary libraries. |
| 68 | + |
0 commit comments