You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by nn...@apache.org on 2014/03/14 20:34:43 UTC

git commit: Fixed build failure of Python-Egg on OS X and clang 3.4.

Repository: mesos
Updated Branches:
  refs/heads/master e49fc2d7b -> c51205fdb


Fixed build failure of Python-Egg on OS X and clang 3.4.

Workaround for incompatibility of clang 3.4 with build settings of
Apple's Python distribution. Adds PYTHON_CFLAGS and PYTHON_CPPFLAGS to
configuration phase. Those variables are pre-populated by the contents
of CFLAGS and CPPFLAGS. When clang is used for the compilation, the
-Qunused-arguments override is added to both variables to deescalate
possible errors caused by unknown commandline flags towards warnings,
thus allowing to build our Python egg with clang 3.4 (Xcode 5.1) and
Apple's default Python.

Review: https://reviews.apache.org/r/19068


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c51205fd
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c51205fd
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c51205fd

Branch: refs/heads/master
Commit: c51205fdb0b9f9aa27b1bf79f194435ea6867b23
Parents: e49fc2d
Author: Till Toenshoff <to...@me.com>
Authored: Fri Mar 14 11:28:17 2014 -0700
Committer: Niklas Q. Nielsen <ni...@mesosphere.io>
Committed: Fri Mar 14 11:28:17 2014 -0700

----------------------------------------------------------------------
 configure.ac    | 12 ++++++++++++
 src/Makefile.am |  3 ++-
 2 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/c51205fd/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index d111382..9a6de87 100644
--- a/configure.ac
+++ b/configure.ac
@@ -581,6 +581,18 @@ There are two possible workarounds for this issue:
                   [chmod +x src/examples/python/test-framework])
   AC_CONFIG_FILES([src/python/setup.py])
 
+  # When clang is being used, make sure that the distutils python-
+  # config cflags extraction does not cause build errors (MESOS-1079).
+  # TODO(tillt): Remove this once Apple distributed an updated Python.
+  PYTHON_CFLAGS="$CFLAGS"
+  PYTHON_CPPFLAGS="$CPPFLAGS"
+
+  AS_IF([test "x$CLANG" = "xyes"],
+	[PYTHON_CFLAGS="$PYTHON_CFLAGS -Qunused-arguments"
+	 PYTHON_CPPFLAGS="$PYTHON_CPPFLAGS -Qunused-arguments"])
+
+  AC_SUBST([PYTHON_CFLAGS])
+  AC_SUBST([PYTHON_CPPFLAGS])
   AC_SUBST([PYTHON_EGG_POSTFIX])
   AC_SUBST([PYTHON_EGG_PUREPY_POSTFIX])
   AC_SUBST([PYTHON]) # Used by the example shell scripts and src/Makefile.am.

http://git-wip-us.apache.org/repos/asf/mesos/blob/c51205fd/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index ce7913b..0775a0d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -794,7 +794,8 @@ $(MESOS_EGG): python/setup.py $(srcdir)/python/src/mesos.py		\
 	  cp -pf $(srcdir)/python/src/mesos.py python/src;		\
 	fi
 	@LIBS="$(LIBS)" CC="$(CC)" CXX="$(CXX)"				\
-	  PYTHONPATH=$(DISTRIBUTE_EGG) $(PYTHON) python/setup.py bdist_egg
+	CFLAGS="$(PYTHON_CFLAGS)" CPPFLAGS="$(PYTHON_CPPFLAGS)"		\
+	PYTHONPATH=$(DISTRIBUTE_EGG) $(PYTHON) python/setup.py bdist_egg
 
 CLEANFILES += $(MESOS_EGG) python/build/temp.*/native/*.o python/build/lib.*/*