From c28aecf9fc41e3a03494bacf7279745425e2fa18 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Mon, 2 Mar 2009 00:42:57 -0500 Subject: [PATCH] ftp://ftp.krokus.ru/pub/OpenBSD/distfiles/xscreensaver-4.06.tar.gz -rw-r--r-- 1 zblaxell zblaxell 3209164 Dec 16 2002 xscreensaver-4.06.tar.gz ba2c14d632ee5d876e1d2b580e6aa6d67b813119 xscreensaver-4.06.tar.gz --- Makefile.in | 5 +- README | 28 + config.guess | 1004 ++- config.sub | 745 ++- configure | 100 +- configure.in | 84 +- driver/Makefile.in | 119 +- driver/XScreenSaver.ad.in | 30 +- driver/XScreenSaver_ad.h | 11 +- driver/demo-Gtk-conf.c | 8 +- driver/demo-Gtk-conf.h | 4 +- driver/demo-Gtk.c | 499 +- driver/passwd-pam.c | 7 +- driver/prefs.c | 14 +- driver/prefs.h | 4 +- driver/remote.c | 4 +- driver/screensaver-properties.desktop.in | 2 +- driver/stderr.c | 3 +- driver/subprocs.c | 30 +- driver/timers.c | 8 +- driver/windows.c | 8 +- driver/xscreensaver-command.c | 2 +- driver/xscreensaver-command.man | 2 +- driver/xscreensaver-demo.glade2 | 2487 +++---- driver/xscreensaver-demo.glade2p | 19 + driver/xscreensaver-demo.man | 2 +- driver/xscreensaver-getimage-file.man | 2 +- driver/xscreensaver-getimage-video | 3 +- driver/xscreensaver-getimage-video.man | 2 +- driver/xscreensaver-getimage.c | 34 +- driver/xscreensaver-getimage.man | 2 +- driver/xscreensaver.c | 41 +- driver/xscreensaver.kss.in | 4 +- driver/xscreensaver.man | 11 +- driver/xscreensaver.pam | 7 +- hacks/Makefile.in | 33 +- hacks/anemone.c | 2 +- hacks/bsod.c | 790 ++- hacks/bsod.man | 1 + hacks/bumps.c | 469 +- hacks/bumps.h | 29 +- hacks/compile_axp.com | 1 + hacks/compile_decc.com | 1 + hacks/config/README | 4 +- hacks/config/atlantis.xml | 2 +- hacks/config/bsod.xml | 22 +- hacks/config/bumps.xml | 2 +- hacks/config/glblur.xml | 46 + hacks/config/greynetic.xml | 2 +- hacks/config/halftone.xml | 46 + hacks/config/lavalite.xml | 1 + hacks/config/webcollage.xml | 2 +- hacks/config/xaos.xml | 5 +- hacks/config/xmatrix.xml | 5 +- hacks/critical.c | 22 +- hacks/distort.c | 15 +- hacks/distort.man | 4 +- hacks/glx/Makefile.in | 36 +- hacks/glx/atlantis.c | 8 +- hacks/glx/chessgames.h | 176 + hacks/glx/chessmodels.c | 17 +- hacks/glx/chessmodels.h | 19 + hacks/glx/circuit.c | 352 +- hacks/glx/endgame.c | 432 +- hacks/glx/endgame.man | 5 +- hacks/glx/engine.c | 95 +- hacks/glx/glblur.c | 638 ++ hacks/glx/glblur.man | 80 + hacks/glx/glplanet.c | 35 +- hacks/glx/lament.c | 113 +- hacks/glx/lavalite.c | 2 +- hacks/glx/lavalite.man | 4 +- hacks/glx/menger.c | 439 +- hacks/glx/molecule.c | 198 +- hacks/glx/queens.c | 260 +- hacks/glx/sballs.c | 4 +- hacks/glx/xlock-gl.c | 24 +- hacks/glx/xpm-ximage.c | 4 +- hacks/glx/xscreensaver-gl-helper.c | 4 +- hacks/greynetic.c | 98 +- hacks/halftone.c | 363 ++ hacks/halftone.man | 79 + hacks/images/hmac.xpm | 52 + hacks/juggle.c | 1 - hacks/maze.c | 11 +- hacks/penrose.man | 4 +- hacks/screenhack.c | 33 + hacks/sonar.c | 23 +- hacks/swirl.c | 4 +- hacks/webcollage | 23 +- hacks/webcollage-helper.c | 2 +- hacks/webcollage.man | 43 +- hacks/xmatrix.c | 7 +- hacks/xmatrix.man | 13 + hacks/xrayswarm.c | 12 +- hacks/xsublim.c | 2 +- po/ChangeLog | 112 +- po/Makefile.in.in | 9 +- po/POTFILES.in | 4 +- po/da.po | 3197 +++++---- po/es.po | 5386 ++++++---------- po/et.po | 1213 ++-- po/fr.po | 1237 ++-- po/ja.po | 486 +- po/ko.po | 1178 ++-- po/nl.po | 7507 ++++++++++++++++++++++ po/no.po | 144 +- po/pl.po | 1432 +++-- po/pt.po | 160 +- po/ru.po | 413 +- po/sk.po | 5200 +++++++++++++++ po/sv.po | 3163 +++++++-- po/update.sh | 24 + po/vi.po | 5371 ++++++++++++++++ po/wa.po | 1676 +++-- po/zh_CN.po | 5348 +++++++++++++++ po/zh_TW.po | 5229 +++++++++++++++ setup.com | 1 + utils/grabclient.c | 2 +- utils/version.h | 2 +- utils/visual.c | 1 + utils/xshm.c | 3 +- xscreensaver.lsm | 16 +- xscreensaver.spec | 2 +- 124 files changed, 48053 insertions(+), 11017 deletions(-) mode change 100755 => 100644 config.sub create mode 100644 driver/xscreensaver-demo.glade2p create mode 100644 hacks/config/glblur.xml create mode 100644 hacks/config/halftone.xml create mode 100644 hacks/glx/chessgames.h create mode 100644 hacks/glx/glblur.c create mode 100644 hacks/glx/glblur.man create mode 100644 hacks/halftone.c create mode 100644 hacks/halftone.man create mode 100644 hacks/images/hmac.xpm create mode 100644 po/nl.po create mode 100644 po/sk.po create mode 100755 po/update.sh create mode 100644 po/vi.po create mode 100644 po/zh_CN.po create mode 100644 po/zh_TW.po diff --git a/Makefile.in b/Makefile.in index 5268e770..117470d4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -10,7 +10,7 @@ SUBDIRS = utils driver hacks hacks/glx po TARFILES = README README.VMS README.debugging INSTALL xscreensaver.lsm \ configure configure.in Makefile.in config.h.in \ config.h-vms install-sh setup.com config.guess aclocal.m4 \ - config.sub install-sh makevms.com \ + config.sub makevms.com \ intltool-merge.in intltool-extract.in intltool-update.in \ xscreensaver.lsm.sh xscreensaver.spec \ @@ -62,7 +62,8 @@ tar: sh xscreensaver.lsm.sh > xscreensaver.lsm.$$$$ ; \ mv xscreensaver.lsm.$$$$ xscreensaver.lsm ; \ NAME=`sed -n \ - 's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/xscreensaver-\1/p' utils/version.h` ; \ + 's/[^0-9]*\([0-9]\.[0-9][0-9]*b\?[0-9]*\).*/xscreensaver-\1/p' \ + utils/version.h` ; \ rm -rf $$NAME ; ln -s . $$NAME ; \ FILES= ; \ ADIR=archive/ ; \ diff --git a/README b/README index ae7f2be1..5fe0a32c 100644 --- a/README +++ b/README @@ -70,6 +70,34 @@ the XScreenSaver FAQ about that: http://www.jwz.org/xscreensaver/faq.html ============ +Changes since 4.05: * New hack, `glblur' (disabled by default, since it + requires fast OpenGL texture support.) + * New hack, `halftone'. + * Updates to `endgame', `queens', `bumps', `glplanet', + `engine', and `circuit'. + * New version of `menger' that uses far fewer polygons. + * Fixed minor bug in `critical' that could cause some + bogus X servers to crash. + * Better labels in `molecule': the labels now appear to + be attached to the atoms, instead of floating in front + of the whole scene. + * Fixed bug that could rarely cause GL hacks to fail to + double-buffer (causing intermittent flickering.) + * Fixed a relative-URL-parsing bug in `webcollage'. + * Fixed a bug that (sometimes) caused the window manager + close box to kill `xscreensaver-demo' with a crash + instead of a graceful exit. + * Updated xscreensaver.pam to the Red Hat 7.3 way. + * More Gnome2-related configure crap. + * Updated to latest `config.guess' and `config.sub'. + * Fixed occasional core dump in `distort'. + * Added a Linux fsck failure and kernel panic to `bsod'. + * Added MacOS X kernel panic to `bsod'. + * Fixed a bug in `bsod' (all bsod bugs are ironic.) + * Fixed a bug that caused `xscreensaver-gl-helper' to + print a nonsense visual ID with some versions of + `printf': this could cause GL programs to display + incorrectly (e.g., flickery.) Changes since 4.04: * More `configure' tweaks to try and get things working on systems that both Gtk 1.x and 2.x installed. * New hack, `endgame'. diff --git a/config.guess b/config.guess index e9e44559..f1657bbc 100755 --- a/config.guess +++ b/config.guess @@ -1,7 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc. -# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-09-03' + # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -21,59 +24,299 @@ # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# Written by Per Bothner . -# The master version of this file is at the FSF in /home/gd/gnu/lib. +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you -# don't specify an explicit system type (host/target name). -# -# Only a few systems have been added to this list; please add others -# (but try to keep the structure clean). -# +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# This shell variable is my proudest work .. or something. --bje + +set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ; +(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old) + || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ; +dummy=$tmpdir/dummy ; +files="$dummy.c $dummy.o $dummy.rel $dummy" ; +trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $files ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; +unset files' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 8/24/94.) +# (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15 - # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'` + eval $set_cc_for_build + cat <$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; + 3-1307) + UNAME_MACHINE="alphaev7" + ;; + esac + fi + rm -f $dummy.s $dummy && rmdir $tmpdir + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-cbm-sysv4 + echo m68k-unknown-sysv4 exit 0;; - amiga:NetBSD:*:*) - echo m68k-cbm-netbsd${UNAME_RELEASE} - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-cbm-openbsd${UNAME_RELEASE} - exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; - Pyramid*:OSx*:*:*|MIS*:OSx*:*:*) + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 @@ -81,9 +324,16 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo pyramid-pyramid-bsd fi exit 0 ;; - NILE:*:*:dcosx) + NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; + DRS?6000:UNIX_SV:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7 && exit 0 ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; @@ -108,27 +358,47 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; - atari*:NetBSD:*:*) - echo m68k-atari-netbsd${UNAME_RELEASE} - exit 0 ;; - atari*:OpenBSD:*:*) - echo m68k-atari-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3*:NetBSD:*:*) - echo m68k-sun-netbsd${UNAME_RELEASE} - exit 0 ;; - sun3*:OpenBSD:*:*) - echo m68k-sun-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:NetBSD:*:*) - echo m68k-apple-netbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-apple-openbsd${UNAME_RELEASE} + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; @@ -141,9 +411,18 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) - sed 's/^ //' << EOF >dummy.c - int main (argc, argv) int argc; char **argv; { + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); @@ -158,12 +437,21 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit (-1); } EOF - ${CC-cc} dummy.c -o dummy \ - && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm dummy.c dummy && exit 0 - rm -f dummy.c dummy + $CC_FOR_BUILD $dummy.c -o $dummy \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:*:*:PowerMAX_OS) + echo powerpc-harris-powermax + exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; @@ -179,15 +467,18 @@ EOF AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ - -o ${TARGET_BINARY_INTERFACE}x = x ] ; then + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then echo m88k-dg-dgux${UNAME_RELEASE} - else + else echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} fi - else echo i586-dg-dgux${UNAME_RELEASE} - fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 @@ -208,12 +499,21 @@ EOF ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i?86:AIX:*:*) + i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - sed 's/^ //' << EOF >dummy.c + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c #include main() @@ -224,8 +524,8 @@ EOF exit(0); } EOF - ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 - rm -f dummy.c dummy + $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 @@ -233,8 +533,9 @@ EOF echo rs6000-ibm-aix3.2 fi exit 0 ;; - *:AIX:*:4) - if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc @@ -242,7 +543,7 @@ EOF if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=4.${UNAME_RELEASE} + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; @@ -252,7 +553,7 @@ EOF ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) @@ -267,18 +568,75 @@ EOF hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; - 9000/[3478]??:HP-UX:*:*) + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;; - 9000/8?? ) HP_ARCH=hppa1.0 ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy && rmdir $tmpdir + fi ;; esac - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; 3050*:HI-UX:*:*) - sed 's/^ //' << EOF >dummy.c + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c #include int main () @@ -303,8 +661,8 @@ EOF exit (0); } EOF - ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 - rm -f dummy.c dummy + $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) @@ -313,13 +671,16 @@ EOF 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; - i?86:OSF1:*:*) + i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else @@ -347,129 +708,273 @@ EOF C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; - CRAY*X-MP:*:*:*) - echo xmp-cray-unicos - exit 0 ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; - CRAY-2:*:*:*) - echo cray2-cray-unicos - exit 0 ;; - F300:UNIX_System_V:*:*) - FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'` + CRAY*T3D:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; - F301:UNIX_System_V:*:*) - echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` - exit 0 ;; - hp3[0-9][05]:NetBSD:*:*) - echo m68k-hp-netbsd${UNAME_RELEASE} + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; - hp3[0-9][05]:OpenBSD:*:*) - echo m68k-hp-openbsd${UNAME_RELEASE} + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; - i?86:BSD/386:*:* | *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + # Determine whether the default compiler uses glibc. + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #if __GLIBC__ >= 2 + LIBC=gnu + #else + LIBC= + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c && rmdir $tmpdir + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; - *:NetBSD:*:*) - echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; - i*:CYGWIN*:*) - echo i386-pc-cygwin32 + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + x86:Interix*:3*) + echo i386-pc-interix3 + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin32 + echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) - echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + rm -f $dummy.c && rmdir $tmpdir + test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu exit 0 ;; - *:Linux:*:*) + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so - # first see if it will tell us. - ld_help_string=`ld --help 2>&1` - if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then - echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then - echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then - echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then - echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then - echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then - echo "powerpc-unknown-linux-gnu" ; exit 0 - elif test "${UNAME_MACHINE}" = "alpha" ; then - echo alpha-unknown-linux-gnu ; exit 0 - elif test "${UNAME_MACHINE}" = "sparc" ; then - echo sparc-unknown-linux-gnu ; exit 0 - else - # Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us - # useful --help. Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout. - test ! -d /usr/lib/ldscripts/. \ - && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 - # Determine whether the default compiler is a.out or elf - cat >dummy.c <&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif EOF - ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 - rm -f dummy.c dummy - fi ;; -# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions -# are messed up and put the nodename in both sysname and nodename. - i?86:DYNIX/ptx:4*:*) + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c && rmdir $tmpdir + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; - i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; - i?86:*:3.2:*) + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; @@ -487,9 +992,12 @@ EOF # "miniframe" echo m68010-convergent-sysv exit 0 ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` @@ -500,24 +1008,30 @@ EOF 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:*) + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; - i?86:LynxOS:2.*:*) + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; - rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) + rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; @@ -529,6 +1043,10 @@ EOF echo ns32k-sni-sysv fi exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm @@ -538,26 +1056,120 @@ EOF # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; - R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*) + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; - PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 -cat >dummy.c <$dummy.c < # include @@ -595,7 +1207,10 @@ main () #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif @@ -640,11 +1255,24 @@ main () #endif #if defined (vax) -#if !defined (ultrix) - printf ("vax-dec-bsd\n"); exit (0); -#else - printf ("vax-dec-ultrix\n"); exit (0); -#endif +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif #endif #if defined (alliant) && defined (i860) @@ -655,8 +1283,8 @@ main () } EOF -${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0 -rm -f dummy.c dummy +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 +rm -f $dummy.c $dummy && rmdir $tmpdir # Apollos put the system type in the environment. @@ -688,6 +1316,48 @@ then esac fi -#echo '(Unable to guess system type)' 1>&2 +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.sub b/config.sub old mode 100755 new mode 100644 index 04325249..1dea9b79 --- a/config.sub +++ b/config.sub @@ -1,6 +1,10 @@ #! /bin/sh -# Configuration validation subroutine script, version 1.1. -# Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-09-05' + # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. @@ -25,6 +29,9 @@ # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. @@ -45,30 +52,73 @@ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. -if [ x$1 = x ] -then - echo Configuration name missing. 1>&2 - echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 - echo "or $0 ALIAS" 1>&2 - echo where ALIAS is a recognized configuration type. 1>&2 - exit 1 -fi +me=`echo "$0" | sed -e 's,.*/,,'` -# First pass through any local machine types. -case $1 in - *local*) - echo $1 - exit 0 - ;; - *) - ;; +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - linux-gnu*) + nto-qnx* | linux-gnu* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -94,15 +144,33 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple) + -apple | -axis) os= basic_machine=$1 ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; -hiux*) os=-hiuxwe2 ;; -sco5) - os=sco3.2v5 + os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) @@ -121,6 +189,9 @@ case $os in os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -143,25 +214,70 @@ case $os in -psos*) os=-psos ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. - tahoe | i860 | m68k | m68000 | m88k | ns32k | arm \ - | arme[lb] | pyramid \ - | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \ - | alpha | we32k | ns16k | clipper | i370 | sh \ - | powerpc | powerpcle | 1750a | dsp16xx | mips64 | mipsel \ - | pdp11 | mips64el | mips64orion | mips64orionel \ - | sparc | sparclet | sparclite | sparc64) + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) basic_machine=$basic_machine-unknown ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. - i[3456]86) + i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. @@ -170,23 +286,77 @@ case $basic_machine in exit 1 ;; # Recognize the basic CPU types with company name. - vax-* | tahoe-* | i[3456]86-* | i860-* | m68k-* | m68000-* | m88k-* \ - | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \ - | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \ - | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \ - | hppa-* | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \ - | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \ - | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-* | f301-*) + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \ + | clipper-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* \ + | m32r-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39 | mipstx39el \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; alliant | fx80) basic_machine=fx80-alliant ;; @@ -202,20 +372,24 @@ case $basic_machine in os=-sysv ;; amiga | amiga-*) - basic_machine=m68k-cbm + basic_machine=m68k-unknown ;; - amigados) - basic_machine=m68k-cbm - os=-amigados + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos ;; amigaunix | amix) - basic_machine=m68k-cbm + basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; aux) basic_machine=m68k-apple os=-aux @@ -224,6 +398,10 @@ case $basic_machine in basic_machine=ns32k-sequent os=-dynix ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; convex-c1) basic_machine=c1-convex os=-bsd @@ -244,27 +422,30 @@ case $basic_machine in basic_machine=c38-convex os=-bsd ;; - cray | ymp) - basic_machine=ymp-cray - os=-unicos - ;; - cray2) - basic_machine=cray2-cray - os=-unicos - ;; - [ctj]90-cray) - basic_machine=c90-cray + cray | j90) + basic_machine=j90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola @@ -292,6 +473,10 @@ case $basic_machine in encore | umax | mmax) basic_machine=ns32k-encore ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; fx2800) basic_machine=i860-alliant ;; @@ -302,6 +487,10 @@ case $basic_machine in basic_machine=tron-gmicro os=-sysv ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 @@ -310,6 +499,14 @@ case $basic_machine in basic_machine=h8300-hitachi os=-hms ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; harris) basic_machine=m88k-harris os=-sysv3 @@ -325,13 +522,30 @@ case $basic_machine in basic_machine=m68k-hp os=-hpux ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; - hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7) + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) @@ -340,27 +554,42 @@ case $basic_machine in hppa-next) os=-nextstep3 ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; i370-ibm* | ibm*) basic_machine=i370-ibm - os=-mvs ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? - i[3456]86v32) + i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; - i[3456]86v4*) + i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; - i[3456]86v) + i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; - i[3456]86sol2) + i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; iris | iris4d) basic_machine=mips-sgi case $os in @@ -386,19 +615,55 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; miniframe) basic_machine=m68000-convergent ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos @@ -411,6 +676,10 @@ case $basic_machine in basic_machine=mips-sony os=-newsos ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; next | m*-next ) basic_machine=m68k-next case $os in @@ -436,9 +705,36 @@ case $basic_machine in basic_machine=i960-intel os=-nindy ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; np1) basic_machine=np1-gould ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 @@ -453,53 +749,85 @@ case $basic_machine in pbb) basic_machine=m68k-tti ;; - pc532 | pc532-*) + pc532 | pc532-*) basic_machine=ns32k-pc532 ;; - pentium | p5) - basic_machine=i586-intel + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc ;; - pentiumpro | p6) - basic_machine=i686-intel + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc ;; - pentium-* | p5-*) + pentiumii | pentium2) + basic_machine=i686-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumpro-* | p6-*) + pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - k5) - # We don't have specific support for AMD's K5 yet, so just call it a Pentium - basic_machine=i586-amd - ;; - nexen) - # We don't have specific support for Nexgen yet, so just call it a Pentium - basic_machine=i586-nexgen + pentiumii-* | pentium2-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; - power) basic_machine=rs6000-ibm + power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown - ;; + ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown - ;; + ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; ps2) basic_machine=i386-ibm ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; sequent) basic_machine=i386-sequent ;; @@ -507,6 +835,10 @@ case $basic_machine in basic_machine=sh-hitachi os=-hms ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; sps7) basic_machine=m68k-bull os=-sysv2 @@ -514,6 +846,13 @@ case $basic_machine in spur) basic_machine=spur-unknown ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; sun2) basic_machine=m68000-sun ;; @@ -554,10 +893,44 @@ case $basic_machine in sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; symmetry) basic_machine=i386-sequent os=-dynix ;; + t3d) + basic_machine=alpha-cray + os=-unicos + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic4x | c4x*) + basic_machine=tic4x-unknown + os=-coff + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; tower | tower-32) basic_machine=m68k-ncr ;; @@ -569,6 +942,10 @@ case $basic_machine in basic_machine=a29k-nyu os=-sym1 ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; vaxv) basic_machine=vax-dec os=-sysv @@ -577,9 +954,9 @@ case $basic_machine in basic_machine=vax-dec os=-vms ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; vxworks960) basic_machine=i960-wrs os=-vxworks @@ -592,13 +969,29 @@ case $basic_machine in basic_machine=a29k-wrs os=-vxworks ;; - xmp) - basic_machine=xmp-cray - os=-unicos + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf ;; - xps | xps100) + windows32) + basic_machine=i386-pc + os=-windows32-msvcrt + ;; + xps | xps100) basic_machine=xps100-honeywell ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; none) basic_machine=none-none os=-none @@ -606,8 +999,14 @@ case $basic_machine in # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. - mips) - basic_machine=mips-mips + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm @@ -618,16 +1017,26 @@ case $basic_machine in vax) basic_machine=vax-dec ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; - sparc) + sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; - cydra) + cydra) basic_machine=cydra-cydrome ;; orion) @@ -636,6 +1045,15 @@ case $basic_machine in orion105) basic_machine=clipper-highlevel ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 @@ -668,9 +1086,12 @@ case $os in -solaris) os=-solaris2 ;; - -unixware* | svr4*) + -svr4*) os=-sysv4 ;; + -unixware*) + os=-sysv4.2uw + ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; @@ -681,17 +1102,43 @@ case $os in -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -linux-gnu* | -uxpv*) + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* | -powermax*) # Remember, each alternative MUST END IN *, to match a version number. ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; @@ -701,6 +1148,12 @@ case $os in -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; -osfrose*) os=-osfrose ;; @@ -716,11 +1169,23 @@ case $os in -acis*) os=-aos ;; + -atheos*) + os=-atheos + ;; + -386bsd) + os=-bsd + ;; -ctix* | -uts*) os=-sysv ;; + -nova*) + os=-rtmk-nova + ;; -ns2 ) - os=-nextstep2 + os=-nextstep2 + ;; + -nsk*) + os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) @@ -747,9 +1212,18 @@ case $os in # This must come after -sysvr4. -sysv*) ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; -xenix) os=-xenix ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; -none) ;; *) @@ -775,10 +1249,17 @@ case $basic_machine in *-acorn) os=-riscix1.2 ;; + arm*-rebel) + os=-linux + ;; arm*-semi) os=-aout ;; - pdp11-*) + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) os=-none ;; *-dec | vax-*) @@ -796,15 +1277,39 @@ case $basic_machine in # default. # os=-sunos4 ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; + *-be) + os=-beos + ;; *-ibm) os=-aix ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; *-hp) os=-hpux ;; @@ -815,7 +1320,7 @@ case $basic_machine in os=-sysv ;; *-cbm) - os=-amigados + os=-amigaos ;; *-dg) os=-dgux @@ -847,27 +1352,39 @@ case $basic_machine in *-next) os=-nextstep3 ;; - *-gould) + *-gould) os=-sysv ;; - *-highlevel) + *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; - *-sgi) + *-sgi) os=-irix ;; - *-siemens) + *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; - f301-fujitsu) + f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; *) os=-none ;; @@ -889,9 +1406,15 @@ case $basic_machine in -aix*) vendor=ibm ;; + -beos*) + vendor=be + ;; -hpux*) vendor=hp ;; + -mpeix*) + vendor=hp + ;; -hiux*) vendor=hitachi ;; @@ -907,21 +1430,41 @@ case $basic_machine in -genix*) vendor=ns ;; - -mvs*) + -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; - -vxsim* | -vxworks*) + -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure b/configure index 94dd9a65..d9ba45ce 100755 --- a/configure +++ b/configure @@ -2361,7 +2361,7 @@ fi if test -n "$GCC"; then echo "$as_me:$LINENO: result: Turning on gcc compiler warnings." >&5 echo "${ECHO_T}Turning on gcc compiler warnings." >&6 - CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format" + CC="$CC -Wall -Wstrict-prototypes -Wnested-externs" else case "$host" in *-irix5* |*-irix6.0-3* ) @@ -6276,9 +6276,7 @@ _ACEOF -# #### no sign of en_GB -#ALL_LINGUAS="ca de en_GB et fr it ko pl sv da es fi hu ja no pt pt_BR ru wa" -ALL_LINGUAS="ca de et fr it ko pl sv da es fi hu ja no pt pt_BR ru wa" +ALL_LINGUAS="ca da de es et fi fr hu it ja ko nl no pl pt pt_BR ru sk sv vi wa zh_CN zh_TW" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 @@ -12494,6 +12492,7 @@ _ACEOF else if test -n "$ac_gtk_version_string" ; then gtk2_halfassed="$ac_gtk_version_string" + gtk2_halfassed_lib="$req" fi fi @@ -12919,7 +12918,7 @@ fi GNOME_DATADIR="" - if test "$have_gnome" = yes -a "$have_gtk" = yes; then + if test "$have_gtk" = yes; then if test -n "$pkg_config"; then if test "$have_gtk2" = yes; then GNOME_DATADIR=`$pkg_config --variable=prefix gtk+-2.0` @@ -12960,9 +12959,11 @@ fi # Check for the Gnome Help Browser. # -if test "$have_gnome" = yes; then - # Extract the first word of "gnome-help-browser", so it can be a program name with args. -set dummy gnome-help-browser; ac_word=$2 +if test "$have_gtk" = yes; then + for ac_prog in yelp gnome-help-browser +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 "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_have_gnome_help+set}" = set; then @@ -12978,14 +12979,13 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_have_gnome_help="yes" + ac_cv_prog_have_gnome_help="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done - test -z "$ac_cv_prog_have_gnome_help" && ac_cv_prog_have_gnome_help="no" fi fi have_gnome_help=$ac_cv_prog_have_gnome_help @@ -12997,8 +12997,13 @@ else echo "${ECHO_T}no" >&6 fi -else - have_gnome_help=no + test -n "$have_gnome_help" && break +done +test -n "$have_gnome_help" || have_gnome_help="no" + + if test "$have_gnome_help" != no; then + have_gnome_help=yes + fi fi @@ -14516,7 +14521,7 @@ if test "${ac_cv_mesagl_version_string+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat > conftest.$ac_ext < #ifndef MESA_MAJOR_VERSION @@ -14730,7 +14735,9 @@ echo "${ECHO_T}not found ($d: no such directory)" >&6 GLE_LIBS="" -if test "$with_gle" = yes; then +if test "$have_gl" = no ; then + true +elif test "$with_gle" = yes; then ac_save_CPPFLAGS="$CPPFLAGS" @@ -17527,9 +17534,56 @@ else fi +# Set PO_DATADIR to something sensible. +# +echo "$as_me:$LINENO: checking for locale directory" >&5 +echo $ECHO_N "checking for locale directory... $ECHO_C" >&6 +if test -n "$GNOME_DATADIR" ; then + PO_DATADIR="$GNOME_DATADIR" +elif test "$have_gtk" = yes; then + if test -n "$pkg_config"; then + if test "$have_gtk2" = yes; then + PO_DATADIR=`$pkg_config --variable=prefix gtk+-2.0` + else + PO_DATADIR=`$pkg_config --variable=prefix gtk+` + fi + else + PO_DATADIR=`$gtk_config --prefix` + fi + PO_DATADIR="$PO_DATADIR/share" +fi + +if test -z "$PO_DATADIR" ; then + # + # #### Total fucking kludge -- + # Map /build/prefix/usr/X11R6/share/ to /build/prefix/usr/share/ + # but of course we need to expand all the nested variables to do that... + # + dd=$datadir + eval dd=${dd} + eval dd=${dd} + eval dd=${dd} + eval dd=${dd} + eval dd=${dd} + PO_DATADIR=`echo $dd | sed 's@/X11R6/@/@'` +fi + +echo "$as_me:$LINENO: result: $PO_DATADIR/locale" >&5 +echo "${ECHO_T}$PO_DATADIR/locale" >&6 + + # canonicalize slashes. HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'` +# gcc 3.0 likes to issue this warning for every file: +# +# cc1: warning: changing search order for system directory "/usr/local/include" +# cc1: warning: as it has already been specified as a non-system directory +# +# Yay. We can only avoid that by deleting "-I${prefix}/include" from the list. +# Which *should* be totally redundant, and thus an ok thing to delete? +# +INCLUDES=`echo "$INCLUDES" | sed 's@ -I${prefix}/include@@g;'` ############################################################################### @@ -17584,6 +17638,7 @@ HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'` + APPDEFAULTS=$ac_x_app_defaults @@ -18286,6 +18341,7 @@ s,@GNOMEHELP_N@,$GNOMEHELP_N,;t t s,@HACKDIR@,$HACKDIR,;t t s,@GNOME_DATADIR@,$GNOME_DATADIR,;t t s,@GLADE_DATADIR@,$GLADE_DATADIR,;t t +s,@PO_DATADIR@,$PO_DATADIR,;t t s,@GNOME_PANELDIR@,$GNOME_PANELDIR,;t t s,@HACK_CONF_DIR@,$HACK_CONF_DIR,;t t s,@GTK_EXTRA_OBJS@,$GTK_EXTRA_OBJS,;t t @@ -18958,10 +19014,12 @@ elif test "$with_gtk_req" = yes -a "$have_gtk" = no ; then fi if test "$gtk2_halfassed" != no ; then - warnL "GTK version $gtk2_halfassed was found, but some other supporting" - warn2 "libraries were not, so GTK 2.x can't be used. Please" - warn2 "read the above output and the \`config.log' file to see" - warn2 "which libraries are missing." + warnL "GTK version $gtk2_halfassed was found, but at least one supporting" + warn2 "library ($gtk2_halfassed_lib) was not, so GTK 2.x can't be used." + v="$ac_gtk_version_string" + warn2 "GTK $v is also installed, so it will be used instead." + warn2 "Please read the above output and the \`config.log' file" + warn2 "for more details." fi @@ -19001,6 +19059,12 @@ if test "$have_gtk" = yes ; then fi fi +if test "$have_gtk" = yes -a "$have_gdk_pixbuf" = no ; then + warn "GTK is being used, but the GDK-Pixbuf library and/or" + warn2 "headers were not found. That can't be good. Please" + warn2 "install the GDK-Pixbuf development kit and re-configure." +fi + if test "$have_motif" = yes -a "$have_lesstif" = yes ; then preferred_lesstif=0.92 diff --git a/configure.in b/configure.in index ac16c7e8..e5579217 100644 --- a/configure.in +++ b/configure.in @@ -65,7 +65,7 @@ AC_DEFUN(AC_PROG_CC_ANSI, if test -n "$GCC"; then AC_MSG_RESULT(Turning on gcc compiler warnings.) - CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format" + CC="$CC -Wall -Wstrict-prototypes -Wnested-externs" else case "$host" in *-irix5* |*-irix6.[0-3]* ) @@ -808,9 +808,7 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE") AC_DEFINE_UNQUOTED(PACKAGE, "$GETTEXT_PACKAGE") AC_SUBST(GETTEXT_PACKAGE) -# #### no sign of en_GB -#ALL_LINGUAS="ca de en_GB et fr it ko pl sv da es fi hu ja no pt pt_BR ru wa" -ALL_LINGUAS="ca de et fr it ko pl sv da es fi hu ja no pt pt_BR ru wa" +ALL_LINGUAS="ca da de es et fi fr hu it ja ko nl no pl pt pt_BR ru sk sv vi wa zh_CN zh_TW" AM_GLIB_GNU_GETTEXT @@ -1950,6 +1948,7 @@ if test "$with_gtk" = yes; then else if test -n "$ac_gtk_version_string" ; then gtk2_halfassed="$ac_gtk_version_string" + gtk2_halfassed_lib="$req" fi fi @@ -2109,7 +2108,7 @@ if test "$with_gtk" = yes; then GNOME_DATADIR="" - if test "$have_gnome" = yes -a "$have_gtk" = yes; then + if test "$have_gtk" = yes; then if test -n "$pkg_config"; then if test "$have_gtk2" = yes; then GNOME_DATADIR=`$pkg_config --variable=prefix gtk+-2.0` @@ -2147,10 +2146,11 @@ fi # Check for the Gnome Help Browser. # -if test "$have_gnome" = yes; then - AC_CHECK_PROG(have_gnome_help, gnome-help-browser, yes, no) -else - have_gnome_help=no +if test "$have_gtk" = yes; then + AC_CHECK_PROGS(have_gnome_help, yelp gnome-help-browser, no) + if test "$have_gnome_help" != no; then + have_gnome_help=yes + fi fi @@ -2640,7 +2640,9 @@ HANDLE_X_PATH_ARG(with_gle, --with-gle, GLE) GLE_LIBS="" -if test "$with_gle" = yes; then +if test "$have_gl" = no ; then + true +elif test "$with_gle" = yes; then AC_CHECK_X_HEADER(GL/gle.h, have_gle3=yes, have_gle3=no, [#include ]) @@ -3359,9 +3361,54 @@ else fi +# Set PO_DATADIR to something sensible. +# +AC_MSG_CHECKING([for locale directory]) +if test -n "$GNOME_DATADIR" ; then + PO_DATADIR="$GNOME_DATADIR" +elif test "$have_gtk" = yes; then + if test -n "$pkg_config"; then + if test "$have_gtk2" = yes; then + PO_DATADIR=`$pkg_config --variable=prefix gtk+-2.0` + else + PO_DATADIR=`$pkg_config --variable=prefix gtk+` + fi + else + PO_DATADIR=`$gtk_config --prefix` + fi + PO_DATADIR="$PO_DATADIR/share" +fi + +if test -z "$PO_DATADIR" ; then + # + # #### Total fucking kludge -- + # Map /build/prefix/usr/X11R6/share/ to /build/prefix/usr/share/ + # but of course we need to expand all the nested variables to do that... + # + dd=$datadir + eval dd=${dd} + eval dd=${dd} + eval dd=${dd} + eval dd=${dd} + eval dd=${dd} + PO_DATADIR=`echo $dd | sed 's@/X11R6/@/@'` +fi + +AC_MSG_RESULT($PO_DATADIR/locale) + + # canonicalize slashes. HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'` +# gcc 3.0 likes to issue this warning for every file: +# +# cc1: warning: changing search order for system directory "/usr/local/include" +# cc1: warning: as it has already been specified as a non-system directory +# +# Yay. We can only avoid that by deleting "-I${prefix}/include" from the list. +# Which *should* be totally redundant, and thus an ok thing to delete? +# +INCLUDES=`echo "$INCLUDES" | sed 's@ -I${prefix}/include@@g;'` ############################################################################### @@ -3414,6 +3461,7 @@ AC_SUBST(GNOMEHELP_N) AC_SUBST(HACKDIR) AC_SUBST(GNOME_DATADIR) AC_SUBST(GLADE_DATADIR) +AC_SUBST(PO_DATADIR) AC_SUBST(GNOME_PANELDIR) AC_SUBST(HACK_CONF_DIR) AC_SUBST(GTK_EXTRA_OBJS) @@ -3563,10 +3611,12 @@ elif test "$with_gtk_req" = yes -a "$have_gtk" = no ; then fi if test "$gtk2_halfassed" != no ; then - warnL "GTK version $gtk2_halfassed was found, but some other supporting" - warn2 "libraries were not, so GTK 2.x can't be used. Please" - warn2 "read the above output and the \`config.log' file to see" - warn2 "which libraries are missing." + warnL "GTK version $gtk2_halfassed was found, but at least one supporting" + warn2 "library ($gtk2_halfassed_lib) was not, so GTK 2.x can't be used." + v="$ac_gtk_version_string" + warn2 "GTK $v is also installed, so it will be used instead." + warn2 "Please read the above output and the \`config.log' file" + warn2 "for more details." fi @@ -3606,6 +3656,12 @@ if test "$have_gtk" = yes ; then fi fi +if test "$have_gtk" = yes -a "$have_gdk_pixbuf" = no ; then + warn "GTK is being used, but the GDK-Pixbuf library and/or" + warn2 "headers were not found. That can't be good. Please" + warn2 "install the GDK-Pixbuf development kit and re-configure." +fi + if test "$have_motif" = yes -a "$have_lesstif" = yes ; then preferred_lesstif=0.92 diff --git a/driver/Makefile.in b/driver/Makefile.in index 8e925da4..8dfbe6a3 100644 --- a/driver/Makefile.in +++ b/driver/Makefile.in @@ -14,16 +14,18 @@ install_prefix = prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ -mandir = @mandir@ -man1dir = $(mandir)/man1 -mansuffix = 1 datadir = @datadir@ localedir = $(datadir)/locale +mandir = @mandir@ +mansuffix = 1 +manNdir = $(mandir)/man$(mansuffix) INTLTOOL_MERGE = @INTLTOOL_MERGE@ GNOME_DATADIR = @GNOME_DATADIR@ -GNOME_CCDIR = $(GNOME_DATADIR)/control-center/Desktop +GNOME_CCDIR_1 = $(GNOME_DATADIR)/control-center/Desktop +GNOME_CCDIR_2 = $(GNOME_DATADIR)/control-center/capplets +GNOME_CCDIR_3 = $(GNOME_DATADIR)/control-center-2.0/capplets GNOME_PANELDIR1 = $(GNOME_DATADIR)/gnome/apps/Settings/Desktop GNOME_PANELDIR2 = $(GNOME_DATADIR)/applications GNOME_PANELDIR = @GNOME_PANELDIR@ @@ -213,6 +215,7 @@ MEN = xscreensaver.man xscreensaver-demo.man \ xscreensaver-getimage-video.man EXTRAS = README Makefile.in XScreenSaver.ad.in xscreensaver.pam \ xscreensaver-demo.glade xscreensaver-demo.glade2 \ + xscreensaver-demo.glade2p \ screensaver-properties.desktop.in \ screensaver-properties-capplet \ xscreensaver.kss.in \ @@ -345,15 +348,15 @@ munge-scripts: $(SCRIPTS) install-man: $(MEN) @men="$(MEN)" ; \ - if [ ! -d $(install_prefix)$(man1dir) ]; then \ - $(INSTALL_DIRS) $(install_prefix)$(man1dir) ; \ + if [ ! -d $(install_prefix)$(manNdir) ]; then \ + $(INSTALL_DIRS) $(install_prefix)$(manNdir) ; \ fi ; \ for man in $$men; do \ instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \ echo $(INSTALL_DATA) $(srcdir)/$$man \ - $(install_prefix)$(man1dir)/$$instname ; \ + $(install_prefix)$(manNdir)/$$instname ; \ $(INSTALL_DATA) $(srcdir)/$$man \ - $(install_prefix)$(man1dir)/$$instname ; \ + $(install_prefix)$(manNdir)/$$instname ; \ done uninstall-program: @@ -369,8 +372,8 @@ uninstall-man: @men="$(MEN)" ; \ for man in $$men; do \ instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \ - echo rm -f $(install_prefix)$(man1dir)/$$instname ; \ - rm -f $(install_prefix)$(man1dir)/$$instname ; \ + echo rm -f $(install_prefix)$(manNdir)/$$instname ; \ + rm -f $(install_prefix)$(manNdir)/$$instname ; \ done install-pam: @@ -416,23 +419,36 @@ install-pam: fi ; \ elif [ -f $$conf ]; then \ if ( grep $$dest $$conf >/dev/null ); then \ - true ; \ + echo "$$conf unchanged: already has an entry for $$dest" ; \ else \ + src="pam.conf.$$$$" ; \ + echo "grep -v $$dest $$conf > $$src" ; \ + grep -v $$dest $$conf > $$src ; \ + extras=`sed -n "s/^login\(.*auth.*\)$$/$$dest\1/p" $$conf`; \ + echo "$$extras" >> $$src ; \ + if [ "x$$extras" = "x" ]; then \ + echo "Error: no login rules in $$conf?" >&2 ; \ + else \ + echo "adding $$dest rules to $$src:" ; \ + echo "$$extras" | sed 's/^/ /' ; \ + fi ; \ + echo $(INSTALL_DATA) $$src $$conf ; \ + $(INSTALL_DATA) $$src $$conf ; \ + echo rm -f $$src ; \ + rm -f $$src ; \ + fi ; \ + if ! ( grep $$dest $$conf >/dev/null ); then \ e=echo ; \ $$e "" ;\ $$e " ####################################################################";\ $$e " Warning: xscreensaver has been compiled with support for Pluggable" ;\ - $$e " Authentication Modules (PAM). To complete the installation";\ - $$e " of PAM support, you must add the following line to the file";\ - $$e " $$conf:" ;\ - $$e "" ;\ - $$e " $$dest auth required /usr/lib/security/pam_unix.so.1" ;\ - $$e "" ;\ - $$e " Be careful: if you mess up that file, you could completely" ;\ - $$e " hose your machine (e.g., \`login' and \`su' won't work, and";\ - $$e " you'll have to boot single-user to fix it.)" ;\ + $$e " Authentication Modules (PAM). However, we were unable to" ;\ + $$e " install xscreensaver rules in the file $$conf." ;\ + $$e " PAM is unlikely to work without this (and old-style" ;\ + $$e " password authentication will be used instead, which may" ;\ + $$e " or may not work.)" ;\ $$e " ####################################################################";\ - echo ""; \ + $$e "" ;\ fi ; \ fi @@ -440,30 +456,57 @@ install-gnome:: screensaver-properties.desktop @lost="" ;\ if [ "$(GNOME_DATADIR)" != "" ]; then \ \ - if [ ! -d "$(install_prefix)$(GNOME_CCDIR)" ]; then \ - echo $(INSTALL_DIRS) "$(install_prefix)$(GNOME_CCDIR)" ;\ - $(INSTALL_DIRS) "$(install_prefix)$(GNOME_CCDIR)" ;\ + if [ ! -d "$(install_prefix)$(GNOME_CCDIR_1)" ]; then \ + echo $(INSTALL_DIRS) "$(install_prefix)$(GNOME_CCDIR_1)" ;\ + $(INSTALL_DIRS) "$(install_prefix)$(GNOME_CCDIR_1)" ;\ + fi ;\ + if [ ! -d "$(install_prefix)$(GNOME_CCDIR_2)" ]; then \ + echo $(INSTALL_DIRS) "$(install_prefix)$(GNOME_CCDIR_2)" ;\ + $(INSTALL_DIRS) "$(install_prefix)$(GNOME_CCDIR_2)" ;\ + fi ;\ + if [ ! -d "$(install_prefix)$(GNOME_CCDIR_3)" ]; then \ + echo $(INSTALL_DIRS) "$(install_prefix)$(GNOME_CCDIR_3)" ;\ + $(INSTALL_DIRS) "$(install_prefix)$(GNOME_CCDIR_3)" ;\ + fi ;\ + if [ ! -d "$(install_prefix)$(GNOME_PANELDIR)" ]; then \ + echo $(INSTALL_DIRS) "$(install_prefix)$(GNOME_PANELDIR)" ;\ + $(INSTALL_DIRS) "$(install_prefix)$(GNOME_PANELDIR)" ;\ + fi ;\ + \ + echo $(INSTALL_DATA) screensaver-properties.desktop \ + $(install_prefix)$(GNOME_CCDIR_1)/screensaver-properties.desktop;\ + \ + if $(INSTALL_DATA) screensaver-properties.desktop \ + $(install_prefix)$(GNOME_CCDIR_1)/screensaver-properties.desktop;\ + then true ;\ + else \ + lost="$$lost $(install_prefix)$(GNOME_CCDIR_1)" ;\ fi ;\ \ - echo $(INSTALL_DATA) screensaver-properties.desktop \ - $(install_prefix)$(GNOME_CCDIR)/screensaver-properties.desktop; \ + echo $(INSTALL_DATA) screensaver-properties.desktop \ + $(install_prefix)$(GNOME_CCDIR_2)/screensaver-properties.desktop;\ \ - if $(INSTALL_DATA) screensaver-properties.desktop \ - $(install_prefix)$(GNOME_CCDIR)/screensaver-properties.desktop; \ + if $(INSTALL_DATA) screensaver-properties.desktop \ + $(install_prefix)$(GNOME_CCDIR_2)/screensaver-properties.desktop;\ then true ;\ else \ - lost="$$lost $(install_prefix)$(GNOME_CCDIR)" ;\ + lost="$$lost $(install_prefix)$(GNOME_CCDIR_2)" ;\ fi ;\ \ - if [ ! -d "$(install_prefix)$(GNOME_PANELDIR)" ]; then \ - echo $(INSTALL_DIRS) "$(install_prefix)$(GNOME_PANELDIR)" ;\ - $(INSTALL_DIRS) "$(install_prefix)$(GNOME_PANELDIR)" ;\ + echo $(INSTALL_DATA) screensaver-properties.desktop \ + $(install_prefix)$(GNOME_CCDIR_3)/screensaver-properties.desktop;\ + \ + if $(INSTALL_DATA) screensaver-properties.desktop \ + $(install_prefix)$(GNOME_CCDIR_3)/screensaver-properties.desktop;\ + then true ;\ + else \ + lost="$$lost $(install_prefix)$(GNOME_CCDIR_3)" ;\ fi ;\ \ echo $(INSTALL_DATA) screensaver-properties.desktop \ - $(GNOME_PANELDIR)/screensaver-properties.desktop ;\ + $(install_prefix)$(GNOME_PANELDIR)/screensaver-properties.desktop;\ if $(INSTALL_DATA) screensaver-properties.desktop \ - $(install_prefix)$(GNOME_PANELDIR)/screensaver-properties.desktop ;\ + $(install_prefix)$(GNOME_PANELDIR)/screensaver-properties.desktop;\ then true ;\ else \ lost="$$lost $(install_prefix)$(GNOME_PANELDIR)" ;\ @@ -572,8 +615,12 @@ install-gnome:: xscreensaver-demo.glade2 uninstall-gnome:: @if [ "$(GNOME_DATADIR)" != "" ]; then \ f=screensaver-properties.desktop ;\ - echo rm -f $(install_prefix)$(GNOME_CCDIR)/$$f ;\ - rm -f $(install_prefix)$(GNOME_CCDIR)/$$f ;\ + echo rm -f $(install_prefix)$(GNOME_CCDIR_1)/$$f ;\ + rm -f $(install_prefix)$(GNOME_CCDIR_1)/$$f ;\ + echo rm -f $(install_prefix)$(GNOME_CCDIR_2)/$$f ;\ + rm -f $(install_prefix)$(GNOME_CCDIR_2)/$$f ;\ + echo rm -f $(install_prefix)$(GNOME_CCDIR_3)/$$f ;\ + rm -f $(install_prefix)$(GNOME_CCDIR_3)/$$f ;\ echo rm -f $(install_prefix)$(GNOME_PANELDIR)/$$f ;\ rm -f $(install_prefix)$(GNOME_PANELDIR)/$$f ;\ fi diff --git a/driver/XScreenSaver.ad.in b/driver/XScreenSaver.ad.in index f759d19c..d42922d0 100644 --- a/driver/XScreenSaver.ad.in +++ b/driver/XScreenSaver.ad.in @@ -4,8 +4,8 @@ ! a screen saver and locker for the X window system ! by Jamie Zawinski ! -! version 4.05 -! 11-Jun-2002 +! version 4.06 +! 23-Oct-2002 ! ! See "man xscreensaver" for more info. The latest version is always ! available at http://www.jwz.org/xscreensaver/ @@ -53,8 +53,9 @@ *splash: True *splashDuration: 0:00:05 *visualID: default - *captureStderr: True +*ignoreUninstalledPrograms: False + *overlayTextForeground: #FFFF00 *overlayTextBackground: #000000 *overlayStderr: True @@ -77,13 +78,14 @@ ! This is how the "Help" button loads URLs (/bin/sh syntax.) ! The "helpURL" will be substituted for up to two occurrences of "%s". -*loadURL: netscape -remote 'openURL(%s)' || netscape '%s' +@GNOMEHELP_N@*loadURL: mozilla '%s' || netscape '%s' +@GNOMEHELP_Y@*loadURL: gnome-url-show '%s' || gnome-moz-remote --newwin '%s' ! This is what the "Manual" button in xscreensaver-demo runs (/bin/sh syntax.) -@GNOMEHELP_N@*manualCommand: xterm +sb -fg black -bg gray75 -T '%s manual' \ -@GNOMEHELP_N@ -e /bin/sh -c 'man "%s" || read foo' +@GNOMEHELP_N@*manualCommand: xterm -sb -fg black -bg gray75 -T '%s manual' \ +@GNOMEHELP_N@ -e /bin/sh -c 'man "%s" ; read foo' ! For GNOME systems: -@GNOMEHELP_Y@*manualCommand: gnome-help-browser 'man:%s' +@GNOMEHELP_Y@*manualCommand: yelp 'man:%s' || gnome-help-browser 'man:%s' ! The format used for printing the date and time in the password dialog box @@ -95,10 +97,10 @@ ! *dateFormat: %H:%M -! 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, -! and you need to set this resource to False (or get a WM that works.) +! Turning on "installColormap" on 8-bit systems 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, and you need to set this resource to False (or get a WM that works.) ! *installColormap: True @@ -282,6 +284,7 @@ - thornbird -root \n\ fluidballs -root \n\ anemone -root \n\ + halftone -root \n\ color: bubbles -root \n\ - default-n: webcollage -root \n\ - default-n: "WebCollage (whacked)" \ @@ -331,6 +334,7 @@ @GL_KLUDGE@ GL: lavalite -root \n\ @GL_KLUDGE@ GL: queens -root \n\ @GL_KLUDGE@ GL: endgame -root \n\ +- GL: glblur -root \n\ \ - xdaliclock -root -builtin3 -cycle \n\ - default-n: xearth -nofork -nostars -ncolors 50 \ @@ -340,7 +344,8 @@ -markerfile earth -wait 1 -timewarp 400 \n\ - xmountains -b -M -Z 0 -r 1 \n\ - "XMountains (top)" xmountains -b -M -Z 0 -r 1 -m \n\ -- xaos -fullscreen -autopilot \ +- xaos -root -autopilot -nogui -delay 10000 \ + -maxframerate 30 \ -incoloring -1 -outcoloring -1 \n\ - xfishtank -d -s \n\ - xsnow \n\ @@ -609,6 +614,7 @@ XScreenSaver*doc.fontList: *-helvetica-medium-r-*-*-*-100-*-*-*-iso8859-1 *hacks.rotzoomer.name: RotZoomer *hacks.stonerview.name: StonerView *hacks.starwars.name: StarWars +*hacks.glblur.name: GLBlur *hacks.gltext.name: GLText *hacks.dangerball.name: DangerBall *hacks.whirlygig.name: WhirlyGig diff --git a/driver/XScreenSaver_ad.h b/driver/XScreenSaver_ad.h index 79d17107..671fa0a6 100644 --- a/driver/XScreenSaver_ad.h +++ b/driver/XScreenSaver_ad.h @@ -27,6 +27,7 @@ "*splashDuration: 0:00:05", "*visualID: default", "*captureStderr: True", +"*ignoreUninstalledPrograms: False", "*overlayTextForeground: #FFFF00", "*overlayTextBackground: #000000", "*overlayStderr: True", @@ -38,8 +39,8 @@ "*demoCommand: xscreensaver-demo", "*prefsCommand: xscreensaver-demo -prefs", "*helpURL: http://www.jwz.org/xscreensaver/man.html", -"*loadURL: netscape -remote 'openURL(%s)' || netscape '%s'", -"*manualCommand: gnome-help-browser 'man:%s'", +"*loadURL: gnome-url-show '%s' || gnome-moz-remote --newwin '%s'", +"*manualCommand: yelp 'man:%s' || gnome-help-browser 'man:%s'", "*dateFormat: %d-%b-%y (%a); %I:%M %p", "*installColormap: True", "*programs: \ @@ -185,6 +186,7 @@ - thornbird -root \\n\ fluidballs -root \\n\ anemone -root \\n\ + halftone -root \\n\ color: bubbles -root \\n\ - default-n: webcollage -root \\n\ - default-n: \"WebCollage (whacked)\" \ @@ -234,6 +236,7 @@ GL: lavalite -root \\n\ GL: queens -root \\n\ GL: endgame -root \\n\ +- GL: glblur -root \\n\ \ - xdaliclock -root -builtin3 -cycle \\n\ - default-n: xearth -nofork -nostars -ncolors 50 \ @@ -243,7 +246,8 @@ -markerfile earth -wait 1 -timewarp 400 \\n\ - xmountains -b -M -Z 0 -r 1 \\n\ - \"XMountains (top)\" xmountains -b -M -Z 0 -r 1 -m \\n\ -- xaos -fullscreen -autopilot \ +- xaos -root -autopilot -nogui -delay 10000 \ + -maxframerate 30 \ -incoloring -1 -outcoloring -1 \\n\ - xfishtank -d -s \\n\ - xsnow \\n\ @@ -421,6 +425,7 @@ "*hacks.rotzoomer.name: RotZoomer", "*hacks.stonerview.name: StonerView", "*hacks.starwars.name: StarWars", +"*hacks.glblur.name: GLBlur", "*hacks.gltext.name: GLText", "*hacks.dangerball.name: DangerBall", "*hacks.whirlygig.name: WhirlyGig", diff --git a/driver/demo-Gtk-conf.c b/driver/demo-Gtk-conf.c index 44726c70..9a3bbfc8 100644 --- a/driver/demo-Gtk-conf.c +++ b/driver/demo-Gtk-conf.c @@ -67,6 +67,8 @@ extern const char *blurb (void); +const char *hack_configuration_path = HACK_CONFIGURATION_PATH; + static gboolean debug_p = FALSE; @@ -990,7 +992,7 @@ file_sel_ok (GtkWidget *button, gpointer user_data) { GtkWidget *entry = GTK_WIDGET (user_data); GtkWidget *dialog = button; - char *path; + const char *path; while (dialog->parent) dialog = dialog->parent; gtk_widget_hide (dialog); @@ -1016,7 +1018,7 @@ static void browse_button_cb (GtkButton *button, gpointer user_data) { GtkWidget *entry = GTK_WIDGET (user_data); - char *text = gtk_entry_get_text (GTK_ENTRY (entry)); + const char *text = gtk_entry_get_text (GTK_ENTRY (entry)); GtkFileSelection *selector = GTK_FILE_SELECTION (gtk_file_selection_new (_("Select file."))); @@ -1696,7 +1698,7 @@ static conf_data * load_configurator_1 (const char *program, const char *arguments, gboolean verbose_p) { - const char *dir = HACK_CONFIGURATION_PATH; + const char *dir = hack_configuration_path; int L = strlen (dir); char *file; char *s; diff --git a/driver/demo-Gtk-conf.h b/driver/demo-Gtk-conf.h index 42b1dbff..9292d810 100644 --- a/driver/demo-Gtk-conf.h +++ b/driver/demo-Gtk-conf.h @@ -1,5 +1,5 @@ /* demo-Gtk-conf.c --- implements the dynamic configuration dialogs. - * xscreensaver, Copyright (c) 2001 Jamie Zawinski + * xscreensaver, Copyright (c) 2001, 2002 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,4 +26,6 @@ extern char *get_configurator_command_line (conf_data *); extern void set_configurator_command_line (conf_data *, const char *cmd_line); extern void free_conf_data (conf_data *); +extern const char *hack_configuration_path; + #endif /* _DEMO_GTK_CONF_H_ */ diff --git a/driver/demo-Gtk.c b/driver/demo-Gtk.c index 3a3f2d6f..f0ca8e4a 100644 --- a/driver/demo-Gtk.c +++ b/driver/demo-Gtk.c @@ -163,6 +163,10 @@ typedef struct { int *list_elt_to_hack_number; /* table for sorting the hack list */ int *hack_number_to_list_elt; /* the inverse table */ + Bool *hacks_available_p; /* whether hacks are on $PATH */ + int list_count; /* how many items are in the list: this may be + less than p->screenhacks_count, if some are + suppressed. */ int _selected_list_element; /* don't use this: call selected_list_element() instead */ @@ -229,16 +233,32 @@ name_to_widget (state *s, const char *name) #ifdef HAVE_GTK2 if (!s->glade_ui) { - s->glade_ui = glade_xml_new (GLADE_DIR "/xscreensaver-demo.glade2", - NULL, NULL); + /* First try to load the Glade file from the current directory; + if there isn't one there, check the installed directory. + */ +# define GLADE_FILE_NAME "xscreensaver-demo.glade2" + const char * const files[] = { GLADE_FILE_NAME, + GLADE_DIR "/" GLADE_FILE_NAME }; + int i; + for (i = 0; i < countof (files); i++) + { + struct stat st; + if (!stat (files[i], &st)) + { + s->glade_ui = glade_xml_new (files[i], NULL, NULL); + break; + } + } if (!s->glade_ui) { fprintf (stderr, - "%s: could not load glade file" - " \"%s/xscreensaver-demo.glade2\"\n", - blurb(), GLADE_DIR); + "%s: could not load \"" GLADE_FILE_NAME "\"\n" + "\tfrom " GLADE_DIR "/ or current directory.\n", + blurb()); exit (-1); } +# undef GLADE_FILE_NAME + glade_xml_signal_autoconnect (s->glade_ui); } @@ -582,12 +602,13 @@ exit_menu_cb (GtkMenuItem *menuitem, gpointer user_data) gtk_main_quit (); } -static void +static gboolean wm_toplevel_close_cb (GtkWidget *widget, GdkEvent *event, gpointer data) { state *s = (state *) data; flush_dialog_changes_and_save (s); gtk_main_quit (); + return TRUE; } @@ -604,10 +625,15 @@ about_menu_cb (GtkMenuItem *menuitem, gpointer user_data) *s = 0; s += 2; + /* Ole Laursen says "don't use _() here because + non-ASCII characters aren't allowed in localizable string keys." + (I don't want to just use (c) instead of © because that doesn't + look as good in the plain-old default Latin1 "C" locale.) + */ #ifdef HAVE_GTK2 - sprintf(copy, _("Copyright \xC2\xA9 1991-2002 %s"), s); + sprintf(copy, ("Copyright \xC2\xA9 1991-2002 %s"), s); #else /* !HAVE_GTK2 */ - sprintf(copy, _("Copyright \251 1991-2002 %s"), s); + sprintf(copy, ("Copyright \251 1991-2002 %s"), s); #endif /* !HAVE_GTK2 */ sprintf (msg, "%s\n\n%s", copy, desc); @@ -734,6 +760,7 @@ doc_menu_cb (GtkMenuItem *menuitem, gpointer user_data) sprintf (help_command + strlen(help_command), p->load_url_command, p->help_url, p->help_url); strcat (help_command, " ) &"); +fprintf(stderr, "## %s\n", help_command); system (help_command); free (help_command); } @@ -896,7 +923,7 @@ manual_cb (GtkButton *button, gpointer user_data) { state *s = global_state_kludge; /* I hate C so much... */ saver_preferences *p = &s->prefs; - GtkList *list_widget = GTK_LIST (name_to_widget (s, "list")); + GtkWidget *list_widget = name_to_widget (s, "list"); int list_elt = selected_list_element (s); int hack_number; char *name, *name2, *cmd, *str; @@ -904,7 +931,7 @@ manual_cb (GtkButton *button, gpointer user_data) hack_number = s->list_elt_to_hack_number[list_elt]; flush_dialog_changes_and_save (s); - ensure_selected_item_visible (GTK_WIDGET (list_widget)); + ensure_selected_item_visible (list_widget); name = strdup (p->screenhacks[hack_number]->command); name2 = name; @@ -968,7 +995,7 @@ void run_next_cb (GtkButton *button, gpointer user_data) { state *s = global_state_kludge; /* I hate C so much... */ - saver_preferences *p = &s->prefs; + /* saver_preferences *p = &s->prefs; */ Bool ops = s->preview_suppressed_p; GtkWidget *list_widget = name_to_widget (s, "list"); @@ -979,7 +1006,7 @@ run_next_cb (GtkButton *button, gpointer user_data) else list_elt++; - if (list_elt >= p->screenhacks_count) + if (list_elt >= s->list_count) list_elt = 0; s->preview_suppressed_p = True; @@ -997,19 +1024,19 @@ void run_prev_cb (GtkButton *button, gpointer user_data) { state *s = global_state_kludge; /* I hate C so much... */ - saver_preferences *p = &s->prefs; + /* saver_preferences *p = &s->prefs; */ Bool ops = s->preview_suppressed_p; GtkWidget *list_widget = name_to_widget (s, "list"); int list_elt = selected_list_element (s); if (list_elt < 0) - list_elt = p->screenhacks_count - 1; + list_elt = s->list_count - 1; else list_elt--; if (list_elt < 0) - list_elt = p->screenhacks_count - 1; + list_elt = s->list_count - 1; s->preview_suppressed_p = True; @@ -1037,7 +1064,7 @@ flush_changes (state *s, Bool changed = False; screenhack *hack; int hack_number; - if (list_elt < 0 || list_elt >= p->screenhacks_count) + if (list_elt < 0 || list_elt >= s->list_count) abort(); hack_number = s->list_elt_to_hack_number[list_elt]; @@ -1141,8 +1168,8 @@ normalize_directory (const char *path) { int L; char *p2, *s; - if (!path) return 0; - L = strlen (path);; + if (!path || !*path) return 0; + L = strlen (path); p2 = (char *) malloc (L + 2); strcpy (p2, path); if (p2[L-1] == '/') /* remove trailing slash */ @@ -1352,7 +1379,7 @@ flush_dialog_changes_and_save (state *s) if (p->field != p2->field) { \ changed = True; \ if (s->debug_p) \ - fprintf (stderr, "%s: %s => %d\n", blurb(), name, p2->field); \ + fprintf (stderr, "%s: %s => %d\n", blurb(), name, (int) p2->field); \ } \ p->field = p2->field @@ -1942,11 +1969,12 @@ settings_ok_cb (GtkButton *button, gpointer user_data) gtk_widget_hide (s->popup_widget); } -static void +static gboolean wm_popup_close_cb (GtkWidget *widget, GdkEvent *event, gpointer data) { state *s = (state *) data; settings_cancel_cb (0, (gpointer) s); + return TRUE; } @@ -2008,6 +2036,52 @@ scroll_to_current_hack (state *s) } +static Bool +on_path_p (const char *program) +{ + int result = False; + struct stat st; + char *cmd = strdup (program); + char *token = strchr (cmd, ' '); + char *path = 0; + int L; + + if (token) *token = 0; + token = 0; + + if (strchr (cmd, '/')) + { + result = (0 == stat (cmd, &st)); + goto DONE; + } + + path = getenv("PATH"); + if (!path || !*path) + goto DONE; + + L = strlen (cmd); + path = strdup (path); + token = strtok (path, ":"); + + while (token) + { + char *p2 = (char *) malloc (strlen (token) + L + 3); + strcpy (p2, token); + strcat (p2, "/"); + strcat (p2, cmd); + result = (0 == stat (p2, &st)); + if (result) + goto DONE; + token = strtok (0, ":"); + } + + DONE: + free (cmd); + if (path) free (path); + return result; +} + + static void populate_hack_list (state *s) { @@ -2042,7 +2116,7 @@ populate_hack_list (state *s) ren = gtk_cell_renderer_text_new (); gtk_tree_view_insert_column_with_attributes (list, COL_NAME, _("Screen Saver"), ren, - "text", COL_NAME, + "markup", COL_NAME, NULL); g_signal_connect_after (list, "row_activated", @@ -2056,20 +2130,49 @@ populate_hack_list (state *s) } - for (i = 0; i < p->screenhacks_count; i++) + for (i = 0; i < s->list_count; i++) { - screenhack *hack = p->screenhacks[s->list_elt_to_hack_number[i]]; + int hack_number = s->list_elt_to_hack_number[i]; + screenhack *hack = (hack_number < 0 ? 0 : p->screenhacks[hack_number]); + char *pretty_name; + Bool available_p = (hack && s->hacks_available_p [hack_number]); - char *pretty_name = (hack->name - ? strdup (hack->name) - : make_hack_name (hack->command)); + if (!hack) continue; + + /* If we're to suppress uninstalled hacks, check $PATH now. */ + if (p->ignore_uninstalled_p && !available_p) + continue; + + pretty_name = (hack->name + ? strdup (hack->name) + : make_hack_name (hack->command)); + + if (!available_p) + { + /* Make the text foreground be the color of insensitive widgets + (but don't actually make it be insensitive, since we still + want to be able to click on it.) + */ + GtkStyle *style = GTK_WIDGET (list)->style; + GdkColor *fg = &style->fg[GTK_STATE_INSENSITIVE]; + /* GdkColor *bg = &style->bg[GTK_STATE_INSENSITIVE]; */ + char *buf = (char *) malloc (strlen (pretty_name) + 100); + + sprintf (buf, "%s", + fg->red >> 8, fg->green >> 8, fg->blue >> 8, + /* bg->red >> 8, bg->green >> 8, bg->blue >> 8, */ + pretty_name); + free (pretty_name); + pretty_name = buf; + } gtk_list_store_append (model, &iter); gtk_list_store_set (model, &iter, COL_ENABLED, hack->enabled_p, COL_NAME, pretty_name, -1); - free (pretty_name); } @@ -2078,9 +2181,10 @@ populate_hack_list (state *s) saver_preferences *p = &s->prefs; GtkList *list = GTK_LIST (name_to_widget (s, "list")); int i; - for (i = 0; i < p->screenhacks_count; i++) + for (i = 0; i < s->list_count; i++) { - screenhack *hack = p->screenhacks[s->list_elt_to_hack_number[i]]; + int hack_number = s->list_elt_to_hack_number[i]; + screenhack *hack = (hack_number < 0 ? 0 : p->screenhacks[hack_number]); /* A GtkList must contain only GtkListItems, but those can contain an arbitrary widget. We add an Hbox, and inside that, a Checkbox @@ -2092,10 +2196,18 @@ populate_hack_list (state *s) GtkWidget *line_hbox; GtkWidget *line_check; GtkWidget *line_label; + char *pretty_name; + Bool available_p = (hack && s->hacks_available_p [hack_number]); + + if (!hack) continue; - char *pretty_name = (hack->name - ? strdup (hack->name) - : make_hack_name (hack->command)); + /* If we're to suppress uninstalled hacks, check $PATH now. */ + if (p->ignore_uninstalled_p && !available_p) + continue; + + pretty_name = (hack->name + ? strdup (hack->name) + : make_hack_name (hack->command)); line = gtk_list_item_new (); line_hbox = gtk_hbox_new (FALSE, 0); @@ -2126,11 +2238,30 @@ populate_hack_list (state *s) GTK_SIGNAL_FUNC (list_checkbox_cb), (gpointer) s); -#if 0 /* #### */ - GTK_WIDGET (GTK_BIN(line)->child)->style = - gtk_style_copy (GTK_WIDGET (text_line)->style); -#endif gtk_widget_show (line); + + if (!available_p) + { + /* Make the widget be colored like insensitive widgets + (but don't actually make it be insensitive, since we + still want to be able to click on it.) + */ + GtkRcStyle *rc_style; + GdkColor fg, bg; + + gtk_widget_realize (GTK_WIDGET (line_label)); + + fg = GTK_WIDGET (line_label)->style->fg[GTK_STATE_INSENSITIVE]; + bg = GTK_WIDGET (line_label)->style->bg[GTK_STATE_INSENSITIVE]; + + rc_style = gtk_rc_style_new (); + rc_style->fg[GTK_STATE_NORMAL] = fg; + rc_style->bg[GTK_STATE_NORMAL] = bg; + rc_style->color_flags[GTK_STATE_NORMAL] |= GTK_RC_FG|GTK_RC_BG; + + gtk_widget_modify_style (GTK_WIDGET (line_label), rc_style); + gtk_rc_style_unref (rc_style); + } } gtk_signal_connect (GTK_OBJECT (list), "select_child", @@ -2343,7 +2474,7 @@ populate_popup_window (state *s) GtkWidget *parent = name_to_widget (s, "settings_vbox"); GtkLabel *doc = GTK_LABEL (name_to_widget (s, "doc")); int list_elt = selected_list_element (s); - int hack_number = (list_elt >= 0 && list_elt < p->screenhacks_count + int hack_number = (list_elt >= 0 && list_elt < s->list_count ? s->list_elt_to_hack_number[list_elt] : -1); screenhack *hack = (hack_number >= 0 ? p->screenhacks[hack_number] : 0); @@ -2409,7 +2540,9 @@ sensitize_demo_widgets (state *s, Bool sensitive_p) static void fix_text_entry_sizes (state *s) { -#ifdef FIXME + GtkWidget *w; + +# if 0 /* appears no longer necessary with Gtk 1.2.10 */ const char * const spinbuttons[] = { "timeout_spinbutton", "cycle_spinbutton", "lock_spinbutton", "dpms_standby_spinbutton", "dpms_suspend_spinbutton", @@ -2417,7 +2550,6 @@ fix_text_entry_sizes (state *s) "-fade_spinbutton" }; int i; int width = 0; - GtkWidget *w; for (i = 0; i < countof(spinbuttons); i++) { @@ -2448,22 +2580,35 @@ fix_text_entry_sizes (state *s) width = gdk_string_width (w->style->font, "mmmmmmmmmmmmmmmmmmmm"); gtk_widget_set_usize (w, width, -2); - /* Now fix the height of the list. +# endif /* 0 */ + + /* Now fix the height of the list widget: + make it default to being around 10 text-lines high instead of 4. */ + w = GTK_WIDGET (name_to_widget (s, "list")); { int lines = 10; int height; int leading = 3; /* approximate is ok... */ int border = 2; - w = GTK_WIDGET (name_to_widget (s, "list")); + +#ifdef HAVE_GTK2 + PangoFontMetrics *pain = + pango_context_get_metrics (gtk_widget_get_pango_context (w), + w->style->font_desc, + gtk_get_default_language ()); + height = PANGO_PIXELS (pango_font_metrics_get_ascent (pain) + + pango_font_metrics_get_descent (pain)); +#else /* !HAVE_GTK2 */ height = w->style->font->ascent + w->style->font->descent; +#endif /* !HAVE_GTK2 */ + height += leading; height *= lines; height += border * 2; w = GTK_WIDGET (name_to_widget (s, "scroller")); gtk_widget_set_usize (w, -2, height); } -#endif } @@ -2640,7 +2785,7 @@ populate_demo_window (state *s, int list_elt) } else { - int hack_number = (list_elt >= 0 && list_elt < p->screenhacks_count + int hack_number = (list_elt >= 0 && list_elt < s->list_count ? s->list_elt_to_hack_number[list_elt] : -1); hack = (hack_number >= 0 ? p->screenhacks[hack_number] : 0); @@ -2716,8 +2861,13 @@ sort_hack_cmp (const void *a, const void *b) if (a == b) return 0; else - return strcmp (sort_hack_cmp_names_kludge[*(int *) a], - sort_hack_cmp_names_kludge[*(int *) b]); + { + int aa = *(int *) a; + int bb = *(int *) b; + const char last[] = "\377\377\377\377\377\377\377\377\377\377\377"; + return strcmp ((aa < 0 ? last : sort_hack_cmp_names_kludge[aa]), + (bb < 0 ? last : sort_hack_cmp_names_kludge[bb])); + } } @@ -2725,21 +2875,44 @@ static void initialize_sort_map (state *s) { saver_preferences *p = &s->prefs; - int i; + int i, j; if (s->list_elt_to_hack_number) free (s->list_elt_to_hack_number); if (s->hack_number_to_list_elt) free (s->hack_number_to_list_elt); + if (s->hacks_available_p) free (s->hacks_available_p); s->list_elt_to_hack_number = (int *) calloc (sizeof(int), p->screenhacks_count + 1); s->hack_number_to_list_elt = (int *) calloc (sizeof(int), p->screenhacks_count + 1); + s->hacks_available_p = (Bool *) + calloc (sizeof(Bool), p->screenhacks_count + 1); - /* Initialize table to 1:1 mapping */ + /* Check which hacks actually exist on $PATH + */ for (i = 0; i < p->screenhacks_count; i++) - s->list_elt_to_hack_number[i] = i; + { + screenhack *hack = p->screenhacks[i]; + s->hacks_available_p[i] = on_path_p (hack->command); + } - /* Generate list of names (once) + /* Initialize list->hack table to unsorted mapping, omitting nonexistent + hacks, if desired. + */ + j = 0; + for (i = 0; i < p->screenhacks_count; i++) + { + if (!p->ignore_uninstalled_p || + s->hacks_available_p[i]) + s->list_elt_to_hack_number[j++] = i; + } + s->list_count = j; + + for (; j < p->screenhacks_count; j++) + s->list_elt_to_hack_number[j] = -1; + + + /* Generate list of sortable names (once) */ sort_hack_cmp_names_kludge = (char **) calloc (sizeof(char *), p->screenhacks_count); @@ -2755,7 +2928,7 @@ initialize_sort_map (state *s) sort_hack_cmp_names_kludge[i] = name; } - /* Sort alphabetically + /* Sort list->hack map alphabetically */ qsort (s->list_elt_to_hack_number, p->screenhacks_count, @@ -2860,36 +3033,47 @@ clear_preview_window (state *s) gdk_window_set_background (window, &p->style->bg[GTK_STATE_NORMAL]); gdk_window_clear (window); -#ifdef HAVE_GTK2 { - GtkWidget *notebook; - - notebook = name_to_widget (s, "preview_notebook"); + int list_elt = selected_list_element (s); + int hack_number = (list_elt >= 0 + ? s->list_elt_to_hack_number[list_elt] + : -1); + Bool available_p = (hack_number >= 0 + ? s->hacks_available_p [hack_number] + : True); +#ifdef HAVE_GTK2 + GtkWidget *notebook = name_to_widget (s, "preview_notebook"); gtk_notebook_set_page (GTK_NOTEBOOK (notebook), - s->running_preview_error_p - ? 1 : 0); - } + (s->running_preview_error_p + ? (available_p ? 1 : 2) + : 0)); #else /* !HAVE_GTK2 */ - if (s->running_preview_error_p) - { - const char * const lines[] = { N_("No Preview"), N_("Available") }; - int lh = p->style->font->ascent + p->style->font->descent; - int y, i; - gint w, h; - gdk_window_get_size (window, &w, &h); - y = (h - (lh * countof(lines))) / 2; - y += p->style->font->ascent; - for (i = 0; i < countof(lines); i++) - { - int sw = gdk_string_width (p->style->font, _(lines[i])); - int x = (w - sw) / 2; - gdk_draw_string (window, p->style->font, - p->style->fg_gc[GTK_STATE_NORMAL], - x, y, _(lines[i])); - y += lh; - } - } + if (s->running_preview_error_p) + { + const char * const lines1[] = { N_("No Preview"), N_("Available") }; + const char * const lines2[] = { N_("Not"), N_("Installed") }; + int nlines = countof(lines1); + int lh = p->style->font->ascent + p->style->font->descent; + int y, i; + gint w, h; + + const char * const *lines = (available_p ? lines1 : lines2); + + gdk_window_get_size (window, &w, &h); + y = (h - (lh * nlines)) / 2; + y += p->style->font->ascent; + for (i = 0; i < nlines; i++) + { + int sw = gdk_string_width (p->style->font, _(lines[i])); + int x = (w - sw) / 2; + gdk_draw_string (window, p->style->font, + p->style->fg_gc[GTK_STATE_NORMAL], + x, y, _(lines[i])); + y += lh; + } + } #endif /* !HAVE_GTK2 */ + } gdk_flush (); } @@ -2938,6 +3122,11 @@ fix_preview_visual (state *s) style->fg_gc[GTK_STATE_NORMAL] = fgc; style->bg_gc[GTK_STATE_NORMAL] = fgc; gtk_widget_set_style (widget, style); + + /* For debugging purposes, put a title on the window (so that + it can be easily found in the output of "xwininfo -tree".) + */ + gdk_window_set_title (window, "Preview"); } gtk_widget_show (widget); @@ -2956,8 +3145,13 @@ subproc_pretty_name (state *s) char *ss = strchr (ps, ' '); if (ss) *ss = 0; ss = strrchr (ps, '/'); - if (ss) *ss = 0; - else ss = ps; + if (!ss) + ss = ps; + else + { + ss = strdup (ss+1); + free (ps); + } return ss; } else @@ -2977,11 +3171,13 @@ reap_zombies (state *s) if (pid == s->running_preview_pid) { char *ss = subproc_pretty_name (s); - fprintf (stderr, "%s: pid %lu (%s) died\n", blurb(), pid, ss); + fprintf (stderr, "%s: pid %lu (%s) died\n", blurb(), + (unsigned long) pid, ss); free (ss); } else - fprintf (stderr, "%s: pid %lu died\n", blurb(), pid); + fprintf (stderr, "%s: pid %lu died\n", blurb(), + (unsigned long) pid); } } } @@ -3051,7 +3247,7 @@ get_best_gl_visual (state *s) int wait_status = 0; FILE *f = fdopen (in, "r"); - unsigned long v = 0; + unsigned int v = 0; char c; close (out); /* don't need this one */ @@ -3115,19 +3311,19 @@ kill_preview_subproc (state *s) { if (s->debug_p) fprintf (stderr, "%s: pid %lu (%s) was already dead.\n", - blurb(), s->running_preview_pid, ss); + blurb(), (unsigned long) s->running_preview_pid, ss); } else { char buf [1024]; sprintf (buf, "%s: couldn't kill pid %lu (%s)", - blurb(), s->running_preview_pid, ss); + blurb(), (unsigned long) s->running_preview_pid, ss); perror (buf); } } else if (s->debug_p) fprintf (stderr, "%s: killed pid %lu (%s)\n", blurb(), - s->running_preview_pid, ss); + (unsigned long) s->running_preview_pid, ss); free (ss); s->running_preview_pid = 0; @@ -3174,7 +3370,8 @@ launch_preview_subproc (state *s) else { strcpy (new_cmd, cmd); - sprintf (new_cmd + strlen (new_cmd), " -window-id 0x%X", id); + sprintf (new_cmd + strlen (new_cmd), " -window-id 0x%X", + (unsigned int) id); } kill_preview_subproc (s); @@ -3220,7 +3417,8 @@ launch_preview_subproc (state *s) if (s->debug_p) { char *ss = subproc_pretty_name (s); - fprintf (stderr, "%s: forked %lu (%s)\n", blurb(), forked, ss); + fprintf (stderr, "%s: forked %lu (%s)\n", blurb(), + (unsigned long) forked, ss); free (ss); } break; @@ -3354,7 +3552,7 @@ check_subproc_timer (gpointer data) { char *ss = subproc_pretty_name (s); fprintf (stderr, "%s: timer: pid %lu (%s) is %s\n", blurb(), - s->running_preview_pid, ss, + (unsigned long) s->running_preview_pid, ss, (s->running_preview_error_p ? "dead" : "alive")); free (ss); } @@ -3563,11 +3761,11 @@ the_network_is_not_the_computer (state *s) "xscreensaver as \"%s\".\n" "\n" "Restart the xscreensaver daemon now?\n"), - blurb(), luser, lhost, + progname, luser, lhost, d, (ruser ? ruser : "???"), (rhost ? rhost : "???"), - blurb(), - blurb(), (ruser ? ruser : "???"), + progname, + progname, (ruser ? ruser : "???"), luser); } else if (rhost && *rhost && !!strcmp (rhost, lhost)) @@ -3585,11 +3783,11 @@ the_network_is_not_the_computer (state *s) "%s won't work right.\n" "\n" "Restart the daemon on \"%s\" as \"%s\" now?\n"), - blurb(), luser, lhost, + progname, luser, lhost, d, (ruser ? ruser : "???"), (rhost ? rhost : "???"), luser, - blurb(), + progname, lhost, luser); } else if (!!strcmp (rversion, s->short_version)) @@ -3682,7 +3880,7 @@ const char *usage = "[--display dpy] [--prefs]" # ifdef HAVE_CRAPPLET " [--crapplet]" # endif - "\n\t\t [--debug] [--sync] [--no-xshm]"; + "\n\t\t [--debug] [--sync] [--no-xshm] [--configdir dir]"; static void map_popup_window_cb (GtkWidget *w, gpointer user_data) @@ -3780,7 +3978,7 @@ main (int argc, char **argv) Display *dpy; Widget toplevel_shell; char *real_progname = argv[0]; - char window_title[255]; + char *window_title; Bool crapplet_p = False; char *str; @@ -3845,35 +4043,71 @@ main (int argc, char **argv) /* We need to parse this arg really early... Sigh. */ for (i = 1; i < argc; i++) - if (argv[i] && - (!strcmp(argv[i], "--crapplet") || - !strcmp(argv[i], "--capplet"))) - { + { + if (argv[i] && + (!strcmp(argv[i], "--crapplet") || + !strcmp(argv[i], "--capplet"))) + { # if defined(HAVE_CRAPPLET) || defined(HAVE_GTK2) - int j; - crapplet_p = True; - for (j = i; j < argc; j++) /* remove it from the list */ - argv[j] = argv[j+1]; - argc--; + int j; + crapplet_p = True; + for (j = i; j < argc; j++) /* remove it from the list */ + argv[j] = argv[j+1]; + argc--; # else /* !HAVE_CRAPPLET && !HAVE_GTK2 */ - fprintf (stderr, "%s: not compiled with --crapplet support\n", - real_progname); - fprintf (stderr, "%s: %s\n", real_progname, usage); - exit (1); + fprintf (stderr, "%s: not compiled with --crapplet support\n", + real_progname); + fprintf (stderr, "%s: %s\n", real_progname, usage); + exit (1); # endif /* !HAVE_CRAPPLET && !HAVE_GTK2 */ - } - else if (argv[i] && - (!strcmp(argv[i], "--debug") || - !strcmp(argv[i], "-debug") || - !strcmp(argv[i], "-d"))) - { - int j; - s->debug_p = True; - for (j = i; j < argc; j++) /* remove it from the list */ - argv[j] = argv[j+1]; - argc--; + } + else if (argv[i] && + (!strcmp(argv[i], "--debug") || + !strcmp(argv[i], "-debug") || + !strcmp(argv[i], "-d"))) + { + int j; + s->debug_p = True; + for (j = i; j < argc; j++) /* remove it from the list */ + argv[j] = argv[j+1]; + argc--; + i--; + } + else if (argv[i] && + argc > i+1 && + *argv[i+1] && + (!strcmp(argv[i], "--configdir"))) + { + int j; + struct stat st; + hack_configuration_path = argv[i+1]; + for (j = i; j < argc; j++) /* remove them from the list */ + argv[j] = argv[j+2]; + argc -= 2; + i -= 2; + + if (0 != stat (hack_configuration_path, &st)) + { + char buf[255]; + sprintf (buf, "%s: %.200s", blurb(), hack_configuration_path); + perror (buf); + exit (1); + } + else if (!S_ISDIR (st.st_mode)) + { + fprintf (stderr, "%s: not a directory: %s\n", + blurb(), hack_configuration_path); + exit (1); + } + } } + + if (s->debug_p) + fprintf (stderr, "%s: using config directory \"%s\"\n", + progname, hack_configuration_path); + + /* Let Gtk open the X connection, then initialize Xt to use that same connection. Doctor Frankenstein would be proud. */ @@ -4008,6 +4242,9 @@ main (int argc, char **argv) was in argv[0]. */ p->db = db; + + hack_environment (s); /* must be before initialize_sort_map() */ + load_init_file (p); initialize_sort_map (s); @@ -4056,6 +4293,7 @@ main (int argc, char **argv) /* Set the main window's title. */ { + char *base_title = _("Screensaver Preferences"); char *v = (char *) strdup(strchr(screensaver_id, ' ')); char *s1, *s2, *s3, *s4; s1 = (char *) strchr(v, ' '); s1++; @@ -4064,7 +4302,12 @@ main (int argc, char **argv) s4 = (char *) strchr(s3, ')'); *s2 = 0; *s4 = 0; - sprintf (window_title, "%.50s %.50s, %.50s", progclass, s1, s3); + + window_title = (char *) malloc (strlen (base_title) + + strlen (progclass) + + strlen (s1) + strlen (s3) + + 100); + sprintf (window_title, "%s (%s %s, %s)", base_title, progclass, s1, s3); gtk_window_set_title (GTK_WINDOW (s->toplevel_widget), window_title); gtk_window_set_title (GTK_WINDOW (s->popup_widget), window_title); free (v); @@ -4153,7 +4396,6 @@ main (int argc, char **argv) # ifdef HAVE_CRAPPLET_IMMEDIATE capplet_widget_changes_are_immediate (CAPPLET_WIDGET (capplet)); # endif /* HAVE_CRAPPLET_IMMEDIATE */ - /* In crapplet-mode, take off the menubar. */ gtk_widget_hide (name_to_widget (s, "menubar")); @@ -4186,9 +4428,22 @@ main (int argc, char **argv) # endif /* HAVE_CRAPPLET */ + /* The Gnome folks hate the menubar. I think it's important to have access + to the commands on the File menu (Restart Daemon, etc.) and to the + About and Documentation commands on the Help menu. + */ +#if 0 +#ifdef HAVE_GTK2 + gtk_widget_hide (name_to_widget (s, "menubar")); +#endif +#endif + + free (window_title); + window_title = 0; + + gtk_widget_show (s->toplevel_widget); init_icon (GTK_WIDGET (s->toplevel_widget)->window); /* after `show' */ - hack_environment (s); fix_preview_visual (s); /* Realize page zero, so that we can diddle the scrollbar when the @@ -4230,7 +4485,7 @@ main (int argc, char **argv) int i; for (i = 0; i < p->screenhacks_count; i++) { - screenhack *hack = p->screenhacks[s->hack_number_to_list_elt[i]]; + screenhack *hack = p->screenhacks[i]; conf_data *d = load_configurator (hack->command, False); if (d) free_conf_data (d); } diff --git a/driver/passwd-pam.c b/driver/passwd-pam.c index 7083cfe4..d6966bdb 100644 --- a/driver/passwd-pam.c +++ b/driver/passwd-pam.c @@ -254,8 +254,13 @@ pam_passwd_valid_p (const char *typed_passwd, Bool verbose_p) /* Each time we successfully authenticate, refresh credentials, for Kerberos/AFS/DCE/etc. If this fails, just ignore that failure and blunder along; it shouldn't matter. + + Note: this used to be PAM_REFRESH_CRED instead of + PAM_REINITIALIZE_CRED, but Jason Heiss + says that the Linux PAM library ignores that one, and only refreshes + credentials when using PAM_REINITIALIZE_CRED. */ - int status2 = pam_setcred (pamh, PAM_REFRESH_CRED); + int status2 = pam_setcred (pamh, PAM_REINITIALIZE_CRED); if (verbose_p) fprintf (stderr, "%s: pam_setcred (...) ==> %d (%s)\n", blurb(), status2, PAM_STRERROR(pamh, status2)); diff --git a/driver/prefs.c b/driver/prefs.c index 180dfca6..04bd856d 100644 --- a/driver/prefs.c +++ b/driver/prefs.c @@ -90,7 +90,7 @@ chase_symlinks (const char *file) if (realpath (file, buf)) return strdup (buf); - sprintf (buf, "%s: realpath", blurb()); + sprintf (buf, "%.100s: realpath %.200s", blurb(), file); perror(buf); } # endif /* HAVE_REALPATH */ @@ -256,6 +256,7 @@ static const char * const prefs[] = { "fadeTicks", "captureStderr", "captureStdout", /* not saved -- obsolete */ + "ignoreUninstalledPrograms", "font", "dpmsEnabled", "dpmsStandby", @@ -768,8 +769,10 @@ write_init_file (saver_preferences *p, const char *version_string, CHECK("splashDuration") type = pref_time, t = p->splash_duration; CHECK("demoCommand") type = pref_str, s = p->demo_command; CHECK("prefsCommand") type = pref_str, s = p->prefs_command; - CHECK("helpURL") type = pref_str, s = p->help_url; - CHECK("loadURL") type = pref_str, s = p->load_url_command; +/* CHECK("helpURL") type = pref_str, s = p->help_url; */ + CHECK("helpURL") continue; /* don't save */ +/* CHECK("loadURL") type = pref_str, s = p->load_url_command; */ + CHECK("loadURL") continue; /* don't save */ CHECK("nice") type = pref_int, i = p->nice_inferior; CHECK("memoryLimit") type = pref_byte, i = p->inferior_memory_limit; CHECK("fade") type = pref_bool, b = p->fade_p; @@ -778,6 +781,9 @@ write_init_file (saver_preferences *p, const char *version_string, CHECK("fadeTicks") type = pref_int, i = p->fade_ticks; CHECK("captureStderr") type = pref_bool, b = p->capture_stderr_p; CHECK("captureStdout") continue; /* don't save */ + CHECK("ignoreUninstalledPrograms") + type = pref_bool, b = p->ignore_uninstalled_p; + CHECK("font") type = pref_str, s = stderr_font; CHECK("dpmsEnabled") type = pref_bool, b = p->dpms_enabled_p; @@ -999,6 +1005,8 @@ load_init_file (saver_preferences *p) p->inferior_memory_limit = get_byte_resource ("memoryLimit", "MemoryLimit"); p->splash_p = get_boolean_resource ("splash", "Boolean"); p->capture_stderr_p = get_boolean_resource ("captureStderr", "Boolean"); + p->ignore_uninstalled_p = get_boolean_resource ("ignoreUninstalledPrograms", + "Boolean"); p->initial_delay = 1000 * get_seconds_resource ("initialDelay", "Time"); p->splash_duration = 1000 * get_seconds_resource ("splashDuration", "Time"); diff --git a/driver/prefs.h b/driver/prefs.h index 6640492b..d89a4a8b 100644 --- a/driver/prefs.h +++ b/driver/prefs.h @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1993-2001 Jamie Zawinski +/* xscreensaver, Copyright (c) 1993-2002 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 @@ -41,6 +41,8 @@ struct saver_preferences { Bool verbose_p; /* whether to print out lots of status info */ Bool timestamp_p; /* whether to mark messages with a timestamp */ Bool capture_stderr_p; /* whether to redirect stdout/stderr */ + Bool ignore_uninstalled_p; /* whether to avoid displaying or complaining + about hacks that are not on $PATH */ Bool debug_p; /* pay no mind to the man behind the curtain */ Bool xsync_p; /* whether XSynchronize has been called */ diff --git a/driver/remote.c b/driver/remote.c index 2ecd7cbb..3c6e4d1e 100644 --- a/driver/remote.c +++ b/driver/remote.c @@ -278,13 +278,13 @@ send_xscreensaver_command (Display *dpy, Atom command, long arg, } if (any && nhacks == 1) - fprintf (stdout, " (hack #%d)\n", data[2]); + fprintf (stdout, " (hack #%d)\n", (int) data[2]); else if (any) { fprintf (stdout, " (hacks: "); for (i = 0; i < nhacks; i++) { - fprintf (stdout, "#%d", data[2 + i]); + fprintf (stdout, "#%d", (int) data[2 + i]); if (i != nhacks-1) fputs (", ", stdout); } diff --git a/driver/screensaver-properties.desktop.in b/driver/screensaver-properties.desktop.in index 436ec83d..541ddd8f 100644 --- a/driver/screensaver-properties.desktop.in +++ b/driver/screensaver-properties.desktop.in @@ -4,6 +4,6 @@ TryExec=xscreensaver-demo Icon=xscreensaver.xpm Terminal=0 _Name=Screensaver -_Comment=Configure the settings of the screensaver. +_Comment=Change screensaver properties Type=Application Categories=Applications;Settings; diff --git a/driver/stderr.c b/driver/stderr.c index 5f337c00..8b7ac8b5 100644 --- a/driver/stderr.c +++ b/driver/stderr.c @@ -114,11 +114,12 @@ print_stderr_1 (saver_screen_info *ssi, char *string) if (! ssi->stderr_font) { char *font_name = get_string_resource ("font", "Font"); - if (!font_name) font_name = "fixed"; + if (!font_name) font_name = strdup ("fixed"); ssi->stderr_font = XLoadQueryFont (dpy, font_name); if (! ssi->stderr_font) ssi->stderr_font = XLoadQueryFont (dpy, "fixed"); ssi->stderr_line_height = (ssi->stderr_font->ascent + ssi->stderr_font->descent); + free (font_name); } if (! ssi->stderr_gc) diff --git a/driver/subprocs.c b/driver/subprocs.c index 910d5cc9..ec2718de 100644 --- a/driver/subprocs.c +++ b/driver/subprocs.c @@ -1,5 +1,5 @@ /* subprocs.c --- choosing, spawning, and killing screenhacks. - * xscreensaver, Copyright (c) 1991-2001 Jamie Zawinski + * xscreensaver, Copyright (c) 1991-2002 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 @@ -365,12 +365,12 @@ kill_job (saver_info *si, pid_t pid, int signal) if (errno == ESRCH) fprintf (stderr, "%s: %d: child process %lu (%s) was already dead.\n", - blurb(), job->screen, job->pid, job->name); + blurb(), job->screen, (unsigned long) job->pid, job->name); else { char buf [1024]; sprintf (buf, "%s: %d: couldn't kill child process %lu (%s)", - blurb(), job->screen, job->pid, job->name); + blurb(), job->screen, (unsigned long) job->pid, job->name); perror (buf); } } @@ -765,8 +765,13 @@ spawn_screenhack_1 (saver_screen_info *ssi, Bool first_time_p) (unsigned long) getpid ()); exec_command (p->shell, hack->command, p->nice_inferior); - /* If that returned, we were unable to exec the subprocess. */ - print_path_error (hack->command); + + /* If that returned, we were unable to exec the subprocess. + Print an error message, if desired. + */ + if (! p->ignore_uninstalled_p) + print_path_error (hack->command); + exit (1); /* exits child fork */ break; @@ -1011,14 +1016,23 @@ get_best_gl_visual (saver_screen_info *ssi) /* Wait for the child to die. */ waitpid (-1, &wait_status, 0); - if (1 == sscanf (buf, "0x%x %c", &v, &c)) + if (1 == sscanf (buf, "0x%lx %c", &v, &c)) result = (int) v; if (result == 0) { if (si->prefs.verbose_p) - fprintf (stderr, "%s: %s did not report a GL visual!\n", - blurb(), av[0]); + { + int L = strlen(buf); + fprintf (stderr, "%s: %s did not report a GL visual!\n", + blurb(), av[0]); + + if (L && buf[L-1] == '\n') + buf[--L] = 0; + if (*buf) + fprintf (stderr, "%s: %s said: \"%s\"\n", + blurb(), av[0], buf); + } return 0; } else diff --git a/driver/timers.c b/driver/timers.c index 04feb90c..7e9baaac 100644 --- a/driver/timers.c +++ b/driver/timers.c @@ -264,8 +264,8 @@ cycle_timer (XtPointer closure, XtIntervalId *id) else { if (p->debug_p) - fprintf (stderr, "%s: not starting cycle_timer: how_long == %d\n", - blurb(), how_long); + fprintf (stderr, "%s: not starting cycle_timer: how_long == %ld\n", + blurb(), (unsigned long) how_long); } } @@ -450,7 +450,7 @@ check_for_clock_skew (saver_info *si) shift > (p->timeout / 1000)) { if (p->verbose_p) - fprintf (stderr, "%s: wall clock has jumped by %d:%02d:%02d!\n", + fprintf (stderr, "%s: wall clock has jumped by %ld:%02ld:%02ld!\n", blurb(), (shift / (60 * 60)), ((shift / 60) % 60), (shift % 60)); @@ -738,7 +738,7 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) for (i = 0; i < si->nscreens; i++) if (root == RootWindowOfScreen (si->screens[i].screen)) break; - fprintf (stderr,"%s: %d: %s on 0x%x", + fprintf (stderr,"%s: %d: %s on 0x%lx", blurb(), i, type, (unsigned long) window); if (x == -1) fprintf (stderr, "\n"); diff --git a/driver/windows.c b/driver/windows.c index 2ecfdfc0..271fe324 100644 --- a/driver/windows.c +++ b/driver/windows.c @@ -119,7 +119,7 @@ grab_kbd(saver_info *si, Window w, int screen_no) } if (p->verbose_p) - fprintf(stderr, "%s: %d: grabbing keyboard on 0x%x... %s.\n", + fprintf(stderr, "%s: %d: grabbing keyboard on 0x%lx... %s.\n", blurb(), screen_no, (unsigned long) w, grab_string(status)); return status; } @@ -139,7 +139,7 @@ grab_mouse (saver_info *si, Window w, Cursor cursor, int screen_no) } if (p->verbose_p) - fprintf(stderr, "%s: %d: grabbing mouse on 0x%x... %s.\n", + fprintf(stderr, "%s: %d: grabbing mouse on 0x%lx... %s.\n", blurb(), screen_no, (unsigned long) w, grab_string(status)); return status; } @@ -151,7 +151,7 @@ ungrab_kbd(saver_info *si) saver_preferences *p = &si->prefs; XUngrabKeyboard(si->dpy, CurrentTime); if (p->verbose_p) - fprintf(stderr, "%s: %d: ungrabbing keyboard (was 0x%x).\n", + fprintf(stderr, "%s: %d: ungrabbing keyboard (was 0x%lx).\n", blurb(), si->keyboard_grab_screen, (unsigned long) si->keyboard_grab_window); si->keyboard_grab_window = 0; @@ -164,7 +164,7 @@ ungrab_mouse(saver_info *si) saver_preferences *p = &si->prefs; XUngrabPointer(si->dpy, CurrentTime); if (p->verbose_p) - fprintf(stderr, "%s: %d: ungrabbing mouse (was 0x%x).\n", + fprintf(stderr, "%s: %d: ungrabbing mouse (was 0x%lx).\n", blurb(), si->mouse_grab_screen, (unsigned long) si->mouse_grab_window); si->mouse_grab_window = 0; diff --git a/driver/xscreensaver-command.c b/driver/xscreensaver-command.c index 8cd1928c..16eb4e19 100644 --- a/driver/xscreensaver-command.c +++ b/driver/xscreensaver-command.c @@ -403,7 +403,7 @@ watch (Display *dpy) if (running && changed) { int i; - fprintf (stdout, "RUN", s); + fprintf (stdout, "RUN"); for (i = 2; i < nitems; i++) fprintf (stdout, " %d", (int) data[i]); fprintf (stdout, "\n"); diff --git a/driver/xscreensaver-command.man b/driver/xscreensaver-command.man index cd8e729c..d65457f7 100644 --- a/driver/xscreensaver-command.man +++ b/driver/xscreensaver-command.man @@ -11,7 +11,7 @@ .if n .sp 1 .if t .sp .5 .. -.TH XScreenSaver 1 "11-Jun-2002 (4.05)" "X Version 11" +.TH XScreenSaver 1 "23-Oct-2002 (4.06)" "X Version 11" .SH NAME xscreensaver-command - control a running xscreensaver process .SH SYNOPSIS diff --git a/driver/xscreensaver-demo.glade2 b/driver/xscreensaver-demo.glade2 index 4e519896..ae5a73fc 100644 --- a/driver/xscreensaver-demo.glade2 +++ b/driver/xscreensaver-demo.glade2 @@ -126,489 +126,507 @@ - + + 8 True - True - True - True - GTK_POS_TOP - False - 2 - 2 - False - + False + 0 - - 10 + True - 2 - 2 - False - 0 - 0 + True + True + True + GTK_POS_TOP + False + 2 + 2 + False + - + + 10 True - 3 - 4 + 2 + 2 False - 2 + 0 0 - + True - _Cycle After - True - False - GTK_JUSTIFY_RIGHT - False - False - 1 - 0.5 - 8 - 0 - cycle_spinbutton - - - 1 - 2 - 1 - 2 - fill - - - + 3 + 4 + False + 2 + 0 - - - True - Whether a password should be required to un-blank the screen. + + + True + _Cycle After + True + False + GTK_JUSTIFY_RIGHT + False + False + 1 + 0.5 + 8 + 0 + cycle_spinbutton + + + 1 + 2 + 1 + 2 + fill + + + - + True - True - _Lock Screen After + Whether a password should be required to un-blank the screen. + + + + True + True + _Lock Screen After + True + GTK_RELIEF_NORMAL + False + False + True + + + + + + 0 + 2 + 2 + 3 + fill + + + + + + + True + _Blank After True - GTK_RELIEF_NORMAL - False - False - True - + False + GTK_JUSTIFY_RIGHT + False + False + 1 + 0.5 + 8 + 0 + timeout_spinbutton + + 1 + 2 + 0 + 1 + fill + + - - - 0 - 2 - 2 - 3 - fill - - - - - - True - _Blank After - True - False - GTK_JUSTIFY_RIGHT - False - False - 1 - 0.5 - 8 - 0 - timeout_spinbutton - - - 1 - 2 - 0 - 1 - fill - - - + + + True + How long before the screensaver activates. + True + 15 + 0 + True + GTK_UPDATE_ALWAYS + True + False + 1 1 720 1 15 15 + + + + + + 2 + 3 + 0 + 1 + fill + + + - - - True - How long before the monitor goes completely black. - True - 15 - 0 - True - GTK_UPDATE_ALWAYS - True - False - 1 1 720 1 15 15 - - - - - - 2 - 3 - 0 - 1 - fill - - - + + + True + minutes + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 3 + 4 + 0 + 1 + + + - - - True - minutes - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 3 - 4 - 0 - 1 - - - + + + True + minutes + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 3 + 4 + 1 + 2 + + + - - - True - minutes - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 + + + True + minutes + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 3 + 4 + 2 + 3 + + + + + + + True + How long after the screen blanks until a password will be required. + True + 15 + 0 + True + GTK_UPDATE_ALWAYS + True + False + 0 0 720 1 15 15 + + + + + + 2 + 3 + 2 + 3 + 10 + fill + + + + + + + True + How long each display mode should run before choosing a new one (in Random mode.) + True + 15 + 0 + True + GTK_UPDATE_ALWAYS + True + False + 1 1 720 1 15 15 + + + + + + 2 + 3 + 1 + 2 + fill + + + - 3 - 4 + 0 + 1 1 2 - + fill + fill - + True - minutes - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 3 - 4 - 2 - 3 - - - + GTK_BUTTONBOX_SPREAD + 30 - - - True - How long before the monitor goes completely black. - True - 15 - 0 - True - GTK_UPDATE_ALWAYS - True - False - 0 0 720 1 15 15 - - - - - - 2 - 3 - 2 - 3 - 10 - fill - - - + + + True + Demo the selected screen saver in full-screen mode (click the mouse to return.) + True + True + _Preview + True + GTK_RELIEF_NORMAL + + + - - - True - How long before the monitor goes completely black. - True - 15 - 0 - True - GTK_UPDATE_ALWAYS - True - False - 1 1 720 1 15 15 - - - + + + True + Customization and explanation of the selected screen saver. + True + True + _Settings... + True + GTK_RELIEF_NORMAL + + + - 2 - 3 + 1 + 2 1 2 fill - + fill - - - 0 - 1 - 1 - 2 - fill - fill - - - - - - True - GTK_BUTTONBOX_SPREAD - 30 - - True - True - True - _Preview - True - GTK_RELIEF_NORMAL - - - - - - - True - True - True - _Settings... - True - GTK_RELIEF_NORMAL - - - - - - 1 - 2 - 1 - 2 - fill - fill - - - - - - 10 - True - False - 0 - - - + + 10 True False 0 - + True - _Mode: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - mode_menu - - - 0 - False - False - - + False + 0 - - - True - True - 0 + + + True + _Mode: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + mode_menu + + + 0 + False + False + + - - + + True + True + 0 - - + + True - Disable Screen Saver - True - - - - - True - Blank Screen Only - True - - + + + True + Disable Screen Saver + True + + - - - True - Only One Screen Saver - True - - + + + True + Blank Screen Only + True + + - - - True - Random Screen Saver - True + + + True + Only One Screen Saver + True + + + + + + True + Random Screen Saver + True + + + + 4 + True + True + - 4 - True + 10 + False True - - - 10 - False - True - - - - - - True - True - GTK_POLICY_NEVER - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - + True True - False - True - False - True - - - - - 0 - True - True - - + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT - - - True - True - 0 + + + True + True + False + True + False + True + + + + + 0 + True + True + + - + True - False + True 0 - + True - True - GTK_RELIEF_NORMAL - + False + 0 - + True - GTK_ARROW_DOWN - GTK_SHADOW_OUT - 0.5 - 0.5 - 0 - 0 + Run the next screen saver in the list in full-screen mode (click the mouse to return.) + True + GTK_RELIEF_NORMAL + + + + + True + GTK_ARROW_DOWN + GTK_SHADOW_OUT + 0.5 + 0.5 + 0 + 0 + + + + 0 + False + False + - - - 0 - False - False - - - - - - True - True - GTK_RELIEF_NORMAL - - + True - GTK_ARROW_UP - GTK_SHADOW_OUT - 0.5 - 0.5 - 0 - 0 + Run the previous screen saver in the list in full-screen mode (click the mouse to return.) + True + GTK_RELIEF_NORMAL + + + + + True + GTK_ARROW_UP + GTK_SHADOW_OUT + 0.5 + 0.5 + 0 + 0 + + + + 0 + False + False + @@ -621,116 +639,168 @@ 0 False - False + True + GTK_PACK_END - 0 - False - True - GTK_PACK_END + 0 + 1 + 0 + 1 + fill - - - 0 - 1 - 0 - 1 - fill - - - - - - True - Description - 0 - GTK_SHADOW_ETCHED_IN - + True - True - True - False - GTK_POS_BOTTOM - False - 2 - 2 - False + 0 + 0.5 + GTK_SHADOW_ETCHED_IN - - 8 + True - 0 - GTK_SHADOW_ETCHED_IN - 0.5 - 0.5 - 1.33 - False + True + True + False + GTK_POS_BOTTOM + False + 2 + 2 + False - + + 8 True - - Preview of screen saver - + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + 0.5 + 0.5 + 1.33 + False + + + + True + + + + False + True + - - - False - True - - - - - True - preview - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - tab - - + + + True + preview + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + tab + + - - - True - No Preview + + + True + No Preview Available - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + False + True + + + + + + True + no preview + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + tab + + + + + + True + Not +Installed + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + False + True + + + + + + True + not installed + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + tab + + - - False - True - - + True - no preview + Description False False GTK_JUSTIFY_LEFT @@ -742,143 +812,79 @@ Available 0 - tab + label_item + + 1 + 2 + 0 + 1 + 6 + expand|shrink|fill + expand|shrink|fill + - 1 - 2 - 0 - 1 - 6 - expand|shrink|fill - expand|shrink|fill + False + True - - - False - True - - - - - - True - _Display Modes - True - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - tab - - - - - True - 2 - 2 - True - 0 - 0 + + + True + _Display Modes + True + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + notebook + + + tab + + - - 10 + True - Image Manipulation - 0 - GTK_SHADOW_ETCHED_IN + 2 + 2 + True + 0 + 0 - - 8 + + 10 True - False - 8 - - - - True - screensaver-snap.xpm - 0 - 0 - 4 - 8 - - - 0 - False - False - - + 0 + 0.5 + GTK_SHADOW_ETCHED_IN - + + 8 True False - 0 - - - - True - True - Grab Desktop _Images - True - GTK_RELIEF_NORMAL - False - False - True - - - - 0 - False - False - - - - - - True - True - Grab _Video Frames - True - GTK_RELIEF_NORMAL - False - False - True - - - - 0 - False - False - - + 8 - - True - True - Choose _Random Image: - True - GTK_RELIEF_NORMAL - False - False - True - + + True + screensaver-snap.xpm + 0 + 0 + 4 + 8 0 @@ -888,24 +894,23 @@ Available - + True False 0 - + True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 8 - 0 + Whether the image-manipulating modes should be allowed to operate on an image of your desktop. + True + Grab Desktop _Images + True + GTK_RELIEF_NORMAL + False + False + True + 0 @@ -915,34 +920,109 @@ Available - + True + Whether the image-manipulating modes should operate on images captured from the system's video input (if there is one.) True - True - True - 0 - - True - * - False - - + Grab _Video Frames + True + GTK_RELIEF_NORMAL + False + False + True + 0 - True - True + False + False - + True + Whether the image-manipulating modes should operate on random images loaded from disk. True - _Browse + Choose _Random Image: True GTK_RELIEF_NORMAL - + False + False + True + + + + 0 + False + False + + + + + + True + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 8 + 0 + + + 0 + False + False + + + + + + True + The directory from which images will be randomly chosen. + True + True + True + 0 + + True + * + False + + + + + 0 + True + True + + + + + + True + True + _Browse + True + GTK_RELIEF_NORMAL + + + + 0 + False + False + + 0 @@ -953,187 +1033,63 @@ Available 0 - False - False + True + True - - 0 - True - True - - - - - - 0 - 1 - 0 - 1 - - - - - - 10 - True - Diagnostics - 0 - GTK_SHADOW_ETCHED_IN - - - - 8 - True - False - 8 - - - - - True - False - 0 - - - - True - True - _Verbose Dialognostics - True - GTK_RELIEF_NORMAL - False - False - True - - - - 0 - False - False - - - - - - True - True - Display Subprocess _Errors - True - GTK_RELIEF_NORMAL - False - False - True - - - - 0 - False - False - - - - - - True - True - Display _Splash Screen at Startup - True - GTK_RELIEF_NORMAL - False - False - True - - - 0 - False - False - - - - - 0 - True - True + label_item + + 0 + 1 + 0 + 1 + - - - 0 - 1 - 1 - 2 - fill - - - - - - 10 - True - Display Power Management - 0 - GTK_SHADOW_ETCHED_IN - - 8 + + 10 True - False - 8 - - - - - 0 - False - False - - + 0 + 0.5 + GTK_SHADOW_ETCHED_IN - + + 8 True False - 0 + 8 - + 0 @@ -1143,233 +1099,402 @@ Available - + True - 3 - 3 False - 2 - 4 + 0 - + True - Stand_by After + Whether the daemon should print lots of debugging information. + True + _Verbose Diagnostics True - False - GTK_JUSTIFY_LEFT - False - False - 1 - 0.5 - 10 - 0 - dpms_standby_spinbutton + GTK_RELIEF_NORMAL + False + False + True + - 0 - 1 - 0 - 1 - fill - + 0 + False + False - + True - Sus_pend After + Whether any error output of the display modes should be redirected to the screen. + True + Display Subprocess _Errors True - False - GTK_JUSTIFY_LEFT - False - False - 1 - 0.5 - 10 - 0 - dpms_suspend_spinbutton + GTK_RELIEF_NORMAL + False + False + True + - 0 - 1 - 1 - 2 - fill - + 0 + False + False - + True - _Off After + Whether the splash screen (with the version number and `Help' button) should be momentarily displayed when the daemon first starts up. + True + Display _Splash Screen at Startup True - False - GTK_JUSTIFY_LEFT - False - False - 1 - 0.5 - 10 - 0 - dpms_off_spinbutton + GTK_RELIEF_NORMAL + False + False + True - 0 - 1 - 2 - 3 - fill - + 0 + False + False + + + 0 + True + True + + + + - - - True - minutes - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 2 - 3 - 0 - 1 - fill - - - + + + True + Diagnostics + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + label_item + + + + + 0 + 1 + 1 + 2 + fill + + - - - True - minutes - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 2 - 3 - 1 - 2 - fill - - - + + + 10 + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN - - - True - minutes - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 2 - 3 - 2 - 3 - fill - - - + + + 8 + True + False + 8 + + + + + 0 + False + False + + + + + + True + False + 0 - + True + Whether the monitor should be powered down after a while. True - 15 - 0 - True - GTK_UPDATE_ALWAYS - True - False - 0 0 1440 1 15 15 - - - + _Power Management Enabled + True + GTK_RELIEF_NORMAL + True + False + True + - 1 - 2 - 2 - 3 - - + 0 + False + False - + True - True - 15 - 0 - True - GTK_UPDATE_ALWAYS - True - False - 0 0 1440 1 15 15 - - - - - - 1 - 2 - 1 - 2 - - - - + 3 + 3 + False + 2 + 4 - - - True - True - 15 - 0 - True - GTK_UPDATE_ALWAYS - True - False - 0 0 1440 1 15 15 - - - + + + True + Stand_by After + True + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 10 + 0 + dpms_standby_spinbutton + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Sus_pend After + True + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 10 + 0 + dpms_suspend_spinbutton + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + _Off After + True + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 10 + 0 + dpms_off_spinbutton + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + minutes + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 2 + 3 + 0 + 1 + fill + + + + + + + True + minutes + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 2 + 3 + 1 + 2 + fill + + + + + + + True + minutes + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 2 + 3 + 2 + 3 + fill + + + + + + + True + How long until the monitor powers down. + True + 15 + 0 + True + GTK_UPDATE_ALWAYS + True + False + 0 0 1440 1 15 15 + + + + + + 1 + 2 + 2 + 3 + + + + + + + + True + How long until the monitor goes into power-saving mode. + True + 15 + 0 + True + GTK_UPDATE_ALWAYS + True + False + 0 0 1440 1 15 15 + + + + + + 1 + 2 + 1 + 2 + + + + + + + + True + How long until the monitor goes completely black. + True + 15 + 0 + True + GTK_UPDATE_ALWAYS + True + False + 0 0 1440 1 15 15 + + + + + + 1 + 2 + 0 + 1 + + + + - 1 - 2 - 0 - 1 - - + 0 + True + True @@ -1380,121 +1505,59 @@ Available - - 0 - True - True - - - - - - 1 - 2 - 0 - 1 - fill - - - - - - 10 - True - Colormaps - 0 - GTK_SHADOW_ETCHED_IN - - - - 8 - True - False - 8 - + True - screensaver-colorselector.xpm + Display Power Management + False + False + GTK_JUSTIFY_LEFT + False + False 0.5 - 0 + 0.5 0 0 - 0 - False - False + label_item + + + 1 + 2 + 0 + 1 + fill + + + + + + 10 + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN - + + 8 True False - 0 - - - - True - True - Install _Colormap - True - GTK_RELIEF_NORMAL - False - False - True - - - - 0 - False - False - - - - - - True - - - 4 - False - False - - - - - - True - True - Fade to Black when _Blanking - True - GTK_RELIEF_NORMAL - False - False - True - - - - 0 - False - False - - + 8 - + True - True - Fade from Black When _Unblanking - True - GTK_RELIEF_NORMAL - False - False - True - + screensaver-colorselector.xpm + 0.5 + 0 + 0 + 0 0 @@ -1504,24 +1567,23 @@ Available - + True False 0 - + True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 3 - 0 + Whether to install a private colormap when running in 8-bit mode on the default Visual. + True + Install _Colormap + True + GTK_RELIEF_NORMAL + False + False + True + 0 @@ -1531,62 +1593,148 @@ Available - + + True + + + 4 + False + False + + + + + True - F_ade Duration + Whether the screen should slowly fade to black when the screen saver activates. + True + Fade to Black when _Blanking True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - fade_spinbutton + GTK_RELIEF_NORMAL + False + False + True + - 10 + 0 False False - + True + Whether the screen should slowly fade in from black when the screen saver deactivates. True - 1 - 0 - True - GTK_UPDATE_ALWAYS - True - False - 0 0 10 1 1 1 - - - + Fade from Black When _Unblanking + True + GTK_RELIEF_NORMAL + False + False + True + 0 - True - True + False + False - + True - seconds - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 3 + 0 + + + 0 + False + False + + + + + + True + F_ade Duration + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + fade_spinbutton + + + 10 + False + False + + + + + + True + How long it should take for the screen to fade in and out. + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + True + False + 0 0 10 1 1 1 + + + + + + 4 + False + False + + + + + + True + seconds + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + False + False + + 0 @@ -1602,47 +1750,67 @@ Available + + + + + True + Colormaps + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + - 0 - True - True + label_item + + 1 + 2 + 1 + 2 + fill + fill + - 1 - 2 - 1 - 2 - fill - fill + False + True - - - False - True - - - - - True - _Advanced - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 + + + True + _Advanced + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + notebook + + + tab + + - tab + 0 + True + True @@ -1667,17 +1835,14 @@ Available - 2 True False 0 - 5 True GTK_BUTTONBOX_END - 10 @@ -1748,8 +1913,8 @@ Available True - Settings 0 + 0.5 GTK_SHADOW_ETCHED_IN @@ -2080,6 +2245,25 @@ Available + + + + True + Settings + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + label_item + + 0 @@ -2091,8 +2275,8 @@ Available True - Description 0 + 0.5 GTK_SHADOW_ETCHED_IN @@ -2141,6 +2325,25 @@ Available + + + + True + Description + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + label_item + + 0 diff --git a/driver/xscreensaver-demo.glade2p b/driver/xscreensaver-demo.glade2p new file mode 100644 index 00000000..3dfe8948 --- /dev/null +++ b/driver/xscreensaver-demo.glade2p @@ -0,0 +1,19 @@ + + + + + XScreenSaver Demo + xscreensaver-demo + + ../utils/images + TRUE + FALSE + FALSE + FALSE + demo-Gtk2-widgets.c + demo-Gtk2-widgets.h + demo-Gtk2-stubs.c + demo-Gtk2-stubs.h + demo-Gtk2-support.c + demo-Gtk2-support.h + diff --git a/driver/xscreensaver-demo.man b/driver/xscreensaver-demo.man index 059509c9..3763285d 100644 --- a/driver/xscreensaver-demo.man +++ b/driver/xscreensaver-demo.man @@ -11,7 +11,7 @@ .if n .sp 1 .if t .sp .5 .. -.TH XScreenSaver 1 "11-Jun-2002 (4.05)" "X Version 11" +.TH XScreenSaver 1 "23-Oct-2002 (4.06)" "X Version 11" .SH NAME xscreensaver-demo - interactively control the background xscreensaver daemon .SH SYNOPSIS diff --git a/driver/xscreensaver-getimage-file.man b/driver/xscreensaver-getimage-file.man index 4b975b51..7e471f94 100644 --- a/driver/xscreensaver-getimage-file.man +++ b/driver/xscreensaver-getimage-file.man @@ -1,4 +1,4 @@ -.TH XScreenSaver 1 "11-Jun-2002 (4.05)" "X Version 11" +.TH XScreenSaver 1 "23-Oct-2002 (4.06)" "X Version 11" .SH NAME xscreensaver-getimage-file - put a randomly-selected image on the root window .SH SYNOPSIS diff --git a/driver/xscreensaver-getimage-video b/driver/xscreensaver-getimage-video index 073fb786..c0ef8941 100755 --- a/driver/xscreensaver-getimage-video +++ b/driver/xscreensaver-getimage-video @@ -29,7 +29,7 @@ use diagnostics; use strict; my $progname = $0; $progname =~ s@.*/@@g; -my $version = q{ $Revision: 1.8 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; +my $version = q{ $Revision: 1.9 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; my $verbose = 0; @@ -54,6 +54,7 @@ my @programs = ( "bttvgrab -d q -Q -l 1 -o ppm -f $tmpfile", # BTTV "qcam > $tmpfile", # Connectix Qcam + "gqcam -t PPM -d $tmpfile", # GTK+ Qcam clone "streamer -s 768x576 -o $tmpfile", # XawTV "atitv snap $tmpfile", # ATI video capture card diff --git a/driver/xscreensaver-getimage-video.man b/driver/xscreensaver-getimage-video.man index da67cd67..786d4b4f 100644 --- a/driver/xscreensaver-getimage-video.man +++ b/driver/xscreensaver-getimage-video.man @@ -1,4 +1,4 @@ -.TH XScreenSaver 1 "11-Jun-2002 (4.05)" "X Version 11" +.TH XScreenSaver 1 "23-Oct-2002 (4.06)" "X Version 11" .SH NAME xscreensaver-getimage-video - put a video frame on the root window .SH SYNOPSIS diff --git a/driver/xscreensaver-getimage.c b/driver/xscreensaver-getimage.c index 2d3cce59..d1cd8515 100644 --- a/driver/xscreensaver-getimage.c +++ b/driver/xscreensaver-getimage.c @@ -437,6 +437,9 @@ load_image_internal (Screen *screen, Window window, GdkPixbuf *pb; Display *dpy = DisplayOfScreen (screen); char *filename = get_filename (dpy, ac, av); +#ifdef HAVE_GTK2 + GError *gerr = 0; +#endif /* HAVE_GTK2 */ if (!filename) { @@ -448,11 +451,15 @@ load_image_internal (Screen *screen, Window window, fprintf (stderr, "%s: loading \"%s\"\n", progname, filename); gdk_pixbuf_xlib_init (dpy, screen_number (screen)); +#ifdef HAVE_GTK2 + g_type_init(); +#else /* !HAVE_GTK2 */ xlib_rgb_init (dpy, screen); +#endif /* !HAVE_GTK2 */ pb = gdk_pixbuf_new_from_file (filename #ifdef HAVE_GTK2 - , NULL + , &gerr #endif /* HAVE_GTK2 */ ); @@ -507,12 +514,26 @@ load_image_internal (Screen *screen, Window window, if (win_width < w) w = win_width; if (win_height < h) h = win_height; + /* The window might have no-op background of None, so to clear it, + draw a black rectangle first, then do XClearWindow (in case the + actual background color is non-black...) */ + { + XGCValues gcv; + GC gc; + /* #### really we should allocate "black" instead, but I'm lazy... */ + gcv.foreground = BlackPixelOfScreen (screen); + gc = XCreateGC (dpy, window, GCForeground, &gcv); + XFillRectangle (dpy, window, gc, 0, 0, win_width, win_height); + XFreeGC (dpy, gc); + XClearWindow (dpy, window); + XFlush (dpy); + } + /* #### Note that this always uses the default colormap! Morons! Owen says that in Gnome 2.0, I should try using gdk_pixbuf_render_pixmap_and_mask_for_colormap() instead. But I don't have Gnome 2.0 yet. */ - XClearWindow (dpy, window); gdk_pixbuf_xlib_render_to_drawable_alpha (pb, window, srcx, srcy, destx, desty, w, h, GDK_PIXBUF_ALPHA_FULL, 127, @@ -526,6 +547,11 @@ load_image_internal (Screen *screen, Window window, else if (filename) { fprintf (stderr, "%s: unable to load %s\n", progname, filename); +#ifdef HAVE_GTK2 + if (gerr && gerr->message && *gerr->message) + fprintf (stderr, "%s: reason %s\n", progname, gerr->message); +#endif /* HAVE_GTK2 */ + goto FAIL; } else @@ -623,8 +649,8 @@ main (int argc, char **argv) !strcmp (argv[i], "--root")) window = RootWindowOfScreen (screen); - else if ((1 == sscanf (argv[i], " 0x%x %c", &w, &dummy) || - 1 == sscanf (argv[i], " %d %c", &w, &dummy)) && + else if ((1 == sscanf (argv[i], " 0x%lx %c", &w, &dummy) || + 1 == sscanf (argv[i], " %ld %c", &w, &dummy)) && w != 0) window = (Window) w; else diff --git a/driver/xscreensaver-getimage.man b/driver/xscreensaver-getimage.man index 559b205c..659aebb1 100644 --- a/driver/xscreensaver-getimage.man +++ b/driver/xscreensaver-getimage.man @@ -1,4 +1,4 @@ -.TH XScreenSaver 1 "11-Jun-2002 (4.05)" "X Version 11" +.TH XScreenSaver 1 "23-Oct-2002 (4.06)" "X Version 11" .SH NAME xscreensaver-getimage - put some randomly-selected image on the root window .SH SYNOPSIS diff --git a/driver/xscreensaver.c b/driver/xscreensaver.c index 5ce1a909..57cc234d 100644 --- a/driver/xscreensaver.c +++ b/driver/xscreensaver.c @@ -302,9 +302,9 @@ saver_ehandler (Display *dpy, XErrorEvent *error) for (i = 0; i < si->nscreens; i++) fprintf (real_stderr, "%s: screen %d: 0x%x, 0x%x, 0x%x\n", blurb(), i, - RootWindowOfScreen (si->screens[i].screen), - si->screens[i].real_vroot, - si->screens[i].screensaver_window); + (unsigned int) RootWindowOfScreen (si->screens[i].screen), + (unsigned int) si->screens[i].real_vroot, + (unsigned int) si->screens[i].screensaver_window); fprintf (real_stderr, "\n" "#######################################" @@ -1206,6 +1206,7 @@ main_loop (saver_info *si) } static void analyze_display (saver_info *si); +static void fix_fds (void); int main (int argc, char **argv) @@ -1219,6 +1220,8 @@ main (int argc, char **argv) memset(si, 0, sizeof(*si)); global_si_kludge = si; /* I hate C so much... */ + fix_fds(); + # undef ya_rand_init ya_rand_init (0); @@ -1277,6 +1280,36 @@ main (int argc, char **argv) return 0; } +static void +fix_fds (void) +{ + /* Bad Things Happen if stdin, stdout, and stderr have been closed + (as by the `sh incantation "xscreensaver >&- 2>&-"). When you do + that, the X connection gets allocated to one of these fds, and + then some random library writes to stderr, and random bits get + stuffed down the X pipe, causing "Xlib: sequence lost" errors. + So, we cause the first three file descriptors to be open to + /dev/null if they aren't open to something else already. This + must be done before any other files are opened (or the closing + of that other file will again free up one of the "magic" first + three FDs.) + + We do this by opening /dev/null three times, and then closing + those fds, *unless* any of them got allocated as #0, #1, or #2, + in which case we leave them open. Gag. + + Really, this crap is technically required of *every* X program, + if you want it to be robust in the face of "2>&-". + */ + int fd0 = open ("/dev/null", O_RDWR); + int fd1 = open ("/dev/null", O_RDWR); + int fd2 = open ("/dev/null", O_RDWR); + if (fd0 > 2) close (fd0); + if (fd1 > 2) close (fd1); + if (fd2 > 2) close (fd2); +} + + /* Processing ClientMessage events. */ @@ -1316,7 +1349,7 @@ XGetAtomName_safe (Display *dpy, Atom atom) else { char buf[100]; - sprintf (buf, "<>", (unsigned long) atom); + sprintf (buf, "<>", (unsigned int) atom); return strdup (buf); } } diff --git a/driver/xscreensaver.kss.in b/driver/xscreensaver.kss.in index 974ecc2e..ba2a7f1b 100755 --- a/driver/xscreensaver.kss.in +++ b/driver/xscreensaver.kss.in @@ -87,9 +87,9 @@ while [ -n "$1" ]; do Install="TRUE" ;; -lock) - if [ ! -f "/etc/shadow" ]; then +# if [ ! -f "/etc/shadow" ]; then lockmode="-lock-mode" - fi +# fi ;; # -allow-root) # echo "Not yet supported" diff --git a/driver/xscreensaver.man b/driver/xscreensaver.man index 16ef372c..dffe163e 100644 --- a/driver/xscreensaver.man +++ b/driver/xscreensaver.man @@ -11,7 +11,7 @@ .if n .sp 1 .if t .sp .5 .. -.TH XScreenSaver 1 "11-Jun-2002 (4.05)" "X Version 11" +.TH XScreenSaver 1 "23-Oct-2002 (4.06)" "X Version 11" .SH NAME xscreensaver - extensible screen saver framework, plus locking .SH SYNOPSIS @@ -303,6 +303,15 @@ runs; this resource will cause the output of all relevant programs to be drawn on the screensaver window itself, as well as being written to the controlling terminal of the screensaver driver process. Default true. .TP 8 +.B ignoreUninstalledPrograms\fP (class \fBBoolean\fP) +There may be programs in the list that are not installed on the system, +yet are marked as "enabled." If this preference is true, then such +programs will simply be ignored. If false, then a warning will be printed +if an attempt is made to run the nonexistent program. Also, the +.BR xscreensaver-demo (1) +program will suppress the non-existent programs from the list if this +is true. Default: false. +.TP 8 .B font\fP (class \fBFont\fP) The font used for the stdout/stderr text, if \fBcaptureStderr\fP is true. Default \fB*\-medium\-r\-*\-140\-*\-m\-*\fP (a 14 point fixed-width font.) diff --git a/driver/xscreensaver.pam b/driver/xscreensaver.pam index 09eefa31..b59e2603 100644 --- a/driver/xscreensaver.pam +++ b/driver/xscreensaver.pam @@ -1,2 +1,7 @@ #%PAM-1.0 -auth required /lib/security/pam_pwdb.so shadow nullok + +# Red Hat says this is right for them, as of 7.3: +auth required /lib/security/pam_stack.so service=system-auth + +# This is what we were using before: +# auth required /lib/security/pam_pwdb.so shadow nullok diff --git a/hacks/Makefile.in b/hacks/Makefile.in index 12e58419..31a72583 100644 --- a/hacks/Makefile.in +++ b/hacks/Makefile.in @@ -13,8 +13,9 @@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ mandir = @mandir@ -man1dir = $(mandir)/man1 +# maybe this should be 6 (games)? mansuffix = 1 +manNdir = $(mandir)/man$(mansuffix) CC = @CC@ CFLAGS = @CFLAGS@ @@ -95,7 +96,7 @@ SRCS = attraction.c blitspin.c bouboule.c braid.c bubbles.c \ rotzoomer.c whirlygig.c speedmine.c vermiculate.c \ xpm-pixmap.c webcollage-helper.c twang.c apollonian.c \ euler2d.c juggle.c polyominoes.c thornbird.c fluidballs.c \ - anemone.c + anemone.c halftone.c SCRIPTS = vidwhacker webcollage OBJS = attraction.o blitspin.o bouboule.o braid.o bubbles.o \ @@ -119,7 +120,7 @@ OBJS = attraction.o blitspin.o bouboule.o braid.o bubbles.o \ rotzoomer.o whirlygig.o speedmine.o vermiculate.o \ xpm-pixmap.o webcollage-helper.o twang.o apollonian.o \ euler2d.o juggle.o polyominoes.o thornbird.o fluidballs.o \ - anemone.o + anemone.o halftone.o NEXES = attraction blitspin bouboule braid bubbles decayscreen deco \ drift flag flame forest vines galaxy grav greynetic halo \ @@ -135,7 +136,7 @@ NEXES = attraction blitspin bouboule braid bubbles decayscreen deco \ xsublim ccurve blaster bumps ripples xteevee xspirograph \ nerverot xrayswarm hyperball zoom whirlwindwarp rotzoomer \ whirlygig speedmine vermiculate twang apollonian euler2d \ - juggle polyominoes thornbird fluidballs anemone \ + juggle polyominoes thornbird fluidballs anemone halftone \ @JPEG_EXES@ SEXES = sonar JPEG_EXES = webcollage-helper @@ -176,7 +177,7 @@ MEN = anemone.man ant.man apollonian.man attraction.man \ wander.man webcollage.man whirlwindwarp.man whirlygig.man \ worm.man xflame.man xjack.man xlyap.man xmatrix.man \ xrayswarm.man xspirograph.man xsublim.man xteevee.man \ - zoom.man + zoom.man halftone.man STAR = * EXTRAS = README Makefile.in xlock_23.h xml2man.pl .gdbinit \ config/README \ @@ -273,15 +274,15 @@ munge-scripts: $(SCRIPTS) install-man: $(MEN) @men="$(MEN)" ; \ - if [ ! -d $(install_prefix)$(man1dir) ]; then \ - $(INSTALL_DIRS) $(install_prefix)$(man1dir) ; \ + if [ ! -d $(install_prefix)$(manNdir) ]; then \ + $(INSTALL_DIRS) $(install_prefix)$(manNdir) ; \ fi ; \ for man in $$men; do \ instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \ echo $(INSTALL_DATA) $(srcdir)/$$man \ - $(install_prefix)$(man1dir)/$$instname ; \ + $(install_prefix)$(manNdir)/$$instname ; \ $(INSTALL_DATA) $(srcdir)/$$man \ - $(install_prefix)$(man1dir)/$$instname ; \ + $(install_prefix)$(manNdir)/$$instname ; \ done install-xml: @@ -306,8 +307,8 @@ uninstall-man: @men="$(MEN)" ; \ for man in $$men; do \ instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \ - echo rm -f $(install_prefix)$(man1dir)/$$instname ; \ - rm -f $(install_prefix)$(man1dir)/$$instname ; \ + echo rm -f $(install_prefix)$(manNdir)/$$instname ; \ + rm -f $(install_prefix)$(manNdir)/$$instname ; \ done uninstall-xml: @@ -674,8 +675,8 @@ ccurve: ccurve.o $(HACK_OBJS) $(COL) $(SPL) blaster: blaster.o $(HACK_OBJS) $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(HACK_LIBS) -bumps: bumps.o $(HACK_OBJS) $(GRAB) - $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(GRAB) $(HACK_LIBS) +bumps: bumps.o $(HACK_OBJS) $(GRAB) $(SHM) + $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(GRAB) $(SHM) $(HACK_LIBS) ripples: ripples.o $(HACK_OBJS) $(SHM) $(COL) $(GRAB) $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(SHM) $(COL) $(GRAB) $(HACK_LIBS) @@ -722,6 +723,9 @@ fluidballs: fluidballs.o $(HACK_OBJS) anemone: anemone.o $(HACK_OBJS) $(DBE) $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(DBE) $(HACK_LIBS) +halftone: halftone.o $(HACK_OBJS) $(COL) + $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(COL) $(HACK_LIBS) + # The rules for those hacks which follow the `xlockmore' API. # @@ -884,6 +888,7 @@ braid.o: $(srcdir)/xlockmore.h bsod.o: ../config.h bsod.o: $(srcdir)/images/amiga.xpm bsod.o: $(srcdir)/images/atari.xbm +bsod.o: $(srcdir)/images/hmac.xpm bsod.o: $(srcdir)/images/macbomb.xbm bsod.o: $(srcdir)/images/mac.xbm bsod.o: $(srcdir)/screenhack.h @@ -1016,6 +1021,8 @@ grav.o: $(srcdir)/xlockmoreI.h grav.o: $(srcdir)/xlockmore.h greynetic.o: ../config.h greynetic.o: $(srcdir)/screenhack.h +halftone.o: ../config.h +halftone.o: $(srcdir)/screenhack.h halo.o: ../config.h halo.o: $(srcdir)/screenhack.h helix.o: ../config.h diff --git a/hacks/anemone.c b/hacks/anemone.c index bbd2d74a..630ea034 100644 --- a/hacks/anemone.c +++ b/hacks/anemone.c @@ -302,7 +302,7 @@ static void drawImage(Drawable curr_window, double sint, double cost) { int q,numpt,mx2=mx/2; - double cx,cy,cz,nx,ny,nz; + double cx,cy,cz,nx=0,ny=0,nz=0; if ((numpt=aCurr->numpt)==1) return; XSetForeground(dpy, gcDraw, aCurr->col); diff --git a/hacks/bsod.c b/hacks/bsod.c index 0d19a456..2ac1ab72 100644 --- a/hacks/bsod.c +++ b/hacks/bsod.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1998-2001 Jamie Zawinski +/* xscreensaver, Copyright (c) 1998-2002 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 @@ -11,23 +11,24 @@ * Blue Screen of Death: the finest in personal computer emulation. * Concept cribbed from Stephen Martin ; * this version written by jwz, 4-Jun-98. - * - * TODO: - * - Should simulate a Unix kernel panic and reboot. - * - Making various boot noises would be fun, too. - * - Should randomize the various hex numbers printed. */ #include "screenhack.h" #include "xpm-pixmap.h" #include +#include +#include #include +#ifdef HAVE_UNAME +# include +#endif /* HAVE_UNAME */ #include "images/amiga.xpm" #include "images/atari.xbm" #include "images/mac.xbm" #include "images/macbomb.xbm" +#include "images/hmac.xpm" static int @@ -1221,6 +1222,151 @@ mac1 (Display *dpy, Window window, int delay) } +static Bool +macx (Display *dpy, Window window, int delay) +{ + XGCValues gcv; + XWindowAttributes xgwa; + char *fontname = 0; + const char *def_font = "fixed"; + XFontStruct *font; + GC gc; + + const char *macx_panic = + ("panic(cpu 0): Unable to find driver for this platform: " + "\"PowerMac 3,5\".\n" + "\n" + "backtrace: 0x0008c2f4 0x0002a7a0 0x001f0204 0x001d4e4c 0x001d4c5c " + "0x001a56cc 0x01d5dbc 0x001c621c 0x00037430 0x00037364\n" + "\n" + "\n" + "\n" + "No debugger configured - dumping debug information\n" + "\n" + "version string : Darwin Kernel Version 1.3:\n" + "Thu Mar 1 06:56:40 PST 2001; root:xnu/xnu-123.5.obj~1/RELEASE_PPC\n" + "\n" + "\n" + "\n" + "\n" + "DBAT0: 00000000 00000000\n" + "DBAT1: 00000000 00000000\n" + "DBAT2: 80001FFE 8000003A\n" + "DBAT3: 90001FFE 9000003A\n" + "MSR=00001030\n" + "backtrace: 0x0008c2f4 0x0002a7a0 0x001f0204 0x001d4e4c 0x001d4c5c " + "0x001a56cc 0x01d5dbc 0x001c621c 0x00037430 0x00037364\n" + "\n" + "panic: We are hanging here...\n"); + + if (!get_boolean_resource("doMacX", "DoMacX")) + return False; + + XGetWindowAttributes (dpy, window, &xgwa); + + gcv.background = get_pixel_resource("macX.background", + "MacX.Background", + dpy, xgwa.colormap); + XSetWindowBackground(dpy, window, gcv.background); + XClearWindow(dpy, window); + + fontname = get_string_resource ((xgwa.height > 900 + ? "macX.font2" + : "macX.font"), + "MacX.Font"); + if (!fontname || !*fontname) fontname = (char *)def_font; + font = XLoadQueryFont (dpy, fontname); + if (!font) font = XLoadQueryFont (dpy, def_font); + if (!font) exit(-1); + if (fontname && fontname != def_font) + free (fontname); + + gcv.font = font->fid; + gcv.foreground = get_pixel_resource("macsbug.foreground", + "MacsBug.Foreground", + dpy, xgwa.colormap); + gcv.background = get_pixel_resource("macsbug.background", + "MacsBug.Background", + dpy, xgwa.colormap); + + + gcv.foreground = get_pixel_resource("macX.textForeground", + "MacX.TextForeground", + dpy, xgwa.colormap); + gcv.background = get_pixel_resource("macX.textBackground", + "MacX.TextBackground", + dpy, xgwa.colormap); + gc = XCreateGC(dpy, window, GCForeground|GCBackground|GCFont, &gcv); + +#if defined(HAVE_GDK_PIXBUF) || defined (HAVE_XPM) + { + Pixmap pixmap = 0; + Pixmap mask = 0; + int x, y, pix_w, pix_h; + pixmap = xpm_data_to_pixmap (dpy, window, (char **) happy_mac, + &pix_w, &pix_h, &mask); + + x = (xgwa.width - pix_w) / 2; + y = (xgwa.height - pix_h) / 2; + if (y < 0) y = 0; + XSync(dpy, False); + bsod_sleep(dpy, 2); + XSetClipMask (dpy, gc, mask); + XSetClipOrigin (dpy, gc, x, y); + XCopyArea (dpy, pixmap, window, gc, 0, 0, pix_w, pix_h, x, y); + XSetClipMask (dpy, gc, None); + XFreePixmap (dpy, pixmap); + } +#endif /* HAVE_GDK_PIXBUF || HAVE_XPM */ + + bsod_sleep(dpy, 3); + + { + const char *s; + int x = 0, y = 0; + int char_width, line_height; + char_width = (font->per_char + ? font->per_char['n'-font->min_char_or_byte2].width + : font->min_bounds.width); + line_height = font->ascent + font->descent; + + s = macx_panic; + y = font->ascent; + while (*s) + { + int ox = x; + int oy = y; + if (*s == '\n' || x + char_width >= xgwa.width) + { + x = 0; + y += line_height; + } + + if (*s == '\n') + { + /* Note that to get this goofy effect, they must be actually + emitting LF CR at the end of each line instead of CR LF! + */ + XDrawImageString (dpy, window, gc, ox, oy, " ", 1); + XDrawImageString (dpy, window, gc, ox, y, " ", 1); + } + else + { + XDrawImageString (dpy, window, gc, x, y, s, 1); + x += char_width; + } + s++; + } + } + + XFreeGC(dpy, gc); + XSync(dpy, False); + bsod_sleep(dpy, delay); + XClearWindow(dpy, window); + return True; +} + + @@ -1310,17 +1456,12 @@ blitdamage (Display *dpy, Window window, int delay) * Anton Solovyev */ -static int solaris_max_scroll = 10; - typedef struct { Display *dpy; Window window; - GC gc; - Pixmap subwindow; /* The text subwindow */ + GC gc, erase_gc; XFontStruct *xfs; - int width; /* Window width in pixels */ - int height; /* Window height in pixels */ int sub_width; /* Text subwindow width in pixels */ int sub_height; /* Text subwindow height in pixels */ int sub_x; /* upper left corner of the text subwindow */ @@ -1328,162 +1469,151 @@ typedef struct int char_width; /* Char width in pixels */ int line_height; /* Line height in pixels */ int columns; /* Number of columns in the text screen */ - int lines; /* Number of lines in the text screen */ - int x; /* position of the cursor */ - int y; /* position of the cursor */ -} solaris_console; + int x; /* horizontal position of the cursor */ +} scrolling_window; -static solaris_console * -make_solaris_console (Display *dpy, Window window) +static scrolling_window * +make_scrolling_window (Display *dpy, Window window, + const char *name, + Bool grab_screen_p) { const char *def_font = "fixed"; - solaris_console* ts; - + scrolling_window* ts; XWindowAttributes xgwa; XGCValues gcv; - char* fontname; - - ts = malloc(sizeof(solaris_console)); + char* fn; + char buf1[100], buf2[100]; + ts = malloc (sizeof (*ts)); ts->window = window; ts->dpy = dpy; ts->x = 0; - ts->y = 0; XGetWindowAttributes (dpy, window, &xgwa); - ts->width = xgwa.width; - ts->height = xgwa.height; - ts->sub_width = ts->width * 0.8; - ts->sub_height = ts->height * 0.8; - fontname = get_string_resource ("solaris.font", "Solaris.Font"); - ts->xfs = XLoadQueryFont (dpy, fontname); + if (grab_screen_p) + { + ts->sub_width = xgwa.width * 0.8; + ts->sub_height = xgwa.height * 0.8; + } + else + { + ts->sub_width = xgwa.width - 20; + ts->sub_height = xgwa.height - 20; + if (ts->sub_width < 20) ts->sub_width = 20; + if (ts->sub_height < 20) ts->sub_height = 20; + } + + sprintf (buf1, "%.50s.font", name); + sprintf (buf2, "%.50s.Font", name); + fn = get_string_resource (buf1, buf2); + ts->xfs = XLoadQueryFont (dpy, fn); if (!ts->xfs) { - fontname = get_string_resource("solaris.font2", "Solaris.Font"); - ts->xfs = XLoadQueryFont(dpy, fontname); + sprintf (buf1, "%.50s.font2", name); + fn = get_string_resource(buf1, buf2); + ts->xfs = XLoadQueryFont(dpy, fn); } if (!ts->xfs) ts->xfs = XLoadQueryFont(dpy, def_font); if (!ts->xfs) - { - fprintf (stderr, "Can't load font\n"); - XFreeFont (dpy, ts->xfs); - free (ts); - exit (1); - } + exit (1); gcv.font = ts->xfs->fid; ts->char_width = (ts->xfs->per_char - ? ts->xfs->per_char[ts->xfs->min_char_or_byte2 + - ts->xfs->default_char].width - : ts->xfs->max_bounds.width); + ? ts->xfs->per_char['n'-ts->xfs->min_char_or_byte2].width + : ts->xfs->min_bounds.width); ts->line_height = ts->xfs->ascent + ts->xfs->descent + 1; ts->columns = ts->sub_width / ts->char_width; - ts->lines = ts->sub_height / ts->line_height; - - ts->sub_x = (ts->width - ts->sub_width) / 2; - ts->sub_y = (ts->height - ts->sub_height) / 2; - - ts->subwindow = XCreatePixmap (dpy, window, ts->sub_width, - ts->sub_height * (solaris_max_scroll + 1), - xgwa.depth); - grab_screen_image (xgwa.screen, window); - gcv.function = GXcopy; - gcv.background = XBlackPixel (dpy, XDefaultScreen(dpy)); - gcv.foreground = XWhitePixel (dpy, XDefaultScreen(dpy)); - ts->gc = XCreateGC (dpy, window, - GCFunction | GCBackground | GCForeground | GCFont, - &gcv); - XCopyArea (dpy, window, ts->subwindow, ts->gc, - ts->sub_x, ts->sub_y, ts->sub_width, ts->sub_height, - 0, 0); - XFillRectangle (dpy, ts->subwindow, ts->gc, 0, ts->sub_height, - ts->sub_width, ts->sub_height * solaris_max_scroll); - gcv.background = XWhitePixel (dpy, XDefaultScreen (dpy)); - gcv.foreground = XBlackPixel (dpy, XDefaultScreen (dpy)); - XChangeGC (dpy, ts->gc, GCBackground | GCForeground, &gcv); + ts->sub_x = (xgwa.width - ts->sub_width) / 2; + ts->sub_y = (xgwa.height - ts->sub_height) / 2; + + if (!grab_screen_p) ts->sub_height += ts->sub_y, ts->sub_y = 0; + + if (grab_screen_p) + grab_screen_image (xgwa.screen, window); + + sprintf (buf1, "%.50s.background", name); + sprintf (buf2, "%.50s.Background", name); + gcv.background = get_pixel_resource (buf1, buf2, dpy, xgwa.colormap); + + sprintf (buf1, "%.50s.foreground", name); + sprintf (buf2, "%.50s.Foreground", name); + gcv.foreground = get_pixel_resource (buf1, buf2, dpy, xgwa.colormap); + ts->gc = XCreateGC (dpy, window, + GCForeground | GCBackground | GCFont, + &gcv); + gcv.foreground = gcv.background; + ts->erase_gc = XCreateGC (dpy, window, + GCForeground | GCBackground, + &gcv); + XSetWindowBackground (dpy, window, gcv.background); return(ts); } static void -free_solaris_console (solaris_console* ts) +free_scrolling_window (scrolling_window* ts) { - XFreePixmap (ts->dpy, ts->subwindow); XFreeGC (ts->dpy, ts->gc); + XFreeGC (ts->dpy, ts->erase_gc); XFreeFont (ts->dpy, ts->xfs); free (ts); } static void -solaris_draw (solaris_console* ts) -{ - XCopyArea (ts->dpy, ts->subwindow, ts->window, ts->gc, 0, - (ts->y + 1) * ts->line_height, ts->sub_width, - ts->sub_height, ts->sub_x, ts->sub_y); -} - -static void -solaris_putc (solaris_console* ts, const char aChar) +scrolling_putc (scrolling_window* ts, const char aChar) { - if (ts->y >= solaris_max_scroll * ts->lines) - return; - - if (!ts->y && !ts->x) - solaris_draw (ts); - switch (aChar) { case '\n': - ts->y++; ts->x = 0; - solaris_draw (ts); + XCopyArea (ts->dpy, ts->window, ts->window, ts->gc, + ts->sub_x, ts->sub_y + ts->line_height, + ts->sub_width, ts->sub_height, + ts->sub_x, ts->sub_y); + XFillRectangle (ts->dpy, ts->window, ts->erase_gc, + ts->sub_x, ts->sub_y + ts->sub_height - ts->line_height, + ts->sub_width, ts->line_height); break; case '\b': if(ts->x > 0) ts->x--; break; default: - XDrawImageString (ts->dpy, ts->subwindow, ts->gc, - (ts->x * ts->char_width - - ts->xfs->min_bounds.lbearing), - (ts->sub_height + (ts->y + 1) * - ts->line_height - ts->xfs->descent), + if (ts->x >= ts->columns) + scrolling_putc (ts, '\n'); + XDrawImageString (ts->dpy, ts->window, ts->gc, + (ts->sub_x + + (ts->x * ts->char_width) + - ts->xfs->min_bounds.lbearing), + (ts->sub_y + ts->sub_height - ts->xfs->descent), &aChar, 1); - XCopyArea (ts->dpy, ts->subwindow, ts->window, ts->gc, - ts->x * ts->char_width, - ts->y * ts->line_height + ts->sub_height, - ts->xfs->max_bounds.rbearing - ts->xfs->min_bounds.lbearing, - ts->line_height, ts->sub_x + ts->x * ts->char_width, - ts->sub_y + ts->sub_height - ts->line_height); ts->x++; - if (ts->x >= ts->columns) - { - ts->x = 0; - solaris_putc(ts, '\n'); - } break; } } -static void -solaris_puts (solaris_console* ts, const char* aString, int delay) +static Bool +scrolling_puts (scrolling_window *ts, const char* aString, int delay) { const char *c; for (c = aString; *c; ++c) { - solaris_putc (ts, *c); + scrolling_putc (ts, *c); if (delay) { XSync(ts->dpy, 0); usleep(delay); + if (bsod_sleep (ts->dpy, 0)) + return True; } } XSync (ts->dpy, 0); + return False; } static Bool @@ -1525,50 +1655,436 @@ sparc_solaris (Display* dpy, Window window, int delay) "rebooting...\n" "Resetting ..."; - solaris_console* ts; + scrolling_window *ts; int i; char buf[256]; if (!get_boolean_resource("doSolaris", "DoSolaris")) return False; - ts = make_solaris_console (dpy, window); + ts = make_scrolling_window (dpy, window, "Solaris", True); - solaris_puts (ts, msg1, 0); + scrolling_puts (ts, msg1, 0); if (bsod_sleep (dpy, 3)) goto DONE; - solaris_puts (ts, msg2, 0); + scrolling_puts (ts, msg2, 0); if (bsod_sleep (dpy, 2)) goto DONE; for (i = 1; i <= 100; ++i) { sprintf(buf, "\b\b\b\b\b\b\b\b\b\b\b%3d%% done", i); - solaris_puts(ts, buf, 0); + scrolling_puts (ts, buf, 0); if (bsod_sleep (dpy, -1)) goto DONE; } - solaris_puts (ts, msg3, 0); + scrolling_puts (ts, msg3, 0); if (bsod_sleep (dpy, 2)) goto DONE; - solaris_puts (ts, msg4, 0); + scrolling_puts (ts, msg4, 0); if (bsod_sleep(dpy, 3)) goto DONE; - XFillRectangle (ts->dpy, ts->window, ts->gc, 0, 0, - ts->width, ts->height); - bsod_sleep (dpy, 3); DONE: - free_solaris_console (ts); + free_scrolling_window (ts); + + return True; +} + +/* Linux panic and fsck, by jwz + */ +static Bool +linux_fsck (Display *dpy, Window window, int delay) +{ + XWindowAttributes xgwa; + scrolling_window *ts; + int i; + const char *sysname; + char buf[1024]; + + const char *linux_panic[] = { + " kernel: Unable to handle kernel paging request at virtual " + "address 0000f0ad\n", + " kernel: printing eip:\n", + " kernel: c01becd7\n", + " kernel: *pde = 00000000\n", + " kernel: Oops: 0000\n", + " kernel: CPU: 0\n", + " kernel: EIP: 0010:[] Tainted: P \n", + " kernel: EFLAGS: 00010286\n", + " kernel: eax: 0000ff00 ebx: ca6b7e00 ecx: ce1d7a60 edx: ce1d7a60\n", + " kernel: esi: ca6b7ebc edi: 00030000 ebp: d3655ca0 esp: ca6b7e5c\n", + " kernel: ds: 0018 es: 0018 ss: 0018\n", + " kernel: Process crond (pid: 1189, stackpage=ca6b7000)\n", + " kernel: Stack: d3655ca0 ca6b7ebc 00030054 ca6b7e7c c01c1e5b " + "00000287 00000020 c01c1fbf \n", + "", + " kernel: 00005a36 000000dc 000001f4 00000000 00000000 " + "ce046d40 00000001 00000000 \n", + "", "", "", + " kernel: ffffffff d3655ca0 d3655b80 00030054 c01bef93 " + "d3655ca0 ca6b7ebc 00030054 \n", + "", "", "", + " kernel: Call Trace: [] [] [] " + "[] []\n", + "", "", "", + " kernel: [] [] [] []\n", + " kernel: \n", + " kernel: Code: 2a 00 75 08 8b 44 24 2c 85 c0 74 0c 8b 44 24 58 83 48 18 " + "08 \n", + 0 + }; + + if (!get_boolean_resource("doLinux", "DoLinux")) + return False; + + XGetWindowAttributes (dpy, window, &xgwa); + XSetWindowBackground (dpy, window, + get_pixel_resource("Linux.background", + "Linux.Background", + dpy, xgwa.colormap)); + XClearWindow(dpy, window); + + sysname = "linux"; +# ifdef HAVE_UNAME + { + struct utsname uts; + char *s; + if (uname (&uts) >= 0) + sysname = uts.nodename; + s = strchr (sysname, '.'); + if (s) *s = 0; + } +# endif /* !HAVE_UNAME */ + + + ts = make_scrolling_window (dpy, window, "Linux", False); + + scrolling_puts (ts, "waiting for X server to shut down ", 0); + usleep (100000); + if (bsod_sleep (dpy, 0)) + goto PANIC; + scrolling_puts (ts, + "XIO: fatal IO error 2 (broken pipe) on X server \":0.0\"\n" + " after 339471 requests (339471 known processed) " + "with 0 events remaining\n", + 0); + if (scrolling_puts (ts, ".........\n", 300000)) + goto PANIC; + if (bsod_sleep (dpy, 0)) + goto PANIC; + scrolling_puts (ts, + "xinit: X server slow to shut down, sending KILL signal.\n", + 0); + scrolling_puts (ts, "waiting for server to die ", 0); + if (scrolling_puts (ts, "...\n", 300000)) + goto PANIC; + if (bsod_sleep (dpy, 0)) + goto PANIC; + scrolling_puts (ts, "xinit: Can't kill server\n", 0); + + if (bsod_sleep (dpy, 2)) + goto PANIC; + + sprintf (buf, "\n%s Login: ", sysname); + scrolling_puts (ts, buf, 0); + if (bsod_sleep (dpy, 1)) + goto PANIC; + scrolling_puts (ts, + "\n\n" + "Parallelizing fsck version 1.22 (22-Jun-2001)\n" + "e2fsck 1.22, 22-Jun-2001 for EXT2 FS 0.5b, 95/08/09\n" + "Warning! /dev/hda1 is mounted.\n" + "/dev/hda1 contains a file system with errors, check forced.\n", + 0); + if (bsod_sleep (dpy, 1)) + goto PANIC; + + if (0 == random() % 2) + scrolling_puts (ts, + "Couldn't find ext2 superblock, trying backup blocks...\n" + "The filesystem size (according to the superblock) is 3644739 blocks\n" + "The physical size of the device is 3636706 blocks\n" + "Either the superblock or the partition table is likely to be corrupt!\n" + "Abort? no\n", + 0); + if (bsod_sleep (dpy, 1)) + goto PANIC; + + AGAIN: + + scrolling_puts (ts, "Pass 1: Checking inodes, blocks, and sizes\n", 0); + if (bsod_sleep (dpy, 2)) + goto PANIC; + + i = (random() % 60) - 20; + while (--i > 0) + { + int b = random() % 0xFFFF; + sprintf (buf, "Deleted inode %d has zero dtime. Fix? yes\n\n", b); + scrolling_puts (ts, buf, 0); + } + + i = (random() % 40) - 10; + if (i > 0) + { + int g = random() % 0xFFFF; + int b = random() % 0xFFFFFFF; + + if (bsod_sleep (dpy, 1)) + goto PANIC; + + sprintf (buf, "Warning: Group %d's copy of the group descriptors " + "has a bad block (%d).\n", g, b); + scrolling_puts (ts, buf, 0); + + b = random() % 0x3FFFFF; + while (--i > 0) + { + b += random() % 0xFFFF; + sprintf (buf, + "Error reading block %d (Attempt to read block " + "from filesystem resulted in short read) while doing " + "inode scan. Ignore error?", + b); + scrolling_puts (ts, buf, 0); + usleep (10000); + scrolling_puts (ts, " yes\n\n", 0); + } + } + + if (0 == (random() % 10)) + { + + if (bsod_sleep (dpy, 1)) + goto PANIC; + + i = 3 + (random() % 10); + while (--i > 0) + scrolling_puts (ts, "Could not allocate 256 block(s) for inode table: " + "No space left on device\n", 0); + scrolling_puts (ts, "Restarting e2fsck from the beginning...\n", 0); + + if (bsod_sleep (dpy, 2)) + goto PANIC; + + goto AGAIN; + } + + i = (random() % 20) - 5; + + if (i > 0) + if (bsod_sleep (dpy, 1)) + goto PANIC; + + while (--i > 0) + { + int j = 5 + (random() % 10); + int w = random() % 4; + + while (--j > 0) + { + int b = random() % 0xFFFFF; + int g = random() % 0xFFF; + + if (0 == (random() % 10)) + b = 0; + else if (0 == (random() % 10)) + b = -1; + + if (w == 0) + sprintf (buf, + "Inode table for group %d not in group. (block %d)\n" + "WARNING: SEVERE DATA LOSS POSSIBLE.\n" + "Relocate?", + g, b); + else if (w == 1) + sprintf (buf, + "Block bitmap for group %d not in group. (block %d)\n" + "Relocate?", + g, b); + else if (w == 2) + sprintf (buf, + "Inode bitmap %d for group %d not in group.\n" + "Continue?", + b, g); + else /* if (w == 3) */ + sprintf (buf, + "Bad block %d in group %d's inode table.\n" + "WARNING: SEVERE DATA LOSS POSSIBLE.\n" + "Relocate?", + b, g); + + scrolling_puts (ts, buf, 0); + scrolling_puts (ts, " yes\n\n", 0); + } + if (bsod_sleep (dpy, 0)) + goto PANIC; + usleep (1000); + } + + + if (0 == random() % 10) goto PANIC; + scrolling_puts (ts, "Pass 2: Checking directory structure\n", 0); + if (bsod_sleep (dpy, 2)) + goto PANIC; + + i = (random() % 20) - 5; + while (--i > 0) + { + int n = random() % 0xFFFFF; + int o = random() % 0xFFF; + sprintf (buf, "Directory inode %d, block 0, offset %d: " + "directory corrupted\n" + "Salvage? ", + n, o); + scrolling_puts (ts, buf, 0); + usleep (1000); + scrolling_puts (ts, " yes\n\n", 0); + + if (0 == (random() % 100)) + { + sprintf (buf, "Missing '.' in directory inode %d.\nFix?", n); + scrolling_puts (ts, buf, 0); + usleep (1000); + scrolling_puts (ts, " yes\n\n", 0); + } + + if (bsod_sleep (dpy, 0)) + goto PANIC; + } + + if (0 == random() % 10) goto PANIC; + scrolling_puts (ts, + "Pass 3: Checking directory connectivity\n" + "/lost+found not found. Create? yes\n", + 0); + if (bsod_sleep (dpy, 2)) + goto PANIC; + /* Unconnected directory inode 4949 (/var/spool/squid/06/???) + Connect to /lost+found? yes + + '..' in /var/spool/squid/06/08 (20351) is (0), should be + /var/spool/squid/06 (20350). + Fix? yes + + Unconnected directory inode 128337 (/var/spool/squid/06/???) + Connect to /lost+found? yes + */ + + + if (0 == random() % 10) goto PANIC; + scrolling_puts (ts, "Pass 4: Checking reference counts\n", 0); + if (bsod_sleep (dpy, 2)) + goto PANIC; + + /* Inode 2 ref count is 19, should be 20. Fix? yes + + Inode 4949 ref count is 3, should be 2. Fix? yes + + ... + + Inode 128336 ref count is 3, should be 2. Fix? yes + + Inode 128337 ref count is 3, should be 2. Fix? yes + + */ + + + if (0 == random() % 10) goto PANIC; + scrolling_puts (ts, "Pass 5: Checking group summary information\n", 0); + if (bsod_sleep (dpy, 2)) + goto PANIC; + + i = (random() % 200) - 50; + if (i > 0) + { + scrolling_puts (ts, "Block bitmap differences: ", 0); + while (--i > 0) + { + sprintf (buf, " %d", -(random() % 0xFFF)); + scrolling_puts (ts, buf, 0); + usleep (1000); + } + scrolling_puts (ts, "\nFix? yes\n\n", 0); + } + + + i = (random() % 100) - 50; + if (i > 0) + { + scrolling_puts (ts, "Inode bitmap differences: ", 0); + while (--i > 0) + { + sprintf (buf, " %d", -(random() % 0xFFF)); + scrolling_puts (ts, buf, 0); + usleep (1000); + } + scrolling_puts (ts, "\nFix? yes\n\n", 0); + } + + i = (random() % 20) - 5; + while (--i > 0) + { + int g = random() % 0xFFFF; + int c = random() % 0xFFFF; + sprintf (buf, + "Free blocks count wrong for group #0 (%d, counted=%d).\nFix? ", + g, c); + scrolling_puts (ts, buf, 0); + usleep (1000); + scrolling_puts (ts, " yes\n\n", 0); + if (bsod_sleep (dpy, 0)) + goto PANIC; + } + + PANIC: + + i = 0; + scrolling_puts (ts, "\n\n", 0); + while (linux_panic[i]) + { + time_t t = time ((time_t *) 0); + struct tm *tm = localtime (&t); + char prefix[100]; + + if (*linux_panic[i]) + { + strftime (prefix, sizeof(prefix)-1, "%b %d %k:%M:%S ", tm); + scrolling_puts (ts, prefix, 0); + scrolling_puts (ts, sysname, 0); + scrolling_puts (ts, linux_panic[i], 0); + XSync(dpy, False); + usleep(1000); + } + else + usleep (300000); + + if (bsod_sleep (dpy, 0)) + goto DONE; + i++; + } + + if (bsod_sleep (dpy, 4)) + goto DONE; + + + XSync(dpy, False); + bsod_sleep(dpy, delay); + + DONE: + free_scrolling_window (ts); + XClearWindow(dpy, window); return True; } + char *progclass = "BSOD"; @@ -1582,9 +2098,11 @@ char *defaults [] = { "*doMac: True", "*doMacsBug: True", "*doMac1: True", + "*doMacX: True", "*doSCO: True", "*doAtari: False", /* boring */ "*doBSD: False", /* boring */ + "*doLinux: True", "*doSparcLinux: False", /* boring */ "*doBlitDamage: True", "*doSolaris: True", @@ -1617,11 +2135,22 @@ char *defaults [] = { ".mac1.foreground: Black", ".mac1.background: White", + ".macX.textForeground: White", + ".macX.textBackground: Black", + ".macX.background: #888888", + ".macX.font: -*-courier-bold-r-*-*-*-120-*-*-m-*-*-*", + ".macX.font2: -*-courier-bold-r-*-*-*-240-*-*-m-*-*-*", + ".SCO.font: -*-courier-bold-r-*-*-*-120-*-*-m-*-*-*", ".SCO.font2: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*", ".SCO.foreground: White", ".SCO.background: Black", + ".Linux.font: 9x15bold", + ".Linux.font2: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*", + ".Linux.foreground: White", + ".Linux.background: Black", + ".SparcLinux.font: -*-courier-bold-r-*-*-*-120-*-*-m-*-*-*", ".SparcLinux.font2: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*", ".SparcLinux.foreground: White", @@ -1636,6 +2165,8 @@ char *defaults [] = { ".Solaris.font: -sun-gallant-*-*-*-*-19-*-*-*-*-120-*-*", ".Solaris.font2: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*", + ".Solaris.foreground: Black", + ".Solaris.background: White", "*dontClearRoot: True", 0 }; @@ -1654,6 +2185,7 @@ XrmOptionDescRec options [] = { { "-no-mac", ".doMac", XrmoptionNoArg, "False" }, { "-mac1", ".doMac1", XrmoptionNoArg, "True" }, { "-no-mac1", ".doMac1", XrmoptionNoArg, "False" }, + { "-no-macx", ".doMacX", XrmoptionNoArg, "False" }, { "-atari", ".doAtari", XrmoptionNoArg, "True" }, { "-no-atari", ".doAtari", XrmoptionNoArg, "False" }, { "-macsbug", ".doMacsBug", XrmoptionNoArg, "True" }, @@ -1662,6 +2194,8 @@ XrmOptionDescRec options [] = { { "-no-sco", ".doSCO", XrmoptionNoArg, "False" }, { "-bsd", ".doBSD", XrmoptionNoArg, "True" }, { "-no-bsd", ".doBSD", XrmoptionNoArg, "False" }, + { "-linux", ".doLinux", XrmoptionNoArg, "True" }, + { "-no-linux", ".doLinux", XrmoptionNoArg, "False" }, { "-sparclinux", ".doSparcLinux", XrmoptionNoArg, "True" }, { "-no-sparclinux", ".doSparcLinux", XrmoptionNoArg, "False" }, { "-blitdamage", ".doBlitDamage", XrmoptionNoArg, "True" }, @@ -1692,22 +2226,24 @@ screenhack (Display *dpy, Window window) while (1) { Bool did; - do { i = (random() & 0xFF) % 13; } while (i == j); + do { i = (random() & 0xFF) % 15; } while (i == j); switch (i) { - case 0: did = windows(dpy, window, delay, 0); break; - case 1: did = windows(dpy, window, delay, 1); break; - case 2: did = windows(dpy, window, delay, 2); break; - case 3: did = amiga(dpy, window, delay); break; - case 4: did = mac(dpy, window, delay); break; - case 5: did = macsbug(dpy, window, delay); break; - case 6: did = mac1(dpy, window, delay); break; - case 7: did = sco(dpy, window, delay); break; - case 8: did = sparc_linux(dpy, window, delay); break; - case 9: did = bsd(dpy, window, delay); break; - case 10: did = atari(dpy, window, delay); break; - case 11: did = blitdamage(dpy, window, delay); break; - case 12: did = sparc_solaris(dpy, window, delay); break; + case 0: did = windows(dpy, window, delay, 0); break; + case 1: did = windows(dpy, window, delay, 1); break; + case 2: did = windows(dpy, window, delay, 2); break; + case 3: did = amiga(dpy, window, delay); break; + case 4: did = mac(dpy, window, delay); break; + case 5: did = macsbug(dpy, window, delay); break; + case 6: did = mac1(dpy, window, delay); break; + case 7: did = macx(dpy, window, delay); break; + case 8: did = sco(dpy, window, delay); break; + case 9: did = sparc_linux(dpy, window, delay); break; + case 10: did = bsd(dpy, window, delay); break; + case 11: did = atari(dpy, window, delay); break; + case 12: did = blitdamage(dpy, window, delay); break; + case 13: did = sparc_solaris(dpy, window, delay); break; + case 14: did = linux_fsck(dpy, window, delay); break; default: abort(); break; } loop++; diff --git a/hacks/bsod.man b/hacks/bsod.man index dffcedbf..d3cbbe81 100644 --- a/hacks/bsod.man +++ b/hacks/bsod.man @@ -75,6 +75,7 @@ hacks are displayed and which aren't. .BR doSCO , .BR doAtari , .BR doBSD , +.BR doLinux , .BR doSparcLinux , .BR doBlitDamage , and diff --git a/hacks/bumps.c b/hacks/bumps.c index 8718bfda..be4c95b9 100644 --- a/hacks/bumps.c +++ b/hacks/bumps.c @@ -1,4 +1,5 @@ -/* Bumps, Copyright (c) 2002 Shane Smit +/* -*- mode: C; tab-width: 4 -*- + * Bumps, Copyright (c) 2002 Shane Smit * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -22,50 +23,73 @@ * [10/01/99] - Shane Smit: Creation * [10/08/99] - Shane Smit: Port to C. (Ick) * [03/08/02] - Shane Smit: New movement code. + * [09/12/02] - Shane Smit: MIT-SHM XImages. + * Thanks to Kennett Galbraith + * for code optimization. */ - #include "bumps.h" +/* This function pointer will point to the appropriate PutPixel*() function below. */ +void (*MyPutPixel)( int8_ *, uint32_ ); + +void PutPixel32( int8_ *pData, uint32_ pixel ) +{ + *(uint32_ *)pData = pixel; +} + +void PutPixel24( int8_ *pData, uint32_ pixel ) +{ + pData[ 2 ] = ( pixel & 0x00FF0000 ) >> 16; + pData[ 1 ] = ( pixel & 0x0000FF00 ) >> 8; + pData[ 0 ] = ( pixel & 0x000000FF ); +} + +void PutPixel16( int8_ *pData, uint32_ pixel ) +{ + *(uint16_ *)pData = (uint16_)pixel; +} + +void PutPixel8( int8_ *pData, uint32_ pixel ) +{ + *(uint8_ *)pData = (uint8_)pixel; +} +/* Creates the light map, which is a circular image... going from black around the edges + * to white in the center. */ void CreateSpotLight( SSpotLight *pSpotLight, uint16_ iDiameter, uint16_ nColorCount ) { - double nDelta; - int16_ iHeight, iWidth; + double nDist; + int16_ iDistX, iDistY; + uint8_ *pLOffset; - pSpotLight->nDiameter = iDiameter; + pSpotLight->nFalloffDiameter = iDiameter; + pSpotLight->nFalloffRadius = pSpotLight->nFalloffDiameter / 2; + pSpotLight->nLightDiameter = iDiameter / 2; + pSpotLight->nLightRadius = pSpotLight->nLightDiameter / 2; #ifdef VERBOSE - printf( "%s: Light Diameter: %d\n", progclass, pSpotLight->nDiameter ); + printf( "%s: Falloff Diameter: %d\n", progclass, pSpotLight->nFalloffDiameter ); + printf( "%s: Spot Light Diameter: %d\n", progclass, pSpotLight->nLightDiameter ); #endif - pSpotLight->aLightMap = calloc( pSpotLight->nDiameter * pSpotLight->nDiameter, sizeof(uint8_) ); - memset( pSpotLight->aLightMap, 0, pSpotLight->nDiameter * pSpotLight->nDiameter ); + pSpotLight->aLightMap = malloc( pSpotLight->nLightDiameter * pSpotLight->nLightDiameter * sizeof(uint8_) ); - /* The falloff max values... 3/4 of the entire lightmap. */ - pSpotLight->nRadius = (uint16_)(pSpotLight->nDiameter / 2.5F); - - for( iHeight=-pSpotLight->nRadius; iHeightnRadius; iHeight++ ) - for( iWidth=-pSpotLight->nRadius; iWidthnRadius; iWidth++ ) + pLOffset = pSpotLight->aLightMap; + for( iDistY=-pSpotLight->nLightRadius; iDistYnLightRadius; ++iDistY ) + { + for( iDistX=-pSpotLight->nLightRadius; iDistXnLightRadius; ++iDistX ) { - nDelta = ( nColorCount * 2.5F ) - ( ( sqrt( pow( iWidth+0.5F, 2 ) + pow( iHeight+0.5F, 2 ) ) / pSpotLight->nRadius ) * ( nColorCount * 2.5F ) ); - nDelta += nColorCount; - if( nDelta >= ( nColorCount * 2 ) ) nDelta = ( nColorCount * 2 ) - 1; - if( nDelta >= nColorCount ) - pSpotLight->aLightMap[ ( ( iHeight + (pSpotLight->nDiameter/2) ) * pSpotLight->nDiameter ) + iWidth + (pSpotLight->nDiameter/2) ] = (uint8_)nDelta; - } - - /* The actual lightmap... Use 1/4 to save time within the loop. */ - pSpotLight->nRadius = pSpotLight->nDiameter / 4; + nDist = sqrt( pow( iDistX+0.5F, 2 ) + pow( iDistY+0.5F, 2 ) ); + if( nDist / pSpotLight->nLightRadius <= 1.0f ) + *pLOffset = (uint8_)(nColorCount - ( ( nDist / pSpotLight->nLightRadius ) * ( nColorCount - 1 ) )); + else + *pLOffset = 0; - for( iHeight=-pSpotLight->nRadius; iHeightnRadius; iHeight++ ) - for( iWidth=-pSpotLight->nRadius; iWidthnRadius; iWidth++ ) - { - nDelta = nColorCount - ( ( sqrt( pow( iWidth+0.5F, 2 ) + pow( iHeight+0.5F, 2 ) ) / pSpotLight->nRadius ) * ( nColorCount - 1 ) ); - if( nDelta >= 1 ) - pSpotLight->aLightMap[ ( ( iHeight + (pSpotLight->nDiameter/2) ) * pSpotLight->nDiameter ) + iWidth + (pSpotLight->nDiameter/2) ] = (uint8_)nDelta; + ++pLOffset; } + } - pSpotLight->nRadius = pSpotLight->nDiameter / 2; /* Now set the radius back to what it should be. */ + /* Initialize movement variables. */ pSpotLight->nAccelX = 0; pSpotLight->nAccelY = 0; pSpotLight->nVelocityX = ( RANDOM() % 2 ) ? pSpotLight->nVelocityMax : -pSpotLight->nVelocityMax; @@ -73,17 +97,18 @@ void CreateSpotLight( SSpotLight *pSpotLight, uint16_ iDiameter, uint16_ nColorC } +/* Calculates the position of the spot light on the screen. */ void CalcLightPos( SBumps *pBumps ) { SSpotLight *pSpotLight = &pBumps->SpotLight; float nGravity; /* X */ - if( pSpotLight->nXPos < pSpotLight->nDiameter * 1 ) nGravity = 1.0f; - else if( pSpotLight->nXPos > pBumps->iWinWidth - ( pSpotLight->nDiameter * 1 ) ) nGravity = -1.0f; - else nGravity = ( ( RANDOM() % 201 ) / 100.0f ) - 1.0f; + if( pSpotLight->nXPos < pSpotLight->nFalloffRadius ) nGravity = 1.0f; + else if( pSpotLight->nXPos > pBumps->iWinWidth - pSpotLight->nFalloffRadius ) nGravity = -1.0f; + else nGravity = ( ( RANDOM() % 201 ) / 100.0f ) - 1.0f; - pSpotLight->nAccelX += nGravity * ( pSpotLight->nAccelMax / 10.0f ); + pSpotLight->nAccelX += nGravity * ( pSpotLight->nAccelMax / 5.0f ); if( pSpotLight->nAccelX < -pSpotLight->nAccelMax ) pSpotLight->nAccelX = -pSpotLight->nAccelMax; else if( pSpotLight->nAccelX > pSpotLight->nAccelMax ) pSpotLight->nAccelX = pSpotLight->nAccelMax; @@ -94,11 +119,11 @@ void CalcLightPos( SBumps *pBumps ) pSpotLight->nXPos += pSpotLight->nVelocityX; /* Y */ - if( pSpotLight->nYPos < pSpotLight->nDiameter * 1 ) nGravity = 1.0f; - else if( pSpotLight->nYPos > pBumps->iWinHeight - ( pSpotLight->nDiameter * 1 ) ) nGravity = -1.0f; - else nGravity = ( ( RANDOM() % 201 ) / 100.0f ) - 1.0f; + if( pSpotLight->nYPos < pSpotLight->nFalloffRadius ) nGravity = 1.0f; + else if( pSpotLight->nYPos > pBumps->iWinHeight - pSpotLight->nFalloffRadius ) nGravity = -1.0f; + else nGravity = ( ( RANDOM() % 201 ) / 100.0f ) - 1.0f; - pSpotLight->nAccelY += nGravity * ( pSpotLight->nAccelMax / 10.0f ); + pSpotLight->nAccelY += nGravity * ( pSpotLight->nAccelMax / 5.0f ); if( pSpotLight->nAccelY < -pSpotLight->nAccelMax ) pSpotLight->nAccelY = -pSpotLight->nAccelMax; else if( pSpotLight->nAccelY > pSpotLight->nAccelMax ) pSpotLight->nAccelY = pSpotLight->nAccelMax; @@ -110,28 +135,83 @@ void CalcLightPos( SBumps *pBumps ) } +/* Main initialization function. */ void CreateBumps( SBumps *pBumps, Display *pNewDisplay, Window NewWin ) { XWindowAttributes XWinAttribs; XGCValues GCValues; int32_ nGCFlags; - uint16_ iWidth, iHeight; uint16_ iDiameter; - + + /* Make size and velocity a function of window size, so it appears the same at 100x60 as it does in 3200x1200. */ XGetWindowAttributes( pNewDisplay, NewWin, &XWinAttribs ); pBumps->iWinWidth = XWinAttribs.width; pBumps->iWinHeight = XWinAttribs.height; pBumps->SpotLight.nXPos = XWinAttribs.width / 2.0f; pBumps->SpotLight.nYPos = XWinAttribs.height / 2.0f; - pBumps->SpotLight.nVelocityMax = ( ( XWinAttribs.width < XWinAttribs.height ) ? XWinAttribs.width : XWinAttribs.height ) / 128.0f; + pBumps->SpotLight.nVelocityMax = ( ( XWinAttribs.width < XWinAttribs.height ) ? XWinAttribs.width : XWinAttribs.height ) / 140.0f; pBumps->SpotLight.nAccelMax = pBumps->SpotLight.nVelocityMax / 10.0f; pBumps->pDisplay = pNewDisplay; pBumps->Win = NewWin; + pBumps->pXImage = NULL; + + iDiameter = ( ( pBumps->iWinWidth < pBumps->iWinHeight ) ? pBumps->iWinWidth : pBumps->iWinHeight ) / 2; - pBumps->pXImage = XCreateImage( pBumps->pDisplay, XWinAttribs.visual, XWinAttribs.depth, ZPixmap, 0, NULL, - pBumps->iWinWidth, pBumps->iWinHeight, BitmapPad( pBumps->pDisplay ), 0 ); - pBumps->pXImage->data = calloc( pBumps->pXImage->bytes_per_line * pBumps->pXImage->height, sizeof(int8_) ); +#ifdef HAVE_XSHM_EXTENSION + pBumps->bUseShm = get_boolean_resource( "useSHM", "Boolean" ); + if( pBumps->bUseShm ) + { + pBumps->pXImage = create_xshm_image( pBumps->pDisplay, XWinAttribs.visual, XWinAttribs.depth, + ZPixmap, NULL, &pBumps->XShmInfo, iDiameter, iDiameter ); + if( !pBumps->pXImage ) + { + fprintf( stderr, "%s: Unable to create XShmImage.\n", progname ); + pBumps->bUseShm = False; + } + } +#endif /* HAVE_XSHM_EXTENSION */ + if( !pBumps->pXImage ) + { + pBumps->pXImage = XCreateImage( pBumps->pDisplay, XWinAttribs.visual, XWinAttribs.depth, + ZPixmap, 0, NULL, iDiameter, iDiameter, BitmapPad( pBumps->pDisplay ), 0 ); + pBumps->pXImage->data = malloc( pBumps->pXImage->bytes_per_line * pBumps->pXImage->height * sizeof(int8_) ); + } + + /* For speed, access the XImage data directly using my own PutPixel routine. */ + switch( pBumps->pXImage->bits_per_pixel ) + { + case 32: + pBumps->bytesPerPixel = 4; + MyPutPixel = PutPixel32; + break; + + case 24: + pBumps->bytesPerPixel = 3; + MyPutPixel = PutPixel24; + break; + + case 16: + pBumps->bytesPerPixel = 2; + MyPutPixel = PutPixel16; + break; + + case 8: + pBumps->bytesPerPixel = 1; + MyPutPixel = PutPixel8; + break; + + default: + fprintf( stderr, "%s: Unknown XImage depth.", progname ); +#ifdef HAVE_XSHM_EXTENSION + if( pBumps->bUseShm ) + destroy_xshm_image( pBumps->pDisplay, pBumps->pXImage, &pBumps->XShmInfo ); + else +#endif /* HAVE_XSHM_EXTENSION */ + XDestroyImage( pBumps->pXImage ); + exit( 1 ); + } + GCValues.function = GXcopy; GCValues.subwindow_mode = IncludeInferiors; nGCFlags = GCForeground | GCFunction; @@ -140,82 +220,69 @@ void CreateBumps( SBumps *pBumps, Display *pNewDisplay, Window NewWin ) pBumps->GraphicsContext = XCreateGC( pBumps->pDisplay, pBumps->Win, nGCFlags, &GCValues ); SetPalette( pBumps, &XWinAttribs ); - iDiameter = ( ( pBumps->iWinWidth < pBumps->iWinHeight ) ? pBumps->iWinWidth : pBumps->iWinHeight ) / 3; CreateSpotLight( &pBumps->SpotLight, iDiameter, pBumps->nColorCount ); InitBumpMap( pBumps, &XWinAttribs ); - /* Clear the image. */ - if (pBumps->aXColors[ 0 ].pixel == 0) - memset (pBumps->pXImage->data, 0, - pBumps->pXImage->bytes_per_line * pBumps->pXImage->height); - else - for( iHeight=0; iHeightiWinHeight; iHeight++ ) - for( iWidth=0; iWidthiWinWidth; iWidth++ ) - XPutPixel( pBumps->pXImage, iWidth, iHeight, - pBumps->aXColors[ 0 ].pixel ); - XSetWindowBackground( pBumps->pDisplay, pBumps->Win, - pBumps->aXColors[ 0 ].pixel ); - XClearWindow (pBumps->pDisplay, pBumps->Win); + XSetWindowBackground( pBumps->pDisplay, pBumps->Win, pBumps->aColors[ 0 ] ); + XClearWindow (pBumps->pDisplay, pBumps->Win); } +/* Creates a specialized phong shade palette. */ void SetPalette( SBumps *pBumps, XWindowAttributes *pXWinAttribs ) { + XColor BaseColor; XColor Color; char *sColor; /* Spotlight Color */ int16_ iColor; - uint32_ *aPixels; sColor = get_string_resource( "color", "Color" ); - Color.red = RANDOM() % 0xFFFF; - Color.green = RANDOM() % 0xFFFF; - Color.blue = RANDOM() % 0xFFFF; + BaseColor.red = RANDOM() % 0xFFFF; + BaseColor.green = RANDOM() % 0xFFFF; + BaseColor.blue = RANDOM() % 0xFFFF; /* Make one color full intesity to avoid dark spotlights. */ switch( RANDOM() % 3 ) { - case 0: Color.red = 0xFFFF; break; - case 1: Color.green = 0xFFFF; break; - case 2: Color.blue = 0xFFFF; break; + case 0: BaseColor.red = 0xFFFF; break; + case 1: BaseColor.green = 0xFFFF; break; + case 2: BaseColor.blue = 0xFFFF; break; } - if( strcasecmp( sColor, "random" ) && !XParseColor( pBumps->pDisplay, pXWinAttribs->colormap, sColor, &Color ) ) + if( strcasecmp( sColor, "random" ) && !XParseColor( pBumps->pDisplay, pXWinAttribs->colormap, sColor, &BaseColor ) ) fprintf( stderr, "%s: color %s not found in database. Choosing random...\n", progname, sColor ); #ifdef VERBOSE - printf( "%s: Spotlight color is <%d,%d,%d> RGB.\n", progclass, Color.red, Color.green, Color.blue ); + printf( "%s: Spotlight color is <%d,%d,%d> RGB.\n", progclass, BaseColor.red, BaseColor.green, BaseColor.blue ); #endif /* VERBOSE */ pBumps->nColorCount = get_integer_resource( "colorcount", "Integer" ); if( pBumps->nColorCount < 2 ) pBumps->nColorCount = 2; if( pBumps->nColorCount > 128 ) pBumps->nColorCount = 128; - pBumps->aXColors = calloc( pBumps->nColorCount, sizeof(XColor ) ); - aPixels = calloc( pBumps->nColorCount, sizeof(uint32_) ); + pBumps->aColors = malloc( pBumps->nColorCount * sizeof(uint32_ ) ); - /* Creates a phong shade: / SpotColor \ Index/ColorCount - * PhongShade = | ------------ | Index + ( 65535 - SpotColor )^ + /* Creates a phong shade: / BaseColor \ Index/ColorCount + * PhongShade = | ------------ | Index + ( 65535 - BaseColor )^ * \ ColorCount / */ pBumps->nColorCount--; for( iColor=0; iColor<=pBumps->nColorCount; iColor++ ) { - pBumps->aXColors[ iColor ].red = (uint16_)( ( ( Color.red / (double)pBumps->nColorCount ) * iColor ) + pow( 0xFFFF - Color.red, iColor/(double)pBumps->nColorCount ) ); - pBumps->aXColors[ iColor ].green = (uint16_)( ( ( Color.green / (double)pBumps->nColorCount ) * iColor ) + pow( 0xFFFF - Color.green, iColor/(double)pBumps->nColorCount ) ); - pBumps->aXColors[ iColor ].blue = (uint16_)( ( ( Color.blue / (double)pBumps->nColorCount ) * iColor ) + pow( 0xFFFF - Color.blue, iColor/(double)pBumps->nColorCount ) ); + Color.red = (uint16_)( ( ( BaseColor.red / (double)pBumps->nColorCount ) * iColor ) + pow( 0xFFFF - BaseColor.red, iColor/(double)pBumps->nColorCount ) ); + Color.green = (uint16_)( ( ( BaseColor.green / (double)pBumps->nColorCount ) * iColor ) + pow( 0xFFFF - BaseColor.green, iColor/(double)pBumps->nColorCount ) ); + Color.blue = (uint16_)( ( ( BaseColor.blue / (double)pBumps->nColorCount ) * iColor ) + pow( 0xFFFF - BaseColor.blue, iColor/(double)pBumps->nColorCount ) ); - if( !XAllocColor( pBumps->pDisplay, pXWinAttribs->colormap, &pBumps->aXColors[ iColor ] ) ) + if( !XAllocColor( pBumps->pDisplay, pXWinAttribs->colormap, &Color ) ) { - XFreeColors( pBumps->pDisplay, pXWinAttribs->colormap, aPixels, iColor, 0 ); - free( pBumps->aXColors ); - free( aPixels ); + XFreeColors( pBumps->pDisplay, pXWinAttribs->colormap, pBumps->aColors, iColor, 0 ); + free( pBumps->aColors ); + pBumps->aColors = malloc( pBumps->nColorCount * sizeof(uint32_) ); pBumps->nColorCount--; - pBumps->aXColors = calloc( pBumps->nColorCount, sizeof(XColor) ); - aPixels = calloc( pBumps->nColorCount, sizeof(uint32_) ); iColor = -1; } else - aPixels[ iColor ] = pBumps->aXColors[ iColor ].pixel; + pBumps->aColors[ iColor ] = Color.pixel; } pBumps->nColorCount++; @@ -223,42 +290,69 @@ void SetPalette( SBumps *pBumps, XWindowAttributes *pXWinAttribs ) printf( "%s: Allocated %d colors.\n", progclass, pBumps->nColorCount ); #endif /* VERBOSE */ - XSetWindowBackground( pBumps->pDisplay, pBumps->Win, pBumps->aXColors[ 0 ].pixel ); + XSetWindowBackground( pBumps->pDisplay, pBumps->Win, pBumps->aColors[ 0 ] ); } +/* Grabs the current contents of the window to use an intensity-based bump map. */ void InitBumpMap( SBumps *pBumps, XWindowAttributes *pXWinAttribs ) { XImage *pScreenImage; - XColor *aColors; + XColor *aColors, *pColor; uint8_ nSoften; uint16_ iWidth, iHeight; + uint32_ nAverager; + uint16_ *pBump; + uint16_ maxHeight; + double softenMultiplier = 1.0f; BOOL bInvert = (BOOL)get_boolean_resource( "invert", "Boolean" ); - - aColors = (XColor*)calloc( pBumps->iWinWidth, sizeof(XColor) ); + + aColors = (XColor*)malloc( pBumps->iWinWidth * sizeof(XColor) ); grab_screen_image( pXWinAttribs->screen, pBumps->Win ); pScreenImage = XGetImage( pBumps->pDisplay, pBumps->Win, 0, 0, pBumps->iWinWidth, pBumps->iWinHeight, ~0L, ZPixmap ); - /* jwz: get the grabbed bits off the screen fast */ - XClearWindow (pBumps->pDisplay, pBumps->Win); - XSync (pBumps->pDisplay, 0); + /* jwz: get the grabbed bits off the screen fast */ + XClearWindow (pBumps->pDisplay, pBumps->Win); + XSync (pBumps->pDisplay, 0); - pBumps->aBumpMap = calloc( pBumps->iWinWidth * pBumps->iWinHeight, sizeof(uint16_) ); - for( iHeight=0; iHeightiWinHeight; iHeight++ ) - { - for( iWidth=0; iWidthiWinWidth; iWidth++ ) - aColors[ iWidth ].pixel = XGetPixel( pScreenImage, iWidth, iHeight ); - - XQueryColors( pBumps->pDisplay, pXWinAttribs->colormap, aColors, pBumps->iWinWidth ); + pBumps->aBumpMap = malloc( pBumps->iWinWidth * pBumps->iWinHeight * sizeof(uint16_) ); - if( bInvert ) + nSoften = get_integer_resource( "soften", "Integer" ); + while( nSoften-- ) + softenMultiplier *= 1.0f + ( 1.0f / 3.0f ); /* Softening takes the max height down, so scale up to compensate. */ + maxHeight = pBumps->SpotLight.nLightRadius * softenMultiplier; + nAverager = ( 3 * 0xFFFF ) / maxHeight; + + pBump = pBumps->aBumpMap; + if( bInvert ) /* Funny, it's actually the 'else' that inverts the bump map... */ + { + for( iHeight=0; iHeightiWinHeight; iHeight++ ) + { + pColor = aColors; for( iWidth=0; iWidthiWinWidth; iWidth++ ) - pBumps->aBumpMap[ ( iHeight * pBumps->iWinWidth ) + iWidth ] = (uint16_) - ( ( aColors[ iWidth ].red + aColors[ iWidth ].green + aColors[ iWidth ].blue ) / ( 0x2FFFD / (double)pBumps->SpotLight.nDiameter ) ); - else + (pColor++)->pixel = XGetPixel( pScreenImage, iWidth, iHeight ); + + XQueryColors( pBumps->pDisplay, pXWinAttribs->colormap, aColors, pBumps->iWinWidth ); + + pColor = aColors; + for( iWidth=pBumps->iWinWidth; iWidth; --iWidth, ++pColor, ++pBump ) + *pBump = ( ( pColor->red + pColor->green + pColor->blue ) / nAverager ); + } + } + else + { + for( iHeight=0; iHeightiWinHeight; iHeight++ ) + { + pColor = aColors; for( iWidth=0; iWidthiWinWidth; iWidth++ ) - pBumps->aBumpMap[ ( iHeight * pBumps->iWinWidth ) + iWidth ] = (uint16_) - ( pBumps->SpotLight.nDiameter - ( ( aColors[ iWidth ].red + aColors[ iWidth ].green + aColors[ iWidth ].blue ) / ( 0x2FFFD / (double)pBumps->SpotLight.nDiameter ) ) ); + (pColor++)->pixel = XGetPixel( pScreenImage, iWidth, iHeight ); + + XQueryColors( pBumps->pDisplay, pXWinAttribs->colormap, aColors, pBumps->iWinWidth ); + + pColor = aColors; + for( iWidth=pBumps->iWinWidth; iWidth; --iWidth, ++pColor, ++pBump ) + *pBump = ( maxHeight - ( ( pColor->red + pColor->green + pColor->blue ) / nAverager ) ); + } } XDestroyImage( pScreenImage ); @@ -269,96 +363,157 @@ void InitBumpMap( SBumps *pBumps, XWindowAttributes *pXWinAttribs ) #endif while( nSoften-- ) SoftenBumpMap( pBumps ); + free( aColors ); } - +/* Soften the bump map. This is to avoid pixellated-looking ridges. + * |-----|-----|-----| + * | 0% |12.5%| 0% | The adjacent pixels are averaged together + * |-----|-----|-----| first. Then than value is averaged with + * |12.5%| 50% |12.5%| the pixel is question. This essentially weights + * |-----|-----|-----| each pixel as shown on the left. + * | 0% |12.5%| 0% | + * |-----|-----|-----| + */ void SoftenBumpMap( SBumps *pBumps ) { - uint16_ *pOffset; - uint16_ nHeight; - uint16_ iWidth, iHeight; - uint16_ *pTempBuffer = calloc( pBumps->iWinWidth * pBumps->iWinHeight, sizeof(uint16_) ); - - for( iHeight=1; iHeightiWinHeight-1; iHeight++ ) + uint16_ *pOffset, *pTOffset; + uint32_ nHeight; + uint32_ iWidth, iHeight; + uint16_ *aTempBuffer = malloc( pBumps->iWinWidth * pBumps->iWinHeight * sizeof(uint16_) ); + + pOffset = pBumps->aBumpMap; + pTOffset = aTempBuffer; + for( iHeight=pBumps->iWinHeight; iHeight; --iHeight ) { - pOffset = pBumps->aBumpMap + ( iHeight * pBumps->iWinWidth ); - for( iWidth=1; iWidthiWinWidth-1; iWidth++ ) - { - nHeight = 0; - nHeight += pOffset[ iWidth ]; - nHeight += pOffset[ iWidth - pBumps->iWinWidth ]; - nHeight += pOffset[ iWidth + 1 ]; - nHeight += pOffset[ iWidth + pBumps->iWinWidth ]; - nHeight += pOffset[ iWidth - 1 ]; - nHeight /= 5; - pTempBuffer[ ( iHeight * pBumps->iWinWidth ) + iWidth ] = nHeight; + for( iWidth=pBumps->iWinWidth; iWidth; --iWidth, ++pOffset, ++pTOffset ) + { + if( iHeight==pBumps->iWinHeight || iHeight==1 || + iWidth==pBumps->iWinWidth || iWidth==1 ) + { + *pTOffset = 0; + continue; + } + + nHeight = pOffset[ -pBumps->iWinWidth ]; + nHeight += pOffset[ 1 ]; + nHeight += pOffset[ pBumps->iWinWidth ]; + nHeight += pOffset[ -1 ]; + nHeight >>= 2; + nHeight += pOffset[ 0 ]; + nHeight >>= 1; + *pTOffset = nHeight; } } - - memcpy( pBumps->aBumpMap, pTempBuffer, pBumps->iWinWidth * pBumps->iWinHeight * 2 ); - free( pTempBuffer ); + + memcpy( pBumps->aBumpMap, aTempBuffer, pBumps->iWinWidth * pBumps->iWinHeight * sizeof(uint16_) ); + free( aTempBuffer ); } +/* This is where we slap down some pixels... */ void Execute( SBumps *pBumps ) { - uint16_ nLightXPos, nLightYPos; - uint16_ iWidth, iHeight; - uint16_ iLightWidth, iLightHeight; + int32_ nLightXPos, nLightYPos; + int32_ iScreenX, iScreenY; + int32_ iLightX, iLightY; uint16_ *pBOffset; - uint8_ *pLOffset; - int16_ nX, nY; + int8_ *pDOffset; + int32_ nX, nY; uint16_ nColor; + int32_ nLightOffsetFar = pBumps->SpotLight.nFalloffDiameter - pBumps->SpotLight.nLightRadius; + CalcLightPos( pBumps ); /* Offset to upper left hand corner. */ - nLightXPos = pBumps->SpotLight.nXPos - pBumps->SpotLight.nRadius; - nLightYPos = pBumps->SpotLight.nYPos - pBumps->SpotLight.nRadius; - - for( iHeight=nLightYPos, iLightHeight=0; iLightHeightSpotLight.nDiameter; iHeight++, iLightHeight++ ) + nLightXPos = pBumps->SpotLight.nXPos - pBumps->SpotLight.nFalloffRadius; + nLightYPos = pBumps->SpotLight.nYPos - pBumps->SpotLight.nFalloffRadius; + + for( iScreenY=nLightYPos, iLightY=-pBumps->SpotLight.nLightRadius; iLightYaBumpMap + ( iHeight * pBumps->iWinWidth ); - pLOffset = pBumps->SpotLight.aLightMap + ( iLightHeight * pBumps->SpotLight.nDiameter ); - for( iWidth=nLightXPos, iLightWidth=0; iLightWidthSpotLight.nDiameter; iWidth++, iLightWidth++ ) + if( iScreenY < 0 ) continue; + else if( iScreenY >= pBumps->iWinHeight ) break; + + pDOffset = &pBumps->pXImage->data[ (iLightY+pBumps->SpotLight.nLightRadius) * pBumps->pXImage->bytes_per_line ]; + pBOffset = pBumps->aBumpMap + ( iScreenY * pBumps->iWinWidth ) + nLightXPos; + for( iScreenX=nLightXPos, iLightX=-pBumps->SpotLight.nLightRadius; iLightXbytesPerPixel ) { - if( pLOffset[ iLightWidth ] ) - { - nX = pBOffset[ iWidth + 1 ] - pBOffset[ iWidth ] + iLightWidth; - nY = pBOffset[ iWidth + pBumps->iWinWidth ] - pBOffset[ iWidth ] + iLightHeight; - - if( nX < 0 ) nX = 0; - else if( nX >= pBumps->SpotLight.nDiameter ) nX = pBumps->SpotLight.nDiameter - 1; - - if( nY < 0 ) nY = 0; - else if( nY >= pBumps->SpotLight.nDiameter ) nY = pBumps->SpotLight.nDiameter - 1; - - nColor = pBumps->SpotLight.aLightMap[ ( nY * pBumps->SpotLight.nDiameter ) + nX ]; - if( nColor >= pBumps->nColorCount ) - nColor = 1; - - if( pLOffset[ iLightWidth ] >= pBumps->nColorCount ) - if( nColor > pLOffset[ iLightWidth ] - pBumps->nColorCount ) - nColor = pLOffset[ iLightWidth ] - pBumps->nColorCount; - - XPutPixel( pBumps->pXImage, iWidth, iHeight, pBumps->aXColors[ nColor ].pixel ); + if( iScreenX < 0 ) continue; + else if( iScreenX >= pBumps->iWinWidth ) break; + else if( iScreenY == 0 || iScreenY >= pBumps->iWinHeight-2 || + iScreenX == 0 || iScreenX >= pBumps->iWinWidth-2 ) + { + MyPutPixel( pDOffset, pBumps->aColors[ 0 ] ); + continue; } - else - XPutPixel( pBumps->pXImage, iWidth, iHeight, pBumps->aXColors[ 0 ].pixel ); + + /* That's right folks, all the magic of bump mapping occurs in these two lines. (kinda disappointing, isn't it?) */ + nX = ( pBOffset[ 1 ] - pBOffset[ 0 ] ) + iLightX; + nY = ( pBOffset[ pBumps->iWinWidth ] - pBOffset[ 0 ] ) + iLightY; + + if( nX<0 || nX>=pBumps->SpotLight.nLightDiameter + || nY<0 || nY>=pBumps->SpotLight.nLightDiameter ) + { + MyPutPixel( pDOffset, pBumps->aColors[ 0 ] ); + continue; + } + + nColor = pBumps->SpotLight.aLightMap[ ( nY * pBumps->SpotLight.nLightDiameter ) + nX ]; + MyPutPixel( pDOffset, pBumps->aColors[ nColor ] ); } } - XPutImage( pBumps->pDisplay, pBumps->Win, pBumps->GraphicsContext, pBumps->pXImage, nLightXPos, nLightYPos, nLightXPos, nLightYPos, pBumps->SpotLight.nDiameter, pBumps->SpotLight.nDiameter ); + /* Allow the spotlight to go *slightly* off the screen by clipping the XImage. */ + iLightX = iLightY = 0; /* Use these for XImages X and Y now. */ + nX = nY = pBumps->SpotLight.nFalloffDiameter; /* Use these for XImage width and height now. */ + if( nLightXPos < 0 ) + { + iLightX = -nLightXPos; + nX -= iLightX; + nLightXPos = 0; + } + else if( nLightXPos + nX >= pBumps->iWinWidth ) + { + nX -= ( nLightXPos + nX ) - pBumps->iWinWidth; + } + + if( nLightYPos < 0 ) + { + iLightY = -nLightYPos; + nY -= iLightY; + nLightYPos = 0; + } + else if( nLightYPos + nY >= pBumps->iWinHeight ) + { + nY -= ( nLightYPos + nY ) - pBumps->iWinHeight; + } + +#ifdef HAVE_XSHM_EXTENSION + if( pBumps->bUseShm ) + XShmPutImage( pBumps->pDisplay, pBumps->Win, pBumps->GraphicsContext, pBumps->pXImage, iLightX, iLightY, nLightXPos, nLightYPos, + nX, nY, False); + else +#endif /* HAVE_XSHM_EXTENSION */ + XPutImage( pBumps->pDisplay, pBumps->Win, pBumps->GraphicsContext, pBumps->pXImage, iLightX, iLightY, nLightXPos, nLightYPos, + nX, nY ); + XSync( pBumps->pDisplay, False ); } +/* Clean up */ void DestroyBumps( SBumps *pBumps ) { DestroySpotLight( &pBumps->SpotLight ); - free( pBumps->aXColors ); + free( pBumps->aColors ); free( pBumps->aBumpMap ); - XDestroyImage( pBumps->pXImage ); +#ifdef HAVE_XSHM_EXTENSION + if( pBumps->bUseShm ) + destroy_xshm_image( pBumps->pDisplay, pBumps->pXImage, &pBumps->XShmInfo ); + else +#endif /* HAVE_XSHM_EXTENSION */ + XDestroyImage( pBumps->pXImage ); } diff --git a/hacks/bumps.h b/hacks/bumps.h index 120be961..7c249bb0 100644 --- a/hacks/bumps.h +++ b/hacks/bumps.h @@ -18,6 +18,9 @@ * [10/01/99] - Shane Smit: Creation * [10/08/99] - Shane Smit: Port to C. (Ick) * [03/08/02] - Shane Smit: New movement code. + * [09/12/02] - Shane Smit: MIT-SHM XImages. + * Thanks to Kennett Galbraith + * for code optimization. */ @@ -29,6 +32,10 @@ #include "screenhack.h" #include +#ifdef HAVE_XSHM_EXTENSION +#include "xshm.h" +#endif /* HAVE_XSHM_EXTENSION */ + /* Defines: */ /* #define VERBOSE */ @@ -51,12 +58,15 @@ char *defaults [] = { ".foreground: white", "*color: random", "*colorcount: 64", - "*delay: 50000", + "*delay: 30000", "*soften: 1", "*invert: FALSE", #ifdef __sgi /* really, HAVE_READ_DISPLAY_EXTENSION */ - "*visualID: Best", + "*visualID: Best", #endif +#ifdef HAVE_XSHM_EXTENSION + "*useSHM: True", +#endif /* HAVE_XSHM_EXTENSION */ 0 }; @@ -66,6 +76,11 @@ XrmOptionDescRec options [] = { { "-delay", ".delay", XrmoptionSepArg, 0 }, { "-soften", ".soften", XrmoptionSepArg, 0 }, { "-invert", ".invert", XrmoptionNoArg, "TRUE" }, +#ifdef HAVE_XSHM_EXTENSION + { "-shm", ".useSHM", XrmoptionNoArg, "True" }, + { "-no-shm", ".useSHM", XrmoptionNoArg, "False" }, +#endif /* HAVE_XSHM_EXTENSION */ + { 0, 0, 0, 0 } }; @@ -75,7 +90,8 @@ XrmOptionDescRec options [] = { typedef struct { uint8_ *aLightMap; - uint16_ nDiameter, nRadius; + uint16_ nFalloffDiameter, nFalloffRadius; + uint16_ nLightDiameter, nLightRadius; float nAccelX, nAccelY; float nAccelMax; float nVelocityX, nVelocityY; @@ -95,10 +111,15 @@ typedef struct Display *pDisplay; Window Win; GC GraphicsContext; - XColor *aXColors; + uint32_ *aColors; XImage *pXImage; +#ifdef HAVE_XSHM_EXTENSION + XShmSegmentInfo XShmInfo; + Bool bUseShm; +#endif /* HAVE_XSHM_EXTENSION */ uint8_ nColorCount; /* Number of colors used. */ + uint8_ bytesPerPixel; uint16_ iWinWidth, iWinHeight; uint16_ *aBumpMap; /* The actual bump map. */ diff --git a/hacks/compile_axp.com b/hacks/compile_axp.com index d1703538..1e2b5747 100644 --- a/hacks/compile_axp.com +++ b/hacks/compile_axp.com @@ -35,6 +35,7 @@ $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) GOOP.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) GRAV.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) GREYNETIC.C +$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) HALFTONE.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) HALO.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) HELIX.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) HOPALONG.C diff --git a/hacks/compile_decc.com b/hacks/compile_decc.com index d1703538..1e2b5747 100644 --- a/hacks/compile_decc.com +++ b/hacks/compile_decc.com @@ -35,6 +35,7 @@ $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) GOOP.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) GRAV.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) GREYNETIC.C +$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) HALFTONE.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) HALO.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) HELIX.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) HOPALONG.C diff --git a/hacks/config/README b/hacks/config/README index 55ca4f8b..e6f95227 100644 --- a/hacks/config/README +++ b/hacks/config/README @@ -4,8 +4,8 @@ a screen saver and locker for the X window system by Jamie Zawinski - version 4.05 - 11-Jun-2002 + version 4.06 + 23-Oct-2002 http://www.jwz.org/xscreensaver/ diff --git a/hacks/config/atlantis.xml b/hacks/config/atlantis.xml index 914fd214..44c5a6ff 100644 --- a/hacks/config/atlantis.xml +++ b/hacks/config/atlantis.xml @@ -10,7 +10,7 @@ - + + + - - - + + + - - - - - + + + + + + - <_description> BSOD stands for ``Blue Screen of Death.'' The finest in personal diff --git a/hacks/config/bumps.xml b/hacks/config/bumps.xml index aaf80753..7333cbaf 100644 --- a/hacks/config/bumps.xml +++ b/hacks/config/bumps.xml @@ -10,7 +10,7 @@ diff --git a/hacks/config/glblur.xml b/hacks/config/glblur.xml new file mode 100644 index 00000000..c8c8aff6 --- /dev/null +++ b/hacks/config/glblur.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + <_description> +This program draws a box and a few line segments, and generates a +radial blur outward from it. This creates flowing field effects. + +This is done by rendering the scene into a small texture, then +repeatedly rendering increasingly-enlarged and increasingly-transparent +versions of that texture onto the frame buffer. As such, it's quite +graphics intensive: don't bother trying to run this if you don't have +hardware-accelerated OpenGL texture support. It will hurt your machine bad. + + diff --git a/hacks/config/greynetic.xml b/hacks/config/greynetic.xml index dd017856..23916908 100644 --- a/hacks/config/greynetic.xml +++ b/hacks/config/greynetic.xml @@ -6,7 +6,7 @@ <_description> diff --git a/hacks/config/halftone.xml b/hacks/config/halftone.xml new file mode 100644 index 00000000..df19d3a3 --- /dev/null +++ b/hacks/config/halftone.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + <_description> +Draws the gravity force in each point on the screen seen through a +halftone dot pattern. The gravity force is calculated from a set of +moving mass points. View it from a distance for best effect. Written +by Peter Jaric <peter@jaric.org>. + + + diff --git a/hacks/config/lavalite.xml b/hacks/config/lavalite.xml index 68011be4..5e900395 100644 --- a/hacks/config/lavalite.xml +++ b/hacks/config/lavalite.xml @@ -22,6 +22,7 @@ low="10" high="120" default="40"/> +