The following diff eliminates the AltiVec FLAVOR and enables
it by default for PowerPC packages. I need someone to test
the AltiVec operation ona G4 system. Load the Gimp in a xterm
with "gimp --verbose" and within the first couple of lines
of verbose output it will list the supported SIMD instructions
and it should show +altivec.


Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/gimp/stable/Makefile,v
retrieving revision 1.35
diff -u -p -r1.35 Makefile
--- Makefile    12 Jul 2008 13:28:04 -0000      1.35
+++ Makefile    22 Aug 2008 14:27:49 -0000
@@ -3,7 +3,7 @@
 COMMENT=       GNU Image Manipulation Program
 
 DISTNAME=      gimp-2.4.6
-PKGNAME=       ${DISTNAME}p1
+PKGNAME=       ${DISTNAME}p2
 SHARED_LIBS=   gimp-2.0        246.00  \
                gimpbase-2.0    246.00  \
                gimpcolor-2.0   246.00  \
@@ -56,23 +56,12 @@ MODULES=    devel/gettext \
 USE_X11=       Yes
 USE_GMAKE=     Yes
 USE_LIBTOOL=   Yes
-
 AUTOCONF_VERSION= 2.61
-
 CONFIGURE_STYLE= autoconf
 CONFIGURE_ARGS=        ${CONFIGURE_SHARED}
 CONFIGURE_ARGS+=--without-gtkhtml2 --without-librsvg --without-print \
                --without-gnomevfs --without-libcurl --disable-python
 CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include/libpng -I${LOCALBASE}/include 
-I${X11BASE}/include" \
                LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib"
-
-FLAVORS=       altivec
-FLAVOR?=
-
-.if ${FLAVOR:L} == "altivec"
-ONLY_FOR_ARCHS= powerpc   
-.else
-CONFIGURE_ARGS+= --disable-altivec
-.endif
 
 .include <bsd.port.mk>
Index: patches/patch-configure_in
===================================================================
RCS file: /cvs/ports/graphics/gimp/stable/patches/patch-configure_in,v
retrieving revision 1.5
diff -u -p -r1.5 patch-configure_in
--- patches/patch-configure_in  15 Jun 2008 17:08:01 -0000      1.5
+++ patches/patch-configure_in  22 Aug 2008 14:27:49 -0000
@@ -1,6 +1,15 @@
 $OpenBSD: patch-configure_in,v 1.5 2008/06/15 17:08:01 okan Exp $
 --- configure.in.orig  Fri May 23 05:41:20 2008
-+++ configure.in       Fri Jun 13 22:05:04 2008
++++ configure.in       Wed Aug 13 05:39:06 2008
+@@ -679,7 +679,7 @@ if test "x$enable_altivec" = xyes; then
+     AC_MSG_WARN([The compiler does not support the AltiVec command set.])
+   else
+     case "$target_or_host" in
+-      *-*-darwin*)
++      *-*-darwin* | *-*-openbsd*)
+         can_use_altivec=yes
+         AC_DEFINE(HAVE_ALTIVEC_SYSCTL, 1,
+          [Define to 1 if the altivec runtime test should use a sysctl.])
 @@ -1103,10 +1103,10 @@ AC_ARG_WITH(libmng,  [  --without-libmng        build 
    if test "x$with_libmng" != xno && test -z "$LIBMNG" &&
       test -n "$LIBPNG" && test -n "$LIBJPEG" && test -n "$LIBZ"; then
Index: patches/patch-libgimpbase_gimpcpuaccel_c
===================================================================
RCS file: patches/patch-libgimpbase_gimpcpuaccel_c
diff -N patches/patch-libgimpbase_gimpcpuaccel_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-libgimpbase_gimpcpuaccel_c    22 Aug 2008 14:27:49 -0000
@@ -0,0 +1,32 @@
+$OpenBSD$
+--- libgimpbase/gimpcpuaccel.c.orig    Wed Aug 13 05:53:08 2008
++++ libgimpbase/gimpcpuaccel.c Wed Aug 13 06:49:20 2008
+@@ -413,16 +413,26 @@ arch_accel (void)
+ #if defined(HAVE_ALTIVEC_SYSCTL)
+ 
+ #include <sys/sysctl.h>
++#ifdef __OpenBSD__
++#include <machine/cpu.h>
++#endif
+ 
+ #define HAVE_ACCEL 1
+ 
+ static guint32
+ arch_accel (void)
+ {
+-  gint     sels[2] = { CTL_HW, HW_VECTORUNIT };
+   gboolean has_vu  = FALSE;
+   gsize    length  = sizeof(has_vu);
+-  gint     err;
++  gint     sels[2], err;
++
++#ifdef __OpenBSD__
++  sels[0] = CTL_MACHDEP;
++  sels[1] = CPU_ALTIVEC;
++#else
++  sels[0] = CTL_HW;
++  sels[1] = HW_VECTORUNIT;
++#endif
+ 
+   err = sysctl (sels, 2, &has_vu, &length, NULL, 0);
+ 

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Reply via email to