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

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

Issue 132343007: Add top level build script for building packages. (Closed) Base URL: https://naclports.googlecode.com/svn/trunk/src
Patch Set: Created 6 years, 11 months 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 | Annotate | Revision Log
« no previous file with comments | « ports/zeromq/build.sh ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 source pkg_info 6 # zlib doesn't support custom build directories so we have
7 source ../../build_tools/common.sh 7 # to build directly in the source dir.
8 8 BUILD_DIR=${SRC_DIR}
9 9
10 ConfigureStep() { 10 ConfigureStep() {
11 Banner "Configuring ${PACKAGE_NAME}" 11 Banner "Configuring ${PACKAGE_NAME}"
12 ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} 12 ChangeDir ${BUILD_DIR}
13 LogExecute rm -f libz.* 13 LogExecute rm -f libz.*
14 # TODO: side-by-side install 14 # TODO: side-by-side install
15 local CONFIGURE_ARGS="--prefix=${NACLPORTS_PREFIX}" 15 local CONFIGURE_ARGS="--prefix=${NACLPORTS_PREFIX}"
16 local CFLAGS="-Dunlink=puts" 16 local CFLAGS="-Dunlink=puts"
17 if [ "${NACL_GLIBC}" = "1" -a $# -gt 0 ]; then 17 if [ "${NACL_GLIBC}" = "1" -a $# -gt 0 ]; then
18 CONFIGURE_ARGS="${CONFIGURE_ARGS} --shared" 18 CONFIGURE_ARGS="${CONFIGURE_ARGS} --shared"
19 CFLAGS="${CFLAGS} -fPIC" 19 CFLAGS="${CFLAGS} -fPIC"
20 fi 20 fi
21 CC=${NACLCC} AR="${NACLAR} -r" RANLIB=${NACLRANLIB} CFLAGS="${CFLAGS}" \ 21 CC=${NACLCC} AR="${NACLAR} -r" RANLIB=${NACLRANLIB} CFLAGS="${CFLAGS}" \
22 LogExecute ./configure ${CONFIGURE_ARGS} 22 LogExecute ./configure ${CONFIGURE_ARGS}
23 export MAKEFLAGS="EXE=${NACL_EXEEXT}" 23 export MAKEFLAGS="EXE=${NACL_EXEEXT}"
24 EXECUTABLES="minigzip${NACL_EXEEXT} example${NACL_EXEEXT}" 24 EXECUTABLES="minigzip${NACL_EXEEXT} example${NACL_EXEEXT}"
25 } 25 }
26 26
27
27 RunMinigzip() { 28 RunMinigzip() {
28 export LD_LIBRARY_PATH=. 29 export LD_LIBRARY_PATH=.
29 if echo "hello world" | ./minigzip | ./minigzip -d; then 30 if echo "hello world" | ./minigzip | ./minigzip -d; then
30 echo ' *** minigzip test OK ***' ; \ 31 echo ' *** minigzip test OK ***' ; \
31 else 32 else
32 echo ' *** minigzip test FAILED ***' ; \ 33 echo ' *** minigzip test FAILED ***' ; \
33 exit 1 34 exit 1
34 fi 35 fi
35 unset LD_LIBRARY_PATH 36 unset LD_LIBRARY_PATH
36 } 37 }
37 38
39
38 RunExample() { 40 RunExample() {
39 export LD_LIBRARY_PATH=. 41 export LD_LIBRARY_PATH=.
40 # This second test does not yet work on nacl (gzopen fails) 42 # This second test does not yet work on nacl (gzopen fails)
41 #if ./example; then \ 43 #if ./example; then \
42 #echo ' *** zlib test OK ***'; \ 44 #echo ' *** zlib test OK ***'; \
43 #else \ 45 #else \
44 #echo ' *** zlib test FAILED ***'; \ 46 #echo ' *** zlib test FAILED ***'; \
45 #exit 1 47 #exit 1
46 #fi 48 #fi
47 unset LD_LIBRARY_PATH 49 unset LD_LIBRARY_PATH
48 } 50 }
49 51
52
50 TestStep() { 53 TestStep() {
51 Banner "Testing ${PACKAGE_NAME}" 54 Banner "Testing ${PACKAGE_NAME}"
52 if [ "${NACL_GLIBC}" = "1" ]; then 55 if [ "${NACL_GLIBC}" = "1" ]; then
53 # Tests do not currently run on GLIBC due to fdopen() not working 56 # Tests do not currently run on GLIBC due to fdopen() not working
54 # TODO(sbc): Remove this once glibc is fixed: 57 # TODO(sbc): Remove this once glibc is fixed:
55 # https://code.google.com/p/nativeclient/issues/detail?id=3362 58 # https://code.google.com/p/nativeclient/issues/detail?id=3362
56 return 59 return
57 fi 60 fi
58 61
59 if [ $NACL_ARCH = "pnacl" ]; then 62 if [ $NACL_ARCH = "pnacl" ]; then
(...skipping 26 matching lines...) Expand all
86 DefaultPackageInstall 89 DefaultPackageInstall
87 if [ "${NACL_GLIBC}" = "1" ]; then 90 if [ "${NACL_GLIBC}" = "1" ]; then
88 ConfigureStep shared 91 ConfigureStep shared
89 BuildStep 92 BuildStep
90 Validate libz.so.1 93 Validate libz.so.1
91 ValidateStep 94 ValidateStep
92 TestStep 95 TestStep
93 InstallStep 96 InstallStep
94 fi 97 fi
95 } 98 }
96
97
98 PackageInstall
99 exit 0
OLDNEW
« no previous file with comments | « ports/zeromq/build.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698