Forráskód Böngészése

Updated documentation on Raspberry Pi port.

Wei Tjong Yao 12 éve
szülő
commit
1a5670b65c
2 módosított fájl, 126 hozzáadás és 32 törlés
  1. 39 11
      Docs/GettingStarted.dox
  2. 87 21
      Readme.txt

+ 39 - 11
Docs/GettingStarted.dox

@@ -10,7 +10,9 @@ Although all required third-party libraries are included as source code, there a
 
 - For Windows, the June 2010 DirectX SDK needs to be installed.
 
-- For Linux, the following development packages need to be installed: libx11-dev, libxrandr-dev, libasound2-dev. Also install the package libgl1-mesa-dev if your GPU driver does not include OpenGL headers & libs.  Building as 32-bit on a 64-bit system requires installing also the 32-bit versions of the development libraries.
+- For Linux, the following development packages need to be installed: libx11-dev, libxrandr-dev, libasound2-dev on Debian-based distros; libX11-devel, libXrandr-devel, alsa-lib-devel on RedHat-based distros. Also install the package libgl1-mesa-dev (Debian) or mesa-libGL-devel (RH) if your GPU driver does not include OpenGL headers & libs.  Building as 32-bit on a 64-bit system requires installing also the 32-bit versions of the development libraries.
+
+- For Raspberry Pi, the following development packages need to be installed: libraspberrypi0, libraspberrypi-dev, libasound2-dev on Raspbian; raspberrypi-vc-libs, raspberrypi-vc-libs-devel, alsa-lib-devel on Pidora. The first two packages which contain the Broadcom VideoCore IV libraries and development headers should normally come preinstalled.
 
 - For Mac OS X, the Xcode developer tools package should include everything necessary.
 
@@ -22,6 +24,8 @@ To run Urho3D, the minimum system requirements are:
 
 - Linux & Mac OS X: CPU with SSE instructions support, GPU with OpenGL 2.0 support, EXT_framebuffer_object and EXT_packed_depth_stencil extensions.
 
+- Raspberry Pi: %Model B revision 2.0 with at least 128 MB of 512 MB SDRAM allocated for GPU. OpenGL ES 2.0 capable GPU.
+
 - Android: OS version 2.2 or newer, OpenGL ES 2.0 capable GPU.
 
 - iOS: OpenGL ES 2.0 capable GPU.
