[38288] trunk/dports/devel/glib2

ryandesign at macports.org ryandesign at macports.org
Mon Jul 14 20:34:56 PDT 2008


Revision: 38288
          http://trac.macosforge.org/projects/macports/changeset/38288
Author:   ryandesign at macports.org
Date:     2008-07-14 20:34:55 -0700 (Mon, 14 Jul 2008)
Log Message:
-----------
glib2: fix PowerPC and universal builds; see #15816

Modified Paths:
--------------
    trunk/dports/devel/glib2/Portfile

Added Paths:
-----------
    trunk/dports/devel/glib2/files/patch-configure.diff

Modified: trunk/dports/devel/glib2/Portfile
===================================================================
--- trunk/dports/devel/glib2/Portfile	2008-07-15 03:13:55 UTC (rev 38287)
+++ trunk/dports/devel/glib2/Portfile	2008-07-15 03:34:55 UTC (rev 38288)
@@ -5,6 +5,7 @@
 name                    glib2
 set my_name             glib
 version                 2.16.4
+revision                1
 set branch              [join [lrange [split ${version} .] 0 1] .]
 categories              devel
 maintainers             ryandesign
@@ -63,6 +64,10 @@
     reinplace "s|path = \"/bin|path = \"${prefix}/bin:/bin|g" ${worksrcpath}/glib/gutils.c ${worksrcpath}/glib/gspawn.c
 }
 
