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

Side by Side Diff: build_tools/common.sh

Issue 11885025: Allow re-targeting of naclports install (Closed) Base URL: http://naclports.googlecode.com/svn/trunk/src
Patch Set: Created 7 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
OLDNEW
1 # Copyright (c) 2012 The Native Client Authors. All rights reserved. 1 # Copyright (c) 2012 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 # Environment variable NACL_ARCH should be unset or set to "i686" 5 # Environment variable NACL_ARCH should be unset or set to "i686"
6 # for a 32-bit build. It should be set to "x86_64", "pnacl", or "arm" 6 # for a 32-bit build. It should be set to "x86_64", "pnacl", or "arm"
7 # for a 64-bit, pnacl, or arm builds. 7 # for a 64-bit, pnacl, or arm builds.
8 8
9 9
10 # NAMING CONVENTION 10 # NAMING CONVENTION
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 export NACLCXX=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-g++ 171 export NACLCXX=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-g++
172 export NACLAR=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ar 172 export NACLAR=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ar
173 export NACLRANLIB=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ranlib 173 export NACLRANLIB=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ranlib
174 export NACLLD=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ld 174 export NACLLD=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ld
175 export NACLSTRINGS=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-strings 175 export NACLSTRINGS=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-strings
176 export NACLSTRIP=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-strip 176 export NACLSTRIP=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-strip
177 177
178 # NACL_SDK_GCC_SPECS_PATH is where nacl-gcc 'specs' file will be installed 178 # NACL_SDK_GCC_SPECS_PATH is where nacl-gcc 'specs' file will be installed
179 readonly NACL_SDK_GCC_SPECS_PATH=${NACL_TOOLCHAIN_ROOT}/lib/gcc/x86_64-nacl/4. 4.3 179 readonly NACL_SDK_GCC_SPECS_PATH=${NACL_TOOLCHAIN_ROOT}/lib/gcc/x86_64-nacl/4. 4.3
180 180
181 # NACL_SDK_USR is where the headers, libraries, etc. will be installed 181 # NACLPORTS_PREFIX is where the headers, libraries, etc. will be installed
182 readonly NACL_SDK_USR=${NACL_TOOLCHAIN_ROOT}/${NACL_CROSS_PREFIX}/usr 182 # Default to the usr folder within the SDK.
183 readonly NACL_SDK_USR_INCLUDE=${NACL_SDK_USR}/include 183 readonly NACLPORTS_PREFIX=${NACLPORTS_PREFIX:-${NACL_TOOLCHAIN_ROOT}/${NACL_CR OSS_PREFIX}/usr}
184 readonly NACLPORTS_INCLUDE=${NACLPORTS_PREFIX}/include
184 readonly NACL_SDK_LIB=${NACL_TOOLCHAIN_ROOT}/${NACL_ARCH}-nacl/${NACL_LIBDIR} 185 readonly NACL_SDK_LIB=${NACL_TOOLCHAIN_ROOT}/${NACL_ARCH}-nacl/${NACL_LIBDIR}
185 readonly NACL_SDK_USR_LIB=${NACL_SDK_USR}/lib 186 readonly NACLPORTS_LIBDIR=${NACLPORTS_PREFIX}/lib
186 readonly NACL_SDK_USR_BIN=${NACL_SDK_USR}/bin 187 readonly NACLPORTS_PREFIX_BIN=${NACLPORTS_PREFIX}/bin
187 188
188 # NACL_SDK_MULITARCH_USR is a version of NACL_SDK_USR that gets passed into 189 readonly NACLPORTS_CFLAGS="-I${NACLPORTS_INCLUDE}"
190 readonly NACLPORTS_LDFLAGS="-L${NACLPORTS_LIBDIR}"
191 export CFLAGS=${NACLPORTS_CFLAGS}
192 export LDFLAGS=${NACLPORTS_LDFLAGS}
193
194 # NACL_SDK_MULITARCH_USR is a version of NACLPORTS_PREFIX that gets passed int o
189 # the gcc specs file. It has a gcc spec-file conditional for ${NACL_ARCH} 195 # the gcc specs file. It has a gcc spec-file conditional for ${NACL_ARCH}
190 readonly NACL_SDK_MULTIARCH_USR=${NACL_TOOLCHAIN_ROOT}/\%\(nacl_arch\)/usr 196 readonly NACL_SDK_MULTIARCH_USR=${NACL_TOOLCHAIN_ROOT}/\%\(nacl_arch\)/usr
191 readonly NACL_SDK_MULTIARCH_USR_INCLUDE=${NACL_SDK_MULTIARCH_USR}/include 197 readonly NACL_SDK_MULTIARCH_USR_INCLUDE=${NACL_SDK_MULTIARCH_USR}/include
192 readonly NACL_SDK_MULTIARCH_USR_LIB=${NACL_SDK_MULTIARCH_USR}/lib 198 readonly NACL_SDK_MULTIARCH_USR_LIB=${NACL_SDK_MULTIARCH_USR}/lib
193 } 199 }
194 200
195 201
196 InitializePNaClToolchain() { 202 InitializePNaClToolchain() {
197 NACL_GLIBC=${NACL_GLIBC:-0} 203 NACL_GLIBC=${NACL_GLIBC:-0}
198 if [ $NACL_GLIBC = "1" ] ; then 204 if [ $NACL_GLIBC = "1" ] ; then
(...skipping 17 matching lines...) Expand all
216 # pnacl's translator 222 # pnacl's translator
217 export TRANSLATOR=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-translate 223 export TRANSLATOR=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-translate
218 # pnacl's pexe optimizer 224 # pnacl's pexe optimizer
219 export OPT=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-opt 225 export OPT=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-opt
220 # TODO(robertm): figure our why we do not have a pnacl-string 226 # TODO(robertm): figure our why we do not have a pnacl-string
221 #export NACLSTRINGS=${NACL_BIN_PATH}/pnacl-strings 227 #export NACLSTRINGS=${NACL_BIN_PATH}/pnacl-strings
222 # until then use the host's strings tool 228 # until then use the host's strings tool
223 # (used only by the cairo package) 229 # (used only by the cairo package)
224 export NACLSTRINGS="$(which strings)" 230 export NACLSTRINGS="$(which strings)"
225 231
226 # NACL_SDK_USR is where the headers, libraries, etc. will be installed 232 # NACLPORTS_PREFIX is where the headers, libraries, etc. will be installed
227 # FIXME: 233 # FIXME:
228 readonly NACL_SDK_USR=${NACL_SDK_BASE}/usr 234 readonly NACLPORTS_PREFIX=${NACL_SDK_BASE}/usr
229 readonly NACL_SDK_USR_INCLUDE=${NACL_SDK_USR}/include 235 readonly NACLPORTS_INCLUDE=${NACLPORTS_PREFIX}/include
230 readonly NACL_SDK_USR_LIB=${NACL_SDK_USR}/lib 236 readonly NACLPORTS_LIBDIR=${NACLPORTS_PREFIX}/lib
231 readonly NACL_SDK_USR_BIN=${NACL_SDK_USR}/bin 237 readonly NACLPORTS_PREFIX_BIN=${NACLPORTS_PREFIX}/bin
232 } 238 }
233 239
234 if [ ${NACL_ARCH} = "pnacl" ] ; then 240 if [ ${NACL_ARCH} = "pnacl" ] ; then
235 InitializePNaClToolchain 241 InitializePNaClToolchain
236 else 242 else
237 InitializeNaClGccToolchain 243 InitializeNaClGccToolchain
238 fi 244 fi
239 245
240 ###################################################################### 246 ######################################################################
241 # Always run 247 # Always run
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 }" |\ 445 }" |\
440 sed "/*link_libgcc:/{ 446 sed "/*link_libgcc:/{
441 N 447 N
442 s|$| -L${SED_SAFE_SPACES_USR_LIB}| 448 s|$| -L${SED_SAFE_SPACES_USR_LIB}|
443 }" >${NACL_SDK_GCC_SPECS_PATH}/specs 449 }" >${NACL_SDK_GCC_SPECS_PATH}/specs
444 } 450 }
445 451
446 452
447 DefaultPreInstallStep() { 453 DefaultPreInstallStep() {
448 cd ${NACL_NATIVE_CLIENT_SDK}/.. 454 cd ${NACL_NATIVE_CLIENT_SDK}/..
449 MakeDir ${NACL_SDK_USR} 455 MakeDir ${NACLPORTS_PREFIX}
450 MakeDir ${NACL_SDK_USR_INCLUDE} 456 MakeDir ${NACLPORTS_INCLUDE}
451 MakeDir ${NACL_SDK_USR_LIB} 457 MakeDir ${NACLPORTS_LIBDIR}
452 MakeDir ${NACL_PACKAGES_REPOSITORY} 458 MakeDir ${NACL_PACKAGES_REPOSITORY}
453 MakeDir ${NACL_PACKAGES_TARBALLS} 459 MakeDir ${NACL_PACKAGES_TARBALLS}
454 MakeDir ${NACL_PACKAGES_PUBLISH} 460 MakeDir ${NACL_PACKAGES_PUBLISH}
455 Remove ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} 461 Remove ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME}
456 } 462 }
457 463
458 464
459 DefaultExtractStep() { 465 DefaultExtractStep() {
460 Banner "Untaring ${PACKAGE_NAME}.tgz" 466 Banner "Untaring ${PACKAGE_NAME}.tgz"
461 ChangeDir ${NACL_PACKAGES_REPOSITORY} 467 ChangeDir ${NACL_PACKAGES_REPOSITORY}
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 514
509 515
510 DefaultConfigureStep() { 516 DefaultConfigureStep() {
511 local EXTRA_CONFIGURE_OPTS=("${@:-}") 517 local EXTRA_CONFIGURE_OPTS=("${@:-}")
512 Banner "Configuring ${PACKAGE_NAME}" 518 Banner "Configuring ${PACKAGE_NAME}"
513 # export the nacl tools 519 # export the nacl tools
514 export CC=${NACLCC} 520 export CC=${NACLCC}
515 export CXX=${NACLCXX} 521 export CXX=${NACLCXX}
516 export AR=${NACLAR} 522 export AR=${NACLAR}
517 export RANLIB=${NACLRANLIB} 523 export RANLIB=${NACLRANLIB}
518 export PKG_CONFIG_PATH=${NACL_SDK_USR_LIB}/pkgconfig 524 export PKG_CONFIG_PATH=${NACLPORTS_LIBDIR}/pkgconfig
519 export PKG_CONFIG_LIBDIR=${NACL_SDK_USR_LIB} 525 export PKG_CONFIG_LIBDIR=${NACLPORTS_LIBDIR}
520 export FREETYPE_CONFIG=${NACL_SDK_USR_BIN}/freetype-config 526 export FREETYPE_CONFIG=${NACLPORTS_PREFIX_BIN}/freetype-config
521 export PATH=${NACL_BIN_PATH}:${PATH}; 527 export PATH=${NACL_BIN_PATH}:${PATH};
522 ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} 528 ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME}
523 Remove ${PACKAGE_NAME}-build 529 Remove ${PACKAGE_NAME}-build
524 MakeDir ${PACKAGE_NAME}-build 530 MakeDir ${PACKAGE_NAME}-build
525 cd ${PACKAGE_NAME}-build 531 cd ${PACKAGE_NAME}-build
526 echo "Directory: $(pwd)" 532 echo "Directory: $(pwd)"
527 533
528 local conf_host=${NACL_CROSS_PREFIX} 534 local conf_host=${NACL_CROSS_PREFIX}
529 if [[ ${NACL_ARCH} = "pnacl" ]]; then 535 if [[ ${NACL_ARCH} = "pnacl" ]]; then
530 # The PNaCl tools use "pnacl-" as the prefix, but config.sub 536 # The PNaCl tools use "pnacl-" as the prefix, but config.sub
531 # does not know about "pnacl". It only knows about "le32-nacl". 537 # does not know about "pnacl". It only knows about "le32-nacl".
532 # Unfortunately, most of the config.subs here are so old that 538 # Unfortunately, most of the config.subs here are so old that
533 # it doesn't know about that "le32" either. So we just say "nacl". 539 # it doesn't know about that "le32" either. So we just say "nacl".
534 conf_host="nacl" 540 conf_host="nacl"
535 fi 541 fi
536 ../configure \ 542 ../configure \
537 --host=${conf_host} \ 543 --host=${conf_host} \
538 --disable-shared \ 544 --disable-shared \
539 --prefix=${NACL_SDK_USR} \ 545 --prefix=${NACLPORTS_PREFIX} \
540 --exec-prefix=${NACL_SDK_USR} \ 546 --exec-prefix=${NACLPORTS_PREFIX} \
541 --libdir=${NACL_SDK_USR_LIB} \ 547 --libdir=${NACLPORTS_LIBDIR} \
542 --oldincludedir=${NACL_SDK_USR_INCLUDE} \ 548 --oldincludedir=${NACLPORTS_INCLUDE} \
543 --with-http=off \ 549 --with-http=off \
544 --with-html=off \ 550 --with-html=off \
545 --with-ftp=off \ 551 --with-ftp=off \
546 --${NACL_OPTION}-mmx \ 552 --${NACL_OPTION}-mmx \
547 --${NACL_OPTION}-sse \ 553 --${NACL_OPTION}-sse \
548 --${NACL_OPTION}-sse2 \ 554 --${NACL_OPTION}-sse2 \
549 --${NACL_OPTION}-asm \ 555 --${NACL_OPTION}-asm \
550 --with-x=no \ 556 --with-x=no \
551 "${EXTRA_CONFIGURE_OPTS[@]}" 557 "${EXTRA_CONFIGURE_OPTS[@]}"
552 } 558 }
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 DefaultPackageInstall() { 667 DefaultPackageInstall() {
662 DefaultPreInstallStep 668 DefaultPreInstallStep
663 DefaultDownloadStep 669 DefaultDownloadStep
664 DefaultExtractStep 670 DefaultExtractStep
665 DefaultPatchStep 671 DefaultPatchStep
666 DefaultConfigureStep 672 DefaultConfigureStep
667 DefaultBuildStep 673 DefaultBuildStep
668 DefaultInstallStep 674 DefaultInstallStep
669 DefaultCleanUpStep 675 DefaultCleanUpStep
670 } 676 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698