From ce3185de9d9705e259f2b60dd4b5509007fa17d4 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Mon, 2 Mar 2009 00:42:27 -0500 Subject: [PATCH] http://ftp.aanet.ru/pub/Linux/X11/apps/xscreensaver-2.31.tar.gz -rw-r--r-- 1 zblaxell zblaxell 909790 Oct 5 1998 xscreensaver-2.31.tar.gz 8f1e9e985d8aa22613fd3388b3a161edd8270d25 xscreensaver-2.31.tar.gz --- Makefile.in | 85 +- README | 213 +-- README.debugging | 46 +- config.h.in | 9 +- configure | 1778 ++++++++++++++---- configure.in | 532 +++++- driver/Makefile.in | 40 +- driver/XScreenSaver.ad.in | 72 +- driver/XScreenSaver_ad.h | 55 +- driver/demo.c | 98 +- driver/dialogs-Xaw.c | 70 +- driver/dialogs-Xm.c | 140 +- driver/dialogs.xd | 2 +- driver/kpasswd.c | 2 +- driver/lock.c | 90 +- driver/passwd.c | 6 +- driver/setuid.c | 215 +++ driver/splash.c | 245 +++ driver/stderr.c | 2 +- driver/subprocs.c | 156 +- driver/test-passwd.c | 289 +++ driver/test-uid.c | 173 ++ driver/timers.c | 97 +- driver/windows.c | 170 +- driver/xscreensaver-command.c | 24 +- driver/xscreensaver-command.man | 14 +- driver/xscreensaver.c | 277 +-- driver/xscreensaver.h | 55 +- driver/xscreensaver.man | 40 +- driver/xset.c | 11 +- hacks/Makefile.in | 76 +- hacks/ant.c | 410 +++-- hacks/attraction.c | 2 +- hacks/attraction.man | 2 +- hacks/blitspin.c | 2 +- hacks/blitspin.man | 2 +- hacks/bouboule.c | 6 +- hacks/bouboule.man | 2 +- hacks/braid.c | 2 +- hacks/braid.man | 2 +- hacks/bsod.c | 278 ++- hacks/bubbles-default.c | 2 +- hacks/coral.c | 6 +- hacks/crystal.c | 196 +- hacks/cynosure.c | 2 +- hacks/decayscreen.c | 2 +- hacks/deco.c | 2 +- hacks/deco.man | 2 +- hacks/distort.c | 533 ++++-- hacks/drift.c | 2 +- hacks/drift.man | 2 +- hacks/epicycle.man | 2 +- hacks/flag.c | 7 +- hacks/flag.man | 2 +- hacks/flame.c | 2 +- hacks/flame.man | 2 +- hacks/forest.man | 2 +- hacks/galaxy.c | 2 +- hacks/galaxy.man | 2 +- hacks/glx/Makefile.in | 63 +- hacks/glx/atlantis.c | 370 ++-- hacks/glx/atlantis.h | 44 +- hacks/glx/bubble3d.c | 264 +++ hacks/glx/cage.c | 2 + hacks/glx/dolphin.c | 3031 ++++++++++++++++--------------- hacks/glx/lament.c | 2207 ++++++++++++++++++++++ hacks/glx/lament.man | 60 + hacks/glx/shark.c | 2025 +++++++++++---------- hacks/glx/swim.c | 262 ++- hacks/glx/whale.c | 2801 ++++++++++++++-------------- hacks/glx/xlock-gl.c | 4 +- hacks/goop.c | 2 +- hacks/goop.man | 2 +- hacks/grav.c | 2 +- hacks/grav.man | 2 +- hacks/greynetic.c | 2 +- hacks/greynetic.man | 2 +- hacks/halo.c | 2 +- hacks/halo.man | 2 +- hacks/helix.c | 2 +- hacks/helix.man | 2 +- hacks/hopalong.c | 2 +- hacks/hopalong.man | 2 +- hacks/hypercube.c | 2 +- hacks/hypercube.man | 2 +- hacks/ifs.c | 2 +- hacks/ifs.man | 2 +- hacks/images/atari.xbm | 13 + hacks/images/lament.xpm | 791 ++++++++ hacks/imsmap.man | 2 +- hacks/interference.c | 82 +- hacks/jigsaw.c | 2 +- hacks/jigsaw.man | 2 +- hacks/julia.c | 4 +- hacks/julia.man | 2 +- hacks/kumppa.c | 58 +- hacks/laser.c | 2 +- hacks/laser.man | 2 +- hacks/lightning.c | 2 +- hacks/lightning.man | 2 +- hacks/lisa.man | 2 +- hacks/lmorph.man | 2 +- hacks/maze.c | 4 +- hacks/moire.c | 76 +- hacks/moire.man | 2 +- hacks/moire2.c | 2 +- hacks/munch.c | 2 +- hacks/noseguy.c | 2 +- hacks/noseguy.man | 2 +- hacks/penrose.c | 2 +- hacks/penrose.man | 2 +- hacks/pyro.c | 2 +- hacks/pyro.man | 2 +- hacks/qix.c | 2 +- hacks/qix.man | 2 +- hacks/rd-bomb.c | 150 +- hacks/rocks.c | 2 +- hacks/rocks.man | 2 +- hacks/rorschach.c | 2 +- hacks/rorschach.man | 2 +- hacks/screenhack.c | 4 +- hacks/screenhack.h | 2 +- hacks/sierpinski.c | 2 +- hacks/sierpinski.man | 2 +- hacks/slidescreen.c | 2 +- hacks/slidescreen.man | 2 +- hacks/slip.c | 2 +- hacks/slip.man | 2 +- hacks/sphere.c | 4 +- hacks/sphere.man | 2 +- hacks/spiral.c | 2 +- hacks/spiral.man | 2 +- hacks/starfish.c | 2 +- hacks/starfish.man | 2 +- hacks/strange.c | 28 +- hacks/strange.man | 2 +- hacks/swirl.c | 49 +- hacks/swirl.man | 2 +- hacks/vidwhacker | 13 +- hacks/vines.c | 2 +- hacks/vines.man | 2 +- hacks/xjack.c | 2 +- hacks/xjack.man | 2 +- hacks/xlockmore.c | 44 +- hacks/xlockmore.h | 7 +- hacks/xlockmoreI.h | 14 +- hacks/xlyap.c | 42 +- hacks/xroger-hack.c | 2 +- hacks/xroger.man | 2 +- hacks/xscreensaver-sgigl.c | 2 +- utils/Makefile.in | 14 +- utils/alpha.c | 2 +- utils/alpha.h | 2 +- utils/colors.c | 2 +- utils/colors.h | 2 +- utils/compile_axp.com | 1 + utils/compile_decc.com | 1 + utils/erase.c | 128 +- utils/fade.c | 6 +- utils/fade.h | 2 +- utils/grabscreen.c | 2 +- utils/grabscreen.h | 2 +- utils/hsv.c | 2 +- utils/hsv.h | 2 +- utils/overlay.c | 2 +- utils/resources.c | 2 +- utils/resources.h | 2 +- utils/sgivideo.c | 2 +- utils/sgivideo.h | 2 +- utils/usleep.c | 2 +- utils/usleep.h | 2 +- utils/utils.h | 2 +- utils/version.h | 2 +- utils/visual.c | 2 +- utils/visual.h | 2 +- utils/xmu.c | 10 +- utils/xroger.c | 2 +- utils/xshm.c | 134 ++ utils/xshm.h | 35 + utils/yarandom.h | 2 +- xscreensaver.lsm | 20 +- xscreensaver.lsm.sh | 8 +- 182 files changed, 13667 insertions(+), 5934 deletions(-) create mode 100644 driver/setuid.c create mode 100644 driver/splash.c create mode 100644 driver/test-passwd.c create mode 100644 driver/test-uid.c create mode 100644 hacks/glx/bubble3d.c create mode 100644 hacks/glx/lament.c create mode 100644 hacks/glx/lament.man create mode 100644 hacks/images/atari.xbm create mode 100644 hacks/images/lament.xpm create mode 100644 utils/xshm.c create mode 100644 utils/xshm.h diff --git a/Makefile.in b/Makefile.in index 8638d536..2127292b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -12,13 +12,13 @@ TARFILES = README README.VMS README.debugging INSTALL xscreensaver.lsm \ config.h-vms install-sh setup.com config.guess \ config.sub makevms.com screenblank.txt \ xscreensaver.lsm.sh -TAR = gtar +TAR = tar COMPRESS = gzip --verbose --best COMPRESS_EXT = gz # COMPRESS = compress # COMPRESS_EXT = Z -MAKE_SUBDIR = for dir in $(SUBDIRS) ; do ( cd $$dir ; $(MAKE) $@ ) ; done +MAKE_SUBDIR = for dir in $(SUBDIRS); do (cd $$dir; $(MAKE) $@) || exit 5; done all:: @$(MAKE_SUBDIR) @@ -46,7 +46,7 @@ tags: clean: @$(MAKE_SUBDIR) distclean: clean - -rm -f config.h Makefile config.status config.cache config.log *~ "#"* + -rm -f config.h Makefile config.status config.cache config.log TAGS *~ "#"* @$(MAKE_SUBDIR) dist: tar @@ -55,7 +55,8 @@ dist: tar tar: @ \ sh config.status ; \ - $(MAKE) hack_configure ; \ + rm -f configure ; \ + $(MAKE) configure ; \ $(MAKE) distdepend ; \ sh xscreensaver.lsm.sh > xscreensaver.lsm.$$$$ ; \ mv xscreensaver.lsm.$$$$ xscreensaver.lsm ; \ @@ -85,7 +86,7 @@ tar: # out options we don't use. Odds are good that this will fail with any version # of autoconf other than 2.12. # -hack_configure:: +configure:: autoconf @TMP=configure.$$$$ ; \ echo "munging configure's --help message..." ; \ @@ -108,7 +109,6 @@ hack_configure:: s/--enable and --with options recognized://m; \ s/\n --with-x .*?(["\n])/$$1/s; \ s/\n(Installation options:\n)/$$1/s; \ - s/\n(X Server Extension options:\n)/$$1/s; \ \ s/^ --oldincludedir=.*$$/ \ --x-includes=DIR X include files are in DIR\n \ @@ -119,3 +119,76 @@ hack_configure:: > $$TMP && \ cat $$TMP > configure ) ; \ rm -f $$TMP + +bump-version:: + @ \ + SRC=utils/version.h ; \ + VERS=`sed -n 's/[^0-9]*\([0-9]\)\.\([0-9][0-9]*\).*/\1 \2/p' $$SRC` ; \ + set - $$VERS ; \ + MAJOR="$$1"; MINOR="$$2"; \ + NEW=`echo $$MINOR + 1 | bc` ; \ + D=`date '+%d-%b-%y'`; \ + if [ ! -f xscreensaver-$$MAJOR.$$MINOR.tar.gz ]; then \ + echo "WARNING: xscreensaver-$$MAJOR.$$MINOR.tar.gz does not exist."; \ + fi ; \ + if [ -f xscreensaver-$$MAJOR.$$NEW.tar.gz ]; then \ + echo "WARNING: xscreensaver-$$MAJOR.$$NEW.tar.gz already exists."; \ + fi ; \ + echo -n "Bumping $$MAJOR.$$MINOR to $$MAJOR.$$NEW ($$D), ok? "; \ + read line; \ + if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then \ + exit 1 ; \ + fi ; \ + TMP=/tmp/bv.$$ ; \ + sed -e "s/\([0-9]\.[0-9][0-9]*\)/$$MAJOR.$$NEW/" \ + -e "s/\(([0-9][0-9]*-[A-Za-z][a-z][a-z]-[0-9][0-9][0-9]*\))/($$D)/" \ + $$SRC > $$TMP ; \ + echo -n "New version and date are "; \ + sed -n "s/[^0-9]*\([0-9]\.[0-9][0-9]*\) (\([-A-Za-z0-9]*\)).*/\1, \2./p" \ + $$TMP; \ + cat $$TMP > $$SRC ; \ + rm -f $$TMP; \ + echo "overwrote $$SRC"; \ + ls -lFd $$SRC + +www:: + @ \ + DEST=$$HOME/www/xscreensaver ; \ + VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/\1/p' utils/version.h` ; \ + NAME="xscreensaver-$$VERS.tar.gz" ; \ + if [ ! -f $$NAME ]; then \ + echo "$$NAME does not exist! Did you forget to \`make tar'?" ; \ + exit 1 ; \ + fi ; \ + if [ -f $$DEST/$$NAME ]; then \ + echo -n "WARNING: $$DEST/$$NAME already exists! Overwrite? "; \ + read line; \ + if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then \ + exit 1 ; \ + fi ; \ + fi ; \ + cp -p $$NAME $$DEST/$$NAME ; \ + chmod u+w $$DEST/$$NAME ; \ + cd $$DEST ; \ + \ + TMP=/tmp/xd.$$$$ ; \ + sed "s/xscreensaver-[0-9]\.[0-9][0-9]\.tar\.gz/$$NAME/g" index.html \ + > $$TMP ; \ + echo '' ; \ + diff -u0 index.html $$TMP ; \ + echo '' ; \ + \ + OLDEST=`ls xscreensaver*.tar.gz | head -1` ; \ + echo -n "Delete $$DEST/$$OLDEST? "; \ + read line; \ + if [ "x$$line" = "xyes" -o "x$$line" = "xy" ]; then \ + set -x ; \ + rm $$OLDEST ; \ + cvs remove $$OLDEST ; \ + else \ + set -x ; \ + fi ; \ + cvs add -kb $$NAME ; \ + cat $$TMP > index.html ; \ + rm -f $$TMP ; \ + cvs commit -m "$$VERS" diff --git a/README b/README index e024874e..70ddfda5 100644 --- a/README +++ b/README @@ -4,6 +4,8 @@ a screen saver and locker for the X window system by Jamie Zawinski + http://www.jwz.org/xscreensaver/ + To build on Unix: - ./configure @@ -18,13 +20,14 @@ The file `INSTALL' gives a general overview of use of these sorts of configure scripts (those generated by the GNU autoconf system.) The most important hint is probably this: - ./configure --includedir=/opt/Motif/include --libdir=/opt/Motif/lib + ./configure --with-motif=/opt/Motif --with-xpm=/usr/local To build on VMS, see README.VMS. -If you think you've found a bug, please let me know; but first, read -the enlosed `README.debugging' file to find out what kind of information -would be most helpful to include in your bug report. +If you think you've found a bug, please let me know! No bug report is too +small. But first, please read the enclosed `README.debugging' file to find +out what kind of information would be most helpful to include in your bug +report. Getting Started: @@ -44,151 +47,79 @@ xscreensaver has an extensive manual -- please read it! ============ -The xscreensaver program waits until the keyboard and mouse have been idle -for a period, and then runs a graphics demo chosen at random. It turns off -as soon as there is any mouse or keyboard activity. - -The purpose of xscreensaver is to display pretty pictures on your screen -when it is not in use, in keeping with the philosophy that unattended -monitors should always be doing something interesting, just like they do -in the movies. - -However, xscreensaver can also be used as a screen locker, to prevent -others from using your terminal while your are away. - -The benefit that this program has over the combination of the xlock and -xautolock programs is the ease with which new graphics hacks can be -installed: you don't need to recompile this program to add a new display -mode, you just change some resource settings. Any program which can be -invoked in such a way that it draws on the root window of the screen can -now be used as a screensaver without modification. The programs that -are being run as screensavers don't need to have any special knowledge -about what it means to be a screensaver. - -The XIDLE, MIT-SCREEN-SAVER, and/or SGI SCREEN_SAVER server extensions -will be used if you have them. - -The dialog boxes (for locking and demo-mode) look best using Motif or -Lesstif, but can be configured to use Athena widgets instead. +The xscreensaver daemon waits until the keyboard and mouse have been idle +for a period, and then runs a graphics demo chosen at random. The demo is +terminated as soon as there is any mouse or keyboard activity (or, in +locking mode, when the proper password is typed.) -Also included are numerous graphics hacks for use as screensavers. There's -nothing magic about these: they're just programs that draw on the root -window, which are pointed at by the screensaver's default resource settings. +It is trivially easy to add new display modes to xscreensaver: any program +which can be invoked in such a way that it draws on the root window of the +screen can be used as a screensaver. You just change a resource setting -- +there's no need to recompile or reinstall anything. - qix - My own implementation of this, with many more options - than you would have thought qix could have. - helix - Generates spirally "stringart" patterns. - pedal - Draws a different kind of spirally pattern. - rorschach - Random inkblot patterns. - attraction - A bouncing ball demo, or a qix-like demo, or a wild - color-cycling thing, with some odd rules. - greynetic - Random colored/stippled rectangles. - rocks - Flying through an asteroid field. - blitspin - Rotate a bitmap using bitblts. - imsmap - Generates random maps or cloud formations. - hypercube - 2d projection of a hypercube rotating on all four axes. - slidescreen - Divides the screen into a grid and plays a 16-puzzle on it. - decayscreen - A melting effect. - jigsaw - Turns the screen into a jigsaw puzzle and shuffles it. - halo - Random circular patterns. - pyro - Fireworks. Looks a lot like the version in xlock. - hopalong - Fractals. I snarfed this code from xlock. - flame - Fractals. Also from xlock. - noseguy - A guy with a big nose wanders around the screen saying - things. I snarfed this code from xnlock. - maze - This is the X maze demo modified to take a -root option - so that it works with xscreensaver. - lmorph - morphing line drawings. - bubbles - condensation forms on your monitor, then pops. - deco - Generates Brady-Bunch-era wall paneling. - moire - Circular interference patterns. - moire2 - More moire. - kaleidescope - Groovy, man. - swirl - Swirly color-cycling patterns. - bouboule - Spinning bubbles on a transparent ball. - braid - Draws random color-cycling braids around a circle. - drift - Drifting recursive fractal cosmic flames. - vines - Small, curvy geometric patterns. - galaxy - Spinning, colliding galaxies. - grav - Orbital simulation and/or cloud chamber. - ifs - Spinning, colliding iterated-function-system shapes. - julia - Animated rendition of the Julia set. - laser - Moving radiating lines. - lightning - Crackling fractal lightning bolts. - penrose - Quasiperiodic tilings. - sierpinski - two-dimensional Sierpinski triangle. - slip - Sucks your desktop through a jet engine. - spiral - Circular color-cycling interference patterns. - strange - Animating strange attractors. - flag - A waving flag of an arbitrary bitmap or text. - sphere - Draws a bunch of shaded spheres. - forest - grows a fractal forest. - lisa - draws animated full-loop lisajous figures. - lissie - another lisajous path. - goop - Squishy transparent oil-and-bubble images - starfish - Radially-symmetric throbbing colormap-hacking blobs. - munch - The classic 1962-vintage "munching squares" hack. - rd-bomb - Reaction-diffusion fractals. - coral - Simulation of coral growth, sort of. - fadeplot - Draws a swimming ribbon. - mountain - Generates mountains on a square grid. - triangle - Generates mountains on a triangular grid. - worm - Draws wiggly worms. - rotor - Draws a rotating spiral pattern. - ant - A cellular automaton. - xjack - Simulates a schizophrenic typist. - xlyap - Calculates and displays Lyapunov exponents. - flow - More strange attractors. - epicycle - Spiral patterns based on pre-Copernican cosmologies. - interference - More groovy colored fields. - truchet - Nonrepeating planar tilings. - bsod - Simulates the system crashes of various other OSes. - crystal - A kaleidoscope of moving polygons. - discrete - Various fractal-ish "discrete map" forms. - distort - A moving lens wanders around the screen, magnifying it. - kumppa - Spinning 3D color fields, kinda. - gears - Draws interlocking rotating gears (GLX only.) - morph3d - Draws shiny shape-changing 3d forms (GLX only.) - superquadrics - More shiny shape-changing 3d forms (GLX only.) - pipes - Generates a field of intertwined plumbing (GLX only.) - rubik - Solves a Rubik's Cube (GLX only.) - sproingies - Marble Madness meets Q-Bert (GLX only.) - stairs - Draws Escher's infinite staircase (GLX only.) - cage - Draws Escher's impossible cage (GLX only.) - moebius - Draws Escher's Moebius Strip II (GLX only.) - atlantis - Draws swimming mammals (GLX only.) - -All of these will pop up their own window unless given that -root option. -See their respective man pages for more details. - -Other reasonable things to use as screensavers, if you have them, are + ============ - xdaliclock -root -builtin2 - melting digital clock - xswarm -r 2>&- - swimming sperm - xwave -root - random 3d graphs - xbouncebits - bounce arbitrary bitmaps around - ico -r -p8 -faces -sleep 1 - it's dull, but it's there - xv -root file.gif -quit - they don't all have to animate! - xsplinefun - bouncing splines - xfishtank -c black -d -r 1 - fish (use version 2.0 or later) - xmountains -b - very realistic generated mountains - xtacy -root - various eye candy - xearth -wait 0 -timewarp 400 - the earth as seen from space - /usr/demos/bin/bongo - an SGI GL demo - /usr/demos/bin/ep -S - another: the stunning ElectroPaint. - (Compile hacks/xscreensaver-sgigl.c - to use these with xscreensaver.) +Along with the xscreensaver daemon itself, this package also includes +numerous graphics hacks for use as screensavers. There is nothing magic +about these: they are just programs that draw on the root window. -You can get most of these from the contrib directory on ftp.x.org. If you -know of (or write) any other interesting programs that can be used as -screensavers, please let me know! +More than 80 such programs are included. For details, see the xscreensaver +web page, or the enclosed manual pages. There are also some helpful hints +on customization in the xscreensaver app-defaults file (normally installed +in /usr/lib/X11/app-defaults/XScreenSaver.) The latest version of xscreensaver is always available on the web at -http://people.netscape.com/jwz/xscreensaver/. +http://www.jwz.org/xscreensaver/. - -- Jamie Zawinski + ============ - +Changes since 2.30: * The cursor was invisible in the password dialog. Fixed. + * Made configure warn against MesaGL 2.6. + * Fixed X error at startup when using non-default visual. + * New version of `crystal', `ant', and `atlantis' from + xlockmore. + * New hack, `bubble3d'. + * Added some new modes to `bsod'. +Changes since 2.29: * Changed the order in which -lSM and -lICE are linked + to be after Motif instead of before (Lesstif on Irix + needs this.) +Changes since 2.28: * Work around a bash bug in configure. + * Tweaked HPUX paths again. FTSOHPUX. + * Made configure recommend against LessTif 0.86, due + to a bug in that version that causes a security hole + in the screen locking code. LessTif 0.87 will fix it. + * Made all of the `--with' options to `configure' accept + a directory option as well (so that --with-motif=/FOO + will add -I/FOO/include -L/FOO/lib). I believe this is + the Configure Party Line of how do to such things. + * Fixed a bug where the mouse was left un-grabbed + after the first time the graphics hack was changed + (simplified all of the mouse-grabbing logic.) + * Maybe possibly perhaps made `vidwhacker' really not + leave stray xv windows around. This time for sure. + * Added a new erase mode (random dots fizzling out.) + * Added `-prefs' argument to `xscreensaver-command', + that brings up the Preferences dialog directly (it + seems that nobody ever noticed the `Preferences' button + on the Demo Mode dialog, maybe this will help.) + * Added a splash screen. Turn it off with *splash:false. +Changes since 2.27: * Better macsbug text in `bsod'. + * New version of `distort' with many new modes. + * Plugged a leak in `coral'. + * Tweaked configure for HPUX. + * Removed some compiler warnings. + * More consistent usage of stderr versus stdout. + * More diagnostics should an X error occur. + * Fixed a possible crash in SGI-specific unfading code. +Changes since 2.26: * Improved version of `distort'. + * Made `lament' compile against OpenGL 1.0 (though it + still requires 1.1 to work properly.) + * Updated my email address and home page. +Changes since 2.24: * Improved motion in `rd-bomb'. + * Added XSHM (shared memory extension) support to the + `distort', `interference', `moire', `rd-bomb', and + `swirl' hacks, which speeds them up a bit. + * Added `lament' hack. Changes since 2.23: * Tweaked the order of the -L options again. * Cleaned up configure's --help message. * Added `kumppa' hack. diff --git a/README.debugging b/README.debugging index b7e7fe0b..87ebb4d2 100644 --- a/README.debugging +++ b/README.debugging @@ -9,10 +9,10 @@ document gives some hints for isolating them; the more information you can give me about the problem, the better the odds that I'll be able to fix it. But, if you don't have time to go through these - steps, report the bug anyway -- even vague bug reports can be + steps, report the bug anyway -- even vague bug reports can be better than no bug report at all. - -------- + -------- STEP ZERO: What are you doing here? Go read README, and then the man page. @@ -20,7 +20,7 @@ STEP ZERO: STEP ZERO, PART TWO: Do you have the most recent version? Go make sure. - http://people.netscape.com/jwz/xscreensaver/ + http://www.jwz.org/xscreensaver/ BUILDING: @@ -59,17 +59,20 @@ BUILDING: problem is that you don't have some kind of ``development option'' installed. Xt/ and Xaw/ (Athena) are free and available on all systems; Xm/ (Motif) is available on all commercial systems except - SunOS 4.x and some early releases of Solaris. + SunOS 4.x and some early releases of Solaris. For Linux and other + free Unixes systems, a Motif clone is available from + http://www.lesstif.org/. RUNNING: For runtime errors, it's important to keep in mind that there are two parts to xscreensaver: there is the screensaver driver process - (the part that detects idleness, deals with locking, and launches + (the daemon that detects idleness, deals with locking, and launches the demos); and there are the demos themselves (independent programs that draw pretty pictures.) - * Compile with `make CFLAGS=-g'. + * Compile with `make CFLAGS=-g' (so that if you get a core + dump, there will be debugging info in it.) * What platform are you running on? What does the included `./config.guess' shell script print? @@ -77,7 +80,7 @@ RUNNING: * Is the problem in the driver, or in the graphics hacks? * If the problem is in the driver, was the driver built using - Motif, or Athena? Which version? + Motif, Lesstif, or Athena? Which version? * If the problem is in one (or more) of the hacks, which ones? If you're not sure, try @@ -88,10 +91,10 @@ RUNNING: don't. * Does the problem occur when running that hack by hand, in - its own window? + its own window (i.e., when started with no command-line args)? * Does the problem occur when running that hack by hand, on - the root window (the `-root' option)? + the root window (i.e., when started with the `-root' option)? * IMPORTANT: What visual are you using? Send the output of the `xdpyinfo' command. @@ -108,10 +111,11 @@ RUNNING: program under a debugger, and show me the stack trace. (If you don't know how to do that, that's ok.) - * If it gets an X error, where did it come from? Run the - program under a debugger; set a breakpoint on `exit'; - start the program with the `-sync' command-line option; - and show me the stack trace when it stops. + * If it gets an X error, where did it come from? Run + xscreensaver with the `-sync' command-line option; if -sync + is used, then X errors will cause xscreensaver to dump a core + file. Look at the core file with a debugger and show me the + stack trace: were in xscreensaver did that X error come from? If the problem is with the xscreensaver process itself, or if you can't figure out which demo is causing the problem, or if you can't @@ -128,18 +132,24 @@ RUNNING: prevent the data from being displayed on the screensaver window as well. - You also might want to set the "*timestamp" resource to True, which - will cause the xscreensaver messages to include the time at which + You also might want to use the `-timestamp' option, which will + cause the xscreensaver messages to include the time at which they were printed. * If the problem is intermittent, you might want to capture the - log information to a file and examine it later. + log information to a file and examine it later. For example, + you could start it from your login script like this (csh syntax): + + ( cd ~/src/xscreensaver/ ; \ + xscreensaver -sync -verbose -timestamp \ + -xrm '*captureStderr:false' -xrm '*captureStdout:false' \ + >>&LOG & ) * Hackers only: If you're feeling adventurous enough to run gdb on the xscreensaver driver process itself, make sure you've read the commentary at the top of xscreensaver.c. ----------------------------------------------------------------------------- - http://people.netscape.com/jwz/xscreensaver/ - Jamie Zawinski + http://www.jwz.org/xscreensaver/ + Jamie Zawinski ----------------------------------------------------------------------------- diff --git a/config.h.in b/config.h.in index 4ee2cd7a..98e6a91b 100644 --- a/config.h.in +++ b/config.h.in @@ -131,11 +131,16 @@ */ #undef HAVE_GL -/* Define this if you have GL, but it's the MesaGL variant. (The libraries - have different names.) (HAVE_GL should be defined too.) +/* Define this if you have OpenGL, but it's the MesaGL variant. (The + libraries have different names.) (HAVE_GL should be defined too.) */ #undef HAVE_MESA_GL +/* Define this if your version of OpenGL has the glBindTexture() routine. + This is the case for OpenGL 1.1, but not for OpenGL 1.0. + */ +#undef HAVE_GLBINDTEXTURE + /* Define this if you have the X Shared Memory Extension. */ #undef HAVE_XSHM_EXTENSION diff --git a/configure b/configure index 88a0de65..d35d9773 100755 --- a/configure +++ b/configure @@ -26,6 +26,11 @@ Installation options: " ac_help="$ac_help" ac_help="$ac_help +Except where noted, all of the --with options below can also take a +directory argument: for example, --with-motif=/opt/Motif. That would +cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/ +to be added to the -L list, assuming those directories exist. + X Server Extension options: --with-sgi-ext Include support for the SGI SCREEN_SAVER @@ -55,8 +60,8 @@ ac_help="$ac_help X Client Toolkit options: - --with-motif Use the Motif toolkit for the user interface, - if possible (this is the default). + --with-motif Use the Motif toolkit for the user interface, if + possible (this is the default). --without-motif Do not use Motif." ac_help="$ac_help --with-athena Use the Athena toolkit for the user interface, if @@ -630,7 +635,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:646: checking host system type" >&5 +echo "configure:650: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -654,7 +659,7 @@ echo "$ac_t""$host" 1>&6 # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:670: checking for $ac_word" >&5 +echo "configure:674: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -683,7 +688,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:699: checking for $ac_word" >&5 +echo "configure:703: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -731,7 +736,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:747: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:751: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -741,11 +746,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -765,12 +770,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:781: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:785: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:786: checking whether we are using GNU C" >&5 +echo "configure:790: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -779,7 +784,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:799: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -794,7 +799,7 @@ if test $ac_cv_prog_gcc = yes; then ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:810: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:814: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -824,7 +829,7 @@ fi if test -z "$GCC"; then echo $ac_n "checking how to request ANSI compilation""... $ac_c" 1>&6 -echo "configure:840: checking how to request ANSI compilation" >&5 +echo "configure:844: checking how to request ANSI compilation" >&5 case "$host" in *-hpux*) echo "$ac_t""HPUX: adding -Ae" 1>&6 @@ -835,8 +840,10 @@ echo "configure:840: checking how to request ANSI compilation" >&5 CC="$CC -qlanglvl=ansi -qhalt=e" ;; -# NOTE: for Digital, need to add -std1 to get ANSI, but I'm not sure -# yet what $host pattern we should be testing for... + *-dec-*) + echo "$ac_t""DEC: adding -std1" 1>&6 + CC="$CC -std1" + ;; *) echo "$ac_t""no idea" 1>&6 @@ -846,16 +853,16 @@ fi echo $ac_n "checking whether the compiler works on ANSI C""... $ac_c" 1>&6 -echo "configure:862: checking whether the compiler works on ANSI C" >&5 +echo "configure:868: checking whether the compiler works on ANSI C" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: Couldn't build even a trivial ANSI C program: check CC." 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo "$ac_t""yes" 1>&6 else @@ -871,20 +878,40 @@ fi case "$host" in *-irix*) - if test -n "$GCC"; then - echo "$ac_t""Turning on gcc compiler warnings." 1>&6 - CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format" - else - # not gcc - echo "$ac_t""Turning on SGI compiler warnings." 1>&6 - CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3" - fi + if test -n "$GCC"; then + echo "$ac_t""Turning on gcc compiler warnings." 1>&6 + CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format" + else + # not gcc + echo "$ac_t""Turning on SGI compiler warnings." 1>&6 + CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3" + fi + ;; + + *-linux-*) + echo "$ac_t""Turning on gcc compiler warnings." 1>&6 + CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format" ;; + +# *-dec-osf*) +# if test -z "$GCC"; then +# AC_MSG_RESULT(Turning on DEC C compiler warnings.) +# CC="$CC -migrate -w0 -verbose -warnprotos" +# fi +# ;; + esac +# Try and determine whether ${INSTALL} can create intermediate directories, +# and if not, whether "mkdir -p" works instead. This sets ${INSTALL_DIRS}. +# (But autoconf should earn its keep and do this for us!) +# + + + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:900: checking how to run the C preprocessor" >&5 +echo "configure:926: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -899,13 +926,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:947: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -916,13 +943,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:938: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:964: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -955,7 +982,7 @@ echo "$ac_t""$CPP" 1>&6 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:971: checking for a BSD compatible install" >&5 +echo "configure:997: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1004,8 +1031,35 @@ test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +INSTALL_DIRS='${INSTALL} -d' + echo $ac_n "checking whether \"\${INSTALL} -d\" creates intermediate directories""... $ac_c" 1>&6 +echo "configure:1048: checking whether \"\${INSTALL} -d\" creates intermediate directories" >&5 + rm -rf conftestdir + if mkdir conftestdir; then + cd conftestdir >&- + + ${INSTALL} -d `pwd`/dir1/dir2 >&- 2>&- + if test -d dir1/dir2 ; then + echo "$ac_t""yes" 1>&6 + else + echo "$ac_t""no" 1>&6 + echo $ac_n "checking whether \"mkdir -p\" creates intermediate directories""... $ac_c" 1>&6 +echo "configure:1059: checking whether \"mkdir -p\" creates intermediate directories" >&5 + rm -rf dir1 + mkdir -p dir1/dir2 >&- 2>&- + if test -d dir1/dir2/. ; then + echo "$ac_t""yes" 1>&6 + INSTALL_DIRS='mkdir -p' + else + echo "$ac_t""no" 1>&6 + fi + fi + cd .. >&- + rm -rf conftestdir + fi + echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1021: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1074: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1033,12 +1087,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1049: checking for working const" >&5 +echo "configure:1102: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1156: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1108,21 +1162,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:1124: checking for inline" >&5 +echo "configure:1177: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1191: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -1149,12 +1203,12 @@ esac echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1165: checking for ANSI C header files" >&5 +echo "configure:1218: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1162,7 +1216,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1178: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1179,7 +1233,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1197,7 +1251,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1218,7 +1272,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1229,7 +1283,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -1253,12 +1307,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1269: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:1322: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1267,7 +1321,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:1283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1336: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -1288,12 +1342,12 @@ EOF fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:1304: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:1357: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1309,7 +1363,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:1325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -1334,12 +1388,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1350: checking for $ac_hdr that defines DIR" >&5 +echo "configure:1403: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -1347,7 +1401,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -1372,7 +1426,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1388: checking for opendir in -ldir" >&5 +echo "configure:1441: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1380,7 +1434,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1413,7 +1467,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1429: checking for opendir in -lx" >&5 +echo "configure:1482: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1421,7 +1475,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1456,12 +1510,12 @@ fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:1472: checking for mode_t" >&5 +echo "configure:1525: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1489,12 +1543,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:1505: checking for pid_t" >&5 +echo "configure:1558: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1522,12 +1576,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1538: checking for size_t" >&5 +echo "configure:1591: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1555,12 +1609,12 @@ EOF fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1571: checking return type of signal handlers" >&5 +echo "configure:1624: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1577,7 +1631,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1646: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -1597,12 +1651,12 @@ EOF echo $ac_n "checking how to call gettimeofday""... $ac_c" 1>&6 -echo "configure:1613: checking how to call gettimeofday" >&5 +echo "configure:1666: checking how to call gettimeofday" >&5 if eval "test \"`echo '$''{'ac_cv_gettimeofday_args'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1611,7 +1665,7 @@ struct timeval tv; struct timezone tzp; gettimeofday(&tv, &tzp); ; return 0; } EOF -if { (eval echo configure:1627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_gettimeofday_args=2 else @@ -1619,7 +1673,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < #include @@ -1627,7 +1681,7 @@ int main() { struct timeval tv; gettimeofday(&tv); ; return 0; } EOF -if { (eval echo configure:1643: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1696: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_gettimeofday_args=1 else @@ -1667,12 +1721,12 @@ fi for ac_func in select fcntl uname nice setpriority getcwd getwd putenv do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1683: checking for $ac_func" >&5 +echo "configure:1736: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1722,12 +1776,12 @@ done for ac_func in sigaction do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1738: checking for $ac_func" >&5 +echo "configure:1791: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1779,17 +1833,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1795: checking for $ac_hdr" >&5 +echo "configure:1848: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1805: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1848,7 +1902,7 @@ fi # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:1864: checking for X" >&5 +echo "configure:1917: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -1910,12 +1964,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1931: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1984: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1984,14 +2038,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -2097,17 +2151,17 @@ else case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:2113: checking whether -R must be followed by a space" >&5 +echo "configure:2166: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_nospace=yes else @@ -2123,14 +2177,14 @@ rm -f conftest* else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_space=yes else @@ -2162,7 +2216,7 @@ rm -f conftest* # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:2178: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:2231: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2170,7 +2224,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2203,7 +2257,7 @@ fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:2219: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:2272: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2211,7 +2265,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2251,12 +2305,12 @@ fi # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:2267: checking for gethostbyname" >&5 +echo "configure:2320: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -2300,7 +2354,7 @@ fi if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:2316: checking for gethostbyname in -lnsl" >&5 +echo "configure:2369: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2308,7 +2362,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2349,12 +2403,12 @@ fi # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:2365: checking for connect" >&5 +echo "configure:2418: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -2398,7 +2452,7 @@ fi if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:2414: checking for connect in -lsocket" >&5 +echo "configure:2467: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2406,7 +2460,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2441,12 +2495,12 @@ fi # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:2457: checking for remove" >&5 +echo "configure:2510: checking for remove" >&5 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -2490,7 +2544,7 @@ fi if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:2506: checking for remove in -lposix" >&5 +echo "configure:2559: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2498,7 +2552,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2533,12 +2587,12 @@ fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:2549: checking for shmat" >&5 +echo "configure:2602: checking for shmat" >&5 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -2582,7 +2636,7 @@ fi if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:2598: checking for shmat in -lipc" >&5 +echo "configure:2651: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2590,7 +2644,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lipc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2634,7 +2688,7 @@ fi # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:2650: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:2703: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2642,7 +2696,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lICE $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2690,14 +2744,14 @@ fi echo $ac_n "checking for X app-defaults directory""... $ac_c" 1>&6 -echo "configure:2706: checking for X app-defaults directory" >&5 +echo "configure:2759: checking for X app-defaults directory" >&5 if eval "test \"`echo '$''{'ac_cv_x_app_defaults'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -fr conftestdir if mkdir conftestdir; then - cd conftestdir + cd conftestdir >&- # Make sure to not put "make" in the Imakefile rules, since we grep it out. cat > Imakefile <<'EOF' acfindx: @@ -2707,11 +2761,12 @@ EOF # GNU make sometimes prints "make[1]: Entering...", which'd confuse us. eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` fi - cd .. + cd .. >&- rm -fr conftestdir fi if test x"$ac_x_app_defaults" = x; then - # Look for the directory under a standard set of common directories. + + # Look for the directory under a standard set of common directories. # Check X11 before X11Rn because it's often a symlink to the current release. for ac_dir in \ /usr/X11/lib/app-defaults \ @@ -2808,6 +2863,23 @@ APPDEFAULTS=$ac_x_app_defaults +# Usage: HANDLE_X_PATH_ARG([variable_name], +# [--command-line-option], +# [descriptive string]) +# +# All of the --with options take three forms: +# +# --with-foo (or --with-foo=yes) +# --without-foo (or --with-foo=no) +# --with-foo=/DIR +# +# This function, HANDLE_X_PATH_ARG, deals with the /DIR case. When it sees +# a directory (string beginning with a slash) it checks to see whether +# /DIR/include and /DIR/lib exist, and adds them to $X_CFLAGS and $X_LIBS +# as appropriate. +# + + # check for the HP XHPDisableReset server extension headers. @@ -2819,7 +2891,7 @@ APPDEFAULTS=$ac_x_app_defaults fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < EOF @@ -2840,7 +2912,7 @@ rm -f conftest* # Check for the availability of the XPointer typedef, and define it otherwise. # echo $ac_n "checking for XPointer""... $ac_c" 1>&6 -echo "configure:2856: checking for XPointer" >&5 +echo "configure:2927: checking for XPointer" >&5 if eval "test \"`echo '$''{'ac_cv_xpointer'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2851,14 +2923,14 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < int main() { XPointer foo = (XPointer) 0; ; return 0; } EOF -if { (eval echo configure:2874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2945: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_xpointer=yes else @@ -2880,44 +2952,119 @@ EOF fi +# Random special-cases for certain pathological OSes. You know who you are. +# case "$host" in *-hpux*) - # Thanks for not making xmkmf find this by default, you losers. + + # The following arcana was gleaned from conversations with + # Eric Schwartz : + # + # On HPUX 10.x, the parts of X that HP considers "standard" live in + # /usr/{include,lib}/X11R6/. The parts that HP doesn't consider + # "standard", notably, Xaw and Xmu, live in /usr/contrib/X11R6/. + # Also, there are symlinks from /usr/include/ and /usr/lib/ into + # /usr/{include,lib}/X11R6/, so that (if you don't use Xmu at all) + # you don't need any -I or -L arguments. + # + # On HPUX 9.x, /usr/{include,lib}/X11R5/ and /usr/contrib/X11R5/ + # are the same division as 10.x. However, there are no symlinks to + # the X stuff from /usr/include/ and /usr/lib/, so -I and -L + # arguments are always necessary. + # + # However, X11R6 was available on HPUX 9.x as a patch: if that + # patch was installed, then all of X11R6 went in to + # /usr/contrib/X11R6/ (there was no /usr/{include,lib}/X11R6/.) + # + # HPUX 8.x was the same as 9.x, but was X11R4 instead (I don't know + # whether R5 was available as a patch; R6 undoubtedly was not.) + # + # So. We try and use the highest numbered pair of + # /usr/{include,lib}/X11R?/ and /usr/contrib/X11R?/{include,lib}/ + # that are available. We do not mix and match different versions + # of X. + # + # Questions I still don't know the answers to: (do you?) + # + # * Does HPUX 10.x come with /usr/contrib/X11R6/ standard? + # Or does that need to be installed separately? + # + # * On HPUX 9.x, where /usr/include/X11R5/ was standard, and + # /usr/contrib/X11R6/ could be installed as a patch, what was in + # that contrib directory? Did it contain so-called "standard" + # X11R6, or did it include Xaw and Xmu as well? If the former, + # where did one find Xaw and Xmu on 9.x R6 systems? Would this + # be a situation where one had to reach into the R5 headers and + # libs to find Xmu? That is, must both R6 and R5 directories + # be on the -I and -L lists in that case? + # + for version in X11R6 X11R5 X11R4 ; do + # if either pair of directories exists... + if test -d /usr/lib/$version || test -d /usr/contrib/$version/lib ; then + # if contrib exists, use it... + if test -d /usr/contrib/$version/lib ; then + X_CFLAGS="$X_CFLAGS -I/usr/contrib/$version/include" + X_LIBS="$X_LIBS -L/usr/contrib/$version/lib" + fi + # if the "standard" one exists, use it. + if test -d /usr/lib/$version ; then + X_CFLAGS="$X_CFLAGS -I/usr/include/$version" + X_LIBS="$X_LIBS -L/usr/lib/$version" + fi + # since at least one of the pair exists, go no farther. + break + fi + done + + # Now find Motif. Thanks for not making xmkmf find this by + # default, you losers. + # if test -d /usr/lib/Motif1.2 ; then - X_CFLAGS="-I/usr/include/Motif1.2 $X_CFLAGS" - X_LIBS="-L/usr/lib/Motif1.2 $X_LIBS" + X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.2" + X_LIBS="$X_LIBS -L/usr/lib/Motif1.2" elif test -d /usr/lib/Motif1.1 ; then - X_CFLAGS="-I/usr/include/Motif1.1 $X_CFLAGS" - X_LIBS="-L/usr/lib/Motif1.1 $X_LIBS" + X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.1" + X_LIBS="$X_LIBS -L/usr/lib/Motif1.1" fi - # This too. You losers. - if test -d /usr/contrib/X11R6/include ; then - X_CFLAGS="-I/usr/contrib/X11R6/include $X_CFLAGS" - X_LIBS="-L/usr/contrib/X11R6/lib $X_LIBS" - elif test -d /usr/X11R6/include ; then - X_CFLAGS="-I/usr/X11R6/include $X_CFLAGS" - X_LIBS="-L/usr/X11R6/lib $X_LIBS" - elif test -d /usr/contrib/X11R5/include ; then - X_CFLAGS="-I/usr/contrib/X11R5/include $X_CFLAGS" - X_LIBS="-L/usr/contrib/X11R5/lib $X_LIBS" - elif test -d /usr/X11R5/include ; then - X_CFLAGS="-I/usr/X11R5/include $X_CFLAGS" - X_LIBS="-L/usr/X11R5/lib $X_LIBS" + # Now let's check for the pseudo-standard locations for OpenGL and XPM. + # + if test -d /opt/Mesa/lib ; then + X_CFLAGS="-I/opt/Mesa/include $X_CFLAGS" + X_LIBS="-L/opt/Mesa/lib $X_LIBS" + fi + + if test -d /opt/xpm/lib/X11 ; then + X_CFLAGS="-I/opt/xpm/include $X_CFLAGS" + X_LIBS="-L/opt/xpm/lib/X11 $X_LIBS" + fi + + # On HPUX, default to installing in /opt/xscreensaver/ instead of + # in /usr/local/, unless there is already an xscreensaver in + # /usr/local/bin/. This can be overridden with the --prefix arg + # to configure. I'm not sure this is the right thing to do, but + # Richard Lloyd says so... + # + if test \! -x /usr/local/bin/xscreensaver ; then + ac_default_prefix=/opt/xscreensaver fi ;; *-solaris*) - # Same to you, pinheads. (Is this really the standard location now? - # What happened to the joke that this kind of thing went in /opt?) + + # Thanks for not making xmkmf find this by default, pinheads. + # And thanks for moving things around again, too. Is this + # really the standard location now? What happened to the + # joke that this kind of thing went in /opt? # cthomp says "answer: CDE (Common Disorganized Environment)" + # if test -f /usr/dt/include/Xm/Xm.h ; then X_CFLAGS="$X_CFLAGS -I/usr/dt/include" X_LIBS="$X_LIBS -L/usr/dt/lib -R:/usr/dt/lib" # Some versions of Slowlaris Motif require -lgen. But not all. Why? echo $ac_n "checking for regcmp in -lgen""... $ac_c" 1>&6 -echo "configure:2933: checking for regcmp in -lgen" >&5 +echo "configure:3079: checking for regcmp in -lgen" >&5 ac_lib_var=`echo gen'_'regcmp | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2925,7 +3072,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgen $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2973,17 +3120,17 @@ have_xmu=no CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "X11/Xmu/Error.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xmu/Error.h""... $ac_c" 1>&6 -echo "configure:2989: checking for X11/Xmu/Error.h" >&5 +echo "configure:3135: checking for X11/Xmu/Error.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2999: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3145: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3027,7 +3174,7 @@ if test $have_xmu = yes ; then case "$host" in *-sunos4*) echo $ac_n "checking for the SunOS 4.1.x _get_wmShellWidgetClass bug""... $ac_c" 1>&6 -echo "configure:3043: checking for the SunOS 4.1.x _get_wmShellWidgetClass bug" >&5 +echo "configure:3189: checking for the SunOS 4.1.x _get_wmShellWidgetClass bug" >&5 if eval "test \"`echo '$''{'ac_cv_sunos_xmu_bug'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3040,14 +3187,14 @@ else # with X libraries because we know it's SunOS. LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_sunos_xmu_bug=no else @@ -3063,21 +3210,21 @@ fi echo "$ac_t""$ac_cv_sunos_xmu_bug" 1>&6 if test $ac_cv_sunos_xmu_bug = yes ; then echo $ac_n "checking whether the compiler understands -static""... $ac_c" 1>&6 -echo "configure:3079: checking whether the compiler understands -static" >&5 +echo "configure:3225: checking whether the compiler understands -static" >&5 if eval "test \"`echo '$''{'ac_cv_ld_static'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -static" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_ld_static=yes else @@ -3114,6 +3261,53 @@ else with_sgi=yes fi + + + case "$with_sgi" in + yes) ;; + no) ;; + + /*) + echo $ac_n "checking for SGI SCREEN_SAVER headers""... $ac_c" 1>&6 +echo "configure:3284: checking for SGI SCREEN_SAVER headers" >&5 + d=$with_sgi/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + echo $ac_n "checking for SGI SCREEN_SAVER libs""... $ac_c" 1>&6 +echo "configure:3294: checking for SGI SCREEN_SAVER libs" >&5 + d=$with_sgi/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + # replace the directory string with "yes". + with_sgi_req="yes" + with_sgi=$with_sgi_req + ;; + + *) + echo "" + echo "error: argument to --with-sgi-ext must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + + # why is this necessary? + # if we don't do this, then "./configure --with-motif=/usr/local/lesstif" + # behaves as if "--with-zippy=/usr/local/lesstif" was also present! + withval= + + if test $with_sgi = yes; then ac_save_CPPFLAGS="$CPPFLAGS" @@ -3123,17 +3317,17 @@ if test $with_sgi = yes; then CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "X11/extensions/XScreenSaver.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/extensions/XScreenSaver.h""... $ac_c" 1>&6 -echo "configure:3139: checking for X11/extensions/XScreenSaver.h" >&5 +echo "configure:3332: checking for X11/extensions/XScreenSaver.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3342: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3178,6 +3372,53 @@ else with_mit=yes fi + + + case "$with_mit" in + yes) ;; + no) ;; + + /*) + echo $ac_n "checking for MIT-SCREEN-SAVER headers""... $ac_c" 1>&6 +echo "configure:3395: checking for MIT-SCREEN-SAVER headers" >&5 + d=$with_mit/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + echo $ac_n "checking for MIT-SCREEN-SAVER libs""... $ac_c" 1>&6 +echo "configure:3405: checking for MIT-SCREEN-SAVER libs" >&5 + d=$with_mit/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + # replace the directory string with "yes". + with_mit_req="yes" + with_mit=$with_mit_req + ;; + + *) + echo "" + echo "error: argument to --with-mit-ext must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + + # why is this necessary? + # if we don't do this, then "./configure --with-motif=/usr/local/lesstif" + # behaves as if "--with-zippy=/usr/local/lesstif" was also present! + withval= + + if test $have_sgi != yes; then if test $with_mit = yes; then @@ -3188,17 +3429,17 @@ if test $have_sgi != yes; then CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "X11/extensions/scrnsaver.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/extensions/scrnsaver.h""... $ac_c" 1>&6 -echo "configure:3204: checking for X11/extensions/scrnsaver.h" >&5 +echo "configure:3444: checking for X11/extensions/scrnsaver.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3454: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3242,7 +3483,7 @@ fi LDFLAGS="$LDFLAGS -L$x_libraries" fi echo $ac_n "checking for XScreenSaverRegister in -lXext""... $ac_c" 1>&6 -echo "configure:3258: checking for XScreenSaverRegister in -lXext" >&5 +echo "configure:3498: checking for XScreenSaverRegister in -lXext" >&5 ac_lib_var=`echo Xext'_'XScreenSaverRegister | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3250,7 +3491,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXext -lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3312,7 +3553,7 @@ fi LDFLAGS="$LDFLAGS -L$x_libraries" fi echo $ac_n "checking for XScreenSaverRegister in -lXExExt""... $ac_c" 1>&6 -echo "configure:3328: checking for XScreenSaverRegister in -lXExExt" >&5 +echo "configure:3568: checking for XScreenSaverRegister in -lXExExt" >&5 ac_lib_var=`echo XExExt'_'XScreenSaverRegister | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3320,7 +3561,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXExExt -lX11 -lXext -lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3377,7 +3618,7 @@ fi LDFLAGS="$LDFLAGS -L$x_libraries" fi echo $ac_n "checking for XScreenSaverRegister in -lXss""... $ac_c" 1>&6 -echo "configure:3393: checking for XScreenSaverRegister in -lXss" >&5 +echo "configure:3633: checking for XScreenSaverRegister in -lXss" >&5 ac_lib_var=`echo Xss'_'XScreenSaverRegister | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3385,7 +3626,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXss -lX11 -lXext -lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3448,6 +3689,53 @@ else with_xidle=yes fi + + + case "$with_xidle" in + yes) ;; + no) ;; + + /*) + echo $ac_n "checking for XIDLE headers""... $ac_c" 1>&6 +echo "configure:3712: checking for XIDLE headers" >&5 + d=$with_xidle/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + echo $ac_n "checking for XIDLE libs""... $ac_c" 1>&6 +echo "configure:3722: checking for XIDLE libs" >&5 + d=$with_xidle/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + # replace the directory string with "yes". + with_xidle_req="yes" + with_xidle=$with_xidle_req + ;; + + *) + echo "" + echo "error: argument to --with-xidle-ext must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + + # why is this necessary? + # if we don't do this, then "./configure --with-motif=/usr/local/lesstif" + # behaves as if "--with-zippy=/usr/local/lesstif" was also present! + withval= + + if test $with_xidle = yes; then ac_save_CPPFLAGS="$CPPFLAGS" @@ -3457,17 +3745,17 @@ if test $with_xidle = yes; then CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "X11/extensions/xidle.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/extensions/xidle.h""... $ac_c" 1>&6 -echo "configure:3473: checking for X11/extensions/xidle.h" >&5 +echo "configure:3760: checking for X11/extensions/xidle.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3483: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3770: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3511,6 +3799,53 @@ else with_xshm=yes fi + + + case "$with_xshm" in + yes) ;; + no) ;; + + /*) + echo $ac_n "checking for XSHM headers""... $ac_c" 1>&6 +echo "configure:3822: checking for XSHM headers" >&5 + d=$with_xshm/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + echo $ac_n "checking for XSHM libs""... $ac_c" 1>&6 +echo "configure:3832: checking for XSHM libs" >&5 + d=$with_xshm/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + # replace the directory string with "yes". + with_xshm_req="yes" + with_xshm=$with_xshm_req + ;; + + *) + echo "" + echo "error: argument to --with-xshm-ext must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + + # why is this necessary? + # if we don't do this, then "./configure --with-motif=/usr/local/lesstif" + # behaves as if "--with-zippy=/usr/local/lesstif" was also present! + withval= + + if test $with_xshm = yes; then # first check for Xshm.h. @@ -3522,17 +3857,17 @@ if test $with_xshm = yes; then CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "X11/extensions/XShm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/extensions/XShm.h""... $ac_c" 1>&6 -echo "configure:3538: checking for X11/extensions/XShm.h" >&5 +echo "configure:3872: checking for X11/extensions/XShm.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3548: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3882: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3566,17 +3901,17 @@ fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6 -echo "configure:3582: checking for sys/ipc.h" >&5 +echo "configure:3916: checking for sys/ipc.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3926: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3611,17 +3946,17 @@ fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "sys/shm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/shm.h""... $ac_c" 1>&6 -echo "configure:3627: checking for sys/shm.h" >&5 +echo "configure:3961: checking for sys/shm.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3637: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3670,7 +4005,7 @@ fi LDFLAGS="$LDFLAGS -L$x_libraries" fi echo $ac_n "checking for XShmQueryExtension in -lXextSam""... $ac_c" 1>&6 -echo "configure:3686: checking for XShmQueryExtension in -lXextSam" >&5 +echo "configure:4020: checking for XShmQueryExtension in -lXextSam" >&5 ac_lib_var=`echo XextSam'_'XShmQueryExtension | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3678,7 +4013,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXextSam -lX11 -lXext -lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3740,6 +4075,53 @@ else with_sgivc=yes fi + + + case "$with_sgivc" in + yes) ;; + no) ;; + + /*) + echo $ac_n "checking for SGI-VIDEO-CONTROL headers""... $ac_c" 1>&6 +echo "configure:4098: checking for SGI-VIDEO-CONTROL headers" >&5 + d=$with_sgivc/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + echo $ac_n "checking for SGI-VIDEO-CONTROL libs""... $ac_c" 1>&6 +echo "configure:4108: checking for SGI-VIDEO-CONTROL libs" >&5 + d=$with_sgivc/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + # replace the directory string with "yes". + with_sgivc_req="yes" + with_sgivc=$with_sgivc_req + ;; + + *) + echo "" + echo "error: argument to --with-sgivc-ext must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + + # why is this necessary? + # if we don't do this, then "./configure --with-motif=/usr/local/lesstif" + # behaves as if "--with-zippy=/usr/local/lesstif" was also present! + withval= + + if test $with_sgivc = yes; then # first check for XSGIvc.h @@ -3751,17 +4133,17 @@ if test $with_sgivc = yes; then CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "X11/extensions/XSGIvc.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/extensions/XSGIvc.h""... $ac_c" 1>&6 -echo "configure:3767: checking for X11/extensions/XSGIvc.h" >&5 +echo "configure:4148: checking for X11/extensions/XSGIvc.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3777: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3804,7 +4186,7 @@ fi LDFLAGS="$LDFLAGS -L$x_libraries" fi echo $ac_n "checking for XSGIvcQueryGammaMap in -lXsgivc""... $ac_c" 1>&6 -echo "configure:3820: checking for XSGIvcQueryGammaMap in -lXsgivc" >&5 +echo "configure:4201: checking for XSGIvcQueryGammaMap in -lXsgivc" >&5 ac_lib_var=`echo Xsgivc'_'XSGIvcQueryGammaMap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3812,7 +4194,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXsgivc -lXext -lX11 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3873,6 +4255,53 @@ else with_dpms=yes fi + + + case "$with_dpms" in + yes) ;; + no) ;; + + /*) + echo $ac_n "checking for DPMS headers""... $ac_c" 1>&6 +echo "configure:4278: checking for DPMS headers" >&5 + d=$with_dpms/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + echo $ac_n "checking for DPMS libs""... $ac_c" 1>&6 +echo "configure:4288: checking for DPMS libs" >&5 + d=$with_dpms/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + # replace the directory string with "yes". + with_dpms_req="yes" + with_dpms=$with_dpms_req + ;; + + *) + echo "" + echo "error: argument to --with-dpms-ext must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + + # why is this necessary? + # if we don't do this, then "./configure --with-motif=/usr/local/lesstif" + # behaves as if "--with-zippy=/usr/local/lesstif" was also present! + withval= + + if test $with_dpms = yes; then # first check for dpms.h @@ -3884,17 +4313,17 @@ if test $with_dpms = yes; then CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "X11/extensions/dpms.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/extensions/dpms.h""... $ac_c" 1>&6 -echo "configure:3900: checking for X11/extensions/dpms.h" >&5 +echo "configure:4328: checking for X11/extensions/dpms.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4338: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3937,7 +4366,7 @@ fi LDFLAGS="$LDFLAGS -L$x_libraries" fi echo $ac_n "checking for DPMSInfo in -lXdpms""... $ac_c" 1>&6 -echo "configure:3953: checking for DPMSInfo in -lXdpms" >&5 +echo "configure:4381: checking for DPMSInfo in -lXdpms" >&5 ac_lib_var=`echo Xdpms'_'DPMSInfo | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3945,7 +4374,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXdpms -lXext -lX11 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4012,6 +4441,52 @@ else fi + + case "$with_motif" in + yes) ;; + no) ;; + + /*) + echo $ac_n "checking for Motif headers""... $ac_c" 1>&6 +echo "configure:4463: checking for Motif headers" >&5 + d=$with_motif/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + echo $ac_n "checking for Motif libs""... $ac_c" 1>&6 +echo "configure:4473: checking for Motif libs" >&5 + d=$with_motif/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + # replace the directory string with "yes". + with_motif_req="yes" + with_motif=$with_motif_req + ;; + + *) + echo "" + echo "error: argument to --with-motif must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + + # why is this necessary? + # if we don't do this, then "./configure --with-motif=/usr/local/lesstif" + # behaves as if "--with-zippy=/usr/local/lesstif" was also present! + withval= + + # Check whether --with-athena or --without-athena was given. if test "${with_athena+set}" = set; then withval="$with_athena" @@ -4021,6 +4496,52 @@ else fi + + case "$with_athena" in + yes) ;; + no) ;; + + /*) + echo $ac_n "checking for Athena headers""... $ac_c" 1>&6 +echo "configure:4518: checking for Athena headers" >&5 + d=$with_athena/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + echo $ac_n "checking for Athena libs""... $ac_c" 1>&6 +echo "configure:4528: checking for Athena libs" >&5 + d=$with_athena/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + # replace the directory string with "yes". + with_athena_req="yes" + with_athena=$with_athena_req + ;; + + *) + echo "" + echo "error: argument to --with-athena must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + + # why is this necessary? + # if we don't do this, then "./configure --with-motif=/usr/local/lesstif" + # behaves as if "--with-zippy=/usr/local/lesstif" was also present! + withval= + + if test $with_motif != yes -a $with_motif != no ; then echo "error: must be yes or no: --with-motif=$with_motif" exit 1 @@ -4055,17 +4576,17 @@ check_motif() { CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6 -echo "configure:4071: checking for Xm/Xm.h" >&5 +echo "configure:4591: checking for Xm/Xm.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4601: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4105,17 +4626,17 @@ check_athena() { CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "X11/Xaw/Dialog.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw/Dialog.h""... $ac_c" 1>&6 -echo "configure:4121: checking for X11/Xaw/Dialog.h" >&5 +echo "configure:4641: checking for X11/Xaw/Dialog.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4131: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4651: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4154,7 +4675,7 @@ fi LDFLAGS="$LDFLAGS -L$x_libraries" fi echo $ac_n "checking for Xaw3dComputeTopShadowRGB in -lXaw3d""... $ac_c" 1>&6 -echo "configure:4170: checking for Xaw3dComputeTopShadowRGB in -lXaw3d" >&5 +echo "configure:4690: checking for Xaw3dComputeTopShadowRGB in -lXaw3d" >&5 ac_lib_var=`echo Xaw3d'_'Xaw3dComputeTopShadowRGB | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4162,7 +4683,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXaw3d -lXt -lXmu -lXext -lX11 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4249,7 +4770,7 @@ fi # XawViewportSetCoordinates in Viewport.h (R3 (or R4?) don't.) if test $have_athena = yes ; then echo $ac_n "checking for XawViewportSetCoordinates in Viewport.h""... $ac_c" 1>&6 -echo "configure:4265: checking for XawViewportSetCoordinates in Viewport.h" >&5 +echo "configure:4785: checking for XawViewportSetCoordinates in Viewport.h" >&5 if eval "test \"`echo '$''{'ac_cv_have_XawViewportSetCoordinates'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4261,7 +4782,7 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < EOF @@ -4290,7 +4811,7 @@ fi have_lesstif=no if test $have_motif = yes ; then echo $ac_n "checking whether Motif is really LessTif""... $ac_c" 1>&6 -echo "configure:4306: checking whether Motif is really LessTif" >&5 +echo "configure:4826: checking whether Motif is really LessTif" >&5 if eval "test \"`echo '$''{'ac_cv_have_lesstif'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4301,14 +4822,14 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < int main() { long vers = LesstifVersion; ; return 0; } EOF -if { (eval echo configure:4324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4844: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_lesstif=yes else @@ -4325,16 +4846,19 @@ echo "$ac_t""$ac_cv_have_lesstif" 1>&6 have_lesstif=$ac_cv_have_lesstif fi -# don't cache this -unset ac_cv_good_lesstif +# don't cache these +unset ac_cv_lesstif_version +unset ac_cv_lesstif_version_string + +lesstif_version=unknown +lesstif_version_string=unknown -good_lesstif=no if test $have_lesstif = yes ; then - # It must be at least "GNU Lesstif 0.82". - # #### If you change this, also sync the warning message lower down. - echo $ac_n "checking whether LessTif is of a recent enough vintage""... $ac_c" 1>&6 -echo "configure:4349: checking whether LessTif is of a recent enough vintage" >&5 -if eval "test \"`echo '$''{'ac_cv_good_lesstif'+set}'`\" = set"; then + ltv=unknown + echo unknown > conftest-lt + echo $ac_n "checking LessTif version number""... $ac_c" 1>&6 +echo "configure:4872: checking LessTif version number" >&5 +if eval "test \"`echo '$''{'ac_cv_lesstif_version_string'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4344,23 +4868,34 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" if test "$cross_compiling" = yes; then - # cross compiling? Make an ass out of umption. - ac_cv_good_lesstif=yes + ac_cv_lesstif_version=unknown + ac_cv_lesstif_version_string=unknown else cat > conftest.$ac_ext < - int main() { exit(LesstifVersion < 82); } -EOF -if { (eval echo configure:4369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +#include + #include + int main() { + FILE *f = fopen("conftest-lt", "w"); + if (!f) exit(1); + fprintf(f, "%d %d.%d\n", LesstifVersion, + LESSTIF_VERSION, LESSTIF_REVISION); + fclose(f); + exit(0); + } +EOF +if { (eval echo configure:4900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then - ac_cv_good_lesstif=yes + ltv=`cat conftest-lt` + ac_cv_lesstif_version=`echo $ltv | sed 's/ .*//'` + ac_cv_lesstif_version_string=`echo $ltv | sed 's/.* //'` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* - ac_cv_good_lesstif=no + ac_cv_lesstif_version=unknown + ac_cv_lesstif_version_string=unknown fi rm -fr conftest* fi @@ -4368,8 +4903,11 @@ fi CPPFLAGS="$ac_save_CPPFLAGS" fi -echo "$ac_t""$ac_cv_good_lesstif" 1>&6 - good_lesstif=$ac_cv_good_lesstif +echo "$ac_t""$ac_cv_lesstif_version_string" 1>&6 + rm -f conftest-lt + lesstif_version=$ac_cv_lesstif_version + lesstif_version_string=$ac_cv_lesstif_version_string + fi @@ -4397,7 +4935,7 @@ if test $have_motif = yes ; then LDFLAGS="$LDFLAGS -L$x_libraries" fi echo $ac_n "checking for XpQueryExtension in -lXp""... $ac_c" 1>&6 -echo "configure:4413: checking for XpQueryExtension in -lXp" >&5 +echo "configure:4950: checking for XpQueryExtension in -lXp" >&5 ac_lib_var=`echo Xp'_'XpQueryExtension | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4405,7 +4943,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXp -lX11 -lXext -lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4453,6 +4991,53 @@ else with_xpm=yes fi + + + case "$with_xpm" in + yes) ;; + no) ;; + + /*) + echo $ac_n "checking for XPM headers""... $ac_c" 1>&6 +echo "configure:5014: checking for XPM headers" >&5 + d=$with_xpm/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + echo $ac_n "checking for XPM libs""... $ac_c" 1>&6 +echo "configure:5024: checking for XPM libs" >&5 + d=$with_xpm/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + # replace the directory string with "yes". + with_xpm_req="yes" + with_xpm=$with_xpm_req + ;; + + *) + echo "" + echo "error: argument to --with-xpm must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + + # why is this necessary? + # if we don't do this, then "./configure --with-motif=/usr/local/lesstif" + # behaves as if "--with-zippy=/usr/local/lesstif" was also present! + withval= + + if test $with_xpm = yes; then ac_save_CPPFLAGS="$CPPFLAGS" @@ -4462,17 +5047,17 @@ if test $with_xpm = yes; then CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6 -echo "configure:4478: checking for X11/xpm.h" >&5 +echo "configure:5062: checking for X11/xpm.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4488: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5072: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4518,6 +5103,55 @@ else fi + + case "$with_gl" in + yes) ;; + no) ;; + + /*) + echo $ac_n "checking for GL headers""... $ac_c" 1>&6 +echo "configure:5125: checking for GL headers" >&5 + d=$with_gl/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + echo $ac_n "checking for GL libs""... $ac_c" 1>&6 +echo "configure:5135: checking for GL libs" >&5 + d=$with_gl/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + # replace the directory string with "yes". + with_gl_req="yes" + with_gl=$with_gl_req + ;; + + *) + echo "" + echo "error: argument to --with-gl must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + + # why is this necessary? + # if we don't do this, then "./configure --with-motif=/usr/local/lesstif" + # behaves as if "--with-zippy=/usr/local/lesstif" was also present! + withval= + + +ac_mesagl_version=unknown +ac_mesagl_version_string=unknown + if test $with_gl = yes; then ac_save_CPPFLAGS="$CPPFLAGS" @@ -4527,17 +5161,17 @@ if test $with_gl = yes; then CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "GL/gl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for GL/gl.h""... $ac_c" 1>&6 -echo "configure:4543: checking for GL/gl.h" >&5 +echo "configure:5176: checking for GL/gl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4553: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4568,17 +5202,17 @@ fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "GL/glx.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for GL/glx.h""... $ac_c" 1>&6 -echo "configure:4584: checking for GL/glx.h" >&5 +echo "configure:5217: checking for GL/glx.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4594: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5227: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4610,35 +5244,161 @@ fi #define HAVE_GL 1 EOF - have_mesa_gl=no - + + # We need to know whether it's MesaGL so that we know which libraries + # to link against. + # + echo $ac_n "checking whether GL is really MesaGL""... $ac_c" 1>&6 +echo "configure:5264: checking whether GL is really MesaGL" >&5 + if eval "test \"`echo '$''{'ac_cv_have_mesa_gl'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_have_mesa_gl=no + ac_save_CPPFLAGS="$CPPFLAGS" if test \! -z "$includedir" ; then CPPFLAGS="$CPPFLAGS -I$includedir" fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "Mesa" >/dev/null 2>&1; then rm -rf conftest* - have_mesa_gl=yes + ac_cv_have_mesa_gl=yes fi rm -f conftest* CPPFLAGS="$ac_save_CPPFLAGS" - if test $have_mesa_gl = no ; then + +fi + + ac_have_mesa_gl=$ac_cv_have_mesa_gl + echo "$ac_t""$ac_have_mesa_gl" 1>&6 + + if test $ac_have_mesa_gl = no ; then + gl_lib_1="GL" GL_LIBS="-lGL -lGLU" else cat >> confdefs.h <<\EOF #define HAVE_MESA_GL 1 EOF + gl_lib_1="MesaGL" GL_LIBS="-lMesaGL -lMesaGLU" fi + + + # 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. + # + if test $ac_have_mesa_gl = yes; then + + # don't cache these. + unset ac_cv_mesagl_version + unset ac_cv_mesagl_version_string + + echo $ac_n "checking MesaGL version number""... $ac_c" 1>&6 +echo "configure:5317: checking MesaGL version number" >&5 + if eval "test \"`echo '$''{'ac_cv_mesagl_version_string'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION +EOF + + mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | sed -n \ + 's/^#configure:.*\([0-9][0-9]*\).*\([0-9][0-9]*\).*$/\1.\2/p'` + if test "$mglv" = ""; then + ac_mesagl_version=unknown + ac_mesagl_version_string=unknown + else + ac_mesagl_version_string=$mglv + maj=`echo $mglv | sed -n 's/\..*//p'` + min=`echo $mglv | sed -n 's/.*\.//p'` + ac_mesagl_version=`echo "$maj * 1000 + $min" | bc` + fi + ac_cv_mesagl_version=$ac_mesagl_version + ac_cv_mesagl_version_string=$ac_mesagl_version_string + +fi + + ac_mesagl_version=$ac_cv_mesagl_version + ac_mesagl_version_string=$ac_cv_mesagl_version_string + echo "$ac_t""$ac_cv_mesagl_version_string" 1>&6 + fi + + + # Check for OpenGL 1.1 features. + # + + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + if test \! -z "$x_libraries" ; then + LDFLAGS="$LDFLAGS -L$x_libraries" + fi + echo $ac_n "checking for glBindTexture in -l$gl_lib_1""... $ac_c" 1>&6 +echo "configure:5369: checking for glBindTexture in -l$gl_lib_1" >&5 +ac_lib_var=`echo $gl_lib_1'_'glBindTexture | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-l$gl_lib_1 $GL_LIBS -lX11 -lXext -lm $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_GLBINDTEXTURE 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" + fi elif test $with_gl != no; then @@ -4659,6 +5419,53 @@ else with_readdisplay=yes fi + + + case "$with_readdisplay" in + yes) ;; + no) ;; + + /*) + echo $ac_n "checking for XReadDisplay headers""... $ac_c" 1>&6 +echo "configure:5442: checking for XReadDisplay headers" >&5 + d=$with_readdisplay/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + echo $ac_n "checking for XReadDisplay libs""... $ac_c" 1>&6 +echo "configure:5452: checking for XReadDisplay libs" >&5 + d=$with_readdisplay/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + # replace the directory string with "yes". + with_readdisplay_req="yes" + with_readdisplay=$with_readdisplay_req + ;; + + *) + echo "" + echo "error: argument to --with-readdisplay must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + + # why is this necessary? + # if we don't do this, then "./configure --with-motif=/usr/local/lesstif" + # behaves as if "--with-zippy=/usr/local/lesstif" was also present! + withval= + + if test $with_readdisplay = yes; then ac_save_CPPFLAGS="$CPPFLAGS" @@ -4668,17 +5475,17 @@ if test $with_readdisplay = yes; then CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "X11/extensions/readdisplay.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/extensions/readdisplay.h""... $ac_c" 1>&6 -echo "configure:4684: checking for X11/extensions/readdisplay.h" >&5 +echo "configure:5490: checking for X11/extensions/readdisplay.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4694: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4721,6 +5528,53 @@ else with_sgivideo=yes fi + + + case "$with_sgivideo" in + yes) ;; + no) ;; + + /*) + echo $ac_n "checking for Iris Video headers""... $ac_c" 1>&6 +echo "configure:5551: checking for Iris Video headers" >&5 + d=$with_sgivideo/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + echo $ac_n "checking for Iris Video libs""... $ac_c" 1>&6 +echo "configure:5561: checking for Iris Video libs" >&5 + d=$with_sgivideo/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + # replace the directory string with "yes". + with_sgivideo_req="yes" + with_sgivideo=$with_sgivideo_req + ;; + + *) + echo "" + echo "error: argument to --with-sgivideo must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + + # why is this necessary? + # if we don't do this, then "./configure --with-motif=/usr/local/lesstif" + # behaves as if "--with-zippy=/usr/local/lesstif" was also present! + withval= + + if test $with_sgivideo = yes; then ac_save_CPPFLAGS="$CPPFLAGS" @@ -4730,17 +5584,17 @@ if test $with_sgivideo = yes; then CPPFLAGS="$CPPFLAGS $X_CFLAGS" ac_safe=`echo "dmedia/vl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dmedia/vl.h""... $ac_c" 1>&6 -echo "configure:4746: checking for dmedia/vl.h" >&5 +echo "configure:5599: checking for dmedia/vl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4756: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4765,7 +5619,7 @@ fi if test $have_sgivideo = yes; then have_sgivideo=no echo $ac_n "checking for vlOpenVideo in -lvl""... $ac_c" 1>&6 -echo "configure:4781: checking for vlOpenVideo in -lvl" >&5 +echo "configure:5634: checking for vlOpenVideo in -lvl" >&5 ac_lib_var=`echo vl'_'vlOpenVideo | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4773,7 +5627,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lvl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4852,7 +5706,7 @@ if test -n "$with_zippy_req" ; then case "$with_zippy_req" in /*) echo $ac_n "checking for $with_zippy_req""... $ac_c" 1>&6 -echo "configure:4868: checking for $with_zippy_req" >&5 +echo "configure:5721: checking for $with_zippy_req" >&5 if test -x "$with_zippy_req" ; then echo "$ac_t""yes" 1>&6 else @@ -4866,7 +5720,7 @@ echo "configure:4868: checking for $with_zippy_req" >&5 # Extract the first word of "$with_zippy_req", so it can be a program name with args. set dummy $with_zippy_req; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4882: checking for $ac_word" >&5 +echo "configure:5735: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_zip2'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4912,7 +5766,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4928: checking for $ac_word" >&5 +echo "configure:5781: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_emacs_exe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4945,7 +5799,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4961: checking for $ac_word" >&5 +echo "configure:5814: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_xemacs_exe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4979,7 +5833,7 @@ done if test -n "$emacs_exe" ; then echo $ac_n "checking for emacs yow""... $ac_c" 1>&6 -echo "configure:4995: checking for emacs yow" >&5 +echo "configure:5848: checking for emacs yow" >&5 # # get emacs to tell us where the libexec directory is. # @@ -5001,7 +5855,7 @@ echo "configure:4995: checking for emacs yow" >&5 if test -z "$ac_cv_zippy_program" ; then echo $ac_n "checking for xemacs yow""... $ac_c" 1>&6 -echo "configure:5017: checking for xemacs yow" >&5 +echo "configure:5870: checking for xemacs yow" >&5 if test -n "$xemacs_exe" ; then # # get xemacs to tell us where the libexec directory is. @@ -5047,7 +5901,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5063: checking for $ac_word" >&5 +echo "configure:5916: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_fortune'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5082,7 +5936,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5098: checking for $ac_word" >&5 +echo "configure:5951: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_fortune'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5159,9 +6013,56 @@ else with_kerberos=yes fi + + + case "$with_kerberos" in + yes) ;; + no) ;; + + /*) + echo $ac_n "checking for Kerberos headers""... $ac_c" 1>&6 +echo "configure:6036: checking for Kerberos headers" >&5 + d=$with_kerberos/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + echo $ac_n "checking for Kerberos libs""... $ac_c" 1>&6 +echo "configure:6046: checking for Kerberos libs" >&5 + d=$with_kerberos/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + # replace the directory string with "yes". + with_kerberos_req="yes" + with_kerberos=$with_kerberos_req + ;; + + *) + echo "" + echo "error: argument to --with-kerberos must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + + # why is this necessary? + # if we don't do this, then "./configure --with-motif=/usr/local/lesstif" + # behaves as if "--with-zippy=/usr/local/lesstif" was also present! + withval= + + if test $with_kerberos = yes; then echo $ac_n "checking for Kerberos""... $ac_c" 1>&6 -echo "configure:5177: checking for Kerberos" >&5 +echo "configure:6077: checking for Kerberos" >&5 if eval "test \"`echo '$''{'ac_cv_kerberos'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5172,14 +6073,14 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < int main() { ; return 0; } EOF -if { (eval echo configure:5195: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6095: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_kerberos=yes else @@ -5199,7 +6100,100 @@ echo "$ac_t""$ac_cv_kerberos" 1>&6 #define HAVE_KERBEROS 1 EOF - PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes -lnsl -lsocket" + + # from Tim Showalter + PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes" + echo $ac_n "checking for res_search""... $ac_c" 1>&6 +echo "configure:6119: checking for res_search" >&5 +if eval "test \"`echo '$''{'ac_cv_func_res_search'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char res_search(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_res_search) || defined (__stub___res_search) +choke me +#else +res_search(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_res_search=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_res_search=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6 +echo "configure:6165: checking for res_search in -lresolv" >&5 +ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lresolv $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + PASSWD_LIBS="${PASSWD_LIBS} -lresolv" +else + echo "$ac_t""no" 1>&6 +echo "configure: warning: Can't find DNS resolver libraries needed for Kerberos" 1>&2 + +fi + +fi + + fi elif test $with_kerberos != no; then echo "error: must be yes or no: --with-kerberos=$with_kerberos" @@ -5217,6 +6211,53 @@ else with_shadow=yes fi + + + case "$with_shadow" in + yes) ;; + no) ;; + + /*) + echo $ac_n "checking for shadow password headers""... $ac_c" 1>&6 +echo "configure:6234: checking for shadow password headers" >&5 + d=$with_shadow/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + echo $ac_n "checking for shadow password libs""... $ac_c" 1>&6 +echo "configure:6244: checking for shadow password libs" >&5 + d=$with_shadow/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + echo "$ac_t""$d" 1>&6 + else + echo "$ac_t""not found ($d: no such directory)" 1>&6 + fi + + # replace the directory string with "yes". + with_shadow_req="yes" + with_shadow=$with_shadow_req + ;; + + *) + echo "" + echo "error: argument to --with-shadow must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + + # why is this necessary? + # if we don't do this, then "./configure --with-motif=/usr/local/lesstif" + # behaves as if "--with-zippy=/usr/local/lesstif" was also present! + withval= + + if test $with_shadow = no; then passwd_cruft_done=yes elif test $with_shadow != yes; then @@ -5229,7 +6270,7 @@ fi # if test $passwd_cruft_done = no ; then echo $ac_n "checking for Sun-style shadow passwords""... $ac_c" 1>&6 -echo "configure:5245: checking for Sun-style shadow passwords" >&5 +echo "configure:6285: checking for Sun-style shadow passwords" >&5 if eval "test \"`echo '$''{'ac_cv_sun_adjunct'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5240,7 +6281,7 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < #include @@ -5253,7 +6294,7 @@ struct passwd_adjunct *p = getpwanam("nobody"); const char *pw = p->pwa_passwd; ; return 0; } EOF -if { (eval echo configure:5269: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6309: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sun_adjunct=yes else @@ -5282,7 +6323,7 @@ EOF # if test $passwd_cruft_done = no ; then echo $ac_n "checking for DEC-style shadow passwords""... $ac_c" 1>&6 -echo "configure:5298: checking for DEC-style shadow passwords" >&5 +echo "configure:6338: checking for DEC-style shadow passwords" >&5 if eval "test \"`echo '$''{'ac_cv_enhanced_passwd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5293,7 +6334,7 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < #include @@ -5310,7 +6351,7 @@ struct pr_passwd *p; pw = p->ufld.fd_encrypt; ; return 0; } EOF -if { (eval echo configure:5326: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6366: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_enhanced_passwd=yes else @@ -5336,7 +6377,7 @@ EOF # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx) # (I'm told it needs -lcurses too, but I don't understand why.) echo $ac_n "checking for getprpwnam in -lprot""... $ac_c" 1>&6 -echo "configure:5352: checking for getprpwnam in -lprot" >&5 +echo "configure:6392: checking for getprpwnam in -lprot" >&5 ac_lib_var=`echo prot'_'getprpwnam | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5344,7 +6385,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lprot -lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5375,7 +6416,7 @@ else echo "$ac_t""no" 1>&6 # On DEC, getprpwnam() is in -lsecurity echo $ac_n "checking for getprpwnam in -lsecurity""... $ac_c" 1>&6 -echo "configure:5391: checking for getprpwnam in -lsecurity" >&5 +echo "configure:6431: checking for getprpwnam in -lsecurity" >&5 ac_lib_var=`echo security'_'getprpwnam | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5383,7 +6424,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsecurity $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5423,7 +6464,7 @@ fi # if test $passwd_cruft_done = no ; then echo $ac_n "checking for HP-style shadow passwords""... $ac_c" 1>&6 -echo "configure:5439: checking for HP-style shadow passwords" >&5 +echo "configure:6479: checking for HP-style shadow passwords" >&5 if eval "test \"`echo '$''{'ac_cv_hpux_passwd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5434,7 +6475,7 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < #include @@ -5447,7 +6488,7 @@ struct s_passwd *p = getspwnam("nobody"); const char *pw = p->pw_passwd; ; return 0; } EOF -if { (eval echo configure:5463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_hpux_passwd=yes else @@ -5472,7 +6513,7 @@ EOF # on HPUX, bigcrypt is in -lsec echo $ac_n "checking for bigcrypt in -lsec""... $ac_c" 1>&6 -echo "configure:5488: checking for bigcrypt in -lsec" >&5 +echo "configure:6528: checking for bigcrypt in -lsec" >&5 ac_lib_var=`echo sec'_'bigcrypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5480,7 +6521,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsec $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5518,7 +6559,7 @@ fi # if test $passwd_cruft_done = no ; then echo $ac_n "checking for generic shadow passwords""... $ac_c" 1>&6 -echo "configure:5534: checking for generic shadow passwords" >&5 +echo "configure:6574: checking for generic shadow passwords" >&5 if eval "test \"`echo '$''{'ac_cv_shadow'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5529,7 +6570,7 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < #include @@ -5541,7 +6582,7 @@ struct spwd *p = getspnam("nobody"); const char *pw = p->sp_pwdp; ; return 0; } EOF -if { (eval echo configure:5557: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_shadow=yes else @@ -5567,7 +6608,7 @@ EOF # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc. have_getspnam=no echo $ac_n "checking for getspnam in -lc""... $ac_c" 1>&6 -echo "configure:5583: checking for getspnam in -lc" >&5 +echo "configure:6623: checking for getspnam in -lc" >&5 ac_lib_var=`echo c'_'getspnam | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5575,7 +6616,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5608,7 +6649,7 @@ fi if test $have_getspnam = no ; then echo $ac_n "checking for getspnam in -lgen""... $ac_c" 1>&6 -echo "configure:5624: checking for getspnam in -lgen" >&5 +echo "configure:6664: checking for getspnam in -lgen" >&5 ac_lib_var=`echo gen'_'getspnam | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5616,7 +6657,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgen $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5658,7 +6699,7 @@ fi # if test $passwd_cruft_done = no ; then echo $ac_n "checking for FreeBSD-style shadow passwords""... $ac_c" 1>&6 -echo "configure:5674: checking for FreeBSD-style shadow passwords" >&5 +echo "configure:6714: checking for FreeBSD-style shadow passwords" >&5 if eval "test \"`echo '$''{'ac_cv_master_passwd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5679,7 +6720,7 @@ echo "$ac_t""$ac_cv_master_passwd" 1>&6 # On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc. have_crypt=no echo $ac_n "checking for crypt in -lc""... $ac_c" 1>&6 -echo "configure:5695: checking for crypt in -lc" >&5 +echo "configure:6735: checking for crypt in -lc" >&5 ac_lib_var=`echo c'_'crypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5687,7 +6728,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5720,7 +6761,7 @@ fi if test $have_crypt = no ; then echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:5736: checking for crypt in -lcrypt" >&5 +echo "configure:6776: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5728,7 +6769,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5801,9 +6842,6 @@ DEPEND_FLAGS= DEPEND_DEFINES= -# Autoconf doesn't seem to have an INSTALL_DIRS, so let's define our own... -INSTALL_DIRS='$(INSTALL) -d' - # Done testing things -- now substitute in some stuff for the Makefiles. # if test $have_motif = yes; then @@ -5892,8 +6930,13 @@ fi # Print some warnings before emitting the Makefiles. # +warn_prefix_1=" Warning:" +warn_prefix_2=" Note:" +warn_prefix="$warn_prefix_1" + warning=no warnsep=' #################################################################' + warnpre() { if test $warning = no ; then echo '' ; echo "$warnsep" ; echo '' @@ -5905,7 +6948,7 @@ warn() { warnpre if test $warning = long ; then echo '' ; fi warning=yes - echo " Warning: $@" + echo "$warn_prefix $@" } warnL() { @@ -5913,7 +6956,7 @@ warnL() { warnpre warning=yes if test $was != no ; then echo '' ; fi - echo " Warning: $@" + echo "$warn_prefix $@" } warn2() { @@ -5921,6 +6964,19 @@ warn2() { warning=long } +note() { + warn_prefix="$warn_prefix_2" + warn $@ + warn_prefix="$warn_prefix_1" +} + +noteL() { + warn_prefix="$warn_prefix_2" + warnL $@ + warn_prefix="$warn_prefix_1" +} + + if test $with_sgi_req = yes -a $have_sgi = no ; then warn 'The SGI saver extension was requested, but was not found.' fi @@ -5960,12 +7016,28 @@ elif test $with_athena_req = yes -a $have_athena = no ; then fi if test $have_motif = yes -a $have_lesstif = yes ; then - if test $good_lesstif != yes ; then - warnL "Motif is being used, but it appears to actually be" - warn2 "LessTif, and the version number is less than 0.82!" - warn2 "Such old versions of LessTif are too buggy to use" - warn2 "with XScreenSaver; it is strongly recommended that" - warn2 "you upgrade! See ." + + preferred_lesstif=0.87 + + if test $lesstif_version = unknown; then + warnL "Unable to determine the LessTif version number!" + warn2 "Make sure you are using version $preferred_lesstif or newer." + warn2 "See ." + + elif test \! $lesstif_version -gt 82; then + warnL "LessTif version $lesstif_version_string is being used." + warn2 "LessTif versions 0.82 and earlier are too buggy to" + warn2 "use with XScreenSaver; it is strongly recommended" + warn2 "that you upgrade to at least version $preferred_lesstif!" + warn2 "See ." + + elif test \! $lesstif_version -gt 86; then + warnL "LessTif version $lesstif_version_string is being used." + warn2 "LessTif versions 0.86 and earlier have a bug that" + warn2 "can cause a security problem with xscreensaver." + warn2 "If you want to use xscreensaver as a screen locker," + warn2 "it is strongly recommended that you upgrade to at" + warn2 "least version $preferred_lesstif. See ." fi fi @@ -5978,12 +7050,58 @@ if test $proselytize_motif = yes ; then warn2 "available as well: see ." fi -if test $with_xpm_req = yes -a $have_xpm = no ; then - warn 'Use of XPM was requested, but it was not found.' + +if test $have_gl = yes -a $ac_have_mesa_gl = yes ; then + preferred_mesagl=2.7 + + if test $ac_mesagl_version = unknown; then + warnL "Unable to determine the MesaGL version number!" + warn2 "Make sure you are using version $preferred_mesagl or newer." + + elif test \! $ac_mesagl_version -gt 2006; then + warnL "MesaGL version $ac_mesagl_version_string is being used." + warn2 "MesaGL versions 2.6 and earlier have a security bug." + warn2 "It is strongly recommended that you upgrade to at" + warn2 "least version $preferred_mesagl." + fi fi -if test $with_gl_req = yes -a $have_gl = no ; then - warn 'Use of GL was requested, but it was not found.' + +if test $have_xpm = no ; then + if test $with_xpm_req = yes ; then + warnL 'Use of XPM was requested, but it was not found.' + elif test $with_xpm_req = no ; then + noteL 'The XPM library is not being used.' + else + noteL 'The XPM library was not found.' + fi + + echo '' + warn2 'Some of the demos will not be as colorful as they' + warn2 'could be. You might want to consider installing XPM' + warn2 'and re-running configure. (Remember to delete the' + warn2 'config.cache file first.) You can find XPM at most' + warn2 'X11 archive sites, such as .' +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.' + elif test $with_gl_req = no ; then + noteL 'The OpenGL 3D library is not being used.' + else + noteL 'The OpenGL 3D library was not found.' + fi + + echo '' + warn2 'Those demos which use 3D will not be built or installed.' + warn2 'You might want to consider installing OpenGL and' + warn2 're-running configure. (Remember to delete the' + warn2 "config.cache file first.) If your vendor doesn't ship" + warn2 'their own implementation of OpenGL, you can get a free' + warn2 'version at .' + warn2 'For general OpenGL info, see .' + fi if test $with_readdisplay_req = yes -a $have_readdisplay = no ; then @@ -6443,7 +7561,7 @@ echo ' When you run "make install", the "xscreensaver" and' echo ' "xscreensaver-command" executables will be installed in' echo " ${bindir}." echo "" -echo " The various graphics demos (60+ different executables) will" +echo " The various graphics demos (80+ different executables) will" echo " be installed in ${HACKDIR}." echo "" echo " If you would prefer the demos to be installed elsewhere" diff --git a/configure.in b/configure.in index be987088..c805692d 100644 --- a/configure.in +++ b/configure.in @@ -19,8 +19,10 @@ if test -z "$GCC"; then CC="$CC -qlanglvl=ansi -qhalt=e" ;; -# NOTE: for Digital, need to add -std1 to get ANSI, but I'm not sure -# yet what $host pattern we should be testing for... + *-dec-*) + AC_MSG_RESULT(DEC: adding -std1) + CC="$CC -std1" + ;; *) AC_MSG_RESULT(no idea) @@ -38,20 +40,66 @@ AC_TRY_RUN([ main(int ac, char **av) { return 0; } ], case "$host" in *-irix*) - if test -n "$GCC"; then - AC_MSG_RESULT(Turning on gcc compiler warnings.) - CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format" - else - # not gcc - AC_MSG_RESULT(Turning on SGI compiler warnings.) - CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3" - fi + if test -n "$GCC"; then + AC_MSG_RESULT(Turning on gcc compiler warnings.) + CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format" + else + # not gcc + AC_MSG_RESULT(Turning on SGI compiler warnings.) + CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3" + fi + ;; + + *-linux-*) + AC_MSG_RESULT(Turning on gcc compiler warnings.) + CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format" ;; + +# *-dec-osf*) +# if test -z "$GCC"; then +# AC_MSG_RESULT(Turning on DEC C compiler warnings.) +# CC="$CC -migrate -w0 -verbose -warnprotos" +# fi +# ;; + esac +# Try and determine whether ${INSTALL} can create intermediate directories, +# and if not, whether "mkdir -p" works instead. This sets ${INSTALL_DIRS}. +# (But autoconf should earn its keep and do this for us!) +# +AC_DEFUN(AC_PROG_INSTALL_DIRS, + [INSTALL_DIRS='${INSTALL} -d' + AC_MSG_CHECKING(whether \"\${INSTALL} -d\" creates intermediate directories) + rm -rf conftestdir + if mkdir conftestdir; then + cd conftestdir >&- + + ${INSTALL} -d `pwd`/dir1/dir2 >&- 2>&- + if test -d dir1/dir2 ; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + AC_MSG_CHECKING(whether \"mkdir -p\" creates intermediate directories) + rm -rf dir1 + mkdir -p dir1/dir2 >&- 2>&- + if test -d dir1/dir2/. ; then + AC_MSG_RESULT(yes) + INSTALL_DIRS='mkdir -p' + else + AC_MSG_RESULT(no) + fi + fi + cd .. >&- + rm -rf conftestdir + fi +]) + + AC_PROG_CPP AC_PROG_INSTALL +AC_PROG_INSTALL_DIRS AC_PROG_MAKE_SET AC_C_CONST @@ -137,11 +185,10 @@ AC_PATH_XTRA # Try and find the app-defaults directory. # It sucks that autoconf doesn't do this already... # -AC_DEFUN(AC_PATH_X_APP_DEFAULTS_XMKMF, - [ +AC_DEFUN(AC_PATH_X_APP_DEFAULTS_XMKMF,[ rm -fr conftestdir if mkdir conftestdir; then - cd conftestdir + cd conftestdir >&- # Make sure to not put "make" in the Imakefile rules, since we grep it out. cat > Imakefile <<'EOF' acfindx: @@ -151,12 +198,12 @@ EOF # GNU make sometimes prints "make[1]: Entering...", which'd confuse us. eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` fi - cd .. + cd .. >&- rm -fr conftestdir fi]) -AC_DEFUN(AC_PATH_X_APP_DEFAULTS_DIRECT, -[ # Look for the directory under a standard set of common directories. +AC_DEFUN(AC_PATH_X_APP_DEFAULTS_DIRECT,[ + # Look for the directory under a standard set of common directories. # Check X11 before X11Rn because it's often a symlink to the current release. for ac_dir in \ /usr/X11/lib/app-defaults \ @@ -306,6 +353,65 @@ AC_DEFUN(AC_TRY_X_RUN, [ +# Usage: HANDLE_X_PATH_ARG([variable_name], +# [--command-line-option], +# [descriptive string]) +# +# All of the --with options take three forms: +# +# --with-foo (or --with-foo=yes) +# --without-foo (or --with-foo=no) +# --with-foo=/DIR +# +# This function, HANDLE_X_PATH_ARG, deals with the /DIR case. When it sees +# a directory (string beginning with a slash) it checks to see whether +# /DIR/include and /DIR/lib exist, and adds them to $X_CFLAGS and $X_LIBS +# as appropriate. +# +AC_DEFUN(HANDLE_X_PATH_ARG, [ + case "$[$1]" in + yes) ;; + no) ;; + + /*) + AC_MSG_CHECKING([for [$3] headers]) + d=$[$1]/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + AC_MSG_RESULT($d) + else + AC_MSG_RESULT(not found ($d: no such directory)) + fi + + AC_MSG_CHECKING([for [$3] libs]) + d=$[$1]/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + AC_MSG_RESULT($d) + else + AC_MSG_RESULT(not found ($d: no such directory)) + fi + + # replace the directory string with "yes". + [$1]_req="yes" + [$1]=$[$1]_req + ;; + + *) + echo "" + echo "error: argument to [$2] must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + + # why is this necessary? + # if we don't do this, then "./configure --with-motif=/usr/local/lesstif" + # behaves as if "--with-zippy=/usr/local/lesstif" was also present! + withval= + ]) + # check for the HP XHPDisableReset server extension headers. @@ -327,37 +433,112 @@ if test $ac_cv_xpointer != yes; then fi +# Random special-cases for certain pathological OSes. You know who you are. +# case "$host" in *-hpux*) - # Thanks for not making xmkmf find this by default, you losers. + + # The following arcana was gleaned from conversations with + # Eric Schwartz : + # + # On HPUX 10.x, the parts of X that HP considers "standard" live in + # /usr/{include,lib}/X11R6/. The parts that HP doesn't consider + # "standard", notably, Xaw and Xmu, live in /usr/contrib/X11R6/. + # Also, there are symlinks from /usr/include/ and /usr/lib/ into + # /usr/{include,lib}/X11R6/, so that (if you don't use Xmu at all) + # you don't need any -I or -L arguments. + # + # On HPUX 9.x, /usr/{include,lib}/X11R5/ and /usr/contrib/X11R5/ + # are the same division as 10.x. However, there are no symlinks to + # the X stuff from /usr/include/ and /usr/lib/, so -I and -L + # arguments are always necessary. + # + # However, X11R6 was available on HPUX 9.x as a patch: if that + # patch was installed, then all of X11R6 went in to + # /usr/contrib/X11R6/ (there was no /usr/{include,lib}/X11R6/.) + # + # HPUX 8.x was the same as 9.x, but was X11R4 instead (I don't know + # whether R5 was available as a patch; R6 undoubtedly was not.) + # + # So. We try and use the highest numbered pair of + # /usr/{include,lib}/X11R?/ and /usr/contrib/X11R?/{include,lib}/ + # that are available. We do not mix and match different versions + # of X. + # + # Questions I still don't know the answers to: (do you?) + # + # * Does HPUX 10.x come with /usr/contrib/X11R6/ standard? + # Or does that need to be installed separately? + # + # * On HPUX 9.x, where /usr/include/X11R5/ was standard, and + # /usr/contrib/X11R6/ could be installed as a patch, what was in + # that contrib directory? Did it contain so-called "standard" + # X11R6, or did it include Xaw and Xmu as well? If the former, + # where did one find Xaw and Xmu on 9.x R6 systems? Would this + # be a situation where one had to reach into the R5 headers and + # libs to find Xmu? That is, must both R6 and R5 directories + # be on the -I and -L lists in that case? + # + for version in X11R6 X11R5 X11R4 ; do + # if either pair of directories exists... + if test -d /usr/lib/$version || test -d /usr/contrib/$version/lib ; then + # if contrib exists, use it... + if test -d /usr/contrib/$version/lib ; then + X_CFLAGS="$X_CFLAGS -I/usr/contrib/$version/include" + X_LIBS="$X_LIBS -L/usr/contrib/$version/lib" + fi + # if the "standard" one exists, use it. + if test -d /usr/lib/$version ; then + X_CFLAGS="$X_CFLAGS -I/usr/include/$version" + X_LIBS="$X_LIBS -L/usr/lib/$version" + fi + # since at least one of the pair exists, go no farther. + break + fi + done + + # Now find Motif. Thanks for not making xmkmf find this by + # default, you losers. + # if test -d /usr/lib/Motif1.2 ; then - X_CFLAGS="-I/usr/include/Motif1.2 $X_CFLAGS" - X_LIBS="-L/usr/lib/Motif1.2 $X_LIBS" + X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.2" + X_LIBS="$X_LIBS -L/usr/lib/Motif1.2" elif test -d /usr/lib/Motif1.1 ; then - X_CFLAGS="-I/usr/include/Motif1.1 $X_CFLAGS" - X_LIBS="-L/usr/lib/Motif1.1 $X_LIBS" + X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.1" + X_LIBS="$X_LIBS -L/usr/lib/Motif1.1" + fi + + # Now let's check for the pseudo-standard locations for OpenGL and XPM. + # + if test -d /opt/Mesa/lib ; then + X_CFLAGS="-I/opt/Mesa/include $X_CFLAGS" + X_LIBS="-L/opt/Mesa/lib $X_LIBS" fi - # This too. You losers. - if test -d /usr/contrib/X11R6/include ; then - X_CFLAGS="-I/usr/contrib/X11R6/include $X_CFLAGS" - X_LIBS="-L/usr/contrib/X11R6/lib $X_LIBS" - elif test -d /usr/X11R6/include ; then - X_CFLAGS="-I/usr/X11R6/include $X_CFLAGS" - X_LIBS="-L/usr/X11R6/lib $X_LIBS" - elif test -d /usr/contrib/X11R5/include ; then - X_CFLAGS="-I/usr/contrib/X11R5/include $X_CFLAGS" - X_LIBS="-L/usr/contrib/X11R5/lib $X_LIBS" - elif test -d /usr/X11R5/include ; then - X_CFLAGS="-I/usr/X11R5/include $X_CFLAGS" - X_LIBS="-L/usr/X11R5/lib $X_LIBS" + if test -d /opt/xpm/lib/X11 ; then + X_CFLAGS="-I/opt/xpm/include $X_CFLAGS" + X_LIBS="-L/opt/xpm/lib/X11 $X_LIBS" + fi + + # On HPUX, default to installing in /opt/xscreensaver/ instead of + # in /usr/local/, unless there is already an xscreensaver in + # /usr/local/bin/. This can be overridden with the --prefix arg + # to configure. I'm not sure this is the right thing to do, but + # Richard Lloyd says so... + # + if test \! -x /usr/local/bin/xscreensaver ; then + ac_default_prefix=/opt/xscreensaver fi ;; *-solaris*) - # Same to you, pinheads. (Is this really the standard location now? - # What happened to the joke that this kind of thing went in /opt?) + + # Thanks for not making xmkmf find this by default, pinheads. + # And thanks for moving things around again, too. Is this + # really the standard location now? What happened to the + # joke that this kind of thing went in /opt? # cthomp says "answer: CDE (Common Disorganized Environment)" + # if test -f /usr/dt/include/Xm/Xm.h ; then X_CFLAGS="$X_CFLAGS -I/usr/dt/include" X_LIBS="$X_LIBS -L/usr/dt/lib -R:/usr/dt/lib" @@ -428,13 +609,21 @@ fi # have_sgi=no with_sgi_req=unspecified -AC_ARG_WITH(sgi-ext,[ +AC_ARG_WITH(sgi-ext, +[Except where noted, all of the --with options below can also take a +directory argument: for example, --with-motif=/opt/Motif. That would +cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/ +to be added to the -L list, assuming those directories exist. + X Server Extension options: --with-sgi-ext Include support for the SGI SCREEN_SAVER server extension, if possible (this is the default). --without-sgi-ext Do not compile in support for this extension.], [with_sgi="$withval"; with_sgi_req="$withval"],[with_sgi=yes]) + +HANDLE_X_PATH_ARG(with_sgi, --with-sgi-ext, SGI SCREEN_SAVER) + if test $with_sgi = yes; then AC_CHECK_X_HEADER(X11/extensions/XScreenSaver.h, [have_sgi=yes @@ -455,6 +644,9 @@ AC_ARG_WITH(mit-ext, server extension, if possible (this is the default). --without-mit-ext Do not compile in support for this extension.], [with_mit="$withval"; with_mit_req="$withval"],[with_mit=yes]) + +HANDLE_X_PATH_ARG(with_mit, --with-mit-ext, MIT-SCREEN-SAVER) + if test $have_sgi != yes; then if test $with_mit = yes; then AC_CHECK_X_HEADER(X11/extensions/scrnsaver.h, [have_mit=yes]) @@ -505,6 +697,9 @@ AC_ARG_WITH(xidle-ext, if possible (this is the default). --without-xidle-ext Do not compile in support for this extension.], [with_xidle="$withval"; with_xidle_req="$withval"],[with_xidle=yes]) + +HANDLE_X_PATH_ARG(with_xidle, --with-xidle-ext, XIDLE) + if test $with_xidle = yes; then AC_CHECK_X_HEADER(X11/extensions/xidle.h, [have_xidle=yes @@ -524,6 +719,9 @@ AC_ARG_WITH(xshm-ext, extension, if possible (this is the default). --without-xshm-ext Do not compile in support for this extension.], [with_xshm="$withval"; with_xshm_req="$withval"],[with_xshm=yes]) + +HANDLE_X_PATH_ARG(with_xshm, --with-xshm-ext, XSHM) + if test $with_xshm = yes; then # first check for Xshm.h. @@ -575,6 +773,9 @@ AC_ARG_WITH(sgivc-ext, extension, if possible (this is the default). --without-sgivc-ext Do not compile in support for this extension.], [with_sgivc="$withval"; with_sgivc_req="$withval"],[with_sgivc=yes]) + +HANDLE_X_PATH_ARG(with_sgivc, --with-sgivc-ext, SGI-VIDEO-CONTROL) + if test $with_sgivc = yes; then # first check for XSGIvc.h @@ -608,6 +809,9 @@ AC_ARG_WITH(dpms-ext, if possible (this is the default). --without-dpms-ext Do not compile in support for this extension.], [with_dpms="$withval"; with_dpms_req="$withval"],[with_dpms=yes]) + +HANDLE_X_PATH_ARG(with_dpms, --with-dpms-ext, DPMS) + if test $with_dpms = yes; then # first check for dpms.h @@ -644,17 +848,21 @@ with_athena_req=unspecified AC_ARG_WITH(motif,[ X Client Toolkit options: - --with-motif Use the Motif toolkit for the user interface, - if possible (this is the default). + --with-motif Use the Motif toolkit for the user interface, if + possible (this is the default). --without-motif Do not use Motif.], [with_motif="$withval"; with_motif_req="$withval"],[with_motif=no]) +HANDLE_X_PATH_ARG(with_motif, --with-motif, Motif) + AC_ARG_WITH(athena, [ --with-athena Use the Athena toolkit for the user interface, if possible (this is the default if Motif isn't used.) --without-athena Do not use Athena.], [with_athena="$withval"; with_athena_req="$withval"],[with_athena=no]) +HANDLE_X_PATH_ARG(with_athena, --with-athena, Athena) + if test $with_motif != yes -a $with_motif != no ; then echo "error: must be yes or no: --with-motif=$with_motif" exit 1 @@ -772,22 +980,39 @@ if test $have_motif = yes ; then have_lesstif=$ac_cv_have_lesstif fi -# don't cache this -unset ac_cv_good_lesstif +# don't cache these +unset ac_cv_lesstif_version +unset ac_cv_lesstif_version_string + +lesstif_version=unknown +lesstif_version_string=unknown -good_lesstif=no if test $have_lesstif = yes ; then - # It must be at least "GNU Lesstif 0.82". - # #### If you change this, also sync the warning message lower down. - AC_CACHE_CHECK([whether LessTif is of a recent enough vintage], - ac_cv_good_lesstif, - [AC_TRY_X_RUN([#include - int main() { exit(LesstifVersion < 82); }], - [ac_cv_good_lesstif=yes], - [ac_cv_good_lesstif=no], - # cross compiling? Make an ass out of umption. - [ac_cv_good_lesstif=yes])]) - good_lesstif=$ac_cv_good_lesstif + ltv=unknown + echo unknown > conftest-lt + AC_CACHE_CHECK([LessTif version number], + ac_cv_lesstif_version_string, + [AC_TRY_X_RUN([#include + #include + int main() { + FILE *f = fopen("conftest-lt", "w"); + if (!f) exit(1); + fprintf(f, "%d %d.%d\n", LesstifVersion, + LESSTIF_VERSION, LESSTIF_REVISION); + fclose(f); + exit(0); + }], + [ltv=`cat conftest-lt` + ac_cv_lesstif_version=`echo $ltv | sed 's/ .*//'` + ac_cv_lesstif_version_string=`echo $ltv | sed 's/.* //'`], + [ac_cv_lesstif_version=unknown + ac_cv_lesstif_version_string=unknown], + [ac_cv_lesstif_version=unknown + ac_cv_lesstif_version_string=unknown])]) + rm -f conftest-lt + lesstif_version=$ac_cv_lesstif_version + lesstif_version_string=$ac_cv_lesstif_version_string + fi @@ -815,6 +1040,9 @@ Graphics Demo options: if possible (this is the default). --without-xpm Do not compile in support for XPM files.], [with_xpm="$withval"; with_xpm_req="$withval"],[with_xpm=yes]) + +HANDLE_X_PATH_ARG(with_xpm, --with-xpm, XPM) + if test $with_xpm = yes; then AC_CHECK_X_HEADER(X11/xpm.h, [have_xpm=yes @@ -836,6 +1064,11 @@ AC_ARG_WITH(gl, --without-gl Do not build the OpenGL demos.], [with_gl="$withval"; with_gl_req="$withval"],[with_gl=yes]) +HANDLE_X_PATH_ARG(with_gl, --with-gl, GL) + +ac_mesagl_version=unknown +ac_mesagl_version_string=unknown + if test $with_gl = yes; then AC_CHECK_X_HEADER(GL/gl.h, have_gl=yes, have_gl=no) if test $have_gl = yes ; then @@ -847,14 +1080,71 @@ if test $with_gl = yes; then if test $have_gl = yes ; then AC_DEFINE(HAVE_GL) - have_mesa_gl=no - AC_EGREP_X_HEADER(Mesa, GL/glx.h, [have_mesa_gl=yes]) - if test $have_mesa_gl = no ; then + + # We need to know whether it's MesaGL so that we know which libraries + # to link against. + # + AC_MSG_CHECKING(whether GL is really MesaGL) + AC_CACHE_VAL(ac_cv_have_mesa_gl, + [ac_cv_have_mesa_gl=no + AC_EGREP_X_HEADER(Mesa, GL/glx.h, [ac_cv_have_mesa_gl=yes]) + ]) + ac_have_mesa_gl=$ac_cv_have_mesa_gl + AC_MSG_RESULT($ac_have_mesa_gl) + + if test $ac_have_mesa_gl = no ; then + gl_lib_1="GL" GL_LIBS="-lGL -lGLU" else AC_DEFINE(HAVE_MESA_GL) + gl_lib_1="MesaGL" GL_LIBS="-lMesaGL -lMesaGLU" fi + + + # 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. + # + if test $ac_have_mesa_gl = yes; then + + # don't cache these. + unset ac_cv_mesagl_version + unset ac_cv_mesagl_version_string + + AC_MSG_CHECKING(MesaGL version number) + AC_CACHE_VAL(ac_cv_mesagl_version_string, + [cat > conftest.$ac_ext < +#configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION +EOF + + mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC | sed -n \ + 's/^#configure:.*\([0-9][0-9]*\).*\([0-9][0-9]*\).*$/\1.\2/p'` + if test "$mglv" = ""; then + ac_mesagl_version=unknown + ac_mesagl_version_string=unknown + else + ac_mesagl_version_string=$mglv + maj=`echo $mglv | sed -n 's/\..*//p'` + min=`echo $mglv | sed -n 's/.*\.//p'` + ac_mesagl_version=`echo "$maj * 1000 + $min" | bc` + fi + ac_cv_mesagl_version=$ac_mesagl_version + ac_cv_mesagl_version_string=$ac_mesagl_version_string + ]) + ac_mesagl_version=$ac_cv_mesagl_version + ac_mesagl_version_string=$ac_cv_mesagl_version_string + AC_MSG_RESULT($ac_cv_mesagl_version_string) + fi + + + # Check for OpenGL 1.1 features. + # + AC_CHECK_X_LIB($gl_lib_1, glBindTexture, [AC_DEFINE(HAVE_GLBINDTEXTURE)], + [], $GL_LIBS -lX11 -lXext -lm) + fi elif test $with_gl != no; then @@ -873,6 +1163,9 @@ AC_ARG_WITH(readdisplay, --without-readdisplay Do not compile in support for this extension.], [with_readdisplay="$withval"; with_readdisplay_req="$withval"], [with_readdisplay=yes]) + +HANDLE_X_PATH_ARG(with_readdisplay, --with-readdisplay, XReadDisplay) + if test $with_readdisplay = yes; then AC_CHECK_X_HEADER(X11/extensions/readdisplay.h, AC_DEFINE(HAVE_READ_DISPLAY_EXTENSION)) @@ -892,6 +1185,9 @@ AC_ARG_WITH(sgivideo, --without-sgivideo Do not compile in support for this library.], [with_sgivideo="$withval"; with_sgivideo_req="$withval"], [with_sgivideo=yes]) + +HANDLE_X_PATH_ARG(with_sgivideo, --with-sgivideo, Iris Video) + if test $with_sgivideo = yes; then AC_CHECK_X_HEADER(dmedia/vl.h, have_sgivideo=yes) if test $have_sgivideo = yes; then @@ -1079,6 +1375,9 @@ if test $enable_locking = yes; then if possible (this is the default.) --without-kerberos Do not compile in support for Kerberos.], [with_kerberos="$withval"; with_kerberos_req="$withval"],[with_kerberos=yes]) + + HANDLE_X_PATH_ARG(with_kerberos, --with-kerberos, Kerberos) + if test $with_kerberos = yes; then AC_CACHE_CHECK([for Kerberos], ac_cv_kerberos, [AC_TRY_X_COMPILE([#include ],, @@ -1087,7 +1386,14 @@ if test $enable_locking = yes; then if test $ac_cv_kerberos = yes ; then have_kerberos=yes AC_DEFINE(HAVE_KERBEROS) - PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes -lnsl -lsocket" + + # from Tim Showalter + PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes" + AC_CHECK_FUNC(res_search,, + AC_CHECK_LIB(resolv,res_search,PASSWD_LIBS="${PASSWD_LIBS} -lresolv", + AC_MSG_WARN([Can't find DNS resolver libraries needed for Kerberos]) + )) + fi elif test $with_kerberos != no; then echo "error: must be yes or no: --with-kerberos=$with_kerberos" @@ -1103,6 +1409,9 @@ if test $enable_locking = yes; then --without-shadow Do not compile in support for shadow passwords. ], [with_shadow="$withval"; with_shadow_req="$withval"],[with_shadow=yes]) + + HANDLE_X_PATH_ARG(with_shadow, --with-shadow, shadow password) + if test $with_shadow = no; then passwd_cruft_done=yes elif test $with_shadow != yes; then @@ -1285,9 +1594,6 @@ DEPEND_FLAGS= DEPEND_DEFINES= -# Autoconf doesn't seem to have an INSTALL_DIRS, so let's define our own... -INSTALL_DIRS='$(INSTALL) -d' - # Done testing things -- now substitute in some stuff for the Makefiles. # if test $have_motif = yes; then @@ -1370,8 +1676,13 @@ AC_SUBST(DEPEND_DEFINES) # Print some warnings before emitting the Makefiles. # +warn_prefix_1=" Warning:" +warn_prefix_2=" Note:" +warn_prefix="$warn_prefix_1" + warning=no warnsep=' #################################################################' + warnpre() { if test $warning = no ; then echo '' ; echo "$warnsep" ; echo '' @@ -1383,7 +1694,7 @@ warn() { warnpre if test $warning = long ; then echo '' ; fi warning=yes - echo " Warning: $@" + echo "$warn_prefix $@" } warnL() { @@ -1391,7 +1702,7 @@ warnL() { warnpre warning=yes if test $was != no ; then echo '' ; fi - echo " Warning: $@" + echo "$warn_prefix $@" } warn2() { @@ -1399,6 +1710,19 @@ warn2() { warning=long } +note() { + warn_prefix="$warn_prefix_2" + warn $@ + warn_prefix="$warn_prefix_1" +} + +noteL() { + warn_prefix="$warn_prefix_2" + warnL $@ + warn_prefix="$warn_prefix_1" +} + + if test $with_sgi_req = yes -a $have_sgi = no ; then warn 'The SGI saver extension was requested, but was not found.' fi @@ -1438,12 +1762,28 @@ elif test $with_athena_req = yes -a $have_athena = no ; then fi if test $have_motif = yes -a $have_lesstif = yes ; then - if test $good_lesstif != yes ; then - warnL "Motif is being used, but it appears to actually be" - warn2 "LessTif, and the version number is less than 0.82!" - warn2 "Such old versions of LessTif are too buggy to use" - warn2 "with XScreenSaver; it is strongly recommended that" - warn2 "you upgrade! See ." + + preferred_lesstif=0.87 + + if test $lesstif_version = unknown; then + warnL "Unable to determine the LessTif version number!" + warn2 "Make sure you are using version $preferred_lesstif or newer." + warn2 "See ." + + elif test \! $lesstif_version -gt 82; then + warnL "LessTif version $lesstif_version_string is being used." + warn2 "LessTif versions 0.82 and earlier are too buggy to" + warn2 "use with XScreenSaver; it is strongly recommended" + warn2 "that you upgrade to at least version $preferred_lesstif!" + warn2 "See ." + + elif test \! $lesstif_version -gt 86; then + warnL "LessTif version $lesstif_version_string is being used." + warn2 "LessTif versions 0.86 and earlier have a bug that" + warn2 "can cause a security problem with xscreensaver." + warn2 "If you want to use xscreensaver as a screen locker," + warn2 "it is strongly recommended that you upgrade to at" + warn2 "least version $preferred_lesstif. See ." fi fi @@ -1456,12 +1796,58 @@ if test $proselytize_motif = yes ; then warn2 "available as well: see ." fi -if test $with_xpm_req = yes -a $have_xpm = no ; then - warn 'Use of XPM was requested, but it was not found.' + +if test $have_gl = yes -a $ac_have_mesa_gl = yes ; then + preferred_mesagl=2.7 + + if test $ac_mesagl_version = unknown; then + warnL "Unable to determine the MesaGL version number!" + warn2 "Make sure you are using version $preferred_mesagl or newer." + + elif test \! $ac_mesagl_version -gt 2006; then + warnL "MesaGL version $ac_mesagl_version_string is being used." + warn2 "MesaGL versions 2.6 and earlier have a security bug." + warn2 "It is strongly recommended that you upgrade to at" + warn2 "least version $preferred_mesagl." + fi +fi + + +if test $have_xpm = no ; then + if test $with_xpm_req = yes ; then + warnL 'Use of XPM was requested, but it was not found.' + elif test $with_xpm_req = no ; then + noteL 'The XPM library is not being used.' + else + noteL 'The XPM library was not found.' + fi + + echo '' + warn2 'Some of the demos will not be as colorful as they' + warn2 'could be. You might want to consider installing XPM' + warn2 'and re-running configure. (Remember to delete the' + warn2 'config.cache file first.) You can find XPM at most' + warn2 'X11 archive sites, such as .' fi -if test $with_gl_req = yes -a $have_gl = no ; then - warn 'Use of GL was requested, but it was not found.' +if test $have_gl = no ; then + if test $with_gl_req = yes ; then + warnL 'Use of GL was requested, but it was not found.' + elif test $with_gl_req = no ; then + noteL 'The OpenGL 3D library is not being used.' + else + noteL 'The OpenGL 3D library was not found.' + fi + + echo '' + warn2 'Those demos which use 3D will not be built or installed.' + warn2 'You might want to consider installing OpenGL and' + warn2 're-running configure. (Remember to delete the' + warn2 "config.cache file first.) If your vendor doesn't ship" + warn2 'their own implementation of OpenGL, you can get a free' + warn2 'version at .' + warn2 'For general OpenGL info, see .' + fi if test $with_readdisplay_req = yes -a $have_readdisplay = no ; then @@ -1522,7 +1908,7 @@ echo ' When you run "make install", the "xscreensaver" and' echo ' "xscreensaver-command" executables will be installed in' echo " ${bindir}." echo "" -echo " The various graphics demos (60+ different executables) will" +echo " The various graphics demos (80+ different executables) will" echo " be installed in ${HACKDIR}." echo "" echo " If you would prefer the demos to be installed elsewhere" diff --git a/driver/Makefile.in b/driver/Makefile.in index 64e19587..9c789a9f 100644 --- a/driver/Makefile.in +++ b/driver/Makefile.in @@ -48,6 +48,8 @@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ # X_EXTRA_LIBS contains extra libraries needed by X that aren't a part of X. # (e.g., -lsocket, -lnsl, etc.) # +# I think (but am not totally sure) that LIBS is also really "LDFLAGS". +# # SAVER_LIBS is the link line for "xscreensaver", and # CMD_LIBS is the link line for "xscreensaver-command". @@ -75,6 +77,8 @@ KERBEROS_OBJS = kpasswd.o LOCK_SRCS_1 = lock.c LOCK_OBJS_1 = lock.o +TEST_SRCS = test-passwd.c test-uid.c + DIALOG_SRCS = @DIALOG_SRCS@ DIALOG_OBJS = @DIALOG_OBJS@ PASSWD_SRCS = @PASSWD_SRCS@ @@ -93,10 +97,10 @@ UTIL_OBJS = $(UTILS_BIN)/fade.o $(UTILS_BIN)/overlay.o \ $(UTILS_BIN)/spline.o \ $(UTILS_BIN)/yarandom.o @XMU_OBJS@ -SAVER_SRCS_1 = demo.c stderr.c subprocs.c timers.c windows.c \ - xscreensaver.c xset.c -SAVER_OBJS_1 = demo.o stderr.o subprocs.o timers.o windows.o \ - xscreensaver.o xset.o +SAVER_SRCS_1 = demo.c stderr.c subprocs.c setuid.c timers.c windows.c \ + xscreensaver.c splash.c xset.c +SAVER_OBJS_1 = demo.o stderr.o subprocs.o setuid.o timers.o windows.o \ + xscreensaver.o splash.o xset.o SAVER_SRCS = $(SAVER_SRCS_1) $(DIALOG_SRCS) $(LOCK_SRCS) $(UTIL_SRCS) SAVER_OBJS = $(SAVER_OBJS_1) $(DIALOG_OBJS) $(LOCK_OBJS) $(UTIL_OBJS) @@ -104,9 +108,9 @@ SAVER_OBJS = $(SAVER_OBJS_1) $(DIALOG_OBJS) $(LOCK_OBJS) $(UTIL_OBJS) CMD_SRCS = xscreensaver-command.c CMD_OBJS = xscreensaver-command.o -SAVER_LIBS = $(X_LIBS) $(X_PRE_LIBS) @SAVER_LIBS@ -lXt \ - -lX11 -lXext $(X_EXTRA_LIBS) $(PASSWD_LIBS) \ - $(LIBS) +SAVER_LIBS = $(LIBS) $(X_LIBS) @SAVER_LIBS@ \ + $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS) \ + $(PASSWD_LIBS) CMD_LIBS = $(X_LIBS) $(X_PRE_LIBS) \ -lX11 -lXext $(X_EXTRA_LIBS) \ @@ -123,7 +127,7 @@ VMSFILES = compile_axp.com compile_decc.com link_axp.com link_decc.com \ TARFILES = $(EXTRAS) $(VMSFILES) $(SAVER_SRCS_1) \ $(MOTIF_SRCS) $(ATHENA_SRCS) $(PWENT_SRCS) $(KERBEROS_SRCS) \ - $(LOCK_SRCS_1) $(CMD_SRCS) $(HDRS) $(MEN) + $(LOCK_SRCS_1) $(CMD_SRCS) $(HDRS) $(TEST_SRCS) $(MEN) all: $(EXES) @@ -136,7 +140,8 @@ install-strip: INSTALL_SETUID='$(INSTALL_SETUID) -s' \ install -install-program: +install-program: $(EXES) + @if [ ! -d $(bindir) ]; then $(INSTALL_DIRS) $(bindir) ; fi @inst="$(INSTALL_PROGRAM)" ; \ if [ @NEED_SETUID@ = yes ]; then \ me="`whoami`" ; \ @@ -156,16 +161,15 @@ install-program: $$e "" ;\ fi ; \ fi ; \ - if [ ! -d $(bindir) ]; then $(INSTALL_DIRS) $(bindir) ; fi ; \ echo $$inst xscreensaver $(bindir)/xscreensaver ; \ $$inst xscreensaver $(bindir)/xscreensaver $(INSTALL_PROGRAM) xscreensaver-command $(bindir)/xscreensaver-command -install-ad: - @if [ ! -d $(AD_DIR) ]; then $(INSTALL_DIRS) $(AD_DIR) ; fi ; \ +install-ad: XScreenSaver.ad + @if [ ! -d $(AD_DIR) ]; then $(INSTALL_DIRS) $(AD_DIR) ; fi $(INSTALL_DATA) XScreenSaver.ad $(AD_DIR)/XScreenSaver -install-man: +install-man: $(MEN) @men="$(MEN)" ; \ if [ ! -d $(man1dir) ]; then $(INSTALL_DIRS) $(man1dir) ; fi ; \ for man in $$men; do \ @@ -195,7 +199,7 @@ clean: -rm -f *.o a.out core $(EXES) XScreenSaver_ad.h distclean: clean - -rm -f Makefile XScreenSaver.ad *~ "#"* + -rm -f Makefile XScreenSaver.ad TAGS *~ "#"* # Adds all current dependencies to Makefile depend: XScreenSaver_ad.h @@ -317,7 +321,7 @@ xscreensaver-command: $(CMD_OBJS) TEST_PASSWD_OBJS = test-passwd.o $(LOCK_OBJS_1) $(PWENT_OBJS) $(DIALOG_OBJS) \ - subprocs.o demo.o \ + subprocs.o setuid.o demo.o \ $(UTIL_OBJS) test-passwd: $(TEST_PASSWD_OBJS) @@ -326,6 +330,7 @@ test-passwd: $(TEST_PASSWD_OBJS) ############################################################################## # # DO NOT DELETE: updated by make distdepend +# $(srcdir)/DO $(srcdir)/NOT $(srcdir)/DELETE: $(srcdir)/updated $(srcdir)/by $(srcdir)/make $(srcdir)/distdepend demo.o: ../config.h demo.o: $(srcdir)/xscreensaver.h @@ -337,6 +342,8 @@ stderr.o: $(UTILS_SRC)/visual.h subprocs.o: ../config.h subprocs.o: $(srcdir)/xscreensaver.h subprocs.o: $(UTILS_SRC)/yarandom.h +setuid.o: ../config.h +setuid.o: $(srcdir)/xscreensaver.h timers.o: ../config.h timers.o: $(srcdir)/xscreensaver.h windows.o: ../config.h @@ -350,6 +357,9 @@ xscreensaver.o: $(UTILS_SRC)/yarandom.h xscreensaver.o: $(UTILS_SRC)/resources.h xscreensaver.o: $(UTILS_SRC)/visual.h xscreensaver.o: XScreenSaver_ad.h +splash.o: ../config.h +splash.o: $(srcdir)/xscreensaver.h +splash.o: $(UTILS_SRC)/visual.h xset.o: ../config.h xset.o: $(srcdir)/xscreensaver.h dialogs-Xm.o: ../config.h diff --git a/driver/XScreenSaver.ad.in b/driver/XScreenSaver.ad.in index 7c29cd78..932dead4 100644 --- a/driver/XScreenSaver.ad.in +++ b/driver/XScreenSaver.ad.in @@ -4,11 +4,11 @@ ! a screen saver and locker for the X window system ! by Jamie Zawinski ! -! version 2.24 -! 30-Jun-98 +! version 2.31 +! 02-Oct-98 ! ! See "man xscreensaver" for more info. The latest version is always -! available at http://people.netscape.com/jwz/xscreensaver/ +! available at http://www.jwz.org/xscreensaver/ *timeout: 10 *cycle: 10 @@ -22,6 +22,8 @@ *unfade: False *fadeSeconds: 3 *fadeTicks: 20 +*splash: True +*splashDuration: 5 *captureStderr: True *captureStdout: True @@ -30,6 +32,13 @@ *overlayStderr: True *font: *-medium-r-*-140-*-m-* +! This is the URL that the "Help" button on the splash screen loads. +*helpURL: http://www.jwz.org/xscreensaver/man.html + +! This is how the "Help" button loads URLs (in /bin/sh syntax.) +*loadURL: netscape -remote 'openURL(%s)' || netscape '%s' & + + ! Turning on "installColormap" interacts erratically with twm and tvtwm, ! but seems to work fine with mwm and olwm. Try it and see. If your ! screen turns some color other than black, the window manager is buggy, @@ -164,7 +173,9 @@ @GL_KLUDGE_2@ pipes -root \n\ @GL_KLUDGE_2@ sproingies -root \n\ @GL_KLUDGE_2@ rubik -root \n\ -@GL_KLUDGE_2@ atlantis -root \n +@GL_KLUDGE_2@ atlantis -root \n\ +@GL_KLUDGE_2@ lament -root \n\ +@GL_KLUDGE_2@ bubble3d -root \n ! A few of the hacks require OpenGL, and will only be built if you have it. @@ -277,6 +288,10 @@ *passwdDialog*fontList: *-helvetica-medium-r-*-*-*-140-*-*-*-iso8859-1 *XmTextField.fontList: *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1 *passwdDialog.passwdText.fontList: *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1 +*splashDialog*fontList: *-helvetica-bold-r-*-*-*-120-*-*-*-iso8859-1 +*splashDialog*splashLabel1.fontList: *-times-bold-r-*-*-*-180-*-*-*-iso8859-1 +*splashDialog*splashLabel2.fontList: *-times-bold-r-*-*-*-140-*-*-*-iso8859-1 +*splashDialog*splashLabel3.fontList: *-times-bold-r-*-*-*-140-*-*-*-iso8859-1 XScreenSaver*XmList.fontList: *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1 ! Need to fully-qualify the preceeding in the case of of *sgiMode. @@ -300,8 +315,8 @@ XScreenSaver*XmDialogShell*rogerLabel.background: #FFFFFF *label1.labelString: XScreenSaver %s *label1.label: XScreenSaver %s -*label2.labelString: Copyright © 1991-1998 by Jamie Zawinski -*label2.label: Copyright © 1991-1998 by Jamie Zawinski +*label2.labelString: Copyright © 1991-1998 by Jamie Zawinski +*label2.label: Copyright © 1991-1998 by Jamie Zawinski *demoList.visibleItemCount: 10 *demoList.automaticSelection: True *next.labelString: Run Next @@ -340,6 +355,21 @@ XScreenSaver*XmDialogShell*rogerLabel.background: #FFFFFF *passwdLabel3.alignment: ALIGNMENT_BEGINNING *rogerLabel.width: 150 +*splashDialog.title: XScreenSaver +*splashLabel1.labelString: XScreenSaver %s +*splashLabel2.labelString: Copyright © 1991-1998 by +*splashLabel3.labelString: Jamie Zawinski +*splashDemo.labelString: Demo +*splashPrefs.labelString: Prefs +*splashDialog*Help.labelString: Help + +*splashLabel1.alignment: ALIGNMENT_CENTER +*splashLabel2.alignment: ALIGNMENT_CENTER +*splashLabel3.alignment: ALIGNMENT_CENTER + +*splashDialog.borderWidth: 1 +*splashForm.shadowThickness: 4 + ! Disable Motif drag-and-drop in dialog boxes. This is kind of pathetic, but ! in some older versions of Motif, most any attempt to drag cause immediate ! flaming death from above. This *should* rip the legs off that bug. @@ -354,6 +384,10 @@ XScreenSaver*dragReceiverProtocolStyle: DRAG_NONE *demo_dialog*font: *-helvetica-bold-r-*-*-*-120-*-*-*-iso8859-1 *resources_dialog*font: *-helvetica-bold-r-*-*-*-120-*-*-*-iso8859-1 *passwd_dialog*font: *-helvetica-bold-r-*-*-*-120-*-*-*-iso8859-1 +*splash_dialog*font: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1 +*splash_dialog*splashLabel1.font: *-times-bold-r-*-*-*-180-*-*-*-iso8859-1 +*splash_dialog*splashLabel2.font: *-times-bold-r-*-*-*-140-*-*-*-iso8859-1 +*splash_dialog*splashLabel3.font: *-times-bold-r-*-*-*-140-*-*-*-iso8859-1 *demo_dialog*label1.font: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1 *resources_dialog*label1.font: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1 XScreenSaver.demo_dialog*List.font: \ @@ -384,6 +418,13 @@ XScreenSaver.passwd_dialog*Text*background: #FFFFFF XScreenSaver.passwd_dialog*roger.foreground: #CD0000 XScreenSaver.passwd_dialog*roger.background: #FFFFFF +XScreenSaver.splash_dialog*foreground: #000000 +XScreenSaver.splash_dialog*background: #E5E5E5 +XScreenSaver.splash_dialog*Command.background: #D9D9D9 +XScreenSaver.splash_dialog*Text*background: #FFFFFF +XScreenSaver.splash_dialog*roger.foreground: #CD0000 +XScreenSaver.splash_dialog*roger.background: #FFFFFF + *demo_dialog*viewport.height: 200 *Form.borderWidth: 0 *Box.borderWidth: 0 @@ -427,6 +468,25 @@ XScreenSaver.demo_dialog*Command.internalHeight: 4 *passwd_dialog*roger.height: 150 *passwd_dialog*roger.borderWidth: 1 +*splash_dialog*splashLabel1.label: XScreenSaver %s +*splash_dialog*splashLabel2.label: Copyright © 1991-1998 by +*splash_dialog*splashLabel3.label: Jamie Zawinski +*splash_dialog*splash_form*label.label: +*splash_dialog*Dialog.label: +*splash_dialog*splash_form.borderWidth: 0 +*splash_dialog*roger.width: 150 +*splash_dialog*roger.height: 150 +*splash_dialog*roger.borderWidth: 1 +*splash_dialog*demo.label: Demo +*splash_dialog*prefs.label: Prefs +*splash_dialog*help.label: Help +*splash_dialog.box.defaultDistance: 0 +*splash_dialog*splashLabel1.internalHeight: 10 +*splash_dialog*splashLabel1.internalWidth: 10 +*splash_dialog*splashLabel2.internalHeight: 0 +*splash_dialog*splashLabel3.internalHeight: 0 + + ! You probably won't need to change these. They are only used if no server ! extension is in use. diff --git a/driver/XScreenSaver_ad.h b/driver/XScreenSaver_ad.h index 315208e2..bb83d0fb 100644 --- a/driver/XScreenSaver_ad.h +++ b/driver/XScreenSaver_ad.h @@ -10,12 +10,16 @@ "*unfade: False", "*fadeSeconds: 3", "*fadeTicks: 20", +"*splash: True", +"*splashDuration: 5", "*captureStderr: True", "*captureStdout: True", "*overlayTextForeground: #FFFF00", "*overlayTextBackground: #000000", "*overlayStderr: True", "*font: *-medium-r-*-140-*-m-*", +"*helpURL: http://www.jwz.org/xscreensaver/man.html", +"*loadURL: netscape -remote 'openURL(%s)' || netscape '%s' &", "*installColormap: True", "*programs: qix -root -solid -delay 0 -segments 100 \\n\ attraction -root -mode balls \\n\ @@ -116,13 +120,19 @@ pipes -root \\n\ sproingies -root \\n\ rubik -root \\n\ - atlantis -root \\n", + atlantis -root \\n\ + lament -root \\n\ + bubble3d -root \\n", " ", "*fontList: *-helvetica-medium-r-*-*-*-120-*-*-*-iso8859-1", "*demoDialog*label1.fontList: *-helvetica-medium-r-*-*-*-140-*-*-*-iso8859-1", "*passwdDialog*fontList: *-helvetica-medium-r-*-*-*-140-*-*-*-iso8859-1", "*XmTextField.fontList: *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1", "*passwdDialog.passwdText.fontList: *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1", +"*splashDialog*fontList: *-helvetica-bold-r-*-*-*-120-*-*-*-iso8859-1", +"*splashDialog*splashLabel1.fontList: *-times-bold-r-*-*-*-180-*-*-*-iso8859-1", +"*splashDialog*splashLabel2.fontList: *-times-bold-r-*-*-*-140-*-*-*-iso8859-1", +"*splashDialog*splashLabel3.fontList: *-times-bold-r-*-*-*-140-*-*-*-iso8859-1", "XScreenSaver*XmList.fontList: *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1", "*XmDialogShell*foreground: #000000", "*XmDialogShell*background: #E5E5E5", @@ -138,8 +148,8 @@ "*demoDialog.maxWidth: 600", "*label1.labelString: XScreenSaver %s", "*label1.label: XScreenSaver %s", -"*label2.labelString: Copyright © 1991-1998 by Jamie Zawinski ", -"*label2.label: Copyright © 1991-1998 by Jamie Zawinski ", +"*label2.labelString: Copyright © 1991-1998 by Jamie Zawinski ", +"*label2.label: Copyright © 1991-1998 by Jamie Zawinski ", "*demoList.visibleItemCount: 10", "*demoList.automaticSelection: True", "*next.labelString: Run Next", @@ -172,11 +182,27 @@ "*passwdLabel2.alignment: ALIGNMENT_BEGINNING", "*passwdLabel3.alignment: ALIGNMENT_BEGINNING", "*rogerLabel.width: 150", +"*splashDialog.title: XScreenSaver", +"*splashLabel1.labelString: XScreenSaver %s", +"*splashLabel2.labelString: Copyright © 1991-1998 by", +"*splashLabel3.labelString: Jamie Zawinski ", +"*splashDemo.labelString: Demo", +"*splashPrefs.labelString: Prefs", +"*splashDialog*Help.labelString: Help", +"*splashLabel1.alignment: ALIGNMENT_CENTER", +"*splashLabel2.alignment: ALIGNMENT_CENTER", +"*splashLabel3.alignment: ALIGNMENT_CENTER", +"*splashDialog.borderWidth: 1", +"*splashForm.shadowThickness: 4", "XScreenSaver*dragInitiatorProtocolStyle: DRAG_NONE", "XScreenSaver*dragReceiverProtocolStyle: DRAG_NONE", "*demo_dialog*font: *-helvetica-bold-r-*-*-*-120-*-*-*-iso8859-1", "*resources_dialog*font: *-helvetica-bold-r-*-*-*-120-*-*-*-iso8859-1", "*passwd_dialog*font: *-helvetica-bold-r-*-*-*-120-*-*-*-iso8859-1", +"*splash_dialog*font: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1", +"*splash_dialog*splashLabel1.font: *-times-bold-r-*-*-*-180-*-*-*-iso8859-1", +"*splash_dialog*splashLabel2.font: *-times-bold-r-*-*-*-140-*-*-*-iso8859-1", +"*splash_dialog*splashLabel3.font: *-times-bold-r-*-*-*-140-*-*-*-iso8859-1", "*demo_dialog*label1.font: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1", "*resources_dialog*label1.font: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1", "XScreenSaver.demo_dialog*List.font: \ @@ -202,6 +228,12 @@ "XScreenSaver.passwd_dialog*Text*background: #FFFFFF", "XScreenSaver.passwd_dialog*roger.foreground: #CD0000", "XScreenSaver.passwd_dialog*roger.background: #FFFFFF", +"XScreenSaver.splash_dialog*foreground: #000000", +"XScreenSaver.splash_dialog*background: #E5E5E5", +"XScreenSaver.splash_dialog*Command.background: #D9D9D9", +"XScreenSaver.splash_dialog*Text*background: #FFFFFF", +"XScreenSaver.splash_dialog*roger.foreground: #CD0000", +"XScreenSaver.splash_dialog*roger.background: #FFFFFF", "*demo_dialog*viewport.height: 200", "*Form.borderWidth: 0", "*Box.borderWidth: 0", @@ -240,6 +272,23 @@ "*passwd_dialog*roger.width: 150", "*passwd_dialog*roger.height: 150", "*passwd_dialog*roger.borderWidth: 1", +"*splash_dialog*splashLabel1.label: XScreenSaver %s", +"*splash_dialog*splashLabel2.label: Copyright © 1991-1998 by", +"*splash_dialog*splashLabel3.label: Jamie Zawinski ", +"*splash_dialog*splash_form*label.label: ", +"*splash_dialog*Dialog.label: ", +"*splash_dialog*splash_form.borderWidth: 0", +"*splash_dialog*roger.width: 150", +"*splash_dialog*roger.height: 150", +"*splash_dialog*roger.borderWidth: 1", +"*splash_dialog*demo.label: Demo", +"*splash_dialog*prefs.label: Prefs", +"*splash_dialog*help.label: Help", +"*splash_dialog.box.defaultDistance: 0", +"*splash_dialog*splashLabel1.internalHeight: 10", +"*splash_dialog*splashLabel1.internalWidth: 10", +"*splash_dialog*splashLabel2.internalHeight: 0", +"*splash_dialog*splashLabel3.internalHeight: 0", "XScreenSaver.pointerPollTime: 5", "XScreenSaver.initialDelay: 0", "XScreenSaver.windowCreationTimeout: 30", diff --git a/driver/demo.c b/driver/demo.c index 10a177ef..99ea27cb 100644 --- a/driver/demo.c +++ b/driver/demo.c @@ -1,5 +1,5 @@ /* demo.c --- implements the interactive demo-mode and options dialogs. - * xscreensaver, Copyright (c) 1993-1998 Jamie Zawinski + * xscreensaver, Copyright (c) 1993-1998 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -15,6 +15,7 @@ #endif #include +#include /* We don't actually use any widget internals, but these are included so that gdb will have debug info for the widgets... */ @@ -30,7 +31,6 @@ #else /* HAVE_ATHENA */ /* Athena demo code contributed by Jon A. Christopher */ /* Copyright 1997, with the same permissions as above. */ -# include # include # include # include @@ -49,6 +49,10 @@ #include #include +#ifdef _VROOT_H_ +ERROR! You must not include vroot.h in this file. +#endif + static void demo_mode_hack (saver_info *si, char *); static void demo_mode_done (saver_info *si); @@ -67,6 +71,8 @@ extern Widget lock_time_text, passwd_time_text; extern Widget verbose_toggle, cmap_toggle, fade_toggle, unfade_toggle, lock_toggle; +extern Widget splash_dialog; + #ifdef HAVE_MOTIF @@ -216,8 +222,13 @@ static void text_cb (Widget text_widget, XtPointer client_data, XtPointer call_data) { saver_info *si = (saver_info *) client_data; + saver_preferences *p = &si->prefs; char *line; line = get_text_string (text_widget); + + if (p->verbose_p) + fprintf (stderr, "%s: processing text \"%s\".\n", blurb(), line); + demo_mode_hack (si, line); } @@ -273,19 +284,6 @@ select_cb (Widget button, XtPointer client_data, XtPointer call_data) } -#if 0 /* configure does this now */ -#ifdef HAVE_ATHENA -# if !defined(_Viewport_h) - /* The R4 Athena libs don't have this function. I don't know the right - way to tell, but I note that the R5 version of Viewport.h defines - _XawViewport_h, while the R4 version defines _Viewport_h. So we'll - try and key off of that... */ -# define HAVE_XawViewportSetCoordinates -# endif -#endif /* HAVE_ATHENA */ -#endif /* 0 */ - - /* Why this behavior isn't automatic in *either* toolkit, I'll never know. */ static void @@ -373,7 +371,12 @@ static void next_cb (Widget button, XtPointer client_data, XtPointer call_data) { saver_info *si = (saver_info *) client_data; + saver_preferences *p = &si->prefs; + if (p->verbose_p) + fprintf (stderr, "%s: Run Next\n", blurb()); + + { #ifdef HAVE_ATHENA int cnt; XawListReturnStruct *current = XawListShowCurrent(demo_list); @@ -418,6 +421,7 @@ next_cb (Widget button, XtPointer client_data, XtPointer call_data) demo_mode_hack (si, get_text_string (text_line)); #endif /* HAVE_MOTIF */ + } } @@ -425,7 +429,12 @@ static void prev_cb (Widget button, XtPointer client_data, XtPointer call_data) { saver_info *si = (saver_info *) client_data; + saver_preferences *p = &si->prefs; + + if (p->verbose_p) + fprintf (stderr, "%s: Run Previous\n", blurb()); + { #ifdef HAVE_ATHENA XawListReturnStruct *current=XawListShowCurrent(demo_list); if (current->list_index == XAW_LIST_NONE) @@ -463,6 +472,7 @@ prev_cb (Widget button, XtPointer client_data, XtPointer call_data) demo_mode_hack (si, get_text_string (text_line)); #endif /* HAVE_MOTIF */ + } } @@ -474,7 +484,12 @@ edit_cb (Widget button, XtPointer client_data, XtPointer call_data) { saver_info *si = (saver_info *) client_data; saver_screen_info *ssi = si->default_screen; + saver_preferences *p = &si->prefs; Widget parent = ssi->toplevel_shell; + + if (p->verbose_p) + fprintf (stderr, "%s: Preferences\n", blurb()); + if (! resources_dialog) make_resources_dialog (si, parent); pop_resources_dialog (si); @@ -492,6 +507,9 @@ static void restart_cb (Widget button, XtPointer client_data, XtPointer call_data) { saver_info *si = (saver_info *) client_data; + saver_preferences *p = &si->prefs; + if (p->verbose_p) + fprintf (stderr, "%s: Restart\n", blurb()); demo_mode_restart_process (si); } @@ -547,6 +565,10 @@ pop_up_dialog_box (Widget dialog, Widget form, int where) x = (sw + w) / 2 - w; y = (sh + h) / 2 - h; break; + case 3: /* center it in the top 2/3rds of the screen */ + x = (sw + w) / 2 - w; + y = (sh*2/3 + h) / 2 - h; + break; default: abort (); } @@ -570,7 +592,8 @@ pop_up_dialog_box (Widget dialog, Widget form, int where) XtManageChild (form); #endif /* HAVE_MOTIF */ - steal_focus_and_colormap (dialog); + if (dialog != splash_dialog) + steal_focus_and_colormap (dialog); } @@ -687,7 +710,7 @@ make_screenhack_dialog (saver_info *si) /* Why isn't the viewport getting centered? */ XtVaGetValues(viewport, XtNx, &x, XtNy, &y, XtNheight, &h, XtNborderWidth, &bw, 0); - printf("%d %d %d %d\n", x, y, w, h); +/* printf("%d %d %d %d\n", x, y, w, h); */ XtConfigureWidget(viewport, x, y, w2-x-x, h, bw); /* And the text line, too. */ @@ -792,9 +815,15 @@ res_bool_cb (Widget button, XtPointer client_data, XtPointer call_data) static void res_cancel_cb (Widget button, XtPointer client_data, XtPointer call_data) { + saver_info *si = (saver_info *) client_data; + saver_preferences *p = &si->prefs; + XtDestroyWidget (resources_dialog); resources_dialog = 0; raise_screenhack_dialog (); + + if (p->verbose_p) + fprintf (stderr, "%s: lowering preferences dialog.\n", blurb()); } @@ -974,6 +1003,9 @@ pop_resources_dialog (saver_info *si) saver_preferences *p = &si->prefs; char buf [100]; + if (p->verbose_p) + fprintf (stderr, "%s: raising preferences dialog.\n", blurb()); + res.timeout = p->timeout / 1000; res.cycle = p->cycle / 1000; res.lock_time = p->lock_timeout / 1000; @@ -1016,10 +1048,19 @@ void demo_mode (saver_info *si) { saver_preferences *p = &si->prefs; + Bool prefs_p = (si->demo_mode_p == (Bool) 2); /* kludge! */ + + if (p->verbose_p) + fprintf (stderr, "%s: Demo Mode.\n", blurb()); + si->dbox_up_p = True; monitor_power_on (si); raise_window (si, True, False, False); make_screenhack_dialog (si); + + if (prefs_p) + edit_cb (0, si, 0); /* pop up preferences panel */ + while (si->demo_mode_p) { XEvent event; @@ -1041,10 +1082,11 @@ demo_mode (saver_info *si) start_notice_events_timer (si, event.xcreatewindow.window); #ifdef DEBUG_TIMERS if (p->verbose_p) - printf ("%s: starting notice_events_timer for 0x%X (%lu)\n", - blurb(), - (unsigned int) event.xcreatewindow.window, - p->notice_events_timeout); + fprintf (stderr, + "%s: starting notice_events_timer for 0x%X (%lu)\n", + blurb(), + (unsigned int) event.xcreatewindow.window, + p->notice_events_timeout); #endif /* DEBUG_TIMERS */ } break; @@ -1077,9 +1119,18 @@ demo_mode (saver_info *si) break; } } + + if (p->verbose_p) + fprintf (stderr, "%s: Demo Mode done.\n", blurb()); + + kill_screenhack (si); + destroy_screenhack_dialogs (si); initialize_screensaver_window (si); + si->dbox_up_p = False; + si->demo_hack = 0; + si->demo_mode_p = True; /* kludge to inhibit unfade... */ unblank_screen (si); si->demo_mode_p = False; @@ -1100,10 +1151,5 @@ demo_mode_hack (saver_info *si, char *hack) static void demo_mode_done (saver_info *si) { - kill_screenhack (si); - if (si->demo_hack) - unblank_screen (si); si->demo_mode_p = False; - si->dbox_up_p = False; - si->demo_hack = 0; } diff --git a/driver/dialogs-Xaw.c b/driver/dialogs-Xaw.c index 1555544b..2487754d 100644 --- a/driver/dialogs-Xaw.c +++ b/driver/dialogs-Xaw.c @@ -1,5 +1,5 @@ /* dialogs-Xaw.c --- Athena widgets for demo, options, and password dialogs. - * xscreensaver, Copyright (c) 1997 Jamie Zawinski + * xscreensaver, Copyright (c) 1997, 1998 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -73,6 +73,14 @@ Widget done; Widget restart; /*Widget spacer;*/ +Widget splash_dialog; +Widget splash_form; +Widget splash_roger_label; +Widget splash_label1; +Widget splash_label3; +Widget splash_demo; +Widget splash_prefs; +Widget splash_help; static Widget buttonbox, textbox, okbox; @@ -322,3 +330,63 @@ create_demo_dialog(Widget parent, Visual *visual, Colormap colormap) restart = XtVaCreateManagedWidget("restart", commandWidgetClass, box, NULL); done = XtVaCreateManagedWidget("done", commandWidgetClass, box, NULL); } + + +void +create_splash_dialog(Widget parent, Visual *visual, Colormap colormap) +{ + Widget box, splash_label2; + int depth = visual_depth(XtScreen(parent), visual); + + splash_dialog = + XtVaCreatePopupShell("splash_dialog", transientShellWidgetClass, parent, + XtNtitle, NULL, + XtNoverrideRedirect, TRUE, + XtNvisual, visual, + XtNcolormap, colormap, + XtNdepth, depth, + NULL); + + box = XtVaCreateManagedWidget("box", formWidgetClass, splash_dialog, + XtNleft, XtChainLeft, + XtNright, XtChainRight, + XtNtop, XtChainTop, + XtNbottom, XtChainBottom, + XtNvisual, visual, + XtNcolormap, colormap, + XtNdepth, depth, + NULL); + + splash_roger_label = XtVaCreateManagedWidget("roger", labelWidgetClass, box, + XtNlabel, "", + XtNleft, XtChainLeft, + XtNright, XtChainRight, + XtNtop, XtChainTop, + NULL); + + splash_label1 = XtVaCreateManagedWidget("splashLabel1", labelWidgetClass, + box, + XtNfromHoriz, splash_roger_label, + XtNright, XtChainRight, + XtNtop, XtChainTop, + NULL); + splash_label2 = XtVaCreateManagedWidget("splashLabel2", labelWidgetClass, + box, + XtNfromHoriz, splash_roger_label, + XtNright, XtChainRight, + XtNfromVert, splash_label1, + NULL); + splash_label3 = XtVaCreateManagedWidget("splashLabel3", labelWidgetClass, + box, + XtNfromHoriz, splash_roger_label, + XtNright, XtChainRight, + XtNfromVert, splash_label2, + NULL); + + splash_form = + XtVaCreateManagedWidget("splash_form", dialogWidgetClass, box, + XtNfromHoriz, splash_roger_label, + XtNright, XtChainRight, + XtNfromVert, splash_label3, + NULL); +} diff --git a/driver/dialogs-Xm.c b/driver/dialogs-Xm.c index 0daa7b35..5a5d73e8 100644 --- a/driver/dialogs-Xm.c +++ b/driver/dialogs-Xm.c @@ -1,5 +1,5 @@ /* dialogs-Xm.c --- Motif widgets for demo, options, and password dialogs. - * xscreensaver, Copyright (c) 1993-1997 Jamie Zawinski + * xscreensaver, Copyright (c) 1993-1998 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -80,6 +80,14 @@ Widget done; Widget restart; Widget spacer; +Widget splash_dialog; +Widget splash_form; +Widget splash_roger_label; +Widget splash_label1; +Widget splash_label3; +Widget splash_demo; +Widget splash_prefs; +Widget splash_help; void create_passwd_dialog(Widget parent, Visual *visual, Colormap colormap) @@ -699,3 +707,133 @@ create_demo_dialog(Widget parent, Visual *visual, Colormap colormap) demo_form = real_dialog; } + + +void +create_splash_dialog(Widget parent, Visual *visual, Colormap colormap) +{ + Widget shell; + Widget form1; + Widget roger; + Widget dialog; + Widget form2; + Widget label1, label2, label3; + Widget demo, prefs, help; + Widget w; + Arg al[64]; + int ac = 0; + + ac = 0; + XtSetArg (al[ac], XmNvisual, visual); ac++; + XtSetArg (al[ac], XmNcolormap, colormap); ac++; + XtSetArg (al[ac], XmNdepth, visual_depth(XtScreen(parent), visual)); ac++; + + shell = XmCreateDialogShell (parent, "splashDialog", al, ac); + + form1 = XmCreateForm (shell, "form", 0, 0); + + roger = XmCreateDrawnButton (form1, "rogerLabel", 0, 0); + + dialog = XmCreateSelectionBox (form1, "splashForm", al, ac); + + form2 = XmCreateForm ( dialog, "form", 0, 0); + label1 = XmCreateLabel ( form2, "splashLabel1", 0, 0); + label2 = XmCreateLabel ( form2, "splashLabel2", 0, 0); + label3 = XmCreateLabel ( form2, "splashLabel3", 0, 0); + + ac = 0; + XtSetArg(al[ac], XmNtraversalOn, False); ac++; + + demo = XmCreatePushButton (dialog, "splashDemo", al, ac); + prefs = XmCreatePushButton (dialog, "splashPrefs", al, ac); + help = XmSelectionBoxGetChild (dialog, XmDIALOG_HELP_BUTTON); + XtSetValues(help, al, ac); + + w = XmSelectionBoxGetChild (dialog, XmDIALOG_OK_BUTTON); + if (w) XtUnmanageChild (w); + w = XmSelectionBoxGetChild (dialog, XmDIALOG_CANCEL_BUTTON); + if (w) XtUnmanageChild (w); + w = XmSelectionBoxGetChild (dialog, XmDIALOG_APPLY_BUTTON); + if (w) XtUnmanageChild (w); + w = XmSelectionBoxGetChild (dialog, XmDIALOG_TEXT); + if (w) XtUnmanageChild (w); + w = XmSelectionBoxGetChild (dialog, XmDIALOG_LIST_LABEL); + if (w) XtUnmanageChild (w); + w = XmSelectionBoxGetChild (dialog, XmDIALOG_LIST); + if (w) XtUnmanageChild (XtParent(w)); + w = XmSelectionBoxGetChild (dialog, XmDIALOG_SELECTION_LABEL); + if (w) XtUnmanageChild (w); + w = XmSelectionBoxGetChild (dialog, XmDIALOG_SEPARATOR); + if (w) XtUnmanageChild (w); + w = XmSelectionBoxGetChild (dialog, XmDIALOG_APPLY_BUTTON); + if (w) XtUnmanageChild (w); + + XtVaSetValues(label1, + XmNtopAttachment, XmATTACH_FORM, + XmNleftAttachment, XmATTACH_FORM, + XmNrightAttachment, XmATTACH_FORM, + XmNbottomAttachment, XmATTACH_NONE, + 0); + XtVaSetValues(label2, + XmNtopAttachment, XmATTACH_WIDGET, + XmNtopWidget, label1, + XmNleftAttachment, XmATTACH_FORM, + XmNrightAttachment, XmATTACH_FORM, + XmNbottomAttachment, XmATTACH_NONE, + 0); + XtVaSetValues(label3, + XmNtopAttachment, XmATTACH_WIDGET, + XmNtopWidget, label2, + XmNleftAttachment, XmATTACH_FORM, + XmNrightAttachment, XmATTACH_FORM, + XmNbottomAttachment, XmATTACH_FORM, + 0); + + XtVaSetValues(roger, + XmNsensitive, FALSE, + XmNtopAttachment, XmATTACH_FORM, + XmNleftAttachment, XmATTACH_FORM, + XmNrightAttachment, XmATTACH_NONE, + XmNbottomAttachment, XmATTACH_FORM, + 0); + XtVaSetValues(dialog, + XmNtopAttachment, XmATTACH_FORM, + XmNleftAttachment, XmATTACH_WIDGET, + XmNleftWidget, roger, + XmNrightAttachment, XmATTACH_FORM, + XmNbottomAttachment, XmATTACH_FORM, + 0); + + XtManageChild(label1); + XtManageChild(label2); + XtManageChild(label3); + + XtManageChild(form2); + XtManageChild(demo); + XtManageChild(prefs); + XtManageChild(help); + + XtManageChild(roger); + XtManageChild(dialog); + + { + Dimension width = 0, height = 0; + XtRealizeWidget(form1); + XtVaGetValues(roger, XmNwidth, &width, XmNheight, &height, 0); + if (width == height) + ; + else if (width > height) + XtVaSetValues(roger, XmNwidth, width, XmNheight, width, 0); + else + XtVaSetValues(roger, XmNwidth, height, XmNheight, height, 0); + } + + splash_dialog = shell; + splash_form = form1; + splash_roger_label = roger; + splash_label1 = label1; + splash_label3 = label3; + splash_demo = demo; + splash_prefs = prefs; + splash_help = help; +} diff --git a/driver/dialogs.xd b/driver/dialogs.xd index ad1f6da0..8acdb35c 100644 --- a/driver/dialogs.xd +++ b/driver/dialogs.xd @@ -424,7 +424,7 @@ object 'label1' : XmLabel { object 'label2' : XmLabel { arguments { name = 'label2'; - XmNlabelString= 'Copyright © 1991-1994 by Jamie Zawinski '; + XmNlabelString= 'Copyright © 1991-1994 by Jamie Zawinski '; }; }; object 'text_area' : XmScrolledList { diff --git a/driver/kpasswd.c b/driver/kpasswd.c index ee115213..91ae343b 100644 --- a/driver/kpasswd.c +++ b/driver/kpasswd.c @@ -1,6 +1,6 @@ /* kpasswd.c --- verify kerberos passwords. * written by Nat Lanza (magus@cs.cmu.edu) for - * xscreensaver, Copyright (c) 1993-1997 Jamie Zawinski + * xscreensaver, Copyright (c) 1993-1997 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that diff --git a/driver/lock.c b/driver/lock.c index 25dad554..f388c0d6 100644 --- a/driver/lock.c +++ b/driver/lock.c @@ -1,5 +1,5 @@ /* lock.c --- handling the password dialog for locking-mode. - * xscreensaver, Copyright (c) 1993-1998 Jamie Zawinski + * xscreensaver, Copyright (c) 1993-1998 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -49,6 +49,10 @@ extern int validate_user(char *name, char *password); #endif /* HAVE_MOTIF */ +#ifdef _VROOT_H_ +ERROR! You must not include vroot.h in this file. +#endif + extern Widget passwd_dialog; extern Widget passwd_form; extern Widget roger_label; @@ -165,16 +169,16 @@ static XtActionsRec actions[] = {{"keypress", keypress}, for all keys anyway. So, the implementation of keypress() has BackSpace, etc, hardcoded into it instead. FMH! */ -static char translations[] = ("BackSpace: backspace()\n" +static char translations[] = "BackSpace: backspace()\n" "Delete: backspace()\n" "CtrlH: backspace()\n" "CtrlU: kill_line()\n" "CtrlX: kill_line()\n" "CtrlJ: done()\n" "CtrlM: done()\n" - ": keypress()\n"); + ": keypress()\n"; # else /* !0 */ -static char translations[] = (": keypress()\n"); +static char translations[] = ": keypress()\n"; # endif /* !0 */ @@ -272,45 +276,6 @@ done (Widget w, XEvent *event, String *argv, Cardinal *argc) #endif /* HAVE_ATHENA || !VERIFY_CALLBACK_WORKS */ -extern void skull (Display *, Window, GC, GC, int, int, int, int); - -static void -roger (Widget button, XtPointer client_data, XtPointer call_data) -{ - Display *dpy = XtDisplay (button); - Screen *screen = XtScreen (button); - Window window = XtWindow (button); - Arg av [10]; - int ac = 0; - XGCValues gcv; - Colormap cmap; - GC draw_gc, erase_gc; - unsigned int fg, bg; - int x, y, size; - XWindowAttributes xgwa; - XGetWindowAttributes (dpy, window, &xgwa); - cmap = xgwa.colormap; - if (xgwa.width > xgwa.height) size = xgwa.height; - else size = xgwa.width; - if (size > 40) size -= 30; - x = (xgwa.width - size) / 2; - y = (xgwa.height - size) / 2; - XtSetArg (av [ac], XtNforeground, &fg); ac++; - XtSetArg (av [ac], XtNbackground, &bg); ac++; - XtGetValues (button, av, ac); - /* if it's black on white, swap it cause it looks better (hack hack) */ - if (fg == BlackPixelOfScreen (screen) && bg == WhitePixelOfScreen (screen)) - fg = WhitePixelOfScreen (screen), bg = BlackPixelOfScreen (screen); - gcv.foreground = bg; - erase_gc = XCreateGC (dpy, window, GCForeground, &gcv); - gcv.foreground = fg; - draw_gc = XCreateGC (dpy, window, GCForeground, &gcv); - XFillRectangle (dpy, window, erase_gc, 0, 0, xgwa.width, xgwa.height); - skull (dpy, window, draw_gc, erase_gc, x, y, size, size); - XFreeGC (dpy, draw_gc); - XFreeGC (dpy, erase_gc); -} - static void make_passwd_dialog (saver_info *si) { @@ -424,6 +389,8 @@ passwd_idle_timer (XtPointer closure, XtIntervalId *id) XtVaGetValues(passwd_done, XmNheight, &h, XmNy, &y, + 0); + XtVaGetValues(passwd_form, XtNforeground, &fg, XtNbackground, &bg, XmNtopShadowColor, &ts, @@ -505,6 +472,7 @@ pop_passwd_dialog (saver_info *si) Window focus; int revert_to; int i; + Window grab_window = RootWindowOfScreen(si->screens[0].screen); typed_passwd [0] = 0; passwd_state = pw_read; @@ -567,13 +535,32 @@ pop_passwd_dialog (saver_info *si) roger(roger_label, 0, 0); #endif /* HAVE_ATHENA */ + + /* Make sure the mouse cursor is visible. + Since the screensaver was already active, we had already called + grab_keyboard_and_mouse() with our "invisible" Cursor object. + Now we need to change that. (cursor == 0 means "server default + cursor.") + */ + if (grab_window != si->mouse_grab_window || + grab_window != si->keyboard_grab_window) + fprintf(stderr, + "%s: WARNING: expected mouse and keyboard grabs on 0x%x,\n" + "\tbut mouse-grab is 0x%x and keyboard-grab is 0x%x.\n", + blurb(), + (unsigned long) grab_window, + (unsigned long) si->mouse_grab_window, + (unsigned long) si->keyboard_grab_window); + + if (p->verbose_p) + fprintf(stderr, "%s: re-grabbing keyboard and mouse to expose cursor.\n", + blurb()); + grab_keyboard_and_mouse (si, grab_window, 0); + + if (!si->prefs.debug_p) XGrabServer (dpy); /* ############ DANGER! */ - /* this call to ungrab used to be in main_loop() - see comment in - xscreensaver.c around line 857. */ - ungrab_keyboard_and_mouse (si); - while (passwd_state == pw_read) { XEvent event; @@ -586,6 +573,15 @@ pop_passwd_dialog (saver_info *si) XUngrabServer (dpy); XSync (dpy, False); /* ###### (danger over) */ + + /* Now turn off the mouse cursor again. + */ + if (p->verbose_p) + fprintf(stderr, "%s: re-grabbing keyboard and mouse to hide cursor.\n", + blurb()); + grab_keyboard_and_mouse (si, grab_window, si->screens[0].cursor); + + if (passwd_state != pw_time) XtRemoveTimeOut (passwd_idle_id); diff --git a/driver/passwd.c b/driver/passwd.c index b0a4b8ad..d331b3bb 100644 --- a/driver/passwd.c +++ b/driver/passwd.c @@ -1,5 +1,5 @@ /* passwd.c --- verifying typed passwords with the OS. - * xscreensaver, Copyright (c) 1993-1998 Jamie Zawinski + * xscreensaver, Copyright (c) 1993-1998 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -26,6 +26,7 @@ #include #ifndef VMS # include +# include #else /* VMS */ # include "vms-pwd.h" #endif /* VMS */ @@ -170,7 +171,7 @@ get_encrypted_passwd(const char *user) } fprintf (stderr, "%s: couldn't get password of \"%s\"\n", - progname, (user ? user : "(null)")); + blurb(), (user ? user : "(null)")); return 0; } @@ -236,5 +237,4 @@ passwd_valid_p (const char *typed_passwd) Bool lock_init (int argc, char **argv) { return True; } #endif /* VMS */ - #endif /* NO_LOCKING -- whole file */ diff --git a/driver/setuid.c b/driver/setuid.c new file mode 100644 index 00000000..87bb4c3a --- /dev/null +++ b/driver/setuid.c @@ -0,0 +1,215 @@ +/* setuid.c --- management of runtime priveleges. + * xscreensaver, Copyright (c) 1993-1998 Jamie Zawinski + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation. No representations are made about the suitability of this + * software for any purpose. It is provided "as is" without express or + * implied warranty. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifndef NO_SETUID /* whole file */ + +#include /* not used for much... */ + +/* This file doesn't need the Xt headers, so stub these types out... */ +#undef XtPointer +#define XtAppContext void* +#define XrmDatabase void* +#define XtIntervalId void* +#define XtPointer void* +#define Widget void* + +#include "xscreensaver.h" + +#ifndef EPERM +#include +#endif + +#include /* for getpwnam() and struct passwd */ +#include /* for getgrgid() and struct group */ + + +static const char * +uid_gid_string(uid_t uid, gid_t gid) +{ + static char buf[255]; + struct passwd *p = 0; + struct group *g = 0; + p = getpwuid (uid); + g = getgrgid (gid); + sprintf (buf, "%s/%s (%ld/%ld)", + (p && p->pw_name ? p->pw_name : "???"), + (g && g->gr_name ? g->gr_name : "???"), + (long) uid, (long) gid); + return buf; +} + + +void +describe_uids (saver_info *si, FILE *out) +{ + uid_t uid = getuid(); + gid_t gid = getgid(); + uid_t euid = geteuid(); + gid_t egid = getegid(); + char *s1 = strdup (uid_gid_string (uid, gid)); + char *s2 = strdup (uid_gid_string (euid, egid)); + + if (si->orig_uid && *si->orig_uid) + fprintf (out, "%s: initial effective uid/gid was %s\n", blurb(), + si->orig_uid); + fprintf (out, "%s: running as %s", blurb(), s1); + if (uid != euid || gid != egid) + fprintf (out, "; effectively %s", s2); + fprintf(out, "\n"); + free(s1); + free(s2); +} + + +/* If we've been run as setuid or setgid to someone else (most likely root) + turn off the extra permissions so that random user-specified programs + don't get special privileges. (On some systems it is necessary to install + this program as setuid root in order to read the passwd file to implement + lock-mode.) + */ +void +hack_uid (saver_info *si) +{ + si->orig_uid = strdup (uid_gid_string (geteuid(), getegid())); + + setgid (getgid ()); + setuid (getuid ()); + + /* If we're being run as root (as from xdm) then switch the user id + to something safe. */ + if (getuid () == 0) + { + struct passwd *p = 0; + struct group *g = 0; + int uid_errno = 0; + int gid_errno = 0; + + /* Locking can't work when running as root, because we have no way of + knowing what the user id of the logged in user is (so we don't know + whose password to prompt for.) + */ + si->locking_disabled_p = True; + si->nolock_reason = "running as root"; + p = getpwnam ("nobody"); + if (! p) p = getpwnam ("noaccess"); + if (! p) p = getpwnam ("daemon"); + if (! p) + { + fprintf (stderr, + "%s: running as root, and couldn't find a safer uid.\n", + blurb()); + saver_exit(si, 1, 0); + } + + g = getgrgid (p->pw_gid); + + /* Rumor has it that some implementations of of setuid() do nothing + when called with -1; therefore, if the "nobody" user has a uid of + -1, then that would be Really Bad. Rumor further has it that such + systems really ought to be using -2 for "nobody", since that works. + So, if we get a uid (or gid, for good measure) of -1, switch to -2 + instead. + */ + + if (p->pw_gid == -1) p->pw_gid = -2; + if (p->pw_uid == -1) p->pw_uid = -2; + + + /* Change the gid to be a safe one, then change the uid to be a safe + one (must do it in this order, because root privs vanish when uid + is changed, and after that, gid can't be changed.) + */ + if (setgid (p->pw_gid) != 0) + gid_errno = errno ? errno : -1; + if (setuid (p->pw_uid) != 0) + uid_errno = errno ? errno : -1; + + if (uid_errno == 0 && gid_errno == 0) + { + static char buf [1024]; + sprintf (buf, "changed uid/gid to %s/%s (%ld/%ld).", + p->pw_name, (g ? g->gr_name : "???"), + (long) p->pw_uid, (long) p->pw_gid); + si->uid_message = buf; + } + else + { + char buf [1024]; + if (gid_errno) + { + sprintf (buf, "%s: couldn't set gid to %s (%ld)", + blurb(), + (g ? g->gr_name : "???"), + (long) p->pw_gid); + if (gid_errno == -1) + fprintf(stderr, "%s: unknown error\n", buf); + else + perror(buf); + } + + if (uid_errno) + { + sprintf (buf, "%s: couldn't set uid to %s (%ld)", + blurb(), + (p ? p->pw_name : "???"), + (long) p->pw_uid); + if (uid_errno == -1) + fprintf(stderr, "%s: unknown error\n", buf); + else + perror(buf); + } + } + + if (uid_errno != 0) + { + /* We'd better exit rather than continue running as root. + But if we switched uid but not gid, continue running, + since that doesn't really matter. (Right?) + */ + saver_exit (si, -1, 0); + } + } +# ifndef NO_LOCKING + else /* disable locking if already being run as "someone else" */ + { + struct passwd *p = getpwuid (getuid ()); + if (!p || + !strcmp (p->pw_name, "root") || + !strcmp (p->pw_name, "nobody") || + !strcmp (p->pw_name, "noaccess") || + !strcmp (p->pw_name, "operator") || + !strcmp (p->pw_name, "daemon") || + !strcmp (p->pw_name, "bin") || + !strcmp (p->pw_name, "adm") || + !strcmp (p->pw_name, "sys") || + !strcmp (p->pw_name, "games")) + { + static char buf [1024]; + sprintf (buf, "running as %s", p->pw_name); + si->nolock_reason = buf; + si->locking_disabled_p = True; + } + } +# endif /* !NO_LOCKING */ +} + +#else /* !NO_SETUID */ + +void hack_uid (saver_info *si) { } +void hack_uid_warn (saver_info *si) { } +void describe_uids (saver_info *si) { } + +#endif /* NO_SETUID */ diff --git a/driver/splash.c b/driver/splash.c new file mode 100644 index 00000000..630c44d7 --- /dev/null +++ b/driver/splash.c @@ -0,0 +1,245 @@ +/* xscreensaver, Copyright (c) 1991-1998 Jamie Zawinski + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation. No representations are made about the suitability of this + * software for any purpose. It is provided "as is" without express or + * implied warranty. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include + +#ifdef HAVE_MOTIF +# include + +#else /* HAVE_ATHENA */ +# include +# include +# include +# include +# include +#endif /* HAVE_ATHENA */ + +#include "xscreensaver.h" +#include "visual.h" +#include +#include +#include + +extern void skull (Display *, Window, GC, GC, int, int, int, int); + +void +roger (Widget button, XtPointer client_data, XtPointer call_data) +{ + Display *dpy = XtDisplay (button); + Screen *screen = XtScreen (button); + Window window = XtWindow (button); + Arg av [10]; + int ac = 0; + XGCValues gcv; + Colormap cmap; + GC draw_gc, erase_gc; + unsigned int fg, bg; + int x, y, size; + XWindowAttributes xgwa; + XGetWindowAttributes (dpy, window, &xgwa); + cmap = xgwa.colormap; + if (xgwa.width > xgwa.height) size = xgwa.height; + else size = xgwa.width; + if (size > 40) size -= 30; + x = (xgwa.width - size) / 2; + y = (xgwa.height - size) / 2; + XtSetArg (av [ac], XtNforeground, &fg); ac++; + XtSetArg (av [ac], XtNbackground, &bg); ac++; + XtGetValues (button, av, ac); + /* if it's black on white, swap it cause it looks better (hack hack) */ + if (fg == BlackPixelOfScreen (screen) && bg == WhitePixelOfScreen (screen)) + fg = WhitePixelOfScreen (screen), bg = BlackPixelOfScreen (screen); + gcv.foreground = bg; + erase_gc = XCreateGC (dpy, window, GCForeground, &gcv); + gcv.foreground = fg; + draw_gc = XCreateGC (dpy, window, GCForeground, &gcv); + XFillRectangle (dpy, window, erase_gc, 0, 0, xgwa.width, xgwa.height); + skull (dpy, window, draw_gc, erase_gc, x, y, size, size); + XFreeGC (dpy, draw_gc); + XFreeGC (dpy, erase_gc); +} + + +static Widget splash_shell; +extern Widget splash_dialog; +extern Widget splash_form; +extern Widget splash_roger_label; +extern Widget splash_label1; +extern Widget splash_label3; +extern Widget splash_demo; +extern Widget splash_prefs; +extern Widget splash_help; + +static void +splash_sink(saver_info *si) +{ + if (si->splash_dialog) + { + XtDestroyWidget(si->splash_dialog); + XtDestroyWidget(splash_shell); + si->splash_dialog = 0; + splash_shell = 0; + } +} + +static void +splash_sink_timer (XtPointer closure, XtIntervalId *id) +{ + saver_info *si = (saver_info *) closure; + splash_sink(si); +} + + +static void +send_self_clientmessage (saver_info *si, Atom command) +{ + Display *dpy = si->dpy; + Window window = si->default_screen->screensaver_window; + XEvent event; + event.xany.type = ClientMessage; + event.xclient.display = si->dpy; + event.xclient.window = window; + event.xclient.message_type = XA_SCREENSAVER; + event.xclient.format = 32; + event.xclient.data.l[0] = (long) command; + if (! XSendEvent (dpy, window, False, 0L, &event)) + fprintf (stderr, "%s: XSendEvent(dpy, 0x%x ...) failed.\n", + progname, (unsigned int) window); +} + +static void +splash_demo_cb (Widget button, XtPointer client_data, XtPointer call_data) +{ + saver_info *si = (saver_info *) client_data; + splash_sink(si); + send_self_clientmessage (si, XA_DEMO); +} + +static void +splash_prefs_cb (Widget button, XtPointer client_data, XtPointer call_data) +{ + saver_info *si = (saver_info *) client_data; + splash_sink(si); + send_self_clientmessage (si, XA_PREFS); +} + +static void +splash_help_cb (Widget button, XtPointer client_data, XtPointer call_data) +{ + saver_info *si = (saver_info *) client_data; + saver_preferences *p = &si->prefs; + + splash_sink(si); + + if (!p->help_url || !*p->help_url) + fprintf(stderr, "%s: no Help URL has been specified.\n"); + else if (!p->load_url_command || !*p->load_url_command) + fprintf(stderr, "%s: no URL-loading command has been specified.\n"); + else + { + char *buf = (char *) malloc (strlen(p->load_url_command) + + (strlen(p->help_url) * 2) + 10); + sprintf(buf, p->load_url_command, p->help_url, p->help_url); + system(buf); + } +} + +static void +make_splash_dialog (saver_info *si) +{ + saver_screen_info *ssi = si->default_screen; + Visual *v = DefaultVisualOfScreen(ssi->screen); + + /* The splash dialog must always be created on the default visual and + with the default colormap, so that it shows up in the right colors + when viewed along with the rest of the desktop. The other xscreensaver + dialogs don't have this constraint, since they are only seen when the + blackout window is also exposed. + + To accomplish this, we need our own ApplicationShell, since the shell + in si->default_screen->toplevel_shell might have a non-default visual. + */ + splash_shell = XtVaAppCreateShell (progname, progclass, + applicationShellWidgetClass, + si->dpy, + XtNscreen, ssi->screen, + XtNvisual, v, + XtNdepth, visual_depth(ssi->screen, v), + 0); + + create_splash_dialog (splash_shell, v, + DefaultColormapOfScreen (ssi->screen)); + si->splash_dialog = splash_dialog; /* gaaah... */ + +#ifdef HAVE_ATHENA + XawDialogAddButton(splash_form,"demo", splash_demo_cb, si); + XawDialogAddButton(splash_form,"prefs", splash_prefs_cb, si); + XawDialogAddButton(splash_form,"help", splash_help_cb, si); + splash_demo = XtNameToWidget(splash_form,"demo"); + splash_prefs = XtNameToWidget(splash_form,"prefs"); + splash_help = XtNameToWidget(splash_form,"help"); + + /* Lose the label on the inner dialog. */ + { + Widget w = XtNameToWidget(splash_form, "label"); + if (w) XtUnmanageChild(w); + } + +#else /* HAVE_MOTIF */ + /* Another random thing necessary in 1.2.1 but not 1.1.5... */ + XtVaSetValues (splash_roger_label, XmNborderWidth, 1, 0); + + XtAddCallback (splash_demo, XmNactivateCallback, splash_demo_cb, si); + XtAddCallback (splash_prefs, XmNactivateCallback, splash_prefs_cb, si); + XtAddCallback (splash_help, XmNactivateCallback, splash_help_cb, si); + XtAddCallback (splash_roger_label, XmNexposeCallback, roger, si); + +#endif /* HAVE_MOTIF */ + + format_into_label (splash_label1, si->version); + + XtRealizeWidget(splash_dialog); +} + +void +pop_splash_dialog (saver_info *si) +{ + XtIntervalId splash_sink_id; + + if (si->prefs.splash_duration <= 0) + return; + + if (! si->splash_dialog) + make_splash_dialog (si); + +#ifdef HAVE_ATHENA + splash_form = splash_dialog; /* kludge */ +#endif + + pop_up_dialog_box (splash_dialog, splash_form, + /* for debugging -- don't ask */ + (si->prefs.debug_p ? 69 : 0) + + 3); + XtManageChild (splash_form); + +#ifdef HAVE_ATHENA + if (splash_roger_label) + roger (splash_roger_label, 0, 0); +#endif /* HAVE_ATHENA */ + + splash_sink_id = XtAppAddTimeOut (si->app, si->prefs.splash_duration, + splash_sink_timer, (XtPointer) si); +} diff --git a/driver/stderr.c b/driver/stderr.c index 0743a50e..798d4efb 100644 --- a/driver/stderr.c +++ b/driver/stderr.c @@ -1,5 +1,5 @@ /* stderr.c --- capturing stdout/stderr output onto the screensaver window. - * xscreensaver, Copyright (c) 1991-1998 Jamie Zawinski + * xscreensaver, Copyright (c) 1991-1998 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that diff --git a/driver/subprocs.c b/driver/subprocs.c index 1876f832..166ae599 100644 --- a/driver/subprocs.c +++ b/driver/subprocs.c @@ -1,6 +1,6 @@ /* subprocs.c --- choosing, spawning, and killing screenhacks. * xscreensaver, Copyright (c) 1991, 1992, 1993, 1995, 1997, 1998 - * Jamie Zawinski + * Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -48,11 +48,6 @@ #include /* for the signal names */ -#ifndef NO_SETUID -#include /* for getpwnam() and struct passwd */ -#include /* for getgrgid() and struct group */ -#endif /* NO_SETUID */ - #if !defined(SIGCHLD) && defined(SIGCLD) #define SIGCHLD SIGCLD #endif @@ -256,9 +251,9 @@ exec_screenhack (saver_info *si, const char *command) Bool hairy_p = !!strpbrk (command, "*?$&!<>[];`'\\\""); if (p->verbose_p) - printf ("%s: spawning \"%s\" in pid %lu%s.\n", - blurb(), command, (unsigned long) getpid (), - (hairy_p ? " (via shell)" : "")); + fprintf (stderr, "%s: spawning \"%s\" in pid %lu%s.\n", + blurb(), command, (unsigned long) getpid (), + (hairy_p ? " (via shell)" : "")); if (hairy_p) /* If it contains any shell metacharacters, do it the hard way, @@ -270,7 +265,8 @@ exec_screenhack (saver_info *si, const char *command) #else /* VMS */ if (p->verbose_p) - printf ("%s: spawning \"%s\" in pid %lu.\n", blurb(), command, getpid()); + fprintf (stderr, "%s: spawning \"%s\" in pid %lu.\n", + blurb(), command, getpid()); exec_vms_command (command); #endif /* VMS */ @@ -612,8 +608,8 @@ describe_dead_child (saver_info *si, pid_t kid, int wait_status) "%s: child pid %lu (%s) exited abnormally (code %d).\n", blurb(), (unsigned long) kid, name, exit_status); else if (p->verbose_p) - printf ("%s: child pid %lu (%s) exited normally.\n", - blurb(), (unsigned long) kid, name); + fprintf (stderr, "%s: child pid %lu (%s) exited normally.\n", + blurb(), (unsigned long) kid, name); if (job) job->status = job_dead; @@ -826,7 +822,7 @@ spawn_screenhack_1 (saver_screen_info *ssi, Bool first_time_p) sprintf (buf, "%s: couldn't fork", blurb()); perror (buf); restore_real_vroot (si); - saver_exit (si, 1); + saver_exit (si, 1, 0); case 0: close (ConnectionNumber (si->dpy)); /* close display fd */ @@ -853,8 +849,9 @@ spawn_screenhack (saver_info *si, Bool first_time_p) if (!monitor_powered_on_p (si)) { if (si->prefs.verbose_p) - printf ("%s: server reports that monitor has powered down; " - "not launching a new hack.\n", blurb()); + fprintf (stderr, + "%s: server reports that monitor has powered down; " + "not launching a new hack.\n", blurb()); return; } @@ -1038,132 +1035,3 @@ hack_environment (saver_info *si) } #endif /* HAVE_PUTENV && DEFAULT_PATH_PREFIX */ } - - - -/* Change the uid/gid of the screensaver process, so that it is safe for it - to run setuid root (which it needs to do on some systems to read the - encrypted passwords from the passwd file.) - - hack_uid() is run before opening the X connection, so that XAuth works. - hack_uid_warn() is called after the connection is opened and the command - line arguments are parsed, so that the messages from hack_uid() get - printed after we know whether we're in `verbose' mode. - */ - -#ifndef NO_SETUID - -static int hack_uid_errno; -static char hack_uid_buf [255], *hack_uid_error; - -void -hack_uid (saver_info *si) -{ - - /* If we've been run as setuid or setgid to someone else (most likely root) - turn off the extra permissions so that random user-specified programs - don't get special privileges. (On some systems it might be necessary - to install this as setuid root in order to read the passwd file to - implement lock-mode...) - */ - setgid (getgid ()); - setuid (getuid ()); - - hack_uid_errno = 0; - hack_uid_error = 0; - - /* If we're being run as root (as from xdm) then switch the user id - to something safe. */ - if (getuid () == 0) - { - struct passwd *p; - /* Locking can't work when running as root, because we have no way of - knowing what the user id of the logged in user is (so we don't know - whose password to prompt for.) - */ - si->locking_disabled_p = True; - si->nolock_reason = "running as root"; - p = getpwnam ("nobody"); - if (! p) p = getpwnam ("noaccess"); - if (! p) p = getpwnam ("daemon"); - if (! p) p = getpwnam ("bin"); - if (! p) p = getpwnam ("sys"); - if (! p) - { - hack_uid_error = "couldn't find safe uid; running as root."; - hack_uid_errno = -1; - } - else - { - struct group *g = getgrgid (p->pw_gid); - hack_uid_error = hack_uid_buf; - sprintf (hack_uid_error, "changing uid/gid to %s/%s (%ld/%ld).", - p->pw_name, (g ? g->gr_name : "???"), - (long) p->pw_uid, (long) p->pw_gid); - - /* Change the gid to be a safe one. If we can't do that, then - print a warning. We change the gid before the uid so that we - change the gid while still root. */ - if (setgid (p->pw_gid) != 0) - { - hack_uid_errno = errno; - sprintf (hack_uid_error, "couldn't set gid to %s (%ld)", - (g ? g->gr_name : "???"), (long) p->pw_gid); - } - - /* Now change the uid to be a safe one. */ - if (setuid (p->pw_uid) != 0) - { - hack_uid_errno = errno; - sprintf (hack_uid_error, "couldn't set uid to %s (%ld)", - p->pw_name, (long) p->pw_uid); - } - } - } -# ifndef NO_LOCKING - else /* disable locking if already being run as "someone else" */ - { - struct passwd *p = getpwuid (getuid ()); - if (!p || - !strcmp (p->pw_name, "root") || - !strcmp (p->pw_name, "nobody") || - !strcmp (p->pw_name, "noaccess") || - !strcmp (p->pw_name, "daemon") || - !strcmp (p->pw_name, "bin") || - !strcmp (p->pw_name, "sys")) - { - si->locking_disabled_p = True; - si->nolock_reason = hack_uid_buf; - sprintf (si->nolock_reason, "running as %s", p->pw_name); - } - } -# endif /* !NO_LOCKING */ -} - -void -hack_uid_warn (saver_info *si) -{ - saver_preferences *p = &si->prefs; - - if (! hack_uid_error) - ; - else if (hack_uid_errno == 0) - { - if (p->verbose_p) - printf ("%s: %s\n", blurb(), hack_uid_error); - } - else - { - char buf [255]; - sprintf (buf, "%s: %s", blurb(), hack_uid_error); - if (hack_uid_errno == -1) - fprintf (stderr, "%s\n", buf); - else - { - errno = hack_uid_errno; - perror (buf); - } - } -} - -#endif /* !NO_SETUID */ diff --git a/driver/test-passwd.c b/driver/test-passwd.c new file mode 100644 index 00000000..019f86da --- /dev/null +++ b/driver/test-passwd.c @@ -0,0 +1,289 @@ +/* xscreensaver, Copyright (c) 1998 Jamie Zawinski + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation. No representations are made about the suitability of this + * software for any purpose. It is provided "as is" without express or + * implied warranty. + */ + +/* This is a kludgy test harness for debugging the password dialog box. + It's somewhat easier to debug it here than in the xscreensaver executable + itself. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include "xscreensaver.h" +#include "resources.h" +#include "version.h" + +char *progname = 0; +char *progclass = 0; +XrmDatabase db = 0; +saver_info *global_si_kludge; + +FILE *real_stderr, *real_stdout; + +void reset_stderr(saver_screen_info *ssi) {} +void clear_stderr(saver_screen_info *ssi) {} +void reset_watchdog_timer(saver_info *si, Bool on_p) {} +void monitor_power_on (saver_info *si) {} +void ungrab_keyboard_and_mouse (saver_info *si) {} +Bool select_visual (saver_screen_info *ssi, const char *v) { return False; } +void raise_window (saver_info *si, Bool i, Bool b, Bool d) {} +void restore_real_vroot (saver_info *si) {} +void saver_exit (saver_info *si, int status, const char *core) { exit(status);} +const char * signal_name(int signal) { return "???"; } +Bool monitor_powered_on_p (saver_info *si) { return True; } +void start_notice_events_timer (saver_info *si, Window w) {} +void initialize_screensaver_window (saver_info *si) {} +void blank_screen (saver_info *si) {} +void unblank_screen (saver_info *si) {} +Bool handle_clientmessage (saver_info *si, XEvent *e, Bool u) { return False; } +int BadWindow_ehandler (Display *dpy, XErrorEvent *error) { exit(1); } + +const char *blurb(void) { return progname; } + +void +idle_timer (XtPointer closure, XtIntervalId *id) +{ + saver_info *si = (saver_info *) closure; + XEvent fake_event; + fake_event.type = 0; /* XAnyEvent type, ignored. */ + fake_event.xany.display = si->dpy; + fake_event.xany.window = 0; + XPutBackEvent (si->dpy, &fake_event); +} + + +static char * +reformat_hack(const char *hack) +{ + int i; + const char *in = hack; + int indent = 13; + char *h2 = (char *) malloc(strlen(in) + indent + 2); + char *out = h2; + + while (isspace(*in)) in++; /* skip whitespace */ + while (*in && !isspace(*in) && *in != ':') + *out++ = *in++; /* snarf first token */ + while (isspace(*in)) in++; /* skip whitespace */ + + if (*in == ':') + *out++ = *in++; /* copy colon */ + else + { + in = hack; + out = h2; /* reset to beginning */ + } + + *out = 0; + + while (isspace(*in)) in++; /* skip whitespace */ + for (i = strlen(h2); i < indent; i++) /* indent */ + *out++ = ' '; + + while (*in) *out++ = *in++; /* copy rest of line */ + *out = 0; + + return h2; +} + + +static void +get_screenhacks (saver_info *si) +{ + saver_preferences *p = &si->prefs; + int i = 0; + int hacks_size = 60; + int size; + char *d; + + d = get_string_resource ("monoPrograms", "MonoPrograms"); + if (d && !*d) { free(d); d = 0; } + if (!d) + d = get_string_resource ("colorPrograms", "ColorPrograms"); + if (d && !*d) { free(d); d = 0; } + + if (d) + { + fprintf (stderr, + "%s: the `monoPrograms' and `colorPrograms' resources are obsolete;\n\ + see the manual for details.\n", blurb()); + free(d); + } + + d = get_string_resource ("programs", "Programs"); + + size = d ? strlen (d) : 0; + p->screenhacks = (char **) malloc (sizeof (char *) * hacks_size); + p->screenhacks_count = 0; + + while (i < size) + { + int end, start = i; + if (d[i] == ' ' || d[i] == '\t' || d[i] == '\n' || d[i] == 0) + { + i++; + continue; + } + if (hacks_size <= p->screenhacks_count) + p->screenhacks = (char **) realloc (p->screenhacks, + (hacks_size = hacks_size * 2) * + sizeof (char *)); + p->screenhacks [p->screenhacks_count++] = d + i; + while (d[i] != 0 && d[i] != '\n') + i++; + end = i; + while (i > start && (d[i-1] == ' ' || d[i-1] == '\t')) + i--; + d[i] = 0; + i = end + 1; + } + + /* shrink all whitespace to one space, for the benefit of the "demo" + mode display. We only do this when we can easily tell that the + whitespace is not significant (no shell metachars). + */ + for (i = 0; i < p->screenhacks_count; i++) + { + char *s = p->screenhacks [i]; + char *s2; + int L = strlen (s); + int j, k; + for (j = 0; j < L; j++) + { + switch (s[j]) + { + case '\'': case '"': case '`': case '\\': + goto DONE; + case '\t': + s[j] = ' '; + case ' ': + k = 0; + for (s2 = s+j+1; *s2 == ' ' || *s2 == '\t'; s2++) + k++; + if (k > 0) + { + for (s2 = s+j+1; s2[k]; s2++) + *s2 = s2[k]; + *s2 = 0; + } + break; + } + } + DONE: + p->screenhacks[i] = reformat_hack(s); /* mallocs */ + } + + if (p->screenhacks_count) + { + /* Shrink down the screenhacks array to be only as big as it needs to. + This doesn't really matter at all. */ + p->screenhacks = (char **) + realloc (p->screenhacks, ((p->screenhacks_count + 1) * + sizeof(char *))); + p->screenhacks [p->screenhacks_count] = 0; + } + else + { + free (p->screenhacks); + p->screenhacks = 0; + } +} + + +int +main (int argc, char **argv) +{ + Widget toplevel_shell; + saver_screen_info ssip; + saver_info sip; + saver_info *si = &sip; + saver_preferences *p = &si->prefs; + + memset(&sip, 0, sizeof(sip)); + memset(&ssip, 0, sizeof(ssip)); + + si->nscreens = 1; + si->screens = si->default_screen = &ssip; + ssip.global = si; + + global_si_kludge = si; + real_stderr = stderr; + real_stdout = stdout; + + si->version = (char *) malloc (5); + memcpy (si->version, screensaver_id + 17, 4); + progname = argv[0]; + +# ifdef SCO + set_auth_parameters(argc, argv); +# endif /* SCO */ + + if (! lock_init (argc, argv)) /* before hack_uid() for proper permissions */ + { + si->locking_disabled_p = True; + si->nolock_reason = "error getting password"; + } + + hack_uid (si); + + progclass = "XScreenSaver"; + + toplevel_shell = XtAppInitialize (&si->app, progclass, 0, 0, + &argc, argv, 0, 0, 0); + + si->dpy = XtDisplay (toplevel_shell); + si->db = XtDatabase (si->dpy); + si->default_screen->toplevel_shell = toplevel_shell; + si->default_screen->screen = XtScreen(toplevel_shell); + si->default_screen->default_visual = + si->default_screen->current_visual = + DefaultVisualOfScreen(si->default_screen->screen); + si->default_screen->screensaver_window = + RootWindowOfScreen(si->default_screen->screen); + + db = si->db; + XtGetApplicationNameAndClass (si->dpy, &progname, &progclass); + + p->debug_p = True; + p->verbose_p = True; + p->lock_p = True; + p->passwd_timeout = 1000 * get_seconds_resource ("passwdTimeout", "Time"); + + get_screenhacks(si); + + hack_uid_warn (si); + + while (1) + { +#if 0 + if (unlock_p (si)) + fprintf (stderr, "%s: password correct\n", progname); + else + fprintf (stderr, "%s: password INCORRECT!\n", progname); + + XSync(si->dpy, False); + sleep (3); +#else + si->demo_mode_p = True; + make_screenhack_dialog (si); + XtAppMainLoop(si->app); +#endif + } +} diff --git a/driver/test-uid.c b/driver/test-uid.c new file mode 100644 index 00000000..d0448f95 --- /dev/null +++ b/driver/test-uid.c @@ -0,0 +1,173 @@ +/* uid-test.c --- playing with setuid. + * xscreensaver, Copyright (c) 1998 Jamie Zawinski + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation. No representations are made about the suitability of this + * software for any purpose. It is provided "as is" without express or + * implied warranty. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include + +static void +print(void) +{ + int uid = getuid(); + int gid = getgid(); + int euid = geteuid(); + int egid = getegid(); + struct passwd *p = 0; + struct group *g = 0; + + p = getpwuid (uid); + g = getgrgid (gid); + fprintf(stderr, "real user/group: %ld/%ld (%s/%s)\n", uid, gid, + (p && p->pw_name ? p->pw_name : "???"), + (g && g->gr_name ? g->gr_name : "???")); + + p = getpwuid (euid); + g = getgrgid (egid); + fprintf(stderr, "eff. user/group: %ld/%ld (%s/%s)\n", euid, egid, + (p && p->pw_name ? p->pw_name : "???"), + (g && g->gr_name ? g->gr_name : "???")); +} + +int +main (int argc, char **argv) +{ + int i; + struct passwd *p = 0; + struct group *g = 0; + + if (argc <= 1) + { + fprintf(stderr, + "usage: %s [ user/group ... ]\n" + "\tEach argument may be a user name, or user/group.\n" + "\tThis program will attempt to setuid/setgid to each\n" + "\tin turn, and report the results. The user and group\n" + "\tnames may be strings, or numeric.\n", + argv[0]); + exit(1); + } + + print(); + for (i = 1; i < argc; i++) + { + char *user = argv[i]; + char *group = strchr(user, '/'); + if (group) + *group++ = 0; + + if (group && *group) + { + long gid = 0; + int was_numeric = 0; + + g = 0; + if (*group == '-' || (*group >= '0' && *group <= '9')) + if (1 == sscanf(group, "%ld", &gid)) + { + g = getgrgid (gid); + was_numeric = 1; + } + + if (!g) + g = getgrnam(group); + + if (g) + { + gid = g->gr_gid; + group = g->gr_name; + } + else + { + if (was_numeric) + { + fprintf(stderr, "no group numbered %s.\n", group); + group = ""; + } + else + { + fprintf(stderr, "no group named %s.\n", group); + goto NOGROUP; + } + } + + fprintf(stderr, "setgid(%ld) \"%s\"", gid, group); + if (setgid(gid) == 0) + fprintf(stderr, " succeeded.\n"); + else + perror(" failed"); + + NOGROUP: ; + } + + if (user && *user) + { + long uid = 0; + int was_numeric = 0; + + p = 0; + if (*user == '-' || (*user >= '0' && *user <= '9')) + if (1 == sscanf(user, "%ld", &uid)) + { + p = getpwuid (uid); + was_numeric = 1; + } + + if (!p) + p = getpwnam(user); + + if (p) + { + uid = p->pw_uid; + user = p->pw_name; + } + else + { + if (was_numeric) + { + fprintf(stderr, "no user numbered \"%s\".\n", user); + user = ""; + } + else + { + fprintf(stderr, "no user named %s.\n", user); + goto NOUSER; + } + } + + fprintf(stderr, "setuid(%ld) \"%s\"", uid, user); + if (setuid(uid) == 0) + fprintf(stderr, " succeeded.\n"); + else + perror(" failed"); + NOUSER: ; + } + print(); + } + + fprintf(stderr, + "running \"whoami\" and \"groups\" in a sub-process reports:\n"); + fflush(stdout); + fflush(stderr); + system ("/bin/sh -c 'echo \"`whoami` / `groups`\"'"); + + fflush(stdout); + fflush(stderr); + exit(0); +} diff --git a/driver/timers.c b/driver/timers.c index dbab1b38..77bc8c30 100644 --- a/driver/timers.c +++ b/driver/timers.c @@ -1,6 +1,6 @@ /* timers.c --- detecting when the user is idle, and other timer-related tasks. * xscreensaver, Copyright (c) 1991-1997, 1998 - * Jamie Zawinski + * Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -106,8 +106,8 @@ notice_events (saver_info *si, Window window, Bool top_p) if (top_p && p->verbose_p && (events & KeyPressMask)) { /* Only mention one window per tree (hack hack). */ - printf ("%s: selected KeyPress on 0x%lX\n", blurb(), - (unsigned long) window); + fprintf (stderr, "%s: selected KeyPress on 0x%lX\n", blurb(), + (unsigned long) window); top_p = False; } @@ -184,13 +184,14 @@ cycle_timer (XtPointer closure, XtIntervalId *id) if (si->dbox_up_p || si->question_up_p) { if (p->verbose_p) - printf ("%s: dialog box up; delaying hack change.\n", blurb()); + fprintf (stderr, "%s: dialog box up; delaying hack change.\n", + blurb()); how_long = 30000; /* 30 secs */ } else { if (p->verbose_p) - printf ("%s: changing graphics hacks.\n", blurb()); + fprintf (stderr, "%s: changing graphics hacks.\n", blurb()); kill_screenhack (si); spawn_screenhack (si, False); } @@ -199,7 +200,7 @@ cycle_timer (XtPointer closure, XtIntervalId *id) #ifdef DEBUG_TIMERS if (p->verbose_p) - printf ("%s: starting cycle_timer (%ld, %ld)\n", + fprintf (stderr, "%s: starting cycle_timer (%ld, %ld)\n", blurb(), how_long, si->cycle_id); #endif /* DEBUG_TIMERS */ } @@ -212,7 +213,7 @@ activate_lock_timer (XtPointer closure, XtIntervalId *id) saver_preferences *p = &si->prefs; if (p->verbose_p) - printf ("%s: timed out; activating lock\n", blurb()); + fprintf (stderr, "%s: timed out; activating lock\n", blurb()); si->locked_p = True; #ifdef HAVE_XHPDISABLERESET @@ -236,8 +237,8 @@ reset_timers (saver_info *si) #ifdef DEBUG_TIMERS if (p->verbose_p) - printf ("%s: killing idle_timer (%ld, %ld)\n", - blurb(), p->timeout, si->timer_id); + fprintf (stderr, "%s: killing idle_timer (%ld, %ld)\n", + blurb(), p->timeout, si->timer_id); #endif /* DEBUG_TIMERS */ XtRemoveTimeOut (si->timer_id); @@ -247,8 +248,8 @@ reset_timers (saver_info *si) #ifdef DEBUG_TIMERS if (p->verbose_p) - printf ("%s: restarting idle_timer (%ld, %ld)\n", - blurb(), p->timeout, si->timer_id); + fprintf (stderr, "%s: restarting idle_timer (%ld, %ld)\n", + blurb(), p->timeout, si->timer_id); #endif /* DEBUG_TIMERS */ si->last_activity_time = time ((time_t *) 0); @@ -298,11 +299,11 @@ check_pointer_timer (XtPointer closure, XtIntervalId *id) if (root_x == ssi->poll_mouse_last_root_x && root_y == ssi->poll_mouse_last_root_y && child == ssi->poll_mouse_last_child) - printf ("%s: modifiers changed at %s on screen %d.\n", - blurb(), timestring(), i); + fprintf (stderr, "%s: modifiers changed at %s on screen %d.\n", + blurb(), timestring(), i); else - printf ("%s: pointer moved at %s on screen %d.\n", - blurb(), timestring(), i); + fprintf (stderr, "%s: pointer moved at %s on screen %d.\n", + blurb(), timestring(), i); #endif /* DEBUG_TIMERS */ si->last_activity_screen = ssi; @@ -333,8 +334,8 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) #ifdef DEBUG_TIMERS if (p->verbose_p) - printf ("%s: starting idle_timer (%ld, %ld)\n", - blurb(), p->timeout, si->timer_id); + fprintf (stderr, "%s: starting idle_timer (%ld, %ld)\n", + blurb(), p->timeout, si->timer_id); #endif /* DEBUG_TIMERS */ } @@ -360,7 +361,7 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) if (! XGetIdleTime (si->dpy, &idle)) { fprintf (stderr, "%s: XGetIdleTime() failed.\n", blurb()); - saver_exit (si, 1); + saver_exit (si, 1, 0); } } else @@ -398,8 +399,8 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) idle_timer, (XtPointer) si); #ifdef DEBUG_TIMERS if (p->verbose_p) - printf ("%s: starting idle_timer (%ld, %ld)\n", - blurb(), p->timeout - idle, si->timer_id); + fprintf (stderr, "%s: starting idle_timer (%ld, %ld)\n", + blurb(), p->timeout - idle, si->timer_id); #endif /* DEBUG_TIMERS */ } } @@ -418,10 +419,11 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) start_notice_events_timer (si, event.xcreatewindow.window); #ifdef DEBUG_TIMERS if (p->verbose_p) - printf ("%s: starting notice_events_timer for 0x%X (%lu)\n", - blurb(), - (unsigned int) event.xcreatewindow.window, - p->notice_events_timeout); + fprintf (stderr, + "%s: starting notice_events_timer for 0x%X (%lu)\n", + blurb(), + (unsigned int) event.xcreatewindow.window, + p->notice_events_timeout); #endif /* DEBUG_TIMERS */ } break; @@ -436,13 +438,20 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) if (p->verbose_p) { if (event.xany.type == MotionNotify) - printf ("%s: MotionNotify at %s\n", blurb(), timestring ()); + fprintf (stderr, "%s: MotionNotify at %s\n", + blurb(), timestring ()); else if (event.xany.type == KeyPress) - printf ("%s: KeyPress seen on 0x%X at %s\n", blurb(), - (unsigned int) event.xkey.window, timestring ()); + fprintf (stderr, "%s: KeyPress seen on 0x%X at %s\n", blurb(), + (unsigned int) event.xkey.window, timestring ()); + else if (event.xany.type == ButtonPress) + fprintf (stderr, "%s: ButtonPress seen on 0x%X at %s\n", blurb(), + (unsigned int) event.xbutton.window, timestring ()); } #endif /* DEBUG_TIMERS */ + /* If any widgets want to handle this event, let them. */ + XtDispatchEvent (&event); + /* We got a user event */ if (!until_idle_p) goto DONE; @@ -461,8 +470,8 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) { # ifdef DEBUG_TIMERS if (p->verbose_p) - printf ("%s: ScreenSaverOn event received at %s\n", - blurb(), timestring ()); + fprintf (stderr, "%s: ScreenSaverOn event received at %s\n", + blurb(), timestring ()); # endif /* DEBUG_TIMERS */ /* Get the "real" server window(s) out of the way as soon @@ -493,16 +502,17 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) { # ifdef DEBUG_TIMERS if (p->verbose_p) - printf ("%s: ScreenSaverOff event received at %s\n", - blurb(), timestring ()); + fprintf (stderr, "%s: ScreenSaverOff event received at %s\n", + blurb(), timestring ()); # endif /* DEBUG_TIMERS */ if (!until_idle_p) goto DONE; } # ifdef DEBUG_TIMERS else if (p->verbose_p) - printf ("%s: unknown MIT-SCREEN-SAVER event received at %s\n", - blurb(), timestring ()); + fprintf (stderr, + "%s: unknown MIT-SCREEN-SAVER event received at %s\n", + blurb(), timestring ()); # endif /* DEBUG_TIMERS */ } else @@ -515,8 +525,8 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) { # ifdef DEBUG_TIMERS if (p->verbose_p) - printf ("%s: ScreenSaverStart event received at %s\n", - blurb(), timestring ()); + fprintf (stderr, "%s: ScreenSaverStart event received at %s\n", + blurb(), timestring ()); # endif /* DEBUG_TIMERS */ if (until_idle_p) @@ -527,8 +537,8 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) { # ifdef DEBUG_TIMERS if (p->verbose_p) - printf ("%s: ScreenSaverEnd event received at %s\n", - blurb(), timestring ()); + fprintf (stderr, "%s: ScreenSaverEnd event received at %s\n", + blurb(), timestring ()); # endif /* DEBUG_TIMERS */ if (!until_idle_p) goto DONE; @@ -603,8 +613,8 @@ watchdog_timer (XtPointer closure, XtIntervalId *id) #ifdef DEBUG_TIMERS if (si->prefs.verbose_p) - printf ("%s: watchdog timer raising %sscreen.\n", - blurb(), (running_p ? "" : "and clearing ")); + fprintf (stderr, "%s: watchdog timer raising %sscreen.\n", + blurb(), (running_p ? "" : "and clearing ")); #endif /* DEBUG_TIMERS */ raise_window (si, True, True, running_p); @@ -612,8 +622,9 @@ watchdog_timer (XtPointer closure, XtIntervalId *id) if (!monitor_powered_on_p (si)) { if (si->prefs.verbose_p) - printf ("%s: server reports that monitor has powered down; " - "killing running hacks.\n", blurb()); + fprintf (stderr, + "%s: server reports that monitor has powered down; " + "killing running hacks.\n", blurb()); kill_screenhack (si); } } @@ -639,8 +650,8 @@ reset_watchdog_timer (saver_info *si, Bool on_p) #ifdef DEBUG_TIMERS if (p->verbose_p) - printf ("%s: restarting watchdog_timer (%ld, %ld)\n", - blurb(), p->watchdog_timeout, si->watchdog_id); + fprintf (stderr, "%s: restarting watchdog_timer (%ld, %ld)\n", + blurb(), p->watchdog_timeout, si->watchdog_id); #endif /* DEBUG_TIMERS */ } diff --git a/driver/windows.c b/driver/windows.c index a460e6da..4daa0607 100644 --- a/driver/windows.c +++ b/driver/windows.c @@ -1,5 +1,5 @@ /* windows.c --- turning the screen black; dealing with visuals, virtual roots. - * xscreensaver, Copyright (c) 1991-1998 Jamie Zawinski + * xscreensaver, Copyright (c) 1991-1998 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -93,8 +93,8 @@ grab_kbd(saver_info *si, Window w) if (status == GrabSuccess) si->keyboard_grab_window = w; - if (p->debug_p) - fprintf(stderr, "%s: XGrabKeyboard(... 0x%x ...) ==> %s\n", + if (p->verbose_p) + fprintf(stderr, "%s: grabbing keyboard on 0x%x... %s.\n", blurb(), (unsigned long) w, (status == GrabSuccess ? "GrabSuccess" : status == AlreadyGrabbed ? "AlreadyGrabbed" : @@ -136,10 +136,9 @@ grab_mouse (saver_info *si, Window w, Cursor cursor) if (status == GrabSuccess) si->mouse_grab_window = w; - if (p->debug_p) - fprintf(stderr, "%s: XGrabPointer(... 0x%x, 0x%x ...) ==> %s\n", - blurb(), (unsigned long) w, (unsigned long) cursor, - grab_string(status)); + if (p->verbose_p) + fprintf(stderr, "%s: grabbing mouse on 0x%x... %s.\n", + blurb(), (unsigned long) w, grab_string(status)); return status; } @@ -149,8 +148,8 @@ ungrab_kbd(saver_info *si) { saver_preferences *p = &si->prefs; XUngrabKeyboard(si->dpy, CurrentTime); - if (p->debug_p) - fprintf(stderr, "%s: XUngrabKeyboard (was 0x%x)\n", blurb(), + if (p->verbose_p) + fprintf(stderr, "%s: ungrabbing keyboard (was 0x%x).\n", blurb(), (unsigned long) si->keyboard_grab_window); si->keyboard_grab_window = 0; } @@ -161,8 +160,8 @@ ungrab_mouse(saver_info *si) { saver_preferences *p = &si->prefs; XUngrabPointer(si->dpy, CurrentTime); - if (p->debug_p) - fprintf(stderr, "%s: XUngrabPointer (was 0x%x)\n", blurb(), + if (p->verbose_p) + fprintf(stderr, "%s: ungrabbing mouse (was 0x%x).\n", blurb(), (unsigned long) si->mouse_grab_window); si->mouse_grab_window = 0; } @@ -327,8 +326,8 @@ kill_xsetroot_data (Display *dpy, Window window, Bool verbose_p) nitems == 1 && bytesafter == 0) { if (verbose_p) - printf ("%s: destroying xsetroot data (0x%lX).\n", - blurb(), *dataP); + fprintf (stderr, "%s: destroying xsetroot data (0x%lX).\n", + blurb(), *dataP); XKillClient (dpy, *dataP); } else @@ -404,8 +403,9 @@ restore_real_vroot_2 (saver_screen_info *ssi) saver_info *si = ssi->global; saver_preferences *p = &si->prefs; if (p->verbose_p && ssi->real_vroot) - printf ("%s: restoring __SWM_VROOT property on the real vroot (0x%lx).\n", - blurb(), (unsigned long) ssi->real_vroot); + fprintf (stderr, + "%s: restoring __SWM_VROOT property on the real vroot (0x%lx).\n", + blurb(), (unsigned long) ssi->real_vroot); remove_vroot_property (si->dpy, ssi->screensaver_window); if (ssi->real_vroot) { @@ -546,7 +546,7 @@ catch_signal (saver_info *si, int sig, Bool on_p) char buf [255]; sprintf (buf, "%s: couldn't catch %s", blurb(), signal_name(sig)); perror (buf); - saver_exit (si, 1); + saver_exit (si, 1, 0); } } } @@ -555,8 +555,8 @@ static void handle_signals (saver_info *si, Bool on_p) { #if 0 - if (on_p) printf ("handling signals\n"); - else printf ("unhandling signals\n"); + if (on_p) fprintf (stderr, "handling signals\n"); + else fprintf (stderr, "unhandling signals\n"); #endif catch_signal (si, SIGHUP, on_p); @@ -588,7 +588,7 @@ handle_signals (saver_info *si, Bool on_p) } void -saver_exit (saver_info *si, int status) +saver_exit (saver_info *si, int status, const char *dump_core_reason) { saver_preferences *p = &si->prefs; static Bool exiting = False; @@ -614,11 +614,49 @@ saver_exit (saver_info *si, int status) else if (status == 1) status = -1; #endif - if (si->prefs.debug_p) + if (si->prefs.debug_p && !dump_core_reason) + dump_core_reason = "because of -debug"; + + if (dump_core_reason) { - fprintf(real_stderr, "%s: dumping core (because of -debug)\n", blurb()); - /* Do this to drop a core file, so that we can get a stack trace. */ - abort(); +#if 0 + if (si->locking_disabled_p && + si->nolock_reason && + *si->nolock_reason) + { + /* If locking is disabled, it's because xscreensaver was launched + by root, and has relinquished its user id (most likely we are + now running as "nobody".) This means we won't be able to dump + core, since "nobody" can't write files; so don't even try. + */ + fprintf(real_stderr, "%s: NOT dumping core (%s)\n", blurb(), + si->nolock_reason); + } + else +#endif + { + /* Note that the Linux man page for setuid() says If uid is + different from the old effective uid, the process will be + forbidden from leaving core dumps. + */ + + char cwd[4096]; /* should really be PATH_MAX, but who cares. */ + fprintf(real_stderr, "%s: dumping core (%s)\n", blurb(), + dump_core_reason); + +# if defined(HAVE_GETCWD) + getcwd (cwd, sizeof(cwd)); +# elif defined(HAVE_GETWD) + getwd (cwd); +# else + strcpy(cwd, "unknown."); +# endif + fprintf (real_stderr, "%s: current directory is %s\n", blurb(), cwd); + describe_uids (si, real_stderr); + + /* Do this to drop a core file, so that we can get a stack trace. */ + abort(); + } } exit (status); @@ -897,7 +935,6 @@ raise_window (saver_info *si, if (p->fade_p && !inhibit_fade && !si->demo_mode_p) { - int grabbed = -1; Window *current_windows = (Window *) calloc(sizeof(Window), si->nscreens); Colormap *current_maps = (Colormap *) @@ -916,37 +953,21 @@ raise_window (saver_info *si, ssi->black_pixel); } - if (p->verbose_p) fprintf (stderr, "%s: fading... ", blurb()); + if (p->verbose_p) fprintf (stderr, "%s: fading...\n", blurb()); XGrabServer (si->dpy); /* ############ DANGER! */ /* Clear the stderr layer on each screen. - Grab the mouse on the first screen on which the mouse is grabbable - (if there are multiple heads, I think you might only be able to - grab the mouse on the screen that currently has the mouse? Anyway, - we only grab the mouse once, and don't try again after the grab - has succeeded.) We grab the mouse on the root window of the screen, - not on the screensaver window, since the screensaver window is not - yet mapped. */ - for (i = 0; i < si->nscreens; i++) - { - saver_screen_info *ssi = &si->screens[i]; - - /* grab and blacken mouse on the root window (saver not mapped yet) - */ - if (grabbed != GrabSuccess) - { - Window root = RootWindowOfScreen(ssi->screen); - grabbed = grab_mouse (si, root, - (si->demo_mode_p ? 0 : ssi->cursor)); - } - - if (!dont_clear || ssi->stderr_overlay_window) - /* Do this before the fade, since the stderr cmap won't fade - even if we uninstall it (beats me...) */ - clear_stderr (ssi); - } + if (!dont_clear) + for (i = 0; i < si->nscreens; i++) + { + saver_screen_info *ssi = &si->screens[i]; + if (ssi->stderr_overlay_window) + /* Do this before the fade, since the stderr cmap won't fade + even if we uninstall it (beats me...) */ + clear_stderr (ssi); + } /* Note! The server is grabbed, and this will take several seconds to complete! */ @@ -958,7 +979,7 @@ raise_window (saver_info *si, current_maps = 0; current_windows = 0; - if (p->verbose_p) fprintf (stderr, "fading done.\n"); + if (p->verbose_p) fprintf (stderr, "%s: fading done.\n", blurb()); #ifdef HAVE_MIT_SAVER_EXTENSION for (i = 0; i < si->nscreens; i++) @@ -970,10 +991,6 @@ raise_window (saver_info *si, } #endif /* HAVE_MIT_SAVER_EXTENSION */ - /* If we had successfully grabbed the mouse, let it go now. */ - if (grabbed == GrabSuccess) - ungrab_mouse (si); - XUngrabServer (si->dpy); XSync (si->dpy, False); /* ###### (danger over) */ } @@ -1007,6 +1024,16 @@ void blank_screen (saver_info *si) { int i; + + /* Note: we do our grabs on the root window, not on the screensaver window. + If we grabbed on the saver window, then the demo mode and lock dialog + boxes wouldn't get any events. + */ + grab_keyboard_and_mouse (si, + /*si->screens[0].screensaver_window,*/ + RootWindowOfScreen(si->screens[0].screen), + (si->demo_mode_p ? 0 : si->screens[0].cursor)); + for (i = 0; i < si->nscreens; i++) { saver_screen_info *ssi = &si->screens[i]; @@ -1019,15 +1046,6 @@ blank_screen (saver_info *si) store_activate_time (si, si->screen_blanked_p); raise_window (si, False, False, False); - /* Note: we do our grabs on the root window, not on the screensaver window. - If we grabbed on the saver window, then the demo mode and lock dialog - boxes wouldn't get any events. - */ - grab_keyboard_and_mouse (si, - /*si->screens[0].screensaver_window,*/ - RootWindowOfScreen(si->screens[0].screen), - (si->demo_mode_p ? 0 : si->screens[0].cursor)); - #ifdef HAVE_XHPDISABLERESET if (si->locked_p && !hp_locked_p) { @@ -1052,7 +1070,6 @@ unblank_screen (saver_info *si) if (p->unfade_p && !si->demo_mode_p) { - int grabbed = -1; Window *current_windows = (Window *) calloc(sizeof(Window), si->nscreens); @@ -1066,7 +1083,7 @@ unblank_screen (saver_info *si) ssi->black_pixel); } - if (p->verbose_p) fprintf (stderr, "%s: unfading... ", blurb()); + if (p->verbose_p) fprintf (stderr, "%s: unfading...\n", blurb()); XSync (si->dpy, False); @@ -1074,18 +1091,10 @@ unblank_screen (saver_info *si) XSync (si->dpy, False); /* Clear the stderr layer on each screen. - Grab the mouse on the first screen on which the mouse is grabbable - (if there are multiple heads, I think you might only be able to - grab the mouse on the screen that currently has the mouse? Anyway, - we only grab the mouse once, and don't try again after the grab - has succeeded.) */ for (i = 0; i < si->nscreens; i++) { saver_screen_info *ssi = &si->screens[i]; - if (grabbed != GrabSuccess) - grabbed = grab_mouse (si, RootWindowOfScreen (ssi->screen), - 0); clear_stderr (ssi); } @@ -1100,11 +1109,7 @@ unblank_screen (saver_info *si) free(current_windows); current_windows = 0; - if (p->verbose_p) fprintf (stderr, "unfading done.\n"); - - /* If we had successfully grabbed the mouse, let it go now. */ - if (grabbed == GrabSuccess) - ungrab_mouse (si); + if (p->verbose_p) fprintf (stderr, "%s: unfading done.\n", blurb()); } else { @@ -1256,6 +1261,13 @@ select_visual (saver_screen_info *ssi, const char *visual_name) ssi->screensaver_window = 0; initialize_screensaver_window_1 (ssi); + + /* stderr_overlay_window is a child of screensaver_window, so we need + to destroy that as well (actually, we just need to invalidate and + drop our pointers to it, but this will destroy it, which is ok so + long as it happens before old_w itself is destroyed.) */ + reset_stderr (ssi); + raise_window (si, True, True, False); store_vroot_property (si->dpy, ssi->screensaver_window, ssi->screensaver_window); diff --git a/driver/xscreensaver-command.c b/driver/xscreensaver-command.c index 8ace1506..4c7a0285 100644 --- a/driver/xscreensaver-command.c +++ b/driver/xscreensaver-command.c @@ -1,5 +1,5 @@ /* xscreensaver-command, Copyright (c) 1991-1998 - * by Jamie Zawinski + * by Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -200,15 +200,15 @@ xscreensaver_command (Display *dpy, Atom command) #ifdef STANDALONE static Atom XA_ACTIVATE, XA_DEACTIVATE, XA_CYCLE, XA_NEXT, XA_PREV; -static Atom XA_EXIT, XA_RESTART, XA_DEMO, XA_LOCK; +static Atom XA_EXIT, XA_RESTART, XA_DEMO, XA_PREFS, XA_LOCK; static char *progname; static char *screensaver_version; static char *usage = "\n\ -usage: %s -\n\ +usage: %s -