Sunday, June 10, 2012

naclports tutorial

NaCl Ports: http://code.google.com/p/naclports/
It is a project to port existing c/c++ projects to Chrome NaCl platform. There are already some projects like freetype and zlib ported. But there is nearly no doc in naclports. I just try to write what I have done to make it work and what problem I have meet.

1. Download NaCl sdk. I am on peper19 so far
2. export NACL_SDK_ROOT="the folder contains toolchains"
3. Download with depot_tools with "git clone https://git.chromium.org/chromium/tools/depot_tools.git /your/local/depot_path"
4. export PATH="$PATH":/your/local/depot_path
5. Download naclports with depot tools with "gclient config https://naclports.googlecode.com/svn/trunk/src" and "gclient sync"


So far, we have all the codes.

6. cd your naclports root folder which contains a Makefile.
7. NACL_PACKAGES_BITSIZE=32 make
8. NACL_PACKAGES_BITSIZE=64 make

If everything is fine, we should have all the projects setup in the NaCl sdk. It is said that you do not need extra -I/-L for the path. However for me it is never a sweet procedure. When I make, I have checksum fail issue. I re-check some sha1 in the folder. They match without any problem. I have to disable checksum by commenting out all the "exit -1" in the build scripts such as common.sh. There could be some problem, but it works so far.

I just have everything setup, have never tested and linked them.

No comments:

Post a Comment