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

Side by Side Diff: ports/sqlite/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/samba/build.sh ('k') | ports/sqlite/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) 2013 The Native Client Authors. All rights reserved. 1 # Copyright (c) 2013 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 MAKE_TARGETS="CCLD=\$(CXX) all" 5 MAKE_TARGETS="CCLD=\$(CXX) all"
6 NACLPORTS_CPPFLAGS+=" -DNACL_SDK_VERSION=$NACL_SDK_VERSION" 6 NACLPORTS_CPPFLAGS+=" -DNACL_SDK_VERSION=$NACL_SDK_VERSION"
7 if [ "${NACL_DEBUG}" = "1" ] ; then 7 if [ "${NACL_DEBUG}" = "1" ] ; then
8 NACLPORTS_CPPFLAGS+=" -DSQLITE_DEBUG -DSQLITE_LOCK_TRACE" 8 NACLPORTS_CPPFLAGS+=" -DSQLITE_DEBUG -DSQLITE_LOCK_TRACE"
9 fi 9 fi
10 LIBS="-lnacl_io -pthread"
11 if [ "${NACL_SHARED}" = "1" ]; then 10 if [ "${NACL_SHARED}" = "1" ]; then
12 EXECUTABLE_DIR=.libs 11 EXECUTABLE_DIR=.libs
13 LIBS+=" -ldl" 12 NACLPORTS_LIBS+=" -ldl"
14 else 13 else
15 EXTRA_CONFIGURE_ARGS=--disable-dynamic-extensions 14 EXTRA_CONFIGURE_ARGS=--disable-dynamic-extensions
16 EXECUTABLE_DIR=. 15 EXECUTABLE_DIR=.
17 fi 16 fi
18 export LIBS
19 17
18 EnableCliMain
20 EXECUTABLES="sqlite3${NACL_EXEEXT}" 19 EXECUTABLES="sqlite3${NACL_EXEEXT}"
21 20
22 BuildStep() {
23 # Remove shell.o between building ppapi and sel_ldr versions of sqlite.
24 # This is the only object that depends on the PPAPI define and therefore
25 # needs to be rebuilt.
26 Remove shell.o
27 DefaultBuildStep
28 if [ "${NACL_ARCH}" = "pnacl" ]; then
29 local pexe=${EXECUTABLE_DIR}/sqlite3${NACL_EXEEXT}
30 TranslateAndWriteLauncherScript ${pexe} x86-64 sqlite3.x86-64.nexe sqlite3
31 fi
32
33 # Build (at least shell.c) again but this time with nacl_io and -DPPAPI
34 NEW_LIBS="${NACL_CLI_MAIN_LIB}"
35 Banner "Building sqlite3_ppapi"
36 sed -i.bak "s/sqlite3\$(EXEEXT)/sqlite3_ppapi\$(EXEEXT)/" Makefile
37 sed -i.bak "s/CFLAGS = /CFLAGS = -DPPAPI /" Makefile
38 sed -i.bak "s/-lnacl_io/${NEW_LIBS}/" Makefile
39 Remove shell.o
40 DefaultBuildStep
41 }
42
43 PublishStep() { 21 PublishStep() {
44 MakeDir ${PUBLISH_DIR} 22 MakeDir ${PUBLISH_DIR}
45 23
46 local exe=${PUBLISH_DIR}/sqlite3_ppapi_${NACL_ARCH}${NACL_EXEEXT} 24 local exe=${PUBLISH_DIR}/sqlite3_${NACL_ARCH}${NACL_EXEEXT}
47 25
48 LogExecute mv ${EXECUTABLE_DIR}/sqlite3_ppapi${NACL_EXEEXT} ${exe} 26 LogExecute cp ${EXECUTABLE_DIR}/sqlite3${NACL_EXEEXT} ${exe}
49 if [ "${NACL_ARCH}" = "pnacl" ]; then 27 if [ "${NACL_ARCH}" = "pnacl" ]; then
50 LogExecute ${PNACLFINALIZE} ${exe} 28 LogExecute ${PNACLFINALIZE} ${exe}
51 fi 29 fi
52 30
53 pushd ${PUBLISH_DIR} 31 pushd ${PUBLISH_DIR}
54 LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \ 32 LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
55 -L${DESTDIR_LIB} \ 33 -L${DESTDIR_LIB} \
56 sqlite3_ppapi*${NACL_EXEEXT} \ 34 sqlite3*${NACL_EXEEXT} \
57 -s . \ 35 -s . \
58 -o sqlite.nmf 36 -o sqlite.nmf
59 LogExecute python ${TOOLS_DIR}/create_term.py sqlite.nmf 37 LogExecute python ${TOOLS_DIR}/create_term.py sqlite.nmf
60 popd 38 popd
61 39
62 InstallNaClTerm ${PUBLISH_DIR} 40 InstallNaClTerm ${PUBLISH_DIR}
63 } 41 }
64 42
65 RunTest() { 43 RunTest() {
66 naclport_test/test -g 44 naclport_test/test -g
67 } 45 }
68 46
69 TestStep() { 47 TestStep() {
70 MakeDir naclport_test 48 MakeDir naclport_test
71 49
72 if [[ ${NACL_ARCH} == "pnacl" ]]; then 50 if [[ ${NACL_ARCH} == "pnacl" ]]; then
73 EXT=.bc 51 EXT=.bc
74 else 52 else
75 EXT=${NACL_EXEEXT} 53 EXT=${NACL_EXEEXT}
76 fi 54 fi
77 55
78 INCLUDES="-I${SRC_DIR}" 56 INCLUDES="-I${SRC_DIR}"
79 LogExecute ${NACLCXX} ${INCLUDES} ${NACLPORTS_CPPFLAGS} \ 57 LogExecute ${NACLCXX} ${INCLUDES} ${NACLPORTS_CPPFLAGS} \
80 ${NACLPORTS_CFLAGS} ${NACLPORTS_LDFLAGS} \ 58 ${NACLPORTS_CFLAGS} ${NACLPORTS_LDFLAGS} \
81 -DPPAPI -o naclport_test/test${EXT} \ 59 -DPPAPI -o naclport_test/test${EXT} \
82 ${START_DIR}/test.cc sqlite3.o ${LIBS} -lgtest 60 ${START_DIR}/test.cc sqlite3.o ${NACLPORTS_LIBS} -lgtest
83 61
84 [[ ${NACL_ARCH} == "pnacl" ]] && ${PNACLFINALIZE} \ 62 [[ ${NACL_ARCH} == "pnacl" ]] && ${PNACLFINALIZE} \
85 -o naclport_test/test${NACL_EXEEXT} naclport_test/test${EXT} 63 -o naclport_test/test${NACL_EXEEXT} naclport_test/test${EXT}
86 64
87 echo "Running test" 65 echo "Running test"
88 66
89 if [ "${NACL_ARCH}" = "pnacl" ]; then 67 if [ "${NACL_ARCH}" = "pnacl" ]; then
90 local pexe=test${NACL_EXEEXT} 68 local pexe=test${NACL_EXEEXT}
91 (cd naclport_test; 69 (cd naclport_test;
92 TranslateAndWriteLauncherScript ${pexe} x86-32 test.x86-32${EXT} \ 70 TranslateAndWriteLauncherScript ${pexe} x86-32 test.x86-32${EXT} \
93 test) 71 test)
94 RunTest 72 RunTest
95 (cd naclport_test; 73 (cd naclport_test;
96 TranslateAndWriteLauncherScript ${pexe} x86-64 test.x86-64${EXT} \ 74 TranslateAndWriteLauncherScript ${pexe} x86-64 test.x86-64${EXT} \
97 test) 75 test)
98 RunTest 76 RunTest
99 echo "Tests OK" 77 echo "Tests OK"
100 elif [ "$(uname -m)" = "${NACL_ARCH_ALT}" ]; then 78 elif [ "$(uname -m)" = "${NACL_ARCH_ALT}" ]; then
101 WriteLauncherScript naclport_test/test test${EXT} 79 WriteLauncherScript naclport_test/test test${EXT}
102 RunTest 80 RunTest
103 echo "Tests OK" 81 echo "Tests OK"
104 fi 82 fi
105 } 83 }
OLDNEW
« no previous file with comments | « ports/samba/build.sh ('k') | ports/sqlite/nacl.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698