From: Brian Aker Date: Fri, 27 Jul 2012 04:00:47 +0000 (-0700) Subject: Fixes for OSX Lion X-Git-Tag: 1.0.10~2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=303f0aafd224cdb5d27c717661c34eaf1eaf4cae;p=awesomized%2Flibmemcached Fixes for OSX Lion --- diff --git a/ChangeLog b/ChangeLog index 76edf62a..76285fa6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 1.0.10 * --disable-assert has been removed from configure, and --enable-assert has been added in its place. +* Compiling fixes for Clang on OSX Mountain Lion. 1.0.9 Wed Jul 4 22:46:19 EDT 2012 diff --git a/bootstrap.sh b/bootstrap.sh index 240f6ac0..109767bc 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -2,7 +2,12 @@ if test -f configure; then make clean; make merge-clean; make distclean; fi; -rm -r -f autom4te.cache +rm -r -f autom4te.cache/ config.h config.log config.status ./config/autorun.sh -./configure --enable-assert +if [ $(uname) = "Darwin" ]; +then + ./configure CC=clang CXX=clang++ --enable-assert +else + ./configure --enable-assert +fi make diff --git a/libmemcached-1.0/types.h b/libmemcached-1.0/types.h index dc61a819..53992d3a 100644 --- a/libmemcached-1.0/types.h +++ b/libmemcached-1.0/types.h @@ -40,7 +40,7 @@ #ifdef __cplusplus -namespace org { namespace libmemcached { class Instance; } } +namespace org { namespace libmemcached { struct Instance; } } struct memcached_st; struct memcached_stat_st; diff --git a/libmemcached/instance.h b/libmemcached/instance.h index 6a56aa4c..dc9e45ed 100644 --- a/libmemcached/instance.h +++ b/libmemcached/instance.h @@ -59,6 +59,7 @@ namespace org { namespace libmemcached { +// @todo Complete class transformation struct Instance { in_port_t port() const { diff --git a/libtest/server_container.cc b/libtest/server_container.cc index 0448e209..fa98c739 100644 --- a/libtest/server_container.cc +++ b/libtest/server_container.cc @@ -182,7 +182,7 @@ bool server_startup_st::validate() bool server_startup(server_startup_st& construct, const std::string& server_type, in_port_t try_port, int argc, const char *argv[], const bool opt_startup_message) { - construct.start_server(server_type, try_port, argc, argv, opt_startup_message); + return construct.start_server(server_type, try_port, argc, argv, opt_startup_message); } bool server_startup_st::start_server(const std::string& server_type, in_port_t try_port, int argc, const char *argv[], const bool opt_startup_message) diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4 index e20a388c..e0d54ad9 100644 --- a/m4/ax_pthread.m4 +++ b/m4/ax_pthread.m4 @@ -82,7 +82,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 17 +#serial 18 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ @@ -145,8 +145,8 @@ ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mt # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) -case "${host_cpu}-${host_os}" in - *solaris*) +case ${host_os} in + solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based @@ -159,7 +159,11 @@ case "${host_cpu}-${host_os}" in ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" ;; - *-darwin*) + darwin12*) + ax_pthread_flags="$ax_pthread_flags" + ;; + + darwin*) ax_pthread_flags="-pthread $ax_pthread_flags" ;; esac @@ -254,10 +258,10 @@ if test "x$ax_pthread_ok" = xyes; then AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no - case "${host_cpu}-${host_os}" in - *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; - *-osf* | *-hpux*) flag="-D_REENTRANT";; - *solaris*) + case ${host_os} in + aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; + osf* | hpux*) flag="-D_REENTRANT";; + solaris*) if test "$GCC" = "yes"; then flag="-D_REENTRANT" else diff --git a/m4/pandora_warnings.m4 b/m4/pandora_warnings.m4 index f3338131..d31965e0 100644 --- a/m4/pandora_warnings.m4 +++ b/m4/pandora_warnings.m4 @@ -98,7 +98,7 @@ AC_DEFUN([PANDORA_WARNINGS],[ AC_CACHE_CHECK([whether it is safe to use -floop-parallelize-all], [ac_cv_safe_to_use_floop_parallelize_all_], [save_CFLAGS="$CFLAGS" - CFLAGS="-floop-parallelize-all ${AM_CFLAGS} ${CFLAGS}" + CFLAGS="-Werror -floop-parallelize-all ${AM_CFLAGS} ${CFLAGS}" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([],[])], [ac_cv_safe_to_use_floop_parallelize_all_=yes],