@@ -32,15 +36,16 @@ SSE requirement can be eliminated by commenting out lines that enable it from th
 
 Urho3D uses CMake (http://www.cmake.org) to build. The process has two steps:
 
--# Run CMake in the root directory with your preferred toolchain specified to generate the build files. You can use the provided batch files or shell scripts:\n
-cmake_vs2008.bat, cmake_vs2010.bat or cmake_vs2012.bat on Windows,\n
-cmake_eclipse.sh on Linux,\n
-cmake_macosx.sh on Mac OS X, and\n
-cmake_gcc.sh on both Linux and Mac OS X.
+-# Run CMake in the root directory with your preferred toolchain specified to generate the build files. You can use the provided batch files or shell scripts on the respective platform.\n
+    - Windows: cmake_vs2008.bat, cmake_vs2010.bat or cmake_vs2012.bat,\n
+    - Linux: cmake_gcc.sh or cmake_eclipse.sh,\n
+    - Mac OS X: cmake_gcc.sh or cmake_macosx.sh.\n
+    .
+\n
 -# For Visual Studio, open Urho3D.sln and build the configuration(s) you like.\n
-For Eclipse on Linux, import the Eclipse's project generated by CMake into the workspace as a general project. The Eclipse's project is generated in "build" sub-directory. See "Importing existing projects" in Eclipse Help for detail steps. Select "Build All" or "Build Project" in the menu. Note that Eclipse requires CDT plugin to build C/C++ project.\n
+For Eclipse, import the Eclipse's project generated by CMake into the workspace as a general project. The Eclipse's project is generated in "build" sub-directory. See "Importing existing projects" in Eclipse Help for detail steps. Select "Build All" or "Build Project" in the menu. Note that Eclipse requires CDT plugin to build C/C++ project.\n
 For GCC, execute make in the "build" sub-directory (by default, cmake_gcc.sh specifies to make a RelWithDebInfo build).\n
-For Xcode on Mac OS X, open Urho3D.xcodeproj and build.
+For Xcode, open Urho3D.xcodeproj and build.
 
 On Windows, using other compilers than Visual Studio is not officially supported. MinGW may work (cmake -G "MinGW Makefiles"), but may lack required DirectX headers. They can be copied to a MinGW installation from the following package: http://www.libsdl.org/extras/win32/common/directx-devel.tar.gz.\n
 
@@ -58,7 +63,7 @@ First, if you are building under Windows platform, copy Bin/Data and Bin/CoreDat
 
 Set the ANDROID_NDK environment variable to point to your Android NDK. On Windows, ensure that make.exe from the Android NDK is included in the path and is executable from the command line.
 
-On Windows, execute cmake_android.bat. On OS X or Linux, execute cmake_gcc.sh (the ANDROID_NDK environment variable distinguishes from a normal desktop build.) Then go to the Android directory and execute the following commands
+On Windows, execute cmake_android.bat then go to the Android directory and execute the following commands. On OS X or Linux, execute cmake_gcc.sh (the ANDROID_NDK environment variable distinguishes from a normal desktop build) then go to the android-build directory (which is a GCC out-of-source build) and execute the following commands.
 
 - android update project -p . -t 1 (only needed on the first time,
                                     replace '-t 1' with desired target-id)
@@ -72,9 +77,9 @@ For a release build, use the "ant release" command instead of "ant debug" and fo
 
 By default the Android package for Urho3D is com.googlecode.urho3d. For a real application you must replace this with your own package name. The Urho3D activity subclasses the SDLActivity from org.libsdl.app package, whose name (or the JNI code from SDL library) does not have to be changed.
 
-Note that the native code is built by default for armeabi-v7a ABI. To make your program compatible also with old Android devices, build also an armeabi version by executing the CMake batch file again with the parameter -DANDROID_ABI=armeabi added, then execute make again in the Android directory.
+Note that the native code is built by default for armeabi-v7a ABI. To make your program compatible also with old Android devices, build also an armeabi version by executing the CMake batch file again with the parameter -DANDROID_ABI=armeabi added, then execute make again in the Android directory on Windows or android-build directory on Mac/Linux.
 
-You can also build and deploy using Eclipse IDE with ADT plugin. To do that, after setting the ANDROID_NDK environment variable then run cmake_eclipse.sh. Import "Existing Android Code into Workspace" from the CMake generated Eclipse's project found in the Android directory. Switch Eclipse IDE to use Java Perspective. Update project properties to choose the desired Android API target and that's it. Just choose "Run" to let ADT automatically build and deploy the application to Android (virtual) device.
+You can also build and deploy using Eclipse IDE with ADT plugin. To do that, after setting the ANDROID_NDK environment variable then run cmake_eclipse.sh. Import "Existing Android Code into Workspace" from the CMake generated Eclipse's project found in the android-build directory. Switch Eclipse IDE to use Java Perspective. Update project properties to choose the desired Android API target and that's it. Just choose "Run" to let ADT automatically build and deploy the application to Android (virtual) device.
 
 \section Building_Ios iOS build process
 
@@ -86,6 +91,16 @@ The Urho3D target will actually build the application bundle and copy resources
 
 To run from Xcode on iPhone/iPad Simulator, edit the Product Scheme to set "Run" destination setting to "iPhone Simulator" or "iPad Simulator", and executable to "Urho3D.app".
 
+\section Building_RaspberryPi Raspberry Pi build process
+
+For native build on Raspberry Pi itself, use the similar process for Linux Desktop build described above.
+
+For cross-compiling build on another build/host machine, set the RASPI_TOOL environment variable to point to your Raspberry Pi Cross-Compiling tool where all the arm-linux-gnueabihf-* executables are located. You can setup the tool using <a href="http://crosstool-ng.org/">crosstool-NG</a> or just download one from https://github.com/raspberrypi/tools. The RASPI_TOOL environment variable tells build script to generate additional build directory for cross-compiling. 
+
+Run cmake_gcc.sh then go to the raspi-build directory and proceed to execute make. After the build is complete, the ARM executables can be found in Bin-CC directory. 
+
+You can also build, deploy, run/debug (as C/C++ Remote %Application) using Eclipse IDE, if you run cmake_eclipse.sh to generate the project file. Import the CMake generated Eclipse project in the raspi-build directory into Eclipse's workspace. Build the project as usual. Use the SCP_TO_TARGET build option to automatically deploy the ARM executables to target Raspberry Pi as part of every project build or configure Eclipse to perform a "download to target path" in the Run/Debug configuration for C/C++ Remote %Application. Either way, you have to configure the Run/Debug configuration how to reach your target Raspberry Pi.
+
 \section Building_64bit Desktop 64bit build
 
 Currently CMake build configuration has been set to compile Urho3D as 32bit by default. To enable 64bit build, run the provided cmake_xxxx.bat or cmake_xxxx.sh by passing the option "-DENABLE_64BIT=1" explicitly. For Visual Studio on Windows platform, this option also overrides CMake to use a 64bit solution generator. Alternatively, you can modify the main CMakeLists.txt to enable 64bit by default.
@@ -107,6 +122,19 @@ Note that you can also enable OpenGL build on Visual Studio by modifying a secti
 
 OpenGL does not need a separate shader compilation step or utility.
 
+\section Build_Options Build options
+
+A number of build options can be defined explicitly when invoking the above cmake_xxxx batch files or shell scripts.\n
+Defines                                      |Build Options|
+---------------------------------------------|---------------------|
+-DENABLE_64BIT=1                             |to enable 64bit build|
+-DENABLE_LUA=1                               |to enable additional Lua scripting support|
+-DENABLE_SAMPLES=1                           |to build the sample applications|
+-DENABLE_TOOLS=1                             |to build the tools (only useful for Raspberry Pi build because this option is already enabled by default for other Desktop platforms)|
+-DUSE_OPENGL=1                               |to use OpenGL instead of Direct3D (only useful for VS on Windows platform because this option is enabled by default for other platforms)| 
+-DSCP_TO_TARGET=user\@target:remote-location |to automatically scp executables to target system (only applicable for cross compiling Raspberry Pi on a build/host machine), SSH digital key must be setup first for this to work|
+-DCMAKE_BUILD_TYPE=Debug or Release          |to tell CMake which build configuration to be generated, default is RelWithDebInfo (only applicable for cmake_gcc.sh and cmake_eclipse.sh)|
+
 
 \page Running Running Urho3D
 

+ 87 - 21
Readme.txt

@@ -111,10 +111,18 @@ successfully:
 - For Windows, the June 2010 DirectX SDK needs to be installed.
 
 - For Linux, the following development packages need to be installed:
-  libx11-dev, libxrandr-dev, libasound2-dev. Also install the package
-  libgl1-mesa-dev if your GPU driver does not include OpenGL headers & libs.
-  Building as 32-bit on a 64-bit system requires installing also the 32-bit
-  versions of the development libraries.
+  libx11-dev, libxrandr-dev, libasound2-dev on Debian-based distros;
+  libX11-devel, libXrandr-devel, alsa-lib-devel on RedHat-based distros.
+  Also install the package libgl1-mesa-dev (Debian) or mesa-libGL-devel (RH)
+  if your GPU driver does not include OpenGL headers & libs. Building as 32-bit on
+  a 64-bit system requires installing also the 32-bit versions of the development
+  libraries.
+
+- For Raspberry Pi, the following development packages need to be installed:
+  libraspberrypi0, libraspberrypi-dev, libasound2-dev on Raspbian;
+  raspberrypi-vc-libs, raspberrypi-vc-libs-devel, alsa-lib-devel on Pidora.
+  The first two packages which contain the Broadcom VideoCore IV libraries and
+  development headers should normally come preinstalled.
 
 - For Mac OS X, the Xcode developer tools package should include everything
   necessary.
@@ -130,6 +138,9 @@ To run Urho3D, the minimum system requirements are:
 - Linux & Mac OS X: CPU with SSE instructions support, GPU with OpenGL 2.0
   support, EXT_framebuffer_object and EXT_packed_depth_stencil extensions.
 
+- Raspberry Pi: Model B revision 2.0 with at least 128 MB of 512 MB SDRAM
+  allocated for GPU. OpenGL ES 2.0 capable GPU.
+
 - Android: OS version 2.2 or newer, OpenGL ES 2.0 capable GPU.
 
 - iOS: OpenGL ES 2.0 capable GPU.
@@ -145,17 +156,16 @@ On desktop systems Urho3D uses CMake (http://www.cmake.org) to build. The
 process has two steps:
 
 1) Run CMake in the root directory with your preferred toolchain specified to
-   generate the build files. You can use the provided batch files or shell 
-   scripts:
-
-   cmake_vs2008.bat, cmake_vs2010.bat or cmake_vs2012.bat on Windows,
-   cmake_eclipse.sh on Linux,
-   cmake_macosx.sh on Mac OS X, and
-   cmake_gcc.sh on both Linux and Mac OS X.
+   generate the build files. You can use the provided batch files or shell
+   scripts on the respective platform.
+   
+    Windows: cmake_vs2008.bat, cmake_vs2010.bat or cmake_vs2012.bat,
+    Linux: cmake_gcc.sh or cmake_eclipse.sh,
+    Mac OS X: cmake_gcc.sh or cmake_macosx.sh.
 
 2) For Visual Studio, open Urho3D.sln and build the configuration(s) you like.
    
