From 57e0cc8a726e5e31646402737071f3a152096d19 Mon Sep 17 00:00:00 2001 From: sthen Date: Thu, 25 Mar 2010 10:23:26 +0000 Subject: [PATCH] Import devel/orc, from Brad with a patch from me to drop ARM machines back to the generic support rather than trying to use the asm backend which appears to be broken upstream. Orc is a library and set of tools for compiling and executing very simple programs that operate on arrays of data. The "language" is a generic assembly language that represents many of the features available in SIMD architectures, including saturated addition and subtraction, and many arithmetic operations. --- devel/orc/Makefile | 30 ++++++++ devel/orc/distinfo | 5 ++ devel/orc/patches/patch-configure_ac | 12 +++ devel/orc/patches/patch-m4_as-host-defines_m4 | 22 ++++++ devel/orc/patches/patch-orc-uninstalled_pc_in | 12 +++ devel/orc/patches/patch-orc_orccodemem_c | 42 ++++++++++ devel/orc/patches/patch-orc_orccpu-powerpc_c | 70 +++++++++++++++++ devel/orc/patches/patch-orc_orccpu-x86_c | 16 ++++ devel/orc/patches/patch-orc_pc_in | 12 +++ devel/orc/pkg/DESCR | 5 ++ devel/orc/pkg/PFRAG.shared | 5 ++ devel/orc/pkg/PLIST | 76 +++++++++++++++++++ 12 files changed, 307 insertions(+) create mode 100644 devel/orc/Makefile create mode 100644 devel/orc/distinfo create mode 100644 devel/orc/patches/patch-configure_ac create mode 100644 devel/orc/patches/patch-m4_as-host-defines_m4 create mode 100644 devel/orc/patches/patch-orc-uninstalled_pc_in create mode 100644 devel/orc/patches/patch-orc_orccodemem_c create mode 100644 devel/orc/patches/patch-orc_orccpu-powerpc_c create mode 100644 devel/orc/patches/patch-orc_orccpu-x86_c create mode 100644 devel/orc/patches/patch-orc_pc_in create mode 100644 devel/orc/pkg/DESCR create mode 100644 devel/orc/pkg/PFRAG.shared create mode 100644 devel/orc/pkg/PLIST diff --git a/devel/orc/Makefile b/devel/orc/Makefile new file mode 100644 index 00000000000..ae474eb43b4 --- /dev/null +++ b/devel/orc/Makefile @@ -0,0 +1,30 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2010/03/25 10:23:26 sthen Exp $ + +COMMENT= library and toolset to operate arrays of data + +DISTNAME= orc-0.4.3 +CATEGORIES= devel +MASTER_SITES= http://code.entropywave.com/download/orc/ + +SHARED_LIBS+= orc-0.4 0.0 \ + orc-float-0.4 0.0 \ + orc-pixel-0.4 0.0 \ + orc-test-0.4 0.0 + +HOMEPAGE= http://code.entropywave.com/projects/orc/ + +MAINTAINER= Brad Smith + +# BSD +PERMIT_PACKAGE_CDROM= Yes +PERMIT_PACKAGE_FTP= Yes +PERMIT_DISTFILES_CDROM= Yes +PERMIT_DISTFILES_FTP= Yes +WANTLIB= c m pthread + +USE_LIBTOOL= Yes +CONFIGURE_STYLE= autoconf +# Should be 2.63 +AUTOCONF_VERSION= 2.62 + +.include diff --git a/devel/orc/distinfo b/devel/orc/distinfo new file mode 100644 index 00000000000..825e40e1252 --- /dev/null +++ b/devel/orc/distinfo @@ -0,0 +1,5 @@ +MD5 (orc-0.4.3.tar.gz) = my5wMMjfig03ERWGn+VoWg== +RMD160 (orc-0.4.3.tar.gz) = wWXaibUVANOd9l5cCU0F8uy+OaM= +SHA1 (orc-0.4.3.tar.gz) = nnPnvPodHhWkkvcvEQAkToefYNI= +SHA256 (orc-0.4.3.tar.gz) = TAJm2B2mf+8LKr1eYkqasNtd4E6yPDqyTiL1+c7u+/4= +SIZE (orc-0.4.3.tar.gz) = 538428 diff --git a/devel/orc/patches/patch-configure_ac b/devel/orc/patches/patch-configure_ac new file mode 100644 index 00000000000..aeccb13090f --- /dev/null +++ b/devel/orc/patches/patch-configure_ac @@ -0,0 +1,12 @@ +$OpenBSD: patch-configure_ac,v 1.1.1.1 2010/03/25 10:23:26 sthen Exp $ +--- configure.ac.orig Wed Mar 17 19:16:07 2010 ++++ configure.ac Wed Mar 17 19:16:50 2010 +@@ -113,7 +113,7 @@ AC_DEFINE(ORC_EXPORTS, 1, [Defined for compiling inter + ORC_CFLAGS="$ORC_CFLAGS -I\$(top_srcdir)" + AC_SUBST(ORC_CFLAGS) + +-ORC_LIBS="\$(top_builddir)/orc/liborc-$ORC_MAJORMINOR.la $LIBM $LIBRT" ++ORC_LIBS="\$(top_builddir)/orc/liborc-$ORC_MAJORMINOR.la -pthread $LIBM $LIBRT" + AC_SUBST(ORC_LIBS) + + #CFLAGS=`echo $CFLAGS | sed s/O2/O0/` diff --git a/devel/orc/patches/patch-m4_as-host-defines_m4 b/devel/orc/patches/patch-m4_as-host-defines_m4 new file mode 100644 index 00000000000..b00e2606b53 --- /dev/null +++ b/devel/orc/patches/patch-m4_as-host-defines_m4 @@ -0,0 +1,22 @@ +$OpenBSD: patch-m4_as-host-defines_m4,v 1.1.1.1 2010/03/25 10:23:26 sthen Exp $ + +orc's arm support is broken; avoid testing for this so the +generic code is used instead. + +--- m4/as-host-defines.m4.orig Thu Mar 25 09:39:08 2010 ++++ m4/as-host-defines.m4 Thu Mar 25 09:40:25 2010 +@@ -23,10 +23,10 @@ AC_DEFUN([AS_HOST_DEFINES], + HAVE_POWERPC=yes + AC_DEFINE(HAVE_POWERPC, 1, [Defined if host is powerpc]) + ;; +- xarm) +- HAVE_ARM=yes +- AC_DEFINE(HAVE_ARM, 1, [Defined if host is arm]) +- ;; ++dnl xarm) ++dnl HAVE_ARM=yes ++dnl AC_DEFINE(HAVE_ARM, 1, [Defined if host is arm]) ++dnl ;; + esac + + AM_CONDITIONAL(HAVE_I386, test "x$HAVE_I386" = "xyes") diff --git a/devel/orc/patches/patch-orc-uninstalled_pc_in b/devel/orc/patches/patch-orc-uninstalled_pc_in new file mode 100644 index 00000000000..2db61181028 --- /dev/null +++ b/devel/orc/patches/patch-orc-uninstalled_pc_in @@ -0,0 +1,12 @@ +$OpenBSD: patch-orc-uninstalled_pc_in,v 1.1.1.1 2010/03/25 10:23:26 sthen Exp $ +--- orc-uninstalled.pc.in.orig Wed Mar 17 19:19:09 2010 ++++ orc-uninstalled.pc.in Wed Mar 17 19:19:40 2010 +@@ -6,7 +6,7 @@ includedir=${pcfiledir}/ + Name: orc-@ORC_MAJORMINOR@ uninstalled + Description: Library of Optimized Inner Loops Runtime Compiler + Version: @VERSION@ +-Libs: -L${libdir} -lorc-@ORC_MAJORMINOR@ @LIBM@ @LIBRT@ ++Libs: -L${libdir} -lorc-@ORC_MAJORMINOR@ -pthread @LIBM@ @LIBRT@ + Cflags: -I${includedir} + + orcc=${pcfiledir}/tools/orcc@EXEEXT@ diff --git a/devel/orc/patches/patch-orc_orccodemem_c b/devel/orc/patches/patch-orc_orccodemem_c new file mode 100644 index 00000000000..be2c2be5f68 --- /dev/null +++ b/devel/orc/patches/patch-orc_orccodemem_c @@ -0,0 +1,42 @@ +$OpenBSD: patch-orc_orccodemem_c,v 1.1.1.1 2010/03/25 10:23:26 sthen Exp $ +--- orc/orccodemem.c.orig Mon Mar 22 20:35:43 2010 ++++ orc/orccodemem.c Mon Mar 22 20:38:14 2010 +@@ -29,26 +29,13 @@ orc_compiler_allocate_codemem (OrcCompiler *compiler) + int fd; + int n; + +- /* FIXME something combining these two would be ideal */ +-#if 1 + { +- char filename[32] = "/tmp/orcexecXXXXXX"; +- fd = mkstemp (filename); +- if (fd == -1) { +- /* FIXME oh crap */ +- ORC_COMPILER_ERROR (compiler, "failed to create temp file"); +- return; +- } +- unlink (filename); +- } +-#else +- { + char *filename; + +- filename = malloc (strlen ("/tmp/orcexec") + +- strlen (compiler->program->name) + 1); +- sprintf(filename, "/tmp/orcexec%s", compiler->program->name); +- fd = open (filename, O_RDWR | O_CREAT, S_IRWXU); ++ filename = malloc (strlen ("/tmp/orcexec..") + ++ strlen (compiler->program->name) + 6 + 1); ++ sprintf(filename, "/tmp/orcexec.%s.XXXXXX", compiler->program->name); ++ fd = mkstemp (filename); + if (fd == -1) { + /* FIXME oh crap */ + ORC_COMPILER_ERROR (compiler, "failed to create temp file"); +@@ -57,7 +44,6 @@ orc_compiler_allocate_codemem (OrcCompiler *compiler) + unlink (filename); + free (filename); + } +-#endif + + n = ftruncate (fd, SIZE); + diff --git a/devel/orc/patches/patch-orc_orccpu-powerpc_c b/devel/orc/patches/patch-orc_orccpu-powerpc_c new file mode 100644 index 00000000000..56fde8b225a --- /dev/null +++ b/devel/orc/patches/patch-orc_orccpu-powerpc_c @@ -0,0 +1,70 @@ +$OpenBSD: patch-orc_orccpu-powerpc_c,v 1.1.1.1 2010/03/25 10:23:26 sthen Exp $ +--- orc/orccpu-powerpc.c.orig Tue Jul 7 17:09:26 2009 ++++ orc/orccpu-powerpc.c Mon Mar 22 23:18:55 2010 +@@ -50,6 +50,11 @@ + #include + #endif + ++#if defined(__OpenBSD__) ++#include ++#include ++#include ++#endif + + /***** powerpc *****/ + +@@ -63,7 +68,7 @@ orc_profile_stamp_tb(void) + } + #endif + +-#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__APPLE__) && !defined(__linux__) ++#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__OpenBSD__) && !defined(__APPLE__) && !defined(__linux__) + static void + test_altivec (void * ignored) + { +@@ -95,6 +100,27 @@ orc_check_altivec_sysctl_bsd (void) + } + #endif + ++#if defined(__OpenBSD__) ++static unsigned long ++orc_check_altivec_sysctl_openbsd (void) ++{ ++ unsigned long cpu_flags = 0; ++ int mib[2], ret, vu; ++ size_t len; ++ ++ mib[0] = CTL_MACHDEP; ++ mib[1] = CPU_ALTIVEC; ++ ++ len = sizeof(vu); ++ ret = sysctl(mib, 2, &vu, &len, NULL, 0); ++ if (!ret && vu) { ++ cpu_flags |= ORC_TARGET_ALTIVEC_ALTIVEC; ++ } ++ ++ return cpu_flags; ++} ++#endif ++ + #if defined(__linux__) + static unsigned long + orc_check_altivec_proc_auxv (void) +@@ -148,7 +174,7 @@ out: + } + #endif + +-#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__APPLE__) && !defined(__linux__) ++#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__OpenBSD__) && !defined(__APPLE__) && !defined(__linux__) + static void + orc_check_altivec_fault (void) + { +@@ -166,6 +192,8 @@ orc_cpu_detect_arch(void) + { + #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) + orc_check_altivec_sysctl_bsd(); ++#elif defined(__OpenBSD__) ++ orc_check_altivec_sysctl_openbsd(); + #elif defined(__linux__) + orc_check_altivec_proc_auxv(); + #else diff --git a/devel/orc/patches/patch-orc_orccpu-x86_c b/devel/orc/patches/patch-orc_orccpu-x86_c new file mode 100644 index 00000000000..0206a2e4c41 --- /dev/null +++ b/devel/orc/patches/patch-orc_orccpu-x86_c @@ -0,0 +1,16 @@ +$OpenBSD: patch-orc_orccpu-x86_c,v 1.1.1.1 2010/03/25 10:23:26 sthen Exp $ +--- orc/orccpu-x86.c.orig Mon Mar 22 21:01:52 2010 ++++ orc/orccpu-x86.c Mon Mar 22 21:03:15 2010 +@@ -431,10 +431,8 @@ orc_cpu_detect_kernel_support (void) + * unmasked SSE FPU exception bug. Other than that, if /proc/cpuinfo + * reported SSE, then it's safe. + */ +-#elif defined(__sun) +- /* Solaris is OK */ +-#elif defined(__NetBSD__) +- /* NetBSD is OK */ ++#elif defined(__sun) || defined(__NetBSD__) || defined(__OpenBSD__) ++ /* Solaris/NetBSD/OpenBSD are OK */ + #else + + ORC_WARNING("Operating system is not known to support SSE. " diff --git a/devel/orc/patches/patch-orc_pc_in b/devel/orc/patches/patch-orc_pc_in new file mode 100644 index 00000000000..e2e5e9df719 --- /dev/null +++ b/devel/orc/patches/patch-orc_pc_in @@ -0,0 +1,12 @@ +$OpenBSD: patch-orc_pc_in,v 1.1.1.1 2010/03/25 10:23:26 sthen Exp $ +--- orc.pc.in.orig Wed Mar 17 19:18:52 2010 ++++ orc.pc.in Wed Mar 17 19:19:23 2010 +@@ -8,7 +8,7 @@ toolsdir=${exec_prefix}/bin + Name: orc-@ORC_MAJORMINOR@ + Description: Library of Optimized Inner Loops Runtime Compiler + Version: @VERSION@ +-Libs: -L${libdir} -lorc-@ORC_MAJORMINOR@ @LIBM@ @LIBRT@ ++Libs: -L${libdir} -lorc-@ORC_MAJORMINOR@ -pthread @LIBM@ @LIBRT@ + Cflags: -I${includedir} + + orcc=${toolsdir}/orcc@EXEEXT@ diff --git a/devel/orc/pkg/DESCR b/devel/orc/pkg/DESCR new file mode 100644 index 00000000000..5cc93937970 --- /dev/null +++ b/devel/orc/pkg/DESCR @@ -0,0 +1,5 @@ +Orc is a library and set of tools for compiling and executing +very simple programs that operate on arrays of data. The "language" +is a generic assembly language that represents many of the features +available in SIMD architectures, including saturated addition and +subtraction, and many arithmetic operations. diff --git a/devel/orc/pkg/PFRAG.shared b/devel/orc/pkg/PFRAG.shared new file mode 100644 index 00000000000..dea3650d5a6 --- /dev/null +++ b/devel/orc/pkg/PFRAG.shared @@ -0,0 +1,5 @@ +@comment $OpenBSD: PFRAG.shared,v 1.1.1.1 2010/03/25 10:23:26 sthen Exp $ +@lib lib/liborc-0.4.so.${LIBorc-0.4_VERSION} +@lib lib/liborc-float-0.4.so.${LIBorc-float-0.4_VERSION} +@lib lib/liborc-pixel-0.4.so.${LIBorc-pixel-0.4_VERSION} +@lib lib/liborc-test-0.4.so.${LIBorc-test-0.4_VERSION} diff --git a/devel/orc/pkg/PLIST b/devel/orc/pkg/PLIST new file mode 100644 index 00000000000..e3c3a68c985 --- /dev/null +++ b/devel/orc/pkg/PLIST @@ -0,0 +1,76 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2010/03/25 10:23:26 sthen Exp $ +%%SHARED%% +@bin bin/orcc +include/orc-0.4/ +include/orc-0.4/orc/ +include/orc-0.4/orc-float/ +include/orc-0.4/orc-float/orcfloat.h +include/orc-0.4/orc-pixel/ +include/orc-0.4/orc-pixel/orcpixel.h +include/orc-0.4/orc-test/ +include/orc-0.4/orc-test/orcarray.h +include/orc-0.4/orc-test/orcprofile.h +include/orc-0.4/orc-test/orcrandom.h +include/orc-0.4/orc-test/orctest.h +include/orc-0.4/orc/opcodes.h +include/orc-0.4/orc/orc-stdint.h +include/orc-0.4/orc/orc.h +include/orc-0.4/orc/orcarm.h +include/orc-0.4/orc/orcdebug.h +include/orc-0.4/orc/orcfunctions.h +include/orc-0.4/orc/orcmmx.h +include/orc-0.4/orc/orconce.h +include/orc-0.4/orc/orcparse.h +include/orc-0.4/orc/orcpowerpc.h +include/orc-0.4/orc/orcprogram.h +include/orc-0.4/orc/orcsse.h +include/orc-0.4/orc/orcutils.h +include/orc-0.4/orc/orcx86.h +lib/liborc-0.4.a +lib/liborc-0.4.la +lib/liborc-float-0.4.a +lib/liborc-float-0.4.la +lib/liborc-pixel-0.4.a +lib/liborc-pixel-0.4.la +lib/liborc-test-0.4.a +lib/liborc-test-0.4.la +lib/orc/ +@bin lib/orc/example1 +@bin lib/orc/mt19937ar +@bin lib/orc/volscale +lib/pkgconfig/ +lib/pkgconfig/orc-0.4.pc +share/gtk-doc/ +share/gtk-doc/html/ +share/gtk-doc/html/orc/ +share/gtk-doc/html/orc/ch01.html +share/gtk-doc/html/orc/ch02.html +share/gtk-doc/html/orc/ch03.html +share/gtk-doc/html/orc/ch04.html +share/gtk-doc/html/orc/ch05.html +share/gtk-doc/html/orc/home.png +share/gtk-doc/html/orc/index.html +share/gtk-doc/html/orc/index.sgml +share/gtk-doc/html/orc/left.png +share/gtk-doc/html/orc/orc-building.html +share/gtk-doc/html/orc/orc-concepts.html +share/gtk-doc/html/orc/orc-misc.html +share/gtk-doc/html/orc/orc-opcodes.html +share/gtk-doc/html/orc/orc-orc.html +share/gtk-doc/html/orc/orc-orcarm.html +share/gtk-doc/html/orc/orc-orccompiler.html +share/gtk-doc/html/orc/orc-orcdebug.html +share/gtk-doc/html/orc/orc-orcexecutor.html +share/gtk-doc/html/orc/orc-orcmmx.html +share/gtk-doc/html/orc/orc-orcopcode.html +share/gtk-doc/html/orc/orc-orcpowerpc.html +share/gtk-doc/html/orc/orc-orcprogram.html +share/gtk-doc/html/orc/orc-orcrule.html +share/gtk-doc/html/orc/orc-orcsse.html +share/gtk-doc/html/orc/orc-orcutils.html +share/gtk-doc/html/orc/orc-orcx86.html +share/gtk-doc/html/orc/orc.devhelp +share/gtk-doc/html/orc/orc.devhelp2 +share/gtk-doc/html/orc/right.png +share/gtk-doc/html/orc/style.css +share/gtk-doc/html/orc/up.png