Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | pmbaty | 1 | |
| 2 | The latest PhysicsFS information and releases can be found at: |
||
| 3 | https://icculus.org/physfs/ |
||
| 4 | |||
| 5 | Building is (ahem) very easy. |
||
| 6 | |||
| 7 | |||
| 8 | ALL PLATFORMS: |
||
| 9 | |||
| 10 | Please read the text file LICENSE.txt in the root of the source tree. |
||
| 11 | The license is extremely liberal, even to closed-source, commercial |
||
| 12 | applications. |
||
| 13 | |||
| 14 | If you've got Doxygen (http://www.doxygen.org/) installed, you can run it |
||
| 15 | without any command line arguments in the root of the source tree to generate |
||
| 16 | the API reference (or build the "docs" target from your build system). This |
||
| 17 | is optional. You can browse the API docs online here: |
||
| 18 | |||
| 19 | https://icculus.org/physfs/docs/ |
||
| 20 | |||
| 21 | |||
| 22 | |||
| 23 | BUILD IT WITH YOUR OWN PROGRAM: |
||
| 24 | |||
| 25 | If you don't care about formal packaging: just add everything in the "src" |
||
| 26 | directory to whatever you use to build your program and compile it along with |
||
| 27 | everything else, and you're done. It should compile with any reasonable |
||
| 28 | ANSI C compiler, should build cleanly even with excessive compiler warnings |
||
| 29 | enabled, needs no extra configuration, and allows static linking. |
||
| 30 | WinRT and Haiku need C++ compilers for their system APIs, but if you aren't on |
||
| 31 | these platforms and don't have a C++ compiler, don't build the .cpp files. |
||
| 32 | Likewise: Apple platforms (macOS, iOS, etc) need an Objective-C compiler, but |
||
| 33 | if you aren't on these platforms and don't have a Objective-C compiler, don't |
||
| 34 | build the .m file. Everything you need is in the .c sources. |
||
| 35 | |||
| 36 | If this all worked for your specific project, you can stop reading now. |
||
| 37 | |||
| 38 | |||
| 39 | |||
| 40 | UNIX: |
||
| 41 | |||
| 42 | You will need CMake (https://www.cmake.org/) 2.4 or later installed. |
||
| 43 | |||
| 44 | Make a directory, wherever you like. This will be your build directory. |
||
| 45 | |||
| 46 | Chdir to your build directory. Run "cmake /where/i/unpacked/physfs" to |
||
| 47 | generate Makefiles. You can then run "ccmake ." and customize the build, |
||
| 48 | but the defaults are probably okay. You can have CMake generate KDevelop |
||
| 49 | or Ninja project files or whatever, if you prefer these. |
||
| 50 | |||
| 51 | Run "make". PhysicsFS will now build. |
||
| 52 | |||
| 53 | As root, run "make install". |
||
| 54 | If you get sick of the library, run "make uninstall" as root |
||
| 55 | and it will remove all traces of the library from the system paths. |
||
| 56 | |||
| 57 | Once you are satisfied, you can delete the build directory. |
||
| 58 | |||
| 59 | Primary Unix development is done with GNU/Linux, but PhysicsFS is known to |
||
| 60 | work out of the box with several flavors of Unix. It it doesn't work, patches |
||
| 61 | to get it running can be sent to icculus@icculus.org. |
||
| 62 | |||
| 63 | |||
| 64 | Windows: |
||
| 65 | |||
| 66 | If building with Cygwin, mingw32, MSYS, or something else that uses the GNU |
||
| 67 | toolchain, follow the Unix instructions, above. |
||
| 68 | |||
| 69 | If you want to use Visual Studio, nmake, or the Platform SDK, you will need |
||
| 70 | CMake (https://www.cmake.org/) 2.4 or later installed. Point CMake at the |
||
| 71 | CMakeLists.txt file in the root of the source directory and hit the |
||
| 72 | "Configure" button. After telling it what type of compiler you are targeting |
||
| 73 | (Borland, Visual Studio, etc), CMake will process for while and then give you |
||
| 74 | a list of options you can change (what archivers you want to support, etc). |
||
| 75 | If you aren't sure, the defaults are probably fine. Hit the "Configure" |
||
| 76 | button again, then "OK" once configuration has completed with options that |
||
| 77 | match your liking. Now project files for your favorite programming |
||
| 78 | environment will be generated for you in the directory you specified. |
||
| 79 | Go there and use them to build PhysicsFS. |
||
| 80 | |||
| 81 | PhysicsFS will only link directly against system libraries that have existed |
||
| 82 | since Windows NT 3.51. If there's a newer API we want to use, we try to |
||
| 83 | dynamically load it at runtime and fallback to a reasonable behaviour when |
||
| 84 | we can't find it. Note that Windows 98 and later _should_ |
||
| 85 | work if you use the Microsoft Layer for Unicode (UNICOWS.DLL) to provide |
||
| 86 | some missing system APIs, but this is no longer tested as of PhysicsFS 2.1.0. |
||
| 87 | PhysicsFS 2.0.x is known to work with Windows 95 without UNICOWS.DLL. |
||
| 88 | |||
| 89 | PhysicsFS works on 32-bit and 64-bit Windows. There is no 16-bit Windows |
||
| 90 | support at all. Windows RT is covered below. |
||
| 91 | |||
| 92 | |||
| 93 | Windows RT: |
||
| 94 | |||
| 95 | Windows RT (Windows Phone, Windows Store, UWP) 8.0 and later are supported. |
||
| 96 | Make sure you include both physfs_platform_windows.c _and_ |
||
| 97 | physfs_platform_winrt.cpp in your build, and that the C++ file has |
||
| 98 | "Consume Windows Runtime Extension" set to "Yes" in its Visual Studio |
||
| 99 | properties (from the command line, you want to compile this file with the |
||
| 100 | "/ZW" compiler switch). CMake can, in theory, generate a project file for |
||
| 101 | WinRT if you pick a recent Visual Studio target, choose manual cross-compile |
||
| 102 | options, and set the system name to "WindowsPhone" or "WindowsStore" and the |
||
| 103 | correct OS version (8.0 or later). |
||
| 104 | |||
| 105 | |||
| 106 | PocketPC/WindowsCE: |
||
| 107 | |||
| 108 | Support for PocketPC was removed in PhysicsFS 2.1.0. This was known to work |
||
| 109 | in the 1.0 releases, but wasn't tested in 2.0 and later. PhysicsFS should |
||
| 110 | work on modern Windows Phones (see "Windows RT" section). |
||
| 111 | |||
| 112 | |||
| 113 | macOS: |
||
| 114 | |||
| 115 | You will need CMake (https://www.cmake.org/) 2.4 or later installed. |
||
| 116 | |||
| 117 | You can either generate a Unix makefile with CMake, or generate an Xcode |
||
| 118 | project, whichever makes you more comfortable. |
||
| 119 | |||
| 120 | PowerPC and Intel Macs should both be supported. |
||
| 121 | |||
| 122 | |||
| 123 | MAC OS 8/9 ("Mac OS Classic"): |
||
| 124 | |||
| 125 | Classic Mac OS support has been dropped in PhysicsFS 2.0. Apple hasn't updated |
||
| 126 | pre-OSX versions in more than a decade at this point, none of the hardware |
||
| 127 | they've shipped will boot it for almost as many years, and finding |
||
| 128 | developer tools for it is becoming almost impossible. As the switch to Intel |
||
| 129 | hardware has removed the "Classic" emulation environment, it was time to |
||
| 130 | remove support from PhysicsFS. That being said, the PhysicsFS 1.0 branch can |
||
| 131 | still target back to Mac OS 8.5, so you can use that if you need support for |
||
| 132 | this legacy OS. We still very much support modern macOS, though: see above. |
||
| 133 | |||
| 134 | |||
| 135 | Emscripten: |
||
| 136 | |||
| 137 | Use the "Unix" instructions, above. You can install the Emscripten SDK and use |
||
| 138 | the extras/buildbot-emscripten.sh script to automate this for you. |
||
| 139 | |||
| 140 | |||
| 141 | BeOS, Zeta, YellowTab: |
||
| 142 | |||
| 143 | BeOS support was dropped in PhysicsFS 2.1.0. Consider installing Haiku, which |
||
| 144 | we still support. |
||
| 145 | |||
| 146 | |||
| 147 | Haiku: |
||
| 148 | |||
| 149 | Use the "Unix" instructions, above. |
||
| 150 | |||
| 151 | |||
| 152 | OS/2: |
||
| 153 | |||
| 154 | OS/2 is known to work with OpenWatcom and GCC-based compilers. I couldn't get |
||
| 155 | an OS/2 port of CMake to generate OpenWatcom project files (although it should |
||
| 156 | be able to do that in theory), it should be able to do Unix Makefiles with |
||
| 157 | GCC. It might be easier to just compile PhysicsFS along with the rest of |
||
| 158 | your project on this platform. |
||
| 159 | |||
| 160 | |||
| 161 | |||
| 162 | OTHER PLATFORMS: |
||
| 163 | |||
| 164 | Many Unix-like platforms might "just work" with CMake. Some of these platforms |
||
| 165 | are known to have worked at one time, but have not been heavily tested, if |
||
| 166 | tested at all. PhysicsFS is, as far as we know, 64-bit and byteorder clean, |
||
| 167 | and is known to compile on several compilers across many platforms. To |
||
| 168 | implement a new platform or archiver, please read the heavily-commented |
||
| 169 | physfs_internal.h and look at the physfs_platform_* and physfs_archiver_* |
||
| 170 | source files for examples. |
||
| 171 | |||
| 172 | --ryan. (icculus@icculus.org) |
||
| 173 |