diff --git a/configure.ac b/configure.ac index 8880089ae3..27a6411cb8 100644 --- a/configure.ac +++ b/configure.ac @@ -1805,6 +1805,28 @@ else evas_engine_gl_common_libs="-lGL" fi +# The lines below fix compiling/linking of gl_generic on OSX +if test "x${have_darwin}" = "xyes"; then + if test "x${have_evas_engine_gl_cocoa}" = "xyes"; then + # If gl_cocoa is enabled, Apple's Core OpenGL (CGL) should be the default OpenGL. + # CFLAGS and LIBS are determined by evas-gl_cocoa. + evas_engine_gl_common_libs="${evas_engine_gl_cocoa_libs}" + evas_engine_gl_common_cflags="${evas_engine_gl_cocoa_cflags}" + else + # If evas-gl_cocoa is disabled, the only supported OpenGL engine on OSX (for now) + # is evas-gl_x11. Without its CFLAGS and LIBS explicitely set, gl_generic + # cannot compile (nor link). + evas_engine_gl_common_libs="" + evas_engine_gl_common_cflags="" + + if test "x${have_evas_engine_gl_xlib}" = "xyes"; then + evas_engine_gl_common_libs="${evas_engine_gl_xlib_libs}" + evas_engine_gl_common_cflags="${evas_engine_gl_xlib_cflags}" + fi + ### XXX Check for other supported engines supported on OSX (dec. 2014: NONE) + fi +fi + AC_SUBST([evas_engine_gl_common_cflags]) AC_SUBST([evas_engine_gl_common_libs]) diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index 9e67eacb8d..a625ec67e8 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -711,6 +711,7 @@ modules_evas_engines_gl_generic_module_la_CFLAGS = \ -I$(top_srcdir)/src/lib/evas/include \ -I$(top_srcdir)/src/lib/evas/cserve2 \ -I$(top_srcdir)/src/modules/evas/engines/gl_common \ +@evas_engine_gl_common_cflags@ \ @EVAS_CFLAGS@ modules_evas_engines_gl_generic_module_la_LIBADD = \ modules/evas/engines/gl_common/libevas_engine_gl_common.la \