summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean.guyomarch@gmail.com>2014-12-03 09:45:51 +0100
committerCedric BAIL <cedric@osg.samsung.com>2014-12-03 09:58:02 +0100
commit682d7fab54f763212cd40c0ad0b24dba1717ce7f (patch)
tree96d66aafd4a9a3f1114ae9e126ceb25df4dfd2fe
parentb1f8f3fb17ec37c4ddb817d766051eb8fe9d72e1 (diff)
autotools: fix compiling/linking gl engines on OSX.
Summary: Until now, it was necessary to set global LDFLAGS and CFLAGS to allow compiling (and linking) engines using OpenGL. gl_generic used to complained about missing headers or unkown libraries. A problem on OSX is that there is CGL (Apple's Core OpenGL) on which the whole system relies on and GLX, when X11 is installed; and they cohabit together. When gl_cocoa is enabled, gl_generic is now linked against CGL. When it is not, gl_generic is compiled with and linked against GLX as a fallback. @fix Test Plan: With --enable-cocoa: software_x11, opengl_x11 and opengl_cocoa are working as expected. With --disable-cocoa: software_x11 and opengl_x11 are also working as expected. No compiling nor linking problems have been issued. Reviewers: cedric, raster, raoulh Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1723 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--configure.ac22
-rw-r--r--src/Makefile_Evas.am1
2 files changed, 23 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 8880089..27a6411 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1805,6 +1805,28 @@ else
1805 evas_engine_gl_common_libs="-lGL" 1805 evas_engine_gl_common_libs="-lGL"
1806fi 1806fi
1807 1807
1808# The lines below fix compiling/linking of gl_generic on OSX
1809if test "x${have_darwin}" = "xyes"; then
1810 if test "x${have_evas_engine_gl_cocoa}" = "xyes"; then
1811 # If gl_cocoa is enabled, Apple's Core OpenGL (CGL) should be the default OpenGL.
1812 # CFLAGS and LIBS are determined by evas-gl_cocoa.
1813 evas_engine_gl_common_libs="${evas_engine_gl_cocoa_libs}"
1814 evas_engine_gl_common_cflags="${evas_engine_gl_cocoa_cflags}"
1815 else
1816 # If evas-gl_cocoa is disabled, the only supported OpenGL engine on OSX (for now)
1817 # is evas-gl_x11. Without its CFLAGS and LIBS explicitely set, gl_generic
1818 # cannot compile (nor link).
1819 evas_engine_gl_common_libs=""
1820 evas_engine_gl_common_cflags=""
1821
1822 if test "x${have_evas_engine_gl_xlib}" = "xyes"; then
1823 evas_engine_gl_common_libs="${evas_engine_gl_xlib_libs}"
1824 evas_engine_gl_common_cflags="${evas_engine_gl_xlib_cflags}"
1825 fi
1826 ### XXX Check for other supported engines supported on OSX (dec. 2014: NONE)
1827 fi
1828fi
1829
1808AC_SUBST([evas_engine_gl_common_cflags]) 1830AC_SUBST([evas_engine_gl_common_cflags])
1809AC_SUBST([evas_engine_gl_common_libs]) 1831AC_SUBST([evas_engine_gl_common_libs])
1810 1832
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index 9e67eac..a625ec6 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -711,6 +711,7 @@ modules_evas_engines_gl_generic_module_la_CFLAGS = \
711-I$(top_srcdir)/src/lib/evas/include \ 711-I$(top_srcdir)/src/lib/evas/include \
712-I$(top_srcdir)/src/lib/evas/cserve2 \ 712-I$(top_srcdir)/src/lib/evas/cserve2 \
713-I$(top_srcdir)/src/modules/evas/engines/gl_common \ 713-I$(top_srcdir)/src/modules/evas/engines/gl_common \
714@evas_engine_gl_common_cflags@ \
714@EVAS_CFLAGS@ 715@EVAS_CFLAGS@
715modules_evas_engines_gl_generic_module_la_LIBADD = \ 716modules_evas_engines_gl_generic_module_la_LIBADD = \
716modules/evas/engines/gl_common/libevas_engine_gl_common.la \ 717modules/evas/engines/gl_common/libevas_engine_gl_common.la \