1
0
Fork 0

test for the presence of alut.h. if it's not found only display a warning message in gl-info and test-env-map. A clean build without glut installed is now possible.

This commit is contained in:
ehofman 2009-09-08 17:07:31 +00:00 committed by Tim Moore
parent 10611c1522
commit 7e07b57d92
3 changed files with 19 additions and 6 deletions

View file

@ -487,8 +487,6 @@ AC_TRY_RUN([
#define MIN_PLIB_VERSION 185
int main() {
int major, minor, micro;
if ( PLIB_VERSION < MIN_PLIB_VERSION ) {
return -1;
}
@ -617,7 +615,7 @@ save_CPPFLAGS=$CPPFLAGS
LIBS=""
CPPFLAGS="-I/usr/include/subversion-1 `apr-1-config --includes`"
AC_CHECK_LIB(svn_client-1, svn_client_checkout3)
AC_CHECK_HEADERS([svn_client.h])
AC_CHECK_HEADERS([svn_client.h glut.h])
if test "x$ac_cv_header_svn_client_h" != "xyes"; then
echo "TerraSync will shell out for command line subversion"
svn_LIBS=""

View file

@ -24,8 +24,10 @@ Date: Fri, 24 Apr 1998 07:33:51 -0800
# include <GLUT/glut.h>
#else
# include <GL/gl.h>
# ifdef HAVE_GLUT_H
# include <GL/glut.h>
# endif
#endif
void getPrints ( GLenum token, char *string )
@ -63,6 +65,7 @@ void getPrinti ( GLenum token, char *string )
int main ( int argc, char **argv )
{
#ifdef HAVE_GLUT_H
glutInit ( &argc, argv ) ;
glutInitDisplayMode ( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ) ;
glutCreateWindow ( "You should never see this window!" ) ;
@ -111,6 +114,10 @@ int main ( int argc, char **argv )
getPrinti( GL_UNPACK_SKIP_ROWS , "GL_UNPACK_SKIP_ROWS" ) ;
getPrinti( GL_BLEND_SRC , "GL_BLEND_SRC" ) ;
getPrinti( GL_BLEND_DST , "GL_BLEND_DST" ) ;
#else
printf("GL Utility Toolkit (glut) was not found on this system.\n");
#endif
return 0 ;
}

View file

@ -16,13 +16,15 @@
# include <GLUT/glut.h>
#else
# include <GL/gl.h>
# ifdef HAVE_GLUT_H
# include <GL/glut.h>
# endif
#endif
#define TEXRES_X 256
#define TEXRES_Y 256
#ifdef HAVE_GLUT_H
unsigned char env_map[TEXRES_X][TEXRES_Y][4];
GLuint texName;
int window_x = 640, window_y = 480;
@ -248,9 +250,11 @@ void keyboard (unsigned char key, int x, int y)
break;
}
}
#endif /* HAVE_GLUT_H */
int main(int argc, char** argv)
{
#ifdef HAVE_GLUT_H
glutInitWindowSize(window_x, window_y);
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
@ -261,6 +265,10 @@ int main(int argc, char** argv)
glutKeyboardFunc(keyboard);
glutMainLoop();
#else
printf("GL Utility Toolkit (glut) was not found on this system.\n");
#endif
return 0;
}