Skip to content

support crystax ndk #553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pythonforandroid/archs.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ def get_env(self):

env["CXXFLAGS"] = env["CFLAGS"]

env["LDFLAGS"] = " ".join(['-lm'])
env["LDFLAGS"] = " ".join(['-lm', '-L' + self.ctx.get_libs_dir(self.arch)])

if self.ctx.ndk == 'crystax':
env['LDFLAGS'] += ' -L{}/sources/crystax/libs/{} -lcrystax'.format(self.ctx.ndk_dir, self.arch)

py_platform = sys.platform
if py_platform in ['linux2', 'linux3']:
Expand Down Expand Up @@ -84,6 +87,7 @@ def get_env(self):
env['STRIP'] = '{}-strip --strip-unneeded'.format(command_prefix)
env['MAKE'] = 'make -j5'
env['READELF'] = '{}-readelf'.format(command_prefix)
env['NM'] = '{}-nm'.format(command_prefix)

hostpython_recipe = Recipe.get_recipe('hostpython2', self.ctx)

Expand Down
10 changes: 9 additions & 1 deletion pythonforandroid/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,17 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
if ndk_dir is not None:
info('Got NDK version from $ANDROIDNDKVER')

self.ndk = 'google'

try:
with open(join(ndk_dir, 'RELEASE.TXT')) as fileh:
reported_ndk_ver = fileh.read().split(' ')[0]
reported_ndk_ver = fileh.read().split(' ')[0].strip()
except IOError:
pass
else:
if reported_ndk_ver.startswith('crystax-ndk-'):
reported_ndk_ver = reported_ndk_ver[12:]
self.ndk = 'crystax'
if ndk_ver is None:
ndk_ver = reported_ndk_ver
info(('Got Android NDK version from the NDK dir: '
Expand All @@ -298,6 +303,8 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
warning('Android NDK version could not be found, exiting.')
self.ndk_ver = ndk_ver

info('Using {} NDK {}'.format(self.ndk.capitalize(), self.ndk_ver))

virtualenv = None
if virtualenv is None:
virtualenv = sh.which('virtualenv2')
Expand Down Expand Up @@ -407,6 +414,7 @@ def __init__(self):
self._ndk_dir = None
self._android_api = None
self._ndk_ver = None
self.ndk = None

self.toolchain_prefix = None
self.toolchain_version = None
Expand Down
6 changes: 6 additions & 0 deletions pythonforandroid/patching.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,9 @@ def will(recipe, **kwargs):
return recipe_name in recipe.ctx.recipe_build_order
return will


def is_ndk(ndk):
def is_x(recipe, **kwargs):
return recipe.ctx.ndk == ndk
return is_x