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 #define MIN_PLIB_VERSION 185
int main() { int main() {
int major, minor, micro;
if ( PLIB_VERSION < MIN_PLIB_VERSION ) { if ( PLIB_VERSION < MIN_PLIB_VERSION ) {
return -1; return -1;
} }
@ -617,7 +615,7 @@ save_CPPFLAGS=$CPPFLAGS
LIBS="" LIBS=""
CPPFLAGS="-I/usr/include/subversion-1 `apr-1-config --includes`" CPPFLAGS="-I/usr/include/subversion-1 `apr-1-config --includes`"
AC_CHECK_LIB(svn_client-1, svn_client_checkout3) 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 if test "x$ac_cv_header_svn_client_h" != "xyes"; then
echo "TerraSync will shell out for command line subversion" echo "TerraSync will shell out for command line subversion"
svn_LIBS="" svn_LIBS=""

View file

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

View file

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