OLD | NEW |
1 # Copyright (c) 2014 The Native Client Authors. All rights reserved. | 1 # Copyright (c) 2014 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 EXECUTABLES=python${NACL_EXEEXT} | 5 EXECUTABLES=python${NACL_EXEEXT} |
6 | 6 |
7 # Workaround for arm-gcc bug: | 7 # Workaround for arm-gcc bug: |
8 # https://code.google.com/p/nativeclient/issues/detail?id=3205 | 8 # https://code.google.com/p/nativeclient/issues/detail?id=3205 |
9 # TODO(sbc): remove this once the issue is fixed | 9 # TODO(sbc): remove this once the issue is fixed |
10 if [ "${NACL_ARCH}" = "arm" ]; then | 10 if [ "${NACL_ARCH}" = "arm" ]; then |
(...skipping 19 matching lines...) Expand all Loading... |
30 EXTRA_CONFIGURE_ARGS="--disable-ipv6" | 30 EXTRA_CONFIGURE_ARGS="--disable-ipv6" |
31 EXTRA_CONFIGURE_ARGS+=" --with-suffix=${NACL_EXEEXT}" | 31 EXTRA_CONFIGURE_ARGS+=" --with-suffix=${NACL_EXEEXT}" |
32 EXTRA_CONFIGURE_ARGS+=" --build=i686-linux-gnu --disable-shared --enable-stati
c" | 32 EXTRA_CONFIGURE_ARGS+=" --build=i686-linux-gnu --disable-shared --enable-stati
c" |
33 export SO=.a | 33 export SO=.a |
34 export MAKEFLAGS="PGEN=${NACL_HOST_PYBUILD}/Parser/pgen" | 34 export MAKEFLAGS="PGEN=${NACL_HOST_PYBUILD}/Parser/pgen" |
35 export LIBS="-ltermcap" | 35 export LIBS="-ltermcap" |
36 export DYNLOADFILE=dynload_ppapi.o | 36 export DYNLOADFILE=dynload_ppapi.o |
37 export MACHDEP=ppapi | 37 export MACHDEP=ppapi |
38 export LINKCC=${NACLCXX} | 38 export LINKCC=${NACLCXX} |
39 if [ "${NACL_LIBC}" = "newlib" ]; then | 39 if [ "${NACL_LIBC}" = "newlib" ]; then |
40 LIBS+=" -lglibc-compat -lc" | 40 LIBS+=" -lglibc-compat" |
41 NACLPORTS_CPPFLAGS+=" -I${NACLPORTS_INCLUDE}/glibc-compat" | 41 NACLPORTS_CPPFLAGS+=" -I${NACLPORTS_INCLUDE}/glibc-compat" |
42 fi | 42 fi |
43 LogExecute cp ${START_DIR}/dynload_ppapi.c ${SRC_DIR}/Python/ | 43 LogExecute cp ${START_DIR}/dynload_ppapi.c ${SRC_DIR}/Python/ |
44 # This next step is costly, but it sets the environment variables correctly. | 44 # This next step is costly, but it sets the environment variables correctly. |
45 DefaultConfigureStep | 45 DefaultConfigureStep |
46 | 46 |
47 LogExecute cp ${START_DIR}/Setup.local Modules/ | 47 LogExecute cp ${START_DIR}/Setup.local Modules/ |
48 cat ${DEST_PYTHON_OBJS}/*.list >> Modules/Setup.local | 48 cat ${DEST_PYTHON_OBJS}/*.list >> Modules/Setup.local |
49 PY_MOD_LIBS="" | 49 PY_MOD_LIBS="" |
50 for MODFILE in ${DEST_PYTHON_OBJS}/*.libs ; do | 50 for MODFILE in ${DEST_PYTHON_OBJS}/*.libs ; do |
51 if [ -e ${MODFILE} ]; then | 51 if [ -e ${MODFILE} ]; then |
52 source ${MODFILE} | 52 source ${MODFILE} |
53 fi | 53 fi |
54 done | 54 done |
55 LogExecute rm -vf libpython2.7.a | 55 LogExecute rm -vf libpython2.7.a |
56 PY_LINK_LINE+="ppapi_wrapper ${DEST_PYTHON_OBJS}/\*/\*.o" | 56 PY_LINK_LINE+="ppapi_wrapper ${DEST_PYTHON_OBJS}/\*/\*.o" |
57 # Not sure why -uPSUserMainGet is needed here. NACL_CLI_MAIN_LIB already | 57 # Not sure why -uPSUserMainGet is needed here. NACL_CLI_MAIN_LIB already |
58 # contains -uPSUserCreateInstance which should be enough to pull in both | 58 # contains -uPSUserCreateInstance which should be enough to pull in both |
59 # symbols (they live int he same object file in libcli_main.a). | 59 # symbols (they live int he same object file in libcli_main.a). |
60 PY_LINK_LINE+=" ${PY_MOD_LIBS} -Wl,-uPSUserMainGet ${NACL_CLI_MAIN_LIB}" | 60 PY_LINK_LINE+=" ${PY_MOD_LIBS} -Wl,-uPSUserMainGet -lcli_main -lnacl_spawn" |
61 PY_LINK_LINE+=" -lz -lppapi_simple -lppapi -lppapi_cpp -lnacl" | 61 PY_LINK_LINE+=" -lz -lppapi_simple -lppapi -lppapi_cpp -lnacl" |
62 PY_LINK_LINE+=" -lnacl_io -lc -lbz2" | 62 PY_LINK_LINE+=" -lnacl_io -lbz2" |
63 if [ "${NACL_LIBC}" = "newlib" ]; then | 63 if [ "${NACL_LIBC}" = "newlib" ]; then |
64 PY_LINK_LINE+=" -lglibc-compat" | 64 PY_LINK_LINE+=" -lglibc-compat" |
65 fi | 65 fi |
66 echo ${PY_LINK_LINE} >> Modules/Setup.local | 66 echo ${PY_LINK_LINE} >> Modules/Setup.local |
67 # At this point we use the existing environment variables from | 67 # At this point we use the existing environment variables from |
68 # DefaultConfigureStep to build our destination Python modules | 68 # DefaultConfigureStep to build our destination Python modules |
69 } | 69 } |
70 | 70 |
71 BuildStep() { | 71 BuildStep() { |
72 SetupCrossEnvironment | 72 SetupCrossEnvironment |
73 export CROSS_COMPILE=true | 73 export CROSS_COMPILE=true |
74 export MAKEFLAGS="PGEN=${NACL_HOST_PYBUILD}/Parser/pgen" | 74 export MAKEFLAGS="PGEN=${NACL_HOST_PYBUILD}/Parser/pgen" |
75 DefaultBuildStep | 75 DefaultBuildStep |
76 ChangeDir ${BUILD_DIR} | 76 ChangeDir ${BUILD_DIR} |
77 Banner "Rebuilding libpython2.7.a" | 77 Banner "Rebuilding libpython2.7.a" |
78 ${AR} cr libpython2.7.a ${DEST_PYTHON_OBJS}/*/*.o | 78 ${AR} cr libpython2.7.a ${DEST_PYTHON_OBJS}/*/*.o |
79 ${RANLIB} libpython2.7.a | 79 ${RANLIB} libpython2.7.a |
80 # To avoid rebuilding python.nexe with the new libpython2.7.a and duplicating | 80 # To avoid rebuilding python.nexe with the new libpython2.7.a and duplicating |
81 # symbols | 81 # symbols |
82 LogExecute touch python${NACL_EXEEXT} | 82 LogExecute touch python${NACL_EXEEXT} |
83 # The modules get built with SO=so, but they need to be SO=a inside the | 83 # The modules get built with SO=so, but they need to be SO=a inside the |
84 # destination filesystem. | 84 # destination filesystem. |
85 for fn in $(find ${NACL_DEST_PYROOT}/${SITE_PACKAGES} -name "*.so"); do | 85 for fn in $(find ${NACL_DEST_PYROOT}/${SITE_PACKAGES} -name "*.so"); do |
86 LogExecute touch ${fn%%so}a | 86 LogExecute touch ${fn%%so}a |
87 LogExecute rm -v ${fn} | 87 LogExecute rm -v ${fn} |
88 done | 88 done |
89 } | 89 } |
OLD | NEW |