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

Side by Side Diff: build_tools/common.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 | « PRESUBMIT.py ('k') | build_tools/pnacl-configure-shim.py » ('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) 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 set to one of the following 5 # Environment variable NACL_ARCH should be set to one of the following
6 # values: i686 x86_64 pnacl arm 6 # values: i686 x86_64 pnacl arm
7 7
8 8
9 # NAMING CONVENTION 9 # NAMING CONVENTION
10 # ================= 10 # =================
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 # Set NACL_SHARED when we want to build shared libraries. 112 # Set NACL_SHARED when we want to build shared libraries.
113 if [ "${NACL_LIBC}" = "glibc" -o "${NACL_LIBC}" = "bionic" ]; then 113 if [ "${NACL_LIBC}" = "glibc" -o "${NACL_LIBC}" = "bionic" ]; then
114 NACL_SHARED=1 114 NACL_SHARED=1
115 else 115 else
116 NACL_SHARED=0 116 NACL_SHARED=0
117 fi 117 fi
118 118
119 # libcli_main.a has a circular dependency which makes static link fail 119 # libcli_main.a has a circular dependency which makes static link fail
120 # (cli_main => nacl_io => ppapi_cpp => cli_main). To break this loop, 120 # (cli_main => nacl_io => ppapi_cpp => cli_main). To break this loop,
121 # you should use this instead of -lcli_main. 121 # you should use this instead of -lcli_main.
122 export NACL_CLI_MAIN_LIB="-Xlinker -unacl_main -Xlinker -uPSUserMainGet \ 122 NACL_CLI_MAIN_LDFLAGS="-Xlinker -uPSUserMainGet"
123 -lcli_main -lnacl_spawn -ltar -lppapi_simple -lnacl_io \ 123 NACL_CLI_MAIN_LIB="-lcli_main -lnacl_spawn -ltar -lppapi_simple \
124 -lppapi -l${NACL_CXX_LIB}" 124 -lnacl_io -lppapi -l${NACL_CXX_LIB}"
125 export NACL_CLI_MAIN_LIB_CPP="-Xlinker -unacl_main -Xlinker -uPSUserMainGet \ 125 NACL_CLI_MAIN_LIB_CPP="-lcli_main -lnacl_spawn -ltar -lppapi_simple_cpp \
126 -lcli_main -lnacl_spawn -ltar -lppapi_simple_cpp -lnacl_io \ 126 -lnacl_io -lppapi_cpp -lppapi -l${NACL_CXX_LIB}"
127 -lppapi_cpp -lppapi -l${NACL_CXX_LIB}"
128 127
129 # Python variables 128 # Python variables
130 NACL_PYSETUP_ARGS="" 129 NACL_PYSETUP_ARGS=""
131 NACL_BUILD_SUBDIR=build 130 NACL_BUILD_SUBDIR=build
132 NACL_INSTALL_SUBDIR=install 131 NACL_INSTALL_SUBDIR=install
133 132
134 # output directories 133 # output directories
135 readonly NACL_PACKAGES_OUT=${NACL_SRC}/out 134 readonly NACL_PACKAGES_OUT=${NACL_SRC}/out
136 readonly NACL_PACKAGES_ROOT=${NACL_PACKAGES_OUT}/packages 135 readonly NACL_PACKAGES_ROOT=${NACL_PACKAGES_OUT}/packages
137 readonly NACL_PACKAGES_BUILD=${NACL_PACKAGES_OUT}/build 136 readonly NACL_PACKAGES_BUILD=${NACL_PACKAGES_OUT}/build
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 NACLPORTS_CXXFLAGS+=" -g -O0" 499 NACLPORTS_CXXFLAGS+=" -g -O0"
501 else 500 else
502 NACLPORTS_CFLAGS+=" -DNDEBUG -O2" 501 NACLPORTS_CFLAGS+=" -DNDEBUG -O2"
503 NACLPORTS_CXXFLAGS+=" -DNDEBUG -O2" 502 NACLPORTS_CXXFLAGS+=" -DNDEBUG -O2"
504 if [ "${NACL_ARCH}" = "pnacl" ]; then 503 if [ "${NACL_ARCH}" = "pnacl" ]; then
505 NACLPORTS_LDFLAGS+=" -DNDEBUG -O2" 504 NACLPORTS_LDFLAGS+=" -DNDEBUG -O2"
506 fi 505 fi
507 fi 506 fi
508 } 507 }
509 508
509 EnableCliMain() {
510 NACLPORTS_LDFLAGS+=" ${NACL_CLI_MAIN_LDFLAGS}"
511 NACLPORTS_LIBS+=" ${NACL_CLI_MAIN_LIB}"
512 }
513
514 EnableCliMainCxx() {
515 NACLPORTS_LDFLAGS+=" ${NACL_CLI_MAIN_LDFLAGS}"
516 NACLPORTS_LIBS+=" ${NACL_CLI_MAIN_LIB_CPP}"
517 }
518
510 EnableGlibcCompat() { 519 EnableGlibcCompat() {
511 if [ "${NACL_LIBC}" = "newlib" ]; then 520 if [ "${NACL_LIBC}" = "newlib" ]; then
512 NACLPORTS_CPPFLAGS+=" -I${NACLPORTS_INCLUDE}/glibc-compat" 521 NACLPORTS_CPPFLAGS+=" -I${NACLPORTS_INCLUDE}/glibc-compat"
513 NACLPORTS_LIBS+=" -lglibc-compat" 522 NACLPORTS_LIBS+=" -lglibc-compat"
514 fi 523 fi
515 } 524 }
516 525
517 # 526 #
518 # Attempt to download a file from a given URL 527 # Attempt to download a file from a given URL
519 # $1 - URL to fetch 528 # $1 - URL to fetch
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 MAKEFLAGS+=" CONFIG=Debug" 774 MAKEFLAGS+=" CONFIG=Debug"
766 else 775 else
767 MAKEFLAGS+=" CONFIG=Release" 776 MAKEFLAGS+=" CONFIG=Release"
768 fi 777 fi
769 if [ "${VERBOSE:-}" = "1" ]; then 778 if [ "${VERBOSE:-}" = "1" ]; then
770 MAKEFLAGS+=" V=1" 779 MAKEFLAGS+=" V=1"
771 fi 780 fi
772 export MAKEFLAGS 781 export MAKEFLAGS
773 782
774 BUILD_DIR=${START_DIR} 783 BUILD_DIR=${START_DIR}
784 echo "LDFLAGS=${LDFLAGS}"
775 } 785 }
776 786
777 SetupCrossPaths() { 787 SetupCrossPaths() {
778 export PKG_CONFIG_LIBDIR="${NACLPORTS_LIBDIR}/pkgconfig" 788 export PKG_CONFIG_LIBDIR="${NACLPORTS_LIBDIR}/pkgconfig"
779 # By default PKG_CONFIG_PATH is set to <libdir>/pkgconfig:<datadir>/pkgconfig. 789 # By default PKG_CONFIG_PATH is set to <libdir>/pkgconfig:<datadir>/pkgconfig.
780 # While PKG_CONFIG_LIBDIR overrides <libdir>, <datadir> (/usr/share/) can only 790 # While PKG_CONFIG_LIBDIR overrides <libdir>, <datadir> (/usr/share/) can only
781 # be overridden individually when pkg-config is built. 791 # be overridden individually when pkg-config is built.
782 # Setting PKG_CONFIG_PATH instead to compensate. 792 # Setting PKG_CONFIG_PATH instead to compensate.
783 export PKG_CONFIG_PATH="${NACLPORTS_LIBDIR}/pkgconfig" 793 export PKG_CONFIG_PATH="${NACLPORTS_LIBDIR}/pkgconfig"
784 PKG_CONFIG_PATH+=":${NACLPORTS_LIBDIR}/../share/pkgconfig" 794 PKG_CONFIG_PATH+=":${NACLPORTS_LIBDIR}/../share/pkgconfig"
(...skipping 11 matching lines...) Expand all
796 export CC=${NACLCC} 806 export CC=${NACLCC}
797 export CXX=${NACLCXX} 807 export CXX=${NACLCXX}
798 export AR=${NACLAR} 808 export AR=${NACLAR}
799 export RANLIB=${NACLRANLIB} 809 export RANLIB=${NACLRANLIB}
800 export READELF=${NACLREADELF} 810 export READELF=${NACLREADELF}
801 export STRIP=${NACLSTRIP} 811 export STRIP=${NACLSTRIP}
802 812
803 export CFLAGS=${NACLPORTS_CFLAGS} 813 export CFLAGS=${NACLPORTS_CFLAGS}
804 export CPPFLAGS=${NACLPORTS_CPPFLAGS} 814 export CPPFLAGS=${NACLPORTS_CPPFLAGS}
805 export CXXFLAGS=${NACLPORTS_CXXFLAGS} 815 export CXXFLAGS=${NACLPORTS_CXXFLAGS}
806 export LDFLAGS="${NACLPORTS_LDFLAGS} ${NACLPORTS_LIBS}" 816 export LDFLAGS=${NACLPORTS_LDFLAGS}
807 export ARFLAGS=${NACL_ARFLAGS} 817 export ARFLAGS=${NACL_ARFLAGS}
808 export AR_FLAGS=${NACL_ARFLAGS} 818 export AR_FLAGS=${NACL_ARFLAGS}
809 export LIBS=${LIBS:-${NACLPORTS_LIBS}} 819 export LIBS=${LIBS:-${NACLPORTS_LIBS}}
810 820
811 echo "CPPFLAGS=${CPPFLAGS}" 821 echo "CPPFLAGS=${CPPFLAGS}"
812 echo "CFLAGS=${CFLAGS}" 822 echo "CFLAGS=${CFLAGS}"
813 echo "CXXFLAGS=${CXXFLAGS}" 823 echo "CXXFLAGS=${CXXFLAGS}"
814 echo "LDFLAGS=${LDFLAGS}" 824 echo "LDFLAGS=${LDFLAGS}"
815 echo "LIBS=${LIBS}" 825 echo "LIBS=${LIBS}"
816 } 826 }
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
1584 ###################################################################### 1594 ######################################################################
1585 # Always run 1595 # Always run
1586 # These functions are called when this script is imported to do 1596 # These functions are called when this script is imported to do
1587 # any essential checking/setup operations. 1597 # any essential checking/setup operations.
1588 ###################################################################### 1598 ######################################################################
1589 PatchSpecsFile 1599 PatchSpecsFile
1590 InjectSystemHeaders 1600 InjectSystemHeaders
1591 InstallConfigSite 1601 InstallConfigSite
1592 GetRevision 1602 GetRevision
1593 MakeDirs 1603 MakeDirs
OLDNEW
« no previous file with comments | « PRESUBMIT.py ('k') | build_tools/pnacl-configure-shim.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698