Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Firefox OS 빌드하기

중요: 번역은 제가 필요한 부분 및 확인 가능한 부분만 진행 하였으며 변역된 날자는(2013/02/25)이며 문서 변경이 잦아 오늘 이후는 원문과 번역이 다를 수 있습니다. 참고하세요. 미 번역/변경된 부분은 추가로 다른 분이 해 주실 것으로 믿습니다.

빌드환경 설정코드 복사 및 초기 환경 설정이 완료 되고 나면, Boot to Gecko를 시작 할 수 있습니다.

최신 코드로 업데이트

B2G빌드가 처음이 아닐 경우, 빌드를 시작하기 전에 최신 코드를 가져 오고 싶다면 아래와 같이 빌드용 툴과 코드를 최신으로 업데이트 하실 수 있습니다.

git pull
./repo sync

원하는 repository의 이름만 입력 함으로서 부분적으로 업데이트도 가능합니다.

./repo sync gaia

"repo"의 다른 옵션들에 관심이 있다면 "repo help"를 입력 해 보세요.

빌드하기

주의: 빌드 하기 전에, 빌드 환경을 개조 하려면 .userconfig파일을 수정하시면 됩니다.  .userconfig 파일 개조하기를 참고하세요.

아래와 같이 입력하면 B2G를 빌드 하실 수 있습니다.

cd B2G
./build.sh

이번 과정 또한 수행 시간이 많이(2시간 이상)걸리므로 잠깐 다른 일을 처리 하셔도 됩니다. As in the configure step on the previous page, if you are using a directory of previously-extracted Android system files, you should set ANDROIDFS_DIR before running build.sh.

특정 모듈 빌드하기

Gecko와 같은 특정 모듈만 빌드하려면 아래와 같습니다.

./build.sh gecko

특정 애플리케이션 하나만 빌드하려면, 아래와 같이 환경 변수 BUILD_APP_NAME에 "gaia"를 설정 하여 gaia만 빌드 하실 수 있습니다.

BUILD_APP_NAME=calendar ./build.sh gaia

빌드 가능한 모듈을 확인 하고 싶으시면 아래와 같이 수행 하십시오.

./build.sh modules

빌드에 사용되는 코어 갯수 변경

기본적으로, B2G 빌드 스크립트는 시스템이 가진 코어보다 2개 더 많은 수로 병렬 빌드를 진행 합니다. "build.sh" 수행시 -j 파라미터를 통해 그 갯수를 변경 하실 수 있습니다. 이를 통해 빌드 시스템의 CPU로드를 조정하실 수 있습니다. 빌드에서 에러가 발생하면 병렬 빌드의 경우 에러 가 복잡하게 보이므로 코어 갯수를 줄이거나 하나로 한다면 빌드 에러 추적이 용이합니다.

아래는 2개의 코어로 설정하여 빌드하는 예입니다.

./build.sh -j2

빌드 에러가 발생시는 아래처럼 1개의 코어로 할 경우 에러 결과를 읽고 분석하기 용이 합니다.

./build.sh -j1

다국어 빌드하기

다국어 지원하도록 한다면:

Gaia

  1. 먼저 어떤 언어를 지원할 것인지 정하시고. 현재는 locales/languages_dev.jsonlocales/languages_all.json가 Gaia의 언어 설정 관련 파일로 사용됩니다.
  2. https://hg.mozilla.org/gaia-l10n에서 지원하고자 하는 언어를 가져옵니다. 언어 파일에 리스트 된 각 언어를 가져 오려면 "repo"를 사용해야 합니다.
  3. 환경 설정으로, set LOCALE_BASEDIR에 위의 2번에서 가져온 파일 절대 경로를 설정합니다. LOCALES_FILE을 1번 설정의 절대 경로로 설정합니다.

예를 들면,

export LOCALE_BASEDIR=$PWD/gaia-l10n
export LOCALES_FILE=$PWD/gecko/gaia/shared/resources/languages-dev.json

Gecko

  1. Determine which Gecko languages file to use. We're currently using b2g/locales/all-locales as our Gecko languages file.
  2. Clone the appropriate locales into a directory; this can be gecko-l10n/ .
  3. Clone compare-locales.
  4. In your environment, set L10NBASEDIR to the absolute path of the directory in step 2. Set MOZ_CHROME_MULTILOCALE to a string of space-delimited locales from step 1.

    Add the compare-locales/scripts dir to your PATH, and compare-locales/lib to your PYTHONPATH.

    For instance,
    export L10NBASEDIR=$PWD/gecko-l10n
    export MOZ_CHROME_MULTILOCALE="ja zh-TW"
    export PATH="$PATH:$PWD/compare-locales/scripts"
    export PYTHONPATH="$PWD/compare-locales/lib"
    

    Once you have the above set up, you can run build.sh .

    It looks like you can use .userconfig as well.

    These instructions may change as we smooth things out.

    Known errors

    • KeyedVector.h:193:31: error: indexOfKey was not declared in this scope

    This error appears when your gcc version is too recent. Install gcc/g++/g++-multilib 4.6.x versions.

    See Customizing with the .userconfig file for more information.

    Community Note: It is possible to use gcc 4.7.x with slight modifications to the B2G code (gcc will guide you) but you won't get any help! Neither with modifying the code nor with bugs you encounter.

    • arm-linux-androideabi-g++: Internal error: Killed (program cc1plus)

    If you see this message, it most likely means that are lacking of free memory. Ensure having enough free memory before running ./build.sh. It should run fine if you system has 4GB of ram.

    • If you get build errors while the build system is running tests

    Sometimes (especially after build tool or operating system updates) you'll get weird errors like this when the build system runs its post-build tests:

    Generating permissions.sqlite...
    test -d profile || mkdir -p profile
    run-js-command  permissions
    WARNING: permission unknown:offline-app
    WARNING: permission unknown:indexedDB-unlimited
    build/permissions.js:122: NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPermissionManager.add]
    make[1]: *** [permissions] Error 3
    make: *** [gaia/profile.tar.gz] Error 2

    In this situation, try deleting the gaia/xulrunner-sdk directory and re-pulling the code:

    rm -r gaia/xulrunner-sdk
    

    This deletes the downloaded, precompiled copy of XULRunner that the build system retrieves automatically; on your next build, a new copy of XULRunner will be automatically retrieved.

    다음 단계

    빌드가 완료되면 다음 단계로는 에뮬레이터로 넣을 것인지 단말기로 놓을 것인지에 따라 아래와 같은 선택사항이 있습니다. 자세한 사항은 각각을 참고 하세요.

문서 태그 및 공헌자

 이 페이지의 공헌자: jwhitlock, SpikeYou
 최종 변경: jwhitlock,