1 diff -rupN glibref/glib-2.40.2/Android.mk glibpatch/glib-2.40.2/Android.mk
2 --- glibref/glib-2.40.2/Android.mk 1970-01-01 09:00:00.000000000 +0900
3 +++ glibpatch/glib-2.40.2/Android.mk 2015-04-01 13:20:38.597557242 +0900
5 +#GLIB Android Makefile to build GLIB modules
7 +LOCAL_PATH := $(call my-dir)
8 +GLIB_MAIN_DIR := $(LOCAL_PATH)
10 +GLIB_C_INCLUDES := $(GLIB_MAIN_DIR) \
11 + $(GLIB_MAIN_DIR)/glib
13 +GTHREAD_C_INCLUDES := $(GLIB_MAIN_DIR) \
14 + $(GLIB_MAIN_DIR)/gthread
16 +include $(GLIB_MAIN_DIR)/glib/Android.mk
17 +include $(GLIB_MAIN_DIR)/gthread/Android.mk
19 diff -rupN glibref/glib-2.40.2/config.h glibpatch/glib-2.40.2/config.h
20 --- glibref/glib-2.40.2/config.h 2015-03-31 16:25:56.882894898 +0900
21 +++ glibpatch/glib-2.40.2/config.h 2015-04-01 13:21:19.593558693 +0900
23 /* #undef ENABLE_GC_FRIENDLY_DEFAULT */
25 /* always defined to indicate that i18n is enabled */
26 +#ifndef _GLIB_ANDROID_
29 +#endif /* _GLIB_ANDROID__ */
30 /* Define the gettext package to be used */
31 #define GETTEXT_PACKAGE "glib20"
34 /* #undef HAVE_COCOA */
36 /* Have nl_langinfo (CODESET) */
37 +#ifndef _GLIB_ANDROID_
38 #define HAVE_CODESET 1
40 +#endif /* _GLIB_ANDROID_ */
41 /* Define to 1 if you have the <crt_externs.h> header file. */
42 /* #undef HAVE_CRT_EXTERNS_H */
45 /* we have the eventfd(2) system call */
46 #define HAVE_EVENTFD 1
48 +#ifndef _GLIB_ANDROID_
49 /* Define to 1 if you have the `fallocate' function. */
50 #define HAVE_FALLOCATE 1
51 +#endif /* _GLIB_ANDROID_ */
53 /* Define if we have FAM */
56 /* Define to 1 if you have the `kqueue' function. */
57 /* #undef HAVE_KQUEUE */
59 +#ifndef _GLIB_ANDROID_
60 /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
61 #define HAVE_LANGINFO_CODESET 1
65 /* Have nl_langinfo (PM_STR) */
66 #define HAVE_LANGINFO_TIME 1
67 +#endif /* _GLIB_ANDROID_ */
69 /* Define to 1 if you have the `lchmod' function. */
70 /* #undef HAVE_LCHMOD */
73 /* Define to 1 if you have the <memory.h> header file. */
74 #define HAVE_MEMORY_H 1
76 +#ifndef _GLIB_ANDROID_
77 /* Define to 1 if you have the `mmap' function. */
79 +#endif /* _GLIB_ANDROID_ */
81 /* Define to 1 if you have the <mntent.h> header file. */
82 #define HAVE_MNTENT_H 1
84 /* Have POSIX function getgrgid_r */
85 #define HAVE_POSIX_GETGRGID_R 1
87 +#ifndef _GLIB_ANDROID_
88 /* Have POSIX function getpwuid_r */
89 #define HAVE_POSIX_GETPWUID_R 1
90 +#endif /* _GLIB_ANDROID_ */
92 /* Define to 1 if you have the `posix_memalign' function. */
93 #define HAVE_POSIX_MEMALIGN 1
95 #define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
97 /* Have function pthread_cond_timedwait_relative_np */
98 +#ifndef _GLIB_ANDROID_
99 /* #undef HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP */
102 +#define HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP 0
103 +#endif /* _GLIB_ANDROID_ */
104 /* Define to 1 if the system has the type `ptrdiff_t'. */
105 #define HAVE_PTRDIFF_T 1
108 /* Define to 1 if you have the <stdlib.h> header file. */
109 #define HAVE_STDLIB_H 1
111 +#ifndef _GLIB_ANDROID_
112 /* Define to 1 if you have the `stpcpy' function. */
113 #define HAVE_STPCPY 1
114 +#endif /* _GLIB_ANDROID_ */
116 /* Define to 1 if you have the `strcasecmp' function. */
117 #define HAVE_STRCASECMP 1
118 @@ -532,10 +546,10 @@
120 /* Define to 1 if you have the <sys/xattr.h> header file. */
121 #define HAVE_SYS_XATTR_H 1
123 +#ifndef _GLIB_ANDROID_
124 /* Define to 1 if you have the `timegm' function. */
125 #define HAVE_TIMEGM 1
127 +#endif /* _GLIB_ANDROID_ */
128 /* Define to 1 if you have the <unistd.h> header file. */
129 #define HAVE_UNISTD_H 1
133 /* Define to 1 if you have the `vsnprintf' function. */
134 #define HAVE_VSNPRINTF 1
136 +#ifndef _GLIB_ANDROID_
137 /* Define if you have the 'wchar_t' type. */
138 #define HAVE_WCHAR_T 1
140 @@ -575,12 +589,14 @@
142 /* Define to 1 if xattr is available */
146 /* Define to 1 if xattr API uses XATTR_NOFOLLOW */
147 /* #undef HAVE_XATTR_NOFOLLOW */
149 /* Define to 1 if you have the <xlocale.h> header file. */
150 +#ifndef _GLIB_ANDROID_
151 #define HAVE_XLOCALE_H 1
152 +#endif /* _GLIB_ANDROID_ */
154 /* Define to 1 if you have the `_NSGetEnviron' function. */
155 /* #undef HAVE__NSGETENVIRON */
156 diff -rupN glibref/glib-2.40.2/glib/Android.mk glibpatch/glib-2.40.2/glib/Android.mk
157 --- glibref/glib-2.40.2/glib/Android.mk 1970-01-01 09:00:00.000000000 +0900
158 +++ glibpatch/glib-2.40.2/glib/Android.mk 2015-03-31 17:10:22.722989176 +0900
160 +#glib Android Make File
162 +LOCAL_PATH := $(call my-dir)
164 +include $(CLEAR_VARS)
166 +LOCAL_MODULE := glib-2.40.2
168 +LOCAL_SRC_FILES := \
169 + libcharset/localcharset.c \
241 + gvariant-parser.c \
242 + gvariant-serialiser.c \
243 + gvarianttypeinfo.c \
251 +LOCAL_C_INCLUDES := $(GLIB_MAIN_DIR) \
252 + $(GLIB_MAIN_DIR)/glib \
253 + $(GLIB_MAIN_DIR)/glib/deprecated \
254 + $(GLIB_MAIN_DIR)/glib/libcharset \
255 + $(GLIB_MAIN_DIR)/pcre \
257 +LOCAL_STATIC_LIBRARIES := pcre
259 +LOCAL_LD_LIBS := -llog
263 + -DLIBDIR=\"$(libdir)\" \
265 + -DG_LOG_DOMAIN=\"GLib\" \
266 + -DGLIB_COMPILATION \
268 + -DG_DISABLE_CAST_CHECKS
270 +include $(BUILD_SHARED_LIBRARY)
272 +include $(GLIB_MAIN_DIR)/glib/pcre/Android.mk
275 diff -rupN glibref/glib-2.40.2/glib/gconvert.c glibpatch/glib-2.40.2/glib/gconvert.c
276 --- glibref/glib-2.40.2/glib/gconvert.c 2015-03-31 16:25:56.946894901 +0900
277 +++ glibpatch/glib-2.40.2/glib/gconvert.c 2015-03-31 16:40:50.546926503 +0900
279 #include "glibconfig.h"
283 +#ifndef _GLIB_ANDROID_
285 +#endif /* _GLIB_ANDROID_ */
292 G_DEFINE_QUARK (g_convert_error, g_convert_error)
294 +#ifndef _GLIB_ANDROID_
296 try_conversion (const char *to_codeset,
297 const char *from_codeset,
298 @@ -197,9 +202,9 @@ try_to_aliases (const char **to_aliases,
305 +#endif /* _GLIB_ANDROID_ */
309 @@ -220,6 +225,7 @@ GIConv
310 g_iconv_open (const gchar *to_codeset,
311 const gchar *from_codeset)
313 +#ifndef _GLIB_ANDROID_
316 if (!try_conversion (to_codeset, from_codeset, &cd))
317 @@ -248,6 +254,9 @@ g_iconv_open (const gchar *to_codeset,
320 return (cd == (iconv_t)-1) ? (GIConv)-1 : (GIConv)cd;
323 +#endif /* _GLIB_ANDROID_ */
327 @@ -274,9 +283,13 @@ g_iconv (GIConv converter,
329 gsize *outbytes_left)
331 +#ifndef _GLIB_ANDROID_
332 iconv_t cd = (iconv_t)converter;
334 return iconv (cd, inbuf, inbytes_left, outbuf, outbytes_left);
337 +#endif /* _GLIB_ANDROID_ */
341 @@ -297,9 +310,13 @@ g_iconv (GIConv converter,
343 g_iconv_close (GIConv converter)
345 +#ifndef _GLIB_ANDROID_
346 iconv_t cd = (iconv_t)converter;
348 return iconv_close (cd);
351 +#endif /* _GLIB_ANDROID_ */
355 diff -rupN glibref/glib-2.40.2/glib/gfileutils.c glibpatch/glib-2.40.2/glib/gfileutils.c
356 --- glibref/glib-2.40.2/glib/gfileutils.c 2015-03-31 16:25:57.170894910 +0900
357 +++ glibpatch/glib-2.40.2/glib/gfileutils.c 2015-03-31 16:37:29.594919396 +0900
360 #ifdef HAVE_LINUX_MAGIC_H /* for btrfs check */
361 #include <linux/magic.h>
362 +#ifndef _GLIB_ANDROID_
364 +#endif /* _GLIB_ANDROID_ */
368 diff -rupN glibref/glib-2.40.2/glib/ggettext.c glibpatch/glib-2.40.2/glib/ggettext.c
369 --- glibref/glib-2.40.2/glib/ggettext.c 2015-03-31 16:25:57.182894907 +0900
370 +++ glibpatch/glib-2.40.2/glib/ggettext.c 2015-03-31 16:37:55.538920314 +0900
376 +#ifndef _GLIB_ANDROID_
378 +#endif /* _GLIB_ANDROID_ */
382 diff -rupN glibref/glib-2.40.2/glib/glibconfig.h glibpatch/glib-2.40.2/glib/glibconfig.h
383 --- glibref/glib-2.40.2/glib/glibconfig.h 2015-03-31 16:25:57.166894909 +0900
384 +++ glibpatch/glib-2.40.2/glib/glibconfig.h 2015-03-31 16:38:06.954920717 +0900
385 @@ -154,7 +154,9 @@ typedef unsigned int guintptr;
386 #define G_THREADS_ENABLED
387 #define G_THREADS_IMPL_POSIX
389 +#ifndef _GLIB_ANDROID_
390 #define G_ATOMIC_LOCK_FREE
391 +#endif /* _GLIB_ANDROID_ */
393 #define GINT16_TO_LE(val) ((gint16) (val))
394 #define GUINT16_TO_LE(val) ((guint16) (val))
395 diff -rupN glibref/glib-2.40.2/glib/gslice.c glibpatch/glib-2.40.2/glib/gslice.c
396 --- glibref/glib-2.40.2/glib/gslice.c 2015-03-31 16:25:56.946894901 +0900
397 +++ glibpatch/glib-2.40.2/glib/gslice.c 2015-03-31 16:38:38.302921827 +0900
398 @@ -388,7 +388,9 @@ slice_config_init (SliceConfig *config)
399 * This way it's possible to force gslice to be enabled under
400 * valgrind just by setting G_SLICE to the empty string.
402 + #ifndef _GLIB_ANDROID_
403 if (RUNNING_ON_VALGRIND)
404 +#endif /* _GLIB_ANDROID_ */
405 config->always_malloc = TRUE;
408 diff -rupN glibref/glib-2.40.2/glib/gstrfuncs.c glibpatch/glib-2.40.2/glib/gstrfuncs.c
409 --- glibref/glib-2.40.2/glib/gstrfuncs.c 2015-03-31 16:25:56.950894901 +0900
410 +++ glibpatch/glib-2.40.2/glib/gstrfuncs.c 2015-03-31 16:39:00.154922598 +0900
411 @@ -309,6 +309,7 @@ static const guint16 ascii_table_data[25
413 const guint16 * const g_ascii_table = ascii_table_data;
415 +#ifndef _GLIB_ANDROID_
416 #if defined (HAVE_NEWLOCALE) && \
417 defined (HAVE_USELOCALE) && \
418 defined (HAVE_STRTOD_L) && \
419 @@ -316,6 +317,7 @@ const guint16 * const g_ascii_table = as
420 defined (HAVE_STRTOLL_L)
421 #define USE_XLOCALE 1
423 +#endif /* _GLIB_ANDROID_ */
427 diff -rupN glibref/glib-2.40.2/glib/pcre/Android.mk glibpatch/glib-2.40.2/glib/pcre/Android.mk
428 --- glibref/glib-2.40.2/glib/pcre/Android.mk 1970-01-01 09:00:00.000000000 +0900
429 +++ glibpatch/glib-2.40.2/glib/pcre/Android.mk 2015-01-13 08:04:00.000000000 +0900
431 +#libpcre Android Make File
433 +LOCAL_PATH := $(call my-dir)
435 +include $(CLEAR_VARS)
437 +LOCAL_MODULE := pcre
439 +LOCAL_LD_LIBS := -llog
442 + -DG_LOG_DOMAIN=\"GLib-GRegex\" \
449 + -DMATCH_LIMIT=10000000 \
450 + -DMATCH_LIMIT_RECURSION=8192 \
451 + -DMAX_NAME_SIZE=32 \
452 + -DMAX_NAME_COUNT=10000 \
453 + -DMAX_DUPLENGTH=30000 \
455 + -DPOSIX_MALLOC_THRESHOLD=10 \
457 + -DG_DISABLE_CAST_CHECKS \
458 + -DGLIB_COMPILATION \
461 +LOCAL_SRC_FILES := pcre_xclass.c pcre_valid_utf8.c pcre_tables.c \
462 + pcre_study.c pcre_string_utils.c pcre_ord2utf8.c \
463 + pcre_newline.c pcre_jit_compile.c pcre_globals.c \
464 + pcre_get.c pcre_fullinfo.c pcre_exec.c \
465 + pcre_dfa_exec.c pcre_config.c pcre_compile.c \
466 + pcre_chartables.c pcre_byte_order.c
468 +LOCAL_C_INCLUDES := $(GLIB_MAIN_DIR) \
469 + $(GLIB_MAIN_DIR)/glib
472 +include $(BUILD_STATIC_LIBRARY)
473 \ No newline at end of file
474 diff -rupN glibref/glib-2.40.2/gthread/Android.mk glibpatch/glib-2.40.2/gthread/Android.mk
475 --- glibref/glib-2.40.2/gthread/Android.mk 1970-01-01 09:00:00.000000000 +0900
476 +++ glibpatch/glib-2.40.2/gthread/Android.mk 2015-03-31 17:11:02.782990592 +0900
478 +#gthread Android Make File
480 +LOCAL_PATH := $(call my-dir)
482 +include $(CLEAR_VARS)
484 +LOCAL_MODULE := gthread-2.40.2
486 +LOCAL_SRC_FILES := gthread-impl.c
488 +LOCAL_C_INCLUDES := $(GLIB_MAIN_DIR) \
489 + $(GLIB_MAIN_DIR)/glib \
490 + $(GLIB_MAIN_DIR)/gthread
494 + -DG_LOG_DOMAIN=\"GThread\" \
496 + -DG_DISABLE_CAST_CHECKS \
497 + -DG_DISABLE_DEPRECATED \
501 +LOCAL_SHARED_LIBRARIES := glib-2.40.2
502 +include $(BUILD_SHARED_LIBRARY)
503 \ No newline at end of file