+platform darwin {
+    patchfiles-append patch-configure.diff
+}
+
 platform powerpc {
     if {[variant_isset universal]} {
         post-configure {

Added: trunk/dports/devel/glib2/files/patch-configure.diff
===================================================================
--- trunk/dports/devel/glib2/files/patch-configure.diff	                        (rev 0)
+++ trunk/dports/devel/glib2/files/patch-configure.diff	2008-07-15 03:34:55 UTC (rev 38288)
@@ -0,0 +1,142 @@
+--- configure	2008-07-14 14:57:48.000000000 +0200
++++ configure	2008-07-14 15:00:04.000000000 +0200
+@@ -31818,23 +31818,11 @@
+ fi
+ { $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+ $as_echo "$ac_cv_c_bigendian" >&6; }
+- case $ac_cv_c_bigendian in #(
+-   yes)
+      cat >>confdefs.h <<\_ACEOF
++#ifdef __BIG_ENDIAN__
+ #define WORDS_BIGENDIAN 1
++#endif
+ _ACEOF
+-;; #(
+-   no)
+-      ;; #(
+-   universal)
+-      ;; #(
+-   *)
+-     { { $as_echo "$as_me:$LINENO: error: unknown endianness
+- presetting ac_cv_c_bigendian=no (or yes) will help" >&5
+-$as_echo "$as_me: error: unknown endianness
+- presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
+-   { (exit 1); exit 1; }; } ;;
+- esac
+ 
+ 
+ # check for header files
+@@ -42770,7 +42758,11 @@
+ $as_echo "$glib_cv_byte_contents_gmutex" >&6; }
+ 
+ cat >>confdefs.h <<_ACEOF
+-#define GLIB_BYTE_CONTENTS_GMUTEX $glib_cv_byte_contents_gmutex
++#ifdef __BIG_ENDIAN__
++#define GLIB_BYTE_CONTENTS_GMUTEX 50,-86,-85,-89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
++#else
++#define GLIB_BYTE_CONTENTS_GMUTEX -89,-85,-86,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
++#endif
+ _ACEOF
+ 
+ 
+@@ -48265,10 +48257,13 @@
+ _______EOF
+ 	fi
+ 
+-	case x$g_stack_grows in
+-	xyes) echo "#define G_HAVE_GROWING_STACK 1" >>$outfile ;;
+-	*)    echo "#define G_HAVE_GROWING_STACK 0" >>$outfile ;;
+-	esac
++	cat >>$outfile <<_______EOF
++#ifdef __BIG_ENDIAN__
++#define G_HAVE_GROWING_STACK 1
++#else
++#define G_HAVE_GROWING_STACK 0
++#endif
++_______EOF
+ 
+ 
+ 	echo >>$outfile
+@@ -48317,7 +48312,12 @@
+     long   dummy_long;
+   } static_mutex;
+ };
+-#define	G_STATIC_MUTEX_INIT	{ NULL, { { $g_mutex_contents} } }
++#ifdef __BIG_ENDIAN__
++#define G_STATIC_MUTEX_INIT     { NULL, { { 50,-86,-85,-89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} } }
++#else           
++#define G_STATIC_MUTEX_INIT     { NULL, { { -89,-85,-86,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} } }
++#endif
++
+ #define	g_static_mutex_get_mutex(mutex) \\
+   (g_thread_use_default_impl ? ((GMutex*) ((mutex)->static_mutex.pad)) : \\
+    g_static_mutex_get_mutex_impl_shortcut (&((mutex)->runtime_mutex)))
+@@ -48346,24 +48346,39 @@
+   void  *dummy_pointer;
+   long   dummy_long;
+ };
+-_______EOF
+-	if test x"$g_memory_barrier_needed" != xno; then
+-	  echo >>$outfile
+-	  echo "#define G_ATOMIC_OP_MEMORY_BARRIER_NEEDED 1" >>$outfile
+-	fi
++#ifdef __BIG_ENDIAN__
++#define G_ATOMIC_OP_MEMORY_BARRIER_NEEDED 1
++#define GINT16_TO_BE(val)	((gint16) (val))
++#define GUINT16_TO_BE(val)	((guint16) (val))
++#define GINT16_TO_LE(val)	((gint16) GUINT16_SWAP_LE_BE (val))
++#define GUINT16_TO_LE(val)	(GUINT16_SWAP_LE_BE (val))
++#define GINT32_TO_BE(val)	((gint32) (val))
++#define GUINT32_TO_BE(val)	((guint32) (val))
++#define GINT32_TO_LE(val)	((gint32) GUINT32_SWAP_LE_BE (val))
++#define GUINT32_TO_LE(val)	(GUINT32_SWAP_LE_BE (val))
++#define GINT64_TO_BE(val)	((gint64) (val))
++#define GUINT64_TO_BE(val)	((guint64) (val))
++#define GINT64_TO_LE(val)	((gint64) GUINT64_SWAP_LE_BE (val))
++#define GUINT64_TO_LE(val)	(GUINT64_SWAP_LE_BE (val))
++
++#else
++
++#define GINT16_TO_LE(val)	((gint16) (val))
++#define GUINT16_TO_LE(val)	((guint16) (val))
++#define GINT16_TO_BE(val)	((gint16) GUINT16_SWAP_LE_BE (val))
++#define GUINT16_TO_BE(val)	(GUINT16_SWAP_LE_BE (val))
++#define GINT32_TO_LE(val)	((gint32) (val))
++#define GUINT32_TO_LE(val)	((guint32) (val))
++#define GINT32_TO_BE(val)	((gint32) GUINT32_SWAP_LE_BE (val))
++#define GUINT32_TO_BE(val)	(GUINT32_SWAP_LE_BE (val))
++#define GINT64_TO_LE(val)	((gint64) (val))
++#define GUINT64_TO_LE(val)	((guint64) (val))
++#define GINT64_TO_BE(val)	((gint64) GUINT64_SWAP_LE_BE (val))
++#define GUINT64_TO_BE(val)	(GUINT64_SWAP_LE_BE (val))
++
++#endif
+ 
+-	echo >>$outfile
+-	g_bit_sizes="16 32 64"
+-	for bits in $g_bit_sizes; do
+-	  cat >>$outfile <<_______EOF
+-#define GINT${bits}_TO_${g_bs_native}(val)	((gint${bits}) (val))
+-#define GUINT${bits}_TO_${g_bs_native}(val)	((guint${bits}) (val))
+-#define GINT${bits}_TO_${g_bs_alien}(val)	((gint${bits}) GUINT${bits}_SWAP_LE_BE (val))
+-#define GUINT${bits}_TO_${g_bs_alien}(val)	(GUINT${bits}_SWAP_LE_BE (val))
+-_______EOF
+-	done
+ 
+-	cat >>$outfile <<_______EOF
+ #define GLONG_TO_LE(val)	((glong) GINT${glongbits}_TO_LE (val))
+ #define GULONG_TO_LE(val)	((gulong) GUINT${glongbits}_TO_LE (val))
+ #define GLONG_TO_BE(val)	((glong) GINT${glongbits}_TO_BE (val))
+@@ -48372,7 +48387,11 @@
+ #define GUINT_TO_LE(val)	((guint) GUINT${gintbits}_TO_LE (val))
+ #define GINT_TO_BE(val)		((gint) GINT${gintbits}_TO_BE (val))
+ #define GUINT_TO_BE(val)	((guint) GUINT${gintbits}_TO_BE (val))
+-#define G_BYTE_ORDER $g_byte_order
++#ifdef __BIG_ENDIAN__
++#define G_BYTE_ORDER G_BIG_ENDIAN
++#else
++#define G_BYTE_ORDER G_LITTLE_ENDIAN
++#endif
+ 
+ #define GLIB_SYSDEF_POLLIN =$g_pollin
+ #define GLIB_SYSDEF_POLLOUT =$g_pollout
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080714/64083ce6/attachment.html 


More information about the macports-changes mailing list