Revision: 70897 http://trac.macports.org/changeset/70897 Author: michaelld@macports.org Date: 2010-08-25 06:25:27 -0700 (Wed, 25 Aug 2010) Log Message: ----------- Patch 'orc' to dynamically test for and use the functions 'posix_memalign' and 'valloc'. Addresses ticket #26209. Modified Paths: -------------- trunk/dports/devel/orc/Portfile Added Paths: ----------- trunk/dports/devel/orc/files/ trunk/dports/devel/orc/files/patch_config.h.in.diff trunk/dports/devel/orc/files/patch_configure.diff trunk/dports/devel/orc/files/patch_orc-test_orcarray.c.diff Modified: trunk/dports/devel/orc/Portfile =================================================================== --- trunk/dports/devel/orc/Portfile 2010-08-25 13:12:57 UTC (rev 70896) +++ trunk/dports/devel/orc/Portfile 2010-08-25 13:25:27 UTC (rev 70897) @@ -16,6 +16,10 @@ sha1 b1078d4dde51cb413f637a9c8b2845f8cc3ffd9a \ rmd160 360cdda369d8b146774e32c4d1d7a8879be0155c +patchfiles patch-configure.diff \ + patch_orc-test_orcarray.c.diff \ + patch-config.h.in.diff + livecheck.type regex livecheck.url ${master_sites} livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}" Added: trunk/dports/devel/orc/files/patch_config.h.in.diff =================================================================== --- trunk/dports/devel/orc/files/patch_config.h.in.diff (rev 0) +++ trunk/dports/devel/orc/files/patch_config.h.in.diff 2010-08-25 13:25:27 UTC (rev 70897) @@ -0,0 +1,22 @@ +--- config.h.in.orig 2010-08-25 09:12:24.000000000 -0400 ++++ config.h.in 2010-08-25 09:12:53.000000000 -0400 +@@ -69,6 +69,9 @@ + /* Defined if host OS is MS Windows */ + #undef HAVE_OS_WIN32 + ++/* Define to 1 if you have the `posix_memalign' function. */ ++#undef HAVE_POSIX_MEMALIGN ++ + /* Defined if host is powerpc */ + #undef HAVE_POWERPC + +@@ -111,6 +114,9 @@ + /* Define to 1 if you have the <unistd.h> header file. */ + #undef HAVE_UNISTD_H + ++/* Define to 1 if you have the `valloc' function. */ ++#undef HAVE_VALLOC ++ + /* Define to the sub-directory in which libtool stores uninstalled libraries. + */ + #undef LT_OBJDIR Added: trunk/dports/devel/orc/files/patch_configure.diff =================================================================== --- trunk/dports/devel/orc/files/patch_configure.diff (rev 0) +++ trunk/dports/devel/orc/files/patch_configure.diff 2010-08-25 13:25:27 UTC (rev 70897) @@ -0,0 +1,30 @@ +--- configure_orig 2010-08-25 09:05:52.000000000 -0400 ++++ configure 2010-08-25 09:05:26.000000000 -0400 +@@ -12715,6 +12715,27 @@ + fi + done + ++for ac_func in posix_memalign ++do : ++ ac_fn_c_check_func "$LINENO" "posix_memalign" "ac_cv_func_posix_memalign" ++if test "x$ac_cv_func_posix_memalign" = x""yes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_POSIX_MEMALIGN 1 ++_ACEOF ++ ++fi ++done ++ ++for ac_func in valloc ++do : ++ ac_fn_c_check_func "$LINENO" "valloc" "ac_cv_func_valloc" ++if test "x$ac_cv_func_valloc" = x""yes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_VALLOC 1 ++_ACEOF ++ ++fi ++done + + LIBM= + case $host in Added: trunk/dports/devel/orc/files/patch_orc-test_orcarray.c.diff =================================================================== --- trunk/dports/devel/orc/files/patch_orc-test_orcarray.c.diff (rev 0) +++ trunk/dports/devel/orc/files/patch_orc-test_orcarray.c.diff 2010-08-25 13:25:27 UTC (rev 70897) @@ -0,0 +1,25 @@ +--- orc-test/orcarray.c.orig 2010-08-25 09:19:38.000000000 -0400 ++++ orc-test/orcarray.c 2010-08-25 09:20:08.000000000 -0400 +@@ -1,3 +1,6 @@ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif + + #include <orc-test/orctest.h> + #include <orc-test/orcarray.h> +@@ -39,8 +42,15 @@ + ar->stride = (ar->stride + (ALIGNMENT-1)) & (~(ALIGNMENT-1)); + ar->alloc_len = ar->stride * (m+2*EXTEND_ROWS) + (ALIGNMENT * element_size); + ++#if defined (HAVE_POSIX_MEMALIGN) + ret = posix_memalign (&data, ALIGNMENT, ar->alloc_len); + ar->alloc_data = data; ++#elif defined (HAVE_VALLOC) ++ /* wasteful alignment to PAGESIZE instead of 64, but it should work */ ++ ar->alloc_data = valloc (ar->alloc_len); ++#else ++ #error "No way to allocate aligned memory." ++#endif + + ar->data = ORC_PTR_OFFSET (ar->alloc_data, + ar->stride * EXTEND_ROWS + element_size * misalignment);
participants (1)
-
michaelld@macports.org