Skip to content

Commit 6a99fbd

Browse files
committed
first stab at building android externals
compiles on dockcross/android-arm and dockcross/android-arm64 not runtime tests have been performed yet (as i only have a cross-compilation environment) Related: #60
1 parent 9bd01a2 commit 6a99fbd

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Makefile.pdlibbuilder

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,9 @@ target.triplet := $(subst -, ,$(shell $(CC) -dumpmachine))
410410
ifneq ($(filter linux gnu% kfreebsd, $(target.triplet)),)
411411
system = Linux
412412
endif
413+
ifneq ($(filter android%, $(target.triplet)),)
414+
system = Android
415+
endif
413416

414417
ifneq ($(filter darwin%, $(target.triplet)),)
415418
system = Darwin
@@ -497,6 +500,27 @@ ifeq ($(system), Linux)
497500
endif
498501

499502

503+
#=== flags and paths for Android ===============================================
504+
ifeq ($(system), Android)
505+
prefix = /usr/local
506+
libdir := $(prefix)/lib
507+
pkglibdir = $(libdir)/pd-externals
508+
pdincludepath := $(wildcard /usr/include/pd)
509+
extension = so
510+
cpp.flags := -DUNIX
511+
c.flags :=
512+
c.ldflags := -rdynamic -shared -Wl,-rpath,"\$$ORIGIN",--enable-new-dtags
513+
c.ldlibs := -lc -lm
514+
cxx.flags := -fcheck-new
515+
cxx.ldflags := -rdynamic -shared -Wl,-rpath,"\$$ORIGIN",--enable-new-dtags
516+
cxx.ldlibs := -lc -lm -lstdc++
517+
shared.extension = so
518+
shared.ldflags := -rdynamic -shared -Wl,-soname,$(shared.lib)
519+
endif
520+
521+
522+
523+
500524
#=== flags and paths for Darwin ================================================
501525

502526

@@ -721,7 +745,11 @@ all.objects = $(classes.objects) $(common.objects) $(shared.objects) \
721745

722746

723747
# construct class executable names from class names
748+
ifeq ($(system), Android)
749+
classes.executables := $(addprefix lib, $(addsuffix .$(extension), $(patsubst %~,%_tilde,$(classes))))
750+
else
724751
classes.executables := $(addsuffix .$(extension), $(classes))
752+
endif
725753

726754
# Construct shared lib executable name if shared sources are defined. If
727755
# extension and shared extension are not identical, use both to facilitate co-

0 commit comments

Comments
 (0)