diff --git a/INSTALL.txt b/INSTALL.txt index f570cb33fd..44e20866c4 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -6,16 +6,16 @@ To compile and install SDL: Windows with gcc, either native or cross-compiling: * Read the FAQ at https://wiki.libsdl.org/FAQWindows - * Run './configure; make; make install' + * Run 'cmake -S . -B build && cmake --build build && cmake --install install' macOS with Xcode: * Read docs/README-macosx.md macOS from the command line: - * Run './configure; make; make install' + * Run 'cmake -S . -B build && cmake --build build && cmake --install install' Linux and other UNIX systems: - * Run './configure; make; make install' + * Run 'cmake -S . -B build && cmake --build build && cmake --install install' Android: * Read docs/README-android.md diff --git a/docs/README-emscripten.md b/docs/README-emscripten.md index f73c6090eb..d6beac60ab 100644 --- a/docs/README-emscripten.md +++ b/docs/README-emscripten.md @@ -46,7 +46,7 @@ Build: $ mkdir build $ cd build - $ emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --disable-cpuinfo CFLAGS="-O2" + $ emcmake cmake .. $ emmake make Or with cmake: @@ -67,10 +67,10 @@ Some other SDL3 libraries can be easily built (assuming SDL3 is installed somewh SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/): - $ EMCONFIGURE_JS=1 emconfigure ../configure + $ emcmake cmake .. build as usual... SDL_gfx (http://cms.ferzkopp.net/index.php/software/13-sdl-gfx): - $ EMCONFIGURE_JS=1 emconfigure ../configure --disable-mmx + $ emcmake cmake .. build as usual... diff --git a/docs/README-linux.md b/docs/README-linux.md index 345e0acbc3..438e5a6182 100644 --- a/docs/README-linux.md +++ b/docs/README-linux.md @@ -14,7 +14,7 @@ Build Dependencies Ubuntu 18.04, all available features enabled: - sudo apt-get install build-essential git make autoconf automake libtool \ + sudo apt-get install build-essential git make \ pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \ libaudio-dev libjack-dev libsndio-dev libsamplerate0-dev libx11-dev libxext-dev \ libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \ @@ -25,7 +25,7 @@ Ubuntu 22.04+ can also add `libpipewire-0.3-dev libdecor-0-dev` to that command Fedora 35, all available features enabled: - sudo yum install gcc git-core make cmake autoconf automake libtool \ + sudo yum install gcc git-core make cmake \ alsa-lib-devel pulseaudio-libs-devel nas-devel pipewire-devel \ libX11-devel libXext-devel libXrandr-devel libXcursor-devel libXfixes-devel \ libXi-devel libXScrnSaver-devel dbus-devel ibus-devel fcitx-devel \ diff --git a/docs/README-macos.md b/docs/README-macos.md index cc94ef3c69..da996a3071 100644 --- a/docs/README-macos.md +++ b/docs/README-macos.md @@ -9,25 +9,14 @@ command line tools or Apple's IDE Xcode. # Command Line Build -To build SDL using the command line, use the standard configure and make -process: +To build SDL using the command line, use the CMake build script: ```bash mkdir build cd build -../configure -make -sudo make install -``` - -CMake is also known to work, although it continues to be a work in progress: - -```bash -mkdir build -cd build -cmake -DCMAKE_BUILD_TYPE=Release .. -make -sudo make install +cmake .. +cmake --build . +sudo cmake --install . ``` @@ -38,9 +27,9 @@ script. ```bash mkdir build cd build -CC=$PWD/../build-scripts/clang-fat.sh ../configure -make -sudo make install +cmake .. "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" +cmake --build . +sudo cmake --install . ``` This script builds SDL with 10.9 ABI compatibility on 64-bit Intel and 11.0 @@ -93,7 +82,7 @@ NSApplicationDelegate implementation: # Using the Simple DirectMedia Layer with a traditional Makefile -An existing autoconf/automake build system for your SDL app has good chances +An existing CMake build system for your SDL app has good chances to work almost unchanged on macOS. However, to produce a "real" Mac binary that you can distribute to users, you need to put the generated binary into a so called "bundle", which is basically a fancy folder with a name like diff --git a/docs/README-porting.md b/docs/README-porting.md index de30592268..50fb0fe335 100644 --- a/docs/README-porting.md +++ b/docs/README-porting.md @@ -11,14 +11,14 @@ on based on C preprocessor symbols. There are two basic ways of building SDL at the moment: -1. The "UNIX" way: ./configure; make; make install +1. CMake: cmake -S . -B build && cmake --build build && cmake --install install - If you have a GNUish system, then you might try this. Edit configure.ac, + If you have a GNUish system, then you might try this. Edit CMakeLists.txt, take a look at the large section labelled: - "Set up the configuration based on the host platform!" + "Platform-specific options and settings!" - Add a section for your platform, and then re-run autogen.sh and build! + Add a section for your platform, and then re-run 'cmake -S . -B build' and build! 2. Using an IDE: diff --git a/docs/README-riscos.md b/docs/README-riscos.md index 4c31b5cf7c..d17d173ade 100644 --- a/docs/README-riscos.md +++ b/docs/README-riscos.md @@ -12,19 +12,13 @@ Requirements: Compiling: ---------- -Currently, SDL for RISC OS only supports compiling with GCCSDK under Linux. Both the autoconf and CMake build systems are supported. - -The following commands can be used to build SDL for RISC OS using autoconf: - - ./configure --host=arm-unknown-riscos --prefix=$GCCSDK_INSTALL_ENV - make - make install +Currently, SDL for RISC OS only supports compiling with GCCSDK under Linux. The following commands can be used to build SDL for RISC OS using CMake: cmake -Bbuild-riscos -DCMAKE_TOOLCHAIN_FILE=$GCCSDK_INSTALL_ENV/toolchain-riscos.cmake -DRISCOS=ON -DCMAKE_INSTALL_PREFIX=$GCCSDK_INSTALL_ENV -DCMAKE_BUILD_TYPE=Release cmake --build build-riscos - cmake --build build-riscos --target install + cmake --install build-riscos When using GCCSDK 4.7.4 release 6 or earlier versions, the builtin atomic functions are broken, meaning it's currently necessary to compile with `--disable-gcc-atomics` using autotools or `-DSDL_GCC_ATOMICS=OFF` using CMake. Newer versions of GCCSDK don't have this problem.