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 # Currently this package only builds on linux. | 7 # Currently this package only builds on linux. |
8 # The build relies on certain host binaries and python's configure | 8 # The build relies on certain host binaries and python's configure |
9 # requires us to set --build= as well as --host=. | 9 # requires us to set --build= as well as --host=. |
10 # | 10 # |
11 # The module downloader is patterned after the Bochs image downloading step. | 11 # The module downloader is patterned after the Bochs image downloading step. |
12 | 12 |
13 ConfigureStep() { | 13 ConfigureStep() { |
14 SetupCrossEnvironment | 14 SetupCrossEnvironment |
15 export CROSS_COMPILE=true | 15 export CROSS_COMPILE=true |
16 # We pre-seed configure with certain results that it cannot determine | 16 # We pre-seed configure with certain results that it cannot determine |
17 # since we are doing a cross compile. The $CONFIG_SITE file is sourced | 17 # since we are doing a cross compile. The $CONFIG_SITE file is sourced |
18 # by configure early on. | 18 # by configure early on. |
19 export CONFIG_SITE=${START_DIR}/config.site | 19 export CONFIG_SITE=${START_DIR}/config.site |
20 # Disable ipv6 since configure claims it requires a working getaddrinfo | 20 # Disable ipv6 since configure claims it requires a working getaddrinfo |
21 # which we do not provide. TODO(sbc): remove this once nacl_io supports | 21 # which we do not provide. TODO(sbc): remove this once nacl_io supports |
22 # getaddrinfo. | 22 # getaddrinfo. |
23 EXTRA_CONFIGURE_ARGS="--disable-ipv6" | 23 EXTRA_CONFIGURE_ARGS="--disable-ipv6" |
24 EXTRA_CONFIGURE_ARGS+=" --with-suffix=${NACL_EXEEXT}" | 24 EXTRA_CONFIGURE_ARGS+=" --with-suffix=${NACL_EXEEXT}" |
25 EXTRA_CONFIGURE_ARGS+=" --build=i686-linux-gnu --disable-shared --enable-stati
c" | 25 EXTRA_CONFIGURE_ARGS+=" --build=i686-linux-gnu --disable-shared --enable-stati
c" |
26 export SO=.a | 26 export SO=.a |
27 export MAKEFLAGS="PGEN=${NACL_HOST_PYROOT}/../python-host/build-nacl-host/Pars
er/pgen" | 27 export MAKEFLAGS="PGEN=${NACL_HOST_PYBUILD}/Parser/pgen" |
28 export LIBS="-ltermcap" | 28 export LIBS="-ltermcap" |
29 export DYNLOADFILE=dynload_ppapi.o | 29 export DYNLOADFILE=dynload_ppapi.o |
30 export MACHDEP=ppapi | 30 export MACHDEP=ppapi |
31 export LINKCC=${NACLCXX} | 31 export LINKCC=${NACLCXX} |
32 if [ "${NACL_LIBC}" = "newlib" ]; then | 32 if [ "${NACL_LIBC}" = "newlib" ]; then |
33 LIBS+=" -lglibc-compat -lc" | 33 LIBS+=" -lglibc-compat -lc" |
34 fi | 34 fi |
35 LogExecute cp ${START_DIR}/dynload_ppapi.c ${SRC_DIR}/Python/ | 35 LogExecute cp ${START_DIR}/dynload_ppapi.c ${SRC_DIR}/Python/ |
36 # This next step is costly, but it sets the environment variables correctly. | 36 # This next step is costly, but it sets the environment variables correctly. |
37 DefaultConfigureStep | 37 DefaultConfigureStep |
(...skipping 18 matching lines...) Expand all Loading... |
56 PY_LINK_LINE+=" -lglibc-compat" | 56 PY_LINK_LINE+=" -lglibc-compat" |
57 fi | 57 fi |
58 echo ${PY_LINK_LINE} >> Modules/Setup.local | 58 echo ${PY_LINK_LINE} >> Modules/Setup.local |
59 # At this point we use the existing environment variables from | 59 # At this point we use the existing environment variables from |
60 # DefaultConfigureStep to build our destination Python modules | 60 # DefaultConfigureStep to build our destination Python modules |
61 } | 61 } |
62 | 62 |
63 BuildStep() { | 63 BuildStep() { |
64 SetupCrossEnvironment | 64 SetupCrossEnvironment |
65 export CROSS_COMPILE=true | 65 export CROSS_COMPILE=true |
66 export MAKEFLAGS="PGEN=${NACL_HOST_PYROOT}/../python-host/build-nacl-host/Pars
er/pgen" | 66 export MAKEFLAGS="PGEN=${NACL_HOST_PYBUILD}/Parser/pgen" |
67 DefaultBuildStep | 67 DefaultBuildStep |
68 ChangeDir ${BUILD_DIR} | 68 ChangeDir ${BUILD_DIR} |
69 Banner "Rebuilding libpython2.7.a" | 69 Banner "Rebuilding libpython2.7.a" |
70 ${AR} cr libpython2.7.a ${DEST_PYTHON_OBJS}/*/*.o | 70 ${AR} cr libpython2.7.a ${DEST_PYTHON_OBJS}/*/*.o |
71 ${RANLIB} libpython2.7.a | 71 ${RANLIB} libpython2.7.a |
72 # To avoid rebuilding python.nexe with the new libpython2.7.a and duplicating | 72 # To avoid rebuilding python.nexe with the new libpython2.7.a and duplicating |
73 # symbols | 73 # symbols |
74 LogExecute touch python${NACL_EXEEXT} | 74 LogExecute touch python${NACL_EXEEXT} |
75 # The modules get built with SO=so, but they need to be SO=a inside the | 75 # The modules get built with SO=so, but they need to be SO=a inside the |
76 # destination filesystem. | 76 # destination filesystem. |
77 for fn in $(find ${NACL_DEST_PYROOT}/${SITE_PACKAGES} -name "*.so"); do | 77 for fn in $(find ${NACL_DEST_PYROOT}/${SITE_PACKAGES} -name "*.so"); do |
78 LogExecute touch ${fn%%so}a | 78 LogExecute touch ${fn%%so}a |
79 LogExecute rm -v ${fn} | 79 LogExecute rm -v ${fn} |
80 done | 80 done |
81 } | 81 } |
OLD | NEW |