From 8f61f81ec21ae9f33c25472d5cd025ccd6004520 Mon Sep 17 00:00:00 2001 From: Deon Ramsey Date: Mon, 18 Feb 2002 21:36:19 +0000 Subject: [PATCH] Improved missing package recognition in Unix configure --- ChangeLog | 1 + INSTALL | 13 +++++--- acinclude.m4 | 4 ++- configure.in | 71 +++++++++++++++++++++++++++++++++------- devguide.txt | 4 +++ src/celestia/gtkmain.cpp | 2 +- 6 files changed, 76 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 74ac3b9cb..2c3a4b966 100644 --- a/ChangeLog +++ b/ChangeLog @@ -422,4 +422,5 @@ Code: * Fixed specular lighting for 3DS meshes, but correcting the mapping of 3DS shininess to OpenGL specular exponents. * Multi Resolution Texturing. (dramsey) +* Unix: Much improved recognition of missing packages in configure. (dramsey) diff --git a/INSTALL b/INSTALL index 9a8d8ed67..cdc5f42cb 100644 --- a/INSTALL +++ b/INSTALL @@ -2,9 +2,12 @@ Celestia Install instructions for UNIX -------------------------------------- You need to have the following components installed before Celestia -will build: OpenGL (tested with Mesa 3.4), glut, libjpeg, and libpng. +will build: OpenGL (tested with Mesa 3.4), glu, glut, libjpeg, and libpng. +Should you have a package based installation (most Linux distributions these +days are), you will also need to install the devel packages for your OpenGL, +glu, glut and glibc packages. -Then, assuming you've collected all the necessary libraries, here's +OK, assuming you've collected all the necessary libraries, here's what you need to do to build and run Celestia: configure @@ -24,7 +27,7 @@ depending in your Installation Distributions you may also need other packages containing various information needed by the build process, for instance, to build under SUSE Linux, you will also need to have the gtk-devel package installed, and having GNOME's devel packages present also is probably not -a bad idea. +a bad idea (in fact, currently absolutely necessary for the GTK version). Celestia will be installed into /usr/local by default, with data files landing in /usr/local/share/Celestia , but you may specify a new location with the @@ -35,6 +38,6 @@ in /usr/local/share/Celestia , but you may specify a new location with the All the other usual configure parameters apply; you may see which options are available using 'configure --help' -Chris Laurel -claurel@.shatters.net +Chris Laurel & Deon Ramsey +claurel@.shatters.net dramsey@users.sourceforge.net diff --git a/acinclude.m4 b/acinclude.m4 index 014e7ce7e..659523ec1 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -154,7 +154,9 @@ main () echo "*** full path to gtk-config. If you are running Linux or some-" echo "*** thing similar, you may need to install the gtk-devel package" echo "*** (or some other package with a similar name) in order to get" - echo "*** a working gtk-config." + echo "*** a working gtk-config. If in fact you don't have or want GTK," + echo "*** disregard this message. Note that configuring with" + echo "*** '--without-gtk' will turn off this check and message." else if test -f conf.gtktest ; then : diff --git a/configure.in b/configure.in index a892b06ae..6c97f620b 100644 --- a/configure.in +++ b/configure.in @@ -110,25 +110,44 @@ GTK_LIBS="" GTKGL_LIBS="" GTK_CFLAGS="" -AM_PATH_GTK(1.2.0,enable_gtk_default="yes",enable_gtk_default="no") -if test "$enable_gtk_default" == "yes" ; then - OLD_LIBS="$LIBS" - LIBS="$LIBS $GTK_LIBS -lGL" - AC_CHECK_LIB(gtkgl,gdk_gl_query,,enable_gtk_default="no") - LIBS="$OLD_LIBS" -fi - -AC_MSG_CHECKING([whether to use GTK.]) +AC_MSG_CHECKING([whether to disable GTK.]) AC_ARG_WITH(gtk, [ --with-gtk Use Gtk for an enhanced GUI], - enable_gtk="$withval", enable_gtk="$enable_gtk_default") -AC_MSG_RESULT($enable_gtk) + enable_gtk="$withval";enable_by_default="no", enable_gtk="yes";enable_by_default="yes") if test "$enable_gtk" == "yes" ; then + AC_MSG_RESULT(no, so try to find GTK) + AM_PATH_GTK(1.2.0,enable_gtk="yes",enable_gtk="no") + + dnl Complain only if the user insisted we do GTK + if test "$enable_by_default" == "no" -a "$enable_gtk" == "no"; then + AC_MSG_ERROR(Unable to find GTK) + fi +else + AC_MSG_RESULT(yes) +fi + +if test "$enable_gtk" == "yes" ; then + OLD_LIBS="$LIBS" + LIBS="$LIBS $GTK_LIBS -lGL" + AC_CHECK_LIB(gtkgl,gdk_gl_query,,enable_gtk="no") + + dnl Complain only if the user insisted we do GTK + if test "$enable_by_default" == "no" -a "$enable_gtk" == "no"; then + AC_MSG_ERROR(Unable to find gtkglarea) + fi +fi + +if test "$enable_gtk" == "yes" ; then + LIBS="$OLD_LIBS" GNOME_INIT GNOME_COMPILE_WARNINGS GNOME_X_CHECKS GTKGL_LIBS=-lgtkgl else + if test "$enable_by_default" == "yes" ; then + AC_MSG_WARN(Disabled GTK GUI because of missing necessary packages) + fi + dnl Check for X11. AC_PATH_XTRA @@ -143,6 +162,16 @@ CXXFLAGS="$CXXFLAGS $CELESTIAFLAGS $CELESTIA_CXXFLAGS $GTK_CFLAGS $GNOME_CFLAGS LIBS="$LIBS $CELESTIALIBS $GTK_LIBS $GNOME_LIBS $GNOMEUI_LIBS $GTKGL_LIBS" LDFLAGS="$LDFLAGS $GNOME_LIBDIR" +dnl Check for OpenGL headers first. +AC_CHECK_HEADERS(GL/gl.h,,AC_MSG_ERROR([[No gl.h found.\ + Usually, this means that you either have no OpenGL library on your system,\ + or if you are using a package based distribution, that you have failed to\ + install the corresponding development package for your library. If for\ + instance you have Mesa installed, you will also have to install the\ + mesa-devel package (or something named similarly). Also, if in fact it *WAS*\ + the devel package missing, make sure you have the devel packages for GLU and\ + GLUT installed as they will also be needed.]])) + dnl Check for OpenGL. Taken partly from the plib sources. AC_CHECK_LIB(GL,glNewList) @@ -152,6 +181,16 @@ if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then AC_MSG_ERROR(GL library was not found)) fi +dnl Check for GLU headers. +AC_CHECK_HEADERS(GL/glu.h,,AC_MSG_ERROR([[No glu.h found.\ + Usually, this means that you either have no GLU library on your system,\ + or if you are using a package based distribution, that you have failed to\ + install the corresponding development package for your library. If for\ + instance you have MesaGLU installed, you will also have to install the\ + mesaglu-devel package (or something named similarly). It is also possible\ + that you have the xf86glu package installed, in which case you'll need the\ + xf86glu-devel package or similar.]])) + AC_CHECK_LIB(GLU,gluLookAt) if test "x$ac_cv_lib_GLU_gluLookAt" = "xno"; then @@ -161,6 +200,14 @@ if test "x$ac_cv_lib_GLU_gluLookAt" = "xno"; then fi +dnl Check for GLUT headers first. +AC_CHECK_HEADERS(GL/glut.h,,AC_MSG_ERROR([[No glut.h found.\ + Usually, this means that you either have no GLUT library on your system,\ + or if you are using a package based distribution, that you have failed to\ + install the corresponding development package for your library. If for\ + instance you have Mesa installed, you will also have to install the\ + mesaglut-devel package (or something named similarly).]])) + dnl Check for GLUT. AC_CHECK_LIB(glut, glutKeyboardUpFunc,, AC_MSG_ERROR(GLUT library version >= 3.7 not found)) @@ -178,7 +225,7 @@ dnl Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS(GL/gl.h GL/glut.h) +#AC_CHECK_HEADERS(GL/gl.h GL/glut.h) # AC_DEFINE(TEXTURE_DIR,"textures") # AC_DEFINE(FONT_DIR,"fonts") diff --git a/devguide.txt b/devguide.txt index c6356d051..379c6c28c 100644 --- a/devguide.txt +++ b/devguide.txt @@ -203,3 +203,7 @@ determining which stars from a StarDatabase are visible to an Observer. The fairly simple trick used to help alleviate the problem involves only checking a portion of the database for visibility at each update. +UNIX +---- +To develop under Unix, you will probably need some of the following packages: +autoconf, automake, and of course the usual array of c++ compilers/linkers. diff --git a/src/celestia/gtkmain.cpp b/src/celestia/gtkmain.cpp index 89f65da53..8d66d7dee 100644 --- a/src/celestia/gtkmain.cpp +++ b/src/celestia/gtkmain.cpp @@ -346,7 +346,7 @@ static void menuAbout() { const gchar* authors[] = { "Chris Laurel ", - "Deon Ramsey ", + "Deon Ramsey ", "Clint Weisbrod ", NULL };