X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=configure.in;h=878757cb6c70a0c87da043c6f6e8d3fdf853fff9;hp=07fb76e98386a52397f77d74e19dbd82837f5870;hb=14463b6ad1ab1ccf81f9c33350b048e410ba94cb;hpb=df7adbee81405e2849728a24b498ad2117784b1f diff --git a/configure.in b/configure.in index 07fb76e9..878757cb 100644 --- a/configure.in +++ b/configure.in @@ -66,6 +66,8 @@ AC_DEFUN(AC_PROG_CC_ANSI, if test -n "$GCC"; then AC_MSG_RESULT(Turning on gcc compiler warnings.) CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format" + AC_MSG_RESULT(Disabling C++ comments in ANSI C code.) + CC="$CC -Wp,-lang-c89" else case "$host" in *-irix5* |*-irix6.[0-3]* ) @@ -180,8 +182,7 @@ perl_version_cmd='print $]' changequote([,]) AC_DEFUN(AC_PROG_PERL, - [PERL='' - AC_PATH_PROGS(PERL, [perl5 perl],,) + [AC_PATH_PROGS(PERL, [perl5 perl],,) if test -z "$PERL" ; then PERL_VERSION=0 else @@ -564,7 +565,7 @@ AC_DEFUN(AC_CHECK_X_LIB, [ LDFLAGS="$LDFLAGS -L$libdir" fi # note: $X_LIBS includes $x_libraries - LDFLAGS="$LDFLAGS $X_LIBS" + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" AC_CHECK_LIB([$1], [$2], [$3], [$4], [$5]) CPPFLAGS="$ac_save_CPPFLAGS" @@ -716,8 +717,6 @@ else HACK_LIBS="-lXmu $HACK_LIBS" MOTIF_LIBS="-lXmu $MOTIF_LIBS" GTK_LIBS="-lXmu $GTK_LIBS" - ATHENA_LIBS="-lXmu $ATHENA_LIBS" - ATHENA3D_LIBS="-lXmu $ATHENA3D_LIBS" AC_DEFINE(HAVE_XMU) fi @@ -1497,6 +1496,11 @@ if test "$with_motif" = yes; then fi +if test "$have_motif" = yes; then + AC_CHECK_X_HEADER(Xm/ComboBox.h, [AC_DEFINE(HAVE_XMCOMBOBOX)]) +fi + + ############################################################################### # # Check for -lgtk. @@ -1580,63 +1584,6 @@ if test "$with_gtk" = yes; then fi -############################################################################### -# -# Check for -lXaw and -lXaw3d. -# -############################################################################### - -have_athena=no -have_athena3d=no -with_athena_req=unspecified -AC_ARG_WITH(athena, -[ --with-athena Use the Athena toolkit for the user interface.], - [with_athena="$withval"; with_athena_req="$withval"],[with_athena=yes]) - -HANDLE_X_PATH_ARG(with_athena, --with-athena, Athena) - - -if test "$with_athena" != yes -a "$with_athena" != no ; then - echo "error: must be yes or no: --with-athena=$with_athena" - exit 1 -fi - - -if test "$with_athena" = yes; then - have_athena=no - AC_CHECK_X_HEADER(X11/Xaw/Dialog.h, [have_athena=yes]) - if test "$have_athena" = yes; then - AC_CHECK_X_LIB(Xaw3d, Xaw3dComputeTopShadowRGB, - [have_athena=yes; have_athena3d=yes], [true], - -lXt -lXmu -lXext -lX11) - fi -fi - -if test "$have_athena" = yes; then - AC_DEFINE(HAVE_ATHENA) - ATHENA_LIBS="-lXaw $ATHENA_LIBS" -fi - -if test "$have_athena3d" = yes; then - ATHENA3D_LIBS="-lXaw3d $ATHENA3D_LIBS" -fi - - -# If we have Athena, check whether it's a version that includes -# XawViewportSetCoordinates in Viewport.h (R3 (or R4?) don't.) -if test "$have_athena" = yes ; then - AC_CACHE_CHECK([for XawViewportSetCoordinates in Viewport.h], - ac_cv_have_XawViewportSetCoordinates, - [ac_cv_have_XawViewportSetCoordinates=no - AC_EGREP_X_HEADER(XawViewportSetCoordinates, - X11/Xaw/Viewport.h, - ac_cv_have_XawViewportSetCoordinates=yes)]) - if test "$ac_cv_have_XawViewportSetCoordinates" = yes ; then - AC_DEFINE(HAVE_XawViewportSetCoordinates) - fi -fi - - ############################################################################### # # Checking whether Motif is really Lesstif. @@ -1781,13 +1728,14 @@ fi ############################################################################### # -# Check for -lGL or -lMesa. +# Check for -lGL or -lMesaGL. # ############################################################################### have_gl=no ac_have_mesa_gl=no with_gl_req=unspecified +gl_halfassed=no AC_ARG_WITH(gl,[ Graphics options: @@ -1809,8 +1757,6 @@ if test "$with_gl" = yes; then # if test "$have_gl" = yes ; then - AC_DEFINE(HAVE_GL) - # We need to know whether it's MesaGL so that we know which libraries # to link against. # @@ -1820,16 +1766,58 @@ if test "$with_gl" = yes; then ]) ac_have_mesa_gl=$ac_cv_have_mesa_gl - if test "$ac_have_mesa_gl" = no ; then - gl_lib_1="GL" - GL_LIBS="-lGL -lGLU" + + gl_lib_1="" + GL_LIBS="" + + + # Some versions of MesaGL are compiled to require -lpthread. + # So if the Mesa headers exist, and -lpthread exists, then always + # link -lpthread after the Mesa libs (be they named -lGL or -lMesaGL.) + # + if test "$ac_have_mesa_gl" = yes; then + AC_CHECK_LIB(pthread, pthread_create, [GL_LIBS="-lpthread"], [],) + fi + + + # If we have Mesa headers, check to see if we can link against -lMesaGL. + # If we don't have Mesa headers, or we don't have -lMesaGL, try -lGL. + # Else, warn that GL is busted. (We have the headers, but no libs.) + # + + if test "$ac_have_mesa_gl" = yes ; then + AC_CHECK_X_LIB(MesaGL, glXCreateContext, + [gl_lib_1="MesaGL" + GL_LIBS="-lMesaGL -lMesaGLU $GL_LIBS"], + [], -lMesaGLU $GL_LIBS -lX11 -lXext -lm) + fi + + if test "$gl_lib_1" = "" ; then + AC_CHECK_X_LIB(GL, glXCreateContext, + [gl_lib_1="GL" + GL_LIBS="-lGL -lGLU $GL_LIBS"], + [], -lGLU $GL_LIBS -lX11 -lXext -lm) + fi + + if test "$gl_lib_1" = "" ; then + # we have headers, but no libs -- bail. + have_gl=no + ac_have_mesa_gl=no + gl_halfassed=yes else - AC_DEFINE(HAVE_MESA_GL) - gl_lib_1="MesaGL" - GL_LIBS="-lMesaGL -lMesaGLU" + # linking works -- we can build the GL hacks. + AC_DEFINE(HAVE_GL) + if test "$ac_have_mesa_gl" = yes ; then + AC_DEFINE(HAVE_MESA_GL) + fi fi + fi + # Now that we know we have GL headers and libs, do some more GL testing. + # + + if test "$have_gl" = yes ; then # If it's MesaGL, we'd like to issue a warning if the version number # is less than or equal to 2.6, because that version had a security bug. # @@ -1880,24 +1868,6 @@ EOF fi - # If it's MesaGL, check to see if it requires -lpthread. - # - have_pthread=no - mesa_requires_pthread=no - if test "$ac_have_mesa_gl" = yes; then - - AC_CHECK_LIB(pthread, pthread_create, [have_pthread=yes], [],) - if test "$have_pthread" = yes; then - AC_CHECK_X_LIB($gl_lib_1, gl_get_thread_context, - [mesa_requires_pthread=yes], [true], - $GL_LIBS -lpthread -lX11 -lXext -lm) - fi - - if test "$mesa_requires_pthread" = yes; then - GL_LIBS="$GL_LIBS -lpthread" - fi - fi - # Check for OpenGL 1.1 features. # AC_CHECK_X_LIB($gl_lib_1, glBindTexture, [AC_DEFINE(HAVE_GLBINDTEXTURE)], @@ -1932,6 +1902,73 @@ elif test "$with_gl" != no; then fi +############################################################################### +# +# Check for -lgle. +# +############################################################################### + +have_gle=no +with_gle_req=unspecified +gle_halfassed=no +AC_ARG_WITH(gle, +[ --with-gle Build those demos which depend on GLE + (the OpenGL "extrusion" library.)], + [with_gle="$withval"; with_gle_req="$withval"],[with_gle=yes]) + +HANDLE_X_PATH_ARG(with_gle, --with-gle, GLE) + +GLE_LIBS="" + +if test "$with_gle" = yes; then + + AC_CHECK_X_HEADER(GL/gutil.h, have_gle=yes, have_gle=no) + if test "$have_gle" = yes ; then + AC_CHECK_X_HEADER(GL/tube.h, have_gle=yes, have_gle=no) + fi + + if test "$have_gle" = yes ; then + have_gle=no + gle_halfassed=yes + AC_CHECK_X_LIB(gle, gleCreateGC, + [have_gle=yes; gle_halfassed=no; GLE_LIBS="-lgle"], + [], $GL_LIBS -lX11 -lXext -lm) + fi + if test "$have_gle" = yes ; then + have_gle=no + gle_halfassed=yes + + # sometimes the libmatrix stuff is included in libgle. look there first. +# +# I don't get it. For some reason, this test passes on SGI, as if +# uview_direction_d() was in libgle -- but it's not, it's in libmatrix. +# Yet the link is succeeding. Why??? +# +# AC_CHECK_X_LIB(gle, uview_direction_d, +# [have_gle=yes; gle_halfassed=no], +# [], $GL_LIBS -lX11 -lXext -lm) + + # if it wasn't in libgle, then look in libmatrix. + if test "$have_gle" = no ; then + AC_CHECK_X_LIB(matrix, uview_direction_d, + [have_gle=yes; gle_halfassed=no; + GLE_LIBS="$GLE_LIBS -lmatrix"], + [], $GL_LIBS -lX11 -lXext -lm) + fi + fi + + if test "$have_gle" = yes ; then + AC_DEFINE(HAVE_GLE) + fi + +elif test "$with_gle" != no; then + echo "error: must be yes or no: --with-gle=$with_gle" + exit 1 + +fi + + + ############################################################################### # # Check for -lXpm. @@ -2005,10 +2042,12 @@ if test "$with_xshm" = yes; then # case "$host" in *-aix*) - have_xshm=no - AC_CHECK_X_LIB(XextSam, XShmQueryExtension, - [have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam"], - [true], -lX11 -lXext -lm) + if [ `uname -v` -eq 3 ]; then + have_xshm=no + AC_CHECK_X_LIB(XextSam, XShmQueryExtension, + [have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam"], + [true], -lX11 -lXext -lm) + fi ;; esac @@ -2291,22 +2330,14 @@ fi ALL_DEMO_PROGRAMS= -if test "$have_athena3d" = yes; then - PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xaw3d - ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS" -fi -if test "$have_athena" = yes; then - PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xaw +if test "$have_motif" = yes; then + PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS" fi if test "$have_gtk" = yes; then PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Gtk ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS" fi -if test "$have_motif" = yes; then - PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm - ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS" -fi if test "$have_kerberos" = yes; then @@ -2326,8 +2357,8 @@ if test "$enable_locking" = yes; then LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)' LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)' else - LOCK_SRCS='' - LOCK_OBJS='' + LOCK_SRCS='$(NOLOCK_SRCS_1)' + LOCK_OBJS='$(NOLOCK_OBJS_1)' fi if test "$need_setuid" = yes; then @@ -2344,7 +2375,15 @@ if test "$have_gl" = yes; then GL_MEN='$(GL_MEN)' GL_KLUDGE="${tab} " else - GL_KLUDGE=" -${tab} " + GL_KLUDGE="-${tab} " +fi + +if test "$have_gle" = yes; then + GLE_EXES='$(GLE_EXES)' + GLE_MEN='$(GLE_MEN)' + GLE_KLUDGE="${tab} " +else + GLE_KLUDGE="-${tab} " fi @@ -2361,11 +2400,10 @@ AC_SUBST(ALL_DEMO_PROGRAMS) AC_SUBST(SAVER_LIBS) AC_SUBST(MOTIF_LIBS) AC_SUBST(GTK_LIBS) -AC_SUBST(ATHENA_LIBS) -AC_SUBST(ATHENA3D_LIBS) AC_SUBST(HACK_LIBS) AC_SUBST(XPM_LIBS) AC_SUBST(GL_LIBS) +AC_SUBST(GLE_LIBS) AC_SUBST(PASSWD_LIBS) AC_SUBST(INSTALL_SETUID) AC_SUBST(INSTALL_DIRS) @@ -2386,6 +2424,9 @@ AC_SUBST(LOCK_OBJS) AC_SUBST(GL_EXES) AC_SUBST(GL_MEN) AC_SUBST(GL_KLUDGE) +AC_SUBST(GLE_EXES) +AC_SUBST(GLE_MEN) +AC_SUBST(GLE_KLUDGE) AC_SUBST(HACKDIR) APPDEFAULTS=$ac_x_app_defaults @@ -2493,17 +2534,13 @@ if test "$with_proc_interrupts_req" = yes -a "$have_proc_interrupts" = no; then fi -if test "$have_motif" = no -a "$have_gtk" = no -a "$have_athena" = no ; then - warnL "None of Motif, Gtk, or Athena widgets seem to be available;" +if test "$have_motif" = no -a "$have_gtk" = no; then + warnL "Neither Motif nor Gtk seem to be available;" warn2 "the \`xscreensaver-demo' program requires one of these." elif test "$with_motif_req" = yes -a "$have_motif" = no ; then warnL "Use of Motif was requested, but it wasn't found;" - if test "$have_gtk" = yes; then - warn2 "Gtk will be used instead." - else - warn2 "Athena will be used instead." - fi + warn2 "Gtk will be used instead." elif test "$jurassic_gtk" = yes ; then @@ -2518,29 +2555,12 @@ elif test "$jurassic_gtk" = yes ; then warnL "Gtk was found on this system, but it is version $v;" fi - if test "$have_motif" = yes; then - which="Motif" - else - which="Athena" - fi - - warn2 "Gtk $pref_gtk or newer is required. $which will be used instead." + warn2 "Gtk $pref_gtk or newer is required. Motif will be used instead." elif test "$with_gtk_req" = yes -a "$have_gtk" = no ; then warnL "Use of Gtk was requested, but it wasn't found;" - if test "$have_motif" = yes; then - warn2 "Motif will be used instead." - else - warn2 "Athena will be used instead." - fi + warn2 "Motif will be used instead." -elif test "$with_athena_req" = yes -a "$have_athena" = no ; then - warnL "Use of Athena was requested, but it wasn't found;" - if test "$have_gtk" = yes; then - warn2 "Gtk will be used instead." - else - warn2 "Motif will be used instead." - fi fi @@ -2562,15 +2582,6 @@ if test "$have_motif" = yes -a "$have_lesstif" = yes ; then fi fi -if test "$have_athena" = yes -a "$have_motif" = no -a "$have_gtk" = no; then - warnL "Athena widgets are being used instead of Motif or Gtk." - warn2 "The \`xscreensaver-demo' program looks much better" - warn2 "with Motif or Gtk. Wouldn't you rather be using Motif?" - warn2 "Motif is shipped by every commercial Unix vendor," - warn2 "and there is a free implementation available as" - warn2 "well: see . Gtk is shipped" - warn2 "with most Linux and BSD distributions." -fi if test "$have_xpm" = no ; then @@ -2606,7 +2617,6 @@ if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then fi fi - if test "$have_gl" = no ; then if test "$with_gl_req" = yes ; then warnL 'Use of GL was requested, but it was not found.' @@ -2616,6 +2626,14 @@ if test "$have_gl" = no ; then noteL 'The OpenGL 3D library was not found.' fi + if test "$gl_halfassed" = yes ; then + echo '' + warn2 'More specifically, we found the headers, but not the' + warn2 'libraries; so either GL is half-installed on this' + warn2 "system, or something else went wrong. The \`config.log'" + warn2 'file might contain some clues.' + fi + echo '' warn2 'Those demos which use 3D will not be built or installed.' warn2 'You might want to consider installing OpenGL and' @@ -2627,6 +2645,39 @@ if test "$have_gl" = no ; then fi + +if test "$have_gl" = yes -a "$have_gle" = no ; then + if test "$with_gle_req" = yes ; then + noteL 'Use of the GLE (GL Extrusion) library was requested, but' + warn2 'it was not found (though the OpenGL library was found, and' + warn2 'is being used.)' + elif test "$with_gle_req" = no ; then + noteL 'The OpenGL Library is being used, but the GLE (GL Extrusion)' + warn2 'library is not.' + else + noteL 'The OpenGL Library was found, but the GLE (GL Extrusion)' + warn2 'was not.' + fi + + if test "$gle_halfassed" = yes ; then + echo '' + warn2 'More specifically, we found the headers, but not the' + warn2 'libraries; so either GLE is half-installed on this' + warn2 "system, or something else went wrong. The \`config.log'" + warn2 'file might contain some clues.' + fi + + echo '' + warn2 'Some of the OpenGL (3D) demos (those that depend on GLE)' + warn2 'will not be built or installed. You might want to consider' + warn2 'installing GLE and re-running configure. (Remember to delete' + warn2 'the config.cache file first.) You can find the GLE library' + warn2 'at . For general OpenGL info,' + warn2 'see .' + +fi + + if test "$with_readdisplay_req" = yes -a "$have_readdisplay" = no ; then warn 'Use of XReadDisplay was requested, but it was not found.' fi @@ -2749,7 +2800,7 @@ if test "$do_dir_warning" = yes; then echo ' "xscreensaver-demo", and "xscreensaver-command" executables' echo " will be installed in ${bindir}." echo "" - echo " The various graphics demos (90+ different executables) will" + echo " The various graphics demos (100+ different executables) will" echo " also be installed in ${HACKDIR}." echo "" echo " If you would prefer the demos to be installed elsewhere"