Thanks for your response but still does not work, I have left my code in configure.in: MDL_HAVE_OPENGL if test -z "$GL_LIBS" then AC_MSG_RESULT([GL libs not found, OpenGL disabled.]) else if test -z "$GL_CFLAGS" then AC_MSG_RESULT([GL headers not found, OpenGL disabled.]) else AC_MSG_RESULT([OpenGL flags: $GL_CFLAGS]) AC_MSG_RESULT([OpenGL libs: $GL_LIBS]) fi fi AM_CONDITIONAL( WITH_OPENGL, test -n "$GL_FLAGS") AM_CONDITIONAL( WITH_OPENGL, test -n "$GL_LIBS") and in my makefile.am: if WITH_OPENGL bin_PROGRAMS = phan3D endif but it does not work, I can not get it to compile conditionally. Please, can someone show me how to correct my code? Thanks Roman On Fri, 2004-02-06 at 10:38, Ralf Corsepius wrote: > On Fri, 2004-02-06 at 09:24, Jose Roman Bilbao wrote: > > Hi, > > > > What is wrong with this piece of code? It always says that there is no > > OpenGL although it has been found: > > > > #checking for OpenGL > > MDL_HAVE_OPENGL > > > > if test -z "$GL_LIBS" > > then > > AC_MSG_RESULT([GL libs not found, OpenGL disabled.]) > > else > > if test -z "$GL_CFLAGS" > > then > > AC_MSG_RESULT([GL headers not found, OpenGL disabled.]) > > else > > AC_MSG_RESULT([OpenGL flags: $GL_CFLAGS]) > > AC_MSG_RESULT([OpenGL libs: $GL_LIBS]) > > fi > > fi > > AM_CONDITIONAL( WITH_OPENGL, test -n "$GL_FLAGS") > > AM_CONDITIONAL( WITH_OPENGL, test -n "$GL_LIBS") > The WITH_OPENGL's in these AM_CONDITIONALS are strings autoconf > internally uses to set up its magic. > > > if test x"$WITH_OPENGL" = xtrue; then > Here, you expect WITH_OPENGL to be a shell variable. > > > AC_MSG_RESULT( OpenGL) > > else > > AC_MSG_RESULT( NO OpenGL ) > > fi > > > > I suppose it is my inexperience, I have read autoconf and automake > > manuals and still no solution. > Have a look into your configure and search for WITH_OPENGL. > > AFAIS, you are expecting WITH_OPENGL to be a shell-variable while > autoconf uses it as a string. > > > Another minor question. Why do we add "x" in: > > if test x"$WITH_OPENGL" = xtrue; then > > Cf. The "Limitations of Builtins" chapter in info autoconf > > Ralf > > > >