Skip to content

Commit

Permalink
Merge pull request #5247 from maron2000/mac_build
Browse files Browse the repository at this point in the history
Add required library information for macOS toBUILD.md
  • Loading branch information
joncampbell123 authored Oct 18, 2024
2 parents 549e77e + aae7284 commit bbc7a9c
Showing 1 changed file with 13 additions and 29 deletions.
42 changes: 13 additions & 29 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,34 +75,29 @@ sudo make install
sudo make install
```

* macOS compile (SDL1)
* Build natively for the host architecture
* macOS
* First install the required libraries needed.
```
./build-macos
brew install autoconf automake nasm glfw glew fluid-synth libslirp pkg-config
```
* Build a Universal Binary on an Apple Silicon CPU (will *not* work on Intel)
* Compile natively for the host architecture (SDL1 or SDL2)
```
./build-macos universal
````
You can build an App Bundle from the result of this build with
```
make dosbox-x.app
./build-macos
```

* macOS compile (SDL2)
* Build natively for the host architecture
```
./build-macos-sdl2
```
* Build a Universal Binary on an Apple Silicon CPU (will *not* work on Intel)
* _(Optional)_ Add `universal` option to build an Universal Binary on an Apple Silicon CPU (will *not* work on Intel)
```
./build-macos universal
```
```
./build-macos-sdl2 universal
````
You can build an App Bundle from the result of this build with
* You can build an App Bundle from the result of this build with
```
make dosbox-x.app
```

* MinGW compile for Windows 7 or later
* First install the required libraries needed.
Libraries for mingw32(32-bit)
Expand All @@ -113,40 +108,29 @@ sudo make install
```
pacman -S git make mingw-w64-x86_64-toolchain mingw-w64-x86_64-libslirp mingw-w64-x86_64-libtool mingw-w64-x86_64-nasm autoconf automake mingw-w64-x86_64-ncurses
```
* Compile SDL1 (32-bit or 64-bit)
* Compile (SDL1 or SDL2, Common for 32-bit/64-bit builds)
```
./build-mingw
```
Compile SDL2 (32-bit or 64-bit)
```
./build-mingw-sdl2
```

* MinGW compile (using MinGW32, not MinGW-w64: see NOTICE below) for lower-end systems including Windows XP or later (SDL1)
* MinGW compile (using MinGW32, not MinGW-w64: see NOTICE below) for lower-end systems including Windows XP or later (SDL1 or SDL2, 32-bit only)
```
./build-mingw-lowend
```

* MinGW compile (using MinGW32, not MinGW-w64: see NOTICE below) for lower-end systems including Windows XP or later (SDL2)
```
./build-mingw-lowend-sdl2
```

* MinGW compile (using MinGW32, not MinGW-w64: see NOTICE below) on Windows to target the DOS platform (MS-DOS or compatible with HX DOS Extender)
* MinGW compile (using MinGW32, not MinGW-w64: see NOTICE below) on Windows to target the DOS platform (MS-DOS or compatible with HX DOS Extender, SDL1 only)
```
./build-mingw-hx-dos
```

NOTICE: Use the 32-bit toolchain from the original MinGW project for the lowend and HX-DOS builds, not the MinGW-w64 project.
Binaries compiled with MinGW-w64 have extra dependencies which are not supported by Windows XP or the HX DOS Extender.

macOS: If you want to make an .app bundle you can run from the Finder, compile the program as instructed then run ``make dosbox-x.app``.

XCode (on macOS, from the Terminal) to target macOS
```
./build-debug
```

## To compile DOSBox-X in Ubuntu (tested with 20.04 and 20.10):

First install the development tools, headers and libraries needed
Expand Down

6 comments on commit bbc7a9c

@emendelson
Copy link
Contributor

@emendelson emendelson commented on bbc7a9c Oct 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maron2000 - unfortunately, the universal option fails under macOS Sequoia on an M2 Mac. I followed the instructions exactly; updated brew and ran the brew install command. When I tried either ./build-macos-sdl2 universal or ./build-macos universal, I got this result:

checking build system type... config.sub: invalid option --enable-universal
Try `config.sub --help' for more information.
configure: error: /bin/sh ./config.sub  --enable-universal failed

Have I missed anything obvious?

@maron2000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a ARM mac to test, but the command itself is unchanged since PR #4054.
@lucyllewy Any ideas?

@emendelson
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a ARM mac to test, but the command itself is unchanged since PR #4054.

@maron2000 - I didn't test the earlier PR. Anyway, It's hard to imagine how this could possibly work, because I don't think brew installs the Intel libraries that are needed for a universal build. But of course I am only guessing about this.

@lucyllewy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My original PR requires that you have both architectures of homebrew installed (native in /opt and x86_64 in /usr/local) and the libraries installed by both of these. That is the only way that the universal build will succeed.

@emendelson
Copy link
Contributor

@emendelson emendelson commented on bbc7a9c Oct 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucyllewy - Yes, I once knew that, and then forgot it. This shouldn't be hard to accomplish. Thank you.

@emendelson
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucyllewy - Has anyone given clear advice on installing the required Intel homebrew files on an ARM Mac? I tried using the method described here:

https://www.wisdomgeek.com/development/installing-intel-based-packages-using-homebrew-on-the-m1-mac/

using arch -x86_64 to precede the commands. But fluidsynth (I think) wouldn't install; the error message was "read-only file system." So I gave up and built separately on an Intel Mac and an M1 Mac and used lipo to merge the two executables. This worked, as it has in the past, but if anyone has any advice on doing all this on an ARM Mac, I would be grateful.

Please sign in to comment.