127b27ec6Sopenharmony_ci# lz4 for DOS/djgpp
227b27ec6Sopenharmony_ciThis file details on how to compile lz4.exe, and liblz4.a for use on DOS/djgpp using
327b27ec6Sopenharmony_ciAndrew Wu's build-djgpp cross compilers ([GH][0], [Binaries][1]) on OSX, Linux.
427b27ec6Sopenharmony_ci
527b27ec6Sopenharmony_ci## Setup
627b27ec6Sopenharmony_ci* Download a djgpp tarball [binaries][1] for your platform.  
727b27ec6Sopenharmony_ci* Extract and install it (`tar jxvf djgpp-linux64-gcc492.tar.bz2`).  Note the path.  We'll assume `/home/user/djgpp`.
827b27ec6Sopenharmony_ci* Add the `bin` folder to your `PATH`.  In bash, do `export PATH=/home/user/djgpp/bin:$PATH`.
927b27ec6Sopenharmony_ci* The `Makefile` in `contrib/djgpp/` sets up `CC`, `AR`, `LD` for you.  So, `CC=i586-pc-msdosdjgpp-gcc`, `AR=i586-pc-msdosdjgpp-ar`, `LD=i586-pc-msdosdjgpp-gcc`.
1027b27ec6Sopenharmony_ci
1127b27ec6Sopenharmony_ci## Building LZ4 for DOS
1227b27ec6Sopenharmony_ciIn the base dir of lz4 and with `contrib/djgpp/Makefile`, try:
1327b27ec6Sopenharmony_ciTry:
1427b27ec6Sopenharmony_ci* `make -f contrib/djgpp/Makefile`
1527b27ec6Sopenharmony_ci* `make -f contrib/djgpp/Makefile liblz4.a`
1627b27ec6Sopenharmony_ci* `make -f contrib/djgpp/Makefile lz4.exe`
1727b27ec6Sopenharmony_ci* `make -f contrib/djgpp/Makefile DESTDIR=/home/user/dos install`, however it doesn't make much sense on a \*nix.
1827b27ec6Sopenharmony_ci* You can also do `make -f contrib/djgpp/Makefile uninstall`
1927b27ec6Sopenharmony_ci
2027b27ec6Sopenharmony_ci[0]: https://github.com/andrewwutw/build-djgpp
2127b27ec6Sopenharmony_ci[1]: https://github.com/andrewwutw/build-djgpp/releases
22