diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2006-11-25 20:52:24 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2006-11-25 20:52:24 +0000 |
commit | cf87db164aa2401ec33a041d3969d6ccb1ef49d9 (patch) | |
tree | 9b65838d7e1aee39d37defb896a5fd6a3922d5ba /app/xman | |
parent | 2387c426e6dfc2b0a2d0aa5585dbeb580f5ea91e (diff) |
Importing from X.Org 7.2RC2
Diffstat (limited to 'app/xman')
45 files changed, 21442 insertions, 0 deletions
diff --git a/app/xman/AUTHORS b/app/xman/AUTHORS new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/app/xman/AUTHORS diff --git a/app/xman/COPYING b/app/xman/COPYING new file mode 100644 index 000000000..7f33cbfd2 --- /dev/null +++ b/app/xman/COPYING @@ -0,0 +1,12 @@ +This is a stub file. This package has not yet had its complete licensing +information compiled. Please see the individual source files for details on +your rights to use and modify this software. + +Please submit updated COPYING files to the Xorg bugzilla: + +https://bugs.freedesktop.org/enter_bug.cgi?product=xorg + +All licensing questions regarding this software should be directed at the +Xorg mailing list: + +http://lists.freedesktop.org/mailman/listinfo/xorg diff --git a/app/xman/ChangeLog b/app/xman/ChangeLog new file mode 100644 index 000000000..7035efdd3 --- /dev/null +++ b/app/xman/ChangeLog @@ -0,0 +1,63 @@ +2006-04-01 Adam Jackson <ajax@freedesktop.org> + + * configure.ac: + Bump to 1.0.2. + +2006-01-06 Alan Coopersmith <alan.coopersmith@sun.com> + + * main.c (ArgError): + <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6240826> + Sun bug 6240826: xman typo: 'geometery' in usage message (Sam Lau) + +2005-12-20 Kevin E. Martin <kem-at-freedesktop-dot-org> + + * configure.ac: + Update package version for X11R7 release. + +2005-12-20 Kevin E. Martin <kem-at-freedesktop-dot-org> + + * version.h: + Bump hardcoded version number. + +2005-12-14 Kevin E. Martin <kem-at-freedesktop-dot-org> + + * configure.ac: + Update package version number for final X11R7 release candidate. + +2005-12-08 Kevin E. Martin <kem-at-freedesktop-dot-org> + + * Makefile.am: + * configure.ac: + Add configure options to allow hard-coded paths to be changed. + +2005-12-07 Kevin E. Martin <kem-at-freedesktop-dot-org> + + * Makefile.am: + * configure.ac: + Change to use the app-defaults default dir configured in libXt. + +2005-12-06 Kevin E. Martin <kem-at-freedesktop-dot-org> + + * Makefile.am: + Change *man_SOURCES ==> *man_PRE to fix autotools warnings. + +2005-12-03 Kevin E. Martin <kem-at-freedesktop-dot-org> + + * configure.ac: + Update package version number for X11R7 RC3 release. + +2005-11-19 Alan Coopersmith <alan.coopersmith@sun.com> + + * configure.ac: + Add dependency on xp module when building with Xprint support. + +2005-11-09 Kevin E. Martin <kem-at-freedesktop-dot-org> + + * configure.ac: + Update package version number for X11R7 RC2 release. + +2005-10-18 Kevin E. Martin <kem-at-freedesktop-dot-org> + + * configure.ac: + Update package version number for RC1 release. + diff --git a/app/xman/INSTALL b/app/xman/INSTALL new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/app/xman/INSTALL diff --git a/app/xman/Makefile.am b/app/xman/Makefile.am new file mode 100644 index 000000000..1b4de74d4 --- /dev/null +++ b/app/xman/Makefile.am @@ -0,0 +1,109 @@ +# +# Copyright 2005 Red Hat, Inc. +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of Red Hat not be used in +# advertising or publicity pertaining to distribution of the software without +# specific, written prior permission. Red Hat makes no +# representations about the suitability of this software for any purpose. It +# is provided "as is" without express or implied warranty. +# +# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +bin_PROGRAMS = xman + +helpdir=@HELPDIR@ +dist_help_DATA = xman.help + +xman_CFLAGS = $(XMAN_CFLAGS) -D_BSD_SOURCE -DHELPFILE=\"$(helpdir)/xman.help\" +xman_LDADD = $(XMAN_LIBS) + +xman_SOURCES = \ + buttons.c \ + defs.h \ + globals.c \ + globals.h \ + handler.c \ + help.c \ + iconclosed.h \ + icon_help.h \ + icon_open.h \ + main.c \ + man.c \ + man.h \ + misc.c \ + ScrollByL.c \ + ScrollByL.h \ + ScrollByLP.h \ + search.c \ + tkfuncs.c \ + vendor.c \ + vendor.h \ + version.h + +if XAW_USE_XPRINT +xman_SOURCES += \ + print.c \ + print.h +endif + +appman_PRE = \ + xman.man + +# App default files (*.ad) + +appdefaultdir = @appdefaultdir@ + +if XAW_USE_XPRINT +Xman: Xman-xprint.ad + ln -s $(top_srcdir)/Xman-xprint.ad Xman +else +Xman: Xman-noxprint.ad + ln -s $(top_srcdir)/Xman-noxprint.ad Xman +endif + +appdefault_DATA = Xman + +EXTRA_DIST = Xman-xprint.ad Xman-noxprint.ad + +CLEANFILES = Xman + +appmandir = $(APP_MAN_DIR) + +appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) + +EXTRA_DIST += $(appman_PRE) +CLEANFILES += $(appman_DATA) + +SED = sed + +# Strings to replace in man pages +XORGRELSTRING = @PACKAGE_STRING@ + XORGMANNAME = X Version 11 + +MAN_SUBSTS = \ + -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xservername__|Xorg|g' \ + -e 's|__xconfigfile__|xorg.conf|g' \ + -e 's|__projectroot__|$(prefix)|g' \ + -e 's|__apploaddir__|$(appdefaultdir)|' \ + -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ + -e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \ + -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ + -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ + -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' + +SUFFIXES = .$(APP_MAN_SUFFIX) .man + +.man.$(APP_MAN_SUFFIX): + sed $(MAN_SUBSTS) < $< > $@ diff --git a/app/xman/Makefile.in b/app/xman/Makefile.in new file mode 100644 index 000000000..154132087 --- /dev/null +++ b/app/xman/Makefile.in @@ -0,0 +1,895 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Copyright 2005 Red Hat, Inc. +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of Red Hat not be used in +# advertising or publicity pertaining to distribution of the software without +# specific, written prior permission. Red Hat makes no +# representations about the suitability of this software for any purpose. It +# is provided "as is" without express or implied warranty. +# +# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = xman$(EXEEXT) +@XAW_USE_XPRINT_TRUE@am__append_1 = \ +@XAW_USE_XPRINT_TRUE@ print.c \ +@XAW_USE_XPRINT_TRUE@ print.h + +DIST_COMMON = README $(am__configure_deps) $(dist_help_DATA) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \ + ChangeLog INSTALL NEWS compile config.guess config.sub depcomp \ + install-sh missing +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appdefaultdir)" \ + "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(helpdir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am__xman_SOURCES_DIST = buttons.c defs.h globals.c globals.h handler.c \ + help.c iconclosed.h icon_help.h icon_open.h main.c man.c man.h \ + misc.c ScrollByL.c ScrollByL.h ScrollByLP.h search.c tkfuncs.c \ + vendor.c vendor.h version.h print.c print.h +@XAW_USE_XPRINT_TRUE@am__objects_1 = xman-print.$(OBJEXT) +am_xman_OBJECTS = xman-buttons.$(OBJEXT) xman-globals.$(OBJEXT) \ + xman-handler.$(OBJEXT) xman-help.$(OBJEXT) xman-main.$(OBJEXT) \ + xman-man.$(OBJEXT) xman-misc.$(OBJEXT) \ + xman-ScrollByL.$(OBJEXT) xman-search.$(OBJEXT) \ + xman-tkfuncs.$(OBJEXT) xman-vendor.$(OBJEXT) $(am__objects_1) +xman_OBJECTS = $(am_xman_OBJECTS) +am__DEPENDENCIES_1 = +xman_DEPENDENCIES = $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I. +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(xman_SOURCES) +DIST_SOURCES = $(am__xman_SOURCES_DIST) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +appdefaultDATA_INSTALL = $(INSTALL_DATA) +appmanDATA_INSTALL = $(INSTALL_DATA) +dist_helpDATA_INSTALL = $(INSTALL_DATA) +DATA = $(appdefault_DATA) $(appman_DATA) $(dist_help_DATA) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APPDEFS_CFLAGS = @APPDEFS_CFLAGS@ +APPDEFS_LIBS = @APPDEFS_LIBS@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +HELPDIR = @HELPDIR@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TMP_XAW_CFLAGS = @TMP_XAW_CFLAGS@ +TMP_XAW_LIBS = @TMP_XAW_LIBS@ +VERSION = @VERSION@ +XAW_USE_XPRINT_FALSE = @XAW_USE_XPRINT_FALSE@ +XAW_USE_XPRINT_TRUE = @XAW_USE_XPRINT_TRUE@ +XMAN_CFLAGS = @XMAN_CFLAGS@ +XMAN_LIBS = @XMAN_LIBS@ +XPRINT_UTIL_CFLAGS = @XPRINT_UTIL_CFLAGS@ +XPRINT_UTIL_LIBS = @XPRINT_UTIL_LIBS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ + +# App default files (*.ad) +appdefaultdir = @appdefaultdir@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +helpdir = @HELPDIR@ +dist_help_DATA = xman.help +xman_CFLAGS = $(XMAN_CFLAGS) -D_BSD_SOURCE -DHELPFILE=\"$(helpdir)/xman.help\" +xman_LDADD = $(XMAN_LIBS) +xman_SOURCES = buttons.c defs.h globals.c globals.h handler.c help.c \ + iconclosed.h icon_help.h icon_open.h main.c man.c man.h misc.c \ + ScrollByL.c ScrollByL.h ScrollByLP.h search.c tkfuncs.c \ + vendor.c vendor.h version.h $(am__append_1) +appman_PRE = \ + xman.man + +appdefault_DATA = Xman +EXTRA_DIST = Xman-xprint.ad Xman-noxprint.ad $(appman_PRE) +CLEANFILES = Xman $(appman_DATA) +appmandir = $(APP_MAN_DIR) +appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) +SED = sed + +# Strings to replace in man pages +XORGRELSTRING = @PACKAGE_STRING@ +XORGMANNAME = X Version 11 +MAN_SUBSTS = \ + -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xservername__|Xorg|g' \ + -e 's|__xconfigfile__|xorg.conf|g' \ + -e 's|__projectroot__|$(prefix)|g' \ + -e 's|__apploaddir__|$(appdefaultdir)|' \ + -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ + -e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \ + -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ + -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ + -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' + +SUFFIXES = .$(APP_MAN_SUFFIX) .man +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .$(APP_MAN_SUFFIX) .man .c .o .obj +am--refresh: + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +xman$(EXEEXT): $(xman_OBJECTS) $(xman_DEPENDENCIES) + @rm -f xman$(EXEEXT) + $(LINK) $(xman_LDFLAGS) $(xman_OBJECTS) $(xman_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xman-ScrollByL.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xman-buttons.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xman-globals.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xman-handler.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xman-help.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xman-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xman-man.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xman-misc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xman-print.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xman-search.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xman-tkfuncs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xman-vendor.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +xman-buttons.o: buttons.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-buttons.o -MD -MP -MF "$(DEPDIR)/xman-buttons.Tpo" -c -o xman-buttons.o `test -f 'buttons.c' || echo '$(srcdir)/'`buttons.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-buttons.Tpo" "$(DEPDIR)/xman-buttons.Po"; else rm -f "$(DEPDIR)/xman-buttons.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='buttons.c' object='xman-buttons.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-buttons.o `test -f 'buttons.c' || echo '$(srcdir)/'`buttons.c + +xman-buttons.obj: buttons.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-buttons.obj -MD -MP -MF "$(DEPDIR)/xman-buttons.Tpo" -c -o xman-buttons.obj `if test -f 'buttons.c'; then $(CYGPATH_W) 'buttons.c'; else $(CYGPATH_W) '$(srcdir)/buttons.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-buttons.Tpo" "$(DEPDIR)/xman-buttons.Po"; else rm -f "$(DEPDIR)/xman-buttons.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='buttons.c' object='xman-buttons.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-buttons.obj `if test -f 'buttons.c'; then $(CYGPATH_W) 'buttons.c'; else $(CYGPATH_W) '$(srcdir)/buttons.c'; fi` + +xman-globals.o: globals.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-globals.o -MD -MP -MF "$(DEPDIR)/xman-globals.Tpo" -c -o xman-globals.o `test -f 'globals.c' || echo '$(srcdir)/'`globals.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-globals.Tpo" "$(DEPDIR)/xman-globals.Po"; else rm -f "$(DEPDIR)/xman-globals.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='globals.c' object='xman-globals.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-globals.o `test -f 'globals.c' || echo '$(srcdir)/'`globals.c + +xman-globals.obj: globals.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-globals.obj -MD -MP -MF "$(DEPDIR)/xman-globals.Tpo" -c -o xman-globals.obj `if test -f 'globals.c'; then $(CYGPATH_W) 'globals.c'; else $(CYGPATH_W) '$(srcdir)/globals.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-globals.Tpo" "$(DEPDIR)/xman-globals.Po"; else rm -f "$(DEPDIR)/xman-globals.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='globals.c' object='xman-globals.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-globals.obj `if test -f 'globals.c'; then $(CYGPATH_W) 'globals.c'; else $(CYGPATH_W) '$(srcdir)/globals.c'; fi` + +xman-handler.o: handler.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-handler.o -MD -MP -MF "$(DEPDIR)/xman-handler.Tpo" -c -o xman-handler.o `test -f 'handler.c' || echo '$(srcdir)/'`handler.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-handler.Tpo" "$(DEPDIR)/xman-handler.Po"; else rm -f "$(DEPDIR)/xman-handler.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='handler.c' object='xman-handler.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-handler.o `test -f 'handler.c' || echo '$(srcdir)/'`handler.c + +xman-handler.obj: handler.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-handler.obj -MD -MP -MF "$(DEPDIR)/xman-handler.Tpo" -c -o xman-handler.obj `if test -f 'handler.c'; then $(CYGPATH_W) 'handler.c'; else $(CYGPATH_W) '$(srcdir)/handler.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-handler.Tpo" "$(DEPDIR)/xman-handler.Po"; else rm -f "$(DEPDIR)/xman-handler.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='handler.c' object='xman-handler.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-handler.obj `if test -f 'handler.c'; then $(CYGPATH_W) 'handler.c'; else $(CYGPATH_W) '$(srcdir)/handler.c'; fi` + +xman-help.o: help.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-help.o -MD -MP -MF "$(DEPDIR)/xman-help.Tpo" -c -o xman-help.o `test -f 'help.c' || echo '$(srcdir)/'`help.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-help.Tpo" "$(DEPDIR)/xman-help.Po"; else rm -f "$(DEPDIR)/xman-help.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='help.c' object='xman-help.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-help.o `test -f 'help.c' || echo '$(srcdir)/'`help.c + +xman-help.obj: help.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-help.obj -MD -MP -MF "$(DEPDIR)/xman-help.Tpo" -c -o xman-help.obj `if test -f 'help.c'; then $(CYGPATH_W) 'help.c'; else $(CYGPATH_W) '$(srcdir)/help.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-help.Tpo" "$(DEPDIR)/xman-help.Po"; else rm -f "$(DEPDIR)/xman-help.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='help.c' object='xman-help.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-help.obj `if test -f 'help.c'; then $(CYGPATH_W) 'help.c'; else $(CYGPATH_W) '$(srcdir)/help.c'; fi` + +xman-main.o: main.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-main.o -MD -MP -MF "$(DEPDIR)/xman-main.Tpo" -c -o xman-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-main.Tpo" "$(DEPDIR)/xman-main.Po"; else rm -f "$(DEPDIR)/xman-main.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='xman-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c + +xman-main.obj: main.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-main.obj -MD -MP -MF "$(DEPDIR)/xman-main.Tpo" -c -o xman-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-main.Tpo" "$(DEPDIR)/xman-main.Po"; else rm -f "$(DEPDIR)/xman-main.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='xman-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` + +xman-man.o: man.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-man.o -MD -MP -MF "$(DEPDIR)/xman-man.Tpo" -c -o xman-man.o `test -f 'man.c' || echo '$(srcdir)/'`man.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-man.Tpo" "$(DEPDIR)/xman-man.Po"; else rm -f "$(DEPDIR)/xman-man.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='man.c' object='xman-man.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-man.o `test -f 'man.c' || echo '$(srcdir)/'`man.c + +xman-man.obj: man.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-man.obj -MD -MP -MF "$(DEPDIR)/xman-man.Tpo" -c -o xman-man.obj `if test -f 'man.c'; then $(CYGPATH_W) 'man.c'; else $(CYGPATH_W) '$(srcdir)/man.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-man.Tpo" "$(DEPDIR)/xman-man.Po"; else rm -f "$(DEPDIR)/xman-man.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='man.c' object='xman-man.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-man.obj `if test -f 'man.c'; then $(CYGPATH_W) 'man.c'; else $(CYGPATH_W) '$(srcdir)/man.c'; fi` + +xman-misc.o: misc.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-misc.o -MD -MP -MF "$(DEPDIR)/xman-misc.Tpo" -c -o xman-misc.o `test -f 'misc.c' || echo '$(srcdir)/'`misc.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-misc.Tpo" "$(DEPDIR)/xman-misc.Po"; else rm -f "$(DEPDIR)/xman-misc.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='misc.c' object='xman-misc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-misc.o `test -f 'misc.c' || echo '$(srcdir)/'`misc.c + +xman-misc.obj: misc.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-misc.obj -MD -MP -MF "$(DEPDIR)/xman-misc.Tpo" -c -o xman-misc.obj `if test -f 'misc.c'; then $(CYGPATH_W) 'misc.c'; else $(CYGPATH_W) '$(srcdir)/misc.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-misc.Tpo" "$(DEPDIR)/xman-misc.Po"; else rm -f "$(DEPDIR)/xman-misc.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='misc.c' object='xman-misc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-misc.obj `if test -f 'misc.c'; then $(CYGPATH_W) 'misc.c'; else $(CYGPATH_W) '$(srcdir)/misc.c'; fi` + +xman-ScrollByL.o: ScrollByL.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-ScrollByL.o -MD -MP -MF "$(DEPDIR)/xman-ScrollByL.Tpo" -c -o xman-ScrollByL.o `test -f 'ScrollByL.c' || echo '$(srcdir)/'`ScrollByL.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-ScrollByL.Tpo" "$(DEPDIR)/xman-ScrollByL.Po"; else rm -f "$(DEPDIR)/xman-ScrollByL.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ScrollByL.c' object='xman-ScrollByL.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-ScrollByL.o `test -f 'ScrollByL.c' || echo '$(srcdir)/'`ScrollByL.c + +xman-ScrollByL.obj: ScrollByL.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-ScrollByL.obj -MD -MP -MF "$(DEPDIR)/xman-ScrollByL.Tpo" -c -o xman-ScrollByL.obj `if test -f 'ScrollByL.c'; then $(CYGPATH_W) 'ScrollByL.c'; else $(CYGPATH_W) '$(srcdir)/ScrollByL.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-ScrollByL.Tpo" "$(DEPDIR)/xman-ScrollByL.Po"; else rm -f "$(DEPDIR)/xman-ScrollByL.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ScrollByL.c' object='xman-ScrollByL.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-ScrollByL.obj `if test -f 'ScrollByL.c'; then $(CYGPATH_W) 'ScrollByL.c'; else $(CYGPATH_W) '$(srcdir)/ScrollByL.c'; fi` + +xman-search.o: search.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-search.o -MD -MP -MF "$(DEPDIR)/xman-search.Tpo" -c -o xman-search.o `test -f 'search.c' || echo '$(srcdir)/'`search.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-search.Tpo" "$(DEPDIR)/xman-search.Po"; else rm -f "$(DEPDIR)/xman-search.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='search.c' object='xman-search.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-search.o `test -f 'search.c' || echo '$(srcdir)/'`search.c + +xman-search.obj: search.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-search.obj -MD -MP -MF "$(DEPDIR)/xman-search.Tpo" -c -o xman-search.obj `if test -f 'search.c'; then $(CYGPATH_W) 'search.c'; else $(CYGPATH_W) '$(srcdir)/search.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-search.Tpo" "$(DEPDIR)/xman-search.Po"; else rm -f "$(DEPDIR)/xman-search.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='search.c' object='xman-search.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-search.obj `if test -f 'search.c'; then $(CYGPATH_W) 'search.c'; else $(CYGPATH_W) '$(srcdir)/search.c'; fi` + +xman-tkfuncs.o: tkfuncs.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-tkfuncs.o -MD -MP -MF "$(DEPDIR)/xman-tkfuncs.Tpo" -c -o xman-tkfuncs.o `test -f 'tkfuncs.c' || echo '$(srcdir)/'`tkfuncs.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-tkfuncs.Tpo" "$(DEPDIR)/xman-tkfuncs.Po"; else rm -f "$(DEPDIR)/xman-tkfuncs.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tkfuncs.c' object='xman-tkfuncs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-tkfuncs.o `test -f 'tkfuncs.c' || echo '$(srcdir)/'`tkfuncs.c + +xman-tkfuncs.obj: tkfuncs.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-tkfuncs.obj -MD -MP -MF "$(DEPDIR)/xman-tkfuncs.Tpo" -c -o xman-tkfuncs.obj `if test -f 'tkfuncs.c'; then $(CYGPATH_W) 'tkfuncs.c'; else $(CYGPATH_W) '$(srcdir)/tkfuncs.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-tkfuncs.Tpo" "$(DEPDIR)/xman-tkfuncs.Po"; else rm -f "$(DEPDIR)/xman-tkfuncs.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tkfuncs.c' object='xman-tkfuncs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-tkfuncs.obj `if test -f 'tkfuncs.c'; then $(CYGPATH_W) 'tkfuncs.c'; else $(CYGPATH_W) '$(srcdir)/tkfuncs.c'; fi` + +xman-vendor.o: vendor.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-vendor.o -MD -MP -MF "$(DEPDIR)/xman-vendor.Tpo" -c -o xman-vendor.o `test -f 'vendor.c' || echo '$(srcdir)/'`vendor.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-vendor.Tpo" "$(DEPDIR)/xman-vendor.Po"; else rm -f "$(DEPDIR)/xman-vendor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='vendor.c' object='xman-vendor.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-vendor.o `test -f 'vendor.c' || echo '$(srcdir)/'`vendor.c + +xman-vendor.obj: vendor.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-vendor.obj -MD -MP -MF "$(DEPDIR)/xman-vendor.Tpo" -c -o xman-vendor.obj `if test -f 'vendor.c'; then $(CYGPATH_W) 'vendor.c'; else $(CYGPATH_W) '$(srcdir)/vendor.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-vendor.Tpo" "$(DEPDIR)/xman-vendor.Po"; else rm -f "$(DEPDIR)/xman-vendor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='vendor.c' object='xman-vendor.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-vendor.obj `if test -f 'vendor.c'; then $(CYGPATH_W) 'vendor.c'; else $(CYGPATH_W) '$(srcdir)/vendor.c'; fi` + +xman-print.o: print.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-print.o -MD -MP -MF "$(DEPDIR)/xman-print.Tpo" -c -o xman-print.o `test -f 'print.c' || echo '$(srcdir)/'`print.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-print.Tpo" "$(DEPDIR)/xman-print.Po"; else rm -f "$(DEPDIR)/xman-print.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='print.c' object='xman-print.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-print.o `test -f 'print.c' || echo '$(srcdir)/'`print.c + +xman-print.obj: print.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -MT xman-print.obj -MD -MP -MF "$(DEPDIR)/xman-print.Tpo" -c -o xman-print.obj `if test -f 'print.c'; then $(CYGPATH_W) 'print.c'; else $(CYGPATH_W) '$(srcdir)/print.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xman-print.Tpo" "$(DEPDIR)/xman-print.Po"; else rm -f "$(DEPDIR)/xman-print.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='print.c' object='xman-print.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xman_CFLAGS) $(CFLAGS) -c -o xman-print.obj `if test -f 'print.c'; then $(CYGPATH_W) 'print.c'; else $(CYGPATH_W) '$(srcdir)/print.c'; fi` +uninstall-info-am: +install-appdefaultDATA: $(appdefault_DATA) + @$(NORMAL_INSTALL) + test -z "$(appdefaultdir)" || $(mkdir_p) "$(DESTDIR)$(appdefaultdir)" + @list='$(appdefault_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(appdefaultDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(appdefaultdir)/$$f'"; \ + $(appdefaultDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(appdefaultdir)/$$f"; \ + done + +uninstall-appdefaultDATA: + @$(NORMAL_UNINSTALL) + @list='$(appdefault_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(appdefaultdir)/$$f'"; \ + rm -f "$(DESTDIR)$(appdefaultdir)/$$f"; \ + done +install-appmanDATA: $(appman_DATA) + @$(NORMAL_INSTALL) + test -z "$(appmandir)" || $(mkdir_p) "$(DESTDIR)$(appmandir)" + @list='$(appman_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(appmanDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(appmandir)/$$f'"; \ + $(appmanDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(appmandir)/$$f"; \ + done + +uninstall-appmanDATA: + @$(NORMAL_UNINSTALL) + @list='$(appman_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(appmandir)/$$f'"; \ + rm -f "$(DESTDIR)$(appmandir)/$$f"; \ + done +install-dist_helpDATA: $(dist_help_DATA) + @$(NORMAL_INSTALL) + test -z "$(helpdir)" || $(mkdir_p) "$(DESTDIR)$(helpdir)" + @list='$(dist_help_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(dist_helpDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(helpdir)/$$f'"; \ + $(dist_helpDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(helpdir)/$$f"; \ + done + +uninstall-dist_helpDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_help_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(helpdir)/$$f'"; \ + rm -f "$(DESTDIR)$(helpdir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(DATA) config.h +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appdefaultdir)" "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(helpdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-appdefaultDATA install-appmanDATA \ + install-dist_helpDATA + +install-exec-am: install-binPROGRAMS + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-appdefaultDATA uninstall-appmanDATA \ + uninstall-binPROGRAMS uninstall-dist_helpDATA \ + uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ + clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \ + dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-compile distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-appdefaultDATA install-appmanDATA install-binPROGRAMS \ + install-data install-data-am install-dist_helpDATA \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am tags uninstall uninstall-am uninstall-appdefaultDATA \ + uninstall-appmanDATA uninstall-binPROGRAMS \ + uninstall-dist_helpDATA uninstall-info-am + + +@XAW_USE_XPRINT_TRUE@Xman: Xman-xprint.ad +@XAW_USE_XPRINT_TRUE@ ln -s $(top_srcdir)/Xman-xprint.ad Xman +@XAW_USE_XPRINT_FALSE@Xman: Xman-noxprint.ad +@XAW_USE_XPRINT_FALSE@ ln -s $(top_srcdir)/Xman-noxprint.ad Xman + +.man.$(APP_MAN_SUFFIX): + sed $(MAN_SUBSTS) < $< > $@ +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/app/xman/NEWS b/app/xman/NEWS new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/app/xman/NEWS diff --git a/app/xman/README b/app/xman/README new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/app/xman/README diff --git a/app/xman/ScrollByL.c b/app/xman/ScrollByL.c new file mode 100644 index 000000000..c679145cd --- /dev/null +++ b/app/xman/ScrollByL.c @@ -0,0 +1,1215 @@ +/* $XConsortium: ScrollByL.c,v 1.30 94/04/17 20:43:46 rws Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ +/* $XFree86: xc/programs/xman/ScrollByL.c,v 1.6tsi Exp $ */ + +#if !defined(lint) && !defined(SABER) && 0 + static char rcs_version[] = "$Athena: ScrollByL.c,v 4.5 88/12/19 13:46:04 kit Exp $"; +#endif + +#include <stdio.h> +#include <ctype.h> +#include <X11/Xos.h> +#include <stdlib.h> + +#include <X11/IntrinsicP.h> +#include <sys/stat.h> /* depends on IntrinsicP.h */ +#include <X11/StringDefs.h> + +#include <X11/Xaw/Scrollbar.h> +#include <X11/Xmu/Misc.h> + +#include "ScrollByLP.h" + +/* Default Translation Table */ + +static char defaultTranslations[] = + "<Key>f: Page(Forward) \n\ + <Key>b: Page(Back) \n\ + <Key>1: Page(Line, 1) \n\ + <Key>2: Page(Line, 2) \n\ + <Key>3: Page(Line, 3) \n\ + <Key>4: Page(Line, 4) \n\ + <Key>\\ : Page(Forward)"; + + +/**************************************************************** + * + * ScrollByLine Resources + * + ****************************************************************/ + +#define Offset(field) XtOffset(ScrollByLineWidget, scroll.field) +#define CoreOffset(field) XtOffset(ScrollByLineWidget, core.field) + +static XtResource resources[] = { + {XtNwidth, XtCWidth, XtRDimension, sizeof(Dimension), + CoreOffset(width), XtRImmediate, (caddr_t) 500}, + {XtNheight, XtCHeight, XtRDimension, sizeof(Dimension), + CoreOffset(height), XtRImmediate, (caddr_t) 700}, + + {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel), + Offset(foreground), XtRString, "XtDefaultForeground"}, + {XtNforceVert, XtCBoolean, XtRBoolean, sizeof(Boolean), + Offset(force_vert), XtRImmediate, (caddr_t) FALSE}, + {XtNindent, XtCIndent, XtRDimension, sizeof(Dimension), + Offset(indent), XtRImmediate, (caddr_t) 15}, + {XtNuseRight, XtCBoolean, XtRBoolean, sizeof(Boolean), + Offset(use_right), XtRImmediate, (caddr_t) FALSE}, + {XtNmanualFontNormal, XtCFont, XtRFontStruct, sizeof(XFontStruct *), + Offset(normal_font), XtRString, MANPAGE_NORMAL}, + {XtNmanualFontBold, XtCFont, XtRFontStruct, sizeof(XFontStruct *), + Offset(bold_font), XtRString, MANPAGE_BOLD}, + {XtNmanualFontItalic, XtCFont, XtRFontStruct, sizeof(XFontStruct *), + Offset(italic_font), XtRString, MANPAGE_ITALIC}, + {XtNmanualFontSymbol, XtCFont, XtRFontStruct, sizeof(XFontStruct *), + Offset(symbol_font), XtRString, MANPAGE_SYMBOL}, + {XtNfile, XtCFile, XtRFile, sizeof(FILE *), + Offset(file), XtRImmediate, (caddr_t) NULL}, + {XtNNumTotalLines, XtCNumTotalLines, XtRInt, sizeof(int), + Offset(lines), XtRImmediate, (caddr_t) 0}, + {XtNNumVisibleLines, XtCNumVisibleLines, XtRInt, sizeof(int), + Offset(num_visible_lines), XtRImmediate, (caddr_t) 0}, +}; + +#undef Offset +#undef CoreOffset + +/**************************************************************** + * + * Full class record constant + * + ****************************************************************/ + +static void CreateScrollbar(Widget w); +static Boolean ScrollVerticalText(Widget w, int new_line, Boolean force_redisp); +static void Layout(Widget w); +static void LoadFile(Widget w); +static void MoveAndClearText(Widget w, int old_y, int height, int new_y); +static void PaintText(Widget w, int y_loc, int height); +static void PrintText(Widget w, int start_line, int num_lines, int location); +static void SetThumbHeight(Widget w); +static void VerticalJump(Widget w, XtPointer junk, XtPointer percent_ptr); +static void VerticalScroll(Widget w, XtPointer client_data, XtPointer call_data); + +/* semi - public functions. */ + +static void Realize(Widget w, Mask *valueMask, XSetWindowAttributes *attributes); +static void Initialize(Widget req, Widget new, ArgList args, Cardinal *num_args); +static void Destroy(Widget w); +static void Redisplay(Widget w, XEvent *event, Region region); +static void Page(Widget w, XEvent * event, String * params, Cardinal *num_params); +static Boolean SetValuesHook(Widget w, ArgList args, Cardinal *num_args); + +static XtActionsRec actions[] = { + { "Page", Page}, +}; + +#define superclass (&simpleClassRec) +#define SuperClass simpleWidgetClass + +ScrollByLineClassRec scrollByLineClassRec = { + { +/* core_class fields */ + /* superclass */ (WidgetClass) superclass, + /* class_name */ "ScrollByLine", + /* widget_size */ sizeof(ScrollByLineRec), + /* class_initialize */ NULL, + /* class_part_init */ NULL, + /* class_inited */ FALSE, + /* initialize */ Initialize, + /* initialize_hook */ NULL, + /* realize */ Realize, + /* actions */ actions, + /* num_actions */ XtNumber(actions), + /* resources */ resources, + /* num_resources */ XtNumber(resources), + /* xrm_class */ NULLQUARK, + /* compress_motion */ TRUE, + /* compress_exposure */ FALSE, + /* compress_enterleave*/ TRUE, + /* visible_interest */ FALSE, + /* destroy */ Destroy, + /* resize */ Layout, + /* expose */ Redisplay, + /* set_values */ NULL, + /* set_values_hook */ SetValuesHook, + /* set_values_almost */ XtInheritSetValuesAlmost, + /* get_values_hook */ NULL, + /* accept_focus */ NULL, + /* version */ XtVersion, + /* callback_private */ NULL, + /* tm_table */ defaultTranslations, + /* query_geometry */ XtInheritQueryGeometry, + /* display_accelerator*/ XtInheritDisplayAccelerator, + /* extension */ NULL, + }, + { /* simple fields */ + /* change_sensitive */ XtInheritChangeSensitive + } +}; + +WidgetClass scrollByLineWidgetClass = + (WidgetClass) &scrollByLineClassRec; + + +/**************************************************************** + * + * Private Routines + * + ****************************************************************/ + +/* Function Name: Layout + * Description: This function lays out the scroll widget. + * Arguments: w - the scroll widget. + * key - a boolean: if true then resize the widget to the child + * if false the resize children to fit widget. + * Returns: TRUE if successful. + */ + +static void +Layout(Widget w) +{ + ScrollByLineWidget sblw = (ScrollByLineWidget) w; + Dimension width, height; + Widget bar; + Position bar_bw; + + CreateScrollbar(w); + +/* + * For now always show the bar. + */ + + bar = sblw->scroll.bar; + height = sblw->core.height; + width = sblw->core.width; + bar_bw = bar->core.border_width; + + /* Move child and v_bar to correct location. */ + + if (sblw->scroll.use_right) { + XtMoveWidget(bar, width - (bar->core.width + bar_bw), - bar_bw); + sblw->scroll.offset = 0; + } + else { + XtMoveWidget(bar, - bar_bw, - bar_bw); + sblw->scroll.offset = bar->core.width + bar_bw; + } + + /* resize the scrollbar to be the correct height or width. */ + + XtResizeWidget(bar, bar->core.width, height, bar->core.border_width); + + SetThumbHeight(w); + + sblw->scroll.num_visible_lines = height / sblw->scroll.font_height + 1; +} + +/* ARGSUSED */ +static void +GExpose(Widget w, XtPointer junk, XEvent *event, Boolean *cont) +{ + +/* + * Graphics exposure events are not currently sent to exposure proc. + */ + + if (event->type == GraphicsExpose) + Redisplay(w, event, NULL); + +} /* ChildExpose */ + +/* + * Repaint the widget's child Window Widget. + */ + +/* ARGSUSED */ +static void +Redisplay(Widget w, XEvent *event, Region region) +{ + int top, height; /* the locations of the top and height + of the region that needs to be repainted. */ + +/* + * This routine tells the client which sections of the window to + * repaint in his callback function which does the actual repainting. + */ + + if (event->type == Expose) { + top = event->xexpose.y; + height = event->xexpose.height; + } + else { + top = event->xgraphicsexpose.y; + height = event->xgraphicsexpose.height; + } + + PaintText(w, top, height); +} /* redisplay (expose) */ + +/* Function Name: PaintText + * Description: paints the text at the give location for a given height. + * Arguments: w - the sbl widget. + * y_loc, height - location and size of area to paint. + * Returns: none + */ + +static void +PaintText(Widget w, int y_loc, int height) +{ + ScrollByLineWidget sblw = (ScrollByLineWidget) w; + int start_line, location; + + start_line = y_loc / sblw->scroll.font_height + sblw->scroll.line_pointer; + + if (start_line >= sblw->scroll.lines) + return; + +/* + * Only integer arithmetic makes this possible. + */ + + location = y_loc / sblw->scroll.font_height * sblw->scroll.font_height; + + PrintText(w, start_line, sblw->scroll.num_visible_lines, location); +} + +/* Function Name: Page + * Description: This function pages the widget, by the amount it recieves + * from the translation Manager. + * Arguments: w - the ScrollByLineWidget. + * event - the event that caused this return. + * params - the parameters passed to it. + * num_params - the number of parameters. + * Returns: none. + */ + +/* ARGSUSED */ +static void +Page(Widget w, XEvent * event, String * params, Cardinal *num_params) +{ + ScrollByLineWidget sblw = (ScrollByLineWidget) w; + Widget bar = sblw->scroll.bar; + + if (*num_params < 1) + return; +/* + * If no scroll bar is visible then do not page, as the entire window is shown, + * of scrolling has been turned off. + */ + + if (bar == (Widget) NULL) + return; + + switch ( params[0][0] ) { + case 'f': + case 'F': + /* move one page forward */ + VerticalScroll(bar, NULL, (XtPointer)((long) bar->core.height)); + break; + case 'b': + case 'B': + /* move one page backward */ + VerticalScroll(bar, NULL, (XtPointer)(- (long) bar->core.height)); + break; + case 'L': + case 'l': + /* move one line forward */ + VerticalScroll(bar, NULL, + (XtPointer)((long) atoi(params[1]) * sblw->scroll.font_height)); + break; + default: + return; + } +} + +/* Function Name: CreateScrollbar + * Description: createst the scrollbar for us. + * Arguments: w - sblw widget. + * Returns: none. + */ + +static void +CreateScrollbar(Widget w) +{ + ScrollByLineWidget sblw = (ScrollByLineWidget) w; + Arg args[5]; + Cardinal num_args = 0; + + if (sblw->scroll.bar != NULL) + return; + + XtSetArg(args[num_args], XtNorientation, XtorientVertical); num_args++; + + sblw->scroll.bar = XtCreateWidget("scrollbar", scrollbarWidgetClass, w, + args, num_args); + XtAddCallback(sblw->scroll.bar, XtNscrollProc, VerticalScroll, NULL); + XtAddCallback(sblw->scroll.bar, XtNjumpProc, VerticalJump, NULL); +} + +/* Function Name: ScrollVerticalText + * Description: This accomplished the actual movement of the text. + * Arguments: w - the ScrollByLine Widget. + * new_line - the new location for the line pointer + * force_redisplay - should we force this window to get + * redisplayed? + * Returns: True if the thumb needs to be moved. + */ + +static Boolean +ScrollVerticalText( +Widget w, +int new_line, +Boolean force_redisp) +{ + ScrollByLineWidget sblw = (ScrollByLineWidget) w; + int num_lines = sblw->scroll.num_visible_lines; + int max_lines, old_line; + Boolean move_thumb = FALSE; + +/* + * Do not let the window extend out of bounds. + */ + + if ( new_line < 0) { + new_line = 0; + move_thumb = TRUE; + } + else { + max_lines = sblw->scroll.lines - (int)w->core.height / sblw->scroll.font_height; + AssignMax(max_lines, 0); + + if ( new_line > max_lines ) { + new_line = max_lines; + move_thumb = TRUE; + } + } + +/* + * If forced to redisplay then do a full redisplay and return. + */ + + old_line = sblw->scroll.line_pointer; + sblw->scroll.line_pointer = new_line; /* Set current top of page. */ + + if (force_redisp) + MoveAndClearText(w, 0, /* cause a full redisplay */ 0, 0); + + if (new_line == old_line) + return(move_thumb); + +/* + * Scroll forward. + */ + + else if (new_line < old_line) { + int lines_to_scroll = old_line - new_line; + MoveAndClearText(w, 0, num_lines - lines_to_scroll, lines_to_scroll); + } + +/* + * Scroll back. + */ + + else { + int lines_to_scroll = new_line - old_line; + MoveAndClearText(w, lines_to_scroll, num_lines - lines_to_scroll, 0); + } + + return(move_thumb); +} + +/* Function Name: MoveAndClearText + * Description: Blits as much text as it can and clear the + * remaining area with generate exposures TRUE. + * Arguments: w - the sbl widget. + * old_y - the old y position. + * height - height of area to move. + * new_y - new y position. + * Returns: none + */ + +static void +MoveAndClearText(Widget w, int old_y, int height, int new_y) +{ + ScrollByLineWidget sblw = (ScrollByLineWidget) w; + int from_left = sblw->scroll.indent + sblw->scroll.offset - 1; + int y_clear; + + old_y *= sblw->scroll.font_height; + new_y *= sblw->scroll.font_height; + height *= sblw->scroll.font_height; + +/* + * If we are already at the right location then do nothing. + * (height == 0). + * + * If we have scrolled more than a screen height then just clear + * the window. + */ + + if (height <= sblw->scroll.font_height) { /* avoid rounding errors. */ + XClearArea( XtDisplay(w), XtWindow(w), from_left, 0, + (unsigned int) 0, (unsigned int) 0, FALSE); + PaintText(w, 0, (int) sblw->core.height); + return; + } + + if ((int)height + (int)old_y > (int)w->core.height) + height = w->core.height - old_y; + + XCopyArea(XtDisplay(w), XtWindow(w), XtWindow(w), sblw->scroll.move_gc, + from_left, old_y, + (unsigned int) w->core.width - from_left, (unsigned int) height, + from_left, new_y); + + if (old_y > new_y) + height -= sblw->scroll.font_height/2; /* clear 1/2 font of extra space, + to make sure we don't lose or + gain decenders. */ + else + height -= sblw->scroll.font_height; /* clear 1 font of extra space, + to make sure we don't overwrite + with a last line in buffer. */ + + if (old_y > new_y) + y_clear = height; + else + y_clear = 0; + +/* + * We cannot use generate exposures, since that may allow another move and + * clear before the area get repainted, this would be bad. + */ + + XClearArea( XtDisplay(w), XtWindow(w), from_left, y_clear, + (unsigned int) 0, (unsigned int) (w->core.height - height), + FALSE); + PaintText(w, (int) y_clear, (int) (w->core.height - height)); +} + +/* Function Name: SetThumbHeight + * Description: Set the height of the thumb. + * Arguments: w - the sblw widget. + * Returns: none + */ + +static void +SetThumbHeight(Widget w) +{ + ScrollByLineWidget sblw = (ScrollByLineWidget) w; + float shown; + + if (sblw->scroll.bar == NULL) + return; + + if (sblw->scroll.lines == 0) + shown = 1.0; + else + shown = (float) w->core.height / (float) (sblw->scroll.lines * + sblw->scroll.font_height); + if (shown > 1.0) + shown = 1.0; + + XawScrollbarSetThumb( sblw->scroll.bar, (float) -1, shown ); +} + +/* Function Name: SetThumb + * Description: Set the thumb location. + * Arguments: w - the sblw. + * Returns: none + */ + +static void +SetThumb(Widget w) +{ + float location; + ScrollByLineWidget sblw = (ScrollByLineWidget) w; + + if ( (sblw->scroll.lines == 0) || (sblw->scroll.bar == NULL) ) + return; + + location = (float) sblw->scroll.line_pointer / (float) sblw->scroll.lines; + XawScrollbarSetThumb( sblw->scroll.bar, location , (float) -1 ); +} + +/* Function Name: VerticalJump. + * Description: This function moves the test + * as the vertical scroll bar is moved. + * Arguments: w - the scrollbar widget. + * junk - not used. + * percent - the position of the scrollbar. + * Returns: none. + */ + +/* ARGSUSED */ +static void +VerticalJump(Widget w, XtPointer junk, XtPointer percent_ptr) +{ + float percent = *((float *) percent_ptr); + int new_line; /* The new location for the line pointer. */ + ScrollByLineWidget sblw = (ScrollByLineWidget) XtParent(w); + + new_line = (int) ((float) sblw->scroll.lines * percent); + if (ScrollVerticalText( (Widget) sblw, new_line, FALSE)) + SetThumb((Widget) sblw); +} + +/* Function Name: VerticalScroll + * Description: This function moves the postition of the interior window + * as the vertical scroll bar is moved. + * Arguments: w - the scrollbar widget. + * junk - not used. + * pos - the position of the cursor. + * Returns: none. + */ + +/* ARGSUSED */ +static void +VerticalScroll(Widget w, XtPointer client_data, XtPointer call_data) +{ + int pos = (int)(long) call_data; + int new_line; /* The new location for the line pointer. */ + ScrollByLineWidget sblw = (ScrollByLineWidget) XtParent(w); + + new_line = sblw->scroll.line_pointer + (pos / sblw->scroll.font_height); + (void) ScrollVerticalText( (Widget) sblw, new_line, FALSE); + SetThumb( (Widget) sblw); +} + +/* ARGSUSED */ +static void +Initialize(Widget req, Widget new, ArgList args, Cardinal *num_args) +{ + ScrollByLineWidget sblw = (ScrollByLineWidget) new; + unsigned long figWidth; + Atom atomNum; + + sblw->scroll.top_line = NULL; + sblw->scroll.line_pointer = 0; + LoadFile(new); + sblw->scroll.bar = (Widget) NULL; + + sblw->scroll.font_height = (sblw->scroll.normal_font->max_bounds.ascent + + sblw->scroll.normal_font->max_bounds.descent); + + atomNum = XInternAtom(XtDisplay(req), "FIGURE_WIDTH", False); + + if (XGetFontProperty(sblw->scroll.normal_font, atomNum, &figWidth)) + sblw->scroll.h_width = figWidth; + else + sblw->scroll.h_width = XTextWidth(sblw->scroll.normal_font, "$", 1); +} /* Initialize. */ + +/* Function Name: CreateGCs + * Description: Creates the graphics contexts that we need. + * Arguments: w - the sblw. + * Returns: none + */ + +static void +CreateGCs(Widget w) +{ + ScrollByLineWidget sblw = (ScrollByLineWidget) w; + + XtGCMask mask; + XGCValues values; + + values.graphics_exposures = TRUE; + sblw->scroll.move_gc = XtGetGC(w, GCGraphicsExposures, &values); + + mask = GCForeground | GCFont; + values.foreground = sblw->scroll.foreground; + + values.font = sblw->scroll.normal_font->fid; + sblw->scroll.normal_gc = XtGetGC(w, mask, &values); + + values.font = sblw->scroll.italic_font->fid; + sblw->scroll.italic_gc = XtGetGC(w, mask, &values); + + values.font = sblw->scroll.bold_font->fid; + sblw->scroll.bold_gc = XtGetGC(w, mask, &values); + + values.font = sblw->scroll.symbol_font->fid; + sblw->scroll.symbol_gc = XtGetGC(w, mask, &values); +} + +/* Function Name: DestroyGCs + * Description: removes all gcs for this widget. + * Arguments: w - the widget. + * Returns: none + */ + +static void +DestroyGCs(Widget w) +{ + ScrollByLineWidget sblw = (ScrollByLineWidget) w; + + XtReleaseGC(w, sblw->scroll.normal_gc); + XtReleaseGC(w, sblw->scroll.bold_gc); + XtReleaseGC(w, sblw->scroll.italic_gc); + XtReleaseGC(w, sblw->scroll.move_gc); +} + +static void +Realize(Widget w, Mask *valueMask, XSetWindowAttributes *attributes) +{ + ScrollByLineWidget sblw = (ScrollByLineWidget) w; + + CreateScrollbar(w); + CreateGCs(w); + Layout(w); + (*SuperClass->core_class.realize) (w, valueMask, attributes); + XtRealizeWidget(sblw->scroll.bar); /* realize scrollbar. */ + XtMapWidget(sblw->scroll.bar); /* map scrollbar. */ + + XtAddEventHandler(w, 0, TRUE, GExpose, NULL); /* Get Graphics Exposures */ +} /* Realize */ + +/* Function Name: Destroy + * Description: Cleans up when we are killed. + * Arguments: w - the widget. + * Returns: none + */ + +static void +Destroy(Widget w) +{ + ScrollByLineWidget sblw = (ScrollByLineWidget) w; + + if (sblw->scroll.bar != NULL) + XtDestroyWidget(sblw->scroll.bar); /* Destroy scrollbar. */ + if (sblw->scroll.file != NULL) + fclose(sblw->scroll.file); + DestroyGCs(w); +} + +/* + * + * Set Values + * + */ + +/* ARGSUSED */ +static Boolean +SetValuesHook(Widget w, ArgList args, Cardinal *num_args) +{ + Boolean ret = TRUE; + Cardinal i; + + for (i = 0; i < *num_args; i++) { + if (strcmp(XtNfile, args[i].name) == 0) { + LoadFile(w); + ret = TRUE; + } + } + +/* + * Changing anthing else will have strange effects, I don't need it so + * I didn't code it. + */ + + return(ret); + +} /* Set Values */ + +/* + * A little design philosophy is probabally wise to include at this point. + * + * One of the things that I has hoped to achieve with xman is to make the + * viewing of manpage not only easy for the nieve user, but also fast for + * the experienced user, I wanted to be able to use it too. To achieve this + * I end up sacrificing a bit of start up time for the manual data structure. + * As well as, the overhead of reading the entire file before putting it up + * on the display. This is actually hardly even noticeable since most manual + * pages are shots, one to two pages - the notable exception is of course csh, + * but then that should be broken up anyway. + * + * METHOD: + * + * I allocate a chunk of space that is the size of the file, plus a null for + * debugging. Then copiesthe file into this chunk of memory. I then allocate + * an array of char*'s that are assigned to the beginning of each line. Yes, + * this means that I have to read the file twice, and could probabally be more + * clever about it, but once it is in memory the second read is damn fast. + * There are a few obsucrities here about guessing the number of lines and + * reallocing if I guess wrong, but other than that it is pretty straight + * forward. + * + * Chris Peterson + * 1/27/88 + */ + +#define ADD_MORE_MEM 100 /* first guesses for allocations. */ +#define CHAR_PER_LINE 40 + +/* Function Name: LoadFile + * Description: Loads the current file into the internal memory. + * Arguments: w - the sblw. + * Returns: none + */ + +static void +LoadFile(Widget w) +{ + ScrollByLineWidget sblw = (ScrollByLineWidget) w; + FILE * file = sblw->scroll.file; + + char *page; + char **line_pointer,**top_line; /* pointers to beginnings of the + lines of the file. */ + int nlines; /* the current number of allocated lines. */ + struct stat fileinfo; /* file information from fstat. */ + + if ( sblw->scroll.top_line != NULL) { + XtFree(*(sblw->scroll.top_line)); /* free characters. */ + XtFree((char *)(sblw->scroll.top_line)); /* free lines. */ + } + sblw->scroll.top_line = NULL; + + if (file == NULL) + return; + +/* + * Get file size and allocate a chunk of memory for the file to be + * copied into. + */ + + if (fstat(fileno(file), &fileinfo)) + XtAppError(XtWidgetToApplicationContext(w), + "SBLW LoadFile: Failure in fstat."); + +/* + * Allocate a space for a list of pointer to the beginning of each line. + */ + + if ( (nlines = fileinfo.st_size/CHAR_PER_LINE) == 0) + return; + + page = XtMalloc(fileinfo.st_size + 1); /* leave space for the NULL */ + top_line = line_pointer = (char**) XtMalloc( nlines * sizeof(char *) ); + +/* + * Copy the file into memory. + */ + + fseek(file, 0L, SEEK_SET); + if (fread(page, sizeof(char), fileinfo.st_size, file) == 0) + XtAppError(XtWidgetToApplicationContext(w), + "SBLW LoadFile: Failure in fread."); + + +/* put NULL at end of buffer. */ + + *(page + fileinfo.st_size) = '\0'; + +/* + * Go through the file setting a line pointer to the character after each + * new line. If we run out of line pointer space then realloc that space + * with space for more lines. + */ + + *line_pointer++ = page; /* first line points to first char in buffer.*/ + while (*page != '\0') { + + if ( *page == '\n' ) { + *line_pointer++ = page + 1; + + if (line_pointer >= top_line + nlines) { + top_line = (char **) XtRealloc( (char *)top_line, (nlines + + ADD_MORE_MEM) * sizeof(char *) ); + line_pointer = top_line + nlines; + nlines += ADD_MORE_MEM; + } + } + page++; + } + +/* + * Realloc the line pointer space to take only the minimum amount of memory + */ + + sblw->scroll.lines = nlines = line_pointer - top_line - 1; + top_line = (char **) XtRealloc((char *)top_line, nlines * sizeof(char *)); + +/* + * Store the memory pointers + */ + + sblw->scroll.top_line = top_line; + sblw->scroll.line_pointer = 0; + SetThumbHeight(w); + SetThumb(w); +} + +#define NLINES 66 /* This is the number of lines to wait until + we boldify the line again, this allows + me to bold the first line of each page.*/ +#define BACKSPACE 010 /* I doubt you would want to change this. */ + +#define NORMAL 0 +#define BOLD 1 +#define ITALIC 2 +#define SYMBOL 3 +#define WHICH(italic, bold) ((bold) ? BOLD : ((italic) ? ITALIC : NORMAL)) + /* Choose BOLD over ITALICS. If neither */ + /* is chosen, use NORMAL. */ + +static int DumpText(Widget w, int x_loc, int y_loc, char * buf, int len, int format); +static Boolean Boldify(char *); + +/* Function Name: PrintText + * Description: This function actually prints the text. + * Arguments: w - the ScrollByLine widget. + * start_line - line to start printing, + * num_lines - the number of lines to print. + * location - the location to print the text. + * Returns: none. + */ + +/* ARGSUSED */ + +static void +PrintText(Widget w, int start_line, int num_lines, int location) +{ + ScrollByLineWidget sblw = (ScrollByLineWidget) w; + + register char *bufp, *c; /* Generic char pointers */ + int current_line; /* the number of the currrent line */ + char buf[BUFSIZ]; /* Misc. characters */ + Boolean italicflag = FALSE; /* Print text in italics?? */ + Boolean first = TRUE; /* First line of a manual page??? */ + int x_loc, y_loc; /* x and y location of text. */ + +/* + * For table hack + * To get columns to line up reasonably in most cases, make the + * assumption that they were lined up using lots of spaces, where + * lots is greater than two. Use a space width of 70% of the + * widest character in the font. + */ + int h_col, h_fix; + char * h_c; + +/* + * Nothing loaded, take no action. + */ + + if (sblw->scroll.top_line == NULL || num_lines == 0) + return; + + current_line = start_line; + +/* Set the first character to print at the first line. */ + + c = *(sblw->scroll.top_line + start_line); + +/* + * Because XDrawString uses the bottom of the text as a position + * reference, add the height from the top of the font to the baseline + * to the ScollByLine position reference. + */ + + y_loc = location + sblw->scroll.normal_font->max_bounds.ascent; + +/* + * Ok, here's the more than mildly heuristic man page formatter. + * We put chars into buf until either a font change or newline + * occurs (at which time we flush it to the screen.) + */ + + + bufp = buf; + x_loc = sblw->scroll.offset + sblw->scroll.indent; + h_col = 0; + +/* + * A fix: + * Assume that we are always starting to print on or before the + * first line of a page, and then prove it if we aren't. + */ + for (h_fix = 1; h_fix <= (start_line % NLINES); h_fix++) + if (**(sblw->scroll.top_line + start_line - h_fix) != '\n') + { + first = FALSE; + break; + } + + while(TRUE) { + if (current_line % NLINES == 0) + first = TRUE; + +/* + * Lets make sure that we do not run out of space in our buffer, making full + * use of it is not critical since no window will be wide enough to display + * nearly BUFSIZ characters. + */ + + if ( (bufp - buf) > (BUFSIZ - 10) ) + /* Toss everything until we find a <CR> or the end of the buffer. */ + while ( (*c != '\n') && (*c != '\0') ) c++; + + switch(*c) { + + case '\0': /* If we reach the end of the file then return */ + DumpText(w, x_loc, y_loc, buf, bufp - buf, WHICH(italicflag, first)); + return; + + case '\n': + if (bufp != buf) { + Boolean bold; + *bufp = '\0'; /* for Boldify. */ + bold = ( (first) || ((x_loc == (sblw->scroll.offset + + sblw->scroll.indent)) && Boldify(buf)) ); + + (void) DumpText(w, x_loc, y_loc, buf, bufp - buf, + WHICH(italicflag, bold)); + + if (bold) + first = FALSE; + } + +/* + * If we have painted the required number of lines then we should now return. + */ + if (++current_line == start_line + num_lines ) + return; + + bufp = buf; + italicflag = FALSE; + x_loc = sblw->scroll.offset + sblw->scroll.indent; + h_col = 0; + y_loc += sblw->scroll.font_height; + break; + +/* + * This tab handling code is not very clever it moves the cursor over + * to the next boundry of eight (8) spaces, as calculated in width just + * before the printing loop started. + */ + + case '\t': /* TAB */ + x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf, + WHICH(italicflag, first)); + h_col += bufp - buf; + bufp = buf; + italicflag = FALSE; + x_loc = sblw->scroll.offset + sblw->scroll.indent; + h_col = h_col + 8 - (h_col%8); + x_loc += sblw->scroll.h_width * h_col; + break; + + case ' ': + h_c = c + 1; + while (*h_c == ' ') h_c++; + + if (h_c - c < 4) + { + *bufp++ = *c; + break; + } + + x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf, + WHICH(italicflag, first)); + h_col += bufp - buf; + bufp = buf; + italicflag = FALSE; + + x_loc = sblw->scroll.offset + sblw->scroll.indent; + h_col += (h_c - c); + x_loc += sblw->scroll.h_width * h_col; + c = h_c - 1; + break; + + case '\033': /* ignore esc sequences for now */ + c++; /* should always be esc-x */ + break; + +/* + * Overstrike code supplied by: cs.utexas.edu!ut-emx!clyde@rutgers.edu + * Since my manual pages do not have overstrike I couldn't test this. + */ + + case BACKSPACE: /* Backspacing for nroff bolding */ + if (c[-1] == c[1] && c[1] != BACKSPACE) { /* overstriking one char */ + if (bufp > buf) { + bufp--; /* Zap 1st instance of char to bolden */ + x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf, + WHICH(italicflag, FALSE)); + h_col += bufp - buf; + } + bufp = buf; + *bufp++ = c[1]; + x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf, BOLD); + h_col += bufp - buf; + bufp = buf; + first = FALSE; + + /* + * Nroff bolding looks like: + * C\bC\bC\bCN... + * c points to ----^ ^ + * it needs to point to --^ + */ + while (*c == BACKSPACE && c[-1] == c[1]) + c += 2; + c--; /* Back up to previous char */ + } + else { + if ((c[-1] == 'o' && c[1] == '+') /* Nroff bullet */ + || (c[-1] == '+' && c[1] == 'o')) { /* Nroff bullet */ + /* If we run into a bullet, print out */ + /* everything that's accumulated to this */ + /* point, then the bullet, then resume. */ + if (bufp>buf) { + bufp--; + x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf, + WHICH(italicflag, FALSE)); + h_col += bufp - buf; + } + bufp = buf; + *bufp = (char)183; + x_loc = DumpText(w, x_loc, y_loc, buf, 1, SYMBOL); + h_col++; + c++; + } + else { /* 'real' backspace - back up output ptr */ + if (bufp>buf) + bufp--; + } + } + break; + +/* End of contributed overstrike code. */ + + case '_': /* look for underlining [italicize] */ + if(*(c + 1) == BACKSPACE) { + if(!italicflag) { /* font change? */ + if (bufp != buf) { + x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf, NORMAL); + h_col += bufp - buf; + bufp = buf; + } + italicflag = TRUE; + } + c += 2; + *bufp++ = *c; + break; + } + /* else fall through to default, because this was a real underscore. */ + + default: + if(italicflag) { /* font change? */ + if (bufp != buf) { + x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf, + WHICH(italicflag, FALSE)); + h_col += bufp - buf; + bufp = buf; + } + italicflag = FALSE; + } + *bufp++ = *c; + break; + } + c++; + } +} + +/* Function Name: DumpText + * Description: Dumps text to the screen. + * Arguments: w - the widget. + * x_loc - to dump text at. + * y_loc - the y_location to draw_text. + * buf - buffer to dump. + * italic, bold, boolean that tells us which gc to use. + * Returns: x_location of the end of the text. + */ + +static int +DumpText(Widget w, int x_loc, int y_loc, char * buf, int len, int format) +{ + ScrollByLineWidget sblw = (ScrollByLineWidget) w; + GC gc; + XFontStruct * font; + + switch(format) { + + case ITALIC: + gc = sblw->scroll.italic_gc; + font = sblw->scroll.italic_font; + break; + + case BOLD: + gc = sblw->scroll.bold_gc; + font = sblw->scroll.bold_font; + break; + + case SYMBOL: + gc = sblw->scroll.symbol_gc; + font = sblw->scroll.symbol_font; + break; + + default: + gc = sblw->scroll.normal_gc; + font = sblw->scroll.normal_font; + break; + } + + XDrawString(XtDisplay(w), XtWindow(w), gc, x_loc, y_loc, buf, len); + return(x_loc + XTextWidth(font, buf, len)); +} + +/* Function Name: Boldify + * Description: look for keyword. + * Arguments: sp - string pointer. + * Returns: 1 if keyword else 0. + */ + +static Boolean +Boldify(register char *sp) +{ + register char *sp_pointer; + int length,count; + +/* + * If there are not lower case letters in the line the assume it is a + * keyword and boldify it in PrintManpage. + */ + + length = strlen(sp); + for (sp_pointer = sp, count = 0; count < length; sp_pointer++,count++) + if ( !isupper(*sp_pointer) && !isspace(*sp_pointer) ) + return(0); + return(1); +} + +#undef superclass +#undef SuperClass diff --git a/app/xman/ScrollByL.h b/app/xman/ScrollByL.h new file mode 100644 index 000000000..028389393 --- /dev/null +++ b/app/xman/ScrollByL.h @@ -0,0 +1,77 @@ +/* $XConsortium: ScrollByL.h,v 1.7 94/04/17 20:43:48 dave Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ + +#ifndef _XtScrollByLine_h +#define _XtScrollByLine_h + +/*********************************************************************** + * + * ScrollByLine Widget (subclass of Simple) + * + ***********************************************************************/ + +/* + * The default fonts. + */ + +#ifdef ATHENA +#define MANPAGE_NORMAL "fixed" +#define MANPAGE_BOLD "helvetica-bold12" +#define MANPAGE_ITALIC "helvetica-boldoblique12" +#define MANPAGE_SYMBOL "symbol-medium12" +#else +#define MANPAGE_NORMAL "*-new century schoolbook-medium-r-normal--*-120-*" +#define MANPAGE_BOLD "*-new century schoolbook-bold-r-normal--*-120-*" +#define MANPAGE_ITALIC "*-new century schoolbook-bold-i-normal--*-120-*" +#define MANPAGE_SYMBOL "*-symbol-medium-r-normal--*-120-*" +#endif /* ATHENA */ + +#define XtNindent "indent" +#define XtNforceVert "forceVert" +#define XtNmanualFontNormal "manualFontNormal" +#define XtNmanualFontBold "manualFontBold" +#define XtNmanualFontItalic "manualFontItalic" +#define XtNmanualFontSymbol "manualFontSymbol" +#define XtNNumTotalLines "numTotalLines" +#define XtNNumVisibleLines "numVisibleLines" + +#define XtCIndent "Indent" +#define XtCNumTotalLines "NumTotalLines" +#define XtCNumVisibleLines "NumVisibleLines" + +/* Class record constants */ + +extern WidgetClass scrollByLineWidgetClass; + +typedef struct _ScrollByLineClassRec *ScrollByLineWidgetClass; +typedef struct _ScrollByLineRec *ScrollByLineWidget; + +#endif /* _XtScrollByLine_h --- DON'T ADD STUFF AFTER THIS LINE */ diff --git a/app/xman/ScrollByLP.h b/app/xman/ScrollByLP.h new file mode 100644 index 000000000..25402d7a2 --- /dev/null +++ b/app/xman/ScrollByLP.h @@ -0,0 +1,100 @@ +/* $XConsortium: ScrollByLP.h,v 1.9 94/04/17 20:43:49 keith Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ + + +#ifndef _XtScrollByLinePrivate_h +#define _XtScrollByLinePrivate_h + +#include <X11/Xaw/SimpleP.h> + +#include "ScrollByL.h" + +/*********************************************************************** + * + * ScrollByLine Widget Private Data + * + ***********************************************************************/ + +/* New fields for the ScrollByLine widget class record */ +typedef struct { + int mumble; /* No new procedures */ +} ScrollByLineClassPart; + +/* Full class record declaration */ +typedef struct _ScrollByLineClassRec { + CoreClassPart core_class; + SimpleClassPart simple_class; + ScrollByLineClassPart scrolled_widget_class; +} ScrollByLineClassRec; + +extern ScrollByLineClassRec scrollByLineClassRec; + +/* New fields for the ScrollByLine widget record */ +typedef struct _ScrollByLinePart { + Pixel foreground; /* The color for the forground of the text. */ + Boolean force_vert, /* Must have scrollbar visable */ + use_right; /* put scroll bar on right side of window. */ + FILE * file; /* The file to display. */ + Dimension indent; /* amount to indent the file. */ + XFontStruct * bold_font, /* The four fonts. */ + * normal_font, + * italic_font, + * symbol_font; + int h_width; /* Main font width */ + +/* variables not in resource list. */ + + Widget bar; /* The scrollbar. */ + int font_height; /* the height of the font. */ + int line_pointer; /* The line that currently is at the top + of the window being displayed. */ + Dimension offset; /* Drawing offset because of scrollbar. */ + GC move_gc; /* GC to use when moving the text. */ + GC bold_gc, normal_gc, italic_gc, symbol_gc; /* gc for drawing. */ + + char ** top_line; /* The top line of the file. */ + int lines; /* Total number of line in the file. */ + int num_visible_lines; /* Number of lines visible */ +} ScrollByLinePart; + +/**************************************************************** + * + * Full instance record declaration + * + ****************************************************************/ + +typedef struct _ScrollByLineRec { + CorePart core; + SimplePart simple; + ScrollByLinePart scroll; +} ScrollByLineRec; + +#endif /* _XtScrollByLinePrivate_h --- DON'T ADD STUFF AFTER THIS LINE */ diff --git a/app/xman/Xman-noxprint.ad b/app/xman/Xman-noxprint.ad new file mode 100644 index 000000000..3f08b0272 --- /dev/null +++ b/app/xman/Xman-noxprint.ad @@ -0,0 +1,195 @@ +*input: True + +*topBox: True +*topBox.Title: Xman +*topBox.IconName: Xman + +*manualBrowser.Title: Manual Page +*manualBrowser.IconName: Manual Page +*manualBrowser.geometry: 600x600 + +*manualFontBold: -*-courier-bold-r-*-*-*-120-*-*-*-*-*-* +*manualFontItalic: -*-courier-medium-o-*-*-*-120-*-*-*-*-*-* +*manualFontNormal: -*-courier-medium-r-*-*-*-120-*-*-*-*-*-* +*manualFontSymbol: -*-symbol-*-*-*-*-*-120-*-*-*-*-*-* +!*directoryFontNormal: -*-courier-medium-r-*-*-*-120-*-*-*-*-*-* +*directoryFontNormal: -*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-* +!*directoryFontNormal: -*-lucida-bold-r-*-*-*-120-*-*-*-*-*-* + +!*SimpleMenu.BackingStore: Always +!*SimpleMenu.SaveUnder: Off + +*horizPane.orientation: horizontal +*horizPane*showGrip: False +*horizPane.min: 22 +*horizPane.max: 22 +*topLabel.BorderWidth: 0 +*search*label.BorderWidth: 0 + +*search*dialog*value: Xman + +!*optionMenu.Label: Options +!*sectionMenu.Label: Sections + +*horizPane*options.Label: Options +*horizPane*sections.Label: Sections + +*helpButton.Label: Help +*helpButton.Tip: Open help browser + +*quitButton.Label: Quit +*quitButton.Tip: Quit Xman + +*manpageButton.Label: Manual Page +*manpageButton.Tip: Open new manpage browser + +*topLabel.Label: Manual Browser + +!*SimpleMenu*menuLabel*vertSpace: 100 +!*SimpleMenu*menuLabel*leftMargin: 20 + +*displayDirectory.Label: Display Directory +*displayManualPage.Label: Display Manual Page +*help.Label: Help +*help.geometry: 600x600 +*search.Label: Search +*removeThisManpage.Label: Remove This Manpage +*help*removeThisManpage.Label: Remove Help +*openNewManpage.Label: Open New Manpage +*showVersion.Label: Show Version +*quit.Label: Quit + +*pleaseStandBy*Label: Formatting Manual Page, Please Stand By... + +*search*dialog.Label: Type string to search for: +*search*apropos.Label: Apropos +*search*manualPage.Label: Manual Page +*search*cancel.Label: Cancel + +*likeToSave*dialog.Label: Would you like to save this formatted Manual Page? +*likeToSave*yes.Label: Yes +*likeToSave*no.Label: No + +*translations: #override \ + Ctrl<Key>q: Quit() \n\ + Ctrl<Key>c: Quit() \n\ + Ctrl<Key>n: CreateNewManpage() \n\ + Ctrl<Key>h: PopupHelp() \n\ + Ctrl<Key>s: PopupSearch() + +*help*Paned.manualPage.translations:#override \ + Ctrl<Btn1Down>: \ + XawPositionSimpleMenu(optionMenu) \ + MenuPopup(optionMenu) \n\ + Ctrl<Key>q: Quit() \n\ + Ctrl<Key>c: Quit() \n\ + Ctrl<Key>r: RemoveThisManpage() \n\ + Ctrl<Key>n: CreateNewManpage() \n\ + Ctrl<Key>h: PopupHelp() \n\ + Ctrl<Key>d: GotoPage(Directory) \n\ + Ctrl<Key>m: GotoPage(ManualPage) \n\ + Ctrl<Key>v: ShowVersion() \n\ + <Key>Prior: Page(Back) \n\ + <Key>Next : Page(Forward) \n\ + Shift<Btn4Down>,<Btn4Up>: Page(Line,-1) \n\ + Shift<Btn5Down>,<Btn5Up>: Page(Line,1) \n\ + Ctrl<Btn4Down>,<Btn4Up>: Page(Back) \n\ + Ctrl<Btn5Down>,<Btn5Up>: Page(Forward) \n\ + None<Btn4Down>,<Btn4Up>: Page(Line,-5) \n\ + None<Btn5Down>,<Btn5Up>: Page(Line,5) + +*manualBrowser*manualPage.translations: #override \ + Ctrl<Btn1Down>: \ + XawPositionSimpleMenu(optionMenu) \ + MenuPopup(optionMenu) \n\ + Ctrl<Btn2Down>: \ + XawPositionSimpleMenu(sectionMenu) \ + MenuPopup(sectionMenu) \n\ + Shift<Btn2Down>,<Btn2Up>:GotoPage(Directory)\n\ + Ctrl<Key>q: Quit() \n\ + Ctrl<Key>c: Quit() \n\ + Ctrl<Key>r: RemoveThisManpage() \n\ + Ctrl<Key>n: CreateNewManpage() \n\ + Ctrl<Key>h: PopupHelp() \n\ + Ctrl<Key>d: GotoPage(Directory) \n\ + Ctrl<Key>m: GotoPage(ManualPage) \n\ + Ctrl<Key>v: ShowVersion() \n\ + <Key>Prior: Page(Back) \n\ + <Key>Next : Page(Forward) \n\ + Shift<Btn4Down>,<Btn4Up>: Page(Line,-1) \n\ + Shift<Btn5Down>,<Btn5Up>: Page(Line,1) \n\ + Ctrl<Btn4Down>,<Btn4Up>: Page(Back) \n\ + Ctrl<Btn5Down>,<Btn5Up>: Page(Forward) \n\ + None<Btn4Down>,<Btn4Up>: Page(Line,-5) \n\ + None<Btn5Down>,<Btn5Up>: Page(Line,5) \n\ + Ctrl<Key>s: PopupSearch() + +!*manualBrowser*directory.background: Grey80 +*manualBrowser*directory.translations: #override \ + Ctrl<Btn1Down>: \ + XawPositionSimpleMenu(optionMenu) \ + MenuPopup(optionMenu) \n\ + Ctrl<Btn2Down>: \ + XawPositionSimpleMenu(sectionMenu) \ + MenuPopup(sectionMenu) \n\ + Shift<Btn2Down>,<Btn2Up>: GotoPage(Manpage) \n\ + Ctrl<Key>q: Quit() \n\ + Ctrl<Key>c: Quit() \n\ + Ctrl<Key>r: RemoveThisManpage() \n\ + Ctrl<Key>n: CreateNewManpage() \n\ + Ctrl<Key>h: PopupHelp() \n\ + Ctrl<Key>d: GotoPage(Directory) \n\ + Ctrl<Key>m: GotoPage(ManualPage) \n\ + Ctrl<Key>v: ShowVersion() \n\ + Ctrl<Key>s: PopupSearch() + +*manualBrowser*search*manualPage.translations: #augment \ + <Btn1Down>,<Btn1Up>: Search(Manpage) reset() + +*manualBrowser*search*apropos.translations: #augment \ + <Btn1Down>,<Btn1Up>: Search(Apropos) reset() + +*manualBrowser*search*cancel*translations: #augment \ + <Btn1Down>,<Btn1Up>: Search(Cancel) reset() + +*manualBrowser*search*value*translations: #override \ + <Key>Return: Search(Manpage) \n\ + Ctrl<Key>m: Search(Manpage) + +*topBox*search*manualPage.translations: #augment \ + <Btn1Down>,<Btn1Up>: Search(Manpage, Open) reset() + +*topBox*search*apropos.translations: #augment \ + <Btn1Down>,<Btn1Up>: Search(Apropos, Open) reset() + +*topBox*search*cancel*translations: #augment \ + <Btn1Down>,<Btn1Up>: Search(Cancel, Open) reset() + +*topBox*search*value*translations: #override \ + <Key>Return: Search(Manpage, Open) \n\ + Ctrl<Key>m: Search(Manpage, Open) + +*manualBrowser*likeToSave*yes.translations: #override \ + <Btn1Down>,<Btn1Up>: SaveFormattedPage(Save) reset() \n\ + <Key>y: SaveFormattedPage(Save) \n\ + <Key>n: SaveFormattedPage(Cancel) + +*manualBrowser*likeToSave*no.translations: #override \ + <Btn1Down>,<Btn1Up>: SaveFormattedPage(Cancel) reset() \n\ + <Key>y: SaveFormattedPage(Save) \n\ + <Key>n: SaveFormattedPage(Cancel) + +*manualBrowser*likeToSave*translations: #override \ + <Key>y: SaveFormattedPage(Save) \n\ + <Key>n: SaveFormattedPage(Cancel) + +*helpButton.translations: #augment \ + <Btn1Down>,<Btn1Up>: PopupHelp() reset() + +*quitButton.translations: #augment \ + <Btn1Down>,<Btn1Up>: Quit() reset() + +*manpageButton.translations: #augment \ + <Btn1Down>,<Btn1Up>: CreateNewManpage() reset() + +! EOF. diff --git a/app/xman/Xman-xprint.ad b/app/xman/Xman-xprint.ad new file mode 100644 index 000000000..2598a98b9 --- /dev/null +++ b/app/xman/Xman-xprint.ad @@ -0,0 +1,294 @@ +*input: True + +*topBox: True +*topBox.Title: Xman +*topBox.IconName: Xman + +*manualBrowser.Title: Manual Page +*manualBrowser.IconName: Manual Page +*manualBrowser.geometry: 600x600 + +*manualFontBold: -*-courier-bold-r-*-*-*-120-*-*-*-*-*-* +*manualFontItalic: -*-courier-medium-o-*-*-*-120-*-*-*-*-*-* +*manualFontNormal: -*-courier-medium-r-*-*-*-120-*-*-*-*-*-* +*manualFontSymbol: -*-symbol-*-*-*-*-*-120-*-*-*-*-*-* +!*directoryFontNormal: -*-courier-medium-r-*-*-*-120-*-*-*-*-*-* +*directoryFontNormal: -*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-* +!*directoryFontNormal: -*-lucida-bold-r-*-*-*-120-*-*-*-*-*-* + +!*SimpleMenu.BackingStore: Always +!*SimpleMenu.SaveUnder: Off + +*horizPane.orientation: horizontal +*horizPane*showGrip: False +*horizPane.min: 22 +*horizPane.max: 22 +*topLabel.BorderWidth: 0 +*search*label.BorderWidth: 0 + +*search*dialog*value: Xman + +!*optionMenu.Label: Options +!*sectionMenu.Label: Sections + +*horizPane*options.Label: Options +*horizPane*sections.Label: Sections + +*helpButton.Label: Help +*helpButton.Tip: Open help browser + +*quitButton.Label: Quit +*quitButton.Tip: Quit Xman + +*manpageButton.Label: Manual Page +*manpageButton.Tip: Open new manpage browser + +*topLabel.Label: Manual Browser + +!*SimpleMenu*menuLabel*vertSpace: 100 +!*SimpleMenu*menuLabel*leftMargin: 20 + +*displayDirectory.Label: Display Directory +*displayManualPage.Label: Display Manual Page +*help.Label: Help +*help.geometry: 600x600 +*search.Label: Search +*removeThisManpage.Label: Remove This Manpage +*help*removeThisManpage.Label: Remove Help +*openNewManpage.Label: Open New Manpage +*printManualPage.Label: Print This Manpage +*showVersion.Label: Show Version +*quit.Label: Quit + +*pleaseStandBy*Label: Formatting Manual Page, Please Stand By... + +*search*dialog.Label: Type string to search for: +*search*apropos.Label: Apropos +*search*manualPage.Label: Manual Page +*search*cancel.Label: Cancel + +*likeToSave*dialog.Label: Would you like to save this formatted Manual Page? +*likeToSave*yes.Label: Yes +*likeToSave*no.Label: No + +*translations: #override \ + Ctrl<Key>q: Quit() \n\ + Ctrl<Key>c: Quit() \n\ + Ctrl<Key>n: CreateNewManpage() \n\ + Ctrl<Key>h: PopupHelp() \n\ + Ctrl<Key>s: PopupSearch() + +*help*Paned.manualPage.translations:#override \ + Ctrl<Btn1Down>: \ + XawPositionSimpleMenu(optionMenu) \ + MenuPopup(optionMenu) \n\ + Ctrl<Key>q: Quit() \n\ + Ctrl<Key>c: Quit() \n\ + Ctrl<Key>r: RemoveThisManpage() \n\ + Ctrl<Key>n: CreateNewManpage() \n\ + Ctrl<Key>h: PopupHelp() \n\ + Ctrl<Key>d: GotoPage(Directory) \n\ + Ctrl<Key>m: GotoPage(ManualPage) \n\ + Ctrl<Key>p: PrintThisManpage() \n\ + Ctrl<Key>v: ShowVersion() \n\ + <Key>Prior: Page(Back) \n\ + <Key>Next : Page(Forward) \n\ + Shift<Btn4Down>,<Btn4Up>: Page(Line,-1) \n\ + Shift<Btn5Down>,<Btn5Up>: Page(Line,1) \n\ + Ctrl<Btn4Down>,<Btn4Up>: Page(Back) \n\ + Ctrl<Btn5Down>,<Btn5Up>: Page(Forward) \n\ + None<Btn4Down>,<Btn4Up>: Page(Line,-5) \n\ + None<Btn5Down>,<Btn5Up>: Page(Line,5) + +*manualBrowser*manualPage.translations: #override \ + Ctrl<Btn1Down>: \ + XawPositionSimpleMenu(optionMenu) \ + MenuPopup(optionMenu) \n\ + Ctrl<Btn2Down>: \ + XawPositionSimpleMenu(sectionMenu) \ + MenuPopup(sectionMenu) \n\ + Shift<Btn2Down>,<Btn2Up>:GotoPage(Directory)\n\ + Ctrl<Key>q: Quit() \n\ + Ctrl<Key>c: Quit() \n\ + Ctrl<Key>r: RemoveThisManpage() \n\ + Ctrl<Key>n: CreateNewManpage() \n\ + Ctrl<Key>h: PopupHelp() \n\ + Ctrl<Key>d: GotoPage(Directory) \n\ + Ctrl<Key>m: GotoPage(ManualPage) \n\ + Ctrl<Key>p: PrintThisManpage() \n\ + Ctrl<Key>v: ShowVersion() \n\ + <Key>Prior: Page(Back) \n\ + <Key>Next : Page(Forward) \n\ + Shift<Btn4Down>,<Btn4Up>: Page(Line,-1) \n\ + Shift<Btn5Down>,<Btn5Up>: Page(Line,1) \n\ + Ctrl<Btn4Down>,<Btn4Up>: Page(Back) \n\ + Ctrl<Btn5Down>,<Btn5Up>: Page(Forward) \n\ + None<Btn4Down>,<Btn4Up>: Page(Line,-5) \n\ + None<Btn5Down>,<Btn5Up>: Page(Line,5) \n\ + Ctrl<Key>s: PopupSearch() + +!*manualBrowser*directory.background: Grey80 +*manualBrowser*directory.translations: #override \ + Ctrl<Btn1Down>: \ + XawPositionSimpleMenu(optionMenu) \ + MenuPopup(optionMenu) \n\ + Ctrl<Btn2Down>: \ + XawPositionSimpleMenu(sectionMenu) \ + MenuPopup(sectionMenu) \n\ + Shift<Btn2Down>,<Btn2Up>: GotoPage(Manpage) \n\ + Ctrl<Key>q: Quit() \n\ + Ctrl<Key>c: Quit() \n\ + Ctrl<Key>r: RemoveThisManpage() \n\ + Ctrl<Key>n: CreateNewManpage() \n\ + Ctrl<Key>h: PopupHelp() \n\ + Ctrl<Key>d: GotoPage(Directory) \n\ + Ctrl<Key>m: GotoPage(ManualPage) \n\ + Ctrl<Key>v: ShowVersion() \n\ + Ctrl<Key>s: PopupSearch() + +*manualBrowser*search*manualPage.translations: #augment \ + <Btn1Down>,<Btn1Up>: Search(Manpage) reset() + +*manualBrowser*search*apropos.translations: #augment \ + <Btn1Down>,<Btn1Up>: Search(Apropos) reset() + +*manualBrowser*search*cancel*translations: #augment \ + <Btn1Down>,<Btn1Up>: Search(Cancel) reset() + +*manualBrowser*search*value*translations: #override \ + <Key>Return: Search(Manpage) \n\ + Ctrl<Key>m: Search(Manpage) + +*topBox*search*manualPage.translations: #augment \ + <Btn1Down>,<Btn1Up>: Search(Manpage, Open) reset() + +*topBox*search*apropos.translations: #augment \ + <Btn1Down>,<Btn1Up>: Search(Apropos, Open) reset() + +*topBox*search*cancel*translations: #augment \ + <Btn1Down>,<Btn1Up>: Search(Cancel, Open) reset() + +*topBox*search*value*translations: #override \ + <Key>Return: Search(Manpage, Open) \n\ + Ctrl<Key>m: Search(Manpage, Open) + +*manualBrowser*likeToSave*yes.translations: #override \ + <Btn1Down>,<Btn1Up>: SaveFormattedPage(Save) reset() \n\ + <Key>y: SaveFormattedPage(Save) \n\ + <Key>n: SaveFormattedPage(Cancel) + +*manualBrowser*likeToSave*no.translations: #override \ + <Btn1Down>,<Btn1Up>: SaveFormattedPage(Cancel) reset() \n\ + <Key>y: SaveFormattedPage(Save) \n\ + <Key>n: SaveFormattedPage(Cancel) + +*manualBrowser*likeToSave*translations: #override \ + <Key>y: SaveFormattedPage(Save) \n\ + <Key>n: SaveFormattedPage(Cancel) + +*helpButton.translations: #augment \ + <Btn1Down>,<Btn1Up>: PopupHelp() reset() + +*quitButton.translations: #augment \ + <Btn1Down>,<Btn1Up>: Quit() reset() + +*manpageButton.translations: #augment \ + <Btn1Down>,<Btn1Up>: CreateNewManpage() reset() + +! Use "white" as background for printing +*printshell*background: white + +! Print dialog +*printdialogshell*geometry: 600x120 +*printdialogshell*title: Print +*printdialogshell*main*ok.fromVert: innerform +*printdialogshell*main*ok.label: Print +*printdialogshell*main*ok.tip: Print +*printdialogshell*main*setup.fromHoriz: ok +*printdialogshell*main*setup.fromVert: innerform +*printdialogshell*main*setup.label: Setup... +*printdialogshell*main*setup.tip: Configure print job options (page size, orientation, etc.) +*printdialogshell*main*cancel.fromHoriz: setup +*printdialogshell*main*cancel.fromVert: innerform +*printdialogshell*main*cancel.label: Cancel +*printdialogshell*main*cancel.tip: Cancel printing +*printdialogshell*main*desclabel.label: Printer Description: +*printdialogshell*main*desclabel.tip: Short description of printer +*printdialogshell*main*desc.fromHoriz: desclabel +*printdialogshell*main*desc.tip: Short description of printer +*printdialogshell*main*info.fromHoriz: desc +*printdialogshell*main*info.label: Printer info... +*printdialogshell*main*info.tip: Display additional information about this printer +*printdialogshell*main*namelabel.fromVert: desclabel +*printdialogshell*main*namelabel.label: Printer Name: +*printdialogshell*main*namelabel.tip: Name of selected printer +*printdialogshell*main*name.fromHoriz: namelabel +*printdialogshell*main*name.fromVert: desclabel +*printdialogshell*main*name.tip: Name of selected printer +*printdialogshell*main*selectprinter.fromHoriz: name +*printdialogshell*main*selectprinter.fromVert: desclabel +*printdialogshell*main*selectprinter.label: Select Printer... +*printdialogshell*main*selectprinter.label: Select Printer... +*printdialogshell*main*selectprinter.tip: Select a different printer +*printdialogshell*main*filenamelabel.fromVert: namelabel +*printdialogshell*main*filenamelabel.label: File Name: +*printdialogshell*main*filenamelabel.tip: File where the output should be stored +*printdialogshell*main*filename.fromHoriz: filenamelabel +*printdialogshell*main*filename.fromVert: namelabel +*printdialogshell*main*filename.tip: File where the output should be stored +*printdialogshell*main*selectfile.fromHoriz: filename +*printdialogshell*main*selectfile.fromVert: namelabel +*printdialogshell*main*selectfile.label: Select File... +*printdialogshell*main*selectfile.tip: Select file where the output should be stored +*printdialogshell*main*printtoprinter.fromVert: filenamelabel +*printdialogshell*main*printtoprinter.label: Print to Printer +*printdialogshell*main*printtoprinter.tip: Send print job to printer +*printdialogshell*main*printtofile.fromVert: filenamelabel +*printdialogshell*main*printtofile.fromHoriz: printtoprinter +*printdialogshell*main*printtofile.label: Print to File +*printdialogshell*main*printtofile.tip: Save print job in a file + +! Print job options dialog +*printdialogshell*setup*geometry: 600x400 +*printdialogshell*setup*title: Print: Print job options +*printdialogshell*setup*ok.fromVert: list +*printdialogshell*setup*ok.label: OK +*printdialogshell*setup*ok.tip: Commit changes +*printdialogshell*setup*cancel.fromHoriz: ok +*printdialogshell*setup*cancel.fromVert: list +*printdialogshell*setup*cancel.label: Cancel +*printdialogshell*setup*cancel.tip: Cancel and reset to defaults +*printdialogshell*setup*paperlist.tip: Select paper size +*printdialogshell*setup*resolutionlist.fromHoriz: paperlist +*printdialogshell*setup*resolutionlist.tip: Select page resolution +*printdialogshell*setup*orientationlist.fromHoriz: resolutionlist +*printdialogshell*setup*orientationlist.tip: Select page orientation +*printdialogshell*setup*plexlist.fromHoriz: orientationlist +*printdialogshell*setup*plexlist.tip: Select page plex mode (simplex, duplex, etc.) +*printdialogshell*setup*colorspacelist.fromHoriz: plexlist +*printdialogshell*setup*colorspacelist.tip: Select color space (color, grayscale, CYMK, etc.) +*printdialogshell*setup*jobcopieslabel.fromVert: paperlist +*printdialogshell*setup*jobcopieslabel.tip: Set number of job copies +*printdialogshell*setup*jobcopieslabel.label: Job Copies: +*printdialogshell*setup*jobcopies.fromHoriz: jobcopieslabel +*printdialogshell*setup*jobcopies.fromVert: paperlist +*printdialogshell*setup*jobcopies.tip: Set number of job copies + +! Printer selection +*printdialogshell*printerselection*geometry: 400x150 +*printdialogshell*printerselection*title: Print: Select printer +*printdialogshell*printerselection*ok.fromVert: list +*printdialogshell*printerselection*ok.label: OK +*printdialogshell*printerselection*ok.tip: Switch printer +*printdialogshell*printerselection*cancel.fromHoriz: ok +*printdialogshell*printerselection*cancel.fromVert: list +*printdialogshell*printerselection*cancel.label: Cancel +*printdialogshell*printerselection*cancel.tip: Cancel printer selection +*printdialogshell*printerselection*list.tip: Select printer name from list + +! Select job file +*printdialogshell*selectfile*geometry: 400x80 +*printdialogshell*selectfile*title: Print: Select job file +*printdialogshell*selectfile*dialog.label: Select Filename: + +! EOF. diff --git a/app/xman/aclocal.m4 b/app/xman/aclocal.m4 new file mode 100644 index 000000000..914a58dc6 --- /dev/null +++ b/app/xman/aclocal.m4 @@ -0,0 +1,1431 @@ +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. +# +# 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 program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + if test -n "$$1"; then + pkg_cv_[]$1="$$1" + else + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + fi +else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [$4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES + +dnl Copyright 2005 Red Hat, Inc +dnl +dnl Permission to use, copy, modify, distribute, and sell this software and its +dnl documentation for any purpose is hereby granted without fee, provided that +dnl the above copyright notice appear in all copies and that both that +dnl copyright notice and this permission notice appear in supporting +dnl documentation. +dnl +dnl The above copyright notice and this permission notice shall be included +dnl in all copies or substantial portions of the Software. +dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +dnl OTHER DEALINGS IN THE SOFTWARE. +dnl +dnl Except as contained in this notice, the name of the copyright holders shall +dnl not be used in advertising or otherwise to promote the sale, use or +dnl other dealings in this Software without prior written authorization +dnl from the copyright holders. +dnl + +# XAW_CHECK_XPRINT_SUPPORT() +# -------------------------- +# Adds --enable/disable-xprint and selects the appropriate version of the Xaw +# library. If neither --enable-xprint nor --disable-xprint are given, +# the presence of an Xaw with Xprint support will be auto detected + +AC_DEFUN([XAW_CHECK_XPRINT_SUPPORT],[ + AC_ARG_ENABLE(xprint, AC_HELP_STRING([--enable-xprint], [Enable XPrint support]), + [use_xprint=$enableval],[use_xprint=auto]) + if test "x$use_xprint" = "xyes"; then + TMP_CHECK1=xaw8 + TMP_CHECK2= + xaw_use_xprint=yes + elif test "x$use_xprint" = "xno"; then + TMP_CHECK1=xaw7 + TMP_CHECK2= + xaw_use_xprint=no + else + TMP_CHECK1=xaw8 + TMP_CHECK2=xaw7 + xaw_use_xprint=yes + fi + + PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK1, success=yes, success=no) + if [[ ! -z $TMP_CHECK2 ]] ; then + if test $success = no ; then + PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK2, success=yes, success=no) + xaw_use_xprint=no + fi + fi + + if test "x$success" = "xyes"; then + $1_CFLAGS=$TMP_XAW_CFLAGS + $1_LIBS=$TMP_XAW_LIBS + + AM_CONDITIONAL([XAW_USE_XPRINT], [test "x$xaw_use_xprint" = "xyes"]) + else + AC_MSG_ERROR([No suitable version of Xaw found]) + fi +]) + +dnl $Id: aclocal.m4,v 1.1 2006/11/25 20:50:34 matthieu Exp $ +dnl +dnl Copyright 2005 Sun Microsystems, Inc. All rights reserved. +dnl +dnl Permission to use, copy, modify, distribute, and sell this software and its +dnl documentation for any purpose is hereby granted without fee, provided that +dnl the above copyright notice appear in all copies and that both that +dnl copyright notice and this permission notice appear in supporting +dnl documentation. +dnl +dnl The above copyright notice and this permission notice shall be included +dnl in all copies or substantial portions of the Software. +dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +dnl OTHER DEALINGS IN THE SOFTWARE. +dnl +dnl Except as contained in this notice, the name of the copyright holders shall +dnl not be used in advertising or otherwise to promote the sale, use or +dnl other dealings in this Software without prior written authorization +dnl from the copyright holders. +dnl + +# XORG_PROG_RAWCPP() +# ------------------ +# Find cpp program and necessary flags for use in pre-processing text files +# such as man pages and config files +AC_DEFUN([XORG_PROG_RAWCPP],[ +AC_REQUIRE([AC_PROG_CPP]) +AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], + [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) + +# Check for flag to avoid builtin definitions - assumes unix is predefined, +# which is not the best choice for supporting other OS'es, but covers most +# of the ones we need for now. +AC_MSG_CHECKING([if $RAWCPP requires -undef]) +AC_LANG_CONFTEST([Does cpp redefine unix ?]) +if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then + AC_MSG_RESULT([no]) +else + if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then + RAWCPPFLAGS=-undef + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) + fi +fi +rm -f conftest.$ac_ext + +AC_MSG_CHECKING([if $RAWCPP requires -traditional]) +AC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) +if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then + AC_MSG_RESULT([no]) +else + if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then + RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) + fi +fi +rm -f conftest.$ac_ext +AC_SUBST(RAWCPPFLAGS) +]) # XORG_PROG_RAWCPP + +# XORG_MANPAGE_SECTIONS() +# ----------------------- +# Determine which sections man pages go in for the different man page types +# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. +# Not sure if there's any better way than just hardcoding by OS name. +# Override default settings by setting environment variables + +AC_DEFUN([XORG_MANPAGE_SECTIONS],[ +AC_REQUIRE([AC_CANONICAL_HOST]) + +if test x$APP_MAN_SUFFIX = x ; then + case $host_os in + linux*) APP_MAN_SUFFIX=1x ;; + *) APP_MAN_SUFFIX=1 ;; + esac +fi +if test x$APP_MAN_DIR = x ; then + case $host_os in + linux*) APP_MAN_DIR='$(mandir)/man1' ;; + *) APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' ;; + esac +fi + +if test x$LIB_MAN_SUFFIX = x ; then + case $host_os in + linux*) LIB_MAN_SUFFIX=3x ;; + *) LIB_MAN_SUFFIX=3 ;; + esac +fi +if test x$LIB_MAN_DIR = x ; then + case $host_os in + linux*) LIB_MAN_DIR='$(mandir)/man3' ;; + *) LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' ;; + esac +fi + +if test x$FILE_MAN_SUFFIX = x ; then + case $host_os in + linux*) FILE_MAN_SUFFIX=5x ;; + solaris*) FILE_MAN_SUFFIX=4 ;; + *) FILE_MAN_SUFFIX=5 ;; + esac +fi +if test x$FILE_MAN_DIR = x ; then + case $host_os in + linux*) FILE_MAN_DIR='$(mandir)/man5' ;; + *) FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' ;; + esac +fi + +# In Imake's linux.cf, the misc man suffix & dir was only changed for +# LinuxDebian, not other Linuxes, so we leave it unchanged here +if test x$MISC_MAN_SUFFIX = x ; then + case $host_os in +# linux*) MISC_MAN_SUFFIX=7x ;; + solaris*) MISC_MAN_SUFFIX=5 ;; + *) MISC_MAN_SUFFIX=7 ;; + esac +fi +if test x$MISC_MAN_DIR = x ; then + case $host_os in +# linux*) MISC_MAN_DIR='$(mandir)/man7' ;; + *) MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' ;; + esac +fi + +# In Imake's linux.cf, the driver man suffix & dir was only changed for +# LinuxDebian, not other Linuxes, so we leave it unchanged here +if test x$DRIVER_MAN_SUFFIX = x ; then + case $host_os in +# linux*) DRIVER_MAN_SUFFIX=4x ;; + solaris*) DRIVER_MAN_SUFFIX=7 ;; + *) DRIVER_MAN_SUFFIX=4 ;; + esac +fi +if test x$DRIVER_MAN_DIR = x ; then + case $host_os in +# linux*) DRIVER_MAN_DIR='$(mandir)/man4' ;; + *) DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' ;; + esac +fi + +if test x$ADMIN_MAN_SUFFIX = x ; then + case $host_os in + solaris*) ADMIN_MAN_SUFFIX=1m ;; + *) ADMIN_MAN_SUFFIX=8 ;; + esac +fi +if test x$ADMIN_MAN_DIR = x ; then + ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' +fi + + +AC_SUBST([APP_MAN_SUFFIX]) +AC_SUBST([LIB_MAN_SUFFIX]) +AC_SUBST([FILE_MAN_SUFFIX]) +AC_SUBST([MISC_MAN_SUFFIX]) +AC_SUBST([DRIVER_MAN_SUFFIX]) +AC_SUBST([ADMIN_MAN_SUFFIX]) +AC_SUBST([APP_MAN_DIR]) +AC_SUBST([LIB_MAN_DIR]) +AC_SUBST([FILE_MAN_DIR]) +AC_SUBST([MISC_MAN_DIR]) +AC_SUBST([DRIVER_MAN_DIR]) +AC_SUBST([ADMIN_MAN_DIR]) +]) # XORG_MANPAGE_SECTIONS + +# XORG_CHECK_LINUXDOC +# ------------------- +# Defines the variable MAKE_TEXT if the necessary tools and +# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. +# Whether or not the necessary tools and files are found can be checked +# with the AM_CONDITIONAL "BUILD_LINUXDOC" +AC_DEFUN([XORG_CHECK_LINUXDOC],[ +AC_CHECK_FILE( + [$prefix/share/X11/sgml/defs.ent], + [DEFS_ENT_PATH=$prefix/share/X11/sgml], + [DEFS_ENT_PATH=] +) + +AC_PATH_PROG(LINUXDOC, linuxdoc) +AC_PATH_PROG(PS2PDF, ps2pdf) + +AC_MSG_CHECKING([Whether to build documentation]) + +if test x$DEFS_ENT_PATH != x && test x$LINUXDOC != x ; then + BUILDDOC=yes +else + BUILDDOC=no +fi + +AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) + +AC_MSG_RESULT([$BUILDDOC]) + +AC_MSG_CHECKING([Whether to build pdf documentation]) + +if test x$PS2PDF != x ; then + BUILDPDFDOC=yes +else + BUILDPDFDOC=no +fi + +AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) + +AC_MSG_RESULT([$BUILDPDFDOC]) + +MAKE_TEXT="SGML_SEARCH_PATH=$DEFS_ENT_PATH GROFF_NO_SGR=y $LINUXDOC -B txt" +MAKE_PS="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B latex --papersize=letter --output=ps" +MAKE_PDF="$PS2PDF" +MAKE_HTML="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B html --split=0" + +AC_SUBST(MAKE_TEXT) +AC_SUBST(MAKE_PS) +AC_SUBST(MAKE_PDF) +AC_SUBST(MAKE_HTML) +]) # XORG_CHECK_LINUXDOC + +# XORG_CHECK_MALLOC_ZERO +# ---------------------- +# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if +# malloc(0) returns NULL. Packages should add one of these cflags to +# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. +AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ +AC_ARG_ENABLE(malloc0returnsnull, + AC_HELP_STRING([--enable-malloc0returnsnull], + [malloc(0) returns NULL (default: auto)]), + [MALLOC_ZERO_RETURNS_NULL=$enableval], + [MALLOC_ZERO_RETURNS_NULL=auto]) + +AC_MSG_CHECKING([whether malloc(0) returns NULL]) +if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then + AC_RUN_IFELSE([ +char *malloc(); +char *realloc(); +char *calloc(); +main() { + char *m0, *r0, *c0, *p; + m0 = malloc(0); + p = malloc(10); + r0 = realloc(p,0); + c0 = calloc(0); + exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); +}], + [MALLOC_ZERO_RETURNS_NULL=yes], + [MALLOC_ZERO_RETURNS_NULL=no]) +fi +AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) + +if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then + MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" + XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS + XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" +else + MALLOC_ZERO_CFLAGS="" + XMALLOC_ZERO_CFLAGS="" + XTMALLOC_ZERO_CFLAGS="" +fi + +AC_SUBST([MALLOC_ZERO_CFLAGS]) +AC_SUBST([XMALLOC_ZERO_CFLAGS]) +AC_SUBST([XTMALLOC_ZERO_CFLAGS]) +]) # XORG_CHECK_MALLOC_ZERO + +dnl Copyright 2005 Red Hat, Inc +dnl +dnl Permission to use, copy, modify, distribute, and sell this software and its +dnl documentation for any purpose is hereby granted without fee, provided that +dnl the above copyright notice appear in all copies and that both that +dnl copyright notice and this permission notice appear in supporting +dnl documentation. +dnl +dnl The above copyright notice and this permission notice shall be included +dnl in all copies or substantial portions of the Software. +dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +dnl OTHER DEALINGS IN THE SOFTWARE. +dnl +dnl Except as contained in this notice, the name of the copyright holders shall +dnl not be used in advertising or otherwise to promote the sale, use or +dnl other dealings in this Software without prior written authorization +dnl from the copyright holders. +dnl + +# XORG_RELEASE_VERSION +# -------------------- +# Adds --with/without-release-string and changes the PACKAGE and +# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If +# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. + +AC_DEFUN([XORG_RELEASE_VERSION],[ + AC_ARG_WITH(release-version, + AC_HELP_STRING([--with-release-version=STRING], + [Use release version string in package name]), + [RELEASE_VERSION="$withval"], + [RELEASE_VERSION=""]) + if test "x$RELEASE_VERSION" != "x"; then + PACKAGE="$PACKAGE-$RELEASE_VERSION" + PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" + AC_MSG_NOTICE([Building with package name set to $PACKAGE]) + fi +]) + +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.9.6])]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 7 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. +# +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar <conftest.tar]) + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/app/xman/buttons.c b/app/xman/buttons.c new file mode 100644 index 000000000..13b1e70e9 --- /dev/null +++ b/app/xman/buttons.c @@ -0,0 +1,759 @@ +/* $XConsortium: buttons.c,v 1.33 94/04/17 20:43:50 dave Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ +/* $XFree86: xc/programs/xman/buttons.c,v 1.3 2000/03/03 23:16:26 dawes Exp $ */ + +/* + * xman - X window system manual page display program. + * Author: Chris D. Peterson, MIT Project Athena + * Created: October 27, 1987 + */ + +#include "globals.h" +#include "vendor.h" + +/* The files with the icon bits in them. */ + +#include "icon_open.h" +#include "icon_help.h" +#include "iconclosed.h" + +static void CreateOptionMenu(ManpageGlobals * man_globals, Widget parent); +static void CreateSectionMenu(ManpageGlobals * man_globals, Widget parent); +static void StartManpage(ManpageGlobals * man_globals, Boolean help, Boolean page); +static Widget * ConvertNamesToWidgets(Widget parent, char ** names); + +/* Function Name: MakeTopBox + * Description: This funtion creates the top menu, in a shell widget. + * Arguments: none. + * Returns: the top level widget + */ + +#define TOPARGS 5 + +extern Atom wm_delete_window; /* in main.c */ + +Widget top; /* needed in PopupWarning, misc.c */ + +void +MakeTopBox(void) +{ + Widget form, command, label; /* widgets. */ + Arg arglist[TOPARGS]; /* An argument list */ + Cardinal num_args = 0; /* The number of arguments. */ + ManpageGlobals * man_globals; + static char * full_size[] = { + "topLabel", MANPAGE_BUTTON, NULL + }; + static char * half_size[] = { + HELP_BUTTON, QUIT_BUTTON, NULL + }; + +/* create the top icon. */ + + num_args = 0; + XtSetArg(arglist[num_args], XtNiconPixmap, + XCreateBitmapFromData( XtDisplay(initial_widget), + XtScreen(initial_widget)->root, + (char *)iconclosed_bits, iconclosed_width, + iconclosed_height)); + num_args++; + XtSetArg(arglist[num_args], XtNtitle, resources.title); + num_args++; + XtSetArg(arglist[num_args], XtNiconic, resources.iconic); + num_args++; + top = XtCreatePopupShell(TOPBOXNAME, topLevelShellWidgetClass, + initial_widget, arglist, num_args); + + form = XtCreateManagedWidget("form", formWidgetClass, top, + NULL, (Cardinal) 0); + + label = XtCreateManagedWidget("topLabel", labelWidgetClass, form, + NULL, (Cardinal) 0); + + num_args = 0; + XtSetArg(arglist[num_args], XtNfromVert, label); num_args++; + command = XtCreateManagedWidget(HELP_BUTTON, commandWidgetClass, form, + arglist, num_args); + + /* use same vertical as help widget. */ + XtSetArg(arglist[num_args], XtNfromHoriz, command); num_args++; + command = XtCreateManagedWidget(QUIT_BUTTON, commandWidgetClass, form, + arglist, num_args); + + num_args = 0; + XtSetArg(arglist[num_args], XtNfromVert, command); num_args++; + command = XtCreateManagedWidget(MANPAGE_BUTTON, commandWidgetClass, form, + arglist, num_args); + + help_widget = NULL; /* We have not seen the help yet. */ + + FormUpWidgets(form, full_size, half_size); + + XtRealizeWidget(top); + /* add WM_COMMAND property */ + XSetCommand(XtDisplay(top), XtWindow(top), saved_argv, saved_argc); + + man_globals = (ManpageGlobals*) XtCalloc(ONE, (Cardinal) sizeof(ManpageGlobals)); + MakeSearchWidget(man_globals, top); + MakeSaveWidgets(man_globals, top); + + SaveGlobals( (man_globals->This_Manpage = top), man_globals); + XtMapWidget(top); + AddCursor(top, resources.cursors.top); + +/* + * Set up ICCCM delete window. + */ + XtOverrideTranslations + (top, XtParseTranslationTable ("<Message>WM_PROTOCOLS: Quit()")); + (void) XSetWMProtocols (XtDisplay(top), XtWindow(top), + &wm_delete_window, 1); + + +} + +/* Function Name: CreateManpage + * Description: Creates a new manpage. + * Arguments: none. + * Returns: none. + */ + +Widget +CreateManpage(FILE * file) +{ + ManpageGlobals * man_globals; /* The psuedo global structure. */ + + man_globals = InitPsuedoGlobals(); + CreateManpageWidget(man_globals, MANNAME, TRUE); + + if (file == NULL) + StartManpage( man_globals, OpenHelpfile(man_globals), FALSE ); + else { + OpenFile(man_globals, file); + StartManpage( man_globals, FALSE, TRUE); + } + return(man_globals->This_Manpage); +} + +/* Function Name: InitPsuedoGlobals + * Description: Initializes the psuedo global variables. + * Arguments: none. + * Returns: a pointer to a new pseudo globals structure. + */ + +ManpageGlobals * +InitPsuedoGlobals(void) +{ + ManpageGlobals * man_globals; + + /* + * Allocate necessary memory. + */ + + man_globals = (ManpageGlobals *)XtCalloc(ONE, (Cardinal) sizeof(ManpageGlobals)); + if(!man_globals) + return NULL; + + man_globals->search_widget = NULL; + man_globals->section_name = (char **) XtMalloc( (Cardinal) (sections * + sizeof(char *))); + man_globals->manpagewidgets.box = (Widget *) XtCalloc( (Cardinal) sections, + (Cardinal) sizeof(Widget)); + + /* Initialize the number of screens that will be shown */ + + man_globals->both_shown = resources.both_shown_initial; + + return(man_globals); +} + +/* Function Name: CreateManpageWidget + * Description: Creates a new manual page widget. + * Arguments: man_globals - a new man_globals structure. + * name - name of this shell widget instance. + * full_instance - if true then create a full manpage, + * otherwise create stripped down version + * used for help. + * Returns: none + */ + +#define MANPAGEARGS 10 + +void +CreateManpageWidget( +ManpageGlobals * man_globals, +char * name, +Boolean full_instance) +{ + Arg arglist[MANPAGEARGS]; /* An argument list for widget creation */ + Cardinal num_args; /* The number of arguments in the list. */ + Widget mytop, pane, hpane, mysections; /* Widgets */ + ManPageWidgets * mpw = &(man_globals->manpagewidgets); + + num_args = (Cardinal) 0; + XtSetArg(arglist[num_args], XtNwidth, default_width); + num_args++; + XtSetArg(arglist[num_args], XtNheight, default_height); + num_args++; + + mytop = XtCreatePopupShell(name, topLevelShellWidgetClass, initial_widget, + arglist, num_args); + + man_globals->This_Manpage = mytop; /* pointer to root widget of Manualpage. */ + num_args = 0; + if (full_instance) + XtSetArg(arglist[num_args], XtNiconPixmap, + XCreateBitmapFromData( XtDisplay(mytop), XtScreen(mytop)->root, + (char *)icon_open_bits, icon_open_width, + icon_open_height)); + else + XtSetArg(arglist[num_args], XtNiconPixmap, + XCreateBitmapFromData( XtDisplay(mytop), XtScreen(mytop)->root, + (char *)icon_help_bits, icon_help_width, + icon_help_height)); + num_args++; + XtSetValues(mytop, arglist, num_args); + + pane = XtCreateManagedWidget("vertPane", panedWidgetClass, mytop, NULL, + (Cardinal) 0); + +/* Create menu bar. */ + + hpane = XtCreateManagedWidget("horizPane", panedWidgetClass, + pane, NULL, (Cardinal) 0); + num_args = 0; + XtSetArg(arglist[num_args], XtNmenuName, OPTION_MENU); num_args++; + (void) XtCreateManagedWidget("options", menuButtonWidgetClass, + hpane, arglist, num_args); + + CreateOptionMenu(man_globals, mytop); + + num_args = 0; + XtSetArg(arglist[num_args], XtNmenuName, SECTION_MENU); num_args++; + mysections = XtCreateManagedWidget("sections", menuButtonWidgetClass, + hpane, arglist, num_args); + + XtSetArg(arglist[0], XtNlabel, SHOW_BOTH); + XtSetValues(man_globals->both_screens_entry, arglist, (Cardinal) 1); + + if (full_instance) { + MakeSearchWidget(man_globals, mytop); + CreateSectionMenu(man_globals, mytop); + MakeSaveWidgets(man_globals, mytop); + } else { + XtSetSensitive(mysections, FALSE); + XtSetArg(arglist[0], XtNsensitive, FALSE); + XtSetValues(man_globals->dir_entry, arglist, ONE); + XtSetValues(man_globals->manpage_entry, arglist, ONE); + XtSetValues(man_globals->help_entry, arglist, ONE); + XtSetValues(man_globals->search_entry, arglist, ONE); + XtSetValues(man_globals->both_screens_entry, arglist, ONE); + } + +#ifdef INCLUDE_XPRINT_SUPPORT + XtSetArg(arglist[0], XtNsensitive, True); + XtSetValues(man_globals->print_entry, arglist, ONE); +#endif /* INCLUDE_XPRINT_SUPPORT */ + + man_globals->label = XtCreateManagedWidget("manualTitle", labelWidgetClass, + hpane, NULL, (Cardinal) 0); + +/* Create Directory */ + + if (full_instance) { + num_args = 0; + XtSetArg(arglist[num_args], XtNallowVert, TRUE); + num_args++; + + mpw->directory = XtCreateWidget(DIRECTORY_NAME, viewportWidgetClass, + pane, arglist, num_args); + + man_globals->current_directory = INITIAL_DIR; + MakeDirectoryBox(man_globals, mpw->directory, + mpw->box + man_globals->current_directory, + man_globals->current_directory ); + XtManageChild(mpw->box[man_globals->current_directory]); + } + +/* Create Manpage */ + + mpw->manpage = XtCreateWidget(MANUALPAGE, scrollByLineWidgetClass, + pane, NULL, (Cardinal) 0); + +} + +/* Function Name: StartManpage + * Description: Starts up a new manpage. + * Arguments: man_globals - the psuedo globals variable. + * help - is this a help file? + * page - Is there a page to display? + * Returns: none. + */ + +static void +StartManpage(ManpageGlobals * man_globals, Boolean help, Boolean page) +{ + Widget dir = man_globals->manpagewidgets.directory; + Widget manpage = man_globals->manpagewidgets.manpage; + Widget label = man_globals->label; + Arg arglist[1]; + +/* + * If there is a helpfile then put up both screens if both_show is set. + */ + + if (page || help) { + if (help) + strcpy(man_globals->manpage_title, "Xman Help"); + + if (man_globals->both_shown) { + XtManageChild(dir); + man_globals->dir_shown = TRUE; + + XtSetArg(arglist[0], XtNpreferredPaneSize, resources.directory_height); + XtSetValues(dir, arglist, (Cardinal) 1); + + XtSetArg(arglist[0], XtNsensitive, FALSE); + XtSetValues(man_globals->manpage_entry, arglist, ONE); + XtSetValues(man_globals->dir_entry, arglist, ONE); + + XtSetArg(arglist[0], XtNlabel, SHOW_ONE); + XtSetValues(man_globals->both_screens_entry, arglist, ONE); + ChangeLabel(label, + man_globals->section_name[man_globals->current_directory]); + } + else { + ChangeLabel(label,man_globals->manpage_title); + } + XtManageChild(manpage); + man_globals->dir_shown = FALSE; + } +/* + * Since There is file to display, put up directory and do not allow change + * to manpage, show both, or help. + */ + else { + XtManageChild(dir); + man_globals->dir_shown = TRUE; + XtSetArg(arglist[0], XtNsensitive, FALSE); + XtSetValues(man_globals->manpage_entry, arglist, ONE); + XtSetValues(man_globals->help_entry, arglist, ONE); + XtSetValues(man_globals->both_screens_entry, arglist, ONE); + man_globals->both_shown = FALSE; + ChangeLabel(label, + man_globals->section_name[man_globals->current_directory]); + } + +/* + * Start 'er up, and change the cursor. + */ + + XtRealizeWidget( man_globals->This_Manpage ); + SaveGlobals( man_globals->This_Manpage, man_globals); + XtMapWidget( man_globals->This_Manpage ); + AddCursor( man_globals->This_Manpage, resources.cursors.manpage); + XtSetArg(arglist[0], XtNtransientFor, man_globals->This_Manpage); + XtSetValues(XtParent(man_globals->standby), arglist, (Cardinal)1); + XtSetValues(XtParent(man_globals->save), arglist, (Cardinal) 1); + XtRealizeWidget(XtParent(man_globals->standby)); + XtRealizeWidget(XtParent(man_globals->save)); + AddCursor( XtParent(man_globals->standby), resources.cursors.top); + AddCursor( XtParent(man_globals->save), resources.cursors.top); + +/* + * Set up ICCCM delete window. + */ + XtOverrideTranslations + (man_globals->This_Manpage, + XtParseTranslationTable ("<Message>WM_PROTOCOLS: RemoveThisManpage()")); + (void) XSetWMProtocols (XtDisplay(man_globals->This_Manpage), + XtWindow(man_globals->This_Manpage), + &wm_delete_window, 1); + +} + +/* Function Name: MenuDestroy + * Description: free's data associated with menu when it is destroyed. + * Arguments: w - menu widget. + * free_me - data to free. + * junk - not used. + * Returns: none. + */ + +/* ARGSUSED */ +static void +MenuDestroy(Widget w, XtPointer free_me, XtPointer junk) +{ + XtFree( (char *) free_me); +} + +/* Function Name: CreateOptionMenu + * Description: Create the option menu. + * Arguments: man_globals - the manual page globals. + * parent - the button that activates the menu. + * Returns: none. + */ + +static void +CreateOptionMenu(ManpageGlobals * man_globals, Widget parent) +{ + Widget menu, entry; + int i; + static char * option_names[] = { /* Names of the buttons. */ + DIRECTORY, + MANPAGE, + HELP, + SEARCH, + BOTH_SCREENS, + REMOVE_MANPAGE, + OPEN_MANPAGE, +#ifdef INCLUDE_XPRINT_SUPPORT + PRINT_MANPAGE, +#endif /* INCLUDE_XPRINT_SUPPORT */ + SHOW_VERSION, + QUIT + }; + + menu = XtCreatePopupShell(OPTION_MENU, simpleMenuWidgetClass, parent, + NULL, (Cardinal) 0); + man_globals->option_menu = menu; + + for (i = 0 ; i < NUM_OPTIONS ; i++) { + entry = XtCreateManagedWidget(option_names[i], smeBSBObjectClass, + menu, NULL, ZERO); + XtAddCallback(entry, XtNcallback, OptionCallback, (caddr_t) man_globals); + switch (i) { + case 0: + man_globals->dir_entry = entry; + break; + case 1: + man_globals->manpage_entry = entry; + break; + case 2: + man_globals->help_entry = entry; + break; + case 3: + man_globals->search_entry = entry; + break; + case 4: + man_globals->both_screens_entry = entry; + break; + case 5: + man_globals->remove_entry = entry; + break; + case 6: + man_globals->open_entry = entry; + break; +#ifdef INCLUDE_XPRINT_SUPPORT + case 7: + man_globals->print_entry = entry; + break; + case 8: + man_globals->version_entry = entry; + break; + case 9: + man_globals->quit_entry = entry; + break; +#else /* !INCLUDE_XPRINT_SUPPORT */ + case 7: + man_globals->version_entry = entry; + break; + case 8: + man_globals->quit_entry = entry; + break; +#endif /* !INCLUDE_XPRINT_SUPPORT */ + default: + Error(("CreateOptionMenu: Unknown id=%d\n", i)); + break; + } + } + +#ifdef INCLUDE_XPRINT_SUPPORT + XtVaSetValues(man_globals->print_entry, XtNsensitive, FALSE, NULL); +#endif /* INCLUDE_XPRINT_SUPPORT */ +} + +/* Function Name: CreateSectionMenu + * Description: Create the Section menu. + * Arguments: man_globals - the manual page globals. + * parent - the button that activates the menu. + * Returns: none. + */ + +static void +CreateSectionMenu(ManpageGlobals * man_globals, Widget parent) +{ + Widget menu, entry; + int i; + MenuStruct * menu_struct; + Arg args[1]; + Cardinal num_args; + char entry_name[BUFSIZ]; + + menu = XtCreatePopupShell(SECTION_MENU, simpleMenuWidgetClass, parent, + NULL, (Cardinal) 0); + + for (i = 0 ; i < sections ; i ++) { + num_args = 0; + XtSetArg(args[num_args], XtNlabel, manual[i].blabel); num_args++; + sprintf(entry_name, "section%d", i); + + entry = XtCreateManagedWidget(entry_name, smeBSBObjectClass, + menu, args, num_args); + menu_struct = (MenuStruct *) XtMalloc(sizeof(MenuStruct)); + menu_struct->data = (caddr_t) man_globals; + menu_struct->number = i; + XtAddCallback(entry, XtNcallback, DirPopupCallback, (caddr_t) menu_struct); + XtAddCallback(entry, XtNdestroyCallback,MenuDestroy, (caddr_t)menu_struct); + + } +} + +/* Function Name: CreateList + * Description: this function prints a label in the directory list + * Arguments: section - the manual section. + * Returns: none + */ + +static char ** +CreateList(int section) +{ + char ** ret_list, **current; + int count; + + ret_list = (char **) XtMalloc( (manual[section].nentries + 1) * + sizeof (char *)); + + for (current = ret_list, count = 0 ; count < manual[section].nentries ; + count++, current++) + *current = CreateManpageName(manual[section].entries[count], section, + manual[section].flags); + + *current = NULL; /* NULL terminate the list. */ + return(ret_list); +} + +/* Function Name: MakeDirectoryBox + * Description: make a directory box. + * Arguments: man_globals - the psuedo global structure for each manpage. + * parent - this guys parent widget. + * dir_disp - the directory display widget. + * section - the section number. + * Returns: none. + */ + +void +MakeDirectoryBox(ManpageGlobals *man_globals, Widget parent, Widget *dir_disp, int section) +{ + Arg arglist[10]; + Cardinal num_args; + char * name, label_name[BUFSIZ]; + + if (*dir_disp != NULL) /* If we have one, don't make another. */ + return; + + name = manual[section].blabel; /* Set the section name */ + sprintf(label_name,"Directory of: %s",name); + man_globals->section_name[section] = StrAlloc(label_name); + + num_args = 0; + XtSetArg(arglist[num_args], XtNlist, CreateList(section)); + num_args++; + XtSetArg(arglist[num_args], XtNfont, resources.fonts.directory); + num_args++; + + *dir_disp = XtCreateWidget(DIRECTORY_NAME, listWidgetClass, parent, + arglist, num_args); + + XtAddCallback(*dir_disp, XtNcallback, + DirectoryHandler, (caddr_t) man_globals); +} + +/* Function Name: MakeSaveWidgets. + * Description: This functions creates two popup widgets, the please + * standby widget and the would you like to save widget. + * Arguments: man_globals - the psuedo globals structure for each man page + * parent - the realized parent for both popups. + * Returns: none. + */ + +void +MakeSaveWidgets(ManpageGlobals *man_globals, Widget parent) +{ + Widget shell, dialog; /* misc. widgets. */ + Arg warg[1]; + Cardinal n = 0; + +/* make the please stand by popup widget. */ + if (XtIsRealized(parent)) { + XtSetArg(warg[0], XtNtransientFor, parent); n++; + } + shell = XtCreatePopupShell( "pleaseStandBy", transientShellWidgetClass, + parent, warg, (Cardinal) n); + + man_globals->standby = XtCreateManagedWidget("label", labelWidgetClass, + shell, NULL, (Cardinal) 0); + + man_globals->save = XtCreatePopupShell("likeToSave", + transientShellWidgetClass, + parent, warg, n); + + dialog = XtCreateManagedWidget("dialog", dialogWidgetClass, + man_globals->save, NULL, (Cardinal) 0); + + XawDialogAddButton(dialog, FILE_SAVE, NULL, NULL); + XawDialogAddButton(dialog, CANCEL_FILE_SAVE, NULL, NULL); + + if (XtIsRealized(parent)) { + XtRealizeWidget(shell); + AddCursor(shell,resources.cursors.top); + XtRealizeWidget(man_globals->save); + AddCursor(man_globals->save, resources.cursors.top); + } +} + +/* Function Name: FormUpWidgets + * Description: Sizes widgets to look nice. + * Arguments: parent - the common parent of all the widgets. + * full_size - array of widget names that will he full size. + * half_size - array of widget names that will he half size. + * Returns: none + */ + +void +FormUpWidgets(Widget parent, char ** full_size, char ** half_size) +{ + Widget * full_widgets, * half_widgets, *temp, long_widget; + Dimension longest, length, b_width; + int interior_dist; + Arg arglist[2]; + + full_widgets = ConvertNamesToWidgets(parent, full_size); + half_widgets = ConvertNamesToWidgets(parent, half_size); + + long_widget = NULL; + longest = 0; + XtSetArg(arglist[0], XtNwidth, &length); + XtSetArg(arglist[1], XtNborderWidth, &b_width); + +/* + * Find Longest widget. + */ + + for ( temp = full_widgets ; *temp != (Widget) NULL ; temp++) { + XtGetValues(*temp, arglist, (Cardinal) 2); + length += 2 * b_width; + if (length > longest) { + longest = length; + long_widget = *temp; + } + } + + if (long_widget == (Widget) NULL) { /* Make sure we found one. */ + PopupWarning(GetGlobals(parent), + "Could not find longest widget, aborting..."); + XtFree((char *)full_widgets); + XtFree((char *)half_widgets); + return; + } + +/* + * Set all other full_widgets to this length. + */ + + for ( temp = full_widgets ; *temp != (Widget) NULL ; temp++ ) + if ( long_widget != *temp) { + Dimension width, border_width; + + XtSetArg(arglist[0], XtNborderWidth, &border_width); + XtGetValues(*temp, arglist, (Cardinal) 1); + + width = longest - 2 * border_width; + XtSetArg(arglist[0], XtNwidth, width); + XtSetValues(*temp, arglist, (Cardinal) 1); + } + +/* + * Set all the half widgets to the right length. + */ + + XtSetArg(arglist[0], XtNdefaultDistance, &interior_dist); + XtGetValues(parent, arglist, (Cardinal) 1); + + for ( temp = half_widgets ; *temp != (Widget) NULL ; temp++) { + Dimension width, border_width; + + XtSetArg(arglist[0], XtNborderWidth, &border_width); + XtGetValues(*temp, arglist, (Cardinal) 1); + + width = (int)(longest - interior_dist)/2 - 2 * border_width; + XtSetArg(arglist[0], XtNwidth, width); + XtSetValues(*temp, arglist, (Cardinal) 1); + } + + XtFree((char *)full_widgets); + XtFree((char *)half_widgets); +} + +/* Function Name: ConvertNamesToWidgets + * Description: Convers a list of names into a list of widgets. + * Arguments: parent - the common parent of these widgets. + * names - an array of widget names. + * Returns: an array of widget id's. + */ + +static Widget * +ConvertNamesToWidgets(Widget parent, char ** names) +{ + char ** temp; + Widget * ids, * temp_ids; + int count; + + for (count = 0, temp = names; *temp != NULL ; count++, temp++); + + ids = (Widget *) XtMalloc( (count + 1) * sizeof(Widget)); + + + for ( temp_ids = ids; *names != NULL ; names++, temp_ids++) { + *temp_ids = XtNameToWidget(parent, *names); + if (*temp_ids == NULL) { + char error_buf[BUFSIZ]; + + sprintf(error_buf, "Could not find widget named '%s'", *names); + PrintError(error_buf); + XtFree((char *)ids); + return(NULL); + } + } + + *temp_ids = (Widget) NULL; + return(ids); +} diff --git a/app/xman/compile b/app/xman/compile new file mode 100644 index 000000000..1b1d23216 --- /dev/null +++ b/app/xman/compile @@ -0,0 +1,142 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2005-05-14.22 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +# Written by Tom Tromey <tromey@cygnus.com>. +# +# 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, 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 program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to <bug-automake@gnu.org>. +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/app/xman/config.guess b/app/xman/config.guess new file mode 100644 index 000000000..917bbc50f --- /dev/null +++ b/app/xman/config.guess @@ -0,0 +1,1463 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-07-08' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (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 program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner <per@bothner.com>. +# Please send patches to <config-patches@gnu.org>. Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerppc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <sys/systemcfg.h> + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include <stdlib.h> + #include <unistd.h> + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <unistd.h> + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <features.h> + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` + echo ${UNAME_MACHINE}-pc-isc$UNAME_REL + elif /bin/uname -X 2>/dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes <hewes@openmarket.com>. + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + *86) UNAME_PROCESSOR=i686 ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c <<EOF +#ifdef _SEQUENT_ +# include <sys/types.h> +# include <sys/utsname.h> +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include <sys/param.h> + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include <sys/param.h> +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 <<EOF +$0: unable to guess system type + +This script, last modified $timestamp, has failed to recognize +the operating system you are using. It is advised that you +download the most up to date version of the config scripts from + + http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess +and + http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub + +If the version you run ($0) is already up to date, please +send the following data and any information you think might be +pertinent to <config-patches@gnu.org> in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/app/xman/config.h.in b/app/xman/config.h.in new file mode 100644 index 000000000..87ff05cad --- /dev/null +++ b/app/xman/config.h.in @@ -0,0 +1,46 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the `mkstemp' function. */ +#undef HAS_MKSTEMP + +/* Default local man page search path (default: none) */ +#undef LOCALMANPATH + +/* Define to path to man config file if you have one */ +#undef MANCONF + +/* Define to 1 if you have BSD format manpath.config */ +#undef MANCONFIGSTYLE_BSD + +/* Define to 1 if you have FreeBSD format manpath.config */ +#undef MANCONFIGSTYLE_FreeBSD + +/* Define to 1 if you have Linux format man.conf or man.config */ +#undef MANCONFIGSTYLE_Linux + +/* Define to 1 if you have OpenBSD format manpath.config */ +#undef MANCONFIGSTYLE_OpenBSD + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Default system man page search path (default: none) */ +#undef SYSMANPATH + +/* Version number of package */ +#undef VERSION diff --git a/app/xman/config.sub b/app/xman/config.sub new file mode 100644 index 000000000..1c366dfde --- /dev/null +++ b/app/xman/config.sub @@ -0,0 +1,1579 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-07-08' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (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 program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to <config-patches@gnu.org>. Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ + kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ms1 \ + | msp430 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m32c) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | ms1-* \ + | msp430-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + m32c-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/app/xman/configure b/app/xman/configure new file mode 100644 index 000000000..f3ec5827a --- /dev/null +++ b/app/xman/configure @@ -0,0 +1,5392 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59 for xman 1.0.2. +# +# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>. +# +# Copyright (C) 2003 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='xman' +PACKAGE_TARNAME='xman' +PACKAGE_VERSION='1.0.2' +PACKAGE_STRING='xman 1.0.2' +PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os HELPDIR PKG_CONFIG ac_pt_PKG_CONFIG TMP_XAW_CFLAGS TMP_XAW_LIBS XAW_USE_XPRINT_TRUE XAW_USE_XPRINT_FALSE XPRINT_UTIL_CFLAGS XPRINT_UTIL_LIBS XMAN_CFLAGS XMAN_LIBS APPDEFS_CFLAGS APPDEFS_LIBS appdefaultdir APP_MAN_SUFFIX LIB_MAN_SUFFIX FILE_MAN_SUFFIX MISC_MAN_SUFFIX DRIVER_MAN_SUFFIX ADMIN_MAN_SUFFIX APP_MAN_DIR LIB_MAN_DIR FILE_MAN_DIR MISC_MAN_DIR DRIVER_MAN_DIR ADMIN_MAN_DIR LIBOBJS LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +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' + +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 + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # 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_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$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 ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) 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 | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$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 | -n) + 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_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + 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 "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# 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_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + 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 "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_PKG_CONFIG_set=${PKG_CONFIG+set} +ac_env_PKG_CONFIG_value=$PKG_CONFIG +ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set} +ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG +ac_env_TMP_XAW_CFLAGS_set=${TMP_XAW_CFLAGS+set} +ac_env_TMP_XAW_CFLAGS_value=$TMP_XAW_CFLAGS +ac_cv_env_TMP_XAW_CFLAGS_set=${TMP_XAW_CFLAGS+set} +ac_cv_env_TMP_XAW_CFLAGS_value=$TMP_XAW_CFLAGS +ac_env_TMP_XAW_LIBS_set=${TMP_XAW_LIBS+set} +ac_env_TMP_XAW_LIBS_value=$TMP_XAW_LIBS +ac_cv_env_TMP_XAW_LIBS_set=${TMP_XAW_LIBS+set} +ac_cv_env_TMP_XAW_LIBS_value=$TMP_XAW_LIBS +ac_env_XPRINT_UTIL_CFLAGS_set=${XPRINT_UTIL_CFLAGS+set} +ac_env_XPRINT_UTIL_CFLAGS_value=$XPRINT_UTIL_CFLAGS +ac_cv_env_XPRINT_UTIL_CFLAGS_set=${XPRINT_UTIL_CFLAGS+set} +ac_cv_env_XPRINT_UTIL_CFLAGS_value=$XPRINT_UTIL_CFLAGS +ac_env_XPRINT_UTIL_LIBS_set=${XPRINT_UTIL_LIBS+set} +ac_env_XPRINT_UTIL_LIBS_value=$XPRINT_UTIL_LIBS +ac_cv_env_XPRINT_UTIL_LIBS_set=${XPRINT_UTIL_LIBS+set} +ac_cv_env_XPRINT_UTIL_LIBS_value=$XPRINT_UTIL_LIBS +ac_env_APPDEFS_CFLAGS_set=${APPDEFS_CFLAGS+set} +ac_env_APPDEFS_CFLAGS_value=$APPDEFS_CFLAGS +ac_cv_env_APPDEFS_CFLAGS_set=${APPDEFS_CFLAGS+set} +ac_cv_env_APPDEFS_CFLAGS_value=$APPDEFS_CFLAGS +ac_env_APPDEFS_LIBS_set=${APPDEFS_LIBS+set} +ac_env_APPDEFS_LIBS_value=$APPDEFS_LIBS +ac_cv_env_APPDEFS_LIBS_set=${APPDEFS_LIBS+set} +ac_cv_env_APPDEFS_LIBS_value=$APPDEFS_LIBS + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # 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 <<_ACEOF +\`configure' configures xman 1.0.2 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --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 + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of xman 1.0.2:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-xprint Enable XPrint support + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-helpdir=<path> Set default directory for xman.help (default: + ${datadir}/X11) + --with-sysmanpath=<path> + Set default system man page search path + --with-localmanpath=<path> + Set default local man page search path + --with-release-version=STRING + Use release version string in package name + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a + nonstandard directory <lib dir> + CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have + headers in a nonstandard directory <include dir> + PKG_CONFIG path to pkg-config utility + TMP_XAW_CFLAGS + C compiler flags for TMP_XAW, overriding pkg-config + TMP_XAW_LIBS + linker flags for TMP_XAW, overriding pkg-config + XPRINT_UTIL_CFLAGS + C compiler flags for XPRINT_UTIL, overriding pkg-config + XPRINT_UTIL_LIBS + linker flags for XPRINT_UTIL, overriding pkg-config + APPDEFS_CFLAGS + C compiler flags for APPDEFS, overriding pkg-config + APPDEFS_LIBS + linker flags for APPDEFS, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>. +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +xman configure 1.0.2 +generated by GNU Autoconf 2.59 + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by xman $as_me 1.0.2, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# 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 + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# 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 "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + + + +am__api_version="1.9" +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 + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $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 +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +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 "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&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_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='xman' + VERSION='1.0.2' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + + ac_config_headers="$ac_config_headers config.h" + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +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 $# != 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 + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 + (eval $ac_compiler --version </dev/null >&5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 + (eval $ac_compiler -v </dev/null >&5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 + (eval $ac_compiler -V </dev/null >&5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include <stdlib.h> +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +# 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 +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +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 "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&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_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + + + +echo "$as_me:$LINENO: checking for mkstemp" >&5 +echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6 +if test "${ac_cv_func_mkstemp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define mkstemp to an innocuous variant, in case <limits.h> declares mkstemp. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define mkstemp innocuous_mkstemp + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char mkstemp (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef mkstemp + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char mkstemp (); +/* 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_mkstemp) || defined (__stub___mkstemp) +choke me +#else +char (*f) () = mkstemp; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != mkstemp; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_mkstemp=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_mkstemp=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_mkstemp" >&5 +echo "${ECHO_T}$ac_cv_func_mkstemp" >&6 +if test $ac_cv_func_mkstemp = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAS_MKSTEMP 1 +_ACEOF + +fi + + + +# Check whether --with-helpdir or --without-helpdir was given. +if test "${with_helpdir+set}" = set; then + withval="$with_helpdir" + HELPDIR="$withval" +else + HELPDIR=${datadir}/X11 +fi; + + + +# Check whether --with-sysmanpath or --without-sysmanpath was given. +if test "${with_sysmanpath+set}" = set; then + withval="$with_sysmanpath" + SYSMANPATH="$withval" +fi; +if test x$SYSMANPATH != x; then + +cat >>confdefs.h <<_ACEOF +#define SYSMANPATH "$SYSMANPATH" +_ACEOF + +fi + + +# Check whether --with-localmanpath or --without-localmanpath was given. +if test "${with_localmanpath+set}" = set; then + withval="$with_localmanpath" + LOCALMANPATH="$withval" +fi; +if test x$LOCALMANPATH != x; then + +cat >>confdefs.h <<_ACEOF +#define LOCALMANPATH "$LOCALMANPATH" +_ACEOF + +fi + +# Checks for pkg-config packages + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG + +if test -n "$ac_pt_PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + PKG_CONFIG=$ac_pt_PKG_CONFIG +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 +echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + PKG_CONFIG="" + fi + +fi + + # Check whether --enable-xprint or --disable-xprint was given. +if test "${enable_xprint+set}" = set; then + enableval="$enable_xprint" + use_xprint=$enableval +else + use_xprint=auto +fi; + if test "x$use_xprint" = "xyes"; then + TMP_CHECK1=xaw8 + TMP_CHECK2= + xaw_use_xprint=yes + elif test "x$use_xprint" = "xno"; then + TMP_CHECK1=xaw7 + TMP_CHECK2= + xaw_use_xprint=no + else + TMP_CHECK1=xaw8 + TMP_CHECK2=xaw7 + xaw_use_xprint=yes + fi + + +pkg_failed=no +echo "$as_me:$LINENO: checking for TMP_XAW" >&5 +echo $ECHO_N "checking for TMP_XAW... $ECHO_C" >&6 + +if test -n "$PKG_CONFIG"; then + if test -n "$TMP_XAW_CFLAGS"; then + pkg_cv_TMP_XAW_CFLAGS="$TMP_XAW_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK1\"") >&5 + ($PKG_CONFIG --exists --print-errors "$TMP_CHECK1") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_TMP_XAW_CFLAGS=`$PKG_CONFIG --cflags "$TMP_CHECK1" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$TMP_XAW_LIBS"; then + pkg_cv_TMP_XAW_LIBS="$TMP_XAW_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK1\"") >&5 + ($PKG_CONFIG --exists --print-errors "$TMP_CHECK1") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_TMP_XAW_LIBS=`$PKG_CONFIG --libs "$TMP_CHECK1" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$TMP_CHECK1"` + else + TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$TMP_CHECK1"` + fi + # Put the nasty error message in config.log where it belongs + echo "$TMP_XAW_PKG_ERRORS" >&5 + + success=no +elif test $pkg_failed = untried; then + success=no +else + TMP_XAW_CFLAGS=$pkg_cv_TMP_XAW_CFLAGS + TMP_XAW_LIBS=$pkg_cv_TMP_XAW_LIBS + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + success=yes +fi + if [ ! -z $TMP_CHECK2 ] ; then + if test $success = no ; then + +pkg_failed=no +echo "$as_me:$LINENO: checking for TMP_XAW" >&5 +echo $ECHO_N "checking for TMP_XAW... $ECHO_C" >&6 + +if test -n "$PKG_CONFIG"; then + if test -n "$TMP_XAW_CFLAGS"; then + pkg_cv_TMP_XAW_CFLAGS="$TMP_XAW_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK2\"") >&5 + ($PKG_CONFIG --exists --print-errors "$TMP_CHECK2") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_TMP_XAW_CFLAGS=`$PKG_CONFIG --cflags "$TMP_CHECK2" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$TMP_XAW_LIBS"; then + pkg_cv_TMP_XAW_LIBS="$TMP_XAW_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK2\"") >&5 + ($PKG_CONFIG --exists --print-errors "$TMP_CHECK2") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_TMP_XAW_LIBS=`$PKG_CONFIG --libs "$TMP_CHECK2" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$TMP_CHECK2"` + else + TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$TMP_CHECK2"` + fi + # Put the nasty error message in config.log where it belongs + echo "$TMP_XAW_PKG_ERRORS" >&5 + + success=no +elif test $pkg_failed = untried; then + success=no +else + TMP_XAW_CFLAGS=$pkg_cv_TMP_XAW_CFLAGS + TMP_XAW_LIBS=$pkg_cv_TMP_XAW_LIBS + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + success=yes +fi + xaw_use_xprint=no + fi + fi + + if test "x$success" = "xyes"; then + XMAN_CFLAGS=$TMP_XAW_CFLAGS + XMAN_LIBS=$TMP_XAW_LIBS + + + +if test "x$xaw_use_xprint" = "xyes"; then + XAW_USE_XPRINT_TRUE= + XAW_USE_XPRINT_FALSE='#' +else + XAW_USE_XPRINT_TRUE='#' + XAW_USE_XPRINT_FALSE= +fi + + else + { { echo "$as_me:$LINENO: error: No suitable version of Xaw found" >&5 +echo "$as_me: error: No suitable version of Xaw found" >&2;} + { (exit 1); exit 1; }; } + fi + + +# Check for man page config files +echo "$as_me:$LINENO: checking for /etc/man.conf" >&5 +echo $ECHO_N "checking for /etc/man.conf... $ECHO_C" >&6 +if test "${ac_cv_file__etc_man_conf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + test "$cross_compiling" = yes && + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } +if test -r "/etc/man.conf"; then + ac_cv_file__etc_man_conf=yes +else + ac_cv_file__etc_man_conf=no +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_file__etc_man_conf" >&5 +echo "${ECHO_T}$ac_cv_file__etc_man_conf" >&6 +if test $ac_cv_file__etc_man_conf = yes; then + MANCONF="/etc/man.conf" +else + echo "$as_me:$LINENO: checking for /etc/man.config" >&5 +echo $ECHO_N "checking for /etc/man.config... $ECHO_C" >&6 +if test "${ac_cv_file__etc_man_config+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + test "$cross_compiling" = yes && + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } +if test -r "/etc/man.config"; then + ac_cv_file__etc_man_config=yes +else + ac_cv_file__etc_man_config=no +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_file__etc_man_config" >&5 +echo "${ECHO_T}$ac_cv_file__etc_man_config" >&6 +if test $ac_cv_file__etc_man_config = yes; then + MANCONF="/etc/man.config" +else + echo "$as_me:$LINENO: checking for /etc/manpath.config" >&5 +echo $ECHO_N "checking for /etc/manpath.config... $ECHO_C" >&6 +if test "${ac_cv_file__etc_manpath_config+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + test "$cross_compiling" = yes && + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } +if test -r "/etc/manpath.config"; then + ac_cv_file__etc_manpath_config=yes +else + ac_cv_file__etc_manpath_config=no +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_file__etc_manpath_config" >&5 +echo "${ECHO_T}$ac_cv_file__etc_manpath_config" >&6 +if test $ac_cv_file__etc_manpath_config = yes; then + MANCONF="/etc/manpath.config" +fi + +fi + +fi + + +if test x$MANCONF != x ; then + +cat >>confdefs.h <<_ACEOF +#define MANCONF "$MANCONF" +_ACEOF + + + # Try to determine format of config file + # would be better to somehow determine from the files themselves, but + # we'll guess based on pathname and OS for now (mirrors old Imake tests) + echo "$as_me:$LINENO: checking man config file format" >&5 +echo $ECHO_N "checking man config file format... $ECHO_C" >&6 + if test x$MANCONF = x/etc/manpath.config ; then + MAN_CONFIG_STYLE="FreeBSD" + else + case $host_os in + *darwin* | *openbsd* | *netbsd* ) + MAN_CONFIG_STYLE="OpenBSD" + ;; + *linux* ) + MAN_CONFIG_STYLE="Linux" + ;; + *bsd* ) + MAN_CONFIG_STYLE="BSD" + ;; + *) + ;; + esac + fi + echo "$as_me:$LINENO: result: $MAN_CONFIG_STYLE" >&5 +echo "${ECHO_T}$MAN_CONFIG_STYLE" >&6 + + case $MAN_CONFIG_STYLE in + FreeBSD) + +cat >>confdefs.h <<\_ACEOF +#define MANCONFIGSTYLE_FreeBSD 1 +_ACEOF + + ;; + OpenBSD) + +cat >>confdefs.h <<\_ACEOF +#define MANCONFIGSTYLE_OpenBSD 1 +_ACEOF + + ;; + BSD) + +cat >>confdefs.h <<\_ACEOF +#define MANCONFIGSTYLE_BSD 1 +_ACEOF + + ;; + Linux) + +cat >>confdefs.h <<\_ACEOF +#define MANCONFIGSTYLE_Linux 1 +_ACEOF + + ;; + *) + { { echo "$as_me:$LINENO: error: Could not determine man page file config format." >&5 +echo "$as_me: error: Could not determine man page file config format." >&2;} + { (exit 1); exit 1; }; } + esac +fi + +if test "x$xaw_use_xprint" = "xyes" ; then + +pkg_failed=no +echo "$as_me:$LINENO: checking for XPRINT_UTIL" >&5 +echo $ECHO_N "checking for XPRINT_UTIL... $ECHO_C" >&6 + +if test -n "$PKG_CONFIG"; then + if test -n "$XPRINT_UTIL_CFLAGS"; then + pkg_cv_XPRINT_UTIL_CFLAGS="$XPRINT_UTIL_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xprintutil xp\"") >&5 + ($PKG_CONFIG --exists --print-errors "xprintutil xp") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_XPRINT_UTIL_CFLAGS=`$PKG_CONFIG --cflags "xprintutil xp" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$XPRINT_UTIL_LIBS"; then + pkg_cv_XPRINT_UTIL_LIBS="$XPRINT_UTIL_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xprintutil xp\"") >&5 + ($PKG_CONFIG --exists --print-errors "xprintutil xp") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_XPRINT_UTIL_LIBS=`$PKG_CONFIG --libs "xprintutil xp" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + XPRINT_UTIL_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xprintutil xp"` + else + XPRINT_UTIL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xprintutil xp"` + fi + # Put the nasty error message in config.log where it belongs + echo "$XPRINT_UTIL_PKG_ERRORS" >&5 + + { { echo "$as_me:$LINENO: error: Package requirements (xprintutil xp) were not met: + +$XPRINT_UTIL_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables XPRINT_UTIL_CFLAGS +and XPRINT_UTIL_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&5 +echo "$as_me: error: Package requirements (xprintutil xp) were not met: + +$XPRINT_UTIL_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables XPRINT_UTIL_CFLAGS +and XPRINT_UTIL_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&2;} + { (exit 1); exit 1; }; } +elif test $pkg_failed = untried; then + { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables XPRINT_UTIL_CFLAGS +and XPRINT_UTIL_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>. +See \`config.log' for more details." >&5 +echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables XPRINT_UTIL_CFLAGS +and XPRINT_UTIL_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + XPRINT_UTIL_CFLAGS=$pkg_cv_XPRINT_UTIL_CFLAGS + XPRINT_UTIL_LIBS=$pkg_cv_XPRINT_UTIL_LIBS + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + : +fi + + XMAN_CFLAGS="$XMAN_CFLAGS $XPRINT_UTIL_CFLAGS" + XMAN_LIBS="$XMAN_LIBS $XPRINT_UTIL_LIBS" +fi + + + + + +pkg_failed=no +echo "$as_me:$LINENO: checking for APPDEFS" >&5 +echo $ECHO_N "checking for APPDEFS... $ECHO_C" >&6 + +if test -n "$PKG_CONFIG"; then + if test -n "$APPDEFS_CFLAGS"; then + pkg_cv_APPDEFS_CFLAGS="$APPDEFS_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5 + ($PKG_CONFIG --exists --print-errors "xt") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_APPDEFS_CFLAGS=`$PKG_CONFIG --cflags "xt" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$APPDEFS_LIBS"; then + pkg_cv_APPDEFS_LIBS="$APPDEFS_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5 + ($PKG_CONFIG --exists --print-errors "xt") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_APPDEFS_LIBS=`$PKG_CONFIG --libs "xt" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + APPDEFS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xt"` + else + APPDEFS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xt"` + fi + # Put the nasty error message in config.log where it belongs + echo "$APPDEFS_PKG_ERRORS" >&5 + + { { echo "$as_me:$LINENO: error: Package requirements (xt) were not met: + +$APPDEFS_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables APPDEFS_CFLAGS +and APPDEFS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&5 +echo "$as_me: error: Package requirements (xt) were not met: + +$APPDEFS_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables APPDEFS_CFLAGS +and APPDEFS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&2;} + { (exit 1); exit 1; }; } +elif test $pkg_failed = untried; then + { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables APPDEFS_CFLAGS +and APPDEFS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>. +See \`config.log' for more details." >&5 +echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables APPDEFS_CFLAGS +and APPDEFS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + APPDEFS_CFLAGS=$pkg_cv_APPDEFS_CFLAGS + APPDEFS_LIBS=$pkg_cv_APPDEFS_LIBS + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + : +fi +appdefaultdir=$(pkg-config --variable=appdefaultdir xt) + + + + + +if test x$APP_MAN_SUFFIX = x ; then + case $host_os in + linux*) APP_MAN_SUFFIX=1x ;; + *) APP_MAN_SUFFIX=1 ;; + esac +fi +if test x$APP_MAN_DIR = x ; then + case $host_os in + linux*) APP_MAN_DIR='$(mandir)/man1' ;; + *) APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' ;; + esac +fi + +if test x$LIB_MAN_SUFFIX = x ; then + case $host_os in + linux*) LIB_MAN_SUFFIX=3x ;; + *) LIB_MAN_SUFFIX=3 ;; + esac +fi +if test x$LIB_MAN_DIR = x ; then + case $host_os in + linux*) LIB_MAN_DIR='$(mandir)/man3' ;; + *) LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' ;; + esac +fi + +if test x$FILE_MAN_SUFFIX = x ; then + case $host_os in + linux*) FILE_MAN_SUFFIX=5x ;; + solaris*) FILE_MAN_SUFFIX=4 ;; + *) FILE_MAN_SUFFIX=5 ;; + esac +fi +if test x$FILE_MAN_DIR = x ; then + case $host_os in + linux*) FILE_MAN_DIR='$(mandir)/man5' ;; + *) FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' ;; + esac +fi + +# In Imake's linux.cf, the misc man suffix & dir was only changed for +# LinuxDebian, not other Linuxes, so we leave it unchanged here +if test x$MISC_MAN_SUFFIX = x ; then + case $host_os in +# linux*) MISC_MAN_SUFFIX=7x ;; + solaris*) MISC_MAN_SUFFIX=5 ;; + *) MISC_MAN_SUFFIX=7 ;; + esac +fi +if test x$MISC_MAN_DIR = x ; then + case $host_os in +# linux*) MISC_MAN_DIR='$(mandir)/man7' ;; + *) MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' ;; + esac +fi + +# In Imake's linux.cf, the driver man suffix & dir was only changed for +# LinuxDebian, not other Linuxes, so we leave it unchanged here +if test x$DRIVER_MAN_SUFFIX = x ; then + case $host_os in +# linux*) DRIVER_MAN_SUFFIX=4x ;; + solaris*) DRIVER_MAN_SUFFIX=7 ;; + *) DRIVER_MAN_SUFFIX=4 ;; + esac +fi +if test x$DRIVER_MAN_DIR = x ; then + case $host_os in +# linux*) DRIVER_MAN_DIR='$(mandir)/man4' ;; + *) DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' ;; + esac +fi + +if test x$ADMIN_MAN_SUFFIX = x ; then + case $host_os in + solaris*) ADMIN_MAN_SUFFIX=1m ;; + *) ADMIN_MAN_SUFFIX=8 ;; + esac +fi +if test x$ADMIN_MAN_DIR = x ; then + ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' +fi + + + + + + + + + + + + + + + + + +# Check whether --with-release-version or --without-release-version was given. +if test "${with_release_version+set}" = set; then + withval="$with_release_version" + RELEASE_VERSION="$withval" +else + RELEASE_VERSION="" +fi; + if test "x$RELEASE_VERSION" != "x"; then + PACKAGE="$PACKAGE-$RELEASE_VERSION" + PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" + { echo "$as_me:$LINENO: Building with package name set to $PACKAGE" >&5 +echo "$as_me: Building with package name set to $PACKAGE" >&6;} + fi + + + ac_config_files="$ac_config_files Makefile" +cat >confcache <<\_ACEOF +# 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, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# 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 | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${XAW_USE_XPRINT_TRUE}" && test -z "${XAW_USE_XPRINT_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"XAW_USE_XPRINT\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"XAW_USE_XPRINT\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by xman $as_me 1.0.2, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to <bug-autoconf@gnu.org>." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +xman config.status 1.0.2 +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@mkdir_p@,$mkdir_p,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@AMTAR@,$AMTAR,;t t +s,@am__tar@,$am__tar,;t t +s,@am__untar@,$am__untar,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@HELPDIR@,$HELPDIR,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t +s,@TMP_XAW_CFLAGS@,$TMP_XAW_CFLAGS,;t t +s,@TMP_XAW_LIBS@,$TMP_XAW_LIBS,;t t +s,@XAW_USE_XPRINT_TRUE@,$XAW_USE_XPRINT_TRUE,;t t +s,@XAW_USE_XPRINT_FALSE@,$XAW_USE_XPRINT_FALSE,;t t +s,@XPRINT_UTIL_CFLAGS@,$XPRINT_UTIL_CFLAGS,;t t +s,@XPRINT_UTIL_LIBS@,$XPRINT_UTIL_LIBS,;t t +s,@XMAN_CFLAGS@,$XMAN_CFLAGS,;t t +s,@XMAN_LIBS@,$XMAN_LIBS,;t t +s,@APPDEFS_CFLAGS@,$APPDEFS_CFLAGS,;t t +s,@APPDEFS_LIBS@,$APPDEFS_LIBS,;t t +s,@appdefaultdir@,$appdefaultdir,;t t +s,@APP_MAN_SUFFIX@,$APP_MAN_SUFFIX,;t t +s,@LIB_MAN_SUFFIX@,$LIB_MAN_SUFFIX,;t t +s,@FILE_MAN_SUFFIX@,$FILE_MAN_SUFFIX,;t t +s,@MISC_MAN_SUFFIX@,$MISC_MAN_SUFFIX,;t t +s,@DRIVER_MAN_SUFFIX@,$DRIVER_MAN_SUFFIX,;t t +s,@ADMIN_MAN_SUFFIX@,$ADMIN_MAN_SUFFIX,;t t +s,@APP_MAN_DIR@,$APP_MAN_DIR,;t t +s,@LIB_MAN_DIR@,$LIB_MAN_DIR,;t t +s,@FILE_MAN_DIR@,$FILE_MAN_DIR,;t t +s,@MISC_MAN_DIR@,$MISC_MAN_DIR,;t t +s,@DRIVER_MAN_DIR@,$DRIVER_MAN_DIR,;t t +s,@ADMIN_MAN_DIR@,$ADMIN_MAN_DIR,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # 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_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # 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" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'`/stamp-h$_am_stamp_count +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/app/xman/configure.ac b/app/xman/configure.ac new file mode 100644 index 000000000..3adfde380 --- /dev/null +++ b/app/xman/configure.ac @@ -0,0 +1,137 @@ + +dnl Copyright 2005 Red Hat, Inc. +dnl +dnl Permission to use, copy, modify, distribute, and sell this software and its +dnl documentation for any purpose is hereby granted without fee, provided that +dnl the above copyright notice appear in all copies and that both that +dnl copyright notice and this permission notice appear in supporting +dnl documentation, and that the name of Red Hat not be used in +dnl advertising or publicity pertaining to distribution of the software without +dnl specific, written prior permission. Red Hat makes no +dnl representations about the suitability of this software for any purpose. It +dnl is provided "as is" without express or implied warranty. +dnl +dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR +dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +dnl PERFORMANCE OF THIS SOFTWARE. +dnl +dnl Process this file with autoconf to create configure. + +AC_PREREQ([2.57]) +AC_INIT(xman,[1.0.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xman) +AM_INIT_AUTOMAKE([dist-bzip2]) +AM_MAINTAINER_MODE + +AM_CONFIG_HEADER(config.h) + +AC_PROG_CC +AC_PROG_INSTALL +AC_CANONICAL_HOST + +AC_CHECK_FUNC([mkstemp], + AC_DEFINE(HAS_MKSTEMP,1,[Define to 1 if you have the `mkstemp' function.])) + +AC_ARG_WITH(helpdir, + AC_HELP_STRING([--with-helpdir=<path>], + [Set default directory for xman.help (default: ${datadir}/X11)]), + [HELPDIR="$withval"], + [HELPDIR=${datadir}/X11]) +AC_SUBST([HELPDIR]) + +AC_ARG_WITH(sysmanpath, + AC_HELP_STRING([--with-sysmanpath=<path>], + [Set default system man page search path]), + [SYSMANPATH="$withval"], []) +if test x$SYSMANPATH != x; then + AC_DEFINE_UNQUOTED(SYSMANPATH, "$SYSMANPATH", + [Default system man page search path (default: none)]) +fi + +AC_ARG_WITH(localmanpath, + AC_HELP_STRING([--with-localmanpath=<path>], + [Set default local man page search path]), + [LOCALMANPATH="$withval"], []) +if test x$LOCALMANPATH != x; then + AC_DEFINE_UNQUOTED(LOCALMANPATH, "$LOCALMANPATH", + [Default local man page search path (default: none)]) +fi + +# Checks for pkg-config packages +XAW_CHECK_XPRINT_SUPPORT(XMAN) + +# Check for man page config files +AC_CHECK_FILE([/etc/man.conf], [MANCONF="/etc/man.conf"], + AC_CHECK_FILE([/etc/man.config], [MANCONF="/etc/man.config"], + AC_CHECK_FILE([/etc/manpath.config], [MANCONF="/etc/manpath.config"]))) + +if test x$MANCONF != x ; then + AC_DEFINE_UNQUOTED(MANCONF, "$MANCONF", + [Define to path to man config file if you have one]) + + # Try to determine format of config file + # would be better to somehow determine from the files themselves, but + # we'll guess based on pathname and OS for now (mirrors old Imake tests) + AC_MSG_CHECKING([man config file format]) + if test x$MANCONF = x/etc/manpath.config ; then + MAN_CONFIG_STYLE="FreeBSD" + else + case $host_os in + *darwin* | *openbsd* | *netbsd* ) + MAN_CONFIG_STYLE="OpenBSD" + ;; + *linux* ) + MAN_CONFIG_STYLE="Linux" + ;; + *bsd* ) + MAN_CONFIG_STYLE="BSD" + ;; + *) + ;; + esac + fi + AC_MSG_RESULT($MAN_CONFIG_STYLE) + + case $MAN_CONFIG_STYLE in + FreeBSD) + AC_DEFINE([MANCONFIGSTYLE_FreeBSD],1, + [Define to 1 if you have FreeBSD format manpath.config]) + ;; + OpenBSD) + AC_DEFINE([MANCONFIGSTYLE_OpenBSD],1, + [Define to 1 if you have OpenBSD format manpath.config]) + ;; + BSD) + AC_DEFINE([MANCONFIGSTYLE_BSD],1, + [Define to 1 if you have BSD format manpath.config]) + ;; + Linux) + AC_DEFINE([MANCONFIGSTYLE_Linux],1, + [Define to 1 if you have Linux format man.conf or man.config]) + ;; + *) + AC_MSG_ERROR([Could not determine man page file config format.]) + esac +fi + +if test "x$xaw_use_xprint" = "xyes" ; then + PKG_CHECK_MODULES(XPRINT_UTIL, xprintutil xp) + + XMAN_CFLAGS="$XMAN_CFLAGS $XPRINT_UTIL_CFLAGS" + XMAN_LIBS="$XMAN_LIBS $XPRINT_UTIL_LIBS" +fi + +AC_SUBST(XMAN_CFLAGS) +AC_SUBST(XMAN_LIBS) + +PKG_CHECK_MODULES(APPDEFS, xt) +appdefaultdir=$(pkg-config --variable=appdefaultdir xt) +AC_SUBST(appdefaultdir) + +XORG_MANPAGE_SECTIONS +XORG_RELEASE_VERSION + +AC_OUTPUT([Makefile]) diff --git a/app/xman/defs.h b/app/xman/defs.h new file mode 100644 index 000000000..ec4d068ae --- /dev/null +++ b/app/xman/defs.h @@ -0,0 +1,146 @@ +/* $XConsortium: defs.h,v 1.25 94/04/17 20:43:50 converse Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ +/* $XFree86: xc/programs/xman/defs.h,v 1.2 2000/03/03 23:16:26 dawes Exp $ */ + +/* + * xman - X window system manual page display program. + * Author: Chris D. Peterson, MIT Project Athena + * Created: October 22, 1987 + */ + +#ifndef HELPFILE +#define HELPFILE "/usr/lib/X11/xman.help" /* name of the default helpfile. */ +#endif + +/* The default cursors */ + +#define XMAN_CURSOR "left_ptr" /* Top level cursor. */ +#define HELP_CURSOR "left_ptr" /* The help cursor. */ +#define MANPAGE_CURSOR "left_ptr" /* The manpage cursor. */ +#define SEARCH_ENTRY_CURSOR "question_arrow" /* The search text widget + cursor. */ +#define DIRECTORY_NORMAL "fixed" /* The default dir font */ + +#define OPTION_MENU "optionMenu" /* Name of the Option Menu. */ +#define SECTION_MENU "sectionMenu" /* Name of the Section Menu. */ + +#define HELP_BUTTON "helpButton" /* Name of top help button */ +#define QUIT_BUTTON "quitButton" /* Name of top quit button */ +#define MANPAGE_BUTTON "manpageButton" /* Name of top manpage button */ + +#define TOPBOXNAME "topBox" /* Name of the Top Box. */ +#define MANNAME "manualBrowser" /* name for each manual page widget. */ +#define SEARCHNAME "search" /* The name for the search widget. */ +#define HELPNAME "help" /* The name of the help widget. */ +#define DIRECTORY_NAME "directory" /* name of the directory widget. */ +#define MANUALPAGE "manualPage" /* name of the Scrollbyline widget that + contains the man page. */ +#define DIALOG "dialog" + +/* Names of the menu buttons */ + +#ifdef INCLUDE_XPRINT_SUPPORT +#define NUM_OPTIONS 10 /* Number of menu options. */ +#else /* !INCLUDE_XPRINT_SUPPORT */ +#define NUM_OPTIONS 9 /* Number of menu options. */ +#endif /* !INCLUDE_XPRINT_SUPPORT */ + +#define DIRECTORY "displayDirectory" +#define MANPAGE "displayManualPage" +#define HELP "help" +#define SEARCH "search" +#define BOTH_SCREENS "showBothScreens" +#define REMOVE_MANPAGE "removeThisManpage" +#define OPEN_MANPAGE "openNewManpage" +#ifdef INCLUDE_XPRINT_SUPPORT +#define PRINT_MANPAGE "printManualPage" +#endif /* INCLUDE_XPRINT_SUPPORT */ +#define SHOW_VERSION "showVersion" +#define QUIT "quit" + +/* definitions of string to use for show both and show one. */ + +#define SHOW_BOTH "Show Both Screens" +#define SHOW_ONE "Show One Screen" + +/* + * Things will not look right if you change these names to make + * MANUALSEARCH longer APROPOSSEARCH, see search.c for details. + */ + +#define MANUALSEARCH "manualPage" +#define APROPOSSEARCH "apropos" +#define CANCEL "cancel" + +#define MANUAL 0 +#define APROPOS 1 + +#define NO_SECTION_DEFAULTS ("no default sections") + +/* + * Define HANDLE_ROFFSEQ to enable parsing of '\" <string> + * sequences in source files to set the format pipeline. + * This is necessary because the default pipeline causes incorrect + * display of ascii(7) on Linux. + * This depends on GNU roff. + */ +#ifdef HAS_GROFF +#define HANDLE_ROFFSEQ +#endif + +#define DEFAULT_WIDTH 500 /* The default width of xman. */ +#define SECTALLOC 8 /* The number of entries allocated + at a time for the manual structures. */ +#define ENTRYALLOC 100 /* The number of entries allocated + at a time for a section. */ + +#define INITIAL_DIR 0 /* The Initial Directory displayed. */ + +#define COPY "cp" /* copy command */ +#define CHMOD_MODE 00666 /* permissions set on saved formatted files */ +#define MANDESC "mandesc" /* name of the mandesc files */ + +#define INDENT 15 +#define TYP20STR "MMMMMMMMMMMMMMMMMMMM" + +#define FILE_SAVE "yes" +#define CANCEL_FILE_SAVE "no" +#define MANTEMP "/tmp/xmanXXXXXX" + +/* + * Macro Definitions. + */ + +#define streq(a, b) ( strcmp((a), (b)) == 0 ) + +/* + * Function definitions moved to man.h + */ diff --git a/app/xman/depcomp b/app/xman/depcomp new file mode 100644 index 000000000..04701da53 --- /dev/null +++ b/app/xman/depcomp @@ -0,0 +1,530 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2005-07-09.11 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. + +# 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, 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 program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to <bug-automake@gnu.org>. +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + outname="$stripped.o" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mecanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/app/xman/globals.c b/app/xman/globals.c new file mode 100644 index 000000000..e88095390 --- /dev/null +++ b/app/xman/globals.c @@ -0,0 +1,54 @@ +/* $XConsortium: globals.c,v 1.9 94/04/17 20:43:51 rws Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ + + +#include "man.h" + +Xman_Resources resources; /* Resource manager sets these. */ + +/* bookkeeping global variables. */ + +Widget help_widget; /* The help widget. */ + +int default_height,default_width; /* Approximately the default with and + height, of the manpage when shown, + the the top level manual page + window */ + +Manual * manual; /* The manual structure. */ +int sections; /* The number of manual sections. */ + +int man_pages_shown; /* The current number of manual + pages being shown, if 0 we exit. */ + +Widget initial_widget; /* The initial widget, never realized. */ + +XContext manglobals_context; /* The context for man_globals. */ diff --git a/app/xman/globals.h b/app/xman/globals.h new file mode 100644 index 000000000..d629f514c --- /dev/null +++ b/app/xman/globals.h @@ -0,0 +1,56 @@ +/* $XConsortium: globals.h,v 1.9 94/04/17 20:43:51 dave Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ +/* $XFree86$ */ + +#include "man.h" + +extern Xman_Resources resources; /* Resource manager sets these. */ + +/* bookkeeping global variables. */ + +extern Widget help_widget; /* The help widget. */ + +extern int default_height,default_width; /* Approximately the default with and + height, of the manpage when shown, + the the top level manual page + window */ +extern int man_pages_shown; /* The current number of manual + pages being shown, if 0 we exit. */ + +extern Manual * manual; /* The manual structure. */ +extern int sections; /* The number of manual sections. */ + +extern XContext manglobals_context; /* The context for man_globals. */ + +extern Widget initial_widget; /* The initial widget, never realized. */ + +extern char **saved_argv; +extern int saved_argc; diff --git a/app/xman/handler.c b/app/xman/handler.c new file mode 100644 index 000000000..f89cdd609 --- /dev/null +++ b/app/xman/handler.c @@ -0,0 +1,724 @@ +/* $XConsortium: handler.c,v 1.22 94/12/16 21:36:53 gildea Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ +/* $XFree86: xc/programs/xman/handler.c,v 1.6 2003/01/19 04:44:45 paulo Exp $ */ + +/* + * xman - X window system manual page display program. + * Author: Chris D. Peterson, MIT Project Athena + * Created: October 29, 1987 + */ + +#include <sys/types.h> +#include <sys/stat.h> +#include "globals.h" +#include "vendor.h" +#ifdef INCLUDE_XPRINT_SUPPORT +#include "printdialog.h" +#include "print.h" +#endif /* INCLUDE_XPRINT_SUPPORT */ + +static void PutUpManpage(ManpageGlobals * man_globals, FILE * file); +static void ToggleBothShownState(ManpageGlobals * man_globals); + +/* Function Name: OptionCallback + * Description: This is the callback function for the callback menu. + * Arguments: w - the widget we are calling back from. + * globals_pointer - a pointer to the psuedo globals structure + * for this manpage. + * junk - (call data) not used. + * Returns: none. + */ + +/*ARGSUSED*/ +void +OptionCallback(Widget w, XtPointer pointer, XtPointer junk) +{ + ManpageGlobals * man_globals = (ManpageGlobals *) pointer; + String params; + Cardinal num_params = 1; + + if ( w == man_globals->search_entry ) + PopupSearch(XtParent(w), NULL, NULL, NULL); + else if (w == man_globals->dir_entry) { /* Put Up Directory */ + params = "Directory"; + GotoPage(XtParent(w), NULL, ¶ms, &num_params); + } + else if (w == man_globals->manpage_entry ) { /* Put Up Man Page */ + params = "ManualPage"; + GotoPage(XtParent(w), NULL, ¶ms, &num_params); + } + else if ( w == man_globals->help_entry ) /* Help */ + PopupHelp(XtParent(w), NULL, NULL, NULL); + else if ( w == man_globals->both_screens_entry ) /*Toggle Both_Shown State.*/ + ToggleBothShownState(man_globals); + else if ( w == man_globals->remove_entry) /* Kill the manpage */ + RemoveThisManpage(XtParent(w), NULL, NULL, NULL); + else if ( w == man_globals->open_entry) /* Open new manpage */ + CreateNewManpage(XtParent(w), NULL, NULL, NULL); +#ifdef INCLUDE_XPRINT_SUPPORT + else if ( w == man_globals->print_entry) /* Print current manpage */ + PrintThisManpage(XtParent(w), NULL, NULL, NULL); +#endif /* INCLUDE_XPRINT_SUPPORT */ + else if ( w == man_globals->version_entry) /* Get version */ + ShowVersion(XtParent(w), NULL, NULL, NULL); + else if ( w == man_globals->quit_entry) /* Quit. */ + Quit(XtParent(w), NULL, NULL, NULL); +} + +/* Function Name: ToggleBothShownState; + * Description: toggles the state of the both shown feature. + * Arguments: man_globals - the man globals structure. + * Returns: none. + */ + +/* + * I did not have a two state widget, which is the way this + * should really be done. 1/22/88 - CDP. + */ + +static void +ToggleBothShownState(ManpageGlobals * man_globals) +{ + char * label_str; + Arg arglist[1]; + + if (man_globals->both_shown == TRUE) { + label_str = SHOW_BOTH; + if (man_globals->dir_shown) + XtUnmanageChild(man_globals->manpagewidgets.manpage); + else + XtUnmanageChild(man_globals->manpagewidgets.directory); + } + else { + Widget manpage = man_globals->manpagewidgets.manpage; + Widget dir = man_globals->manpagewidgets.directory; + + label_str = SHOW_ONE; + + XtSetArg(arglist[0], XtNpreferredPaneSize, resources.directory_height); + XtSetValues(dir, arglist, (Cardinal) 1); + + if (!man_globals->dir_shown) { + XtUnmanageChild(manpage); + XtManageChild(dir); + } + XtManageChild(manpage); + } + man_globals->both_shown = !man_globals->both_shown; + + if (man_globals->dir_shown) + ChangeLabel(man_globals->label, + man_globals->section_name[man_globals->current_directory]); + else + ChangeLabel(man_globals->label, man_globals->manpage_title); + + XtSetArg(arglist[0], XtNlabel, label_str); + XtSetValues(man_globals->both_screens_entry, arglist, ONE); + + /* if both are shown there is no need to switch between the two. */ + + XtSetArg(arglist[0], XtNsensitive, !man_globals->both_shown); + XtSetValues(man_globals->manpage_entry, arglist, ONE); + XtSetValues(man_globals->dir_entry, arglist, ONE); +} + +/* Function Name: Popup + * Description: This function pops up the given widget under the cursor. + * Arguments: w - the widget to popup. + * grab_kind - the kind of grab to register. + * Returns: none + */ + +/* How far off the top of the widget to have the initial cursor postion. */ + +#define OFF_OF_TOP 25 + +void +Popup(Widget w, XtGrabKind grab_kind) +{ + int x_root,y_root,y_pos,garbage; + unsigned int mask; + Window junk_window; + + XQueryPointer(XtDisplay(w), XtWindow(w), &junk_window, &junk_window, + &x_root, &y_root, &garbage, &garbage, &mask); + + y_pos = OFF_OF_TOP - Height(w)/2 - BorderWidth(w); + PositionCenter(w, x_root, y_root, y_pos, 0, 2, 2); + XtPopup(w, grab_kind); +} + +/* Function Name: PutUpManpage + * Description: Puts the manpage on the display. + * Arguments: man_globals - a pointer to the psuedo globals structure + * for this manpage. + * file - the file to display. + * Returns: none. + */ + +static void +PutUpManpage(ManpageGlobals * man_globals, FILE * file) +{ + String params = "ManualPage"; + Cardinal num_params = 1; + + if (file == NULL) + return; + + OpenFile(man_globals, file); + + if (!man_globals->both_shown) { + Arg arglist[1]; + XtSetArg(arglist[0], XtNsensitive, TRUE); + XtSetValues(man_globals->manpage_entry, arglist, ONE); + XtSetValues(man_globals->both_screens_entry, arglist, ONE); + } + GotoPage(man_globals->manpagewidgets.manpage, NULL, ¶ms, &num_params); +} + +/* Function Name: DirectoryHandler + * Description: This is the callback function for the directory listings. + * Arguments: w - the widget we are calling back from. + * global_pointer - the pointer to the psuedo global structure + * associated with this manpage. + * ret_val - return value from the list widget. + * Returns: none. + */ + +void +DirectoryHandler(Widget w, XtPointer global_pointer, XtPointer ret_val) +{ + FILE * file; /* The manpage file. */ + ManpageGlobals * man_globals = (ManpageGlobals *) global_pointer; + XawListReturnStruct * ret_struct = (XawListReturnStruct *) ret_val; + + file = FindManualFile(man_globals, man_globals->current_directory, + ret_struct->list_index); + PutUpManpage(man_globals, file); + if ((file != NULL) && (file != man_globals->curr_file)) { + fclose(file); + } +} + +/* Function Name: DirPopupCallback + * Description: This is the callback function for the callback menu. + * Arguments: w - the widget we are calling back from. + * pointer - a pointer to the psuedo globals structure + * for this manpage. + * junk - (call data) not used. + * Returns: none. + */ + +/*ARGSUSED*/ +void +DirPopupCallback(Widget w, XtPointer pointer, XtPointer junk) +{ + ManpageGlobals * man_globals; + MenuStruct * menu_struct; + Widget parent; + int number; + int current_box; + + menu_struct = (MenuStruct *) pointer; + man_globals = (ManpageGlobals *) menu_struct->data; + + number = menu_struct->number; + current_box = man_globals->current_directory; + + /* We have used this guy, pop down the menu. */ + + if (number != current_box) { + /* This is the only one that we know has a parent. */ + parent = XtParent(man_globals->manpagewidgets.box[INITIAL_DIR]); + + MakeDirectoryBox(man_globals, parent, + man_globals->manpagewidgets.box + number, number); + XtUnmanageChild(man_globals->manpagewidgets.box[current_box]); + XtManageChild(man_globals->manpagewidgets.box[number]); + + XawListUnhighlight(man_globals->manpagewidgets.box[current_box]); + ChangeLabel(man_globals->label, man_globals->section_name[number]); + man_globals->current_directory = number; + } + + /* put up directory. */ + if (!man_globals->both_shown) { + XtUnmanageChild(man_globals->manpagewidgets.manpage); + XtManageChild(man_globals->manpagewidgets.directory); + } +} + +/************************************************************ + * + * Action Routines. + * + ************************************************************/ + +/* Function Name: SaveFormattedPage + * Description: This is the action routine may save the manpage. + * Arguments: w - any widget in the widget tree. + * event - NOT USED. + * params, num_params - the parameters paseed to the action + * routine, can be either Manpage or + * Directory. + * Returns: none. + */ + +/*ARGSUSED*/ +void +SaveFormattedPage(Widget w, XEvent * event, String * params, Cardinal * num_params) +{ + ManpageGlobals * man_globals; + char cmdbuf[BUFSIZ], error_buf[BUFSIZ]; + + if (*num_params != 1) { + XtAppWarning(XtWidgetToApplicationContext(w), + "Xman - SaveFormattedPage: This action routine requires one argument."); + return; + } + + man_globals = GetGlobals(w); + +/* + * If we are not active then take no action. + */ + + if (man_globals->tempfile == '\0') return; + + switch (params[0][0]) { + case 'S': + case 's': + +#ifndef NO_COMPRESS + if (!man_globals->compress) +#endif + + sprintf(cmdbuf, "%s %s %s", COPY, man_globals->tempfile, + man_globals->save_file); + +#ifndef NO_COMPRESS + else + if (man_globals->gzip) + sprintf(cmdbuf, "%s < %s > %s", GZIP_COMPRESS, man_globals->tempfile, + man_globals->save_file); + else + sprintf(cmdbuf, "%s < %s > %s", COMPRESS, man_globals->tempfile, + man_globals->save_file); +#endif + + if(! system(cmdbuf)) { + /* make sure the formatted man page is fully accessible by the world */ + if (chmod(man_globals->save_file, CHMOD_MODE) != 0) { + sprintf(error_buf, + "Couldn't set permissions on formatted man page '%s'.\n", + man_globals->save_file); + PopupWarning( man_globals, error_buf); + } + } else { + sprintf(error_buf, "Error while executing the command '%s'.\n", + cmdbuf); + PopupWarning( man_globals, error_buf); + } + break; + case 'C': + case 'c': + break; + default: + sprintf(error_buf,"%s %s", "Xman - SaveFormattedPagee:", + "Unknown argument must be either 'Save' or 'Cancel'."); + PopupWarning(man_globals, error_buf); + return; + } + +/* + * We do not need the filename anymore, and have the fd open. + * We will unlink it. + */ + + unlink(man_globals->tempfile); + XtPopdown( XtParent(XtParent(w)) ); +} + +/* Function Name: GotoPage + * Description: The Action routine that switches over to the manpage + * or directory. + * Arguments: w - any widget in the widget tree. + * event - NOT USED. + * params, num_params - the parameters paseed to the action + * routine, can be either Manpage or + * Directory. + * Returns: none. + */ + +/*ARGSUSED*/ +void +GotoPage(Widget w, XEvent * event, String * params, Cardinal * num_params) +{ + ManpageGlobals * man_globals; + char error_buf[BUFSIZ]; + Arg arglist[1]; + Boolean sensitive; + + if (*num_params != 1) { + XtAppWarning(XtWidgetToApplicationContext(w), + "Xman - GotoPage: This action routine requires one argument."); + return; + } + + man_globals = GetGlobals(w); + + if (man_globals->both_shown) { + ChangeLabel(man_globals->label, + man_globals->section_name[man_globals->current_directory]); + return; + } + + switch (params[0][0]) { + case 'M': + case 'm': + XtSetArg(arglist[0], XtNsensitive, &sensitive); + XtGetValues(man_globals->manpage_entry, arglist, ONE); + if (sensitive) { + ChangeLabel(man_globals->label,man_globals->manpage_title); + XtUnmanageChild(man_globals->manpagewidgets.directory); + XtManageChild(man_globals->manpagewidgets.manpage); + man_globals->dir_shown = FALSE; + } + break; + case 'D': + case 'd': + ChangeLabel(man_globals->label, + man_globals->section_name[man_globals->current_directory]); + XtUnmanageChild(man_globals->manpagewidgets.manpage); + XtManageChild(man_globals->manpagewidgets.directory); + man_globals->dir_shown = TRUE; + break; + default: + sprintf(error_buf,"%s %s", "Xman - GotoPage: Unknown argument must be", + "either Manpage or Directory."); + XtAppWarning(XtWidgetToApplicationContext(w), error_buf); + return; + } +} + +/* Function Name: Quit. + * Description: Quits Xman. + * Arguments: w - any widget. + * event - NOT USED. + * params, num_params - NOT USED. + * Returns: none. + */ + +/*ARGSUSED*/ +void +Quit(Widget w, XEvent * event, String * params, Cardinal * num_params) +{ + XtAppSetExitFlag(XtWidgetToApplicationContext(w)); +} + +/* Function Name: PopupHelp + * Description: Pops up xman's help. + * Arguments: w - NOT USED. + * event - NOT USED. + * params, num_params - NOT USED. + * Returns: none. + */ + +/*ARGSUSED*/ +void +PopupHelp(Widget w, XEvent * event, String * params, Cardinal * num_params) +{ + if (MakeHelpWidget()) + XtPopup(help_widget,XtGrabNone); +} + +/* Function Name: PopupSearch + * Description: Pops up this manual pages search widget. + * Arguments: w - any widget in this manpage. + * event - NOT USED. + * params, num_params - NOT USED. + * Returns: none. + */ + +/*ARGSUSED*/ +void +PopupSearch(Widget w, XEvent * event, String * params, Cardinal * num_params) +{ + ManpageGlobals * man_globals = GetGlobals(w); + + if (man_globals->search_widget) { + if (!XtIsRealized(man_globals->search_widget)) { + XtRealizeWidget(man_globals->search_widget); + AddCursor(man_globals->search_widget, resources.cursors.search_entry); + } + Popup(man_globals->search_widget, XtGrabNone); + } +} + +/* Function Name: CreateNewManpage + * Description: Creates A New Manual Page. + * Arguments: w - NOT USED. + * event - NOT USED. + * params, num_params - NOT USED. + * Returns: none. + */ + +/*ARGSUSED*/ +void +CreateNewManpage(Widget w, XEvent * event, String * params, Cardinal * num_params) +{ + (void) CreateManpage(NULL); + man_pages_shown++; +} + +/* Function Name: RemoveThisManpage + * Description: Removes a manual page. + * Arguments: w - any widget in the manpage. + * event - NOT USED. + * params, num_params - NOT USED. + * Returns: none. + */ + +/*ARGSUSED*/ +void +RemoveThisManpage(Widget w, XEvent * event, String * params, Cardinal * num_params) +{ + ManpageGlobals * man_globals = GetGlobals(w); + + if (man_globals->This_Manpage != help_widget) { + RemoveGlobals(man_globals->This_Manpage); + XtDestroyWidget(man_globals->This_Manpage); + + XtFree( (char *) man_globals->section_name); + XtFree( (char *) man_globals->manpagewidgets.box); + XtFree( (char *) man_globals); + + if ( (--man_pages_shown) == 0) + Quit(w, NULL, NULL, NULL); + } + else + XtPopdown(help_widget); +} + +/* Function Name: Search + * Description: Actually performs a search. + * Arguments: w - any widget in the manpage. + * event - NOT USED. + * params, num_params - NOT USED. + * Returns: none. + */ + +/*ARGSUSED*/ +void +Search(Widget w, XEvent * event, String * params, Cardinal * num_params) +{ + ManpageGlobals * man_globals = GetGlobals(w); + FILE * file = NULL; + + XtPopdown( XtParent(XtParent(w)) ); /* popdown the search widget */ + + if ( (*num_params < 1) || (*num_params > 2) ) { + XtAppWarning(XtWidgetToApplicationContext(w), + "Xman - Search: This action routine requires one or two arguments."); + return; + } + + switch(params[0][0]) { + case 'a': + case 'A': + file = DoSearch(man_globals,APROPOS); + break; + case 'm': + case 'M': + file = DoSearch(man_globals,MANUAL); + break; + case 'c': + case 'C': + file = NULL; + break; + default: + XtAppWarning(XtWidgetToApplicationContext(w), + "Xman - Search: First parameter unknown."); + file = NULL; + break; + } + + if ( *num_params == 2 ) + switch (params[1][0]) { + case 'O': + case 'o': + if (file != NULL) { + Widget w; + char * label; + + w = CreateManpage(file); + man_pages_shown++; + + /* Put title into new manual page. */ + + label = man_globals->manpage_title; + man_globals = GetGlobals(w); + strcpy(man_globals->manpage_title, label); + ChangeLabel(man_globals->label, label); + } + break; + default: + XtAppWarning(XtWidgetToApplicationContext(w), + "Xman - Search: Second parameter unknown."); + break; + } + else { + PutUpManpage(man_globals, file); + } + if ((file != NULL) && (file != man_globals->curr_file)) { + fclose(file); + } +} + +#ifdef INCLUDE_XPRINT_SUPPORT +static void +printshellDestroyXtProc(Widget w, XtPointer client_data, XtPointer callData) +{ + ManpageGlobals *mg = GetGlobals(w); + XawPrintDialogClosePrinterConnection(mg->printdialog, False); +} + +static void +printOKXtProc(Widget w, XtPointer client_data, XtPointer callData) +{ + XawPrintDialogCallbackStruct *pdcs = (XawPrintDialogCallbackStruct *)callData; + Cardinal n; + Arg args[2]; + ManpageGlobals *mg = GetGlobals(w); + Widget topwindow = mg->This_Manpage; + FILE *file; + + Log(("printOKXtProc: OK.\n")); + + /* Get file object */ + n = 0; + XtSetArg(args[n], XtNfile, &file); n++; + XtGetValues(mg->manpagewidgets.manpage, args, n); + Assertion(file != NULL, (("printOKXtProc: file == NULL.\n"))); + + DoPrintManpage("Xman", + file, topwindow, + pdcs->pdpy, pdcs->pcontext, pdcs->colorspace, + printshellDestroyXtProc, + mg->manpage_title, + pdcs->printToFile?pdcs->printToFileName:NULL); + + XtPopdown(mg->printdialog_shell); +} + +static void +printCancelXtProc(Widget w, XtPointer client_data, XtPointer callData) +{ + ManpageGlobals * mg = GetGlobals(w); + + Log(("printCancelXtProc: cancel.\n")); + XtPopdown(mg->printdialog_shell); + + Log(("destroying print dialog shell...\n")); + XtDestroyWidget(mg->printdialog_shell); + mg->printdialog_shell = NULL; + mg->printdialog = NULL; + Log(("... done\n")); +} + +/* Function Name: PrintThisManpage + * Description: Print the current manual page. + * Arguments: mg - manpage globals + * Returns: none. + */ + +/*ARGSUSED*/ +void +PrintThisManpage(Widget w, XEvent * event, String * params, Cardinal * num_params) +{ + ManpageGlobals *mg = GetGlobals(w); + Dimension width, height; + Position x, y; + Widget parent = mg->This_Manpage; + Widget topwindow = mg->This_Manpage; + Log(("print!\n")); + + if (!mg->printdialog) { + int n; + Arg args[20]; + + n = 0; + XtSetArg(args[n], XtNallowShellResize, True); n++; + mg->printdialog_shell = XtCreatePopupShell("printdialogshell", + transientShellWidgetClass, + topwindow, args, n); + n = 0; + mg->printdialog = XtCreateManagedWidget("printdialog", printDialogWidgetClass, + mg->printdialog_shell, args, n); + XtAddCallback(mg->printdialog, XawNOkCallback, printOKXtProc, NULL); + XtAddCallback(mg->printdialog, XawNCancelCallback, printCancelXtProc, NULL); + + XtRealizeWidget(mg->printdialog_shell); + } + + /* Center dialog */ + XtVaGetValues(mg->printdialog_shell, + XtNwidth, &width, + XtNheight, &height, + NULL); + + x = (Position)(XWidthOfScreen( XtScreen(parent)) - width) / 2; + y = (Position)(XHeightOfScreen(XtScreen(parent)) - height) / 3; + + XtVaSetValues(mg->printdialog_shell, + XtNx, x, + XtNy, y, + NULL); + + XtPopup(mg->printdialog_shell, XtGrabNonexclusive); +} +#endif /* INCLUDE_XPRINT_SUPPORT */ + +/* Function Name: ShowVersion + * Description: Show current version. + * Arguments: w - any widget in the manpage. + * event - NOT USED. + * params, num_params - NOT USED. + * Returns: none. + */ + +/*ARGSUSED*/ +void +ShowVersion(Widget w, XEvent * event, String * params, Cardinal * num_params) +{ + ManpageGlobals * man_globals = GetGlobals(w); + ChangeLabel(man_globals->label, XMAN_VERSION); +} diff --git a/app/xman/help.c b/app/xman/help.c new file mode 100644 index 000000000..76956dff1 --- /dev/null +++ b/app/xman/help.c @@ -0,0 +1,110 @@ +/* $XConsortium: help.c,v 1.10 94/04/17 20:43:53 dave Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ +/* $XFree86$ */ + +/* + * xman - X window system manual page display program. + * Author: Chris D. Peterson, MIT Project Athena + * Created: January 19, 1988 + */ + +#include "globals.h" + +extern Atom wm_delete_window; /* in main.c */ + +/* Function Name: MakeHelpWidget. + * Description: This function creates the help widget so that it will be + * ready to be displayed. + * Arguments: none. + * Returns: none. + */ + +Boolean +MakeHelpWidget(void) +{ + + ManpageGlobals * man_globals; /* The psuedo global structure. */ + + if (help_widget != NULL) /* If we already have a help widget. + then do not create one. */ + return(TRUE); + + man_globals = InitPsuedoGlobals(); + + CreateManpageWidget(man_globals, HELPNAME, FALSE); + help_widget = man_globals->This_Manpage; + + if (OpenHelpfile(man_globals) == FALSE) { + XtDestroyWidget(help_widget); + help_widget = NULL; + return(FALSE); + } + + ChangeLabel(man_globals->label, "Xman Help"); + + XtManageChild( man_globals->manpagewidgets.manpage ); + XtRealizeWidget( help_widget ); + SaveGlobals( man_globals->This_Manpage, man_globals ); + AddCursor( help_widget, resources.cursors.manpage); + +/* + * Set up ICCCM delete window. + */ + XtOverrideTranslations + (man_globals->This_Manpage, + XtParseTranslationTable ("<Message>WM_PROTOCOLS: RemoveThisManpage()")); + (void) XSetWMProtocols (XtDisplay(man_globals->This_Manpage), + XtWindow(man_globals->This_Manpage), + &wm_delete_window, 1); + + return(TRUE); +} + +/* Function Name: OpenHelpfile + * Description: opens the helpfile. + * Arguments: man_globals - the psuedo globals structure. + * Returns: False if no helpfile was found. + */ + +Boolean +OpenHelpfile(ManpageGlobals * man_globals) +{ + FILE * help_file_ptr; + + if( (help_file_ptr = fopen(resources.help_file, "r")) == NULL ) { + PopupWarning(man_globals, + "Could not open help file, NO HELP WILL BE AVALIABLE."); + return(FALSE); + } + + OpenFile(man_globals, help_file_ptr); + return(TRUE); +} diff --git a/app/xman/icon_help.h b/app/xman/icon_help.h new file mode 100644 index 000000000..228c3c79a --- /dev/null +++ b/app/xman/icon_help.h @@ -0,0 +1,50 @@ +/* $XConsortium: icon_help.h,v 1.5 94/04/17 20:43:54 rws Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ + +/* + * xman - X window system manual page display program. + * Author: Chris D. Peterson, MIT Project Athena + * Created: August 15, 1988 + */ + +#define icon_help_width 30 +#define icon_help_height 30 +static unsigned char icon_help_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xf0, 0x00, 0xf8, 0xdf, 0xfe, 0x07, + 0x3e, 0xfc, 0x0f, 0x1f, 0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18, + 0x06, 0xe0, 0x03, 0x18, 0x06, 0xf0, 0x07, 0x18, 0x06, 0x18, 0x0c, 0x18, + 0x06, 0x0c, 0x18, 0x18, 0x06, 0x0c, 0x18, 0x18, 0x06, 0x0c, 0x18, 0x18, + 0x06, 0x00, 0x18, 0x18, 0x06, 0x00, 0x18, 0x18, 0x06, 0x00, 0x0c, 0x18, + 0x06, 0x80, 0x07, 0x18, 0x06, 0xc0, 0x03, 0x18, 0x06, 0xc0, 0x00, 0x18, + 0x06, 0xc0, 0x00, 0x18, 0x06, 0xc0, 0x00, 0x18, 0x06, 0xc0, 0x00, 0x18, + 0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18, 0x06, 0xc0, 0x00, 0x18, + 0x06, 0xc0, 0x00, 0x18, 0xc6, 0x03, 0xf0, 0x18, 0xfe, 0x1f, 0xfe, 0x1f, + 0x3e, 0xfc, 0x0f, 0x1f, 0x06, 0xc0, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00}; diff --git a/app/xman/icon_open.h b/app/xman/icon_open.h new file mode 100644 index 000000000..b47b1d11e --- /dev/null +++ b/app/xman/icon_open.h @@ -0,0 +1,50 @@ +/* $XConsortium: icon_open.h,v 1.5 94/04/17 20:43:54 rws Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ + +/* + * xman - X window system manual page display program. + * Author: Chris D. Peterson, MIT Project Athena + * Created: January 29, 1988 + */ + +#define icon_open_width 30 +#define icon_open_height 30 +static unsigned char icon_open_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xf0, 0x00, 0xf8, 0xdf, 0xfe, 0x07, + 0x3e, 0xfc, 0x0f, 0x1f, 0x06, 0x00, 0x00, 0x18, 0x06, 0x30, 0x03, 0x18, + 0xc6, 0x31, 0xe3, 0x18, 0x36, 0x32, 0x13, 0x1b, 0x06, 0x30, 0x03, 0x18, + 0xc6, 0xf1, 0xe3, 0x18, 0x36, 0xe2, 0x11, 0x1b, 0x06, 0x00, 0x00, 0x18, + 0xc6, 0xf1, 0xe3, 0x18, 0x36, 0x32, 0x13, 0x1b, 0x06, 0x30, 0x03, 0x18, + 0xc6, 0xf1, 0xe3, 0x18, 0x36, 0x32, 0x10, 0x1b, 0x06, 0x30, 0x00, 0x18, + 0xc6, 0x01, 0xe0, 0x18, 0x36, 0x3a, 0x17, 0x1b, 0x06, 0xf8, 0x07, 0x18, + 0xc6, 0xd9, 0xe6, 0x18, 0x36, 0xda, 0x16, 0x1b, 0x06, 0x18, 0x06, 0x18, + 0x06, 0x18, 0x06, 0x18, 0xc6, 0x03, 0xf0, 0x18, 0xfe, 0x1f, 0xfe, 0x1f, + 0x3e, 0xfc, 0x0f, 0x1f, 0x06, 0xc0, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00}; diff --git a/app/xman/iconclosed.h b/app/xman/iconclosed.h new file mode 100644 index 000000000..106068c58 --- /dev/null +++ b/app/xman/iconclosed.h @@ -0,0 +1,47 @@ +/* $XConsortium: iconclosed.h,v 1.5 94/04/17 20:43:55 rws Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ + +/* + * Author: Chris D. Peterson, MIT Project Athena + * Created: January 29, 1988 + */ + +#define iconclosed_width 20 +#define iconclosed_height 30 +static unsigned char iconclosed_bits[] = { + 0x00, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x0e, 0xf8, 0x07, 0x06, 0x00, 0x05, + 0xfe, 0xff, 0x04, 0xbe, 0xfb, 0x04, 0xbe, 0xfb, 0x04, 0xbe, 0xfb, 0x04, + 0xbe, 0xfb, 0x04, 0xbe, 0xfb, 0x04, 0x3e, 0xf8, 0x04, 0xfe, 0xff, 0x04, + 0xfe, 0xff, 0x04, 0x3e, 0xf8, 0x04, 0xbe, 0xfb, 0x04, 0xbe, 0xfb, 0x04, + 0x3e, 0xf8, 0x04, 0xbe, 0xff, 0x04, 0xbe, 0xff, 0x04, 0xfe, 0xff, 0x04, + 0xfe, 0xff, 0x04, 0x3e, 0xf9, 0x04, 0x3e, 0xf9, 0x04, 0xbe, 0xfa, 0x04, + 0xbe, 0xfa, 0x04, 0xbe, 0xfb, 0x06, 0xbe, 0xfb, 0x05, 0xfe, 0xff, 0x00, + 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00}; diff --git a/app/xman/install-sh b/app/xman/install-sh new file mode 100644 index 000000000..4d4a9519e --- /dev/null +++ b/app/xman/install-sh @@ -0,0 +1,323 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2005-05-14.22 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# 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. It can only install one file at a time, a restriction +# shared with many OS's install programs. + +# 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}" + +chmodcmd="$chmodprog 0755" +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test -n "$1"; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit $?;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + *) # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + test -n "$dir_arg$dstarg" && break + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done + break;; + esac +done + +if test -z "$1"; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + src= + + if test -d "$dst"; then + mkdircmd=: + chmodcmd= + else + mkdircmd=$mkdirprog + fi + else + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dst=$dst/`basename "$src"` + fi + fi + + # This sed command emulates the dirname command. + dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` + + # Make sure that the destination directory exists. + + # Skip lots of stat calls in the usual case. + if test ! -d "$dstdir"; then + defaultIFS=' + ' + IFS="${IFS-$defaultIFS}" + + oIFS=$IFS + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` + shift + IFS=$oIFS + + pathcomp= + + while test $# -ne 0 ; do + pathcomp=$pathcomp$1 + shift + if test ! -d "$pathcomp"; then + $mkdirprog "$pathcomp" + # mkdir can fail with a `File exist' error in case several + # install-sh are creating the directory concurrently. This + # is OK. + test -d "$pathcomp" || exit + fi + pathcomp=$pathcomp/ + done + fi + + if test -n "$dir_arg"; then + $doit $mkdircmd "$dst" \ + && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } + + else + dstfile=`basename "$dst"` + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + trap '(exit $?); exit' 1 2 13 15 + + # Copy the file name to the temp name. + $doit $cpprog "$src" "$dsttmp" && + + # 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 $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dstdir/$dstfile"; then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ + || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ + || { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + } + } + fi || { (exit 1); exit 1; } +done + +# The final little trick to "correctly" pass the exit status to the exit trap. +{ + (exit 0); exit 0 +} + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/app/xman/main.c b/app/xman/main.c new file mode 100644 index 000000000..6030c0a73 --- /dev/null +++ b/app/xman/main.c @@ -0,0 +1,300 @@ +/* $XConsortium: main.c,v 1.23 94/04/17 20:43:55 rws Exp $ */ +/* $XdotOrg: app/xman/main.c,v 1.4 2006/01/06 22:39:24 alanc Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ +/* $XFree86: xc/programs/xman/main.c,v 1.3 2000/03/03 23:16:27 dawes Exp $ */ + +/* + * xman - X window system manual page display program. + * Author: Chris D. Peterson, MIT Project Athena + * Created: October 22, 1987 + */ + +#include "globals.h" +#ifndef ZERO +#include <X11/Xaw/Cardinals.h> +#endif /* ZERO */ + +#if !defined(lint) && !defined(SABER) + static char version[] = XMAN_VERSION; /* via strings. */ +#endif + +static void ArgError(int argc, char ** argv); +static void AdjustDefResources(void); + +#define Offset(field) (XtOffsetOf(Xman_Resources , field)) + +static XtResource my_resources[] = { + {"directoryFontNormal", XtCFont, XtRFontStruct, sizeof(XFontStruct *), + Offset(fonts.directory), XtRString, DIRECTORY_NORMAL}, + {"bothShown", XtCBoolean, XtRBoolean, sizeof(Boolean), + Offset(both_shown_initial), XtRString, "False"}, + {"directoryHeight", "DirectoryHeight", XtRInt, sizeof(int), + Offset(directory_height), XtRString, "150"}, + {"topCursor", XtCCursor, XtRCursor, sizeof(Cursor), + Offset(cursors.top), XtRString, XMAN_CURSOR}, + {"helpCursor", XtCCursor, XtRCursor, sizeof(Cursor), + Offset(cursors.help), XtRString, HELP_CURSOR}, + {"manpageCursor", XtCCursor, XtRCursor, sizeof(Cursor), + Offset(cursors.manpage), XtRString, MANPAGE_CURSOR}, + {"searchEntryCursor", XtCCursor, XtRCursor, sizeof(Cursor), + Offset(cursors.search_entry), XtRString, SEARCH_ENTRY_CURSOR}, + {"pointerColor", XtCForeground, XtRPixel, sizeof(Pixel), + Offset(cursors.fg_color), XtRString, "XtDefaultForeground"}, + {"pointerColorBackground", XtCBackground, XtRPixel, sizeof(Pixel), + Offset(cursors.bg_color), XtRString, "XtDefaultBackground"}, + {"help", XtCBoolean, XtRBoolean, sizeof(Boolean), + Offset(show_help_syntax), XtRImmediate, FALSE}, + {"helpFile", XtCFile, XtRString, sizeof(char *), + Offset(help_file), XtRString, HELPFILE}, + {"topBox", XtCBoolean, XtRBoolean, sizeof(Boolean), + Offset(top_box_active), XtRString, "True"}, + {"clearSearchString", "ClearSearchString", XtRBoolean, sizeof(Boolean), + Offset(clear_search_string), XtRImmediate, (caddr_t) TRUE}, + {"title", XtCString, XtRString, sizeof(char *), + Offset(title), XtRString, "xman"}, + {"iconic", XtCBoolean, XtRBoolean, sizeof(Boolean), + Offset(iconic), XtRString, "False"}, +}; + +#undef Offset + +/* + * The resource that we absolutely need. + */ + +static char * fallback_resources[] = { "Xman*quitButton.translations: #override \\n <Btn1Up>: Quit() reset()", + "Xman*helpButton.sensitive: FALSE", + "Xman*manpageButton.sensitive: FALSE", + "Xman*helpButton.Label: Help", + "Xman*quitButton.Label: Quit", + "Xman*manpageButton.Label: Manual Page", + "Xman*topLabel.label: No App-Defaults File", + NULL, +}; + +/* + * This is necessary to keep all TopLevel shells from becoming + * the size that is specified on the command line. + */ + +static XrmOptionDescRec xman_options[] = { +{"-geometry", "*topBox.geometry", XrmoptionSepArg, (caddr_t) NULL}, +{"-help", "help", XrmoptionNoArg, (caddr_t) "True"}, +{"=", "*topBox.geometry", XrmoptionIsArg, (caddr_t) NULL}, +{"-pagesize", "*manualBrowser.geometry", XrmoptionSepArg, (caddr_t) NULL}, +{"-notopbox", "topBox", XrmoptionNoArg, (caddr_t) "False"}, +{"-helpfile", "helpFile", XrmoptionSepArg, (caddr_t) NULL}, +{"-bothshown","bothShown", XrmoptionNoArg, (caddr_t) "True"}, +{"-title", "title", XrmoptionSepArg, (caddr_t) "xman"}, +{"-iconic", "iconic", XrmoptionNoArg, (caddr_t) "True"}, +}; + +XtActionsRec xman_actions[] = { + {"GotoPage", GotoPage}, + {"Quit", Quit}, + {"Search", Search}, + {"PopupHelp", PopupHelp}, + {"PopupSearch", PopupSearch}, + {"CreateNewManpage", CreateNewManpage}, + {"RemoveThisManpage", RemoveThisManpage}, + {"SaveFormattedPage", SaveFormattedPage}, +#ifdef INCLUDE_XPRINT_SUPPORT + {"PrintThisManpage", PrintThisManpage}, +#endif /* INCLUDE_XPRINT_SUPPORT */ + {"ShowVersion", ShowVersion}, +}; + +char **saved_argv; +int saved_argc; + +/* + * This atom is used to make the application ICCCM compliant. + */ +Atom wm_delete_window; + +/* Function Name: main + * Description: This is the main driver for Xman. + * Arguments: argc, argv - the command line arguments. + * Returns: return, what return. + */ + +int main(int argc, char ** argv) +{ + XtAppContext app_con; + + saved_argc = argc; + saved_argv = (char **)XtMalloc(argc * sizeof(char *)); + bcopy(argv, saved_argv, argc * sizeof(char *)); + + XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); + + initial_widget = XtAppInitialize(&app_con, "Xman", xman_options, + XtNumber(xman_options), &argc, argv, + fallback_resources, NULL, ZERO); + wm_delete_window = XInternAtom(XtDisplay(initial_widget), "WM_DELETE_WINDOW", + False); + + manglobals_context = XStringToContext(MANNAME); + + AdjustDefResources(); + + XtGetApplicationResources( initial_widget, (caddr_t) &resources, + my_resources, XtNumber(my_resources), + NULL, (Cardinal) 0); + + if ( (argc != 1) || (resources.show_help_syntax) ) { + ArgError(argc, argv); + return EXIT_FAILURE; + } + + XtAppAddActions(app_con, xman_actions, XtNumber(xman_actions)); + + if (!resources.fonts.directory) + PrintError("Failed to get the directory font."); + +#ifdef DEBUG + printf("debugging mode\n"); +#endif + +/* + * Set the default width and height. + * I am not real happy with this method, but it will usually do something + * reasonable, if not the "right" thing. It is not a real big issue since + * it is easy to change the values with resources or command line options. + * NOTE: if you are in a 100 dpi display you will lose. + */ + + default_width = DEFAULT_WIDTH; + default_height=DisplayHeight(XtDisplay(initial_widget), + DefaultScreen(XtDisplay(initial_widget))); + default_height *= 3; + default_height /= 4; + + if ( (sections = Man()) == 0 ) + PrintError("There are no manual sections to display, check your MANPATH."); + + if (resources.top_box_active) + MakeTopBox(); + else + (void) CreateManpage(NULL); + +/* + * We need to keep track of the number of manual pages that are shown on + * the screen so that if this user does not have a top box then when he + * removes all his manual pages we can kill off the xman process. + * To make things easier we will consider the top box a shown manual page + * here, but since you cannot remove it, man_page_shown only goes to zero when + * no top box is present. + */ + + man_pages_shown = 1; + + XtAppMainLoop(app_con); + + return EXIT_SUCCESS; +} + +/* Function Name: ArgError + * Description: Prints error message about unknow arguments. + * Arguments: argc, argv - args not understood. + * Returns: none. + */ + +static void +ArgError(int argc, char ** argv) +{ + int i; + + static char **syntax, *syntax_def[] = { + "-help", "Print this message", + "-helpfile <filename>", "Specifies the helpfile to use.", + "-bothshown", "Show both the directory and manpage at once.", + "-notopbox", "Starts with manpage rather than topbox.", + "-geometry <geom>", "Specifies the geometry of the top box.", + "=<geom>", "Specifies the geometry of the top box.", + "-pagesize <geom>", "Specifies the geometry of the manual page.", + "-bw <pixels>", "Width of all window borders.", + "-borderwidth <pixels>", "Width of all window borders.", + "-bd <color>", "Color of all window borders.", + "-bordercolor <color>", "Color of all window borders.", + "-fg <color>", "Foreground color for the application.", + "-foreground <color>", "Foreground color for the application.", + "-bg <color>", "Background color for the application.", + "-background <color>", "Background color for the application.", + "-display <display name>", "Specify a display that is not the default", + "-fn <font>", "Font to be used for button and label text.", + "-font <font>", "Font to be used for button and label text.", + "-name <name>", "Change the name used for retrieving resources.", + "-title <name>", "Change the name without affecting resources.", + "-xrm <resource>", "Specifies a resource on the command line.", + NULL, NULL, + }; + + syntax = syntax_def; + + for (i = 1; i < argc ; i++) + (void) printf("This argument is unknown to Xman: %s\n", argv[i]); + + (void) printf("\nKnown arguments are:\n"); + + while ( *syntax != NULL ) { + printf("%-30s - %s\n", syntax[0], syntax[1]); + syntax += 2; + } +} + +/* Function Name: AdjustDefResources + * Description: Changes default resources which contain paths when + * XWINHOME is set + * Arguments: none + * Returns: nothing + */ + +static void +AdjustDefResources(void) +{ + char *xwinhome = NULL; + int i; + + if (!(xwinhome = getenv("XWINHOME"))) + return; + + for (i = 0; i < sizeof(my_resources)/sizeof(XtResource); i++) { + if (!strcmp(my_resources[i].resource_name, "helpFile")) { + if (!(my_resources[i].default_addr = + malloc(strlen(xwinhome) + sizeof("/lib/X11/xman.help")))) { + fprintf(stderr, "malloc failure\n"); + exit(EXIT_FAILURE); + } + sprintf(my_resources[i].default_addr, "%s/lib/X11/xman.help", xwinhome); + } + } +} diff --git a/app/xman/man.c b/app/xman/man.c new file mode 100644 index 000000000..a67dd7f87 --- /dev/null +++ b/app/xman/man.c @@ -0,0 +1,1168 @@ +/* $XConsortium: man.c,v 1.30 94/04/17 20:43:56 rws Exp $ */ +/* $XdotOrg: app/xman/man.c,v 1.4 2005/11/08 06:33:33 jkj Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ +/* $XFree86: xc/programs/xman/man.c,v 1.8 2003/04/09 20:31:31 herrb Exp $ */ + + +#include "globals.h" +#include "vendor.h" /* vendor-specific defines and data */ + +#ifndef X_NOT_POSIX +#include <dirent.h> +#else +#ifdef SYSV +#include <dirent.h> +#else +#ifdef USG +#include <dirent.h> +#else +#include <sys/dir.h> +#ifndef dirent +#define dirent direct +#endif +#endif +#endif +#endif + +#ifdef DEBUG +static char error_buf[BUFSIZ]; /* The buffer for error messages. */ +#endif /* DEBUG */ + +static void AddToCurrentSection(Manual * local_manual, char * path); +static void InitManual(Manual * l_manual, char * label); +static void ReadCurrentSection(Manual * local_manual, char * path); +static void ReadMandescFile(SectionList ** section_list, char * path); +static void SortAndRemove(Manual *man, int number); +static void SortList(SectionList ** list); + +#define SECT_ERROR -1 + +#ifndef Byte +#define Byte unsigned char +#endif + +#ifndef reg +#define reg register +#endif + +static void sortstrs (Byte *data[], int size, Byte *otherdata[]); +static void sortstrs_block (Byte **, Byte **, int, Byte, Byte **, Byte **); +static void sortstrs_block_oo (Byte **, Byte **, int, Byte, int *, int *, Byte **, Byte **); + +/* Function Name: Man + * Description: Builds a list of all manual directories and files. + * Arguments: none. + * Returns: the number of manual sections. + */ + +int +Man(void) +{ + SectionList *list = NULL; + char *ptr, *lang = 0, manpath[BUFSIZ], buf[BUFSIZ], *path, *current_label; + int sect, num_alloced; + +/* + * Get the environment variable MANPATH, and if it doesn't exist then use + * SYSMANPATH and LOCALMANPATH. + */ + + /* if MANPATH variable ends in ':'. So, should extend it's value to the + * default search path. + */ + + *manpath = '\0'; + if ((ptr = getenv("MANPATH")) != NULL) + strcpy(manpath, ptr); + if (ptr == NULL || streq(ptr , "") || ptr[strlen(ptr) - 1] == ':') { + lang = getenv("LANG"); +#ifdef MANCONF + if (!ReadManConfig(manpath + strlen(manpath))) +#endif + { +#ifdef MANCONF + if (manpath[strlen(manpath) - 1] != ':') + strcat(manpath, ":"); +#endif + strcat(manpath, SYSMANPATH); +#ifdef LOCALMANPATH + strcat(manpath, ":"); + strcat(manpath, LOCALMANPATH); +#endif + } + } + +/* + * Get the list of manual directories in the users MANPATH that we should + * open to look for manual pages. The ``mandesc'' file is read here. + */ + + for ( path = manpath ; (ptr = index(path , ':')) != NULL ; path = ++ptr) { + *ptr = '\0'; + if (lang != 0) { + strcpy(buf, path); + strcat(buf, "/"); + strncat(buf, lang, sizeof(buf) - strlen(path) + 1); + buf[sizeof(buf) - strlen(path) + 1] = '\0'; + ReadMandescFile(&list, buf); + } + ReadMandescFile(&list, path); + } + if (lang != 0) { + strcpy(buf, path); + strcat(buf, "/"); + strncat(buf, lang, sizeof(buf) - strlen(path) + 1); + buf[sizeof(buf) - strlen(path) + 1] = '\0'; + ReadMandescFile(&list, buf); + } + ReadMandescFile(&list, path); + + SortList(&list); + + sect = 0; + num_alloced = SECTALLOC; + manual = (Manual *) XtMalloc( sizeof(Manual) * num_alloced ); + InitManual( manual, list->label ); + manual[sect].flags = list->flags; + current_label = NULL; + + while ( list != NULL ) { + SectionList * old_list; + + if ( current_label == NULL || streq(list->label, current_label) ) + AddToCurrentSection( manual + sect, list->directory); + else { + if (manual[sect].nentries == 0) { /* empty section, re-use it. */ + XtFree(manual[sect].blabel); + manual[sect].blabel = list->label; + manual[sect].flags = list->flags; + } + else { + if ( ++sect >= num_alloced ) { + num_alloced += SECTALLOC; + manual = (Manual *) XtRealloc ( (char *) manual, + (sizeof(Manual) * num_alloced)); + if (manual == NULL) + PrintError("Could not allocate memory for manual sections."); + } + InitManual( manual + sect, list->label ); + manual[sect].flags = list->flags; + } + AddToCurrentSection( manual + sect, list->directory); + } + /* Save label to see if it matches next entry. */ + current_label = list->label; + old_list = list; + list = list->next; + XtFree((char *) old_list); /* free what you allocate. */ + } + if (manual[sect].nentries != 0) + sect++; /* don't forget that last section. */ + + SortAndRemove(manual, sect); + +#ifdef notdef /* dump info. */ + DumpManual(sect); +#endif + +/* + * realloc manual to be minimum space necessary. + */ + + if (sect == 0) + PrintError("No manual pages found."); + manual = (Manual *) XtRealloc( (char *) manual, (sizeof(Manual) * sect)); + if (manual == NULL) + PrintError("Could not allocate memory for manual sections."); + + return(sect); /* return the number of man sections. */ +} + +/* Function Name: SortList + * Description: Sorts the list of sections to search. + * Arguments: list - a pointer to the list to sort. + * Returns: a sorted list. + * + * This is the most complicated part of the entire operation. + * all sections with the same label must by right next to each other, + * but the sections that are in the standard list have to come first. + */ + +static void +SortList(SectionList ** list) +{ + SectionList * local; + SectionList *head, *last, *inner, *old; + + if (*list == NULL) + PrintError("No manual sections to read, exiting."); + +/* + * First step + * + * Look for standard list items, and more them to the top of the list. + */ + + last = NULL; /* keep Saber happy. */ + for ( local = *list ; local->next != NULL ; local = local->next) { + if ( local->flags ) { + if ( local == *list ) /* top element is already standard. */ + break; + head = local; + + /* Find end of standard block */ + for (old = 0 ; (local->next != NULL) && (local->flags) + ; old = local, local = local->next); + + if (old != 0) { + last->next = old->next; /* Move the block. */ + old->next = *list; + *list = head; + } + + break; /* First step accomplished. */ + } + last = local; + } + +/* + * Second step + * + * Move items with duplicate labels right next to each other. + * + * Changed to keep the order of the list entries unchanged. + */ + + for (local = *list; local->next != NULL; local = local->next) { + head = local; + old = inner = local->next; + while (inner != NULL) { + if (streq(inner->label, local->label)) { + if (old != inner) { + old->next = inner->next; + last = inner->next; + inner->next = head->next; + head->next = inner; + head = inner; + old = inner = last; + continue; + } + else + head = inner; + } + old = inner; + inner = inner->next; + } + } +} + +/* Function Name: ReadMandescFile + * Description: Reads the mandesc file, and adds more sections as + * necessary. + * Arguments: path - path name if the current search directory. + * section_list - pointer to the list of sections. + * Returns: TRUE in we should use default sections + */ + +static void +ReadMandescFile(SectionList ** section_list, char * path) +{ + char mandesc_file[BUFSIZ]; /* full path to the mandesc file. */ + FILE * descfile; + char string[BUFSIZ], local_file[BUFSIZ]; + Boolean use_defaults = TRUE; + char *cp; + + snprintf(mandesc_file, sizeof(mandesc_file), "%s/%s", path, MANDESC); + if ( (descfile = fopen(mandesc_file, "r")) != NULL) { + while ( fgets(string, BUFSIZ, descfile) != NULL) { + string[strlen(string)-1] = '\0'; /* Strip off the CR. */ + + if ( streq(string, NO_SECTION_DEFAULTS) ) { + use_defaults = FALSE; + continue; + } + + if ((cp = index(string,'\t')) != NULL) { + char *s; + *cp++ = '\0'; + strcpy(local_file, MAN); + strcat(local_file, string); + if ((s = index(cp,'\t')) != NULL) { + *s++ = '\0'; + if (streq(s, SUFFIX)) + AddNewSection(section_list, path, local_file, cp, MSUFFIX); + else if (streq(s, FOLD)) + AddNewSection(section_list, path, local_file, cp, MFOLD); + else if (streq(s, FOLDSUFFIX)) + AddNewSection(section_list, path, local_file, cp, MFOLDSUFFIX); + else + AddNewSection(section_list, path, local_file, cp, MNULL); + } else + AddNewSection(section_list, path, local_file, cp, MNULL); + } else { + snprintf(local_file, sizeof(local_file), "%s%c", MAN, string[0]); + AddNewSection(section_list, path, local_file, (string + 1), FALSE ); +#ifdef SEARCHOTHER + snprintf(local_file, sizeof(local_file), "%s%c", SEARCHOTHER, string[0]); + AddNewSection(section_list, path, local_file, (string + 1), FALSE); +#endif + } + } + + fclose(descfile); + } + if (use_defaults) + AddStandardSections(section_list, path); +} + +/* Function Name: AddNewSection + * Description: Adds the new section onto the current section list. + * Arguments: list - pointer to the section list. + * path - the path to the current manual section. + * file - the file to save. + * label - the current section label. + * flags = 1 - add a suffix + * = 2 - fold to lower case + * Returns: none. + */ + +void +AddNewSection( +SectionList **list, +char * path, char * file, char * label, +int flags) +{ + SectionList * local_list, * end; + char full_path[BUFSIZ]; + +/* Allocate a new list element */ + + local_list = (SectionList *) XtMalloc(sizeof(SectionList)); + + if (*list != NULL) { + for ( end = *list ; end->next != NULL ; end = end->next ); + end->next = local_list; + } + else + *list = local_list; + + local_list->next = NULL; + local_list->label = StrAlloc(label); + snprintf(full_path, sizeof(full_path), "%s/%s", path, file); + local_list->directory = StrAlloc(full_path); + local_list->flags = flags; +} + +/* Function Name: AddToCurrentSection + * Description: This function gets the names of the manual page + * directories, then closes the directory. + * Arguments: local_manual - a pointer to a manual pages structure. + * path - the path to this directory. + * Returns: none. + */ + +static void +AddToCurrentSection(Manual * local_manual, char * path) +{ + char temp_path[BUFSIZ]; + +#if defined(__OpenBSD__) || defined(__NetBSD__) + snprintf(temp_path, sizeof(temp_path), "%s/%s", path, MACHINE); + ReadCurrentSection(local_manual, temp_path); +#endif + ReadCurrentSection(local_manual, path); + snprintf(temp_path, sizeof(temp_path), "%s.%s", path, COMPRESSION_EXTENSION); + ReadCurrentSection(local_manual, temp_path); +} + +/* Function Name: ReadCurrentSection + * Description: Actually does the work of adding entries to the + * new section + * Arguments: local_manual - a pointer to a manual pages structure. + * path - the path to this directory. + * compressed - Is this a compressed directory? + * Returns: TRUE if any entries are found. + */ + +static void +ReadCurrentSection(Manual * local_manual, char * path) +{ + DIR * dir; + + register struct dirent *dp; + + register int nentries; + register int nalloc; + char full_name[BUFSIZ], *ptr; + + if((dir = opendir(path)) == NULL) { +#ifdef DEBUG + snprintf(error_buf, sizeof(error_buf), "Can't open directory %s", path); + PopupWarning(NULL, error_buf); +#endif /* DEBUG */ + return; + } + +/* + * Remove the compression extension from the path name. + */ + + if ( (ptr = rindex(path, '.')) != NULL) { +#if !defined(__SCO__) && !defined(ISC) + if (streq(ptr + 1, COMPRESSION_EXTENSION)) +#else + if (strpbrk(ptr + 1, COMPRESSION_EXTENSIONS) != NULL) +#endif + *ptr = '\0'; +#ifdef GZIP_EXTENSION + else if (streq(ptr + 1, GZIP_EXTENSION)) + *ptr = '\0'; +#endif + } + + nentries = local_manual->nentries; + nalloc = local_manual->nalloc; + + while( (dp = readdir(dir)) != NULL ) { + char * name = dp->d_name; + if (name[0] == '.') + continue; +#ifndef CRAY + if (index(name, '.') == NULL) + continue; +#endif + if( nentries >= nalloc ) { + nalloc += ENTRYALLOC; + local_manual->entries =(char **) XtRealloc((char *)local_manual->entries, + nalloc * sizeof(char *)); + local_manual->entries_less_paths = + (char **) XtRealloc((char *)local_manual->entries_less_paths, + nalloc * sizeof(char *)); + } + + snprintf(full_name, sizeof(full_name), "%s/%s", path, name); +/* + * Remove the compression extension from the entry name. + */ + + if ( (ptr = rindex(full_name, '.')) != NULL) { +#if !defined(__SCO__) && !defined(ISC) + if (streq(ptr + 1, COMPRESSION_EXTENSION)) +#else + if (strpbrk(ptr + 1, COMPRESSION_EXTENSIONS) != NULL) +#endif + *ptr = '\0'; +#ifdef GZIP_EXTENSION + else if (streq(ptr + 1, GZIP_EXTENSION)) + *ptr = '\0'; +#endif +#ifdef IGNORE_EXTENSION + /* skip files with specified extension - they're not real man pages */ + else if (streq(ptr + 1, IGNORE_EXTENSION)) { + continue; + } +#endif /* IGNORE_EXTENSION */ + } + local_manual->entries[nentries] = StrAlloc(full_name); + local_manual->entries_less_paths[nentries] = + rindex(local_manual->entries[nentries], '/'); + if ( local_manual->entries_less_paths[nentries] == NULL ) + PrintError("Internal error while cataloging manual pages."); + ++ nentries; + } + + local_manual->nentries = nentries; + local_manual->nalloc = nalloc; + + closedir(dir); +} + +/* Function Name: SortAndRemove + * Description: This function sorts all the entry names and + * then removes all the duplicate entries. + * Arguments: man - a pointer to the manual structure. + * number - the number of manual sections. + * Returns: an improved manual stucure + */ + +static void +SortAndRemove(Manual *man, int number) +{ + int i; + char *l1, *l2, **s1; + + for ( i = 0; i < number; man++, i++) { /* sort each section */ + register int i2 = 0; + +#ifdef DEBUG + printf("sorting section %d - %s\n", i, man->blabel); +#endif /* DEBUG */ + + s1 = (char **)malloc(man->nentries * sizeof(char *)); + + /* temporarily remove suffixes of entries, preventing them from */ + /* being used in alpabetic comparison ie sccs-delta.1 vs sccs.1 */ + for (i2=0; i2<man->nentries; i2++) + if ((s1[i2] = rindex(man->entries_less_paths[i2], '.')) != NULL) + *s1[i2] = '\0'; + + sortstrs ( (Byte **)man->entries_less_paths, man->nentries, (Byte **)man->entries ); + + /* put back suffixes */ + for (i2=0; i2<man->nentries; i2++) + if (s1[i2] != NULL) *s1[i2] = '.'; + + free(s1); + +#ifdef DEBUG + printf("removing from section %d.\n", i); +#endif /* DEBUG */ + + { + register int j, k, nent, nentm1; + int j2; + nent = man -> nentries; + nentm1 = nent - 1; + j = 0; + l2 = man->entries_less_paths[j++]; + if ( l2 == NULL ) + PrintError("Internal error while removing duplicate manual pages."); + while ( j < nentm1 ) + { + l1 = l2; + l2 = man->entries_less_paths[j++]; + if ( l2 == NULL ) + PrintError("Internal error while removing duplicate manual pages." + ); + if ( streq(l1,l2) ) + { + j2 = j-1; + k = j2; + while ( j < nent ) + { + man -> entries_less_paths[k] = man -> entries_less_paths[j]; + man -> entries[k++] = man -> entries[j++]; + } + j = j2; + -- man -> nentries; + -- nent; + -- nentm1; + } + } + } + } +} + + /* + ******* Replacement for qsort to keep + ******* identical entries in order + + A somewhat ugly hack of something that was once simpler... + */ + /* + Sort an array of pointers to strings, keeping it + in ascending order by (1) string comparison and + (2) original entry order in the pointer array. + + This is a modified radix exchange algorithm. + + In case there's insufficient memory for a temporary copy + of the pointer array, the original order of identical strings + isn't preserved. + */ + +static void +sortstrs (Byte *data[], int size, Byte *otherdata[]) +{ + Byte **sp, **ep; + Byte **othersp, **otherep; + int *origorder; + + origorder = (int *) calloc (size, sizeof(int)); + if ( origorder ) + { + reg int i; + + for ( i=0; i < size; ++i ) + origorder[i] = i; + } + + sp = data; + ep = &data[size-1]; + othersp = otherdata; + otherep = &otherdata[size-1]; + if ( origorder ) + { + sortstrs_block_oo ( sp, ep, 0, 0x80, origorder, &origorder[size-1], + othersp, otherep ); + free (origorder); + } + else + sortstrs_block ( sp, ep, 0, 0x80, othersp, otherep ); +} + + + + /*---------------------------------*/ + /* Sort 1 block of data on 1 bit */ + /*---------------------------------*/ + +static void +sortstrs_block ( + Byte **start, + Byte **end, + int offset, + Byte mask, + Byte **otherstart, + Byte **otherend) + +{ + reg Byte **sp, **ep; + reg Byte m; + reg int off; + reg Byte *t; + reg int curstrlen; + int maxstrlen; + Byte **othersp, **otherep; + + +#define newstring(ptr) \ + { \ + t = *ptr; \ + curstrlen = 0; \ + while ( *t++ ) ++ curstrlen; \ + if ( curstrlen > maxstrlen ) maxstrlen = curstrlen; \ + t = *ptr; \ + } + + + maxstrlen = 0; + sp = start; + ep = end; + off = offset; + m = mask; + othersp = otherstart; + otherep = otherend; + + while (1) + { + newstring(sp) + while (((sp != ep) && ((curstrlen < off) || ((t[off] & m) == 0)))) + { + ++ sp; + ++ othersp; + newstring(sp) + } + if ( sp == ep ) + break; + + newstring(ep); + while (((sp != ep) && (curstrlen >= off) && ((t[off] & m) != 0))) + { + -- ep; + -- otherep; + newstring(ep) + } + if ( sp == ep ) + break; + + t = *sp; + *sp = *ep; + *ep = t; + + t = *othersp; + *othersp = *otherep; + *otherep = t; + } + + t = *sp; + if ((curstrlen < off) || ((t[off] & m) == 0)) + { + if ( ep != end ) + { + ++ ep; + ++ otherep; + } + } + else + { + if ( sp != start ) + { + -- sp; + -- othersp; + } + } + + m >>= 1; + if ( m == 0 ) + { + m = 0x80; + if ( ++off >= maxstrlen ) + return; + } + + + if ( sp != start ) + sortstrs_block ( start, sp, off, m, otherstart, othersp ); + if ( ep != end ) + sortstrs_block ( ep, end, off, m, otherep, otherend ); +} + + + + /*-----------------------------------------------------------------*/ + /* Sort 1 block of data on 1 bit; check for out-of-order entries */ + /*-----------------------------------------------------------------*/ + +static void + sortstrs_block_oo ( + Byte **start, + Byte **end, + int offset, + Byte mask, + int *ostart, + int *oend, + Byte **otherstart, + Byte **otherend) + +{ + reg Byte **sp, **ep; + reg int *osp, *oep; + reg Byte m; + reg int off; + reg Byte *t; + reg int u; + reg int curstrlen; + int maxstrlen; + Byte **othersp, **otherep; + + +#define newstring(ptr) \ + { \ + t = *ptr; \ + curstrlen = 0; \ + while ( *t++ ) ++ curstrlen; \ + if ( curstrlen > maxstrlen ) maxstrlen = curstrlen; \ + t = *ptr; \ + } + + + maxstrlen = 0; + sp = start; + ep = end; + osp = ostart; + oep = oend; + off = offset; + m = mask; + othersp = otherstart; + otherep = otherend; + + while (1) + { + newstring(sp) + while (((sp != ep) && ((curstrlen < off) || ((t[off] & m) == 0)))) + { + ++ sp; + ++ osp; + ++ othersp; + newstring(sp) + } + if ( sp == ep ) + break; + + newstring(ep); + while (((sp != ep) && (curstrlen >= off) && ((t[off] & m) != 0))) + { + -- ep; + -- oep; + -- otherep; + newstring(ep) + } + if ( sp == ep ) + break; + + t = *sp; + *sp = *ep; + *ep = t; + + t = *othersp; + *othersp = *otherep; + *otherep = t; + + u = *osp; + *osp = *oep; + *oep = u; + } + + t = *sp; + if ((curstrlen < off) || ((t[off] & m) == 0)) + { + if ( ep != end ) + { + ++ ep; + ++ oep; + ++ otherep; + } + } + else + { + if ( sp != start ) + { + -- sp; + -- osp; + -- othersp; + } + } + + m >>= 1; + if ( m == 0 ) + { + m = 0x80; + if ( ++off >= maxstrlen ) /* Finished sorting block of strings: */ + { /* Restore duplicates to +riginal order */ + reg Byte **cp; + reg int *ocp; + Byte **othercp; + + + if ( sp != start ) + { + cp = start; + ocp = ostart; + othercp = otherstart; + while ( cp != sp ) + { + if ( *ocp > *(ocp+1) ) + { + t = *(cp+1); + *(cp+1) = *cp; + *cp = t; + + t = *(othercp+1); + *(othercp+1) = *othercp; + *othercp = t; + + u = *(ocp+1); + *(ocp+1) = *ocp; + *ocp = u; + + if ( cp != start ) + { + -- cp; + -- ocp; + -- othercp; + continue; + } + } + ++ cp; + ++ ocp; + ++ othercp; + } + } + if ( ep != end ) + { + cp = ep; + ocp = oep; + othercp = otherep; + while ( cp != end ) + { + if ( *ocp > *(ocp+1) ) + { + t = *(cp+1); + *(cp+1) = *cp; + *cp = t; + + t = *(othercp+1); + *(othercp+1) = *othercp; + *othercp = t; + + u = *(ocp+1); + *(ocp+1) = *ocp; + *ocp = u; + + if ( cp != ep ) + { + -- cp; + -- ocp; + -- othercp; + continue; + } + } + ++ cp; + ++ ocp; + ++ othercp; + } + } + return; + } + } + + + if ( sp != start ) + sortstrs_block_oo ( start, sp, off, m, ostart, osp, otherstart, othersp ); + if ( ep != end ) + sortstrs_block_oo ( ep, end, off, m, oep, oend, otherep, otherend ); +} + + +/* Function Name: InitManual + * Description: Initializes this manual section. + * Arguments: l_manual - local copy of the manual structure. + * label - the button label for this section. + * Returns: none. + */ + +static void +InitManual(Manual * l_manual, char * label) +{ + bzero( l_manual, sizeof(Manual) ); /* clear it. */ + l_manual->blabel = label; /* set label. */ +} + +#if defined(DEBUG) + +/* Function Name: DumpManual + * Description: Debugging function that dumps the entire manual page + * structure. + * Arguments: number - the number of sections. + * Returns: none. + */ + +void +DumpManual(int number) +{ + register int i,j; + + for ( i = 0; i < number; i++) { + printf("label: %s\n", manual[i].blabel); + for (j = 0; j < manual[i].nentries; j++) + printf("%s\n", manual[i].entries[j]); + } +} + +#endif /* DEBUG */ + + + +#ifdef MANCONF + +#if defined(MANCONFIGSTYLE_FreeBSD) + +/* Function Name: ReadManConfig + * Description: Reads man.conf file used by FreeBSD man + * Argument: manpath - char array to return path in. + * Returns: TRUE if read was successful. + */ + +Bool +ReadManConfig(char manpath[]) +{ + FILE *fp; + char line[BUFSIZ]; + char *path; + Bool firstpath = TRUE; + + if (!(fp = fopen(MANCONF, "r"))) + return(FALSE); + + while (fgets(line, sizeof(line), fp)) { + path = strtok(line, " \t\n"); + if (!path || *path == '#') + continue; + if (strcmp(path, "MANPATH_MAP") == 0) + path = strtok((char *)NULL, " \t\n"); + else if (strcmp(path, "MANDATORY_MANPATH") != 0 && + strcmp(path, "OPTIONAL_MANPATH") != 0) + return(FALSE); + path = strtok((char *)NULL, " \t\n"); + if (!path || *path == '#') + return FALSE; + if (firstpath) { + strcpy(manpath, path); + firstpath = FALSE; + } + else if (!strstr(manpath,path)) { + strcat(manpath, ":"); + strcat(manpath, path); + } + } + fclose(fp); + return(!firstpath); +} + + +#elif defined(MANCONFIGSTYLE_Linux) /* not FreeBSD */ + +/* Function Name: ReadManConfig + * Description: Reads man.conf file used by Linux man + * Argument: manpath - char array to return path in. + * Returns: TRUE if read was successful. + */ + + +Bool +ReadManConfig(char manpath[]) +{ + FILE *fp; + char line[BUFSIZ]; + char *path; + Bool firstpath = TRUE; + + if (!(fp = fopen(MANCONF, "r"))) + return(FALSE); + + while (fgets(line, sizeof(line), fp)) { + path = strtok(line, " \t\n"); + if (!path || *path == '#' || (strcmp(path, "MANPATH") != 0)) + continue; + path = strtok((char *)NULL, " \t\n"); + if (!path || *path == '#') + return FALSE; + if (firstpath) { + strcpy(manpath, path); + firstpath = FALSE; + } + else { + strcat(manpath, ":"); + strcat(manpath, path); + } + } + fclose(fp); + return(!firstpath); +} + +#elif defined(MANCONFIGSTYLE_OpenBSD) /* not FreeBSD or Linux */ + +/* Function Name: ReadManConfig + * Description: Reads man.conf file used by Open/NetBSD + * Argument: manpath - char array to return path in. + * Returns: TRUE if read was successful. + * + * This version expands the glob pattern that can be found + * in man.conf + */ +#include <glob.h> + +Bool +ReadManConfig(char manpath[]) +{ + FILE *fp; + char line[BUFSIZ]; + char *path; + Bool firstpath = TRUE; + glob_t gs; + int i; + + if (!(fp = fopen(MANCONF, "r"))) + return(FALSE); + + while (fgets(line, sizeof(line), fp)) { + path = strtok(line, " \t\n"); + if (!path || *path == '#') + continue; + if (strcmp(path, "_default")) { + /* for now */ + continue; + } + memset(&gs, 0, sizeof(glob_t)); + while ((path = strtok((char *)NULL, " \t\n"))) { + if (glob(path, GLOB_BRACE, NULL, &gs) < 0) { + fclose(fp); + return FALSE; + } + } /* while */ + for (i = 0; i < gs.gl_pathc; i++) { + + if (firstpath) { + strcpy(manpath, gs.gl_pathv[i]); + firstpath = FALSE; + } + else { + strcat(manpath, ":"); + strcat(manpath, gs.gl_pathv[i]); + } + } /* for */ + globfree(&gs); + } + fclose(fp); + return(!firstpath); +} + +#elif defined(MANCONFIGSTYLE_BSD) /* not FreeBSD, Linux, or OpenBSD */ + +/* Function Name: ReadManConfig + * Description: Reads man.conf file used by BSD 4.4 + * Argument: manpath - char array to return path in. + * Returns: TRUE if read was successful. + */ + +Bool +ReadManConfig(manpath) + +char manpath[]; + +{ + FILE *fp; + char line[BUFSIZ]; + char *path; + Bool firstpath = TRUE; + + if (!(fp = fopen(MANCONF, "r"))) + return(FALSE); + + while (fgets(line, sizeof(line), fp)) { + path = strtok(line, " \t\n"); + if (!path || *path == '#' || strcmp(path, "_default")) + continue; + while ((path = strtok((char *)NULL, " \t\n"))) { + if (firstpath) { + strcpy(manpath, path); + firstpath = FALSE; + } + else { + strcat(manpath, ":"); + strcat(manpath, path); + } + } + } + fclose(fp); + return(!firstpath); +} + +#else /* not BSD */ + +#error "MANCONF defined (in vendor.h) for unknown operating system." + +#endif /* MANCONFIGSTYLE == FreeBSD ... BSD */ + +#endif /* MANCONF */ diff --git a/app/xman/man.h b/app/xman/man.h new file mode 100644 index 000000000..d1c7f1eb0 --- /dev/null +++ b/app/xman/man.h @@ -0,0 +1,281 @@ +/* $XConsortium: man.h,v 1.31 94/12/16 21:36:53 gildea Exp $ */ +/* $XdotOrg: app/xman/man.h,v 1.8 2004/09/02 08:40:33 kem Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ +/* $XFree86: xc/programs/xman/man.h,v 1.4 2001/07/25 15:05:27 dawes Exp $ */ + + +/* X toolkit header files */ + +#include <X11/Intrinsic.h> +#include <X11/StringDefs.h> +#include <X11/Shell.h> + +#include <X11/Xaw/Cardinals.h> + +/* Std system and C header files */ + +#include <stdio.h> +#include <limits.h> + +#include <X11/Xfuncs.h> +#include <X11/Xos.h> + +/* X include files */ + +#include <X11/Xatom.h> + +/* Widget header files. */ + +#include <X11/Xaw/AsciiText.h> +#include <X11/Xaw/SmeBSB.h> +#include <X11/Xaw/Box.h> +#include <X11/Xaw/Command.h> +#include <X11/Xaw/Dialog.h> +#include <X11/Xaw/Label.h> +#include <X11/Xaw/List.h> +#include <X11/Xaw/MenuButton.h> +#include <X11/Xaw/SimpleMenu.h> +#include <X11/Xaw/Paned.h> +#include <X11/Xaw/Viewport.h> + +/* program specific header files. */ + +#include "ScrollByL.h" + +#include "version.h" +#include "defs.h" + +/* Turn a NULL pointer string into an empty string */ +#define NULLSTR(x) (((x)!=NULL)?(x):("")) + +#define Error(x) { printf x ; exit(EXIT_FAILURE); } +#define Assertion(expr, msg) { if (!(expr)) { Error msg } } +#ifdef DEBUG +# define Log(x) { if(True) printf x; } +#else +# define Log(x) { if(False) printf x; } +#endif /* DEBUG */ + +/* + * Assigning values here allows the user of Bitwise Or. + */ + +typedef struct _XmanFonts { + XFontStruct * directory; /* The font for the directory. */ +} XmanFonts; + +typedef struct _XmanCursors { + Cursor top, /* The top Cursor, default for xman. */ + help, /* The top cursor for the help menu. */ + manpage, /* The cursor for the Manpage. */ + search_entry; /* The cursor for the text widget in the + search box.*/ + Pixel fg_color; /* foreground color of cursors. */ + Pixel bg_color; /* background color of cursors. */ +} XmanCursors; + +typedef struct _ManPageWidgets { + Widget manpage, /* The manual page window (scrolled) */ + directory, /* The widget in which all directories will + appear. */ + *box; /* The boxes containing the sections. */ +} ManPageWidgets; + +typedef struct _MenuStruct { + caddr_t data; + int number; + XrmQuark quark; +} MenuStruct; + +/* + * The manual sections and entries + */ + +typedef struct tManual { + char * blabel; /* The button label. */ + char ** entries; /* The individual man page file names. */ + char ** entries_less_paths; /* Entry names only */ + int nentries; /* how many (TOTAL)*/ + int nalloc; /* how much space allocated */ + int flags; /* suffix, fold */ +} Manual; + +/* psuedo Globals that are specific to each manpage created. */ + +typedef struct _ManpageGlobals{ + int current_directory; /* The directory currently being shown + on this manpage. */ + Boolean dir_shown, /* True if the directory is then current + visable screen */ + both_shown; /* If true then both the manpage and + the directory are to be shown.*/ + Widget label, /* The label widget at the top of the page. */ + standby, /* The please standby widget. */ + save, /* The "would you like to save?" widget. */ + search_widget, /* The search widget popup. */ + help_button, /* The help button. */ + option_menu, /* The option menu. */ + text_widget; /* text widget containing search string. */ + + /* Widgets (Objects really) for the command menu entries. */ + + Widget dir_entry, manpage_entry, help_entry, + search_entry, both_screens_entry, remove_entry, + open_entry, print_entry, version_entry, quit_entry; + +#ifdef INCLUDE_XPRINT_SUPPORT + /* Print objects and data */ + Widget printdialog_shell; /* Shell for the print dialog */ + Widget printdialog; /* Print dialog */ +#endif /*INCLUDE_XPRINT_SUPPORT */ + /* Misc. */ + + char manpage_title[80]; /* The label to use for the current manpage. */ + + char save_file[80]; /* the name of the file to save fomatted + page into. */ + char tempfile[80]; /* the name of the file to copy the formatted + page from. */ + Boolean compress; /* Compress file on save? */ + Boolean gzip; /* Gzip file on save? */ + Boolean deletetempfile; /* Need to delete tempfile when done? */ + char ** section_name; /* The name of each of the sections */ + + ManPageWidgets manpagewidgets; /* The manpage widgets. */ + + /* Things to remember when cleaning up when killing manpage. */ + + Widget This_Manpage; /* a pointer to the root of + this manpage. */ + + FILE *curr_file; /* Current file shown in manpage widget */ +} ManpageGlobals; + + +/* Resource manager sets these. */ + +typedef struct _Xman_Resources { + XmanFonts fonts; /* The fonts used for the man pages. */ + XmanCursors cursors; /* The cursors for xman. */ + Boolean show_help_syntax; /* True if syntax message should be dumped to + stdout. */ + Boolean both_shown_initial; /* The initial state of the manual pages + show two screens or only one. */ + Boolean top_box_active; /* Put up the Top Box. */ + Boolean clear_search_string; /* clear the search string each time it + is popped down? */ + int directory_height; /* The default height of directory in + both_shown mode. */ + char * help_file; /* The name of the help file. */ + char * title; /* The title for topBox */ + Boolean iconic; /* Should topBox come up in an iconic state */ +} Xman_Resources; + +/************************************************************ + * + * Function Defintions + * + ************************************************************/ + +/* + * This is easier than trying to find all calls to StrAlloc(). + */ + +#define StrAlloc(ptr) XtNewString(ptr) + +/* Standard library function definitions. */ +#include <stdlib.h> + +/* buttons.c */ + +ManpageGlobals * InitPsuedoGlobals(void); +Widget CreateManpage(FILE * file); +void CreateManpageWidget(ManpageGlobals * man_globals, char * name, Boolean full_instance); +void FormUpWidgets(Widget parent, char ** full_size, char ** half_size); +void MakeDirectoryBox(ManpageGlobals *man_globals, Widget parent, Widget *dir_disp, int section); +void MakeSaveWidgets(ManpageGlobals *man_globals, Widget parent); +void MakeTopBox(void); + +/* handler.c */ + +void DirPopupCallback(Widget w, XtPointer pointer, XtPointer junk); +void DirectoryHandler(Widget w, XtPointer global_pointer, XtPointer ret_val); +void OptionCallback(Widget w, XtPointer pointer, XtPointer junk); +void Popup(Widget w, XtGrabKind grab_kind); + +/* Action Routines. */ + +void CreateNewManpage(Widget w, XEvent * event, String * params, Cardinal * num_params); +void GotoPage(Widget w, XEvent * event, String * params, Cardinal * num_params); +void PopupHelp(Widget w, XEvent * event, String * params, Cardinal * num_params); +void PopupSearch(Widget w, XEvent * event, String * params, Cardinal * num_params); +void Quit(Widget w, XEvent * event, String * params, Cardinal * num_params); +void RemoveThisManpage(Widget w, XEvent * event, String * params, Cardinal * num_params); +void SaveFormattedPage(Widget w, XEvent * event, String * params, Cardinal * num_params); +void Search(Widget w, XEvent * event, String * params, Cardinal * num_params); +#ifdef INCLUDE_XPRINT_SUPPORT +void PrintThisManpage(Widget w, XEvent * event, String * params, Cardinal * num_params); +#endif /* INCLUDE_XPRINT_SUPPORT */ +void ShowVersion(Widget w, XEvent * event, String * params, Cardinal * num_params); + +/* help.c */ + +Boolean MakeHelpWidget(void); +Boolean OpenHelpfile(ManpageGlobals * man_globals); + +/* man.c */ +Bool ReadManConfig(char manpath[]); +int Man(void); + +/* misc.c */ +FILE * FindManualFile(ManpageGlobals * man_globals, int section_num, int entry_num); +ManpageGlobals * GetGlobals(Widget w); +void AddCursor(Widget w, Cursor cursor); +void ChangeLabel(Widget w, char * str); +void OpenFile(ManpageGlobals * man_globals, FILE * file); +void PopupWarning(ManpageGlobals * man_globals, char * string); +void PositionCenter(Widget widget, int x, int y, int above, int left, int v_space, int h_space); +void PrintError(char * string); +void RemoveGlobals(Widget w); +void SaveGlobals(Widget w, ManpageGlobals * globals); +void ParseEntry(char *entry, char *path, char *sect, char *page); +FILE * Format(ManpageGlobals * man_globals, char * entry); + +/* search */ +FILE * DoSearch(ManpageGlobals * man_globals, int type); +void MakeSearchWidget(ManpageGlobals * man_globals, Widget parent); + +/* tkfunctions.c */ + +int Width(Widget); +int Height(Widget); +int BorderWidth(Widget); +char * Name(Widget); diff --git a/app/xman/misc.c b/app/xman/misc.c new file mode 100644 index 000000000..92c011a4c --- /dev/null +++ b/app/xman/misc.c @@ -0,0 +1,1176 @@ +/* $XConsortium: misc.c,v 1.31 94/12/16 21:36:53 gildea Exp $ */ +/* $XdotOrg: app/xman/misc.c,v 1.8 2005/11/08 06:33:33 jkj Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ +/* $XFree86: xc/programs/xman/misc.c,v 1.10 2003/08/02 17:35:48 herrb Exp $ */ + +/* + * xman - X window system manual page display program. + * Author: Chris D. Peterson, MIT Project Athena + * Created: October 27, 1987 + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "globals.h" +#include "vendor.h" +#include <X11/Xos.h> /* sys/types.h and unistd.h included in here */ +#include <sys/stat.h> +#include <errno.h> +#include <X11/Xaw/Dialog.h> +#include <X11/Shell.h> + +static FILE * Uncompress(ManpageGlobals * man_globals, char * filename); +#ifndef HAS_MKSTEMP +static Boolean UncompressNamed(ManpageGlobals * man_globals, char * filename, + char * output); +static Boolean UncompressUnformatted(ManpageGlobals * man_globals, + char * entry, char * filename); +#else +static Boolean UncompressNamed(ManpageGlobals * man_globals, char * filename, + char * output, FILE ** output_fd); +static Boolean UncompressUnformatted(ManpageGlobals * man_globals, + char * entry, char * filename, + FILE **file); +#endif +#ifdef HANDLE_ROFFSEQ +static Boolean ConstructCommand(char * cmdbuf, char * path, char * filename, char * tempfile); +#endif + +#if defined(ISC) || defined(__SCO__) || defined(__UNIXWARE__) +static char *uncompress_format = NULL; +static char *uncompress_formats[] = + { UNCOMPRESS_FORMAT_1, + UNCOMPRESS_FORMAT_2, + UNCOMPRESS_FORMAT_3 + }; +#endif + +/* Function Name: PopupWarning + * Description: This function pops upa warning message. + * Arguments: string - the specific warning string. + * Returns: none + */ + +extern Widget top; +static Widget warnShell, warnDialog; + +static void +PopdownWarning(Widget w, XtPointer client, XtPointer call) +{ + XtPopdown((Widget)client); +} + +void +PopupWarning(ManpageGlobals * man_globals, char * string) +{ + int n; + Arg wargs[3]; + Dimension topX, topY; + char buffer[BUFSIZ]; + Boolean hasPosition; + + snprintf( buffer, sizeof(buffer), "Xman Warning: %s", string); + hasPosition = FALSE; + if (top) + { + n=0; + XtSetArg(wargs[n], XtNx, &topX); n++; + XtSetArg(wargs[n], XtNy, &topY); n++; + XtGetValues(top, wargs, n); + hasPosition = TRUE; + } + + if (man_globals != NULL) + ChangeLabel(man_globals->label, buffer); + if (man_globals->label == NULL) { + n=0; + if (hasPosition) + { + XtSetArg(wargs[n], XtNx, topX); n++; + XtSetArg(wargs[n], XtNy, topY); n++; + } + XtSetArg(wargs[n], XtNtransientFor, top); n++; + warnShell = XtCreatePopupShell("warnShell", transientShellWidgetClass, + initial_widget, wargs, n); + XtSetArg(wargs[0], XtNlabel, buffer); + warnDialog = XtCreateManagedWidget("warnDialog", dialogWidgetClass, + warnShell, wargs, 1); + XawDialogAddButton(warnDialog, "dismiss", PopdownWarning, + (XtPointer)warnShell); + XtRealizeWidget(warnShell); + Popup(warnShell, XtGrabNone); + } +} + +/* Function Name: PrintError + * Description: This Function prints an error message and exits. + * Arguments: string - the specific message. + * Returns: none. - exits tho. + */ + +void +PrintError(char * string) +{ + fprintf(stderr,"Xman Error: %s\n",string); + exit(EXIT_FAILURE); +} + +/* Function Name: OpenFile + * Description: Assignes a file to the manpage. + * Arguments: man_globals - global structure. + * file - the file pointer. + * Returns: none + */ + +void +OpenFile(ManpageGlobals * man_globals, FILE * file) +{ + Arg arglist[1]; + Cardinal num_args = 0; + + if (man_globals->curr_file) { +#if 0 /* Ownership rules need to be fixed first */ + fclose(man_globals->curr_file); +#endif + } + man_globals->curr_file = file; + + XtSetArg(arglist[num_args], XtNfile, man_globals->curr_file); num_args++; + XtSetValues(man_globals->manpagewidgets.manpage, arglist, num_args); +} + + +/* Function Name: FindManualFile + * Description: Opens the manual page file given the entry information. + * Arguments: man_globals - the globals info for this manpage. + * section_num - section number of the man page. + * entry_num - entry number of the man page. + * Returns: fp - the file pointer + * + * NOTES: + * + * If there is a uncompressed section it will look there for uncompresed + * manual pages first and then for individually compressed file in the + * uncompressed section. + * + * If there is a compressed directory then it will also look there for + * the manual pages. + * + * If both of these fail then it will attempt to format the manual page. + */ + +FILE * +FindManualFile(ManpageGlobals * man_globals, int section_num, int entry_num) +{ + FILE * file; + char path[BUFSIZ], page[BUFSIZ], section[BUFSIZ], *temp; + char filename[BUFSIZ]; + char * entry = manual[section_num].entries[entry_num]; + int len_cat = strlen(CAT); +#if defined(ISC) || defined(__SCO__) || defined(__UNIXWARE__) + int i; +#endif + + temp = CreateManpageName(entry, 0, 0); + snprintf(man_globals->manpage_title, sizeof(man_globals->manpage_title), + "The current manual page is: %s.", temp); + XtFree(temp); + + ParseEntry(entry, path, section, page); + +/* + * Look for uncompressed files first. + */ +#if defined(__OpenBSD__) || defined(__NetBSD__) + /* look in machine subdir first */ + snprintf(filename, sizeof(filename), "%s/%s%s/%s/%s", path, CAT, + section + len_cat, MACHINE, page); + if ( (file = fopen(filename,"r")) != NULL) + return(file); +#endif + + snprintf(filename, sizeof(filename), "%s/%s%s/%s", + path, CAT, section + len_cat, page); + if ( (file = fopen(filename,"r")) != NULL) + return(file); + +/* + * Then for compressed files in an uncompressed directory. + */ + +#if !defined(ISC) && !defined(__UNIXWARE__) +#if defined(__OpenBSD__) || defined(__NetBSD__) + /* look in machine subdir first */ + snprintf(filename, sizeof(filename), "%s/%s%s/%s/%s.%s", path, CAT, + section + len_cat, MACHINE, page, COMPRESSION_EXTENSION); + if ( (file = Uncompress(man_globals, filename)) != NULL) + return(file); +#endif + snprintf(filename, sizeof(filename), "%s/%s%s/%s.%s", path, CAT, + section + len_cat, page, COMPRESSION_EXTENSION); + if ( (file = Uncompress(man_globals, filename)) != NULL) + return(file); +#ifdef GZIP_EXTENSION + else { +#if defined(__OpenBSD__) || defined(__NetBSD__) + /* look in machine subdir first */ + snprintf(filename, sizeof(filename), "%s/%s%s/%s/%s.%s", path, CAT, + section + len_cat, MACHINE, page, GZIP_EXTENSION); + if ( (file = Uncompress(man_globals, filename)) != NULL) + return(file); +#endif + snprintf(filename, sizeof(filename), "%s/%s%s/%s.%s", path, CAT, + section + len_cat, page, GZIP_EXTENSION); + if ( (file = Uncompress(man_globals, filename)) != NULL) + return(file); + } +#endif +#else + for(i = 0; i < strlen(COMPRESSION_EXTENSIONS); i++) { + snprintf(filename, sizeof(filename), "%s/%s%s/%s.%c", path, CAT, + section + len_cat, page, COMPRESSION_EXTENSIONS[i]); + uncompress_format = uncompress_formats[i]; +#ifdef DEBUG + printf("Trying .%c ...\n", COMPRESSION_EXTENSIONS[i]); +#endif + if ( (file = Uncompress(man_globals, filename)) != NULL) + return(file); + } +#endif + +/* + * And lastly files in a compressed directory. + * + * The directory is not actually compressed it is just named man#.Z + * and all files in it are compressed without the .Z extension. + * HP does it this way (really :-). + */ + + snprintf(filename, sizeof(filename), "%s/%s%s.%s/%s", path, CAT, + section + len_cat, COMPRESSION_EXTENSION, page); + if ( (file = Uncompress(man_globals, filename)) != NULL) + return(file); +/* + * We did not find any preformatted manual pages, try to format it. + */ + + return(Format(man_globals, entry)); +} + +/* Function Namecompress + * Description: This function will attempt to find a compressed man + * page and uncompress it. + * Arguments: man_globals - the psuedo global info. + * filename - name of file to uncompress. + * Returns:; a pointer to the file or NULL. + */ + +static FILE * +Uncompress(ManpageGlobals * man_globals, char * filename) +{ + char tmp_file[BUFSIZ], error_buf[BUFSIZ]; + FILE * file; + +#ifndef HAS_MKSTEMP + if ( !UncompressNamed(man_globals, filename, tmp_file) ) + return(NULL); + + else if ((file = fopen(tmp_file, "r")) == NULL) { + sprintf(error_buf, "Something went wrong in retrieving the %s", + "uncompressed manual page try cleaning up /tmp."); + PopupWarning(man_globals, error_buf); + } +#else + if (!UncompressNamed(man_globals, filename, tmp_file, &file)) { + sprintf(error_buf, "Something went wrong in retrieving the %s", + "uncompressed manual page try cleaning up /tmp."); + PopupWarning(man_globals, error_buf); + return(NULL); + } +#endif + + unlink(tmp_file); /* remove name in tree, it will remain + until we close the fd, however. */ + return(file); +} + +/* Function Name: UncompressNamed + * Description: This function will attempt to find a compressed man + * page and uncompress it. + * Arguments: man_globals - the psuedo global info. + * filename - name of file to uncompress. + * RETURNED output - the file name output (must be an allocated string). + * Returns:; TRUE if the file was found. + */ + +#ifndef HAS_MKSTEMP +static Boolean +UncompressNamed(ManpageGlobals * man_globals, char * filename, char * output) +#else +static Boolean +UncompressNamed(ManpageGlobals * man_globals, char * filename, char * output, + FILE ** output_fd) +#endif +{ + char tmp[BUFSIZ], cmdbuf[BUFSIZ], error_buf[BUFSIZ]; + struct stat junk; +#ifdef HAS_MKSTEMP + int fd; +#endif + + if (stat(filename, &junk) != 0) { /* Check for existance of the file. */ + if (errno != ENOENT) { + snprintf(error_buf, sizeof(error_buf), + "Error while stating file %s, errno = %d", filename, errno); + PopupWarning(man_globals, error_buf); + } + return(FALSE); + } + +/* + * Using stdin is necessary to fool zcat since we cannot guarentee + * the .Z extension. + */ + + strcpy(tmp, MANTEMP); /* get a temp file. */ +#ifndef HAS_MKSTEMP + (void) mktemp(tmp); +#else + fd = mkstemp(tmp); + if (fd < 0) { + PopupWarning(man_globals, "Error creating a temp file"); + return FALSE; + } + *output_fd = fdopen(fd, "r"); +#endif + strcpy(output, tmp); + +#ifdef GZIP_EXTENSION + if (streq(filename + strlen(filename) - strlen(GZIP_EXTENSION), + GZIP_EXTENSION)) + snprintf(cmdbuf, sizeof(cmdbuf), GUNZIP_FORMAT, filename, output); + else +#endif + snprintf(cmdbuf, sizeof(cmdbuf), UNCOMPRESS_FORMAT, filename, output); + if(system(cmdbuf) == 0) /* execute search. */ + return(TRUE); + + snprintf(error_buf, sizeof(error_buf), + "Error while uncompressing, command was: %s", cmdbuf); + PopupWarning(man_globals, error_buf); + return(FALSE); +} + +#if defined(SMAN) && defined(SFORMAT) +/* Function Name: SgmlToRoffNamed + * Description: This function will attempt to find an SGML man + * page and convert it to roff format. + * Arguments: man_globals - the psuedo global info. + * filename - name of file to uncompress. + * RETURNED output - the file name output (must be an allocated string). + * Returns:; TRUE if the file was found. + */ + +#ifndef HAS_MKSTEMP +static Boolean +SgmlToRoffNamed(ManpageGlobals * man_globals, char * filename, char * output) +#else +static Boolean +SgmlToRoffNamed(ManpageGlobals * man_globals, char * filename, char * output, + FILE ** output_fd) +#endif +{ + char tmp[BUFSIZ], cmdbuf[BUFSIZ], error_buf[BUFSIZ]; + struct stat junk; +#ifdef HAS_MKSTEMP + int fd; +#endif + + if (stat(filename, &junk) != 0) { /* Check for existance of the file. */ + if (errno != ENOENT) { + snprintf(error_buf, sizeof(error_buf), + "Error while stating file %s, errno = %d", filename, errno); + PopupWarning(man_globals, error_buf); + } + return(FALSE); + } + + strcpy(tmp, MANTEMP); /* get a temp file. */ +#ifndef HAS_MKSTEMP + (void) mktemp(tmp); +#else + fd = mkstemp(tmp); + if (fd < 0) { + PopupWarning(man_globals, "Error creating a temp file"); + return FALSE; + } + *output_fd = fdopen(fd, "r"); +#endif + strcpy(output, tmp); + + snprintf(cmdbuf, sizeof(cmdbuf), "%s %s > %s", SFORMAT, filename, output); + if(system(cmdbuf) == 0) /* execute search. */ + return(TRUE); + + snprintf(error_buf, sizeof(error_buf), + "Error while converting from sgml, command was: %s", cmdbuf); + PopupWarning(man_globals, error_buf); + return(FALSE); +} +#endif /* defined (SMAN) && defined(SFORMAT) */ + +/* Function Name: Format + * Description: This funtion formats the manual pages and interfaces + * with the user. + * Arguments: man_globals - the psuedo globals + * file - the file pointer to use and return + * entry - the current entry struct. + * current_box - The current directory being displayed. + * Returns: none. + */ + +/* ARGSUSED */ + +FILE * +Format(ManpageGlobals * man_globals, char * entry) +{ + FILE * file = NULL; +#ifdef HAS_MKSTEMP + int fd; +#endif + Widget manpage = man_globals->manpagewidgets.manpage; + char cmdbuf[BUFSIZ], tmp[BUFSIZ], filename[BUFSIZ], error_buf[BUFSIZ]; + char path[BUFSIZ], sect[BUFSIZ]; + XEvent event; + Position x,y; /* location to pop up the + "would you like to save" widget. */ + +#ifndef HAS_MKSTEMP + if ( !UncompressUnformatted(man_globals, entry, filename) ) { +#else + if ( !UncompressUnformatted(man_globals, entry, filename, &file) ) { +#endif + /* We Really could not find it, this should never happen, yea right. */ + snprintf(error_buf, sizeof(error_buf), + "Could not open manual page, %s", entry); + PopupWarning(man_globals, error_buf); + XtPopdown( XtParent(man_globals->standby) ); + return(NULL); + } + +#ifndef HAS_MKSTEMP + if ((file = fopen(filename, "r")) != NULL) { +#else + if (file != NULL) { +#endif + char line[BUFSIZ]; + + if (fgets(line, sizeof(line), file) != NULL) { + if (strncmp(line, ".so ", 4) == 0) { + line[strlen(line) - 1] = '\0'; + fclose(file); + unlink(filename); + if (line[4] != '/') { + char *ptr = NULL; + + strcpy(tmp, entry); + if ((ptr = rindex(tmp, '/')) != NULL) { + *ptr = '\0'; + if ((ptr = rindex(tmp, '/')) != NULL) + ptr[1] = '\0'; + } + } + else + *tmp = '\0'; + snprintf(filename, sizeof(filename), "%s%s", tmp, line + 4); + + return (Format(man_globals, filename)); + } + } + fclose(file); + } + + Popup(XtParent(man_globals->standby), XtGrabExclusive); + while ( !XCheckTypedWindowEvent(XtDisplay(man_globals->standby), + XtWindow(man_globals->standby), + Expose, &event) ); + XtDispatchEvent( &event ); + XFlush(XtDisplay(man_globals->standby)); + + strcpy(tmp,MANTEMP); /* Get a temp file. */ +#ifndef HAS_MKSTEMP + (void) mktemp(tmp); +#else + fd = mkstemp(tmp); + file = fdopen(fd, "r"); +#endif + strcpy(man_globals->tempfile, tmp); + + ParseEntry(entry, path, sect, NULL); + +#ifndef HANDLE_ROFFSEQ +#ifndef HAS_MKSTEMP + snprintf(cmdbuf, sizeof(cmdbuf), "cd %s ; %s %s %s > %s %s", path, TBL, + filename, FORMAT, man_globals->tempfile, "2> /dev/null"); +#else + snprintf(cmdbuf, sizeof(cmdbuf), "cd %s ; %s %s %s >> %s %s", path, TBL, + filename, FORMAT, man_globals->tempfile, "2> /dev/null"); +#endif +#else + /* Handle more flexible way of specifying the formatting pipeline */ + if (! ConstructCommand(cmdbuf, path, filename, man_globals->tempfile)) { + sprintf(error_buf, "Constructed command was too long!"); + PopupWarning(man_globals, error_buf); + file = NULL; + } + else +#endif /* HANDLE_ROFFSEQ */ + + if(system(cmdbuf) != 0) { /* execute search. */ + snprintf(error_buf, sizeof(error_buf), + "Something went wrong trying to run the command: %s", cmdbuf); + PopupWarning(man_globals, error_buf); + file = NULL; + } + else { +#ifndef HAS_MKSTEMP + if ((file = fopen(man_globals->tempfile,"r")) == NULL) { + sprintf(error_buf, "Something went wrong in retrieving the %s", + "temp file, try cleaning up /tmp"); + PopupWarning(man_globals, error_buf); + } + else { +#endif + + XtPopdown( XtParent(man_globals->standby) ); + + if ( (man_globals->save == NULL) || + (man_globals->manpagewidgets.manpage == NULL) ) + unlink(man_globals->tempfile); + else { + char * ptr, catdir[BUFSIZ]; + + /* + * If the catdir is writeable then ask the user if he/she wants to + * write the man page to it. + */ + + strcpy(catdir, man_globals->save_file); + if ( (ptr = rindex(catdir, '/')) != NULL) { + *ptr = '\0'; + + if ( access(catdir, W_OK) != 0 ) + unlink(man_globals->tempfile); + else { + x = (Position) Width(man_globals->manpagewidgets.manpage)/2; + y = (Position) Height(man_globals->manpagewidgets.manpage)/2; + XtTranslateCoords(manpage, x, y, &x, &y); + PositionCenter( man_globals->save, (int) x, (int) y, 0, 0, 0, 0); + XtPopup( man_globals->save, XtGrabExclusive); + } + } + else + unlink(man_globals->tempfile); + } +#ifndef HAS_MKSTEMP + } +#endif + } + + /* + * If the original was compressed or in another format, delete temporary file. + */ + if (man_globals->deletetempfile) + unlink(filename); + + return(file); +} + +#ifdef HANDLE_ROFFSEQ +/* Function Name: ConstructCommand + * Description: Constructs the pipeline of commands necessary to format + * a manual page. + * Arguments: cmdbuf - the buffer into which to write the command + * path - the directory in which the original man page resides + * filename - the (uncompressed) manpage source file + * tempfile - the name of a temporary file to direct the final + * output of the pipeline into + * Returns: TRUE if the command fit into the buffer, FALSE if it would + * be too long (more than BUFSIZ characters) + */ +static Boolean +ConstructCommand(cmdbuf, path, filename, tempfile) + char *cmdbuf, *path, *filename, *tempfile; +{ + /* The original code did the following to produce a command line: + * sprintf(cmdbuf,"cd %s ; %s %s %s > %s %s", path, TBL, + * filename, FORMAT, man_globals->tempfile, "2> /dev/null"); + * We are more flexible and follow more or less the algorithm used + * by the Linux man command: + * + Obtain a string of letters from the following sources in order + * of preference: + * + a command line option (not implemented in xman; it's probably not + * useful) + * + the first line of the manpage source, if it is of the form: + * '\" <string> + * + the MANROFFSEQ environment variable + * + a default string; this is "". + * + Interpret the string as a pipeline of filters: + * + e = eqn g = grap p = pic t = tbl v = vgrind r = refer + * + zsoelim is always run as the first preprocessor in any case. + * + * Strictly speaking we should save a catpage iff the string comes + * from the file or is the default. + * + * You'll notice that we format a man page into ASCII text output and then + * attempt to interpret things like L^HL as bold and so forth. This + * is so obviously the Wrong Thing it's untrue. + */ + char *c = cmdbuf; /* current posn in buffer */ + int left = BUFSIZ; /* space left in buffer */ + int used; + char *fmt; + FILE *file; + char fmtbuf[128]; + int gotfmt = 0; /* set to 1 if we got a directive from source */ + char *fname = NULL; +#ifdef __UNIXOS2__ + int i; +#endif + + fmt = NULL; + /* If you have a command line option that gives a setting for fmt, + set it here. */ + + if (!fmt) { + /* This is the tricky bit: extract a format string from the source file + * Annoyingly, filename might be relative or absolute. We cheat and + * use system to get the thing to a known absoute filename. + */ + if (filename[0] == '/') { + fname = filename; + } else { + fname = malloc(strlen(path) + 1 + strlen(filename) + 1); + if (!fname) + return FALSE; + sprintf(fname, "%s/%s", path, filename); + } + if ((file = fopen(fname, "r")) && + (fgets(fmtbuf, sizeof(fmtbuf), file)) && + (!memcmp(fmtbuf, "'\\\" ", 4))) { + /* that's squote-backslash-dquote-space */ + int len; + fmt = fmtbuf + 3; + len = strlen(fmt); + if (len && (fmt[len-1] == '\n')) { + fmt[len-1] = 0; + gotfmt++; + } + } + if (fname && fname != filename) + free(fname); + if (!gotfmt) /* not there or some error */ + { + fmt = getenv("MANROFFSEQ"); + } + } + + if (!fmt) + { + fmt = DEFAULT_MANROFFSEQ; + } + + + /* Start with the first fixed part of the command line */ +#ifdef __UNIXOS2__ + for (i = 0; i < strlen(path); i++) { + if (path[i] == '/') + path[i] = '\\'; + } + used = snprintf(c, left, "cd %s & %s %s ", path, ZSOELIM, filename); +#else + used = snprintf(c, left, "cd %s; %s %s ", path, ZSOELIM, filename); +#endif + left -= used; + c += used; + if (left <= 1) + return (FALSE); + + /* Now add preprocessors of the form '| processor' */ + for ( ; *fmt; fmt++) + { + char *filter; + switch (*fmt) + { + case 'e': + filter = EQN; + break; + case 'g': + filter = GRAP; + break; + case 'p': + filter = PIC; + break; + case 't': + filter = TBL; + break; + case 'v': + filter = VGRIND; + break; + case 'r': + filter = REFER; + break; + default: + filter = NULL; + break; + } + if (filter) + { + used = snprintf(c, left, " | %s ", filter); + left -= used; + c += used; + if (left <= 1) + return (FALSE); + } + } + + /* Now add the fixed trailing part 'formatprog > tempfile 2> /dev/null' */ +#ifdef __UNIXOS2__ + used = snprintf(c, left, " | %s > %s 2>NUL", FORMAT, tempfile); +#else +#ifndef HAS_MKSTEMP + used = snprintf(c, left, " | %s > %s 2>/dev/null", FORMAT, tempfile); +#else + used = snprintf(c, left, " | %s >> %s 2>/dev/null", FORMAT, tempfile); +#endif +#endif /* __UNIXOS2__ */ + left -= used; + if (left <= 1) + return (FALSE); + + return (TRUE); +} +#endif /* HANDLE_ROFFSEQ */ + +/* Function Name: UncompressUnformatted + * Description: Finds an uncompressed unformatted manual page. + * Arguments: man_globals - the psuedo global structure. + * entry - the manual page entry. + * RETURNED filename - location to put the name of the file. + * Returns: TRUE if the file was found. + */ + +static Boolean +#ifndef HAS_MKSTEMP +UncompressUnformatted(ManpageGlobals * man_globals, char * entry, + char * filename) +#else +UncompressUnformatted(ManpageGlobals * man_globals, char * entry, + char * filename, FILE **file) +#endif +{ + char path[BUFSIZ], page[BUFSIZ], section[BUFSIZ], input[BUFSIZ]; + int len_cat = strlen(CAT), len_man = strlen(MAN); +#if defined(SMAN) && defined(SFORMAT) + int len_sman = strlen(SMAN); +#endif + + ParseEntry(entry, path, section, page); + +#if defined(__OpenBSD__) || defined(__NetBSD__) + /* + * look for uncompressed file in machine subdir first + */ + snprintf(filename, BUFSIZ, "%s/%s%s/%s/%s", path, MAN, + section + len_cat, MACHINE, page); + if ( access( filename, R_OK ) == 0 ) { + man_globals->compress = FALSE; + man_globals->gzip = FALSE; + man_globals->deletetempfile = FALSE; + snprintf(man_globals->save_file, sizeof(man_globals->save_file), + "%s/%s%s/%s/%s", path, CAT, section + len_cat, MACHINE, page); + return(TRUE); + } + /* + * Then for compressed files in an uncompressed directory. + */ + snprintf(input, sizeof(input), "%s.%s", filename, COMPRESSION_EXTENSION); +#ifndef HAS_MKSTEMP + if ( UncompressNamed(man_globals, input, filename) ) { +#else + if ( UncompressNamed(man_globals, input, filename, file) ) { +#endif + man_globals->compress = TRUE; + man_globals->deletetempfile = TRUE; + snprintf(man_globals->save_file, sizeof(man_globals->save_file), + "%s/%s%s/%s.%s", path, CAT, section + len_cat, page, + COMPRESSION_EXTENSION); + return(TRUE); + } +#ifdef GZIP_EXTENSION + else { + snprintf(input, sizeof(input), "%s.%s", filename, GZIP_EXTENSION); +#ifndef HAS_MKSTEMP + if ( UncompressNamed(man_globals, input, filename) ) { +#else + if ( UncompressNamed(man_globals, input, filename, file) ) { +#endif + man_globals->compress = TRUE; + man_globals->gzip = TRUE; + man_globals->deletetempfile = TRUE; + snprintf(man_globals->save_file, sizeof(man_globals->save_file), + "%s/%s%s/%s.%s", path, CAT, section + len_cat, page, + GZIP_EXTENSION); + return(TRUE); + } + } +#endif /* GZIP_EXTENSION */ +#endif /* __OpenBSD__ || __NetBSD__ */ +/* + * Look for uncompressed file first. + */ + + snprintf(filename, BUFSIZ, "%s/%s%s/%s", path, MAN, section + len_man, page); + if ( access( filename, R_OK ) == 0 ) { + man_globals->compress = FALSE; + man_globals->gzip = FALSE; + man_globals->deletetempfile = FALSE; + snprintf(man_globals->save_file, sizeof(man_globals->save_file), + "%s/%s%s/%s", path, CAT, section + len_cat, page); + return(TRUE); + } + +#if defined(SMAN) && defined(SFORMAT) + /* + * Look for uncompressed sgml file next. + */ + + snprintf(input, BUFSIZ, "%s/%s%s/%s", path, SMAN, section + len_sman, page); +#ifndef HAS_MKSTEMP + if ( SgmlToRoffNamed(man_globals, input, filename) ) { +#else + if ( SgmlToRoffNamed(man_globals, input, filename, file) ) { +#endif + man_globals->compress = FALSE; + man_globals->gzip = FALSE; + man_globals->deletetempfile = TRUE; + snprintf(man_globals->save_file, sizeof(man_globals->save_file), + "%s/%s%s/%s", path, CAT, section + len_cat, page); + return(TRUE); + } +#endif + +/* + * Then for compressed files in an uncompressed directory. + */ + + snprintf(input, sizeof(input), "%s.%s", filename, COMPRESSION_EXTENSION); +#ifndef HAS_MKSTEMP + if ( UncompressNamed(man_globals, input, filename) ) { +#else + if ( UncompressNamed(man_globals, input, filename, file) ) { +#endif + man_globals->compress = TRUE; + man_globals->deletetempfile = TRUE; + snprintf(man_globals->save_file, sizeof(man_globals->save_file), + "%s/%s%s/%s.%s", path, CAT, section + len_cat, page, + COMPRESSION_EXTENSION); + return(TRUE); + } +#ifdef GZIP_EXTENSION + else { + snprintf(input, sizeof(input), "%s.%s", filename, GZIP_EXTENSION); +#ifndef HAS_MKSTEMP + if ( UncompressNamed(man_globals, input, filename) ) { +#else + if ( UncompressNamed(man_globals, input, filename, file) ) { +#endif + man_globals->compress = TRUE; + man_globals->gzip = TRUE; + man_globals->deletetempfile = TRUE; + snprintf(man_globals->save_file, sizeof(man_globals->save_file), + "%s/%s%s/%s.%s", path, CAT, section + len_cat, page, + GZIP_EXTENSION); + return(TRUE); + } + } +#endif +/* + * And lastly files in a compressed directory. + */ + + snprintf(input, sizeof(input), "%s/%s%s.%s/%s", path, + MAN, section + len_man, COMPRESSION_EXTENSION, page); +#ifndef HAS_MKSTEMP + if ( UncompressNamed(man_globals, input, filename) ) { +#else + if ( UncompressNamed(man_globals, input, filename, file) ) { +#endif + man_globals->compress = TRUE; + man_globals->deletetempfile = TRUE; + snprintf(man_globals->save_file, sizeof(man_globals->save_file), + "%s/%s%s.%s/%s", path, CAT, section + len_cat, + COMPRESSION_EXTENSION, page); + return(TRUE); + } + return(FALSE); +} + +/* Function Name: AddCursor + * Description: This function adds the cursor to the window. + * Arguments: w - the widget to add the cursor to. + * cursor - the cursor to add to this widget. + * Returns: none + */ + +void +AddCursor(Widget w, Cursor cursor) +{ + XColor colors[2]; + Arg args[10]; + Cardinal num_args = 0; + Colormap c_map; + + if (!XtIsRealized(w)) { + PopupWarning(NULL, "Widget is not realized, no cursor added.\n"); + return; + } + + XtSetArg( args[num_args], XtNcolormap, &c_map); num_args++; + XtGetValues( w, args, num_args); + + colors[0].pixel = resources.cursors.fg_color; + colors[1].pixel = resources.cursors.bg_color; + + XQueryColors (XtDisplay(w), c_map, colors, 2); + XRecolorCursor(XtDisplay(w), cursor, colors, colors+1); + XDefineCursor(XtDisplay(w),XtWindow(w),cursor); +} + +/* Function Name: ChangeLabel + * Description: This function changes the label field of the + * given widget to the string in str. + * Arguments: w - the widget. + * str - the string to change the label to. + * Returns: none + */ + +void +ChangeLabel(Widget w, char * str) +{ + Arg arglist[3]; /* An argument list. */ + + if (w == NULL) return; + + XtSetArg(arglist[0], XtNlabel, str); + +/* shouldn't really have to do this. */ + XtSetArg(arglist[1], XtNwidth, 0); + XtSetArg(arglist[2], XtNheight, 0); + + XtSetValues(w, arglist, (Cardinal) 1); +} + +/* + * In an ideal world this would be part of the XToolkit, and I would not + * have to do it, but such is life sometimes. Perhaps in X11R3. + */ + +/* Function Name: PositionCenter + * Description: This function positions the given widgets center + * in the following location. + * Arguments: widget - the widget widget to postion + * x,y - The location for the center of the widget + * above - number of pixels above center to locate this widget + * left - number of pixels left of center to locate this widget + * h_space, v_space - how close to get to the edges of the + * parent window. + * Returns: none + * Note: This should only be used with a popup widget that has override + * redirect set. + */ + +void +PositionCenter(Widget widget, int x, int y, int above, int left, int v_space, int h_space) +{ + Arg wargs[2]; + int x_temp,y_temp; /* location of the new window. */ + int parent_height,parent_width; /* Height and width of the parent widget or + the root window if it has no parent. */ + + x_temp = x - left - Width(widget) / 2 + BorderWidth(widget); + y_temp = y - above - Height(widget) / 2 + BorderWidth(widget); + + parent_height = HeightOfScreen(XtScreen(widget)); + parent_width = WidthOfScreen(XtScreen(widget)); + +/* + * Check to make sure that all edges are within the viewable part of the + * root window, and if not then force them to be. + */ + + if (x_temp < h_space) + x_temp = v_space; + if (y_temp < v_space) + (y_temp = 2); + + if ( y_temp + Height(widget) + v_space > parent_height ) + y_temp = parent_height - Height(widget) - v_space; + + if ( x_temp + Width(widget) + h_space > parent_width ) + x_temp = parent_width - Width(widget) - h_space; + + XtSetArg(wargs[0], XtNx, x_temp); + XtSetArg(wargs[1], XtNy, y_temp); + XtSetValues(widget, wargs, 2); +} + +/* Function Name: ParseEntry(entry, path, sect, page) + * Description: Parses the manual pages entry filenames. + * Arguments: str - the full path name. + * path - the path name. RETURNED + * sect - the section name. RETURNED + * page - the page name. RETURNED + * Returns: none. + */ + +void +ParseEntry(char *entry, char *path, char *sect, char *page) +{ + char *c, temp[BUFSIZ]; + + strcpy(temp, entry); + + c = rindex(temp, '/'); + if (c == NULL) + PrintError("index failure in ParseEntry."); + *c++ = '\0'; + if (page != NULL) + strcpy(page, c); + + c = rindex(temp, '/'); + if (c == NULL) + PrintError("index failure in ParseEntry."); + *c++ = '\0'; +#if defined(SFORMAT) && defined(SMAN) + /* sgmltoroff sometimes puts an extra ./ in the path to .so entries */ + if (strcmp(c, ".") == 0) { + c = rindex(temp, '/'); + if (c == NULL) + PrintError("index failure in ParseEntry."); + *c++ = '\0'; + } +#endif +#if defined(__OpenBSD__) || defined(__NetBSD__) + /* Skip machine subdirectory if present */ + if (strcmp(c, MACHINE) == 0) { + c = rindex(temp, '/'); + if (c == NULL) + PrintError("index failure in ParseEntry."); + *c++ = '\0'; + } +#endif + if (sect != NULL) + strcpy(sect, c); + + if (path != NULL) + strcpy(path, temp); +} + +/* Function Name: GetGlobals + * Description: Gets the psuedo globals associated with the + * manpage associated with this widget. + * Arguments: w - a widget in the manpage. + * Returns: the psuedo globals. + * Notes: initial_widget is a globals variable. + * manglobals_context is a global variable. + */ + +ManpageGlobals * +GetGlobals(Widget w) +{ + Widget temp; + caddr_t data; + + while ( (temp = XtParent(w)) != initial_widget && (temp != NULL)) + w = temp; + + if (temp == NULL) + XtAppError(XtWidgetToApplicationContext(w), + "Xman: Could not locate widget in tree, exiting"); + + if (XFindContext(XtDisplay(w), XtWindow(w), + manglobals_context, &data) != XCSUCCESS) + XtAppError(XtWidgetToApplicationContext(w), + "Xman: Could not find global data, exiting"); + + return( (ManpageGlobals *) data); +} + +/* Function Name: SaveGlobals + * Description: Saves the psuedo globals on the widget passed + * to this function, although GetGlobals assumes that + * the data is associated with the popup child of topBox. + * Arguments: w - the widget to associate the data with. + * globals - data to associate with this widget. + * Returns: none. + * Notes: WIDGET MUST BE REALIZED. + * manglobals_context is a global variable. + */ + +void +SaveGlobals(Widget w, ManpageGlobals * globals) +{ + if (XSaveContext(XtDisplay(w), XtWindow(w), manglobals_context, + (caddr_t) globals) != XCSUCCESS) + XtAppError(XtWidgetToApplicationContext(w), + "Xman: Could not save global data, are you out of memory?"); +} + +/* Function Name: RemoveGlobals + * Description: Removes the psuedo globals from the widget passed + * to this function. + * Arguments: w - the widget to remove the data from. + * Returns: none. + * Notes: WIDGET MUST BE REALIZED. + * manglobals_context is a global variable. + */ + +void +RemoveGlobals(Widget w) +{ + if (XDeleteContext(XtDisplay(w), XtWindow(w), + manglobals_context) != XCSUCCESS) + XtAppError(XtWidgetToApplicationContext(w), + "Xman: Could not remove global data?"); +} diff --git a/app/xman/missing b/app/xman/missing new file mode 100644 index 000000000..894e786e1 --- /dev/null +++ b/app/xman/missing @@ -0,0 +1,360 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2005-06-08.21 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. + +# 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, 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 program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to <bug-automake@gnu.org>." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case "$1" in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/app/xman/print.c b/app/xman/print.c new file mode 100644 index 000000000..0d5b1d3eb --- /dev/null +++ b/app/xman/print.c @@ -0,0 +1,396 @@ +/* + * $Xorg: print.c,v 1.1 2004/04/30 02:05:54 gisburn Exp $ + * +Copyright 2004 Roland Mainz <roland.mainz@nrubsig.org> + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + * + */ + +/* Turn a NULL pointer string into an empty string */ +#define NULLSTR(x) (((x)!=NULL)?(x):("")) + +#define Error(x) { printf x ; exit(EXIT_FAILURE); } +#define Assertion(expr, msg) { if (!(expr)) { Error msg } } +#define Log(x) { if(True) printf x; } + +#include "print.h" +#include "ScrollByL.h" +#include <X11/Xaw/Form.h> +#include <X11/Xaw/Label.h> +#include <stdio.h> +#include <stdlib.h> + +static Widget +CreatePrintShell(Widget videoshell, + Screen *pscreen, + Visual *pvisual, + String printshell_name, + ArgList args, + Cardinal numargs) +{ + String videoname, + videoclass; + Widget pappshell, + printshell; + Display *pdpy = XDisplayOfScreen(pscreen); + int dummyc = 0; + String dummys = ""; + Cardinal shell_n; + Arg shell_args[5]; + + XtGetApplicationNameAndClass(XtDisplay(videoshell), + &videoname, &videoclass); + + /* XXX: Why is the |dummyc|&&|dummys| stuff needed here ? */ + XtDisplayInitialize(XtWidgetToApplicationContext(videoshell), pdpy, + videoname, videoclass, + NULL, 0, + &dummyc, &dummys); + + shell_n = 0; + XtSetArg(shell_args[shell_n], XtNscreen, pscreen); shell_n++; + if (pvisual) { + XtSetArg(shell_args[shell_n], XtNvisual, pvisual); shell_n++; + } + pappshell = XtAppCreateShell(videoname, videoclass, + applicationShellWidgetClass, + pdpy, + shell_args, shell_n); + printshell = XtCreatePopupShell(printshell_name, + xawPrintShellWidgetClass, + pappshell, args, numargs); + + + /* we're mapping/unmapping at start/end page time */ + XtSetMappedWhenManaged(printshell, False); + + /* We realise the widget when we're done with building the widget tree... */ + + return printshell; +} + +typedef struct +{ + const char *programname; + Widget toplevel; + Bool isPrinting; + Widget printshell; + struct + { + Widget form; + Widget pageheaderlabel; + Widget manpage; + } content; /* content to print */ + int numpages; + Display *pdpy; + Screen *pscreen; + XPContext pcontext; + XtCallbackProc pdpyDestroyCallback; + void *printtofile_handle; + const char *jobtitle; +} AppPrintData; + +static AppPrintData apdx; +static AppPrintData *apd = &apdx; + +/* "Count" pages in a scrollByLineWidgetClass widget */ +static +long CountPages(Widget sblw) +{ + long num_pages = 0; + Cardinal n; + Arg args[3]; + int num_total_lines = 0, + num_visible_lines = 0; + + n = 0; + XtSetArg(args[n], XtNNumTotalLines, &num_total_lines); n++; + XtSetArg(args[n], XtNNumVisibleLines, &num_visible_lines); n++; + XtGetValues(sblw, args, n); + +#define DIV_ROUND_UP(a, b) (((a)+((b)-1)) / (b)) + /* scrollByLineWidgetClass's "Page(forward)" always overlaps by one + * line so we use |num_visible_lines-1| instead of |num_visible_lines| */ + num_pages = DIV_ROUND_UP(num_total_lines, num_visible_lines-1); +#undef DIV_ROUND_UP + + return num_pages; +} + +static void +PageSetupCB(Widget widget, XtPointer client_data, XtPointer call_data) +{ + Widget pshell = widget; + XawPrintShellCallbackStruct *psp = (XawPrintShellCallbackStruct *)call_data; + AppPrintData *p = (AppPrintData *)client_data; + + Log(("--> PageSetupCB\n")); + + if (!psp->last_page_in_job) { + int currpage; + char buffer[256]; + + XtVaGetValues(pshell, XawNcurrPageNumInJob, &currpage, NULL); + + sprintf(buffer, "Title: %s / Page: %d/%d", p->jobtitle, currpage, p->numpages); + XtVaSetValues(apd->content.pageheaderlabel, XtNlabel, buffer, NULL); + + /* Note: XawPrintShell's pagecount starts with '1' + * (=first page is page no. '1') */ + if (currpage > 1) { + String params[] = { "Forward" }; + Log(("pagedown %d\n", currpage)); + /* "Page(Forward)" is scrollByLineWidgetClass's way to + * move one page forward */ + XtCallActionProc(p->content.manpage, "Page", NULL, params, ONE); + } + else + { + Log(("first page\n")); + } + + if (currpage >= p->numpages) { + psp->last_page_in_job = True; + } + } +} + +static +void FinishPrinting(AppPrintData *p) +{ + /* Wait for the job to finish */ + if (p->printtofile_handle) { + if (XpuWaitForPrintFileChild(p->printtofile_handle) != XPGetDocFinished) { + fprintf(stderr, "%s: Error while printing to file.\n", apd->programname); + } + p->printtofile_handle = NULL; + } + + /* Avoid that the manpage object tries to close the |FILE *|-handle at destruction time */ + XtVaSetValues(p->content.manpage, XtNfile, NULL, NULL); + + if (p->printshell) { + XtDestroyWidget(p->printshell); + p->printshell = NULL; + } + + /* Two issues here: + * 1. The print display connection is owned by the print dialog + * To avoid any problems with that use a callback back to the main + * application which calls + * |XawPrintDialogClosePrinterConnection(w, False)| to ask the + * print dialog widget to close all print display resources and + * disown the object. + * 2. We have to use XpDestroyContext() and XtCloseDisplay() + * instead of XpuClosePrinterDisplay() to make libXt happy... + * + * Call callback... */ + (*apd->pdpyDestroyCallback)(p->toplevel, NULL, NULL); /* HACK! */ + + /* ... and then get rid of the display */ + if (p->pcontext != None) { + XpDestroyContext(p->pdpy, p->pcontext); + } + XtCloseDisplay(p->pdpy); + + p->toplevel = NULL; + p->isPrinting = False; + p->pdpy = NULL; + p->pscreen = NULL; + p->pcontext = None; +} + +static +void PrintEndJobCB(Widget pshell, XtPointer client_data, XtPointer call_data) +{ + AppPrintData *p = (AppPrintData *)client_data; + + Log(("--> PrintEndJobCB\n")); + + /* Finish printing and destroy print shell (it's legal to destroy Xt + * widgets from within it's own callbacks) */ + FinishPrinting(p); +} + +static +XFontStruct *GetPrintTextFont(Display *pdpy, const char *fontprefix, long dpi_x, long dpi_y) +{ + XFontStruct *font; + char fontname[1024]; + + sprintf(fontname, "%s--*-120-%ld-%ld-*-*-iso8859-1", fontprefix, dpi_x, dpi_y); + font = XLoadQueryFont(pdpy, fontname); + if (!font) { + sprintf(fontname, "-adobe-courier-medium-r-normal--*-120-%ld-%ld-*-*-iso8859-1", dpi_x, dpi_y); + font = XLoadQueryFont(pdpy, fontname); + } + if (!font) { + sprintf(fontname, "-*-*-*-*-*-*-*-120-%ld-%ld-*-*-iso8859-1", dpi_x, dpi_y); + font = XLoadQueryFont(pdpy, fontname); + } + if (!font) + Error(("XLoadQueryFont failure.\n")); + return font; + +} + +void DoPrintManpage(const char *programname, + FILE *manpagefile, Widget toplevel, + Display *pdpy, XPContext pcontext, + XpuColorspaceRec *colorspace, + XtCallbackProc pdpyDestroyCB, + const char *jobtitle, const char *toFile) +{ + long dpi_x = 0L, + dpi_y = 0L; + int n; + Arg args[20]; + XFontStruct *printFontNormal; + XFontStruct *printFontBold; + XFontStruct *printFontItalic; + XFontStruct *printFontSymbol; + + if (!manpagefile) { + Error(("DoPrintManpage: No FILE given.")); + } + + apd->programname = programname; + apd->pdpyDestroyCallback = pdpyDestroyCB; + + if (apd->isPrinting) { + fprintf(stderr, "%s: Already busy with printing.\n", apd->programname); + return; + } + + /* Configure the print context (paper size, title etc.) + * We must do this before creating any Xt widgets - otherwise they will + * make wrong assuptions about fonts, resultions etc. ... + */ + XpuSetJobTitle(pdpy, pcontext, jobtitle); + + /* Configuration done, set the context */ + XpSetContext(pdpy, pcontext); + + /* Get default printer resolution */ + if (XpuGetResolution(pdpy, pcontext, &dpi_x, &dpi_y) != 1) { + fprintf(stderr, "%s: No default resolution for printer.\n", apd->programname); + XpuClosePrinterDisplay(pdpy, pcontext); + return; + } + + apd->toplevel = toplevel; + apd->pdpy = pdpy; + apd->pcontext = pcontext; + apd->pscreen = XpGetScreenOfContext(pdpy, pcontext); + apd->jobtitle = jobtitle; + + n = 0; + /* Override any geometry resource settings as XawPrintShell adjusts it's size + * to the current page siue when |XawPrintLAYOUTMODE_DRAWABLEAREA| or + * |XawPrintLAYOUTMODE_PAGESIZE| are used. */ + XtSetArg(args[n], XtNgeometry, "+0+0"); n++; + XtSetArg(args[n], XawNlayoutMode, XawPrintLAYOUTMODE_DRAWABLEAREA); n++; + if (colorspace) { + printf("Setting visual to id=0x%lx.\n", colorspace->visualinfo.visualid); + } + apd->printshell = CreatePrintShell(toplevel, apd->pscreen, + (colorspace?(colorspace->visualinfo.visual):(NULL)), + "printshell", args, n); + + n = 0; + XtSetArg(args[n], XtNresizable, True); n++; + XtSetArg(args[n], XtNright, XtChainRight); n++; + apd->content.form = XtCreateManagedWidget("form", formWidgetClass, apd->printshell, args, n); + + printFontNormal = GetPrintTextFont(pdpy, "-*-courier-medium-r-*", dpi_x, dpi_y); + printFontBold = GetPrintTextFont(pdpy, "-*-courier-bold-r-*", dpi_x, dpi_y); + printFontItalic = GetPrintTextFont(pdpy, "-*-courier-medium-o-*", dpi_x, dpi_y); + printFontSymbol = GetPrintTextFont(pdpy, "-*-symbol-*-*-*", dpi_x, dpi_y); + + n = 0; + XtSetArg(args[n], XtNfromHoriz, NULL); n++; + XtSetArg(args[n], XtNfromVert, NULL); n++; + XtSetArg(args[n], XtNtop, XtChainTop); n++; + XtSetArg(args[n], XtNright, XtChainRight); n++; + XtSetArg(args[n], XtNresizable, True); n++; + XtSetArg(args[n], XtNfont, printFontNormal); n++; /* fontset would be better */ + XtSetArg(args[n], XtNlabel, "Page: n/n"); n++; + XtSetArg(args[n], XtNjustify, XtJustifyRight); n++; + apd->content.pageheaderlabel = XtCreateManagedWidget("pageinfo", labelWidgetClass, apd->content.form, args, n); + + n = 0; + XtSetArg(args[n], XtNfile, manpagefile); n++; + +/* Usually I would expect that using |XtNfromVert, apd->content.pageheaderlabel| + * would be the correct way to place the text widget with the main content below + * the page header widget - but for an unknown reason this doesn not work: The + * text widget squishes itself into the bottom half of the page and only occupies + * 1/2 of the page's with... ;-(( */ +#define WORKAROUND_FOR_SOMETHING_IS_WRONG 1 +#ifdef WORKAROUND_FOR_SOMETHING_IS_WRONG + XtSetArg(args[n], XtNtop, XtChainTop); n++; + XtSetArg(args[n], XtNright, XtChainRight); n++; + XtSetArg(args[n], XtNvertDistance, (printFontNormal->ascent+printFontNormal->descent+2)*2); n++; +#else + XtSetArg(args[n], XtNfromHoriz, NULL); n++; + XtSetArg(args[n], XtNfromVert, apd->content.pageheaderlabel); n++; +#endif + + XtSetArg(args[n], XtNmanualFontNormal, printFontNormal); n++; + XtSetArg(args[n], XtNmanualFontBold, printFontBold); n++; + XtSetArg(args[n], XtNmanualFontItalic, printFontItalic); n++; + XtSetArg(args[n], XtNmanualFontSymbol, printFontSymbol); n++; + apd->content.manpage = XtCreateManagedWidget("manpage", scrollByLineWidgetClass, apd->content.form, args, n); + + XtAddCallback(apd->printshell, XawNpageSetupCallback, PageSetupCB, (XtPointer)apd); + XtAddCallback(apd->printshell, XawNendJobCallback, PrintEndJobCB, (XtPointer)apd); + + /* Realise print shell (which will set position+size of the child + * widgets based on the current page size) */ + XtRealizeWidget(apd->printshell); + + /* Count number of pages in the manpage widget */ + apd->numpages = CountPages(apd->content.manpage); + + /* Make sure that the Xt machinery is really using the right screen (assertion) */ + if (XpGetScreenOfContext(XtDisplay(apd->printshell), apd->pcontext) != XtScreen(apd->printshell)) + Error(("Widget's screen != print screen. BAD.\n")); + + apd->isPrinting = True; + + if (toFile) { + printf("%s: Printing to file '%s'...\n", apd->programname, toFile); + apd->printtofile_handle = XpuStartJobToFile(pdpy, pcontext, toFile); + if (!apd->printtofile_handle) { + perror("XpuStartJobToFile failure"); + apd->isPrinting = False; + return; + } + } + else + { + printf("%s: Printing to printer...\n", apd->programname); + XpuStartJobToSpooler(pdpy); + } +} + + diff --git a/app/xman/print.h b/app/xman/print.h new file mode 100644 index 000000000..892cd6c39 --- /dev/null +++ b/app/xman/print.h @@ -0,0 +1,50 @@ +/* + * $Xorg: print.h,v 1.1 2004/04/30 02:05:54 gisburn Exp $ + * +Copyright 2004 Roland Mainz <roland.mainz@nrubsig.org> + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + * + */ + +#ifndef XMAN_PRINT_H +#define XMAN_PRINT_H 1 + +#include <X11/Intrinsic.h> +#include <X11/StringDefs.h> +#include <X11/Shell.h> +#include <X11/Xaw/Print.h> +#include <X11/Xaw/Cardinals.h> +#include <X11/XprintUtil/xprintutil.h> + +#define PrintMsg(x) { printf("xman: "); printf x ; } + +/* Prototypes */ +void DoPrintManpage(const char *programname, + FILE *manpage, + Widget toplevel, + Display *pdpy, XPContext pcontext, + XpuColorspaceRec *colorspace, + XtCallbackProc printDisplayDestroyCallback, + const char *jobTitle, + const char *toFile); + +#endif /* !XMAN_PRINT_H */ diff --git a/app/xman/search.c b/app/xman/search.c new file mode 100644 index 000000000..48c4efe9a --- /dev/null +++ b/app/xman/search.c @@ -0,0 +1,401 @@ +/* $XConsortium: search.c,v 1.21 94/04/17 20:43:58 rws Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ +/* $XFree86: xc/programs/xman/search.c,v 1.5 2001/01/27 17:24:27 herrb Exp $ */ + + +#include "globals.h" +#include "vendor.h" + +/* Map <CR> and control-M to goto begining of file. */ + +#define SEARCHARGS 10 + +static FILE * DoManualSearch(ManpageGlobals *man_globals, char * string); +static int BEntrySearch(char * string, char ** first, int number); + +/* Function Name: MakeSearchWidget + * Description: This Function Creates the Search Widget. + * Arguments: man_globals - the pseudo globas for this manpage. + * w - the widgets parent + * Returns: the search widget. + */ + +void +MakeSearchWidget(ManpageGlobals * man_globals, Widget parent) +{ + Widget dialog, command, text, cancel; + Arg arglist[2]; + Cardinal num_args = 0; + + XtSetArg(arglist[0], XtNtransientFor, parent); + man_globals->search_widget = XtCreatePopupShell(SEARCHNAME, + transientShellWidgetClass, + parent, + arglist, 1); + + if (resources.clear_search_string) { + XtSetArg(arglist[0], XtNvalue, ""); num_args++; + } + + dialog = XtCreateManagedWidget(DIALOG, dialogWidgetClass, + man_globals->search_widget, + arglist, num_args); + + if ( (text = XtNameToWidget(dialog, "value")) == (Widget) NULL) + PopupWarning(NULL, "Could not find text widget in MakeSearchWidget."); + else + XtSetKeyboardFocus(dialog, text); + + XawDialogAddButton(dialog, MANUALSEARCH, NULL, NULL); + XawDialogAddButton(dialog, APROPOSSEARCH, NULL, NULL); + XawDialogAddButton(dialog, CANCEL, NULL, NULL); + +/* + * This is a bit gross, but it get the cancel button underneath the + * others, and forms them up to the right size.. + */ + + if ( ((command = XtNameToWidget(dialog, MANUALSEARCH)) == (Widget) NULL) || + ((cancel = XtNameToWidget(dialog, CANCEL)) == (Widget) NULL) ) + PopupWarning(NULL, + "Could not find manual search widget in MakeSearchWidget."); + else { + static char * half_size[] = { + MANUALSEARCH, APROPOSSEARCH, NULL + }; + static char * full_size[] = { + "label", "value", CANCEL, NULL + }; + + num_args = 0; + XtSetArg(arglist[num_args], XtNfromVert, command); num_args++; + XtSetArg(arglist[num_args], XtNfromHoriz, NULL); num_args++; + XtSetValues(cancel, arglist, num_args); + FormUpWidgets(dialog, full_size, half_size); + } + +} + +/* Function Name: SearchString + * Description: Returns the search string. + * Arguments: man_globals - the globals. + * Returns: the search string. + */ + +static char * +SearchString( +ManpageGlobals * man_globals) +{ + Widget dialog; + + dialog = XtNameToWidget(man_globals->search_widget, DIALOG); + if (dialog != NULL) + return(XawDialogGetValueString(dialog)); + + PopupWarning(man_globals, + "Could not get the search string, no search will be preformed."); + return(NULL); +} + + +/* Function Name: DoSearch + * Description: This function performs a search for a man page or apropos + * search upon search string. + * Arguments: man_globals - the pseudo globas for this manpage. + * type - the type of search. + * Returns: none. + */ + +#define LOOKLINES 6 + +/* + * Manual searches look through the list of manual pages for the right one + * with a binary search. + * + * Apropos searches still exec man -k. + * + * If nothing is found then I send a warning message to the user, and do + * nothing. + */ + +FILE * +DoSearch(ManpageGlobals * man_globals, int type) +{ + char cmdbuf[BUFSIZ],*mantmp, *manpath; + char tmp[BUFSIZ],path[BUFSIZ]; + char string_buf[BUFSIZ], cmp_str[BUFSIZ], error_buf[BUFSIZ]; + char * search_string = SearchString(man_globals); + FILE * file; +#ifdef HAS_MKSTEMP + int fd; +#endif + int count; + Boolean flag; + + if (search_string == NULL) return(NULL); + + /* If the string is empty or starts with a space then do not search */ + + if ( streq(search_string,"") ) { + PopupWarning(man_globals, "Search string is empty."); + return(NULL); + } + + if (strlen(search_string) >= BUFSIZ) { + PopupWarning(man_globals, "Search string too long."); + return(NULL); + } + if (search_string[0] == ' ') { + PopupWarning(man_globals, "First character cannot be a space."); + return(NULL); + } + + if (type == APROPOS) { + char label[BUFSIZ]; + + strcpy(tmp, MANTEMP); /* get a temp file. */ +#ifdef HAS_MKSTEMP + fd = mkstemp(tmp); + if (fd < 0) { + PopupWarning(man_globals, "Cant create temp file"); + return NULL; + } +#else + (void)mktemp(tmp); +#endif + mantmp = tmp; + + manpath=getenv("MANPATH"); + if (manpath == NULL || streq(manpath,"") ) { +#ifdef MANCONF + if (!ReadManConfig(path)) +#endif + { + strcpy(path,SYSMANPATH); +#ifdef LOCALMANPATH + strcat(path,":"); + strcat(path,LOCALMANPATH); +#endif + } + } else { + strcpy(path,manpath); + } + + snprintf(label, sizeof(label), + "Results of apropos search on: %s", search_string); + +#ifdef NO_MANPATH_SUPPORT /* not quite correct, but the best I can do. */ + snprintf(cmdbuf, sizeof(cmdbuf), APROPOS_FORMAT, search_string, mantmp); +#else + snprintf(cmdbuf, sizeof(cmdbuf), APROPOS_FORMAT, path, search_string, mantmp); +#endif + + if(system(cmdbuf) != 0) { /* execute search. */ + snprintf(error_buf, sizeof(error_buf), "Something went wrong trying to run %s\n",cmdbuf); + PopupWarning(man_globals, error_buf); + } + +#ifdef HAS_MKSTEMP + if ((file = fdopen(fd, "r")) == NULL) +#else + if((file = fopen(mantmp,"r")) == NULL) +#endif + PrintError("lost temp file? out of temp space?"); + +/* + * Since we keep the FD open we can unlink the file safely, this + * will keep extra files out of /tmp. + */ + + unlink(mantmp); + + snprintf(string_buf, sizeof(string_buf), "%s: nothing appropriate", search_string); + + /* + * Check first LOOKLINES lines for "nothing appropriate". + */ + + count = 0; + flag = FALSE; + while ( (fgets(cmp_str, BUFSIZ, file) != NULL) && (count < LOOKLINES) ) { + if ( cmp_str[strlen(cmp_str) - 1] == '\n') /* strip off the '\n' */ + cmp_str[strlen(cmp_str) - 1] = '\0'; + + if (streq(cmp_str, string_buf)) { + flag = TRUE; + break; + } + count++; + } + + /* + * If the file is less than this number of lines then assume that there is + * nothing apropriate found. This does not confuse the apropos filter. + */ + + if (flag) { + fclose(file); + file = NULL; + ChangeLabel(man_globals->label,string_buf); + return(NULL); + } + + snprintf(man_globals->manpage_title, sizeof(man_globals->manpage_title), + "%s", label); + ChangeLabel(man_globals->label,label); + fseek(file, 0L, SEEK_SET); /* reset file to point at top. */ + } + else { /* MANUAL SEACH */ + file = DoManualSearch(man_globals, search_string); + if (file == NULL) { + snprintf(string_buf, sizeof(string_buf), "No manual entry for %s.", search_string); + ChangeLabel(man_globals->label, string_buf); + if (man_globals->label == NULL) + PopupWarning(man_globals, string_buf); + return(NULL); + } + } + + if (resources.clear_search_string) { + Arg arglist[1]; + Widget dialog; + + dialog = XtNameToWidget(man_globals->search_widget, DIALOG); + if (dialog == NULL) + PopupWarning(man_globals, "Could not clear the search string."); + + XtSetArg(arglist[0], XtNvalue, ""); + XtSetValues(dialog, arglist, (Cardinal) 1); + } + + return(file); +} + +/* Function Name: DoManualSearch + * Description: performs a manual search. + * Arguments: man_globals - the manual page specific globals. + * Returns: the filename of the man page. + */ + +#define NO_ENTRY -100 + +static FILE * +DoManualSearch(ManpageGlobals *man_globals, char * string) +{ + int e_num = NO_ENTRY; + int i; + +/* search current section first. */ + + i = man_globals->current_directory; + e_num = BEntrySearch(string, manual[i].entries, manual[i].nentries); + +/* search other sections. */ + + if (e_num == NO_ENTRY) { + i = 0; /* At the exit of the loop i needs to + be the one we used. */ + while ( TRUE ) { + if (i == man_globals->current_directory) + if (++i >= sections) return(NULL); + e_num = BEntrySearch(string, manual[i].entries, manual[i].nentries); + if (e_num != NO_ENTRY) break; + if (++i >= sections) return(NULL); + } + +/* + * Manual page found in some other section, unhighlight the current one. + */ + if ( man_globals->manpagewidgets.box != NULL) + XawListUnhighlight( + man_globals->manpagewidgets.box[man_globals->current_directory]); + } + else { + /* + * Highlight the element we are searching for if it is in the directory + * listing currently being shown. + */ + if ( man_globals->manpagewidgets.box != NULL) + XawListHighlight(man_globals->manpagewidgets.box[i], e_num); + } + return(FindManualFile(man_globals, i, e_num)); +} + +/* Function Name: BEntrySearch + * Description: binary search through entries. + * Arguments: string - the string to match. + * first - the first entry in the list. + * number - the number of entries. + * Returns: a pointer to the entry found. + */ + +static int +BEntrySearch( +char * string, +char ** first, +int number) +{ + int check, cmp, len_cmp, global_number; + char *head, *tail; + + global_number = 0; + while (TRUE) { + + if (number == 0) { + return(NO_ENTRY); /* didn't find it. */ + } + + check = number/2; + + head = rindex(first[ global_number + check ], '/'); + if (head == NULL) + PrintError("index failure in BEntrySearch"); + head++; + + tail = rindex(head, '.'); + if (tail == NULL) + /* not an error, some systems (e.g. sgi) have only a .z suffix */ + tail = head + strlen(head); + + cmp = strncmp(string, head, (tail - head)); + len_cmp = strlen(string) - (int) (tail - head); + + if ( cmp == 0 && len_cmp == 0) { + return(global_number + check); + } + else if ( cmp < 0 || ((cmp == 0) && (len_cmp < 0)) ) + number = check; + else /* cmp > 0 || ((cmp == 0) && (len_cmp > 0)) */ { + global_number += (check + 1); + number -= ( check + 1 ); + } + } +} diff --git a/app/xman/tkfuncs.c b/app/xman/tkfuncs.c new file mode 100644 index 000000000..0222e7c7b --- /dev/null +++ b/app/xman/tkfuncs.c @@ -0,0 +1,99 @@ +/* $XConsortium: tkfuncs.c,v 1.6 94/04/17 20:43:59 rws Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ +/* $XFree86$ */ + +#include <X11/X.h> +#include <X11/Xos.h> +#include <X11/Xlib.h> +#include <X11/Intrinsic.h> +#include <X11/StringDefs.h> +#include <X11/IntrinsicP.h> + +#include "globals.h" + +/* + * I am doing the "wrong" thing here by looking in the core field for the + * widget to get this info, the "right" thing to do is to do a XtGetValues + * to get this information. + */ + +/* Function Name: Width + * Description: finds the width of a widget. + * Arguments: w - the widget. + * Returns: the width of that widget. + */ + +int +Width(Widget w) +{ + return( (int) w->core.width ); +} + +/* Function Name: Height + * Description: finds the height of a widget. + * Arguments: w - the widget. + * Returns: the height of that widget. + */ + +int +Height(Widget w) +{ + return( (int) w->core.height ); +} + +/* Function Name: BorderWidth + * Description: finds the BorderWidth of a widget. + * Arguments: w - the widget. + * Returns: the BorderWidth of that widget. + */ + +int +BorderWidth(Widget w) +{ + return( (int) w->core.border_width ); +} + +/* + * These functions have got to be able to get at the widget tree, I don't see + * any way around this one. + */ + +/* Function Name: Name + * Description: This function returns the correct popup child + * Arguments: w - widget + * Returns: the popup child. + */ + +char * +Name(Widget w) +{ + return( w->core.name); +} diff --git a/app/xman/vendor.c b/app/xman/vendor.c new file mode 100644 index 000000000..56257b3bd --- /dev/null +++ b/app/xman/vendor.c @@ -0,0 +1,318 @@ +/* $XConsortium: vendor.c,v 1.10 94/04/17 20:43:59 rws Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ +/* $XFree86: xc/programs/xman/vendor.c,v 1.2 2000/03/03 20:02:25 dawes Exp $ */ + +/* Vendor-specific data structures and operations */ + +#include "globals.h" +#include "vendor.h" + +typedef struct sectionName { + char * name; + char * suffix; +} SectionNameRec; + +#if defined(SYSV) || defined(__osf__) || defined(SVR4) && !defined(sun) + +static SectionNameRec SectionNames[] = { + {"(1) User Commands", "1"}, + {"(1m) Sys, Administration", "1m"}, + {"(2) System Calls", "2"}, + {"(3) Subroutines", "3"}, + {"(4) File Formats", "4"}, + {"(5) Miscellaneous", "5"}, + {"(6) Games", "6"}, + {"(7) Devices", "7"}, + {"(8) Sys. Administration", "8"}, + {"(l) Local", "l"}, + {"(n) New", "n"}, + {"(o) Old", "o"} +#ifdef __SCO__ + , + { "(ADM) System Administration", "ADM" }, + { "(ADMN) Network Administration", "ADMN" }, + { "(ADMP) Protocol Administration", "ADMP" }, + { "(C) Commands", "C" }, + { "(CMD) DOS Commands", "CMD" }, + { "(CP) Programming Commands", "CP" }, + { "(DOS) DOS Subroutines and Libraries", "DOS" }, + { "(F) File Formats", "F" }, + { "(HW) Hardware Dependant", "HW" }, + { "(K) Kernel Subroutines", "K" }, + { "(LOCAL) Local utilities for your system", "LOCAL" }, + { "(M) Miscellaneous", "M" }, + { "(NADM) NFS Administration", "NADM" }, + { "(NC) Network Commands", "NC" }, + { "(NF) Network File Formats", "NF" }, + { "(NS) Network Subroutines", "NS" }, + { "(NSL) Network Services", "NSL" }, + { "(S) Subroutines and Libraries", "S" }, + { "(SCO) Product Engineering Toolkit", "SCO" }, + { "(SFF) Socket File Formats", "SFF" }, + { "(STR) Streams", "STR" }, + { "(TC) Transport Layer Commands", "TC" }, + { "(X) X Man pages", "X" }, + { "(XNX) Xenix Subroutines, Commands and Libs", "XNX" }, + { "(XS) X11 Subroutines and Libraries", "XS" }, + { "(Xm) Motif Commands and Subroutines", "Xm" }, + { "(Xt) X Intrinsics", "Xt" } +#endif +}; + +#else + +#if defined(sun) && defined(SVR4) +/* losing man.cf is useless because it has no section names */ + +static SectionNameRec SectionNames[] = { + {"(1) User Commands", "1"}, + {"(1b) SunOS/BSD Compatibility Commands", "1b"}, + {"(1c) Communication Commands", "1c"}, + {"(1f) FMLI Commands", "1f"}, + {"(1m) Maintenance Commands", "1m"}, + {"(1s) SunOS Specific Commands", "1s"}, + {"(2) System Calls", "2"}, + {"(3) C Library Functions", "3"}, + {"(3b) SunOS/BSD Compatibility Functions", "3b"}, + {"(3c) C Library Functions", "3c"}, + {"(3e) ELF Library Functions", "3e"}, + {"(3g) C Library Functions", "3g"}, + {"(3i) Wid Character Functions", "3i"}, + {"(3k) Kernel VM Library Functions", "3k"}, + {"(3m) Mathematical Library", "3m"}, + {"(3n) Network Functions", "3n"}, + {"(3r) RPC Services Library", "3r"}, + {"(3s) Standard I/O Functions", "3s"}, +#if OSMINORVERSION == 5 + {"(3t) Threads Library", "3t"}, +#endif + {"(3x) Miscellaneous Library Functions", "3x"}, + {"(4) File Formats", "4"}, + {"(4b) Misc. Reference Manual Pages", "4b"}, + {"(5) Environments, Tables, and TROFF Macros", "5"}, + {"(6) Games and Demos", "6"}, + {"(7) Special Files", "7"}, +#if OSMINORVERSION == 5 + {"(7d) Devices", "7d"}, + {"(7fs) File Systems", "7fs"}, + {"(7i) Ioctl Requests", "7i"}, + {"(7m) STREAMS Modules", "7m"}, + {"(7p) Protocols", "7p"}, +#endif + {"(9) Device Driver Information", "9"}, + {"(9e) DDI and DKI Driver Entry Points", "9e"}, + {"(9f) DDI and DKI Kernel Functions", "9f"}, + {"(9s) DDI and DKI Data Structures", "9s"}, + {"(l) Local", "l"}, + {"(n) New", "n"}, +}; + +#else + +static SectionNameRec SectionNames[] = { + {"(1) User Commands", "1"}, + {"(2) System Calls", "2"}, + {"(3) Subroutines", "3"}, + {"(4) Devices", "4"}, + {"(5) File Formats", "5"}, + {"(6) Games", "6"}, + {"(7) Miscellaneous", "7"}, + {"(8) Sys. Administration", "8"}, +#ifdef Lynx + {"(9) Device driver service calls", "9"}, +#endif +#if defined(__OpenBSD__) || defined(__NetBSD__) + {"(9) Kernel Manual", "9"}, +#endif +#if defined(__FreeBSD__) + {"(9) Kernel Interfaces", "9"}, +#endif + {"(l) Local", "l"}, + {"(n) New", "n"}, + {"(o) Old", "o"}, +#ifdef sony + {"(p) Public Domain", "p"}, + {"(s) Sony Specific", "s"}, +#endif +}; + +#endif +#endif + +/* Function Name: AddStandardSections + * Description: Adds all the standard sections to the list for this path. + * Arguments: list - a pointer to the section list. + * path - the path to these standard sections. + * Returns: none. + */ + +void AddStandardSections( +SectionList **list, +char * path) +{ +#ifdef CRAY + AddStandardCraySections(list, path); + return; +#else + register int i; + char file[BUFSIZ]; + int numSections = sizeof(SectionNames) / sizeof(SectionNames[0]); + + for (i=0; i < numSections; i++) { + sprintf(file, "%s%s", SEARCHDIR, SectionNames[i].suffix); + AddNewSection(list, path, file, SectionNames[i].name, TRUE); +#ifdef SEARCHOTHER + sprintf(file, "%s%s", SEARCHOTHER, SectionNames[i].suffix); + AddNewSection(list, path, file, SectionNames[i].name, TRUE); +#endif + } +#endif +} + +#ifdef CRAY +/* Function Name: AddStandardCraySections + * Description: Add sections specific to the Cray. + * Arguments: list - a pointer to the section list. + * path - the path to these standard sections. + * names - standard section names. + * Returns: none. + */ + +void AddStandardCraySections( +SectionList **list, +char *path) +{ + char file[BUFSIZ]; + int i; +#define NoSuf (char *)0 +#define Suffix (char *)1 +#define Fold (char *)2 +#define FoldSuffix (char *)3 + static char *cname[] = { + "(1) User Commands", Suffix, "1", "1bsd", NULL, + "(1) User Commands (instant)", NoSuf, "1r", "1rb", NULL, + "(1m) System Administration", NoSuf, "1m", NULL, + "(2) System Calls", Suffix, "2", NULL, + "(3) Subroutines", FoldSuffix, "3", "3bsd", "3c", "3m", "3mt", "3s", "3sl", "3z", NULL, + "(3) Subroutines (FORTRAN)", Fold, "3f", NULL, + "(3) Subroutines (I/O)", Fold, "3io", NULL, + "(3) Subroutines (X11)", NoSuf, "3X11", NULL, + "(3) Subroutines (Xt)", NoSuf, "3Xt", NULL, + "(3) Subroutines (misc.)", Suffix, "3q", NULL, + "(3) Subroutines (misc.)", Fold, "3x", NULL, + "(3) Subroutines (networking)", Suffix, "3n", "3rpc", "3svc", "3w", "3yp", NULL, + "(3) Subroutines (scientific)", Fold, "3sci", NULL, + "(3) Subroutines (utilities)", FoldSuffix, "3db", "3u", NULL, + "(4) Devices", Suffix, "4", "4d", "4f", "4n", "4p", "4s", NULL, + "(5) File Formats", Suffix, "5", NULL, + "(6) Games", Suffix, "6", NULL, + "(7) Miscellaneous", Suffix, "7", NULL, + "(8) Sys. Administration", NoSuf, "8", NULL, + "(l) Local", Suffix, "l", NULL, + "(n) New", Suffix, "n", NULL, + "(o) Old", Suffix, "o", NULL, + "(info) Information", NoSuf, "info", NULL, + "(osi) Miscellaneous", NoSuf, "osi", NULL, + "(sl) Miscellaneous", NoSuf, "sl", NULL, + "(ultra) Miscellaneous", NoSuf, "ultra", NULL, + NULL + }; + char **p = cname; + + while (*p != NULL) { + char *message = *p++; + int flags = (int) *p++; + while (*p != NULL) { + sprintf(file, "%s%s", SEARCHDIR, *p++); + AddNewSection(list, path, file, message, flags); + } + p++; + } +} +#endif /* CRAY */ + + +/* Function Name: CreateManpageName + * Description: Creates the manual page name for a given item. + * Arguments: entry - the entry to convert. + * Returns: the manual page properly allocated. + */ + +/* + * If the filename is foo.3 - Create an entry of the form: foo + * If the filename is foo.3X11 - Create an entry of the form: foo(X11) + * IF the filename is a.out.1 - Create an entry of the form: a.out + */ + +char * +CreateManpageName( +char * entry, +int section, /* FIXME: unused */ +int flags) +{ + char * cp; + char page[BUFSIZ]; + char sect[BUFSIZ]; + + ParseEntry(entry, NULL, sect, page); + +#ifndef CRAY + if ( (cp = rindex(page, '.')) != NULL) { + if ( (int)strlen(cp) > 2 ) { + *cp++ = '('; + while( (cp[1] != '\0') ) { + *cp = *(cp + 1); + cp++; + } + *cp++ = ')'; + *cp = '\0'; + } + else + *cp = '\0'; + } + +#else /* CRAY - pick up the Cray name from the section */ + + if ( (cp = rindex(page, '.')) == NULL) + cp = page + strlen(page); + if ((flags & MSUFFIX) && strlen(sect) > 4) { + char *p = sect + 4; + *cp++ = '('; + while (*p) + *cp++ = *p++; + *cp++ = ')'; + } + *cp = '\0'; + +#endif /* CRAY */ + + return(StrAlloc(page)); +} diff --git a/app/xman/vendor.h b/app/xman/vendor.h new file mode 100644 index 000000000..0e0c72d50 --- /dev/null +++ b/app/xman/vendor.h @@ -0,0 +1,247 @@ +/* $XConsortium: vendor.h,v 1.12 94/04/17 20:44:00 rws Exp $ */ +/* $XdotOrg: app/xman/vendor.h,v 1.7 2005/11/08 06:33:33 jkj Exp $ */ +/* + +Copyright (c) 1991 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ +/* $XFree86: xc/programs/xman/vendor.h,v 1.13 2003/07/29 21:16:56 dawes Exp $ */ + +/* Vendor-specific definitions */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef CSRG_BASED +#include <sys/param.h> +#endif + +#define SUFFIX "suffix" +#define FOLD "fold" +#define FOLDSUFFIX "foldsuffix" +#define MNULL 0 +#define MSUFFIX 1 +#define MFOLD 2 +#define MFOLDSUFFIX 3 + +/* + * The directories to search. Assume that the manual directories are more + * complete than the cat directories. + */ + +#if ( defined(UTEK) || defined(apollo) || defined(Lynx) ) +# define SEARCHDIR CAT +#else +# define SEARCHDIR MAN +#endif + +#if ( defined(sgi) || (defined(i386) && (defined(SYSV) || defined(SVR4))) || (defined(BSD) && (BSD >= 199103)) || defined(linux) ) +# define SEARCHOTHER CAT +#endif + +/* + * The default manual page directory. + * + * The MANPATH enviornment variable will override this. + */ + +#ifndef SYSMANPATH + +#if defined(macII) +# define SYSMANPATH "/usr/catman/u_man:/usr/catman/a_man" +#elif defined(__bsdi__) +# define SYSMANPATH "/usr/share/man:/usr/contrib/man:/usr/contrib/isode/man:/usr/local/man" +#elif defined(__OpenBSD__) || defined(__DARWIN__) +# define SYSMANPATH "/usr/share/man:/usr/local/man:/usr/X11R6/man" +#elif defined(SVR4) && defined(sun) +# define SYSMANPATH "/usr/share/man:/usr/X11/man:/usr/openwin/share/man:/usr/dt/share/man:/usr/sfw/share/man" +#elif defined(SVR4) || defined(__osf__) || (defined(BSD) && (BSD >= 199103)) +# define SYSMANPATH "/usr/share/man" +#elif defined(hcx) +# define SYSMANPATH "/usr/catman/local_man:/usr/catman/u_man:/usr/catman/a_man:/usr/catman/p_man:/usr/catman/ada_man" +#elif defined(SYSV) && defined(i386) && !defined(__SCO__) +# define SYSMANPATH "/usr/catman/u_man:/usr/catman/p_man" +#elif defined(sgi) +# define SYSMANPATH "/usr/catman/a_man:/usr/catman/g_man:/usr/catman/p_man:/usr/catman/u_man:/usr/man/p_man:/usr/man/u_man:/usr/man" +#endif + +#ifndef SYSMANPATH +# define SYSMANPATH "/usr/man" +#endif + +#endif + +/* + * Compression Definitions. + */ + +#if defined( macII ) || defined( hcx ) || \ + (defined(SYSV) && defined(i386) && !defined(ISC) && \ + !defined(__UNIXWARE__) && !defined(__SCO__)) || defined(sgi) +# define COMPRESSION_EXTENSION "z" +# define UNCOMPRESS_FORMAT "pcat %s > %s" +# define NO_COMPRESS /* mac can't handle using pack as a filter and + xman needs it to be done that way. */ +#elif defined(UTEK) +# define COMPRESSION_EXTENSION "C" +# define UNCOMPRESS_FORMAT "ccat < %s > %s" +# define COMPRESS "compact" +#elif defined (ISC) || defined(__SCO__) || defined(__UNIXWARE__) +# define COMPRESSION_EXTENSION "Z" /* dummy */ +# if !defined(__SCO__) && !defined(__UNIXWARE__) +# define COMPRESSION_EXTENSIONS "zZF" /* pack, compress, freeze */ +# else +# define COMPRESSION_EXTENSIONS "zZ" /* pack, compress */ +# endif +# define UNCOMPRESS_FORMAT uncompress_format +# define UNCOMPRESS_FORMAT_1 "pcat %s > %s" +# define UNCOMPRESS_FORMAT_2 "zcat < %s > %s" +# define UNCOMPRESS_FORMAT_3 "fcat < %s > %s" +# define NO_COMPRESS +#else +# define COMPRESSION_EXTENSION "Z" +# ifndef HAS_MKSTEMP +# define UNCOMPRESS_FORMAT "zcat < %s > %s" +# else +# define UNCOMPRESS_FORMAT "zcat < %s >> %s" +# endif +# define COMPRESS "compress" +# define GZIP_EXTENSION "gz" +# ifndef HAS_MKSTEMP +# define GUNZIP_FORMAT "gzip -c -d < %s > %s" +# else +# define GUNZIP_FORMAT "gzip -c -d < %s >> %s" +# endif +# define GZIP_COMPRESS "gzip" +#endif + + + +/* + * The command filters for the manual and apropos searches. + */ + +#if (defined(hpux) || defined(macII) || defined(CRAY) || defined(ultrix) || \ + defined(hcx) ) +# define NO_MANPATH_SUPPORT +#endif + +#ifndef HAS_MKSTEMP +# ifdef NO_MANPATH_SUPPORT +# define APROPOS_FORMAT ("man -k %s | pr -h Apropos > %s") +# else +# define APROPOS_FORMAT ("man -M %s -k %s | pr -h Apropos > %s") +# endif +#else +/* with mkstemp the temp output file is already created */ +# ifdef NO_MANPATH_SUPPORT +# define APROPOS_FORMAT ("man -k %s | pr -h Apropos >> %s") +# else +# define APROPOS_FORMAT ("man -M %s -k %s | pr -h Apropos >> %s") +# endif +#endif + +#ifndef HANDLE_ROFFSEQ +# if defined(ultrix) +# define FORMAT "| nroff -man" /* The format command. */ +# elif defined(CSRG_BASED) +# define FORMAT "| eqn | tbl | nroff -mandoc" +# elif defined(BSD) && (BSD >= 199103) +# define FORMAT "| eqn | tbl | nroff -man" +# elif defined(linux) +# define FORMAT "| pic | eqn | tbl -Tlatin1 | GROFF_NO_SGR= groff -Tlatin1 -mandoc" +# else +# define FORMAT "| neqn | nroff -man" /* The format command. */ +# endif +# define TBL "tbl" +#else /* HANDLE_ROFFSEQ */ +# if defined(linux) +# define ZSOELIM "zsoelim" +# else +# define ZSOELIM "soelim" +#endif +# define EQN "eqn" +# define TBL "tbl" +# define GRAP "grap" +# define PIC "pic" +# define VGRIND "vgrind" +# define REFER "refer" +# if defined(CSRG_BASED) +# define FORMAT "nroff -mandoc" +# elif defined(linux) +# define FORMAT "GROFF_NO_SGR= groff -Tlatin1 -mandoc" +# elif defined(__DARWIN__) +# define FORMAT "nroff -man" +# else +# define FORMAT "groff -man" +# endif +# define DEFAULT_MANROFFSEQ "et" +#endif /*HANDLE_ROFFSEQ */ + +/* + * Names of the man and cat dirs. + */ + +#ifdef __bsdi__ +#define MAN "cat" +#else +#define MAN "man" +#endif + +/* + * The Apple, Cray,, SYSV386, and HCX folks put the preformatted pages in the + * "man" directories. + */ +#if (defined(macII) || defined(CRAY) || defined(hcx) || \ + (defined(SYSV) && defined(i386))) && !defined(SCO) +# define CAT MAN +#elif defined(SCO) +# define CAT "cat." +#else +# define CAT "cat" +#endif + +/* Solaris has nroff man pages in "man" and sgml man pages in "sman" */ +#if defined(sun) && defined(SVR4) +# define SFORMAT "/usr/lib/sgml/sgml2roff" +# define SMAN "sman" +# undef SEARCHOTHER +# define SEARCHOTHER SMAN +# define SGMLENT_EXTENSION "ent" /* SGML entity files end in ".ent" */ +#endif + + +typedef struct _SectionList { + struct _SectionList * next; + char * label; /* section label */ + char * directory; /* section directory */ + int flags; +} SectionList; + +extern char * CreateManpageName(char * entry, int section, int flags); +extern void AddStandardSections(SectionList **list, char * path); +extern void AddNewSection(SectionList **list, char * path, char * file, char * label, int flags); diff --git a/app/xman/version.h b/app/xman/version.h new file mode 100644 index 000000000..f10367d6b --- /dev/null +++ b/app/xman/version.h @@ -0,0 +1,32 @@ +/* $XConsortium: version.h,v 1.11 94/04/17 20:44:00 gildea Exp $ */ +/* + +Copyright (c) 1987, 1988 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ + +#define XMAN_VERSION "Xman Version 3.2.0 - X11R7.0" diff --git a/app/xman/xman.help b/app/xman/xman.help new file mode 100644 index 000000000..247ed7c63 --- /dev/null +++ b/app/xman/xman.help @@ -0,0 +1,228 @@ + + +XMAN is an X Window System manual browsing tool. + + + +GETTING STARTED + +By default, xman starts by creating a small window that contains three +"buttons" (places on which to click a pointer button). Two of these +buttons, Help and Quit, are self-explanatory. The third, Manual Page, +creates a new manual page browser window; you may use this button to +open a new manual page any time xman is running. + +A new manual page starts up displaying this help information. The +manual page contains three sections. In the upper left corner are two +menu buttons. When the mouse is clicked on either of these buttons a +menu is popped up. The contents of these menus is described below. +Directly to the right of the menu buttons is an informational display. +This display usually contains the name of the directory or manual page +being displayed. It is also used to display warning messages and the +current version of xman. The last and largest section is the +information display. This section of the application contains either a +list of manual pages to choose from or the text of a manual page. + +To use xman pull down the Sections menu to select a manual section. +When the section is displayed, click the left pointer button on the name +of the manual page that you would like to see. Xman will replace the +directory listing with the manual page you selected. + +That should be enough to get you started. Once you understand the +basics of how to use xman, take a look at the rest of this file to see +the advanced features that are available to make using xman fast and +efficient. + + +SCROLLING TEXT + +The scroll bars are similar to xterm and xmh scroll bars; clicking the +left or right pointer button with the pointer at the bottom of the +scroll bar will scroll the text down or up one page, respectively. +Clicking with the pointer farther up the scroll bar scrolls +proportionally less than one page. Clicking the middle button a portion +of the way down the scroll bar will move the text window that portion of +the way down the text. Holding the middle button and moving the pointer +up and down allows the text to be scrolled dynamically. + +You may also type 'f' or <space bar> to scroll down one page, and 'b' to +scroll up one page. + + +RESIZING WINDOWS + +You can resize any of the windows in xman with your window manager, and +xman will do the best it can to resize everything internally into a +useful configuration. The only control over the internal arrangement +that you have is moving the border between the manual page and directory +when both are displayed. This is done by clicking and holding the any +pointer button when the cursor is over the small square (grip) on the +right side of the screen. The grip is located on the horizontal line +which separates the panes. The grip may be moved up and down to resize +the panes of the screen, and when the pointer button is released xman +will move the pane boundary to the newly specified location. + + +MENU COMMANDS + +There are two ways to activate the menus. The first is to click any +pointer button in the menu button corresponding to the menu you want to +activate. The second method is to hold down the "Control" key and click +the left pointer button for the Options menu or the middle pointer +button for the Sections menu. Reguardless of how the menu was +activated, selecting items is the same. + +Once a menu is activated, continue to hold down the pointer button and +drag the pointer cursor over the item that you would like to activate. +Once the item that you want to select is highlighted, select it by +releasing the pointer button. To avoid making a menu selection, move +the pointer cursor outside the menu and release the button. + +Selecting one of the items in the Sections menu will display the named +directory. + +The following commands are available through the Options menu: + +Display Directory Show the current section directory. + +Display Manual Page Show the current manual page. + +Help Create a help window with this text displayed. + +Search Pop up a dialogue box that allows the entire + tree of manual pages to be searched for a + specific name. A keyword (apropos) search is + also available through this dialogue box. + +Show Both Screens Split the manual page display window to display + both the current manual page and the directory. +Show One Screen Return to a single screen display of either a + manual page or directory listing. + +Remove This Man Page Remove this manual page, do not quit. + +Open New Man Page Pop up a new manual page browser window. + +Show Version Print the current version of xman to the + information display window. Please include the + version number when reporting bugs. + +Quit Close all xman windows and quit xman. + + +SUMMARY OF BASIC ACTIONS + +In a menu button: + + CLICK: Pop up a menu + +In a directory, manual page, or scroll bar: + + <CONTROL> CLICK LEFT: Pop up the Options menu. + <CONTROL> CLICK MIDDLE: Pop up the Sections menu. + +In a directory: + + CLICK LEFT: Bring up named manual page + <SHIFT> CLICK MIDDLE: Go to manual page previously chosen. + +In a manual page or apropos listing: + + <SHIFT> CLICK MIDDLE: Go to directory of manual pages. + +In scroll bars: + + CLICK LEFT: Move down - more if pointer is near bottom + of window, less if at top. + CLICK MIDDLE: Move top of page to current pointer position. + CLICK RIGHT: Move up - more if pointer is near bottom + of window, less if at top. + +SEARCHING + +Xman has a built-in searching utility that allows the user to search the +entire manual page tree for a specific topic (manual page search) or a +keyword (apropos search). The search dialogue box can be activated from +the Options menu, or by the key Control-s. If the search is started +from the small initial topbox xman will open a new manual page if the +search was successful, and fail silently if the search was unsuccessful. + +Manual page searches are performed starting in the currently displayed +section. If no match is found then the remaining sections are searched +in the order that the sections appear in the Sections menu, starting at +the top. The current version of xman immediately displays the first +manual page that it finds. If the manual page cannot be found that fact +is noted in the informational display. + +An apropos search will search a list of short descriptions for all +manual pages on the system and return a list of all descriptions which +contain the keyword specified. + + +KEYBOARD ACCELERATORS + +Xman contains a set of preinstalled keyboard accelerators. These are a +set of key bindings that perform many of the same operations as the menu +items. Since it is not necessary to pull down the menu, these actions +can be performed more quickly, hence the name accelerators. + +The default key bindings for xman are: + +Anywhere: + + Control - c Exit xman + Control - h Create the help window + Control - n Create a new man page + Control - q Exit xman + Control - s Create a search popup + +In a manual page, directory, or help window: + + Control - r Remove this manual page or help display + Control - v Show the current version of xman + +In a manual page or directory: + + Control - d Display Directory + Control - m Display Man Page + +In a manual page only: + + b Page Back + f Page forward + <Space> Page forward + 1 One line forward + 2 Two lines forward + 3 Three lines forward + 4 Four lines forward + +Note: Control-s does not have any effect in the help window. + + +FURTHER INFORMATION + +Xman is highly customizable. Through the X resource database a user can +customize the look and feel of this application so that it meets a +preferred style of interaction. Almost any configuration that is +available dynamically can be specified through resources. This includes +changing the size, color, and fonts, starting with no topbox, showing +both screens, and rebinding the keyboard accelerators. + +The information on customizing xman is contained in the xman manual +page, I will leave it to you to figure out how to find and display that +information :-) + + + Chris D. Peterson MIT X + Consortium + +CREDITS + +Version: Use 'Show Version' menu item. +Written By: Chris D. Peterson - formerly MIT X Consortium +Based Upon: Xman for X10 by Barry Shein - Boston University + +Copyright 1988, 1989 X Consortium +Edited by Donna Converse and Dave Sternlicht + + diff --git a/app/xman/xman.man b/app/xman/xman.man new file mode 100644 index 000000000..4aaabc0a3 --- /dev/null +++ b/app/xman/xman.man @@ -0,0 +1,387 @@ +.\" $XConsortium: xman.man,v 1.23 94/04/17 20:44:02 matt Exp $ +.\" +.\" $XFree86: xc/programs/xman/xman.man,v 1.3 2001/01/27 18:21:18 dawes Exp $ +.\" +.TH XMAN 1 __xorgversion__ +.SH NAME +xman \- Manual page display program for the X Window System +.SH SYNOPSIS +.B xman +[ +.I \-options +\&.\|.\|. ] +.SH DESCRIPTION +.I Xman +is a manual page browser. The default size of the initial \fIxman\fP +window is small so that you can leave it running throughout your entire login +session. In the initial window there are three options: +\fIHelp\fP will pop up a window with on-line help, \fIQuit\fP will +exit, and \fIManual Page\fP will pop up a window with a manual page +browser in it. +Typing Control-S will pop up a window prompting for a specific manual +page to display. +You may display more than one manual page browser window at a time +from a single execution of \fIxman\fP. +.PP +For further information on using \fIxman\fP, please read the on-line +help information. Most of this manual will discuss +customization of \fIxman\fP. +.SH "OPTIONS" +.PP +Xman supports all standard Toolkit command line arguments (see +\fIX\fP(1)). The following additional arguments are supported. +.sp +.IP "\fB\-helpfile\fP \fIfilename\fP" +Specifies a helpfile to use other than the default. +.IP \fB\-bothshown\fP +Allows both the manual page and manual directory to be on the screen at +the same time. +.IP \fB\-notopbox\fP +Starts without the Top Menu with the three buttons in it. +.IP "\fB\-geometry\fP \fIWxH+X+Y\fP" +Sets the size and location of the Top Menu with the three buttons in it. +.IP "\fB\-pagesize\fP \fIWxH+X+Y\fP" +Sets the size and location of all the Manual Pages. +.SH "CUSTOMIZING XMAN" +.PP +.I Xman +allows customization of both the directories to be searched for manual pages, +and the name that each directory will map to in the \fISections\fP +menu. Xman determines which directories it will +search by reading the \fIMANPATH\fP environment variable. If no +\fIMANPATH\fP is found then the directory is /usr/man is searched on +POSIX systems. This environment +is expected to be a colon-separated list of directories for xman to search. +.sp +.nf +setenv MANPATH /mit/kit/man:/usr/man +.fi +.PP +By default, +.I xman +will search each of the following directories (in each of the directories +specified in the users MANPATH) for manual pages. If manual pages exist +in that directory then they are added to list of manual pages for +the corresponding menu item. +A menu item is only displayed for those sections that actually contain +manual pages. +.ta 1.5i +.nf + +Directory Section Name +--------- ------------ +man1 (1) User Commands +man2 (2) System Calls +man3 (3) Subroutines +man4 (4) Devices +man5 (5) File Formats +man6 (6) Games +man7 (7) Miscellaneous +man8 (8) Sys. Administration +manl (l) Local +mann (n) New +mano (o) Old + +.fi +For instance, a user has three directories in her manual path and each +contain a directory called \fIman3\fP. All these manual pages will appear +alphabetically sorted when the user selects the menu item called +\fI(3) Subroutines\fP. If there is no directory called \fImano\fP in +any of the directories in her MANPATH, or there are no manual pages +in any of the directories called \fImano\fP then no menu item will be +displayed for the section called \fI(o) Old\fP. +.SH "BSD AND LINUX SYSTEMS" +.PP +In newer BSD and Linux systems, \fIXman\fP will search for a file named +\fI/etc/man.conf\fP which will contain the list of directories containing +manual pages. See \fIman.conf\fP(5) for a complete description of the file +format. +.SH "THE MANDESC FILE" +.PP +By using the \fImandesc\fP file a user or system manager is able to +more closely control which manual pages will appear in each of the sections +represented by menu items in the \fISections\fP menu. This +functionality is only available on a section by section basis, and individual +manual pages may not be handled in this manner. +(Although generous use of +symbolic links \(em see \fIln\fP(1) \(em will allow +almost any configuration you can imagine.) +.PP +The format of the mandesc file is a character followed by a label. The +character determines which of the sections will be added under this label. +For instance suppose that you would like to create an extra menu item that +contains all programmer subroutines. This label should contain all manual +pages in both sections two and three. The \fImandesc\fP file +would look like this: +.nf + +2Programmer Subroutines +3Programmer Subroutines + +.fi +This will add a menu item to the \fISections\fP menu that would +bring up a listing of all manual pages in sections two and three of +the Programmers Manual. Since the label names are \fIexactly\fP the +same they will be added to the same section. Note, however, that the +original sections still exist. +.PP +If you want to completely ignore the default sections in a manual directory +then add the line: +.nf + +no default sections + +.fi +anywhere in your mandesc file. This keeps xman from searching +the default manual sections \fIIn that directory only\fP. As an example, +suppose you want to do the same thing as above, but you don't think that +it is useful to have the \fISystem Calls\fP or \fISubroutines\fP sections +any longer. You would need to duplicate the default entries, as well as +adding your new one. +.nf + +no default sections +1(1) User Commands +2Programmer Subroutines +3Programmer Subroutines +4(4) Devices +5(5) File Formats +6(6) Games +7(7) Miscellaneous +8(8) Sys. Administration +l(l) Local +n(n) New +o(o) Old + +.fi +Xman will read any section that is of the from \fIman<character>\fP, where +<character> is an upper or lower case letter (they are treated distinctly) or +a numeral (0-9). Be warned, however, that man(1) and catman(8) will +not search directories that are non-standard. +.SH WIDGETS +In order to specify resources, it is useful to know the hierarchy of +the widgets which compose \fIxman\fR. In the notation below, +indentation indicates hierarchical structure. The widget class name +is given first, followed by the widget instance name. +.sp +.nf +.ta .5i 1.0i 1.5i 2.0i 2.5i 3.0i 3.5i +Xman xman \fI(This widget is never used)\fP + TopLevelShell topBox + Form form + Label topLabel + Command helpButton + Command quitButton + Command manpageButton + TransientShell search + DialogWidgetClass dialog + Label label + Text value + Command manualPage + Command apropos + Command cancel + TransientShell pleaseStandBy + Label label + TopLevelShell manualBrowser + Paned Manpage_Vpane + Paned horizPane + MenuButton options + MenuButton sections + Label manualBrowser + Viewport directory + List directory + List directory + . + . (one for each section, + . created on the fly) + . + ScrollByLine manualPage + SimpleMenu optionMenu + SmeBSB displayDirectory + SmeBSB displayManualPage + SmeBSB help + SmeBSB search + SmeBSB showBothScreens + SmeBSB removeThisManpage + SmeBSB openNewManpage + SmeBSB showVersion + SmeBSB quit + SimpleMenu sectionMenu + SmeBSB <name of section> + . + . (one for each section) + . + TransientShell search + DialogWidgetClass dialog + Label label + Text value + Command manualPage + Command apropos + Command cancel + TransientShell pleaseStandBy + Label label + TransientShell likeToSave + Dialog dialog + Label label + Text value + Command yes + Command no + TopLevelShell help + Paned Manpage_Vpane + Paned horizPane + MenuButton options + MenuButton sections + Label manualBrowser + ScrollByLine manualPage + SimpleMenu optionMenu + SmeBSB displayDirectory + SmeBSB displayManualPage + SmeBSB help + SmeBSB search + SmeBSB showBothScreens + SmeBSB removeThisManpage + SmeBSB openNewManpage + SmeBSB showVersion + SmeBSB quit + +.fi +.SH "APPLICATION RESOURCES" +\fIxman\fP has the following application-specific resources which allow +customizations unique to \fIxman\fP. +.PP +.TP 18 +\fBmanualFontNormal\fP (Class \fBFont\fP) +The font to use for normal text in the manual pages. +.TP 18 +\fBmanualFontBold\fP (Class \fBFont\fP) +The font to use for bold text in the manual pages. +.TP 18 +\fBmanualFontItalic\fP (Class \fBFont\fP) +The font to use for italic text in the manual pages. +.TP 18 +\fBdirectoryFontNormal\fP (Class \fBFont\fP) +The font to use for the directory text. +.TP 18 +\fBbothShown\fP (Class \fBBoolean\fP) +Either `true' or `false,' specifies whether or not you want both the +directory and the manual page shown at start up. +.TP 18 +\fBdirectoryHeight\fP (Class \fBDirectoryHeight\fP) +The height in pixels of the directory, when the directory and the manual page +are shown simultaneously. +.TP 18 +\fBtopCursor\fP (Class \fBCursor\fP) +The cursor to use in the top box. +.TP 18 +\fBhelpCursor\fP (Class \fBCursor\fP) +The cursor to use in the help window. +.TP 18 +\fBmanpageCursor\fP (Class \fBCursor\fP) +The cursor to use in the manual page window. +.TP 18 +\fBsearchEntryCursor\fP (Class \fBCursor\fP) +The cursor to use in the search entry text widget. +.TP 18 +\fBpointerColor\fP (Class \fBForeground\fP) +This is the color of all the cursors (pointers) specified above. The +name was chosen to be compatible with xterm. +.TP 18 +\fBhelpFile\fP (Class \fBFile\fP) +Use this rather than the system default helpfile. +.TP 18 +\fBtopBox\fP (Class \fBBoolean\fP) +Either `true' or `false,' determines whether the top box (containing +the help, quit and manual page buttons) or a manual page is put on the screen +at start-up. The default is true. +.TP 18 +\fBverticalList\fP (Class \fBBoolean\fP) +Either `true' or `false,' determines whether the directory listing is +vertically or horizontally organized. The default is horizontal (false). +.SH "GLOBAL ACTIONS" +\fIXman\fP defines all user interaction through global actions. This allows +the user to modify the translation table of any widget, and bind any event +to the new user action. The list of actions supported by \fIxman\fP are: +.TP 1.5i +.B GotoPage(\fIpage\fB) +When used in a manual page display window this will allow the user to +move between a directory and manual page display. The \fIpage\fP argument can +be either \fBDirectory\fP or \fBManualPage\fP. +.TP 1.5i +.B Quit() +This action may be used anywhere, and will exit xman. +.TP 1.5i +.B Search(\fItype\fB, \fIaction\fB) +Only useful when used in a search popup, this action will cause the search +widget to perform the named search type on the string in the search popup's +value widget. This action will also pop down the search widget. The +\fItype\fP argument can be either \fBApropos\fP, \fBManpage\fP or +\fBCancel\fP. If an \fIaction\fP of \fBOpen\fP is specified then xman +will open a new manual page to display the results of the search, otherwise +xman will attempt to display the results in the parent of the search popup. +.TP 1.5i +.B PopupHelp() +This action may be used anywhere, and will popup the help widget. +.TP 1.5i +.B PopupSearch() +This action may be used anywhere except in a help window. It will cause +the search popup to become active and visible on the screen, allowing +the user search for a manual page. +.TP 1.5i +.B CreateNewManpage() +This action may be used anywhere, and will create a new manual page +display window. +.TP 1.5i +.B RemoveThisManpage() +This action may be used in any manual page or help display window. When +called it will remove the window, and clean up all resources +associated with it. +.TP 1.5i +.B SaveFormattedPage(\fIaction\fP) +This action can only be used in the \fBlikeToSave\fP popup widget, and +tells xman whether to \fBSave\fP or \fBCancel\fP a save of the +manual page that has just been formatted. +.TP 1.5i +.B ShowVersion() +This action may be called from any manual page or help display window, and +will cause the informational display line to show the current version +of xman. +.SH FILES +.IP "\fI<manpath directory>\fP/man<\fIcharacter\fP>" 2.5i +.IP "\fI<manpath directory>\fP/cat<\fIcharacter\fP>" +.IP "\fI<manpath directory>\fP/mandesc" +.IP __apploaddir__/Xman +specifies required resources. +.IP /tmp +.I Xman +creates temporary files in /tmp for all unformatted man pages and all apropos +searches. +.SH "SEE ALSO" +.IR X (__miscmansuffix__), +.IR man (1), +.IR apropos (1), +.IR catman (8), +.I "Athena Widget Set" +.SH ENVIRONMENT +.TP 1.5i +.B DISPLAY +the default host and display to use. +.TP 1.5i +.B MANPATH +the search path for manual pages. Directories are separated by +colons (e.g. /usr/man:/mit/kit/man:/foo/bar/man). +.TP 1.5i +.B XENVIRONMENT +to get the name of a resource file that overrides the global resources +stored in the RESOURCE_MANAGER property. +.TP 1.5i +.B XAPPLRESDIR +A string that will have ``Xman'' appended to it. This string will be +the full path name of a user app-defaults file to be merged into the +resource database after the system app-defaults file, and before +the resources that are attached to the display. +.br +See \fIX(__miscmansuffix__)\fP for a full statement of rights and permissions. +.SH AUTHORS +Chris Peterson, MIT X Consortium from the V10 version written by Barry +Shein formerly of Boston University. +Bug fixes and Linux support by Carlos A M dos Santos, for The XFree86 Project. |