Skip to content

Commit

Permalink
admon/build-doc: be compatible with py3
Browse files Browse the repository at this point in the history
Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed Sep 11, 2017
1 parent 5720c98 commit f8cc72f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions admin/build-doc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ cd build-doc
[ -z "$vdir" ] && vdir="$TOPDIR/build-doc/virtualenv"

if [ ! -e $vdir ]; then
virtualenv --system-site-packages $vdir -p python2
virtualenv --system-site-packages $vdir
fi
$vdir/bin/pip install --quiet -r $TOPDIR/admin/doc-requirements.txt

Expand Down Expand Up @@ -88,7 +88,12 @@ for bind in rados rbd cephfs rgw; do
LDFLAGS="-L$vdir/lib -Wl,--no-as-needed" \
$vdir/bin/pip install $TOPDIR/src/pybind/${bind}
# rgwfile_version(), librgw_create(), rgw_mount()
nm $vdir/lib/python*/*-packages/${bind}.so | grep -E "U (lib)?${bind}" | \
# since py3.5, distutils adds postfix in between ${bind} and so
lib_fn=$vdir/lib/python*/*-packages/${bind}.*.so
if [ ! -e $lib_fn ]; then
lib_fn=$vdir/lib/python*/*-packages/${bind}.so
fi
nm $lib_fn | grep -E "U (lib)?${bind}" | \
awk '{ print "void "$2"(void) {}" }' | \
gcc -shared -o $vdir/lib/lib${bind}.so.1 -xc -
if [ ${bind} != rados ]; then
Expand Down

0 comments on commit f8cc72f

Please sign in to comment.