From: Chris Meyer Date: October 20 2000 5:20am Subject: Re: building on Darwin/Mac OS X List-Archive: http://lists.mysql.com/internals/39 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" ; format="flowed" >I downloaded the 3.23.26 sources and they almost compile on Mac OS >X. I only need to make two changes! > >1) in mysqld.cc 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); } > >to: > > #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/configure.in mysql-3.23.26-beta-darwin/configure.in --- mysql-3.23.26-beta/configure.in Tue Oct 17 13:59:31 2000 +++ mysql-3.23.26-beta-darwin/configure.in Wed Oct 18 13:55:02 2000 @@ -685,8 +685,8 @@ *darwin*) if test "$ac_cv_prog_gcc" = "yes" then - CFLAGS="$CFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS" - CXXFLAGS="$CXXFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS" + CFLAGS="$CFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIB\ LE" + CXXFLAGS="$CXXFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_V\ ISIBLE" MAX_C_OPTIMIZE="-O" with_named_curses="" fi diff -ru mysql-3.23.26-beta/include/my_pthread.h mysql-3.23.26-beta-darwin/incl\ ude/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)) #endif