-   For Eclipse on Linux, import the Eclipse's project generated by CMake into
+   For Eclipse, import the Eclipse's project generated by CMake into
    the workspace as a general project. The Eclipse's project is generated in
    "build" sub-directory. See "Importing existing projects" in Eclipse Help for
    detail steps. Select "Build All" or "Build Project" in the menu. Note that
@@ -164,7 +174,7 @@ process has two steps:
    For GCC, execute make in the "build" sub-directory (by default, cmake_gcc.sh
    specifies to make a RelWithDebInfo build).
 
-   For Xcode on Mac OS X, open Urho3D.xcodeproj and build.
+   For Xcode, open Urho3D.xcodeproj and build.
 
 On Windows, using other compilers than Visual Studio is not officially
 supported. MinGW may work (cmake -G "MinGW Makefiles"), but may lack required
@@ -207,9 +217,11 @@ Set the ANDROID_NDK environment variable to point to your Android NDK. On Window
 ensure that make.exe from the Android NDK is included in the path and is executable
 from the command line.
 
-On Windows, execute cmake_android.bat. On OS X or Linux, execute cmake_gcc.sh (the
-ANDROID_NDK environment variable distinguishes from a normal desktop build.) Then 
-go to the Android directory and execute the following commands
+On Windows, execute cmake_android.bat then go to the Android directory and execute
+the following commands. On OS X or Linux, execute cmake_gcc.sh (the ANDROID_NDK
+environment variable distinguishes from a normal desktop build) then go to the
+android-build directory (which is a GCC out-of-source build) and execute the
+following commands.
 
 - android update project -p . -t 1 (only needed on the first time,
                                     replace '-t 1' with desired target-id)
