diff options
author | Tor Lillqvist <tml@iki.fi> | 2011-05-31 01:25:03 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2011-05-31 01:26:26 +0300 |
commit | b61b156d52d24a7cfc42fb47d922bbc292bc6835 (patch) | |
tree | d380a657f6f8a157db92be8d60eb6b466f827081 /glib | |
parent | d49fe1968a4b5a3c79fa71177bcdeeb702db264e (diff) |
Enable building glib for iOS
Pass --build and --host options to the configure script. Pass a bunch
of a priori cached test results for stuff that can't be determined
when cross-compiling. Link with the CoreFoundation framework. Build
static archives.
Patch out the compile-time USE_LIBICONV_GNU and _LIBICONV_H test from
gconvert.c as it for some reason fails for iOS.
Diffstat (limited to 'glib')
-rw-r--r-- | glib/glib-2.28.1.patch | 17 | ||||
-rw-r--r-- | glib/makefile.mk | 36 |
2 files changed, 50 insertions, 3 deletions
diff --git a/glib/glib-2.28.1.patch b/glib/glib-2.28.1.patch index cadcc4db2cb8..da993817da7f 100644 --- a/glib/glib-2.28.1.patch +++ b/glib/glib-2.28.1.patch @@ -39,3 +39,20 @@ #include "gthreadprivate.h" /** +--- misc/glib-2.28.1/glib/gconvert.c ++++ misc/build/glib-2.28.1/glib/gconvert.c +@@ -58,13 +58,6 @@ + + #include "glibintl.h" + +-#if defined(USE_LIBICONV_GNU) && !defined (_LIBICONV_H) +-#error GNU libiconv in use but included iconv.h not from libiconv +-#endif +-#if !defined(USE_LIBICONV_GNU) && defined (_LIBICONV_H) +-#error GNU libiconv not in use but included iconv.h is from libiconv +-#endif +- + + /** + * SECTION:conversions + diff --git a/glib/makefile.mk b/glib/makefile.mk index 7e355d488dba..7d65bad2aa32 100644 --- a/glib/makefile.mk +++ b/glib/makefile.mk @@ -48,15 +48,32 @@ TARFILE_NAME=$(PRJNAME)-$(GLIBVERSION) TARFILE_MD5=9f6e85e1e38490c3956f4415bcd33e6e -.IF "$(OS)"=="MACOSX" +.IF "$(OS)"=="MACOSX" || "$(OS)"=="IOS" PATCH_FILES=glib-2.28.1.patch -CONFIGURE_FLAGS=--prefix=$(SRC_ROOT)$/$(PRJNAME)$/$(MISC) +.IF "$(OS)"=="IOS" +CONFIGURE_FLAGS= \ + glib_cv_stack_grows=no \ + glib_cv_uscore=yes \ + ac_cv_func_posix_getpwuid_r=yes \ + ac_cv_func_posix_getgrgid_r=yes \ + ac_cv_func__NSGetEnviron=no \ + --disable-shared +FRAMEWORK=-framework CoreFoundation +.ELSE +CONFIGURE_FLAGS=--disable-static +.ENDIF + +CONFIGURE_FLAGS+=--prefix=$(SRC_ROOT)$/$(PRJNAME)$/$(MISC) CONFIGURE_FLAGS+=--disable-fam CONFIGURE_FLAGS+=CPPFLAGS="$(ARCH_FLAGS) $(EXTRA_CDEFS) -DBUILD_OS_APPLEOSX" CONFIGURE_FLAGS+=CFLAGS="$(ARCH_FLAGS) $(EXTRA_CFLAGS) -I$(SOLARINCDIR)$/external" -CONFIGURE_FLAGS+=LDFLAGS="-L$(SOLARLIBDIR) $(EXTRA_LINKFLAGS)" +CONFIGURE_FLAGS+=LDFLAGS="-L$(SOLARLIBDIR) $(EXTRA_LINKFLAGS) $(FRAMEWORK)" +.IF "$(CROSS_COMPILING)"!="" +CONFIGURE_FLAGS+=--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) +.ENDIF + CONFIGURE_ACTION=$(AUGMENT_LIBRARY_PATH) ./configure .IF "$(VERBOSE)"!="" @@ -66,6 +83,9 @@ VFLAG=V=1 BUILD_ACTION=$(AUGMENT_LIBRARY_PATH) $(GNUMAKE) $(VFLAG) EXTRPATH=LOADER + +.IF "$(OS)"=="MACOSX" + OUT2LIB+=gio/.libs/libgio-2.0.0.dylib OUT2LIB+=glib/.libs/libglib-2.0.0.dylib OUT2LIB+=gmodule/.libs/libgmodule-2.0.0.dylib @@ -76,6 +96,16 @@ OUT2BIN+=gobject/glib-mkenums OUT2BIN+=gobject/.libs/glib-genmarshal OUT2BIN+=gio/.libs/glib-compile-schemas +.ELIF "$(OS)"=="IOS" + +OUT2LIB+=gio/.libs/libgio-2.0.a +OUT2LIB+=glib/.libs/libglib-2.0.a +OUT2LIB+=gmodule/.libs/libgmodule-2.0.a +OUT2LIB+=gobject/.libs/libgobject-2.0.a +OUT2LIB+=gthread/.libs/libgthread-2.0.a + +.ENDIF + OUT2INC+=glib/glib.h OUT2INC+=glib/glib-object.h OUT2INC+=glib/glibconfig.h |