11#! /usr/bin/env bash
2- set -e -x
32
4- # Versions can be restricted by passing them in as arguments to the script
5- # For example,
6- # manylinux-build-wheels.sh cp27mu cp35
7- if [[ $# -eq 0 ]]; then
8- PYBINARIES=(/opt/python/* /bin)
9- else
10- PYBINARIES=()
11- for version in " $@ " ; do
12- PYBINARIES+=(/opt/python/* ${version} * /bin)
13- done
14- fi
15-
16- # i686 or x86_64 ?
17- case $( uname -p) in
18- i686)
19- arch=x86
20- ;;
21- x86_64)
22- arch=x64
23- ;;
24- * )
25- die " Unknown architecture $( uname -p) "
26- ;;
27- esac
28-
29- echo " Building wheels for $arch "
3+ script_dir=" ` cd $( dirname $0 ) ; pwd` "
4+ source " ${script_dir} /manylinux-build-common.sh"
305
316# Build standalone project and populate archive cache
327mkdir -p /work/standalone-${arch} -build
@@ -35,22 +10,6 @@ pushd /work/standalone-${arch}-build > /dev/null 2>&1
3510 ninja
3611popd > /dev/null 2>&1
3712
38- # Since the python interpreter exports its symbol (see [1]), python
39- # modules should not link against any python libraries.
40- # To ensure it is not the case, we configure the project using an empty
41- # file as python library.
42- #
43- # [1] "Note that libpythonX.Y.so.1 is not on the list of libraries that
44- # a manylinux1 extension is allowed to link to. Explicitly linking to
45- # libpythonX.Y.so.1 is unnecessary in almost all cases: the way ELF linking
46- # works, extension modules that are loaded into the interpreter automatically
47- # get access to all of the interpreter's symbols, regardless of whether or
48- # not the extension itself is explicitly linked against libpython. [...]"
49- #
50- # Source: https://www.python.org/dev/peps/pep-0513/#libpythonx-y-so-1
51- PYTHON_LIBRARY=/work/scripts/internal/manylinux-libpython-not-needed-symbols-exported-by-interpreter
52- touch ${PYTHON_LIBRARY}
53-
5413# Compile wheels re-using standalone project and archive cache
5514for PYBIN in " ${PYBINARIES[@]} " ; do
5615 if [[ ${PYBIN} == * " cp26" * || ${PYBIN} == * " cp33" * ]]; then
0 commit comments