[BACK]Return to patch-CMakeLists.txt CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / graphics / openjpeg / patches

File: [cvs.NetBSD.org] / pkgsrc / graphics / openjpeg / patches / patch-CMakeLists.txt (download)

Revision 1.1, Fri Jan 23 17:15:09 2015 UTC (7 years ago) by pho
Branch: MAIN
CVS Tags: pkgsrc-2021Q4-base, pkgsrc-2021Q4, pkgsrc-2021Q3-base, pkgsrc-2021Q3, pkgsrc-2021Q2-base, pkgsrc-2021Q2, pkgsrc-2021Q1-base, pkgsrc-2021Q1, pkgsrc-2020Q4-base, pkgsrc-2020Q4, pkgsrc-2020Q3-base, pkgsrc-2020Q3, pkgsrc-2020Q2-base, pkgsrc-2020Q2, pkgsrc-2020Q1-base, pkgsrc-2020Q1, pkgsrc-2019Q4-base, pkgsrc-2019Q4, pkgsrc-2019Q3-base, pkgsrc-2019Q3, pkgsrc-2019Q2-base, pkgsrc-2019Q2, pkgsrc-2019Q1-base, pkgsrc-2019Q1, pkgsrc-2018Q4-base, pkgsrc-2018Q4, pkgsrc-2018Q3-base, pkgsrc-2018Q3, pkgsrc-2018Q2-base, pkgsrc-2018Q2, pkgsrc-2018Q1-base, pkgsrc-2018Q1, pkgsrc-2017Q4-base, pkgsrc-2017Q4, pkgsrc-2017Q3-base, pkgsrc-2017Q3, pkgsrc-2017Q2-base, pkgsrc-2017Q2, pkgsrc-2017Q1-base, pkgsrc-2017Q1, pkgsrc-2016Q4-base, pkgsrc-2016Q4, pkgsrc-2016Q3-base, pkgsrc-2016Q3, pkgsrc-2016Q2-base, pkgsrc-2016Q2, pkgsrc-2016Q1-base, pkgsrc-2016Q1, pkgsrc-2015Q4-base, pkgsrc-2015Q4, pkgsrc-2015Q3-base, pkgsrc-2015Q3, pkgsrc-2015Q2-base, pkgsrc-2015Q2, pkgsrc-2015Q1-base, pkgsrc-2015Q1, HEAD

Check for aligned memory functions with cmake

Not all platforms have posix_memalign(3) so we need to check if it
exists. This fixes build failure on Darwin 9. See:
https://www.gnu.org/software/gnulib/manual/html_node/posix_005fmemalign.html

$NetBSD: patch-CMakeLists.txt,v 1.1 2015/01/23 17:15:09 pho Exp $

Move checks for aligned malloc function from opj_malloc.h to cmake.
See also patch-aa

--- CMakeLists.txt.orig	2015-01-23 16:40:21.000000000 +0000
+++ CMakeLists.txt
@@ -213,6 +213,12 @@ CHECK_INCLUDE_FILE("sys/stat.h"     HAVE
 CHECK_INCLUDE_FILE("sys/types.h"    HAVE_SYS_TYPES_H)
 CHECK_INCLUDE_FILE("unistd.h"       HAVE_UNISTD_H)
 
+# Check for functions
+include (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake)
+CHECK_SYMBOL_EXISTS(_mm_malloc     "malloc.h" HAVE_MM_MALLOC     )
+CHECK_SYMBOL_EXISTS(memalign       "malloc.h" HAVE_MEMALIGN      )
+CHECK_SYMBOL_EXISTS(posix_memalign "stdlib.h" HAVE_POSIX_MEMALIGN)
+
 # Enable Large file support
 include(TestLargeFiles)
 OPJ_TEST_LARGE_FILES(OPJ_HAVE_LARGEFILES)