| OLD | NEW |
| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 export NACLCXX=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-g++ | 168 export NACLCXX=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-g++ |
| 169 export NACLAR=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ar | 169 export NACLAR=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ar |
| 170 export NACLRANLIB=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ranlib | 170 export NACLRANLIB=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ranlib |
| 171 export NACLLD=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ld | 171 export NACLLD=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ld |
| 172 export NACLSTRINGS=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-strings | 172 export NACLSTRINGS=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-strings |
| 173 export NACLSTRIP=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-strip | 173 export NACLSTRIP=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-strip |
| 174 | 174 |
| 175 # NACL_SDK_GCC_SPECS_PATH is where nacl-gcc 'specs' file will be installed | 175 # NACL_SDK_GCC_SPECS_PATH is where nacl-gcc 'specs' file will be installed |
| 176 readonly NACL_SDK_GCC_SPECS_PATH=${NACL_TOOLCHAIN_ROOT}/lib/gcc/x86_64-nacl/4.
4.3 | 176 readonly NACL_SDK_GCC_SPECS_PATH=${NACL_TOOLCHAIN_ROOT}/lib/gcc/x86_64-nacl/4.
4.3 |
| 177 | 177 |
| 178 # NACL_SDK_USR is where the headers, libraries, etc. will be installed | |
| 179 readonly NACL_SDK_USR=${NACL_TOOLCHAIN_ROOT}/${NACL_CROSS_PREFIX}/usr | |
| 180 readonly NACL_SDK_USR_INCLUDE=${NACL_SDK_USR}/include | |
| 181 | |
| 182 if [ ${NACL_ARCH} = "arm" ] ; then | 178 if [ ${NACL_ARCH} = "arm" ] ; then |
| 183 local NACL_LIBDIR=arm-nacl/lib | 179 local NACL_LIBDIR=arm-nacl/lib |
| 184 elif [ ${NACL_ARCH} = "x86_64" ] ; then | 180 elif [ ${NACL_ARCH} = "x86_64" ] ; then |
| 185 local NACL_LIBDIR=x86_64-nacl/lib64 | 181 local NACL_LIBDIR=x86_64-nacl/lib64 |
| 186 else | 182 else |
| 187 local NACL_LIBDIR=x86_64-nacl/lib32 | 183 local NACL_LIBDIR=x86_64-nacl/lib32 |
| 188 fi | 184 fi |
| 189 | 185 |
| 186 # NACLPORTS_PREFIX is where the headers, libraries, etc. will be installed |
| 187 # Default to the usr folder within the SDK. |
| 188 readonly NACLPORTS_PREFIX=${NACLPORTS_PREFIX:-${NACL_TOOLCHAIN_ROOT}/${NACL_CR
OSS_PREFIX}/usr} |
| 189 readonly NACLPORTS_INCLUDE=${NACLPORTS_PREFIX}/include |
| 190 readonly NACL_SDK_LIB=${NACL_TOOLCHAIN_ROOT}/${NACL_LIBDIR} | 190 readonly NACL_SDK_LIB=${NACL_TOOLCHAIN_ROOT}/${NACL_LIBDIR} |
| 191 readonly NACLPORTS_LIBDIR=${NACLPORTS_PREFIX}/lib |
| 192 readonly NACLPORTS_PREFIX_BIN=${NACLPORTS_PREFIX}/bin |
| 191 | 193 |
| 192 readonly NACL_SDK_USR_LIB=${NACL_SDK_USR}/lib | 194 readonly NACLPORTS_CFLAGS="-I${NACLPORTS_INCLUDE}" |
| 193 readonly NACL_SDK_USR_BIN=${NACL_SDK_USR}/bin | 195 readonly NACLPORTS_LDFLAGS="-L${NACLPORTS_LIBDIR}" |
| 196 export CFLAGS=${NACLPORTS_CFLAGS} |
| 197 export LDFLAGS=${NACLPORTS_LDFLAGS} |
| 194 | 198 |
| 195 # NACL_SDK_MULITARCH_USR is a version of NACL_SDK_USR that gets passed into | 199 # NACL_SDK_MULITARCH_USR is a version of NACLPORTS_PREFIX that gets passed int
o |
| 196 # the gcc specs file. It has a gcc spec-file conditional for ${NACL_ARCH} | 200 # the gcc specs file. It has a gcc spec-file conditional for ${NACL_ARCH} |
| 197 readonly NACL_SDK_MULTIARCH_USR=${NACL_TOOLCHAIN_ROOT}/\%\(nacl_arch\)/usr | 201 readonly NACL_SDK_MULTIARCH_USR=${NACL_TOOLCHAIN_ROOT}/\%\(nacl_arch\)/usr |
| 198 readonly NACL_SDK_MULTIARCH_USR_INCLUDE=${NACL_SDK_MULTIARCH_USR}/include | 202 readonly NACL_SDK_MULTIARCH_USR_INCLUDE=${NACL_SDK_MULTIARCH_USR}/include |
| 199 readonly NACL_SDK_MULTIARCH_USR_LIB=${NACL_SDK_MULTIARCH_USR}/lib | 203 readonly NACL_SDK_MULTIARCH_USR_LIB=${NACL_SDK_MULTIARCH_USR}/lib |
| 200 } | 204 } |
| 201 | 205 |
| 202 | 206 |
| 203 InitializePNaClToolchain() { | 207 InitializePNaClToolchain() { |
| 204 NACL_GLIBC=${NACL_GLIBC:-0} | 208 NACL_GLIBC=${NACL_GLIBC:-0} |
| 205 if [ $NACL_GLIBC = "1" ] ; then | 209 if [ $NACL_GLIBC = "1" ] ; then |
| (...skipping 17 matching lines...) Expand all Loading... |
| 223 # pnacl's translator | 227 # pnacl's translator |
| 224 export TRANSLATOR=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-translate | 228 export TRANSLATOR=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-translate |
| 225 # pnacl's pexe optimizer | 229 # pnacl's pexe optimizer |
| 226 export OPT=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-opt | 230 export OPT=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-opt |
| 227 # TODO(robertm): figure our why we do not have a pnacl-string | 231 # TODO(robertm): figure our why we do not have a pnacl-string |
| 228 #export NACLSTRINGS=${NACL_BIN_PATH}/pnacl-strings | 232 #export NACLSTRINGS=${NACL_BIN_PATH}/pnacl-strings |
| 229 # until then use the host's strings tool | 233 # until then use the host's strings tool |
| 230 # (used only by the cairo package) | 234 # (used only by the cairo package) |
| 231 export NACLSTRINGS="$(which strings)" | 235 export NACLSTRINGS="$(which strings)" |
| 232 | 236 |
| 233 # NACL_SDK_USR is where the headers, libraries, etc. will be installed | 237 # NACLPORTS_PREFIX is where the headers, libraries, etc. will be installed |
| 234 # FIXME: | 238 # FIXME: |
| 235 readonly NACL_SDK_USR=${NACL_SDK_BASE}/usr | 239 readonly NACLPORTS_PREFIX=${NACL_SDK_BASE}/usr |
| 236 readonly NACL_SDK_USR_INCLUDE=${NACL_SDK_USR}/include | 240 readonly NACLPORTS_INCLUDE=${NACLPORTS_PREFIX}/include |
| 237 readonly NACL_SDK_USR_LIB=${NACL_SDK_USR}/lib | 241 readonly NACLPORTS_LIBDIR=${NACLPORTS_PREFIX}/lib |
| 238 readonly NACL_SDK_USR_BIN=${NACL_SDK_USR}/bin | 242 readonly NACLPORTS_PREFIX_BIN=${NACLPORTS_PREFIX}/bin |
| 239 } | 243 } |
| 240 | 244 |
| 241 if [ ${NACL_ARCH} = "pnacl" ] ; then | 245 if [ ${NACL_ARCH} = "pnacl" ] ; then |
| 242 InitializePNaClToolchain | 246 InitializePNaClToolchain |
| 243 else | 247 else |
| 244 InitializeNaClGccToolchain | 248 InitializeNaClGccToolchain |
| 245 fi | 249 fi |
| 246 | 250 |
| 247 ###################################################################### | 251 ###################################################################### |
| 248 # Always run | 252 # Always run |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 }" |\ | 469 }" |\ |
| 466 sed "/*link_libgcc:/{ | 470 sed "/*link_libgcc:/{ |
| 467 N | 471 N |
| 468 s|$| -L${SED_SAFE_SPACES_USR_LIB}| | 472 s|$| -L${SED_SAFE_SPACES_USR_LIB}| |
| 469 }" >${NACL_SDK_GCC_SPECS_PATH}/specs | 473 }" >${NACL_SDK_GCC_SPECS_PATH}/specs |
| 470 } | 474 } |
| 471 | 475 |
| 472 | 476 |
| 473 DefaultPreInstallStep() { | 477 DefaultPreInstallStep() { |
| 474 cd ${NACL_NATIVE_CLIENT_SDK}/.. | 478 cd ${NACL_NATIVE_CLIENT_SDK}/.. |
| 475 MakeDir ${NACL_SDK_USR} | 479 MakeDir ${NACLPORTS_PREFIX} |
| 476 MakeDir ${NACL_SDK_USR_INCLUDE} | 480 MakeDir ${NACLPORTS_INCLUDE} |
| 477 MakeDir ${NACL_SDK_USR_LIB} | 481 MakeDir ${NACLPORTS_LIBDIR} |
| 478 MakeDir ${NACL_PACKAGES_REPOSITORY} | 482 MakeDir ${NACL_PACKAGES_REPOSITORY} |
| 479 MakeDir ${NACL_PACKAGES_TARBALLS} | 483 MakeDir ${NACL_PACKAGES_TARBALLS} |
| 480 MakeDir ${NACL_PACKAGES_PUBLISH} | 484 MakeDir ${NACL_PACKAGES_PUBLISH} |
| 481 Remove ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} | 485 Remove ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} |
| 482 } | 486 } |
| 483 | 487 |
| 484 | 488 |
| 485 DefaultExtractStep() { | 489 DefaultExtractStep() { |
| 486 Banner "Untaring ${PACKAGE_NAME}.tgz" | 490 Banner "Untaring ${PACKAGE_NAME}.tgz" |
| 487 ChangeDir ${NACL_PACKAGES_REPOSITORY} | 491 ChangeDir ${NACL_PACKAGES_REPOSITORY} |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 | 538 |
| 535 | 539 |
| 536 DefaultConfigureStep() { | 540 DefaultConfigureStep() { |
| 537 local EXTRA_CONFIGURE_OPTS=("${@:-}") | 541 local EXTRA_CONFIGURE_OPTS=("${@:-}") |
| 538 Banner "Configuring ${PACKAGE_NAME}" | 542 Banner "Configuring ${PACKAGE_NAME}" |
| 539 # export the nacl tools | 543 # export the nacl tools |
| 540 export CC=${NACLCC} | 544 export CC=${NACLCC} |
| 541 export CXX=${NACLCXX} | 545 export CXX=${NACLCXX} |
| 542 export AR=${NACLAR} | 546 export AR=${NACLAR} |
| 543 export RANLIB=${NACLRANLIB} | 547 export RANLIB=${NACLRANLIB} |
| 544 export PKG_CONFIG_PATH=${NACL_SDK_USR_LIB}/pkgconfig | 548 export PKG_CONFIG_PATH=${NACLPORTS_LIBDIR}/pkgconfig |
| 545 export PKG_CONFIG_LIBDIR=${NACL_SDK_USR_LIB} | 549 export PKG_CONFIG_LIBDIR=${NACLPORTS_LIBDIR} |
| 546 export FREETYPE_CONFIG=${NACL_SDK_USR_BIN}/freetype-config | 550 export FREETYPE_CONFIG=${NACLPORTS_PREFIX_BIN}/freetype-config |
| 547 export PATH=${NACL_BIN_PATH}:${PATH}; | 551 export PATH=${NACL_BIN_PATH}:${PATH}; |
| 548 ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} | 552 ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} |
| 549 Remove ${PACKAGE_NAME}-build | 553 Remove ${PACKAGE_NAME}-build |
| 550 MakeDir ${PACKAGE_NAME}-build | 554 MakeDir ${PACKAGE_NAME}-build |
| 551 cd ${PACKAGE_NAME}-build | 555 cd ${PACKAGE_NAME}-build |
| 552 echo "Directory: $(pwd)" | 556 echo "Directory: $(pwd)" |
| 553 | 557 |
| 554 local conf_host=${NACL_CROSS_PREFIX} | 558 local conf_host=${NACL_CROSS_PREFIX} |
| 555 if [[ ${NACL_ARCH} = "pnacl" ]]; then | 559 if [[ ${NACL_ARCH} = "pnacl" ]]; then |
| 556 # The PNaCl tools use "pnacl-" as the prefix, but config.sub | 560 # The PNaCl tools use "pnacl-" as the prefix, but config.sub |
| 557 # does not know about "pnacl". It only knows about "le32-nacl". | 561 # does not know about "pnacl". It only knows about "le32-nacl". |
| 558 # Unfortunately, most of the config.subs here are so old that | 562 # Unfortunately, most of the config.subs here are so old that |
| 559 # it doesn't know about that "le32" either. So we just say "nacl". | 563 # it doesn't know about that "le32" either. So we just say "nacl". |
| 560 conf_host="nacl" | 564 conf_host="nacl" |
| 561 fi | 565 fi |
| 562 ../configure \ | 566 ../configure \ |
| 563 --host=${conf_host} \ | 567 --host=${conf_host} \ |
| 564 --disable-shared \ | 568 --disable-shared \ |
| 565 --prefix=${NACL_SDK_USR} \ | 569 --prefix=${NACLPORTS_PREFIX} \ |
| 566 --exec-prefix=${NACL_SDK_USR} \ | 570 --exec-prefix=${NACLPORTS_PREFIX} \ |
| 567 --libdir=${NACL_SDK_USR_LIB} \ | 571 --libdir=${NACLPORTS_LIBDIR} \ |
| 568 --oldincludedir=${NACL_SDK_USR_INCLUDE} \ | 572 --oldincludedir=${NACLPORTS_INCLUDE} \ |
| 569 --with-http=off \ | 573 --with-http=off \ |
| 570 --with-html=off \ | 574 --with-html=off \ |
| 571 --with-ftp=off \ | 575 --with-ftp=off \ |
| 572 --${NACL_OPTION}-mmx \ | 576 --${NACL_OPTION}-mmx \ |
| 573 --${NACL_OPTION}-sse \ | 577 --${NACL_OPTION}-sse \ |
| 574 --${NACL_OPTION}-sse2 \ | 578 --${NACL_OPTION}-sse2 \ |
| 575 --${NACL_OPTION}-asm \ | 579 --${NACL_OPTION}-asm \ |
| 576 --with-x=no \ | 580 --with-x=no \ |
| 577 "${EXTRA_CONFIGURE_OPTS[@]}" | 581 "${EXTRA_CONFIGURE_OPTS[@]}" |
| 578 } | 582 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 DefaultPackageInstall() { | 691 DefaultPackageInstall() { |
| 688 DefaultPreInstallStep | 692 DefaultPreInstallStep |
| 689 DefaultDownloadStep | 693 DefaultDownloadStep |
| 690 DefaultExtractStep | 694 DefaultExtractStep |
| 691 DefaultPatchStep | 695 DefaultPatchStep |
| 692 DefaultConfigureStep | 696 DefaultConfigureStep |
| 693 DefaultBuildStep | 697 DefaultBuildStep |
| 694 DefaultInstallStep | 698 DefaultInstallStep |
| 695 DefaultCleanUpStep | 699 DefaultCleanUpStep |
| 696 } | 700 } |
| OLD | NEW |