Skip to content

Commit 8ff3ef4

Browse files
committed
Make python flags to be absolute paths for Android.mk files
Because it make the reading easy, more maintainable and also will allow us to remove the recently introduced variables: MK_PYTHON_LINK_ROOT and PYTHON_INCLUDE_ROOT Which only adds unneeded complexity...so...we also take care of that in here. ¡¡¡Thanks @inclement!!!
1 parent 3695853 commit 8ff3ef4

File tree

4 files changed

+7
-19
lines changed

4 files changed

+7
-19
lines changed

pythonforandroid/bootstraps/pygame/build/jni/application/Android.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ LOCAL_CFLAGS := $(foreach D, $(APP_SUBDIRS), -I$(LOCAL_PATH)/$(D)) \
1818
-I$(LOCAL_PATH)/../jpeg \
1919
-I$(LOCAL_PATH)/../intl \
2020
-I$(LOCAL_PATH)/.. \
21-
-I$(LOCAL_PATH)/../../../../other_builds/$(MK_PYTHON_INCLUDE_ROOT)
21+
-I$(PYTHON_INCLUDE_ROOT)
2222

2323

2424
LOCAL_CFLAGS += $(APPLICATION_ADDITIONAL_CFLAGS)
@@ -38,7 +38,7 @@ LOCAL_LDLIBS := -lpython2.7 -lGLESv1_CM -ldl -llog -lz
3838

3939
# AND: Another hardcoded path that should be templated
4040
# AND: NOT TEMPALTED! We can use $ARCH
41-
LOCAL_LDFLAGS += -L$(LOCAL_PATH)/../../../../other_builds/$(MK_PYTHON_LINK_ROOT) $(APPLICATION_ADDITIONAL_LDFLAGS)
41+
LOCAL_LDFLAGS += -L$(PYTHON_LINK_ROOT) $(APPLICATION_ADDITIONAL_LDFLAGS)
4242

4343
LIBS_WITH_LONG_SYMBOLS := $(strip $(shell \
4444
for f in $(LOCAL_PATH)/../../libs/$ARCH/*.so ; do \

pythonforandroid/bootstraps/service_only/build/jni/application/src/Android.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ LOCAL_MODULE := main
77
# Add your application source files here...
88
LOCAL_SRC_FILES := start.c pyjniusjni.c
99

10-
LOCAL_CFLAGS += -I$(LOCAL_PATH)/../../../../../other_builds/$(MK_PYTHON_INCLUDE_ROOT) $(EXTRA_CFLAGS)
10+
LOCAL_CFLAGS += -I$(PYTHON_INCLUDE_ROOT) $(EXTRA_CFLAGS)
1111

1212
LOCAL_SHARED_LIBRARIES := python_shared
1313

1414
LOCAL_LDLIBS := -llog $(EXTRA_LDLIBS)
1515

16-
LOCAL_LDFLAGS += -L$(LOCAL_PATH)/../../../../../other_builds/$(MK_PYTHON_LINK_ROOT) $(APPLICATION_ADDITIONAL_LDFLAGS)
16+
LOCAL_LDFLAGS += -L$(PYTHON_LINK_ROOT) $(APPLICATION_ADDITIONAL_LDFLAGS)
1717

1818
include $(BUILD_SHARED_LIBRARY)
1919

pythonforandroid/bootstraps/webview/build/jni/application/src/Android.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ LOCAL_MODULE := main
99
# Add your application source files here...
1010
LOCAL_SRC_FILES := start.c pyjniusjni.c
1111

12-
LOCAL_CFLAGS += -I$(LOCAL_PATH)/../../../../../other_builds/$(MK_PYTHON_INCLUDE_ROOT) $(EXTRA_CFLAGS)
12+
LOCAL_CFLAGS += -I$(PYTHON_INCLUDE_ROOT) $(EXTRA_CFLAGS)
1313

1414
LOCAL_SHARED_LIBRARIES := python_shared
1515

1616
LOCAL_LDLIBS := -llog $(EXTRA_LDLIBS)
1717

18-
LOCAL_LDFLAGS += -L$(LOCAL_PATH)/../../../../../other_builds/$(MK_PYTHON_LINK_ROOT) $(APPLICATION_ADDITIONAL_LDFLAGS)
18+
LOCAL_LDFLAGS += -L$(PYTHON_LINK_ROOT) $(APPLICATION_ADDITIONAL_LDFLAGS)
1919

2020
include $(BUILD_SHARED_LIBRARY)
2121

pythonforandroid/recipe.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,7 @@ class BootstrapNDKRecipe(Recipe):
626626
:class:`~pythonforandroid.recipe.NDKRecipe`.
627627
628628
To link with python, call the method :meth:`get_recipe_env`
629-
with the kwarg *with_python=True*. If recipe contains android's mk files
630-
which should be linked with python, you may want to use the env variables
631-
MK_PYTHON_INCLUDE_ROOT and MK_PYTHON_LINK_ROOT set in there.
629+
with the kwarg *with_python=True*.
632630
'''
633631

634632
dir_name = None # The name of the recipe build folder in the jni dir
@@ -657,16 +655,6 @@ def get_recipe_env(self, arch=None, with_flags_in_cc=True, with_python=False):
657655
self.ctx.python_recipe.major_minor_version_string)
658656
if 'python3' in self.ctx.python_recipe.name:
659657
env['EXTRA_LDLIBS'] += 'm'
660-
661-
# set some env variables that may be needed to build some bootstrap ndk
662-
# recipes that needs linking with our python via mk files, like
663-
# recipes: sdl2, genericndkbuild or sdl
664-
other_builds = join(self.ctx.build_dir, 'other_builds') + '/'
665-
env['MK_PYTHON_INCLUDE_ROOT'] = \
666-
self.ctx.python_recipe.include_root(arch.arch)[
667-
len(other_builds):]
668-
env['MK_PYTHON_LINK_ROOT'] = \
669-
self.ctx.python_recipe.link_root(arch.arch)[len(other_builds):]
670658
return env
671659

672660

0 commit comments

Comments
 (0)