aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/config/util
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2011-10-10 17:43:39 +0200
committerReinhard Tartler <siretart@tauware.de>2011-10-10 17:43:39 +0200
commitf4092abdf94af6a99aff944d6264bc1284e8bdd4 (patch)
tree2ac1c9cc16ceb93edb2c4382c088dac5aeafdf0f /nx-X11/config/util
parenta840692edc9c6d19cd7c057f68e39c7d95eb767d (diff)
downloadnx-libs-f4092abdf94af6a99aff944d6264bc1284e8bdd4.tar.gz
nx-libs-f4092abdf94af6a99aff944d6264bc1284e8bdd4.tar.bz2
nx-libs-f4092abdf94af6a99aff944d6264bc1284e8bdd4.zip
Imported nx-X11-3.1.0-1.tar.gznx-X11/3.1.0-1
Summary: Imported nx-X11-3.1.0-1.tar.gz Keywords: Imported nx-X11-3.1.0-1.tar.gz into Git repository
Diffstat (limited to 'nx-X11/config/util')
-rw-r--r--nx-X11/config/util/Imakefile168
-rw-r--r--nx-X11/config/util/Makefile.ini20
-rw-r--r--nx-X11/config/util/aminstall.sh74
-rw-r--r--nx-X11/config/util/bsdinst.sh168
-rw-r--r--nx-X11/config/util/buildos2.cmd1
-rw-r--r--nx-X11/config/util/ccmakedep.man142
-rw-r--r--nx-X11/config/util/checktree.c339
-rw-r--r--nx-X11/config/util/chownxterm.c79
-rw-r--r--nx-X11/config/util/cleanlinks.man29
-rw-r--r--nx-X11/config/util/cleanlinks.sh27
-rw-r--r--nx-X11/config/util/crayar.sh9
-rw-r--r--nx-X11/config/util/elistgen.hp202
-rw-r--r--nx-X11/config/util/elistgen.ibm220
-rw-r--r--nx-X11/config/util/elistgen.sun267
-rw-r--r--nx-X11/config/util/elistgen.usl221
-rw-r--r--nx-X11/config/util/gccmakedep.man126
-rw-r--r--nx-X11/config/util/gccmdep.cpp126
-rw-r--r--nx-X11/config/util/indir.cmd28
-rw-r--r--nx-X11/config/util/install.sh108
-rw-r--r--nx-X11/config/util/lndir.c391
-rw-r--r--nx-X11/config/util/lndir.man119
-rw-r--r--nx-X11/config/util/makedef.cmd620
-rw-r--r--nx-X11/config/util/makeg.man64
-rw-r--r--nx-X11/config/util/makeg.sh13
-rw-r--r--nx-X11/config/util/makestrs.c752
-rw-r--r--nx-X11/config/util/makestrs.man219
-rw-r--r--nx-X11/config/util/mdepend.cpp286
-rw-r--r--nx-X11/config/util/mergelib.cpp105
-rw-r--r--nx-X11/config/util/mergelib.man28
-rw-r--r--nx-X11/config/util/mkdirhier.c80
-rw-r--r--nx-X11/config/util/mkdirhier.cmd54
-rw-r--r--nx-X11/config/util/mkdirhier.man42
-rw-r--r--nx-X11/config/util/mkdirhier.sh67
-rw-r--r--nx-X11/config/util/mkhtmlindex.man32
-rw-r--r--nx-X11/config/util/mkhtmlindex.pl103
-rw-r--r--nx-X11/config/util/mkhtmlindex.sh60
-rw-r--r--nx-X11/config/util/mkshadow/Imakefile5
-rw-r--r--nx-X11/config/util/mkshadow/README38
-rw-r--r--nx-X11/config/util/mkshadow/mkshadow.c378
-rw-r--r--nx-X11/config/util/mkshadow/savedir.c119
-rw-r--r--nx-X11/config/util/mkshadow/wildmat.c167
-rw-r--r--nx-X11/config/util/printver.c29
-rw-r--r--nx-X11/config/util/revpath.c47
-rw-r--r--nx-X11/config/util/revpath.man45
-rw-r--r--nx-X11/config/util/syminst.sh90
-rw-r--r--nx-X11/config/util/x11mf.sh28
-rw-r--r--nx-X11/config/util/xmake.cmd5
-rw-r--r--nx-X11/config/util/xmkmf.cpp70
-rw-r--r--nx-X11/config/util/xmkmf.man89
49 files changed, 6499 insertions, 0 deletions
diff --git a/nx-X11/config/util/Imakefile b/nx-X11/config/util/Imakefile
new file mode 100644
index 000000000..016751d06
--- /dev/null
+++ b/nx-X11/config/util/Imakefile
@@ -0,0 +1,168 @@
+XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:41:52 cpqbld Exp $
+
+
+
+XCOMM $XFree86: xc/config/util/Imakefile,v 3.49 2003/10/21 17:41:45 tsi Exp $
+
+CCMDEP_PROG = ccmakedep
+
+#ifdef ExportListGenSource
+EXPORTLISTGEN = exportlistgen
+#endif
+
+#if defined(Win32Architecture) && !defined(CrossCompiling)
+CMKDIRHIER = mkdirhier.exe
+#endif
+
+GCCMDEP_PROG = gccmakedep
+
+#if HasSymLinks
+#if CrossCompiling
+LNDIR_PROG = HostProgramTargetName(lndir)
+#else
+LNDIR_PROG = ProgramTargetName(lndir)
+#endif
+#endif
+
+#if CrossCompiling
+MAKESTRS_PROG = HostProgramTargetName(makestrs)
+REVPATH_PROG = HostProgramTargetName(revpath)
+#else
+MAKESTRS_PROG = ProgramTargetName(makestrs)
+REVPATH_PROG = ProgramTargetName(revpath)
+#endif
+
+#if BuildRman
+RMAN_PROG = HostProgramTargetName(rman)
+#endif
+
+PROGRAMS = $(RMAN_PROG) $(LNDIR_PROG) $(MAKESTRS_PROG) \
+ $(REVPATH_PROG) $(EXPORTLISTGEN) $(CMKDIRHIER)
+DEPLIBS =
+#ifndef Win32Architecture
+ EXTRA_LIBRARIES =
+#endif
+#ifdef LinuxArchitecture
+ PREPROCESSCMD_MKDEPEND = PreProcessCmd StandardCppDefines $(PROJECT_DEFINES)
+#else
+ PREPROCESSCMD_MKDEPEND = $(PREPROCESSCMD)
+#endif
+
+XCOMM Some compilers generate fatal errors if an -L directory does
+XCOMM not exist. Since BUILDLIBDIR may not exist yet suppress its use.
+ LDPRELIB =
+ LDPRELIBS =
+#if CrossCompiling
+ LDPOSTLIBS =
+ LDPOSTLIB =
+#endif
+
+all:: xmkmf mergelib $(CCMDEP_PROG) $(GCCMDEP_PROG) $(PROGRAMS)
+
+makedependonly:: $(CCMDEP_PROG) $(GCCMDEP_PROG)
+
+#if HasGcc
+GCCCMD = $(CC)
+#else
+GCCCMD = gcc
+#endif
+
+#if CrossCompiling
+includes:: HostProgramTargetName(makestrs)
+#else
+includes:: ProgramTargetName(makestrs)
+#endif
+
+#ifdef ExportListGenSource
+CppScriptTarget(exportlistgen,ExportListGenSource,-DCXXFILT=$(CXXFILT),)
+InstallNamedProg(exportlistgen,exportlistgen,$(BINDIR))
+#endif
+
+CppScriptTarget(xmkmf,xmkmf.cpp,-DCONFIGDIRSPEC='"'"-I$(CONFIGDIR)"'"',$(ICONFIGFILES))
+CppScriptTarget(ccmakedep,mdepend.cpp,-DPREPROC='"'"$(PREPROCESSCMD_MKDEPEND)"'"',$(ICONFIGFILES))
+CppScriptTarget(mergelib,mergelib.cpp,"-DARCMD=$(AR)" "-DRANLIB=$(RANLIB)",$(ICONFIGFILES))
+CppScriptTarget(gccmakedep,gccmdep.cpp,-DCCCMD='"'"$(GCCCMD)"'"' -DRMCMD='"'"$(RM)"'"' -DLNCMD='"'"$(LN)"'"' -DMVCMD='"'"$(MV)"'"',$(ICONFIGFILES))
+
+#ifndef OpenBSDArchitecture
+#if HasSymLinks
+#if CrossCompiling
+SimpleHostProgramTarget_2(lndir)
+#else
+AllTarget(lndir)
+SimpleProgramTarget_2(lndir)
+#endif
+#endif
+#endif
+
+#if defined(Win32Architecture) && !defined(CrossCompiling)
+AllTarget(ProgramTargetName(mkdirhier))
+SimpleProgramTarget_3(mkdirhier)
+#endif
+
+#if CrossCompiling
+AllTarget(HostProgramTargetName(makestrs))
+SimpleHostProgramTarget_1(makestrs)
+AllTarget(HostProgramTargetName(revpath))
+SimpleHostProgramTarget_4(revpath)
+#else
+AllTarget(ProgramTargetName(makestrs))
+SimpleProgramTarget_1(makestrs)
+AllTarget(ProgramTargetName(revpath))
+SimpleProgramTarget_4(revpath)
+#endif
+
+#if BuildRman
+rmanonly:: $(RMAN_PROG)
+
+VOLLIST="1:2:3:4:5:6:7:8:9:o:l:n:p"
+MANTITLEPRINTF="%s(%s) manual page"
+MANREFPRINTF="%s.%s.html"
+RMANVERSION="3.0.8+X.Org"
+#if CrossCompiling
+AllTarget(HostProgramTargetName(rman))
+SimpleHostProgramTarget_3(rman)
+#else
+AllTarget(ProgramTargetName(rman))
+SimpleProgramTarget_5(rman)
+#endif
+SpecialCObjectRule(rman,NullParameter,-DVOLLIST='$(VOLLIST)' -DMANTITLEPRINTF='$(MANTITLEPRINTF)' -DMANREFPRINTF='$(MANREFPRINTF)' -DPOLYGLOTMANVERSION='$(RMANVERSION)' -DXOrg)
+LinkSourceFile(rman.c,$(TOP)/extras/rman)
+LinkFile(rman.man,$(TOP)/extras/rman/rman.1)
+#endif
+
+InstallManPage(xmkmf,$(MANDIR))
+
+InstallNamedProg(xmkmf,xmkmf,$(BINDIR))
+InstallNamedProg(mkdirhier.sh,mkdirhier,$(BINDIR))
+InstallManPage(mkdirhier,$(MANDIR))
+InstallNamedProg(gccmakedep,gccmakedep,$(BINDIR))
+InstallManPage(gccmakedep,$(MANDIR))
+#if defined(QNX4Architecture) || defined(NTOArchitecture)
+InstallNamedProg(install.sh,install,$(BINDIR))
+#endif
+InstallDriverSDKNamedProg(mkdirhier.sh,mkdirhier.sh,$(DRIVERSDKDIR)/config/util)
+InstallDriverSDKNamedProg(gccmakedep,gccmakedep,$(DRIVERSDKDIR)/config/util)
+InstallNamedProg(mergelib,mergelib,$(BINDIR))
+InstallManPage(mergelib,$(MANDIR))
+InstallNamedProg(makeg.sh,makeg,$(BINDIR))
+InstallManPage(makeg,$(MANDIR))
+InstallNamedProg(cleanlinks.sh,cleanlinks,$(BINDIR))
+InstallManPage(cleanlinks,$(MANDIR))
+#if HasPerl
+InstallNamedProg(mkhtmlindex.pl,mkhtmlindex,$(BINDIR))
+#else
+InstallNamedProg(mkhtmlindex.sh,mkhtmlindex,$(BINDIR))
+#endif
+InstallManPage(mkhtmlindex,$(MANDIR))
+InstallNamedProg(ccmakedep,ccmakedep,$(BINDIR))
+InstallManPage(ccmakedep,$(MANDIR))
+InstallDriverSDKNamedProg(ccmakedep,ccmakedep,$(DRIVERSDKDIR)/config/util)
+#if SystemV || SystemV4
+InstallNamedProg(bsdinst.sh,bsdinst,$(BINDIR))
+InstallDriverSDKNamedProg(bsdinst.sh,bsdinst.sh,$(DRIVERSDKDIR)/config/util)
+#endif
+
+InstallDriverSDKNamedProg(revpath,revpath,$(DRIVERSDKDIR)/config/util)
+#ifdef OS2Architecture
+InstallNamedProg(makedef.cmd,makedef.cmd,$(BINDIR))
+#endif
diff --git a/nx-X11/config/util/Makefile.ini b/nx-X11/config/util/Makefile.ini
new file mode 100644
index 000000000..17d8d74d6
--- /dev/null
+++ b/nx-X11/config/util/Makefile.ini
@@ -0,0 +1,20 @@
+# $Xorg: Makefile.ini,v 1.3 2000/08/17 19:41:52 cpqbld Exp $
+#
+# A way to get lndir built the first time, before you have imake up
+# and running. You may well have to specify OSFLAGS=-D<something> to
+# get it to compile, which values are embedded in config files. What
+# you would pass as BOOTSTRAPCFLAGS might work.
+
+OSFLAGS =
+CC = cc
+CDEBUGFLAGS = -O
+INCLUDES = -I.
+CFLAGS = $(OSFLAGS) $(CDEBUGFLAGS) $(INCLUDES)
+SHELL = /bin/sh
+RM = rm -f
+LN = ln -s
+
+lndir:
+ $(LN) ../../include X11
+ $(CC) -o lndir $(CFLAGS) lndir.c
+ $(RM) X11
diff --git a/nx-X11/config/util/aminstall.sh b/nx-X11/config/util/aminstall.sh
new file mode 100644
index 000000000..19a8a4d5a
--- /dev/null
+++ b/nx-X11/config/util/aminstall.sh
@@ -0,0 +1,74 @@
+#!/bin/sh
+# $Xorg: aminstall.sh,v 1.3 2000/08/17 19:41:52 cpqbld Exp $
+# aminstall - transfer cross-compiled files to system running Amoeba.
+# Usage: aminstall binary-directory [-s stksz] unix-source amoeba-dest
+
+#
+# Default soap mask for files
+#
+SPMASK=0xFF:2:2
+export SPMASK
+PROG=$0
+USAGE="Usage: $PROG binary-directory unix-source amoeba-dest"
+
+#
+# Argument check
+#
+case $# in
+3|5) ;;
+*) echo $USAGE >&2
+ exit 1
+ ;;
+esac
+
+bindir=$1
+stksz=
+case $2 in
+-s) if [ $# -ne 5 ]
+ then
+ echo $USAGE >&2
+ exit 1
+ fi
+ stksz="-s $3"
+ shift
+ shift
+ ;;
+esac
+
+unxfile=$2
+dest=$3
+
+#
+# Change /public .... into /super (just for installation)
+#
+stripped=`echo $dest | sed 's:^/public::'`
+if [ X$dest != X$stripped ]; then
+ dest=/super$stripped
+fi
+
+#
+# If the file already exists, then delete it
+#
+INFO=`$bindir/std_info $dest 2>&1`
+case $INFO in
+*"not found"*) ;;
+*failed*) ;;
+*bytes*) $bindir/del -f $dest
+ ;;
+/??????) echo $PROG: cannot install over directory 1>&2
+ exit
+ ;;
+*) $bindir/del -d $dest
+ ;;
+esac
+
+#
+# Transfer the file to Amoeba
+#
+$bindir/../bin.scripts/ainstall $stksz $unxfile $dest > /dev/null 2>&1
+if [ $? -ne 0 ]
+then
+ echo "This is not binary - using tob"
+ $bindir/tob $unxfile $dest
+fi
+
diff --git a/nx-X11/config/util/bsdinst.sh b/nx-X11/config/util/bsdinst.sh
new file mode 100644
index 000000000..fc2673c13
--- /dev/null
+++ b/nx-X11/config/util/bsdinst.sh
@@ -0,0 +1,168 @@
+#!/bin/sh
+
+# $XFree86: xc/config/util/bsdinst.sh,v 3.3 1996/12/23 05:56:13 dawes Exp $
+#
+# This accepts bsd-style install arguments and makes the appropriate calls
+# to the System V install.
+# $Xorg: bsdinst.sh,v 1.3 2000/08/17 19:41:52 cpqbld Exp $
+
+flags=""
+dst=""
+src=""
+dostrip=""
+owner=""
+group=""
+mode=""
+bargs=$*
+
+while [ x$1 != x ]; do
+ case $1 in
+ -c) shift
+ continue;;
+
+ -m) flags="$flags $1 $2 "
+ mode="$2"
+ shift
+ shift
+ continue;;
+
+ -o) flags="$flags -u $2 "
+ owner="$2"
+ shift
+ shift
+ continue;;
+
+ -g) flags="$flags $1 $2 "
+ group="$2"
+ shift
+ shift
+ continue;;
+
+ -s) dostrip="strip"
+ shift
+ continue;;
+
+ *) if [ x$src = x ]
+ then
+ src=$1
+ else
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x$src = x ]
+then
+ echo "$0: no input file specified"
+ exit 1
+fi
+
+if [ x$dst = x ]
+then
+ echo "$0: no destination specified"
+ exit 1
+fi
+
+if [ -x /usr/ucb/install ]
+then
+ if [ -d "$dst" ]
+ then
+ dst=$dst/`basename "$src"`
+ fi
+ case "$group" in
+ "")
+ bargs="-g other $bargs"
+ ;;
+ esac
+ /usr/ucb/install $bargs
+ if [ x$dostrip = xstrip -a -x /usr/bin/mcs ]
+ then
+ /usr/bin/mcs -d $dst
+ fi
+ exit 0
+fi
+
+case "$mode" in
+"")
+ ;;
+*)
+ case "$owner" in
+ "")
+ flags="$flags -u root"
+ ;;
+ esac
+ ;;
+esac
+
+
+# set up some variable to be used later
+
+rmcmd=""
+srcdir="."
+
+# if the destination isn't a directory we'll need to copy it first
+
+if [ ! -d $dst ]
+then
+ dstbase=`basename $dst`
+ cp $src /tmp/$dstbase
+ rmcmd="rm -f /tmp/$dstbase"
+ src=$dstbase
+ srcdir=/tmp
+ dst="`echo $dst | sed 's,^\(.*\)/.*$,\1,'`"
+ if [ x$dst = x ]
+ then
+ dst="."
+ fi
+fi
+
+
+# If the src file has a directory, copy it to /tmp to make install happy
+
+srcbase=`basename $src`
+
+if [ "$src" != "$srcbase" ] && [ "$src" != "./$srcbase" ]
+then
+ cp $src /tmp/$srcbase
+ src=$srcbase
+ srcdir=/tmp
+ rmcmd="rm -f /tmp/$srcbase"
+fi
+
+# do the actual install
+
+if [ -f /usr/sbin/install ]
+then
+ installcmd=/usr/sbin/install
+elif [ -f /etc/install ]
+then
+ installcmd=/etc/install
+else
+ installcmd=install
+fi
+
+# This rm is commented out because some people want to be able to
+# install through symbolic links. Uncomment it if it offends you.
+# rm -f $dst/$srcbase
+(cd $srcdir ; $installcmd -f $dst $flags $src)
+
+if [ x$dostrip = xstrip ]
+then
+ strip $dst/$srcbase
+ if [ -x /usr/bin/mcs ]
+ then
+ /usr/bin/mcs -d $dst/$srcbase
+ fi
+fi
+
+if [ x$mode != x ]
+then
+ chmod $mode $dst/$srcbase
+fi
+
+# and clean up
+
+$rmcmd
+
diff --git a/nx-X11/config/util/buildos2.cmd b/nx-X11/config/util/buildos2.cmd
new file mode 100644
index 000000000..cd5baa24f
--- /dev/null
+++ b/nx-X11/config/util/buildos2.cmd
@@ -0,0 +1 @@
+make CC="gcc -D__UNIXOS2__" BOOTSTRAPCFLAGS=-Zexe World 2>&1 | tee World.log
diff --git a/nx-X11/config/util/ccmakedep.man b/nx-X11/config/util/ccmakedep.man
new file mode 100644
index 000000000..20d9e82f8
--- /dev/null
+++ b/nx-X11/config/util/ccmakedep.man
@@ -0,0 +1,142 @@
+.TH ccmakedep 1 __xorgversion__
+.SH NAME
+ccmakedep \- create dependencies in makefiles using a C compiler
+.SH SYNOPSIS
+.B ccmakedep
+[
+.BI cpp-flags
+] [
+.BI \-w width
+] [
+.BI \-s magic-string
+] [
+.BI \-f makefile
+] [
+.BI \-o object-suffix
+] [
+.B \-v
+] [
+.B \-a
+] [
+.BI \-cc compiler
+] [
+\-\^\-
+.I options
+\-\^\-
+]
+.I sourcefile
+\^.\|.\|.
+.SH DESCRIPTION
+The
+.B ccmakedep
+program calls a C compiler to preprocess each
+.IR sourcefile ,
+and uses the output to construct
+.I makefile
+rules describing their dependencies.
+These rules instruct
+.BR make (1)
+on which object files must be recompiled when a dependency has changed.
+.PP
+By default,
+.B ccmakedep
+places its output in the file named
+.I makefile
+if it exists, otherwise
+.I Makefile.
+An alternate makefile may be specified with the
+.B \-f
+option.
+It first searches the makefile for a line beginning with
+.sp
+\& # DO NOT DELETE
+.sp
+or one provided with the
+.B \-s
+option, as a delimiter for the dependency output.
+If it finds it, it will delete everything following this up to the end of
+the makefile and put the output after this line.
+If it doesn't find it, the program will append the string to the makefile
+and place the output after that.
+.SH EXAMPLE
+Normally,
+.B ccmakedep
+will be used in a makefile target so that typing 'make depend' will bring
+the dependencies up to date for the makefile.
+For example,
+.nf
+ SRCS\0=\0file1.c\0file2.c\0.\|.\|.
+ CFLAGS\0=\0\-O\0\-DHACK\0\-I\^.\^.\^/foobar\0\-xyz
+ depend:
+ ccmakedep\0\-\^\-\0$(CFLAGS)\0\-\^\-\0$(SRCS)
+.fi
+.SH OPTIONS
+The program will ignore any option that it does not understand, so you may
+use the same arguments that you would for
+.BR cc (1),
+including
+.B \-D
+and
+.B \-U
+options to define and undefine symbols and
+.B \-I
+to set the include path.
+.TP
+.B \-a
+Append the dependencies to the file instead of replacing existing
+dependencies.
+.TP
+.BI \-cc compiler
+Use this compiler to generate dependencies.
+.TP
+.BI \-f makefile
+Filename.
+This allows you to specify an alternate makefile in which
+.B ccmakedep
+can place its output.
+Specifying \(lq\-\(rq as the file name (that is,
+.BR \-f\- )
+sends the output to standard output instead of modifying an existing file.
+.TP
+.BI \-s string
+Starting string delimiter.
+This option permits you to specify a different string for
+.B ccmakedep
+to look for in the makefile.
+The default is \(lq# DO NOT DELETE\(rq.
+.TP
+.BI \-v
+Be verbose: display the C compiler command before running it.
+.TP
+.BI \-\^\- " options " \-\^\-
+If
+.B ccmakedep
+encounters a double hyphen (\-\^\-) in the argument list, then any
+unrecognized arguments following it will be silently ignored.
+A second double hyphen terminates this special treatment.
+In this way,
+.B ccmakedep
+can be made to safely ignore esoteric compiler arguments that might
+normally be found in a CFLAGS
+.B make
+macro (see the
+.B EXAMPLE
+section above).
+.BR \-D ,
+.BR \-I ,
+and
+.B \-U
+options appearing between the pair of double hyphens are still processed
+normally.
+.SH "SEE ALSO"
+.BR cc (1),
+.BR make (1),
+.BR makedepend (1),
+.BR ccmakedep (1).
+.SH AUTHOR
+.B ccmakedep
+was written by the X Consortium.
+.PP
+Colin Watson wrote this manual page, originally for the Debian Project,
+based partly on the manual page for
+.BR makedepend (1).
diff --git a/nx-X11/config/util/checktree.c b/nx-X11/config/util/checktree.c
new file mode 100644
index 000000000..8bebdc5a3
--- /dev/null
+++ b/nx-X11/config/util/checktree.c
@@ -0,0 +1,339 @@
+/* $Xorg: checktree.c,v 1.4 2001/02/09 02:03:16 xorgcvs Exp $ */
+
+/*
+
+Copyright (c) 1993, 1998 The Open Group
+
+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.
+*/
+/* $XFree86: xc/config/util/checktree.c,v 1.3 2001/07/29 05:01:10 tsi Exp $ */
+
+#include <X11/Xos.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/param.h>
+#include <errno.h>
+
+#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 S_IFLNK
+#define Stat lstat
+#else
+#define Stat stat
+#endif
+
+#define CHARSALLOWED \
+"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_."
+
+#define fmode_bits_minset 0444
+#define fmode_bits_maxset 0777
+#define fmode_bits_write 0222
+#define dmode_bits_minset 0775
+
+int dorcs = 1; /* check RCS file */
+int do83 = 1; /* check for 8+3 clash */
+int doro = 1; /* disallow writable (checked out) files */
+int dodot = 1; /* disallow .files */
+int dotwiddle = 1; /* disallow file~ */
+
+int dontcare(fn)
+ char *fn;
+{
+ char *cp;
+
+ if (fn[strlen(fn) - 1] == '~')
+ return 1;
+ cp = strrchr(fn, '.');
+ return cp && (!strcmp(cp + 1, "Z") || !strcmp(cp + 1, "PS"));
+}
+
+checkfile(fullname, fn, fs)
+ char *fullname, *fn;
+ struct stat *fs;
+{
+ char *cp;
+ int maxlen = 12;
+ int len, mode;
+
+ if (dodot && fn[0] == '.') {
+ printf("dot file: %s\n", fullname);
+ return;
+ }
+ for (len = 0, cp = fn; *cp; len++, cp++) {
+ if (!strchr(CHARSALLOWED, *cp)) {
+ if (dotwiddle || *cp != '~' || cp[1])
+ printf ("bad character: %s\n", fullname);
+ break;
+ }
+ }
+ if (len > maxlen && !dontcare(fn))
+ printf("too long (%d): %s\n", len, fullname);
+#ifdef S_IFLNK
+ if ((fs->st_mode & S_IFLNK) == S_IFLNK) {
+ printf("symbolic link: %s\n", fullname);
+ return;
+ }
+#endif
+ mode = fs->st_mode & (~S_IFMT);
+ if ((fs->st_mode & S_IFDIR) == S_IFDIR) {
+ maxlen = 14;
+ if ((mode & dmode_bits_minset) != dmode_bits_minset)
+ printf("directory mode 0%o not minimum 0%o: %s\n",
+ mode, dmode_bits_minset, fullname);
+ } else if ((fs->st_mode & S_IFREG) != S_IFREG)
+ printf("not a regular file: %s\n", fullname);
+ else {
+ if ((mode & fmode_bits_minset) != fmode_bits_minset)
+ printf("file mode 0%o not minimum 0%o: %s\n",
+ fs->st_mode, fmode_bits_minset, fullname);
+ if (fs->st_nlink != 1)
+ printf("%d links instead of 1: %s\n", fs->st_nlink, fullname);
+ if (doro && (mode & fmode_bits_write) && !dontcare(fn))
+ printf("writable: %s\n", fullname);
+ }
+ if ((mode & ~fmode_bits_maxset) != 0)
+ printf("mode 0%o outside maximum set 0%o: %s\n",
+ mode, fmode_bits_maxset, fullname);
+}
+
+void
+checkrcs(dir, p)
+ char *dir;
+ char *p;
+{
+ DIR *df;
+ struct dirent *dp;
+ struct stat fs;
+ int i;
+
+ if (!(df = opendir(dir))) {
+ fprintf(stderr, "cannot open: %s\n", dir);
+ return;
+ }
+ while (dp = readdir(df)) {
+ i = strlen(dp->d_name);
+ if (dp->d_name[i - 1] == 'v' && dp->d_name[i - 2] == ',') {
+ strcpy(p, dp->d_name);
+ p[i - 2] = '\0';
+ if (Stat(dir, &fs) < 0) {
+ strcpy(p, "RCS/");
+ strcat(p, dp->d_name);
+ printf("not used: %s\n", dir);
+ }
+ }
+ }
+ closedir(df);
+}
+
+int
+Strncmp(cp1, cp2, n)
+ char *cp1, *cp2;
+ int n;
+{
+ char c1, c2;
+
+ for (; --n >= 0 && *cp1 && *cp2; cp1++, cp2++) {
+ if (*cp1 != *cp2) {
+ c1 = *cp1;
+ c2 = *cp2;
+ if (c1 >= 'A' && c1 <= 'Z')
+ c1 += 'a' - 'A';
+ else if (c1 == '-')
+ c1 = '_';
+ if (c2 >= 'A' && c2 <= 'Z')
+ c2 += 'a' - 'A';
+ else if (c2 == '-')
+ c2 = '_';
+ if (c1 != c2)
+ return (int)c1 - (int)c2;
+ }
+ }
+ if (n < 0)
+ return 0;
+ return (int)*cp1 - (int)*cp2;
+}
+
+int
+fncomp(n1, n2)
+ char **n1, **n2;
+{
+ int i, res;
+ char *cp1, *cp2;
+ char c1, c2;
+
+ i = Strncmp(*n1, *n2, 8);
+ if (!i) {
+ cp1 = strrchr(*n1, '.');
+ cp2 = strrchr(*n2, '.');
+ if (cp1 || cp2) {
+ if (!cp1)
+ return -1;
+ if (!cp2)
+ return 1;
+ i = Strncmp(cp1 + 1, cp2 + 1, 3);
+ }
+ }
+ return i;
+}
+
+void
+checkdir(dir)
+ char *dir;
+{
+ DIR *df;
+ struct dirent *dp;
+ char *p;
+ struct stat fs;
+ char *s, **names;
+ int i, max;
+
+ if (!(df = opendir(dir))) {
+ fprintf(stderr, "cannot open: %s\n", dir);
+ return;
+ }
+ p = dir + strlen(dir);
+ if (p[-1] != '/')
+ *p++ = '/';
+ i = 0;
+ max = 0;
+ names = NULL;
+ while (dp = readdir(df)) {
+ strcpy(p, dp->d_name);
+ if (Stat(dir, &fs) < 0) {
+ perror(dir);
+ continue;
+ }
+ if ((fs.st_mode & S_IFDIR) == S_IFDIR) {
+ if (dp->d_name[0] == '.' &&
+ (dp->d_name[1] == '\0' || (dp->d_name[1] == '.' &&
+ dp->d_name[2] == '\0')))
+ continue;
+ if (!strcmp (dp->d_name, "RCS")) {
+ if (dorcs)
+ checkrcs(dir, p);
+ continue;
+ }
+ if (!strcmp (dp->d_name, "SCCS"))
+ continue;
+ if (!strcmp (dp->d_name, "CVS.adm"))
+ continue;
+ checkfile(dir, p, &fs);
+ checkdir(dir);
+ continue;
+ }
+ checkfile(dir, p, &fs);
+ if (dorcs && !dontcare(dp->d_name)) {
+ strcpy(p, "RCS/");
+ strcat(p, dp->d_name);
+ strcat(p, ",v");
+ if (Stat(dir, &fs) < 0) {
+ strcpy(p, dp->d_name);
+ printf("no RCS: %s\n", dir);
+ }
+ }
+ if (do83) {
+ s = (char *)malloc(strlen(dp->d_name) + 1);
+ strcpy(s, dp->d_name);
+ if (i >= max) {
+ max += 25;
+ if (names)
+ names = (char **)realloc((char *)names,
+ (max + 1) * sizeof(char *));
+ else
+ names = (char **)malloc((max + 1) * sizeof(char *));
+ }
+ names[i++] = s;
+ }
+ }
+ closedir(df);
+ if (do83) {
+ qsort((char *)names, i, sizeof(char *), fncomp);
+ max = i - 1;
+ *p = '\0';
+ for (i = 0; i < max; i++) {
+ if (!fncomp(&names[i], &names[i + 1]))
+ printf("8+3 clash: %s%s and %s\n",
+ dir, names[i], names[i + 1]);
+ free(names[i]);
+ }
+ if (names) {
+ free(names[i]);
+ free((char *)names);
+ }
+ }
+}
+
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ char buf[2048];
+
+ argc--;
+ argv++;
+ while (argc > 0) {
+ if (!strcmp(*argv, "-rcs")) {
+ dorcs = 0;
+ argc--;
+ argv++;
+ } else if (!strcmp(*argv, "-83")) {
+ do83 = 0;
+ argc--;
+ argv++;
+ } else if (!strcmp(*argv, "-ro")) {
+ doro = 0;
+ argc--;
+ argv++;
+ } else if (!strcmp(*argv, "-dot")) {
+ dodot = 0;
+ argc--;
+ argv++;
+ } else if (!strcmp(*argv, "-twiddle")) {
+ dotwiddle = 0;
+ argc--;
+ argv++;
+ } else
+ break;
+ }
+ if (!argc) {
+ strcpy(buf, ".");
+ checkdir(buf);
+ } else
+ while (--argc >= 0) {
+ strcpy(buf, *argv++);
+ checkdir(buf);
+ }
+}
diff --git a/nx-X11/config/util/chownxterm.c b/nx-X11/config/util/chownxterm.c
new file mode 100644
index 000000000..868f99c3d
--- /dev/null
+++ b/nx-X11/config/util/chownxterm.c
@@ -0,0 +1,79 @@
+/* $Xorg: chownxterm.c,v 1.4 2001/02/09 02:03:16 xorgcvs Exp $ */
+/*
+
+Copyright (c) 1993, 1994, 1998 The Open Group
+
+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.
+
+*/
+
+/*
+ * chownxterm --- make xterm suid root
+ *
+ * By Stephen Gildea, December 1993
+ */
+
+
+#define XTERM_PATH "/x11/programs/xterm/xterm"
+
+#include <stdio.h>
+#include <errno.h>
+
+char *prog_name;
+
+void help()
+{
+ if (setgid(getgid()) == -1)
+ exit(1);
+ if (setuid(getuid()) == -1)
+ exit(1);
+ printf("chown-xterm makes %s suid root\n", XTERM_PATH);
+ printf("This is necessary on Ultrix for /dev/tty operation.\n");
+ exit(0);
+}
+
+void print_error(err_string)
+ char *err_string;
+{
+ if (setgid(getgid()) == -1)
+ exit(1);
+ if (setuid(getuid()) == -1)
+ exit(1);
+ fprintf(stderr, "%s: \"%s\"", prog_name, err_string);
+ perror(" failed");
+ exit(1);
+}
+
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ prog_name = argv[0];
+ if (argc >= 2 && strcmp(argv[1], "-help") == 0) {
+ help();
+ } else {
+ if (chown(XTERM_PATH, 0, -1) != 0)
+ print_error("chown root " XTERM_PATH);
+ if (chmod(XTERM_PATH, 04555) != 0)
+ print_error("chmod 4555 " XTERM_PATH);
+ }
+ exit(0);
+}
diff --git a/nx-X11/config/util/cleanlinks.man b/nx-X11/config/util/cleanlinks.man
new file mode 100644
index 000000000..d550ef5a4
--- /dev/null
+++ b/nx-X11/config/util/cleanlinks.man
@@ -0,0 +1,29 @@
+.TH cleanlinks 1 __vendorversion__
+.SH NAME
+cleanlinks \- remove dangling symbolic links and empty directories
+.SH SYNOPSIS
+.B cleanlinks
+.SH DESCRIPTION
+The
+.I cleanlinks
+program searches the directory tree descended from the current directory for
+symbolic links whose targets do not exist, and removes them.
+It then removes all empty directories in that directory tree.
+.PP
+.I cleanlinks
+is useful for cleaning up a shadow link tree created with
+.BR lndir (1)
+after files have been removed from the real directory.
+.SH DIAGNOSTICS
+A message will be printed upon encountering each dangling symlink and empty
+directory.
+.SH SEE ALSO
+.BR lndir (1).
+.SH AUTHOR
+.PP
+The version of the
+.I cleanlinks
+included in this X.Org Foundation release was originally written
+by David Dawes wrote as a part of XFree86.
+.PP
+Colin Watson wrote this manual page, originally for the Debian Project.
diff --git a/nx-X11/config/util/cleanlinks.sh b/nx-X11/config/util/cleanlinks.sh
new file mode 100644
index 000000000..4e1a8ead9
--- /dev/null
+++ b/nx-X11/config/util/cleanlinks.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Copyright © 2000, 2003 by The XFree86 Project, Inc
+#
+# Remove dangling symlinks and empty directories from a shadow link tree
+# (created with lndir).
+#
+# Author: David Dawes <dawes@xfree86.org>
+#
+# $XFree86: xc/config/util/cleanlinks.sh,v 1.2 2003/04/15 03:05:16 dawes Exp $
+
+find . -type l -print |
+(
+ read i
+ while [ X"$i" != X ]; do
+ if [ ! -f "$i" ]; then
+ echo $i is a dangling symlink, removing
+ rm -f "$i"
+ fi
+ read i
+ done
+)
+
+echo Removing empty directories ...
+#find . -type d -depth -print | xargs rmdir > /dev/null 2>&1
+find . -type d -depth -empty -print -exec rmdir {} \;
+exit 0
diff --git a/nx-X11/config/util/crayar.sh b/nx-X11/config/util/crayar.sh
new file mode 100644
index 000000000..6296de51d
--- /dev/null
+++ b/nx-X11/config/util/crayar.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+lib=$1
+shift
+if cray2; then
+ bld cr $lib `lorder $* | tsort`
+else
+ ar clq $lib $*
+fi
+
diff --git a/nx-X11/config/util/elistgen.hp b/nx-X11/config/util/elistgen.hp
new file mode 100644
index 000000000..fe22e794e
--- /dev/null
+++ b/nx-X11/config/util/elistgen.hp
@@ -0,0 +1,202 @@
+XCOMM!/bin/sh
+XCOMM $Xorg: elistgen.hp,v 1.3 2000/08/17 19:41:52 cpqbld Exp $
+XCOMM
+XCOMM #########################################################################
+XCOMM Construct shared-library export lists for HP-UX based on standardized
+XCOMM export list description file
+XCOMM
+XCOMM Usage: exportlistgen libfoo.sl libfoo.elist > libfoo.lopt
+XCOMM
+XCOMM libfoo.sl => shared library of interest
+XCOMM libfoo.elist => Meta description of necessary export list.
+XCOMM
+XCOMM The output may then be passed to the linker to reconstruct the
+XCOMM shared library. For unknown reasons naming only exported symbols
+XCOMM with "+e" does not work for debuggable C++ code, even though "nm"
+XCOMM reports no difference between the resulting libraries. The linker
+XCOMM complains that "first non-inline virtual function" is not defined for
+XCOMM vtables. We instead hide internal symbols with "-h" as a work-around.
+XCOMM
+XCOMM Author: Aloke Gupta 5/25/94.
+XCOMM (c) Copyright 1996 Digital Equipment Corporation.
+XCOMM (c) Copyright 1994,1996 Hewlett-Packard Company.
+XCOMM (c) Copyright 1996 International Business Machines Corp.
+XCOMM (c) Copyright 1996 Sun Microsystems, Inc.
+XCOMM (c) Copyright 1996 Novell, Inc.
+XCOMM (c) Copyright 1996 FUJITSU LIMITED.
+XCOMM (c) Copyright 1996 Hitachi.
+XCOMM
+XCOMM #########################################################################
+
+XCOMM Utility programs
+FILTER=CXXFILT # C++ symbol demangler
+AWK=awk # awk
+PATH=/usr/bin:/bin:/usr/ucb # For nm, cat, pr, expand, awk, c++filt
+
+XCOMM Temporary files
+EXPORTLIST=/tmp/elistgen1.$$ # list of export symbols from "libfoo.elist"
+NMLIST=/tmp/elistgen2.$$ # name list from libfoo.sl
+FILTLIST=/tmp/elistgen3.$$ # demangled (C++) version of NMLIST
+
+XCOMM Print useful information at the top of the output
+echo "#" `date`
+echo "# This linker options list was produced by" $0
+echo "# Input export list description taken from:" $2
+echo "# Target library:" $1
+echo "# Target Operating System:" `uname -msrv`
+echo "# "
+
+XCOMM Extract the globally visible symbols from target library
+XCOMM The NMLIST generated here is later used to cross-check the symbols in the
+XCOMM supplied export-list.
+XCOMM
+nm -p $1 | $AWK '
+ / [cCTDB][S ] [^\$]/{print $3} # Text, Data, BSS, or Secondary symbols
+' > $NMLIST
+
+XCOMM Demangle the global library symbols. This operation is necessary to
+XCOMM convert mangled C++ symbols into their C++ notation.
+${FILTER:-cat} $NMLIST > $FILTLIST
+
+XCOMM
+XCOMM Cleanup the export-list description file.
+XCOMM Note that C++ symbols may have embedded spaces in them.
+XCOMM
+cat $2 | $AWK '
+ BEGIN {
+ csyms = 0; # C language symbols in libfoo.list
+ cplusplus = 0; # C++ language symbols in libfoo.list
+ isyms = 0; # C internal symbols in libfoo.elist
+ icplusplus = 0; # C++ internal symbols in libfoo.elist
+ implicit = ""; # Handling of implicit symbols.
+ }
+ $1 == "default" {
+ # A default clause suppresses warnings about implicit symbols.
+ if ($2 != "" && $2 != "force" && $2 != "public" &&
+ $2 != "private" && $2 != "internal") {
+ print "# Warning: illegal default clause:", $2 | "cat 1>&2";
+ next;
+ }
+ if (implicit != "")
+ print "# Warning: multiple default clauses." | "cat 1>&2";
+ implicit = $2;
+ next;
+ }
+ $1 == "force" || $1 == "public" || $1 == "private" {
+ csyms ++;
+ print $1 ";;" $2;
+ next;
+ }
+ $1 == "publicC++" || $1 == "privateC++" {
+ cplusplus ++;
+ string = $2;
+ for (n = 3; n <= NF; n++)
+ string = string " " $n;
+ print $1 ";;" string;
+ next;
+ }
+ $1 == "internal" {
+ isyms ++;
+ print $1 ";;" $2;
+ next;
+ }
+ $1 == "internalC++" {
+ icplusplus ++;
+ string = $2;
+ for (n = 3; n <= NF; n++)
+ string = string " " $n;
+ print $1 ";;" string;
+ next;
+ }
+ END {
+ printf("# Exporting %d C and %d C++ symbols, hiding %d and %d.\n",
+ csyms, cplusplus, isyms, icplusplus) | "cat 1>&2";
+ if (implicit != "") {
+ print "# Unspecified symbols are " implicit "." | "cat 1>&2";
+ print "default;;" implicit;
+ }
+ }
+' > $EXPORTLIST
+
+XCOMM Read in the above files and write result to stdout. The contents
+XCOMM of NMLIST and FILTLIST are used to construct a symbol lookup table.
+XCOMM The contents of EXPORTLIST are converted with the help of this table.
+XCOMM Use ";" as a delimiter in the symbol lookup table.
+XCOMM
+(pr -m -s";" -t -w1024 $NMLIST $FILTLIST| expand -t 1;cat $EXPORTLIST ) | $AWK '
+ BEGIN {
+ FS = ";";
+ implicit = 0;
+ }
+ NF == 2 {
+ # This is "pr" output, i.e., symbol translation table.
+ syms[$2] = $1;
+ next;
+ }
+ NF == 3 && $1 == "default" {
+ # Treatment of unspecified symbols.
+ if ($3 == "internal" || $3 == "internalC++")
+ implicit = 1;
+ else if ($3 == "private" || $3 == "privateC++")
+ implicit = 2;
+ else if ($3 == "public" || $3 == "publicC++")
+ implicit = 3;
+ else # $3 == "force"
+ implicit = 4;
+ next;
+ }
+ NF == 3 {
+ # Parse our instructions for this symbol.
+ if ($1 == "internal" || $1 == "internalC++")
+ export = 1;
+ else if ($1 == "private" || $1 == "privateC++")
+ export = 2;
+ else if ($1 == "public" || $1 == "publicC++")
+ export = 3;
+ else # $1 == "force"
+ export = 4;
+
+ # Process it.
+ if (length(syms[$3]) > 0) {
+ if (donelist[$3])
+ print "# Warning: Duplicate entry for", $3,
+ "in export list" | "cat 1>&2";
+ if (donelist[$3] < export)
+ donelist[$3] = export;
+ } else {
+ if (export == 4)
+ donelist[$3] = export;
+ else
+ print "# Warning:", $3,
+ "was not in the nm list for this library" | "cat 1>&2";
+ }
+ next;
+ }
+ END {
+ # Force implicit exporting of errno.
+ if (! donelist["errno"])
+ donelist["errno"] = 4;
+
+ # Complain about some implicit symbols.
+ for (i in syms) {
+ if (!donelist[i] && (length(syms[i]) > 0)) {
+ # Ignore automatic symbols generated by the C++ compiler.
+ if (implicit == 0 &&
+ (syms[i] !~ /^__noperfopt__/) &&
+ (syms[i] !~ /^__ptbl_vec__/) &&
+ (syms[i] !~ /^__vtbl__[0-9]*_/) &&
+ (syms[i] !~ /^__cfront_version_[0-9]*_xxxxxxxx$/))
+ print "# Warning:", syms[i],
+ "was not in the export list" | "cat 1>&2";
+ donelist[i] = implicit;
+ }
+ if ((donelist[i] > 1) && (length(syms[i]) > 0))
+ print "-e", syms[i];
+ }
+ }
+'
+
+XCOMM Clean up temporary files
+rm $EXPORTLIST
+rm $NMLIST
+rm $FILTLIST
diff --git a/nx-X11/config/util/elistgen.ibm b/nx-X11/config/util/elistgen.ibm
new file mode 100644
index 000000000..d36869656
--- /dev/null
+++ b/nx-X11/config/util/elistgen.ibm
@@ -0,0 +1,220 @@
+XCOMM!/bin/sh
+XCOMM $Xorg: elistgen.ibm,v 1.3 2000/08/17 19:41:52 cpqbld Exp $
+XCOMM
+XCOMM #########################################################################
+XCOMM Construct shared-library export lists for IBM-AIX based on standardized
+XCOMM export list description file
+XCOMM
+XCOMM Usage: elistgen libfoo.sl libfoo.elist > libfoo.lopt
+XCOMM
+XCOMM libfoo.a => shared library of interest
+XCOMM libfoo.elist => Meta description of necessary export list.
+XCOMM
+XCOMM The output file, "libfoo.lopt" may then be passed to the IBM linker to
+XCOMM reconstruct the shared library, libfoo.sl.
+XCOMM
+XCOMM Author: Yanling Qi 10/03/94, Last updated 10/03/94
+XCOMM (c) Copyright 1996 Digital Equipment Corporation.
+XCOMM (c) Copyright 1996 Hewlett-Packard Company.
+XCOMM (c) Copyright 1994,1996 International Business Machines Corp.
+XCOMM (c) Copyright 1996 Sun Microsystems, Inc.
+XCOMM (c) Copyright 1996 Novell, Inc.
+XCOMM (c) Copyright 1996 FUJITSU LIMITED.
+XCOMM (c) Copyright 1996 Hitachi.
+XCOMM
+XCOMM #########################################################################
+
+#define HASH #
+
+XCOMM Utility programs
+FILTER=CXXFILT # C++ symbol demangler
+AWK=awk # awk
+
+XCOMM For dump, cat, pr, expand, awk, c++filt
+PATH=/usr/bin:/bin:/usr/ucb:/usr/lpp/xlC/bin
+
+XCOMM Temporary files
+EXPORTLIST=/tmp/elistgen1.$$ # export directives from "libfoo.list"
+NMLIST=/tmp/elistgen2.$$ # name list from libfoo.sl
+FILTLIST=/tmp/elistgen3.$$ # demangled (C++) version of above
+
+XCOMM Print useful information
+echo "*" `date`
+echo "* This linker options list was produced by" $0
+echo "* Input export list description taken from:" $2
+echo "* Target library:" $1
+echo "* Target Operating System:" `uname`
+echo "*"
+
+XCOMM Extract the globally visible symbols from target library
+dump -g $1 | $AWK '$1 ~ /[0-9][0-9]/ && $2 !~ /^[\.]/ {print $2}' > $NMLIST
+
+XCOMM Demangle the global library symbols
+${FILTER:-cat} $NMLIST > $FILTLIST
+
+XCOMM
+XCOMM Clean up the export-list description file.
+XCOMM Note that C++ symbols may have embedded spaces in them.
+XCOMM
+$AWK '
+ BEGIN {
+ csyms = 0; # C language symbols in libfoo.list
+ cplusplus = 0; # C++ language symbols in libfoo.list
+ isyms = 0; # C internal symbols in libfoo.list
+ iplusplus = 0; # C++ internal symbols in libfoo.list
+ count = 0; # Running count of symbols
+ implicit = ""; # Handling of implicit symbols.
+ }
+ $1 == "default" {
+ HASH A default clause suppresses warnings about implicit symbols.
+ if ($2 != "" && $2 != "force" && $2 != "public" &&
+ $2 != "private" && $2 != "internal") {
+ print "# Warning: illegal default clause:", $2 | "cat 1>&2";
+ next;
+ }
+ if (implicit != "")
+ print "# Warning: multiple default clauses." | "cat 1>&2";
+ implicit = $2;
+ next;
+ }
+ $1 == "force" || $1 == "public" || $1 == "private" {
+ csyms ++;
+ symbol[count++] = $1 ";;" $2;
+ next;
+ }
+ $1 == "publicC++" || $1 == "privateC++" {
+ HASH forceC++ is unsupported because we only know how to demangle,
+ HASH not how to mangle symbols, and the final ld input file must
+ HASH be mangled.
+ cplusplus ++;
+ string = $2;
+ for (n = 3; n <= NF; n++)
+ string = string " " $n;
+ symbol[count++] = $1 ";;" string;
+ next;
+ }
+ $1 == "internal" {
+ isyms ++;
+ symbol[count++] = $1 ";;" $2;
+ next;
+ }
+ $1 == "internalC++" {
+ iplusplus ++;
+ string = ";;" $2;
+ for (n = 3; n <= NF; n++)
+ string = string " " $n;
+ symbol[count++] = $1 ";;" string;
+ next;
+ }
+ $1 == "#line" || $1 == "#" {
+ HASH cpp will have removed comments, but may have added other stuff.
+ next;
+ }
+ NF > 0 {
+ print "# Warning: unrecognized directive:", $0 | "cat 1>&2";
+ next;
+ }
+ END {
+ printf("# Exporting %d C and %d C++ symbols, hiding %d and %d.\n",
+ csyms, cplusplus, isyms, iplusplus) | "cat 1>&2";
+ if (implicit != "") {
+ print "# Unspecified symbols are " implicit "." | "cat 1>&2";
+ print "default;;" implicit;
+ }
+ for (i in symbol)
+ print symbol[i];
+ }
+' $2 > $EXPORTLIST
+
+XCOMM
+XCOMM Read in the above files and write result to stdout. Use the
+XCOMM delimiter ";" to identify the entries in the symbol lookup table.
+XCOMM
+(pr -m -s";" -t -w1024 $NMLIST $FILTLIST | expand -t 1; cat $EXPORTLIST) | $AWK '
+ BEGIN {
+ FS = ";";
+ implicit = 0;
+ }
+ NF == 2 {
+ HASH This is "pr" output, i.e., symbol translation table
+ r2=$2
+ gsub(/ /,"",r2); # Remove spaces because c++filt is unpredictable
+ syms[r2] = $1;
+ r1=$1;
+ gsub(/ /,"",r1);
+ mangled[r1] = 1; # Save the mangling because the export lists
+ HASH sometimes use it instead of a prototype.
+ next;
+ }
+ NF == 3 && $1 == "default" {
+ HASH Treatment of unspecified symbols.
+ if ($3 == "internal")
+ implicit = 1;
+ else if ($3 == "private" || $3 == "privateC++")
+ implicit = 2;
+ else if ($3 == "public" || $3 == "publicC++")
+ implicit = 3;
+ else # $3 == "force"
+ implicit = 4;
+ next;
+ }
+ NF == 3 {
+ HASH Generate canonical demangled form as an alternate symbol.
+ alt=$3;
+ gsub(/ \.\.\./,",...",alt); # change " ..." to ",..." to match c++filt
+ gsub(/ /,"",alt); # remove all spaces
+ gsub(/\(void\)/,"()",alt); # change "(void)" to "()" to match c++filt
+
+ HASH Parse our instructions for this symbol.
+ if ($1 == "internal" || $1 == "internalC++")
+ export = 1;
+ else if ($1 == "private" || $1 == "privateC++")
+ export = 2;
+ else if ($1 == "public" || $1 == "publicC++")
+ export = 3;
+ else # $1 == "force"
+ export = 4;
+
+ HASH Process it.
+ if ((length(syms[alt]) > 0) || mangled[alt]) {
+ HASH This symbol is present in the library.
+ if (donelist[alt])
+ print "# Warning: Duplicate entry for", $3,
+ "in export list" | "cat 1>&2";
+ if (donelist[alt] < export) {
+ if (export > 1)
+ print syms[alt];
+ donelist[alt] = export;
+ }
+ } else {
+ HASH Print forced-export symbols without complaining.
+ if (export == 4) {
+ print alt;
+ donelist[alt] = export;
+ } else {
+ print "# Warning:", $3,
+ "was not in the nm list for this library" | "cat 1>&2";
+ }
+ }
+
+ next;
+ }
+ END {
+ HASH Process implicit symbols.
+ for (i in syms) {
+ if ((! donelist[i]) && (length(syms[i]) > 0)) {
+ HASH Do not complain about C++ virtual function tables.
+ if (implicit == 0 && syms[i] !~ /^__vft[0-9]*_/)
+ print "# Warning:", syms[i],
+ "was not in the export list" | "cat 1>&2";
+ if (implicit > 1)
+ print syms[i];
+ }
+ }
+ }
+'
+
+XCOMM Clean up temporary files
+rm $EXPORTLIST
+rm $NMLIST
+rm $FILTLIST
diff --git a/nx-X11/config/util/elistgen.sun b/nx-X11/config/util/elistgen.sun
new file mode 100644
index 000000000..f9af50ad1
--- /dev/null
+++ b/nx-X11/config/util/elistgen.sun
@@ -0,0 +1,267 @@
+XCOMM!/bin/sh -f
+XCOMM $Xorg: elistgen.sun,v 1.3 2000/08/17 19:41:52 cpqbld Exp $
+XCOMM
+XCOMM ########################################################################
+XCOMM Construct shared-library scoping mapfile for Solaris based on standardized
+XCOMM export list description file
+XCOMM
+XCOMM Usage: exportlistgen libfoo.so libfoo.elist > mapfile.scope
+XCOMM
+XCOMM libfoo.so => shared library of interest
+XCOMM libfoo.elist => Meta description of necessary export list.
+XCOMM
+XCOMM The output file, "mapfile.scope" may then be passed to the Solaris
+XCOMM linker to reconstruct the shared library, libfoo.so.
+XCOMM
+XCOMM ########################################################################
+XCOMM
+XCOMM $XFree86: xc/config/util/elistgen.sun,v 1.7 2001/01/17 16:39:01 dawes Exp $
+
+XCOMM Utility programs
+FILTER=CXXFILT # C++ symbol demangler
+AWK=nawk # Awk
+
+XCOMM For nm, cat, pr, sed, awk, c++filt
+PATH=/usr/bin:/bin:/usr/ccs/bin:/usr/ucb:$PATH
+
+XCOMM Try to detect broken versions of c++filt.
+if [ `echo _okay | ${FILTER:-cat}` != "_okay" ]; then
+ if [ -x /opt/SUNWspro/bin/c++filt ]; then
+ echo "# Your $FILTER is broken -- using /opt/SUNWspro/bin/c++filt."
+ FILTER=/opt/SUNWspro/bin/c++filt
+ else
+ echo "# ERROR: no working $FILTER available."
+ exit 1
+ fi;
+fi;
+
+XCOMM Temporary files
+EXPORTLIST=/tmp/elistgen1.$$ # export directives from "libfoo.list"
+NMLIST=/tmp/elistgen2.$$ # name list from libfoo.sl
+FILTLIST=/tmp/elistgen3.$$ # demangled (C++) version of above
+
+XCOMM Print useful information at the top of the output
+echo "#" `date`
+echo "# This scoping mapfile was produced by" $0
+echo "# Export list description taken from:" $2
+echo "# Target library:" $1
+echo "# Target Operating System:" `uname -msrv`
+echo "# "
+
+XCOMM Extract the globally visible symbols from target library
+XCOMM The NMLIST generated here is later used to cross-check the symbols in the
+XCOMM nm stopped working on Solaris 2.5, use dump instead.
+nm -p $1 | $AWK '/ [ TDBS] /{print $3}' > $NMLIST
+XCOMM /usr/ccs/bin/dump -t -v $1 | $AWK '/(FUNC|OBJT).(GLOB|WEAK)/{print $8}' > $NMLIST
+
+XCOMM Extract the globally visible symbols from target library
+XCOMM The NMLIST generated here is later used to cross-check the symbols in the
+${FILTER:-cat} < $NMLIST > $FILTLIST
+
+XCOMM Clean up the export-list description file. Sort the directives.
+$AWK '
+ BEGIN {
+ csyms = 0; # C public symbols in libfoo.list
+ cplusplus = 0; # C++ public symbols in libfoo.list
+ isyms = 0; # C internal symbols in libfoo.list
+ iplusplus = 0; # C++ internal symbols in libfoo.list
+ implicit = ""; # Handling of implicit symbols
+ }
+ $1 == "default" {
+ # A default clause suppresses warnings about implicit symbols.
+ if ($2 != "" && $2 != "force" && $2 != "public" && $2 != "private" && $2 != "internal") {
+ print "# Warning: illegal default clause:", $2 | "cat 1>&2";
+ next;
+ }
+ if (implicit != "")
+ print "# Warning: multiple default clauses." | "cat 1>&2";
+ implicit = $2;
+ next;
+ }
+ $1 == "force" {
+ csyms ++;
+ print $1 ";;" $2;
+ next;
+ }
+ $1 == "public" {
+ csyms ++;
+ print $1 ";;" $2;
+ next;
+ }
+ $1 == "publicC++" {
+ cplusplus ++;
+ string = $2;
+ for (n = 3; n <= NF; n++)
+ string = string " " $n;
+ print $1 ";;" string;
+ next;
+ }
+ $1 == "private" {
+ csyms ++;
+ print $1 ";;" $2;
+ next;
+ }
+ $1 == "privateC++" {
+ cplusplus ++;
+ string = $2;
+ for (n = 3; n <= NF; n++)
+ string = string " " $n;
+ print $1 ";;" string;
+ next;
+ }
+ $1 == "internal" {
+ isyms ++;
+ print $1 ";;" $2;
+ next;
+ }
+ $1 == "internalC++" {
+ iplusplus ++;
+ string = $2;
+ for (n = 3; n <= NF; n++)
+ string = string " " $n;
+ print $1 ";;" string;
+ next;
+ }
+ $1 == "#line" || $1 == "#" {
+ # cpp will have removed comments, but may have added other stuff.
+ next;
+ }
+ NF > 0 {
+ print "# Warning: unrecognized directive:", $0 | "cat 1>&2";
+ next;
+ }
+ END {
+ printf("# Exporting %d C and %d C++ symbols, hiding %d and %d.\n", csyms, cplusplus, isyms, iplusplus) | "cat 1>&2";
+ if (implicit != "") {
+ print "# Unspecified symbols are " implicit "." | "cat 1>&2";
+ print "default;;" implicit;
+ }
+ }
+' $2 1>$EXPORTLIST
+
+
+XCOMM Read in the above files and write result to stdout. The contents
+XCOMM of NMLIST and FILTLIST are used to construct a symbol lookup table.
+XCOMM The contents of EXPORTLIST are converted with the help of this table.
+XCOMM Use ";" as a delimiter in the symbol lookup table.
+(pr -m -s";" -t -w1024 $NMLIST $FILTLIST | sed 's/ / /g'; cat $EXPORTLIST) | $AWK '
+ BEGIN {
+ FS = ";";
+ implicit = 0;
+ }
+ NF == 2 {
+ # This is "pr" output, i.e., symbol translation table
+ r2=$2;
+ gsub(/static /,"",r2); # remove keyword "static" as above
+ gsub(/ /,"",r2); # Remove spaces because c++filt is unpredictable
+ syms[r2] = $1;
+ r1=$1;
+ gsub(/ /,"",r1);
+ mangled[r1] = 1; # Save the mangling because the export lists
+ # sometimes use it instead of a prototype.
+ next;
+ }
+ NF == 3 && $1 == "default" {
+ # Treatment of unspecified symbols.
+ if ($3 == "internal" || $3 == "internalC++")
+ implicit = 1;
+ else if ($3 == "private" || $3 == "privateC++")
+ implicit = 2;
+ else if ($3 == "public" || $3 == "publicC++")
+ implicit = 3;
+ else # $3 == "force"
+ implicit = 4;
+ next;
+ }
+ NF == 3 {
+ # Generate canonical demangled form as an alternate symbol.
+ alt=$3;
+ gsub(/ \.\.\./,",...",alt); # change " ..." to ",..." to match c++filt
+ gsub(/ /,"",alt); # remove all spaces
+
+ # An export directive. Parse our instructions for this symbol.
+ if ($1 == "internal" || $1 == "internalC++")
+ export = 1;
+ else if ($3 == "private" || $3 == "privateC++")
+ export = 2;
+ else if ($3 == "public" || $3 == "publicC++")
+ export = 3;
+ else # $3 == "force"
+ export = 4;
+
+ # Process it.
+ if ((length(syms[alt]) > 0) || mangled[alt]) {
+ # This symbol is present in the library.
+ if (donelist[alt])
+ print "# Warning: Duplicate entry for", $3,
+ "in export list" | "cat 1>&2";
+ if (donelist[alt] < export) {
+ donelist[alt] = export;
+ }
+ } else {
+ # Print forced-export symbols without complaining.
+ if (export == 4) {
+ donelist[alt] = export;
+ } else {
+ print "# Warning:", $3,
+ "was not in the nm list for this library" | "cat 1>&2";
+ }
+ }
+
+ next;
+ }
+ END {
+ # Ignore magic linker symbols.
+ if (implicit == 0) {
+ if (!donelist["_DYNAMIC"])
+ donelist["_DYNAMIC"] = 1;
+ if (!donelist["_GLOBAL_OFFSET_TABLE_"])
+ donelist["_GLOBAL_OFFSET_TABLE_"] = 1;
+ if (!donelist["_PROCEDURE_LINKAGE_TABLE_"])
+ donelist["_PROCEDURE_LINKAGE_TABLE_"] = 1;
+ if (!donelist["_edata"])
+ donelist["_edata"] = 1;
+ if (!donelist["_end"])
+ donelist["_end"] = 1;
+ if (!donelist["_etext"])
+ donelist["_etext"] = 1;
+ }
+
+ # Process implicit symbols.
+ for (i in syms) {
+ if (donelist[i] == 0 && length(syms[i]) > 0) {
+ if (implicit == 0) {
+ # Ignore magic symbols introduced by the C++ compiler.
+ if ((syms[i] !~ /^__vtbl__[0-9]*_/) && (syms[i] !~ /^__ptbl_vec__/))
+ print "# Warning:", syms[i], "was not in the export list" | "cat 1>&2";
+ } else {
+ donelist[i] = implicit;
+ }
+ }
+ }
+
+ # Generate the linker file.
+ print "";
+ print "SUNW.1.1 {";
+ print " global:";
+ for (i in syms)
+ if (donelist[i] >= 2 && length(syms[i]) > 0)
+ print " " syms[i] ";";
+ print " local:";
+ print " *;";
+ print "};";
+
+ print "";
+ print "SUNW_private.1.1 {";
+ print " global:";
+ for (i in syms)
+ if (donelist[i] == 1 && length(syms[i]) > 0)
+ print " " syms[i] ";";
+ print "} SUNW.1.1;"
+ }
+'
+
+XCOMM Clean up temporary files
+rm $EXPORTLIST
+rm $NMLIST
+rm $FILTLIST
diff --git a/nx-X11/config/util/elistgen.usl b/nx-X11/config/util/elistgen.usl
new file mode 100644
index 000000000..f17bcdb22
--- /dev/null
+++ b/nx-X11/config/util/elistgen.usl
@@ -0,0 +1,221 @@
+XCOMM!/bin/sh
+XCOMM $Xorg: elistgen.usl,v 1.3 2000/08/17 19:41:52 cpqbld Exp $
+XCOMM
+XCOMM #########################################################################
+XCOMM Construct shared-library export lists for Novell based on standardized
+XCOMM export list description file
+XCOMM
+XCOMM Usage: exportlistgen libFoo.so libFoo.elist > libFoo.lopt
+XCOMM
+XCOMM libFoo.so => shared library of interest
+XCOMM libFoo.elist => Meta description of necessary export list.
+XCOMM
+XCOMM The output file, "libFoo.lopt" may then be passed to the linker to
+XCOMM reconstruct the shared library.
+XCOMM
+XCOMM (c) Copyright 1996 Digital Equipment Corporation.
+XCOMM (c) Copyright 1996 Hewlett-Packard Company.
+XCOMM (c) Copyright 1996 International Business Machines Corp.
+XCOMM (c) Copyright 1996 Sun Microsystems, Inc.
+XCOMM (c) Copyright 1996 Novell, Inc.
+XCOMM (c) Copyright 1996 FUJITSU LIMITED.
+XCOMM (c) Copyright 1996 Hitachi.
+XCOMM
+XCOMM #########################################################################
+XCOMM
+XCOMM $XFree86$
+
+XCOMM Utility programs
+FILTER=CXXFILT # C++ symbol demangler
+AWK=awk # awk
+
+XCOMM For nm, cat, pr, sed, awk, c++filt
+PATH=/usr/bin:/bin:/usr/ucb:/usr/ccs/bin
+
+XCOMM Temporary files
+EXPORTLIST=/tmp/elistgen1.$$ # list of export symbols from "libfoo.elist"
+NMLIST=/tmp/elistgen2.$$ # name list from libfoo.sl
+FILTLIST=/tmp/elistgen3.$$ # demangled (C++) version of NMLIST
+
+XCOMM Print useful information at the top of the output
+echo "#" `date`
+echo "# This linker options list was produced by" $0
+echo "# Input export list description taken from:" $2
+echo "# Target library:" $1
+echo "# Target Operating System:" `uname -msrv`
+echo "# "
+
+XCOMM Extract the globally visible symbols from target library.
+XCOMM The NMLIST generated here is later used to cross-check the symbols in the
+XCOMM supplied export-list.
+nm -p $1 | $AWK '
+ / [TD] [^\$]/{print $3} # Text, Data, BSS, or Secondary symbols
+' > $NMLIST
+
+XCOMM Demangle the global library symbols. This operation is necessary to convert
+XCOMM mangled C++ symbols into their C++ notation.
+${FILTER:-cat} $NMLIST > $FILTLIST
+
+XCOMM Clean up the export-list description file.
+XCOMM Note that C++ symbols may have embedded spaces in them.
+cat $2 | $AWK '
+ BEGIN {
+ csyms = 0; # C language symbols in libfoo.list
+ cplusplus = 0; # C++ language symbols in libfoo.list
+ isyms = 0; # C internal symbols in libfoo.elist
+ iplusplus = 0; # C++ internal symbols in libfoo.elist
+ implicit = ""; # Handling of implicit symbols
+ }
+ $1 == "default" {
+ # A default clause suppresses warnings about implicit symbols.
+ if ($2 != "" && $2 != "force" && $2 != "public" &&
+ $2 != "private" && $2 != "internal") {
+ print "# Warning: illegal default clause:", $2 | "cat 1>&2";
+ next;
+ }
+ if (implicit != "")
+ print "# Warning: multiple default clauses." | "cat 1>&2";
+ implicit = $2;
+ next;
+ }
+ $1 == "force" || $1 == "public" || $1 == "private" {
+ csyms ++;
+ print $1 ";;" $2;
+ next;
+ }
+ $1 == "publicC++" || $1 == "privateC++" {
+ cplusplus ++;
+ string = $2;
+ for (n = 3; n <= NF; n++) {
+ string = string " " $n;
+ }
+ print $1 ";;" string;
+ next;
+ }
+ $1 == "internal" {
+ isyms ++;
+ print $1 ";;" $2;
+ next;
+ }
+ $1 == "internalC++" {
+ iplusplus ++;
+ string = $2;
+ for (n = 3; n <= NF; n++) {
+ string = string " " $n;
+ }
+ print $1 ";;" string;
+ next;
+ }
+ $1 == "#line" || $1 == "#" {
+ # cpp will have removed comments, but may have added other stuff.
+ next;
+ }
+ NF > 0 {
+ print "# Warning: unrecognized directive:", $0 | "cat 1>&2";
+ next;
+ }
+ END {
+ printf("# Exporting %d C and %d C++ symbols, hiding %d and %d.\n",
+ csyms, cplusplus, isyms, iplusplus) | "cat 1>&2";
+ if (implicit != "") {
+ print "# Unspecified symbols are " implicit "." | "cat 1>&2";
+ print "default;;" implicit;
+ }
+ }
+' > $EXPORTLIST
+
+XCOMM Read in the above files and write result to stdout. The contents
+XCOMM of NMLIST and FILTLIST are used to construct a symbol lookup table.
+XCOMM The contents of EXPORTLIST are converted with the help of this table.
+XCOMM Use ";" as a delimiter in the symbol lookup table.
+(pr -m -s";" -t -w1024 $NMLIST $FILTLIST | sed 's/ / /g'; cat $EXPORTLIST) | $AWK '
+ BEGIN {
+ FS = ";";
+ implicit = 0;
+ }
+ NF == 2 {
+ # This is "pr" output, i.e., symbol translation table
+ syms[$2] = $1;
+ next;
+ }
+ NF == 3 && $1 == "default" {
+ # Treatment of unspecified symbols.
+ if ($3 == "internal")
+ implicit = 1;
+ else if ($3 == "private" || $3 == "privateC++")
+ implicit = 2;
+ else if ($3 == "public" || $3 == "publicC++")
+ implicit = 3;
+ else # $3 == "force"
+ implicit = 4;
+ next;
+ }
+ NF == 3 {
+ # Parse our instructions for this symbol.
+ if ($1 == "internal" || $1 == "internalC++")
+ export = 1;
+ else if ($1 == "private" || $1 == "privateC++")
+ export = 2;
+ else if ($1 == "public" || $1 == "publicC++")
+ export = 3;
+ else # $1 == "force"
+ export = 4;
+
+ # Process it.
+ if (length(syms[$3]) > 0) {
+ # This symbol is present in the library.
+ if (donelist[$3])
+ print "# Warning: Duplicate entry for", $3,
+ "in export list" | "cat 1>&2";
+ if (donelist[$3] < export) {
+ if (export > 1)
+ print syms[$3];
+ donelist[$3] = export;
+ }
+ } else {
+ # Do not complain about unknown forced-export symbols.
+ if (export == 4) {
+ print $3;
+ donelist[$3] = export;
+ } else
+ print "# Warning:", $3,
+ "was not in the nm list for this library" | "cat 1>&2";
+ }
+
+ next;
+ }
+ END {
+ # Ignore built-in linker symbols.
+ if (implicit == 0) {
+ if (!donelist["_DYNAMIC"])
+ donelist["_DYNAMIC"] = 1;
+ if (!donelist["_GLOBAL_OFFSET_TABLE_"])
+ donelist["_GLOBAL_OFFSET_TABLE_"] = 1;
+ if (!donelist["_edata"])
+ donelist["_edata"] = 1;
+ if (!donelist["_end"])
+ donelist["_end"] = 1;
+ if (!donelist["_etext"])
+ donelist["_etext"] = 1;
+ }
+
+ # Process implicit symbols.
+ for (i in syms) {
+ if (!donelist[i] && (length(syms[i]) > 0)) {
+ # Ignore C++ compiler symbols
+ if (implicit == 0 &&
+ (syms[i] !~ /^__vtbl__[0-9]*_/) &&
+ (syms[i] !~ /^__cpp_unixware_[0-9]*$/))
+ print "# Warning:", syms[i],
+ "was not in the export list" | "cat 1>&2";
+ if (implicit > 1)
+ print syms[i];
+ }
+ }
+ }
+'
+
+XCOMM Clean up temporary files
+rm $EXPORTLIST
+rm $NMLIST
+rm $FILTLIST
diff --git a/nx-X11/config/util/gccmakedep.man b/nx-X11/config/util/gccmakedep.man
new file mode 100644
index 000000000..5a97a3ebb
--- /dev/null
+++ b/nx-X11/config/util/gccmakedep.man
@@ -0,0 +1,126 @@
+.TH gccmakedep 1 __vendorversion__
+.SH NAME
+gccmakedep \- create dependencies in makefiles using 'gcc -M'
+.SH SYNOPSIS
+.B gccmakedep
+[
+.BI \-s separator
+] [
+.BI \-f makefile
+] [
+.BI \-a
+] [
+\-\^\-
+.I options
+\-\^\-
+]
+.I sourcefile
+\&.\|.\|.
+.SH DESCRIPTION
+The
+.B gccmakedep
+program calls 'gcc -M' to output
+.I makefile
+rules describing the dependencies of each
+.IR sourcefile ,
+so that
+.BR make (1)
+knows which object files must be recompiled when a dependency has changed.
+.PP
+By default,
+.B gccmakedep
+places its output in the file named
+.I makefile
+if it exists, otherwise
+.I Makefile.
+An alternate makefile may be specified with the
+.B \-f
+option.
+It first searches the makefile for a line beginning with
+.sp
+\& # DO NOT DELETE
+.sp
+or one provided with the
+.B \-s
+option, as a delimiter for the dependency output.
+If it finds it, it will delete everything following this up to the end of
+the makefile and put the output after this line.
+If it doesn't find it, the program will append the string to the makefile
+and place the output after that.
+.SH EXAMPLE
+Normally,
+.B gccmakedep
+will be used in a makefile target so that typing 'make depend' will bring
+the dependencies up to date for the makefile.
+For example,
+.nf
+ SRCS\0=\0file1.c\0file2.c\0.\|.\|.
+ CFLAGS\0=\0\-O\0\-DHACK\0\-I\^.\^.\^/foobar\0\-xyz
+ depend:
+ gccmakedep\0\-\^\-\0$(CFLAGS)\0\-\^\-\0$(SRCS)
+.fi
+.SH OPTIONS
+The program will ignore any option that it does not understand, so you may
+use the same arguments that you would for
+.BR gcc (1),
+including
+.B \-D
+and
+.B \-U
+options to define and undefine symbols and
+.B \-I
+to set the include path.
+.TP
+.B \-a
+Append the dependencies to the file instead of replacing existing
+dependencies.
+.TP
+.BI \-f makefile
+Filename.
+This allows you to specify an alternate makefile in which
+.B gccmakedep
+can place its output.
+Specifying \(lq\-\(rq as the file name (that is,
+.BR \-f\- )
+sends the output to standard output instead of modifying an existing file.
+.TP
+.BI \-s string
+Starting string delimiter.
+This option permits you to specify a different string for
+.B gccmakedep
+to look for in the makefile.
+The default is \(lq# DO NOT DELETE\(rq.
+.TP
+.BI \-\^\- " options " \-\^\-
+If
+.B gccmakedep
+encounters a double hyphen (\-\^\-) in the argument list, then any
+unrecognized arguments following it will be silently ignored.
+A second double hyphen terminates this special treatment.
+In this way,
+.B gccmakedep
+can be made to safely ignore esoteric compiler arguments that might
+normally be found in a CFLAGS
+.B make
+macro (see the
+.B EXAMPLE
+section above).
+.BR \-D ,
+.BR \-I ,
+and
+.B \-U
+options appearing between the pair of double hyphens are still processed
+normally.
+.SH "SEE ALSO"
+.BR gcc (1),
+.BR make (1),
+.BR makedepend (1).
+.SH AUTHOR
+The version of the
+.B gccmakedep
+included in this X.Org Foundation release was originally
+written by the XFree86 Project based on code supplied by Hongjiu Lu.
+.PP
+Colin Watson wrote this manual page, originally for the Debian Project,
+based partly on the manual page for
+.BR makedepend (1).
diff --git a/nx-X11/config/util/gccmdep.cpp b/nx-X11/config/util/gccmdep.cpp
new file mode 100644
index 000000000..ff4b12a3d
--- /dev/null
+++ b/nx-X11/config/util/gccmdep.cpp
@@ -0,0 +1,126 @@
+XCOMM!/bin/sh
+
+XCOMM
+XCOMM makedepend which uses 'gcc -M'
+XCOMM
+XCOMM $XFree86: xc/config/util/gccmdep.cpp,v 3.10tsi Exp $
+XCOMM
+XCOMM Based on mdepend.cpp and code supplied by Hongjiu Lu <hjl@nynexst.com>
+XCOMM
+
+TMP=mdep$$.tmp
+CC=CCCMD
+RM=RMCMD
+LN=LNCMD
+MV=MVCMD
+
+${RM} ${TMP}
+
+trap "${RM} ${TMP}*; exit 1" 1 2 15
+trap "${RM} ${TMP}*; exit 0" 1 2 13
+
+files=
+makefile=
+endmarker=
+magic_string='# DO NOT DELETE'
+append=n
+args=
+
+while [ $# != 0 ]; do
+ if [ "$endmarker"x != x -a "$endmarker" = "$1" ]; then
+ endmarker=
+ else
+ case "$1" in
+ -D*|-I*|-U*)
+ args="$args '$1'"
+ ;;
+ -g*|-O*)
+ ;;
+ *)
+ if [ "$endmarker"x = x ]; then
+ case $1 in
+XCOMM ignore these flags
+ -w|-o|-cc)
+ shift
+ ;;
+ -v)
+ ;;
+ -s)
+ magic_string="$2"
+ shift
+ ;;
+ -f*)
+ if [ "$1" = "-f-" ]; then
+ makefile="-"
+ elif [ "$1" = "-f" ]; then
+ makefile="$2"
+ shift
+ else
+ echo "$1" | sed 's/^\-f//' >${TMP}arg
+ makefile="`cat ${TMP}arg`"
+ rm -f ${TMP}arg
+ fi
+ ;;
+ --*)
+ endmarker=`echo $1 | sed 's/^\-\-//'`
+ if [ "$endmarker"x = x ]; then
+ endmarker="--"
+ fi
+ ;;
+ -a)
+ append=y
+ ;;
+ -*)
+ echo "Unknown option '$1' ignored" 1>&2
+ ;;
+ *)
+ files="$files $1"
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ fi
+ shift
+done
+
+if [ x"$files" = x ]; then
+XCOMM Nothing to do
+ exit 0
+fi
+
+case "$makefile" in
+ '')
+ if [ -r makefile ]; then
+ makefile=makefile
+ elif [ -r Makefile ]; then
+ makefile=Makefile
+ else
+ echo 'no makefile or Makefile found' 1>&2
+ exit 1
+ fi
+ ;;
+esac
+
+if [ X"$makefile" != X- ]; then
+ if [ x"$append" = xn ]; then
+ sed -e "/^$magic_string/,\$d" < $makefile > $TMP
+ echo "$magic_string" >> $TMP
+ else
+ cp $makefile $TMP
+ fi
+fi
+
+CMD="$CC -M $args $files"
+if [ X"$makefile" != X- ]; then
+ CMD="$CMD >> $TMP"
+fi
+eval $CMD
+if [ X"$makefile" != X- ]; then
+ $RM ${makefile}.bak
+ $MV $makefile ${makefile}.bak
+ $MV $TMP $makefile
+fi
+
+$RM ${TMP}*
+exit 0
diff --git a/nx-X11/config/util/indir.cmd b/nx-X11/config/util/indir.cmd
new file mode 100644
index 000000000..2c86690aa
--- /dev/null
+++ b/nx-X11/config/util/indir.cmd
@@ -0,0 +1,28 @@
+/* OS/2 rexx script to emulate the "cd dir; command" mechanism in make
+ * which does not work with stupid CMD.EXE
+ *
+ * $XFree86: xc/config/util/indir.cmd,v 3.1 1996/01/24 21:56:12 dawes Exp $
+ */
+curdir = directory()
+line = fixbadprefix(ARG(1))
+w1 = TRANSLATE(WORD(line,1),'\','/')
+new = directory(w1)
+/*IF (SUBSTR(w1,1,2) = '..') | (POS(w1,new) > 0) THEN DO*/
+ subword(line,2)
+ old = directory(curdir)
+/*END
+ELSE DO
+ say 'Directory 'new' does not exist, ignoring command (nonfatal)'
+END*/
+EXIT
+
+/* somehow make or cmd manages to convert a relative path ..\..\. to ..... */
+fixbadprefix:
+count = 1
+str = ARG(1)
+DO WHILE SUBSTR(str,count,3) = '...'
+ count = count+1
+ str = INSERT('\',str,count)
+ count = count+2
+END
+RETURN str
diff --git a/nx-X11/config/util/install.sh b/nx-X11/config/util/install.sh
new file mode 100644
index 000000000..7b2d40b85
--- /dev/null
+++ b/nx-X11/config/util/install.sh
@@ -0,0 +1,108 @@
+#!/bin/sh
+
+#
+# install - install a program, script, or datafile
+#
+# $Xorg: install.sh,v 1.3 2000/08/17 19:41:52 cpqbld Exp $
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+#
+
+
+# set DOITPROG to echo to test this script
+
+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}"
+
+instcmd="$mvprog"
+chmodcmd=""
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+src=""
+dst=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+fi
+
+if [ x"$dst" = x ]
+then
+ echo "install: no destination specified"
+ exit 1
+fi
+
+
+# if destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+if [ -d $dst ]
+then
+ dst="$dst"/`basename $src`
+fi
+
+
+# get rid of the old one and mode the new one in
+
+$doit $rmcmd $dst
+$doit $instcmd $src $dst
+
+
+# and set any options; do chmod last to preserve setuid bits
+
+if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; fi
+if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; fi
+if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; fi
+if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; fi
+
+exit 0
diff --git a/nx-X11/config/util/lndir.c b/nx-X11/config/util/lndir.c
new file mode 100644
index 000000000..cd1d983b0
--- /dev/null
+++ b/nx-X11/config/util/lndir.c
@@ -0,0 +1,391 @@
+/* $Xorg: lndir.c,v 1.5 2001/02/09 02:03:17 xorgcvs Exp $ */
+/* Create shadow link tree (after X11R4 script of the same name)
+ Mark Reinhold (mbr@lcs.mit.edu)/3 January 1990 */
+
+/*
+Copyright (c) 1990, 1998 The Open Group
+
+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.
+
+*/
+/* $XFree86: xc/config/util/lndir.c,v 3.18 2003/06/24 15:44:45 eich Exp $ */
+
+/* From the original /bin/sh script:
+
+ Used to create a copy of the a directory tree that has links for all
+ non-directories (except, by default, those named BitKeeper, RCS, SCCS
+ or CVS.adm). If you are building the distribution on more than one
+ machine, you should use this technique.
+
+ If your master sources are located in /usr/local/src/X and you would like
+ your link tree to be in /usr/local/src/new-X, do the following:
+
+ % mkdir /usr/local/src/new-X
+ % cd /usr/local/src/new-X
+ % lndir ../X
+*/
+
+#include <X11/Xos.h>
+#include <X11/Xfuncproto.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#if !defined(MINIX) && !defined(Lynx)
+#include <sys/param.h>
+#endif
+#include <errno.h>
+
+#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
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 2048
+#endif
+
+#include <stdarg.h>
+
+int silent = 0; /* -silent */
+int ignore_links = 0; /* -ignorelinks */
+int with_revinfo = 0; /* -withrevinfo */
+
+char *rcurdir;
+char *curdir;
+
+static void
+quit (int code, char * fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vfprintf (stderr, fmt, args);
+ va_end(args);
+ putc ('\n', stderr);
+ exit (code);
+}
+
+static void
+quiterr (int code, char *s)
+{
+ perror (s);
+ exit (code);
+}
+
+static void
+msg (char * fmt, ...)
+{
+ va_list args;
+ if (curdir) {
+ fprintf (stderr, "%s:\n", curdir);
+ curdir = 0;
+ }
+ va_start(args, fmt);
+ vfprintf (stderr, fmt, args);
+ va_end(args);
+ putc ('\n', stderr);
+}
+
+static void
+mperror (char *s)
+{
+ if (curdir) {
+ fprintf (stderr, "%s:\n", curdir);
+ curdir = 0;
+ }
+ perror (s);
+}
+
+
+static int
+equivalent(char *lname, char *rname, char **p)
+{
+ char *s;
+
+ if (!strcmp(lname, rname))
+ return 1;
+ for (s = lname; *s && (s = strchr(s, '/')); s++) {
+ while (s[1] == '/') {
+ strcpy(s+1, s+2);
+ if (*p) (*p)--;
+ }
+ }
+ return !strcmp(lname, rname);
+}
+
+
+/* Recursively create symbolic links from the current directory to the "from"
+ directory. Assumes that files described by fs and ts are directories. */
+static int
+dodir (char *fn, /* name of "from" directory, either absolute or
+ relative to cwd */
+ struct stat *fs,
+ struct stat *ts, /* stats for the "from" directory and cwd */
+ int rel) /* if true, prepend "../" to fn before using */
+{
+ DIR *df;
+ struct dirent *dp;
+ char buf[MAXPATHLEN + 1], *p;
+ char symbuf[MAXPATHLEN + 1];
+ char basesym[MAXPATHLEN + 1];
+ struct stat sb, sc;
+ int n_dirs;
+ int symlen;
+ int basesymlen = -1;
+ char *ocurdir;
+
+ if ((fs->st_dev == ts->st_dev) && (fs->st_ino == ts->st_ino)) {
+ msg ("%s: From and to directories are identical!", fn);
+ return 1;
+ }
+
+ if (rel)
+ strcpy (buf, "../");
+ else
+ buf[0] = '\0';
+ strcat (buf, fn);
+
+ if (!(df = opendir (buf))) {
+ msg ("%s: Cannot opendir", buf);
+ return 1;
+ }
+
+ p = buf + strlen (buf);
+ if (*(p - 1) != '/')
+ *p++ = '/';
+ n_dirs = fs->st_nlink;
+ while ((dp = readdir (df))) {
+ if (dp->d_name[strlen(dp->d_name) - 1] == '~')
+ continue;
+#ifdef __DARWIN__
+ /* Ignore these Mac OS X Finder data files */
+ if (!strcmp(dp->d_name, ".DS_Store") ||
+ !strcmp(dp->d_name, "._.DS_Store"))
+ continue;
+#endif
+ strcpy (p, dp->d_name);
+
+ if (n_dirs > 0) {
+ if (lstat (buf, &sb) < 0) {
+ mperror (buf);
+ continue;
+ }
+
+#ifdef S_ISDIR
+ if(S_ISDIR(sb.st_mode))
+#else
+ if ((sb.st_mode & S_IFMT) == S_IFDIR)
+#endif
+ {
+ /* directory */
+ n_dirs--;
+ if (dp->d_name[0] == '.' &&
+ (dp->d_name[1] == '\0' || (dp->d_name[1] == '.' &&
+ dp->d_name[2] == '\0')))
+ continue;
+ if (!with_revinfo) {
+ if (!strcmp (dp->d_name, "BitKeeper"))
+ continue;
+ if (!strcmp (dp->d_name, "RCS"))
+ continue;
+ if (!strcmp (dp->d_name, "SCCS"))
+ continue;
+ if (!strcmp (dp->d_name, "CVS"))
+ continue;
+ if (!strcmp (dp->d_name, "CVS.adm"))
+ continue;
+ if (!strcmp (dp->d_name, ".svn"))
+ continue;
+ }
+ ocurdir = rcurdir;
+ rcurdir = buf;
+ curdir = silent ? buf : (char *)0;
+ if (!silent)
+ printf ("%s:\n", buf);
+ if ((stat (dp->d_name, &sc) < 0) && (errno == ENOENT)) {
+ if (mkdir (dp->d_name, 0777) < 0 ||
+ stat (dp->d_name, &sc) < 0) {
+ mperror (dp->d_name);
+ curdir = rcurdir = ocurdir;
+ continue;
+ }
+ }
+ if (readlink (dp->d_name, symbuf, sizeof(symbuf) - 1) >= 0) {
+ msg ("%s: is a link instead of a directory", dp->d_name);
+ curdir = rcurdir = ocurdir;
+ continue;
+ }
+ if (chdir (dp->d_name) < 0) {
+ mperror (dp->d_name);
+ curdir = rcurdir = ocurdir;
+ continue;
+ }
+ dodir (buf, &sb, &sc, (buf[0] != '/'));
+ if (chdir ("..") < 0)
+ quiterr (1, "..");
+ curdir = rcurdir = ocurdir;
+ continue;
+ }
+ }
+
+ /* non-directory */
+ symlen = readlink (dp->d_name, symbuf, sizeof(symbuf) - 1);
+ if (symlen >= 0)
+ symbuf[symlen] = '\0';
+
+ /* The option to ignore links exists mostly because
+ checking for them slows us down by 10-20%.
+ But it is off by default because this really is a useful check. */
+ if (!ignore_links) {
+ /* see if the file in the base tree was a symlink */
+ basesymlen = readlink(buf, basesym, sizeof(basesym) - 1);
+ if (basesymlen >= 0)
+ basesym[basesymlen] = '\0';
+ }
+
+ if (symlen >= 0) {
+ /* Link exists in new tree. Print message if it doesn't match. */
+ if (!equivalent (basesymlen>=0 ? basesym : buf, symbuf,
+ basesymlen>=0 ? (char **) 0 : &p))
+ msg ("%s: %s", dp->d_name, symbuf);
+ } else {
+ char *sympath;
+
+ if (basesymlen>=0) {
+ if ((buf[0] == '.') && (buf[1] == '.') && (buf[2] == '/') &&
+ (basesym[0] == '.') && (basesym[1] == '.') &&
+ (basesym[2] == '/')) {
+ /* It becomes very tricky here. We have
+ ../../bar/foo symlinked to ../xxx/yyy. We
+ can't just use ../xxx/yyy. We have to use
+ ../../bar/foo/../xxx/yyy. */
+
+ int i;
+ char *start, *end;
+
+ strcpy (symbuf, buf);
+ /* Find the first char after "../" in symbuf. */
+ start = symbuf;
+ do {
+ start += 3;
+ } while ((start[0] == '.') && (start[1] == '.') &&
+ (start[2] == '/'));
+
+ /* Then try to eliminate "../"s in basesym. */
+ i = 0;
+ end = strrchr (symbuf, '/');
+ if (start < end) {
+ do {
+ i += 3;
+ end--;
+ while ((*end != '/') && (end != start))
+ end--;
+ if (end == start)
+ break;
+ } while ((basesym[i] == '.') &&
+ (basesym[i + 1] == '.') &&
+ (basesym[i + 2] == '/'));
+ }
+ if (*end == '/')
+ end++;
+ strcpy (end, &basesym[i]);
+ sympath = symbuf;
+ }
+ else
+ sympath = basesym;
+ }
+ else
+ sympath = buf;
+ if (symlink (sympath, dp->d_name) < 0)
+ mperror (dp->d_name);
+ }
+ }
+
+ closedir (df);
+ return 0;
+}
+
+int
+main (int ac, char *av[])
+{
+ char *prog_name = av[0];
+ char *fn, *tn;
+ struct stat fs, ts;
+
+ while (++av, --ac) {
+ if (strcmp(*av, "-silent") == 0)
+ silent = 1;
+ else if (strcmp(*av, "-ignorelinks") == 0)
+ ignore_links = 1;
+ else if (strcmp(*av, "-withrevinfo") == 0)
+ with_revinfo = 1;
+ else if (strcmp(*av, "--") == 0) {
+ ++av, --ac;
+ break;
+ }
+ else
+ break;
+ }
+
+ if (ac < 1 || ac > 2)
+ quit (1, "usage: %s [-silent] [-ignorelinks] fromdir [todir]",
+ prog_name);
+
+ fn = av[0];
+ if (ac == 2)
+ tn = av[1];
+ else
+ tn = ".";
+
+ /* to directory */
+ if (stat (tn, &ts) < 0)
+ quiterr (1, tn);
+#ifdef S_ISDIR
+ if (!(S_ISDIR(ts.st_mode)))
+#else
+ if (!(ts.st_mode & S_IFMT) == S_IFDIR)
+#endif
+ quit (2, "%s: Not a directory", tn);
+ if (chdir (tn) < 0)
+ quiterr (1, tn);
+
+ /* from directory */
+ if (stat (fn, &fs) < 0)
+ quiterr (1, fn);
+#ifdef S_ISDIR
+ if (!(S_ISDIR(fs.st_mode)))
+#else
+ if (!(fs.st_mode & S_IFMT) == S_IFDIR)
+#endif
+ quit (2, "%s: Not a directory", fn);
+
+ exit (dodir (fn, &fs, &ts, 0));
+}
diff --git a/nx-X11/config/util/lndir.man b/nx-X11/config/util/lndir.man
new file mode 100644
index 000000000..244e8a58f
--- /dev/null
+++ b/nx-X11/config/util/lndir.man
@@ -0,0 +1,119 @@
+.\" $Xorg: lndir.man,v 1.4 2001/02/09 02:03:17 xorgcvs Exp $
+.\"
+.\" Copyright (c) 1993, 1994, 1998 The Open Group
+.\"
+.\" 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.
+.\"
+.\"
+.\" $XFree86: xc/config/util/lndir.man,v 1.3tsi Exp $
+.\"
+.TH LNDIR 1 __xorgversion__
+.SH NAME
+lndir \- create a shadow directory of symbolic links to another directory tree
+.SH SYNOPSIS
+.B lndir
+[
+.B \-silent
+] [
+.B \-ignorelinks
+] [
+.B \-withrevinfo
+]
+.I \|fromdir\|
+[
+.I todir
+]
+.SH DESCRIPTION
+The
+.I lndir
+program makes a shadow copy
+.I todir
+of a directory tree
+.I fromdir,
+except that the shadow is not
+populated with real files but instead with symbolic links pointing at
+the real files in the
+.I fromdir
+directory tree. This is usually useful for maintaining source code for
+different machine architectures. You create a shadow directory
+containing links to the real source, which you will have usually
+mounted from a remote machine. You can build in the shadow tree, and
+the object files will be in the shadow directory, while the
+source files in the shadow directory are just symlinks to the real
+files.
+.PP
+This scheme has the advantage that if you update the source, you need not
+propagate the change to the other architectures by hand, since all
+source in all shadow directories are symlinks to the real thing: just cd
+to the shadow directory and recompile away.
+.PP
+The
+.I todir
+argument is optional and defaults to the current directory. The
+.I fromdir
+argument may be relative (e.g., ../src) and is relative to
+.I todir
+(not the current directory).
+.PP
+.\" CVS.adm is used by the Concurrent Versions System.
+Note that BitKeeper, RCS, SCCS, .svn, CVS and CVS.adm directories are
+shadowed only if the \fB\-withrevinfo\fP flag is specified.
+.PP
+If you add files, simply run
+.I lndir
+again. New files will be silently added. Old files will be
+checked that they have the correct link.
+.PP
+Deleting files is a more painful problem; the symlinks will
+just point into never never land.
+.PP
+If a file in \fIfromdir\fP is a symbolic link, \fIlndir\fP will make
+the same link in \fItodir\fP rather than making a link back to the
+(symbolic link) entry in \fIfromdir.\fP The \fB\-ignorelinks\fP flag
+changes this behavior.
+.SH OPTIONS
+.IP \-silent
+Normally \fIlndir\fP outputs the name of each subdirectory as it
+descends into it. The \fB\-silent\fP option suppresses these status
+messages.
+.IP \-ignorelinks
+Causes the program to not treat symbolic links in \fIfromdir\fP
+specially. The link created in \fItodir\fP will point back to the
+corresponding (symbolic link) file in \fIfromdir\fP.
+If the link is to a directory, this is almost certainly the wrong thing.
+.IP
+This option exists mostly to emulate the behavior the C version of
+\fIlndir\fP had in X11R6. Its use is not recommended.
+.IP \-withrevinfo
+Causes any BitKeeper, RCS, SCCS, .svn, CVS and CVS.adm subdirectories to be
+treated as any other directory, rather than ignored.
+.SH DIAGNOSTICS
+The program displays the name of each subdirectory it enters, followed
+by a colon. The \fB\-silent\fP option suppresses these messages.
+.PP
+A warning message is displayed if the symbolic link cannot be created.
+The usual problem is that a regular file of the same name already
+exists.
+.PP
+If the link already exists but doesn't point to the correct file, the
+program prints the link name and the location where it does point.
diff --git a/nx-X11/config/util/makedef.cmd b/nx-X11/config/util/makedef.cmd
new file mode 100644
index 000000000..9d5d6decf
--- /dev/null
+++ b/nx-X11/config/util/makedef.cmd
@@ -0,0 +1,620 @@
+/* This is OS/2 REXX */
+/* $XFree86: xc/config/util/makedef.cmd,v 1.4 2003/11/12 00:10:24 dawes Exp $
+ *
+ * This file was taken from Odin32 project, modified to suit
+ * XFree86 4.x build process and then modified to suit
+ * the X.org monolithic build process for X11R6.7
+ *
+ * Generate *os2.def linker definition files for OS/2
+ */
+
+if RxFuncQuery('SysLoadFuncs')=1 THEN
+DO
+ call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs';
+ call SysLoadFuncs;
+END
+
+/*
+ * Set default parameter values.
+ */
+sLibrary = '';
+sDBFile = '';
+sOrdinals = 0;
+sASDFeatureId = '';
+sCountryCode = '';
+sDateTime = left(' 'date()' 'time(), 26);
+sDescription = 'X.Org 6.9';
+sFixPakVer = '';
+sHostname = strip(substr(VALUE('HOSTNAME',,'OS2ENVIRONMENT'), 1, 11));
+sLanguageCode = '';
+sMiniVer = '';
+sVendor = 'X.Org';
+sVersion = '6.9';
+
+
+/*
+ * Parse parameters.
+ */
+parse arg sArgs
+if (sArgs = '') then
+do
+ call syntax;
+ exit(1);
+end
+
+do while (sArgs <> '')
+ sArgs = strip(sArgs);
+ if (substr(sArgs, 1, 1) = '-' | substr(sArgs, 1, 1) = '/') then
+ do /*
+ * Option.
+ */
+ ch = translate(substr(sArgs, 2, 1));
+ if (pos(ch, 'ACDHLMNOPRTV') < 1) then
+ do
+ say 'invalid option:' substr(sArgs, 1, 2);
+ call syntax;
+ exit(2);
+ end
+
+ /* get value and advance sArgs to next or to end. */
+ if (substr(sArgs, 3, 1) = '"') then
+ do
+ iNext = pos('"', sArgs, 4);
+ fQuote = 1;
+ end
+ else
+ do
+ iNext = pos(' ', sArgs, 3);
+ if (iNext <= 0) then
+ iNext = length(sArgs);
+ fQuote = 0;
+ end
+
+ if (iNext > 3 | ch = 'R') then
+ do
+ sValue = substr(sArgs, 3 + fQuote, iNext - 3 - fQuote);
+ sArgs = strip(substr(sArgs, iNext+1));
+ /*say 'iNext:' iNext 'sValue:' sValue 'sArgs:' sArgs; */
+
+ /* check if we're gonna search for something in an file. */
+ if (sValue <> '' & pos('#define=', sValue) > 0) then
+ sValue = LookupDefine(sValue);
+ end
+ else
+ do
+ say 'syntax error near' substr(sArgs, 1, 2)'.';
+ call syntax;
+ exit(3);
+ end
+
+
+ /* set value */
+ select
+ when (ch = 'A') then /* ASD Feature Id */
+ sASDFeatureId = sValue;
+
+ when (ch = 'C') then /* Country code */
+ sCountryCode = sValue;
+
+ when (ch = 'D') then /* Description */
+ sDescription = sValue;
+
+ when (ch = 'H') then /* Hostname */
+ sHostname = sValue;
+
+ when (ch = 'L') then /* Language code */
+ sLanguageCode = sValue;
+
+ when (ch = 'M') then /* MiniVer */
+ sMiniVer = sValue;
+
+ when (ch = 'N') then /* Vendor */
+ sVendor = sValue;
+
+ when (ch = 'O') then /* Ordinals */
+ sOrdinals = 1;
+
+ when (ch = 'R') then /* Vendor */
+ sDescription = ReadDescription(sValue, sDefFile);
+
+ when (ch = 'P') then /* Fixpak version */
+ sFixPakVer = sValue;
+
+ when (ch = 'T') then /* Date Time */
+ sDateTime = sValue;
+
+ when (ch = 'V') then /* Version */
+ sVersion = sValue;
+
+ /* Otherwise it's an illegal option */
+ otherwise:
+ say 'invalid option:' substr(sArgs, 1, 2);
+ call syntax;
+ exit(2);
+ end /* select */
+ end
+ else
+ do /*
+ * Table file name, typically xc/config/cf/os2def.db
+ */
+ if (sLibrary <> '') then
+ do
+ say 'Syntax error: Can''t specify more than two files!';
+ exit(4);
+ end
+ if (sDBFile = '') then
+ parse value sArgs with sDBFile' 'sArgs
+ else
+ parse value sArgs with sLibrary' 'sArgs
+ sArgs = strip(sArgs);
+ end
+end
+
+/* check that a definition file was specified. */
+if (sLibrary = '') then
+do
+ say 'Syntax error: Will have to specify a library stem.';
+ call syntax;
+ exit(5);
+end
+
+
+/*
+ * Trim strings to correct lengths.
+ */
+sVendor = strip(substr(sVendor, 1, 31));
+if (substr(sDateTime, 1, 1) <> ' ') then
+ sDateTime = ' ' || sDateTime;
+sDateTime = left(sDateTime, 26);
+sHostname = strip(substr(sHostname, 1, 11));
+sMiniVer = strip(substr(sMiniVer, 1, 11));
+sDescription = strip(substr(sDescription, 1, 80));
+sCountryCode = strip(substr(sCountryCode, 1, 4));
+sLanguageCode = strip(substr(sLanguageCode, 1, 4));
+sASDFeatureId = strip(substr(sASDFeatureId, 1, 11));
+sFixPakVer = strip(substr(sFixPakVer, 1, 11));
+
+/* load database file, only accept lines for the specified sLibrary */
+ordHash.0 = 0
+sRealName = ''
+sInitTerm = 0
+
+rc = LoadDBFile(sDBFile,sLibrary)
+
+/* engage gcc to parse the corresponding -def.cpp file */
+'@gcc -E -D__UNIXOS2__ 'sLibrary'-def.cpp >tmpos2.def'
+
+/* Signature */
+sEnhSign = '##1##'
+
+/*
+ * Build description string.
+ */
+sDescription = '@#'sVendor':'sVersion'#@'sEnhSign||,
+ sDateTime||sHostname||,
+ ':'sASDFeatureId':'sLanguageCode':'sCountryCode':'sMiniVer||,
+ '::'sFixPakVer'@@'sDescription;
+
+/*
+ * Update .def-file.
+ */
+rc = UpdateDefFile(sLibrary,sDescription,sRealName,sOrdinals,sInitTerm);
+call SysFileDelete('tmpos2.def')
+
+exit(rc);
+
+LoadDBFile: procedure expose ordHash. sRealname sInitTerm
+ parse arg dbfile,libname;
+
+ rc = stream(dbfile, 'c', 'open read');
+ if (pos('READY', rc) <> 1) then
+ do
+ say 'error: failed to open 'dbfile;
+ exit(-1);
+ end
+ do while (lines(dbfile) > 0)
+ line = translate(strip(linein(dbfile)),' ',' ');
+ if pos(';',line) > 0 then iterate;
+ if pos('LIBRARY',line) > 0 then do
+ if word(line,2) = libname then do
+ sRealname = word(line,3)
+ if word(line,4) <> '' then
+ sInitTerm = 1
+ end
+ iterate
+ end
+ if word(line,1) = libname then do
+ name = word(line,2)
+ ordHash.name = word(line,3)
+ end
+ end
+ rc = stream(dbfile,'c','close')
+ return rc
+
+/**
+ * Display script syntax.
+ */
+syntax: procedure
+ say 'Syntax: MakeDef.cmd [options] <dbfile> <libname> [options]'
+ say ' <dbfile> Ordinals database.'
+ say ' <libname> Library stem'
+ say 'Options:'
+ say ' -A<string> ASD Feature Id.'
+ say ' -C<string> Country code.'
+ say ' -D<string> Description.'
+ say ' -O<string> Ordinals definition file.'
+ say ' -R[deffile] Read description from .def file.'
+ say ' -H<string> Hostname.'
+ say ' -L<string> Language code.'
+ say ' -M<string> MiniVer.'
+ say ' -N<string> Vendor.'
+ say ' -P<string> Fixpak version.'
+ say ' -T<string> Date Time.'
+ say ' -V<string> Version.'
+ say '<string> could be a double quoted string or a single word.'
+ say ' You could also reference #defines in C/C++ include files.'
+ say ' The string should then have this form:'
+ say ' "#define=<DEFINE_NAME>,<includefile.h>"'
+ say '';
+
+ return;
+
+
+/**
+ * Search for a #define in an C/C++ header or source file.
+ *
+ * @returns String containing the defined value
+ * found for the define in the header file.
+ * Quits on fatal errors.
+ * @param A string on the form: "#define=DEFINETOFIND,includefile.h"
+ * @remark Write only code... - let's hope it works.
+ */
+LookupDefine: procedure
+ parse arg '#'sDefine'='sMacro','sIncludeFile
+
+ /*
+ * Validate parameters.
+ */
+ sMacro = strip(sMacro);
+ sIncludeFile = strip(sIncludeFile);
+ if (sMacro = '') then
+ do
+ say 'syntax error: #define=<DEFINE_NAME>,<includefile.h>.';
+ say ' <DEFINE_NAME> was empty.';
+ exit(-20);
+ end
+ if (sIncludeFile = '') then
+ do
+ say 'syntax error: #define=<DEFINE_NAME>,<includefile.h>.';
+ say ' <includefile.h> was empty.';
+ exit(-20);
+ end
+
+
+ sIllegal = translate(translate(sMacro),,
+ '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!',,
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_');
+
+ if (strip(translate(sIllegal, ' ', '!')) <> '') then
+ do
+ say 'syntax error: #define=<DEFINE_NAME>,<includefile.h>.';
+ say ' <DEFINE_NAME> contains illegal charater(s).'
+ say ' 'sMacro;
+ say ' 'translate(sIllegal, ' ', '!');
+ exit(-20);
+ end
+
+ /*
+ * Open include file.
+ */
+ sRc = stream(sIncludeFile, 'c', 'open read');
+ if (pos('READY', sRc) <> 1) then
+ do /* search INCLUDE variable */
+ sFile = SysSearchPath('INCLUDE', sIncludeFile);
+ if (sFile = '') then
+ do
+ say 'Can''t find include file 'sIncludeFile'.';
+ exit(-20);
+ end
+ sIncludeFile = sFile;
+
+ sRc = stream(sIncludeFile, 'c', 'open read');
+ if (pos('READY', sRc) <> 1) then
+ do
+ say 'Failed to open include file' sIncludeFile'.';
+ exit(-20);
+ end
+ end
+
+ /*
+ * Search the file line by line.
+ * We'll check for lines starting with a hash (#) char.
+ * Then check that the word after the hash is 'define'.
+ * Then match the next word with the macro name.
+ * Then then get the next rest of the line to comment or continuation char.
+ * (continuation is not supported)
+ * Finally strip quotes.
+ */
+ sValue = '';
+ do while (lines(sIncludeFile) > 0)
+ sLine = strip(linein(sIncludeFile));
+ if (sLine = '') then
+ iterate;
+ if (substr(sLine, 1, 1) <> '#') then
+ iterate;
+ sLine = substr(sLine, 2);
+ if (word(sLine, 1) <> 'define') then
+ iterate;
+ sLine = strip(substr(sLine, wordpos(sLine, 1) + length('define')+1));
+ if ( substr(sLine, 1, length(sMacro)) <> sMacro,
+ | substr(sLine, length(sMacro)+1, 1) <> ' ') then
+ iterate;
+ sLine = strip(substr(sLine, length(sMacro) + 1));
+ if (sLine = '') then
+ do
+ say 'error: #define' sMacro' is empty.';
+ call stream sIncludeFile, 'c', 'close';
+ exit(-20);
+ end
+
+ chQuote = substr(sLine, 1, 1);
+ if (chQuote = '"' | chQuote = "'") then
+ do /* quoted string */
+ iLastQuote = 0;
+ do forever
+ iLast = pos(chQuote, sLine, 2);
+ if (iLast <= 0) then
+ leave;
+ if (substr(sLine, iLast, 1) = '\') then
+ iterate;
+ iLastQuote = iLast;
+ leave;
+ end
+
+ if (iLastQuote <= 0) then
+ do
+ say 'C/C++ syntax error in 'sIncludefile': didn''t find end quote.';
+ call stream sIncludeFile, 'c', 'close';
+ exit(-20);
+ end
+
+ call stream sIncludeFile, 'c', 'close';
+ sValue = substr(sLine, 2, iLastQuote - 2);
+ say 'Found 'sMacro'='sValue;
+ return sValue;
+ end
+ else
+ do
+ iCommentCPP = pos('//',sLine);
+ iCommentC = pos('/*',sLine);
+ if (iCommentC > 0 & iCommentCPP > 0 & iCommentC > iCommentCPP) then
+ iComment = iCommentCPP;
+ else if (iCommentC > 0 & iCommentCPP > 0 & iCommentC < iCommentCPP) then
+ iComment = iCommentC;
+ else if (iCommentCPP > 0) then
+ iComment = iCommentCPP;
+ else if (iCommentC > 0) then
+ iComment = iCommentC;
+ else
+ iComment = 0;
+
+ if (iComment > 0) then
+ sValue = strip(substr(sLine, 1, iComment-1));
+ else
+ sValue = strip(sLine);
+
+ if (sValue <> '') then
+ do
+ if (substr(sValue, length(sValue)) = '\') then
+ do
+ say 'Found continuation char: Multiline definitions are not supported!\n';
+ call stream sIncludeFile, 'c', 'close';
+ exit(-20);
+ end
+ end
+
+ if (sValue = '') then
+ say 'warning: The #define has no value.';
+
+ call stream sIncludeFile, 'c', 'close';
+ say 'Found 'sMacro'='sValue;
+ return sValue;
+ end
+ end
+
+ call stream sIncludeFile, 'c', 'close';
+ say 'error: didn''t find #define' sMacro'.';
+ exit(-20);
+
+
+
+/**
+ * Reads the description line for a .def-file.
+ * @returns The Description string, with quotes removed.
+ * Empty string is acceptable.
+ * On error we'll terminate the script.
+ * @param sDefFile Filename of .def-file to read the description from.
+ * @param sDefFile2 Used if sDefFile is empty.
+ * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
+ */
+ReadDescription: procedure;
+ parse arg sDefFile, sDefFile2
+
+ /*
+ * Validate parameters.
+ */
+ if (sDefFile = '') then
+ sDefFile = sDefFile2;
+ if (sDefFile = '') then
+ do
+ say 'error: no definition file to get description from.'
+ exit(-1);
+ end
+
+ /*
+ * Open file
+ */
+ rc = stream(sDefFile, 'c', 'open read');
+ if (pos('READY', rc) <> 1) then
+ do
+ say 'error: failed to open deffile file.';
+ exit(-1);
+ end
+
+
+ /*
+ * Search for the 'DESCRIPTION' line.
+ */
+ do while (lines(sDefFile) > 0)
+ sLine = strip(linein(sDefFile));
+ if (sLine = '') then
+ iterate;
+ if (translate(word(sLine, 1)) <> 'DESCRIPTION') then
+ iterate;
+ sLine = strip(substr(sLine, wordpos(sLine, 1) + length('DESCRIPTION')+1));
+
+ ch = substr(sLine, 1, 1);
+ if (ch <> "'" & ch <> '"') then
+ do
+ say 'syntax error: description line in' sDefFile 'is misformed.';
+ call stream sDefFile, 'c', 'close';
+ exit(-10);
+ end
+
+ iEnd = pos(ch, sLine, 2);
+ if (iEnd <= 0) then
+ do
+ say 'syntax error: description line in' sDefFile 'is misformed.';
+ call stream sDefFile, 'c', 'close';
+ exit(-10);
+ end
+
+ call stream sDefFile, 'c', 'close';
+ sValue = substr(sLine, 2, iEnd - 2);
+ say 'Found Description:' sValue;
+ return sValue;
+ end
+
+ call stream sDefFile, 'c', 'close';
+ say 'info: Didn''t find description line in' sDefFile'.';
+ return '';
+
+AddCodeDataSection: procedure
+ parse arg outfile;
+ call lineout outfile,"CODE PRELOAD";
+ call lineout outfile,"DATA MULTIPLE NONSHARED";
+ return '';
+
+findOrdinal: procedure expose ordHash.
+ parse arg line,sOrdinal;
+ line = strip(line,,' ');
+ line = word(translate(strip(line),' ','='),1)
+ if (sOrdinal) then do
+ ordinal = ordHash.line;
+ if (ordinal = 'ORDHASH.'line) then do
+ say 'Oops: DB lacks ordinal for symbol "'line'" Create one!'
+ return ' 'line
+ end
+ else
+ return ' 'line' @ 'ordinal
+ end
+ else
+ return ' 'line
+/**
+ * This is a function which reads sLibrary into an
+ * internal array and changes the DESCRIPTION text if found.
+ * If DESCRIPTION isn't found, it is added at the end.
+ * The array is written to sDBFile.
+ * @returns 0 on succes.
+ * Errorcode on error.
+ * @param sLibrary library stem
+ * @param sDescription New description string.
+ * @param sRealname real 8.3 name of library
+ * @param sOrdinals flag to denote generation of ordinals
+ * @param sInitTerm flag to denote adding INITINSTANCE/TERM... qualifiers
+ * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
+ * @author heavily modified by Platon & Holger
+ */
+UpdateDefFile: procedure expose ordHash.;
+ parse arg sLibrary, sDescription, sRealname, sOrdinals, sInitTerm
+
+ initterm = ''
+ if sInitTerm = 1 then initterm = 'INITINSTANCE TERMINSTANCE'
+
+ /* Open input file. */
+ infile = 'tmpos2.def'
+ rc = stream(infile, 'c', 'open read');
+ if (pos('READY', rc) <> 1) then do
+ say 'error: failed to open' infile 'file.';
+ return 110;
+ end
+ /* open output file. */
+ if sOrdinals = 1 then
+ outfile = sLibrary'o_os2.def'
+ else
+ outfile = sLibrary'os2.def'
+ call SysFileDelete(outfile)
+ rc = stream(outfile, 'c', 'open write');
+ if (pos('READY', rc) <> 1) then do
+ say 'error: failed to open outputfile' outfile 'file.';
+ return 110;
+ end
+ call lineout outfile, '; Created by makedef.cmd on' date() time()'. Do not edit.', 1;
+
+ /*
+ * Search for the specific lines.
+ */
+ fDescription = 0;
+ fExports = 0;
+ fWinLib = 0;
+ do while (lines(infile) > 0)
+ line = strip(linein(infile));
+ line = strip(line,,' ');
+ if line = '' then iterate;
+ if pos('#',line) = 1 then iterate;
+ if pos(';',line) = 1 then iterate;
+ if pos('/*',line) = 1 then iterate;
+
+ firstsym = translate(word(line,1))
+ if firstsym = 'LIBRARY' then do
+ call lineout outfile,'LIBRARY 'sRealName' 'initterm
+ iterate
+ end
+ if firstsym = 'VERSION' then do
+ call lineout outfile, 'DESCRIPTION "'sDescription sLibrary'"'
+ fDescription = 1;
+ AddCodeDataSection(outfile);
+ end
+ if (firstsym = 'EXPORTS') then do
+ call lineout outfile,'EXPORTS'
+ fExports = 1;
+ iterate;
+ end
+ if (fExports) then do
+ call lineout outfile, findOrdinal(line,sOrdinals);
+ iterate;
+ end
+ end
+
+ /*
+ * Add description is none was found.
+ */
+ if (\fDescription) then
+ do
+ call lineout outfile,"DESCRIPTION '"||sDescription sLibrary||"'";
+ AddCodeDataSection(outfile);
+ end
+
+ /*
+ * Close input file and open output file.
+ */
+ call stream outfile, 'c', 'close';
+ call stream infile, 'c', 'close';
+ if sOrdinals = 1 then do
+ call SysFileDelete('dll.name');
+ call stream 'dll.name', 'c', 'open write';
+ call charout 'dll.name', sRealName".dll";
+ call stream 'dll.name', 'c'. 'close';
+ end
+ return 0;
+
diff --git a/nx-X11/config/util/makeg.man b/nx-X11/config/util/makeg.man
new file mode 100644
index 000000000..815031d94
--- /dev/null
+++ b/nx-X11/config/util/makeg.man
@@ -0,0 +1,64 @@
+.\" $Xorg: makeg.man,v 1.4 2001/02/09 02:03:17 xorgcvs Exp $
+.\" Copyright (c) 1996, 1998 The Open Group
+.\"
+.\" 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.
+.\"
+.\"
+.\" $XFree86: xc/config/util/makeg.man,v 1.2 2001/01/27 18:19:55 dawes Exp $
+.\"
+.TH MAKEG 1 __xorgversion__
+.SH NAME
+makeg \- make a debuggable executable
+.SH SYNOPSIS
+.B makeg
+[
+.I make-options .\|.\|.
+] [
+.I targets .\|.\|.
+]
+.SH DESCRIPTION
+The
+.I makeg
+script runs
+.I make,
+passing it variable settings to create a debuggable target when used
+with a Makefile generated by
+.I imake.
+For example, it arranges for the C compiler to be called with the
+.B \-g
+option.
+.SH ENVIRONMENT
+.TP 8
+.B MAKE
+The
+.I make
+program to use. Default ``make''.
+.TP 8
+.B GDB
+Set to a non-null value if using the
+.I gdb
+debugger on Solaris 2, which requires additional debugging options to
+be passed to the compiler.
+.SH "SEE ALSO"
+.I make (1),
+.I imake (1)
diff --git a/nx-X11/config/util/makeg.sh b/nx-X11/config/util/makeg.sh
new file mode 100644
index 000000000..38be8c9e2
--- /dev/null
+++ b/nx-X11/config/util/makeg.sh
@@ -0,0 +1,13 @@
+#! /bin/sh
+# makeg - run "make" with options necessary to make a debuggable executable
+# $Xorg: makeg.sh,v 1.3 2000/08/17 19:41:52 cpqbld Exp $
+
+# set GDB=1 in your environment if using gdb on Solaris 2.
+
+make="${MAKE-make}"
+flags="CDEBUGFLAGS=-g CXXDEBUGFLAGS=-g"
+
+# gdb on Solaris needs the stabs included in the executable
+test "${GDB+yes}" = yes && flags="$flags -xs"
+
+exec "$make" $flags LDSTRIPFLAGS= ${1+"$@"}
diff --git a/nx-X11/config/util/makestrs.c b/nx-X11/config/util/makestrs.c
new file mode 100644
index 000000000..af4b69619
--- /dev/null
+++ b/nx-X11/config/util/makestrs.c
@@ -0,0 +1,752 @@
+/* $XdotOrg: xc/config/util/makestrs.c,v 1.4 2005/05/24 15:58:51 ago Exp $ */
+
+/*
+
+Copyright (c) 1991, 1998 The Open Group
+
+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.
+
+*/
+/* $XFree86: xc/config/util/makestrs.c,v 3.6 2001/07/25 15:04:41 dawes Exp $ */
+
+/* Constructs string definitions */
+
+#include <stdio.h>
+#include <X11/Xos.h>
+#include <stdlib.h>
+#include <unistd.h>
+#if defined(macII) && !defined(__STDC__) /* stdlib.h fails to define these */
+char *malloc();
+#endif /* macII */
+
+typedef struct _TableEnt {
+ struct _TableEnt* next;
+ char* left;
+ char* right;
+ int offset;
+} TableEnt;
+
+typedef struct _Table {
+ struct _Table* next;
+ TableEnt* tableent;
+ TableEnt* tableentcurrent;
+ TableEnt** tableenttail;
+ char* name;
+ int offset;
+} Table;
+
+typedef struct _File {
+ struct _File* next;
+ FILE* tmpl;
+ char* name;
+ Table* table;
+ Table* tablecurrent;
+ Table** tabletail;
+} File;
+
+static File* file = NULL;
+static File* filecurrent = NULL;
+static File** filetail = &file;
+static char* conststr;
+static char* prefixstr = NULL;
+static char* featurestr = NULL;
+static char* ctmplstr = NULL;
+static char* fileprotstr;
+static char* externrefstr;
+static char* externdefstr;
+
+#ifndef FALSE
+# define FALSE 0
+# define TRUE !(FALSE)
+#endif
+
+static int solaris_abi_names = FALSE;
+
+#define X_DEFAULT_ABI 0
+#define X_ARRAYPER_ABI 1
+#define X_INTEL_ABI 2
+#define X_INTEL_ABI_BC 3
+#define X_SPARC_ABI 4
+#define X_FUNCTION_ABI 5
+
+#define X_MAGIC_STRING "<<<STRING_TABLE_GOES_HERE>>>"
+
+/* Wrapper for fopen()
+ * Prepend filename with an includedir which can be specified on the
+ * commandline. Needed to separate source and build directories.
+ */
+static char* includedir = NULL;
+static FILE *ifopen(const char *file, const char *mode)
+{
+ size_t len;
+ char *buffer;
+ FILE *ret;
+
+ if (includedir == NULL)
+ return fopen(file, mode);
+
+ len = strlen(file) + strlen(includedir) + 1;
+ buffer = (char*)malloc(len + 1);
+ if (buffer == NULL)
+ return NULL;
+
+ strcpy(buffer, includedir);
+ strcat(buffer, "/");
+ strcat(buffer, file);
+
+ ret = fopen(buffer, mode);
+
+ free(buffer);
+ return ret;
+}
+
+static void WriteHeaderProlog (FILE *f, File *phile)
+{
+ Table* t;
+ TableEnt* te;
+
+ (void) fprintf (f, "#ifdef %s\n", featurestr);
+ for (t = phile->table; t; t = t->next)
+ for (te = t->tableent; te; te = te->next) {
+ if (strcmp (te->left, "RAtom") == 0) {
+ (void) fprintf (f,
+ "#ifndef %s%s\n#define %s%s \"%s\"\n#endif\n",
+ prefixstr, te->left, prefixstr, te->left, te->right);
+ } else {
+ (void) fprintf (f,
+ "#define %s%s \"%s\"\n",
+ prefixstr, te->left, te->right);
+ }
+ }
+ (void) fprintf (f, "%s", "#else\n");
+}
+
+static void IntelABIWriteHeader (FILE *f, File *phile)
+{
+ Table* t;
+ TableEnt* te;
+
+ WriteHeaderProlog (f, phile);
+
+ for (t = phile->table; t; t = t->next) {
+ (void) fprintf (f, "%s %sConst char %s[];\n",
+ externrefstr, conststr ? conststr : fileprotstr, t->name);
+ for (te = t->tableent; te; te = te->next)
+ (void) fprintf (f,
+ "#ifndef %s%s\n#define %s%s ((char*)&%s[%d])\n#endif\n",
+ prefixstr, te->left, prefixstr, te->left, t->name, te->offset);
+ }
+
+ (void) fprintf (f, "#endif /* %s */\n", featurestr);
+}
+
+static void SPARCABIWriteHeader (FILE *f, File *phile)
+{
+ Table* t;
+ TableEnt* te;
+
+ for (t = phile->table; t; t = t->next)
+ for (te = t->tableent; te; te = te->next)
+ (void) fprintf (f, "#define %s%s \"%s\"\n",
+ prefixstr, te->left, te->right);
+}
+
+static void FunctionWriteHeader (FILE *f, File *phile)
+{
+ Table* t;
+ TableEnt* te;
+
+ WriteHeaderProlog (f, phile);
+
+ (void) fprintf (f, "%s %sConst char* %s();\n",
+ externrefstr, conststr ? conststr : fileprotstr,
+ phile->table->name);
+
+ for (t = phile->table; t; t = t->next)
+ for (te = t->tableent; te; te = te->next)
+ (void) fprintf (f,
+ "#ifndef %s%s\n#define %s%s (%s(%d))\n#endif\n",
+ prefixstr, te->left, prefixstr, te->left, phile->table->name,
+ te->offset);
+
+ (void) fprintf (f, "#endif /* %s */\n", featurestr);
+}
+
+static void ArrayperWriteHeader (FILE *f, File *phile)
+{
+ Table* t;
+ TableEnt* te;
+
+ WriteHeaderProlog (f, phile);
+
+ for (t = phile->table; t; t = t->next)
+ for (te = t->tableent; te; te = te->next)
+ (void) fprintf (f,
+ "#ifndef %s%s\n%s %sConst char %s%s[];\n#endif\n",
+ prefixstr, te->left,
+ externrefstr, conststr ? conststr : fileprotstr,
+ prefixstr, te->left);
+
+ (void) fprintf (f, "#endif /* %s */\n", featurestr);
+}
+
+static void DefaultWriteHeader (FILE *f, File *phile)
+{
+ Table* t;
+ TableEnt* te;
+
+ WriteHeaderProlog (f, phile);
+
+ (void) fprintf (f, "%s %sConst char %s[];\n",
+ externrefstr, conststr ? conststr : fileprotstr,
+ phile->table->name);
+
+ for (t = phile->table; t; t = t->next)
+ for (te = t->tableent; te; te = te->next)
+ (void) fprintf (f,
+ "#ifndef %s%s\n#define %s%s ((char*)&%s[%d])\n#endif\n",
+ prefixstr, te->left, prefixstr, te->left, phile->table->name,
+ te->offset);
+
+ (void) fprintf (f, "#endif /* %s */\n", featurestr);
+}
+
+static void CopyTmplProlog (FILE *tmpl, FILE *f)
+{
+ char buf[1024];
+ static char* magic_string = X_MAGIC_STRING;
+ int magic_string_len = strlen (magic_string);
+
+ while (fgets (buf, sizeof buf, tmpl)) {
+ if (strncmp (buf, magic_string, magic_string_len) == 0) {
+ return;
+ }
+ (void) fputs (buf, f);
+ }
+}
+
+static void CopyTmplEpilog (FILE *tmpl, FILE *f)
+{
+ char buf[1024];
+
+ while (fgets (buf, sizeof buf, tmpl))
+ (void) fputs (buf, f);
+}
+
+static char* abistring[] = {
+ "Default", "Array per string", "Intel", "Intel BC", "SPARC", "Function" };
+
+static void WriteHeader (char *tagline, File *phile, int abi)
+{
+ FILE* f;
+ char* tmp;
+ static void (*headerproc[])(FILE *f, File *phile) = {
+ DefaultWriteHeader, ArrayperWriteHeader,
+ IntelABIWriteHeader, IntelABIWriteHeader,
+ SPARCABIWriteHeader, FunctionWriteHeader };
+
+ if ((f = fopen (phile->name, "w+")) == NULL) exit (1);
+
+ if (phile->tmpl) CopyTmplProlog (phile->tmpl, f);
+
+ (void) fprintf (f,
+ "%s\n%s\n/* %s ABI version -- Do not edit */\n",
+ "/* $Xorg: makestrs.c,v 1.6 2001/02/09 02:03:17 xorgcvs Exp $ */",
+ "/* This file is automatically generated. */",
+ abistring[abi]);
+
+ if (tagline) (void) fprintf (f, "/* %s */\n\n", tagline);
+
+ /* do the right thing for Motif, i.e. avoid _XmXmStrDefs_h_ */
+ if (strcmp (prefixstr, "Xm") == 0) {
+ if ((fileprotstr = malloc (strlen (phile->name) + 3)) == NULL)
+ exit (1);
+ (void) sprintf (fileprotstr, "_%s_", phile->name);
+ } else {
+ if ((fileprotstr = malloc (strlen (phile->name) + strlen (prefixstr) + 3)) == NULL)
+ exit (1);
+ (void) sprintf (fileprotstr, "_%s%s_", prefixstr, phile->name);
+ }
+
+ for (tmp = fileprotstr; *tmp; tmp++) if (*tmp == '.') *tmp = '_';
+
+ (*headerproc[abi])(f, phile);
+
+ if (phile->tmpl) CopyTmplEpilog (phile->tmpl, f);
+
+ (void) free (fileprotstr);
+ (void) fclose (phile->tmpl);
+ (void) fclose (f);
+}
+
+static void WriteSourceLine (TableEnt *te, int abi, int fudge)
+{
+ char* c;
+
+ for (c = te->right; *c; c++) (void) printf ("'%c',", *c);
+ (void) printf ("%c", '0');
+ if (te->next || fudge) (void) printf ("%c", ',');
+ (void) printf ("%s", "\n");
+}
+
+static char* const_string = "%s %sConst char %s[] = {\n";
+
+static void IntelABIWriteSource (int abi)
+{
+ File* phile;
+
+ for (phile = file; phile; phile = phile->next) {
+ Table* t;
+ TableEnt* te;
+
+ for (t = phile->table; t; t = t->next) {
+ (void) printf (const_string, externdefstr,
+ conststr ? conststr : "", t->name);
+ for (te = t->tableent; te; te = te->next)
+ WriteSourceLine (te, abi, 0);
+ (void) printf ("%s\n\n", "};");
+ }
+ }
+}
+
+static void IntelABIBCWriteSource (int abi)
+{
+ File* phile;
+
+ for (phile = file; phile; phile = phile->next) {
+ Table* t;
+ TableEnt* te;
+
+ (void) printf (const_string, externdefstr,
+ conststr ? conststr : "", phile->table->name);
+
+ for (t = phile->table; t; t = t->next)
+ for (te = t->tableent; te; te = te->next)
+ WriteSourceLine (te, abi, t->next ? 1 : 0);
+ (void) printf ("%s\n\n", "};");
+
+ if (phile->table->next) {
+ (void) printf (const_string, externdefstr,
+ conststr ? conststr : "", phile->table->next->name);
+ for (t = phile->table->next; t; t = t->next)
+ for (te = t->tableent; te; te = te->next)
+ WriteSourceLine (te, abi, 0);
+ (void) printf ("%s\n\n", "};");
+ }
+ }
+}
+
+static void FunctionWriteSource (int abi)
+{
+ File* phile;
+
+ for (phile = file; phile; phile = phile->next) {
+ Table* t;
+ TableEnt* te;
+
+ (void) printf ("static %sConst char _%s[] = {\n",
+ conststr ? conststr : "", phile->table->name);
+
+ for (t = phile->table; t; t = t->next)
+ for (te = t->tableent; te; te = te->next)
+ WriteSourceLine (te, abi, t->next ? 1 : 0);
+ (void) printf ("%s\n\n", "};");
+
+ (void) printf ("%sConst char* %s(index)\n int index;\n{\n return &_%s[index];\n}\n\n",
+ conststr ? conststr : "",
+ phile->table->name, phile->table->name);
+ }
+}
+
+static void ArrayperWriteSource (int abi)
+{
+ File* phile;
+ static int done_atom;
+
+ for (phile = file; phile; phile = phile->next) {
+ Table* t;
+ TableEnt* te;
+
+ for (t = phile->table; t; t = t->next)
+ for (te = t->tableent; te; te = te->next) {
+ if (strcmp (te->left, "RAtom") == 0) {
+ if (done_atom) return;
+ done_atom = 1;
+ }
+ (void) printf ("%s %sConst char %s%s[] = \"%s\";\n",
+ externdefstr, conststr ? conststr : "",
+ prefixstr,
+ te->left, te->right);
+ }
+ }
+}
+
+static void DefaultWriteSource (int abi)
+{
+ File* phile;
+
+ for (phile = file; phile; phile = phile->next) {
+ Table* t;
+ TableEnt* te;
+
+ (void) printf (const_string, externdefstr, conststr ? conststr : "",
+ phile->table->name);
+
+ for (t = phile->table; t; t = t->next)
+ for (te = t->tableent; te; te = te->next)
+ WriteSourceLine (te, abi, t->next ? 1 : 0);
+ (void) printf ("%s\n\n", "};");
+ }
+}
+
+static void WriteSource(char *tagline, int abi)
+{
+ static void (*sourceproc[])(int) = {
+ DefaultWriteSource, ArrayperWriteSource,
+ IntelABIWriteSource, IntelABIBCWriteSource,
+ DefaultWriteSource, FunctionWriteSource };
+
+ FILE* tmpl;
+
+ if (ctmplstr) {
+ tmpl = ifopen (ctmplstr, "r");
+
+ if (tmpl) CopyTmplProlog (tmpl, stdout);
+ else {
+ (void) fprintf (stderr, "Expected template %s, not found\n",
+ ctmplstr);
+ exit (1);
+ }
+ } else
+ tmpl = NULL;
+
+
+ (void) printf ("%s\n%s\n/* %s ABI version -- Do not edit */\n",
+ "/* $Xorg: makestrs.c,v 1.6 2001/02/09 02:03:17 xorgcvs Exp $ */",
+ "/* This file is automatically generated. */",
+ abistring[abi]);
+
+ if (tagline) (void) printf ("/* %s */\n\n", tagline);
+
+ (*sourceproc[abi])(abi);
+
+ if (tmpl) CopyTmplEpilog (tmpl, stdout);
+}
+
+static void DoLine(char *buf)
+{
+#define X_NO_TOKEN 0
+#define X_FILE_TOKEN 1
+#define X_TABLE_TOKEN 2
+#define X_PREFIX_TOKEN 3
+#define X_FEATURE_TOKEN 4
+#define X_EXTERNREF_TOKEN 5
+#define X_EXTERNDEF_TOKEN 6
+#define X_CTMPL_TOKEN 7
+#define X_HTMPL_TOKEN 8
+#define X_CONST_TOKEN 9
+
+ int token;
+ char lbuf[1024];
+ static char* file_str = "#file";
+ static char* table_str = "#table";
+ static char* prefix_str = "#prefix";
+ static char* feature_str = "#feature";
+ static char* externref_str = "#externref";
+ static char* externdef_str = "#externdef";
+ static char* ctmpl_str = "#ctmpl";
+ static char* htmpl_str = "#htmpl";
+ static char* const_str = "#const";
+
+ if (strncmp (buf, file_str, strlen (file_str)) == 0)
+ token = X_FILE_TOKEN;
+ else if (strncmp (buf, table_str, strlen (table_str)) == 0)
+ token = X_TABLE_TOKEN;
+ else if (strncmp (buf, prefix_str, strlen (prefix_str)) == 0)
+ token = X_PREFIX_TOKEN;
+ else if (strncmp (buf, feature_str, strlen (feature_str)) == 0)
+ token = X_FEATURE_TOKEN;
+ else if (strncmp (buf, externref_str, strlen (externref_str)) == 0)
+ token = X_EXTERNREF_TOKEN;
+ else if (strncmp (buf, externdef_str, strlen (externdef_str)) == 0)
+ token = X_EXTERNDEF_TOKEN;
+ else if (strncmp (buf, ctmpl_str, strlen (ctmpl_str)) == 0)
+ token = X_CTMPL_TOKEN;
+ else if (strncmp (buf, htmpl_str, strlen (htmpl_str)) == 0)
+ token = X_HTMPL_TOKEN;
+ else if (strncmp (buf, const_str, strlen (const_str)) == 0)
+ token = X_CONST_TOKEN;
+ else
+ token = X_NO_TOKEN;
+
+ switch (token) {
+ case X_FILE_TOKEN:
+ {
+ File* phile;
+
+ if ((phile = (File*) malloc (sizeof(File))) == NULL)
+ exit(1);
+ if ((phile->name = malloc (strlen (buf + strlen (file_str)) + 1)) == NULL)
+ exit(1);
+ (void) strcpy (phile->name, buf + strlen (file_str) + 1);
+ phile->table = NULL;
+ phile->tablecurrent = NULL;
+ phile->tabletail = &phile->table;
+ phile->next = NULL;
+ phile->tmpl = NULL;
+
+ *filetail = phile;
+ filetail = &phile->next;
+ filecurrent = phile;
+ }
+ break;
+ case X_TABLE_TOKEN:
+ {
+ Table* table;
+ if ((table = (Table*) malloc (sizeof(Table))) == NULL)
+ exit(1);
+ if ((table->name = malloc (strlen (buf + strlen (table_str)) + 1)) == NULL)
+ exit(1);
+ (void) strcpy (table->name, buf + strlen (table_str) + 1);
+ if (solaris_abi_names) {
+ if (strcmp(table->name, "XtStringsR6") == 0) {
+ strcpy(table->name, "XtR6Strings");
+ } else if (strcmp(table->name, "XtShellStringsR6") == 0) {
+ strcpy(table->name, "XtR6ShellStrings");
+ }
+ }
+ table->tableent = NULL;
+ table->tableentcurrent = NULL;
+ table->tableenttail = &table->tableent;
+ table->next = NULL;
+ table->offset = 0;
+
+ *filecurrent->tabletail = table;
+ filecurrent->tabletail = &table->next;
+ filecurrent->tablecurrent = table;
+ }
+ break;
+ case X_PREFIX_TOKEN:
+ if ((prefixstr = malloc (strlen (buf + strlen (prefix_str)) + 1)) == NULL)
+ exit(1);
+ (void) strcpy (prefixstr, buf + strlen (prefix_str) + 1);
+ break;
+ case X_FEATURE_TOKEN:
+ if ((featurestr = malloc (strlen (buf + strlen (feature_str)) + 1)) == NULL)
+ exit(1);
+ (void) strcpy (featurestr, buf + strlen (feature_str) + 1);
+ break;
+ case X_EXTERNREF_TOKEN:
+ if ((externrefstr = malloc (strlen (buf + strlen (externref_str)) + 1)) == NULL)
+ exit(1);
+ (void) strcpy (externrefstr, buf + strlen (externref_str) + 1);
+ break;
+ case X_EXTERNDEF_TOKEN:
+ if ((externdefstr = malloc (strlen (buf + strlen (externdef_str)) + 1)) == NULL)
+ exit(1);
+ (void) strcpy (externdefstr, buf + strlen (externdef_str) + 1);
+ break;
+ case X_CTMPL_TOKEN:
+ if ((ctmplstr = malloc (strlen (buf + strlen (ctmpl_str)) + 1)) == NULL)
+ exit(1);
+ (void) strcpy (ctmplstr, buf + strlen (ctmpl_str) + 1);
+ break;
+ case X_HTMPL_TOKEN:
+ if ((filecurrent->tmpl = ifopen (buf + strlen (htmpl_str) + 1, "r")) == NULL) {
+ (void) fprintf (stderr,
+ "Expected template %s, not found\n", htmpl_str);
+ exit (1);
+ }
+ break;
+ case X_CONST_TOKEN:
+ if ((conststr = malloc (strlen (buf + strlen (const_str)) + 1)) == NULL)
+ exit(1);
+ (void) strcpy (conststr, buf + strlen (const_str) + 1);
+ break;
+ default:
+ {
+ char* right;
+ TableEnt* tableent;
+ int llen;
+ int rlen;
+ int len;
+
+ if ((right = index(buf, ' ')))
+ *right++ = 0;
+ else
+ right = buf + 1;
+ if (buf[0] == 'H') {
+ strcpy (lbuf, prefixstr);
+ strcat (lbuf, right);
+ right = lbuf;
+ }
+
+ llen = len = strlen(buf) + 1;
+ rlen = strlen(right) + 1;
+ if (right != buf + 1) len += rlen;
+ if ((tableent = (TableEnt*)malloc(sizeof(TableEnt) + len)) == NULL)
+ exit(1);
+ tableent->left = (char *)(tableent + 1);
+ strcpy(tableent->left, buf);
+ if (llen != len) {
+ tableent->right = tableent->left + llen;
+ strcpy(tableent->right, right);
+ } else {
+ tableent->right = tableent->left + 1;
+ }
+ tableent->next = NULL;
+
+ *filecurrent->tablecurrent->tableenttail = tableent;
+ filecurrent->tablecurrent->tableenttail = &tableent->next;
+ filecurrent->tablecurrent->tableentcurrent = tableent;
+ }
+ break;
+ }
+}
+
+static void IntelABIIndexEntries (File *file)
+{
+ Table* t;
+ TableEnt* te;
+
+ for (t = file->table; t; t = t->next)
+ for (te = t->tableent; te; te = te->next) {
+ te->offset = t->offset;
+ t->offset += strlen (te->right);
+ t->offset++;
+ }
+}
+
+static void DefaultIndexEntries (File *file)
+{
+ Table* t;
+ TableEnt* te;
+ int offset = 0;
+
+ for (t = file->table; t; t = t->next)
+ for (te = t->tableent; te; te = te->next) {
+ te->offset = offset;
+ offset += strlen (te->right);
+ offset++;
+ }
+}
+
+static void IndexEntries (File *file, int abi)
+{
+ switch (abi) {
+ case X_SPARC_ABI:
+ break;
+ case X_INTEL_ABI:
+ case X_INTEL_ABI_BC:
+ IntelABIIndexEntries (file);
+ break;
+ default:
+ DefaultIndexEntries (file);
+ break;
+ }
+}
+
+static char* DoComment (char *line)
+{
+ char* tag;
+ char* eol;
+ char* ret;
+ int len;
+
+ /* assume that the first line with two '$' in it is the RCS tag line */
+ if ((tag = index (line, '$')) == NULL) return NULL;
+ if ((eol = index (tag + 1, '$')) == NULL) return NULL;
+ len = eol - tag;
+ if ((ret = malloc (len)) == NULL)
+ exit (1);
+ (void) strncpy (ret, tag + 1, len - 1);
+ ret[len - 2] = 0;
+ return ret;
+}
+
+int main(int argc, char *argv[])
+{
+ int len, i;
+ char* tagline = NULL;
+ File* phile;
+ FILE *f;
+ char buf[1024];
+ int abi =
+#ifndef ARRAYPERSTR
+ X_DEFAULT_ABI;
+#else
+ X_ARRAYPER_ABI;
+#endif
+
+ f = stdin;
+ if (argc > 1) {
+ for (i = 1; i < argc; i++) {
+ if (strcmp (argv[i], "-f") == 0) {
+ if (++i < argc)
+ f = fopen (argv[i], "r");
+ else
+ return 1;
+ }
+ if (strcmp (argv[i], "-i") == 0) {
+ if (++i < argc)
+ includedir = argv[i];
+ else
+ return 1;
+ }
+ if (strcmp (argv[i], "-sparcabi") == 0)
+ abi = X_SPARC_ABI;
+ if (strcmp (argv[i], "-intelabi") == 0)
+ abi = X_INTEL_ABI;
+ if (strcmp (argv[i], "-functionabi") == 0)
+ abi = X_FUNCTION_ABI;
+ if (strcmp (argv[i], "-earlyR6bc") == 0 && abi == X_INTEL_ABI)
+ abi = X_INTEL_ABI_BC;
+ if (strcmp (argv[i], "-arrayperabi") == 0)
+ abi = X_ARRAYPER_ABI;
+#ifdef ARRAYPERSTR
+ if (strcmp (argv[i], "-defaultabi") == 0)
+ abi = X_DEFAULT_ABI;
+#endif
+ if (strcmp (argv[i], "-solarisabinames") == 0)
+ solaris_abi_names = TRUE;
+ }
+ }
+
+ if (f == NULL) return 1;
+ while (fgets(buf, sizeof buf, f)) {
+ if (!buf[0] || buf[0] == '\n')
+ continue;
+ if (buf[0] == '!') {
+ if (tagline) continue;
+ tagline = DoComment (buf);
+ continue;
+ }
+ if (buf[(len = strlen (buf) - 1)] == '\n') buf[len] = '\0';
+ DoLine(buf);
+ }
+ for (phile = file; phile; phile = phile->next) {
+ if (abi != X_ARRAYPER_ABI) IndexEntries (phile, abi);
+ WriteHeader (tagline, phile, abi);
+ }
+ WriteSource(tagline, abi);
+ return 0;
+}
+
diff --git a/nx-X11/config/util/makestrs.man b/nx-X11/config/util/makestrs.man
new file mode 100644
index 000000000..cd9684114
--- /dev/null
+++ b/nx-X11/config/util/makestrs.man
@@ -0,0 +1,219 @@
+.\" $Xorg: makestrs.man,v 1.4 2001/02/09 02:03:17 xorgcvs Exp $
+.\" Copyright (c) 1993, 1994, 1998 The Open Group
+.\"
+.\" 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
+.\" dealing in this Software without prior written authorization from The
+.\" Open Group.
+.\"
+.\" $XFree86: xc/config/util/makestrs.man,v 3.8 2001/12/14 19:53:22 dawes Exp $
+.\"
+.TH MAKESTRS 1 __xorgversion__
+.SH NAME
+makestrs \- makes string table C source and header(s)
+.SH SYNOPSIS
+.B makestrs [-f source] [-i includedir] [-abioptions ...]
+.SH DESCRIPTION
+The
+.I makestrs
+command creates string table C source files and headers.
+If
+.I -f
+.I source
+is not specified
+.I makestrs
+will read from
+.I stdin.
+The C source file is always written to
+.I stdout.
+.I makestrs
+creates one or more C header files as specified in the source file.
+The following options may be specified:
+.I -sparcabi,
+.I -intelabi,
+.I -functionabi,
+.I -arrayperabi,
+and
+.I -defaultabi.
+.LP
+.I -sparcabi
+is used on SPARC platforms conforming to the SPARC
+Compliance Definition, i.e. SVR4/Solaris.
+.LP
+.I -intelabi
+is used on Intel platforms conforming to the System
+V Application Binary Interface, i.e. SVR4.
+.LP
+.I -earlyR6abi
+may be used in addition to
+.I -intelabi
+for situations
+where the vendor wishes to maintain binary compatibility between
+X11R6 public-patch 11 (and earlier) and X11R6 public-patch 12 (and later).
+.LP
+.I -functionabi
+generates a functional abi to the string table. This
+mechanism imposes a severe performance penalty and it's recommended
+that you not use it.
+.LP
+.I -arrayperabi
+results in a separate array for each string. This is
+the default behavior if makestrs was compiled with -DARRAYPERSTR
+(it almost never is).
+.LP
+.I -defaultabi
+forces the generation of the "normal" string table even
+if makestrs was compiled with -DARRAYPERSTR. Since makestrs is almost
+never compiled with -DARRAYPERSTR this is the default behavior if
+no abioptions are specified.
+.LP
+.I -i includedir
+forces the reading of templates from the includedir instead of the local
+directory. This is useful to have separate source and build directories.
+.SH SYNTAX
+The syntax for string-list file is (items in square brackets are optional):
+.RS 4
+\&#prefix <text>
+.RE
+.RS 4
+\&#feature <text>
+.RE
+.RS 4
+\&#externref <text>
+.RE
+.RS 4
+\&#externdef [<text>]
+.RE
+.RS 4
+[#ctempl <text>]
+.RE
+.LP
+.RS 4
+\&#file <filename>
+.RE
+.RS 4
+\&#table <tablename>
+.RE
+.RS 4
+[#htempl]
+.RE
+.RS 4
+<text>
+.RE
+.RS 4
+...
+.RE
+.RS 4
+<text>
+.RE
+.RS 4
+[#table <tablename>
+.RE
+.RS 4
+<text>
+.RE
+.RS 4
+...
+.RE
+.RS 4
+<text>
+.RE
+.RS 4
+ ...
+.RE
+.RS 4
+\&#table <tablename>
+.RE
+.RS 4
+ ...]
+.RE
+.RS 4
+[#file <filename>
+.RE
+.RS 4
+ ...]
+.RE
+.LP
+In words you may have one or more #file directives. Each #file may have
+one or more #table directives.
+.LP
+The #prefix directive determines the string that makestr will prefix
+to each definition.
+.LP
+The #feature directive determines the string that makestr will use
+for the feature-test macro, e.g. X[TM]STRINGDEFINES.
+.LP
+The #externref directive determines the string that makestr will use
+for the extern clause, typically this will be "extern" but Motif wants
+it to be "externalref"
+.LP
+The #externdef directive determines the string that makestr will use
+for the declaration, typically this will be the null string (note that
+makestrs requires a trailing space in this case, i.e. "#externdef "),
+and Motif will use "externaldef(_xmstrings).
+.LP
+The #ctmpl directive determines the name of the file used as a template
+for the C source file that is generated
+.LP
+Each #file <filename> directive will result in a corresponding header
+file by that name containing the appropriate definitions as specified
+by command line options. A single C source file containing the
+declarations for the definitions in all the headers will be printed
+to stdout.
+.LP
+The #htmpl directive determines the name of the file used as a template
+for the C header file that is generated.
+.LP
+Each #table <tablename> directive will be processed in accordance with
+the ABI. On most platforms all tables will be catenated into a single
+table with the name of the first table for that file. To conform to
+the Intel ABI separate tables will be generated with the names indicated.
+.LP
+The template files specified by the #ctmpl and #htmpl directives
+are processed by copying line for line from the template file to
+the appropriate output file. The line containing the string
+.I <<<STRING_TABLE_GOES_HERE>>>
+is not copied to the output file. The appropriate data is then
+copied to the output file and then the remainder of the template
+file is copied to the output file.
+.SH BUGS
+makestrs is not very forgiving of syntax errors. Sometimes you need
+a trailing space after # directives, other times they will mess you
+up. No warning messages are emitted.
+.SH SEE ALSO
+SPARC Compliance Definition 2.2., SPARC International Inc.,
+535 Middlefield Road, Suite 210, Menlo Park, CA 94025
+.LP
+System V Application Binary Interface, Third Edition,
+ISBN 0-13-100439-5
+UNIX Press, PTR Prentice Hall, 113 Sylvan Avenue, Englewood Cliffs,
+NJ 07632
+.LP
+System V Application Binary Interface, Third Edition, Intel386
+Architecture Processor Supplement
+ISBN 0-13-104670-5
+UNIX Press, PTR Prentice Hall, 113 Sylvan Avenue, Englewood Cliffs,
+NJ 07632
+.LP
+System V Application Binary Interface, Third Edition, SPARC
+Architecture Processor Supplement
+ISBN 0-13-104696-9
+UNIX Press, PTR Prentice Hall, 113 Sylvan Avenue, Englewood Cliffs,
+NJ 07632
diff --git a/nx-X11/config/util/mdepend.cpp b/nx-X11/config/util/mdepend.cpp
new file mode 100644
index 000000000..35cab0b22
--- /dev/null
+++ b/nx-X11/config/util/mdepend.cpp
@@ -0,0 +1,286 @@
+XCOMM!/bin/sh
+XCOMM
+XCOMM $Xorg: mdepend.cpp,v 1.3 2000/08/17 19:41:52 cpqbld Exp $
+XCOMM $XdotOrg: xc/config/util/mdepend.cpp,v 1.4 2005/08/26 05:01:37 daniels Exp $
+XCOMM
+XCOMM Do the equivalent of the 'makedepend' program, but do it right.
+XCOMM
+XCOMM Usage:
+XCOMM
+XCOMM makedepend [cpp-flags] [-w width] [-s magic-string] [-f makefile]
+XCOMM [-o object-suffix] [-v] [-a] [-cc compiler] [-d dependencyflag]
+XCOMM
+XCOMM Notes:
+XCOMM
+XCOMM The C compiler used can be overridden with the environment
+XCOMM variable "CC" or the command line flag -cc.
+XCOMM
+XCOMM The "-v" switch of the "makedepend" program is not supported.
+XCOMM
+XCOMM
+XCOMM This script should
+XCOMM work on both USG and BSD systems. However, when System V.4 comes out,
+XCOMM USG users will probably have to change "silent" to "-s" instead of
+XCOMM "-" (at least, that is what the documentation implies).
+XCOMM
+XCOMM $XFree86: xc/config/util/mdepend.cpp,v 3.9 2001/04/26 20:55:10 dawes Exp $
+XCOMM
+
+CC=PREPROC
+
+silent='-'
+
+TMP=`pwd`/.mdep$$
+
+rm -rf ${TMP}
+if ! mkdir -p ${TMP}; then
+ echo "$0: cannot create ${TMP}, exit." >&2
+fi
+
+CPPCMD=${TMP}/a
+DEPENDLINES=${TMP}/b
+TMPMAKEFILE=${TMP}/c
+MAGICLINE=${TMP}/d
+ARGS=${TMP}/e
+
+trap "rm -rf ${TMP}; exit 1" 1 2 15
+trap "rm -rf ${TMP}; exit 0" 1 2 13
+
+echo " \c" > $CPPCMD
+if [ `wc -c < $CPPCMD` -eq 1 ]
+then
+ c="\c"
+ n=
+else
+ c=
+ n="-n"
+fi
+
+echo $n "$c" >$ARGS
+
+files=
+makefile=
+magic_string='# DO NOT DELETE'
+objsuffix='.o'
+width=78
+endmarker=""
+verbose=n
+append=n
+compilerlistsdepends=n
+
+while [ $# != 0 ]
+do
+ if [ "$endmarker"x != x ] && [ "$endmarker" = "$1" ]; then
+ endmarker=""
+ else
+ case "$1" in
+ -D*|-I*|-U*)
+ echo $n " '$1'$c" >> $ARGS
+ ;;
+
+ -g|-O) # ignore so we can just pass $(CFLAGS) in
+ ;;
+
+ *)
+ if [ "$endmarker"x = x ]; then
+ case "$1" in
+ -w)
+ width="$2"
+ shift
+ ;;
+ -s)
+ magic_string="$2"
+ shift
+ ;;
+ -f*)
+ if [ "$1" = "-f-" ]; then
+ makefile="-"
+ elif [ "$1" = "-f" ]; then
+ makefile="$2"
+ shift
+ else
+ echo "$1" | sed 's/^\-f//' >${TMP}arg
+ makefile="`cat ${TMP}arg`"
+ rm -f ${TMP}arg
+ fi
+ ;;
+ -o)
+ objsuffix="$2"
+ shift
+ ;;
+
+ --*)
+ echo "$1" | sed 's/^\-\-//' >${TMP}end
+ endmarker="`cat ${TMP}end`"
+ rm -f ${TMP}end
+ if [ "$endmarker"x = x ]; then
+ endmarker="--"
+ fi
+ ;;
+ -v)
+ verbose="y"
+ ;;
+
+ -a)
+ append="y"
+ ;;
+
+ -cc)
+ CC="$2"
+ shift
+ ;;
+
+ # Flag to tell compiler to output dependencies directly
+ # For example, with Sun compilers, -xM or -xM1 or
+ # with gcc, -M
+ -d)
+ compilerlistsdepends="y"
+ compilerlistdependsflag="$2"
+ shift
+ ;;
+
+ -*)
+ echo "Unknown option '$1' ignored" 1>&2
+ ;;
+ *)
+ files="$files $1"
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ fi
+ shift
+done
+echo ' $*' >> $ARGS
+
+if [ "$compilerlistsdepends"x = "y"x ] ; then
+ CC="$CC $compilerlistdependsflag"
+fi
+
+echo "#!/bin/sh" > $CPPCMD
+echo "exec $CC `cat $ARGS`" >> $CPPCMD
+chmod +x $CPPCMD
+rm $ARGS
+
+case "$makefile" in
+ '')
+ if [ -r makefile ]
+ then
+ makefile=makefile
+ elif [ -r Makefile ]
+ then
+ makefile=Makefile
+ else
+ echo 'no makefile or Makefile found' 1>&2
+ exit 1
+ fi
+ ;;
+ -)
+ makefile=$TMPMAKEFILE
+ ;;
+esac
+
+if [ "$verbose"x = "y"x ]; then
+ cat $CPPCMD
+fi
+
+echo '' > $DEPENDLINES
+
+if [ "$compilerlistsdepends"x = "y"x ] ; then
+ for i in $files
+ do
+ $CPPCMD $i >> $DEPENDLINES
+ done
+else
+for i in $files
+do
+ $CPPCMD $i \
+ | sed -n "/^#/s;^;$i ;p"
+done \
+ | sed -e 's|/[^/.][^/]*/\.\.||g' -e 's|/\.[^.][^/]*/\.\.||g' \
+ -e 's|"||g' -e 's| \./| |' \
+ | awk '{
+ if ($1 != $4 && $2 != "#ident" && $2 != "#pragma")
+ {
+ numparts = split( $1, ofileparts, "\." )
+ ofile = ""
+ for ( i = 1; i < numparts; i = i+1 )
+ {
+ if (i != 1 )
+ ofile = ofile "."
+ ofile = ofile ofileparts[i]
+ }
+ print ofile "'"$objsuffix"'", $4
+ }
+ }' \
+ | sort -u \
+ | awk '
+ {
+ newrec = rec " " $2
+ if ($1 != old1)
+ {
+ old1 = $1
+ if (rec != "")
+ print rec
+ rec = $1 ": " $2
+ }
+ else if (length (newrec) > '"$width"')
+ {
+ print rec
+ rec = $1 ": " $2
+ }
+ else
+ rec = newrec
+ }
+ END \
+ {
+ if (rec != "")
+ print rec
+ }' \
+ | egrep -v '^[^:]*:[ ]*$' >> $DEPENDLINES
+fi
+
+trap "" 1 2 13 15 # Now we are committed
+case "$makefile" in
+ $TMPMAKEFILE)
+ ;;
+ *)
+ rm -f $makefile.bak
+ cp $makefile $makefile.bak
+ echo "Appending dependencies to $makefile"
+ ;;
+esac
+
+XCOMM
+XCOMM If not -a, append the magic string and a blank line so that
+XCOMM /^$magic_string/+1,\$d can be used to delete everything from after
+XCOMM the magic string to the end of the file. Then, append a blank
+XCOMM line again and then the dependencies.
+XCOMM
+if [ "$append" = "n" ]
+then
+ cat >> $makefile << END_OF_APPEND
+
+$magic_string
+
+END_OF_APPEND
+ ed $silent $makefile << END_OF_ED_SCRIPT
+/^$magic_string/+1,\$d
+w
+q
+END_OF_ED_SCRIPT
+ echo '' >>$makefile
+fi
+
+cat $DEPENDLINES >>$makefile
+
+case "$makefile" in
+ $TMPMAKEFILE)
+ cat $TMPMAKEFILE
+ ;;
+
+esac
+
+rm -rf ${TMP}*
+exit 0
diff --git a/nx-X11/config/util/mergelib.cpp b/nx-X11/config/util/mergelib.cpp
new file mode 100644
index 000000000..1c7cc6470
--- /dev/null
+++ b/nx-X11/config/util/mergelib.cpp
@@ -0,0 +1,105 @@
+XCOMM!/bin/sh
+XCOMM
+XCOMM $Xorg: mergelib.cpp,v 1.4 2001/02/09 02:03:17 xorgcvs Exp $
+XCOMM
+XCOMM Copyright (c) 1989, 1998 The Open Group
+XCOMM
+XCOMM Permission to use, copy, modify, distribute, and sell this software and
+XCOMM its documentation for any purpose is hereby granted without fee, provided
+XCOMM that the above copyright notice appear in all copies and that both that
+XCOMM copyright notice and this permission notice appear in supporting
+XCOMM documentation.
+XCOMM
+XCOMM The above copyright notice and this permission notice shall be included in
+XCOMM all copies or substantial portions of the Software.
+XCOMM
+XCOMM THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+XCOMM IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+XCOMM FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+XCOMM OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+XCOMM AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+XCOMM CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+XCOMM
+XCOMM Except as contained in this notice, the name of The Open Group shall not be
+XCOMM used in advertising or otherwise to promote the sale, use or other dealings
+XCOMM in this Software without prior written authorization from The Open Group.
+XCOMM
+XCOMM Author: Jim Fulton, MIT X Consortium
+XCOMM
+XCOMM mergelib - merge one library into another; this is commonly used by X
+XCOMM to add the extension library into the base Xlib.
+XCOMM
+
+usage="usage: $0 to-library from-library [object-filename-prefix]"
+objprefix=_
+
+case $# in
+ 2) ;;
+ 3) objprefix=$3 ;;
+ *) echo "$usage" 1>&2; exit 1 ;;
+esac
+
+tolib=$1
+fromlib=$2
+
+if [ ! -f $fromlib ]; then
+ echo "$0: no such from-library $fromlib" 1>&2
+ exit 1
+fi
+
+if [ ! -f $tolib ]; then
+ echo "$0: no such to-library $tolib" 1>&2
+ exit 1
+fi
+
+
+XCOMM
+XCOMM Create a temp directory, and figure out how to reference the
+XCOMM object files from it (i.e. relative vs. absolute path names).
+XCOMM
+
+tmpdir=tmp.$$
+origdir=..
+
+XCOMM Remove directory if we fail
+trap "rm -rf $tmpdir; exit 1" 1 2 15
+trap "rm -rf $tmpdir; exit 0" 1 2 13
+
+mkdir $tmpdir
+
+XCOMM Security: if $tmpdir exists before mkdir exit immediately
+if [ $? -gt 0 -o ! -d $tmpdir ]; then
+ echo "$0: unable to create temporary directory $tmpdir" 1>&2
+ exit 1
+fi
+
+case "$fromlib" in
+ /?*) upfrom= ;;
+ *) upfrom=../ ;;
+esac
+
+case "$tolib" in
+ /?*) upto= ;;
+ *) upto=../ ;;
+esac
+
+
+XCOMM
+XCOMM In the temp directory, extract all of the object files and prefix
+XCOMM them with some symbol to avoid name clashes with the base library.
+XCOMM
+cd $tmpdir || exit 1
+ar x ${upfrom}$fromlib
+for i in *.o; do
+ mv $i ${objprefix}$i
+done
+
+
+XCOMM
+XCOMM Merge in the object modules, ranlib (if appropriate) and cleanup
+XCOMM
+ARCMD ${upto}$tolib *.o
+RANLIB ${upto}$tolib
+cd $origdir
+rm -rf $tmpdir
+
diff --git a/nx-X11/config/util/mergelib.man b/nx-X11/config/util/mergelib.man
new file mode 100644
index 000000000..768516648
--- /dev/null
+++ b/nx-X11/config/util/mergelib.man
@@ -0,0 +1,28 @@
+.\" $XFree86$
+.\" shorthand for double quote that works everywhere.
+.ds q \N'34'
+.TH MERGELIB 1 __xorgversion__
+.SH NAME
+mergelib \- merge one library into another
+.SH SYNOPSIS
+.B mergelib
+.I to-library
+.I from-library
+.RI [ object-filename-prefix ]
+.SH DESCRIPTION
+The
+.I mergelib
+program merges objects from one library into another.
+The names of object files in
+.I from-library
+will be prefixed by
+.I object-filename-prefix
+(\*q_\*q by default) to avoid name clashes.
+The merged library will be left in
+.IR to-library .
+.SH AUTHOR
+Jim Fulton wrote the
+.I mergelib
+program for the X Consortium.
+.PP
+Colin Watson wrote this manual page, originally for the Debian Project.
diff --git a/nx-X11/config/util/mkdirhier.c b/nx-X11/config/util/mkdirhier.c
new file mode 100644
index 000000000..61207b541
--- /dev/null
+++ b/nx-X11/config/util/mkdirhier.c
@@ -0,0 +1,80 @@
+/* $Xorg: mkdirhier.c,v 1.4 2001/02/09 02:03:17 xorgcvs Exp $ */
+/*
+
+Copyright (C) 1996, 1998 The Open Group
+
+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.
+
+*/
+/* $XFree86$ */
+
+/*
+ * Simple mkdirhier program for Windows NT
+ */
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifndef __UNIXOS2__
+#include <direct.h>
+#else
+#include <dirent.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+
+char *
+next_sep(char *path)
+{
+ while (*path)
+ if (*path == '/' || *path == '\\')
+ return path;
+ else
+ path++;
+ return NULL;
+}
+
+int
+main(int argc, char *argv[])
+{
+ char *dirname, *next, *prev;
+ char buf[1024];
+ struct _stat sb;
+
+ if (argc < 2)
+ exit(1);
+ dirname = argv[1];
+
+ prev = dirname;
+ while (next = next_sep(prev)) {
+ strncpy(buf, dirname, next - dirname);
+ buf[next - dirname] = '\0';
+ /* if parent dir doesn't exist yet create it */
+ if (_stat(buf, &sb))
+ _mkdir(buf); /* no error checking to avoid barfing on C: */
+ prev = next + 1;
+ }
+ if (_mkdir(dirname) == -1) {
+ perror("mkdirhier failed");
+ exit(1);
+ }
+ exit(0);
+}
diff --git a/nx-X11/config/util/mkdirhier.cmd b/nx-X11/config/util/mkdirhier.cmd
new file mode 100644
index 000000000..9ee8fa791
--- /dev/null
+++ b/nx-X11/config/util/mkdirhier.cmd
@@ -0,0 +1,54 @@
+/* OS/2 REXX SCRIPT */
+/* $XFree86: xc/config/util/mkdirhier.cmd,v 3.1 1996/02/09 08:18:04 dawes Exp $ */
+
+CALL RxFuncAdd 'SysMkDir', 'RexxUtil', 'SysMkDir'
+
+IF ARG() = 0 THEN DO
+ SAY "mkdirhier: usage: mkdirhier directory ..."
+ EXIT 1
+END
+
+curdir=DIRECTORY()
+drive=DELSTR(curdir,3)
+
+status=""
+PARSE ARG all
+
+DO i=1 TO WORDS(all)
+ direc = TRANSLATE(WORD(all,i),'/','\')
+ SELECT
+ WHEN direc = "" THEN DO
+ SAY "mkdirhier: empty directory name"
+ status=1
+ ITERATE
+ END
+ WHEN POS('0a'x,direc) > 0 THEN DO
+ SAY "mkdirhier: directory name contains a newline: '" direc "'"
+ status=1
+ ITERATE
+ END
+ OTHERWISE NOP
+ END
+ IF POS(":",direc) = 0 THEN direc = INSERT(drive,direc)
+
+ dirbuf.0 = direc
+ DO k=1 TO 1000
+ direc1 = STRIP(direc,"t","/")
+ dpath1 = FILESPEC("path",direc1)
+ dirbuf.k=FILESPEC("drive",direc1)||STRIP(dpath1,"t","/")
+ IF POS("/",dirbuf.k) = 0 THEN LEAVE k
+ direc=dirbuf.k
+ END
+ DO m=k-1 TO 0 BY -1
+ dospath = TRANSLATE(dirbuf.m,'\','/')
+ targetdir=DIRECTORY(dospath)
+ IF targetdir = dospath THEN
+ NOP
+ ELSE
+ CALL SysMkDir(dospath)
+ CALL DIRECTORY curdir
+ END
+END
+
+
+EXIT status
diff --git a/nx-X11/config/util/mkdirhier.man b/nx-X11/config/util/mkdirhier.man
new file mode 100644
index 000000000..4ad475e62
--- /dev/null
+++ b/nx-X11/config/util/mkdirhier.man
@@ -0,0 +1,42 @@
+.\" $Xorg: mkdirhier.man,v 1.4 2001/02/09 02:03:17 xorgcvs Exp $
+.\" Copyright (c) 1993, 1994, 1998 The Open Group
+.\"
+.\" 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
+.\" dealing in this Software without prior written authorization from The
+.\" Open Group.
+.\"
+.\" $XFree86: xc/config/util/mkdirhier.man,v 1.2 2001/01/27 18:19:55 dawes Exp $
+.\"
+.TH MKDIRHIER 1 __xorgversion__
+.SH NAME
+mkdirhier \- makes a directory hierarchy
+.SH SYNOPSIS
+.B mkdirhier
+directory ...
+.SH DESCRIPTION
+The
+.I mkdirhier
+command creates the specified directories. Unlike
+.I mkdir
+if any of the parent directories of the specified directory
+do not exist, it creates them as well.
+.SH "SEE ALSO"
+mkdir(1)
diff --git a/nx-X11/config/util/mkdirhier.sh b/nx-X11/config/util/mkdirhier.sh
new file mode 100644
index 000000000..09b89ee9d
--- /dev/null
+++ b/nx-X11/config/util/mkdirhier.sh
@@ -0,0 +1,67 @@
+#!/bin/sh
+# $Xorg: mkdirhier.sh,v 1.3 2000/08/17 19:41:53 cpqbld Exp $
+# Courtesy of Paul Eggert
+
+newline='
+'
+IFS=$newline
+
+case ${1--} in
+-*) echo >&2 "mkdirhier: usage: mkdirhier directory ..."; exit 1
+esac
+
+status=
+
+for directory
+do
+ case $directory in
+ '')
+ echo >&2 "mkdirhier: empty directory name"
+ status=1
+ continue;;
+ *"$newline"*)
+ echo >&2 "mkdirhier: directory name contains a newline: \`\`$directory''"
+ status=1
+ continue;;
+ ///*) prefix=/;; # See Posix 2.3 "path".
+ //*) prefix=//;;
+ /*) prefix=/;;
+ -*) prefix=./;;
+ *) prefix=
+ esac
+
+ IFS=/
+ set x $directory
+ case $2 in
+ */*) # IFS parsing is broken
+ IFS=' '
+ set x `echo $directory | tr / ' '`
+ ;;
+ esac
+ IFS=$newline
+ shift
+
+ for filename
+ do
+ path=$prefix$filename
+ prefix=$path/
+ shift
+
+ test -d "$path" || {
+ paths=$path
+ for filename
+ do
+ if [ -n "$filename" -a "$filename" != "." ]; then
+ path=$path/$filename
+ paths=$paths$newline$path
+ fi
+ done
+
+ mkdir $paths || status=$?
+
+ break
+ }
+ done
+ done
+
+exit $status
diff --git a/nx-X11/config/util/mkhtmlindex.man b/nx-X11/config/util/mkhtmlindex.man
new file mode 100644
index 000000000..fc8a4276b
--- /dev/null
+++ b/nx-X11/config/util/mkhtmlindex.man
@@ -0,0 +1,32 @@
+.TH mkhtmlindex 1 __vendorversion__
+.SH NAME
+mkhtmlindex \- generate index files for HTML man pages
+.SH SYNOPSIS
+.B mkhtmlindex
+.I htmlmandir
+.SH DESCRIPTION
+The
+.I mkhtmlindex
+program generates index files for a directory of HTML-formatted manual
+pages.
+It searches for files whose names are of the form \(lqname.1.html\(rq,
+and outputs index files \(lqmanindex1.html\(rq, \(lqmanindex.2.html\(rq,
+and so on, one for each manual volume.
+Empty index files will be removed.
+Names and descriptions are found by scanning the first
+.I <H2>
+section of each page.
+.SH OPTIONS
+.I mkhtmlindex
+takes only one argument: the directory to process.
+.SH NOTES
+This utility is currently rather specific to X manual pages.
+In particular, the format of the index files it outputs is not configurable,
+nor is the HTML formatting it expects of manual pages.
+.SH AUTHOR
+The version of the
+.I mkhtmlindex
+included in this X.Org Foundation release was originally written
+by David Dawes wrote as a part of XFree86.
+.PP
+Colin Watson wrote this manual page, originally for the Debian Project.
diff --git a/nx-X11/config/util/mkhtmlindex.pl b/nx-X11/config/util/mkhtmlindex.pl
new file mode 100644
index 000000000..10030910e
--- /dev/null
+++ b/nx-X11/config/util/mkhtmlindex.pl
@@ -0,0 +1,103 @@
+#!/usr/bin/perl
+#
+# $XFree86: xc/config/util/mkhtmlindex.pl,v 1.2 2001/03/15 19:02:31 dawes Exp $
+#
+# Copyright © 2000,2001 by VA Linux Systems, Inc.
+#
+# Generate index files for HTML man pages.
+#
+# Author: David Dawes <dawes@xfree86.org>
+#
+
+#
+# Best viewed with tabs set to 4
+#
+
+if ($#ARGV ne 0) {
+ print STDERR "Usage: mkhtmlindex.pl htmlmandir\n";
+ exit 1;
+}
+
+$dir = $ARGV[0];
+
+if (! -d $dir) {
+ print STDERR "$dir is not a directory\n";
+ exit 1;
+}
+
+@vollist = ("1", "2", "3", "4", "5", "6", "7", "8", "9", "o", "l", "n", "p");
+
+$indexprefix = "manindex";
+
+foreach $vol (@vollist) {
+ $empty = "yes";
+ $indexname="$dir/$indexprefix$vol.html";
+
+ # print "Processing volume $vol\n";
+
+ open(mindex, ">$indexname") || die "Can't create $indexname";
+ opendir(dir, "$dir") || die "Can't open $dir";
+
+ print mindex <<EOF;
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<HTML>
+<HEAD>
+<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
+<TITLE>X.Org Manual pages: Section $vol</TITLE>
+</HEAD>
+<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
+
+<H1>X.Org Manual pages: Section $vol</H1>
+<P>
+<UL>
+EOF
+
+ foreach $file (sort readdir dir) {
+ if ($file =~ "\.$vol\.html") {
+ open(file, "<$dir/$file") || die "Can't open $dir/$file";
+ while (<file>) {
+ chop;
+ if (/^<[hH]2>/) {
+ if (! /<\/[hH]2>$/) {
+ while (<file> && ! /<\/[hH]2>$/) {
+ ;
+ }
+ }
+ $heading = "";
+ while (<file>) {
+ if (/^<[hH]2>/) {
+ last;
+ }
+ $heading = "$heading" . "$_";
+ }
+ if ($heading) {
+ undef $empty;
+ $heading =~ s/--/-/;
+ ($name, $descr) = split(/-/, $heading, 2);
+ $file =~ /(.*)\.$vol\.html/;
+ $fname = $1;
+ $descr =~ s/<[pP]>//g;
+ print mindex
+ "<LI><A href=\"$file\">$fname</A> - $descr</LI>";
+ }
+ last;
+ }
+ }
+ close file;
+ }
+ }
+
+ print mindex <<EOF;
+</UL>
+<P>
+</BODY>
+</HTML>
+EOF
+
+ close mindex;
+ closedir dir;
+ if (defined $empty) {
+ # print "Removing empty $indexname\n";
+ unlink $indexname;
+ }
+}
diff --git a/nx-X11/config/util/mkhtmlindex.sh b/nx-X11/config/util/mkhtmlindex.sh
new file mode 100644
index 000000000..ab1c894ea
--- /dev/null
+++ b/nx-X11/config/util/mkhtmlindex.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+#
+# $XFree86: xc/config/util/mkhtmlindex.sh,v 1.3 2000/08/26 04:30:49 dawes Exp $
+#
+# Copyright © 2000 by Precision Insight, Inc.
+#
+# Generate index files for the HTML man pages
+#
+# Author: David Dawes <dawes@xfree86.org>
+#
+
+VOLLIST="1 2 3 4 5 6 7 8 9 o l n p"
+INDEX="manindex"
+
+if [ $# != 1 ]; then
+ echo Usage: $0 htmlmandir
+ exit 1
+fi
+
+if [ ! -d $1 ]; then
+ echo $1 is not a directory
+ exit 1
+fi
+
+cd $1
+
+for s in $VOLLIST; do
+ list="`ls *.$s.html 2> /dev/null`" || : # ignore failed glob expansion
+ if [ X"$list" != X ]; then
+ file=$INDEX$s.html
+ rm -f $file
+ cat <<EOF > $file
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<HTML>
+<HEAD>
+<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
+<TITLE>X.Org Manual pages: Section $s</TITLE>
+</HEAD>
+<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
+
+<H1>X.Org Manual pages: Section $s</H1>
+<P>
+<UL>
+EOF
+ for i in $list; do
+ title="`sed -e '/^[^0-9A-Za-z]/d' -e '/^$/' -e '/^Name/d' -e q $i`"
+ name="`echo \"$title\" | sed -e 's/ - .*//'`"
+ desc="`echo \"$title\" | sed -e 's/[^-]* - //' -e 's/<P>//'`"
+ echo "<LI><A href=\"$i\">$name</A> - $desc</LI>" >> $file
+ done
+ cat <<EOF >> $file
+</UL>
+<P>
+</BODY>
+</HTML>
+EOF
+ fi
+done
+
+exit 0
diff --git a/nx-X11/config/util/mkshadow/Imakefile b/nx-X11/config/util/mkshadow/Imakefile
new file mode 100644
index 000000000..e8a879d97
--- /dev/null
+++ b/nx-X11/config/util/mkshadow/Imakefile
@@ -0,0 +1,5 @@
+XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:41:53 cpqbld Exp $
+ SRCS = mkshadow.c savedir.c wildmat.c
+ OBJS = mkshadow.o savedir.o wildmat.o
+
+ComplexProgramTarget(mkshadow)
diff --git a/nx-X11/config/util/mkshadow/README b/nx-X11/config/util/mkshadow/README
new file mode 100644
index 000000000..eea4b8b89
--- /dev/null
+++ b/nx-X11/config/util/mkshadow/README
@@ -0,0 +1,38 @@
+The mkshadow programs makes a "shadow tree" of a directory tree.
+It logically copies all of the "MASTER" directory into ".".
+However, ordinary files, and RCS/SCCS directories are "copied"
+by creating a sybolic link to the corresponding file in MASTER.
+
+The wildmat.c file is by Rich Salz, and from comp.sources.misc, volume 17.
+The savedir.c file is lightly modified from the version written
+by David MacKenzie for GNU fileutils; the Free Software Foundation
+has graciously agreed to waive their usual copyright so this
+program can be distributed by the X Consortium.
+
+If you have problems compiling savedir.c, try setting the DIRENT make
+variable as suggested in the Makefile.
+
+ * Usage: mkshadow [-X exclude_file] [-x exclude_pattern] ... MASTER
+ * Makes the current directory be a "shadow copy" of MASTER.
+ * Sort of like a recursive copy of MASTER to .
+ * However, symbolic links are used instead of actually
+ * copying (non-directory) files.
+ * Also, directories named RCS or SCCS are shared (with a symbolic link).
+ * Warning messages are printed for files (and directories) in .
+ * that don't match a corresponding file in MASTER (though
+ * symbolic links are silently removed).
+ * Also, a warning message is printed for non-directory files
+ * under . that are not symbolic links.
+ *
+ * Files and directories can be excluded from the sharing
+ * with the -X and -x flags. The flag `-x pattern' (or `-xpattern')
+ * means that mkshadow should ignore any file whose name matches
+ * the pattern. The pattern is a "globbing" pattern, i.e. the
+ * characters *?[^-] are interpreted as by the shell.
+ * If the pattern contains a '/' is is matched against the complete
+ * current path (relative to '.'); otherwise, it is matched
+ * against the last component of the path.
+ * A `-X filename' flag means to read a set of exclusion patterns
+ * from the named file, one pattern to a line.
+
+Author: Per Bothner. bothner@cygnus.com. November 1990, 1993.
diff --git a/nx-X11/config/util/mkshadow/mkshadow.c b/nx-X11/config/util/mkshadow/mkshadow.c
new file mode 100644
index 000000000..d9c5eb841
--- /dev/null
+++ b/nx-X11/config/util/mkshadow/mkshadow.c
@@ -0,0 +1,378 @@
+/* $Xorg: mkshadow.c,v 1.3 2000/08/17 19:41:53 cpqbld Exp $ */
+/* mkshadow.c - make a "shadow copy" of a directory tree with symlinks.
+ Copyright 1990, 1993 Free Software Foundation, Inc.
+
+ Permission to use, copy, modify, and distribute this program for
+ any purpose and without fee is hereby granted, provided that this
+ copyright and permission notice appear on all copies, and that
+ notice be given that copying and distribution is by permission of
+ the Free Software Foundation. The Free Software Foundation makes
+ no representations about the suitability of this software for any
+ purpose. It is provided "as is" without expressed or implied
+ warranty.
+
+ (The FSF has modified its usual distribution terms, for this file,
+ as a courtesy to the X project.) */
+
+/*
+ * Usage: mkshadow [-X exclude_file] [-x exclude_pattern] ... MASTER [SHADOW]
+ * Makes SHADOW be a "shadow copy" of MASTER. SHADOW defaults to the current
+ * directory. Sort of like a recursive copy of MASTER to SHADOW.
+ * However, symbolic links are used instead of actually
+ * copying (non-directory) files.
+ * Also, directories named RCS or SCCS are shared (with a symbolic link).
+ * Warning messages are printed for files (and directories) in .
+ * that don't match a corresponding file in MASTER (though
+ * symbolic links are silently removed).
+ * Also, a warning message is printed for non-directory files
+ * under SHADOW that are not symbolic links.
+ *
+ * Files and directories can be excluded from the sharing
+ * with the -X and -x flags. The flag `-x pattern' (or `-xpattern')
+ * means that mkshadow should ignore any file whose name matches
+ * the pattern. The pattern is a "globbing" pattern, i.e. the
+ * characters *?[^-] are interpreted as by the shell.
+ * If the pattern contains a '/' is is matched against the complete
+ * current path (relative to '.'); otherwise, it is matched
+ * against the last component of the path.
+ * A `-X filename' flag means to read a set of exclusion patterns
+ * from the named file, one pattern to a line.
+ *
+ * Originally written by Per Bothner at University of Wisconsin-Madison,
+ * inspired by the lndir script distributed with X11.
+ * Modified by Per Bothner <bothner@cygnus.com> November 1993
+ * to more-or-less follow Posix.
+ */
+
+#include <sys/types.h>
+#include <stdio.h>
+#ifdef BSD
+#include <strings.h>
+#define strchr index
+#else
+#include <string.h>
+#endif
+#include <sys/stat.h>
+#if defined(S_IFDIR) && !defined(S_ISDIR)
+#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
+#endif
+#if defined(S_IFLNK) && !defined(S_ISLNK)
+#define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
+#endif
+#ifndef S_ISLNK
+#define lstat stat
+#endif
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+#include <errno.h>
+#ifndef errno
+extern int errno;
+#endif
+
+extern char * savedir();
+
+fatal(msg)
+ char *msg;
+{
+ if (errno) perror(msg ? msg : "");
+ else if (msg) fprintf(stderr, "mkshadow: %s\n", msg);
+ exit(-1);
+}
+
+/* When handling symbolic links to relative directories,
+ * we need to prepend "../" to the "source".
+ * We preallocate MAX_DEPTH repetations of "../" using a simple trick.
+ */
+#define MAX_DEPTH 20
+#define PREPEND_BUFFER_SIZE (MAX_DEPTH*3)
+char master_buffer[MAXPATHLEN+PREPEND_BUFFER_SIZE] =
+ "../../../../../../../../../../../../../../../../../../../../";
+/* The logical start of the master_buffer is defined by
+ * master_start, which skips the fixed prepend area.
+ */
+#define master_start (master_buffer+PREPEND_BUFFER_SIZE)
+char shadow_buffer[MAXPATHLEN];
+
+void bad_args(msg)
+{
+ if (msg) fprintf(stderr, "%s\n", msg);
+ fprintf (stderr, "usage: mkshadow [-X exclude_file] [-x exclude_pattern]");
+ fprintf (stderr, " master [shadow]\n");
+ exit(-1);
+}
+
+int exclude_count = 0;
+char **exclude_patterns = NULL;
+int exclude_limit = 0;
+
+void add_exclude(pattern)
+ char *pattern;
+{
+ if (exclude_limit == 0) {
+ exclude_limit = 100;
+ exclude_patterns = (char**)malloc(exclude_limit * sizeof(char*));
+ } else if (exclude_count + 1 >= exclude_limit) {
+ exclude_limit += 100;
+ exclude_patterns = (char**)realloc(exclude_patterns,
+ exclude_limit * sizeof(char*));
+ }
+ exclude_patterns[exclude_count] = pattern;
+ exclude_count++;
+}
+
+void add_exclude_file(name)
+ char *name;
+{
+ char buf[MAXPATHLEN];
+ FILE *file = fopen(name, "r");
+ if (file == NULL) fatal("failed to find -X (exclude) file");
+ for (;;) {
+ int len;
+ char *str = fgets(buf, MAXPATHLEN, file);
+ if (str == NULL) break;
+ len = strlen(str);
+ if (len && str[len-1] == '\n') str[--len] = 0;
+ if (!len) continue;
+ str = (char*)malloc(len+1);
+ strcpy(str, buf);
+ add_exclude(str);
+ }
+ fclose(file);
+}
+
+main(argc, argv)
+ char **argv;
+{
+ char *master_name = NULL;
+ char *shadow_name = NULL;
+ int i;
+ for (i = 1; i < argc; i++) {
+ if (argv[i][0] == '-') {
+ switch(argv[i][1]) {
+ case 'X':
+ if (argv[i][2]) add_exclude_file(&argv[i][2]);
+ else if (++i >= argc) bad_args(NULL);
+ else add_exclude_file(argv[i]);
+ break;
+ case 'x':
+ if (argv[i][2]) add_exclude(&argv[i][2]);
+ else if (++i >= argc) bad_args(NULL);
+ else add_exclude(argv[i]);
+ break;
+ default:
+ bad_args(NULL);
+ }
+ } else if (master_name == NULL)
+ master_name = argv[i];
+ else if (shadow_name == NULL)
+ shadow_name = argv[i];
+ else bad_args (NULL);
+ }
+
+ if (master_name == NULL) bad_args(NULL);
+ if (shadow_name == NULL)
+ shadow_name = ".";
+ else if ((shadow_name[0] != '.' || shadow_name[1])
+ && master_name[0] != '/') {
+ fprintf(stderr, "Shadowing a relative directory pathname to a \n");
+ fprintf(stderr, "shadow other than '.' is not supported!\n");
+ exit(-1);
+ }
+ strcpy(shadow_buffer, shadow_name);
+ strcpy(master_start, master_name);
+ DoCopy(master_start, shadow_buffer, 0);
+ return 0;
+}
+
+int compare_strings(ptr1, ptr2)
+ char **ptr1, **ptr2;
+{
+ return strcmp(*ptr1, *ptr2);
+}
+
+void MakeLink(master, current, depth)
+ char *master;
+ char *current;
+ int depth;
+{
+ if (master[0] != '/') {
+ /* Source directory was specified with a relative pathname. */
+ if (master != master_start) {
+ fatal("Internal bug: bad string buffer use");
+ }
+ /* Pre-pend "../" depth times. This compensates for
+ * the directories we've entered. */
+ master -= 3 * depth;
+ }
+ if (symlink(master, current)) {
+ fprintf(stderr, "Failed to create symbolic link %s->%s\n",
+ current, master);
+ exit (-1);
+ }
+}
+
+
+/* Get a sorted NULL_terminator array of (char*) using 'names'
+ * (created by save_dir) as data.
+ */
+char ** get_name_pointers(names)
+ char *names;
+{
+ int n_names = 0;
+ int names_buf_size = 64;
+ char *namep;
+ char ** pointers = (char**)malloc(names_buf_size * sizeof(char*));
+ if (!names || !pointers) fatal("virtual memory exhausted");
+
+ for (namep = names; *namep; namep += strlen(namep) + 1) {
+ if (n_names + 1 >= names_buf_size) {
+ names_buf_size *= 2;
+ pointers = (char**)realloc(pointers,
+ names_buf_size * sizeof(char*));
+ if (!pointers) fatal("virtual memory exhausted");
+ }
+ pointers[n_names++] = namep;
+ }
+ pointers[n_names] = 0;
+ qsort(pointers, n_names, sizeof(char*), compare_strings);
+ return pointers;
+}
+
+/* Recursively shadow the directory whose name is in MASTER
+ * (which is == MASTER_START) into the destination directory named CURRENT.
+ */
+
+DoCopy(master, current, depth)
+ char *master; /* The source directory. */
+ char *current; /* The destination directory. */
+ int depth;
+{
+ struct stat stat_master, stat_current;
+ char **master_pointer, **current_pointer;
+ char **master_names, **current_names;
+ char *master_end, *current_end;
+ char *master_name_buf, *current_name_buf;
+ master_end = master + strlen(master);
+ current_end = current + strlen(current);
+
+ /* Get rid of terminal '/' */
+ if (master_end[-1] == '/' && master != master_end - 1)
+ *--master_end = 0;
+ if (current_end[-1] == '/' && current != current_end - 1)
+ *--current_end = 0;
+
+ if (depth >= MAX_DEPTH) {
+ fprintf(stderr,
+ "Nesting too deep (depth %d at %s). Probable circularity.\n",
+ depth, master);
+ exit(-1);
+ }
+
+ master_name_buf = savedir(master, 500);
+ if (master_name_buf == NULL) {
+ fprintf(stderr, "Not enough memory or no such directory: %s\n",
+ master);
+ exit(-1);
+ }
+ current_name_buf = savedir(current, 500);
+ if (current_name_buf == NULL) {
+ fprintf(stderr, "Not enough memory or no such directory: %s\n",
+ current);
+ exit(-1);
+ }
+
+ master_names = get_name_pointers(master_name_buf);
+ current_names = get_name_pointers(current_name_buf);
+
+ master_pointer = master_names;
+ current_pointer = current_names;
+ for (;;) {
+ int cmp, ipat;
+ int in_master, in_current;
+ char *cur_name;
+ if (*master_pointer == NULL && *current_pointer == NULL)
+ break;
+ if (*master_pointer == NULL) cmp = 1;
+ else if (*current_pointer == NULL) cmp = -1;
+ else cmp = strcmp(*master_pointer, *current_pointer);
+ if (cmp < 0) { /* file only exists in master directory */
+ in_master = 1; in_current = 0;
+ } else if (cmp == 0) { /* file exists in both directories */
+ in_master = 1; in_current = 1;
+ } else { /* file only exists in current directory */
+ in_current = 1; in_master = 0;
+ }
+ cur_name = in_master ? *master_pointer : *current_pointer;
+ sprintf(master_end, "/%s", cur_name);
+ sprintf(current_end, "/%s", cur_name);
+ for (ipat = 0; ipat < exclude_count; ipat++) {
+ char *pat = exclude_patterns[ipat];
+ char *cur;
+ if (strchr(pat, '/')) cur = current + 2; /* Skip initial "./" */
+ else cur = cur_name;
+ if (wildmat(cur, pat)) goto skip;
+ }
+ if (in_master)
+ if (lstat(master, &stat_master) != 0) fatal("stat failed");
+ if (in_current)
+ if (lstat(current, &stat_current) != 0) fatal("stat failed");
+ if (in_current && !in_master) {
+ if (S_ISLNK(stat_current.st_mode))
+ if (unlink(current)) {
+ fprintf(stderr, "Failed to remove symbolic link %s.\n",
+ current);
+ }
+ else
+ fprintf(stderr, "Removed symbolic link %s.\n",
+ current);
+ else {
+ fprintf(stderr,
+ "The file %s does not exist in the master tree.\n",
+ current);
+ }
+ }
+ else if (S_ISDIR(stat_master.st_mode)
+ && strcmp(cur_name, "RCS") != 0
+ && strcmp(cur_name, "SCCS") != 0) {
+ if (!in_current) {
+ if (mkdir(current, 0775)) fatal("mkdir failed");
+ }
+ else if (stat(current, &stat_current)) fatal("stat failed");
+ if (!in_current || stat_current.st_dev != stat_master.st_dev
+ || stat_current.st_ino != stat_master.st_ino)
+ DoCopy(master, current, depth+1);
+ else
+ fprintf(stderr, "Link %s is the same as directory %s.\n",
+ current, master);
+ }
+ else {
+ if (!in_current)
+ MakeLink(master, current, depth);
+ else if (!S_ISLNK(stat_current.st_mode)) {
+ fprintf(stderr, "Existing file %s is not a symbolic link.\n",
+ current);
+ } else {
+ if (stat(current, &stat_current) || stat(master, &stat_master))
+ fatal("stat failed");
+ if (stat_current.st_dev != stat_master.st_dev
+ || stat_current.st_ino != stat_master.st_ino) {
+ fprintf(stderr, "Fixing incorrect symbolic link %s.\n",
+ current);
+ if (unlink(current)) {
+ fprintf(stderr, "Failed to remove symbolic link %s.\n",
+ current);
+ }
+ else
+ MakeLink(master, current, depth);
+ }
+ }
+ }
+ skip:
+ if (in_master) master_pointer++;
+ if (in_current) current_pointer++;
+ }
+
+ free(master_names); free(current_names);
+ free(master_name_buf); free(current_name_buf);
+}
diff --git a/nx-X11/config/util/mkshadow/savedir.c b/nx-X11/config/util/mkshadow/savedir.c
new file mode 100644
index 000000000..6629f5a8d
--- /dev/null
+++ b/nx-X11/config/util/mkshadow/savedir.c
@@ -0,0 +1,119 @@
+/* $Xorg: savedir.c,v 1.3 2000/08/17 19:41:53 cpqbld Exp $ */
+/* savedir.c -- save the list of files in a directory in a string
+ Copyright 1990, 1993 Free Software Foundation, Inc.
+
+ Permission to use, copy, modify, and distribute this program for
+ any purpose and without fee is hereby granted, provided that this
+ copyright and permission notice appear on all copies, and that
+ notice be given that copying and distribution is by permission of
+ the Free Software Foundation. The Free Software Foundation makes
+ no representations about the suitability of this software for any
+ purpose. It is provided "as is" without expressed or implied
+ warranty.
+
+ (The FSF has modified its usual distribution terms, for this file,
+ as a courtesy to the X project.) */
+
+/* $XFree86$ */
+
+/* Written by David MacKenzie <djm@ai.mit.edu>.
+ Modified to use <dirent.h> by default. Per Bothner <bothner@cygnus.com>. */
+
+#include <sys/types.h>
+#if !defined(DIRECT) && !defined(BSD)
+#include <dirent.h>
+#define NLENGTH(direct) (strlen((direct)->d_name))
+#else
+#undef dirent
+#define dirent direct
+#define NLENGTH(direct) ((direct)->d_namlen)
+#ifdef BSD
+#include <sys/dir.h>
+#else
+#ifdef SYSNDIR
+#include <sys/ndir.h>
+#else
+#include <ndir.h>
+#endif
+#endif
+#endif
+
+#if defined(VOID_CLOSEDIR) || defined(BSD)
+/* Fake a return value. */
+#define CLOSEDIR(d) (closedir (d), 0)
+#else
+#define CLOSEDIR(d) closedir (d)
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <stddef.h>
+
+char *stpcpy ();
+
+/* Return a freshly allocated string containing the filenames
+ in directory DIR, separated by '\0' characters;
+ the end is marked by two '\0' characters in a row.
+ NAME_SIZE is the number of bytes to initially allocate
+ for the string; it will be enlarged as needed.
+ Return NULL if DIR cannot be opened or if out of memory. */
+
+char *
+savedir (dir, name_size)
+ char *dir;
+ unsigned name_size;
+{
+ DIR *dirp;
+ struct dirent *dp;
+ char *name_space;
+ char *namep;
+
+ dirp = opendir (dir);
+ if (dirp == NULL)
+ return NULL;
+
+ name_space = (char *) malloc (name_size);
+ if (name_space == NULL)
+ {
+ closedir (dirp);
+ return NULL;
+ }
+ namep = name_space;
+
+ while ((dp = readdir (dirp)) != NULL)
+ {
+ /* Skip "." and ".." (some NFS filesystems' directories lack them). */
+ if (dp->d_name[0] != '.'
+ || (dp->d_name[1] != '\0'
+ && (dp->d_name[1] != '.' || dp->d_name[2] != '\0')))
+ {
+ unsigned size_needed = (namep - name_space) + NLENGTH (dp) + 2;
+
+ if (size_needed > name_size)
+ {
+ char *new_name_space;
+
+ while (size_needed > name_size)
+ name_size += 1024;
+
+ new_name_space = realloc (name_space, name_size);
+ if (new_name_space == NULL)
+ {
+ closedir (dirp);
+ return NULL;
+ }
+ namep += new_name_space - name_space;
+ name_space = new_name_space;
+ }
+ strcpy (namep, dp->d_name);
+ namep += strlen (namep) + 1;
+ }
+ }
+ *namep = '\0';
+ if (CLOSEDIR (dirp))
+ {
+ free (name_space);
+ return NULL;
+ }
+ return name_space;
+}
diff --git a/nx-X11/config/util/mkshadow/wildmat.c b/nx-X11/config/util/mkshadow/wildmat.c
new file mode 100644
index 000000000..8e0c179eb
--- /dev/null
+++ b/nx-X11/config/util/mkshadow/wildmat.c
@@ -0,0 +1,167 @@
+/* $Xorg: wildmat.c,v 1.3 2000/08/17 19:41:53 cpqbld Exp $ */
+/*
+**
+** Do shell-style pattern matching for ?, \, [], and * characters.
+** Might not be robust in face of malformed patterns; e.g., "foo[a-"
+** could cause a segmentation violation. It is 8bit clean.
+**
+** Written by Rich $alz, mirror!rs, Wed Nov 26 19:03:17 EST 1986.
+** Rich $alz is now <rsalz@bbn.com>.
+** April, 1991: Replaced mutually-recursive calls with in-line code
+** for the star character.
+**
+** Special thanks to Lars Mathiesen <thorinn@diku.dk> for the ABORT code.
+** This can greatly speed up failing wildcard patterns. For example:
+** pattern: -*-*-*-*-*-*-12-*-*-*-m-*-*-*
+** text 1: -adobe-courier-bold-o-normal--12-120-75-75-m-70-iso8859-1
+** text 2: -adobe-courier-bold-o-normal--12-120-75-75-X-70-iso8859-1
+** Text 1 matches with 51 calls, while text 2 fails with 54 calls. Without
+** the ABORT, then it takes 22310 calls to fail. Ugh. The following
+** explanation is from Lars:
+** The precondition that must be fulfilled is that DoMatch will consume
+** at least one character in text. This is true if *p is neither '*' nor
+** '\0'.) The last return has ABORT instead of FALSE to avoid quadratic
+** behaviour in cases like pattern "*a*b*c*d" with text "abcxxxxx". With
+** FALSE, each star-loop has to run to the end of the text; with ABORT
+** only the last one does.
+**
+** Once the control of one instance of DoMatch enters the star-loop, that
+** instance will return either TRUE or ABORT, and any calling instance
+** will therefore return immediately after (without calling recursively
+** again). In effect, only one star-loop is ever active. It would be
+** possible to modify the code to maintain this context explicitly,
+** eliminating all recursive calls at the cost of some complication and
+** loss of clarity (and the ABORT stuff seems to be unclear enough by
+** itself). I think it would be unwise to try to get this into a
+** released version unless you have a good test data base to try it out
+** on.
+*/
+
+#define TRUE 1
+#define FALSE 0
+#define ABORT -1
+
+
+ /* What character marks an inverted character class? */
+#define NEGATE_CLASS '^'
+ /* Is "*" a common pattern? */
+#define OPTIMIZE_JUST_STAR
+ /* Do tar(1) matching rules, which ignore a trailing slash? */
+#undef MATCH_TAR_PATTERN
+
+
+/*
+** Match text and p, return TRUE, FALSE, or ABORT.
+*/
+static int
+DoMatch(text, p)
+ register char *text;
+ register char *p;
+{
+ register int last;
+ register int matched;
+ register int reverse;
+
+ for ( ; *p; text++, p++) {
+ if (*text == '\0' && *p != '*')
+ return ABORT;
+ switch (*p) {
+ case '\\':
+ /* Literal match with following character. */
+ p++;
+ /* FALLTHROUGH */
+ default:
+ if (*text != *p)
+ return FALSE;
+ continue;
+ case '?':
+ /* Match anything. */
+ continue;
+ case '*':
+ while (*++p == '*')
+ /* Consecutive stars act just like one. */
+ continue;
+ if (*p == '\0')
+ /* Trailing star matches everything. */
+ return TRUE;
+ while (*text)
+ if ((matched = DoMatch(text++, p)) != FALSE)
+ return matched;
+ return ABORT;
+ case '[':
+ reverse = p[1] == NEGATE_CLASS ? TRUE : FALSE;
+ if (reverse)
+ /* Inverted character class. */
+ p++;
+ for (last = 0400, matched = FALSE; *++p && *p != ']'; last = *p)
+ /* This next line requires a good C compiler. */
+ if (*p == '-' ? *text <= *++p && *text >= last : *text == *p)
+ matched = TRUE;
+ if (matched == reverse)
+ return FALSE;
+ continue;
+ }
+ }
+
+#ifdef MATCH_TAR_PATTERN
+ if (*text == '/')
+ return TRUE;
+#endif /* MATCH_TAR_ATTERN */
+ return *text == '\0';
+}
+
+
+/*
+** User-level routine. Returns TRUE or FALSE.
+*/
+int
+wildmat(text, p)
+ char *text;
+ char *p;
+{
+#ifdef OPTIMIZE_JUST_STAR
+ if (p[0] == '*' && p[1] == '\0')
+ return TRUE;
+#endif /* OPTIMIZE_JUST_STAR */
+ return DoMatch(text, p) == TRUE;
+}
+
+
+
+#ifdef TEST
+#include <stdio.h>
+
+/* Yes, we use gets not fgets. Sue me. */
+extern char *gets();
+
+
+main()
+{
+ char p[80];
+ char text[80];
+
+ printf("Wildmat tester. Enter pattern, then strings to test.\n");
+ printf("A blank line gets prompts for a new pattern; a blank pattern\n");
+ printf("exits the program.\n");
+
+ for ( ; ; ) {
+ printf("\nEnter pattern: ");
+ (void)fflush(stdout);
+ if (gets(p) == NULL || p[0] == '\0')
+ break;
+ for ( ; ; ) {
+ printf("Enter text: ");
+ (void)fflush(stdout);
+ if (gets(text) == NULL)
+ exit(0);
+ if (text[0] == '\0')
+ /* Blank line; go back and get a new pattern. */
+ break;
+ printf(" %s\n", wildmat(text, p) ? "YES" : "NO");
+ }
+ }
+
+ exit(0);
+ /* NOTREACHED */
+}
+#endif /* TEST */
diff --git a/nx-X11/config/util/printver.c b/nx-X11/config/util/printver.c
new file mode 100644
index 000000000..2dbca7457
--- /dev/null
+++ b/nx-X11/config/util/printver.c
@@ -0,0 +1,29 @@
+
+/*
+ * A simple program to make it possible to print the XFree86 version and
+ * date info as defined in xf86Version.h and xf86Date.h very early in the
+ * build process.
+ */
+
+/* $XFree86: xc/config/util/printver.c,v 1.2 2003/02/26 09:21:33 dawes Exp $ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "xf86Version.h"
+#include "xf86Date.h"
+
+int
+main()
+{
+#ifdef XF86_VERSION_MAJOR
+ printf(" version %d.%d.%d", XF86_VERSION_MAJOR, XF86_VERSION_MINOR,
+ XF86_VERSION_PATCH);
+ if (XF86_VERSION_SNAP != 0)
+ printf(".%d", XF86_VERSION_SNAP);
+#ifdef XF86_DATE
+ printf(" (%s)", XF86_DATE);
+#endif
+#endif
+ exit(0);
+}
+
diff --git a/nx-X11/config/util/revpath.c b/nx-X11/config/util/revpath.c
new file mode 100644
index 000000000..db88393cb
--- /dev/null
+++ b/nx-X11/config/util/revpath.c
@@ -0,0 +1,47 @@
+/*
+ * Copyright 1999 by The XFree86 Project, Inc.
+ */
+/* $XFree86: xc/config/util/revpath.c,v 1.2 1999/02/01 11:55:49 dawes Exp $ */
+
+/*
+ * Reverse a pathname. It returns a relative path that can be used to undo
+ * 'cd argv[1]'.
+ *
+ * It is impossible to do this in general, but this handles the cases that
+ * come up in imake. Maybe imake should use an absolute path for $(TOP)
+ * instead of a relative path so that this problem can be avoided?
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ int levels = 0;
+ char *p;
+
+ /* Silently ignore invalid usage */
+ if (argc != 2)
+ exit(0);
+
+ /* Split the path and count the levels */
+ p = strtok(argv[1], "/");
+ while (p) {
+ if (strcmp(p, ".") == 0)
+ ;
+ else if (strcmp(p, "..") == 0)
+ levels--;
+ else
+ levels++;
+ p = strtok(NULL, "/");
+ }
+
+ while (levels-- > 0)
+ printf("../");
+
+ printf("\n");
+
+ exit(0);
+}
diff --git a/nx-X11/config/util/revpath.man b/nx-X11/config/util/revpath.man
new file mode 100644
index 000000000..5b9cace15
--- /dev/null
+++ b/nx-X11/config/util/revpath.man
@@ -0,0 +1,45 @@
+.\" $XFree86: xc/config/util/revpath.man,v 1.1 1999/01/03 03:58:14 dawes Exp $
+.TH REVPATH 1 __vendorversion__
+.SH NAME
+revpath \- generate a relative path that can be used to undo a change-directory
+.SH SYNOPSIS
+.B revpath
+.I path
+.SH DESCRIPTION
+The
+.I revpath
+program prints out a relative path that is the ``reverse'' or ``inverse'' of
+.IR path .
+Start with two directories
+.I top
+and
+.IR bottom ,
+with the latter below the former, and
+.I path
+is the location of
+.I bottom
+relative to
+.IR top .
+The output of
+.I revpath
+is the location of
+.I top
+relative to
+.IR bottom .
+The resulting path contains a trailing `/' character when the result is
+non-trivial.
+If
+.I path
+is equivalent to `.', the resulting output is empty.
+If
+.I path
+is invalid in some way (e.g., doesn't represent the path to a subdirectory)
+the output is also empty and no error messages are ever generated.
+.SH DIAGNOSTICS
+There are no diagnostics. Error conditions are silently ignored, and the
+exit status is always 0.
+.SH BUGS
+It isn't possible to reverse arbitrary relative paths.
+If any path element between the two end points of
+.I path
+is a symbolic link, the results will probably be incorrect.
diff --git a/nx-X11/config/util/syminst.sh b/nx-X11/config/util/syminst.sh
new file mode 100644
index 000000000..f9e1863d5
--- /dev/null
+++ b/nx-X11/config/util/syminst.sh
@@ -0,0 +1,90 @@
+#!/bin/sh
+
+#
+# syminst - install with a symbolic link back to the build tree
+#
+
+# set DOITPROG to echo to test this script
+
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+lnprog="${LNPROG-ln -s}"
+rmprog="${RMPROG-rm}"
+
+instcmd="$lnprog"
+rmcmd="$rmprog -f"
+srcdir=`pwd`/
+src=""
+dst=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) shift
+ continue;;
+
+ -m) shift
+ shift
+ continue;;
+
+ -o) shift
+ shift
+ continue;;
+
+ -g) shift
+ shift
+ continue;;
+
+ -s) shift
+ continue;;
+
+ -DIR) srcdir=`echo $2 | sed 's;/\./;/;g'`/
+ shift
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "syminst: no input file specified"
+ exit 1
+fi
+
+if [ x"$dst" = x ]
+then
+ echo "syminst: no destination specified"
+ exit 1
+fi
+
+
+# if destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+if [ -d $dst ]
+then
+ dst="$dst"/`basename $src`
+fi
+
+case $src in
+ /*) srcdir=""
+ instcmd=cp;;
+esac
+
+# get rid of the old one and mode the new one in
+
+$doit $rmcmd $dst
+$doit $instcmd $srcdir$src $dst
+
+exit 0
diff --git a/nx-X11/config/util/x11mf.sh b/nx-X11/config/util/x11mf.sh
new file mode 100644
index 000000000..2c44194d5
--- /dev/null
+++ b/nx-X11/config/util/x11mf.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+#
+# generate a Makefile within the build tree
+#
+# usage: x11mf [treedir]
+#
+
+if [ x$1 != x ]; then
+ tree=$1
+else
+ tree=/x11
+fi
+
+dir=`pwd`
+top=`(cd $tree; /bin/pwd)`
+intree=no
+
+case $dir in
+ $top*) intree=yes;;
+esac
+
+if [ $intree != yes ]; then
+ echo "$0: Must be underneath $tree"
+ exit 1
+fi
+
+(cd ..; make SUBDIRS=`basename $dir` Makefiles)
diff --git a/nx-X11/config/util/xmake.cmd b/nx-X11/config/util/xmake.cmd
new file mode 100644
index 000000000..24e14947f
--- /dev/null
+++ b/nx-X11/config/util/xmake.cmd
@@ -0,0 +1,5 @@
+/* REXX */
+/* $XFree86: xc/config/util/xmake.cmd,v 3.0 1996/01/24 21:56:17 dawes Exp $ */
+'@echo off'
+PARSE ARG a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
+x11make.exe 'MAKE=x11make.exe SHELL=' a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
diff --git a/nx-X11/config/util/xmkmf.cpp b/nx-X11/config/util/xmkmf.cpp
new file mode 100644
index 000000000..3d03bde3f
--- /dev/null
+++ b/nx-X11/config/util/xmkmf.cpp
@@ -0,0 +1,70 @@
+XCOMM!/bin/sh
+
+XCOMM $XFree86: xc/config/util/xmkmf.cpp,v 1.3 2000/11/06 21:57:10 dawes Exp $
+XCOMM
+XCOMM make a Makefile from an Imakefile from inside or outside the sources
+XCOMM
+XCOMM $Xorg: xmkmf.cpp,v 1.3 2000/08/17 19:41:53 cpqbld Exp $
+
+usage="usage: $0 [-a] [top_of_sources_pathname [current_directory]]"
+
+configdirspec=CONFIGDIRSPEC
+topdir=
+curdir=.
+do_all=
+imake_defines=
+
+while [ $# -gt 0 ]
+do
+ case "$1" in
+ -D*)
+ imake_defines="$imake_defines $1"
+ shift
+ ;;
+ -a)
+ do_all="yes"
+ shift
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
+
+case $# in
+ 0) ;;
+ 1) topdir=$1 ;;
+ 2) topdir=$1 curdir=$2 ;;
+ *) echo "$usage" 1>&2; exit 1 ;;
+esac
+
+case "$topdir" in
+ -*) echo "$usage" 1>&2; exit 1 ;;
+esac
+
+if [ -f Makefile ]; then
+ echo mv -f Makefile Makefile.bak
+ mv -f Makefile Makefile.bak
+fi
+
+if [ "$topdir" = "" ]; then
+ args="-DUseInstalled "$configdirspec
+else
+ args="-I$topdir/config/cf -DTOPDIR=$topdir -DCURDIR=$curdir"
+fi
+
+echo imake $imake_defines $args
+case "$do_all" in
+yes)
+ imake $imake_defines $args &&
+ echo "make Makefiles" &&
+ make Makefiles &&
+ echo "make includes" &&
+ make includes &&
+ echo "make depend" &&
+ make depend
+ ;;
+*)
+ imake $imake_defines $args
+ ;;
+esac
diff --git a/nx-X11/config/util/xmkmf.man b/nx-X11/config/util/xmkmf.man
new file mode 100644
index 000000000..8a4f234dd
--- /dev/null
+++ b/nx-X11/config/util/xmkmf.man
@@ -0,0 +1,89 @@
+.\" $Xorg: xmkmf.man,v 1.4 2001/02/09 02:03:17 xorgcvs Exp $
+.\" Copyright (c) 1993, 1994, 1998 The Open Group
+.\"
+.\" 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
+.\" dealing in this Software without prior written authorization from The
+.\" Open Group.
+.\"
+.\" $XFree86: xc/config/util/xmkmf.man,v 1.2 2001/01/27 18:19:55 dawes Exp $
+.\"
+.TH XMKMF 1 __xorgversion__
+.SH NAME
+xmkmf \- create a Makefile from an Imakefile
+.SH SYNOPSIS
+.B xmkmf
+[ -a ] [
+.I topdir
+[
+.I curdir
+] ]
+.SH DESCRIPTION
+The
+.I xmkmf
+command is the normal way to create a
+.I Makefile
+from an
+.I Imakefile
+shipped with third-party software.
+.PP
+When invoked with no arguments in a directory containing an
+.I Imakefile,
+the
+.I imake
+program is run with arguments appropriate for your system
+(configured into
+.I xmkmf
+when X was built) and generates a
+.I Makefile.
+.PP
+When invoked with the
+.I \-a
+option,
+.I xmkmf
+builds the
+.I Makefile
+in the current directory, and then automatically executes
+``make Makefiles'' (in case there are subdirectories),
+``make includes'',
+and ``make depend'' for you.
+This is the normal way to configure software that is outside
+the X Consortium build tree.
+.PP
+If working inside the X Consortium build tree (unlikely unless you
+are an X developer, and even then this option is never really used), the
+.I topdir
+argument should be specified as the relative pathname from the
+current directory to the top of the build tree. Optionally,
+.I curdir
+may be specified as a relative pathname from the top of the build
+tree to the current directory. It is necessary to supply
+.I curdir
+if the current directory has subdirectories, or the
+.I Makefile
+will not be able to build the subdirectories.
+If a
+.I topdir
+is given,
+.I xmkmf
+assumes nothing is installed on your system and looks for files in
+the build tree instead of using the installed versions.
+.SH "SEE ALSO"
+imake(1)