@@ -232,15 +244,16 @@ activity subclasses the SDLActivity from org.libsdl.app package, whose name
 Note that the native code is built by default for armeabi-v7a ABI. To make your
 program compatible also with old Android devices, build also an armeabi version
 by executing the CMake batch file again with the parameter -DANDROID_ABI=armeabi
-added, then execute make again in the Android directory.
+added, then execute make again in the Android directory on Windows or android-build
+directory on Mac/Linux.
 
 You can also build and deploy using Eclipse IDE with ADT plugin. To do that, after
 setting the ANDROID_NDK environment variable then run cmake_eclipse.sh. Import
 "Existing Android Code into Workspace" from the CMake generated Eclipse's project
-found in the Android directory. Switch Eclipse IDE to use Java Perspective. Update
-project properties to choose the desired Android API target and that's it. Just
-choose "Run" to let ADT automatically build and deploy the application to Android
-(virtual) device.
+found in the android-build directory. Switch Eclipse IDE to use Java Perspective.
+Update project properties to choose the desired Android API target and that's it.
+Just choose "Run" to let ADT automatically build and deploy the application to
+Android (virtual) device.
 
 
 iOS build process
@@ -262,6 +275,32 @@ destination setting to "iPhone Simulator" or "iPad Simulator", and executable
 to "Urho3D.app".
 
 
