diff --git a/BUILD_LINUX.md b/BUILD_LINUX.md index e51251b1..5271b949 100644 --- a/BUILD_LINUX.md +++ b/BUILD_LINUX.md @@ -2,6 +2,7 @@ ## Requirements +* Autotools * GCC 5.0+ * SDL 2.0.8+ * SDL_image 2.0.0+ @@ -11,8 +12,6 @@ * libsamplerate (optional) * zlib (optional) -If you cloned the code from the GitHub repo you also need the GNU Autotools. - You need libarchive if you want to use zipped ROM sets. Without libsamplerate the PC Speaker will not emit any sound and other audio @@ -21,7 +20,7 @@ sources will not be played unless they are at the same rate as the mixer. Without zlib the ZMBV compressed video capture format will not work. ## General instructions -If you cloned the code from GitHub run: +First of all run: ``` $ autoreconf --install ``` @@ -32,9 +31,9 @@ $ ./configure --with-librocket-prefix=PATH/TO/LIBROCKET $ make $ make install ``` -Use './configure --help' to read the various compilation options. +Use `./configure --help` to read the various compilation options. -You can omit the --with-librocket-prefix if you installed libRocket has a +You can omit the `--with-librocket-prefix` if you installed libRocket has a system library. Any missing library will be pointed out; use your distributon's software @@ -42,11 +41,81 @@ manager to install them (except libRocket, see notes below). ### libRocket -libRocket is a C++ user interface package based on the HTML and CSS standards. +libRocket is a C++ user interface package based on the HTML and CSS standards. + +To compile libRocket you'll need cmake and libfreetype. + IBMulator needs various fixes so use the version from my repository. ``` -$ git clone https://github.com/barotto/libRocket.git -$ cd libRocket/Build -$ cmake -G "Unix Makefiles" +$ git clone https://github.com/barotto/libRocket.git +$ cd libRocket/Build +$ cmake -G "Unix Makefiles" $ make ``` + +## Statically linked version + +Static linking is totally unsupported on Linux. +Just follow the previous instructions and compile with dynamic linking. + +This procedure works only on my Ubuntu system with some library recompiled. +I'll keep these notes here only for my reference and convenience. + +**NOTE:** libSDL2 will always be linked dynamically. + +Needed libs: + +* libtiff +* libjpeg +* libwebp +* liblzma +* libjbig +* libzstd +* libharfbuzz +* libbz2 +* liblzo2 +* libfreetype6 + +``` +$ sudo apt install libtiff-dev libjpeg-dev libwebp-dev liblzma-dev libjbig-dev \ +libzstd-dev libharfbuzz-dev libbz2-dev liblzo2-dev libfreetype6-dev +``` + +Compile libarchive with lot of stuff removed: +``` +$ git clone https://github.com/libarchive/libarchive.git +$ cd libarchive +$ ./configure --without-bz2lib --without-libb2 --without-iconv --without-lz4 \ +--without-zstd --without-lzma --with-lzo2 --without-cng --without-nettle \ +--without-openssl --without-xml2 --without-expat \ +--prefix=/home/marco/workspace/libarchive/release +$ make -j24 +$ make install +``` + +Compile GLEW: +``` +$ git clone https://github.com/nigels-com/glew.git +$ cd glew/build/cmake +$ ccmake +$ make -j24 +$ make install +``` + +Compile libRocket with the static lib option enabled: +``` +$ cd libRocket/Build/ +$ cmake -G "Unix Makefiles" -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release \ +-DCMAKE_INSTALL_PREFIX:PATH=/home/marco/workspace/libRocket/release +$ make -j24 +$ make install +``` + +Configure IBMulator: +``` +$ ./configure --prefix=/home/marco/workspace/IBMulator/release \ +--enable-static --disable-sdltest \ +--with-librocket-prefix=/home/marco/workspace/libRocket/release \ +--with-glew-prefix=/home/marco/workspace/glew/release \ +--with-libarchive-prefix=/home/marco/workspace/libarchive/release +``` diff --git a/BUILD_WINDOWS.md b/BUILD_WINDOWS.md index d080afe6..f00508ad 100644 --- a/BUILD_WINDOWS.md +++ b/BUILD_WINDOWS.md @@ -17,14 +17,11 @@ clicking the right mouse button and choosing 'paste'. We will use mingw-w64 (mingw-w64.org) under **MSYS2** (www.msys2.org) 1. Go to the [MSYS2 website](http://www.msys2.org), download the x86_64 package -and follow its install instructions. -2. Open the **MSYS2 MSYS** shell and using the package manager `pacman`: -install the toolchain: -`pacman -S mingw-w64-x86_64-binutils mingw-w64-x86_64-gcc` -install cmake, make, Autotools, and git: -`pacman -S mingw-w64-x86_64-cmake mingw-w64-x86_64-pkg-config make pkgconfig autoconf automake libtool git` -3. Install the libraries needed by libRocket and IBMulator -`pacman -S mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_image mingw-w64-x86_64-glew mingw-w64-x86_64-libsamplerate mingw-w64-x86_64-libarchive mingw-w64-x86_64-freetype` +and follow its installation instructions. +2. Open the **MSYS2 MSYS** shell and install the toolchain: +`pacman -S mingw-w64-x86_64-binutils mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-pkg-config make pkgconfig autoconf automake libtool git` +3. Install the libraries needed by libRocket and IBMulator: +`pacman -S mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_image mingw-w64-x86_64-glew mingw-w64-x86_64-libsamplerate mingw-w64-x86_64-libarchive mingw-w64-x86_64-freetype mingw-w64-x86_64-lzo2` You can compile IBMulator with dynamic or static linking; see [below](#installation) for more info on the two versions. I suggest static @@ -48,8 +45,8 @@ line) and: 4. Create the Makefile with cmake: `cmake -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/mingw64/x86_64-w64-mingw32` for static linking add `-DBUILD_SHARED_LIBS=OFF` -5. Build and install (change the 4 with the number of your CPU's cores): -`make -j4 && make install` +5. Build and install (change the 8 with the number of your CPU's cores): +`make -j8 && make install` ## STEP 3. Build IBMulator @@ -68,17 +65,19 @@ Open the **MSYS2 MinGW 64-bit** shell and: for static linking add `--enable-static` use the `--help` option to see the available build options; use the `--prefix` option to install the program with all its assets inside a -folder of your choosing (see [below](#installation) for more info). +folder of your choosing (see [below](#installation) for more info). +Example: +`./configure --prefix=/c/workspace/IBMulator/release --enable-static` 6. Build: -`make -j4` +`make -j8` 7. Install if you used the `--prefix` option: `make install` ### Installation In order to use the program you'll need to "install" it. The install process is -not a Windows program installation. Its purpose is to organize executables and -assets inside a folder from which the program can run. +not a Windows program installation. Its purpose is to organize the executable and +its assets inside a folder from which the program can run. This is the needed directory structure: @@ -121,6 +120,10 @@ Variables. #### option 2: copy the library files Copy the following DLLs inside IBMulator's `bin` folder. +**NOTE:** this list changes periodically depending on the current version of +MSYS2/MinGW. You can use the Dependency Walker program to determine the up to +date list of libraries. + From C:\msys64\mingw64\bin: ``` @@ -138,7 +141,6 @@ libintl-8.dll libjpeg-8.dll liblz4.dll liblzma-5.dll -libnettle-6.dll libpcre-1.dll libpng16-16.dll libsamplerate-0.dll @@ -160,10 +162,6 @@ libRocketCore.dll libRocketDebugger.dll ``` -**NOTE:** this list changes periodically depending on the current version of -MSYS2/MinGW. You can use the Dependency Walker program to determine the up to -date list of libraries. - ## Debugging Install the GDB debugger: