Changeset 1982


Ignore:
Timestamp:
Oct 7, 2012, 11:25:50 AM (5 years ago)
Author:
sam
Message:

build: put the OpenGL detection code in a separate .m4 file and assume
that the OpenGL framework on OS X provides GL version 2 at least.

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/.gitignore

    r1847 r1982  
    1919Makefile.in
    2020aclocal.m4
     21build/autotools/m4/libtool.m4
     22build/autotools/m4/ltoptions.m4
     23build/autotools/m4/ltsugar.m4
     24build/autotools/m4/ltversion.m4
     25build/autotools/m4/lt~obsolete.m4
    2126autom4te.cache
    2227config.h.in
  • trunk/Makefile.am

    r1923 r1982  
    88EXTRA_DIST = bootstrap TODO
    99AUTOMAKE_OPTIONS = dist-bzip2
     10ACLOCAL_AMFLAGS = -I build/autotools/m4
    1011
    1112check: lolcheck
  • trunk/bootstrap

    r1523 r1982  
    120120    mkdir "$auxdir"
    121121  fi
    122   aclocalflags="${aclocalflags} -I $auxdir -I ."
     122  aclocalflags="-I $auxdir -I . ${aclocalflags}"
    123123fi
    124124
     
    129129for x in $tmp; do
    130130  if test -n "$x"; then
    131     aclocalflags="${aclocalflags} -I $x"
     131    aclocalflags="-I $x ${aclocalflags}"
    132132  fi
    133133done
  • trunk/configure.ac

    r1981 r1982  
    153153#AM_CONDITIONAL(USE_D3D9, test "${ac_cv_my_have_d3d9}" != "no")
    154154
    155 
    156 dnl  Find which version of OpenGL to use
    157 ac_cv_my_have_gl="no"
    158 ac_cv_my_stop_looking_for_gl="no"
    159 
    160 if test "x${ac_cv_my_stop_looking_for_gl}" = "xno"; then
    161   LIBS_save="$LIBS"
    162   LIBS="$LIBS -Wl,-framework -Wl,OpenGL"
    163   AC_MSG_CHECKING(for -framework OpenGL)
    164   AC_TRY_LINK([], [],
    165    [AC_MSG_RESULT(yes)
    166     GL_LIBS="${GL_LIBS} -framework OpenGL"
    167     CXXFLAGS="${CXXFLAGS} -ObjC++"],
    168    [AC_MSG_RESULT(no)])
    169   LIBS="$LIBS_save"
    170 fi
    171 
    172 dnl  Use the Raspberry Pi libraries?
    173 if test "x${ac_cv_my_stop_looking_for_gl}" = "xno"; then
    174   AC_CHECK_HEADERS(bcm_host.h,
    175    [AC_CHECK_LIB(vcos, main,
    176      [ac_cv_my_have_gl="yes"
    177       ac_cv_my_stop_looking_for_gl="yes"
    178       AC_DEFINE(HAVE_GLES_2X, 1, Define to 1 if GLES 2.x is available)
    179       dnl  FIXME: -lEGL does not belong here but the configure test fails
    180       dnl  when cross-compiling, so we add it manually here.
    181       GL_LIBS="${GL_LIBS} -lGLESv2 -lEGL -lvcos -lvchiq_arm -lbcm_host"])])
    182 fi
    183 
    184 dnl  Use the PS3 PSGL?
    185 if test "x${ac_cv_my_stop_looking_for_gl}" = "xno"; then
    186   AC_CHECK_HEADERS(PSGL/psgl.h,
    187    [ac_cv_my_have_gl="yes"
    188     ac_cv_my_stop_looking_for_gl="yes"])
    189 fi
    190 
    191 if test "x${ac_cv_my_stop_looking_for_gl}" = "xno"; then
    192   PKG_CHECK_MODULES(GLES2, glesv2,
    193    [ac_cv_my_have_gl="yes"
    194     AC_DEFINE(HAVE_GLES_2X, 1, Define to 1 if GLES 2.x is available)
    195     GL_CFLAGS="${GL_CFLAGS} ${GLES2_CFLAGS}"
    196     GL_LIBS="${GL_LIBS} ${GLES2_LIBS}"],
    197    [:])
    198 fi
    199 
    200 if test "x${ac_cv_my_stop_looking_for_gl}" = "xno"; then
    201   AC_CHECK_HEADER(GLES2/gl2.h,
    202    [ac_cv_my_have_gl="yes"
    203     AC_DEFINE(HAVE_GLES_2X, 1, Define to 1 if GLES 2.x is available)
    204     AC_CHECK_LIB(GLESv2, glEnable,
    205      [GL_LIBS="${GL_LIBS} -lGLESv2"])])
    206 fi
    207 
    208 if test "x${ac_cv_my_stop_looking_for_gl}" = "xno"; then
    209   PKG_CHECK_MODULES(GL, gl,
    210    [ac_cv_my_have_gl="yes"
    211     AC_DEFINE(HAVE_GL_2X, 1, Define to 1 if GL 2.x is available)],
    212    [:])
    213 fi
    214 
    215 if test "x${ac_cv_my_stop_looking_for_gl}" = "xno"; then
    216   AC_CHECK_LIB(GL, glEnable,
    217    [ac_cv_my_have_gl="yes"
    218     AC_DEFINE(HAVE_GL_2X, 1, Define to 1 if GL 2.x is available) # FIXME: hackish
    219     GL_LIBS="-lGL"])
    220 fi
    221 
    222 if test "x${ac_cv_my_stop_looking_for_gl}" = "xno"; then
    223   AC_CHECK_HEADER(GL/gl.h,
    224    [LIBS_save="$LIBS"
    225     LIBS="$LIBS -lopengl32"
    226     AC_MSG_CHECKING(for glLoadIdentity in -lopengl32)
    227     AC_TRY_LINK([#include <GL/gl.h>],
    228      [glLoadIdentity();],
    229      [ac_cv_my_have_gl="yes"
    230       AC_DEFINE(HAVE_GL_2X, 1, Define to 1 if GL 2.x is available) # FIXME: hack
    231       AC_MSG_RESULT(yes)
    232       GL_LIBS="-lopengl32"],
    233      [AC_MSG_RESULT(no)])
    234     LIBS="$LIBS_save"])
    235 fi
    236 
    237 if test "${ac_cv_my_have_gl}" = "no"; then
    238   AC_MSG_ERROR([[No OpenGL or OpenGL ES implementation found]])
    239 fi
    240 
    241 
    242 dnl Use Glew?
    243 ac_cv_my_have_glew="no"
    244 PKG_CHECK_MODULES(GLEW, glew,
    245  [ac_cv_my_have_glew="yes"
    246   GL_CFLAGS="${GLEW_CFLAGS} ${GL_CFLAGS}"
    247   GL_LIBS="${GLEW_LIBS} ${GL_LIBS}"],
    248  [:])
    249 AC_CHECK_HEADER(glew.h,
    250  [LIBS_save="${LIBS}"
    251   LIBS="${LIBS} -lglew32 ${GL_LIBS}"
    252   AC_MSG_CHECKING(for glewInit in -lglew32)
    253   AC_TRY_LINK(
    254    [#include <glew.h>],
    255    [glewInit();],
    256    [ac_cv_my_have_glew="yes"
    257     GL_LIBS="-lglew32 ${GL_LIBS}"
    258     AC_MSG_RESULT(yes)],
    259    [AC_MSG_RESULT(no)])
    260   LIBS="${LIBS_save}"])
    261 if test "${ac_cv_my_have_glew}" != "no"; then
    262   AC_DEFINE(HAVE_GLES_2X, 1, Define to 1 if GLES 2.x is available)
    263   AC_DEFINE(USE_GLEW, 1, Define to 1 to use libglew)
    264 fi
    265 AM_CONDITIONAL(USE_GLEW, test "${ac_cv_my_have_glew}" != "no")
    266 
    267 dnl Poor man's GL feature detection if all else failed.
    268 save_LIBS="${LIBS}"
    269 LIBS="${LIBS} ${GL_LIBS} ${GLES2_LIBS}"
    270 AC_CHECK_FUNCS(glBegin)
    271 LIBS="${save_LIBS}"
     155LOL_CHECK_OPENGL()
    272156
    273157
Note: See TracChangeset for help on using the changeset viewer.