]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
Add an Android-friendly build system 26/head
authorArun Raghavan <arun.raghavan@collabora.co.uk>
Fri, 20 Jan 2012 07:30:45 +0000 (13:00 +0530)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Thu, 26 Apr 2012 07:48:33 +0000 (13:18 +0530)
This dependson the Androgenizer project, which helps keep autofoo-based build
systems in sync with the Android build.

Android.configure.mk [new file with mode: 0644]
Makefile.am

diff --git a/Android.configure.mk b/Android.configure.mk
new file mode 100644 (file)
index 0000000..a6265ad
--- /dev/null
@@ -0,0 +1,39 @@
+# This file is the top android makefile for all sub-modules.
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+json_c_TOP := $(LOCAL_PATH)
+
+JSON_C_BUILT_SOURCES := Android.mk
+
+JSON_C_BUILT_SOURCES := $(patsubst %, $(abspath $(json_c_TOP))/%, $(JSON_C_BUILT_SOURCES))
+
+.PHONY: json-c-configure json-c-configure-real
+json-c-configure-real:
+       echo $(JSON_C_BUILT_SOURCES)
+       cd $(json_c_TOP) ; \
+       $(abspath $(json_c_TOP))/autogen.sh && \
+       CC="$(CONFIGURE_CC)" \
+       CFLAGS="$(CONFIGURE_CFLAGS)" \
+       LD=$(TARGET_LD) \
+       LDFLAGS="$(CONFIGURE_LDFLAGS)" \
+       CPP=$(CONFIGURE_CPP) \
+       CPPFLAGS="$(CONFIGURE_CPPFLAGS)" \
+       PKG_CONFIG_LIBDIR=$(CONFIGURE_PKG_CONFIG_LIBDIR) \
+       PKG_CONFIG_TOP_BUILD_DIR=/ \
+       ac_cv_func_malloc_0_nonnull=yes \
+       ac_cv_func_realloc_0_nonnull=yes \
+       $(abspath $(json_c_TOP))/$(CONFIGURE) --host=$(CONFIGURE_HOST) \
+       --prefix=/system \
+       && \
+       for file in $(JSON_C_BUILT_SOURCES); do \
+               rm -f $$file && \
+               make -C $$(dirname $$file) $$(basename $$file) ; \
+       done
+
+json-c-configure: json-c-configure-real
+
+PA_CONFIGURE_TARGETS += json-c-configure
+
+-include $(json_c_TOP)/Android.mk
index d4a7bbbe4fc0e9f8d843b449328e196094577a1f..3c53b93d421f28c5e73b1cf1a17f723839ad0d52 100644 (file)
@@ -44,3 +44,17 @@ distclean-local:
        -rm -rf $(testsubdir)
        -rm -rf config.h.in~ Makefile.in aclocal.m4 autom4te.cache/ config.guess config.sub configure depcomp install-sh ltmain.sh missing
 
+ANDROID_CFLAGS = -I$(top_srcdir) -DHAVE_CONFIG_H
+
+Android.mk: Makefile.am
+       androgenizer -:PROJECT json-c \
+               -:SHARED libjson \
+               -:TAGS eng debug \
+               -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
+               -:SOURCES $(libjson_la_SOURCES) $(nodist_libjson_la_SOURCES) \
+               -:CFLAGS $(DEFS) $(ANDROID_CFLAGS) $(libjson_la_CFLAGS) \
+               -:LDFLAGS $(libjson_la_LDFLAGS) $(libjson_la_LIBADD) \
+               -:HEADER_TARGET json \
+               -:HEADERS $(libjsoninclude_HEADERS) \
+               -:PASSTHROUGH LOCAL_ARM_MODE:=arm \
+       > $@