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