xdiskusage-1.48/0040755000076500007650000000000010123736043013566 5ustar spitzakspitzakxdiskusage-1.48/README0100644000076500007650000001604607727551767014502 0ustar spitzakspitzakxdiskusage Version 1.46 ---------------------------------------------------------------- How to compile xdiskusage: ---------------------------------------------------------------- You need fltk. If you do not have it yet, download it from http://www.fltk.org, and compile and install it. You can also use the CVS version of fltk2 located on the same site. Type "./configure" (not necessary if you have gmake) Type "make" Test it by typing "./xdiskusage" Become superuser and type "make install" If you wish to edit the code, type "make depend" ---------------------------------------------------------------- How to use xdiskusage: ---------------------------------------------------------------- Typing "xdiskusage dir" where "dir" is a folder causes "du" to be run on that folder and the result displayed. If the named file is a symbolic link it is dereferenced before being sent to du. The "-a" switch, if given, is passed to "du" to cause all files to be measured. Typing "xdiskusage file" where "file" is not a folder makes xdiskusage parse that file as though it was "du" output and display the result. You can type several file and folder names and get several display windows. If no files are named, you can pipe the output from another program to xdiskusage. If stdin is not a terminal xdiskusage will parse it as "du" output and display the result. For instance "du -k . | xdiskusage". Typing just "xdiskusage" brings up the disk browser described here: ---------------------------------------------------------------- How to use the Disk Browser ---------------------------------------------------------------- By default xdiskusage presents you with a list of all the disks mounted on your system (it found these by running "df"). Click one of these names and it will scan the entire disk (by running "du") and present a graphical display of how much space all the files are taking on that disk. You can click on several disks (or on the same disk multiple times, for instance if you have changed the files stored on it) and get multiple display windows. The "rescan" button reruns "df" to get a new list of disks. You need to do this if you mount or unmount a disk, or to see new usage percentages. The (C) button shows you the copyright and license. You can type a filename into the input field on the bottom and type Enter. If the name is a folder, xdiskusage will attempt to run "du" on it and display the result. If the name is a file it is assummed to be "du" output and it is parsed and displayed. The "all files" button sends the -a switch to "du" causing it to list the space for every file on the disk. This can significantly increase the time it takes to scan. ---------------------------------------------------------------- How to use the Display ---------------------------------------------------------------- Each white box represents a folder. It's size is equal to the sum of all it's contents (all sub-folders and files). To the right of each box are stacked the boxes for the sub-folders (and files if the "all files" switch was given). If you selected a disk from the disk browser, some extra boxes are added to show information learned from df: "(free)" is the free space reported by df. "(permission denied)" is space that df said was used but du did not report. Besides permission errors when running du, this may also be the result of a file deleted from its containing folder, but still in use by a program, so its space is not reclaimed yet. Mounted loopback filesystems (ISO image just checked before burning, then deleted while still mounted) are common examples. "(inodes)" is the difference between the total size of the disk and the used + available space reported by du, this is overhead used by the file system. The left-most box is the "current root". One of the boxes is outlined in red, this is the "current node". Clicking on any box makes it the current node. The arrow keys can also be used to navigate you around. Hitting return makes the current node be the current root: putting it on the left edge and blowing it up to the height of the window and scaling all it's contents the same. The left arrow can be used to move the root and current node back up, or you can type '/' to move just the root, leaving the current node where it is. To dismiss any window type Escape. ---------------------------------------------------------------- Menu Items: ---------------------------------------------------------------- There is a pop-up menu on the right-hand mouse button. Every item on the menu has a keyboard shortcut. The menu items are: In (right arrow): go to the first child of the current folder. Next (down arrow): go down to brother of current folder. Previous (up arrow): go up to the brother of current folder. Out (left arrow): go to parent of current folder. Root out (slash): move the root of the window up to it's parent. Hide (h): remove this node from the display and scale rest up to fit Unhide (H): Recursivly turn off the hide flag from all children Sort/Largest (s): sort largest size at the top Sort/Smallest (r): sort smallest size at the top Sort/Alphabetical (a): sort in alphabetical order Sort/Reverse Alphabetical (z): sort in backwards alphabetical order Sort/Unsorted (u): sort in the order read from du. Columns/2-11 (2-9,0,1): arrange display to have N columns. Copy to Clipboard (c): the pathname of the current node is put in the X clipboard (you can then paste it into a shell command). Print (p): The current display is printed. The output is Encapsulated PostScript. It will either run it through lpr (or any command you choose) or send it to a file. ---------------------------------------------------------------- Acknowledgements ---------------------------------------------------------------- This program was inspired by, and the user interface design copied from, the "xdu" program written by Phillip C. Dykstra. Stephane Gourichon contributed many suggested improvements. ---------------------------------------------------------------- Copyright (C) 2003 Bill Spitzak ---------------------------------------------------------------- This program 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 (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. Written by Bill Spitzak spitzak at dee two dot com ---------------------------------------------------------------- END ---------------------------------------------------------------- xdiskusage-1.48/Makefile0100644000076500007650000000315210123735003015217 0ustar spitzakspitzakSHELL=/bin/sh PROGRAM = xdiskusage VERSION = 1.48 CXXFILES = panels.C xdiskusage.C # You may need this to link with a shared version of fltk: LIBS = MANPAGE = 1 ################################################################ OBJECTS = $(CXXFILES:.C=.o) all: $(PROGRAM) $(PROGRAM) : $(OBJECTS) $(CXX) $(LDFLAGS) -o $(PROGRAM) $(OBJECTS) $(LIBS) $(LDLIBS) makeinclude: configure ./configure include makeinclude .SUFFIXES : .fl .do .C .c .H .C.o : $(CXX) $(CXXFLAGS) -c $< .C : $(CXX) $(CXXFLAGS) -c $< .fl.C : -fluid -c $< .fl.H : -fluid -c $< clean : -@ rm -f *.o $(PROGRAM) $(CLEAN) core *~ makedepend @touch makedepend depend: $(MAKEDEPEND) -I.. $(CXXFLAGS) $(CXXFILES) $(CFILES) > makedepend makedepend: touch makedepend include makedepend install: $(PROGRAM) $(INSTALL) -s $(PROGRAM) $(bindir)/$(PROGRAM) $(INSTALL) $(PROGRAM).$(MANPAGE) $(mandir)/man$(MANPAGE)/$(PROGRAM).$(MANPAGE) uninstall: -@ rm -f $(bindir)/$(PROGRAM) -@ rm -f $(mandir)/man$(MANPAGE)/$(PROGRAM).$(MANPAGE) dist: cat /dev/null > makedepend -@mkdir $(PROGRAM)-$(VERSION) -@ln README Makefile configure install-sh makedepend *.C *.H *.in *.fl $(PROGRAM).spec $(PROGRAM).$(MANPAGE) $(PROGRAM)-$(VERSION) tar -cvzf $(PROGRAM)-$(VERSION).tgz $(PROGRAM)-$(VERSION) -@rm -r $(PROGRAM)-$(VERSION) ################################################################ PROGRAM_D = $(PROGRAM)_d debug: $(PROGRAM_D) OBJECTS_D = $(CXXFILES:.C=.do) $(CFILES:.c=.do) .C.do : $(CXX) $(CXXFLAGS_D) -c -o $@ $< .c.do : $(CC) $(CFLAGS_D) -c -o $@ $< $(PROGRAM_D) : $(OBJECTS_D) $(CXX) $(LDFLAGS_D) -o $(PROGRAM_D) $(OBJECTS_D) $(LIBS) $(LDLIBS) xdiskusage-1.48/configure0100755000076500007650000020271206645726461015517 0ustar spitzakspitzak#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.12 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help --with-x use the X Window System" # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.12" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=xdiskusage.C # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:527: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:556: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" ac_prog_rejected=no for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" break fi done IFS="$ac_save_ifs" if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$ac_dir/$ac_word" "$@" shift ac_cv_prog_CC="$@" fi fi fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:604: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else ac_cv_prog_cc_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_works=no fi rm -fr conftest* echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:638: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 echo "configure:643: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 echo "configure:667: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ac_cv_prog_cc_g=yes else ac_cv_prog_cc_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 if test "$ac_test_CFLAGS" = set; then CFLAGS="$ac_save_CFLAGS" elif test $ac_cv_prog_cc_g = yes; then CFLAGS="-g -O2" else CFLAGS="-O2" fi else GCC= test "${CFLAGS+set}" = set || CFLAGS="-g" fi for ac_prog in $CCC c++ g++ gcc CC cxx cc++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:699: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CXX="$ac_prog" break fi done IFS="$ac_save_ifs" fi fi CXX="$ac_cv_prog_CXX" if test -n "$CXX"; then echo "$ac_t""$CXX" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$CXX" && break done test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:730: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cxx_cross=no else ac_cv_prog_cxx_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cxx_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:770: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 echo "configure:775: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.C <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no fi fi echo "$ac_t""$ac_cv_prog_gxx" 1>&6 if test $ac_cv_prog_gxx = yes; then GXX=yes ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 echo "configure:799: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.cc if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then ac_cv_prog_cxx_g=yes else ac_cv_prog_cxx_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS="$ac_save_CXXFLAGS" elif test $ac_cv_prog_cxx_g = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-O2" fi else GXX= test "${CXXFLAGS+set}" = set || CXXFLAGS="-g" fi ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:856: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. for ac_prog in ginstall installbsd scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. # OSF/1 installbsd also uses dspmsg, but is usable. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:907: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi echo "$ac_t""$CPP" 1>&6 # If we find X, set shell vars x_includes and x_libraries to the # paths, otherwise set no_x=yes. # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 echo "configure:972: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then withval="$with_x" : fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then # Both variables are already set. have_x=yes else if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=NO ac_x_libraries=NO rm -fr conftestdir if mkdir conftestdir; then cd conftestdir # Make sure to not put "make" in the Imakefile rules, since we grep it out. cat > Imakefile <<'EOF' acfindx: @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' EOF if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl; do if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && test -f $ac_im_libdir/libX11.$ac_extension; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case "$ac_im_incroot" in /usr/include) ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;; esac case "$ac_im_usrlibdir" in /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;; esac fi cd .. rm -fr conftestdir fi if test "$ac_x_includes" = NO; then # Guess where to find include files, by looking for this one X11 .h file. test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1039: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* # We can compile using X headers with no special include directory. ac_x_includes= else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* # Look for the header file in a standard set of common directories. # Check X11 before X11Rn because it is often a symlink to the current release. for ac_dir in \ /usr/X11/include \ /usr/X11R6/include \ /usr/X11R5/include \ /usr/X11R4/include \ \ /usr/include/X11 \ /usr/include/X11R6 \ /usr/include/X11R5 \ /usr/include/X11R4 \ \ /usr/local/X11/include \ /usr/local/X11R6/include \ /usr/local/X11R5/include \ /usr/local/X11R4/include \ \ /usr/local/include/X11 \ /usr/local/include/X11R6 \ /usr/local/include/X11R5 \ /usr/local/include/X11R4 \ \ /usr/X386/include \ /usr/x386/include \ /usr/XFree86/include/X11 \ \ /usr/include \ /usr/local/include \ /usr/unsupported/include \ /usr/athena/include \ /usr/local/x11r5/include \ /usr/lpp/Xamples/include \ \ /usr/openwin/include \ /usr/openwin/share/include \ ; \ do if test -r "$ac_dir/$x_direct_test_include"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest* fi # $ac_x_includes = NO if test "$ac_x_libraries" = NO; then # Check for the libraries. test -z "$x_direct_test_library" && x_direct_test_library=Xt test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. ac_x_libraries= else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* LIBS="$ac_save_LIBS" # First see if replacing the include by lib works. # Check X11 before X11Rn because it is often a symlink to the current release. for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ /usr/X11/lib \ /usr/X11R6/lib \ /usr/X11R5/lib \ /usr/X11R4/lib \ \ /usr/lib/X11 \ /usr/lib/X11R6 \ /usr/lib/X11R5 \ /usr/lib/X11R4 \ \ /usr/local/X11/lib \ /usr/local/X11R6/lib \ /usr/local/X11R5/lib \ /usr/local/X11R4/lib \ \ /usr/local/lib/X11 \ /usr/local/lib/X11R6 \ /usr/local/lib/X11R5 \ /usr/local/lib/X11R4 \ \ /usr/X386/lib \ /usr/x386/lib \ /usr/XFree86/lib/X11 \ \ /usr/lib \ /usr/local/lib \ /usr/unsupported/lib \ /usr/athena/lib \ /usr/local/x11r5/lib \ /usr/lpp/Xamples/lib \ /lib/usr/lib/X11 \ \ /usr/openwin/lib \ /usr/openwin/share/lib \ ; \ do for ac_extension in a so sl; do if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f conftest* fi # $ac_x_libraries = NO if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then # Didn't find X anywhere. Cache the known absence of X. ac_cv_have_x="have_x=no" else # Record where we found X for the cache. ac_cv_have_x="have_x=yes \ ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" fi fi fi eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then echo "$ac_t""$have_x" 1>&6 no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes \ ac_x_includes=$x_includes ac_x_libraries=$x_libraries" echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6 fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. cat >> confdefs.h <<\EOF #define X_DISPLAY_MISSING 1 EOF X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 echo "configure:1221: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_nospace=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_R_nospace=no fi rm -f conftest* if test $ac_R_nospace = yes; then echo "$ac_t""no" 1>&6 X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_space=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_R_space=no fi rm -f conftest* if test $ac_R_space = yes; then echo "$ac_t""yes" 1>&6 X_LIBS="$X_LIBS -R $x_libraries" else echo "$ac_t""neither works" 1>&6 fi fi LIBS="$ac_xsave_LIBS" esac fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 echo "configure:1286: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" else echo "$ac_t""no" 1>&6 fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 echo "configure:1327: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" else echo "$ac_t""no" 1>&6 fi fi # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 echo "configure:1375: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) choke me #else gethostbyname(); #endif ; return 0; } EOF if { (eval echo configure:1403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_gethostbyname=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 fi if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 echo "configure:1424: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" else echo "$ac_t""no" 1>&6 fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says simon@lia.di.epfl.ch: it contains # gethostby* variants that don't use the nameserver (or something). # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 echo "configure:1473: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char connect(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_connect) || defined (__stub___connect) choke me #else connect(); #endif ; return 0; } EOF if { (eval echo configure:1501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_connect=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_connect=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 fi if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 echo "configure:1522: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" else echo "$ac_t""no" 1>&6 fi fi # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 echo "configure:1565: checking for remove" >&5 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char remove(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_remove) || defined (__stub___remove) choke me #else remove(); #endif ; return 0; } EOF if { (eval echo configure:1593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_remove=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_remove=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 fi if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 echo "configure:1614: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" else echo "$ac_t""no" 1>&6 fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 echo "configure:1657: checking for shmat" >&5 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shmat(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shmat) || defined (__stub___shmat) choke me #else shmat(); #endif ; return 0; } EOF if { (eval echo configure:1685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_shmat=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 fi if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 echo "configure:1706: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lipc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" else echo "$ac_t""no" 1>&6 fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS="$LDFLAGS" test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 echo "configure:1758: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lICE $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" else echo "$ac_t""no" 1>&6 fi LDFLAGS="$ac_save_LDFLAGS" fi echo "Ignoring libraries \"$X_PRE_LIBS\" requested by configure." LIBS="$LIBS$X_LIBS" MAKEDEPEND="\$(CXX) -M" if test -n "$GXX"; then # GNU C compiler CFLAGS="-Wall -O2" CFLAGS_D="-Wall -g -DDEBUG" CXXFLAGS="-Wall -O2" CXXFLAGS_D="-Wall -g -DDEBUG" else if test "`(uname) 2>/dev/null`" = IRIX; then if expr "`(uname -r)`" \>= 6.2; then # turn on new "n32" Irix compiler: CXX="CC -n32" CC="cc -n32" LD="ld -n32" # but -M is broken so use old compiler: MAKEDEPEND="CC -M" CFLAGS="-fullwarn -O2" CFLAGS_D="-fullwarn -gslim -DDEBUG" CXXFLAGS="-fullwarn -O2" CXXFLAGS_D="-fullwarn -gslim -DDEBUG" else # old Irix compiler: CFLAGS="-O2" CFLAGS_D="-g -DDEBUG" CXXFLAGS="+w +pp -O2" CXXFLAGS_D="+w +pp -g -DDEBUG" fi else # generic C compiler: CFLAGS="-O" CFLAGS_D="-g -DDEBUG" CXXFLAGS="-O" CXXFLAGS_D="-g -DDEBUG" fi fi trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. cat > conftest.defs <<\EOF s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g s%\[%\\&%g s%\]%\\&%g s%\$%$$%g EOF DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` rm -f conftest.defs # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS </dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.12" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "makeinclude" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@CC@%$CC%g s%@CXX@%$CXX%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@CPP@%$CPP%g s%@X_CFLAGS@%$X_CFLAGS%g s%@X_PRE_LIBS@%$X_PRE_LIBS%g s%@X_LIBS@%$X_LIBS%g s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g s%@MAKEDEPEND@%$MAKEDEPEND%g s%@CFLAGS_D@%$CFLAGS_D%g s%@CXXFLAGS_D@%$CXXFLAGS_D%g CEOF EOF cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac case "$ac_given_INSTALL" in [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 xdiskusage-1.48/install-sh0100644000076500007650000001124406561746515015606 0ustar spitzakspitzak#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" tranformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 xdiskusage-1.48/makedepend0100644000076500007650000000000010123736043015571 0ustar spitzakspitzakxdiskusage-1.48/panels.C0100644000076500007650000001217107612714476015172 0ustar spitzakspitzak// generated by Fast Light User Interface Designer (fluid) version 1.0011 #include "panels.H" Fl_Window *disk_chooser=(Fl_Window *)0; Fl_Browser *disk_browser=(Fl_Browser *)0; Fl_Input *disk_input=(Fl_Input *)0; static void cb_browser(Fl_Button*, void*) { const char* c = fl_file_chooser("Directory:", 0, disk_input->value()); if (c) disk_input->value(c); } Fl_Check_Button *all_files_button=(Fl_Check_Button *)0; Fl_Window* make_diskchooser() { Fl_Window* w; { Fl_Window* o = disk_chooser = new Fl_Window(404, 252, "Disk Usage Display"); w = o; { Fl_Button* o = new Fl_Button(290, 10, 65, 20, "reload"); o->callback((Fl_Callback*)reload_cb); } { Fl_Button* o = new Fl_Button(365, 10, 25, 20, "\251"); o->labelsize(18); o->callback((Fl_Callback*)copyright_cb); } { Fl_Browser* o = disk_browser = new Fl_Browser(15, 30, 375, 150, "Pick a disk:"); o->type(2); o->callback((Fl_Callback*)disk_browser_cb); o->align(FL_ALIGN_TOP_LEFT); Fl_Group::current()->resizable(o); static int widths[] = {200,0}; o->column_widths(widths); } { Fl_Input* o = disk_input = new Fl_Input(15, 200, 335, 25, "Or type pathname in and hit Enter:"); o->callback((Fl_Callback*)disk_input_cb); o->align(FL_ALIGN_TOP_LEFT); o->when(FL_WHEN_ENTER_KEY_ALWAYS); o->value("/"); } { Fl_Button* o = new Fl_Button(350, 200, 40, 25, "browser"); o->labelsize(8); o->callback((Fl_Callback*)cb_browser); } { Fl_Check_Button* o = new Fl_Check_Button(15, 225, 185, 25, "measure directories only"); o->type(102); o->down_box(FL_DIAMOND_DOWN_BOX); o->value(1); } { Fl_Check_Button* o = all_files_button = new Fl_Check_Button(190, 225, 145, 25, "measure all files"); o->type(102); o->down_box(FL_DIAMOND_DOWN_BOX); } o->end(); } return w; } Fl_Window *wait_window=(Fl_Window *)0; Fl_Slider *wait_slider=(Fl_Slider *)0; Fl_Window* make_wait_window() { Fl_Window* w; { Fl_Window* o = wait_window = new Fl_Window(229, 100); w = o; w->hotspot(o); { Fl_Slider* o = wait_slider = new Fl_Slider(10, 25, 205, 25, "Reading disk:"); o->type(3); o->color(12); o->selection_color(47); o->align(FL_ALIGN_TOP_LEFT); Fl_Group::current()->resizable(o); o->set_output(); } { Fl_Button* o = new Fl_Button(70, 60, 80, 25, "Cancel"); o->shortcut(0xff1b); o->callback((Fl_Callback*)cancel_cb); } o->set_modal(); o->end(); } return w; } Fl_Window *print_panel=(Fl_Window *)0; Fl_Input *print_command_input=(Fl_Input *)0; Fl_Light_Button *print_file_button=(Fl_Light_Button *)0; Fl_Input *print_file_input=(Fl_Input *)0; static void cb_browser1(Fl_Button*, void*) { const char* c = fl_file_chooser("Print to:", "*.ps", print_file_input->value()); if (c) print_file_input->value(c); } Fl_Check_Button *print_portrait_button=(Fl_Check_Button *)0; Fl_Check_Button *fill_page_button=(Fl_Check_Button *)0; Fl_Return_Button *print_ok_button=(Fl_Return_Button *)0; static void cb_Cancel(Fl_Button* o, void*) { o->window()->hide(); } Fl_Window* make_print_panel() { Fl_Window* w; { Fl_Window* o = print_panel = new Fl_Window(345, 173, "Print"); w = o; w->hotspot(o); { Fl_Box* o = new Fl_Box(10, 5, 85, 25, "Print to:"); o->labelfont(1); o->labelsize(18); o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); } { Fl_Light_Button* o = new Fl_Light_Button(10, 35, 75, 25, "printer"); o->type(102); o->value(1); } { Fl_Input* o = print_command_input = new Fl_Input(85, 35, 250, 25); o->value("lpr"); } { Fl_Light_Button* o = print_file_button = new Fl_Light_Button(10, 65, 75, 25, "file"); o->type(102); } { Fl_Input* o = print_file_input = new Fl_Input(85, 65, 215, 25); o->value("xdiskusage.ps"); } { Fl_Button* o = new Fl_Button(300, 65, 36, 25, "browser"); o->labelsize(8); o->callback((Fl_Callback*)cb_browser1); } { Fl_Group* o = new Fl_Group(10, 90, 325, 35); o->align(FL_ALIGN_LEFT); { Fl_Check_Button* o = print_portrait_button = new Fl_Check_Button(10, 90, 80, 25, "portrait"); o->type(102); o->down_box(FL_DIAMOND_DOWN_BOX); o->value(1); } { Fl_Check_Button* o = new Fl_Check_Button(90, 90, 100, 25, "landscape"); o->type(102); o->down_box(FL_DIAMOND_DOWN_BOX); } o->end(); } { Fl_Group* o = new Fl_Group(10, 110, 330, 45); o->align(FL_ALIGN_LEFT); { Fl_Check_Button* o = fill_page_button = new Fl_Check_Button(10, 115, 150, 25, "reshape to fill page"); o->type(102); o->down_box(FL_DIAMOND_DOWN_BOX); o->value(1); } { Fl_Check_Button* o = new Fl_Check_Button(160, 115, 175, 25, "same shape as window"); o->type(102); o->down_box(FL_DIAMOND_DOWN_BOX); } o->end(); } print_ok_button = new Fl_Return_Button(175, 140, 75, 25, "OK"); { Fl_Button* o = new Fl_Button(260, 140, 75, 25, "Cancel"); o->shortcut(0xff1b); o->callback((Fl_Callback*)cb_Cancel); } o->set_modal(); o->end(); } return w; } xdiskusage-1.48/xdiskusage.C0100644000076500007650000007641110123735302016044 0ustar spitzakspitzak// xdiskusage.C const char* copyright = "xdiskusage version 1.48\n" "Copyright (C) 2004 Bill Spitzak\n" "Based on xdu by Phillip C. Dykstra\n" "\n" "This program 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 " "(at your option) any later version.\n" "\n" "This program is distributed in the hope that it will be useful, " "but WITHOUT ANY WARRANTY; without even the implied warranty of " "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the " "GNU General Public License for more details.\n" "\n" "You should have received a copy of the GNU General Public License " "along with this software; if not, write to the Free Software " "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 " "USA."; #if defined(__hpux) # define DF_COMMAND "df -P" # define DU_COMMAND "du -kx" #elif defined(__bsdi__) # define DF_COMMAND "df" # define DU_COMMAND "du -x" #elif defined(SVR4) || defined(__sun) # define DF_COMMAND "df -k" # define DU_COMMAND "du -kd" #else // linux and irix # define DF_COMMAND "df -k" # define DU_COMMAND "du -kx" #endif #include #include #include #include #include #include #include #include "panels.H" #include #include #include #include #include typedef unsigned long ulong; // turn number of K into user-friendly text: const char* formatk(ulong k) { static char buffer[10]; if (k >= 1024*1024) sprintf(buffer,"%.4gG",(double)k/(1024*1024)); else if (k >= 1024) sprintf(buffer,"%.4gM",(double)k/1024); else sprintf(buffer,"%ldK",k); return buffer; } // Holds data read from 'df' for each disk struct Disk { const char* mount; ulong total; ulong used; ulong avail; Disk* next; }; Disk* firstdisk; // Run 'df' and create a list of Disk structures, fill in browser: void reload_cb(Fl_Button*, void*) { FILE* f = popen(DF_COMMAND, "r"); if (!f) { fprintf(stderr,"Can't run df, %s\n", strerror(errno)); exit(1); } Disk** pointer = &firstdisk; for (;;) { char buffer[1024]; if (!fgets(buffer, 1024, f)) break; int n = 0; // number of words char* word[10]; // pointer to each word for (char* p = buffer; n < 10;) { // skip leading whitespace: while (*p && isspace(*p)) p++; if (!*p) break; // skip over the word: word[n++] = p; while (*p && !isspace(*p)) p++; if (!*p) break; *p++ = 0; } if (n < 5 || word[n-1][0] != '/') continue; // ok we found a line with a /xyz at the end: Disk* d = new Disk; d->mount = strdup(word[n-1]); d->total = strtol(word[n-5],0,10); d->used=strtol(word[n-4],0,10); d->avail=strtol(word[n-3],0,10); *pointer = d; d->next = 0; pointer = &d->next; } pclose(f); if (!firstdisk) { fl_alert("Something went wrong with df, no disks found."); } else { disk_browser->clear(); } for (Disk* d = firstdisk; d; d = d->next) { char buf[512]; int pct; ulong sum = d->used + d->avail; if (!sum) { pct = 0; } else { pct = int((d->used*100+d->used/2)/sum); if (!pct && d->used) pct = 1; } #if FL_MAJOR_VERSION > 1 sprintf(buf, "@b;%s\t@n;%s %2d%% full", d->mount, formatk(d->total), pct); #else sprintf(buf, "@b%s\t@r%s %2d%%", d->mount, formatk(d->total), pct); #endif disk_browser->add(buf); } disk_browser->position(0); #if FL_MAJOR_VERSION > 1 disk_browser->deselect(); #endif } Fl_Window *copyright_window; void copyright_cb(Fl_Button*, void*) { if (!copyright_window) { copyright_window = new Fl_Window(400,270,"about xdiskusage"); copyright_window->color(FL_WHITE); Fl_Box *b = new Fl_Box(10,0,380,270,copyright); #ifdef FL_NORMAL_SIZE b->labelsize(12); #endif b->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_WRAP); copyright_window->resizable(b); copyright_window->end(); } copyright_window->hotspot(copyright_window); copyright_window->set_non_modal(); copyright_window->show(); } //////////////////////////////////////////////////////////////// struct Node { Node* child; Node* brother; const char* name; ulong size; long ordinal; // sign bit indicates hidden bool hidden() const {return ordinal < 0;} }; // default sizes of new windows, changed by user actions on other windows: int window_w = 600; int window_h = 480; int ncols = 5; #define MAXDEPTH 100 class OutputWindow : public Fl_Window { void draw(); int handle(int); void resize(int,int,int,int); Node* root; Node* current_root; Node* path[MAXDEPTH]; Node* current_node; int root_depth; int current_depth; int ncols; Fl_Menu_Button menu_button; OutputWindow(int w, int h, const char* l) : Fl_Window(w,h,l), menu_button(0,0,w,h) {box(FL_NO_BOX);} void finish_drawn_row(); void draw_tree(Node* n, int column, ulong row, double scale, double offset); void print_tree(FILE* f, Node* n, int column, ulong row, double scale, double offset, int W, int H); void setcurrent(Node*, int); void setroot(Node*, int); public: static void root_cb(Fl_Widget*, void*); static void out_cb(Fl_Widget*, void*); static void hide_cb(Fl_Widget*, void*); static void unhide_cb(Fl_Widget*, void*); static void in_cb(Fl_Widget*, void*); static void next_cb(Fl_Widget*, void*); static void previous_cb(Fl_Widget*, void*); static void setroot_cb(Fl_Widget*, void*); static void sort_cb(Fl_Widget* o, void*); static void columns_cb(Fl_Widget* o, void*); static void copy_cb(Fl_Widget* o, void*); static void print_cb(Fl_Widget* o, void*); static Node* sort(Node* n, int (*compare)(const Node*, const Node*)); static OutputWindow* make(const char*, Disk* = 0); ~OutputWindow(); }; int all_files, quiet; int arg_cb(int, char **argv, int &i) { const char *s = argv[i]; if (!s) return 0; if (*s != '-') return 0; for (s++; *s; s++) { if (*s == 'a') all_files = 1; else if (*s == 'q') quiet = 1; else return 0; } i++; return 1; } int main(int argc, char**argv) { #if FL_MAJOR_VERSION < 2 // Make fltk look more like KDE/Windoze: #ifndef FL_NORMAL_SIZE // detect new versions of fltk where this is a variable FL_NORMAL_SIZE = 12; #endif Fl::set_color(FL_SELECTION_COLOR,0,0,128); #endif // Parse and -x switches understood by fltk: int n; Fl::args(argc,argv,n, arg_cb); // Any remaining words are files/directories: if (n < argc) { if (argv[n][0] == '-') { if (argv[n][1]) { // unknown switch fprintf(stderr, "xdiskusage display browser of disks to run du on\n" "xdiskusage directory... run du on each named directory\n" "xdiskusage file... assume the file contains du output\n" "du ... | xdiskusage pipe du output to xdiskusage\n" " -a show all files\n" " -q (quiet) don't show the progress slider\n" "%s\n" " -help\n", Fl::help); return 1; } } while (n < argc) { OutputWindow* d = OutputWindow::make(argv[n++]); if (d) d->show(argc,argv); } } else if (!isatty(0)) { // test for pipe, if so read stdin: OutputWindow* d = OutputWindow::make(0); if (d) d->show(argc,argv); } else { // normal gui: make_diskchooser(); reload_cb(0,0); disk_chooser->show(argc,argv); } return Fl::run(); } void disk_browser_cb(Fl_Browser*b, void*) { int i = b->value(); //printf("disk browser cb %d\n", i); #if FL_MAJOR_VERSION > 1 if (i < 0) return; #else i--; #endif Disk* d; for (d = firstdisk; i > 0; i--) d = d->next; all_files = all_files_button->value(); OutputWindow* w = OutputWindow::make(d->mount, d); if (w) w->show(); //b->value(0); } #include void disk_input_cb(Fl_Input* i, void*) { all_files = all_files_button->value(); OutputWindow* w = OutputWindow::make(i->value(), 0); if (w) w->show(); } void close_cb(Fl_Widget* o, void*) { OutputWindow* d = (OutputWindow*)o; delete d; } static int cancelled; void cancel_cb(Fl_Button*, void*) { cancelled = 1; } void delete_tree(Node* n) { while (n) { if (n->child) delete_tree(n->child); Node* next = n->brother; free((void*)n->name); delete n; n = next; } } // fill in missing totals by adding all sons: void fix_tree(Node* n) { if (n->size) return; ulong total = 0; for (Node *x = n->child; x; x = x->brother) total += x->size; n->size = total; } static long ordinal; Node* newnode(const char* name, ulong size, Node* parent, Node* & brother) { Node* n = new Node; n->child = n->brother = 0; n->name = strdup(name); n->size = size; n->ordinal = ++ordinal; if (parent->child) { brother->brother = n; } else { parent->child = n; } brother = n; return n; } static Fl_Menu_Item menutable[] = { {"set root", '\r', OutputWindow::setroot_cb}, {"in", FL_Right, OutputWindow::in_cb}, {"next", FL_Down, OutputWindow::next_cb}, {"previous", FL_Up, OutputWindow::previous_cb}, {"out", FL_Left, OutputWindow::out_cb}, {"root out", '/', OutputWindow::root_cb}, {"hide", 'h', OutputWindow::hide_cb}, {"unhide", FL_SHIFT|'H', OutputWindow::unhide_cb}, {"sort", 0, 0, 0, FL_SUBMENU}, {"largest first", 's', OutputWindow::sort_cb, (void*)'s'}, {"smallest first", 'r', OutputWindow::sort_cb, (void*)'r'}, {"alphabetical", 'a', OutputWindow::sort_cb, (void*)'a'}, {"reverse alphabetical", 'z', OutputWindow::sort_cb, (void*)'z'}, {"unsorted", 'u', OutputWindow::sort_cb, (void*)'u'}, {0}, {"columns", 0, 0, 0, FL_SUBMENU}, {"2", '2', OutputWindow::columns_cb, (void*)2}, {"3", '3', OutputWindow::columns_cb, (void*)3}, {"4", '4', OutputWindow::columns_cb, (void*)4}, {"5", '5', OutputWindow::columns_cb, (void*)5}, {"6", '6', OutputWindow::columns_cb, (void*)6}, {"7", '7', OutputWindow::columns_cb, (void*)7}, {"8", '8', OutputWindow::columns_cb, (void*)8}, {"9", '9', OutputWindow::columns_cb, (void*)9}, {"10", '0', OutputWindow::columns_cb, (void*)10}, {"11", '1', OutputWindow::columns_cb, (void*)11}, {0}, {"copy to clipboard", 'c', OutputWindow::copy_cb}, {"print", 'p', OutputWindow::print_cb}, {0} }; static int largestfirst(const Node* a, const Node* b) { return (a->size > b->size) ? -1 : 1; } OutputWindow* OutputWindow::make(const char* path, Disk* disk) { cancelled = 0; FILE* f; bool true_file; char buffer[1024]; char pathbuf[1024]; if (!path) { // it is a pipe true_file = true; f = stdin; } else { if (!disk) { // follow all symbolic links... strncpy(pathbuf, path, 1024); for (int i=0; i<10; i++) { char *p = (char*)fl_filename_name(pathbuf); int i = readlink(pathbuf, p, 1024-(p-pathbuf)); if (i < 0) { if (errno != EINVAL) { strcat(pathbuf, ": no such file"); fl_alert(pathbuf); return 0; } break; } if (*p == '/') {memmove(pathbuf, p, i); p = pathbuf;} p[i] = 0; path = pathbuf; } } // First, determine if the path we're given is an actual file, and // not a directory. If it is a file, assume it's the output from a // du command the user ran by hand. struct stat stbuf; if (stat(path, &stbuf) < 0) { fl_alert("%s : %s", path, strerror(errno)); return 0; } true_file = S_ISREG(stbuf.st_mode); f = fopen(path, "r"); if (!f) { fl_alert("%s : %s", path, strerror(errno)); return 0; } } if (!true_file) { // It's a directory; popen a du command starting at that directory. #ifdef __sgi // sgi has the -x and -L switches somehow confused. You cannot turn // off descent into mount points (with -x) without turning on descent // into symbolic links (at least for a stat()). At DD all the symbolic // links are on the /usr disk so I special case it: if (!strcmp(path, "/usr")) sprintf(buffer, "du -k%c \"%s\"", all_files ? 'a' : ' ', path); else #endif sprintf(buffer, DU_COMMAND"%c \"%s\"", all_files ? 'a' : ' ', path); f = popen(buffer,"r"); if (!f) { fl_alert("Problem running '%s' : %s", buffer, strerror(errno)); return 0; } } if (!wait_window) make_wait_window(); wait_slider->type(disk ? FL_HOR_FILL_SLIDER : FL_HOR_SLIDER); wait_slider->value(0.0); #if FL_MAJOR_VERSION > 1 wait_slider->box(FL_DOWN_BOX); wait_slider->color(0); wait_slider->selection_color(12); #endif if (!quiet && !(path && true_file)) { wait_window->show(); while (wait_window->damage()) Fl::wait(.1); } Node* root = new Node; root->child = root->brother = 0; root->name = 0; //if (!true_file) root->name = strdup(path); root->size = 0; root->ordinal = 0; ordinal = 0; Node* lastnode[MAXDEPTH]; ulong runningtotal; ulong totals[MAXDEPTH]; lastnode[0] = root; runningtotal = 0; totals[0] = 0; int currentdepth = 0; for (size_t line_no = 1;; ++line_no) { if (!(path && true_file)) Fl::check(); if (cancelled) { delete_tree(root); if (true_file) { if (path) fclose(f); } else { pclose(f); } wait_window->hide(); return 0; } // FIXME: don't limit line length to 1024 if (!fgets(buffer, 1024, f)) break; // If the line was longer than the maximum, warn about it, // and discard the rest of the line. size_t len = strlen (buffer); if (buffer[len-1] != '\n') { fprintf (stderr, "%s:%d: line too long, skipping it\n", path, line_no); // Read until end of line or EOF. while (1) { char c = getc (f); if (c == '\n' || c == EOF) break; } continue; } // null-terminate the line: char* p = buffer+len; if (p > buffer && p[-1] == '\n') p[-1] = 0; ulong size = strtoul(buffer, &p, 10); if (!isspace(*p) || p == buffer) { if (!*p || *p=='#') continue; // ignore blank lines or comments (?) fl_alert("%s:%d: does not look like du output: %s", path, line_no, p); cancelled = 1; continue; } while (isspace(*p)) p++; // split the path into parts: int newdepth = 0; const char* parts[MAXDEPTH]; if (*p == '/') { if (!root->name) root->name = strdup("/"); p++; } for (newdepth = 0; newdepth < MAXDEPTH && *p;) { parts[++newdepth] = p++; while (*p && *p != '/') p++; if (*p == '/') *p++ = 0; } // find out how many of the fields match: int match = 0; for (; match < newdepth && match < currentdepth; match++) { if (strcmp(parts[match+1],lastnode[match+1]->name)) break; } // give a total to any subdirectories we are leaving that du did // not report a total for: for (int j = currentdepth; j > match; j--) fix_tree(lastnode[j]); if (match == newdepth) { Node* p = lastnode[newdepth]; ulong t = totals[newdepth]+size; p->size = size; runningtotal = t; } else { Node* p = lastnode[match]; for (int j = match+1; j <= newdepth; j++) { totals[j] = runningtotal; p = newnode(parts[j], 0, p, lastnode[j]); } p->size = size; runningtotal += size; } currentdepth = newdepth; totals[newdepth] = runningtotal; // percent done is rounded to nearest pixel so slider does // not continuousely redraw: if (!quiet) { double v = disk ? (double)runningtotal/disk->used : (double)(ordinal%1024)/1024; v = rint(v*wait_slider->w())/wait_slider->w(); wait_slider->value(v); } } if (!root->name && path) root->name = strdup(path); if (true_file) { if (path) fclose(f); } else { pclose(f); } wait_window->hide(); // remove all the common roots that were not given sizes by du: while (root->child && !root->size && !root->child->brother) { Node* child = root->child; if (root->name) { char buffer[1024]; char* p = buffer; const char* q = root->name; while (*q) *p++ = *q++; if (p[-1] != '/') *p++ = '/'; strcpy(p, child->name); free((void*)(root->name)); root->name = strdup(buffer); free((void*)(child->name)); } else { root->name = child->name; } root->size = child->size; root->child = child->child; delete child; for (int j = 1; j < currentdepth; j++) lastnode[j] = lastnode[j+1]; currentdepth--; } // give a total to any subdirectories we are leaving that du did // not report a total for: for (int j = currentdepth; j > 0; j--) fix_tree(lastnode[j]); // Add dummy nodes to report more information we learned from df: if (disk) { // find last child so we can add after it: Node* n = root->child; while (n && n->brother) n = n->brother; if (disk->used > runningtotal) { // missing stuff (probably permission denied errors): newnode("(permission denied)", disk->used-runningtotal, root, n); runningtotal = disk->used; } if (disk->avail) { newnode("(free)", disk->avail, root, n); runningtotal += disk->avail; } if (disk->total > runningtotal) { newnode("(inodes)", disk->total-runningtotal, root, n); runningtotal = disk->total; } } root->size = runningtotal; OutputWindow* d = new OutputWindow(window_w, window_h, root->name); d->ncols = ::ncols; d->root = d->current_root = sort(root, largestfirst); d->resizable(d); d->menu_button.menu(menutable); d->menu_button.box(FL_NO_BOX); d->callback(close_cb); d->root_depth = 0; d->current_node = d->root; d->current_depth = 0; return d; } // These point at the top-left most pixel not drawn. This avoids drawing // over already made drawings: static int drawn_row; static int undrawn_column; #define BACKGROUND FL_LIGHT2 // erase the reset of drawn_row void OutputWindow::finish_drawn_row() { if (undrawn_column < w()) { fl_color(BACKGROUND); fl_rectf(undrawn_column, drawn_row, w()-undrawn_column, 1); } } int depth(Node* m, int quit_after) { int found = 0; for (Node* c = m->child; c; c=c->brother) if (!c->hidden()) { int t = depth(c, quit_after-1); if (t > found) {found = t; if (found+1 >= quit_after) break;} } return found+1; } // Returns first pixel row not drawn into: void OutputWindow::draw_tree(Node* n, int column, ulong row, double scale, double offset) { int X = (w()-1)*column/ncols; int W = (w()-1)*(column+1)/ncols - X; int Y = int(row*scale+offset+.5); for (; n; n = n->brother) { int NEXTY; if (n == current_root) NEXTY = h()-1; else if (n->hidden()) continue; else NEXTY = int((row+n->size)*scale+offset+.5); int H = NEXTY-Y; // if we have gone to next pixel row, erase end of previous one: if (Y > drawn_row) { finish_drawn_row(); drawn_row = Y; undrawn_column = X+1; } // anything more than 1 pixel tall draws a box: if (H > 1) { fl_color(FL_WHITE); fl_rectf(X+1,Y+1,W-1,H-1); fl_color(FL_BLACK); if (n->size*scale > 10) { char buffer[256]; #if FL_MAJOR_VERSION > 1 snprintf(buffer, 256, "%s%c%s", n->name, n->size*scale > 20 ? '\n' : ' ', formatk(n->size)); fl_draw(buffer, X+3, Y, W-3, H, Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_CLIP|fltk::RAW_LABEL)); #else // we need to double all the @ signs in the filename, and do // something with unprintable letters: int i,j; for (i = j = 0; i < 254;) { unsigned char c = (unsigned char)(n->name[j++]); if (!c) break; if (c < 32 || c>=127 && c < 0xA0 || c==255) c = '?'; buffer[i++] = c; if (c=='@' || c=='&') buffer[i++] = c; } snprintf(buffer+i, 256-i, "%c%s", n->size*scale > 20 ? '\n' : ' ', formatk(n->size)); fl_draw(buffer, X+3, Y, W-3, H, Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_CLIP)); #endif } fl_rect(X,Y,W+1,H+1); if (undrawn_column < X+W+1) undrawn_column = X+W+1; if (column+1 < ncols) { // figure out how much is not hidden: ulong hidden = 0; for (Node* c = n->child; c; c = c->brother) if (c->hidden()) hidden += c->size; if (hidden > 0) { int yy = int((row+hidden)*scale+offset+.5); fl_color(FL_BLACK); fl_line(X,yy,X+10,yy); fl_line(X+10,yy,X+W,Y); } if (hidden < n->size) { double s2 = scale*n->size/(n->size-hidden); draw_tree(n->child, column+1, row, s2, offset+row*(scale-s2)); } if (drawn_row < NEXTY) { finish_drawn_row(); drawn_row++; if (drawn_row < NEXTY) { fl_color(BACKGROUND); fl_rectf(X+W+1, drawn_row, w()-(X+W+1), NEXTY-drawn_row); } drawn_row = NEXTY; undrawn_column = X+W+1; } } else { drawn_row = NEXTY; undrawn_column = X+W+1; } if (n == current_node) { fl_color(FL_RED); fl_rect(X+1,Y+1,W-1,H-1); } } else { // draw a line for children less than 2 pixels tall int R = (w()-1)*(column+::depth(n,ncols-column))/ncols; if (R >= undrawn_column) { fl_color(FL_DARK2); fl_rectf(undrawn_column, Y, R+1-undrawn_column, 1); undrawn_column = R+1; } if (H > 0) { finish_drawn_row(); fl_color(FL_DARK2); fl_rectf(X+1, NEXTY, W+1, 1); drawn_row = NEXTY; undrawn_column = X+W+1; } if (n == current_node) { fl_color(FL_RED); fl_rectf(X,Y,W+1,H+1); } } if (n == current_root) {finish_drawn_row(); break;} row += n->size; Y = NEXTY; } } void OutputWindow::draw() { //fl_draw_box(box(),0,0,w(),h(),color()); double scale = (double)(h()-1)/current_root->size; fl_font(0,10); drawn_row = undrawn_column = 0; draw_tree(current_root, 0, 0, scale, 0); } int OutputWindow::handle(int event) { switch (event) { case FL_PUSH: case FL_DRAG: case FL_RELEASE: break; default: return Fl_Window::handle(event); } // Figure out what node we are pointing at: int X = Fl::event_x(); int Y = Fl::event_y(); if (X < 0 || X >= w() || Y < 0 || Y >= h()) return 1; int column = X * ncols / w(); if (column <= 0) { setcurrent(current_root, root_depth); } else { column += root_depth; double scale = (double)(h()-1)/current_root->size; double offset = 0; Node* n = current_root; ulong row = 0; int d = root_depth; while (n && d < column) { path[d] = n; ulong hidden = 0; for (Node* c = n->child; c; c = c->brother) if (c->hidden()) hidden += c->size; if (hidden >= n->size) {n = 0; break;} double s2 = scale*n->size/(n->size-hidden); offset += row*(scale-s2); scale = s2; n = n->child; for (; n; n = n->brother) { if (n->hidden()) continue; int Y1 = int((row+n->size)*scale+offset+.5); if (Y < Y1) break; row += n->size; } d++; } if (n) setcurrent(n,d); } // make menus popup now that we have current node: if (event == FL_PUSH && Fl::event_button() != 1) return Fl_Window::handle(event); // double-click opens the item: if (event == FL_RELEASE && Fl::event_clicks()) { if (current_node == current_root && current_depth) setcurrent(path[current_depth-1], current_depth-1); else setroot(current_node, current_depth); } // otherwise just navigate to it: return 1; } void OutputWindow::setcurrent(Node* n, int newdepth) { if (current_node == n) return; current_node = n; current_depth = newdepth; if (newdepth <= root_depth) setroot(n, newdepth); int m = current_depth-root_depth+1; if (m > ncols) ncols = m; n->ordinal = labs(n->ordinal); // unhide redraw(); } void OutputWindow::setroot(Node* n, int newdepth) { if (n == current_root) return; current_root = n; root_depth = newdepth; char buffer[1024]; buffer[0] = 0; char* p = buffer; for (int i = 0; i < root_depth; i++) { const char* q = path[i]->name; if (q && *q) { while (*q) *p++ = *q++; if (p[-1] != '/') *p++ = '/'; } } strcpy(p,n->name); label(buffer); int m = current_depth-root_depth+1; if (m > ncols) ncols = m; redraw(); } void OutputWindow::copy_cb(Fl_Widget* o, void*) { OutputWindow* d = (OutputWindow*)(o->window()); char buffer[1024]; char* p = buffer; for (int i = 0; i < d->current_depth; i++) { const char* q = d->path[i]->name; while (*q) *p++ = *q++; if (p[-1] != '/') *p++ = '/'; } strcpy(p, d->current_node->name); Fl::selection(*d, buffer, strlen(buffer)); } OutputWindow::~OutputWindow() { delete_tree(root); } void OutputWindow::setroot_cb(Fl_Widget* o, void*) { OutputWindow* d = (OutputWindow*)(o->window()); d->setroot(d->current_node, d->current_depth); } void OutputWindow::root_cb(Fl_Widget* o, void*) { OutputWindow* d = (OutputWindow*)(o->window()); if (d->root_depth) d->setroot(d->path[d->root_depth-1], d->root_depth-1); } void OutputWindow::out_cb(Fl_Widget* o, void*) { OutputWindow* d = (OutputWindow*)(o->window()); if (d->current_depth) d->setcurrent(d->path[d->current_depth-1], d->current_depth-1); } void OutputWindow::in_cb(Fl_Widget* o, void*) { OutputWindow* d = (OutputWindow*)(o->window()); for (Node* c = d->current_node->child; c; c = c->brother) if (!c->hidden()) { d->path[d->current_depth] = d->current_node; d->setcurrent(c, d->current_depth+1); break; } } void OutputWindow::next_cb(Fl_Widget* o, void*) { OutputWindow* d = (OutputWindow*)(o->window()); for (Node* c = d->current_node->brother; c; c = c->brother) if (!c->hidden()) { d->setcurrent(c, d->current_depth); break; } } void OutputWindow::previous_cb(Fl_Widget* o, void*) { OutputWindow* d = (OutputWindow*)(o->window()); if (!d->current_depth) return; Node* prev = 0; for (Node* c = d->path[d->current_depth-1]->child; c; c = c->brother) { if (c == d->current_node) { if (prev) d->setcurrent(prev, d->current_depth); return; } if (!c->hidden()) prev = c; } } void OutputWindow::hide_cb(Fl_Widget* o, void*) { OutputWindow* d = (OutputWindow*)(o->window()); d->current_node->ordinal = -labs(d->current_node->ordinal); for (Node* c = d->current_node->brother; c; c = c->brother) if (!c->hidden()) { d->setcurrent(c, d->current_depth); return; } if (d->current_depth) d->setcurrent(d->path[d->current_depth-1], d->current_depth-1); } void unhide(Node* n) { n->ordinal = labs(n->ordinal); for (Node* m = n->child; m; m = m->brother) unhide(m); } void OutputWindow::unhide_cb(Fl_Widget* o, void*) { OutputWindow* d = (OutputWindow*)(o->window()); unhide(d->current_node); d->redraw(); } static int smallestfirst(const Node* a, const Node* b) { return (a->size < b->size) ? -1 : 1; } static int alphabetical(const Node* a, const Node* b) { return strcmp(a->name, b->name); } static int zalphabetical(const Node* a, const Node* b) { return -strcmp(a->name, b->name); } static int unsorted(const Node* a, const Node* b) { return labs(a->ordinal) - labs(b->ordinal); } Node* OutputWindow::sort(Node* n, int (*compare)(const Node*, const Node*)) { if (!n) return 0; Node* head = 0; while (n) { Node* n1 = n->brother; Node** p = &head; while (*p) {if (compare(n, *p) < 0) break; p = &(*p)->brother;} n->brother = *p; *p = n; n->child = sort(n->child, compare); n = n1; } return head; } void OutputWindow::sort_cb(Fl_Widget* o, void*v) { OutputWindow* d = (OutputWindow*)(o->window()); int (*compare)(const Node*, const Node*); switch ((int)v) { case 's': compare = largestfirst; break; case 'r': compare = smallestfirst; break; case 'a': compare = alphabetical; break; case 'z': compare = zalphabetical; break; default: compare = unsorted; break; } d->root = sort(d->root, compare); d->redraw(); } void OutputWindow::columns_cb(Fl_Widget* o, void*v) { OutputWindow* d = (OutputWindow*)(o->window()); int n = (int)v; ::ncols = n; if (n == d->ncols) return; if (d->current_depth > d->root_depth+n-1) { d->current_depth = d->root_depth+n-1; d->current_node = d->path[d->current_depth]; } d->ncols = n; d->redraw(); } void OutputWindow::resize(int X, int Y, int W, int H) { window_w = W; window_h = H; Fl_Window::resize(X,Y,W,H); } //////////////////////////////////////////////////////////////// // PostScript output void OutputWindow::print_tree(FILE*f,Node* n, int column, ulong row, double scale, double offset, int bboxw, int bboxh) { int X = bboxw*column/ncols; int W = bboxw*(column+1)/ncols - X; for (; n; n = n->brother) { double Y,H; if (n == current_root) {Y = 0; H = bboxh;} else if (n->hidden()) continue; else {Y = row*scale+offset; H = n->size*scale;} fprintf(f, "%d %g %d %g rect", X, -Y, W, -H); if (H > 20) { fprintf(f, " %d %g moveto (%s) %d fitshow", X+3, -Y-H/2+2, n->name, W-6); fprintf(f, " %d %g moveto (%s) %d fitshow", X+3, -Y-H/2-8, formatk(n->size), W-6); } else if (H > 10) { fprintf(f, " %d %g moveto (%s %s) %d fitshow", X+3, -Y-H/2-4, n->name, formatk(n->size), W-6); } else if (H > 2) { fprintf(f, " /Helvetica findfont %g scalefont setfont\n", H*0.95); fprintf(f, " %d %g moveto (%s %s) %d fitshow\n", X+3, -Y-H*0.85, n->name, formatk(n->size), W-6); fprintf(f, " /Helvetica findfont 10 scalefont setfont"); } fprintf(f, "\n"); if (n->child && column+1 < ncols) { ulong hidden = 0; for (Node* c = n->child; c; c = c->brother) if (c->hidden()) hidden += c->size; if (hidden > 0) { double yy = (row+hidden)*scale+offset; fprintf(f, " %d %g moveto %d %g lineto %d %g lineto stroke\n", X, -yy, X+10, -yy, X+W, -Y); } if (hidden < n->size) { double s2 = scale*n->size/(n->size-hidden); print_tree(f, n->child, column+1, row, s2, offset+row*(scale-s2), bboxw, bboxh); } } if (n == current_root) return; row += n->size; } } #if FL_MAJOR_VERSION > 1 static void ok_cb(Fl_Widget* w, void*) { w->window()->set_value(); w->window()->hide(); } #endif void OutputWindow::print_cb(Fl_Widget* o, void*) { OutputWindow* d = (OutputWindow*)(o->window()); if (!print_panel) make_print_panel(); #if FL_MAJOR_VERSION > 1 print_ok_button->callback(ok_cb); if (!print_panel->exec()) return; #else print_panel->show(); for (;;) { if (!print_panel->shown()) return; Fl_Widget* o = Fl::readqueue(); if (o) { if (o == print_ok_button) break; } else { Fl::wait(); } } print_panel->hide(); #endif FILE *f; if (print_file_button->value()) { f = fopen(print_file_input->value(), "w"); } else { f = popen(print_command_input->value(), "w"); } if (!f) { fl_alert("Can't open printer output stream"); return; } fprintf(f, "%%!PS-Adobe-2.0\n"); int W = 7*72+36; int H = 10*72; if (!print_portrait_button->value()) {int t = W; W = H; H = t;} int X = 0; int Y = 0; if (!fill_page_button->value()) { if (d->w()*H > d->h()*W) {int t = d->h()*W/d->w(); Y = (H-t)/2; H = t;} else {int t = d->w()*H/d->h(); X = (W-t)/2; W = t;} } if (print_portrait_button->value()) fprintf(f, "%%%%BoundingBox: 36 36 %d %d\n",36+X+W,36+Y+H); else fprintf(f, "%%%%BoundingBox: 36 36 %d %d\n",36+Y+H,36+X+W); fprintf(f, "/rect {4 2 roll moveto dup 0 exch rlineto exch 0 rlineto neg 0 exch rlineto closepath stroke} bind def\n"); fprintf(f, "/pagelevel save def\n"); fprintf(f, "/Helvetica findfont 10 scalefont setfont\n"); fprintf(f, "/fitshow {gsave 1 index stringwidth pop div dup 1 lt {dup sqrt scale} {pop} ifelse show grestore} bind def\n"); fprintf(f, "0 setlinewidth\n"); if (print_portrait_button->value()) fprintf(f, "%d %d translate\n", 36+X, 36+Y+H); else fprintf(f, "%d %d translate 90 rotate\n", 36+Y, 36+X); double scale = (double)H/d->current_root->size; d->print_tree(f, d->current_root, 0, 0, scale, 0, W, H); fprintf(f,"showpage\npagelevel restore\n%%%%EOF\n"); if (print_file_button->value()) { fclose(f); } else { pclose(f); } } // End of xdiskusage.C xdiskusage-1.48/panels.H0100644000076500007650000000232207612714476015174 0ustar spitzakspitzak// generated by Fast Light User Interface Designer (fluid) version 1.0011 #ifndef panels_H #define panels_H #include #include extern Fl_Window *disk_chooser; #include extern void reload_cb(Fl_Button*, void*); extern void copyright_cb(Fl_Button*, void*); #include extern void disk_browser_cb(Fl_Browser*, void*); extern Fl_Browser *disk_browser; #include extern void disk_input_cb(Fl_Input*, void*); extern Fl_Input *disk_input; #include #include extern Fl_Check_Button *all_files_button; Fl_Window* make_diskchooser(); extern Fl_Window *wait_window; #include extern Fl_Slider *wait_slider; extern void cancel_cb(Fl_Button*, void*); Fl_Window* make_wait_window(); extern Fl_Window *print_panel; #include #include extern Fl_Input *print_command_input; extern Fl_Light_Button *print_file_button; extern Fl_Input *print_file_input; #include extern Fl_Check_Button *print_portrait_button; extern Fl_Check_Button *fill_page_button; #include extern Fl_Return_Button *print_ok_button; Fl_Window* make_print_panel(); #endif xdiskusage-1.48/configure.in0100666000076500007650000000246407147167131016116 0ustar spitzakspitzakdnl# -*- sh -*- dnl# the "configure" script is made from this by running GNU "autoconf" AC_INIT(xdiskusage.C) AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL AC_PATH_XTRA echo "Ignoring libraries \"$X_PRE_LIBS\" requested by configure." dnl# LIBS="$LIBS$X_LIBS$X_PRE_LIBS" LIBS="$LIBS$X_LIBS" MAKEDEPEND="\$(CXX) -M" dnl# add warnings and optimization to compiler switches: if test -n "$GXX"; then # GNU C compiler CFLAGS="-Wall -O2" CFLAGS_D="-Wall -g -DDEBUG" CXXFLAGS="-Wall -O2" CXXFLAGS_D="-Wall -g -DDEBUG" else if test "`(uname) 2>/dev/null`" = IRIX; then if expr "`(uname -r)`" \>= 6.2; then # turn on new "n32" Irix compiler: CXX="CC -n32" CC="cc -n32" LD="ld -n32" # but -M is broken so use old compiler: MAKEDEPEND="CC -M" CFLAGS="-fullwarn -O2" CFLAGS_D="-fullwarn -gslim -DDEBUG" CXXFLAGS="-fullwarn -O2" CXXFLAGS_D="-fullwarn -gslim -DDEBUG" else # old Irix compiler: CFLAGS="-O2" CFLAGS_D="-g -DDEBUG" CXXFLAGS="+w +pp -O2" CXXFLAGS_D="+w +pp -g -DDEBUG" fi else # generic C compiler: CFLAGS="-O" CFLAGS_D="-g -DDEBUG" CXXFLAGS="-O" CXXFLAGS_D="-g -DDEBUG" fi fi AC_SUBST(MAKEDEPEND) AC_SUBST(CFLAGS_D) AC_SUBST(CXXFLAGS_D) dnl# AC_CONFIG_HEADER(config.h:configh.in) AC_OUTPUT(makeinclude) dnl# end of configure.in xdiskusage-1.48/makeinclude.in0100644000076500007650000000073710046102275016401 0ustar spitzakspitzak# @configure_input@ prefix =@prefix@ exec_prefix =@exec_prefix@ bindir =@bindir@ mandir =@mandir@ includedir =@includedir@ libdir =@libdir@ srcdir =@srcdir@ VPATH =@srcdir@ # compiler names: CXX =@CXX@ CC =@CC@ MAKEDEPEND =@MAKEDEPEND@ # flags for C++ compiler: CFLAGS =@CFLAGS@ CFLAGS_D =@CFLAGS_D@ CXXFLAGS =@CXXFLAGS@ CXXFLAGS_D =@CXXFLAGS_D@ # libraries to link with: LDLIBS =@LIBS@ -lfltk -lXinerama -lGL -lGLU -lX11 -lXext @X_EXTRA_LIBS@ -lm INSTALL =@INSTALL@ xdiskusage-1.48/panels.fl0100644000076500007650000000721207612714474015407 0ustar spitzakspitzak# data file for the Fltk User Interface Designer (fluid) version 1.0009 header_name {.H} code_name {.C} gridx 5 gridy 5 snap 3 Function {make_diskchooser()} {open } { Fl_Window disk_chooser { label {Disk Usage Display} open xywh {192 212 404 252} resizable visible } { Fl_Button {} { label reload callback reload_cb xywh {290 10 65 20} } Fl_Button {} { label {©} callback copyright_cb xywh {365 10 25 20} labelsize 18 } Fl_Browser disk_browser { label {Pick a disk:} callback disk_browser_cb xywh {15 30 375 150} type Hold align 5 resizable code0 {static int widths[] = {200,0};} code1 {o->column_widths(widths);} } Fl_Input disk_input { label {Or type pathname in and hit Enter:} callback disk_input_cb xywh {15 200 335 25} align 5 when 10 code0 {o->value("/");} } Fl_Button {} { label browser callback {const char* c = fl_file_chooser("Directory:", 0, disk_input->value()); if (c) disk_input->value(c);} xywh {350 200 40 25} labelsize 8 code0 {\#include } } Fl_Check_Button {} { label {measure directories only} xywh {15 225 185 25} type Radio down_box DIAMOND_DOWN_BOX value 1 } Fl_Check_Button all_files_button { label {measure all files} selected xywh {190 225 145 25} type Radio down_box DIAMOND_DOWN_BOX } } } Function {make_wait_window()} {open } { Fl_Window wait_window {open xywh {362 558 229 100} resizable hotspot modal visible } { Fl_Slider wait_slider { label {Reading disk:} xywh {10 25 205 25} type {Horz Fill} color 12 selection_color 47 align 5 resizable code0 {o->set_output();} } Fl_Button {} { label Cancel callback cancel_cb xywh {70 60 80 25} shortcut 0xff1b } } } Function {make_print_panel()} {open } { Fl_Window print_panel { label Print xywh {881 436 345 173} hotspot modal visible } { Fl_Box {} { label {Print to:} xywh {10 5 85 25} labelfont 1 labelsize 18 align 20 } Fl_Light_Button {} { label printer xywh {10 35 75 25} type Radio value 1 } Fl_Input print_command_input { xywh {85 35 250 25} code0 {o->value("lpr");} } Fl_Light_Button print_file_button { label file xywh {10 65 75 25} type Radio } Fl_Input print_file_input { xywh {85 65 215 25} code0 {o->value("xdiskusage.ps");} } Fl_Button {} { label browser callback {const char* c = fl_file_chooser("Print to:", "*.ps", print_file_input->value()); if (c) print_file_input->value(c);} xywh {300 65 36 25} labelsize 8 code0 {\#include } } Fl_Group {} {open xywh {10 90 325 35} align 4 } { Fl_Check_Button print_portrait_button { label portrait xywh {10 90 80 25} type Radio down_box DIAMOND_DOWN_BOX value 1 } Fl_Check_Button {} { label landscape xywh {90 90 100 25} type Radio down_box DIAMOND_DOWN_BOX } } Fl_Group {} {open xywh {10 110 330 45} align 4 } { Fl_Check_Button fill_page_button { label {reshape to fill page} xywh {10 115 150 25} type Radio down_box DIAMOND_DOWN_BOX value 1 } Fl_Check_Button {} { label {same shape as window} xywh {160 115 175 25} type Radio down_box DIAMOND_DOWN_BOX } } Fl_Return_Button print_ok_button { label OK xywh {175 140 75 25} } Fl_Button {} { label Cancel callback {o->window()->hide();} xywh {260 140 75 25} shortcut 0xff1b } } } xdiskusage-1.48/xdiskusage.spec0100664000076500007650000000262107275114264016622 0ustar spitzakspitzak# Note that this is NOT a relocatable package %define prefix /usr %define bindir /usr/bin %define mandir /usr/share/man %define tmppath /tmp Summary: Grapically displays the amount of disks used for by each subdirectory. Name: xdiskusage Version: 1.43 Release: 1 Source0: http://xdiskusage.sourceforge.net/%{name}-%{version}.tgz Copyright: GPL Group: Applications/System BuildRoot: %{tmppath}/%{name}-%{version}-buildroot URL: http://xdiskusage.sourceforge.net/ BuildRequires: fltk-devel BuildRequires: Mesa %description xdiskusage is a user-friendly program to show you what is using up all your disk space. It is based on the design of xdu written by Phillip C. Dykstra. Changes have been made so it runs "du" for you, and can display the free space left on the disk, and produce a PostScript version of the display. %prep %setup %build %configure ./configure --prefix=%prefix make %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/%{bindir} $RPM_BUILD_ROOT/%{mandir}/man1 make prefix=$RPM_BUILD_ROOT/%{prefix} \ mandir=$RPM_BUILD_ROOT/%{mandir} install %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc README %{bindir}/* %{mandir}/man1/* %changelog * Thu May 3 2001 Dan Mueth - First draft of a spec file. I'm not modifying the autoconf or make stuff so I had to do a couple goofy things in here. xdiskusage-1.48/xdiskusage.10100644000076500007650000001425207727552017016035 0ustar spitzakspitzak.\"Man page for xdiskusage, by Bill Spitzak. .TH xdiskusage 1 "4 Sep 2003" .SH NAME \fIxdiskusage\fR - Grapical display of disk usage .SH SYNOPSIS .B xdiskusage [-a] [-d[isplay] host:n.n] [-g[eometry] WxH+X+Y] [-t[itle] windowtitle] [-n[ame] classname] [-i[conic]] [-fg color] [-bg color] [-bg2 color] [directory...] [file...] .SH DESCRIPTION .I xdiskusage displays the output of "du" in an X window, allowing you to graphically compare the sizes that the files and directories take. .SH USAGE Typing "xdiskusage dir" where "dir" is a folder causes "du" to be run on that folder and the result displayed. If the named file is a symbolic link it is dereferenced before being sent to du. The "-a" switch, if given, is passed to "du" to cause all files to be measured. Typing "xdiskusage file" where "file" is not a folder makes xdiskusage parse that file as though it was "du" output and display the result. You can type several file and folder names and get several display windows. If no files are named, you can pipe the output from another program to xdiskusage. If stdin is not a terminal xdiskusage will parse it as "du" output and display the result. For instance "du -k . | xdiskusage". Typing just "xdiskusage" brings up the disk browser described here: .SH DISK BROWSER By default xdiskusage presents you with a list of all the disks mounted on your system (it found these by running "df"). Click one of these names and it will scan the entire disk (by running "du") and present a graphical display of how much space all the files are taking on that disk. You can click on several disks (or on the same disk multiple times, for instance if you have changed the files stored on it) and get multiple display windows. The "rescan" button reruns "df" to get a new list of disks. You need to do this if you mount or unmount a disk, or to see new usage percentages. The (C) button shows you the copyright and license. You can type a filename into the input field on the bottom and type Enter. If the name is a directory, xdiskusage will attempt to run "du" on it and display the result. If the name is a file it is assummed to be "du" output and it is parsed and displayed. The "all files" button sends the -a switch to "du" causing it to list the space for every file on the disk. This can significantly increase the time it takes to scan. .SH DISPLAY Each white box represents a folder. It's size is equal to the sum of all it's contents (all sub-folders and files). To the right of each box are stacked the boxes for the sub-folders (and files if the "all files" switch was given). If you selected a disk from the disk browser, some extra boxes are added to show information learned from df: "(free)" is the free space reported by df. "(permission denied)" is space that df said was used but du did not report. Besides permission errors when running du, this may also be the result of a file deleted from its containing folder, but still in use by a program, so its space is not reclaimed yet. Mounted loopback filesystems (ISO image just checked before burning, then deleted while still mounted) are common examples. "(inodes)" is the difference between the total size of the disk and the used + available space reported by du, this is overhead used by the file system. The left-most box is the "current root". One of the boxes is outlined in red, this is the "current node". Clicking on any box makes it the current node. The arrow keys can also be used to navigate you around. Hitting return makes the current node be the current root: putting it on the left edge and blowing it up to the height of the window and scaling all it's contents the same. The left arrow can be used to move the root and current node back up, or you can type '/' to move just the root, leaving the current node where it is. To dismiss any window type Escape. .SH MENU ITEMS There is a pop-up menu on the right-hand mouse button. Every item on the menu has a keyboard shortcut. The menu items are: .B In (right arrow) go to the first child of the current folder. .B Next (down arrow) go down to brother of current folder. .B Previous (up arrow) go up to the brother of current folder. .B Out (left arrow) go to parent of current folder. .B Root out (slash) move the root of the window up to it's parent. .B Hide (h) remove this node from the display and scale rest up to fit .B Unhide (H) Recursivly turn off the hide flag from all children .B Sort/Largest (s) sort largest size at the top .B Sort/Smallest (r) sort smallest size at the top .B Sort/Alphabetical (a) sort in alphabetical order .B Sort/Reverse Alphabetical (z) sort in backwards alphabetical order .B Sort/Unsorted (u) sort in the order read from du. .B Columns/2-11 (2-9,0,1) arrange display to have N columns. .B Copy to Clipboard (c) the pathname of the current node is put in the X clipboard (you can then paste it into a shell command). .B Print (p) The current display is printed. The output is Encapsulated PostScript. It will either run it through lpr (or any command you choose) or send it to a file. .SH BUGS Gets confused by "df" output on some platforms, requiring platform-specific code. .SH ACKNOWLEDGEMENTS This program was inspired by, and the user interface design copied from, the "xdu" program written by Phillip C. Dykstra. Stephane Gourichon contributed many suggested improvements. .SH COPYRIGHT Copyright (C) 2003 Bill Spitzak This program 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 (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. .SH AUTHORS Written by Bill Spitzak spitzak at dee two dot com