From 44db2406d3d71cb5882627581a7dee1c4acbe0a6 Mon Sep 17 00:00:00 2001 From: CharlieRoot Date: Tue, 19 Jul 2011 18:29:59 +0400 Subject: MySQL: Fix compilation on Lion Do not allow cmake find pthread_init because it is internal to Apple's pthread library although linkable. Fixes #5251 Fixes #5876 Fixes #6277 Signed-off-by: Adam Vandenberg --- Library/Formula/mysql.rb | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'Library/Formula/mysql.rb') diff --git a/Library/Formula/mysql.rb b/Library/Formula/mysql.rb index b7642b44b..162c76691 100644 --- a/Library/Formula/mysql.rb +++ b/Library/Formula/mysql.rb @@ -23,7 +23,11 @@ class Mysql < Formula ] end - def patches; DATA; end + # The CMAKE patches are so that on Lion we do not detect a private + # pthread_init function as linkable. + def patches + DATA + end def install # Make sure the var/msql directory exists @@ -173,3 +177,21 @@ index efc8254..8964b70 100644 do # The first option we might strip will always have a space before it because # we set -I$pkgincludedir as the first option +diff --git a/configure.cmake b/configure.cmake +index 0014c1d..21fe471 100644 +--- a/configure.cmake ++++ b/configure.cmake +@@ -391,7 +391,11 @@ CHECK_FUNCTION_EXISTS (pthread_attr_setscope HAVE_PTHREAD_ATTR_SETSCOPE) + CHECK_FUNCTION_EXISTS (pthread_attr_setstacksize HAVE_PTHREAD_ATTR_SETSTACKSIZE) + CHECK_FUNCTION_EXISTS (pthread_condattr_create HAVE_PTHREAD_CONDATTR_CREATE) + CHECK_FUNCTION_EXISTS (pthread_condattr_setclock HAVE_PTHREAD_CONDATTR_SETCLOCK) +-CHECK_FUNCTION_EXISTS (pthread_init HAVE_PTHREAD_INIT) ++ ++IF (NOT CMAKE_OSX_SYSROOT) ++ CHECK_FUNCTION_EXISTS (pthread_init HAVE_PTHREAD_INIT) ++ENDIF (NOT CMAKE_OSX_SYSROOT) ++ + CHECK_FUNCTION_EXISTS (pthread_key_delete HAVE_PTHREAD_KEY_DELETE) + CHECK_FUNCTION_EXISTS (pthread_rwlock_rdlock HAVE_PTHREAD_RWLOCK_RDLOCK) + CHECK_FUNCTION_EXISTS (pthread_sigmask HAVE_PTHREAD_SIGMASK) + -- cgit v1.2.3