summaryrefslogtreecommitdiff
path: root/legacy/evas/m4/evas_check_engine.m4
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2010-10-26 23:31:58 +0000
committerCarsten Haitzler <raster@rasterman.com>2010-10-26 23:31:58 +0000
commit555d85033c67ec10a54dc26edef19715600fb24a (patch)
tree1129a074367c91237fe3c4c431861ef86ade4da2 /legacy/evas/m4/evas_check_engine.m4
parentc5661c44714908e055254ff8d45eeb074b4ae549 (diff)
more complete gl auto-checking in configure.ac
SVN revision: 53905
Diffstat (limited to '')
-rw-r--r--legacy/evas/m4/evas_check_engine.m495
1 files changed, 78 insertions, 17 deletions
diff --git a/legacy/evas/m4/evas_check_engine.m4 b/legacy/evas/m4/evas_check_engine.m4
index 54ce5d2211..9e62a6557f 100644
--- a/legacy/evas/m4/evas_check_engine.m4
+++ b/legacy/evas/m4/evas_check_engine.m4
@@ -125,16 +125,37 @@ evas_engine_[]$1[]_libs=""
125AC_PATH_X 125AC_PATH_X
126AC_PATH_XTRA 126AC_PATH_XTRA
127 127
128AC_CHECK_HEADERS([GL/gl.h GL/glx.h X11/X.h], 128AC_CHECK_HEADER([stdio.h],
129 [have_dep="yes"], 129 [have_dep="yes"],
130 [have_dep="no"]) 130 [have_dep="no"],
131 [
132#include <GL/gl.h>
133#include <GL/glext.h>
134#include <GL/glx.h>
135#include <X11/Xlib.h>
136#include <X11/Xatom.h>
137#include <X11/Xutil.h>
138#include <X11/extensions/Xrender.h>
139#include <X11/Xresource.h>
140 ])
141
142gl_pt_lib="";
143have_gl_pt="no"
144AC_CHECK_LIB([pthread], [pthread_create], [have_gl_pt="yes"], [have_gl_pt="no"])
145if test "x$have_gl_pt" = "xyes" ; then
146 gl_pt_lib=" -lpthread"
147fi
131 148
132if test "x${have_dep}" = "xyes" ; then 149if test "x${have_dep}" = "xyes" ; then
133 AC_CHECK_LIB([X11], [XCreateColormap], [have_dep="yes"], [have_dep="no"]) 150 AC_CHECK_LIB([X11], [XCreateColormap], [have_dep="yes"], [have_dep="no"])
134fi 151fi
135 152
136if test "x${have_dep}" = "xyes" ; then 153if test "x${have_dep}" = "xyes" ; then
137 AC_CHECK_LIB([GL], [glXCreateContext], [have_dep="yes"], [have_dep="no"]) 154 AC_CHECK_LIB([Xrender], [XRenderCreatePicture], [have_dep="yes"], [have_dep="no"])
155fi
156
157if test "x${have_dep}" = "xyes" ; then
158 AC_CHECK_LIB([GL], [glXCreateContext], [have_dep="yes"], [have_dep="no"], -lX11 -lXext -lXrender -lm $gl_pt_lib)
138fi 159fi
139 160
140if test "x$gl_flavor_gles" = "xyes" ; then 161if test "x$gl_flavor_gles" = "xyes" ; then
@@ -150,8 +171,8 @@ if test "x${have_dep}" = "xyes" ; then
150 x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext -lXrender" 171 x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext -lXrender"
151 fi 172 fi
152 evas_engine_[]$1[]_cflags="-I/usr/include ${x_cflags}" 173 evas_engine_[]$1[]_cflags="-I/usr/include ${x_cflags}"
153 evas_engine_[]$1[]_libs="${x_libs} -lGL -lpthread" 174 evas_engine_[]$1[]_libs="${x_libs} -lGL $gl_pt_lib"
154 evas_engine_gl_common_libs="-lGL -lpthread" 175 evas_engine_gl_common_libs="-lGL $gl_pt_lib"
155else 176else
156 if test "x$2" = "xyes" ; then 177 if test "x$2" = "xyes" ; then
157 x_libs="${x_libs} -lX11 -lXext -lXrender" 178 x_libs="${x_libs} -lX11 -lXext -lXrender"
@@ -160,14 +181,29 @@ else
160 x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}} 181 x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}}
161 x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext -lXrender" 182 x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext -lXrender"
162 fi 183 fi
163 AC_CHECK_HEADERS([EGL/egl.h X11/X.h X11/Xlib.h X11/extensions/Xrender.h], [have_egl="yes"]) 184 AC_CHECK_HEADER([stdio.h],
185 [have_egl="yes"],
186 [have_egl="no"],
187 [
188#include <GLES2/gl2.h>
189#include <GLES2/gl2ext.h>
190#include <EGL/egl.h>
191#include <X11/Xlib.h>
192#include <X11/Xatom.h>
193#include <X11/Xutil.h>
194#include <X11/extensions/Xrender.h>
195#include <X11/Xresource.h>
196 ])
164 if test "x${have_egl}" = "xyes" ; then 197 if test "x${have_egl}" = "xyes" ; then
165 AC_CHECK_LIB(GLESv2, glTexImage2D, [have_glesv2="yes"], , -lEGL ${x_libs} -lpthread -lm) 198 AC_CHECK_LIB(GLESv2, glTexImage2D, [have_glesv2="yes"], , -lEGL ${x_libs} -lm $gl_pt_lib)
166 if test "x${have_glesv2}" = "xyes" ; then 199 if test "x${have_glesv2}" = "xyes" ; then
167 evas_engine_[]$1[]_cflags="${x_cflags}" 200 evas_engine_[]$1[]_cflags="${x_cflags}"
168 evas_engine_[]$1[]_libs="${x_libs} -lGLESv2 -lpthread -lm -lEGL" 201 evas_engine_[]$1[]_libs="${x_libs} -lGLESv2 -lEGL -lm $gl_pt_lib"
169 evas_engine_gl_common_libs="-lGLESv2 -lpthread -lm" 202 evas_engine_gl_common_libs="-lGLESv2 -lm $gl_pt_lib"
170 have_dep="yes" 203 have_dep="yes"
204 gl_flavor_gles="no"
205 AC_DEFINE(GLES_VARIETY_SGX, 1, [Imagination SGX GLES2 support])
206 gles_variety_sgx="yes"
171 fi 207 fi
172 fi 208 fi
173fi 209fi
@@ -510,9 +546,20 @@ PKG_CHECK_MODULES([SDL],
510 ] 546 ]
511) 547)
512 548
513AC_CHECK_HEADERS([GL/gl.h], 549gl_pt_lib="";
550have_gl_pt="no"
551AC_CHECK_LIB([pthread], [pthread_create], [have_gl_pt="yes"], [have_gl_pt="no"])
552if test "x$have_gl_pt" = "xyes" ; then
553 gl_pt_lib=" -lpthread"
554fi
555
556AC_CHECK_HEADER([stdio.h],
514 [have_dep="yes"], 557 [have_dep="yes"],
515 [have_dep="no"]) 558 [have_dep="no"],
559 [
560#include <GL/gl.h>
561#include <GL/glext.h>
562 ])
516 563
517if test "x$gl_flavor_gles" = "xyes" ; then 564if test "x$gl_flavor_gles" = "xyes" ; then
518 have_dep=no 565 have_dep=no
@@ -520,17 +567,31 @@ fi
520 567
521if test "x${have_dep}" = "xyes" ; then 568if test "x${have_dep}" = "xyes" ; then
522 evas_engine_[]$1[]_cflags="${SDL_CFLAGS}" 569 evas_engine_[]$1[]_cflags="${SDL_CFLAGS}"
523 evas_engine_[]$1[]_libs="${SDL_LIBS} -lGL -lpthread" 570 evas_engine_[]$1[]_libs="${SDL_LIBS} -lGL -lm $gl_pt_lib"
524 evas_engine_gl_common_libs="-lGL -lpthread" 571 evas_engine_gl_common_libs="-lGL -lm $gl_pt_lib"
525else 572else
526 AC_CHECK_HEADERS([SDL/SDL_opengles.h EGL/egl.h], [have_egl="yes"]) 573 AC_CHECK_HEADER([stdio.h],
574 [have_egl="yes"],
575 [have_egl="no"],
576 [
577#include <SDL/SDL_opengles.h>
578#include <EGL/egl.h>
579#include <X11/Xlib.h>
580#include <X11/Xatom.h>
581#include <X11/Xutil.h>
582#include <X11/extensions/Xrender.h>
583#include <X11/Xresource.h>
584 ])
527 if test "x${have_egl}" = "xyes" ; then 585 if test "x${have_egl}" = "xyes" ; then
528 AC_CHECK_LIB(GLESv2, glTexImage2D, [have_glesv2="yes"], , -lEGL -lpthread -lm) 586 AC_CHECK_LIB(GLESv2, glTexImage2D, [have_glesv2="yes"], , -lEGL -lm $gl_pt_lib)
529 if test "x${have_glesv2}" = "xyes" ; then 587 if test "x${have_glesv2}" = "xyes" ; then
530 evas_engine_[]$1[]_cflags="${SDL_CFLAGS}" 588 evas_engine_[]$1[]_cflags="${SDL_CFLAGS}"
531 evas_engine_[]$1[]_libs="${SDL_LIBS} -lGLESv2 -lpthread -lm -lEGL" 589 evas_engine_[]$1[]_libs="${SDL_LIBS} -lGLESv2 -lEGL -lm $gl_pt_lib"
532 evas_engine_gl_common_libs="-lGLESv2 -lpthread -lm" 590 evas_engine_gl_common_libs="-lGLESv2 -lm $gl_pt_lib"
533 have_dep="yes" 591 have_dep="yes"
592 gl_flavor_gles="no"
593 AC_DEFINE(GLES_VARIETY_SGX, 1, [Imagination SGX GLES2 support])
594 gles_variety_sgx="yes"
534 fi 595 fi
535 fi 596 fi
536fi 597fi