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

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
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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 NACLPORTS_CXXFLAGS+=" -g -O0" 498 NACLPORTS_CXXFLAGS+=" -g -O0"
500 else 499 else
501 NACLPORTS_CFLAGS+=" -DNDEBUG -O2" 500 NACLPORTS_CFLAGS+=" -DNDEBUG -O2"
502 NACLPORTS_CXXFLAGS+=" -DNDEBUG -O2" 501 NACLPORTS_CXXFLAGS+=" -DNDEBUG -O2"
503 if [ "${NACL_ARCH}" = "pnacl" ]; then 502 if [ "${NACL_ARCH}" = "pnacl" ]; then
504 NACLPORTS_LDFLAGS+=" -DNDEBUG -O2" 503 NACLPORTS_LDFLAGS+=" -DNDEBUG -O2"
505 fi 504 fi
506 fi 505 fi
507 } 506 }
508 507
508 EnableCliMain() {
509 NACLPORTS_LDFLAGS+=" ${NACL_CLI_MAIN_LDFLAGS}"
510 NACLPORTS_LIBS+=" ${NACL_CLI_MAIN_LIB}"
511 }
512
513 EnableCliMainCxx() {
514 NACLPORTS_LDFLAGS+=" ${NACL_CLI_MAIN_LDFLAGS}"
515 NACLPORTS_LIBS+=" ${NACL_CLI_MAIN_LIB_CPP}"
516 }
517
509 EnableGlibcCompat() { 518 EnableGlibcCompat() {
510 if [ "${NACL_LIBC}" = "newlib" ]; then 519 if [ "${NACL_LIBC}" = "newlib" ]; then
511 NACLPORTS_CPPFLAGS+=" -I${NACLPORTS_INCLUDE}/glibc-compat" 520 NACLPORTS_CPPFLAGS+=" -I${NACLPORTS_INCLUDE}/glibc-compat"
512 NACLPORTS_LIBS+=" -lglibc-compat" 521 NACLPORTS_LIBS+=" -lglibc-compat"
513 fi 522 fi
514 } 523 }
515 524
516 # 525 #
517 # Attempt to download a file from a given URL 526 # Attempt to download a file from a given URL
518 # $1 - URL to fetch 527 # $1 - URL to fetch
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 MAKEFLAGS+=" CONFIG=Debug" 773 MAKEFLAGS+=" CONFIG=Debug"
765 else 774 else
766 MAKEFLAGS+=" CONFIG=Release" 775 MAKEFLAGS+=" CONFIG=Release"
767 fi 776 fi
768 if [ "${VERBOSE:-}" = "1" ]; then 777 if [ "${VERBOSE:-}" = "1" ]; then
769 MAKEFLAGS+=" V=1" 778 MAKEFLAGS+=" V=1"
770 fi 779 fi
771 export MAKEFLAGS 780 export MAKEFLAGS
772 781
773 BUILD_DIR=${START_DIR} 782 BUILD_DIR=${START_DIR}
783 echo "LDFLAGS=${LDFLAGS}"
774 } 784 }
775 785
776 SetupCrossPaths() { 786 SetupCrossPaths() {
777 export PKG_CONFIG_LIBDIR="${NACLPORTS_LIBDIR}/pkgconfig" 787 export PKG_CONFIG_LIBDIR="${NACLPORTS_LIBDIR}/pkgconfig"
778 # By default PKG_CONFIG_PATH is set to <libdir>/pkgconfig:<datadir>/pkgconfig. 788 # By default PKG_CONFIG_PATH is set to <libdir>/pkgconfig:<datadir>/pkgconfig.
779 # While PKG_CONFIG_LIBDIR overrides <libdir>, <datadir> (/usr/share/) can only 789 # While PKG_CONFIG_LIBDIR overrides <libdir>, <datadir> (/usr/share/) can only
780 # be overridden individually when pkg-config is built. 790 # be overridden individually when pkg-config is built.
781 # Setting PKG_CONFIG_PATH instead to compensate. 791 # Setting PKG_CONFIG_PATH instead to compensate.
782 export PKG_CONFIG_PATH="${NACLPORTS_LIBDIR}/pkgconfig" 792 export PKG_CONFIG_PATH="${NACLPORTS_LIBDIR}/pkgconfig"
783 PKG_CONFIG_PATH+=":${NACLPORTS_LIBDIR}/../share/pkgconfig" 793 PKG_CONFIG_PATH+=":${NACLPORTS_LIBDIR}/../share/pkgconfig"
(...skipping 11 matching lines...) Expand all
795 export CC=${NACLCC} 805 export CC=${NACLCC}
796 export CXX=${NACLCXX} 806 export CXX=${NACLCXX}
797 export AR=${NACLAR} 807 export AR=${NACLAR}
798 export RANLIB=${NACLRANLIB} 808 export RANLIB=${NACLRANLIB}
799 export READELF=${NACLREADELF} 809 export READELF=${NACLREADELF}
800 export STRIP=${NACLSTRIP} 810 export STRIP=${NACLSTRIP}
801 811
802 export CFLAGS=${NACLPORTS_CFLAGS} 812 export CFLAGS=${NACLPORTS_CFLAGS}
803 export CPPFLAGS=${NACLPORTS_CPPFLAGS} 813 export CPPFLAGS=${NACLPORTS_CPPFLAGS}
804 export CXXFLAGS=${NACLPORTS_CXXFLAGS} 814 export CXXFLAGS=${NACLPORTS_CXXFLAGS}
805 export LDFLAGS="${NACLPORTS_LDFLAGS} ${NACLPORTS_LIBS}" 815 export LDFLAGS=${NACLPORTS_LDFLAGS}
806 export ARFLAGS=${NACL_ARFLAGS} 816 export ARFLAGS=${NACL_ARFLAGS}
807 export AR_FLAGS=${NACL_ARFLAGS} 817 export AR_FLAGS=${NACL_ARFLAGS}
808 export LIBS=${LIBS:-${NACLPORTS_LIBS}} 818 export LIBS=${LIBS:-${NACLPORTS_LIBS}}
809 819
810 echo "CPPFLAGS=${CPPFLAGS}" 820 echo "CPPFLAGS=${CPPFLAGS}"
811 echo "CFLAGS=${CFLAGS}" 821 echo "CFLAGS=${CFLAGS}"
812 echo "CXXFLAGS=${CXXFLAGS}" 822 echo "CXXFLAGS=${CXXFLAGS}"
813 echo "LDFLAGS=${LDFLAGS}" 823 echo "LDFLAGS=${LDFLAGS}"
814 echo "LIBS=${LIBS}" 824 echo "LIBS=${LIBS}"
815 } 825 }
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 ###################################################################### 1593 ######################################################################
1584 # Always run 1594 # Always run
1585 # These functions are called when this script is imported to do 1595 # These functions are called when this script is imported to do
1586 # any essential checking/setup operations. 1596 # any essential checking/setup operations.
1587 ###################################################################### 1597 ######################################################################
1588 PatchSpecsFile 1598 PatchSpecsFile
1589 InjectSystemHeaders 1599 InjectSystemHeaders
1590 InstallConfigSite 1600 InstallConfigSite
1591 GetRevision 1601 GetRevision
1592 MakeDirs 1602 MakeDirs
OLDNEW
« no previous file with comments | « PRESUBMIT.py ('k') | build_tools/pnacl-configure-shim.py » ('j') | ports/avrdude/nacl.patch » ('J')

Powered by Google App Engine
This is Rietveld 408576698