Browse Source

2008-03-12 Geoff Norton <[email protected]>

	* src/gutf8.c: Implement g_ucs4_to_utf16 and g_utf16_to_ucs4 as
	asserts.  They're needed to build mono with eglib.
	* src/gutil.h: Add a few missing function declarations to the header.
	* src/gspawn.c: Some darwin implementations don't have crt_externs.h
	So we'll just define _NSGetEnviron() ourselves.
	* Makefile.am: Dont build test when cross compiling.
	* configure.ac: Define CROSS_COMPILING when cross compiling.
	Undefine _FORTIFY_SOURCE on arm-apple-darwin as the headers it
	requires are not available.


svn path=/trunk/mono/; revision=98061
Geoff Norton 18 years ago
parent
commit
c4e3ccc5aa
6 changed files with 47 additions and 3 deletions
  1. 12 0
      eglib/ChangeLog
  2. 4 0
      eglib/Makefile.am
  3. 7 0
      eglib/configure.ac
  4. 3 2
      eglib/src/glib.h
  5. 5 1
      eglib/src/gspawn.c
  6. 16 0
      eglib/src/gutf8.c

+ 12 - 0
eglib/ChangeLog

@@ -1,3 +1,15 @@
+2008-03-12  Geoff Norton  <[email protected]>
+
+	* src/gutf8.c: Implement g_ucs4_to_utf16 and g_utf16_to_ucs4 as
+	asserts.  They're needed to build mono with eglib.
+	* src/gutil.h: Add a few missing function declarations to the header.
+	* src/gspawn.c: Some darwin implementations don't have crt_externs.h
+	So we'll just define _NSGetEnviron() ourselves.
+	* Makefile.am: Dont build test when cross compiling.
+	* configure.ac: Define CROSS_COMPILING when cross compiling.
+	Undefine _FORTIFY_SOURCE on arm-apple-darwin as the headers it 
+	requires are not available.
+
 2008-01-15  Andreas Faerber  <[email protected]>
 
 	* configure.ac: Add default G_BREAKPOINT implementation.

+ 4 - 0
eglib/Makefile.am

@@ -1,4 +1,8 @@
+if CROSS_COMPILING
+SUBDIRS = src
+else
 SUBDIRS = src test
+endif
 
 EXTRA_DIST = autogen.sh README NEWS AUTHORS ChangeLog
 

+ 7 - 0
eglib/configure.ac

@@ -25,6 +25,7 @@ AC_SUBST(GNUC_UNUSED)
 AC_SUBST(GNUC_NORETURN)
 AC_SUBST(BREAKPOINT)
 
+AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
 AC_C_BIGENDIAN([ORDER=G_BIG_ENDIAN],[ORDER=G_LITTLE_ENDIAN])
 AC_SUBST(ORDER)
 
@@ -41,6 +42,12 @@ case $host in
     ;;
 esac
 
+case $target in
+arm*-darwin*)
+    CFLAGS="$CLAFGS -U_FORTIFY_SOURCE"
+    ;;
+esac
+
 AC_SUBST(PATHSEP)
 AC_SUBST(SEARCHSEP)
 AC_SUBST(OS)

+ 3 - 2
eglib/src/glib.h

@@ -197,6 +197,7 @@ typedef struct {
 	gchar   *message;
 } GError;
 
+void    g_clear_error (GError **error);
 void    g_error_free (GError *error);
 GError *g_error_new  (gpointer domain, gint code, const char *format, ...);
 void    g_set_error  (GError **err, gpointer domain, gint code, const gchar *format, ...);
@@ -559,8 +560,8 @@ typedef enum {
 	G_CONVERT_ERROR_NOT_ABSOLUTE_PATH
 } GConvertError;
 
-gunichar2 *g_utf8_to_utf16 (const gchar *str, glong len, glong *items_read, glong     *items_written, GError **error);
-gchar     *g_utf16_to_utf8 (const gunichar2 *str, glong len, glong *items_read, glong     *items_written, GError **error);
+gunichar2 *g_utf8_to_utf16 (const gchar *str, glong len, glong *items_read, glong *items_written, GError **error);
+gchar     *g_utf16_to_utf8 (const gunichar2 *str, glong len, glong *items_read, glong *items_written, GError **error);
 
 #define u8to16(str) g_utf8_to_utf16(str, (glong)strlen(str), NULL, NULL, NULL)
 

+ 5 - 1
eglib/src/gspawn.c

@@ -64,7 +64,11 @@
 #define CLOSE_PIPE(p) do { close (p [0]); close (p [1]); } while (0)
 
 #ifdef __APPLE__
-#include <crt_externs.h>
+/* Apple defines this in crt_externs.h but doesn't provide that header for 
+ * arm-apple-darwin9.  We'll manually define the symbol on Apple as it does
+ * in fact exist on all implementations (so far) 
+ */
+gchar ***_NSGetEnviron();
 #define environ *_NSGetEnviron();
 #endif
 

+ 16 - 0
eglib/src/gutf8.c

@@ -379,3 +379,19 @@ utf16_to_utf8_len (const gunichar2 *str, glong len, glong *items_read, GError **
 		*items_read = in_pos;
 	return ret;
 }
+
+gunichar2*
+g_ucs4_to_utf16 (const gunichar *str, glong len, glong *items_read, glong *items_written, GError **error)
+{
+	g_assert_not_reached ();
+
+	return NULL;
+}
+
+gunichar*
+g_utf16_to_ucs4 (const gunichar2 *str, glong len, glong *items_read, glong *items_written, GError **error)
+{
+	g_assert_not_reached ();
+
+	return NULL;
+}