Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: ports/toybox/build.sh

Issue 1417223003: Switch from using 'nacl_main' to 'main' entry point (Closed) Base URL: https://chromium.googlesource.com/external/naclports.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ports/tk/build.sh ('k') | ports/toybox/nacl.patch » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2014 The Native Client Authors. All rights reserved. 1 # Copyright (c) 2014 The Native Client Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 EXECUTABLES="toybox" 5 EXECUTABLES="toybox"
6 6
7 # Toybox wants to build in its current directory. 7 # Toybox wants to build in its current directory.
8 BUILD_DIR=${SRC_DIR} 8 BUILD_DIR=${SRC_DIR}
9 9
10 NACLPORTS_CPPFLAGS+=" -DBYTE_ORDER=LITTLE_ENDIAN" 10 NACLPORTS_CPPFLAGS+=" -DBYTE_ORDER=LITTLE_ENDIAN"
11 NACLPORTS_CPPFLAGS+=" -Dmain=nacl_main"
12 NACLPORTS_CPPFLAGS+=" -Dpipe=nacl_spawn_pipe" 11 NACLPORTS_CPPFLAGS+=" -Dpipe=nacl_spawn_pipe"
13 NACLPORTS_LDFLAGS+=" ${NACL_CLI_MAIN_LIB}"
14 12
15 export HOSTCC=cc 13 export HOSTCC=cc
16 14
15 EnableCliMain
17 EnableGlibcCompat 16 EnableGlibcCompat
18 17
19 NACLPORTS_LDFLAGS+=" -l${NACL_CXX_LIB}"
20
21 ConfigureStep() { 18 ConfigureStep() {
22 LogExecute cp ${START_DIR}/toybox.config ${SRC_DIR}/.config 19 LogExecute cp ${START_DIR}/toybox.config ${SRC_DIR}/.config
23 } 20 }
24 21
25 BuildStep() { 22 BuildStep() {
26 # We can't use NACL_CROSS_PREFIX without also redefining the CC and HOSTCC 23 # We can't use NACL_CROSS_PREFIX without also redefining the CC and HOSTCC
27 # variables. 24 # variables.
28 if [[ "${NACLCC}" = *clang ]]; then 25 if [[ "${NACLCC}" = *clang ]]; then
29 CC=clang 26 CC=clang
30 else 27 else
31 CC=gcc 28 CC=gcc
32 fi 29 fi
33 30
34 export CROSS_COMPILE="${NACL_CROSS_PREFIX}-" 31 export CROSS_COMPILE="${NACL_CROSS_PREFIX}-"
35 export LDFLAGS="${NACLPORTS_LDFLAGS}" 32 export LDFLAGS="${NACLPORTS_LDFLAGS}"
36 export CFLAGS="${NACLPORTS_CPPFLAGS} ${NACLPORTS_CFLAGS}" 33 export CFLAGS="${NACLPORTS_CPPFLAGS} ${NACLPORTS_CFLAGS}"
34 export LIBS="${NACLPORTS_LIBS}"
37 export CC 35 export CC
38 LogExecute make clean 36 LogExecute make clean
39 DefaultBuildStep 37 DefaultBuildStep
40 } 38 }
41 39
42 InstallStep() { 40 InstallStep() {
43 MakeDir ${PUBLISH_DIR} 41 MakeDir ${PUBLISH_DIR}
44 local ASSEMBLY_DIR="${PUBLISH_DIR}/toybox" 42 local ASSEMBLY_DIR="${PUBLISH_DIR}/toybox"
45 MakeDir ${ASSEMBLY_DIR} 43 MakeDir ${ASSEMBLY_DIR}
46 44
47 cp ${BUILD_DIR}/toybox ${ASSEMBLY_DIR}/toybox_${NACL_ARCH}${NACL_EXEEXT} 45 cp ${BUILD_DIR}/toybox ${ASSEMBLY_DIR}/toybox_${NACL_ARCH}${NACL_EXEEXT}
48 46
49 ChangeDir ${ASSEMBLY_DIR} 47 ChangeDir ${ASSEMBLY_DIR}
50 LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \ 48 LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
51 ${ASSEMBLY_DIR}/toybox_*${NACL_EXEEXT} \ 49 ${ASSEMBLY_DIR}/toybox_*${NACL_EXEEXT} \
52 -s . \ 50 -s . \
53 -o toybox.nmf 51 -o toybox.nmf
54 LogExecute python ${TOOLS_DIR}/create_term.py toybox.nmf 52 LogExecute python ${TOOLS_DIR}/create_term.py toybox.nmf
55 53
56 InstallNaClTerm ${ASSEMBLY_DIR} 54 InstallNaClTerm ${ASSEMBLY_DIR}
57 LogExecute cp ${START_DIR}/manifest.json ${ASSEMBLY_DIR} 55 LogExecute cp ${START_DIR}/manifest.json ${ASSEMBLY_DIR}
58 LogExecute cp ${START_DIR}/icon_16.png ${ASSEMBLY_DIR} 56 LogExecute cp ${START_DIR}/icon_16.png ${ASSEMBLY_DIR}
59 LogExecute cp ${START_DIR}/icon_48.png ${ASSEMBLY_DIR} 57 LogExecute cp ${START_DIR}/icon_48.png ${ASSEMBLY_DIR}
60 LogExecute cp ${START_DIR}/icon_128.png ${ASSEMBLY_DIR} 58 LogExecute cp ${START_DIR}/icon_128.png ${ASSEMBLY_DIR}
61 ChangeDir ${PUBLISH_DIR} 59 ChangeDir ${PUBLISH_DIR}
62 CreateWebStoreZip toybox-${VERSION}.zip toybox 60 CreateWebStoreZip toybox-${VERSION}.zip toybox
63 } 61 }
OLDNEW
« no previous file with comments | « ports/tk/build.sh ('k') | ports/toybox/nacl.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698