MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:Chris Meyer Date:October 20 2000 5:20am
Subject:Re: building on Darwin/Mac OS X
View as plain text  
>I downloaded the 3.23.26 sources and they almost compile on Mac OS 
>X.  I only need to make two changes!
>1) in at line 1520 is:
>   #ifdef HAVE_MLOCKALL
>which conditionalizes mlockall(MCL_CURRENT).  But mlockall is not 
>available on Mac OS X.  All other uses of it are conditionalized 
>with #ifdef SUN_OS.   So, either HAVE_MLOCKALL is setup wrong or 
>that conditional should be changed to SUN_OS.
>2) in include/my_pthread.h at line 357:
>I had to remove the ampersand from the call to pthread_detach.   That is
>   #define pthread_detach_this_thread() { pthread_t 
>tmp=pthread_self() ; pthread_detach(&tmp); }
>   #define pthread_detach_this_thread() { pthread_t 
>tmp=pthread_self() ; pthread_detach(tmp); }

My patch is nearly the same, but enabled the code to mysqld to work 
properly -- also takes out a questionable pthread #define.  It seems 
to me that mlockall IS available, but 'MCL_CURRENT' is undefined 
unless _P1003_1B_VISIBLE is defined.

Can the mysql folks determine whether mlockall should be used ONLY on SUN_OS?

The patch is as follows:

diff -ru mysql-3.23.26-beta/ mysql-3.23.26-beta-darwin/
--- mysql-3.23.26-beta/ Tue Oct 17 13:59:31 2000
+++ mysql-3.23.26-beta-darwin/  Wed Oct 18 13:55:02 2000
@@ -685,8 +685,8 @@
      if test "$ac_cv_prog_gcc" = "yes"
-      CFLAGS="$CFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS"
+      CFLAGS="$CFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS 
diff -ru mysql-3.23.26-beta/include/my_pthread.h 
--- mysql-3.23.26-beta/include/my_pthread.h Tue Oct 17 13:59:30 2000
+++ mysql-3.23.26-beta-darwin/include/my_pthread.h  Wed Oct 18 13:55:44 2000
@@ -351,10 +351,9 @@
  #define pthread_kill(A,B) pthread_dummy(0)
  #define pthread_condattr_init(A) pthread_dummy(0)
  #define pthread_condattr_destroy(A) pthread_dummy(0)
-#define pthread_cond_init( A, B ) pthread_cond_init( (A), 0 )
  #define pthread_signal(A,B) pthread_dummy(0)
  #undef pthread_detach_this_thread
-#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() 
; pthread_\
detach(&tmp); }
+#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() 
; pthread_\
detach(tmp); }
  #undef sigset
  #define sigset(A,B) pthread_signal((A),(void (*)(int)) (B))
building on Darwin/Mac OS XNick Kledzik20 Oct
  • Re: building on Darwin/Mac OS XChris Meyer20 Oct