+Raspberry Pi build process
+--------------------------
+
+For native build on Raspberry Pi itself, use the similar process for Linux Desktop
+build described above.
+
+For cross-compiling build on another build/host machine, set the RASPI_TOOL
+environment variable to point to your Raspberry Pi Cross-Compiling tool where all
+the arm-linux-gnueabihf-* executables are located. You can setup the tool using
+crosstool-NG (http://crosstool-ng.org/) or just download one from
+https://github.com/raspberrypi/tools. The RASPI_TOOL environment variable tells
+build script to generate additional build directory for cross-compiling.
+
+Run cmake_gcc.sh then go to the raspi-build directory and proceed to execute make.
+After the build is complete, the ARM executables can be found in Bin-CC directory. 
+
+You can also build, deploy, run/debug (as C/C++ Remote Application) using Eclipse
+IDE, if you run cmake_eclipse.sh to generate the project file. Import the CMake
+generated Eclipse project in the raspi-build directory into Eclipse's workspace.
+Build the project as usual. Use the SCP_TO_TARGET build option to automatically
+deploy the ARM executables to target Raspberry Pi as part of every project build
+or configure Eclipse to perform a "download to target path" in the Run/Debug
+configuration for C/C++ Remote Application. Either way, you have to configure the
+Run/Debug configuration how to reach your target Raspberry Pi.
+
+
 Desktop 64bit build
 -------------------
 
@@ -293,6 +332,33 @@ section in the root CMakeLists.txt to read as follows:
 OpenGL does not need a separate shader compilation step or utility.
 
 
+Build options
+
+A number of build options can be defined explicitly when invoking the above
+cmake_xxxx batch files or shell scripts.
+
+|----------------------|-------------------------------------------------------|
+|Defines               |Build Options                                          |
+|----------------------|-------------------------------------------------------|
+|-DENABLE_64BIT=1      |to enable 64bit build                                  |
+|-DENABLE_LUA=1        |to enable additional Lua scripting support             |
+|-DENABLE_SAMPLES=1    |to build the sample applications                       |
+|-DENABLE_TOOLS=1      |to build the tools (only useful for Raspberry Pi build |
+|                      | because this option is already enabled by default for |
+|                      | other Desktop platforms)                              |
+|-DUSE_OPENGL=1        |to use OpenGL instead of Direct3D (only useful for VS  |
+|                      | on Windows platform because this option is enabled by |
+|                      | default for other platforms)                          | 
+|-DSCP_TO_TARGET=      |to automatically scp executables to target system (only|
+|  usr\@tgt:remote-loc | applicable for cross compiling Raspberry Pi on a      |
+|                      | build/host machine), SSH digital key must be setup    |
+|                      | first for this to work                                |
+|-DCMAKE_BUILD_TYPE=   |to tell CMake which build configuration to be          |
+|  Debug or Release    | generated, default is RelWithDebInfo (only applicable |
+|                      | for cmake_gcc.sh and cmake_eclipse.sh)                |
+|----------------------|-------------------------------------------------------|
+
+
 History
 -------