summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Paalanen <ppaalanen@gmail.com>2012-03-28 11:23:16 (GMT)
committerPekka Paalanen <ppaalanen@gmail.com>2012-03-29 12:48:56 (GMT)
commita260255605695f134bee6cfa22cccc67c05b5352 (patch)
treedd26553cc9fd35eba819c1b3b998154a5ba53901
parent8bff730a98dd7e68192743717bf8c9384d5c0c5b (diff)
downloadpixman-a260255605695f134bee6cfa22cccc67c05b5352.tar.gz
pixman-a260255605695f134bee6cfa22cccc67c05b5352.tar.xz
android: add build files
TLS is unsupported in pixman for Android/Bionic/ARM. cpufeatures is needed for cpu-features.h. Static libs must link to other static libs as WHOLE, otherwise nothing is linked.
-rw-r--r--Android.mk40
-rw-r--r--pixman/Makefile.am33
2 files changed, 73 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..681a40b
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,40 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+PIXMAN_TOP := $(LOCAL_PATH)
+
+PIXMAN_BUILT_MAKEFILES := \
+ $(PIXMAN_TOP)/pixman/Android.mk
+
+pixman-configure:
+ cd $(PIXMAN_TOP) ; \
+ autoreconf -fiv && \
+ CC="$(CONFIGURE_CC)" \
+ CFLAGS="$(CONFIGURE_CFLAGS) -DPIXMAN_NO_TLS" \
+ LD=$(TARGET_LD) \
+ LDFLAGS="$(CONFIGURE_LDFLAGS)" \
+ CPP=$(CONFIGURE_CPP) \
+ CPPFLAGS="$(CONFIGURE_CPPFLAGS)" \
+ PKG_CONFIG_LIBDIR=$(CONFIGURE_PKG_CONFIG_LIBDIR) \
+ PKG_CONFIG_TOP_BUILD_DIR=$(PKG_CONFIG_TOP_BUILD_DIR) \
+ ./configure --host=arm-linux-androideabi \
+ --disable-gtk
+ for file in $(PIXMAN_BUILT_MAKEFILES); do \
+ rm -f $$file && \
+ make -C $$(dirname $$file) $$(basename $$file) ; \
+ done
+
+pixman-cleanup:
+ cd $(PIXMAN_TOP) && \
+ git clean -qdxf && \
+ git reset --hard HEAD
+
+.PHONY: pixman-configure pixman-cleanup
+
+CONFIGURE_TARGETS += pixman-configure
+CONFIGURE_CLEANUP_TARGETS += pixman-cleanup
+CONFIGURE_PKG_CONFIG_LIBDIR := $(CONFIGURE_PKG_CONFIG_LIBDIR):$(PIXMAN_TOP)
+
+-include $(PIXMAN_BUILT_MAKEFILES)
+
diff --git a/pixman/Makefile.am b/pixman/Makefile.am
index 286b7cf..ffc23c1 100644
--- a/pixman/Makefile.am
+++ b/pixman/Makefile.am
@@ -104,3 +104,36 @@ endif
.c.s : $(libpixmaninclude_HEADERS) $(BUILT_SOURCES)
$(CC) $(CFLAGS) $(ASM_CFLAGS_$(@:pixman-%.s=%)) $(ASM_CFLAGS_$(@:pixman-arm-%.s=arm_%)) -DHAVE_CONFIG_H -I$(srcdir) -I$(builddir) -I$(top_builddir) -S -o $@ $<
+
+
+myvalue = $($(subst .,_,$(subst -,_,$(1)))_$(2))
+empty :=
+slash := $(empty)\$(empty)
+
+# We ignore <hwcap>_LDFLAGS
+define help_libs
+$(foreach mylib,$(1), -:STATIC $(mylib:%.la=%) $(slash)
+ -:TAGS optional $(slash)
+ -:SOURCES $(call myvalue,$(mylib),SOURCES) $(slash)
+ -:CFLAGS $(CFLAGS) $(call myvalue,$(mylib),CFLAGS) $(slash)
+ -:LDFLAGS $(call myvalue,$(mylib),LIBADD) $(slash)
+ $(slash)
+)
+endef
+
+Android.mk: CFLAGS += -DHAVE_CONFIG_H -I$(top_builddir)
+Android.mk: Makefile.am $(BUILT_SOURCES)
+ androgenizer \
+ -:PROJECT pixman \
+ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
+ \
+$(call help_libs,$(noinst_LTLIBRARIES)) -:STATIC libpixman-1 \
+ -:TAGS eng debug \
+ -:SOURCES $(libpixman_1_la_SOURCES) \
+ -:CFLAGS $(CFLAGS) \
+ -:LDFLAGS $(libpixman_1_la_LIBADD) \
+ -:LIBFILTER_WHOLE $(noinst_LTLIBRARIES:lib%.la=%) \
+ -:PASSTHROUGH 'LOCAL_WHOLE_STATIC_LIBRARIES += cpufeatures' \
+ 'LOCAL_C_INCLUDES += ndk/sources/cpufeatures' \
+ > $@
+